UNPKG

@sofaws/dapp-core

Version:

A library to hold the main logic for a dapp on the Elrond Network

1 lines 73.9 kB
"use strict";var Oi=Object.create;var Ae=Object.defineProperty,Bi=Object.defineProperties,Ui=Object.getOwnPropertyDescriptor,Vi=Object.getOwnPropertyDescriptors,$i=Object.getOwnPropertyNames,Oe=Object.getOwnPropertySymbols,Hi=Object.getPrototypeOf,yt=Object.prototype.hasOwnProperty,Cr=Object.prototype.propertyIsEnumerable;var Nr=(e,t,r)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w=(e,t)=>{for(var r in t||(t={}))yt.call(t,r)&&Nr(e,r,t[r]);if(Oe)for(var r of Oe(t))Cr.call(t,r)&&Nr(e,r,t[r]);return e},I=(e,t)=>Bi(e,Vi(t));var Rr=(e,t)=>{var r={};for(var n in e)yt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Oe)for(var n of Oe(e))t.indexOf(n)<0&&Cr.call(e,n)&&(r[n]=e[n]);return r};var x=(e,t)=>()=>(e&&(t=e(e=0)),t);var Be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),re=(e,t)=>{for(var r in t)Ae(e,r,{get:t[r],enumerable:!0})},Pr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $i(t))!yt.call(e,o)&&o!==r&&Ae(e,o,{get:()=>t[o],enumerable:!(n=Ui(t,o))||n.enumerable});return e};var k=(e,t,r)=>(r=e!=null?Oi(Hi(e)):{},Pr(t||!e||!e.__esModule?Ae(r,"default",{value:e,enumerable:!0}):r,e)),ve=e=>Pr(Ae({},"__esModule",{value:!0}),e);var Fr=(e,t,r)=>new Promise((n,o)=>{var a=m=>{try{u(r.next(m))}catch(g){o(g)}},s=m=>{try{u(r.throw(m))}catch(g){o(g)}},u=m=>m.done?n(m.value):Promise.resolve(m.value).then(a,s);u((r=r.apply(e,t)).next())});var Or=Be(Ue=>{"use strict";i();Ue.byteLength=Wi;Ue.toByteArray=ji;Ue.fromByteArray=Yi;var B=[],P=[],Gi=typeof Uint8Array!="undefined"?Uint8Array:Array,ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ne=0,_r=ht.length;ne<_r;++ne)B[ne]=ht[ne],P[ht.charCodeAt(ne)]=ne;var ne,_r;P["-".charCodeAt(0)]=62;P["_".charCodeAt(0)]=63;function Mr(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function Wi(e){var t=Mr(e),r=t[0],n=t[1];return(r+n)*3/4-n}function qi(e,t,r){return(t+r)*3/4-r}function ji(e){var t,r=Mr(e),n=r[0],o=r[1],a=new Gi(qi(e,n,o)),s=0,u=o>0?n-4:n,m;for(m=0;m<u;m+=4)t=P[e.charCodeAt(m)]<<18|P[e.charCodeAt(m+1)]<<12|P[e.charCodeAt(m+2)]<<6|P[e.charCodeAt(m+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=t&255;return o===2&&(t=P[e.charCodeAt(m)]<<2|P[e.charCodeAt(m+1)]>>4,a[s++]=t&255),o===1&&(t=P[e.charCodeAt(m)]<<10|P[e.charCodeAt(m+1)]<<4|P[e.charCodeAt(m+2)]>>2,a[s++]=t>>8&255,a[s++]=t&255),a}function zi(e){return B[e>>18&63]+B[e>>12&63]+B[e>>6&63]+B[e&63]}function Ki(e,t,r){for(var n,o=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),o.push(zi(n));return o.join("")}function Yi(e){for(var t,r=e.length,n=r%3,o=[],a=16383,s=0,u=r-n;s<u;s+=a)o.push(Ki(e,s,s+a>u?u:s+a));return n===1?(t=e[r-1],o.push(B[t>>2]+B[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],o.push(B[t>>10]+B[t>>4&63]+B[t<<2&63]+"=")),o.join("")}});var Br=Be(xt=>{i();xt.read=function(e,t,r,n,o){var a,s,u=o*8-n-1,m=(1<<u)-1,g=m>>1,T=-7,f=r?o-1:0,y=r?-1:1,S=e[t+f];for(f+=y,a=S&(1<<-T)-1,S>>=-T,T+=u;T>0;a=a*256+e[t+f],f+=y,T-=8);for(s=a&(1<<-T)-1,a>>=-T,T+=n;T>0;s=s*256+e[t+f],f+=y,T-=8);if(a===0)a=1-g;else{if(a===m)return s?NaN:(S?-1:1)*(1/0);s=s+Math.pow(2,n),a=a-g}return(S?-1:1)*s*Math.pow(2,a-n)};xt.write=function(e,t,r,n,o,a){var s,u,m,g=a*8-o-1,T=(1<<g)-1,f=T>>1,y=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:a-1,A=n?1:-1,b=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=T):(s=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-s))<1&&(s--,m*=2),s+f>=1?t+=y/m:t+=y*Math.pow(2,1-f),t*m>=2&&(s++,m/=2),s+f>=T?(u=0,s=T):s+f>=1?(u=(t*m-1)*Math.pow(2,o),s=s+f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[r+S]=u&255,S+=A,u/=256,o-=8);for(s=s<<o|u,g+=o;g>0;e[r+S]=s&255,S+=A,s/=256,g-=8);e[r+S-A]|=b*128}});var Xr=Be(ue=>{"use strict";i();var St=Or(),pe=Br(),Ur=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ue.Buffer=d;ue.SlowBuffer=ta;ue.INSPECT_MAX_BYTES=50;var Ve=2147483647;ue.kMaxLength=Ve;d.TYPED_ARRAY_SUPPORT=Zi();!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 Zi(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(r){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 G(e){if(e>Ve)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,d.prototype),t}function d(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return vt(e)}return Hr(e,t,r)}d.poolSize=8192;function Hr(e,t,r){if(typeof e=="string")return Ji(e,t);if(ArrayBuffer.isView(e))return Qi(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(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(U(e,SharedArrayBuffer)||e&&U(e.buffer,SharedArrayBuffer)))return bt(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return d.from(n,t,r);var o=ea(e);if(o)return o;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return d.from(e[Symbol.toPrimitive]("string"),t,r);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,t,r){return Hr(e,t,r)};Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Gr(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 Xi(e,t,r){return Gr(e),e<=0?G(e):t!==void 0?typeof r=="string"?G(e).fill(t,r):G(e).fill(t):G(e)}d.alloc=function(e,t,r){return Xi(e,t,r)};function vt(e){return Gr(e),G(e<0?0:It(e)|0)}d.allocUnsafe=function(e){return vt(e)};d.allocUnsafeSlow=function(e){return vt(e)};function Ji(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!d.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=Wr(e,t)|0,n=G(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}function wt(e){for(var t=e.length<0?0:It(e.length)|0,r=G(t),n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Qi(e){if(U(e,Uint8Array)){var t=new Uint8Array(e);return bt(t.buffer,t.byteOffset,t.byteLength)}return wt(e)}function bt(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,d.prototype),n}function ea(e){if(d.isBuffer(e)){var t=It(e.length)|0,r=G(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||kt(e.length)?G(0):wt(e);if(e.type==="Buffer"&&Array.isArray(e.data))return wt(e.data)}function It(e){if(e>=Ve)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ve.toString(16)+" bytes");return e|0}function ta(e){return+e!=e&&(e=0),d.alloc(+e)}d.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==d.prototype};d.compare=function(t,r){if(U(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),U(r,Uint8Array)&&(r=d.from(r,r.offset,r.byteLength)),!d.isBuffer(t)||!d.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var n=t.length,o=r.length,a=0,s=Math.min(n,o);a<s;++a)if(t[a]!==r[a]){n=t[a],o=r[a];break}return n<o?-1:o<n?1:0};d.isEncoding=function(t){switch(String(t).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(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return d.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var o=d.allocUnsafe(r),a=0;for(n=0;n<t.length;++n){var s=t[n];if(U(s,Uint8Array))a+s.length>o.length?d.from(s).copy(o,a):Uint8Array.prototype.set.call(o,s,a);else if(d.isBuffer(s))s.copy(o,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=s.length}return o};function Wr(e,t){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||U(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 r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return At(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Zr(e).length;default:if(o)return n?-1:At(e).length;t=(""+t).toLowerCase(),o=!0}}d.byteLength=Wr;function ra(e,t,r){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return da(this,t,r);case"utf8":case"utf-8":return jr(this,t,r);case"ascii":return pa(this,t,r);case"latin1":case"binary":return ua(this,t,r);case"base64":return ca(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ma(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}d.prototype._isBuffer=!0;function oe(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}d.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)oe(this,r,r+1);return this};d.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)oe(this,r,r+3),oe(this,r+1,r+2);return this};d.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)oe(this,r,r+7),oe(this,r+1,r+6),oe(this,r+2,r+5),oe(this,r+3,r+4);return this};d.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?jr(this,0,t):ra.apply(this,arguments)};d.prototype.toLocaleString=d.prototype.toString;d.prototype.equals=function(t){if(!d.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:d.compare(this,t)===0};d.prototype.inspect=function(){var t="",r=ue.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Ur&&(d.prototype[Ur]=d.prototype.inspect);d.prototype.compare=function(t,r,n,o,a){if(U(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),r<0||n>t.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&r>=n)return 0;if(o>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,a>>>=0,this===t)return 0;for(var s=a-o,u=n-r,m=Math.min(s,u),g=this.slice(o,a),T=t.slice(r,n),f=0;f<m;++f)if(g[f]!==T[f]){s=g[f],u=T[f];break}return s<u?-1:u<s?1:0};function qr(e,t,r,n,o){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,kt(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof t=="string"&&(t=d.from(t,n)),d.isBuffer(t))return t.length===0?-1:Vr(e,t,r,n,o);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Vr(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function Vr(e,t,r,n,o){var a=1,s=e.length,u=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function m(S,A){return a===1?S[A]:S.readUInt16BE(A*a)}var g;if(o){var T=-1;for(g=r;g<s;g++)if(m(e,g)===m(t,T===-1?0:g-T)){if(T===-1&&(T=g),g-T+1===u)return T*a}else T!==-1&&(g-=g-T),T=-1}else for(r+u>s&&(r=s-u),g=r;g>=0;g--){for(var f=!0,y=0;y<u;y++)if(m(e,g+y)!==m(t,y)){f=!1;break}if(f)return g}return-1}d.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};d.prototype.indexOf=function(t,r,n){return qr(this,t,r,n,!0)};d.prototype.lastIndexOf=function(t,r,n){return qr(this,t,r,n,!1)};function na(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;var a=t.length;n>a/2&&(n=a/2);for(var s=0;s<n;++s){var u=parseInt(t.substr(s*2,2),16);if(kt(u))return s;e[r+s]=u}return s}function oa(e,t,r,n){return $e(At(t,e.length-r),e,r,n)}function ia(e,t,r,n){return $e(Ta(t),e,r,n)}function aa(e,t,r,n){return $e(Zr(t),e,r,n)}function sa(e,t,r,n){return $e(ya(t,e.length-r),e,r,n)}d.prototype.write=function(t,r,n,o){if(r===void 0)o="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")o=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-r;if((n===void 0||n>a)&&(n=a),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var s=!1;;)switch(o){case"hex":return na(this,t,r,n);case"utf8":case"utf-8":return oa(this,t,r,n);case"ascii":case"latin1":case"binary":return ia(this,t,r,n);case"base64":return aa(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sa(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),s=!0}};d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ca(e,t,r){return t===0&&r===e.length?St.fromByteArray(e):St.fromByteArray(e.slice(t,r))}function jr(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var a=e[o],s=null,u=a>239?4:a>223?3:a>191?2:1;if(o+u<=r){var m,g,T,f;switch(u){case 1:a<128&&(s=a);break;case 2:m=e[o+1],(m&192)===128&&(f=(a&31)<<6|m&63,f>127&&(s=f));break;case 3:m=e[o+1],g=e[o+2],(m&192)===128&&(g&192)===128&&(f=(a&15)<<12|(m&63)<<6|g&63,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:m=e[o+1],g=e[o+2],T=e[o+3],(m&192)===128&&(g&192)===128&&(T&192)===128&&(f=(a&15)<<18|(m&63)<<12|(g&63)<<6|T&63,f>65535&&f<1114112&&(s=f))}}s===null?(s=65533,u=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),o+=u}return la(n)}var $r=4096;function la(e){var t=e.length;if(t<=$r)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=$r));return r}function pa(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]&127);return n}function ua(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function da(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",a=t;a<r;++a)o+=ha[e[a]];return o}function ma(e,t,r){for(var n=e.slice(t,r),o="",a=0;a<n.length-1;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}d.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);var o=this.subarray(t,r);return Object.setPrototypeOf(o,d.prototype),o};function L(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||L(t,r,this.length);for(var o=this[t],a=1,s=0;++s<r&&(a*=256);)o+=this[t+s]*a;return o};d.prototype.readUintBE=d.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||L(t,r,this.length);for(var o=this[t+--r],a=1;r>0&&(a*=256);)o+=this[t+--r]*a;return o};d.prototype.readUint8=d.prototype.readUInt8=function(t,r){return t=t>>>0,r||L(t,1,this.length),this[t]};d.prototype.readUint16LE=d.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||L(t,2,this.length),this[t]|this[t+1]<<8};d.prototype.readUint16BE=d.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||L(t,2,this.length),this[t]<<8|this[t+1]};d.prototype.readUint32LE=d.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};d.prototype.readUint32BE=d.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};d.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||L(t,r,this.length);for(var o=this[t],a=1,s=0;++s<r&&(a*=256);)o+=this[t+s]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*r)),o};d.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||L(t,r,this.length);for(var o=r,a=1,s=this[t+--o];o>0&&(a*=256);)s+=this[t+--o]*a;return a*=128,s>=a&&(s-=Math.pow(2,8*r)),s};d.prototype.readInt8=function(t,r){return t=t>>>0,r||L(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};d.prototype.readInt16LE=function(t,r){t=t>>>0,r||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};d.prototype.readInt16BE=function(t,r){t=t>>>0,r||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};d.prototype.readInt32LE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};d.prototype.readInt32BE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};d.prototype.readFloatLE=function(t,r){return t=t>>>0,r||L(t,4,this.length),pe.read(this,t,!0,23,4)};d.prototype.readFloatBE=function(t,r){return t=t>>>0,r||L(t,4,this.length),pe.read(this,t,!1,23,4)};d.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||L(t,8,this.length),pe.read(this,t,!0,52,8)};d.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||L(t,8,this.length),pe.read(this,t,!1,52,8)};function N(e,t,r,n,o,a){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(t,r,n,o){if(t=+t,r=r>>>0,n=n>>>0,!o){var a=Math.pow(2,8*n)-1;N(this,t,r,n,a,0)}var s=1,u=0;for(this[r]=t&255;++u<n&&(s*=256);)this[r+u]=t/s&255;return r+n};d.prototype.writeUintBE=d.prototype.writeUIntBE=function(t,r,n,o){if(t=+t,r=r>>>0,n=n>>>0,!o){var a=Math.pow(2,8*n)-1;N(this,t,r,n,a,0)}var s=n-1,u=1;for(this[r+s]=t&255;--s>=0&&(u*=256);)this[r+s]=t/u&255;return r+n};d.prototype.writeUint8=d.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,1,255,0),this[r]=t&255,r+1};d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};d.prototype.writeIntLE=function(t,r,n,o){if(t=+t,r=r>>>0,!o){var a=Math.pow(2,8*n-1);N(this,t,r,n,a-1,-a)}var s=0,u=1,m=0;for(this[r]=t&255;++s<n&&(u*=256);)t<0&&m===0&&this[r+s-1]!==0&&(m=1),this[r+s]=(t/u>>0)-m&255;return r+n};d.prototype.writeIntBE=function(t,r,n,o){if(t=+t,r=r>>>0,!o){var a=Math.pow(2,8*n-1);N(this,t,r,n,a-1,-a)}var s=n-1,u=1,m=0;for(this[r+s]=t&255;--s>=0&&(u*=256);)t<0&&m===0&&this[r+s+1]!==0&&(m=1),this[r+s]=(t/u>>0)-m&255;return r+n};d.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};d.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};d.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};d.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};d.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||N(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function zr(e,t,r,n,o,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Kr(e,t,r,n,o){return t=+t,r=r>>>0,o||zr(e,t,r,4,34028234663852886e22,-34028234663852886e22),pe.write(e,t,r,n,23,4),r+4}d.prototype.writeFloatLE=function(t,r,n){return Kr(this,t,r,!0,n)};d.prototype.writeFloatBE=function(t,r,n){return Kr(this,t,r,!1,n)};function Yr(e,t,r,n,o){return t=+t,r=r>>>0,o||zr(e,t,r,8,17976931348623157e292,-17976931348623157e292),pe.write(e,t,r,n,52,8),r+8}d.prototype.writeDoubleLE=function(t,r,n){return Yr(this,t,r,!0,n)};d.prototype.writeDoubleBE=function(t,r,n){return Yr(this,t,r,!1,n)};d.prototype.copy=function(t,r,n,o){if(!d.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!o&&o!==0&&(o=this.length),r>=t.length&&(r=t.length),r||(r=0),o>0&&o<n&&(o=n),o===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-r<o-n&&(o=t.length-r+n);var a=o-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,o):Uint8Array.prototype.set.call(t,this.subarray(n,o),r),a};d.prototype.fill=function(t,r,n,o){if(typeof t=="string"){if(typeof r=="string"?(o=r,r=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!d.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(t.length===1){var a=t.charCodeAt(0);(o==="utf8"&&a<128||o==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var s;if(typeof t=="number")for(s=r;s<n;++s)this[s]=t;else{var u=d.isBuffer(t)?t:d.from(t,o),m=u.length;if(m===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<n-r;++s)this[s+r]=u[s%m]}return this};var ga=/[^+/0-9A-Za-z-_]/g;function fa(e){if(e=e.split("=")[0],e=e.trim().replace(ga,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function At(e,t){t=t||1/0;for(var r,n=e.length,o=null,a=[],s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function Ta(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function ya(e,t){for(var r,n,o,a=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,o=r%256,a.push(o),a.push(n);return a}function Zr(e){return St.toByteArray(fa(e))}function $e(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function U(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function kt(e){return e!==e}var ha=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=r*16,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}()});var rn=Be((zs,tn)=>{i();var v=tn.exports={},V,$;function Et(){throw new Error("setTimeout has not been defined")}function Lt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?V=setTimeout:V=Et}catch(e){V=Et}try{typeof clearTimeout=="function"?$=clearTimeout:$=Lt}catch(e){$=Lt}})();function Jr(e){if(V===setTimeout)return setTimeout(e,0);if((V===Et||!V)&&setTimeout)return V=setTimeout,setTimeout(e,0);try{return V(e,0)}catch(t){try{return V.call(null,e,0)}catch(r){return V.call(this,e,0)}}}function xa(e){if($===clearTimeout)return clearTimeout(e);if(($===Lt||!$)&&clearTimeout)return $=clearTimeout,clearTimeout(e);try{return $(e)}catch(t){try{return $.call(null,e)}catch(r){return $.call(this,e)}}}var W=[],de=!1,ie,He=-1;function Sa(){!de||!ie||(de=!1,ie.length?W=ie.concat(W):He=-1,W.length&&Qr())}function Qr(){if(!de){var e=Jr(Sa);de=!0;for(var t=W.length;t;){for(ie=W,W=[];++He<t;)ie&&ie[He].run();He=-1,t=W.length}ie=null,de=!1,xa(e)}}v.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];W.push(new en(e,t)),W.length===1&&!de&&Jr(Qr)};function en(e,t){this.fun=e,this.array=t}en.prototype.run=function(){this.fun.apply(null,this.array)};v.title="browser";v.browser=!0;v.env={};v.argv=[];v.version="";v.versions={};function q(){}v.on=q;v.addListener=q;v.once=q;v.off=q;v.removeListener=q;v.removeAllListeners=q;v.emit=q;v.prependListener=q;v.prependOnceListener=q;v.listeners=function(e){return[]};v.binding=function(e){throw new Error("process.binding is not supported")};v.cwd=function(){return"/"};v.chdir=function(e){throw new Error("process.chdir is not supported")};v.umask=function(){return 0}});var c,l,Ks,i=x(()=>{c=k(Xr()),l=k(rn()),Ks=function(e){function t(){var n=this||self;return delete e.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var r=__magic__;return r}(Object)});var O=x(()=>{"use strict";i()});function Nt(e){return e!=null&&(un(e)||fn(e))}function Ie(e){return e!=null&&(dn(e)||Tn(e))}function ke(e){return e!=null&&(mn(e)||yn(e))}function Ct(e){return e!=null&&gn(e)}function un(e){return e!=null&&nn.includes(e)}function dn(e){return e!=null&&on.includes(e)}function mn(e){return e!=null&&an.includes(e)}function gn(e){return e!=null&&sn.includes(e)}function fn(e){return e!=null&&cn.includes(e)}function Tn(e){return e!=null&&ln.includes(e)}function yn(e){return e!=null&&pn.includes(e)}var nn,on,an,sn,cn,ln,pn,Rt=x(()=>{"use strict";i();O();nn=["sent"],on=["success"],an=["fail","cancelled","timedOut"],sn=["timedOut"],cn=["pending"],ln=["success"],pn=["fail","invalid"]});var hn=x(()=>{"use strict";i()});var Pt,Y,D=x(()=>{"use strict";i();Pt=(n=>(n.nft="nft",n.esdt="esdt",n.egld="egld",n))(Pt||{}),Y=(o=>(o.raw="raw",o.text="text",o.decimal="decimal",o.smart="smart",o))(Y||{})});var xn=x(()=>{"use strict";i()});var Sn=x(()=>{"use strict";i()});var wn=x(()=>{"use strict";i()});var bn=x(()=>{"use strict";i()});var Z=x(()=>{"use strict";i();hn();D();O();xn();Sn();wn();bn()});var kn=x(()=>{"use strict";i()});var Ut,En,Ec,Ln,Lc,Dn,Dc,Nc,Cc,Nn=x(()=>{"use strict";i();Z();Ut={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:En,egldLabel:Ec}=Ut["devnet"],{chainId:Ln,egldLabel:Lc}=Ut["testnet"],{chainId:Dn,egldLabel:Dc}=Ut["mainnet"],Nc={["devnet"]:En,["testnet"]:Ln,["mainnet"]:Dn},Cc={[En]:"devnet",[Ln]:"testnet",[Dn]:"mainnet"}});var Vt=x(()=>{"use strict";i()});var Cn=x(()=>{"use strict";i()});var Rn,$t=x(()=>{"use strict";i();Rn="transaction-status-toast-id"});var Ht,Gt,F,Ee,Pn,We,Fn,qe,_n,Mn,X,E=x(()=>{"use strict";i();kn();Nn();Vt();Cn();$t();Ht=5e4,Gt=1e9,F=18,Ee=4,Pn=1,We=4294967295,Fn=4294967280,qe="logout",_n="login",Mn="refundedGas",X="0"});var Ke,zt=x(()=>{"use strict";i();Ke=()=>Date.now()/1e3});var Un=x(()=>{"use strict";i()});var Vn=x(()=>{"use strict";i()});var $n=x(()=>{"use strict";i();zt();Un();Vn()});var Yt={};re(Yt,{getItem:()=>Oa,localStorageKeys:()=>se,removeItem:()=>Ba,setItem:()=>Ma});var se,Kt,Ma,Oa,Ba,De=x(()=>{"use strict";i();$n();se={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Kt=typeof localStorage!="undefined",Ma=({key:e,data:t,expires:r})=>{!Kt||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Oa=e=>{if(!Kt)return;let t=localStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Ke()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},Ba=e=>{!Kt||localStorage.removeItem(String(e))}});var Zt={};re(Zt,{clear:()=>qn,getItem:()=>Gn,removeItem:()=>Wn,setItem:()=>Hn,storage:()=>Ua});var Hn,Gn,Wn,qn,Ua,jn=x(()=>{"use strict";i();Hn=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Gn=e=>{let t=sessionStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Date.now()>=r.expires?(sessionStorage.removeItem(String(e)),null):r.data},Wn=e=>sessionStorage.removeItem(String(e)),qn=()=>sessionStorage.clear(),Ua={setItem:Hn,getItem:Gn,removeItem:Wn,clear:qn}});var ge,Ye=x(()=>{"use strict";i();De();jn();ge={session:Zt,local:Yt}});function Ne(){return new Date().setHours(new Date().getHours()+24)}function Ce(e){ge.local.setItem({key:se.loginExpiresAt,data:e,expires:e})}var Xt=x(()=>{"use strict";i();Ye();De()});var Jt,C,Ze,J=x(()=>{"use strict";i();Jt=require("@reduxjs/toolkit");E();C=(0,Jt.createAction)(qe),Ze=(0,Jt.createAction)(_n,e=>({payload:e}))});var Kn,zn,Yn,Cl,Rl,Pl,Fl,_l,Ml,Zn,Xn,Qt=x(()=>{"use strict";i();Kn=require("@reduxjs/toolkit");Xt();O();J();zn={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Yn=(0,Kn.createSlice)({name:"loginInfoSlice",initialState:zn,reducers:{setLoginMethod:(e,t)=>{e.loginMethod=t.payload},setTokenLogin:(e,t)=>{e.tokenLogin=t.payload},setTokenLoginSignature:(e,t)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=t.payload)},setWalletLogin:(e,t)=>{e.walletLogin=t.payload},setWalletConnectLogin:(e,t)=>{e.walletConnectLogin=t.payload},setLedgerLogin:(e,t)=>{e.ledgerLogin=t.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0}},extraReducers:e=>{e.addCase(C,()=>zn),e.addCase(Ze,(t,r)=>{t.loginMethod=r.payload.loginMethod,Ce(Ne())})}}),{setLoginMethod:Cl,setWalletConnectLogin:Rl,setLedgerLogin:Pl,setTokenLogin:Fl,setTokenLoginSignature:_l,setWalletLogin:Ml,invalidateLoginSession:Zn}=Yn.actions,Xn=Yn.reducer});var Jn=x(()=>{"use strict";i()});var Qn=x(()=>{"use strict";i();Jn()});function er(e){return e[Math.floor(Math.random()*e.length)]}var eo=x(()=>{"use strict";i()});var to=x(()=>{"use strict";i();Vt()});var ro=x(()=>{"use strict";i();Qn();eo();to()});var no,oo,tr,$a,io,Jl,Ql,ao,rr=x(()=>{"use strict";i();no=require("@reduxjs/toolkit"),oo=k(require("lodash.omit"));ro();tr={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},$a={network:tr,chainID:"-1"},io=(0,no.createSlice)({name:"appConfig",initialState:$a,reducers:{initializeNetworkConfig:(e,t)=>{let r=er(t.payload.walletConnectBridgeAddresses),n=er(t.payload.walletConnectV2RelayAddresses),o=(0,oo.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=I(w(w({},e.network),o),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:n})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:Jl,setChainID:Ql}=io.actions,ao=io.reducer});var or,so,co,Xe,nr,lo,po,sp,uo,cp,lp,pp,up,dp,mp,gp,mo,ir=x(()=>{"use strict";i();or=require("@elrondnetwork/erdjs"),so=require("@reduxjs/toolkit"),co=require("redux-persist");E();Ye();De();J();Xe={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:X},nr={address:"",websocketEvent:null,accounts:{"":Xe},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},lo=(0,so.createSlice)({name:"accountInfoSlice",initialState:nr,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new or.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Xe},e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,t)=>{let{address:r}=e;e.accounts[r].nonce=t.payload},setAccountShard:(e,t)=>{e.shard=t.payload},setLedgerAccount:(e,t)=>{e.ledgerAccount=t.payload},updateLedgerAccount:(e,t)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=t.payload.index,e.ledgerAccount.address=t.payload.address)},setWalletConnectAccount:(e,t)=>{e.walletConnectAccount=t.payload},setIsAccountLoading:(e,t)=>{e.isAccountLoading=t.payload,e.accountLoadingError=null},setAccountLoadingError:(e,t)=>{e.accountLoadingError=t.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,t)=>{e.websocketEvent={timestamp:Date.now(),message:t.payload}}},extraReducers:e=>{e.addCase(C,()=>(ge.local.removeItem(se.loginExpiresAt),nr)),e.addCase(Ze,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new or.Address(n).hex()}),e.addCase(co.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:o,shard:a,accounts:s,publicKey:u}=n;t.address=o,t.shard=a;let m=s&&o in s;t.accounts=m?s:nr.accounts,t.publicKey=u})}}),{setAccount:po,setAddress:sp,setAccountNonce:uo,setAccountShard:cp,setLedgerAccount:lp,updateLedgerAccount:pp,setWalletConnectAccount:up,setIsAccountLoading:dp,setAccountLoadingError:mp,setWebsocketEvent:gp}=lo.actions,mo=lo.reducer});var go,fo,Re,Ha,To,wp,bp,Ap,vp,Ip,kp,Ep,Lp,Dp,Np,Je,Qe=x(()=>{"use strict";i();go=require("@reduxjs/toolkit"),fo=require("redux-persist");O();Rt();J();Re={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Ha={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},To=(0,go.createSlice)({name:"transactionsSlice",initialState:Re,reducers:{moveTransactionsToSignedState:(e,t)=>{var m,g;let{sessionId:r,transactions:n,errorMessage:o,status:a,redirectRoute:s}=t.payload,u=((m=e.customTransactionInformationForSessionId)==null?void 0:m[r])||Ha;e.signedTransactions[r]={transactions:n,status:a,errorMessage:o,redirectRoute:s,customTransactionInformation:u},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===r&&(e.transactionsToSign=Re.transactionsToSign)},clearSignedTransaction:(e,t)=>{e.signedTransactions[t.payload]&&delete e.signedTransactions[t.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,t)=>{e.signedTransactions=w(w({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:n,errorMessage:o,transactions:a}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=n,o!=null&&(e.signedTransactions[r].errorMessage=o),a!=null&&(e.signedTransactions[r].transactions=a))},updateSignedTransactionStatus:(e,t)=>{var u,m,g,T,f,y;let{sessionId:r,status:n,errorMessage:o,transactionHash:a}=t.payload,s=(m=(u=e.signedTransactions)==null?void 0:u[r])==null?void 0:m.transactions;if(s!=null){e.signedTransactions[r].transactions=s.map(b=>b.hash===a?I(w({},b),{status:n,errorMessage:o}):b);let S=(T=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:T.every(b=>Ie(b.status)),A=(y=(f=e.signedTransactions[r])==null?void 0:f.transactions)==null?void 0:y.every(b=>ke(b.status));S&&(e.signedTransactions[r].status="success"),A&&(e.signedTransactions[r].status="fail")}},setTransactionsToSign:(e,t)=>{e.transactionsToSign=t.payload;let{sessionId:r,customTransactionInformation:n}=t.payload;e.customTransactionInformationForSessionId[r]=n,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=Re.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Re.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(C,()=>Re),e.addCase(fo.REHYDRATE,(t,r)=>{var s;if(t.signTransactionsCancelMessage=null,!((s=r.payload)!=null&&s.transactions))return;let{signedTransactions:n,customTransactionInformationForSessionId:o}=r.payload.transactions,a=Object.entries(n).reduce((u,[m,g])=>{let T=new Date(m),f=new Date;return f.setHours(f.getHours()+5),f-T>0||(u[m]=g),u},{});o!=null&&(t.customTransactionInformationForSessionId=o),n!=null&&(t.signedTransactions=a)})}}),{updateSignedTransactionStatus:wp,updateSignedTransactions:bp,setTransactionsToSign:Ap,clearAllTransactionsToSign:vp,clearAllSignedTransactions:Ip,clearSignedTransaction:kp,clearTransactionToSign:Ep,setSignTransactionsError:Lp,setSignTransactionsCancelMessage:Dp,moveTransactionsToSignedState:Np}=To.actions,Je=To.reducer});var yo,sr,cr,lr,Ga,ar,ho,Fp,_p,Mp,et,tt=x(()=>{"use strict";i();yo=require("@reduxjs/toolkit");J();sr="Transaction failed",cr="Transaction successful",lr="Processing transaction",Ga="Transaction submitted",ar={},ho=(0,yo.createSlice)({name:"transactionsInfo",initialState:ar,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||sr,successMessage:(n==null?void 0:n.successMessage)||cr,processingMessage:(n==null?void 0:n.processingMessage)||lr,submittedMessage:(n==null?void 0:n.submittedMessage)||Ga,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>ar},extraReducers:e=>{e.addCase(C,()=>ar)}}),{clearTransactionsInfo:Fp,setTransactionsDisplayInfo:_p,clearTransactionsInfoForSessionId:Mp}=ho.actions,et=ho.reducer});var So,xo,wo,Vp,$p,Hp,Gp,bo,pr=x(()=>{"use strict";i();So=require("@reduxjs/toolkit");J();xo={},wo=(0,So.createSlice)({name:"modalsSlice",initialState:xo,reducers:{setTxSubmittedModal:(e,t)=>{e.txSubmittedModal=t.payload},setNotificationModal:(e,t)=>{e.notificationModal=t.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(C,()=>xo)}}),{setTxSubmittedModal:Vp,setNotificationModal:$p,clearTxSubmittedModal:Hp,clearNotificationModal:Gp}=wo.actions,bo=wo.reducer});var vo,Io,Ao,ko,Xp,Jp,Qp,eu,tu,ru,rt,nt=x(()=>{"use strict";i();vo=require("@reduxjs/toolkit"),Io=require("redux-persist");$t();Z();zt();J();Ao={customToasts:[],transactionToasts:[],failTransactionToast:null},ko=(0,vo.createSlice)({name:"toastsSlice",initialState:Ao,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(I(w({},t.payload),{type:"custom",toastId:t.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,t)=>{e.customToasts=e.customToasts.filter(r=>r.toastId!==t.payload)},addTransactionToast:(e,t)=>{e.transactionToasts.push({type:"transaction",startTimestamp:Ke(),toastId:t.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,t)=>{e.transactionToasts=e.transactionToasts.filter(r=>r.toastId!==t.payload)},addFailTransactionToast:(e,t)=>{e.failTransactionToast=I(w({},t.payload),{toastId:Rn})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(C,()=>Ao),e.addCase(Io.REHYDRATE,(t,r)=>{var o,a;let n=(a=(o=r.customToasts)==null?void 0:o.filter(s=>!("component"in s)))!=null?a:[];t.customToasts=n})}}),{addCustomToast:Xp,removeCustomToast:Jp,addTransactionToast:Qp,removeTransactionToast:eu,addFailTransactionToast:tu,removeFailTransactionToast:ru}=ko.actions,rt=ko.reducer});var fe=x(()=>{"use strict";i();Qt();rr();ir();Qe();tt();pr();nt()});var fr=x(()=>{"use strict";i()});var Po,Ro,Fo,Pd,Fd,_d,Md,Od,Bd,_o,Mo=x(()=>{"use strict";i();Po=require("@reduxjs/toolkit");J();Ro={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Fo=(0,Po.createSlice)({name:"dappModalsSlice",initialState:Ro,reducers:{setDappModalVisibility:(e,t)=>{e.visible=t.payload},setDappModalHeaderVisibility:(e,t)=>{e.modal.showHeader=t.payload},setDappModalFooterVisibility:(e,t)=>{e.modal.showFooter=t.payload},setDappModalHeaderText:(e,t)=>{e.modal.headerText=t.payload},setDappModalFooterText:(e,t)=>{e.modal.footerText=t.payload},setDappModalConfig:(e,t)=>{e.modal=w({},t.payload)}},extraReducers:e=>{e.addCase(C,()=>Ro)}}),{setDappModalVisibility:Pd,setDappModalHeaderVisibility:Fd,setDappModalFooterVisibility:_d,setDappModalHeaderText:Md,setDappModalFooterText:Od,setDappModalConfig:Bd}=Fo.actions,_o=Fo.reducer});var Oo,Ka,Ya,he,lt=x(()=>{"use strict";i();Oo=require("@reduxjs/toolkit");fr();ir();Mo();Qt();pr();rr();nt();tt();Qe();Ka={["account"]:mo,["networkConfig"]:ao,["loginInfo"]:Xn,["modals"]:bo,["dappModal"]:_o,["toasts"]:rt,["transactions"]:Je,["transactionsInfo"]:et},Ya=(e={})=>(0,Oo.combineReducers)(w(w({},Ka),e)),he=Ya});var Vo={};re(Vo,{default:()=>rs});function Tr(e,t=[]){return{key:e,version:1,storage:Uo.default,blacklist:t}}var ce,Bo,Uo,Za,Xa,Ja,Qa,es,ts,rs,$o=x(()=>{"use strict";i();ce=require("redux-persist"),Bo=k(require("redux-persist/lib/storage")),Uo=k(require("redux-persist/lib/storage/session"));lt();fe();nt();tt();Qe();fr();Za={2:e=>I(w({},e),{networkConfig:tr})};Xa=Tr("dapp-core-transactionsInfo"),Ja=Tr("dapp-core-transactions",["transactionsToSign"]),Qa=Tr("dapp-core-toasts"),es={key:"dapp-core-store",version:2,storage:Bo.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,ce.createMigrate)(Za,{debug:!1})},ts={["toasts"]:(0,ce.persistReducer)(Qa,rt),["transactions"]:(0,ce.persistReducer)(Ja,Je),["transactionsInfo"]:(0,ce.persistReducer)(Xa,et)},rs=(0,ce.persistReducer)(es,he(ts))});var Ho={};re(Ho,{default:()=>ns});var ns,Go=x(()=>{"use strict";i();lt();ns=he()});var Wo={};re(Wo,{default:()=>is});var _,os,is,qo=x(()=>{"use strict";i();_=require("redux-persist"),os=[_.FLUSH,_.REHYDRATE,_.PAUSE,_.PERSIST,_.PURGE,_.REGISTER],is=os});var Ko={};re(Ko,{default:()=>zo});function zo(e){return(0,jo.persistStore)(e)}var jo,Yo=x(()=>{"use strict";i();jo=require("redux-persist")});var $s={};re($s,{ACTIONS_WITH_EGLD_VALUE:()=>Si,ACTIONS_WITH_MANDATORY_OPERATIONS:()=>xi,ACTIONS_WITH_VALUE_IN_ACTION_FIELD:()=>bi,ACTIONS_WITH_VALUE_IN_DATA_FIELD:()=>wi,builtCallbackUrl:()=>Fa,failBatchTransactionsStates:()=>an,failServerTransactionsStates:()=>pn,getAllTransactionsLink:()=>ss,getAreTransactionsOnSameShard:()=>Ra,getEventListDataHexValue:()=>xs,getEventListHighlight:()=>Ss,getInterpretedTransaction:()=>hs,getIsTransactionFailed:()=>ke,getIsTransactionPending:()=>Nt,getIsTransactionSuccessful:()=>Ie,getIsTransactionTimedOut:()=>Ct,getOperationDirection:()=>ws,getOperationList:()=>Pi,getScResultsDecodedData:()=>bs,getScResultsHighlight:()=>As,getScamFlag:()=>vs,getShardText:()=>Is,getTokenFromData:()=>Bt,getTransactionActionNftText:()=>vr,getTransactionActionTokenText:()=>Ir,getTransactionFee:()=>Es,getTransactionLink:()=>as,getTransactionLinkWithLabel:()=>Ls,getTransactionMessages:()=>Ds,getTransactionStatus:()=>Ns,getTransactionStatusText:()=>Cs,getTrimmedHash:()=>Rs,getVisibleOperations:()=>Ai,isBatchTransactionFailed:()=>mn,isBatchTransactionPending:()=>un,isBatchTransactionSuccessful:()=>dn,isBatchTransactionTimedOut:()=>gn,isServerTransactionFailed:()=>yn,isServerTransactionPending:()=>fn,isServerTransactionSuccessful:()=>Tn,isTokenTransfer:()=>Ia,parseMultiEsdtTransferData:()=>ba,parseTransactionAfterSigning:()=>_a,pendingBatchTransactionsStates:()=>nn,pendingServerTransactionsStatuses:()=>cn,successBatchTransactionsStates:()=>on,successServerTransactionsStates:()=>ln,timedOutBatchTransactionsStates:()=>sn,transactionActionUnwrapper:()=>Ps,useDataDecode:()=>Os,useDataDecodeMethod:()=>Bs,useGetOperationList:()=>Vs});module.exports=ve($s);i();Rt();i();var Ft=k(require("bignumber.js"));Z();i();i();function Ge(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)return!1;return!0}function ae(e){let t=e;try{let r=c.Buffer.from(e,"hex").toString();Ge(r)&&r.length>1&&(t=r)}catch(r){}return t}i();var An=(e,t)=>{let r=[],n=e.indexOf(t,0);for(;n>=0;)r.push(n),n=e.indexOf(t,n+1);return r};function ba(e){let t=[],r=0;try{if((e==null?void 0:e.startsWith("MultiESDTNFTTransfer"))&&(e==null?void 0:e.includes("@"))){let[,n,o,...a]=e==null?void 0:e.split("@");if(n){let s=new Ft.default(o,16).toNumber(),u=0;for(let f=0;f<s;f++){let y={type:"nftTransaction",data:"",receiver:n};for(let S=0;S<3;S++){switch(S){case 0:y.token=ae(a[u]),y.data=a[u];break;case 1:{let A=a[u]&&a[u].length?a[u]:"";A?y.nonce=A:y.type="esdtTransaction",y.data=`${y.data}@${a[u]}`;break}case 2:y.amount=new Ft.default(a[u],16).toString(10),y.data=`${y.data}@${a[u]}`;break;default:break}r=u+1,u++}t[f]=y}let m=t.length!==s,g=t.some(f=>An(f.data,"@").length!==2),T=t.some(f=>f.data.startsWith("@"));if(m||g||T)return[];if(a[r]){let f=a[r];for(let y=r+1;y<a.length;y++)f+="@"+a[y];t[s]={type:"scCall",data:f,receiver:n}}}}}catch(n){return console.error("failed parsing tx",n),t}return t}i();var Mt=require("@elrondnetwork/erdjs"),Ot=k(require("bignumber.js"));O();i();var In=require("@elrondnetwork/erdjs");function Aa(e){try{let t=new In.Address(e);return Boolean(t.bech32())}catch(t){return!1}}function me(e){return(e==null?void 0:e.startsWith("erd"))&&e.length===62&&/^\w+$/.test(e)&&Aa(e)}var _t={tokenId:"",amount:""},va=e=>e.split("@").map((a,s)=>[2,3].includes(s)?a:ae(a));function Bt(e){if(!e)return _t;let t=e.startsWith("ESDTTransfer"),r=e.startsWith("ESDTNFTTransfer")&&e.includes("@");if(t){let[,n,o]=e.split("@");try{let a=c.Buffer.from(n,"hex").toString("ascii");if(!a)return _t;let s=new Ot.default("0x"+o.replace("0x","")).toString(10);return{tokenId:a,amount:s}}catch(a){console.error("Error getting token from transaction data",a)}}if(r)try{let[,n,o,a,s]=va(e);if([n,o,a,s].every(u=>Boolean(u))&&me(new Mt.Address(s).bech32()))return{tokenId:`${n}-${o}`,amount:new Ot.default(a,16).toString(10),collection:n,nonce:o,receiver:new Mt.Address(s).bech32()}}catch(n){}return _t}i();function Ia({tokenId:e,erdLabel:t}){return Boolean(e&&e!==t)}i();i();var qt=require("@elrondnetwork/erdjs/out");i();E();var ka=e=>{let t=c.Buffer.from([0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);if(e.slice(0,t.length).equals(t))return!0;let n=c.Buffer.alloc(32).fill(0);return e.equals(n)},Wt=e=>{try{let r=parseInt("11",2),n=parseInt("01",2),o=c.Buffer.from(e,"hex"),a=o[31];if(ka(o))return We;let s=a&r;return s>3-1&&(s=a&n),s}catch(t){return-1}};function On({receiverAddress:e,senderShard:t,senderAddress:r}){try{let n=new qt.Address(e),o=Wt(n.pubkey());if(t==null&&r!=null){let a=new qt.Address(r);return Wt(a)===o}return o===t}catch(n){return!1}}i();var Le=require("@elrondnetwork/erdjs");Z();i();function je(e){try{return c.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}var Ea=["ESDTNFTTransfer","ESDTNFTBurn","ESDTNFTAddQuantity","ESDTNFTCreate","MultiESDTNFTTransfer","ESDTTransfer","ESDTBurn","ESDTLocalMint","ESDTLocalBurn","ESDTWipe","ESDT