@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 181 kB
JavaScript
"use strict";var wi=Object.create;var Ke=Object.defineProperty,vi=Object.defineProperties,ki=Object.getOwnPropertyDescriptor,Ii=Object.getOwnPropertyDescriptors,Ai=Object.getOwnPropertyNames,so=Object.getOwnPropertySymbols,Ei=Object.getPrototypeOf,Zo=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable;var ut=(o,e,n)=>e in o?Ke(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n,T=(o,e)=>{for(var n in e||(e={}))Zo.call(e,n)&&ut(o,n,e[n]);if(so)for(var n of so(e))gt.call(e,n)&&ut(o,n,e[n]);return o},I=(o,e)=>vi(o,Ii(e));var mo=(o,e)=>{var n={};for(var r in o)Zo.call(o,r)&&e.indexOf(r)<0&&(n[r]=o[r]);if(o!=null&&so)for(var r of so(o))e.indexOf(r)<0&>.call(o,r)&&(n[r]=o[r]);return n};var y=(o,e)=>()=>(o&&(e=o(o=0)),e);var _o=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),Te=(o,e)=>{for(var n in e)Ke(o,n,{get:e[n],enumerable:!0})},ft=(o,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of Ai(e))!Zo.call(o,p)&&p!==n&&Ke(o,p,{get:()=>e[p],enumerable:!(r=ki(e,p))||r.enumerable});return o};var x=(o,e,n)=>(n=o!=null?wi(Ei(o)):{},ft(e||!o||!o.__esModule?Ke(n,"default",{value:o,enumerable:!0}):n,o)),Xe=o=>ft(Ke({},"__esModule",{value:!0}),o);var v=(o,e,n)=>new Promise((r,p)=>{var m=l=>{try{u(n.next(l))}catch(g){p(g)}},s=l=>{try{u(n.throw(l))}catch(g){p(g)}},u=l=>l.done?r(l.value):Promise.resolve(l.value).then(m,s);u((n=n.apply(o,e)).next())});var xt=_o(lo=>{"use strict";t();lo.byteLength=Ci;lo.toByteArray=Ni;lo.fromByteArray=Mi;var J=[],K=[],Li=typeof Uint8Array!="undefined"?Uint8Array:Array,Jo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(xe=0,ht=Jo.length;xe<ht;++xe)J[xe]=Jo[xe],K[Jo.charCodeAt(xe)]=xe;var xe,ht;K["-".charCodeAt(0)]=62;K["_".charCodeAt(0)]=63;function Tt(o){var e=o.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=o.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function Ci(o){var e=Tt(o),n=e[0],r=e[1];return(n+r)*3/4-r}function Pi(o,e,n){return(e+n)*3/4-n}function Ni(o){var e,n=Tt(o),r=n[0],p=n[1],m=new Li(Pi(o,r,p)),s=0,u=p>0?r-4:r,l;for(l=0;l<u;l+=4)e=K[o.charCodeAt(l)]<<18|K[o.charCodeAt(l+1)]<<12|K[o.charCodeAt(l+2)]<<6|K[o.charCodeAt(l+3)],m[s++]=e>>16&255,m[s++]=e>>8&255,m[s++]=e&255;return p===2&&(e=K[o.charCodeAt(l)]<<2|K[o.charCodeAt(l+1)]>>4,m[s++]=e&255),p===1&&(e=K[o.charCodeAt(l)]<<10|K[o.charCodeAt(l+1)]<<4|K[o.charCodeAt(l+2)]>>2,m[s++]=e>>8&255,m[s++]=e&255),m}function Di(o){return J[o>>18&63]+J[o>>12&63]+J[o>>6&63]+J[o&63]}function Ri(o,e,n){for(var r,p=[],m=e;m<n;m+=3)r=(o[m]<<16&16711680)+(o[m+1]<<8&65280)+(o[m+2]&255),p.push(Di(r));return p.join("")}function Mi(o){for(var e,n=o.length,r=n%3,p=[],m=16383,s=0,u=n-r;s<u;s+=m)p.push(Ri(o,s,s+m>u?u:s+m));return r===1?(e=o[n-1],p.push(J[e>>2]+J[e<<4&63]+"==")):r===2&&(e=(o[n-2]<<8)+o[n-1],p.push(J[e>>10]+J[e>>4&63]+J[e<<2&63]+"=")),p.join("")}});var yt=_o(Qo=>{t();Qo.read=function(o,e,n,r,p){var m,s,u=p*8-r-1,l=(1<<u)-1,g=l>>1,b=-7,h=n?p-1:0,w=n?-1:1,P=o[e+h];for(h+=w,m=P&(1<<-b)-1,P>>=-b,b+=u;b>0;m=m*256+o[e+h],h+=w,b-=8);for(s=m&(1<<-b)-1,m>>=-b,b+=r;b>0;s=s*256+o[e+h],h+=w,b-=8);if(m===0)m=1-g;else{if(m===l)return s?NaN:(P?-1:1)*(1/0);s=s+Math.pow(2,r),m=m-g}return(P?-1:1)*s*Math.pow(2,m-r)};Qo.write=function(o,e,n,r,p,m){var s,u,l,g=m*8-p-1,b=(1<<g)-1,h=b>>1,w=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=r?0:m-1,N=r?1:-1,B=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=b):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+h>=1?e+=w/l:e+=w*Math.pow(2,1-h),e*l>=2&&(s++,l/=2),s+h>=b?(u=0,s=b):s+h>=1?(u=(e*l-1)*Math.pow(2,p),s=s+h):(u=e*Math.pow(2,h-1)*Math.pow(2,p),s=0));p>=8;o[n+P]=u&255,P+=N,u/=256,p-=8);for(s=s<<p|u,g+=p;g>0;o[n+P]=s&255,P+=N,s/=256,g-=8);o[n+P-N]|=B*128}});var Dt=_o(De=>{"use strict";t();var en=xt(),Ne=yt(),bt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;De.Buffer=d;De.SlowBuffer=Gi;De.INSPECT_MAX_BYTES=50;var uo=2147483647;De.kMaxLength=uo;d.TYPED_ARRAY_SUPPORT=Fi();!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 Fi(){try{var o=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(o,e),o.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 ie(o){if(o>uo)throw new RangeError('The value "'+o+'" is invalid for option "size"');var e=new Uint8Array(o);return Object.setPrototypeOf(e,d.prototype),e}function d(o,e,n){if(typeof o=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return rn(o)}return vt(o,e,n)}d.poolSize=8192;function vt(o,e,n){if(typeof o=="string")return Bi(o,e);if(ArrayBuffer.isView(o))return Ui(o);if(o==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof o);if(Q(o,ArrayBuffer)||o&&Q(o.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Q(o,SharedArrayBuffer)||o&&Q(o.buffer,SharedArrayBuffer)))return nn(o,e,n);if(typeof o=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var r=o.valueOf&&o.valueOf();if(r!=null&&r!==o)return d.from(r,e,n);var p=Wi(o);if(p)return p;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof o[Symbol.toPrimitive]=="function")return d.from(o[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof o)}d.from=function(o,e,n){return vt(o,e,n)};Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function kt(o){if(typeof o!="number")throw new TypeError('"size" argument must be of type number');if(o<0)throw new RangeError('The value "'+o+'" is invalid for option "size"')}function Oi(o,e,n){return kt(o),o<=0?ie(o):e!==void 0?typeof n=="string"?ie(o).fill(e,n):ie(o).fill(e):ie(o)}d.alloc=function(o,e,n){return Oi(o,e,n)};function rn(o){return kt(o),ie(o<0?0:an(o)|0)}d.allocUnsafe=function(o){return rn(o)};d.allocUnsafeSlow=function(o){return rn(o)};function Bi(o,e){if((typeof e!="string"||e==="")&&(e="utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=It(o,e)|0,r=ie(n),p=r.write(o,e);return p!==n&&(r=r.slice(0,p)),r}function on(o){for(var e=o.length<0?0:an(o.length)|0,n=ie(e),r=0;r<e;r+=1)n[r]=o[r]&255;return n}function Ui(o){if(Q(o,Uint8Array)){var e=new Uint8Array(o);return nn(e.buffer,e.byteOffset,e.byteLength)}return on(o)}function nn(o,e,n){if(e<0||o.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(o.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return e===void 0&&n===void 0?r=new Uint8Array(o):n===void 0?r=new Uint8Array(o,e):r=new Uint8Array(o,e,n),Object.setPrototypeOf(r,d.prototype),r}function Wi(o){if(d.isBuffer(o)){var e=an(o.length)|0,n=ie(e);return n.length===0||o.copy(n,0,0,e),n}if(o.length!==void 0)return typeof o.length!="number"||cn(o.length)?ie(0):on(o);if(o.type==="Buffer"&&Array.isArray(o.data))return on(o.data)}function an(o){if(o>=uo)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+uo.toString(16)+" bytes");return o|0}function Gi(o){return+o!=o&&(o=0),d.alloc(+o)}d.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==d.prototype};d.compare=function(e,n){if(Q(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),Q(n,Uint8Array)&&(n=d.from(n,n.offset,n.byteLength)),!d.isBuffer(e)||!d.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===n)return 0;for(var r=e.length,p=n.length,m=0,s=Math.min(r,p);m<s;++m)if(e[m]!==n[m]){r=e[m],p=n[m];break}return r<p?-1:p<r?1:0};d.isEncoding=function(e){switch(String(e).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(e,n){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return d.alloc(0);var r;if(n===void 0)for(n=0,r=0;r<e.length;++r)n+=e[r].length;var p=d.allocUnsafe(n),m=0;for(r=0;r<e.length;++r){var s=e[r];if(Q(s,Uint8Array))m+s.length>p.length?d.from(s).copy(p,m):Uint8Array.prototype.set.call(p,s,m);else if(d.isBuffer(s))s.copy(p,m);else throw new TypeError('"list" argument must be an Array of Buffers');m+=s.length}return p};function It(o,e){if(d.isBuffer(o))return o.length;if(ArrayBuffer.isView(o)||Q(o,ArrayBuffer))return o.byteLength;if(typeof o!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof o);var n=o.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;for(var p=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return tn(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Nt(o).length;default:if(p)return r?-1:tn(o).length;e=(""+e).toLowerCase(),p=!0}}d.byteLength=It;function $i(o,e,n){var r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,e>>>=0,n<=e))return"";for(o||(o="utf8");;)switch(o){case"hex":return Ji(this,e,n);case"utf8":case"utf-8":return Et(this,e,n);case"ascii":return Yi(this,e,n);case"latin1":case"binary":return Zi(this,e,n);case"base64":return Ki(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Qi(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),r=!0}}d.prototype._isBuffer=!0;function ye(o,e,n){var r=o[e];o[e]=o[n],o[n]=r}d.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<e;n+=2)ye(this,n,n+1);return this};d.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<e;n+=4)ye(this,n,n+3),ye(this,n+1,n+2);return this};d.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<e;n+=8)ye(this,n,n+7),ye(this,n+1,n+6),ye(this,n+2,n+5),ye(this,n+3,n+4);return this};d.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?Et(this,0,e):$i.apply(this,arguments)};d.prototype.toLocaleString=d.prototype.toString;d.prototype.equals=function(e){if(!d.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:d.compare(this,e)===0};d.prototype.inspect=function(){var e="",n=De.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"};bt&&(d.prototype[bt]=d.prototype.inspect);d.prototype.compare=function(e,n,r,p,m){if(Q(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(n===void 0&&(n=0),r===void 0&&(r=e?e.length:0),p===void 0&&(p=0),m===void 0&&(m=this.length),n<0||r>e.length||p<0||m>this.length)throw new RangeError("out of range index");if(p>=m&&n>=r)return 0;if(p>=m)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,p>>>=0,m>>>=0,this===e)return 0;for(var s=m-p,u=r-n,l=Math.min(s,u),g=this.slice(p,m),b=e.slice(n,r),h=0;h<l;++h)if(g[h]!==b[h]){s=g[h],u=b[h];break}return s<u?-1:u<s?1:0};function At(o,e,n,r,p){if(o.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:o.length-1),n<0&&(n=o.length+n),n>=o.length){if(p)return-1;n=o.length-1}else if(n<0)if(p)n=0;else return-1;if(typeof e=="string"&&(e=d.from(e,r)),d.isBuffer(e))return e.length===0?-1:St(o,e,n,r,p);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?p?Uint8Array.prototype.indexOf.call(o,e,n):Uint8Array.prototype.lastIndexOf.call(o,e,n):St(o,[e],n,r,p);throw new TypeError("val must be string, number or Buffer")}function St(o,e,n,r,p){var m=1,s=o.length,u=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(o.length<2||e.length<2)return-1;m=2,s/=2,u/=2,n/=2}function l(P,N){return m===1?P[N]:P.readUInt16BE(N*m)}var g;if(p){var b=-1;for(g=n;g<s;g++)if(l(o,g)===l(e,b===-1?0:g-b)){if(b===-1&&(b=g),g-b+1===u)return b*m}else b!==-1&&(g-=g-b),b=-1}else for(n+u>s&&(n=s-u),g=n;g>=0;g--){for(var h=!0,w=0;w<u;w++)if(l(o,g+w)!==l(e,w)){h=!1;break}if(h)return g}return-1}d.prototype.includes=function(e,n,r){return this.indexOf(e,n,r)!==-1};d.prototype.indexOf=function(e,n,r){return At(this,e,n,r,!0)};d.prototype.lastIndexOf=function(e,n,r){return At(this,e,n,r,!1)};function Vi(o,e,n,r){n=Number(n)||0;var p=o.length-n;r?(r=Number(r),r>p&&(r=p)):r=p;var m=e.length;r>m/2&&(r=m/2);for(var s=0;s<r;++s){var u=parseInt(e.substr(s*2,2),16);if(cn(u))return s;o[n+s]=u}return s}function Hi(o,e,n,r){return go(tn(e,o.length-n),o,n,r)}function ji(o,e,n,r){return go(nc(e),o,n,r)}function zi(o,e,n,r){return go(Nt(e),o,n,r)}function qi(o,e,n,r){return go(tc(e,o.length-n),o,n,r)}d.prototype.write=function(e,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 m=this.length-n;if((r===void 0||r>m)&&(r=m),e.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");p||(p="utf8");for(var s=!1;;)switch(p){case"hex":return Vi(this,e,n,r);case"utf8":case"utf-8":return Hi(this,e,n,r);case"ascii":case"latin1":case"binary":return ji(this,e,n,r);case"base64":return zi(this,e,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qi(this,e,n,r);default:if(s)throw new TypeError("Unknown encoding: "+p);p=(""+p).toLowerCase(),s=!0}};d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ki(o,e,n){return e===0&&n===o.length?en.fromByteArray(o):en.fromByteArray(o.slice(e,n))}function Et(o,e,n){n=Math.min(o.length,n);for(var r=[],p=e;p<n;){var m=o[p],s=null,u=m>239?4:m>223?3:m>191?2:1;if(p+u<=n){var l,g,b,h;switch(u){case 1:m<128&&(s=m);break;case 2:l=o[p+1],(l&192)===128&&(h=(m&31)<<6|l&63,h>127&&(s=h));break;case 3:l=o[p+1],g=o[p+2],(l&192)===128&&(g&192)===128&&(h=(m&15)<<12|(l&63)<<6|g&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:l=o[p+1],g=o[p+2],b=o[p+3],(l&192)===128&&(g&192)===128&&(b&192)===128&&(h=(m&15)<<18|(l&63)<<12|(g&63)<<6|b&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,u=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),p+=u}return Xi(r)}var wt=4096;function Xi(o){var e=o.length;if(e<=wt)return String.fromCharCode.apply(String,o);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,o.slice(r,r+=wt));return n}function Yi(o,e,n){var r="";n=Math.min(o.length,n);for(var p=e;p<n;++p)r+=String.fromCharCode(o[p]&127);return r}function Zi(o,e,n){var r="";n=Math.min(o.length,n);for(var p=e;p<n;++p)r+=String.fromCharCode(o[p]);return r}function Ji(o,e,n){var r=o.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var p="",m=e;m<n;++m)p+=rc[o[m]];return p}function Qi(o,e,n){for(var r=o.slice(e,n),p="",m=0;m<r.length-1;m+=2)p+=String.fromCharCode(r[m]+r[m+1]*256);return p}d.prototype.slice=function(e,n){var r=this.length;e=~~e,n=n===void 0?r:~~n,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n<e&&(n=e);var p=this.subarray(e,n);return Object.setPrototypeOf(p,d.prototype),p};function F(o,e,n){if(o%1!==0||o<0)throw new RangeError("offset is not uint");if(o+e>n)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(e,n,r){e=e>>>0,n=n>>>0,r||F(e,n,this.length);for(var p=this[e],m=1,s=0;++s<n&&(m*=256);)p+=this[e+s]*m;return p};d.prototype.readUintBE=d.prototype.readUIntBE=function(e,n,r){e=e>>>0,n=n>>>0,r||F(e,n,this.length);for(var p=this[e+--n],m=1;n>0&&(m*=256);)p+=this[e+--n]*m;return p};d.prototype.readUint8=d.prototype.readUInt8=function(e,n){return e=e>>>0,n||F(e,1,this.length),this[e]};d.prototype.readUint16LE=d.prototype.readUInt16LE=function(e,n){return e=e>>>0,n||F(e,2,this.length),this[e]|this[e+1]<<8};d.prototype.readUint16BE=d.prototype.readUInt16BE=function(e,n){return e=e>>>0,n||F(e,2,this.length),this[e]<<8|this[e+1]};d.prototype.readUint32LE=d.prototype.readUInt32LE=function(e,n){return e=e>>>0,n||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};d.prototype.readUint32BE=d.prototype.readUInt32BE=function(e,n){return e=e>>>0,n||F(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};d.prototype.readIntLE=function(e,n,r){e=e>>>0,n=n>>>0,r||F(e,n,this.length);for(var p=this[e],m=1,s=0;++s<n&&(m*=256);)p+=this[e+s]*m;return m*=128,p>=m&&(p-=Math.pow(2,8*n)),p};d.prototype.readIntBE=function(e,n,r){e=e>>>0,n=n>>>0,r||F(e,n,this.length);for(var p=n,m=1,s=this[e+--p];p>0&&(m*=256);)s+=this[e+--p]*m;return m*=128,s>=m&&(s-=Math.pow(2,8*n)),s};d.prototype.readInt8=function(e,n){return e=e>>>0,n||F(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};d.prototype.readInt16LE=function(e,n){e=e>>>0,n||F(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};d.prototype.readInt16BE=function(e,n){e=e>>>0,n||F(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};d.prototype.readInt32LE=function(e,n){return e=e>>>0,n||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};d.prototype.readInt32BE=function(e,n){return e=e>>>0,n||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};d.prototype.readFloatLE=function(e,n){return e=e>>>0,n||F(e,4,this.length),Ne.read(this,e,!0,23,4)};d.prototype.readFloatBE=function(e,n){return e=e>>>0,n||F(e,4,this.length),Ne.read(this,e,!1,23,4)};d.prototype.readDoubleLE=function(e,n){return e=e>>>0,n||F(e,8,this.length),Ne.read(this,e,!0,52,8)};d.prototype.readDoubleBE=function(e,n){return e=e>>>0,n||F(e,8,this.length),Ne.read(this,e,!1,52,8)};function H(o,e,n,r,p,m){if(!d.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>p||e<m)throw new RangeError('"value" argument is out of bounds');if(n+r>o.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(e,n,r,p){if(e=+e,n=n>>>0,r=r>>>0,!p){var m=Math.pow(2,8*r)-1;H(this,e,n,r,m,0)}var s=1,u=0;for(this[n]=e&255;++u<r&&(s*=256);)this[n+u]=e/s&255;return n+r};d.prototype.writeUintBE=d.prototype.writeUIntBE=function(e,n,r,p){if(e=+e,n=n>>>0,r=r>>>0,!p){var m=Math.pow(2,8*r)-1;H(this,e,n,r,m,0)}var s=r-1,u=1;for(this[n+s]=e&255;--s>=0&&(u*=256);)this[n+s]=e/u&255;return n+r};d.prototype.writeUint8=d.prototype.writeUInt8=function(e,n,r){return e=+e,n=n>>>0,r||H(this,e,n,1,255,0),this[n]=e&255,n+1};d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(e,n,r){return e=+e,n=n>>>0,r||H(this,e,n,2,65535,0),this[n]=e&255,this[n+1]=e>>>8,n+2};d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(e,n,r){return e=+e,n=n>>>0,r||H(this,e,n,2,65535,0),this[n]=e>>>8,this[n+1]=e&255,n+2};d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(e,n,r){return e=+e,n=n>>>0,r||H(this,e,n,4,4294967295,0),this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=e&255,n+4};d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(e,n,r){return e=+e,n=n>>>0,r||H(this,e,n,4,4294967295,0),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e&255,n+4};d.prototype.writeIntLE=function(e,n,r,p){if(e=+e,n=n>>>0,!p){var m=Math.pow(2,8*r-1);H(this,e,n,r,m-1,-m)}var s=0,u=1,l=0;for(this[n]=e&255;++s<r&&(u*=256);)e<0&&l===0&&this[n+s-1]!==0&&(l=1),this[n+s]=(e/u>>0)-l&255;return n+r};d.prototype.writeIntBE=function(e,n,r,p){if(e=+e,n=n>>>0,!p){var m=Math.pow(2,8*r-1);H(this,e,n,r,m-1,-m)}var s=r-1,u=1,l=0;for(this[n+s]=e&255;--s>=0&&(u*=256);)e<0&&l===0&&this[n+s+1]!==0&&(l=1),this[n+s]=(e/u>>0)-l&255;return n+r};d.prototype.writeInt8=function(e,n,r){return e=+e,n=n>>>0,r||H(this,e,n,1,127,-128),e<0&&(e=255+e+1),this[n]=e&255,n+1};d.prototype.writeInt16LE=function(e,n,r){return e=+e,n=n>>>0,r||H(this,e,n,2,32767,-32768),this[n]=e&255,this[n+1]=e>>>8,n+2};d.prototype.writeInt16BE=function(e,n,r){return e=+e,n=n>>>0,r||H(this,e,n,2,32767,-32768),this[n]=e>>>8,this[n+1]=e&255,n+2};d.prototype.writeInt32LE=function(e,n,r){return e=+e,n=n>>>0,r||H(this,e,n,4,2147483647,-2147483648),this[n]=e&255,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24,n+4};d.prototype.writeInt32BE=function(e,n,r){return e=+e,n=n>>>0,r||H(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e&255,n+4};function Lt(o,e,n,r,p,m){if(n+r>o.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Ct(o,e,n,r,p){return e=+e,n=n>>>0,p||Lt(o,e,n,4,34028234663852886e22,-34028234663852886e22),Ne.write(o,e,n,r,23,4),n+4}d.prototype.writeFloatLE=function(e,n,r){return Ct(this,e,n,!0,r)};d.prototype.writeFloatBE=function(e,n,r){return Ct(this,e,n,!1,r)};function Pt(o,e,n,r,p){return e=+e,n=n>>>0,p||Lt(o,e,n,8,17976931348623157e292,-17976931348623157e292),Ne.write(o,e,n,r,52,8),n+8}d.prototype.writeDoubleLE=function(e,n,r){return Pt(this,e,n,!0,r)};d.prototype.writeDoubleBE=function(e,n,r){return Pt(this,e,n,!1,r)};d.prototype.copy=function(e,n,r,p){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!p&&p!==0&&(p=this.length),n>=e.length&&(n=e.length),n||(n=0),p>0&&p<r&&(p=r),p===r||e.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),e.length-n<p-r&&(p=e.length-n+r);var m=p-r;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,r,p):Uint8Array.prototype.set.call(e,this.subarray(r,p),n),m};d.prototype.fill=function(e,n,r,p){if(typeof e=="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(e.length===1){var m=e.charCodeAt(0);(p==="utf8"&&m<128||p==="latin1")&&(e=m)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));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,e||(e=0);var s;if(typeof e=="number")for(s=n;s<r;++s)this[s]=e;else{var u=d.isBuffer(e)?e:d.from(e,p),l=u.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-n;++s)this[s+n]=u[s%l]}return this};var ec=/[^+/0-9A-Za-z-_]/g;function oc(o){if(o=o.split("=")[0],o=o.trim().replace(ec,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function tn(o,e){e=e||1/0;for(var n,r=o.length,p=null,m=[],s=0;s<r;++s){if(n=o.charCodeAt(s),n>55295&&n<57344){if(!p){if(n>56319){(e-=3)>-1&&m.push(239,191,189);continue}else if(s+1===r){(e-=3)>-1&&m.push(239,191,189);continue}p=n;continue}if(n<56320){(e-=3)>-1&&m.push(239,191,189),p=n;continue}n=(p-55296<<10|n-56320)+65536}else p&&(e-=3)>-1&&m.push(239,191,189);if(p=null,n<128){if((e-=1)<0)break;m.push(n)}else if(n<2048){if((e-=2)<0)break;m.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;m.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;m.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return m}function nc(o){for(var e=[],n=0;n<o.length;++n)e.push(o.charCodeAt(n)&255);return e}function tc(o,e){for(var n,r,p,m=[],s=0;s<o.length&&!((e-=2)<0);++s)n=o.charCodeAt(s),r=n>>8,p=n%256,m.push(p),m.push(r);return m}function Nt(o){return en.toByteArray(oc(o))}function go(o,e,n,r){for(var p=0;p<r&&!(p+n>=e.length||p>=o.length);++p)e[p+n]=o[p];return p}function Q(o,e){return o instanceof e||o!=null&&o.constructor!=null&&o.constructor.name!=null&&o.constructor.name===e.name}function cn(o){return o!==o}var rc=function(){for(var o="0123456789abcdef",e=new Array(256),n=0;n<16;++n)for(var r=n*16,p=0;p<16;++p)e[r+p]=o[n]+o[p];return e}()});var Bt=_o((om,Ot)=>{t();var M=Ot.exports={},ee,oe;function pn(){throw new Error("setTimeout has not been defined")}function sn(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ee=setTimeout:ee=pn}catch(o){ee=pn}try{typeof clearTimeout=="function"?oe=clearTimeout:oe=sn}catch(o){oe=sn}})();function Rt(o){if(ee===setTimeout)return setTimeout(o,0);if((ee===pn||!ee)&&setTimeout)return ee=setTimeout,setTimeout(o,0);try{return ee(o,0)}catch(e){try{return ee.call(null,o,0)}catch(n){return ee.call(this,o,0)}}}function ac(o){if(oe===clearTimeout)return clearTimeout(o);if((oe===sn||!oe)&&clearTimeout)return oe=clearTimeout,clearTimeout(o);try{return oe(o)}catch(e){try{return oe.call(null,o)}catch(n){return oe.call(this,o)}}}var ce=[],Re=!1,be,fo=-1;function ic(){!Re||!be||(Re=!1,be.length?ce=be.concat(ce):fo=-1,ce.length&&Mt())}function Mt(){if(!Re){var o=Rt(ic);Re=!0;for(var e=ce.length;e;){for(be=ce,ce=[];++fo<e;)be&&be[fo].run();fo=-1,e=ce.length}be=null,Re=!1,ac(o)}}M.nextTick=function(o){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];ce.push(new Ft(o,e)),ce.length===1&&!Re&&Rt(Mt)};function Ft(o,e){this.fun=o,this.array=e}Ft.prototype.run=function(){this.fun.apply(null,this.array)};M.title="browser";M.browser=!0;M.env={};M.argv=[];M.version="";M.versions={};function pe(){}M.on=pe;M.addListener=pe;M.once=pe;M.off=pe;M.removeListener=pe;M.removeAllListeners=pe;M.emit=pe;M.prependListener=pe;M.prependOnceListener=pe;M.listeners=function(o){return[]};M.binding=function(o){throw new Error("process.binding is not supported")};M.cwd=function(){return"/"};M.chdir=function(o){throw new Error("process.chdir is not supported")};M.umask=function(){return 0}});var a,i,nm,t=y(()=>{a=x(Dt()),i=x(Bt()),nm=function(o){function e(){var r=this||self;return delete o.prototype.__magic__,r}if(typeof globalThis=="object")return globalThis;if(this)return e();o.defineProperty(o.prototype,"__magic__",{configurable:!0,get:e});var n=__magic__;return n}(Object)});var ho,mn=y(()=>{"use strict";t();ho=()=>Date.now()/1e3});var Ut=y(()=>{"use strict";t()});var Wt=y(()=>{"use strict";t()});var dn=y(()=>{"use strict";t();mn();Ut();Wt()});var ln={};Te(ln,{getItem:()=>pc,localStorageKeys:()=>ue,removeItem:()=>sc,setItem:()=>cc});var ue,_n,cc,pc,sc,Me=y(()=>{"use strict";t();dn();ue={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},_n=typeof localStorage!="undefined",cc=({key:o,data:e,expires:n})=>{!_n||localStorage.setItem(String(o),JSON.stringify({expires:n,data:e}))},pc=o=>{if(!_n)return;let e=localStorage.getItem(String(o));if(!e)return null;let n=JSON.parse(e);return!n||!n.hasOwnProperty("expires")||!n.hasOwnProperty("data")?null:ho()>=n.expires?(localStorage.removeItem(String(o)),null):n.data},sc=o=>{!_n||localStorage.removeItem(String(o))}});var un={};Te(un,{clear:()=>Ht,getItem:()=>$t,removeItem:()=>Vt,setItem:()=>Gt,storage:()=>mc});var Gt,$t,Vt,Ht,mc,jt=y(()=>{"use strict";t();Gt=({key:o,data:e,expires:n})=>{sessionStorage.setItem(String(o),JSON.stringify({expires:n,data:e}))},$t=o=>{let e=sessionStorage.getItem(String(o));if(!e)return null;let n=JSON.parse(e);return!n||!n.hasOwnProperty("expires")||!n.hasOwnProperty("data")?null:Date.now()>=n.expires?(sessionStorage.removeItem(String(o)),null):n.data},Vt=o=>sessionStorage.removeItem(String(o)),Ht=()=>sessionStorage.clear(),mc={setItem:Gt,getItem:$t,removeItem:Vt,clear:Ht}});var Se,Fe=y(()=>{"use strict";t();Me();jt();Se={session:un,local:ln}});function Ye(){return new Date().setHours(new Date().getHours()+24)}function Ze(o){Se.local.setItem({key:ue.loginExpiresAt,data:o,expires:o})}var gn=y(()=>{"use strict";t();Fe();Me()});var D=y(()=>{"use strict";t()});var Oe=y(()=>{"use strict";t()});var zt=y(()=>{"use strict";t()});var W=y(()=>{"use strict";t()});var qt=y(()=>{"use strict";t()});var Kt=y(()=>{"use strict";t()});var Xt=y(()=>{"use strict";t()});var Yt=y(()=>{"use strict";t()});var z=y(()=>{"use strict";t();zt();W();D();qt();Kt();Xt();Yt()});var fn,Zt,Cm,Jt,Pm,Qt,Nm,Dm,Rm,er=y(()=>{"use strict";t();z();fn={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:Zt,egldLabel:Cm}=fn["devnet"],{chainId:Jt,egldLabel:Pm}=fn["testnet"],{chainId:Qt,egldLabel:Nm}=fn["mainnet"],Dm={["devnet"]:Zt,["testnet"]:Jt,["mainnet"]:Qt},Rm={[Zt]:"devnet",[Jt]:"testnet",[Qt]:"mainnet"}});var hn=y(()=>{"use strict";t()});var or=y(()=>{"use strict";t()});var To,Tn=y(()=>{"use strict";t();To="transaction-status-toast-id"});var Je,xo,ne,yo,nr,bo,tr,rr,we,E=y(()=>{"use strict";t();Oe();er();hn();or();Tn();Je=5e4,xo=1e9,ne=18,yo=4,nr=1,bo="logout",tr="login",rr="N/A",we="0"});var xn,G,se,j=y(()=>{"use strict";t();xn=require("@reduxjs/toolkit");E();G=(0,xn.createAction)(bo),se=(0,xn.createAction)(tr,o=>({payload:o}))});var ir,ar,cr,Jm,pr,dc,Qe,sr,_c,mr,dr,yn=y(()=>{"use strict";t();ir=require("@reduxjs/toolkit");gn();D();j();ar={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},cr=(0,ir.createSlice)({name:"loginInfoSlice",initialState:ar,reducers:{setLoginMethod:(o,e)=>{o.loginMethod=e.payload},setTokenLogin:(o,e)=>{o.tokenLogin=e.payload},setTokenLoginSignature:(o,e)=>{(o==null?void 0:o.tokenLogin)!=null&&(o.tokenLogin.signature=e.payload)},setWalletLogin:(o,e)=>{o.walletLogin=e.payload},setWalletConnectLogin:(o,e)=>{o.walletConnectLogin=e.payload},setLedgerLogin:(o,e)=>{o.ledgerLogin=e.payload},invalidateLoginSession:o=>{o.isLoginSessionInvalid=!0}},extraReducers:o=>{o.addCase(G,()=>ar),o.addCase(se,(e,n)=>{e.loginMethod=n.payload.loginMethod,Ze(Ye())})}}),{setLoginMethod:Jm,setWalletConnectLogin:pr,setLedgerLogin:dc,setTokenLogin:Qe,setTokenLoginSignature:sr,setWalletLogin:_c,invalidateLoginSession:mr}=cr.actions,dr=cr.reducer});var eo=y(()=>{"use strict";t()});var lr=y(()=>{"use strict";t();eo()});function bn(o){return o[Math.floor(Math.random()*o.length)]}var ur=y(()=>{"use strict";t()});var Sn=y(()=>{"use strict";t();hn()});var Be=y(()=>{"use strict";t();lr();ur();Sn()});var gr,fr,wn,lc,hr,ld,ud,Tr,vn=y(()=>{"use strict";t();gr=require("@reduxjs/toolkit"),fr=x(require("lodash.omit"));Be();wn={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},lc={network:wn,chainID:"-1"},hr=(0,gr.createSlice)({name:"appConfig",initialState:lc,reducers:{initializeNetworkConfig:(o,e)=>{let n=bn(e.payload.walletConnectBridgeAddresses),r=bn(e.payload.walletConnectV2RelayAddresses),p=(0,fr.default)(e.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");o.network=I(T(T({},o.network),p),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(o,e)=>{o.chainID=e.payload}}}),{initializeNetworkConfig:ld,setChainID:ud}=hr.actions,Tr=hr.reducer});var In,xr,yr,So,kn,br,An,Sd,En,wd,uc,gc,vd,kd,Id,fc,Sr,Ln=y(()=>{"use strict";t();In=require("@elrondnetwork/erdjs"),xr=require("@reduxjs/toolkit"),yr=require("redux-persist");E();Fe();Me();j();So={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:we},kn={address:"",websocketEvent:null,accounts:{"":So},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},br=(0,xr.createSlice)({name:"accountInfoSlice",initialState:kn,reducers:{setAddress:(o,e)=>{let n=e.payload;o.address=n,o.publicKey=new In.Address(n).hex()},setAccount:(o,e)=>{let n=o.address===e.payload.address;o.accounts={[o.address]:n?e.payload:So},o.isAccountLoading=!1,o.accountLoadingError=null},setAccountNonce:(o,e)=>{let{address:n}=o;o.accounts[n].nonce=e.payload},setAccountShard:(o,e)=>{o.shard=e.payload},setLedgerAccount:(o,e)=>{o.ledgerAccount=e.payload},updateLedgerAccount:(o,e)=>{o.ledgerAccount!=null&&(o.ledgerAccount.index=e.payload.index,o.ledgerAccount.address=e.payload.address)},setWalletConnectAccount:(o,e)=>{o.walletConnectAccount=e.payload},setIsAccountLoading:(o,e)=>{o.isAccountLoading=e.payload,o.accountLoadingError=null},setAccountLoadingError:(o,e)=>{o.accountLoadingError=e.payload,o.isAccountLoading=!1},setWebsocketEvent:(o,e)=>{o.websocketEvent={timestamp:Date.now(),message:e.payload}}},extraReducers:o=>{o.addCase(G,()=>(Se.local.removeItem(ue.loginExpiresAt),kn)),o.addCase(se,(e,n)=>{let{address:r}=n.payload;e.address=r,e.publicKey=new In.Address(r).hex()}),o.addCase(yr.REHYDRATE,(e,n)=>{var g;if(!((g=n.payload)!=null&&g.account))return;let{account:r}=n.payload,{address:p,shard:m,accounts:s,publicKey:u}=r;e.address=p,e.shard=m;let l=s&&p in s;e.accounts=l?s:kn.accounts,e.publicKey=u})}}),{setAccount:An,setAddress:Sd,setAccountNonce:En,setAccountShard:wd,setLedgerAccount:uc,updateLedgerAccount:gc,setWalletConnectAccount:vd,setIsAccountLoading:kd,setAccountLoadingError:Id,setWebsocketEvent:fc}=br.actions,Sr=br.reducer});function Ue(o){return o!=null&&(vc(o)||Ec(o))}function We(o){return o!=null&&(kc(o)||Lc(o))}function Ge(o){return o!=null&&(Ic(o)||Cc(o))}function Cn(o){return o!=null&&Ac(o)}function vc(o){return o!=null&&hc.includes(o)}function kc(o){return o!=null&&Tc.includes(o)}function Ic(o){return o!=null&&xc.includes(o)}function Ac(o){return o!=null&&yc.includes(o)}function Ec(o){return o!=null&&bc.includes(o)}function Lc(o){return o!=null&&Sc.includes(o)}function Cc(o){return o!=null&&wc.includes(o)}var hc,Tc,xc,yc,bc,Sc,wc,$e=y(()=>{"use strict";t();D();hc=["sent"],Tc=["success"],xc=["fail","cancelled","timedOut"],yc=["timedOut"],bc=["pending"],Sc=["success"],wc=["fail","invalid"]});var wr,vr,no,Pc,kr,Ir,Ar,Nc,wo,Dc,Rc,Md,Mc,vo,Pn,ko,Io=y(()=>{"use strict";t();wr=require("@reduxjs/toolkit"),vr=require("redux-persist");D();$e();j();no={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Pc={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},kr=(0,wr.createSlice)({name:"transactionsSlice",initialState:no,reducers:{moveTransactionsToSignedState:(o,e)=>{var l,g;let{sessionId:n,transactions:r,errorMessage:p,status:m,redirectRoute:s}=e.payload,u=((l=o.customTransactionInformationForSessionId)==null?void 0:l[n])||Pc;o.signedTransactions[n]={transactions:r,status:m,errorMessage:p,redirectRoute:s,customTransactionInformation:u},((g=o==null?void 0:o.transactionsToSign)==null?void 0:g.sessionId)===n&&(o.transactionsToSign=no.transactionsToSign)},clearSignedTransaction:(o,e)=>{o.signedTransactions[e.payload]&&delete o.signedTransactions[e.payload]},clearTransactionToSign:o=>{o!=null&&o.transactionsToSign&&(o.transactionsToSign=null)},updateSignedTransaction:(o,e)=>{o.signedTransactions=T(T({},o.signedTransactions),e.payload)},updateSignedTransactions:(o,e)=>{let{sessionId:n,status:r,errorMessage:p,transactions:m}=e.payload;o.signedTransactions[n]!=null&&(o.signedTransactions[n].status=r,p!=null&&(o.signedTransactions[n].errorMessage=p),m!=null&&(o.signedTransactions[n].transactions=m))},updateSignedTransactionStatus:(o,e)=>{var u,l,g,b,h,w;let{sessionId:n,status:r,errorMessage:p,transactionHash:m}=e.payload,s=(l=(u=o.signedTransactions)==null?void 0:u[n])==null?void 0:l.transactions;if(s!=null){o.signedTransactions[n].transactions=s.map(B=>B.hash===m?I(T({},B),{status:r,errorMessage:p}):B);let P=(b=(g=o.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:b.every(B=>We(B.status)),N=(w=(h=o.signedTransactions[n])==null?void 0:h.transactions)==null?void 0:w.every(B=>Ge(B.status));P&&(o.signedTransactions[n].status="success"),N&&(o.signedTransactions[n].status="fail")}},setTransactionsToSign:(o,e)=>{o.transactionsToSign=e.payload;let{sessionId:n,customTransactionInformation:r}=e.payload;o.customTransactionInformationForSessionId[n]=r,o.signTransactionsError=null},clearAllTransactionsToSign:o=>{o.transactionsToSign=no.transactionsToSign,o.signTransactionsError=null},clearAllSignedTransactions:o=>{o.signedTransactions=no.signedTransactions},setSignTransactionsError:(o,e)=>{o.signTransactionsError=e.payload},setSignTransactionsCancelMessage:(o,e)=>{o.signTransactionsCancelMessage=e.payload}},extraReducers:o=>{o.addCase(G,()=>no),o.addCase(vr.REHYDRATE,(e,n)=>{var s;if(e.signTransactionsCancelMessage=null,!((s=n.payload)!=null&&s.transactions))return;let{signedTransactions:r,customTransactionInformationForSessionId:p}=n.payload.transactions,m=Object.entries(r).reduce((u,[l,g])=>{let b=new Date(l),h=new Date;return h.setHours(h.getHours()+5),h-b>0||(u[l]=g),u},{});p!=null&&(e.customTransactionInformationForSessionId=p),r!=null&&(e.signedTransactions=m)})}}),{updateSignedTransactionStatus:Ir,updateSignedTransactions:Ar,setTransactionsToSign:Nc,clearAllTransactionsToSign:wo,clearAllSignedTransactions:Dc,clearSignedTransaction:Rc,clearTransactionToSign:Md,setSignTransactionsError:Mc,setSignTransactionsCancelMessage:vo,moveTransactionsToSignedState:Pn}=kr.actions,ko=kr.reducer});var Er,Dn,Rn,Mn,Fc,Nn,Lr,Ud,Oc,Fn,Ao,Eo=y(()=>{"use strict";t();Er=require("@reduxjs/toolkit");j();Dn="Transaction failed",Rn="Transaction successful",Mn="Processing transaction",Fc="Transaction submitted",Nn={},Lr=(0,Er.createSlice)({name:"transactionsInfo",initialState:Nn,reducers:{setTransactionsDisplayInfo(o,e){let{sessionId:n,transactionsDisplayInfo:r}=e.payload;n!=null&&(o[n]={errorMessage:(r==null?void 0:r.errorMessage)||Dn,successMessage:(r==null?void 0:r.successMessage)||Rn,processingMessage:(r==null?void 0:r.processingMessage)||Mn,submittedMessage:(r==null?void 0:r.submittedMessage)||Fc,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(o,e){e.payload!=null&&delete o[e.payload]},clearTransactionsInfo:()=>Nn},extraReducers:o=>{o.addCase(G,()=>Nn)}}),{clearTransactionsInfo:Ud,setTransactionsDisplayInfo:Oc,clearTransactionsInfoForSessionId:Fn}=Lr.actions,Ao=Lr.reducer});var Pr,Cr,Nr,Vd,Bc,Hd,Uc,Dr,On=y(()=>{"use strict";t();Pr=require("@reduxjs/toolkit");j();Cr={},Nr=(0,Pr.createSlice)({name:"modalsSlice",initialState:Cr,reducers:{setTxSubmittedModal:(o,e)=>{o.txSubmittedModal=e.payload},setNotificationModal:(o,e)=>{o.notificationModal=e.payload},clearTxSubmittedModal:o=>{o.txSubmittedModal=void 0},clearNotificationModal:o=>{o.notificationModal=void 0}},extraReducers:o=>{o.addCase(G,()=>Cr)}}),{setTxSubmittedModal:Vd,setNotificationModal:Bc,clearTxSubmittedModal:Hd,clearNotificationModal:Uc}=Nr.actions,Dr=Nr.reducer});var Mr,Fr,Rr,Or,Wc,Bn,Jd,Qd,e_,o_,Lo,Co=y(()=>{"use strict";t();Mr=require("@reduxjs/toolkit"),Fr=require("redux-persist");Tn();z();mn();j();Rr={customToasts:[],transactionToasts:[],failTransactionToast:null},Or=(0,Mr.createSlice)({name:"toastsSlice",initialState:Rr,reducers:{addCustomToast:(o,e)=>{o.customToasts.push(I(T({},e.payload),{type:"custom",toastId:e.payload.toastId||`custom-toast-${o.customToasts.length+1}`}))},removeCustomToast:(o,e)=>{o.customToasts=o.customToasts.filter(n=>n.toastId!==e.payload)},addTransactionToast:(o,e)=>{o.transactionToasts.push({type:"transaction",startTimestamp:ho(),toastId:e.payload||`custom-toast-${o.transactionToasts.length+1}`})},removeTransactionToast:(o,e)=>{o.transactionToasts=o.transactionToasts.filter(n=>n.toastId!==e.payload)},addFailTransactionToast:(o,e)=>{o.failTransactionToast=I(T({},e.payload),{toastId:To})},removeFailTransactionToast:o=>{o.failTransactionToast=null}},extraReducers:o=>{o.addCase(G,()=>Rr),o.addCase(Fr.REHYDRATE,(e,n)=>{var p,m;let r=(m=(p=n.customToasts)==null?void 0:p.filter(s=>!("component"in s)))!=null?m:[];e.customToasts=r})}}),{addCustomToast:Wc,removeCustomToast:Bn,addTransactionToast:Jd,removeTransactionToast:Qd,addFailTransactionToast:e_,removeFailTransactionToast:o_}=Or.actions,Lo=Or.reducer});var C=y(()=>{"use strict";t();yn();vn();Ln();Io();Eo();On();Co()});var Un=y(()=>{"use strict";t()});var Gr,Wr,$r,b_,S_,w_,v_,k_,I_,Vr,Hr=y(()=>{"use strict";t();Gr=require("@reduxjs/toolkit");j();Wr={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},$r=(0,Gr.createSlice)({name:"dappModalsSlice",initialState:Wr,reducers:{setDappModalVisibility:(o,e)=>{o.visible=e.payload},setDappModalHeaderVisibility:(o,e)=>{o.modal.showHeader=e.payload},setDappModalFooterVisibility:(o,e)=>{o.modal.showFooter=e.payload},setDappModalHeaderText:(o,e)=>{o.modal.headerText=e.payload},setDappModalFooterText:(o,e)=>{o.modal.footerText=e.payload},setDappModalConfig:(o,e)=>{o.modal=T({},e.payload)}},extraReducers:o=>{o.addCase(G,()=>Wr)}}),{setDappModalVisibility:b_,setDappModalHeaderVisibility:S_,setDappModalFooterVisibility:w_,setDappModalHeaderText:v_,setDappModalFooterText:k_,setDappModalConfig:I_}=$r.actions,Vr=$r.reducer});var jr,Hc,jc,Ve,No=y(()=>{"use strict";t();jr=require("@reduxjs/toolkit");Un();Ln();Hr();yn();On();vn();Co();Eo();Io();Hc={["account"]:Sr,["networkConfig"]:Tr,["loginInfo"]:dr,["modals"]:Dr,["dappModal"]:Vr,["toasts"]:Lo,["transactions"]:ko,["transactionsInfo"]:Ao},jc=(o={})=>(0,jr.combineReducers)(T(T({},Hc),o)),Ve=jc});var Kr={};Te(Kr,{default:()=>Jc});function Wn(o,e=[]){return{key:o,version:1,storage:qr.default,blacklist:e}}var ke,zr,qr,zc,qc,Kc,Xc,Yc,Zc,Jc,Xr=y(()=>{"use strict";t();ke=require("redux-persist"),zr=x(require("redux-persist/lib/storage")),qr=x(require("redux-persist/lib/storage/session"));No();C();Co();Eo();Io();Un();zc={2:o=>I(T({},o),{networkConfig:wn})};qc=Wn("dapp-core-transactionsInfo"),Kc=Wn("dapp-core-transactions",["transactionsToSign"]),Xc=Wn("dapp-core-toasts"),Yc={key:"dapp-core-store",version:2,storage:zr.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,ke.createMigrate)(zc,{debug:!1})},Zc={["toasts"]:(0,ke.persistReducer)(Xc,Lo),["transactions"]:(0,ke.persistReducer)(Kc,ko),["transactionsInfo"]:(0,ke.persistReducer)(qc,Ao)},Jc=(0,ke.persistReducer)(Yc,Ve(Zc))});var Yr={};Te(Yr,{default:()=>Qc});var Qc,Zr=y(()=>{"use strict";t();No();Qc=Ve()});var Jr={};Te(Jr,{default:()=>op});var Y,ep,op,Qr=y(()=>{"use strict";t();Y=require("redux-persist"),ep=[Y.FLUSH,Y.REHYDRATE,Y.PAUSE,Y.PERSIST,Y.PURGE,Y.REGISTER],op=ep});var na={};Te(na,{default:()=>oa});function oa(o){return(0,ea.persistStore)(o)}var ea,ta=y(()=>{"use strict";t();ea=require("redux-persist")});var Ys={};Te(Ys,{SignStep:()=>Xs});module.exports=Xe(Ys);t();var k=x(require("react")),gi=require("@elrondnetwork/erdjs/out"),qo=require("@fortawesome/free-solid-svg-icons"),fi=require("@fortawesome/react-fontawesome");t();t();t();var sa=require("react"),He=require("react-redux");t();var Gn=require("@reduxjs/toolkit"),ca=require("react-redux/es/utils/Subscription");C();t();var Br=x(require("lodash.throttle"));E();C();gn();Fe();Me();var Gc=[bo],$c=(0,Br.default)(()=>{Ze(Ye())},5e3),Ur=o=>e=>n=>{var l;if(Gc.includes(n.type))return e(n);let r=o.getState(),p=Se.local.getItem(ue.loginExpiresAt);if(!((l=r==null?void 0:r.loginInfo)==null?void 0:l.isLoggedIn))return e(n);if(p==null)return Ze(Ye());let s=Date.now();return p-s<0?setTimeout(()=>v(void 0,null,function*(){console.log("session expired");try{o.dispatch(mr())}catch(g){console.error("error logging out",g)}}),1e3):($c(),e(n))};t();t();function Po(){return typeof sessionStorage!="undefined"}var ra=Po()?(Xr(),Xe(Kr)).default:(Zr(),Xe(Yr)).default,aa=Po()?(Qr(),Xe(Jr)).default:[],ia=Po()?(ta(),Xe(na)).default:o=>o;No();var A=(0,Gn.configureStore)({reducer:ra,middleware:o=>o({serializableCheck:{ignoredActions:[...aa,En.type,An.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(Ur)}),pa=(0,ca.createSubscription)(A),Z_=ia(A),J_=(0,Gn.configureStore)({reducer:Ve});var np={store:A,subscription:pa},$n=(0,sa.createContext)(np),nl=(0,He.createStoreHook)($n),Z=(0,He.createDispatchHook)($n),L=(0,He.createSelectorHook)($n);t();t();C();t();var ma=x(require("lodash.isequal")),Do=require("reselect"),f=(0,Do.createSelectorCreator)(Do.defaultMemoize,ma.default);var me=o=>o.account,je=f(me,o=>o.address),to=f(me,je,(o,e)=>e in o.accounts?o.accounts[e]:So),tp=f(me,to,(o,e)=>{let p=o,{accounts:n}=p,r=mo(p,["accounts"]);return I(T({},r),{account:e})}),rp=f(to,o=>o.balance),ap=f(to,o=>{var e;return((e=o==null?void 0:o.nonce)==null?void 0:e.valueOf())||0}),cl=f(me,o=>o.shard),ip=f(me,o=>o.ledgerAccount),pl=f(me,o=>o.walletConnectAccount),sl=f(me,o=>o.isAccountLoading),ml=f(me,o=>o.accountLoadingError),da=f(me,o=>o.websocketEvent);t();var de=o=>o.networkConfig,Ro=f(de,o=>o.chainID),cp=f(de,o=>o.network.walletConnectBridgeAddress),pp=f(de,o=>o.network.walletConnectV2RelayAddress),sp=f(de,o=>o.network.walletConnectV2ProjectId),_a=f(de,o=>o.network.walletConnectDeepLink),Ie=f(de,o=>o.network),la=f(Ie,o=>o.apiAddress),ua=f(Ie,o=>o.explorerAddress),Vn=f(Ie,o=>o.egldLabel);t();D();var Ae=o=>o.loginInfo,hl=f(Ae,o=>o.loginMethod),Mo=f(Ae,je,(o,e)=>o.loginMethod!=""&&Boolean(e)),Tl=f(Ae,o=>o.walletConnectLogin),xl=f(Ae,o=>o.ledgerLogin),mp=f(Ae,o=>o.walletLogin),yl=f(Ae,o=>o.isLoginSessionInvalid);t();t();var q=require("@elrondnetwork/erdjs");E();t();function Hn(o){try{return a.Buffer.from(o,"base64").toString()===atob(o)}catch(e){return!1}}function Fo(o){var p,m,s;let{data:e}=o,n=Hn(e!=null?e:"")?q.TransactionPayload.fromEncoded(e):new q.TransactionPayload(e),r=new q.Transaction(T({value:o.value.valueOf(),data:n,nonce:o.nonce.valueOf(),receiver:new q.Address(o.receiver),sender:new q.Address(o.sender),gasLimit:(p=o.gasLimit.valueOf())!=null?p:Je,gasPrice:(m=o.gasPrice.valueOf())!=null?m:xo,chainID:o.chainID.valueOf(),version:new q.TransactionVersion((s=o.version)!=null?s:nr)},o.options?{options:new q.TransactionOptions(o.options)}:{}));return r.applySignature({hex:()=>o.signature||""},new q.Address(o.sender)),r}t();$e();t();var dp=x(require("bignumber.js"));z();t();t();function jn(o){for(let e=0;e<o.length;e++)if(o.charCodeAt(e)>127)return!1;return!0}function ro(o){let e=o;try{let n=a.Buffer.from(o,"hex").toString();jn(n)&&n.length>1&&(e=n)}catch(n){}return e}t();t();var lp=require("@elrondnetwork/erdjs"),up=x(require("bignumber.js"));D();t();var _p=require("@elrondnetwork/erdjs");t();function qn({tokenId:o,erdLabel:e}){return Boolean(o&&o!==e)}t();t();var fp=require("@elrondnetwork/erdjs/out");t();E();t();var fa=require("@elrondnetwork/erdjs");z();t();t();t();t();D();t();t();t();t();t();t();t();var Kn="tokens";var Xn="collections";t();t();t();t();W();t();t();W();t();t();t();var xp=x(require("bignumber.js"));E();t();var ba=require("@elrondnetwork/erdjs"),ge=x(require("bignumber.js"));E();t();var ya=x(require("bignumber.js")),Yn=(o,e=!0)=>{let n=String(o);if(!n.match(/^[-]?\d+$/))return!1;let r=new ya.default(n),p=e?0:-1;return r.toString(10)===n&&r.comparedTo(0)>=p};t();function _e(o){return{if:function(e){return e?{then:n=>n instanceof Function?_e(n(o)):_e(n)}:{then:()=>_e(o)}},then:e=>e instanceof Function?_e(e(o)):_e(e),valueOf:function(){return o}}}ge.default.config({ROUNDING_MODE:ge.default.ROUND_FLOOR});function Ee({input:o,decimals:e=ne,digits:n=yo,showLastNonZeroDecimal:r=!0,showIsLessThanDecimalsLabel:p=!1,addCommas:m=!1}){if(!Yn(o,!1))throw new Error("Invalid input");let s=new ge.default(o).isNegative(),u=o;return s&&(u=o.substring(1)),_e(u).then(()=>ba.TokenPayment.fungibleFromBigInteger("",u,e).toRationalNumber()).then(l=>{let g=new ge.default(l);if(g.is