UNPKG

@sofaws/dapp-core

Version:

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

1 lines 55.6 kB
"use strict";var Po=Object.create;var ge=Object.defineProperty,Fo=Object.defineProperties,_o=Object.getOwnPropertyDescriptor,Mo=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertyNames,Ae=Object.getOwnPropertySymbols,Bo=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable;var Yt=(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)&&Yt(e,r,t[r]);if(Ae)for(var r of Ae(t))Zt.call(t,r)&&Yt(e,r,t[r]);return e},E=(e,t)=>Fo(e,Mo(t));var Xt=(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&&Zt.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),Q=(e,t)=>{for(var r in t)ge(e,r,{get:t[r],enumerable:!0})},Jt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Oo(t))!Qe.call(e,i)&&i!==r&&ge(e,i,{get:()=>t[i],enumerable:!(n=_o(t,i))||n.enumerable});return e};var w=(e,t,r)=>(r=e!=null?Po(Bo(e)):{},Jt(t||!e||!e.__esModule?ge(r,"default",{value:e,enumerable:!0}):r,e)),fe=e=>Jt(ge({},"__esModule",{value:!0}),e);var F=(e,t,r)=>new Promise((n,i)=>{var l=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(l,p);m((r=r.apply(e,t)).next())});var tr=ve(Ie=>{"use strict";o();Ie.byteLength=Vo;Ie.toByteArray=Go;Ie.fromByteArray=qo;var B=[],_=[],Uo=typeof Uint8Array!="undefined"?Uint8Array:Array,et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ee=0,Qt=et.length;ee<Qt;++ee)B[ee]=et[ee],_[et.charCodeAt(ee)]=ee;var ee,Qt;_["-".charCodeAt(0)]=62;_["_".charCodeAt(0)]=63;function er(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 Vo(e){var t=er(e),r=t[0],n=t[1];return(r+n)*3/4-n}function $o(e,t,r){return(t+r)*3/4-r}function Go(e){var t,r=er(e),n=r[0],i=r[1],l=new Uo($o(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)],l[p++]=t>>16&255,l[p++]=t>>8&255,l[p++]=t&255;return i===2&&(t=_[e.charCodeAt(d)]<<2|_[e.charCodeAt(d+1)]>>4,l[p++]=t&255),i===1&&(t=_[e.charCodeAt(d)]<<10|_[e.charCodeAt(d+1)]<<4|_[e.charCodeAt(d+2)]>>2,l[p++]=t>>8&255,l[p++]=t&255),l}function Ho(e){return B[e>>18&63]+B[e>>12&63]+B[e>>6&63]+B[e&63]}function Wo(e,t,r){for(var n,i=[],l=t;l<r;l+=3)n=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),i.push(Ho(n));return i.join("")}function qo(e){for(var t,r=e.length,n=r%3,i=[],l=16383,p=0,m=r-n;p<m;p+=l)i.push(Wo(e,p,p+l>m?m:p+l));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 rr=ve(tt=>{o();tt.read=function(e,t,r,n,i){var l,p,m=i*8-n-1,d=(1<<m)-1,g=d>>1,T=-7,f=r?i-1:0,S=r?-1:1,v=e[t+f];for(f+=S,l=v&(1<<-T)-1,v>>=-T,T+=m;T>0;l=l*256+e[t+f],f+=S,T-=8);for(p=l&(1<<-T)-1,l>>=-T,T+=n;T>0;p=p*256+e[t+f],f+=S,T-=8);if(l===0)l=1-g;else{if(l===d)return p?NaN:(v?-1:1)*(1/0);p=p+Math.pow(2,n),l=l-g}return(v?-1:1)*p*Math.pow(2,l-n)};tt.write=function(e,t,r,n,i,l){var p,m,d,g=l*8-i-1,T=(1<<g)-1,f=T>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=n?0:l-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+v]=m&255,v+=C,m/=256,i-=8);for(p=p<<i|m,g+=i;g>0;e[r+v]=p&255,v+=C,p/=256,g-=8);e[r+v-C]|=R*128}});var fr=ve(se=>{"use strict";o();var rt=tr(),ae=rr(),nr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;se.Buffer=u;se.SlowBuffer=Xo;se.INSPECT_MAX_BYTES=50;var ke=2147483647;se.kMaxLength=ke;u.TYPED_ARRAY_SUPPORT=jo();!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 jo(){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 ar(e,t,r)}u.poolSize=8192;function ar(e,t,r){if(typeof e=="string")return Ko(e,t);if(ArrayBuffer.isView(e))return Yo(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=Zo(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 ar(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function sr(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 zo(e,t,r){return sr(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 zo(e,t,r)};function at(e){return sr(e),H(e<0?0:st(e)|0)}u.allocUnsafe=function(e){return at(e)};u.allocUnsafeSlow=function(e){return at(e)};function Ko(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=cr(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 Yo(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 Zo(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 Xo(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,l=0,p=Math.min(n,i);l<p;++l)if(t[l]!==r[l]){n=t[l],i=r[l];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),l=0;for(n=0;n<t.length;++n){var p=t[n];if(U(p,Uint8Array))l+p.length>i.length?u.from(p).copy(i,l):Uint8Array.prototype.set.call(i,p,l);else if(u.isBuffer(p))p.copy(i,l);else throw new TypeError('"list" argument must be an Array of Buffers');l+=p.length}return i};function cr(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 gr(e).length;default:if(i)return n?-1:it(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=cr;function Jo(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 ci(this,t,r);case"utf8":case"utf-8":return pr(this,t,r);case"ascii":return ai(this,t,r);case"latin1":case"binary":return si(this,t,r);case"base64":return oi(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return li(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function te(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)te(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)te(this,r,r+3),te(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)te(this,r,r+7),te(this,r+1,r+6),te(this,r+2,r+5),te(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?pr(this,0,t):Jo.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+">"};nr&&(u.prototype[nr]=u.prototype.inspect);u.prototype.compare=function(t,r,n,i,l){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),l===void 0&&(l=this.length),r<0||n>t.length||i<0||l>this.length)throw new RangeError("out of range index");if(i>=l&&r>=n)return 0;if(i>=l)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,l>>>=0,this===t)return 0;for(var p=l-i,m=n-r,d=Math.min(p,m),g=this.slice(i,l),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 lr(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:or(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):or(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function or(e,t,r,n,i){var l=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;l=2,p/=2,m/=2,r/=2}function d(v,C){return l===1?v[C]:v.readUInt16BE(C*l)}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*l}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 lr(this,t,r,n,!0)};u.prototype.lastIndexOf=function(t,r,n){return lr(this,t,r,n,!1)};function Qo(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var l=t.length;n>l/2&&(n=l/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 ei(e,t,r,n){return Ee(it(t,e.length-r),e,r,n)}function ti(e,t,r,n){return Ee(di(t),e,r,n)}function ri(e,t,r,n){return Ee(gr(t),e,r,n)}function ni(e,t,r,n){return Ee(mi(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 l=this.length-r;if((n===void 0||n>l)&&(n=l),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 Qo(this,t,r,n);case"utf8":case"utf-8":return ei(this,t,r,n);case"ascii":case"latin1":case"binary":return ti(this,t,r,n);case"base64":return ri(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ni(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 oi(e,t,r){return t===0&&r===e.length?rt.fromByteArray(e):rt.fromByteArray(e.slice(t,r))}function pr(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var l=e[i],p=null,m=l>239?4:l>223?3:l>191?2:1;if(i+m<=r){var d,g,T,f;switch(m){case 1:l<128&&(p=l);break;case 2:d=e[i+1],(d&192)===128&&(f=(l&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=(l&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=(l&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 ii(n)}var ir=4096;function ii(e){var t=e.length;if(t<=ir)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=ir));return r}function ai(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 si(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 ci(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",l=t;l<r;++l)i+=gi[e[l]];return i}function li(e,t,r){for(var n=e.slice(t,r),i="",l=0;l<n.length-1;l+=2)i+=String.fromCharCode(n[l]+n[l+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 I(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||I(t,r,this.length);for(var i=this[t],l=1,p=0;++p<r&&(l*=256);)i+=this[t+p]*l;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||I(t,r,this.length);for(var i=this[t+--r],l=1;r>0&&(l*=256);)i+=this[t+--r]*l;return i};u.prototype.readUint8=u.prototype.readUInt8=function(t,r){return t=t>>>0,r||I(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||I(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||I(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||I(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||I(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||I(t,r,this.length);for(var i=this[t],l=1,p=0;++p<r&&(l*=256);)i+=this[t+p]*l;return l*=128,i>=l&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||I(t,r,this.length);for(var i=r,l=1,p=this[t+--i];i>0&&(l*=256);)p+=this[t+--i]*l;return l*=128,p>=l&&(p-=Math.pow(2,8*r)),p};u.prototype.readInt8=function(t,r){return t=t>>>0,r||I(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||I(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||I(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||I(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||I(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||I(t,4,this.length),ae.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||I(t,4,this.length),ae.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||I(t,8,this.length),ae.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||I(t,8,this.length),ae.read(this,t,!1,52,8)};function D(e,t,r,n,i,l){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<l)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 l=Math.pow(2,8*n)-1;D(this,t,r,n,l,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 l=Math.pow(2,8*n)-1;D(this,t,r,n,l,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 l=Math.pow(2,8*n-1);D(this,t,r,n,l-1,-l)}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 l=Math.pow(2,8*n-1);D(this,t,r,n,l-1,-l)}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 ur(e,t,r,n,i,l){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function dr(e,t,r,n,i){return t=+t,r=r>>>0,i||ur(e,t,r,4,34028234663852886e22,-34028234663852886e22),ae.write(e,t,r,n,23,4),r+4}u.prototype.writeFloatLE=function(t,r,n){return dr(this,t,r,!0,n)};u.prototype.writeFloatBE=function(t,r,n){return dr(this,t,r,!1,n)};function mr(e,t,r,n,i){return t=+t,r=r>>>0,i||ur(e,t,r,8,17976931348623157e292,-17976931348623157e292),ae.write(e,t,r,n,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,n){return mr(this,t,r,!0,n)};u.prototype.writeDoubleBE=function(t,r,n){return mr(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 l=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),l};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 l=t.charCodeAt(0);(i==="utf8"&&l<128||i==="latin1")&&(t=l)}}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 pi=/[^+/0-9A-Za-z-_]/g;function ui(e){if(e=e.split("=")[0],e=e.trim().replace(pi,""),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,l=[],p=0;p<n;++p){if(r=e.charCodeAt(p),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&l.push(239,191,189);continue}else if(p+1===n){(t-=3)>-1&&l.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&l.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&l.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;l.push(r)}else if(r<2048){if((t-=2)<0)break;l.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;l.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;l.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return l}function di(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function mi(e,t){for(var r,n,i,l=[],p=0;p<e.length&&!((t-=2)<0);++p)r=e.charCodeAt(p),n=r>>8,i=r%256,l.push(i),l.push(n);return l}function gr(e){return rt.toByteArray(ui(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 gi=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 Sr=ve((Ba,xr)=>{o();var A=xr.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 Tr(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 fi(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,re,Le=-1;function Ti(){!ce||!re||(ce=!1,re.length?W=re.concat(W):Le=-1,W.length&&yr())}function yr(){if(!ce){var e=Tr(Ti);ce=!0;for(var t=W.length;t;){for(re=W,W=[];++Le<t;)re&&re[Le].run();Le=-1,t=W.length}re=null,ce=!1,fi(e)}}A.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 hr(e,t)),W.length===1&&!ce&&Tr(yr)};function hr(e,t){this.fun=e,this.array=t}hr.prototype.run=function(){this.fun.apply(null,this.array)};A.title="browser";A.browser=!0;A.env={};A.argv=[];A.version="";A.versions={};function q(){}A.on=q;A.addListener=q;A.once=q;A.off=q;A.removeListener=q;A.removeAllListeners=q;A.emit=q;A.prependListener=q;A.prependOnceListener=q;A.listeners=function(e){return[]};A.binding=function(e){throw new Error("process.binding is not supported")};A.cwd=function(){return"/"};A.chdir=function(e){throw new Error("process.chdir is not supported")};A.umask=function(){return 0}});var a,s,Ua,o=h(()=>{a=w(fr()),s=w(Sr()),Ua=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 wr=h(()=>{"use strict";o()});var br=h(()=>{"use strict";o()});var L=h(()=>{"use strict";o()});var O=h(()=>{"use strict";o()});var Ar=h(()=>{"use strict";o()});var vr=h(()=>{"use strict";o()});var Ir=h(()=>{"use strict";o()});var kr=h(()=>{"use strict";o()});var j=h(()=>{"use strict";o();br();L();O();Ar();vr();Ir();kr()});var ut,Er,ts,Lr,rs,Dr,ns,os,is,Nr=h(()=>{"use strict";o();j();ut={devnet:{id:"devnet",chainId:"D",name:"Devnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://devnet-wallet.elrond.com",apiAddress:"https://devnet-api.elrond.com",explorerAddress:"http://devnet-explorer.elrond.com",apiTimeout:"4000"},testnet:{id:"testnet",chainId:"T",name:"Testnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://testnet-wallet.elrond.com",apiAddress:"https://testnet-api.elrond.com",explorerAddress:"http://testnet-explorer.elrond.com",apiTimeout:"4000"},mainnet:{id:"mainnet",chainId:"1",name:"Mainnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://wallet.elrond.com",apiAddress:"https://api.elrond.com",explorerAddress:"https://explorer.elrond.com",apiTimeout:"4000"}},{chainId:Er,egldLabel:ts}=ut["devnet"],{chainId:Lr,egldLabel:rs}=ut["testnet"],{chainId:Dr,egldLabel:ns}=ut["mainnet"],os={["devnet"]:Er,["testnet"]:Lr,["mainnet"]:Dr},is={[Er]:"devnet",[Lr]:"testnet",[Dr]:"mainnet"}});var dt=h(()=>{"use strict";o()});var Cr=h(()=>{"use strict";o()});var Rr,mt=h(()=>{"use strict";o();Rr="transaction-status-toast-id"});var Pr,De,Y,le,Fr,Ne,_r,Z,b=h(()=>{"use strict";o();wr();Nr();dt();Cr();mt();Pr=.01,De=1500,Y=5e4,le=1e9,Fr=1,Ne="logout",_r="login",Z="0"});var Ce,gt=h(()=>{"use strict";o();Ce=()=>Date.now()/1e3});var Mr=h(()=>{"use strict";o()});var Or=h(()=>{"use strict";o()});var Br=h(()=>{"use strict";o();gt();Mr();Or()});var Tt={};Q(Tt,{getItem:()=>hi,localStorageKeys:()=>ne,removeItem:()=>xi,setItem:()=>yi});var ne,ft,yi,hi,xi,Te=h(()=>{"use strict";o();Br();ne={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},ft=typeof localStorage!="undefined",yi=({key:e,data:t,expires:r})=>{!ft||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},hi=e=>{if(!ft)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:Ce()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},xi=e=>{!ft||localStorage.removeItem(String(e))}});var yt={};Q(yt,{clear:()=>Gr,getItem:()=>Vr,removeItem:()=>$r,setItem:()=>Ur,storage:()=>Si});var Ur,Vr,$r,Gr,Si,Hr=h(()=>{"use strict";o();Ur=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Vr=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},$r=e=>sessionStorage.removeItem(String(e)),Gr=()=>sessionStorage.clear(),Si={setItem:Ur,getItem:Vr,removeItem:$r,clear:Gr}});var pe,Re=h(()=>{"use strict";o();Te();Hr();pe={session:yt,local:Tt}});function ye(){return new Date().setHours(new Date().getHours()+24)}function he(e){pe.local.setItem({key:ne.loginExpiresAt,data:e,expires:e})}var ht=h(()=>{"use strict";o();Re();Te()});var xt,N,Pe,X=h(()=>{"use strict";o();xt=require("@reduxjs/toolkit");b();N=(0,xt.createAction)(Ne),Pe=(0,xt.createAction)(_r,e=>({payload:e}))});var qr,Wr,jr,_s,Ms,Os,Bs,Us,Vs,zr,Kr,St=h(()=>{"use strict";o();qr=require("@reduxjs/toolkit");ht();O();X();Wr={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},jr=(0,qr.createSlice)({name:"loginInfoSlice",initialState:Wr,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,()=>Wr),e.addCase(Pe,(t,r)=>{t.loginMethod=r.payload.loginMethod,he(ye())})}}),{setLoginMethod:_s,setWalletConnectLogin:Ms,setLedgerLogin:Os,setTokenLogin:Bs,setTokenLoginSignature:Us,setWalletLogin:Vs,invalidateLoginSession:zr}=jr.actions,Kr=jr.reducer});var Yr=h(()=>{"use strict";o()});var Zr=h(()=>{"use strict";o();Yr()});function wt(e){return e[Math.floor(Math.random()*e.length)]}var Xr=h(()=>{"use strict";o()});var Jr=h(()=>{"use strict";o();dt()});var Qr=h(()=>{"use strict";o();Zr();Xr();Jr()});var en,tn,bt,bi,rn,rc,nc,nn,At=h(()=>{"use strict";o();en=require("@reduxjs/toolkit"),tn=w(require("lodash.omit"));Qr();bt={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},bi={network:bt,chainID:"-1"},rn=(0,en.createSlice)({name:"appConfig",initialState:bi,reducers:{initializeNetworkConfig:(e,t)=>{let r=wt(t.payload.walletConnectBridgeAddresses),n=wt(t.payload.walletConnectV2RelayAddresses),i=(0,tn.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:rc,setChainID:nc}=rn.actions,nn=rn.reducer});var It,on,an,Fe,vt,sn,cn,uc,ln,dc,mc,gc,fc,Tc,yc,hc,pn,kt=h(()=>{"use strict";o();It=require("@elrondnetwork/erdjs"),on=require("@reduxjs/toolkit"),an=require("redux-persist");b();Re();Te();X();Fe={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Z},vt={address:"",websocketEvent:null,accounts:{"":Fe},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},sn=(0,on.createSlice)({name:"accountInfoSlice",initialState:vt,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new It.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,()=>(pe.local.removeItem(ne.loginExpiresAt),vt)),e.addCase(Pe,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new It.Address(n).hex()}),e.addCase(an.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:i,shard:l,accounts:p,publicKey:m}=n;t.address=i,t.shard=l;let d=p&&i in p;t.accounts=d?p:vt.accounts,t.publicKey=m})}}),{setAccount:cn,setAddress:uc,setAccountNonce:ln,setAccountShard:dc,setLedgerAccount:mc,updateLedgerAccount:gc,setWalletConnectAccount:fc,setIsAccountLoading:Tc,setAccountLoadingError:yc,setWebsocketEvent:hc}=sn.actions,pn=sn.reducer});function un(e){return e!=null&&(Ci(e)||_i(e))}function _e(e){return e!=null&&(Ri(e)||Mi(e))}function Me(e){return e!=null&&(Pi(e)||Oi(e))}function dn(e){return e!=null&&Fi(e)}function Ci(e){return e!=null&&vi.includes(e)}function Ri(e){return e!=null&&Ii.includes(e)}function Pi(e){return e!=null&&ki.includes(e)}function Fi(e){return e!=null&&Ei.includes(e)}function _i(e){return e!=null&&Li.includes(e)}function Mi(e){return e!=null&&Di.includes(e)}function Oi(e){return e!=null&&Ni.includes(e)}var vi,Ii,ki,Ei,Li,Di,Ni,Lt=h(()=>{"use strict";o();O();vi=["sent"],Ii=["success"],ki=["fail","cancelled","timedOut"],Ei=["timedOut"],Li=["pending"],Di=["success"],Ni=["fail","invalid"]});var mn,gn,xe,Bi,fn,Ec,Lc,Tn,Dc,Nc,Cc,Rc,Pc,yn,Fc,Oe,Be=h(()=>{"use strict";o();mn=require("@reduxjs/toolkit"),gn=require("redux-persist");O();Lt();X();xe={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Bi={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},fn=(0,mn.createSlice)({name:"transactionsSlice",initialState:xe,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,g;let{sessionId:r,transactions:n,errorMessage:i,status:l,redirectRoute:p}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||Bi;e.signedTransactions[r]={transactions:n,status:l,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:l}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=n,i!=null&&(e.signedTransactions[r].errorMessage=i),l!=null&&(e.signedTransactions[r].transactions=l))},updateSignedTransactionStatus:(e,t)=>{var m,d,g,T,f,S;let{sessionId:r,status:n,errorMessage:i,transactionHash:l}=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===l?E(x({},R),{status:n,errorMessage:i}):R);let v=(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));v&&(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(gn.REHYDRATE,(t,r)=>{var p;if(t.signTransactionsCancelMessage=null,!((p=r.payload)!=null&&p.transactions))return;let{signedTransactions:n,customTransactionInformationForSessionId:i}=r.payload.transactions,l=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=l)})}}),{updateSignedTransactionStatus:Ec,updateSignedTransactions:Lc,setTransactionsToSign:Tn,clearAllTransactionsToSign:Dc,clearAllSignedTransactions:Nc,clearSignedTransaction:Cc,clearTransactionToSign:Rc,setSignTransactionsError:Pc,setSignTransactionsCancelMessage:yn,moveTransactionsToSignedState:Fc}=fn.actions,Oe=fn.reducer});var hn,Nt,Ct,Rt,Ui,Dt,xn,Bc,Sn,Uc,Ue,Ve=h(()=>{"use strict";o();hn=require("@reduxjs/toolkit");X();Nt="Transaction failed",Ct="Transaction successful",Rt="Processing transaction",Ui="Transaction submitted",Dt={},xn=(0,hn.createSlice)({name:"transactionsInfo",initialState:Dt,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||Nt,successMessage:(n==null?void 0:n.successMessage)||Ct,processingMessage:(n==null?void 0:n.processingMessage)||Rt,submittedMessage:(n==null?void 0:n.submittedMessage)||Ui,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>Dt},extraReducers:e=>{e.addCase(N,()=>Dt)}}),{clearTransactionsInfo:Bc,setTransactionsDisplayInfo:Sn,clearTransactionsInfoForSessionId:Uc}=xn.actions,Ue=xn.reducer});var bn,wn,An,Hc,Pt,Wc,qc,vn,Ft=h(()=>{"use strict";o();bn=require("@reduxjs/toolkit");X();wn={},An=(0,bn.createSlice)({name:"modalsSlice",initialState:wn,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,()=>wn)}}),{setTxSubmittedModal:Hc,setNotificationModal:Pt,clearTxSubmittedModal:Wc,clearNotificationModal:qc}=An.actions,vn=An.reducer});var kn,En,In,Ln,Qc,el,tl,rl,nl,ol,$e,Ge=h(()=>{"use strict";o();kn=require("@reduxjs/toolkit"),En=require("redux-persist");mt();j();gt();X();In={customToasts:[],transactionToasts:[],failTransactionToast:null},Ln=(0,kn.createSlice)({name:"toastsSlice",initialState:In,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:Ce(),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:Rr})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(N,()=>In),e.addCase(En.REHYDRATE,(t,r)=>{var i,l;let n=(l=(i=r.customToasts)==null?void 0:i.filter(p=>!("component"in p)))!=null?l:[];t.customToasts=n})}}),{addCustomToast:Qc,removeCustomToast:el,addTransactionToast:tl,removeTransactionToast:rl,addFailTransactionToast:nl,removeFailTransactionToast:ol}=Ln.actions,$e=Ln.reducer});var oe=h(()=>{"use strict";o();St();At();kt();Be();Ve();Ft();Ge()});var Ot=h(()=>{"use strict";o()});var On,Mn,Bn,Gl,Hl,Wl,ql,jl,zl,Un,Vn=h(()=>{"use strict";o();On=require("@reduxjs/toolkit");X();Mn={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Bn=(0,On.createSlice)({name:"dappModalsSlice",initialState:Mn,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,()=>Mn)}}),{setDappModalVisibility:Gl,setDappModalHeaderVisibility:Hl,setDappModalFooterVisibility:Wl,setDappModalHeaderText:ql,setDappModalFooterText:jl,setDappModalConfig:zl}=Bn.actions,Un=Bn.reducer});var $n,Hi,Wi,de,je=h(()=>{"use strict";o();$n=require("@reduxjs/toolkit");Ot();kt();Vn();St();Ft();At();Ge();Ve();Be();Hi={["account"]:pn,["networkConfig"]:nn,["loginInfo"]:Kr,["modals"]:vn,["dappModal"]:Un,["toasts"]:$e,["transactions"]:Oe,["transactionsInfo"]:Ue},Wi=(e={})=>(0,$n.combineReducers)(x(x({},Hi),e)),de=Wi});var Wn={};Q(Wn,{default:()=>Xi});function Bt(e,t=[]){return{key:e,version:1,storage:Hn.default,blacklist:t}}var ie,Gn,Hn,qi,ji,zi,Ki,Yi,Zi,Xi,qn=h(()=>{"use strict";o();ie=require("redux-persist"),Gn=w(require("redux-persist/lib/storage")),Hn=w(require("redux-persist/lib/storage/session"));je();oe();Ge();Ve();Be();Ot();qi={2:e=>E(x({},e),{networkConfig:bt})};ji=Bt("dapp-core-transactionsInfo"),zi=Bt("dapp-core-transactions",["transactionsToSign"]),Ki=Bt("dapp-core-toasts"),Yi={key:"dapp-core-store",version:2,storage:Gn.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,ie.createMigrate)(qi,{debug:!1})},Zi={["toasts"]:(0,ie.persistReducer)(Ki,$e),["transactions"]:(0,ie.persistReducer)(zi,Oe),["transactionsInfo"]:(0,ie.persistReducer)(ji,Ue)},Xi=(0,ie.persistReducer)(Yi,de(Zi))});var jn={};Q(jn,{default:()=>Ji});var Ji,zn=h(()=>{"use strict";o();je();Ji=de()});var Kn={};Q(Kn,{default:()=>ea});var M,Qi,ea,Yn=h(()=>{"use strict";o();M=require("redux-persist"),Qi=[M.FLUSH,M.REHYDRATE,M.PAUSE,M.PERSIST,M.PURGE,M.REGISTER],ea=Qi});var Jn={};Q(Jn,{default:()=>Xn});function Xn(e){return(0,Zn.persistStore)(e)}var Zn,Qn=h(()=>{"use strict";o();Zn=require("redux-persist")});var Pa={};Q(Pa,{sendTransactions:()=>Ra});module.exports=fe(Pa);o();o();var mo=w(require("bignumber.js"));b();o();oe();o();var Dn=w(require("lodash.isequal")),He=require("reselect"),y=(0,He.createSelectorCreator)(He.defaultMemoize,Dn.default);var z=e=>e.account,Se=y(z,e=>e.address),_t=y(z,Se,(e,t)=>t in e.accounts?e.accounts[t]:Fe),yl=y(z,_t,(e,t)=>{let i=e,{accounts:r}=i,n=Xt(i,["accounts"]);return E(x({},n),{account:t})}),Nn=y(_t,e=>e.balance),Cn=y(_t,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),hl=y(z,e=>e.shard),xl=y(z,e=>e.ledgerAccount),Sl=y(z,e=>e.walletConnectAccount),wl=y(z,e=>e.isAccountLoading),bl=y(z,e=>e.accountLoadingError),Al=y(z,e=>e.websocketEvent);o();var ue=e=>e.networkConfig,We=y(ue,e=>e.chainID),kl=y(ue,e=>e.network.walletConnectBridgeAddress),El=y(ue,e=>e.network.walletConnectV2RelayAddress),Ll=y(ue,e=>e.network.walletConnectV2ProjectId),Dl=y(ue,e=>e.network.walletConnectDeepLink),Mt=y(ue,e=>e.network),Rn=y(Mt,e=>e.apiAddress),Pn=y(Mt,e=>e.explorerAddress),Nl=y(Mt,e=>e.egldLabel);oe();o();var Ut=require("@reduxjs/toolkit"),no=require("react-redux/es/utils/Subscription");oe();o();var Fn=w(require("lodash.throttle"));b();oe();ht();Re();Te();var Vi=[Ne],$i=(0,Fn.default)(()=>{he(ye())},5e3),_n=e=>t=>r=>{var d;if(Vi.includes(r.type))return t(r);let n=e.getState(),i=pe.local.getItem(ne.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(zr())}catch(g){console.error("error logging out",g)}}),1e3):($i(),t(r))};o();o();function qe(){return typeof sessionStorage!="undefined"}var eo=qe()?(qn(),fe(Wn)).default:(zn(),fe(jn)).default,to=qe()?(Yn(),fe(Kn)).default:[],ro=qe()?(Qn(),fe(Jn)).default:e=>e;je();var k=(0,Ut.configureStore)({reducer:eo,middleware:e=>e({serializableCheck:{ignoredActions:[...to,ln.type,cn.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(_n)}),hp=(0,no.createSubscription)(k),xp=ro(k),Sp=(0,Ut.configureStore)({reducer:de});j();o();var oo=w(require("bignumber.js"));b();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 oo.default(n);return i.toString(10)===n&&i.comparedTo(0)>=0};o();var Gt=w(require("bignumber.js"));b();o();o();b();o();var ta=require("@elrondnetwork/erdjs"),$t=w(require("bignumber.js"));b();o();var io=w(require("bignumber.js")),Vt=(e,t=!0)=>{let r=String(e);if(!r.match(/^[-]?\d+$/))return!1;let n=new io.default(r),i=t?0:-1;return n.toString(10)===r&&n.comparedTo(0)>=i};o();$t.default.config({ROUNDING_MODE:$t.default.ROUND_FLOOR});o();b();o();var ra=require("@elrondnetwork/erdjs");b();o();var K=require("@elrondnetwork/erdjs"),co=require("@elrondnetwork/erdjs"),lo=require("@elrondnetwork/erdjs-network-providers");b();o();o();b();o();var so={from:"erd12dnfhej64s6c56ka369gkyj3hwv5ms0y5rxgsk2k7hkd2vuk7rvqxkalsa",to:"erd12dnfhej64s6c56ka369gkyj3hwv5ms0y5rxgsk2k7hkd2vuk7rvqxkalsa"};function po({minGasLimit:e=String(Y),gasLimit:t,gasPrice:r,data:n,gasPerDataByte:i,gasPriceModifier:l,defaultGasPrice:p=String(le),chainId:m}){let d=n||"",g=Vt(t)?t:e,T=ze(r)?r:p,f=new K.Transaction({nonce:0,value:co.TokenPayment.egldFromAmount("0"),receiver:new K.Address(so.to),sender:new K.Address(so.to),gasPrice:parseInt(T),gasLimit:parseInt(g),data:new K.TransactionPayload(d.trim()),chainID:m,version:new K.TransactionVersion(1)}),S=new lo.NetworkConfig;S.MinGasLimit=parseInt(e),S.GasPerDataByte=parseInt(i),S.GasPriceModifier=parseFloat(l);try{return f.computeFee(S).toString(10)}catch(v){return Z}}o();o();o();function uo(e,t){let r=new Gt.default(0);return e.forEach(n=>{let i=po({gasPerDataByte:String(De),gasPriceModifier:String(Pr),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 Gt.default(i))}),r}function go(l){return F(this,arguments,function*({transactions:e,callbackRoute:t,minGasLimit:r=Y,customTransactionInformation:n,transactionsDisplayInfo:i}){let p=k.getState(),m=Date.now().toString(),d=Nn(p),g=We(p),T=Array.isArray(e)?e:[e],f=uo(T,r);if(!new mo.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 k.dispatch(Pt(G)),{error:"insufficient funds",sessionId:null}}if(!(T==null?void 0:T.every(G=>G.getChainID().valueOf()===g.valueOf()))){let G={type:"warning",iconClassName:"text-warning",title:"Network change detected",description:"The application tried to change the transaction network"};return k.dispatch(Pt(G)),{error:"Invalid ChainID",sessionId:null}}let R={sessionId:m,callbackRoute:t,customTransactionInformation:n,transactions:T.map(G=>G.toPlainObject())};return k.dispatch(yn(null)),k.dispatch(Tn(R)),k.d