UNPKG

@sofaws/dapp-core

Version:

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

1 lines 345 kB
"use strict";var A1=Object.create;var ta=Object.defineProperty,I1=Object.defineProperties,k1=Object.getOwnPropertyDescriptor,E1=Object.getOwnPropertyDescriptors,N1=Object.getOwnPropertyNames,xi=Object.getOwnPropertySymbols,L1=Object.getPrototypeOf,nc=Object.prototype.hasOwnProperty,zd=Object.prototype.propertyIsEnumerable;var $d=(n,t,a)=>t in n?ta(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a,P=(n,t)=>{for(var a in t||(t={}))nc.call(t,a)&&$d(n,a,t[a]);if(xi)for(var a of xi(t))zd.call(t,a)&&$d(n,a,t[a]);return n},z=(n,t)=>I1(n,E1(t));var rn=(n,t)=>{var a={};for(var p in n)nc.call(n,p)&&t.indexOf(p)<0&&(a[p]=n[p]);if(n!=null&&xi)for(var p of xi(n))t.indexOf(p)<0&&zd.call(n,p)&&(a[p]=n[p]);return a};var V=(n,t)=>()=>(n&&(t=n(n=0)),t);var ra=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),dt=(n,t)=>{for(var a in t)ta(n,a,{get:t[a],enumerable:!0})},Vd=(n,t,a,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of N1(t))!nc.call(n,l)&&l!==a&&ta(n,l,{get:()=>t[l],enumerable:!(p=k1(t,l))||p.enumerable});return n};var v=(n,t,a)=>(a=n!=null?A1(L1(n)):{},Vd(t||!n||!n.__esModule?ta(a,"default",{value:n,enumerable:!0}):a,n)),aa=n=>Vd(ta({},"__esModule",{value:!0}),n);var te=(n,t,a)=>new Promise((p,l)=>{var g=I=>{try{A(a.next(I))}catch(C){l(C)}},h=I=>{try{A(a.throw(I))}catch(C){l(C)}},A=I=>I.done?p(I.value):Promise.resolve(I.value).then(g,h);A((a=a.apply(n,t)).next())});var Zd=ra(Ti=>{"use strict";i();Ti.byteLength=D1;Ti.toByteArray=M1;Ti.fromByteArray=B1;var no=[],Pn=[],C1=typeof Uint8Array!="undefined"?Uint8Array:Array,oc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ut=0,qd=oc.length;ut<qd;++ut)no[ut]=oc[ut],Pn[oc.charCodeAt(ut)]=ut;var ut,qd;Pn["-".charCodeAt(0)]=62;Pn["_".charCodeAt(0)]=63;function Kd(n){var t=n.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=n.indexOf("=");a===-1&&(a=t);var p=a===t?0:4-a%4;return[a,p]}function D1(n){var t=Kd(n),a=t[0],p=t[1];return(a+p)*3/4-p}function P1(n,t,a){return(t+a)*3/4-a}function M1(n){var t,a=Kd(n),p=a[0],l=a[1],g=new C1(P1(n,p,l)),h=0,A=l>0?p-4:p,I;for(I=0;I<A;I+=4)t=Pn[n.charCodeAt(I)]<<18|Pn[n.charCodeAt(I+1)]<<12|Pn[n.charCodeAt(I+2)]<<6|Pn[n.charCodeAt(I+3)],g[h++]=t>>16&255,g[h++]=t>>8&255,g[h++]=t&255;return l===2&&(t=Pn[n.charCodeAt(I)]<<2|Pn[n.charCodeAt(I+1)]>>4,g[h++]=t&255),l===1&&(t=Pn[n.charCodeAt(I)]<<10|Pn[n.charCodeAt(I+1)]<<4|Pn[n.charCodeAt(I+2)]>>2,g[h++]=t>>8&255,g[h++]=t&255),g}function F1(n){return no[n>>18&63]+no[n>>12&63]+no[n>>6&63]+no[n&63]}function O1(n,t,a){for(var p,l=[],g=t;g<a;g+=3)p=(n[g]<<16&16711680)+(n[g+1]<<8&65280)+(n[g+2]&255),l.push(F1(p));return l.join("")}function B1(n){for(var t,a=n.length,p=a%3,l=[],g=16383,h=0,A=a-p;h<A;h+=g)l.push(O1(n,h,h+g>A?A:h+g));return p===1?(t=n[a-1],l.push(no[t>>2]+no[t<<4&63]+"==")):p===2&&(t=(n[a-2]<<8)+n[a-1],l.push(no[t>>10]+no[t>>4&63]+no[t<<2&63]+"=")),l.join("")}});var Xd=ra(tc=>{i();tc.read=function(n,t,a,p,l){var g,h,A=l*8-p-1,I=(1<<A)-1,C=I>>1,M=-7,F=a?l-1:0,W=a?-1:1,K=n[t+F];for(F+=W,g=K&(1<<-M)-1,K>>=-M,M+=A;M>0;g=g*256+n[t+F],F+=W,M-=8);for(h=g&(1<<-M)-1,g>>=-M,M+=p;M>0;h=h*256+n[t+F],F+=W,M-=8);if(g===0)g=1-C;else{if(g===I)return h?NaN:(K?-1:1)*(1/0);h=h+Math.pow(2,p),g=g-C}return(K?-1:1)*h*Math.pow(2,g-p)};tc.write=function(n,t,a,p,l,g){var h,A,I,C=g*8-l-1,M=(1<<C)-1,F=M>>1,W=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,K=p?0:g-1,re=p?1:-1,ae=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(A=isNaN(t)?1:0,h=M):(h=Math.floor(Math.log(t)/Math.LN2),t*(I=Math.pow(2,-h))<1&&(h--,I*=2),h+F>=1?t+=W/I:t+=W*Math.pow(2,1-F),t*I>=2&&(h++,I/=2),h+F>=M?(A=0,h=M):h+F>=1?(A=(t*I-1)*Math.pow(2,l),h=h+F):(A=t*Math.pow(2,F-1)*Math.pow(2,l),h=0));l>=8;n[a+K]=A&255,K+=re,A/=256,l-=8);for(h=h<<l|A,C+=l;C>0;n[a+K]=h&255,K+=re,h/=256,C-=8);n[a+K-re]|=ae*128}});var pu=ra(nr=>{"use strict";i();var rc=Zd(),er=Xd(),Yd=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;nr.Buffer=E;nr.SlowBuffer=$1;nr.INSPECT_MAX_BYTES=50;var bi=2147483647;nr.kMaxLength=bi;E.TYPED_ARRAY_SUPPORT=R1();!E.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 R1(){try{var n=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(n,t),n.foo()===42}catch(a){return!1}}Object.defineProperty(E.prototype,"parent",{enumerable:!0,get:function(){if(!!E.isBuffer(this))return this.buffer}});Object.defineProperty(E.prototype,"offset",{enumerable:!0,get:function(){if(!!E.isBuffer(this))return this.byteOffset}});function bo(n){if(n>bi)throw new RangeError('The value "'+n+'" is invalid for option "size"');var t=new Uint8Array(n);return Object.setPrototypeOf(t,E.prototype),t}function E(n,t,a){if(typeof n=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return pc(n)}return Qd(n,t,a)}E.poolSize=8192;function Qd(n,t,a){if(typeof n=="string")return U1(n,t);if(ArrayBuffer.isView(n))return H1(n);if(n==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n);if(oo(n,ArrayBuffer)||n&&oo(n.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(oo(n,SharedArrayBuffer)||n&&oo(n.buffer,SharedArrayBuffer)))return ic(n,t,a);if(typeof n=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var p=n.valueOf&&n.valueOf();if(p!=null&&p!==n)return E.from(p,t,a);var l=G1(n);if(l)return l;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof n[Symbol.toPrimitive]=="function")return E.from(n[Symbol.toPrimitive]("string"),t,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}E.from=function(n,t,a){return Qd(n,t,a)};Object.setPrototypeOf(E.prototype,Uint8Array.prototype);Object.setPrototypeOf(E,Uint8Array);function eu(n){if(typeof n!="number")throw new TypeError('"size" argument must be of type number');if(n<0)throw new RangeError('The value "'+n+'" is invalid for option "size"')}function W1(n,t,a){return eu(n),n<=0?bo(n):t!==void 0?typeof a=="string"?bo(n).fill(t,a):bo(n).fill(t):bo(n)}E.alloc=function(n,t,a){return W1(n,t,a)};function pc(n){return eu(n),bo(n<0?0:cc(n)|0)}E.allocUnsafe=function(n){return pc(n)};E.allocUnsafeSlow=function(n){return pc(n)};function U1(n,t){if((typeof t!="string"||t==="")&&(t="utf8"),!E.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var a=nu(n,t)|0,p=bo(a),l=p.write(n,t);return l!==a&&(p=p.slice(0,l)),p}function ac(n){for(var t=n.length<0?0:cc(n.length)|0,a=bo(t),p=0;p<t;p+=1)a[p]=n[p]&255;return a}function H1(n){if(oo(n,Uint8Array)){var t=new Uint8Array(n);return ic(t.buffer,t.byteOffset,t.byteLength)}return ac(n)}function ic(n,t,a){if(t<0||n.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(n.byteLength<t+(a||0))throw new RangeError('"length" is outside of buffer bounds');var p;return t===void 0&&a===void 0?p=new Uint8Array(n):a===void 0?p=new Uint8Array(n,t):p=new Uint8Array(n,t,a),Object.setPrototypeOf(p,E.prototype),p}function G1(n){if(E.isBuffer(n)){var t=cc(n.length)|0,a=bo(t);return a.length===0||n.copy(a,0,0,t),a}if(n.length!==void 0)return typeof n.length!="number"||mc(n.length)?bo(0):ac(n);if(n.type==="Buffer"&&Array.isArray(n.data))return ac(n.data)}function cc(n){if(n>=bi)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+bi.toString(16)+" bytes");return n|0}function $1(n){return+n!=n&&(n=0),E.alloc(+n)}E.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==E.prototype};E.compare=function(t,a){if(oo(t,Uint8Array)&&(t=E.from(t,t.offset,t.byteLength)),oo(a,Uint8Array)&&(a=E.from(a,a.offset,a.byteLength)),!E.isBuffer(t)||!E.isBuffer(a))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===a)return 0;for(var p=t.length,l=a.length,g=0,h=Math.min(p,l);g<h;++g)if(t[g]!==a[g]){p=t[g],l=a[g];break}return p<l?-1:l<p?1:0};E.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}};E.concat=function(t,a){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return E.alloc(0);var p;if(a===void 0)for(a=0,p=0;p<t.length;++p)a+=t[p].length;var l=E.allocUnsafe(a),g=0;for(p=0;p<t.length;++p){var h=t[p];if(oo(h,Uint8Array))g+h.length>l.length?E.from(h).copy(l,g):Uint8Array.prototype.set.call(l,h,g);else if(E.isBuffer(h))h.copy(l,g);else throw new TypeError('"list" argument must be an Array of Buffers');g+=h.length}return l};function nu(n,t){if(E.isBuffer(n))return n.length;if(ArrayBuffer.isView(n)||oo(n,ArrayBuffer))return n.byteLength;if(typeof n!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof n);var a=n.length,p=arguments.length>2&&arguments[2]===!0;if(!p&&a===0)return 0;for(var l=!1;;)switch(t){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return sc(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a*2;case"hex":return a>>>1;case"base64":return su(n).length;default:if(l)return p?-1:sc(n).length;t=(""+t).toLowerCase(),l=!0}}E.byteLength=nu;function z1(n,t,a){var p=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((a===void 0||a>this.length)&&(a=this.length),a<=0)||(a>>>=0,t>>>=0,a<=t))return"";for(n||(n="utf8");;)switch(n){case"hex":return eA(this,t,a);case"utf8":case"utf-8":return tu(this,t,a);case"ascii":return J1(this,t,a);case"latin1":case"binary":return Q1(this,t,a);case"base64":return Y1(this,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nA(this,t,a);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),p=!0}}E.prototype._isBuffer=!0;function ft(n,t,a){var p=n[t];n[t]=n[a],n[a]=p}E.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 a=0;a<t;a+=2)ft(this,a,a+1);return this};E.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 a=0;a<t;a+=4)ft(this,a,a+3),ft(this,a+1,a+2);return this};E.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 a=0;a<t;a+=8)ft(this,a,a+7),ft(this,a+1,a+6),ft(this,a+2,a+5),ft(this,a+3,a+4);return this};E.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?tu(this,0,t):z1.apply(this,arguments)};E.prototype.toLocaleString=E.prototype.toString;E.prototype.equals=function(t){if(!E.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:E.compare(this,t)===0};E.prototype.inspect=function(){var t="",a=nr.INSPECT_MAX_BYTES;return t=this.toString("hex",0,a).replace(/(.{2})/g,"$1 ").trim(),this.length>a&&(t+=" ... "),"<Buffer "+t+">"};Yd&&(E.prototype[Yd]=E.prototype.inspect);E.prototype.compare=function(t,a,p,l,g){if(oo(t,Uint8Array)&&(t=E.from(t,t.offset,t.byteLength)),!E.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(a===void 0&&(a=0),p===void 0&&(p=t?t.length:0),l===void 0&&(l=0),g===void 0&&(g=this.length),a<0||p>t.length||l<0||g>this.length)throw new RangeError("out of range index");if(l>=g&&a>=p)return 0;if(l>=g)return-1;if(a>=p)return 1;if(a>>>=0,p>>>=0,l>>>=0,g>>>=0,this===t)return 0;for(var h=g-l,A=p-a,I=Math.min(h,A),C=this.slice(l,g),M=t.slice(a,p),F=0;F<I;++F)if(C[F]!==M[F]){h=C[F],A=M[F];break}return h<A?-1:A<h?1:0};function ou(n,t,a,p,l){if(n.length===0)return-1;if(typeof a=="string"?(p=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,mc(a)&&(a=l?0:n.length-1),a<0&&(a=n.length+a),a>=n.length){if(l)return-1;a=n.length-1}else if(a<0)if(l)a=0;else return-1;if(typeof t=="string"&&(t=E.from(t,p)),E.isBuffer(t))return t.length===0?-1:jd(n,t,a,p,l);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?l?Uint8Array.prototype.indexOf.call(n,t,a):Uint8Array.prototype.lastIndexOf.call(n,t,a):jd(n,[t],a,p,l);throw new TypeError("val must be string, number or Buffer")}function jd(n,t,a,p,l){var g=1,h=n.length,A=t.length;if(p!==void 0&&(p=String(p).toLowerCase(),p==="ucs2"||p==="ucs-2"||p==="utf16le"||p==="utf-16le")){if(n.length<2||t.length<2)return-1;g=2,h/=2,A/=2,a/=2}function I(K,re){return g===1?K[re]:K.readUInt16BE(re*g)}var C;if(l){var M=-1;for(C=a;C<h;C++)if(I(n,C)===I(t,M===-1?0:C-M)){if(M===-1&&(M=C),C-M+1===A)return M*g}else M!==-1&&(C-=C-M),M=-1}else for(a+A>h&&(a=h-A),C=a;C>=0;C--){for(var F=!0,W=0;W<A;W++)if(I(n,C+W)!==I(t,W)){F=!1;break}if(F)return C}return-1}E.prototype.includes=function(t,a,p){return this.indexOf(t,a,p)!==-1};E.prototype.indexOf=function(t,a,p){return ou(this,t,a,p,!0)};E.prototype.lastIndexOf=function(t,a,p){return ou(this,t,a,p,!1)};function V1(n,t,a,p){a=Number(a)||0;var l=n.length-a;p?(p=Number(p),p>l&&(p=l)):p=l;var g=t.length;p>g/2&&(p=g/2);for(var h=0;h<p;++h){var A=parseInt(t.substr(h*2,2),16);if(mc(A))return h;n[a+h]=A}return h}function q1(n,t,a,p){return wi(sc(t,n.length-a),n,a,p)}function K1(n,t,a,p){return wi(rA(t),n,a,p)}function Z1(n,t,a,p){return wi(su(t),n,a,p)}function X1(n,t,a,p){return wi(aA(t,n.length-a),n,a,p)}E.prototype.write=function(t,a,p,l){if(a===void 0)l="utf8",p=this.length,a=0;else if(p===void 0&&typeof a=="string")l=a,p=this.length,a=0;else if(isFinite(a))a=a>>>0,isFinite(p)?(p=p>>>0,l===void 0&&(l="utf8")):(l=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var g=this.length-a;if((p===void 0||p>g)&&(p=g),t.length>0&&(p<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");l||(l="utf8");for(var h=!1;;)switch(l){case"hex":return V1(this,t,a,p);case"utf8":case"utf-8":return q1(this,t,a,p);case"ascii":case"latin1":case"binary":return K1(this,t,a,p);case"base64":return Z1(this,t,a,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X1(this,t,a,p);default:if(h)throw new TypeError("Unknown encoding: "+l);l=(""+l).toLowerCase(),h=!0}};E.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Y1(n,t,a){return t===0&&a===n.length?rc.fromByteArray(n):rc.fromByteArray(n.slice(t,a))}function tu(n,t,a){a=Math.min(n.length,a);for(var p=[],l=t;l<a;){var g=n[l],h=null,A=g>239?4:g>223?3:g>191?2:1;if(l+A<=a){var I,C,M,F;switch(A){case 1:g<128&&(h=g);break;case 2:I=n[l+1],(I&192)===128&&(F=(g&31)<<6|I&63,F>127&&(h=F));break;case 3:I=n[l+1],C=n[l+2],(I&192)===128&&(C&192)===128&&(F=(g&15)<<12|(I&63)<<6|C&63,F>2047&&(F<55296||F>57343)&&(h=F));break;case 4:I=n[l+1],C=n[l+2],M=n[l+3],(I&192)===128&&(C&192)===128&&(M&192)===128&&(F=(g&15)<<18|(I&63)<<12|(C&63)<<6|M&63,F>65535&&F<1114112&&(h=F))}}h===null?(h=65533,A=1):h>65535&&(h-=65536,p.push(h>>>10&1023|55296),h=56320|h&1023),p.push(h),l+=A}return j1(p)}var Jd=4096;function j1(n){var t=n.length;if(t<=Jd)return String.fromCharCode.apply(String,n);for(var a="",p=0;p<t;)a+=String.fromCharCode.apply(String,n.slice(p,p+=Jd));return a}function J1(n,t,a){var p="";a=Math.min(n.length,a);for(var l=t;l<a;++l)p+=String.fromCharCode(n[l]&127);return p}function Q1(n,t,a){var p="";a=Math.min(n.length,a);for(var l=t;l<a;++l)p+=String.fromCharCode(n[l]);return p}function eA(n,t,a){var p=n.length;(!t||t<0)&&(t=0),(!a||a<0||a>p)&&(a=p);for(var l="",g=t;g<a;++g)l+=iA[n[g]];return l}function nA(n,t,a){for(var p=n.slice(t,a),l="",g=0;g<p.length-1;g+=2)l+=String.fromCharCode(p[g]+p[g+1]*256);return l}E.prototype.slice=function(t,a){var p=this.length;t=~~t,a=a===void 0?p:~~a,t<0?(t+=p,t<0&&(t=0)):t>p&&(t=p),a<0?(a+=p,a<0&&(a=0)):a>p&&(a=p),a<t&&(a=t);var l=this.subarray(t,a);return Object.setPrototypeOf(l,E.prototype),l};function Be(n,t,a){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+t>a)throw new RangeError("Trying to access beyond buffer length")}E.prototype.readUintLE=E.prototype.readUIntLE=function(t,a,p){t=t>>>0,a=a>>>0,p||Be(t,a,this.length);for(var l=this[t],g=1,h=0;++h<a&&(g*=256);)l+=this[t+h]*g;return l};E.prototype.readUintBE=E.prototype.readUIntBE=function(t,a,p){t=t>>>0,a=a>>>0,p||Be(t,a,this.length);for(var l=this[t+--a],g=1;a>0&&(g*=256);)l+=this[t+--a]*g;return l};E.prototype.readUint8=E.prototype.readUInt8=function(t,a){return t=t>>>0,a||Be(t,1,this.length),this[t]};E.prototype.readUint16LE=E.prototype.readUInt16LE=function(t,a){return t=t>>>0,a||Be(t,2,this.length),this[t]|this[t+1]<<8};E.prototype.readUint16BE=E.prototype.readUInt16BE=function(t,a){return t=t>>>0,a||Be(t,2,this.length),this[t]<<8|this[t+1]};E.prototype.readUint32LE=E.prototype.readUInt32LE=function(t,a){return t=t>>>0,a||Be(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};E.prototype.readUint32BE=E.prototype.readUInt32BE=function(t,a){return t=t>>>0,a||Be(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};E.prototype.readIntLE=function(t,a,p){t=t>>>0,a=a>>>0,p||Be(t,a,this.length);for(var l=this[t],g=1,h=0;++h<a&&(g*=256);)l+=this[t+h]*g;return g*=128,l>=g&&(l-=Math.pow(2,8*a)),l};E.prototype.readIntBE=function(t,a,p){t=t>>>0,a=a>>>0,p||Be(t,a,this.length);for(var l=a,g=1,h=this[t+--l];l>0&&(g*=256);)h+=this[t+--l]*g;return g*=128,h>=g&&(h-=Math.pow(2,8*a)),h};E.prototype.readInt8=function(t,a){return t=t>>>0,a||Be(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};E.prototype.readInt16LE=function(t,a){t=t>>>0,a||Be(t,2,this.length);var p=this[t]|this[t+1]<<8;return p&32768?p|4294901760:p};E.prototype.readInt16BE=function(t,a){t=t>>>0,a||Be(t,2,this.length);var p=this[t+1]|this[t]<<8;return p&32768?p|4294901760:p};E.prototype.readInt32LE=function(t,a){return t=t>>>0,a||Be(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};E.prototype.readInt32BE=function(t,a){return t=t>>>0,a||Be(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};E.prototype.readFloatLE=function(t,a){return t=t>>>0,a||Be(t,4,this.length),er.read(this,t,!0,23,4)};E.prototype.readFloatBE=function(t,a){return t=t>>>0,a||Be(t,4,this.length),er.read(this,t,!1,23,4)};E.prototype.readDoubleLE=function(t,a){return t=t>>>0,a||Be(t,8,this.length),er.read(this,t,!0,52,8)};E.prototype.readDoubleBE=function(t,a){return t=t>>>0,a||Be(t,8,this.length),er.read(this,t,!1,52,8)};function an(n,t,a,p,l,g){if(!E.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>l||t<g)throw new RangeError('"value" argument is out of bounds');if(a+p>n.length)throw new RangeError("Index out of range")}E.prototype.writeUintLE=E.prototype.writeUIntLE=function(t,a,p,l){if(t=+t,a=a>>>0,p=p>>>0,!l){var g=Math.pow(2,8*p)-1;an(this,t,a,p,g,0)}var h=1,A=0;for(this[a]=t&255;++A<p&&(h*=256);)this[a+A]=t/h&255;return a+p};E.prototype.writeUintBE=E.prototype.writeUIntBE=function(t,a,p,l){if(t=+t,a=a>>>0,p=p>>>0,!l){var g=Math.pow(2,8*p)-1;an(this,t,a,p,g,0)}var h=p-1,A=1;for(this[a+h]=t&255;--h>=0&&(A*=256);)this[a+h]=t/A&255;return a+p};E.prototype.writeUint8=E.prototype.writeUInt8=function(t,a,p){return t=+t,a=a>>>0,p||an(this,t,a,1,255,0),this[a]=t&255,a+1};E.prototype.writeUint16LE=E.prototype.writeUInt16LE=function(t,a,p){return t=+t,a=a>>>0,p||an(this,t,a,2,65535,0),this[a]=t&255,this[a+1]=t>>>8,a+2};E.prototype.writeUint16BE=E.prototype.writeUInt16BE=function(t,a,p){return t=+t,a=a>>>0,p||an(this,t,a,2,65535,0),this[a]=t>>>8,this[a+1]=t&255,a+2};E.prototype.writeUint32LE=E.prototype.writeUInt32LE=function(t,a,p){return t=+t,a=a>>>0,p||an(this,t,a,4,4294967295,0),this[a+3]=t>>>24,this[a+2]=t>>>16,this[a+1]=t>>>8,this[a]=t&255,a+4};E.prototype.writeUint32BE=E.prototype.writeUInt32BE=function(t,a,p){return t=+t,a=a>>>0,p||an(this,t,a,4,4294967295,0),this[a]=t>>>24,this[a+1]=t>>>16,this[a+2]=t>>>8,this[a+3]=t&255,a+4};E.prototype.writeIntLE=function(t,a,p,l){if(t=+t,a=a>>>0,!l){var g=Math.pow(2,8*p-1);an(this,t,a,p,g-1,-g)}var h=0,A=1,I=0;for(this[a]=t&255;++h<p&&(A*=256);)t<0&&I===0&&this[a+h-1]!==0&&(I=1),this[a+h]=(t/A>>0)-I&255;return a+p};E.prototype.writeIntBE=function(t,a,p,l){if(t=+t,a=a>>>0,!l){var g=Math.pow(2,8*p-1);an(this,t,a,p,g-1,-g)}var h=p-1,A=1,I=0;for(this[a+h]=t&255;--h>=0&&(A*=256);)t<0&&I===0&&this[a+h+1]!==0&&(I=1),this[a+h]=(t/A>>0)-I&255;return a+p};E.prototype.writeInt8=function(t,a,p){return t=+t,a=a>>>0,p||an(this,t,a,1,127,-128),t<0&&(t=255+t+1),this[a]=t&255,a+1};E.prototype.writeInt16LE=function(t,a,p){return t=+t,a=a>>>0,p||an(this,t,a,2,32767,-32768),this[a]=t&255,this[a+1]=t>>>8,a+2};E.prototype.writeInt16BE=function(t,a,p){return t=+t,a=a>>>0,p||an(this,t,a,2,32767,-32768),this[a]=t>>>8,this[a+1]=t&255,a+2};E.prototype.writeInt32LE=function(t,a,p){return t=+t,a=a>>>0,p||an(this,t,a,4,2147483647,-2147483648),this[a]=t&255,this[a+1]=t>>>8,this[a+2]=t>>>16,this[a+3]=t>>>24,a+4};E.prototype.writeInt32BE=function(t,a,p){return t=+t,a=a>>>0,p||an(this,t,a,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[a]=t>>>24,this[a+1]=t>>>16,this[a+2]=t>>>8,this[a+3]=t&255,a+4};function ru(n,t,a,p,l,g){if(a+p>n.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function au(n,t,a,p,l){return t=+t,a=a>>>0,l||ru(n,t,a,4,34028234663852886e22,-34028234663852886e22),er.write(n,t,a,p,23,4),a+4}E.prototype.writeFloatLE=function(t,a,p){return au(this,t,a,!0,p)};E.prototype.writeFloatBE=function(t,a,p){return au(this,t,a,!1,p)};function iu(n,t,a,p,l){return t=+t,a=a>>>0,l||ru(n,t,a,8,17976931348623157e292,-17976931348623157e292),er.write(n,t,a,p,52,8),a+8}E.prototype.writeDoubleLE=function(t,a,p){return iu(this,t,a,!0,p)};E.prototype.writeDoubleBE=function(t,a,p){return iu(this,t,a,!1,p)};E.prototype.copy=function(t,a,p,l){if(!E.isBuffer(t))throw new TypeError("argument should be a Buffer");if(p||(p=0),!l&&l!==0&&(l=this.length),a>=t.length&&(a=t.length),a||(a=0),l>0&&l<p&&(l=p),l===p||t.length===0||this.length===0)return 0;if(a<0)throw new RangeError("targetStart out of bounds");if(p<0||p>=this.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("sourceEnd out of bounds");l>this.length&&(l=this.length),t.length-a<l-p&&(l=t.length-a+p);var g=l-p;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(a,p,l):Uint8Array.prototype.set.call(t,this.subarray(p,l),a),g};E.prototype.fill=function(t,a,p,l){if(typeof t=="string"){if(typeof a=="string"?(l=a,a=0,p=this.length):typeof p=="string"&&(l=p,p=this.length),l!==void 0&&typeof l!="string")throw new TypeError("encoding must be a string");if(typeof l=="string"&&!E.isEncoding(l))throw new TypeError("Unknown encoding: "+l);if(t.length===1){var g=t.charCodeAt(0);(l==="utf8"&&g<128||l==="latin1")&&(t=g)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(a<0||this.length<a||this.length<p)throw new RangeError("Out of range index");if(p<=a)return this;a=a>>>0,p=p===void 0?this.length:p>>>0,t||(t=0);var h;if(typeof t=="number")for(h=a;h<p;++h)this[h]=t;else{var A=E.isBuffer(t)?t:E.from(t,l),I=A.length;if(I===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(h=0;h<p-a;++h)this[h+a]=A[h%I]}return this};var oA=/[^+/0-9A-Za-z-_]/g;function tA(n){if(n=n.split("=")[0],n=n.trim().replace(oA,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function sc(n,t){t=t||1/0;for(var a,p=n.length,l=null,g=[],h=0;h<p;++h){if(a=n.charCodeAt(h),a>55295&&a<57344){if(!l){if(a>56319){(t-=3)>-1&&g.push(239,191,189);continue}else if(h+1===p){(t-=3)>-1&&g.push(239,191,189);continue}l=a;continue}if(a<56320){(t-=3)>-1&&g.push(239,191,189),l=a;continue}a=(l-55296<<10|a-56320)+65536}else l&&(t-=3)>-1&&g.push(239,191,189);if(l=null,a<128){if((t-=1)<0)break;g.push(a)}else if(a<2048){if((t-=2)<0)break;g.push(a>>6|192,a&63|128)}else if(a<65536){if((t-=3)<0)break;g.push(a>>12|224,a>>6&63|128,a&63|128)}else if(a<1114112){if((t-=4)<0)break;g.push(a>>18|240,a>>12&63|128,a>>6&63|128,a&63|128)}else throw new Error("Invalid code point")}return g}function rA(n){for(var t=[],a=0;a<n.length;++a)t.push(n.charCodeAt(a)&255);return t}function aA(n,t){for(var a,p,l,g=[],h=0;h<n.length&&!((t-=2)<0);++h)a=n.charCodeAt(h),p=a>>8,l=a%256,g.push(l),g.push(p);return g}function su(n){return rc.toByteArray(tA(n))}function wi(n,t,a,p){for(var l=0;l<p&&!(l+a>=t.length||l>=n.length);++l)t[l+a]=n[l];return l}function oo(n,t){return n instanceof t||n!=null&&n.constructor!=null&&n.constructor.name!=null&&n.constructor.name===t.name}function mc(n){return n!==n}var iA=function(){for(var n="0123456789abcdef",t=new Array(256),a=0;a<16;++a)for(var p=a*16,l=0;l<16;++l)t[p+l]=n[a]+n[l];return t}()});var du=ra((R2,_u)=>{i();var ke=_u.exports={},to,ro;function lc(){throw new Error("setTimeout has not been defined")}function _c(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?to=setTimeout:to=lc}catch(n){to=lc}try{typeof clearTimeout=="function"?ro=clearTimeout:ro=_c}catch(n){ro=_c}})();function cu(n){if(to===setTimeout)return setTimeout(n,0);if((to===lc||!to)&&setTimeout)return to=setTimeout,setTimeout(n,0);try{return to(n,0)}catch(t){try{return to.call(null,n,0)}catch(a){return to.call(this,n,0)}}}function sA(n){if(ro===clearTimeout)return clearTimeout(n);if((ro===_c||!ro)&&clearTimeout)return ro=clearTimeout,clearTimeout(n);try{return ro(n)}catch(t){try{return ro.call(null,n)}catch(a){return ro.call(this,n)}}}var wo=[],or=!1,gt,vi=-1;function pA(){!or||!gt||(or=!1,gt.length?wo=gt.concat(wo):vi=-1,wo.length&&mu())}function mu(){if(!or){var n=cu(pA);or=!0;for(var t=wo.length;t;){for(gt=wo,wo=[];++vi<t;)gt&&gt[vi].run();vi=-1,t=wo.length}gt=null,or=!1,sA(n)}}ke.nextTick=function(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)t[a-1]=arguments[a];wo.push(new lu(n,t)),wo.length===1&&!or&&cu(mu)};function lu(n,t){this.fun=n,this.array=t}lu.prototype.run=function(){this.fun.apply(null,this.array)};ke.title="browser";ke.browser=!0;ke.env={};ke.argv=[];ke.version="";ke.versions={};function vo(){}ke.on=vo;ke.addListener=vo;ke.once=vo;ke.off=vo;ke.removeListener=vo;ke.removeAllListeners=vo;ke.emit=vo;ke.prependListener=vo;ke.prependOnceListener=vo;ke.listeners=function(n){return[]};ke.binding=function(n){throw new Error("process.binding is not supported")};ke.cwd=function(){return"/"};ke.chdir=function(n){throw new Error("process.chdir is not supported")};ke.umask=function(){return 0}});var c,d,cA,m,i=V(()=>{c=v(pu()),d=v(du()),cA=function(n){function t(){var p=this||self;return delete n.prototype.__magic__,p}if(typeof globalThis=="object")return globalThis;if(this)return t();n.defineProperty(n.prototype,"__magic__",{configurable:!0,get:t});var a=__magic__;return a}(Object),m=cA});var ia,Mn,he=V(()=>{"use strict";i();ia=(p=>(p.nft="nft",p.esdt="esdt",p.egld="egld",p))(ia||{}),Mn=(l=>(l.raw="raw",l.text="text",l.decimal="decimal",l.smart="smart",l))(Mn||{})});var tr=V(()=>{"use strict";i()});var gu=V(()=>{"use strict";i()});var Te=V(()=>{"use strict";i()});var hu=V(()=>{"use strict";i()});var yu=V(()=>{"use strict";i()});var xu=V(()=>{"use strict";i()});var Tu=V(()=>{"use strict";i()});var sn=V(()=>{"use strict";i();gu();he();Te();hu();yu();xu();Tu()});var dc,bu,aN,wu,iN,vu,Su,sN,pN,Au=V(()=>{"use strict";i();sn();dc={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:bu,egldLabel:aN}=dc["devnet"],{chainId:wu,egldLabel:iN}=dc["testnet"],{chainId:vu,egldLabel:Su}=dc["mainnet"],sN={["devnet"]:bu,["testnet"]:wu,["mainnet"]:vu},pN={[bu]:"devnet",[wu]:"testnet",[vu]:"mainnet"}});var uc=V(()=>{"use strict";i()});var Iu=V(()=>{"use strict";i()});var Si,fc=V(()=>{"use strict";i();Si="transaction-status-toast-id"});var sa,Ai,ze,ht,ku,gc,Eu,Ii,Nu,Lu,ye,Kn,Q=V(()=>{"use strict";i();tr();Au();uc();Iu();fc();sa=5e4,Ai=1e9,ze=18,ht=4,ku=1,gc=4294967295,Eu=4294967280,Ii="logout",Nu="login",Lu="refundedGas",ye="N/A",Kn="0"});var Ei,yc=V(()=>{"use strict";i();Ei=()=>Date.now()/1e3});var Ru=V(()=>{"use strict";i()});var Wu=V(()=>{"use strict";i()});var xc=V(()=>{"use strict";i();yc();Ru();Wu()});var bc={};dt(bc,{getItem:()=>bA,localStorageKeys:()=>Jo,removeItem:()=>wA,setItem:()=>TA});var Jo,Tc,TA,bA,wA,ir=V(()=>{"use strict";i();xc();Jo={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Tc=typeof localStorage!="undefined",TA=({key:n,data:t,expires:a})=>{!Tc||localStorage.setItem(String(n),JSON.stringify({expires:a,data:t}))},bA=n=>{if(!Tc)return;let t=localStorage.getItem(String(n));if(!t)return null;let a=JSON.parse(t);return!a||!a.hasOwnProperty("expires")||!a.hasOwnProperty("data")?null:Ei()>=a.expires?(localStorage.removeItem(String(n)),null):a.data},wA=n=>{!Tc||localStorage.removeItem(String(n))}});var wc={};dt(wc,{clear:()=>$u,getItem:()=>Hu,removeItem:()=>Gu,setItem:()=>Uu,storage:()=>vA});var Uu,Hu,Gu,$u,vA,zu=V(()=>{"use strict";i();Uu=({key:n,data:t,expires:a})=>{sessionStorage.setItem(String(n),JSON.stringify({expires:a,data:t}))},Hu=n=>{let t=sessionStorage.getItem(String(n));if(!t)return null;let a=JSON.parse(t);return!a||!a.hasOwnProperty("expires")||!a.hasOwnProperty("data")?null:Date.now()>=a.expires?(sessionStorage.removeItem(String(n)),null):a.data},Gu=n=>sessionStorage.removeItem(String(n)),$u=()=>sessionStorage.clear(),vA={setItem:Uu,getItem:Hu,removeItem:Gu,clear:$u}});var xt,sr=V(()=>{"use strict";i();ir();zu();xt={session:wc,local:bc}});function ca(){return new Date().setHours(new Date().getHours()+24)}function ma(n){xt.local.setItem({key:Jo.loginExpiresAt,data:n,expires:n})}var vc=V(()=>{"use strict";i();sr();ir()});var Sc,je,Ao,cn=V(()=>{"use strict";i();Sc=require("@reduxjs/toolkit");Q();je=(0,Sc.createAction)(Ii),Ao=(0,Sc.createAction)(Nu,n=>({payload:n}))});var qu,Vu,Ku,pL,Zu,SA,la,Xu,AA,Yu,ju,Ac=V(()=>{"use strict";i();qu=require("@reduxjs/toolkit");vc();Te();cn();Vu={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Ku=(0,qu.createSlice)({name:"loginInfoSlice",initialState:Vu,reducers:{setLoginMethod:(n,t)=>{n.loginMethod=t.payload},setTokenLogin:(n,t)=>{n.tokenLogin=t.payload},setTokenLoginSignature:(n,t)=>{(n==null?void 0:n.tokenLogin)!=null&&(n.tokenLogin.signature=t.payload)},setWalletLogin:(n,t)=>{n.walletLogin=t.payload},setWalletConnectLogin:(n,t)=>{n.walletConnectLogin=t.payload},setLedgerLogin:(n,t)=>{n.ledgerLogin=t.payload},invalidateLoginSession:n=>{n.isLoginSessionInvalid=!0}},extraReducers:n=>{n.addCase(je,()=>Vu),n.addCase(Ao,(t,a)=>{t.loginMethod=a.payload.loginMethod,ma(ca())})}}),{setLoginMethod:pL,setWalletConnectLogin:Zu,setLedgerLogin:SA,setTokenLogin:la,setTokenLoginSignature:Xu,setWalletLogin:AA,invalidateLoginSession:Yu}=Ku.actions,ju=Ku.reducer});var _a=V(()=>{"use strict";i()});var Qu=V(()=>{"use strict";i();_a()});function Ic(n){return n[Math.floor(Math.random()*n.length)]}var ef=V(()=>{"use strict";i()});var kc=V(()=>{"use strict";i();uc()});var pr=V(()=>{"use strict";i();Qu();ef();kc()});var nf,of,Ec,IA,tf,vL,SL,rf,Nc=V(()=>{"use strict";i();nf=require("@reduxjs/toolkit"),of=v(require("lodash.omit"));pr();Ec={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},IA={network:Ec,chainID:"-1"},tf=(0,nf.createSlice)({name:"appConfig",initialState:IA,reducers:{initializeNetworkConfig:(n,t)=>{let a=Ic(t.payload.walletConnectBridgeAddresses),p=Ic(t.payload.walletConnectV2RelayAddresses),l=(0,of.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");n.network=z(P(P({},n.network),l),{walletConnectBridgeAddress:a,walletConnectV2RelayAddress:p})},setChainID:(n,t)=>{n.chainID=t.payload}}}),{initializeNetworkConfig:vL,setChainID:SL}=tf.actions,rf=tf.reducer});var Cc,af,sf,Ni,Lc,pf,Dc,DL,Pc,PL,kA,EA,ML,FL,OL,NA,cf,Mc=V(()=>{"use strict";i();Cc=require("@elrondnetwork/erdjs"),af=require("@reduxjs/toolkit"),sf=require("redux-persist");Q();sr();ir();cn();Ni={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Kn},Lc={address:"",websocketEvent:null,accounts:{"":Ni},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},pf=(0,af.createSlice)({name:"accountInfoSlice",initialState:Lc,reducers:{setAddress:(n,t)=>{let a=t.payload;n.address=a,n.publicKey=new Cc.Address(a).hex()},setAccount:(n,t)=>{let a=n.address===t.payload.address;n.accounts={[n.address]:a?t.payload:Ni},n.isAccountLoading=!1,n.accountLoadingError=null},setAccountNonce:(n,t)=>{let{address:a}=n;n.accounts[a].nonce=t.payload},setAccountShard:(n,t)=>{n.shard=t.payload},setLedgerAccount:(n,t)=>{n.ledgerAccount=t.payload},updateLedgerAccount:(n,t)=>{n.ledgerAccount!=null&&(n.ledgerAccount.index=t.payload.index,n.ledgerAccount.address=t.payload.address)},setWalletConnectAccount:(n,t)=>{n.walletConnectAccount=t.payload},setIsAccountLoading:(n,t)=>{n.isAccountLoading=t.payload,n.accountLoadingError=null},setAccountLoadingError:(n,t)=>{n.accountLoadingError=t.payload,n.isAccountLoading=!1},setWebsocketEvent:(n,t)=>{n.websocketEvent={timestamp:Date.now(),message:t.payload}}},extraReducers:n=>{n.addCase(je,()=>(xt.local.removeItem(Jo.loginExpiresAt),Lc)),n.addCase(Ao,(t,a)=>{let{address:p}=a.payload;t.address=p,t.publicKey=new Cc.Address(p).hex()}),n.addCase(sf.REHYDRATE,(t,a)=>{var C;if(!((C=a.payload)!=null&&C.account))return;let{account:p}=a.payload,{address:l,shard:g,accounts:h,publicKey:A}=p;t.address=l,t.shard=g;let I=h&&l in h;t.accounts=I?h:Lc.accounts,t.publicKey=A})}}),{setAccount:Dc,setAddress:DL,setAccountNonce:Pc,setAccountShard:PL,setLedgerAccount:kA,updateLedgerAccount:EA,setWalletConnectAccount:ML,setIsAccountLoading:FL,setAccountLoadingError:OL,setWebsocketEvent:NA}=pf.actions,cf=pf.reducer});function mr(n){return n!=null&&(BA(n)||HA(n))}function lr(n){return n!=null&&(RA(n)||GA(n))}function _r(n){return n!=null&&(WA(n)||$A(n))}function Fc(n){return n!=null&&UA(n)}function BA(n){return n!=null&&LA.includes(n)}function RA(n){return n!=null&&CA.includes(n)}function WA(n){return n!=null&&DA.includes(n)}function UA(n){return n!=null&&PA.includes(n)}function HA(n){return n!=null&&MA.includes(n)}function GA(n){return n!=null&&FA.includes(n)}function $A(n){return n!=null&&OA.includes(n)}var LA,CA,DA,PA,MA,FA,OA,dr=V(()=>{"use strict";i();Te();LA=["sent"],CA=["success"],DA=["fail","cancelled","timedOut"],PA=["timedOut"],MA=["pending"],FA=["success"],OA=["fail","invalid"]});var mf,lf,da,zA,_f,df,uf,VA,Li,qA,KA,VL,ZA,Ci,Oc,Di,Pi=V(()=>{"use strict";i();mf=require("@reduxjs/toolkit"),lf=require("redux-persist");Te();dr();cn();da={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},zA={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},_f=(0,mf.createSlice)({name:"transactionsSlice",initialState:da,reducers:{moveTransactionsToSignedState:(n,t)=>{var I,C;let{sessionId:a,transactions:p,errorMessage:l,status:g,redirectRoute:h}=t.payload,A=((I=n.customTransactionInformationForSessionId)==null?void 0:I[a])||zA;n.signedTransactions[a]={transactions:p,status:g,errorMessage:l,redirectRoute:h,customTransactionInformation:A},((C=n==null?void 0:n.transactionsToSign)==null?void 0:C.sessionId)===a&&(n.transactionsToSign=da.transactionsToSign)},clearSignedTransaction:(n,t)=>{n.signedTransactions[t.payload]&&delete n.signedTransactions[t.payload]},clearTransactionToSign:n=>{n!=null&&n.transactionsToSign&&(n.transactionsToSign=null)},updateSignedTransaction:(n,t)=>{n.signedTransactions=P(P({},n.signedTransactions),t.payload)},updateSignedTransactions:(n,t)=>{let{sessionId:a,status:p,errorMessage:l,transactions:g}=t.payload;n.signedTransactions[a]!=null&&(n.signedTransactions[a].status=p,l!=null&&(n.signedTransactions[a].errorMessage=l),g!=null&&(n.signedTransactions[a].transactions=g))},updateSignedTransactionStatus:(n,t)=>{var A,I,C,M,F,W;let{sessionId:a,status:p,errorMessage:l,transactionHash:g}=t.payload,h=(I=(A=n.signedTransactions)==null?void 0:A[a])==null?void 0:I.transactions;if(h!=null){n.signedTransactions[a].transactions=h.map(ae=>ae.hash===g?z(P({},ae),{status:p,errorMessage:l}):ae);let K=(M=(C=n.signedTransactions[a])==null?void 0:C.transactions)==null?void 0:M.every(ae=>lr(ae.status)),re=(W=(F=n.signedTransactions[a])==null?void 0:F.transactions)==null?void 0:W.every(ae=>_r(ae.status));K&&(n.signedTransactions[a].status="success"),re&&(n.signedTransactions[a].status="fail")}},setTransactionsToSign:(n,t)=>{n.transactionsToSign=t.payload;let{sessionId:a,customTransactionInformation:p}=t.payload;n.customTransactionInformationForSessionId[a]=p,n.signTransactionsError=null},clearAllTransactionsToSign:n=>{n.transactionsToSign=da.transactionsToSign,n.signTransactionsError=null},clearAllSignedTransactions:n=>{n.signedTransactions=da.signedTransactions},setSignTransactionsError:(n,t)=>{n.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(n,t)=>{n.signTransactionsCancelMessage=t.payload}},extraReducers:n=>{n.addCase(je,()=>da),n.addCase(lf.REHYDRATE,(t,a)=>{var h;if(t.signTransactionsCancelMessage=null,!((h=a.payload)!=null&&h.transactions))return;let{signedTransactions:p,customTransactionInformationForSessionId:l}=a.payload.transactions,g=Object.entries(p).reduce((A,[I,C])=>{let M=new Date(I),F=new Date;return F.setHours(F.getHours()+5),F-M>0||(A[I]=C),A},{});l!=null&&(t.customTransactionInformationForSessionId=l),p!=null&&(t.signedTransactions=g)})}}),{updateSignedTransactionStatus:df,updateSignedTransactions:uf,setTransactionsToSign:VA,clearAllTransactionsToSign:Li,clearAllSignedTransactions:qA,clearSignedTransaction:KA,clearTransactionToSign:VL,setSignTransactionsError:ZA,setSignTransactionsCancelMessage:Ci,moveTransactionsToSignedState:Oc}=_f.actions,Di=_f.reducer});var ff,Rc,Wc,Uc,XA,Bc,gf,XL,YA,Hc,Mi,Fi=V(()=>{"use strict";i();ff=require("@reduxjs/toolkit");cn();Rc="Transaction failed",Wc="Transaction successful",Uc="Processing transaction",XA="Transaction submitted",Bc={},gf=(0,ff.createSlice)({name:"transactionsInfo",initialState:Bc,reducers:{setTransactionsDisplayInfo(n,t){let{sessionId:a,transactionsDisplayInfo:p}=t.payload;a!=null&&(n[a]={errorMessage:(p==null?void 0:p.errorMessage)||Rc,successMessage:(p==null?void 0:p.successMessage)||Wc,processingMessage:(p==null?void 0:p.processingMessage)||Uc,submittedMessage:(p==null?void 0:p.submittedMessage)||XA,transactionDuration:p==null?void 0:p.transactionDuration})},clearTransactionsInfoForSessionId(n,t){t.payload!=null&&delete n[t.payload]},clearTransactionsInfo:()=>Bc},extraReducers:n=>{n.addCase(je,()=>Bc)}}),{clearTransactionsInfo:XL,setTransactionsDisplayInfo:YA,clearTransactionsInfoForSessionId:Hc}=gf.actions,Mi=gf.reducer});var yf,hf,xf,QL,jA,eC,JA,Tf,Gc=V(()=>{"use strict";i();yf=require("@reduxjs/toolkit");cn();hf={},xf=(0,yf.createSlice)({name:"modalsSlice",initialState:hf,reducers:{setTxSubmittedModal:(n,t)=>{n.txSubmittedModal=t.payload},setNotificationModal:(n,t)=>{n.notificationModal=t.payload},clearTxSubmittedModal:n=>{n.txSubmittedModal=void 0},clearNotificationModal:n=>{n.notificationModal=void 0}},extraReducers:n=>{n.addCase(je,()=>hf)}}),{setTxSubmittedModal:QL,setNotificationModal:jA,clearTxSubmittedModal:eC,clearNotificationModal:JA}=xf.actions,Tf=xf.reducer});var wf,vf,bf,Sf,QA,$c,pC,cC,mC,lC,Oi,Bi=V(()=>{"use strict";i();wf=require("@reduxjs/toolkit"),vf=require("redux-persist");fc();sn();yc();cn();bf={customToasts:[],transactionToasts:[],failTransactionToast:null},Sf=(0,wf.createSlice)({name:"toastsSlice",initialState:bf,reducers:{addCustomToast:(n,t)=>{n.customToasts.push(z(P({},t.payload),{type:"custom",toastId:t.payload.toastId||`custom-toast-${n.customToasts.length+1}`}))},removeCustomToast:(n,t)=>{n.customToasts=n.customToasts.filter(a=>a.toastId!==t.payload)},addTransactionToast:(n,t)=>{n.transactionToasts.push({type:"transaction",startTimestamp:Ei(),toastId:t.payload||`custom-toast-${n.transactionToasts.length+1}`})},removeTransactionToast:(n,t)=>{n.transactionToasts=n.transactionToasts.filter(a=>a.toastId!==t.payload)},addFailTransactionToast:(n,t)=>{n.failTransactionToast=z(P({},t.payload),{toastId:Si})},removeFailTransactionToast:n=>{n.failTransactionToast=null}},extraReducers:n=>{n.addCase(je,()=>bf),n.addCase(vf.REHYDRATE,(t,a)=>{var l,g;let p=(g=(l=a.customToasts)==null?void 0:l.filter(h=>!("component"in h)))!=null?g:[];t.customToasts=p})}}),{addCustomToast:QA,removeCustomToast:$c,addTransactionToast:pC,removeTransactionToast:cC,addFailTransactionToast:mC,removeFailTransactionToast:lC}=Sf.actions,Oi=Sf.reducer});var ue=V(()=>{"use strict";i();Ac();Nc();Mc();Pi();Fi();Gc();Bi()});var zc=V(()=>{"use strict";i()});var Ef,kf,Nf,CC,DC,PC,MC,FC,OC,Lf,Cf=V(()=>{"use strict";i();Ef=require("@reduxjs/toolkit");cn();kf={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Nf=(0,Ef.createSlice)({name:"dappModalsSlice",initialState:kf,reducers:{setDappModalVisibility:(n,t)=>{n.visible=t.payload},setDappModalHeaderVisibility:(n,t)=>{n.modal.showHeader=t.payload},setDappModalFooterVisibility:(n,t)=>{n.modal.showFooter=t.payload},setDappModalHeaderText:(n,t)=>{n.modal.headerText=t.payload},setDappModalFooterText:(n,t)=>{n.modal.footerText=t.payload},setDappModalConfig:(n,t)=>{n.modal=P({},t.payload)}},extraReducers:n=>{n.addCase(je,()=>kf)}}),{setDappModalVisibility:CC,setDappModalHeaderVisibility:DC,setDappModalFooterVisibility:PC,setDappModalHeaderText:MC,setDappModalFooterText:FC,setDappModalConfig:OC}=Nf.actions,Lf=Nf.reducer});var Df,tI,rI,ur,Wi=V(()=>{"use strict";i();Df=require("@reduxjs/toolkit");zc();Mc();Cf();Ac();Gc();Nc();Bi();Fi();Pi();tI={["account"]:cf,["networkConfig"]:rf,["loginInfo"]:ju,["modals"]:Tf,["dappModal"]:Lf,["toasts"]:Oi,["transactions"]:Di,["transactionsInfo"]:Mi},rI=(n={})=>(0,Df.combineReducers)(P(P({},tI),n)),ur=rI});var Ff={};dt(Ff,{default:()=>lI});function Vc(n,t=[]){return{key:n,version:1,storage:Mf.default,blacklist:t}}var bt,Pf,Mf,aI,iI,sI,pI,cI,mI,lI,Of=V(()=>{"use strict";i();bt=require("redux-persist"),Pf=v(require("redux-persist/lib/storage")),Mf=v(require("redux-persist/lib/storage/session"));Wi();ue();Bi();Fi();Pi();zc();aI={2:n=>z(P({},n),{networkConfig:Ec})};iI=Vc("dapp-core-transactionsInfo"),sI=Vc("dapp-core-transactions",["transactionsToSign"]),pI=Vc("dapp-core-toasts"),cI={key:"dapp-core-store",version:2,storage:Pf.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,bt.createMigrate)(aI,{debug:!1})},mI={["toasts"]:(0,bt.persistReducer)(pI,Oi),["transactions"]:(0,bt.persistReducer)(sI,Di),["transactionsInfo"]:(0,bt.persistReducer)(iI,Mi)},lI=(0,bt.persistReducer)(cI,ur(mI))});var Bf={};dt(Bf,{default:()=>_I});var _I,Rf=V(()=>{"use strict";i();Wi();_I=ur()});var Wf={};dt(Wf,{default:()=>uI});var On,dI,uI,Uf=V(()=>{"use strict";i();On=require("redux-persist"),dI=[On.FLUSH,On.REHYDRATE,On.PAUSE,On.PERSIST,On.PURGE,On.REGISTER],uI=dI});var $f={};dt($f,{default:()=>Gf});function Gf(n){return(0,Hf.persistStore)(n)}var Hf,zf=V(()=>{"use strict";i();Hf=require("redux-persist")});var rh=ra((wr,ha)=>{i();(function(){var n,t="4.17.21",a=200,p="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",g="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",A=500,I="__lodash_placeholder__",C=1,M=2,F=4,W=1,K=2,re=1,ae=2,ot=4,_n=8,dn=16,He=32,Me=64,Qe=128,Yn=256,Mr=512,Ps=30,Cy="...",Dy=800,Py=16,ll=1,My=2,Fy=3,tt=1/0,Wo=9007199254740991,Oy=17976931348623157e292,Ia=0/0,jn=4294967295,By=jn-1,Ry=jn>>>1,Wy=[["ary",Qe],["bind",re],["bindKey",ae],["curry",_n],["curryRight",dn],["flip",Mr],["partial",He],["partialRight",Me],["rearg",Yn]],Wt="[object Arguments]",ka="[object Array]",Uy="[object AsyncFunction]",Fr="[object Boolean]",Or="[object Date]",Hy="[object DOMException]",Ea="[object Error]",Na="[object Function]",_l="[object GeneratorFunction]",Hn="[object Map]",Br="[object Number]",Gy="[object Null]",mo="[object Object]",dl="[object Promise]",$y="[object Proxy]",Rr="[object RegExp]",Gn="[object Set]",Wr="[object String]",La="[object Symbol]",zy="[object Undefined]",Ur="[object WeakMap]",Vy="[object WeakSet]",Hr="[object ArrayBuffer]",Ut="[object DataView]",Ms="[object Float32Array]",Fs="[object Float64Array]",Os="[object Int8Array]",Bs="[object Int16Array]",Rs="[object Int32Array]",Ws="[object Uint8Array]",Us="[object Uint8ClampedArray]",Hs="[object Uint16Array]",Gs="[object Uint32Array]",qy=/\b__p \+= '';/g,Ky=/\b(__p \+=) '' \+/g,Zy=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ul=/&(?:amp|lt|gt|quot|#39);/g,fl=/[&<>"']/g,Xy=RegExp(ul.source),Yy=RegExp(fl.source),jy=/<%-([\s\S]+?)%>/g,Jy=/<%([\s\S]+?)%>/g,gl=/<%=([\s\S]+?)%>/g,Qy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ex=/^\w*$/,nx=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$s=/[\\^$.*+?()[\]{}|]/g,ox=RegExp($s.source),zs=/^\s+/,tx=/\s/,rx=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ax=/\{\n\/\* \[wrapped with (.+)\] \*/,ix=/,? & /,sx=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,px=/[()=,{}\[\]\/\s]/,cx=/\\(\\)?/g,mx=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,hl=/\w*$/,lx=/^[-+]0x[0-9a-f]+$/i,_x=/^0b[01]+$/i,dx=/^\[object .+?Constructor\]$/,ux=/^0o[0-7]+$/i,fx=/^(?:0|[1-9]\d*)$/,gx=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ca=/($^)/,hx=/['\n\r\u2028\u2029\\]/g,Da="\\ud800-\\udfff",yx="\\u0300-\\u036f",xx="\\ufe20-\\ufe2f",Tx="\\u20d0-\\u20ff",yl=yx+xx+Tx,xl="\\u2700-\\u27bf",Tl="a-z\\xdf-\\xf6\\xf8-\\xff",bx="\\xac\\xb1\\xd7\\xf7",wx="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vx="\\u2000-\\u206f",Sx=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bl="A-Z\\xc0-\\xd6\\xd8-\\xde",wl="\\ufe0e\\ufe0f",vl=bx+wx+vx+Sx,Vs="['\u2019]",Ax="["+Da+"]",Sl="["+vl+"]",Pa="["+yl+"]",Al="\\d+",Ix="["+xl+"]",Il="["+Tl+"]",kl="[^"+Da+vl+Al+xl+Tl+bl+"]",qs="\\ud83c[\\udffb-\\udfff]",kx="(?:"+Pa+"|"+qs+")",El="[^"+Da+"]",Ks="(?:\\ud83c[\\udde6-\\uddff]){2}",Zs="[\\ud800-\\udbff][\\udc00-\\udfff]",Ht="["+bl+"]",Nl="\\u200d",Ll="(?:"+Il+"|"+kl+")",Ex="(?:"+Ht+"|"+kl+")",Cl="(?:"+Vs+"(?:d|ll|m|re|s|t|ve))?",Dl="(?:"+Vs+"(?:D|LL|M|RE|S|T|VE))?",Pl=kx+"?",Ml="["+wl+"]?",Nx="(?:"+Nl+"(?:"+[El,Ks,Zs].join("|")+")"+Ml+Pl+")*",Lx="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Cx="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Fl=Ml+Pl+Nx,Dx="(?:"+[Ix,Ks,Zs].join("|")+")"+Fl,Px="(?:"+[El+Pa+"?",Pa,Ks,Zs,Ax].join("|")+")",Mx=RegExp(Vs,"g"),Fx=RegExp(Pa,"g"),Xs=RegExp(qs+"(?="+qs+")|"+Px+Fl,"g"),Ox=RegExp([Ht+"?"+Il+"+"+Cl+"(?="+[Sl,Ht,"$"].join("|")+")",Ex+"+"+Dl+"(?="+[Sl,Ht+Ll,"$"].join("|")+")",Ht+"?"+Ll+"+"+Cl,Ht+"+"+Dl,Cx,Lx,Al,Dx].join("|"),"g"),Bx=RegExp("["+Nl+Da+yl+wl+"]"),Rx=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wx=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ux=-1,fe={};fe[Ms]=fe[Fs]=fe[Os]=fe[Bs]=fe[Rs]=fe[Ws]=fe[Us]=fe[Hs]=fe[Gs]=!0,fe[Wt]=fe[ka]=fe[Hr]=fe[Fr]=fe[Ut]=fe[Or]=fe[Ea]=fe[Na]=fe[Hn]=fe[Br]=fe[mo]=fe[Rr]=fe[Gn]=fe[Wr]=fe[Ur]=!1;var de={};de[Wt]=de[ka]=de[Hr]=de[Ut]=de[Fr]=de[Or]=de[Ms]=de[Fs]=de[Os]=de[Bs]=de[Rs]=de[Hn]=de[Br]=de[mo]=de[Rr]=de[Gn]=de[Wr]=de[La]=de[Ws]=de[Us]=de[Hs]=de[Gs]=!0,de[Ea]=de[Na]=de[Ur]=!1;var Hx={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D