UNPKG

@sofaws/dapp-core

Version:

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

1 lines 243 kB
"use strict";var ky=Object.create;var _o=Object.defineProperty,Iy=Object.defineProperties,Ey=Object.getOwnPropertyDescriptor,Ly=Object.getOwnPropertyDescriptors,Cy=Object.getOwnPropertyNames,hr=Object.getOwnPropertySymbols,Ry=Object.getPrototypeOf,li=Object.prototype.hasOwnProperty,qs=Object.prototype.propertyIsEnumerable;var Vs=(t,r,a)=>r in t?_o(t,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[r]=a,Q=(t,r)=>{for(var a in r||(r={}))li.call(r,a)&&Vs(t,a,r[a]);if(hr)for(var a of hr(r))qs.call(r,a)&&Vs(t,a,r[a]);return t},we=(t,r)=>Iy(t,Ly(r));var xr=(t,r)=>{var a={};for(var c in t)li.call(t,c)&&r.indexOf(c)<0&&(a[c]=t[c]);if(t!=null&&hr)for(var c of hr(t))r.indexOf(c)<0&&qs.call(t,c)&&(a[c]=t[c]);return a};var W=(t,r)=>()=>(t&&(r=t(t=0)),r);var mo=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),pt=(t,r)=>{for(var a in r)_o(t,a,{get:r[a],enumerable:!0})},Ks=(t,r,a,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of Cy(r))!li.call(t,l)&&l!==a&&_o(t,l,{get:()=>r[l],enumerable:!(c=Ey(r,l))||c.enumerable});return t};var ee=(t,r,a)=>(a=t!=null?ky(Ry(t)):{},Ks(r||!t||!t.__esModule?_o(a,"default",{value:t,enumerable:!0}):a,t)),lo=t=>Ks(_o({},"__esModule",{value:!0}),t);var Xs=(t,r,a)=>new Promise((c,l)=>{var x=E=>{try{L(a.next(E))}catch(N){l(N)}},y=E=>{try{L(a.throw(E))}catch(N){l(N)}},L=E=>E.done?c(E.value):Promise.resolve(E.value).then(x,y);L((a=a.apply(t,r)).next())});var Js=mo(yr=>{"use strict";_();yr.byteLength=Dy;yr.toByteArray=Fy;yr.fromByteArray=By;var gn=[],Qe=[],Ny=typeof Uint8Array!="undefined"?Uint8Array:Array,di="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ct=0,Ys=di.length;ct<Ys;++ct)gn[ct]=di[ct],Qe[di.charCodeAt(ct)]=ct;var ct,Ys;Qe["-".charCodeAt(0)]=62;Qe["_".charCodeAt(0)]=63;function Zs(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=t.indexOf("=");a===-1&&(a=r);var c=a===r?0:4-a%4;return[a,c]}function Dy(t){var r=Zs(t),a=r[0],c=r[1];return(a+c)*3/4-c}function Py(t,r,a){return(r+a)*3/4-a}function Fy(t){var r,a=Zs(t),c=a[0],l=a[1],x=new Ny(Py(t,c,l)),y=0,L=l>0?c-4:c,E;for(E=0;E<L;E+=4)r=Qe[t.charCodeAt(E)]<<18|Qe[t.charCodeAt(E+1)]<<12|Qe[t.charCodeAt(E+2)]<<6|Qe[t.charCodeAt(E+3)],x[y++]=r>>16&255,x[y++]=r>>8&255,x[y++]=r&255;return l===2&&(r=Qe[t.charCodeAt(E)]<<2|Qe[t.charCodeAt(E+1)]>>4,x[y++]=r&255),l===1&&(r=Qe[t.charCodeAt(E)]<<10|Qe[t.charCodeAt(E+1)]<<4|Qe[t.charCodeAt(E+2)]>>2,x[y++]=r>>8&255,x[y++]=r&255),x}function Oy(t){return gn[t>>18&63]+gn[t>>12&63]+gn[t>>6&63]+gn[t&63]}function My(t,r,a){for(var c,l=[],x=r;x<a;x+=3)c=(t[x]<<16&16711680)+(t[x+1]<<8&65280)+(t[x+2]&255),l.push(Oy(c));return l.join("")}function By(t){for(var r,a=t.length,c=a%3,l=[],x=16383,y=0,L=a-c;y<L;y+=x)l.push(My(t,y,y+x>L?L:y+x));return c===1?(r=t[a-1],l.push(gn[r>>2]+gn[r<<4&63]+"==")):c===2&&(r=(t[a-2]<<8)+t[a-1],l.push(gn[r>>10]+gn[r>>4&63]+gn[r<<2&63]+"=")),l.join("")}});var Qs=mo(ui=>{_();ui.read=function(t,r,a,c,l){var x,y,L=l*8-c-1,E=(1<<L)-1,N=E>>1,U=-7,P=a?l-1:0,Y=a?-1:1,ie=t[r+P];for(P+=Y,x=ie&(1<<-U)-1,ie>>=-U,U+=L;U>0;x=x*256+t[r+P],P+=Y,U-=8);for(y=x&(1<<-U)-1,x>>=-U,U+=c;U>0;y=y*256+t[r+P],P+=Y,U-=8);if(x===0)x=1-N;else{if(x===E)return y?NaN:(ie?-1:1)*(1/0);y=y+Math.pow(2,c),x=x-N}return(ie?-1:1)*y*Math.pow(2,x-c)};ui.write=function(t,r,a,c,l,x){var y,L,E,N=x*8-l-1,U=(1<<N)-1,P=U>>1,Y=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,ie=c?0:x-1,re=c?1:-1,de=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(L=isNaN(r)?1:0,y=U):(y=Math.floor(Math.log(r)/Math.LN2),r*(E=Math.pow(2,-y))<1&&(y--,E*=2),y+P>=1?r+=Y/E:r+=Y*Math.pow(2,1-P),r*E>=2&&(y++,E/=2),y+P>=U?(L=0,y=U):y+P>=1?(L=(r*E-1)*Math.pow(2,l),y=y+P):(L=r*Math.pow(2,P-1)*Math.pow(2,l),y=0));l>=8;t[a+ie]=L&255,ie+=re,L/=256,l-=8);for(y=y<<l|L,N+=l;N>0;t[a+ie]=y&255,ie+=re,y/=256,N-=8);t[a+ie-re]|=de*128}});var m_=mo(Rt=>{"use strict";_();var fi=Js(),Ct=Qs(),js=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Rt.Buffer=S;Rt.SlowBuffer=zy;Rt.INSPECT_MAX_BYTES=50;var br=2147483647;Rt.kMaxLength=br;S.TYPED_ARRAY_SUPPORT=Uy();!S.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 Uy(){try{var t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),t.foo()===42}catch(a){return!1}}Object.defineProperty(S.prototype,"parent",{enumerable:!0,get:function(){if(!!S.isBuffer(this))return this.buffer}});Object.defineProperty(S.prototype,"offset",{enumerable:!0,get:function(){if(!!S.isBuffer(this))return this.byteOffset}});function Cn(t){if(t>br)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,S.prototype),r}function S(t,r,a){if(typeof t=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return yi(t)}return t_(t,r,a)}S.poolSize=8192;function t_(t,r,a){if(typeof t=="string")return $y(t,r);if(ArrayBuffer.isView(t))return Hy(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(hn(t,ArrayBuffer)||t&&hn(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(hn(t,SharedArrayBuffer)||t&&hn(t.buffer,SharedArrayBuffer)))return hi(t,r,a);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var c=t.valueOf&&t.valueOf();if(c!=null&&c!==t)return S.from(c,r,a);var l=Gy(t);if(l)return l;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return S.from(t[Symbol.toPrimitive]("string"),r,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}S.from=function(t,r,a){return t_(t,r,a)};Object.setPrototypeOf(S.prototype,Uint8Array.prototype);Object.setPrototypeOf(S,Uint8Array);function o_(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Wy(t,r,a){return o_(t),t<=0?Cn(t):r!==void 0?typeof a=="string"?Cn(t).fill(r,a):Cn(t).fill(r):Cn(t)}S.alloc=function(t,r,a){return Wy(t,r,a)};function yi(t){return o_(t),Cn(t<0?0:bi(t)|0)}S.allocUnsafe=function(t){return yi(t)};S.allocUnsafeSlow=function(t){return yi(t)};function $y(t,r){if((typeof r!="string"||r==="")&&(r="utf8"),!S.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var a=r_(t,r)|0,c=Cn(a),l=c.write(t,r);return l!==a&&(c=c.slice(0,l)),c}function gi(t){for(var r=t.length<0?0:bi(t.length)|0,a=Cn(r),c=0;c<r;c+=1)a[c]=t[c]&255;return a}function Hy(t){if(hn(t,Uint8Array)){var r=new Uint8Array(t);return hi(r.buffer,r.byteOffset,r.byteLength)}return gi(t)}function hi(t,r,a){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(a||0))throw new RangeError('"length" is outside of buffer bounds');var c;return r===void 0&&a===void 0?c=new Uint8Array(t):a===void 0?c=new Uint8Array(t,r):c=new Uint8Array(t,r,a),Object.setPrototypeOf(c,S.prototype),c}function Gy(t){if(S.isBuffer(t)){var r=bi(t.length)|0,a=Cn(r);return a.length===0||t.copy(a,0,0,r),a}if(t.length!==void 0)return typeof t.length!="number"||Ti(t.length)?Cn(0):gi(t);if(t.type==="Buffer"&&Array.isArray(t.data))return gi(t.data)}function bi(t){if(t>=br)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+br.toString(16)+" bytes");return t|0}function zy(t){return+t!=t&&(t=0),S.alloc(+t)}S.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==S.prototype};S.compare=function(r,a){if(hn(r,Uint8Array)&&(r=S.from(r,r.offset,r.byteLength)),hn(a,Uint8Array)&&(a=S.from(a,a.offset,a.byteLength)),!S.isBuffer(r)||!S.isBuffer(a))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===a)return 0;for(var c=r.length,l=a.length,x=0,y=Math.min(c,l);x<y;++x)if(r[x]!==a[x]){c=r[x],l=a[x];break}return c<l?-1:l<c?1:0};S.isEncoding=function(r){switch(String(r).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}};S.concat=function(r,a){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return S.alloc(0);var c;if(a===void 0)for(a=0,c=0;c<r.length;++c)a+=r[c].length;var l=S.allocUnsafe(a),x=0;for(c=0;c<r.length;++c){var y=r[c];if(hn(y,Uint8Array))x+y.length>l.length?S.from(y).copy(l,x):Uint8Array.prototype.set.call(l,y,x);else if(S.isBuffer(y))y.copy(l,x);else throw new TypeError('"list" argument must be an Array of Buffers');x+=y.length}return l};function r_(t,r){if(S.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||hn(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var a=t.length,c=arguments.length>2&&arguments[2]===!0;if(!c&&a===0)return 0;for(var l=!1;;)switch(r){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return xi(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a*2;case"hex":return a>>>1;case"base64":return __(t).length;default:if(l)return c?-1:xi(t).length;r=(""+r).toLowerCase(),l=!0}}S.byteLength=r_;function Vy(t,r,a){var c=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((a===void 0||a>this.length)&&(a=this.length),a<=0)||(a>>>=0,r>>>=0,a<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return nb(this,r,a);case"utf8":case"utf-8":return i_(this,r,a);case"ascii":return jy(this,r,a);case"latin1":case"binary":return eb(this,r,a);case"base64":return Jy(this,r,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tb(this,r,a);default:if(c)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),c=!0}}S.prototype._isBuffer=!0;function st(t,r,a){var c=t[r];t[r]=t[a],t[a]=c}S.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var a=0;a<r;a+=2)st(this,a,a+1);return this};S.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var a=0;a<r;a+=4)st(this,a,a+3),st(this,a+1,a+2);return this};S.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var a=0;a<r;a+=8)st(this,a,a+7),st(this,a+1,a+6),st(this,a+2,a+5),st(this,a+3,a+4);return this};S.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?i_(this,0,r):Vy.apply(this,arguments)};S.prototype.toLocaleString=S.prototype.toString;S.prototype.equals=function(r){if(!S.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:S.compare(this,r)===0};S.prototype.inspect=function(){var r="",a=Rt.INSPECT_MAX_BYTES;return r=this.toString("hex",0,a).replace(/(.{2})/g,"$1 ").trim(),this.length>a&&(r+=" ... "),"<Buffer "+r+">"};js&&(S.prototype[js]=S.prototype.inspect);S.prototype.compare=function(r,a,c,l,x){if(hn(r,Uint8Array)&&(r=S.from(r,r.offset,r.byteLength)),!S.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(a===void 0&&(a=0),c===void 0&&(c=r?r.length:0),l===void 0&&(l=0),x===void 0&&(x=this.length),a<0||c>r.length||l<0||x>this.length)throw new RangeError("out of range index");if(l>=x&&a>=c)return 0;if(l>=x)return-1;if(a>=c)return 1;if(a>>>=0,c>>>=0,l>>>=0,x>>>=0,this===r)return 0;for(var y=x-l,L=c-a,E=Math.min(y,L),N=this.slice(l,x),U=r.slice(a,c),P=0;P<E;++P)if(N[P]!==U[P]){y=N[P],L=U[P];break}return y<L?-1:L<y?1:0};function a_(t,r,a,c,l){if(t.length===0)return-1;if(typeof a=="string"?(c=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,Ti(a)&&(a=l?0:t.length-1),a<0&&(a=t.length+a),a>=t.length){if(l)return-1;a=t.length-1}else if(a<0)if(l)a=0;else return-1;if(typeof r=="string"&&(r=S.from(r,c)),S.isBuffer(r))return r.length===0?-1:e_(t,r,a,c,l);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?l?Uint8Array.prototype.indexOf.call(t,r,a):Uint8Array.prototype.lastIndexOf.call(t,r,a):e_(t,[r],a,c,l);throw new TypeError("val must be string, number or Buffer")}function e_(t,r,a,c,l){var x=1,y=t.length,L=r.length;if(c!==void 0&&(c=String(c).toLowerCase(),c==="ucs2"||c==="ucs-2"||c==="utf16le"||c==="utf-16le")){if(t.length<2||r.length<2)return-1;x=2,y/=2,L/=2,a/=2}function E(ie,re){return x===1?ie[re]:ie.readUInt16BE(re*x)}var N;if(l){var U=-1;for(N=a;N<y;N++)if(E(t,N)===E(r,U===-1?0:N-U)){if(U===-1&&(U=N),N-U+1===L)return U*x}else U!==-1&&(N-=N-U),U=-1}else for(a+L>y&&(a=y-L),N=a;N>=0;N--){for(var P=!0,Y=0;Y<L;Y++)if(E(t,N+Y)!==E(r,Y)){P=!1;break}if(P)return N}return-1}S.prototype.includes=function(r,a,c){return this.indexOf(r,a,c)!==-1};S.prototype.indexOf=function(r,a,c){return a_(this,r,a,c,!0)};S.prototype.lastIndexOf=function(r,a,c){return a_(this,r,a,c,!1)};function qy(t,r,a,c){a=Number(a)||0;var l=t.length-a;c?(c=Number(c),c>l&&(c=l)):c=l;var x=r.length;c>x/2&&(c=x/2);for(var y=0;y<c;++y){var L=parseInt(r.substr(y*2,2),16);if(Ti(L))return y;t[a+y]=L}return y}function Ky(t,r,a,c){return Tr(xi(r,t.length-a),t,a,c)}function Xy(t,r,a,c){return Tr(ab(r),t,a,c)}function Yy(t,r,a,c){return Tr(__(r),t,a,c)}function Zy(t,r,a,c){return Tr(ib(r,t.length-a),t,a,c)}S.prototype.write=function(r,a,c,l){if(a===void 0)l="utf8",c=this.length,a=0;else if(c===void 0&&typeof a=="string")l=a,c=this.length,a=0;else if(isFinite(a))a=a>>>0,isFinite(c)?(c=c>>>0,l===void 0&&(l="utf8")):(l=c,c=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var x=this.length-a;if((c===void 0||c>x)&&(c=x),r.length>0&&(c<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");l||(l="utf8");for(var y=!1;;)switch(l){case"hex":return qy(this,r,a,c);case"utf8":case"utf-8":return Ky(this,r,a,c);case"ascii":case"latin1":case"binary":return Xy(this,r,a,c);case"base64":return Yy(this,r,a,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Zy(this,r,a,c);default:if(y)throw new TypeError("Unknown encoding: "+l);l=(""+l).toLowerCase(),y=!0}};S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Jy(t,r,a){return r===0&&a===t.length?fi.fromByteArray(t):fi.fromByteArray(t.slice(r,a))}function i_(t,r,a){a=Math.min(t.length,a);for(var c=[],l=r;l<a;){var x=t[l],y=null,L=x>239?4:x>223?3:x>191?2:1;if(l+L<=a){var E,N,U,P;switch(L){case 1:x<128&&(y=x);break;case 2:E=t[l+1],(E&192)===128&&(P=(x&31)<<6|E&63,P>127&&(y=P));break;case 3:E=t[l+1],N=t[l+2],(E&192)===128&&(N&192)===128&&(P=(x&15)<<12|(E&63)<<6|N&63,P>2047&&(P<55296||P>57343)&&(y=P));break;case 4:E=t[l+1],N=t[l+2],U=t[l+3],(E&192)===128&&(N&192)===128&&(U&192)===128&&(P=(x&15)<<18|(E&63)<<12|(N&63)<<6|U&63,P>65535&&P<1114112&&(y=P))}}y===null?(y=65533,L=1):y>65535&&(y-=65536,c.push(y>>>10&1023|55296),y=56320|y&1023),c.push(y),l+=L}return Qy(c)}var n_=4096;function Qy(t){var r=t.length;if(r<=n_)return String.fromCharCode.apply(String,t);for(var a="",c=0;c<r;)a+=String.fromCharCode.apply(String,t.slice(c,c+=n_));return a}function jy(t,r,a){var c="";a=Math.min(t.length,a);for(var l=r;l<a;++l)c+=String.fromCharCode(t[l]&127);return c}function eb(t,r,a){var c="";a=Math.min(t.length,a);for(var l=r;l<a;++l)c+=String.fromCharCode(t[l]);return c}function nb(t,r,a){var c=t.length;(!r||r<0)&&(r=0),(!a||a<0||a>c)&&(a=c);for(var l="",x=r;x<a;++x)l+=pb[t[x]];return l}function tb(t,r,a){for(var c=t.slice(r,a),l="",x=0;x<c.length-1;x+=2)l+=String.fromCharCode(c[x]+c[x+1]*256);return l}S.prototype.slice=function(r,a){var c=this.length;r=~~r,a=a===void 0?c:~~a,r<0?(r+=c,r<0&&(r=0)):r>c&&(r=c),a<0?(a+=c,a<0&&(a=0)):a>c&&(a=c),a<r&&(a=r);var l=this.subarray(r,a);return Object.setPrototypeOf(l,S.prototype),l};function be(t,r,a){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>a)throw new RangeError("Trying to access beyond buffer length")}S.prototype.readUintLE=S.prototype.readUIntLE=function(r,a,c){r=r>>>0,a=a>>>0,c||be(r,a,this.length);for(var l=this[r],x=1,y=0;++y<a&&(x*=256);)l+=this[r+y]*x;return l};S.prototype.readUintBE=S.prototype.readUIntBE=function(r,a,c){r=r>>>0,a=a>>>0,c||be(r,a,this.length);for(var l=this[r+--a],x=1;a>0&&(x*=256);)l+=this[r+--a]*x;return l};S.prototype.readUint8=S.prototype.readUInt8=function(r,a){return r=r>>>0,a||be(r,1,this.length),this[r]};S.prototype.readUint16LE=S.prototype.readUInt16LE=function(r,a){return r=r>>>0,a||be(r,2,this.length),this[r]|this[r+1]<<8};S.prototype.readUint16BE=S.prototype.readUInt16BE=function(r,a){return r=r>>>0,a||be(r,2,this.length),this[r]<<8|this[r+1]};S.prototype.readUint32LE=S.prototype.readUInt32LE=function(r,a){return r=r>>>0,a||be(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};S.prototype.readUint32BE=S.prototype.readUInt32BE=function(r,a){return r=r>>>0,a||be(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};S.prototype.readIntLE=function(r,a,c){r=r>>>0,a=a>>>0,c||be(r,a,this.length);for(var l=this[r],x=1,y=0;++y<a&&(x*=256);)l+=this[r+y]*x;return x*=128,l>=x&&(l-=Math.pow(2,8*a)),l};S.prototype.readIntBE=function(r,a,c){r=r>>>0,a=a>>>0,c||be(r,a,this.length);for(var l=a,x=1,y=this[r+--l];l>0&&(x*=256);)y+=this[r+--l]*x;return x*=128,y>=x&&(y-=Math.pow(2,8*a)),y};S.prototype.readInt8=function(r,a){return r=r>>>0,a||be(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};S.prototype.readInt16LE=function(r,a){r=r>>>0,a||be(r,2,this.length);var c=this[r]|this[r+1]<<8;return c&32768?c|4294901760:c};S.prototype.readInt16BE=function(r,a){r=r>>>0,a||be(r,2,this.length);var c=this[r+1]|this[r]<<8;return c&32768?c|4294901760:c};S.prototype.readInt32LE=function(r,a){return r=r>>>0,a||be(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};S.prototype.readInt32BE=function(r,a){return r=r>>>0,a||be(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};S.prototype.readFloatLE=function(r,a){return r=r>>>0,a||be(r,4,this.length),Ct.read(this,r,!0,23,4)};S.prototype.readFloatBE=function(r,a){return r=r>>>0,a||be(r,4,this.length),Ct.read(this,r,!1,23,4)};S.prototype.readDoubleLE=function(r,a){return r=r>>>0,a||be(r,8,this.length),Ct.read(this,r,!0,52,8)};S.prototype.readDoubleBE=function(r,a){return r=r>>>0,a||be(r,8,this.length),Ct.read(this,r,!1,52,8)};function Fe(t,r,a,c,l,x){if(!S.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>l||r<x)throw new RangeError('"value" argument is out of bounds');if(a+c>t.length)throw new RangeError("Index out of range")}S.prototype.writeUintLE=S.prototype.writeUIntLE=function(r,a,c,l){if(r=+r,a=a>>>0,c=c>>>0,!l){var x=Math.pow(2,8*c)-1;Fe(this,r,a,c,x,0)}var y=1,L=0;for(this[a]=r&255;++L<c&&(y*=256);)this[a+L]=r/y&255;return a+c};S.prototype.writeUintBE=S.prototype.writeUIntBE=function(r,a,c,l){if(r=+r,a=a>>>0,c=c>>>0,!l){var x=Math.pow(2,8*c)-1;Fe(this,r,a,c,x,0)}var y=c-1,L=1;for(this[a+y]=r&255;--y>=0&&(L*=256);)this[a+y]=r/L&255;return a+c};S.prototype.writeUint8=S.prototype.writeUInt8=function(r,a,c){return r=+r,a=a>>>0,c||Fe(this,r,a,1,255,0),this[a]=r&255,a+1};S.prototype.writeUint16LE=S.prototype.writeUInt16LE=function(r,a,c){return r=+r,a=a>>>0,c||Fe(this,r,a,2,65535,0),this[a]=r&255,this[a+1]=r>>>8,a+2};S.prototype.writeUint16BE=S.prototype.writeUInt16BE=function(r,a,c){return r=+r,a=a>>>0,c||Fe(this,r,a,2,65535,0),this[a]=r>>>8,this[a+1]=r&255,a+2};S.prototype.writeUint32LE=S.prototype.writeUInt32LE=function(r,a,c){return r=+r,a=a>>>0,c||Fe(this,r,a,4,4294967295,0),this[a+3]=r>>>24,this[a+2]=r>>>16,this[a+1]=r>>>8,this[a]=r&255,a+4};S.prototype.writeUint32BE=S.prototype.writeUInt32BE=function(r,a,c){return r=+r,a=a>>>0,c||Fe(this,r,a,4,4294967295,0),this[a]=r>>>24,this[a+1]=r>>>16,this[a+2]=r>>>8,this[a+3]=r&255,a+4};S.prototype.writeIntLE=function(r,a,c,l){if(r=+r,a=a>>>0,!l){var x=Math.pow(2,8*c-1);Fe(this,r,a,c,x-1,-x)}var y=0,L=1,E=0;for(this[a]=r&255;++y<c&&(L*=256);)r<0&&E===0&&this[a+y-1]!==0&&(E=1),this[a+y]=(r/L>>0)-E&255;return a+c};S.prototype.writeIntBE=function(r,a,c,l){if(r=+r,a=a>>>0,!l){var x=Math.pow(2,8*c-1);Fe(this,r,a,c,x-1,-x)}var y=c-1,L=1,E=0;for(this[a+y]=r&255;--y>=0&&(L*=256);)r<0&&E===0&&this[a+y+1]!==0&&(E=1),this[a+y]=(r/L>>0)-E&255;return a+c};S.prototype.writeInt8=function(r,a,c){return r=+r,a=a>>>0,c||Fe(this,r,a,1,127,-128),r<0&&(r=255+r+1),this[a]=r&255,a+1};S.prototype.writeInt16LE=function(r,a,c){return r=+r,a=a>>>0,c||Fe(this,r,a,2,32767,-32768),this[a]=r&255,this[a+1]=r>>>8,a+2};S.prototype.writeInt16BE=function(r,a,c){return r=+r,a=a>>>0,c||Fe(this,r,a,2,32767,-32768),this[a]=r>>>8,this[a+1]=r&255,a+2};S.prototype.writeInt32LE=function(r,a,c){return r=+r,a=a>>>0,c||Fe(this,r,a,4,2147483647,-2147483648),this[a]=r&255,this[a+1]=r>>>8,this[a+2]=r>>>16,this[a+3]=r>>>24,a+4};S.prototype.writeInt32BE=function(r,a,c){return r=+r,a=a>>>0,c||Fe(this,r,a,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[a]=r>>>24,this[a+1]=r>>>16,this[a+2]=r>>>8,this[a+3]=r&255,a+4};function p_(t,r,a,c,l,x){if(a+c>t.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function c_(t,r,a,c,l){return r=+r,a=a>>>0,l||p_(t,r,a,4,34028234663852886e22,-34028234663852886e22),Ct.write(t,r,a,c,23,4),a+4}S.prototype.writeFloatLE=function(r,a,c){return c_(this,r,a,!0,c)};S.prototype.writeFloatBE=function(r,a,c){return c_(this,r,a,!1,c)};function s_(t,r,a,c,l){return r=+r,a=a>>>0,l||p_(t,r,a,8,17976931348623157e292,-17976931348623157e292),Ct.write(t,r,a,c,52,8),a+8}S.prototype.writeDoubleLE=function(r,a,c){return s_(this,r,a,!0,c)};S.prototype.writeDoubleBE=function(r,a,c){return s_(this,r,a,!1,c)};S.prototype.copy=function(r,a,c,l){if(!S.isBuffer(r))throw new TypeError("argument should be a Buffer");if(c||(c=0),!l&&l!==0&&(l=this.length),a>=r.length&&(a=r.length),a||(a=0),l>0&&l<c&&(l=c),l===c||r.length===0||this.length===0)return 0;if(a<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=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),r.length-a<l-c&&(l=r.length-a+c);var x=l-c;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(a,c,l):Uint8Array.prototype.set.call(r,this.subarray(c,l),a),x};S.prototype.fill=function(r,a,c,l){if(typeof r=="string"){if(typeof a=="string"?(l=a,a=0,c=this.length):typeof c=="string"&&(l=c,c=this.length),l!==void 0&&typeof l!="string")throw new TypeError("encoding must be a string");if(typeof l=="string"&&!S.isEncoding(l))throw new TypeError("Unknown encoding: "+l);if(r.length===1){var x=r.charCodeAt(0);(l==="utf8"&&x<128||l==="latin1")&&(r=x)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(a<0||this.length<a||this.length<c)throw new RangeError("Out of range index");if(c<=a)return this;a=a>>>0,c=c===void 0?this.length:c>>>0,r||(r=0);var y;if(typeof r=="number")for(y=a;y<c;++y)this[y]=r;else{var L=S.isBuffer(r)?r:S.from(r,l),E=L.length;if(E===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(y=0;y<c-a;++y)this[y+a]=L[y%E]}return this};var ob=/[^+/0-9A-Za-z-_]/g;function rb(t){if(t=t.split("=")[0],t=t.trim().replace(ob,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function xi(t,r){r=r||1/0;for(var a,c=t.length,l=null,x=[],y=0;y<c;++y){if(a=t.charCodeAt(y),a>55295&&a<57344){if(!l){if(a>56319){(r-=3)>-1&&x.push(239,191,189);continue}else if(y+1===c){(r-=3)>-1&&x.push(239,191,189);continue}l=a;continue}if(a<56320){(r-=3)>-1&&x.push(239,191,189),l=a;continue}a=(l-55296<<10|a-56320)+65536}else l&&(r-=3)>-1&&x.push(239,191,189);if(l=null,a<128){if((r-=1)<0)break;x.push(a)}else if(a<2048){if((r-=2)<0)break;x.push(a>>6|192,a&63|128)}else if(a<65536){if((r-=3)<0)break;x.push(a>>12|224,a>>6&63|128,a&63|128)}else if(a<1114112){if((r-=4)<0)break;x.push(a>>18|240,a>>12&63|128,a>>6&63|128,a&63|128)}else throw new Error("Invalid code point")}return x}function ab(t){for(var r=[],a=0;a<t.length;++a)r.push(t.charCodeAt(a)&255);return r}function ib(t,r){for(var a,c,l,x=[],y=0;y<t.length&&!((r-=2)<0);++y)a=t.charCodeAt(y),c=a>>8,l=a%256,x.push(l),x.push(c);return x}function __(t){return fi.toByteArray(rb(t))}function Tr(t,r,a,c){for(var l=0;l<c&&!(l+a>=r.length||l>=t.length);++l)r[l+a]=t[l];return l}function hn(t,r){return t instanceof r||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===r.name}function Ti(t){return t!==t}var pb=function(){for(var t="0123456789abcdef",r=new Array(256),a=0;a<16;++a)for(var c=a*16,l=0;l<16;++l)r[c+l]=t[a]+t[l];return r}()});var g_=mo((UT,f_)=>{_();var me=f_.exports={},xn,yn;function wi(){throw new Error("setTimeout has not been defined")}function vi(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?xn=setTimeout:xn=wi}catch(t){xn=wi}try{typeof clearTimeout=="function"?yn=clearTimeout:yn=vi}catch(t){yn=vi}})();function l_(t){if(xn===setTimeout)return setTimeout(t,0);if((xn===wi||!xn)&&setTimeout)return xn=setTimeout,setTimeout(t,0);try{return xn(t,0)}catch(r){try{return xn.call(null,t,0)}catch(a){return xn.call(this,t,0)}}}function cb(t){if(yn===clearTimeout)return clearTimeout(t);if((yn===vi||!yn)&&clearTimeout)return yn=clearTimeout,clearTimeout(t);try{return yn(t)}catch(r){try{return yn.call(null,t)}catch(a){return yn.call(this,t)}}}var Rn=[],Nt=!1,_t,wr=-1;function sb(){!Nt||!_t||(Nt=!1,_t.length?Rn=_t.concat(Rn):wr=-1,Rn.length&&d_())}function d_(){if(!Nt){var t=l_(sb);Nt=!0;for(var r=Rn.length;r;){for(_t=Rn,Rn=[];++wr<r;)_t&&_t[wr].run();wr=-1,r=Rn.length}_t=null,Nt=!1,cb(t)}}me.nextTick=function(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)r[a-1]=arguments[a];Rn.push(new u_(t,r)),Rn.length===1&&!Nt&&l_(d_)};function u_(t,r){this.fun=t,this.array=r}u_.prototype.run=function(){this.fun.apply(null,this.array)};me.title="browser";me.browser=!0;me.env={};me.argv=[];me.version="";me.versions={};function Nn(){}me.on=Nn;me.addListener=Nn;me.once=Nn;me.off=Nn;me.removeListener=Nn;me.removeAllListeners=Nn;me.emit=Nn;me.prependListener=Nn;me.prependOnceListener=Nn;me.listeners=function(t){return[]};me.binding=function(t){throw new Error("process.binding is not supported")};me.cwd=function(){return"/"};me.chdir=function(t){throw new Error("process.chdir is not supported")};me.umask=function(){return 0}});var b,T,_b,h,_=W(()=>{b=ee(m_()),T=ee(g_()),_b=function(t){function r(){var c=this||self;return delete t.prototype.__magic__,c}if(typeof globalThis=="object")return globalThis;if(this)return r();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:r});var a=__magic__;return a}(Object),h=_b});var vr,Si=W(()=>{"use strict";_();vr=()=>Date.now()/1e3});var h_=W(()=>{"use strict";_()});var x_=W(()=>{"use strict";_()});var y_=W(()=>{"use strict";_();Si();h_();x_()});var ki={};pt(ki,{getItem:()=>lb,localStorageKeys:()=>mt,removeItem:()=>db,setItem:()=>mb});var mt,Ai,mb,lb,db,uo=W(()=>{"use strict";_();y_();mt={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Ai=typeof localStorage!="undefined",mb=({key:t,data:r,expires:a})=>{!Ai||localStorage.setItem(String(t),JSON.stringify({expires:a,data:r}))},lb=t=>{if(!Ai)return;let r=localStorage.getItem(String(t));if(!r)return null;let a=JSON.parse(r);return!a||!a.hasOwnProperty("expires")||!a.hasOwnProperty("data")?null:vr()>=a.expires?(localStorage.removeItem(String(t)),null):a.data},db=t=>{!Ai||localStorage.removeItem(String(t))}});var Ii={};pt(Ii,{clear:()=>v_,getItem:()=>T_,removeItem:()=>w_,setItem:()=>b_,storage:()=>ub});var b_,T_,w_,v_,ub,S_=W(()=>{"use strict";_();b_=({key:t,data:r,expires:a})=>{sessionStorage.setItem(String(t),JSON.stringify({expires:a,data:r}))},T_=t=>{let r=sessionStorage.getItem(String(t));if(!r)return null;let a=JSON.parse(r);return!a||!a.hasOwnProperty("expires")||!a.hasOwnProperty("data")?null:Date.now()>=a.expires?(sessionStorage.removeItem(String(t)),null):a.data},w_=t=>sessionStorage.removeItem(String(t)),v_=()=>sessionStorage.clear(),ub={setItem:b_,getItem:T_,removeItem:w_,clear:v_}});var Dt,Sr=W(()=>{"use strict";_();uo();S_();Dt={session:Ii,local:ki}});function fo(){return new Date().setHours(new Date().getHours()+24)}function go(t){Dt.local.setItem({key:mt.loginExpiresAt,data:t,expires:t})}var Ei=W(()=>{"use strict";_();Sr();uo()});var sn=W(()=>{"use strict";_()});var A_=W(()=>{"use strict";_()});var k_=W(()=>{"use strict";_()});var Le=W(()=>{"use strict";_()});var I_=W(()=>{"use strict";_()});var E_=W(()=>{"use strict";_()});var L_=W(()=>{"use strict";_()});var C_=W(()=>{"use strict";_()});var Kn=W(()=>{"use strict";_();k_();Le();sn();I_();E_();L_();C_()});var Li,R_,dw,N_,uw,D_,fw,gw,hw,P_=W(()=>{"use strict";_();Kn();Li={devnet:{id:"devnet",chainId:"D",name:"Devnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://devnet-wallet.elrond.com",apiAddress:"https://devnet-api.elrond.com",explorerAddress:"http://devnet-explorer.elrond.com",apiTimeout:"4000"},testnet:{id:"testnet",chainId:"T",name:"Testnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://testnet-wallet.elrond.com",apiAddress:"https://testnet-api.elrond.com",explorerAddress:"http://testnet-explorer.elrond.com",apiTimeout:"4000"},mainnet:{id:"mainnet",chainId:"1",name:"Mainnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://wallet.elrond.com",apiAddress:"https://api.elrond.com",explorerAddress:"https://explorer.elrond.com",apiTimeout:"4000"}},{chainId:R_,egldLabel:dw}=Li["devnet"],{chainId:N_,egldLabel:uw}=Li["testnet"],{chainId:D_,egldLabel:fw}=Li["mainnet"],gw={["devnet"]:R_,["testnet"]:N_,["mainnet"]:D_},hw={[R_]:"devnet",[N_]:"testnet",[D_]:"mainnet"}});var Ci=W(()=>{"use strict";_()});var F_=W(()=>{"use strict";_()});var O_,Ri=W(()=>{"use strict";_();O_="transaction-status-toast-id"});var Ni,Di,_n,ho,M_,Ar,B_,U_,lt,ge=W(()=>{"use strict";_();A_();P_();Ci();F_();Ri();Ni=5e4,Di=1e9,_n=18,ho=4,M_=1,Ar="logout",B_="login",U_="refundedGas",lt="0"});var Pi,Oe,kr,Xn=W(()=>{"use strict";_();Pi=require("@reduxjs/toolkit");ge();Oe=(0,Pi.createAction)(Ar),kr=(0,Pi.createAction)(B_,t=>({payload:t}))});var $_,W_,H_,Fw,Ow,Mw,Bw,Uw,Ww,G_,z_,Fi=W(()=>{"use strict";_();$_=require("@reduxjs/toolkit");Ei();sn();Xn();W_={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},H_=(0,$_.createSlice)({name:"loginInfoSlice",initialState:W_,reducers:{setLoginMethod:(t,r)=>{t.loginMethod=r.payload},setTokenLogin:(t,r)=>{t.tokenLogin=r.payload},setTokenLoginSignature:(t,r)=>{(t==null?void 0:t.tokenLogin)!=null&&(t.tokenLogin.signature=r.payload)},setWalletLogin:(t,r)=>{t.walletLogin=r.payload},setWalletConnectLogin:(t,r)=>{t.walletConnectLogin=r.payload},setLedgerLogin:(t,r)=>{t.ledgerLogin=r.payload},invalidateLoginSession:t=>{t.isLoginSessionInvalid=!0}},extraReducers:t=>{t.addCase(Oe,()=>W_),t.addCase(kr,(r,a)=>{r.loginMethod=a.payload.loginMethod,go(fo())})}}),{setLoginMethod:Fw,setWalletConnectLogin:Ow,setLedgerLogin:Mw,setTokenLogin:Bw,setTokenLoginSignature:Uw,setWalletLogin:Ww,invalidateLoginSession:G_}=H_.actions,z_=H_.reducer});var V_=W(()=>{"use strict";_()});var q_=W(()=>{"use strict";_();V_()});function Oi(t){return t[Math.floor(Math.random()*t.length)]}var K_=W(()=>{"use strict";_()});var X_=W(()=>{"use strict";_();Ci()});var Y_=W(()=>{"use strict";_();q_();K_();X_()});var Z_,J_,Mi,gb,Q_,t1,o1,j_,Bi=W(()=>{"use strict";_();Z_=require("@reduxjs/toolkit"),J_=ee(require("lodash.omit"));Y_();Mi={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},gb={network:Mi,chainID:"-1"},Q_=(0,Z_.createSlice)({name:"appConfig",initialState:gb,reducers:{initializeNetworkConfig:(t,r)=>{let a=Oi(r.payload.walletConnectBridgeAddresses),c=Oi(r.payload.walletConnectV2RelayAddresses),l=(0,J_.default)(r.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");t.network=we(Q(Q({},t.network),l),{walletConnectBridgeAddress:a,walletConnectV2RelayAddress:c})},setChainID:(t,r)=>{t.chainID=r.payload}}}),{initializeNetworkConfig:t1,setChainID:o1}=Q_.actions,j_=Q_.reducer});var Wi,em,nm,Ir,Ui,tm,om,m1,rm,l1,d1,u1,f1,g1,h1,x1,am,$i=W(()=>{"use strict";_();Wi=require("@elrondnetwork/erdjs"),em=require("@reduxjs/toolkit"),nm=require("redux-persist");ge();Sr();uo();Xn();Ir={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:lt},Ui={address:"",websocketEvent:null,accounts:{"":Ir},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},tm=(0,em.createSlice)({name:"accountInfoSlice",initialState:Ui,reducers:{setAddress:(t,r)=>{let a=r.payload;t.address=a,t.publicKey=new Wi.Address(a).hex()},setAccount:(t,r)=>{let a=t.address===r.payload.address;t.accounts={[t.address]:a?r.payload:Ir},t.isAccountLoading=!1,t.accountLoadingError=null},setAccountNonce:(t,r)=>{let{address:a}=t;t.accounts[a].nonce=r.payload},setAccountShard:(t,r)=>{t.shard=r.payload},setLedgerAccount:(t,r)=>{t.ledgerAccount=r.payload},updateLedgerAccount:(t,r)=>{t.ledgerAccount!=null&&(t.ledgerAccount.index=r.payload.index,t.ledgerAccount.address=r.payload.address)},setWalletConnectAccount:(t,r)=>{t.walletConnectAccount=r.payload},setIsAccountLoading:(t,r)=>{t.isAccountLoading=r.payload,t.accountLoadingError=null},setAccountLoadingError:(t,r)=>{t.accountLoadingError=r.payload,t.isAccountLoading=!1},setWebsocketEvent:(t,r)=>{t.websocketEvent={timestamp:Date.now(),message:r.payload}}},extraReducers:t=>{t.addCase(Oe,()=>(Dt.local.removeItem(mt.loginExpiresAt),Ui)),t.addCase(kr,(r,a)=>{let{address:c}=a.payload;r.address=c,r.publicKey=new Wi.Address(c).hex()}),t.addCase(nm.REHYDRATE,(r,a)=>{var N;if(!((N=a.payload)!=null&&N.account))return;let{account:c}=a.payload,{address:l,shard:x,accounts:y,publicKey:L}=c;r.address=l,r.shard=x;let E=y&&l in y;r.accounts=E?y:Ui.accounts,r.publicKey=L})}}),{setAccount:om,setAddress:m1,setAccountNonce:rm,setAccountShard:l1,setLedgerAccount:d1,updateLedgerAccount:u1,setWalletConnectAccount:f1,setIsAccountLoading:g1,setAccountLoadingError:h1,setWebsocketEvent:x1}=tm.actions,am=tm.reducer});function im(t){return t!=null&&(Ab(t)||Lb(t))}function Er(t){return t!=null&&(kb(t)||Cb(t))}function Lr(t){return t!=null&&(Ib(t)||Rb(t))}function pm(t){return t!=null&&Eb(t)}function Ab(t){return t!=null&&xb.includes(t)}function kb(t){return t!=null&&yb.includes(t)}function Ib(t){return t!=null&&bb.includes(t)}function Eb(t){return t!=null&&Tb.includes(t)}function Lb(t){return t!=null&&wb.includes(t)}function Cb(t){return t!=null&&vb.includes(t)}function Rb(t){return t!=null&&Sb.includes(t)}var xb,yb,bb,Tb,wb,vb,Sb,Gi=W(()=>{"use strict";_();sn();xb=["sent"],yb=["success"],bb=["fail","cancelled","timedOut"],Tb=["timedOut"],wb=["pending"],vb=["success"],Sb=["fail","invalid"]});var cm,sm,xo,Nb,_m,I1,E1,L1,C1,R1,N1,D1,P1,F1,O1,Cr,Rr=W(()=>{"use strict";_();cm=require("@reduxjs/toolkit"),sm=require("redux-persist");sn();Gi();Xn();xo={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Nb={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},_m=(0,cm.createSlice)({name:"transactionsSlice",initialState:xo,reducers:{moveTransactionsToSignedState:(t,r)=>{var E,N;let{sessionId:a,transactions:c,errorMessage:l,status:x,redirectRoute:y}=r.payload,L=((E=t.customTransactionInformationForSessionId)==null?void 0:E[a])||Nb;t.signedTransactions[a]={transactions:c,status:x,errorMessage:l,redirectRoute:y,customTransactionInformation:L},((N=t==null?void 0:t.transactionsToSign)==null?void 0:N.sessionId)===a&&(t.transactionsToSign=xo.transactionsToSign)},clearSignedTransaction:(t,r)=>{t.signedTransactions[r.payload]&&delete t.signedTransactions[r.payload]},clearTransactionToSign:t=>{t!=null&&t.transactionsToSign&&(t.transactionsToSign=null)},updateSignedTransaction:(t,r)=>{t.signedTransactions=Q(Q({},t.signedTransactions),r.payload)},updateSignedTransactions:(t,r)=>{let{sessionId:a,status:c,errorMessage:l,transactions:x}=r.payload;t.signedTransactions[a]!=null&&(t.signedTransactions[a].status=c,l!=null&&(t.signedTransactions[a].errorMessage=l),x!=null&&(t.signedTransactions[a].transactions=x))},updateSignedTransactionStatus:(t,r)=>{var L,E,N,U,P,Y;let{sessionId:a,status:c,errorMessage:l,transactionHash:x}=r.payload,y=(E=(L=t.signedTransactions)==null?void 0:L[a])==null?void 0:E.transactions;if(y!=null){t.signedTransactions[a].transactions=y.map(de=>de.hash===x?we(Q({},de),{status:c,errorMessage:l}):de);let ie=(U=(N=t.signedTransactions[a])==null?void 0:N.transactions)==null?void 0:U.every(de=>Er(de.status)),re=(Y=(P=t.signedTransactions[a])==null?void 0:P.transactions)==null?void 0:Y.every(de=>Lr(de.status));ie&&(t.signedTransactions[a].status="success"),re&&(t.signedTransactions[a].status="fail")}},setTransactionsToSign:(t,r)=>{t.transactionsToSign=r.payload;let{sessionId:a,customTransactionInformation:c}=r.payload;t.customTransactionInformationForSessionId[a]=c,t.signTransactionsError=null},clearAllTransactionsToSign:t=>{t.transactionsToSign=xo.transactionsToSign,t.signTransactionsError=null},clearAllSignedTransactions:t=>{t.signedTransactions=xo.signedTransactions},setSignTransactionsError:(t,r)=>{t.signTransactionsError=r.payload},setSignTransactionsCancelMessage:(t,r)=>{t.signTransactionsCancelMessage=r.payload}},extraReducers:t=>{t.addCase(Oe,()=>xo),t.addCase(sm.REHYDRATE,(r,a)=>{var y;if(r.signTransactionsCancelMessage=null,!((y=a.payload)!=null&&y.transactions))return;let{signedTransactions:c,customTransactionInformationForSessionId:l}=a.payload.transactions,x=Object.entries(c).reduce((L,[E,N])=>{let U=new Date(E),P=new Date;return P.setHours(P.getHours()+5),P-U>0||(L[E]=N),L},{});l!=null&&(r.customTransactionInformationForSessionId=l),c!=null&&(r.signedTransactions=x)})}}),{updateSignedTransactionStatus:I1,updateSignedTransactions:E1,setTransactionsToSign:L1,clearAllTransactionsToSign:C1,clearAllSignedTransactions:R1,clearSignedTransaction:N1,clearTransactionToSign:D1,setSignTransactionsError:P1,setSignTransactionsCancelMessage:F1,moveTransactionsToSignedState:O1}=_m.actions,Cr=_m.reducer});var mm,Vi,qi,Ki,Db,zi,lm,W1,$1,H1,Nr,Dr=W(()=>{"use strict";_();mm=require("@reduxjs/toolkit");Xn();Vi="Transaction failed",qi="Transaction successful",Ki="Processing transaction",Db="Transaction submitted",zi={},lm=(0,mm.createSlice)({name:"transactionsInfo",initialState:zi,reducers:{setTransactionsDisplayInfo(t,r){let{sessionId:a,transactionsDisplayInfo:c}=r.payload;a!=null&&(t[a]={errorMessage:(c==null?void 0:c.errorMessage)||Vi,successMessage:(c==null?void 0:c.successMessage)||qi,processingMessage:(c==null?void 0:c.processingMessage)||Ki,submittedMessage:(c==null?void 0:c.submittedMessage)||Db,transactionDuration:c==null?void 0:c.transactionDuration})},clearTransactionsInfoForSessionId(t,r){r.payload!=null&&delete t[r.payload]},clearTransactionsInfo:()=>zi},extraReducers:t=>{t.addCase(Oe,()=>zi)}}),{clearTransactionsInfo:W1,setTransactionsDisplayInfo:$1,clearTransactionsInfoForSessionId:H1}=lm.actions,Nr=lm.reducer});var um,dm,fm,q1,K1,X1,Y1,gm,Xi=W(()=>{"use strict";_();um=require("@reduxjs/toolkit");Xn();dm={},fm=(0,um.createSlice)({name:"modalsSlice",initialState:dm,reducers:{setTxSubmittedModal:(t,r)=>{t.txSubmittedModal=r.payload},setNotificationModal:(t,r)=>{t.notificationModal=r.payload},clearTxSubmittedModal:t=>{t.txSubmittedModal=void 0},clearNotificationModal:t=>{t.notificationModal=void 0}},extraReducers:t=>{t.addCase(Oe,()=>dm)}}),{setTxSubmittedModal:q1,setNotificationModal:K1,clearTxSubmittedModal:X1,clearNotificationModal:Y1}=fm.actions,gm=fm.reducer});var xm,ym,hm,bm,ov,rv,av,iv,pv,cv,Pr,Fr=W(()=>{"use strict";_();xm=require("@reduxjs/toolkit"),ym=require("redux-persist");Ri();Kn();Si();Xn();hm={customToasts:[],transactionToasts:[],failTransactionToast:null},bm=(0,xm.createSlice)({name:"toastsSlice",initialState:hm,reducers:{addCustomToast:(t,r)=>{t.customToasts.push(we(Q({},r.payload),{type:"custom",toastId:r.payload.toastId||`custom-toast-${t.customToasts.length+1}`}))},removeCustomToast:(t,r)=>{t.customToasts=t.customToasts.filter(a=>a.toastId!==r.payload)},addTransactionToast:(t,r)=>{t.transactionToasts.push({type:"transaction",startTimestamp:vr(),toastId:r.payload||`custom-toast-${t.transactionToasts.length+1}`})},removeTransactionToast:(t,r)=>{t.transactionToasts=t.transactionToasts.filter(a=>a.toastId!==r.payload)},addFailTransactionToast:(t,r)=>{t.failTransactionToast=we(Q({},r.payload),{toastId:O_})},removeFailTransactionToast:t=>{t.failTransactionToast=null}},extraReducers:t=>{t.addCase(Oe,()=>hm),t.addCase(ym.REHYDRATE,(r,a)=>{var l,x;let c=(x=(l=a.customToasts)==null?void 0:l.filter(y=>!("component"in y)))!=null?x:[];r.customToasts=c})}}),{addCustomToast:ov,removeCustomToast:rv,addTransactionToast:av,removeTransactionToast:iv,addFailTransactionToast:pv,removeFailTransactionToast:cv}=bm.actions,Pr=bm.reducer});var Pt=W(()=>{"use strict";_();Fi();Bi();$i();Rr();Dr();Xi();Fr()});var Yi=W(()=>{"use strict";_()});var Sm,vm,Am,Ev,Lv,Cv,Rv,Nv,Dv,km,Im=W(()=>{"use strict";_();Sm=require("@reduxjs/toolkit");Xn();vm={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Am=(0,Sm.createSlice)({name:"dappModalsSlice",initialState:vm,reducers:{setDappModalVisibility:(t,r)=>{t.visible=r.payload},setDappModalHeaderVisibility:(t,r)=>{t.modal.showHeader=r.payload},setDappModalFooterVisibility:(t,r)=>{t.modal.showFooter=r.payload},setDappModalHeaderText:(t,r)=>{t.modal.headerText=r.payload},setDappModalFooterText:(t,r)=>{t.modal.footerText=r.payload},setDappModalConfig:(t,r)=>{t.modal=Q({},r.payload)}},extraReducers:t=>{t.addCase(Oe,()=>vm)}}),{setDappModalVisibility:Ev,setDappModalHeaderVisibility:Lv,setDappModalFooterVisibility:Cv,setDappModalHeaderText:Rv,setDappModalFooterText:Nv,setDappModalConfig:Dv}=Am.actions,km=Am.reducer});var Em,Mb,Bb,Ft,Mr=W(()=>{"use strict";_();Em=require("@reduxjs/toolkit");Yi();$i();Im();Fi();Xi();Bi();Fr();Dr();Rr();Mb={["account"]:am,["networkConfig"]:j_,["loginInfo"]:z_,["modals"]:gm,["dappModal"]:km,["toasts"]:Pr,["transactions"]:Cr,["transactionsInfo"]:Nr},Bb=(t={})=>(0,Em.combineReducers)(Q(Q({},Mb),t)),Ft=Bb});var Rm={};pt(Rm,{default:()=>Vb});function Zi(t,r=[]){return{key:t,version:1,storage:Cm.default,blacklist:r}}var dt,Lm,Cm,Ub,Wb,$b,Hb,Gb,zb,Vb,Nm=W(()=>{"use strict";_();dt=require("redux-persist"),Lm=ee(require("redux-persist/lib/storage")),Cm=ee(require("redux-persist/lib/storage/session"));Mr();Pt();Fr();Dr();Rr();Yi();Ub={2:t=>we(Q({},t),{networkConfig:Mi})};Wb=Zi("dapp-core-transactionsInfo"),$b=Zi("dapp-core-transactions",["transactionsToSign"]),Hb=Zi("dapp-core-toasts"),Gb={key:"dapp-core-store",version:2,storage:Lm.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,dt.createMigrate)(Ub,{debug:!1})},zb={["toasts"]:(0,dt.persistReducer)(Hb,Pr),["transactions"]:(0,dt.persistReducer)($b,Cr),["transactionsInfo"]:(0,dt.persistReducer)(Wb,Nr)},Vb=(0,dt.persistReducer)(Gb,Ft(zb))});var Dm={};pt(Dm,{default:()=>qb});var qb,Pm=W(()=>{"use strict";_();Mr();qb=Ft()});var Fm={};pt(Fm,{default:()=>Xb});var je,Kb,Xb,Om=W(()=>{"use strict";_();je=require("redux-persist"),Kb=[je.FLUSH,je.REHYDRATE,je.PAUSE,je.PERSIST,je.PURGE,je.REGISTER],Xb=Kb});var Um={};pt(Um,{default:()=>Bm});function Bm(t){return(0,Mm.persistStore)(t)}var Mm,Wm=W(()=>{"use strict";_();Mm=require("redux-persist")});var vl=mo((Wt,bo)=>{_();(function(){var t,r="4.17.21",a=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",x="Invalid `variable` option passed into `_.template`",y="__lodash_hash_undefined__",L=500,E="__lodash_placeholder__",N=1,U=2,P=4,Y=1,ie=2,re=1,de=2,vo=4,en=8,nn=16,ve=32,he=64,Ce=128,mn=256,$t=512,zr=30,Rl="...",Nl=800,Dl=16,dp=1,Pl=2,Fl=3,Jn=1/0,On=9007199254740991,Ol=17976931348623157e292,So=0/0,ln=4294967295,Ml=ln-1,Bl=ln>>>1,Ul=[["ary",Ce],["bind",re],["bindKey",de],["curry",en],["curryRight",nn],["flip",$t],["partial",ve],["partialRight",he],["rearg",mn]],ft="[object Arguments]",Ao="[object Array]",Wl="[object AsyncFunction]",Ht="[object Boolean]",Gt="[object Date]",$l="[object DOMException]",ko="[object Error]",Io="[object Function]",up="[object GeneratorFunction]",tn="[object Map]",zt="[object Number]",Hl="[object Null]",bn="[object Object]",fp="[object Promise]",Gl="[object Proxy]",Vt="[object RegExp]",on="[object Set]",qt="[object String]",Eo="[object Symbol]",zl="[object Undefined]",Kt="[object WeakMap]",Vl="[object WeakSet]",Xt="[object ArrayBuffer]",gt="[object DataView]",Vr="[object Float32Array]",qr="[object Float64Array]",Kr="[object Int8Array]",Xr="[object Int16Array]",Yr="[object Int32Array]",Zr="[object Uint8Array]",Jr="[object Uint8ClampedArray]",Qr="[object Uint16Array]",jr="[object Uint32Array]",ql=/\b__p \+= '';/g,Kl=/\b(__p \+=) '' \+/g,Xl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,gp=/&(?:amp|lt|gt|quot|#39);/g,hp=/[&<>"']/g,Yl=RegExp(gp.source),Zl=RegExp(hp.source),Jl=/<%-([\s\S]+?)%>/g,Ql=/<%([\s\S]+?)%>/g,xp=/<%=([\s\S]+?)%>/g,jl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ed=/^\w*$/,nd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ea=/[\\^$.*+?()[\]{}|]/g,td=RegExp(ea.source),na=/^\s+/,od=/\s/,rd=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ad=/\{\n\/\* \[wrapped with (.+)\] \*/,id=/,? & /,pd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,cd=/[()=,{}\[\]\/\s]/,sd=/\\(\\)?/g,_d=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yp=/\w*$/,md=/^[-+]0x[0-9a-f]+$/i,ld=/^0b[01]+$/i,dd=/^\[object .+?Constructor\]$/,ud=/^0o[0-7]+$/i,fd=/^(?:0|[1-9]\d*)$/,gd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Lo=/($^)/,hd=/['\n\r\u2028\u2029\\]/g,Co="\\ud800-\\udfff",xd="\\u0300-\\u036f",yd="\\ufe20-\\ufe2f",bd="\\u20d0-\\u20ff",bp=xd+yd+bd,Tp="\\u2700-\\u27bf",wp="a-z\\xdf-\\xf6\\xf8-\\xff",Td="\\xac\\xb1\\xd7\\xf7",wd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vd="\\u2000-\\u206f",Sd=" \\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",vp="A-Z\\xc0-\\xd6\\xd8-\\xde",Sp="\\ufe0e\\ufe0f",Ap=Td+wd+vd+Sd,ta="['\u2019]",Ad="["+Co+"]",kp="["+Ap+"]",Ro="["+bp+"]",Ip="\\d+",kd="["+Tp+"]",Ep="["+wp+"]",Lp="[^"+Co+Ap+Ip+Tp+wp+vp+"]",oa="\\ud83c[\\udffb-\\udfff]",Id="(?:"+Ro+"|"+oa+")",Cp="[^"+Co+"]",ra="(?:\\ud83c[\\udde6-\\uddff]){2}",aa="[\\ud800-\\udbff][\\udc00-\\udfff]",ht="["+vp+"]",Rp="\\u200d",Np="(?:"+Ep+"|"+Lp+")",Ed="(?:"+ht+"|"+Lp+")",Dp="(?:"+ta+"(?:d|ll|m|re|s|t|ve))?",Pp="(?:"+ta+"(?:D|LL|M|RE|S|T|VE))?",Fp=Id+"?",Op="["+Sp+"]?",Ld="(?:"+Rp+"(?:"+[Cp,ra,aa].join("|")+")"+Op+Fp+")*",Cd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Mp=Op+Fp+Ld,Nd="(?:"+[kd,ra,aa].join("|")+")"+Mp,Dd="(?:"+[Cp+Ro+"?",Ro,ra,aa,Ad].join("|")+")",Pd=RegExp(ta,"g"),Fd=RegExp(Ro,"g"),ia=RegExp(oa+"(?="+oa+")|"+Dd+Mp,"g"),Od=RegExp([ht+"?"+Ep+"+"+Dp+"(?="+[kp,ht,"$"].join("|")+")",Ed+"+"+Pp+"(?="+[kp,ht+Np,"$"].join("|")+")",ht+"?"+Np+"+"+Dp,ht+"+"+Pp,Rd,Cd,Ip,Nd].join("|"),"g"),Md=RegExp("["+Rp+Co+bp+Sp+"]"),Bd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ud=["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"],Wd=-1,oe={};oe[Vr]=oe[qr]=oe[Kr]=oe[Xr]=oe[Yr]=oe[Zr]=oe[Jr]=oe[Qr]=oe[jr]=!0,oe[ft]=oe[Ao]=oe[Xt]=oe[Ht]=oe[gt]=oe[Gt]=oe[ko]=oe[Io]=oe[tn]=oe[zt]=oe[bn]=oe[Vt]=oe[on]=oe[qt]=oe[Kt]=!1;var te={};te[ft]=te[Ao]=te[Xt]=te[gt]=te[Ht]=te[Gt]=te[Vr]=te[qr]=te[Kr]=te[Xr]=te[Yr]=te[tn]=te[zt]=te[bn]=te[Vt]=te[on]=te[qt]=te[Eo]=te[Zr]=te[Jr]=te[Qr]=te[jr]=!0,te[ko]=te[Io]=te[Kt]=!1;var $d={\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",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED