UNPKG

@sofaws/dapp-core

Version:

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

1 lines 86.2 kB
"use strict";var Va=Object.create;var Fe=Object.defineProperty,Ha=Object.defineProperties,Wa=Object.getOwnPropertyDescriptor,Ga=Object.getOwnPropertyDescriptors,qa=Object.getOwnPropertyNames,ot=Object.getOwnPropertySymbols,za=Object.getPrototypeOf,Wt=Object.prototype.hasOwnProperty,pn=Object.prototype.propertyIsEnumerable;var ln=(e,t,r)=>t in e?Fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))Wt.call(t,r)&&ln(e,r,t[r]);if(ot)for(var r of ot(t))pn.call(t,r)&&ln(e,r,t[r]);return e},v=(e,t)=>Ha(e,Ga(t));var xe=(e,t)=>{var r={};for(var n in e)Wt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ot)for(var n of ot(e))t.indexOf(n)<0&&pn.call(e,n)&&(r[n]=e[n]);return r};var S=(e,t)=>()=>(e&&(t=e(e=0)),t);var it=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),de=(e,t)=>{for(var r in t)Fe(e,r,{get:t[r],enumerable:!0})},un=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of qa(t))!Wt.call(e,i)&&i!==r&&Fe(e,i,{get:()=>t[i],enumerable:!(n=Wa(t,i))||n.enumerable});return e};var E=(e,t,r)=>(r=e!=null?Va(za(e)):{},un(t||!e||!e.__esModule?Fe(r,"default",{value:e,enumerable:!0}):r,e)),Me=e=>un(Fe({},"__esModule",{value:!0}),e);var k=(e,t,r)=>new Promise((n,i)=>{var a=m=>{try{u(r.next(m))}catch(g){i(g)}},s=m=>{try{u(r.throw(m))}catch(g){i(g)}},u=m=>m.done?n(m.value):Promise.resolve(m.value).then(a,s);u((r=r.apply(e,t)).next())});var gn=it(at=>{"use strict";o();at.byteLength=Ka;at.toByteArray=Za;at.fromByteArray=Qa;var V=[],O=[],ja=typeof Uint8Array!="undefined"?Uint8Array:Array,Gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(me=0,dn=Gt.length;me<dn;++me)V[me]=Gt[me],O[Gt.charCodeAt(me)]=me;var me,dn;O["-".charCodeAt(0)]=62;O["_".charCodeAt(0)]=63;function mn(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 Ka(e){var t=mn(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Ya(e,t,r){return(t+r)*3/4-r}function Za(e){var t,r=mn(e),n=r[0],i=r[1],a=new ja(Ya(e,n,i)),s=0,u=i>0?n-4:n,m;for(m=0;m<u;m+=4)t=O[e.charCodeAt(m)]<<18|O[e.charCodeAt(m+1)]<<12|O[e.charCodeAt(m+2)]<<6|O[e.charCodeAt(m+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=t&255;return i===2&&(t=O[e.charCodeAt(m)]<<2|O[e.charCodeAt(m+1)]>>4,a[s++]=t&255),i===1&&(t=O[e.charCodeAt(m)]<<10|O[e.charCodeAt(m+1)]<<4|O[e.charCodeAt(m+2)]>>2,a[s++]=t>>8&255,a[s++]=t&255),a}function Xa(e){return V[e>>18&63]+V[e>>12&63]+V[e>>6&63]+V[e&63]}function Ja(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(Xa(n));return i.join("")}function Qa(e){for(var t,r=e.length,n=r%3,i=[],a=16383,s=0,u=r-n;s<u;s+=a)i.push(Ja(e,s,s+a>u?u:s+a));return n===1?(t=e[r-1],i.push(V[t>>2]+V[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(V[t>>10]+V[t>>4&63]+V[t<<2&63]+"=")),i.join("")}});var fn=it(qt=>{o();qt.read=function(e,t,r,n,i){var a,s,u=i*8-n-1,m=(1<<u)-1,g=m>>1,T=-7,f=r?i-1:0,y=r?-1:1,w=e[t+f];for(f+=y,a=w&(1<<-T)-1,w>>=-T,T+=u;T>0;a=a*256+e[t+f],f+=y,T-=8);for(s=a&(1<<-T)-1,a>>=-T,T+=n;T>0;s=s*256+e[t+f],f+=y,T-=8);if(a===0)a=1-g;else{if(a===m)return s?NaN:(w?-1:1)*(1/0);s=s+Math.pow(2,n),a=a-g}return(w?-1:1)*s*Math.pow(2,a-n)};qt.write=function(e,t,r,n,i,a){var s,u,m,g=a*8-i-1,T=(1<<g)-1,f=T>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=n?0:a-1,A=n?1:-1,I=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=T):(s=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-s))<1&&(s--,m*=2),s+f>=1?t+=y/m:t+=y*Math.pow(2,1-f),t*m>=2&&(s++,m/=2),s+f>=T?(u=0,s=T):s+f>=1?(u=(t*m-1)*Math.pow(2,i),s=s+f):(u=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+w]=u&255,w+=A,u/=256,i-=8);for(s=s<<i|u,g+=i;g>0;e[r+w]=s&255,w+=A,s/=256,g-=8);e[r+w-A]|=I*128}});var Ln=it(we=>{"use strict";o();var zt=gn(),Se=fn(),Tn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;we.Buffer=d;we.SlowBuffer=is;we.INSPECT_MAX_BYTES=50;var st=2147483647;we.kMaxLength=st;d.TYPED_ARRAY_SUPPORT=es();!d.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function es(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(r){return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(!!d.isBuffer(this))return this.buffer}});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(!!d.isBuffer(this))return this.byteOffset}});function ee(e){if(e>st)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,d.prototype),t}function d(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Zt(e)}return xn(e,t,r)}d.poolSize=8192;function xn(e,t,r){if(typeof e=="string")return rs(e,t);if(ArrayBuffer.isView(e))return ns(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(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(H(e,SharedArrayBuffer)||e&&H(e.buffer,SharedArrayBuffer)))return Kt(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return d.from(n,t,r);var i=os(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return d.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}d.from=function(e,t,r){return xn(e,t,r)};Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Sn(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 ts(e,t,r){return Sn(e),e<=0?ee(e):t!==void 0?typeof r=="string"?ee(e).fill(t,r):ee(e).fill(t):ee(e)}d.alloc=function(e,t,r){return ts(e,t,r)};function Zt(e){return Sn(e),ee(e<0?0:Xt(e)|0)}d.allocUnsafe=function(e){return Zt(e)};d.allocUnsafeSlow=function(e){return Zt(e)};function rs(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!d.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=wn(e,t)|0,n=ee(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function jt(e){for(var t=e.length<0?0:Xt(e.length)|0,r=ee(t),n=0;n<t;n+=1)r[n]=e[n]&255;return r}function ns(e){if(H(e,Uint8Array)){var t=new Uint8Array(e);return Kt(t.buffer,t.byteOffset,t.byteLength)}return jt(e)}function Kt(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,d.prototype),n}function os(e){if(d.isBuffer(e)){var t=Xt(e.length)|0,r=ee(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||Jt(e.length)?ee(0):jt(e);if(e.type==="Buffer"&&Array.isArray(e.data))return jt(e.data)}function Xt(e){if(e>=st)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+st.toString(16)+" bytes");return e|0}function is(e){return+e!=e&&(e=0),d.alloc(+e)}d.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==d.prototype};d.compare=function(t,r){if(H(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),H(r,Uint8Array)&&(r=d.from(r,r.offset,r.byteLength)),!d.isBuffer(t)||!d.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var n=t.length,i=r.length,a=0,s=Math.min(n,i);a<s;++a)if(t[a]!==r[a]){n=t[a],i=r[a];break}return n<i?-1:i<n?1:0};d.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};d.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return d.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=d.allocUnsafe(r),a=0;for(n=0;n<t.length;++n){var s=t[n];if(H(s,Uint8Array))a+s.length>i.length?d.from(s).copy(i,a):Uint8Array.prototype.set.call(i,s,a);else if(d.isBuffer(s))s.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=s.length}return i};function wn(e,t){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(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 Yt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return kn(e).length;default:if(i)return n?-1:Yt(e).length;t=(""+t).toLowerCase(),i=!0}}d.byteLength=wn;function as(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 Ts(this,t,r);case"utf8":case"utf-8":return vn(this,t,r);case"ascii":return gs(this,t,r);case"latin1":case"binary":return fs(this,t,r);case"base64":return ds(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ys(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}d.prototype._isBuffer=!0;function ge(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}d.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)ge(this,r,r+1);return this};d.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)ge(this,r,r+3),ge(this,r+1,r+2);return this};d.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)ge(this,r,r+7),ge(this,r+1,r+6),ge(this,r+2,r+5),ge(this,r+3,r+4);return this};d.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?vn(this,0,t):as.apply(this,arguments)};d.prototype.toLocaleString=d.prototype.toString;d.prototype.equals=function(t){if(!d.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:d.compare(this,t)===0};d.prototype.inspect=function(){var t="",r=we.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Tn&&(d.prototype[Tn]=d.prototype.inspect);d.prototype.compare=function(t,r,n,i,a){if(H(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),r<0||n>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,a>>>=0,this===t)return 0;for(var s=a-i,u=n-r,m=Math.min(s,u),g=this.slice(i,a),T=t.slice(r,n),f=0;f<m;++f)if(g[f]!==T[f]){s=g[f],u=T[f];break}return s<u?-1:u<s?1:0};function bn(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,Jt(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=d.from(t,n)),d.isBuffer(t))return t.length===0?-1:yn(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):yn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function yn(e,t,r,n,i){var a=1,s=e.length,u=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function m(w,A){return a===1?w[A]:w.readUInt16BE(A*a)}var g;if(i){var T=-1;for(g=r;g<s;g++)if(m(e,g)===m(t,T===-1?0:g-T)){if(T===-1&&(T=g),g-T+1===u)return T*a}else T!==-1&&(g-=g-T),T=-1}else for(r+u>s&&(r=s-u),g=r;g>=0;g--){for(var f=!0,y=0;y<u;y++)if(m(e,g+y)!==m(t,y)){f=!1;break}if(f)return g}return-1}d.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};d.prototype.indexOf=function(t,r,n){return bn(this,t,r,n,!0)};d.prototype.lastIndexOf=function(t,r,n){return bn(this,t,r,n,!1)};function ss(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var a=t.length;n>a/2&&(n=a/2);for(var s=0;s<n;++s){var u=parseInt(t.substr(s*2,2),16);if(Jt(u))return s;e[r+s]=u}return s}function cs(e,t,r,n){return ct(Yt(t,e.length-r),e,r,n)}function ls(e,t,r,n){return ct(Ss(t),e,r,n)}function ps(e,t,r,n){return ct(kn(t),e,r,n)}function us(e,t,r,n){return ct(ws(t,e.length-r),e,r,n)}d.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 a=this.length-r;if((n===void 0||n>a)&&(n=a),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return ss(this,t,r,n);case"utf8":case"utf-8":return cs(this,t,r,n);case"ascii":case"latin1":case"binary":return ls(this,t,r,n);case"base64":return ps(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return us(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ds(e,t,r){return t===0&&r===e.length?zt.fromByteArray(e):zt.fromByteArray(e.slice(t,r))}function vn(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a=e[i],s=null,u=a>239?4:a>223?3:a>191?2:1;if(i+u<=r){var m,g,T,f;switch(u){case 1:a<128&&(s=a);break;case 2:m=e[i+1],(m&192)===128&&(f=(a&31)<<6|m&63,f>127&&(s=f));break;case 3:m=e[i+1],g=e[i+2],(m&192)===128&&(g&192)===128&&(f=(a&15)<<12|(m&63)<<6|g&63,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:m=e[i+1],g=e[i+2],T=e[i+3],(m&192)===128&&(g&192)===128&&(T&192)===128&&(f=(a&15)<<18|(m&63)<<12|(g&63)<<6|T&63,f>65535&&f<1114112&&(s=f))}}s===null?(s=65533,u=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=u}return ms(n)}var hn=4096;function ms(e){var t=e.length;if(t<=hn)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=hn));return r}function gs(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 fs(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 Ts(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=bs[e[a]];return i}function ys(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}d.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);var i=this.subarray(t,r);return Object.setPrototypeOf(i,d.prototype),i};function N(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||N(t,r,this.length);for(var i=this[t],a=1,s=0;++s<r&&(a*=256);)i+=this[t+s]*a;return i};d.prototype.readUintBE=d.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||N(t,r,this.length);for(var i=this[t+--r],a=1;r>0&&(a*=256);)i+=this[t+--r]*a;return i};d.prototype.readUint8=d.prototype.readUInt8=function(t,r){return t=t>>>0,r||N(t,1,this.length),this[t]};d.prototype.readUint16LE=d.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||N(t,2,this.length),this[t]|this[t+1]<<8};d.prototype.readUint16BE=d.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||N(t,2,this.length),this[t]<<8|this[t+1]};d.prototype.readUint32LE=d.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};d.prototype.readUint32BE=d.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||N(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};d.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||N(t,r,this.length);for(var i=this[t],a=1,s=0;++s<r&&(a*=256);)i+=this[t+s]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*r)),i};d.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||N(t,r,this.length);for(var i=r,a=1,s=this[t+--i];i>0&&(a*=256);)s+=this[t+--i]*a;return a*=128,s>=a&&(s-=Math.pow(2,8*r)),s};d.prototype.readInt8=function(t,r){return t=t>>>0,r||N(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};d.prototype.readInt16LE=function(t,r){t=t>>>0,r||N(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};d.prototype.readInt16BE=function(t,r){t=t>>>0,r||N(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};d.prototype.readInt32LE=function(t,r){return t=t>>>0,r||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};d.prototype.readInt32BE=function(t,r){return t=t>>>0,r||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};d.prototype.readFloatLE=function(t,r){return t=t>>>0,r||N(t,4,this.length),Se.read(this,t,!0,23,4)};d.prototype.readFloatBE=function(t,r){return t=t>>>0,r||N(t,4,this.length),Se.read(this,t,!1,23,4)};d.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||N(t,8,this.length),Se.read(this,t,!0,52,8)};d.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||N(t,8,this.length),Se.read(this,t,!1,52,8)};function F(e,t,r,n,i,a){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var a=Math.pow(2,8*n)-1;F(this,t,r,n,a,0)}var s=1,u=0;for(this[r]=t&255;++u<n&&(s*=256);)this[r+u]=t/s&255;return r+n};d.prototype.writeUintBE=d.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var a=Math.pow(2,8*n)-1;F(this,t,r,n,a,0)}var s=n-1,u=1;for(this[r+s]=t&255;--s>=0&&(u*=256);)this[r+s]=t/u&255;return r+n};d.prototype.writeUint8=d.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||F(this,t,r,1,255,0),this[r]=t&255,r+1};d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||F(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||F(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||F(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||F(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};d.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var a=Math.pow(2,8*n-1);F(this,t,r,n,a-1,-a)}var s=0,u=1,m=0;for(this[r]=t&255;++s<n&&(u*=256);)t<0&&m===0&&this[r+s-1]!==0&&(m=1),this[r+s]=(t/u>>0)-m&255;return r+n};d.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var a=Math.pow(2,8*n-1);F(this,t,r,n,a-1,-a)}var s=n-1,u=1,m=0;for(this[r+s]=t&255;--s>=0&&(u*=256);)t<0&&m===0&&this[r+s+1]!==0&&(m=1),this[r+s]=(t/u>>0)-m&255;return r+n};d.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||F(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};d.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||F(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};d.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||F(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};d.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||F(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};d.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||F(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 An(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function In(e,t,r,n,i){return t=+t,r=r>>>0,i||An(e,t,r,4,34028234663852886e22,-34028234663852886e22),Se.write(e,t,r,n,23,4),r+4}d.prototype.writeFloatLE=function(t,r,n){return In(this,t,r,!0,n)};d.prototype.writeFloatBE=function(t,r,n){return In(this,t,r,!1,n)};function En(e,t,r,n,i){return t=+t,r=r>>>0,i||An(e,t,r,8,17976931348623157e292,-17976931348623157e292),Se.write(e,t,r,n,52,8),r+8}d.prototype.writeDoubleLE=function(t,r,n){return En(this,t,r,!0,n)};d.prototype.writeDoubleBE=function(t,r,n){return En(this,t,r,!1,n)};d.prototype.copy=function(t,r,n,i){if(!d.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 a=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),a};d.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"&&!d.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var a=t.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var s;if(typeof t=="number")for(s=r;s<n;++s)this[s]=t;else{var u=d.isBuffer(t)?t:d.from(t,i),m=u.length;if(m===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<n-r;++s)this[s+r]=u[s%m]}return this};var hs=/[^+/0-9A-Za-z-_]/g;function xs(e){if(e=e.split("=")[0],e=e.trim().replace(hs,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Yt(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function Ss(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function ws(e,t){for(var r,n,i,a=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function kn(e){return zt.toByteArray(xs(e))}function ct(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 H(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Jt(e){return e!==e}var bs=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 Rn=it((El,Cn)=>{o();var L=Cn.exports={},W,G;function Qt(){throw new Error("setTimeout has not been defined")}function er(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?W=setTimeout:W=Qt}catch(e){W=Qt}try{typeof clearTimeout=="function"?G=clearTimeout:G=er}catch(e){G=er}})();function Dn(e){if(W===setTimeout)return setTimeout(e,0);if((W===Qt||!W)&&setTimeout)return W=setTimeout,setTimeout(e,0);try{return W(e,0)}catch(t){try{return W.call(null,e,0)}catch(r){return W.call(this,e,0)}}}function vs(e){if(G===clearTimeout)return clearTimeout(e);if((G===er||!G)&&clearTimeout)return G=clearTimeout,clearTimeout(e);try{return G(e)}catch(t){try{return G.call(null,e)}catch(r){return G.call(this,e)}}}var te=[],be=!1,fe,lt=-1;function As(){!be||!fe||(be=!1,fe.length?te=fe.concat(te):lt=-1,te.length&&Nn())}function Nn(){if(!be){var e=Dn(As);be=!0;for(var t=te.length;t;){for(fe=te,te=[];++lt<t;)fe&&fe[lt].run();lt=-1,t=te.length}fe=null,be=!1,vs(e)}}L.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];te.push(new Pn(e,t)),te.length===1&&!be&&Dn(Nn)};function Pn(e,t){this.fun=e,this.array=t}Pn.prototype.run=function(){this.fun.apply(null,this.array)};L.title="browser";L.browser=!0;L.env={};L.argv=[];L.version="";L.versions={};function re(){}L.on=re;L.addListener=re;L.once=re;L.off=re;L.removeListener=re;L.removeAllListeners=re;L.emit=re;L.prependListener=re;L.prependOnceListener=re;L.listeners=function(e){return[]};L.binding=function(e){throw new Error("process.binding is not supported")};L.cwd=function(){return"/"};L.chdir=function(e){throw new Error("process.chdir is not supported")};L.umask=function(){return 0}});var c,l,kl,o=S(()=>{c=E(Ln()),l=E(Rn()),kl=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 Fn=S(()=>{"use strict";o()});var Mn=S(()=>{"use strict";o()});var tr,le,R=S(()=>{"use strict";o();tr=(n=>(n.nft="nft",n.esdt="esdt",n.egld="egld",n))(tr||{}),le=(i=>(i.raw="raw",i.text="text",i.decimal="decimal",i.smart="smart",i))(le||{})});var M=S(()=>{"use strict";o()});var _n=S(()=>{"use strict";o()});var On=S(()=>{"use strict";o()});var Bn=S(()=>{"use strict";o()});var Un=S(()=>{"use strict";o()});var q=S(()=>{"use strict";o();Mn();R();M();_n();On();Bn();Un()});var rr,$n,Wl,Vn,Gl,Hn,ql,zl,jl,Wn=S(()=>{"use strict";o();q();rr={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:$n,egldLabel:Wl}=rr["devnet"],{chainId:Vn,egldLabel:Gl}=rr["testnet"],{chainId:Hn,egldLabel:ql}=rr["mainnet"],zl={["devnet"]:$n,["testnet"]:Vn,["mainnet"]:Hn},jl={[$n]:"devnet",[Vn]:"testnet",[Hn]:"mainnet"}});var nr=S(()=>{"use strict";o()});var Gn=S(()=>{"use strict";o()});var qn,or=S(()=>{"use strict";o();qn="transaction-status-toast-id"});var pt,ut,P,ve,zn,jn,dt,Kn,mt,Yn,Zn,z,D=S(()=>{"use strict";o();Fn();Wn();nr();Gn();or();pt=5e4,ut=1e9,P=18,ve=4,zn=1,jn=1,dt=4294967295,Kn=4294967280,mt="logout",Yn="login",Zn="refundedGas",z="0"});var ar,C,Ae,j=S(()=>{"use strict";o();ar=require("@reduxjs/toolkit");D();C=(0,ar.createAction)(mt),Ae=(0,ar.createAction)(Yn,e=>({payload:e}))});var Ue,sr=S(()=>{"use strict";o();Ue=()=>Date.now()/1e3});var Ds,to=S(()=>{"use strict";o();Ds=e=>new Date().setMilliseconds(new Date().getMilliseconds()+e)/1e3});var Ns,ro=S(()=>{"use strict";o();Ns=e=>new Date().setSeconds(new Date().getSeconds()+e)/1e3});var cr=S(()=>{"use strict";o();sr();to();ro()});var pr={};de(pr,{getItem:()=>Cs,localStorageKeys:()=>K,removeItem:()=>Rs,setItem:()=>Ps});var K,lr,Ps,Cs,Rs,Ie=S(()=>{"use strict";o();cr();K={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},lr=typeof localStorage!="undefined",Ps=({key:e,data:t,expires:r})=>{!lr||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Cs=e=>{if(!lr)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:Ue()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},Rs=e=>{!lr||localStorage.removeItem(String(e))}});var ur={};de(ur,{clear:()=>ao,getItem:()=>oo,removeItem:()=>io,setItem:()=>no,storage:()=>Fs});var no,oo,io,ao,Fs,so=S(()=>{"use strict";o();no=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},oo=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},io=e=>sessionStorage.removeItem(String(e)),ao=()=>sessionStorage.clear(),Fs={setItem:no,getItem:oo,removeItem:io,clear:ao}});var Y,Ee=S(()=>{"use strict";o();Ie();so();Y={session:ur,local:pr}});function $e(){return new Date().setHours(new Date().getHours()+24)}function Ve(e){Y.local.setItem({key:K.loginExpiresAt,data:e,expires:e})}var dr=S(()=>{"use strict";o();Ee();Ie()});var lo,co,po,Cp,Rp,Fp,Mp,_p,Op,uo,mo,mr=S(()=>{"use strict";o();lo=require("@reduxjs/toolkit");dr();M();j();co={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},po=(0,lo.createSlice)({name:"loginInfoSlice",initialState:co,reducers:{setLoginMethod:(e,t)=>{e.loginMethod=t.payload},setTokenLogin:(e,t)=>{e.tokenLogin=t.payload},setTokenLoginSignature:(e,t)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=t.payload)},setWalletLogin:(e,t)=>{e.walletLogin=t.payload},setWalletConnectLogin:(e,t)=>{e.walletConnectLogin=t.payload},setLedgerLogin:(e,t)=>{e.ledgerLogin=t.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0}},extraReducers:e=>{e.addCase(C,()=>co),e.addCase(Ae,(t,r)=>{t.loginMethod=r.payload.loginMethod,Ve($e())})}}),{setLoginMethod:Cp,setWalletConnectLogin:Rp,setLedgerLogin:Fp,setTokenLogin:Mp,setTokenLoginSignature:_p,setWalletLogin:Op,invalidateLoginSession:uo}=po.actions,mo=po.reducer});var go,gr,Tt,yt=S(()=>{"use strict";o();go=!1,gr=(e=!0)=>{go=e},Tt=(e,t=0)=>{go||setTimeout(()=>{window.location.href=e},t)}});var fo=S(()=>{"use strict";o();yt()});function fr(e){return e[Math.floor(Math.random()*e.length)]}var To=S(()=>{"use strict";o()});var yo=S(()=>{"use strict";o();nr()});var ho=S(()=>{"use strict";o();fo();To();yo()});var xo,So,Tr,Ms,wo,Jp,Qp,bo,yr=S(()=>{"use strict";o();xo=require("@reduxjs/toolkit"),So=E(require("lodash.omit"));ho();Tr={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Ms={network:Tr,chainID:"-1"},wo=(0,xo.createSlice)({name:"appConfig",initialState:Ms,reducers:{initializeNetworkConfig:(e,t)=>{let r=fr(t.payload.walletConnectBridgeAddresses),n=fr(t.payload.walletConnectV2RelayAddresses),i=(0,So.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=v(x(x({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:n})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:Jp,setChainID:Qp}=wo.actions,bo=wo.reducer});var xr,vo,Ao,ht,hr,Io,xt,su,St,cu,lu,pu,uu,du,mu,gu,Eo,Sr=S(()=>{"use strict";o();xr=require("@elrondnetwork/erdjs"),vo=require("@reduxjs/toolkit"),Ao=require("redux-persist");D();Ee();Ie();j();ht={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:z},hr={address:"",websocketEvent:null,accounts:{"":ht},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Io=(0,vo.createSlice)({name:"accountInfoSlice",initialState:hr,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new xr.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:ht},e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,t)=>{let{address:r}=e;e.accounts[r].nonce=t.payload},setAccountShard:(e,t)=>{e.shard=t.payload},setLedgerAccount:(e,t)=>{e.ledgerAccount=t.payload},updateLedgerAccount:(e,t)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=t.payload.index,e.ledgerAccount.address=t.payload.address)},setWalletConnectAccount:(e,t)=>{e.walletConnectAccount=t.payload},setIsAccountLoading:(e,t)=>{e.isAccountLoading=t.payload,e.accountLoadingError=null},setAccountLoadingError:(e,t)=>{e.accountLoadingError=t.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,t)=>{e.websocketEvent={timestamp:Date.now(),message:t.payload}}},extraReducers:e=>{e.addCase(C,()=>(Y.local.removeItem(K.loginExpiresAt),hr)),e.addCase(Ae,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new xr.Address(n).hex()}),e.addCase(Ao.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:i,shard:a,accounts:s,publicKey:u}=n;t.address=i,t.shard=a;let m=s&&i in s;t.accounts=m?s:hr.accounts,t.publicKey=u})}}),{setAccount:xt,setAddress:su,setAccountNonce:St,setAccountShard:cu,setLedgerAccount:lu,updateLedgerAccount:pu,setWalletConnectAccount:uu,setIsAccountLoading:du,setAccountLoadingError:mu,setWebsocketEvent:gu}=Io.actions,Eo=Io.reducer});function br(e){return e!=null&&(Fo(e)||Bo(e))}function He(e){return e!=null&&(Mo(e)||Uo(e))}function We(e){return e!=null&&(_o(e)||$o(e))}function vr(e){return e!=null&&Oo(e)}function Fo(e){return e!=null&&ko.includes(e)}function Mo(e){return e!=null&&Lo.includes(e)}function _o(e){return e!=null&&Do.includes(e)}function Oo(e){return e!=null&&No.includes(e)}function Bo(e){return e!=null&&Po.includes(e)}function Uo(e){return e!=null&&Co.includes(e)}function $o(e){return e!=null&&Ro.includes(e)}var ko,Lo,Do,No,Po,Co,Ro,Ar=S(()=>{"use strict";o();M();ko=["sent"],Lo=["success"],Do=["fail","cancelled","timedOut"],No=["timedOut"],Po=["pending"],Co=["success"],Ro=["fail","invalid"]});var Vo,Ho,Ge,Os,Wo,vu,Au,Iu,Eu,ku,Lu,Du,Nu,Pu,Cu,wt,bt=S(()=>{"use strict";o();Vo=require("@reduxjs/toolkit"),Ho=require("redux-persist");M();Ar();j();Ge={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Os={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Wo=(0,Vo.createSlice)({name:"transactionsSlice",initialState:Ge,reducers:{moveTransactionsToSignedState:(e,t)=>{var m,g;let{sessionId:r,transactions:n,errorMessage:i,status:a,redirectRoute:s}=t.payload,u=((m=e.customTransactionInformationForSessionId)==null?void 0:m[r])||Os;e.signedTransactions[r]={transactions:n,status:a,errorMessage:i,redirectRoute:s,customTransactionInformation:u},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===r&&(e.transactionsToSign=Ge.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:a}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=n,i!=null&&(e.signedTransactions[r].errorMessage=i),a!=null&&(e.signedTransactions[r].transactions=a))},updateSignedTransactionStatus:(e,t)=>{var u,m,g,T,f,y;let{sessionId:r,status:n,errorMessage:i,transactionHash:a}=t.payload,s=(m=(u=e.signedTransactions)==null?void 0:u[r])==null?void 0:m.transactions;if(s!=null){e.signedTransactions[r].transactions=s.map(I=>I.hash===a?v(x({},I),{status:n,errorMessage:i}):I);let w=(T=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:T.every(I=>He(I.status)),A=(y=(f=e.signedTransactions[r])==null?void 0:f.transactions)==null?void 0:y.every(I=>We(I.status));w&&(e.signedTransactions[r].status="success"),A&&(e.signedTransactions[r].status="fail")}},setTransactionsToSign:(e,t)=>{e.transactionsToSign=t.payload;let{sessionId:r,customTransactionInformation:n}=t.payload;e.customTransactionInformationForSessionId[r]=n,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=Ge.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Ge.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(C,()=>Ge),e.addCase(Ho.REHYDRATE,(t,r)=>{var s;if(t.signTransactionsCancelMessage=null,!((s=r.payload)!=null&&s.transactions))return;let{signedTransactions:n,customTransactionInformationForSessionId:i}=r.payload.transactions,a=Object.entries(n).reduce((u,[m,g])=>{let T=new Date(m),f=new Date;return f.setHours(f.getHours()+5),f-T>0||(u[m]=g),u},{});i!=null&&(t.customTransactionInformationForSessionId=i),n!=null&&(t.signedTransactions=a)})}}),{updateSignedTransactionStatus:vu,updateSignedTransactions:Au,setTransactionsToSign:Iu,clearAllTransactionsToSign:Eu,clearAllSignedTransactions:ku,clearSignedTransaction:Lu,clearTransactionToSign:Du,setSignTransactionsError:Nu,setSignTransactionsCancelMessage:Pu,moveTransactionsToSignedState:Cu}=Wo.actions,wt=Wo.reducer});var Go,Er,kr,Lr,Bs,Ir,qo,_u,Ou,Bu,vt,At=S(()=>{"use strict";o();Go=require("@reduxjs/toolkit");j();Er="Transaction failed",kr="Transaction successful",Lr="Processing transaction",Bs="Transaction submitted",Ir={},qo=(0,Go.createSlice)({name:"transactionsInfo",initialState:Ir,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||Er,successMessage:(n==null?void 0:n.successMessage)||kr,processingMessage:(n==null?void 0:n.processingMessage)||Lr,submittedMessage:(n==null?void 0:n.submittedMessage)||Bs,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>Ir},extraReducers:e=>{e.addCase(C,()=>Ir)}}),{clearTransactionsInfo:_u,setTransactionsDisplayInfo:Ou,clearTransactionsInfoForSessionId:Bu}=qo.actions,vt=qo.reducer});var jo,zo,Ko,Hu,Wu,Gu,qu,Yo,Dr=S(()=>{"use strict";o();jo=require("@reduxjs/toolkit");j();zo={},Ko=(0,jo.createSlice)({name:"modalsSlice",initialState:zo,reducers:{setTxSubmittedModal:(e,t)=>{e.txSubmittedModal=t.payload},setNotificationModal:(e,t)=>{e.notificationModal=t.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(C,()=>zo)}}),{setTxSubmittedModal:Hu,setNotificationModal:Wu,clearTxSubmittedModal:Gu,clearNotificationModal:qu}=Ko.actions,Yo=Ko.reducer});var Xo,Jo,Zo,Qo,Nr,ei,Qu,ed,td,rd,It,Et=S(()=>{"use strict";o();Xo=require("@reduxjs/toolkit"),Jo=require("redux-persist");or();q();sr();j();Zo={customToasts:[],transactionToasts:[],failTransactionToast:null},Qo=(0,Xo.createSlice)({name:"toastsSlice",initialState:Zo,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(v(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:Ue(),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=v(x({},t.payload),{toastId:qn})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(C,()=>Zo),e.addCase(Jo.REHYDRATE,(t,r)=>{var i,a;let n=(a=(i=r.customToasts)==null?void 0:i.filter(s=>!("component"in s)))!=null?a:[];t.customToasts=n})}}),{addCustomToast:Nr,removeCustomToast:ei,addTransactionToast:Qu,removeTransactionToast:ed,addFailTransactionToast:td,removeFailTransactionToast:rd}=Qo.actions,It=Qo.reducer});var oe=S(()=>{"use strict";o();mr();yr();Sr();bt();At();Dr();Et()});var Pr=S(()=>{"use strict";o()});var oi,ni,ii,bd,vd,Ad,Id,Ed,kd,ai,si=S(()=>{"use strict";o();oi=require("@reduxjs/toolkit");j();ni={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},ii=(0,oi.createSlice)({name:"dappModalsSlice",initialState:ni,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(C,()=>ni)}}),{setDappModalVisibility:bd,setDappModalHeaderVisibility:vd,setDappModalFooterVisibility:Ad,setDappModalHeaderText:Id,setDappModalFooterText:Ed,setDappModalConfig:kd}=ii.actions,ai=ii.reducer});var ci,Hs,Ws,ke,kt=S(()=>{"use strict";o();ci=require("@reduxjs/toolkit");Pr();Sr();si();mr();Dr();yr();Et();At();bt();Hs={["account"]:Eo,["networkConfig"]:bo,["loginInfo"]:mo,["modals"]:Yo,["dappModal"]:ai,["toasts"]:It,["transactions"]:wt,["transactionsInfo"]:vt},Ws=(e={})=>(0,ci.combineReducers)(x(x({},Hs),e)),ke=Ws});var ui={};de(ui,{default:()=>Zs});function Cr(e,t=[]){return{key:e,version:1,storage:pi.default,blacklist:t}}var Te,li,pi,Gs,qs,zs,js,Ks,Ys,Zs,di=S(()=>{"use strict";o();Te=require("redux-persist"),li=E(require("redux-persist/lib/storage")),pi=E(require("redux-persist/lib/storage/session"));kt();oe();Et();At();bt();Pr();Gs={2:e=>v(x({},e),{networkConfig:Tr})};qs=Cr("dapp-core-transactionsInfo"),zs=Cr("dapp-core-transactions",["transactionsToSign"]),js=Cr("dapp-core-toasts"),Ks={key:"dapp-core-store",version:2,storage:li.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,Te.createMigrate)(Gs,{debug:!1})},Ys={["toasts"]:(0,Te.persistReducer)(js,It),["transactions"]:(0,Te.persistReducer)(zs,wt),["transactionsInfo"]:(0,Te.persistReducer)(qs,vt)},Zs=(0,Te.persistReducer)(Ks,ke(Ys))});var mi={};de(mi,{default:()=>Xs});var Xs,gi=S(()=>{"use strict";o();kt();Xs=ke()});var fi={};de(fi,{default:()=>Qs});var U,Js,Qs,Ti=S(()=>{"use strict";o();U=require("redux-persist"),Js=[U.FLUSH,U.REHYDRATE,U.PAUSE,U.PERSIST,U.PURGE,U.REGISTER],Qs=Js});var xi={};de(xi,{default:()=>hi});function hi(e){return(0,yi.persistStore)(e)}var yi,Si=S(()=>{"use strict";o();yi=require("redux-persist")});var Sl={};de(Sl,{ACTIONS_WITH_EGLD_VALUE:()=>ga,ACTIONS_WITH_MANDATORY_OPERATIONS:()=>ma,ACTIONS_WITH_VALUE_IN_ACTION_FIELD:()=>Ta,ACTIONS_WITH_VALUE_IN_DATA_FIELD:()=>fa,DAPP_INIT_ROUTE:()=>Qn,ESDTTransferTypes:()=>_i,EmptyProvider:()=>_e,addNewCustomToast:()=>ul,addressIsValid:()=>ae,buildUrlParams:()=>cl,builtCallbackUrl:()=>uc,calculateFeeLimit:()=>wc,decodeBase64:()=>Pi,decodePart:()=>pe,deleteCustomToast:()=>dl,denominate:()=>hc,emptyProvider:()=>ft,encodeToBase64:()=>ec,failBatchTransactionsStates:()=>Do,failServerTransactionsStates:()=>Ro,formatAmount:()=>Q,getAccount:()=>et,getAccountBalance:()=>rl,getAccountProvider:()=>B,getAccountProviderType:()=>on,getAddress:()=>he,getAddressFromDataField:()=>Rt,getAllTransactionsLink:()=>gc,getAreTransactionsOnSameShard:()=>lc,getChainID:()=>gl,getEgldLabel:()=>Tl,getEventListDataHexValue:()=>Cc,getEventListHighlight:()=>Rc,getExternalProvider:()=>eo,getIdentifierType:()=>sa,getInterpretedTransaction:()=>Pc,getIsLoggedIn:()=>nn,getIsProviderEqualTo:()=>Ce,getIsTransactionFailed:()=>We,getIsTransactionPending:()=>br,getIsTransactionSuccessful:()=>He,getIsTransactionTimedOut:()=>vr,getLatestNonce:()=>an,getLedgerConfiguration:()=>Es,getNetworkConfig:()=>fl,getOperationDirection:()=>Fc,getOperationList:()=>ka,getProviderType:()=>Be,getRegisteredCustomIconComponents:()=>pl,getRemainingTime:()=>Yr,getScResultsDecodedData:()=>Mc,getScResultsHighlight:()=>_c,getScamFlag:()=>Oc,getShardOfAddress:()=>Ct,getShardText:()=>Bc,getTokenFromData:()=>Br,getTransactionActionNftText:()=>Zr,getTransactionActionTokenText:()=>Xr,getTransactionFee:()=>$c,getTransactionLink:()=>mc,getTransactionLinkWithLabel:()=>Vc,getTransactionMessages:()=>Hc,getTransactionStatus:()=>Wc,getTransactionStatusText:()=>Gc,getTrimmedHash:()=>qc,getUnixTimestamp:()=>Ue,getUnixTimestampWithAddedMilliseconds:()=>Ds,getUnixTimestampWithAddedSeconds:()=>Ns,getUsdValue:()=>bc,getVisibleOperations:()=>ya,getWebsocketUrl:()=>hl,isBatchTransactionFailed:()=>_o,isBatchTransactionPending:()=>Fo,isBatchTransactionSuccessful:()=>Mo,isBatchTransactionTimedOut:()=>Oo,isContract:()=>$r,isMobileEnvironment:()=>xl,isSelfESDTContract:()=>Oi,isServerTransactionFailed:()=>$o,isServerTransactionPending:()=>Bo,isServerTransactionSuccessful:()=>Uo,isStringBase64:()=>Ye,isTokenTransfer:()=>oc,isUtf8:()=>Ze,isWebEnvironment:()=>qe,logarithmicRest:()=>ml,loginWithExternalProvider:()=>il,logout:()=>sl,maxDecimals:()=>Sc,newWalletProvider:()=>Is,nominate:()=>xc,parseAmount:()=>zr,parseMultiEsdtTransferData:()=>tc,parseTransactionAfterSigning:()=>dc,pendingBatchTransactionsStates:()=>ko,pendingServerTransactionsStatuses:()=>Po,pipe:()=>J,preventRedirects:()=>gr,refreshAccount:()=>nl,retryMultipleTimes:()=>yl,safeRedirect:()=>Tt,setNonce:()=>tl,signMessage:()=>ol,storage:()=>Y,stringIsFloat:()=>jr,stringIsInteger:()=>Je,successBatchTransactionsStates:()=>Lo,successServerTransactionsStates:()=>Co,switchTrue:()=>ll,timeAgo:()=>Ec,timeRemaining:()=>Ac,timedOutBatchTransactionsStates:()=>No,transactionActionUnwrapper:()=>zc,truncate:()=>kc,useDataDecode:()=>Zc,useDataDecodeMethod:()=>Xc,useGetOperationList:()=>Qc});module.exports=Me(Sl);o();o();o();o();o();var Xn=require("@elrondnetwork/erdjs-extension-provider"),Jn=require("@elrondnetwork/erdjs-hw-provider"),gt=require("@elrondnetwork/erdjs-wallet-connect-provider"),ir=require("@elrondnetwork/erdjs-web-wallet-provider");D();M();var Qn="/dapp/init",Be=e=>{switch(e==null?void 0:e.constructor){case ir.WalletProvider:return"wallet";case gt.WalletConnectProvider:return"walletconnect";case gt.WalletConnectV2Provider:return"walletconnectv2";case Jn.HWProvider:return"ledger";case Xn.ExtensionProvider:return"extension";case _e:return"";default:return"extra"}},Is=e=>new ir.WalletProvider(`${e}${Qn}`),Es=e=>k(void 0,null,function*(){if(!e.isInitialized())throw new Error("Unable to get version. Provider not initialized");let t=e.hwApp,{contractData:r,version:n}=yield t.getAppConfiguration();return{version:n,dataEnabled:r===jn}}),ne=e=>`Unable to perform ${e}, Provider not initialized`,_e=class{init(){return Promise.resolve(!1)}login(t){throw new Error(ne(`login with options: ${t}`))}logout(t){throw new Error(ne(`logout with options: ${t}`))}getAddress(){throw new Error(ne("getAddress"))}isInitialized(){return!1}isConnected(){return Promise.resolve(!1)}sendTransaction(t,r){throw new Error(ne(`sendTransaction with transactions: ${t} options: ${r}`))}signTransaction(t,r){throw new Error(ne(`signTransaction with transactions: ${t} options: ${r}`))}signTransactions(t,r){throw new Error(ne(`signTransactions with transactions: ${t} option