@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 186 kB
JavaScript
"use strict";var mc=Object.create;var yo=Object.defineProperty,dc=Object.defineProperties,lc=Object.getOwnPropertyDescriptor,_c=Object.getOwnPropertyDescriptors,uc=Object.getOwnPropertyNames,Ro=Object.getOwnPropertySymbols,gc=Object.getPrototypeOf,bn=Object.prototype.hasOwnProperty,Gt=Object.prototype.propertyIsEnumerable;var Wt=(e,o,n)=>o in e?yo(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)&&Wt(e,n,o[n]);if(Ro)for(var n of Ro(o))Gt.call(o,n)&&Wt(e,n,o[n]);return e},A=(e,o)=>dc(e,_c(o));var Fo=(e,o)=>{var n={};for(var r in e)bn.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ro)for(var r of Ro(e))o.indexOf(r)<0&&Gt.call(e,r)&&(n[r]=e[r]);return n};var b=(e,o)=>()=>(e&&(o=e(e=0)),o);var Bo=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),Ae=(e,o)=>{for(var n in o)yo(e,n,{get:o[n],enumerable:!0})},Ht=(e,o,n,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of uc(o))!bn.call(e,p)&&p!==n&&yo(e,p,{get:()=>o[p],enumerable:!(r=lc(o,p))||r.enumerable});return e};var h=(e,o,n)=>(n=e!=null?mc(gc(e)):{},Ht(o||!e||!e.__esModule?yo(n,"default",{value:e,enumerable:!0}):n,e)),bo=e=>Ht(yo({},"__esModule",{value:!0}),e);var w=(e,o,n)=>new Promise((r,p)=>{var s=l=>{try{u(n.next(l))}catch(g){p(g)}},m=l=>{try{u(n.throw(l))}catch(g){p(g)}},u=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,m);u((n=n.apply(e,o)).next())});var zt=Bo(Oo=>{"use strict";t();Oo.byteLength=hc;Oo.toByteArray=xc;Oo.fromByteArray=Sc;var ce=[],J=[],fc=typeof Uint8Array!="undefined"?Uint8Array:Array,Sn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ie=0,$t=Sn.length;Ie<$t;++Ie)ce[Ie]=Sn[Ie],J[Sn.charCodeAt(Ie)]=Ie;var Ie,$t;J["-".charCodeAt(0)]=62;J["_".charCodeAt(0)]=63;function Vt(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 hc(e){var o=Vt(e),n=o[0],r=o[1];return(n+r)*3/4-r}function Tc(e,o,n){return(o+n)*3/4-n}function xc(e){var o,n=Vt(e),r=n[0],p=n[1],s=new fc(Tc(e,r,p)),m=0,u=p>0?r-4:r,l;for(l=0;l<u;l+=4)o=J[e.charCodeAt(l)]<<18|J[e.charCodeAt(l+1)]<<12|J[e.charCodeAt(l+2)]<<6|J[e.charCodeAt(l+3)],s[m++]=o>>16&255,s[m++]=o>>8&255,s[m++]=o&255;return p===2&&(o=J[e.charCodeAt(l)]<<2|J[e.charCodeAt(l+1)]>>4,s[m++]=o&255),p===1&&(o=J[e.charCodeAt(l)]<<10|J[e.charCodeAt(l+1)]<<4|J[e.charCodeAt(l+2)]>>2,s[m++]=o>>8&255,s[m++]=o&255),s}function yc(e){return ce[e>>18&63]+ce[e>>12&63]+ce[e>>6&63]+ce[e&63]}function bc(e,o,n){for(var r,p=[],s=o;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),p.push(yc(r));return p.join("")}function Sc(e){for(var o,n=e.length,r=n%3,p=[],s=16383,m=0,u=n-r;m<u;m+=s)p.push(bc(e,m,m+s>u?u:m+s));return r===1?(o=e[n-1],p.push(ce[o>>2]+ce[o<<4&63]+"==")):r===2&&(o=(e[n-2]<<8)+e[n-1],p.push(ce[o>>10]+ce[o>>4&63]+ce[o<<2&63]+"=")),p.join("")}});var jt=Bo(wn=>{t();wn.read=function(e,o,n,r,p){var s,m,u=p*8-r-1,l=(1<<u)-1,g=l>>1,f=-7,T=n?p-1:0,S=n?-1:1,E=e[o+T];for(T+=S,s=E&(1<<-f)-1,E>>=-f,f+=u;f>0;s=s*256+e[o+T],T+=S,f-=8);for(m=s&(1<<-f)-1,s>>=-f,f+=r;f>0;m=m*256+e[o+T],T+=S,f-=8);if(s===0)s=1-g;else{if(s===l)return m?NaN:(E?-1:1)*(1/0);m=m+Math.pow(2,r),s=s-g}return(E?-1:1)*m*Math.pow(2,s-r)};wn.write=function(e,o,n,r,p,s){var m,u,l,g=s*8-p-1,f=(1<<g)-1,T=f>>1,S=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=r?0:s-1,N=r?1:-1,R=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(u=isNaN(o)?1:0,m=f):(m=Math.floor(Math.log(o)/Math.LN2),o*(l=Math.pow(2,-m))<1&&(m--,l*=2),m+T>=1?o+=S/l:o+=S*Math.pow(2,1-T),o*l>=2&&(m++,l/=2),m+T>=f?(u=0,m=f):m+T>=1?(u=(o*l-1)*Math.pow(2,p),m=m+T):(u=o*Math.pow(2,T-1)*Math.pow(2,p),m=0));p>=8;e[n+E]=u&255,E+=N,u/=256,p-=8);for(m=m<<p|u,g+=p;g>0;e[n+E]=m&255,E+=N,m/=256,g-=8);e[n+E-N]|=R*128}});var ar=Bo($e=>{"use strict";t();var vn=zt(),He=jt(),qt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;$e.Buffer=d;$e.SlowBuffer=Ec;$e.INSPECT_MAX_BYTES=50;var Uo=2147483647;$e.kMaxLength=Uo;d.TYPED_ARRAY_SUPPORT=wc();!d.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 wc(){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(d.prototype,"parent",{enumerable:!0,get:function(){if(!!d.isBuffer(this))return this.buffer}});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(!!d.isBuffer(this))return this.byteOffset}});function _e(e){if(e>Uo)throw new RangeError('The value "'+e+'" is invalid for option "size"');var o=new Uint8Array(e);return Object.setPrototypeOf(o,d.prototype),o}function d(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 En(e)}return Yt(e,o,n)}d.poolSize=8192;function Yt(e,o,n){if(typeof e=="string")return kc(e,o);if(ArrayBuffer.isView(e))return Ac(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 An(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 d.from(r,o,n);var p=Ic(e);if(p)return p;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return d.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)}d.from=function(e,o,n){return Yt(e,o,n)};Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Zt(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 vc(e,o,n){return Zt(e),e<=0?_e(e):o!==void 0?typeof n=="string"?_e(e).fill(o,n):_e(e).fill(o):_e(e)}d.alloc=function(e,o,n){return vc(e,o,n)};function En(e){return Zt(e),_e(e<0?0:Ln(e)|0)}d.allocUnsafe=function(e){return En(e)};d.allocUnsafeSlow=function(e){return En(e)};function kc(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!d.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=Jt(e,o)|0,r=_e(n),p=r.write(e,o);return p!==n&&(r=r.slice(0,p)),r}function kn(e){for(var o=e.length<0?0:Ln(e.length)|0,n=_e(o),r=0;r<o;r+=1)n[r]=e[r]&255;return n}function Ac(e){if(pe(e,Uint8Array)){var o=new Uint8Array(e);return An(o.buffer,o.byteOffset,o.byteLength)}return kn(e)}function An(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,d.prototype),r}function Ic(e){if(d.isBuffer(e)){var o=Ln(e.length)|0,n=_e(o);return n.length===0||e.copy(n,0,0,o),n}if(e.length!==void 0)return typeof e.length!="number"||Cn(e.length)?_e(0):kn(e);if(e.type==="Buffer"&&Array.isArray(e.data))return kn(e.data)}function Ln(e){if(e>=Uo)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Uo.toString(16)+" bytes");return e|0}function Ec(e){return+e!=e&&(e=0),d.alloc(+e)}d.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==d.prototype};d.compare=function(o,n){if(pe(o,Uint8Array)&&(o=d.from(o,o.offset,o.byteLength)),pe(n,Uint8Array)&&(n=d.from(n,n.offset,n.byteLength)),!d.isBuffer(o)||!d.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,p=n.length,s=0,m=Math.min(r,p);s<m;++s)if(o[s]!==n[s]){r=o[s],p=n[s];break}return r<p?-1:p<r?1:0};d.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}};d.concat=function(o,n){if(!Array.isArray(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return d.alloc(0);var r;if(n===void 0)for(n=0,r=0;r<o.length;++r)n+=o[r].length;var p=d.allocUnsafe(n),s=0;for(r=0;r<o.length;++r){var m=o[r];if(pe(m,Uint8Array))s+m.length>p.length?d.from(m).copy(p,s):Uint8Array.prototype.set.call(p,m,s);else if(d.isBuffer(m))m.copy(p,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=m.length}return p};function Jt(e,o){if(d.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 p=!1;;)switch(o){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return In(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return rr(e).length;default:if(p)return r?-1:In(e).length;o=(""+o).toLowerCase(),p=!0}}d.byteLength=Jt;function Lc(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 Uc(this,o,n);case"utf8":case"utf-8":return er(this,o,n);case"ascii":return Bc(this,o,n);case"latin1":case"binary":return Oc(this,o,n);case"base64":return Rc(this,o,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wc(this,o,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}d.prototype._isBuffer=!0;function Ee(e,o,n){var r=e[o];e[o]=e[n],e[n]=r}d.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)Ee(this,n,n+1);return this};d.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)Ee(this,n,n+3),Ee(this,n+1,n+2);return this};d.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)Ee(this,n,n+7),Ee(this,n+1,n+6),Ee(this,n+2,n+5),Ee(this,n+3,n+4);return this};d.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?er(this,0,o):Lc.apply(this,arguments)};d.prototype.toLocaleString=d.prototype.toString;d.prototype.equals=function(o){if(!d.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:d.compare(this,o)===0};d.prototype.inspect=function(){var o="",n=$e.INSPECT_MAX_BYTES;return o=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(o+=" ... "),"<Buffer "+o+">"};qt&&(d.prototype[qt]=d.prototype.inspect);d.prototype.compare=function(o,n,r,p,s){if(pe(o,Uint8Array)&&(o=d.from(o,o.offset,o.byteLength)),!d.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),p===void 0&&(p=0),s===void 0&&(s=this.length),n<0||r>o.length||p<0||s>this.length)throw new RangeError("out of range index");if(p>=s&&n>=r)return 0;if(p>=s)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,p>>>=0,s>>>=0,this===o)return 0;for(var m=s-p,u=r-n,l=Math.min(m,u),g=this.slice(p,s),f=o.slice(n,r),T=0;T<l;++T)if(g[T]!==f[T]){m=g[T],u=f[T];break}return m<u?-1:u<m?1:0};function Qt(e,o,n,r,p){if(e.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Cn(n)&&(n=p?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(p)return-1;n=e.length-1}else if(n<0)if(p)n=0;else return-1;if(typeof o=="string"&&(o=d.from(o,r)),d.isBuffer(o))return o.length===0?-1:Kt(e,o,n,r,p);if(typeof o=="number")return o=o&255,typeof Uint8Array.prototype.indexOf=="function"?p?Uint8Array.prototype.indexOf.call(e,o,n):Uint8Array.prototype.lastIndexOf.call(e,o,n):Kt(e,[o],n,r,p);throw new TypeError("val must be string, number or Buffer")}function Kt(e,o,n,r,p){var s=1,m=e.length,u=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,u/=2,n/=2}function l(E,N){return s===1?E[N]:E.readUInt16BE(N*s)}var g;if(p){var f=-1;for(g=n;g<m;g++)if(l(e,g)===l(o,f===-1?0:g-f)){if(f===-1&&(f=g),g-f+1===u)return f*s}else f!==-1&&(g-=g-f),f=-1}else for(n+u>m&&(n=m-u),g=n;g>=0;g--){for(var T=!0,S=0;S<u;S++)if(l(e,g+S)!==l(o,S)){T=!1;break}if(T)return g}return-1}d.prototype.includes=function(o,n,r){return this.indexOf(o,n,r)!==-1};d.prototype.indexOf=function(o,n,r){return Qt(this,o,n,r,!0)};d.prototype.lastIndexOf=function(o,n,r){return Qt(this,o,n,r,!1)};function Cc(e,o,n,r){n=Number(n)||0;var p=e.length-n;r?(r=Number(r),r>p&&(r=p)):r=p;var s=o.length;r>s/2&&(r=s/2);for(var m=0;m<r;++m){var u=parseInt(o.substr(m*2,2),16);if(Cn(u))return m;e[n+m]=u}return m}function Nc(e,o,n,r){return Wo(In(o,e.length-n),e,n,r)}function Dc(e,o,n,r){return Wo($c(o),e,n,r)}function Pc(e,o,n,r){return Wo(rr(o),e,n,r)}function Mc(e,o,n,r){return Wo(Vc(o,e.length-n),e,n,r)}d.prototype.write=function(o,n,r,p){if(n===void 0)p="utf8",r=this.length,n=0;else if(r===void 0&&typeof n=="string")p=n,r=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(r)?(r=r>>>0,p===void 0&&(p="utf8")):(p=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");p||(p="utf8");for(var m=!1;;)switch(p){case"hex":return Cc(this,o,n,r);case"utf8":case"utf-8":return Nc(this,o,n,r);case"ascii":case"latin1":case"binary":return Dc(this,o,n,r);case"base64":return Pc(this,o,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mc(this,o,n,r);default:if(m)throw new TypeError("Unknown encoding: "+p);p=(""+p).toLowerCase(),m=!0}};d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Rc(e,o,n){return o===0&&n===e.length?vn.fromByteArray(e):vn.fromByteArray(e.slice(o,n))}function er(e,o,n){n=Math.min(e.length,n);for(var r=[],p=o;p<n;){var s=e[p],m=null,u=s>239?4:s>223?3:s>191?2:1;if(p+u<=n){var l,g,f,T;switch(u){case 1:s<128&&(m=s);break;case 2:l=e[p+1],(l&192)===128&&(T=(s&31)<<6|l&63,T>127&&(m=T));break;case 3:l=e[p+1],g=e[p+2],(l&192)===128&&(g&192)===128&&(T=(s&15)<<12|(l&63)<<6|g&63,T>2047&&(T<55296||T>57343)&&(m=T));break;case 4:l=e[p+1],g=e[p+2],f=e[p+3],(l&192)===128&&(g&192)===128&&(f&192)===128&&(T=(s&15)<<18|(l&63)<<12|(g&63)<<6|f&63,T>65535&&T<1114112&&(m=T))}}m===null?(m=65533,u=1):m>65535&&(m-=65536,r.push(m>>>10&1023|55296),m=56320|m&1023),r.push(m),p+=u}return Fc(r)}var Xt=4096;function Fc(e){var o=e.length;if(o<=Xt)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<o;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Xt));return n}function Bc(e,o,n){var r="";n=Math.min(e.length,n);for(var p=o;p<n;++p)r+=String.fromCharCode(e[p]&127);return r}function Oc(e,o,n){var r="";n=Math.min(e.length,n);for(var p=o;p<n;++p)r+=String.fromCharCode(e[p]);return r}function Uc(e,o,n){var r=e.length;(!o||o<0)&&(o=0),(!n||n<0||n>r)&&(n=r);for(var p="",s=o;s<n;++s)p+=zc[e[s]];return p}function Wc(e,o,n){for(var r=e.slice(o,n),p="",s=0;s<r.length-1;s+=2)p+=String.fromCharCode(r[s]+r[s+1]*256);return p}d.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 p=this.subarray(o,n);return Object.setPrototypeOf(p,d.prototype),p};function W(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")}d.prototype.readUintLE=d.prototype.readUIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||W(o,n,this.length);for(var p=this[o],s=1,m=0;++m<n&&(s*=256);)p+=this[o+m]*s;return p};d.prototype.readUintBE=d.prototype.readUIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||W(o,n,this.length);for(var p=this[o+--n],s=1;n>0&&(s*=256);)p+=this[o+--n]*s;return p};d.prototype.readUint8=d.prototype.readUInt8=function(o,n){return o=o>>>0,n||W(o,1,this.length),this[o]};d.prototype.readUint16LE=d.prototype.readUInt16LE=function(o,n){return o=o>>>0,n||W(o,2,this.length),this[o]|this[o+1]<<8};d.prototype.readUint16BE=d.prototype.readUInt16BE=function(o,n){return o=o>>>0,n||W(o,2,this.length),this[o]<<8|this[o+1]};d.prototype.readUint32LE=d.prototype.readUInt32LE=function(o,n){return o=o>>>0,n||W(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216};d.prototype.readUint32BE=d.prototype.readUInt32BE=function(o,n){return o=o>>>0,n||W(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])};d.prototype.readIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||W(o,n,this.length);for(var p=this[o],s=1,m=0;++m<n&&(s*=256);)p+=this[o+m]*s;return s*=128,p>=s&&(p-=Math.pow(2,8*n)),p};d.prototype.readIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||W(o,n,this.length);for(var p=n,s=1,m=this[o+--p];p>0&&(s*=256);)m+=this[o+--p]*s;return s*=128,m>=s&&(m-=Math.pow(2,8*n)),m};d.prototype.readInt8=function(o,n){return o=o>>>0,n||W(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]};d.prototype.readInt16LE=function(o,n){o=o>>>0,n||W(o,2,this.length);var r=this[o]|this[o+1]<<8;return r&32768?r|4294901760:r};d.prototype.readInt16BE=function(o,n){o=o>>>0,n||W(o,2,this.length);var r=this[o+1]|this[o]<<8;return r&32768?r|4294901760:r};d.prototype.readInt32LE=function(o,n){return o=o>>>0,n||W(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24};d.prototype.readInt32BE=function(o,n){return o=o>>>0,n||W(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]};d.prototype.readFloatLE=function(o,n){return o=o>>>0,n||W(o,4,this.length),He.read(this,o,!0,23,4)};d.prototype.readFloatBE=function(o,n){return o=o>>>0,n||W(o,4,this.length),He.read(this,o,!1,23,4)};d.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||W(o,8,this.length),He.read(this,o,!0,52,8)};d.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||W(o,8,this.length),He.read(this,o,!1,52,8)};function q(e,o,n,r,p,s){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>p||o<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(o,n,r,p){if(o=+o,n=n>>>0,r=r>>>0,!p){var s=Math.pow(2,8*r)-1;q(this,o,n,r,s,0)}var m=1,u=0;for(this[n]=o&255;++u<r&&(m*=256);)this[n+u]=o/m&255;return n+r};d.prototype.writeUintBE=d.prototype.writeUIntBE=function(o,n,r,p){if(o=+o,n=n>>>0,r=r>>>0,!p){var s=Math.pow(2,8*r)-1;q(this,o,n,r,s,0)}var m=r-1,u=1;for(this[n+m]=o&255;--m>=0&&(u*=256);)this[n+m]=o/u&255;return n+r};d.prototype.writeUint8=d.prototype.writeUInt8=function(o,n,r){return o=+o,n=n>>>0,r||q(this,o,n,1,255,0),this[n]=o&255,n+1};d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||q(this,o,n,2,65535,0),this[n]=o&255,this[n+1]=o>>>8,n+2};d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||q(this,o,n,2,65535,0),this[n]=o>>>8,this[n+1]=o&255,n+2};d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||q(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};d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||q(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};d.prototype.writeIntLE=function(o,n,r,p){if(o=+o,n=n>>>0,!p){var s=Math.pow(2,8*r-1);q(this,o,n,r,s-1,-s)}var m=0,u=1,l=0;for(this[n]=o&255;++m<r&&(u*=256);)o<0&&l===0&&this[n+m-1]!==0&&(l=1),this[n+m]=(o/u>>0)-l&255;return n+r};d.prototype.writeIntBE=function(o,n,r,p){if(o=+o,n=n>>>0,!p){var s=Math.pow(2,8*r-1);q(this,o,n,r,s-1,-s)}var m=r-1,u=1,l=0;for(this[n+m]=o&255;--m>=0&&(u*=256);)o<0&&l===0&&this[n+m+1]!==0&&(l=1),this[n+m]=(o/u>>0)-l&255;return n+r};d.prototype.writeInt8=function(o,n,r){return o=+o,n=n>>>0,r||q(this,o,n,1,127,-128),o<0&&(o=255+o+1),this[n]=o&255,n+1};d.prototype.writeInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||q(this,o,n,2,32767,-32768),this[n]=o&255,this[n+1]=o>>>8,n+2};d.prototype.writeInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||q(this,o,n,2,32767,-32768),this[n]=o>>>8,this[n+1]=o&255,n+2};d.prototype.writeInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||q(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};d.prototype.writeInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||q(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 or(e,o,n,r,p,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function nr(e,o,n,r,p){return o=+o,n=n>>>0,p||or(e,o,n,4,34028234663852886e22,-34028234663852886e22),He.write(e,o,n,r,23,4),n+4}d.prototype.writeFloatLE=function(o,n,r){return nr(this,o,n,!0,r)};d.prototype.writeFloatBE=function(o,n,r){return nr(this,o,n,!1,r)};function tr(e,o,n,r,p){return o=+o,n=n>>>0,p||or(e,o,n,8,17976931348623157e292,-17976931348623157e292),He.write(e,o,n,r,52,8),n+8}d.prototype.writeDoubleLE=function(o,n,r){return tr(this,o,n,!0,r)};d.prototype.writeDoubleBE=function(o,n,r){return tr(this,o,n,!1,r)};d.prototype.copy=function(o,n,r,p){if(!d.isBuffer(o))throw new TypeError("argument should be a Buffer");if(r||(r=0),!p&&p!==0&&(p=this.length),n>=o.length&&(n=o.length),n||(n=0),p>0&&p<r&&(p=r),p===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(p<0)throw new RangeError("sourceEnd out of bounds");p>this.length&&(p=this.length),o.length-n<p-r&&(p=o.length-n+r);var s=p-r;return this===o&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,r,p):Uint8Array.prototype.set.call(o,this.subarray(r,p),n),s};d.prototype.fill=function(o,n,r,p){if(typeof o=="string"){if(typeof n=="string"?(p=n,n=0,r=this.length):typeof r=="string"&&(p=r,r=this.length),p!==void 0&&typeof p!="string")throw new TypeError("encoding must be a string");if(typeof p=="string"&&!d.isEncoding(p))throw new TypeError("Unknown encoding: "+p);if(o.length===1){var s=o.charCodeAt(0);(p==="utf8"&&s<128||p==="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 u=d.isBuffer(o)?o:d.from(o,p),l=u.length;if(l===0)throw new TypeError('The value "'+o+'" is invalid for argument "value"');for(m=0;m<r-n;++m)this[m+n]=u[m%l]}return this};var Gc=/[^+/0-9A-Za-z-_]/g;function Hc(e){if(e=e.split("=")[0],e=e.trim().replace(Gc,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function In(e,o){o=o||1/0;for(var n,r=e.length,p=null,s=[],m=0;m<r;++m){if(n=e.charCodeAt(m),n>55295&&n<57344){if(!p){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}p=n;continue}if(n<56320){(o-=3)>-1&&s.push(239,191,189),p=n;continue}n=(p-55296<<10|n-56320)+65536}else p&&(o-=3)>-1&&s.push(239,191,189);if(p=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 $c(e){for(var o=[],n=0;n<e.length;++n)o.push(e.charCodeAt(n)&255);return o}function Vc(e,o){for(var n,r,p,s=[],m=0;m<e.length&&!((o-=2)<0);++m)n=e.charCodeAt(m),r=n>>8,p=n%256,s.push(p),s.push(r);return s}function rr(e){return vn.toByteArray(Hc(e))}function Wo(e,o,n,r){for(var p=0;p<r&&!(p+n>=o.length||p>=e.length);++p)o[p+n]=e[p];return p}function pe(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function Cn(e){return e!==e}var zc=function(){for(var e="0123456789abcdef",o=new Array(256),n=0;n<16;++n)for(var r=n*16,p=0;p<16;++p)o[r+p]=e[n]+e[p];return o}()});var mr=Bo((ed,sr)=>{t();var O=sr.exports={},se,me;function Nn(){throw new Error("setTimeout has not been defined")}function Dn(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?se=setTimeout:se=Nn}catch(e){se=Nn}try{typeof clearTimeout=="function"?me=clearTimeout:me=Dn}catch(e){me=Dn}})();function ir(e){if(se===setTimeout)return setTimeout(e,0);if((se===Nn||!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 jc(e){if(me===clearTimeout)return clearTimeout(e);if((me===Dn||!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 ue=[],Ve=!1,Le,Go=-1;function qc(){!Ve||!Le||(Ve=!1,Le.length?ue=Le.concat(ue):Go=-1,ue.length&&cr())}function cr(){if(!Ve){var e=ir(qc);Ve=!0;for(var o=ue.length;o;){for(Le=ue,ue=[];++Go<o;)Le&&Le[Go].run();Go=-1,o=ue.length}Le=null,Ve=!1,jc(e)}}O.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];ue.push(new pr(e,o)),ue.length===1&&!Ve&&ir(cr)};function pr(e,o){this.fun=e,this.array=o}pr.prototype.run=function(){this.fun.apply(null,this.array)};O.title="browser";O.browser=!0;O.env={};O.argv=[];O.version="";O.versions={};function ge(){}O.on=ge;O.addListener=ge;O.once=ge;O.off=ge;O.removeListener=ge;O.removeAllListeners=ge;O.emit=ge;O.prependListener=ge;O.prependOnceListener=ge;O.listeners=function(e){return[]};O.binding=function(e){throw new Error("process.binding is not supported")};O.cwd=function(){return"/"};O.chdir=function(e){throw new Error("process.chdir is not supported")};O.umask=function(){return 0}});var a,i,od,t=b(()=>{a=h(ar()),i=h(mr()),od=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 Ho,Pn=b(()=>{"use strict";t();Ho=()=>Date.now()/1e3});var dr=b(()=>{"use strict";t()});var lr=b(()=>{"use strict";t()});var Mn=b(()=>{"use strict";t();Pn();dr();lr()});var Fn={};Ae(Fn,{getItem:()=>Xc,localStorageKeys:()=>be,removeItem:()=>Yc,setItem:()=>Kc});var be,Rn,Kc,Xc,Yc,ze=b(()=>{"use strict";t();Mn();be={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Rn=typeof localStorage!="undefined",Kc=({key:e,data:o,expires:n})=>{!Rn||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},Xc=e=>{if(!Rn)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:Ho()>=n.expires?(localStorage.removeItem(String(e)),null):n.data},Yc=e=>{!Rn||localStorage.removeItem(String(e))}});var Bn={};Ae(Bn,{clear:()=>fr,getItem:()=>ur,removeItem:()=>gr,setItem:()=>_r,storage:()=>Zc});var _r,ur,gr,fr,Zc,hr=b(()=>{"use strict";t();_r=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},ur=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},gr=e=>sessionStorage.removeItem(String(e)),fr=()=>sessionStorage.clear(),Zc={setItem:_r,getItem:ur,removeItem:gr,clear:fr}});var Ce,je=b(()=>{"use strict";t();ze();hr();Ce={session:Bn,local:Fn}});function So(){return new Date().setHours(new Date().getHours()+24)}function wo(e){Ce.local.setItem({key:be.loginExpiresAt,data:e,expires:e})}var On=b(()=>{"use strict";t();je();ze()});var M=b(()=>{"use strict";t()});var qe,Ne=b(()=>{"use strict";t();qe="Action not allowed. User is logged in. Call logout() first"});var Tr=b(()=>{"use strict";t()});var H=b(()=>{"use strict";t()});var xr=b(()=>{"use strict";t()});var yr=b(()=>{"use strict";t()});var br=b(()=>{"use strict";t()});var Sr=b(()=>{"use strict";t()});var X=b(()=>{"use strict";t();Tr();H();M();xr();yr();br();Sr()});var Un,wr,Ld,vr,Cd,kr,Ar,Nd,Dd,Ir=b(()=>{"use strict";t();X();Un={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:wr,egldLabel:Ld}=Un["devnet"],{chainId:vr,egldLabel:Cd}=Un["testnet"],{chainId:kr,egldLabel:Ar}=Un["mainnet"],Nd={["devnet"]:wr,["testnet"]:vr,["mainnet"]:kr},Dd={[wr]:"devnet",[vr]:"testnet",[kr]:"mainnet"}});var Wn,Gn=b(()=>{"use strict";t();Wn={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 Er=b(()=>{"use strict";t()});var $o,Hn=b(()=>{"use strict";t();$o="transaction-status-toast-id"});var vo,Vo,Q,Ke,Lr,Cr,zo,Nr,de,L=b(()=>{"use strict";t();Ne();Ir();Gn();Er();Hn();vo=5e4,Vo=1e9,Q=18,Ke=4,Lr=1,Cr=1,zo="logout",Nr="login",de="0"});var $n,$,re,K=b(()=>{"use strict";t();$n=require("@reduxjs/toolkit");L();$=(0,$n.createAction)(zo),re=(0,$n.createAction)(Nr,e=>({payload:e}))});var Pr,Dr,Mr,Yd,Rr,Fr,Xe,Br,Jc,Or,Ur,Vn=b(()=>{"use strict";t();Pr=require("@reduxjs/toolkit");On();M();K();Dr={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Mr=(0,Pr.createSlice)({name:"loginInfoSlice",initialState:Dr,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($,()=>Dr),e.addCase(re,(o,n)=>{o.loginMethod=n.payload.loginMethod,wo(So())})}}),{setLoginMethod:Yd,setWalletConnectLogin:Rr,setLedgerLogin:Fr,setTokenLogin:Xe,setTokenLoginSignature:Br,setWalletLogin:Jc,invalidateLoginSession:Or}=Mr.actions,Ur=Mr.reducer});var Qc,jo,ko=b(()=>{"use strict";t();Qc=!1,jo=(e,o=0)=>{Qc||setTimeout(()=>{window.location.href=e},o)}});function Ye({callbackRoute:e,onLoginRedirect:o,options:n}){let r=Boolean(e),p=typeof o=="function",s=p?0:ep;r&&e!=null&&setTimeout(()=>{if(p)return o(e,n);window.location.pathname.includes(e)||jo(e)},s)}var ep,Wr=b(()=>{"use strict";t();ko();ep=200});function zn(e){return e[Math.floor(Math.random()*e.length)]}var Gr=b(()=>{"use strict";t()});function Ze(e){let o=null;if((e==null?void 0:e.statusCode)in Wn){let n=e==null?void 0:e.statusCode,{message:r}=Wn[n];o=tp.includes(n)?Hr:r}return{errorMessage:o,defaultErrorMessage:Hr}}var Hr,op,np,tp,jn=b(()=>{"use strict";t();Gn();Hr="Check if Elrond app is open on Ledger",op=28161,np=28160,tp=[op,np]});var Je=b(()=>{"use strict";t();Wr();Gr();jn()});var $r,Vr,qn,rp,zr,ml,dl,jr,Kn=b(()=>{"use strict";t();$r=require("@reduxjs/toolkit"),Vr=h(require("lodash.omit"));Je();qn={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},rp={network:qn,chainID:"-1"},zr=(0,$r.createSlice)({name:"appConfig",initialState:rp,reducers:{initializeNetworkConfig:(e,o)=>{let n=zn(o.payload.walletConnectBridgeAddresses),r=zn(o.payload.walletConnectV2RelayAddresses),p=(0,Vr.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=A(y(y({},e.network),p),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(e,o)=>{e.chainID=o.payload}}}),{initializeNetworkConfig:ml,setChainID:dl}=zr.actions,jr=zr.reducer});var Yn,qr,Kr,qo,Xn,Xr,Zn,xl,Jn,yl,Qn,Yr,bl,Sl,wl,ap,Zr,et=b(()=>{"use strict";t();Yn=require("@elrondnetwork/erdjs"),qr=require("@reduxjs/toolkit"),Kr=require("redux-persist");L();je();ze();K();qo={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:de},Xn={address:"",websocketEvent:null,accounts:{"":qo},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Xr=(0,qr.createSlice)({name:"accountInfoSlice",initialState:Xn,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new Yn.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:qo},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($,()=>(Ce.local.removeItem(be.loginExpiresAt),Xn)),e.addCase(re,(o,n)=>{let{address:r}=n.payload;o.address=r,o.publicKey=new Yn.Address(r).hex()}),e.addCase(Kr.REHYDRATE,(o,n)=>{var g;if(!((g=n.payload)!=null&&g.account))return;let{account:r}=n.payload,{address:p,shard:s,accounts:m,publicKey:u}=r;o.address=p,o.shard=s;let l=m&&p in m;o.accounts=l?m:Xn.accounts,o.publicKey=u})}}),{setAccount:Zn,setAddress:xl,setAccountNonce:Jn,setAccountShard:yl,setLedgerAccount:Qn,updateLedgerAccount:Yr,setWalletConnectAccount:bl,setIsAccountLoading:Sl,setAccountLoadingError:wl,setWebsocketEvent:ap}=Xr.actions,Zr=Xr.reducer});function Qe(e){return e!=null&&(_p(e)||hp(e))}function eo(e){return e!=null&&(up(e)||Tp(e))}function oo(e){return e!=null&&(gp(e)||xp(e))}function ot(e){return e!=null&&fp(e)}function _p(e){return e!=null&&ip.includes(e)}function up(e){return e!=null&&cp.includes(e)}function gp(e){return e!=null&&pp.includes(e)}function fp(e){return e!=null&&sp.includes(e)}function hp(e){return e!=null&&mp.includes(e)}function Tp(e){return e!=null&&dp.includes(e)}function xp(e){return e!=null&&lp.includes(e)}var ip,cp,pp,sp,mp,dp,lp,no=b(()=>{"use strict";t();M();ip=["sent"],cp=["success"],pp=["fail","cancelled","timedOut"],sp=["timedOut"],mp=["pending"],dp=["success"],lp=["fail","invalid"]});var Jr,Qr,Io,yp,ea,oa,na,bp,Ko,Sp,wp,Dl,vp,Xo,nt,Yo,Zo=b(()=>{"use strict";t();Jr=require("@reduxjs/toolkit"),Qr=require("redux-persist");M();no();K();Io={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},yp={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},ea=(0,Jr.createSlice)({name:"transactionsSlice",initialState:Io,reducers:{moveTransactionsToSignedState:(e,o)=>{var l,g;let{sessionId:n,transactions:r,errorMessage:p,status:s,redirectRoute:m}=o.payload,u=((l=e.customTransactionInformationForSessionId)==null?void 0:l[n])||yp;e.signedTransactions[n]={transactions:r,status:s,errorMessage:p,redirectRoute:m,customTransactionInformation:u},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===n&&(e.transactionsToSign=Io.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:p,transactions:s}=o.payload;e.signedTransactions[n]!=null&&(e.signedTransactions[n].status=r,p!=null&&(e.signedTransactions[n].errorMessage=p),s!=null&&(e.signedTransactions[n].transactions=s))},updateSignedTransactionStatus:(e,o)=>{var u,l,g,f,T,S;let{sessionId:n,status:r,errorMessage:p,transactionHash:s}=o.payload,m=(l=(u=e.signedTransactions)==null?void 0:u[n])==null?void 0:l.transactions;if(m!=null){e.signedTransactions[n].transactions=m.map(R=>R.hash===s?A(y({},R),{status:r,errorMessage:p}):R);let E=(f=(g=e.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:f.every(R=>eo(R.status)),N=(S=(T=e.signedTransactions[n])==null?void 0:T.transactions)==null?void 0:S.every(R=>oo(R.status));E&&(e.signedTransactions[n].status="success"),N&&(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=Io.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Io.signedTransactions},setSignTransactionsError:(e,o)=>{e.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(e,o)=>{e.signTransactionsCancelMessage=o.payload}},extraReducers:e=>{e.addCase($,()=>Io),e.addCase(Qr.REHYDRATE,(o,n)=>{var m;if(o.signTransactionsCancelMessage=null,!((m=n.payload)!=null&&m.transactions))return;let{signedTransactions:r,customTransactionInformationForSessionId:p}=n.payload.transactions,s=Object.entries(r).reduce((u,[l,g])=>{let f=new Date(l),T=new Date;return T.setHours(T.getHours()+5),T-f>0||(u[l]=g),u},{});p!=null&&(o.customTransactionInformationForSessionId=p),r!=null&&(o.signedTransactions=s)})}}),{updateSignedTransactionStatus:oa,updateSignedTransactions:na,setTransactionsToSign:bp,clearAllTransactionsToSign:Ko,clearAllSignedTransactions:Sp,clearSignedTransaction:wp,clearTransactionToSign:Dl,setSignTransactionsError:vp,setSignTransactionsCancelMessage:Xo,moveTransactionsToSignedState:nt}=ea.actions,Yo=ea.reducer});var ta,rt,at,it,kp,tt,ra,Fl,Ap,ct,Jo,Qo=b(()=>{"use strict";t();ta=require("@reduxjs/toolkit");K();rt="Transaction failed",at="Transaction successful",it="Processing transaction",kp="Transaction submitted",tt={},ra=(0,ta.createSlice)({name:"transactionsInfo",initialState:tt,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:r}=o.payload;n!=null&&(e[n]={errorMessage:(r==null?void 0:r.errorMessage)||rt,successMessage:(r==null?void 0:r.successMessage)||at,processingMessage:(r==null?void 0:r.processingMessage)||it,submittedMessage:(r==null?void 0:r.submittedMessage)||kp,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(e,o){o.payload!=null&&delete e[o.payload]},clearTransactionsInfo:()=>tt},extraReducers:e=>{e.addCase($,()=>tt)}}),{clearTransactionsInfo:Fl,setTransactionsDisplayInfo:Ap,clearTransactionsInfoForSessionId:ct}=ra.actions,Jo=ra.reducer});var ia,aa,ca,Wl,Ip,Gl,Ep,pa,pt=b(()=>{"use strict";t();ia=require("@reduxjs/toolkit");K();aa={},ca=(0,ia.createSlice)({name:"modalsSlice",initialState:aa,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($,()=>aa)}}),{setTxSubmittedModal:Wl,setNotificationModal:Ip,clearTxSubmittedModal:Gl,clearNotificationModal:Ep}=ca.actions,pa=ca.reducer});var ma,da,sa,la,Lp,st,Xl,Yl,Zl,Jl,en,on=b(()=>{"use strict";t();ma=require("@reduxjs/toolkit"),da=require("redux-persist");Hn();X();Pn();K();sa={customToasts:[],transactionToasts:[],failTransactionToast:null},la=(0,ma.createSlice)({name:"toastsSlice",initialState:sa,reducers:{addCustomToast:(e,o)=>{e.customToasts.push(A(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:Ho(),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=A(y({},o.payload),{toastId:$o})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase($,()=>sa),e.addCase(da.REHYDRATE,(o,n)=>{var p,s;let r=(s=(p=n.customToasts)==null?void 0:p.filter(m=>!("component"in m)))!=null?s:[];o.customToasts=r})}}),{addCustomToast:Lp,removeCustomToast:st,addTransactionToast:Xl,removeTransactionToast:Yl,addFailTransactionToast:Zl,removeFailTransactionToast:Jl}=la.actions,en=la.reducer});var C=b(()=>{"use strict";t();Vn();Kn();et();Zo();Qo();pt();on()});var mt=b(()=>{"use strict";t()});var fa,ga,ha,dt,T_,x_,y_,b_,Ta,xa,lt=b(()=>{"use strict";t();fa=require("@reduxjs/toolkit");K();ga={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},ha=(0,fa.createSlice)({name:"dappModalsSlice",initialState:ga,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($,()=>ga)}}),{setDappModalVisibility:dt,setDappModalHeaderVisibility:T_,setDappModalFooterVisibility:x_,setDappModalHeaderText:y_,setDappModalFooterText:b_,setDappModalConfig:Ta}=ha.actions,xa=ha.reducer});var ya,Pp,Mp,to,tn=b(()=>{"use strict";t();ya=require("@reduxjs/toolkit");mt();et();lt();Vn();pt();Kn();on();Qo();Zo();Pp={["account"]:Zr,["networkConfig"]:jr,["loginInfo"]:Ur,["modals"]:pa,["dappModal"]:xa,["toasts"]:en,["transactions"]:Yo,["transactionsInfo"]:Jo},Mp=(e={})=>(0,ya.combineReducers)(y(y({},Pp),e)),to=Mp});var wa={};Ae(wa,{default:()=>Gp});function _t(e,o=[]){return{key:e,version:1,storage:Sa.default,blacklist:o}}var Pe,ba,Sa,Rp,Fp,Bp,Op,Up,Wp,Gp,va=b(()=>{"use strict";t();Pe=require("redux-persist"),ba=h(require("redux-persist/lib/storage")),Sa=h(require("redux-persist/lib/storage/session"));tn();C();on();Qo();Zo();mt();Rp={2:e=>A(y({},e),{networkConfig:qn})};Fp=_t("dapp-core-transactionsInfo"),Bp=_t("dapp-core-transactions",["transactionsToSign"]),Op=_t("dapp-core-toasts"),Up={key:"dapp-core-store",version:2,storage:ba.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,Pe.createMigrate)(Rp,{debug:!1})},Wp={["toasts"]:(0,Pe.persistReducer)(Op,en),["transactions"]:(0,Pe.persistReducer)(Bp,Yo),["transactionsInfo"]:(0,Pe.persistReducer)(Fp,Jo)},Gp=(0,Pe.persistReducer)(Up,to(Wp))});var ka={};Ae(ka,{default:()=>Hp});var Hp,Aa=b(()=>{"use strict";t();tn();Hp=to()});var Ia={};Ae(Ia,{default:()=>Vp});var oe,$p,Vp,Ea=b(()=>{"use strict";t();oe=require("redux-persist"),$p=[oe.FLUSH,oe.REHYDRATE,oe.PAUSE,oe.PERSIST,oe.PURGE,oe.REGISTER],Vp=$p});var Na={};Ae(Na,{default:()=>Ca});function Ca(e){return(0,La.persistStore)(e)}var La,Da=b(()=>{"use strict";t();La=require("redux-persist")});var Xm={};Ae(Xm,{LedgerLoginButton:()=>Km,LedgerLoginContainer:()=>Ft});module.exports=bo(Xm);t();t();var To=h(require("react")),Qi=require("@fortawesome/free-solid-svg-icons"),ec=h(require("classnames"));t();t();var Oa=require("react"),ro=require("react-redux");t();var ut=require("@reduxjs/toolkit"),Fa=require("react-redux/es/utils/Subscription");C();t();var _a=h(require("lodash.throttle"));L();C();On();je();ze();var Cp=[zo],Np=(0,_a.default)(()=>{wo(So())},5e3),ua=e=>o=>n=>{var l;if(Cp.includes(n.type))return o(n);let r=e.getState(),p=Ce.local.getItem(be.loginExpiresAt);if(!((l=r==null?void 0:r.loginInfo)==null?void 0:l.isLoggedIn))return o(n);if(p==null)return wo(So());let m=Date.now();return p-m<0?setTimeout(()=>w(void 0,null,function*(){console.log("session expired");try{e.dispatch(Or())}catch(g){console.error("error logging out",g)}}),1e3):(Np(),o(n))};t();t();function nn(){return typeof sessionStorage!="undefined"}var Pa=nn()?(va(),bo(wa)).default:(Aa(),bo(ka)).default,Ma=nn()?(Ea(),bo(Ia)).default:[],Ra=nn()?(Da(),bo(Na)).default:e=>e;tn();var v=(0,ut.configureStore)({reducer:Pa,middleware:e=>e({serializableCheck:{ignoredActions:[...Ma,Jn.type,Zn.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(ua)}),Ba=(0,Fa.createSubscription)(v),j_=Ra(v),q_=(0,ut.configureStore)({reducer:to});var zp={store:v,subscription:Ba},gt=(0,Oa.createContext)(zp),Z_=(0,ro.createStoreHook)(gt),V=(0,ro.createDispatchHook)(gt),I=(0,ro.createSelectorHook)(gt);t();t();C();t();var Ua=h(require("lodash.isequal")),rn=require("reselect"),x=(0,rn.createSelectorCreator)(rn.defaultMemoize,Ua.default);var fe=e=>e.account,ao=x(fe,e=>e.address),io=x(fe,ao,(e,o)=>o in e.accounts?e.accounts[o]:qo),Wa=x(fe,io,(e,o)=>{let p=e,{accounts:n}=p,r=Fo(p,["accounts"]);return A(y({},r),{account:o})}),jp=x(io,e=>e.balance),qp=x(io,e=>{var o;return((o=e==null?void 0:e.nonce)==null?void 0:o.valueOf())||0}),nu=x(fe,e=>e.shard),Ga=x(fe,e=>e.ledgerAccount),tu=x(fe,e=>e.walletConnectAccount),ru=x(fe,e=>e.isAccountLoading),au=x(fe,e=>e.accountLoadingError),Ha=x(fe,e=>e.websocketEvent);t();var Se=e=>e.networkConfig,an=x(Se,e=>e.chainID),Kp=x(Se,e=>e.network.walletConnectBridgeAddress),Xp=x(Se,e=>e.network.walletConnectV2RelayAddress),Yp=x(Se,e=>e.network.walletConnectV2ProjectId),$a=x(Se,e=>e.network.walletConnectDeepLink),Me=x(Se,e=>e.network),ft=x(Me,e=>e.apiAddress),Va=x(Me,e=>e.explorerAddress),ht=x(Me,e=>e.egldLabel);t();M();var Re=e=>e.loginInfo,lu=x(Re,e=>e.loginMethod),co=x(Re,ao,(e,o)=>e.loginMethod!=""&&Boolean(o)),_u=x(Re,e=>e.walletConnectLogin),uu=x(Re,e=>e.ledgerLogin),Zp=x(Re,e=>e.walletLogin),gu=x(Re,e=>e.isLoginSessionInvalid);t();t();var Y=require("@elrondnetwork/erdjs");L();t();function Tt(e){try{return a.Buffer.from(e,"base64").toString()===atob(e)}catch(o){return!1}}function cn(e){var p,s,m;let{data:o}=e,n=Tt(o!=null?o:"")?Y.TransactionPayload.fromEncoded(o):new Y.TransactionPayload(o),r=new Y.Transaction(y({value:e.value.valueOf(),data:n,n