@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 56.6 kB
JavaScript
"use strict";var Vo=Object.create;var ge=Object.defineProperty,$o=Object.defineProperties,Go=Object.getOwnPropertyDescriptor,Ho=Object.getOwnPropertyDescriptors,Wo=Object.getOwnPropertyNames,Ae=Object.getOwnPropertySymbols,qo=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty,rr=Object.prototype.propertyIsEnumerable;var tr=(e,t,r)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))Qe.call(t,r)&&tr(e,r,t[r]);if(Ae)for(var r of Ae(t))rr.call(t,r)&&tr(e,r,t[r]);return e},E=(e,t)=>$o(e,Ho(t));var nr=(e,t)=>{var r={};for(var n in e)Qe.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ae)for(var n of Ae(e))t.indexOf(n)<0&&rr.call(e,n)&&(r[n]=e[n]);return r};var h=(e,t)=>()=>(e&&(t=e(e=0)),t);var ve=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ee=(e,t)=>{for(var r in t)ge(e,r,{get:t[r],enumerable:!0})},or=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Wo(t))!Qe.call(e,i)&&i!==r&&ge(e,i,{get:()=>t[i],enumerable:!(n=Go(t,i))||n.enumerable});return e};var w=(e,t,r)=>(r=e!=null?Vo(qo(e)):{},or(t||!e||!e.__esModule?ge(r,"default",{value:e,enumerable:!0}):r,e)),fe=e=>or(ge({},"__esModule",{value:!0}),e);var F=(e,t,r)=>new Promise((n,i)=>{var c=d=>{try{m(r.next(d))}catch(g){i(g)}},p=d=>{try{m(r.throw(d))}catch(g){i(g)}},m=d=>d.done?n(d.value):Promise.resolve(d.value).then(c,p);m((r=r.apply(e,t)).next())});var sr=ve(Ie=>{"use strict";o();Ie.byteLength=zo;Ie.toByteArray=Yo;Ie.fromByteArray=Jo;var B=[],_=[],jo=typeof Uint8Array!="undefined"?Uint8Array:Array,et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(te=0,ir=et.length;te<ir;++te)B[te]=et[te],_[et.charCodeAt(te)]=te;var te,ir;_["-".charCodeAt(0)]=62;_["_".charCodeAt(0)]=63;function ar(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 zo(e){var t=ar(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Ko(e,t,r){return(t+r)*3/4-r}function Yo(e){var t,r=ar(e),n=r[0],i=r[1],c=new jo(Ko(e,n,i)),p=0,m=i>0?n-4:n,d;for(d=0;d<m;d+=4)t=_[e.charCodeAt(d)]<<18|_[e.charCodeAt(d+1)]<<12|_[e.charCodeAt(d+2)]<<6|_[e.charCodeAt(d+3)],c[p++]=t>>16&255,c[p++]=t>>8&255,c[p++]=t&255;return i===2&&(t=_[e.charCodeAt(d)]<<2|_[e.charCodeAt(d+1)]>>4,c[p++]=t&255),i===1&&(t=_[e.charCodeAt(d)]<<10|_[e.charCodeAt(d+1)]<<4|_[e.charCodeAt(d+2)]>>2,c[p++]=t>>8&255,c[p++]=t&255),c}function Zo(e){return B[e>>18&63]+B[e>>12&63]+B[e>>6&63]+B[e&63]}function Xo(e,t,r){for(var n,i=[],c=t;c<r;c+=3)n=(e[c]<<16&16711680)+(e[c+1]<<8&65280)+(e[c+2]&255),i.push(Zo(n));return i.join("")}function Jo(e){for(var t,r=e.length,n=r%3,i=[],c=16383,p=0,m=r-n;p<m;p+=c)i.push(Xo(e,p,p+c>m?m:p+c));return n===1?(t=e[r-1],i.push(B[t>>2]+B[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(B[t>>10]+B[t>>4&63]+B[t<<2&63]+"=")),i.join("")}});var cr=ve(tt=>{o();tt.read=function(e,t,r,n,i){var c,p,m=i*8-n-1,d=(1<<m)-1,g=d>>1,T=-7,f=r?i-1:0,S=r?-1:1,I=e[t+f];for(f+=S,c=I&(1<<-T)-1,I>>=-T,T+=m;T>0;c=c*256+e[t+f],f+=S,T-=8);for(p=c&(1<<-T)-1,c>>=-T,T+=n;T>0;p=p*256+e[t+f],f+=S,T-=8);if(c===0)c=1-g;else{if(c===d)return p?NaN:(I?-1:1)*(1/0);p=p+Math.pow(2,n),c=c-g}return(I?-1:1)*p*Math.pow(2,c-n)};tt.write=function(e,t,r,n,i,c){var p,m,d,g=c*8-i-1,T=(1<<g)-1,f=T>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=n?0:c-1,C=n?1:-1,R=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,p=T):(p=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-p))<1&&(p--,d*=2),p+f>=1?t+=S/d:t+=S*Math.pow(2,1-f),t*d>=2&&(p++,d/=2),p+f>=T?(m=0,p=T):p+f>=1?(m=(t*d-1)*Math.pow(2,i),p=p+f):(m=t*Math.pow(2,f-1)*Math.pow(2,i),p=0));i>=8;e[r+I]=m&255,I+=C,m/=256,i-=8);for(p=p<<i|m,g+=i;g>0;e[r+I]=p&255,I+=C,p/=256,g-=8);e[r+I-C]|=R*128}});var wr=ve(se=>{"use strict";o();var rt=sr(),ae=cr(),lr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;se.Buffer=u;se.SlowBuffer=oi;se.INSPECT_MAX_BYTES=50;var ke=2147483647;se.kMaxLength=ke;u.TYPED_ARRAY_SUPPORT=Qo();!u.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 Qo(){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(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function H(e){if(e>ke)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(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 at(e)}return dr(e,t,r)}u.poolSize=8192;function dr(e,t,r){if(typeof e=="string")return ti(e,t);if(ArrayBuffer.isView(e))return ri(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 ot(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 u.from(n,t,r);var i=ni(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return u.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)}u.from=function(e,t,r){return dr(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function mr(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 ei(e,t,r){return mr(e),e<=0?H(e):t!==void 0?typeof r=="string"?H(e).fill(t,r):H(e).fill(t):H(e)}u.alloc=function(e,t,r){return ei(e,t,r)};function at(e){return mr(e),H(e<0?0:st(e)|0)}u.allocUnsafe=function(e){return at(e)};u.allocUnsafeSlow=function(e){return at(e)};function ti(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=gr(e,t)|0,n=H(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function nt(e){for(var t=e.length<0?0:st(e.length)|0,r=H(t),n=0;n<t;n+=1)r[n]=e[n]&255;return r}function ri(e){if(U(e,Uint8Array)){var t=new Uint8Array(e);return ot(t.buffer,t.byteOffset,t.byteLength)}return nt(e)}function ot(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,u.prototype),n}function ni(e){if(u.isBuffer(e)){var t=st(e.length)|0,r=H(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||ct(e.length)?H(0):nt(e);if(e.type==="Buffer"&&Array.isArray(e.data))return nt(e.data)}function st(e){if(e>=ke)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ke.toString(16)+" bytes");return e|0}function oi(e){return+e!=e&&(e=0),u.alloc(+e)}u.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==u.prototype};u.compare=function(t,r){if(U(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),U(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(t)||!u.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,i=r.length,c=0,p=Math.min(n,i);c<p;++c)if(t[c]!==r[c]){n=t[c],i=r[c];break}return n<i?-1:i<n?1:0};u.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}};u.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return u.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=u.allocUnsafe(r),c=0;for(n=0;n<t.length;++n){var p=t[n];if(U(p,Uint8Array))c+p.length>i.length?u.from(p).copy(i,c):Uint8Array.prototype.set.call(i,p,c);else if(u.isBuffer(p))p.copy(i,c);else throw new TypeError('"list" argument must be an Array of Buffers');c+=p.length}return i};function gr(e,t){if(u.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 i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return it(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Sr(e).length;default:if(i)return n?-1:it(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=gr;function ii(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 fi(this,t,r);case"utf8":case"utf-8":return Tr(this,t,r);case"ascii":return mi(this,t,r);case"latin1":case"binary":return gi(this,t,r);case"base64":return ui(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ti(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function re(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}u.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)re(this,r,r+1);return this};u.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)re(this,r,r+3),re(this,r+1,r+2);return this};u.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)re(this,r,r+7),re(this,r+1,r+6),re(this,r+2,r+5),re(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?Tr(this,0,t):ii.apply(this,arguments)};u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:u.compare(this,t)===0};u.prototype.inspect=function(){var t="",r=se.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};lr&&(u.prototype[lr]=u.prototype.inspect);u.prototype.compare=function(t,r,n,i,c){if(U(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.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),i===void 0&&(i=0),c===void 0&&(c=this.length),r<0||n>t.length||i<0||c>this.length)throw new RangeError("out of range index");if(i>=c&&r>=n)return 0;if(i>=c)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,c>>>=0,this===t)return 0;for(var p=c-i,m=n-r,d=Math.min(p,m),g=this.slice(i,c),T=t.slice(r,n),f=0;f<d;++f)if(g[f]!==T[f]){p=g[f],m=T[f];break}return p<m?-1:m<p?1:0};function fr(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,ct(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=u.from(t,n)),u.isBuffer(t))return t.length===0?-1:pr(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):pr(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function pr(e,t,r,n,i){var c=1,p=e.length,m=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;c=2,p/=2,m/=2,r/=2}function d(I,C){return c===1?I[C]:I.readUInt16BE(C*c)}var g;if(i){var T=-1;for(g=r;g<p;g++)if(d(e,g)===d(t,T===-1?0:g-T)){if(T===-1&&(T=g),g-T+1===m)return T*c}else T!==-1&&(g-=g-T),T=-1}else for(r+m>p&&(r=p-m),g=r;g>=0;g--){for(var f=!0,S=0;S<m;S++)if(d(e,g+S)!==d(t,S)){f=!1;break}if(f)return g}return-1}u.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};u.prototype.indexOf=function(t,r,n){return fr(this,t,r,n,!0)};u.prototype.lastIndexOf=function(t,r,n){return fr(this,t,r,n,!1)};function ai(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var c=t.length;n>c/2&&(n=c/2);for(var p=0;p<n;++p){var m=parseInt(t.substr(p*2,2),16);if(ct(m))return p;e[r+p]=m}return p}function si(e,t,r,n){return Ee(it(t,e.length-r),e,r,n)}function ci(e,t,r,n){return Ee(xi(t),e,r,n)}function li(e,t,r,n){return Ee(Sr(t),e,r,n)}function pi(e,t,r,n){return Ee(Si(t,e.length-r),e,r,n)}u.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var c=this.length-r;if((n===void 0||n>c)&&(n=c),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var p=!1;;)switch(i){case"hex":return ai(this,t,r,n);case"utf8":case"utf-8":return si(this,t,r,n);case"ascii":case"latin1":case"binary":return ci(this,t,r,n);case"base64":return li(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pi(this,t,r,n);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ui(e,t,r){return t===0&&r===e.length?rt.fromByteArray(e):rt.fromByteArray(e.slice(t,r))}function Tr(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var c=e[i],p=null,m=c>239?4:c>223?3:c>191?2:1;if(i+m<=r){var d,g,T,f;switch(m){case 1:c<128&&(p=c);break;case 2:d=e[i+1],(d&192)===128&&(f=(c&31)<<6|d&63,f>127&&(p=f));break;case 3:d=e[i+1],g=e[i+2],(d&192)===128&&(g&192)===128&&(f=(c&15)<<12|(d&63)<<6|g&63,f>2047&&(f<55296||f>57343)&&(p=f));break;case 4:d=e[i+1],g=e[i+2],T=e[i+3],(d&192)===128&&(g&192)===128&&(T&192)===128&&(f=(c&15)<<18|(d&63)<<12|(g&63)<<6|T&63,f>65535&&f<1114112&&(p=f))}}p===null?(p=65533,m=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),i+=m}return di(n)}var ur=4096;function di(e){var t=e.length;if(t<=ur)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=ur));return r}function mi(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function gi(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function fi(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",c=t;c<r;++c)i+=wi[e[c]];return i}function Ti(e,t,r){for(var n=e.slice(t,r),i="",c=0;c<n.length-1;c+=2)i+=String.fromCharCode(n[c]+n[c+1]*256);return i}u.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 i=this.subarray(t,r);return Object.setPrototypeOf(i,u.prototype),i};function k(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")}u.prototype.readUintLE=u.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||k(t,r,this.length);for(var i=this[t],c=1,p=0;++p<r&&(c*=256);)i+=this[t+p]*c;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||k(t,r,this.length);for(var i=this[t+--r],c=1;r>0&&(c*=256);)i+=this[t+--r]*c;return i};u.prototype.readUint8=u.prototype.readUInt8=function(t,r){return t=t>>>0,r||k(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||k(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||k(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||k(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||k(t,r,this.length);for(var i=this[t],c=1,p=0;++p<r&&(c*=256);)i+=this[t+p]*c;return c*=128,i>=c&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||k(t,r,this.length);for(var i=r,c=1,p=this[t+--i];i>0&&(c*=256);)p+=this[t+--i]*c;return c*=128,p>=c&&(p-=Math.pow(2,8*r)),p};u.prototype.readInt8=function(t,r){return t=t>>>0,r||k(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||k(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(t,r){t=t>>>0,r||k(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(t,r){return t=t>>>0,r||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};u.prototype.readInt32BE=function(t,r){return t=t>>>0,r||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};u.prototype.readFloatLE=function(t,r){return t=t>>>0,r||k(t,4,this.length),ae.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||k(t,4,this.length),ae.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||k(t,8,this.length),ae.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||k(t,8,this.length),ae.read(this,t,!1,52,8)};function D(e,t,r,n,i,c){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<c)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var c=Math.pow(2,8*n)-1;D(this,t,r,n,c,0)}var p=1,m=0;for(this[r]=t&255;++m<n&&(p*=256);)this[r+m]=t/p&255;return r+n};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var c=Math.pow(2,8*n)-1;D(this,t,r,n,c,0)}var p=n-1,m=1;for(this[r+p]=t&255;--p>=0&&(m*=256);)this[r+p]=t/m&255;return r+n};u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,1,255,0),this[r]=t&255,r+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||D(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};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||D(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};u.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var c=Math.pow(2,8*n-1);D(this,t,r,n,c-1,-c)}var p=0,m=1,d=0;for(this[r]=t&255;++p<n&&(m*=256);)t<0&&d===0&&this[r+p-1]!==0&&(d=1),this[r+p]=(t/m>>0)-d&255;return r+n};u.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var c=Math.pow(2,8*n-1);D(this,t,r,n,c-1,-c)}var p=n-1,m=1,d=0;for(this[r+p]=t&255;--p>=0&&(m*=256);)t<0&&d===0&&this[r+p+1]!==0&&(d=1),this[r+p]=(t/m>>0)-d&255;return r+n};u.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};u.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||D(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};u.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||D(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 yr(e,t,r,n,i,c){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function hr(e,t,r,n,i){return t=+t,r=r>>>0,i||yr(e,t,r,4,34028234663852886e22,-34028234663852886e22),ae.write(e,t,r,n,23,4),r+4}u.prototype.writeFloatLE=function(t,r,n){return hr(this,t,r,!0,n)};u.prototype.writeFloatBE=function(t,r,n){return hr(this,t,r,!1,n)};function xr(e,t,r,n,i){return t=+t,r=r>>>0,i||yr(e,t,r,8,17976931348623157e292,-17976931348623157e292),ae.write(e,t,r,n,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,n){return xr(this,t,r,!0,n)};u.prototype.writeDoubleBE=function(t,r,n){return xr(this,t,r,!1,n)};u.prototype.copy=function(t,r,n,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var c=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),c};u.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var c=t.charCodeAt(0);(i==="utf8"&&c<128||i==="latin1")&&(t=c)}}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 p;if(typeof t=="number")for(p=r;p<n;++p)this[p]=t;else{var m=u.isBuffer(t)?t:u.from(t,i),d=m.length;if(d===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(p=0;p<n-r;++p)this[p+r]=m[p%d]}return this};var yi=/[^+/0-9A-Za-z-_]/g;function hi(e){if(e=e.split("=")[0],e=e.trim().replace(yi,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function it(e,t){t=t||1/0;for(var r,n=e.length,i=null,c=[],p=0;p<n;++p){if(r=e.charCodeAt(p),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&c.push(239,191,189);continue}else if(p+1===n){(t-=3)>-1&&c.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&c.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&c.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;c.push(r)}else if(r<2048){if((t-=2)<0)break;c.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;c.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;c.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return c}function xi(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Si(e,t){for(var r,n,i,c=[],p=0;p<e.length&&!((t-=2)<0);++p)r=e.charCodeAt(p),n=r>>8,i=r%256,c.push(i),c.push(n);return c}function Sr(e){return rt.toByteArray(hi(e))}function Ee(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function U(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function ct(e){return e!==e}var wi=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=r*16,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()});var kr=ve((Ka,Ir)=>{o();var v=Ir.exports={},V,$;function lt(){throw new Error("setTimeout has not been defined")}function pt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?V=setTimeout:V=lt}catch(e){V=lt}try{typeof clearTimeout=="function"?$=clearTimeout:$=pt}catch(e){$=pt}})();function br(e){if(V===setTimeout)return setTimeout(e,0);if((V===lt||!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 bi(e){if($===clearTimeout)return clearTimeout(e);if(($===pt||!$)&&clearTimeout)return $=clearTimeout,clearTimeout(e);try{return $(e)}catch(t){try{return $.call(null,e)}catch(r){return $.call(this,e)}}}var W=[],ce=!1,ne,Le=-1;function Ai(){!ce||!ne||(ce=!1,ne.length?W=ne.concat(W):Le=-1,W.length&&Ar())}function Ar(){if(!ce){var e=br(Ai);ce=!0;for(var t=W.length;t;){for(ne=W,W=[];++Le<t;)ne&&ne[Le].run();Le=-1,t=W.length}ne=null,ce=!1,bi(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 vr(e,t)),W.length===1&&!ce&&br(Ar)};function vr(e,t){this.fun=e,this.array=t}vr.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 a,s,Ya,o=h(()=>{a=w(wr()),s=w(kr()),Ya=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 De,ut=h(()=>{"use strict";o();De=()=>Date.now()/1e3});var Er=h(()=>{"use strict";o()});var Lr=h(()=>{"use strict";o()});var Dr=h(()=>{"use strict";o();ut();Er();Lr()});var mt={};ee(mt,{getItem:()=>Ii,localStorageKeys:()=>oe,removeItem:()=>ki,setItem:()=>vi});var oe,dt,vi,Ii,ki,Te=h(()=>{"use strict";o();Dr();oe={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},dt=typeof localStorage!="undefined",vi=({key:e,data:t,expires:r})=>{!dt||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Ii=e=>{if(!dt)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:De()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},ki=e=>{!dt||localStorage.removeItem(String(e))}});var gt={};ee(gt,{clear:()=>Pr,getItem:()=>Cr,removeItem:()=>Rr,setItem:()=>Nr,storage:()=>Ei});var Nr,Cr,Rr,Pr,Ei,Fr=h(()=>{"use strict";o();Nr=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Cr=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},Rr=e=>sessionStorage.removeItem(String(e)),Pr=()=>sessionStorage.clear(),Ei={setItem:Nr,getItem:Cr,removeItem:Rr,clear:Pr}});var le,Ne=h(()=>{"use strict";o();Te();Fr();le={session:gt,local:mt}});function ye(){return new Date().setHours(new Date().getHours()+24)}function he(e){le.local.setItem({key:oe.loginExpiresAt,data:e,expires:e})}var ft=h(()=>{"use strict";o();Ne();Te()});var O=h(()=>{"use strict";o()});var _r=h(()=>{"use strict";o()});var Mr=h(()=>{"use strict";o()});var L=h(()=>{"use strict";o()});var Or=h(()=>{"use strict";o()});var Br=h(()=>{"use strict";o()});var Ur=h(()=>{"use strict";o()});var Vr=h(()=>{"use strict";o()});var j=h(()=>{"use strict";o();Mr();L();O();Or();Br();Ur();Vr()});var Tt,$r,As,Gr,vs,Hr,Is,ks,Es,Wr=h(()=>{"use strict";o();j();Tt={devnet:{id:"devnet",chainId:"D",name:"Devnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://devnet-wallet.elrond.com",apiAddress:"https://devnet-api.elrond.com",explorerAddress:"http://devnet-explorer.elrond.com",apiTimeout:"4000"},testnet:{id:"testnet",chainId:"T",name:"Testnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://testnet-wallet.elrond.com",apiAddress:"https://testnet-api.elrond.com",explorerAddress:"http://testnet-explorer.elrond.com",apiTimeout:"4000"},mainnet:{id:"mainnet",chainId:"1",name:"Mainnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://wallet.elrond.com",apiAddress:"https://api.elrond.com",explorerAddress:"https://explorer.elrond.com",apiTimeout:"4000"}},{chainId:$r,egldLabel:As}=Tt["devnet"],{chainId:Gr,egldLabel:vs}=Tt["testnet"],{chainId:Hr,egldLabel:Is}=Tt["mainnet"],ks={["devnet"]:$r,["testnet"]:Gr,["mainnet"]:Hr},Es={[$r]:"devnet",[Gr]:"testnet",[Hr]:"mainnet"}});var yt=h(()=>{"use strict";o()});var qr=h(()=>{"use strict";o()});var jr,ht=h(()=>{"use strict";o();jr="transaction-status-toast-id"});var zr,Ce,Y,pe,Kr,xt,Re,Yr,Z,A=h(()=>{"use strict";o();_r();Wr();yt();qr();ht();zr=.01,Ce=1500,Y=5e4,pe=1e9,Kr=1,xt=4294967295,Re="logout",Yr="login",Z="0"});var St,N,Pe,X=h(()=>{"use strict";o();St=require("@reduxjs/toolkit");A();N=(0,St.createAction)(Re),Pe=(0,St.createAction)(Yr,e=>({payload:e}))});var Xr,Zr,Jr,qs,js,zs,Ks,Ys,Zs,Qr,en,wt=h(()=>{"use strict";o();Xr=require("@reduxjs/toolkit");ft();O();X();Zr={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Jr=(0,Xr.createSlice)({name:"loginInfoSlice",initialState:Zr,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(N,()=>Zr),e.addCase(Pe,(t,r)=>{t.loginMethod=r.payload.loginMethod,he(ye())})}}),{setLoginMethod:qs,setWalletConnectLogin:js,setLedgerLogin:zs,setTokenLogin:Ks,setTokenLoginSignature:Ys,setWalletLogin:Zs,invalidateLoginSession:Qr}=Jr.actions,en=Jr.reducer});var tn=h(()=>{"use strict";o()});var rn=h(()=>{"use strict";o();tn()});function bt(e){return e[Math.floor(Math.random()*e.length)]}var nn=h(()=>{"use strict";o()});var on=h(()=>{"use strict";o();yt()});var an=h(()=>{"use strict";o();rn();nn();on()});var sn,cn,At,Di,ln,dc,mc,pn,vt=h(()=>{"use strict";o();sn=require("@reduxjs/toolkit"),cn=w(require("lodash.omit"));an();At={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Di={network:At,chainID:"-1"},ln=(0,sn.createSlice)({name:"appConfig",initialState:Di,reducers:{initializeNetworkConfig:(e,t)=>{let r=bt(t.payload.walletConnectBridgeAddresses),n=bt(t.payload.walletConnectV2RelayAddresses),i=(0,cn.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=E(x(x({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:n})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:dc,setChainID:mc}=ln.actions,pn=ln.reducer});var kt,un,dn,Fe,It,mn,gn,wc,fn,bc,Ac,vc,Ic,kc,Ec,Lc,Tn,Et=h(()=>{"use strict";o();kt=require("@elrondnetwork/erdjs"),un=require("@reduxjs/toolkit"),dn=require("redux-persist");A();Ne();Te();X();Fe={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Z},It={address:"",websocketEvent:null,accounts:{"":Fe},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},mn=(0,un.createSlice)({name:"accountInfoSlice",initialState:It,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new kt.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Fe},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(N,()=>(le.local.removeItem(oe.loginExpiresAt),It)),e.addCase(Pe,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new kt.Address(n).hex()}),e.addCase(dn.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:i,shard:c,accounts:p,publicKey:m}=n;t.address=i,t.shard=c;let d=p&&i in p;t.accounts=d?p:It.accounts,t.publicKey=m})}}),{setAccount:gn,setAddress:wc,setAccountNonce:fn,setAccountShard:bc,setLedgerAccount:Ac,updateLedgerAccount:vc,setWalletConnectAccount:Ic,setIsAccountLoading:kc,setAccountLoadingError:Ec,setWebsocketEvent:Lc}=mn.actions,Tn=mn.reducer});function yn(e){return e!=null&&(Bi(e)||Gi(e))}function _e(e){return e!=null&&(Ui(e)||Hi(e))}function Me(e){return e!=null&&(Vi(e)||Wi(e))}function hn(e){return e!=null&&$i(e)}function Bi(e){return e!=null&&Ci.includes(e)}function Ui(e){return e!=null&&Ri.includes(e)}function Vi(e){return e!=null&&Pi.includes(e)}function $i(e){return e!=null&&Fi.includes(e)}function Gi(e){return e!=null&&_i.includes(e)}function Hi(e){return e!=null&&Mi.includes(e)}function Wi(e){return e!=null&&Oi.includes(e)}var Ci,Ri,Pi,Fi,_i,Mi,Oi,Dt=h(()=>{"use strict";o();O();Ci=["sent"],Ri=["success"],Pi=["fail","cancelled","timedOut"],Fi=["timedOut"],_i=["pending"],Mi=["success"],Oi=["fail","invalid"]});var xn,Sn,xe,qi,wn,Oc,Bc,bn,An,vn,Nt,Uc,Vc,In,$c,Oe,Be=h(()=>{"use strict";o();xn=require("@reduxjs/toolkit"),Sn=require("redux-persist");O();Dt();X();xe={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},qi={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},wn=(0,xn.createSlice)({name:"transactionsSlice",initialState:xe,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,g;let{sessionId:r,transactions:n,errorMessage:i,status:c,redirectRoute:p}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||qi;e.signedTransactions[r]={transactions:n,status:c,errorMessage:i,redirectRoute:p,customTransactionInformation:m},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===r&&(e.transactionsToSign=xe.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=x(x({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:n,errorMessage:i,transactions:c}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=n,i!=null&&(e.signedTransactions[r].errorMessage=i),c!=null&&(e.signedTransactions[r].transactions=c))},updateSignedTransactionStatus:(e,t)=>{var m,d,g,T,f,S;let{sessionId:r,status:n,errorMessage:i,transactionHash:c}=t.payload,p=(d=(m=e.signedTransactions)==null?void 0:m[r])==null?void 0:d.transactions;if(p!=null){e.signedTransactions[r].transactions=p.map(R=>R.hash===c?E(x({},R),{status:n,errorMessage:i}):R);let I=(T=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:T.every(R=>_e(R.status)),C=(S=(f=e.signedTransactions[r])==null?void 0:f.transactions)==null?void 0:S.every(R=>Me(R.status));I&&(e.signedTransactions[r].status="success"),C&&(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=xe.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=xe.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(N,()=>xe),e.addCase(Sn.REHYDRATE,(t,r)=>{var p;if(t.signTransactionsCancelMessage=null,!((p=r.payload)!=null&&p.transactions))return;let{signedTransactions:n,customTransactionInformationForSessionId:i}=r.payload.transactions,c=Object.entries(n).reduce((m,[d,g])=>{let T=new Date(d),f=new Date;return f.setHours(f.getHours()+5),f-T>0||(m[d]=g),m},{});i!=null&&(t.customTransactionInformationForSessionId=i),n!=null&&(t.signedTransactions=c)})}}),{updateSignedTransactionStatus:Oc,updateSignedTransactions:Bc,setTransactionsToSign:bn,clearAllTransactionsToSign:An,clearAllSignedTransactions:vn,clearSignedTransaction:Nt,clearTransactionToSign:Uc,setSignTransactionsError:Vc,setSignTransactionsCancelMessage:In,moveTransactionsToSignedState:$c}=wn.actions,Oe=wn.reducer});var kn,Rt,Pt,Ft,ji,Ct,En,qc,Ln,jc,Ue,Ve=h(()=>{"use strict";o();kn=require("@reduxjs/toolkit");X();Rt="Transaction failed",Pt="Transaction successful",Ft="Processing transaction",ji="Transaction submitted",Ct={},En=(0,kn.createSlice)({name:"transactionsInfo",initialState:Ct,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||Rt,successMessage:(n==null?void 0:n.successMessage)||Pt,processingMessage:(n==null?void 0:n.processingMessage)||Ft,submittedMessage:(n==null?void 0:n.submittedMessage)||ji,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>Ct},extraReducers:e=>{e.addCase(N,()=>Ct)}}),{clearTransactionsInfo:qc,setTransactionsDisplayInfo:Ln,clearTransactionsInfoForSessionId:jc}=En.actions,Ue=En.reducer});var Nn,Dn,Cn,Zc,_t,Xc,Jc,Rn,Mt=h(()=>{"use strict";o();Nn=require("@reduxjs/toolkit");X();Dn={},Cn=(0,Nn.createSlice)({name:"modalsSlice",initialState:Dn,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(N,()=>Dn)}}),{setTxSubmittedModal:Zc,setNotificationModal:_t,clearTxSubmittedModal:Xc,clearNotificationModal:Jc}=Cn.actions,Rn=Cn.reducer});var Fn,_n,Pn,Mn,al,sl,cl,ll,pl,ul,$e,Ge=h(()=>{"use strict";o();Fn=require("@reduxjs/toolkit"),_n=require("redux-persist");ht();j();ut();X();Pn={customToasts:[],transactionToasts:[],failTransactionToast:null},Mn=(0,Fn.createSlice)({name:"toastsSlice",initialState:Pn,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(E(x({},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:De(),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=E(x({},t.payload),{toastId:jr})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(N,()=>Pn),e.addCase(_n.REHYDRATE,(t,r)=>{var i,c;let n=(c=(i=r.customToasts)==null?void 0:i.filter(p=>!("component"in p)))!=null?c:[];t.customToasts=n})}}),{addCustomToast:al,removeCustomToast:sl,addTransactionToast:cl,removeTransactionToast:ll,addFailTransactionToast:pl,removeFailTransactionToast:ul}=Mn.actions,$e=Mn.reducer});var J=h(()=>{"use strict";o();wt();vt();Et();Be();Ve();Mt();Ge()});var Ot=h(()=>{"use strict";o()});var Vn,Un,$n,Cl,Rl,Pl,Fl,_l,Ml,Gn,Hn=h(()=>{"use strict";o();Vn=require("@reduxjs/toolkit");X();Un={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},$n=(0,Vn.createSlice)({name:"dappModalsSlice",initialState:Un,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=x({},t.payload)}},extraReducers:e=>{e.addCase(N,()=>Un)}}),{setDappModalVisibility:Cl,setDappModalHeaderVisibility:Rl,setDappModalFooterVisibility:Pl,setDappModalHeaderText:Fl,setDappModalFooterText:_l,setDappModalConfig:Ml}=$n.actions,Gn=$n.reducer});var Wn,Zi,Xi,ue,We=h(()=>{"use strict";o();Wn=require("@reduxjs/toolkit");Ot();Et();Hn();wt();Mt();vt();Ge();Ve();Be();Zi={["account"]:Tn,["networkConfig"]:pn,["loginInfo"]:en,["modals"]:Rn,["dappModal"]:Gn,["toasts"]:$e,["transactions"]:Oe,["transactionsInfo"]:Ue},Xi=(e={})=>(0,Wn.combineReducers)(x(x({},Zi),e)),ue=Xi});var zn={};ee(zn,{default:()=>oa});function Bt(e,t=[]){return{key:e,version:1,storage:jn.default,blacklist:t}}var ie,qn,jn,Ji,Qi,ea,ta,ra,na,oa,Kn=h(()=>{"use strict";o();ie=require("redux-persist"),qn=w(require("redux-persist/lib/storage")),jn=w(require("redux-persist/lib/storage/session"));We();J();Ge();Ve();Be();Ot();Ji={2:e=>E(x({},e),{networkConfig:At})};Qi=Bt("dapp-core-transactionsInfo"),ea=Bt("dapp-core-transactions",["transactionsToSign"]),ta=Bt("dapp-core-toasts"),ra={key:"dapp-core-store",version:2,storage:qn.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,ie.createMigrate)(Ji,{debug:!1})},na={["toasts"]:(0,ie.persistReducer)(ta,$e),["transactions"]:(0,ie.persistReducer)(ea,Oe),["transactionsInfo"]:(0,ie.persistReducer)(Qi,Ue)},oa=(0,ie.persistReducer)(ra,ue(na))});var Yn={};ee(Yn,{default:()=>ia});var ia,Zn=h(()=>{"use strict";o();We();ia=ue()});var Xn={};ee(Xn,{default:()=>sa});var M,aa,sa,Jn=h(()=>{"use strict";o();M=require("redux-persist"),aa=[M.FLUSH,M.REHYDRATE,M.PAUSE,M.PERSIST,M.PURGE,M.REGISTER],sa=aa});var to={};ee(to,{default:()=>eo});function eo(e){return(0,Qn.persistStore)(e)}var Qn,ro=h(()=>{"use strict";o();Qn=require("redux-persist")});var Ha={};ee(Ha,{calcTotalFee:()=>qt,isCrossShardTransaction:()=>vo,removeAllSignedTransactions:()=>pa,removeAllTransactionsToSign:()=>ua,removeSignedTransaction:()=>la,removeTransactionsToSign:()=>ca,sendTransactions:()=>Ga,signTransactions:()=>jt});module.exports=fe(Ha);o();o();o();J();o();var Ut=require("@reduxjs/toolkit"),ao=require("react-redux/es/utils/Subscription");J();o();var On=w(require("lodash.throttle"));A();J();ft();Ne();Te();var zi=[Re],Ki=(0,On.default)(()=>{he(ye())},5e3),Bn=e=>t=>r=>{var d;if(zi.includes(r.type))return t(r);let n=e.getState(),i=le.local.getItem(oe.loginExpiresAt);if(!((d=n==null?void 0:n.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(i==null)return he(ye());let p=Date.now();return i-p<0?setTimeout(()=>F(void 0,null,function*(){console.log("session expired");try{e.dispatch(Qr())}catch(g){console.error("error logging out",g)}}),1e3):(Ki(),t(r))};o();o();function He(){return typeof sessionStorage!="undefined"}var no=He()?(Kn(),fe(zn)).default:(Zn(),fe(Yn)).default,oo=He()?(Jn(),fe(Xn)).default:[],io=He()?(ro(),fe(to)).default:e=>e;We();var b=(0,Ut.configureStore)({reducer:no,middleware:e=>e({serializableCheck:{ignoredActions:[...oo,fn.type,gn.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(Bn)}),sp=(0,ao.createSubscription)(b),cp=io(b),lp=(0,Ut.configureStore)({reducer:ue});function ca(e){b.dispatch(Nt(e))}function la(e){b.dispatch(Nt(e))}function pa(){b.dispatch(vn())}function ua(){b.dispatch(An())}o();o();var So=w(require("bignumber.js"));A();o();J();o();var so=w(require("lodash.isequal")),qe=require("reselect"),y=(0,qe.createSelectorCreator)(qe.defaultMemoize,so.default);var z=e=>e.account,Se=y(z,e=>e.address),Vt=y(z,Se,(e,t)=>t in e.accounts?e.accounts[t]:Fe),yp=y(z,Vt,(e,t)=>{let i=e,{accounts:r}=i,n=nr(i,["accounts"]);return E(x({},n),{account:t})}),co=y(Vt,e=>e.balance),lo=y(Vt,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),hp=y(z,e=>e.shard),xp=y(z,e=>e.ledgerAccount),Sp=y(z,e=>e.walletConnectAccount),wp=y(z,e=>e.isAccountLoading),bp=y(z,e=>e.accountLoadingError),Ap=y(z,e=>e.websocketEvent);o();var de=e=>e.networkConfig,je=y(de,e=>e.chainID),kp=y(de,e=>e.network.walletConnectBridgeAddress),Ep=y(de,e=>e.network.walletConnectV2RelayAddress),Lp=y(de,e=>e.network.walletConnectV2ProjectId),Dp=y(de,e=>e.network.walletConnectDeepLink),$t=y(de,e=>e.network),po=y($t,e=>e.apiAddress),uo=y($t,e=>e.explorerAddress),Np=y($t,e=>e.egldLabel);J();j();o();var mo=w(require("bignumber.js"));A();var ze=e=>{if(isNaN(e)||String(e).includes("Infinity"))return!1;let[t,r]=e.split(".");if(r)for(;r.charAt(r.length-1)===Z;)r=r.slice(0,-1);let n=r?[t,r].join("."):t,i=new mo.default(n);return i.toString(10)===n&&i.comparedTo(0)>=0};o();var Wt=w(require("bignumber.js"));A();o();o();A();o();var da=require("@elrondnetwork/erdjs"),Ht=w(require("bignumber.js"));A();o();var go=w(require("bignumber.js")),Gt=(e,t=!0)=>{let r=String(e);if(!r.match(/^[-]?\d+$/))return!1;let n=new go.default(r),i=t?0:-1;return n.toString(10)===r&&n.comparedTo(0)>=i};o();Ht.default.config({ROUNDING_MODE:Ht.default.ROUND_FLOOR});o();A();o();var ma=require("@elrondnetwork/erdjs");A();o();var K=require("@elrondnetwork/erdjs"),yo=require("@elrondnetwork/erdjs"),ho=require("@elrondnetwork/erdjs-network-providers");A();o();o();A();o();var To={from:"erd12dnfhej64s6c56ka369gkyj3hwv5ms0y5rxgsk2k7hkd2vuk7rvqxkalsa",to:"erd12dnfhej64s6c56ka369gkyj3hwv5ms0y5rxgsk2k7hkd2vuk7rvqxkalsa"};function xo({minGasLimit:e=String(Y),gasLimit:t,gasPrice:r,data:n,gasPerDataByte:i,gasPriceModifier:c,defaultGasPrice:p=String(pe),chainId:m}){let d=n||"",g=Gt(t)?t:e,T=ze(r)?r:p,f=new K.Transaction({nonce:0,value:yo.TokenPayment.egldFromAmount("0"),receiver:new K.Address(To.to),sender:new K.Address(To.to),gasPrice:parseInt(T),gasLimit:parseInt(g),data:new K.TransactionPayload(d.trim()),chainID:m,version:new K.TransactionVersion(1)}),S=new ho.NetworkConfig;S.MinGasLimit=parseInt(e),S.GasPerDataByte=parseInt(i),S.GasPriceModifier=parseFloat(c);try{return f.computeFee(S).toString(10)}catch(I){return Z}}o();o();o();function qt(e,t){let r=new Wt.default(0);return e.forEach(n=>{let i=xo({gasPerDataByte:String(Ce),gasPriceModifier:String(zr),minGasLimit:String(t),gasLimit:n.getGasLimit().valueOf().toString(),gasPrice:n.getGasPrice().valueOf().toString(),data:n.getData().toString(),chainId:n.getChainID().valueOf()});r=r.plus(new Wt.default(i))}),r}function jt(c){return F(this,arguments,function*({transactions:e,callbackRoute:t,minGasLimit:r=Y,customTransactionInformation:n,transactionsDisplayInfo:i}){let p=b.getState(),m=Date.now().toString(),d=co(p),g=je(p),T=Array.isArray(e)?e:[e],f=qt(T,r);if(!new So.default(ze(d)?d:"0").minus(f).isGreaterThan(0)){let G={type:"warning",iconClassName:"text-warning",title:"Insufficient EGLD funds",description:"Current EGLD balance cannot cover the transaction fees."};return b.dispatch(_t(G)),{error:"insufficient funds",sessionId:null}}if(!(T==null?void 0:T.every(G=>G.getChainID().valueOf()===g.valueOf()))){let G=