@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
140 lines (121 loc) • 198 kB
JavaScript
"use strict";var ep=Object.create;var To=Object.defineProperty,op=Object.defineProperties,np=Object.getOwnPropertyDescriptor,tp=Object.getOwnPropertyDescriptors,rp=Object.getOwnPropertyNames,$o=Object.getOwnPropertySymbols,ap=Object.getPrototypeOf,Bn=Object.prototype.hasOwnProperty,br=Object.prototype.propertyIsEnumerable;var yr=(e,o,n)=>o in e?To(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,y=(e,o)=>{for(var n in o||(o={}))Bn.call(o,n)&&yr(e,n,o[n]);if($o)for(var n of $o(o))br.call(o,n)&&yr(e,n,o[n]);return e},I=(e,o)=>op(e,tp(o));var Vo=(e,o)=>{var n={};for(var r in e)Bn.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$o)for(var r of $o(e))o.indexOf(r)<0&&br.call(e,r)&&(n[r]=e[r]);return n};var w=(e,o)=>()=>(e&&(o=e(e=0)),o);var jo=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),Ae=(e,o)=>{for(var n in o)To(e,n,{get:o[n],enumerable:!0})},Sr=(e,o,n,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of rp(o))!Bn.call(e,i)&&i!==n&&To(e,i,{get:()=>o[i],enumerable:!(r=np(o,i))||r.enumerable});return e};var b=(e,o,n)=>(n=e!=null?ep(ap(e)):{},Sr(o||!e||!e.__esModule?To(n,"default",{value:e,enumerable:!0}):n,e)),xo=e=>Sr(To({},"__esModule",{value:!0}),e);var k=(e,o,n)=>new Promise((r,i)=>{var s=_=>{try{g(n.next(_))}catch(u){i(u)}},m=_=>{try{g(n.throw(_))}catch(u){i(u)}},g=_=>_.done?r(_.value):Promise.resolve(_.value).then(s,m);g((n=n.apply(e,o)).next())});var kr=jo(zo=>{"use strict";t();zo.byteLength=cp;zo.toByteArray=sp;zo.fromByteArray=lp;var ce=[],ne=[],ip=typeof Uint8Array!="undefined"?Uint8Array:Array,Un="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ee=0,wr=Un.length;Ee<wr;++Ee)ce[Ee]=Un[Ee],ne[Un.charCodeAt(Ee)]=Ee;var Ee,wr;ne["-".charCodeAt(0)]=62;ne["_".charCodeAt(0)]=63;function vr(e){var o=e.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=o);var r=n===o?0:4-n%4;return[n,r]}function cp(e){var o=vr(e),n=o[0],r=o[1];return(n+r)*3/4-r}function pp(e,o,n){return(o+n)*3/4-n}function sp(e){var o,n=vr(e),r=n[0],i=n[1],s=new ip(pp(e,r,i)),m=0,g=i>0?r-4:r,_;for(_=0;_<g;_+=4)o=ne[e.charCodeAt(_)]<<18|ne[e.charCodeAt(_+1)]<<12|ne[e.charCodeAt(_+2)]<<6|ne[e.charCodeAt(_+3)],s[m++]=o>>16&255,s[m++]=o>>8&255,s[m++]=o&255;return i===2&&(o=ne[e.charCodeAt(_)]<<2|ne[e.charCodeAt(_+1)]>>4,s[m++]=o&255),i===1&&(o=ne[e.charCodeAt(_)]<<10|ne[e.charCodeAt(_+1)]<<4|ne[e.charCodeAt(_+2)]>>2,s[m++]=o>>8&255,s[m++]=o&255),s}function mp(e){return ce[e>>18&63]+ce[e>>12&63]+ce[e>>6&63]+ce[e&63]}function dp(e,o,n){for(var r,i=[],s=o;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),i.push(mp(r));return i.join("")}function lp(e){for(var o,n=e.length,r=n%3,i=[],s=16383,m=0,g=n-r;m<g;m+=s)i.push(dp(e,m,m+s>g?g:m+s));return r===1?(o=e[n-1],i.push(ce[o>>2]+ce[o<<4&63]+"==")):r===2&&(o=(e[n-2]<<8)+e[n-1],i.push(ce[o>>10]+ce[o>>4&63]+ce[o<<2&63]+"=")),i.join("")}});var Ir=jo(Wn=>{t();Wn.read=function(e,o,n,r,i){var s,m,g=i*8-r-1,_=(1<<g)-1,u=_>>1,h=-7,f=n?i-1:0,x=n?-1:1,T=e[o+f];for(f+=x,s=T&(1<<-h)-1,T>>=-h,h+=g;h>0;s=s*256+e[o+f],f+=x,h-=8);for(m=s&(1<<-h)-1,s>>=-h,h+=r;h>0;m=m*256+e[o+f],f+=x,h-=8);if(s===0)s=1-u;else{if(s===_)return m?NaN:(T?-1:1)*(1/0);m=m+Math.pow(2,r),s=s-u}return(T?-1:1)*m*Math.pow(2,s-r)};Wn.write=function(e,o,n,r,i,s){var m,g,_,u=s*8-i-1,h=(1<<u)-1,f=h>>1,x=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=r?0:s-1,v=r?1:-1,P=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(g=isNaN(o)?1:0,m=h):(m=Math.floor(Math.log(o)/Math.LN2),o*(_=Math.pow(2,-m))<1&&(m--,_*=2),m+f>=1?o+=x/_:o+=x*Math.pow(2,1-f),o*_>=2&&(m++,_/=2),m+f>=h?(g=0,m=h):m+f>=1?(g=(o*_-1)*Math.pow(2,i),m=m+f):(g=o*Math.pow(2,f-1)*Math.pow(2,i),m=0));i>=8;e[n+T]=g&255,T+=v,g/=256,i-=8);for(m=m<<i|g,u+=i;u>0;e[n+T]=m&255,T+=v,m/=256,u-=8);e[n+T-v]|=P*128}});var Ur=jo(He=>{"use strict";t();var Gn=kr(),Ge=Ir(),Ar=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;He.Buffer=l;He.SlowBuffer=Tp;He.INSPECT_MAX_BYTES=50;var qo=2147483647;He.kMaxLength=qo;l.TYPED_ARRAY_SUPPORT=_p();!l.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function _p(){try{var e=new Uint8Array(1),o={foo:function(){return 42}};return Object.setPrototypeOf(o,Uint8Array.prototype),Object.setPrototypeOf(e,o),e.foo()===42}catch(n){return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(!!l.isBuffer(this))return this.buffer}});Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(!!l.isBuffer(this))return this.byteOffset}});function he(e){if(e>qo)throw new RangeError('The value "'+e+'" is invalid for option "size"');var o=new Uint8Array(e);return Object.setPrototypeOf(o,l.prototype),o}function l(e,o,n){if(typeof e=="number"){if(typeof o=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return jn(e)}return Lr(e,o,n)}l.poolSize=8192;function Lr(e,o,n){if(typeof e=="string")return up(e,o);if(ArrayBuffer.isView(e))return fp(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(pe(e,ArrayBuffer)||e&&pe(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(pe(e,SharedArrayBuffer)||e&&pe(e.buffer,SharedArrayBuffer)))return $n(e,o,n);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return l.from(r,o,n);var i=hp(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return l.from(e[Symbol.toPrimitive]("string"),o,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}l.from=function(e,o,n){return Lr(e,o,n)};Object.setPrototypeOf(l.prototype,Uint8Array.prototype);Object.setPrototypeOf(l,Uint8Array);function Dr(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function gp(e,o,n){return Dr(e),e<=0?he(e):o!==void 0?typeof n=="string"?he(e).fill(o,n):he(e).fill(o):he(e)}l.alloc=function(e,o,n){return gp(e,o,n)};function jn(e){return Dr(e),he(e<0?0:zn(e)|0)}l.allocUnsafe=function(e){return jn(e)};l.allocUnsafeSlow=function(e){return jn(e)};function up(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!l.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=Nr(e,o)|0,r=he(n),i=r.write(e,o);return i!==n&&(r=r.slice(0,i)),r}function Hn(e){for(var o=e.length<0?0:zn(e.length)|0,n=he(o),r=0;r<o;r+=1)n[r]=e[r]&255;return n}function fp(e){if(pe(e,Uint8Array)){var o=new Uint8Array(e);return $n(o.buffer,o.byteOffset,o.byteLength)}return Hn(e)}function $n(e,o,n){if(o<0||e.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<o+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return o===void 0&&n===void 0?r=new Uint8Array(e):n===void 0?r=new Uint8Array(e,o):r=new Uint8Array(e,o,n),Object.setPrototypeOf(r,l.prototype),r}function hp(e){if(l.isBuffer(e)){var o=zn(e.length)|0,n=he(o);return n.length===0||e.copy(n,0,0,o),n}if(e.length!==void 0)return typeof e.length!="number"||qn(e.length)?he(0):Hn(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Hn(e.data)}function zn(e){if(e>=qo)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+qo.toString(16)+" bytes");return e|0}function Tp(e){return+e!=e&&(e=0),l.alloc(+e)}l.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==l.prototype};l.compare=function(o,n){if(pe(o,Uint8Array)&&(o=l.from(o,o.offset,o.byteLength)),pe(n,Uint8Array)&&(n=l.from(n,n.offset,n.byteLength)),!l.isBuffer(o)||!l.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(o===n)return 0;for(var r=o.length,i=n.length,s=0,m=Math.min(r,i);s<m;++s)if(o[s]!==n[s]){r=o[s],i=n[s];break}return r<i?-1:i<r?1:0};l.isEncoding=function(o){switch(String(o).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};l.concat=function(o,n){if(!Array.isArray(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return l.alloc(0);var r;if(n===void 0)for(n=0,r=0;r<o.length;++r)n+=o[r].length;var i=l.allocUnsafe(n),s=0;for(r=0;r<o.length;++r){var m=o[r];if(pe(m,Uint8Array))s+m.length>i.length?l.from(m).copy(i,s):Uint8Array.prototype.set.call(i,m,s);else if(l.isBuffer(m))m.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=m.length}return i};function Nr(e,o){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||pe(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;for(var i=!1;;)switch(o){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Vn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Br(e).length;default:if(i)return r?-1:Vn(e).length;o=(""+o).toLowerCase(),i=!0}}l.byteLength=Nr;function xp(e,o,n){var r=!1;if((o===void 0||o<0)&&(o=0),o>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,o>>>=0,n<=o))return"";for(e||(e="utf8");;)switch(e){case"hex":return Cp(this,o,n);case"utf8":case"utf-8":return Mr(this,o,n);case"ascii":return Ap(this,o,n);case"latin1":case"binary":return Ep(this,o,n);case"base64":return kp(this,o,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lp(this,o,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}l.prototype._isBuffer=!0;function Ce(e,o,n){var r=e[o];e[o]=e[n],e[n]=r}l.prototype.swap16=function(){var o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<o;n+=2)Ce(this,n,n+1);return this};l.prototype.swap32=function(){var o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<o;n+=4)Ce(this,n,n+3),Ce(this,n+1,n+2);return this};l.prototype.swap64=function(){var o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<o;n+=8)Ce(this,n,n+7),Ce(this,n+1,n+6),Ce(this,n+2,n+5),Ce(this,n+3,n+4);return this};l.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?Mr(this,0,o):xp.apply(this,arguments)};l.prototype.toLocaleString=l.prototype.toString;l.prototype.equals=function(o){if(!l.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:l.compare(this,o)===0};l.prototype.inspect=function(){var o="",n=He.INSPECT_MAX_BYTES;return o=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(o+=" ... "),"<Buffer "+o+">"};Ar&&(l.prototype[Ar]=l.prototype.inspect);l.prototype.compare=function(o,n,r,i,s){if(pe(o,Uint8Array)&&(o=l.from(o,o.offset,o.byteLength)),!l.isBuffer(o))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof o);if(n===void 0&&(n=0),r===void 0&&(r=o?o.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),n<0||r>o.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&n>=r)return 0;if(i>=s)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,i>>>=0,s>>>=0,this===o)return 0;for(var m=s-i,g=r-n,_=Math.min(m,g),u=this.slice(i,s),h=o.slice(n,r),f=0;f<_;++f)if(u[f]!==h[f]){m=u[f],g=h[f];break}return m<g?-1:g<m?1:0};function Pr(e,o,n,r,i){if(e.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,qn(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof o=="string"&&(o=l.from(o,r)),l.isBuffer(o))return o.length===0?-1:Er(e,o,n,r,i);if(typeof o=="number")return o=o&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,o,n):Uint8Array.prototype.lastIndexOf.call(e,o,n):Er(e,[o],n,r,i);throw new TypeError("val must be string, number or Buffer")}function Er(e,o,n,r,i){var s=1,m=e.length,g=o.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(e.length<2||o.length<2)return-1;s=2,m/=2,g/=2,n/=2}function _(T,v){return s===1?T[v]:T.readUInt16BE(v*s)}var u;if(i){var h=-1;for(u=n;u<m;u++)if(_(e,u)===_(o,h===-1?0:u-h)){if(h===-1&&(h=u),u-h+1===g)return h*s}else h!==-1&&(u-=u-h),h=-1}else for(n+g>m&&(n=m-g),u=n;u>=0;u--){for(var f=!0,x=0;x<g;x++)if(_(e,u+x)!==_(o,x)){f=!1;break}if(f)return u}return-1}l.prototype.includes=function(o,n,r){return this.indexOf(o,n,r)!==-1};l.prototype.indexOf=function(o,n,r){return Pr(this,o,n,r,!0)};l.prototype.lastIndexOf=function(o,n,r){return Pr(this,o,n,r,!1)};function yp(e,o,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var s=o.length;r>s/2&&(r=s/2);for(var m=0;m<r;++m){var g=parseInt(o.substr(m*2,2),16);if(qn(g))return m;e[n+m]=g}return m}function bp(e,o,n,r){return Ko(Vn(o,e.length-n),e,n,r)}function Sp(e,o,n,r){return Ko(Pp(o),e,n,r)}function wp(e,o,n,r){return Ko(Br(o),e,n,r)}function vp(e,o,n,r){return Ko(Mp(o,e.length-n),e,n,r)}l.prototype.write=function(o,n,r,i){if(n===void 0)i="utf8",r=this.length,n=0;else if(r===void 0&&typeof n=="string")i=n,r=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(r)?(r=r>>>0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-n;if((r===void 0||r>s)&&(r=s),o.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var m=!1;;)switch(i){case"hex":return yp(this,o,n,r);case"utf8":case"utf-8":return bp(this,o,n,r);case"ascii":case"latin1":case"binary":return Sp(this,o,n,r);case"base64":return wp(this,o,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vp(this,o,n,r);default:if(m)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),m=!0}};l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function kp(e,o,n){return o===0&&n===e.length?Gn.fromByteArray(e):Gn.fromByteArray(e.slice(o,n))}function Mr(e,o,n){n=Math.min(e.length,n);for(var r=[],i=o;i<n;){var s=e[i],m=null,g=s>239?4:s>223?3:s>191?2:1;if(i+g<=n){var _,u,h,f;switch(g){case 1:s<128&&(m=s);break;case 2:_=e[i+1],(_&192)===128&&(f=(s&31)<<6|_&63,f>127&&(m=f));break;case 3:_=e[i+1],u=e[i+2],(_&192)===128&&(u&192)===128&&(f=(s&15)<<12|(_&63)<<6|u&63,f>2047&&(f<55296||f>57343)&&(m=f));break;case 4:_=e[i+1],u=e[i+2],h=e[i+3],(_&192)===128&&(u&192)===128&&(h&192)===128&&(f=(s&15)<<18|(_&63)<<12|(u&63)<<6|h&63,f>65535&&f<1114112&&(m=f))}}m===null?(m=65533,g=1):m>65535&&(m-=65536,r.push(m>>>10&1023|55296),m=56320|m&1023),r.push(m),i+=g}return Ip(r)}var Cr=4096;function Ip(e){var o=e.length;if(o<=Cr)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<o;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Cr));return n}function Ap(e,o,n){var r="";n=Math.min(e.length,n);for(var i=o;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function Ep(e,o,n){var r="";n=Math.min(e.length,n);for(var i=o;i<n;++i)r+=String.fromCharCode(e[i]);return r}function Cp(e,o,n){var r=e.length;(!o||o<0)&&(o=0),(!n||n<0||n>r)&&(n=r);for(var i="",s=o;s<n;++s)i+=Rp[e[s]];return i}function Lp(e,o,n){for(var r=e.slice(o,n),i="",s=0;s<r.length-1;s+=2)i+=String.fromCharCode(r[s]+r[s+1]*256);return i}l.prototype.slice=function(o,n){var r=this.length;o=~~o,n=n===void 0?r:~~n,o<0?(o+=r,o<0&&(o=0)):o>r&&(o=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n<o&&(n=o);var i=this.subarray(o,n);return Object.setPrototypeOf(i,l.prototype),i};function H(e,o,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+o>n)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||H(o,n,this.length);for(var i=this[o],s=1,m=0;++m<n&&(s*=256);)i+=this[o+m]*s;return i};l.prototype.readUintBE=l.prototype.readUIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||H(o,n,this.length);for(var i=this[o+--n],s=1;n>0&&(s*=256);)i+=this[o+--n]*s;return i};l.prototype.readUint8=l.prototype.readUInt8=function(o,n){return o=o>>>0,n||H(o,1,this.length),this[o]};l.prototype.readUint16LE=l.prototype.readUInt16LE=function(o,n){return o=o>>>0,n||H(o,2,this.length),this[o]|this[o+1]<<8};l.prototype.readUint16BE=l.prototype.readUInt16BE=function(o,n){return o=o>>>0,n||H(o,2,this.length),this[o]<<8|this[o+1]};l.prototype.readUint32LE=l.prototype.readUInt32LE=function(o,n){return o=o>>>0,n||H(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216};l.prototype.readUint32BE=l.prototype.readUInt32BE=function(o,n){return o=o>>>0,n||H(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])};l.prototype.readIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||H(o,n,this.length);for(var i=this[o],s=1,m=0;++m<n&&(s*=256);)i+=this[o+m]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*n)),i};l.prototype.readIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||H(o,n,this.length);for(var i=n,s=1,m=this[o+--i];i>0&&(s*=256);)m+=this[o+--i]*s;return s*=128,m>=s&&(m-=Math.pow(2,8*n)),m};l.prototype.readInt8=function(o,n){return o=o>>>0,n||H(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]};l.prototype.readInt16LE=function(o,n){o=o>>>0,n||H(o,2,this.length);var r=this[o]|this[o+1]<<8;return r&32768?r|4294901760:r};l.prototype.readInt16BE=function(o,n){o=o>>>0,n||H(o,2,this.length);var r=this[o+1]|this[o]<<8;return r&32768?r|4294901760:r};l.prototype.readInt32LE=function(o,n){return o=o>>>0,n||H(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24};l.prototype.readInt32BE=function(o,n){return o=o>>>0,n||H(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]};l.prototype.readFloatLE=function(o,n){return o=o>>>0,n||H(o,4,this.length),Ge.read(this,o,!0,23,4)};l.prototype.readFloatBE=function(o,n){return o=o>>>0,n||H(o,4,this.length),Ge.read(this,o,!1,23,4)};l.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||H(o,8,this.length),Ge.read(this,o,!0,52,8)};l.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||H(o,8,this.length),Ge.read(this,o,!1,52,8)};function Y(e,o,n,r,i,s){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>i||o<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(o,n,r,i){if(o=+o,n=n>>>0,r=r>>>0,!i){var s=Math.pow(2,8*r)-1;Y(this,o,n,r,s,0)}var m=1,g=0;for(this[n]=o&255;++g<r&&(m*=256);)this[n+g]=o/m&255;return n+r};l.prototype.writeUintBE=l.prototype.writeUIntBE=function(o,n,r,i){if(o=+o,n=n>>>0,r=r>>>0,!i){var s=Math.pow(2,8*r)-1;Y(this,o,n,r,s,0)}var m=r-1,g=1;for(this[n+m]=o&255;--m>=0&&(g*=256);)this[n+m]=o/g&255;return n+r};l.prototype.writeUint8=l.prototype.writeUInt8=function(o,n,r){return o=+o,n=n>>>0,r||Y(this,o,n,1,255,0),this[n]=o&255,n+1};l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||Y(this,o,n,2,65535,0),this[n]=o&255,this[n+1]=o>>>8,n+2};l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||Y(this,o,n,2,65535,0),this[n]=o>>>8,this[n+1]=o&255,n+2};l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||Y(this,o,n,4,4294967295,0),this[n+3]=o>>>24,this[n+2]=o>>>16,this[n+1]=o>>>8,this[n]=o&255,n+4};l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||Y(this,o,n,4,4294967295,0),this[n]=o>>>24,this[n+1]=o>>>16,this[n+2]=o>>>8,this[n+3]=o&255,n+4};l.prototype.writeIntLE=function(o,n,r,i){if(o=+o,n=n>>>0,!i){var s=Math.pow(2,8*r-1);Y(this,o,n,r,s-1,-s)}var m=0,g=1,_=0;for(this[n]=o&255;++m<r&&(g*=256);)o<0&&_===0&&this[n+m-1]!==0&&(_=1),this[n+m]=(o/g>>0)-_&255;return n+r};l.prototype.writeIntBE=function(o,n,r,i){if(o=+o,n=n>>>0,!i){var s=Math.pow(2,8*r-1);Y(this,o,n,r,s-1,-s)}var m=r-1,g=1,_=0;for(this[n+m]=o&255;--m>=0&&(g*=256);)o<0&&_===0&&this[n+m+1]!==0&&(_=1),this[n+m]=(o/g>>0)-_&255;return n+r};l.prototype.writeInt8=function(o,n,r){return o=+o,n=n>>>0,r||Y(this,o,n,1,127,-128),o<0&&(o=255+o+1),this[n]=o&255,n+1};l.prototype.writeInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||Y(this,o,n,2,32767,-32768),this[n]=o&255,this[n+1]=o>>>8,n+2};l.prototype.writeInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||Y(this,o,n,2,32767,-32768),this[n]=o>>>8,this[n+1]=o&255,n+2};l.prototype.writeInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||Y(this,o,n,4,2147483647,-2147483648),this[n]=o&255,this[n+1]=o>>>8,this[n+2]=o>>>16,this[n+3]=o>>>24,n+4};l.prototype.writeInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||Y(this,o,n,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),this[n]=o>>>24,this[n+1]=o>>>16,this[n+2]=o>>>8,this[n+3]=o&255,n+4};function Rr(e,o,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Fr(e,o,n,r,i){return o=+o,n=n>>>0,i||Rr(e,o,n,4,34028234663852886e22,-34028234663852886e22),Ge.write(e,o,n,r,23,4),n+4}l.prototype.writeFloatLE=function(o,n,r){return Fr(this,o,n,!0,r)};l.prototype.writeFloatBE=function(o,n,r){return Fr(this,o,n,!1,r)};function Or(e,o,n,r,i){return o=+o,n=n>>>0,i||Rr(e,o,n,8,17976931348623157e292,-17976931348623157e292),Ge.write(e,o,n,r,52,8),n+8}l.prototype.writeDoubleLE=function(o,n,r){return Or(this,o,n,!0,r)};l.prototype.writeDoubleBE=function(o,n,r){return Or(this,o,n,!1,r)};l.prototype.copy=function(o,n,r,i){if(!l.isBuffer(o))throw new TypeError("argument should be a Buffer");if(r||(r=0),!i&&i!==0&&(i=this.length),n>=o.length&&(n=o.length),n||(n=0),i>0&&i<r&&(i=r),i===r||o.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),o.length-n<i-r&&(i=o.length-n+r);var s=i-r;return this===o&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,r,i):Uint8Array.prototype.set.call(o,this.subarray(r,i),n),s};l.prototype.fill=function(o,n,r,i){if(typeof o=="string"){if(typeof n=="string"?(i=n,n=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(o.length===1){var s=o.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(o=s)}}else typeof o=="number"?o=o&255:typeof o=="boolean"&&(o=Number(o));if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;n=n>>>0,r=r===void 0?this.length:r>>>0,o||(o=0);var m;if(typeof o=="number")for(m=n;m<r;++m)this[m]=o;else{var g=l.isBuffer(o)?o:l.from(o,i),_=g.length;if(_===0)throw new TypeError('The value "'+o+'" is invalid for argument "value"');for(m=0;m<r-n;++m)this[m+n]=g[m%_]}return this};var Dp=/[^+/0-9A-Za-z-_]/g;function Np(e){if(e=e.split("=")[0],e=e.trim().replace(Dp,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Vn(e,o){o=o||1/0;for(var n,r=e.length,i=null,s=[],m=0;m<r;++m){if(n=e.charCodeAt(m),n>55295&&n<57344){if(!i){if(n>56319){(o-=3)>-1&&s.push(239,191,189);continue}else if(m+1===r){(o-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(o-=3)>-1&&s.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(o-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((o-=1)<0)break;s.push(n)}else if(n<2048){if((o-=2)<0)break;s.push(n>>6|192,n&63|128)}else if(n<65536){if((o-=3)<0)break;s.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((o-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return s}function Pp(e){for(var o=[],n=0;n<e.length;++n)o.push(e.charCodeAt(n)&255);return o}function Mp(e,o){for(var n,r,i,s=[],m=0;m<e.length&&!((o-=2)<0);++m)n=e.charCodeAt(m),r=n>>8,i=n%256,s.push(i),s.push(r);return s}function Br(e){return Gn.toByteArray(Np(e))}function Ko(e,o,n,r){for(var i=0;i<r&&!(i+n>=o.length||i>=e.length);++i)o[i+n]=e[i];return i}function pe(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function qn(e){return e!==e}var Rp=function(){for(var e="0123456789abcdef",o=new Array(256),n=0;n<16;++n)for(var r=n*16,i=0;i<16;++i)o[r+i]=e[n]+e[i];return o}()});var Vr=jo((fd,$r)=>{t();var B=$r.exports={},se,me;function Kn(){throw new Error("setTimeout has not been defined")}function Xn(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?se=setTimeout:se=Kn}catch(e){se=Kn}try{typeof clearTimeout=="function"?me=clearTimeout:me=Xn}catch(e){me=Xn}})();function Wr(e){if(se===setTimeout)return setTimeout(e,0);if((se===Kn||!se)&&setTimeout)return se=setTimeout,setTimeout(e,0);try{return se(e,0)}catch(o){try{return se.call(null,e,0)}catch(n){return se.call(this,e,0)}}}function Fp(e){if(me===clearTimeout)return clearTimeout(e);if((me===Xn||!me)&&clearTimeout)return me=clearTimeout,clearTimeout(e);try{return me(e)}catch(o){try{return me.call(null,e)}catch(n){return me.call(this,e)}}}var Te=[],$e=!1,Le,Xo=-1;function Op(){!$e||!Le||($e=!1,Le.length?Te=Le.concat(Te):Xo=-1,Te.length&&Gr())}function Gr(){if(!$e){var e=Wr(Op);$e=!0;for(var o=Te.length;o;){for(Le=Te,Te=[];++Xo<o;)Le&&Le[Xo].run();Xo=-1,o=Te.length}Le=null,$e=!1,Fp(e)}}B.nextTick=function(e){var o=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)o[n-1]=arguments[n];Te.push(new Hr(e,o)),Te.length===1&&!$e&&Wr(Gr)};function Hr(e,o){this.fun=e,this.array=o}Hr.prototype.run=function(){this.fun.apply(null,this.array)};B.title="browser";B.browser=!0;B.env={};B.argv=[];B.version="";B.versions={};function xe(){}B.on=xe;B.addListener=xe;B.once=xe;B.off=xe;B.removeListener=xe;B.removeAllListeners=xe;B.emit=xe;B.prependListener=xe;B.prependOnceListener=xe;B.listeners=function(e){return[]};B.binding=function(e){throw new Error("process.binding is not supported")};B.cwd=function(){return"/"};B.chdir=function(e){throw new Error("process.chdir is not supported")};B.umask=function(){return 0}});var a,c,hd,t=w(()=>{a=b(Ur()),c=b(Vr()),hd=function(e){function o(){var r=this||self;return delete e.prototype.__magic__,r}if(typeof globalThis=="object")return globalThis;if(this)return o();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:o});var n=__magic__;return n}(Object)});var Yo,Yn=w(()=>{"use strict";t();Yo=()=>Date.now()/1e3});var jr=w(()=>{"use strict";t()});var zr=w(()=>{"use strict";t()});var Zn=w(()=>{"use strict";t();Yn();jr();zr()});var Qn={};Ae(Qn,{getItem:()=>Wp,localStorageKeys:()=>ve,removeItem:()=>Gp,setItem:()=>Up});var ve,Jn,Up,Wp,Gp,Ve=w(()=>{"use strict";t();Zn();ve={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Jn=typeof localStorage!="undefined",Up=({key:e,data:o,expires:n})=>{!Jn||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},Wp=e=>{if(!Jn)return;let o=localStorage.getItem(String(e));if(!o)return null;let n=JSON.parse(o);return!n||!n.hasOwnProperty("expires")||!n.hasOwnProperty("data")?null:Yo()>=n.expires?(localStorage.removeItem(String(e)),null):n.data},Gp=e=>{!Jn||localStorage.removeItem(String(e))}});var et={};Ae(et,{clear:()=>Yr,getItem:()=>Kr,removeItem:()=>Xr,setItem:()=>qr,storage:()=>Hp});var qr,Kr,Xr,Yr,Hp,Zr=w(()=>{"use strict";t();qr=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},Kr=e=>{let o=sessionStorage.getItem(String(e));if(!o)return null;let n=JSON.parse(o);return!n||!n.hasOwnProperty("expires")||!n.hasOwnProperty("data")?null:Date.now()>=n.expires?(sessionStorage.removeItem(String(e)),null):n.data},Xr=e=>sessionStorage.removeItem(String(e)),Yr=()=>sessionStorage.clear(),Hp={setItem:qr,getItem:Kr,removeItem:Xr,clear:Yr}});var De,je=w(()=>{"use strict";t();Ve();Zr();De={session:et,local:Qn}});function yo(){return new Date().setHours(new Date().getHours()+24)}function bo(e){De.local.setItem({key:ve.loginExpiresAt,data:e,expires:e})}var ot=w(()=>{"use strict";t();je();Ve()});var F=w(()=>{"use strict";t()});var nt,ze=w(()=>{"use strict";t();nt="Transaction canceled"});var Jr=w(()=>{"use strict";t()});var q=w(()=>{"use strict";t()});var Qr=w(()=>{"use strict";t()});var ea=w(()=>{"use strict";t()});var oa=w(()=>{"use strict";t()});var na=w(()=>{"use strict";t()});var J=w(()=>{"use strict";t();Jr();q();F();Qr();ea();oa();na()});var tt,ta,zd,ra,qd,aa,Kd,Xd,Yd,ia=w(()=>{"use strict";t();J();tt={devnet:{id:"devnet",chainId:"D",name:"Devnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://devnet-wallet.elrond.com",apiAddress:"https://devnet-api.elrond.com",explorerAddress:"http://devnet-explorer.elrond.com",apiTimeout:"4000"},testnet:{id:"testnet",chainId:"T",name:"Testnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://testnet-wallet.elrond.com",apiAddress:"https://testnet-api.elrond.com",explorerAddress:"http://testnet-explorer.elrond.com",apiTimeout:"4000"},mainnet:{id:"mainnet",chainId:"1",name:"Mainnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://wallet.elrond.com",apiAddress:"https://api.elrond.com",explorerAddress:"https://explorer.elrond.com",apiTimeout:"4000"}},{chainId:ta,egldLabel:zd}=tt["devnet"],{chainId:ra,egldLabel:qd}=tt["testnet"],{chainId:aa,egldLabel:Kd}=tt["mainnet"],Xd={["devnet"]:ta,["testnet"]:ra,["mainnet"]:aa},Yd={[ta]:"devnet",[ra]:"testnet",[aa]:"mainnet"}});var rt,at=w(()=>{"use strict";t();rt={36864:{code:"codeSuccess",message:"Success"},27013:{code:"ERR_USER_DENIED",message:"Rejected by user"},27904:{code:"ERR_UNKNOWN_INSTRUCTION",message:"Unknown instruction"},28160:{code:"ERR_WRONG_CLA",message:"Wrong CLA"},28161:{code:"ERR_INVALID_ARGUMENTS",message:"Invalid arguments"},28162:{code:"ERR_INVALID_MESSAGE",message:"Invalid message"},28163:{code:"ERR_INVALID_P1",message:"Invalid P1"},28164:{code:"ERR_MESSAGE_TOO_LONG",message:"Message too long"},28165:{code:"ERR_RECEIVER_TOO_LONG",message:"Receiver too long"},28166:{code:"ERR_AMOUNT_TOO_LONG",message:"Amount too long"},28167:{code:"ERR_CONTRACT_DATA_DISABLED",message:"Contract data disabled in app options"},28168:{code:"ERR_MESSAGE_INCOMPLETE",message:"Message incomplete"},28176:{code:"ERR_SIGNATURE_FAILED",message:"Signature failed"},28169:{code:"ERR_WRONG_TX_VERSION",message:"Wrong TX version"},28170:{code:"ERR_NONCE_TOO_LONG",message:"Nonce too long"},28171:{code:"ERR_INVALID_AMOUNT",message:"Invalid amount"},28172:{code:"ERR_INVALID_FEE",message:"Invalid fee"},28173:{code:"ERR_PRETTY_FAILED",message:"Pretty failed"},28174:{code:"ERR_DATA_TOO_LONG",message:"Data too long"},28175:{code:"ERR_WRONG_TX_OPTIONS",message:"Invalid transaction options"},28177:{code:"ERR_SIGN_TX_DEPRECATED",message:"Regular transaction signing is deprecated in this version. Use hash signing."}}});var ca=w(()=>{"use strict";t()});var So,it=w(()=>{"use strict";t();So="transaction-status-toast-id"});var wo,Zo,de,Jo,pa,sa,Qo,en,ma,da,Ne,N=w(()=>{"use strict";t();ze();ia();at();ca();it();wo=5e4,Zo=1e9,de=18,Jo=4,pa=1,sa="/dapp/init",Qo="signSession",en="logout",ma="login",da="N/A",Ne="0"});var ct,K,ye,Z=w(()=>{"use strict";t();ct=require("@reduxjs/toolkit");N();K=(0,ct.createAction)(en),ye=(0,ct.createAction)(ma,e=>({payload:e}))});var _a,la,ga,gl,ua,$p,vo,fa,Vp,ha,Ta,pt=w(()=>{"use strict";t();_a=require("@reduxjs/toolkit");ot();F();Z();la={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},ga=(0,_a.createSlice)({name:"loginInfoSlice",initialState:la,reducers:{setLoginMethod:(e,o)=>{e.loginMethod=o.payload},setTokenLogin:(e,o)=>{e.tokenLogin=o.payload},setTokenLoginSignature:(e,o)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=o.payload)},setWalletLogin:(e,o)=>{e.walletLogin=o.payload},setWalletConnectLogin:(e,o)=>{e.walletConnectLogin=o.payload},setLedgerLogin:(e,o)=>{e.ledgerLogin=o.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0}},extraReducers:e=>{e.addCase(K,()=>la),e.addCase(ye,(o,n)=>{o.loginMethod=n.payload.loginMethod,bo(yo())})}}),{setLoginMethod:gl,setWalletConnectLogin:ua,setLedgerLogin:$p,setTokenLogin:vo,setTokenLoginSignature:fa,setWalletLogin:Vp,invalidateLoginSession:ha}=ga.actions,Ta=ga.reducer});var jp,on,ko=w(()=>{"use strict";t();jp=!1,on=(e,o=0)=>{jp||setTimeout(()=>{window.location.href=e},o)}});var xa=w(()=>{"use strict";t();ko()});function st(e){return e[Math.floor(Math.random()*e.length)]}var ya=w(()=>{"use strict";t()});function mt(e){let o=null;if((e==null?void 0:e.statusCode)in rt){let n=e==null?void 0:e.statusCode,{message:r}=rt[n];o=Kp.includes(n)?ba:r}return{errorMessage:o,defaultErrorMessage:ba}}var ba,zp,qp,Kp,dt=w(()=>{"use strict";t();at();ba="Check if Elrond app is open on Ledger",zp=28161,qp=28160,Kp=[zp,qp]});var qe=w(()=>{"use strict";t();xa();ya();dt()});var Sa,wa,lt,Xp,va,El,Cl,ka,_t=w(()=>{"use strict";t();Sa=require("@reduxjs/toolkit"),wa=b(require("lodash.omit"));qe();lt={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Xp={network:lt,chainID:"-1"},va=(0,Sa.createSlice)({name:"appConfig",initialState:Xp,reducers:{initializeNetworkConfig:(e,o)=>{let n=st(o.payload.walletConnectBridgeAddresses),r=st(o.payload.walletConnectV2RelayAddresses),i=(0,wa.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=I(y(y({},e.network),i),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(e,o)=>{e.chainID=o.payload}}}),{initializeNetworkConfig:El,setChainID:Cl}=va.actions,ka=va.reducer});var ut,Ia,Aa,nn,gt,Ea,ft,Ol,ht,Bl,Yp,Zp,Ul,Wl,Gl,Jp,Ca,Tt=w(()=>{"use strict";t();ut=require("@elrondnetwork/erdjs"),Ia=require("@reduxjs/toolkit"),Aa=require("redux-persist");N();je();Ve();Z();nn={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Ne},gt={address:"",websocketEvent:null,accounts:{"":nn},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Ea=(0,Ia.createSlice)({name:"accountInfoSlice",initialState:gt,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new ut.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:nn},e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,o)=>{let{address:n}=e;e.accounts[n].nonce=o.payload},setAccountShard:(e,o)=>{e.shard=o.payload},setLedgerAccount:(e,o)=>{e.ledgerAccount=o.payload},updateLedgerAccount:(e,o)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=o.payload.index,e.ledgerAccount.address=o.payload.address)},setWalletConnectAccount:(e,o)=>{e.walletConnectAccount=o.payload},setIsAccountLoading:(e,o)=>{e.isAccountLoading=o.payload,e.accountLoadingError=null},setAccountLoadingError:(e,o)=>{e.accountLoadingError=o.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,o)=>{e.websocketEvent={timestamp:Date.now(),message:o.payload}}},extraReducers:e=>{e.addCase(K,()=>(De.local.removeItem(ve.loginExpiresAt),gt)),e.addCase(ye,(o,n)=>{let{address:r}=n.payload;o.address=r,o.publicKey=new ut.Address(r).hex()}),e.addCase(Aa.REHYDRATE,(o,n)=>{var u;if(!((u=n.payload)!=null&&u.account))return;let{account:r}=n.payload,{address:i,shard:s,accounts:m,publicKey:g}=r;o.address=i,o.shard=s;let _=m&&i in m;o.accounts=_?m:gt.accounts,o.publicKey=g})}}),{setAccount:ft,setAddress:Ol,setAccountNonce:ht,setAccountShard:Bl,setLedgerAccount:Yp,updateLedgerAccount:Zp,setWalletConnectAccount:Ul,setIsAccountLoading:Wl,setAccountLoadingError:Gl,setWebsocketEvent:Jp}=Ea.actions,Ca=Ea.reducer});function Ke(e){return e!=null&&(is(e)||ms(e))}function Xe(e){return e!=null&&(cs(e)||ds(e))}function Ye(e){return e!=null&&(ps(e)||ls(e))}function xt(e){return e!=null&&ss(e)}function is(e){return e!=null&&Qp.includes(e)}function cs(e){return e!=null&&es.includes(e)}function ps(e){return e!=null&&os.includes(e)}function ss(e){return e!=null&&ns.includes(e)}function ms(e){return e!=null&&ts.includes(e)}function ds(e){return e!=null&&rs.includes(e)}function ls(e){return e!=null&&as.includes(e)}var Qp,es,os,ns,ts,rs,as,Ze=w(()=>{"use strict";t();F();Qp=["sent"],es=["success"],os=["fail","cancelled","timedOut"],ns=["timedOut"],ts=["pending"],rs=["success"],as=["fail","invalid"]});var La,Da,Ao,_s,Na,Pa,Ma,gs,Je,us,fs,Yl,Ra,Qe,eo,tn,rn=w(()=>{"use strict";t();La=require("@reduxjs/toolkit"),Da=require("redux-persist");F();Ze();Z();Ao={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},_s={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Na=(0,La.createSlice)({name:"transactionsSlice",initialState:Ao,reducers:{moveTransactionsToSignedState:(e,o)=>{var _,u;let{sessionId:n,transactions:r,errorMessage:i,status:s,redirectRoute:m}=o.payload,g=((_=e.customTransactionInformationForSessionId)==null?void 0:_[n])||_s;e.signedTransactions[n]={transactions:r,status:s,errorMessage:i,redirectRoute:m,customTransactionInformation:g},((u=e==null?void 0:e.transactionsToSign)==null?void 0:u.sessionId)===n&&(e.transactionsToSign=Ao.transactionsToSign)},clearSignedTransaction:(e,o)=>{e.signedTransactions[o.payload]&&delete e.signedTransactions[o.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,o)=>{e.signedTransactions=y(y({},e.signedTransactions),o.payload)},updateSignedTransactions:(e,o)=>{let{sessionId:n,status:r,errorMessage:i,transactions:s}=o.payload;e.signedTransactions[n]!=null&&(e.signedTransactions[n].status=r,i!=null&&(e.signedTransactions[n].errorMessage=i),s!=null&&(e.signedTransactions[n].transactions=s))},updateSignedTransactionStatus:(e,o)=>{var g,_,u,h,f,x;let{sessionId:n,status:r,errorMessage:i,transactionHash:s}=o.payload,m=(_=(g=e.signedTransactions)==null?void 0:g[n])==null?void 0:_.transactions;if(m!=null){e.signedTransactions[n].transactions=m.map(P=>P.hash===s?I(y({},P),{status:r,errorMessage:i}):P);let T=(h=(u=e.signedTransactions[n])==null?void 0:u.transactions)==null?void 0:h.every(P=>Xe(P.status)),v=(x=(f=e.signedTransactions[n])==null?void 0:f.transactions)==null?void 0:x.every(P=>Ye(P.status));T&&(e.signedTransactions[n].status="success"),v&&(e.signedTransactions[n].status="fail")}},setTransactionsToSign:(e,o)=>{e.transactionsToSign=o.payload;let{sessionId:n,customTransactionInformation:r}=o.payload;e.customTransactionInformationForSessionId[n]=r,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=Ao.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Ao.signedTransactions},setSignTransactionsError:(e,o)=>{e.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(e,o)=>{e.signTransactionsCancelMessage=o.payload}},extraReducers:e=>{e.addCase(K,()=>Ao),e.addCase(Da.REHYDRATE,(o,n)=>{var m;if(o.signTransactionsCancelMessage=null,!((m=n.payload)!=null&&m.transactions))return;let{signedTransactions:r,customTransactionInformationForSessionId:i}=n.payload.transactions,s=Object.entries(r).reduce((g,[_,u])=>{let h=new Date(_),f=new Date;return f.setHours(f.getHours()+5),f-h>0||(g[_]=u),g},{});i!=null&&(o.customTransactionInformationForSessionId=i),r!=null&&(o.signedTransactions=s)})}}),{updateSignedTransactionStatus:Pa,updateSignedTransactions:Ma,setTransactionsToSign:gs,clearAllTransactionsToSign:Je,clearAllSignedTransactions:us,clearSignedTransaction:fs,clearTransactionToSign:Yl,setSignTransactionsError:Ra,setSignTransactionsCancelMessage:Qe,moveTransactionsToSignedState:eo}=Na.actions,tn=Na.reducer});var Fa,bt,St,wt,hs,yt,Oa,e_,Ts,Eo,an,cn=w(()=>{"use strict";t();Fa=require("@reduxjs/toolkit");Z();bt="Transaction failed",St="Transaction successful",wt="Processing transaction",hs="Transaction submitted",yt={},Oa=(0,Fa.createSlice)({name:"transactionsInfo",initialState:yt,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:r}=o.payload;n!=null&&(e[n]={errorMessage:(r==null?void 0:r.errorMessage)||bt,successMessage:(r==null?void 0:r.successMessage)||St,processingMessage:(r==null?void 0:r.processingMessage)||wt,submittedMessage:(r==null?void 0:r.submittedMessage)||hs,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(e,o){o.payload!=null&&delete e[o.payload]},clearTransactionsInfo:()=>yt},extraReducers:e=>{e.addCase(K,()=>yt)}}),{clearTransactionsInfo:e_,setTransactionsDisplayInfo:Ts,clearTransactionsInfoForSessionId:Eo}=Oa.actions,an=Oa.reducer});var Ua,Ba,Wa,r_,xs,a_,ys,Ga,vt=w(()=>{"use strict";t();Ua=require("@reduxjs/toolkit");Z();Ba={},Wa=(0,Ua.createSlice)({name:"modalsSlice",initialState:Ba,reducers:{setTxSubmittedModal:(e,o)=>{e.txSubmittedModal=o.payload},setNotificationModal:(e,o)=>{e.notificationModal=o.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(K,()=>Ba)}}),{setTxSubmittedModal:r_,setNotificationModal:xs,clearTxSubmittedModal:a_,clearNotificationModal:ys}=Wa.actions,Ga=Wa.reducer});var $a,Va,Ha,ja,bs,pn,__,g_,u_,f_,sn,mn=w(()=>{"use strict";t();$a=require("@reduxjs/toolkit"),Va=require("redux-persist");it();J();Yn();Z();Ha={customToasts:[],transactionToasts:[],failTransactionToast:null},ja=(0,$a.createSlice)({name:"toastsSlice",initialState:Ha,reducers:{addCustomToast:(e,o)=>{e.customToasts.push(I(y({},o.payload),{type:"custom",toastId:o.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,o)=>{e.customToasts=e.customToasts.filter(n=>n.toastId!==o.payload)},addTransactionToast:(e,o)=>{e.transactionToasts.push({type:"transaction",startTimestamp:Yo(),toastId:o.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,o)=>{e.transactionToasts=e.transactionToasts.filter(n=>n.toastId!==o.payload)},addFailTransactionToast:(e,o)=>{e.failTransactionToast=I(y({},o.payload),{toastId:So})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(K,()=>Ha),e.addCase(Va.REHYDRATE,(o,n)=>{var i,s;let r=(s=(i=n.customToasts)==null?void 0:i.filter(m=>!("component"in m)))!=null?s:[];o.customToasts=r})}}),{addCustomToast:bs,removeCustomToast:pn,addTransactionToast:__,removeTransactionToast:g_,addFailTransactionToast:u_,removeFailTransactionToast:f_}=ja.actions,sn=ja.reducer});var M=w(()=>{"use strict";t();pt();_t();Tt();rn();cn();vt();mn()});var kt=w(()=>{"use strict";t()});var Xa,Ka,Ya,It,F_,O_,B_,U_,Za,Ja,At=w(()=>{"use strict";t();Xa=require("@reduxjs/toolkit");Z();Ka={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Ya=(0,Xa.createSlice)({name:"dappModalsSlice",initialState:Ka,reducers:{setDappModalVisibility:(e,o)=>{e.visible=o.payload},setDappModalHeaderVisibility:(e,o)=>{e.modal.showHeader=o.payload},setDappModalFooterVisibility:(e,o)=>{e.modal.showFooter=o.payload},setDappModalHeaderText:(e,o)=>{e.modal.headerText=o.payload},setDappModalFooterText:(e,o)=>{e.modal.footerText=o.payload},setDappModalConfig:(e,o)=>{e.modal=y({},o.payload)}},extraReducers:e=>{e.addCase(K,()=>Ka)}}),{setDappModalVisibility:It,setDappModalHeaderVisibility:F_,setDappModalFooterVisibility:O_,setDappModalHeaderText:B_,setDappModalFooterText:U_,setDappModalConfig:Za}=Ya.actions,Ja=Ya.reducer});var Qa,ks,Is,oo,ln=w(()=>{"use strict";t();Qa=require("@reduxjs/toolkit");kt();Tt();At();pt();vt();_t();mn();cn();rn();ks={["account"]:Ca,["networkConfig"]:ka,["loginInfo"]:Ta,["modals"]:Ga,["dappModal"]:Ja,["toasts"]:sn,["transactions"]:tn,["transactionsInfo"]:an},Is=(e={})=>(0,Qa.combineReducers)(y(y({},ks),e)),oo=Is});var ni={};Ae(ni,{default:()=>Ps});function Et(e,o=[]){return{key:e,version:1,storage:oi.default,blacklist:o}}var Me,ei,oi,As,Es,Cs,Ls,Ds,Ns,Ps,ti=w(()=>{"use strict";t();Me=require("redux-persist"),ei=b(require("redux-persist/lib/storage")),oi=b(require("redux-persist/lib/storage/session"));ln();M();mn();cn();rn();kt();As={2:e=>I(y({},e),{networkConfig:lt})};Es=Et("dapp-core-transactionsInfo"),Cs=Et("dapp-core-transactions",["transactionsToSign"]),Ls=Et("dapp-core-toasts"),Ds={key:"dapp-core-store",version:2,storage:ei.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,Me.createMigrate)(As,{debug:!1})},Ns={["toasts"]:(0,Me.persistReducer)(Ls,sn),["transactions"]:(0,Me.persistReducer)(Cs,tn),["transactionsInfo"]:(0,Me.persistReducer)(Es,an)},Ps=(0,Me.persistReducer)(Ds,oo(Ns))});var ri={};Ae(ri,{default:()=>Ms});var Ms,ai=w(()=>{"use strict";t();ln();Ms=oo()});var ii={};Ae(ii,{default:()=>Fs});var re,Rs,Fs,ci=w(()=>{"use strict";t();re=require("redux-persist"),Rs=[re.FLUSH,re.REHYDRATE,re.PAUSE,re.PERSIST,re.PURGE,re.REGISTER],Fs=Rs});var mi={};Ae(mi,{default:()=>si});function si(e){return(0,pi.persistStore)(e)}var pi,di=w(()=>{"use strict";t();pi=require("redux-persist")});var dd={};Ae(dd,{SignWithLedgerModal:()=>md});module.exports=xo(dd);t();var Yc=b(require("react"));t();var Pn=b(require("react")),fr=b(require("classnames"));t();var Bp=`.dapp-core-component__main__link-style {
color: #1392ff;
}
.dapp-core-component__main__link-second-style {
color: #9dabbd;
}
.dapp-core-component__main__link-second-style:hover {
color: #1392ff;
}
.dapp-core-component__main__link-second-style:hover svg {
color: #1392ff;
}
.dapp-core-component__main__wrapper {
min-height: 100vh;
}
.dapp-core-component__main__opacity-6 {
opacity: 0.6;
}
.dapp-core-component__main__qr-code-svg-container {
width: 15rem;
height: 15rem;
}
.dapp-core-component__main__pair-list {
max-height: 20rem;
overflow-y: auto;
margin-bottom: -0.5rem;
}
.dapp-core-component__main__pair-image {
width: 4rem;
overflow: hidden;
height: auto;
min-width: 2rem;
}
.dapp-core-component__main__pair-remove {
padding: 0 0.5rem;
position: absolute;
right: 0;
top: 0;
}
.dapp-core-component__main__dapp-icon {
padding: 5px;
border-radius: 50%;
background-color: #fafafa;
width: 4.6428571429rem;
height: 4.6428571429rem;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
}
.dapp-core-component__main__dapp-icon.dapp-core-component__main__icon-medium {
width: 80px;
height: 80px;
}
.dapp-core-component__main__centering {
display: flex;
justify-content: center;
align-items: center;
}
.dapp-core-component__main__border-n {
border: none !important;
}
.dapp-core-component__main__t-shadow {
text-shadow: 0px 4px 7px rgba(0, 0, 0, 0.3);
}
.dapp-core-component__main__btn {
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.04) !important;
}
.dapp-core-component__main__media {
display: flex;
align-items: flex-start;
}
.dapp-core-component__main__media-body {
flex: 1;
}
.dapp-core-component__main__connect-btns .dapp-core-component__main__btn {
display: flex;
height: 48px;
justify-content: center;
align-items: center;
color: #fff !important;
background-color: #1392ff;
padding: 15px 20px 15px 16px;
border-radius: 6px;
gap: 8px;
}
.dapp-core-component__main__connect-btns .dapp-core-component__main__btn:hover, .dapp-core-component__main__connect-btns .dapp-core-component__main__btn:active {
background-color: #1392ff;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.dapp-core-component__main__connect-btns .dapp-core-component__main__info {
color: #1392ff;
margin-left: 48px;
}
.dapp-core-component__main__btn {
transition: none !important;
}
.dapp-core-component__main__trust-badge {
width: 20px;
height: 20px;
}
/* Navbar
-------------------------------------------------- */
.dapp-core-component__main__navbar .dapp-core-component__main__dapp-name {
display: flex;
align-items: center;
font-size: 1.7142857143rem;
font-weight: 400;
color: #9ba5b4;
margin-left: 1.6428571429rem;
}
.dapp-core-component__main__navbar .dapp-core-component__main__dapp-name:before {
content: "";
display: block;
width: 1px;
height: 3rem;
margin-right: 1.7142857143rem;
}
/* Dashboard
-------------------------------------------------- */
.dapp-core-compone