UNPKG

@sofaws/dapp-core

Version:

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

1 lines 249 kB
"use strict";var zy=Object.create;var xo=Object.defineProperty,Vy=Object.defineProperties,qy=Object.getOwnPropertyDescriptor,Ky=Object.getOwnPropertyDescriptors,Xy=Object.getOwnPropertyNames,wr=Object.getOwnPropertySymbols,Zy=Object.getPrototypeOf,Ai=Object.prototype.hasOwnProperty,sm=Object.prototype.propertyIsEnumerable;var cm=(t,r,a)=>r in t?xo(t,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[r]=a,J=(t,r)=>{for(var a in r||(r={}))Ai.call(r,a)&&cm(t,a,r[a]);if(wr)for(var a of wr(r))sm.call(r,a)&&cm(t,a,r[a]);return t},fe=(t,r)=>Vy(t,Ky(r));var Rt=(t,r)=>{var a={};for(var s in t)Ai.call(t,s)&&r.indexOf(s)<0&&(a[s]=t[s]);if(t!=null&&wr)for(var s of wr(t))r.indexOf(s)<0&&sm.call(t,s)&&(a[s]=t[s]);return a};var W=(t,r)=>()=>(t&&(r=t(t=0)),r);var yo=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),it=(t,r)=>{for(var a in r)xo(t,a,{get:r[a],enumerable:!0})},mm=(t,r,a,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of Xy(r))!Ai.call(t,l)&&l!==a&&xo(t,l,{get:()=>r[l],enumerable:!(s=qy(r,l))||s.enumerable});return t};var C=(t,r,a)=>(a=t!=null?zy(Zy(t)):{},mm(r||!t||!t.__esModule?xo(a,"default",{value:t,enumerable:!0}):a,t)),bo=t=>mm(xo({},"__esModule",{value:!0}),t);var Pt=(t,r,a)=>new Promise((s,l)=>{var b=E=>{try{L(a.next(E))}catch(R){l(R)}},T=E=>{try{L(a.throw(E))}catch(R){l(R)}},L=E=>E.done?s(E.value):Promise.resolve(E.value).then(b,T);L((a=a.apply(t,r)).next())});var dm=yo(vr=>{"use strict";c();vr.byteLength=Jy;vr.toByteArray=jy;vr.fromByteArray=tb;var ln=[],Ye=[],Yy=typeof Uint8Array!="undefined"?Uint8Array:Array,ki="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(pt=0,_m=ki.length;pt<_m;++pt)ln[pt]=ki[pt],Ye[ki.charCodeAt(pt)]=pt;var pt,_m;Ye["-".charCodeAt(0)]=62;Ye["_".charCodeAt(0)]=63;function lm(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 s=a===r?0:4-a%4;return[a,s]}function Jy(t){var r=lm(t),a=r[0],s=r[1];return(a+s)*3/4-s}function Qy(t,r,a){return(r+a)*3/4-a}function jy(t){var r,a=lm(t),s=a[0],l=a[1],b=new Yy(Qy(t,s,l)),T=0,L=l>0?s-4:s,E;for(E=0;E<L;E+=4)r=Ye[t.charCodeAt(E)]<<18|Ye[t.charCodeAt(E+1)]<<12|Ye[t.charCodeAt(E+2)]<<6|Ye[t.charCodeAt(E+3)],b[T++]=r>>16&255,b[T++]=r>>8&255,b[T++]=r&255;return l===2&&(r=Ye[t.charCodeAt(E)]<<2|Ye[t.charCodeAt(E+1)]>>4,b[T++]=r&255),l===1&&(r=Ye[t.charCodeAt(E)]<<10|Ye[t.charCodeAt(E+1)]<<4|Ye[t.charCodeAt(E+2)]>>2,b[T++]=r>>8&255,b[T++]=r&255),b}function eb(t){return ln[t>>18&63]+ln[t>>12&63]+ln[t>>6&63]+ln[t&63]}function nb(t,r,a){for(var s,l=[],b=r;b<a;b+=3)s=(t[b]<<16&16711680)+(t[b+1]<<8&65280)+(t[b+2]&255),l.push(eb(s));return l.join("")}function tb(t){for(var r,a=t.length,s=a%3,l=[],b=16383,T=0,L=a-s;T<L;T+=b)l.push(nb(t,T,T+b>L?L:T+b));return s===1?(r=t[a-1],l.push(ln[r>>2]+ln[r<<4&63]+"==")):s===2&&(r=(t[a-2]<<8)+t[a-1],l.push(ln[r>>10]+ln[r>>4&63]+ln[r<<2&63]+"=")),l.join("")}});var um=yo(Ii=>{c();Ii.read=function(t,r,a,s,l){var b,T,L=l*8-s-1,E=(1<<L)-1,R=E>>1,G=-7,O=a?l-1:0,ie=a?-1:1,ue=t[r+O];for(O+=ie,b=ue&(1<<-G)-1,ue>>=-G,G+=L;G>0;b=b*256+t[r+O],O+=ie,G-=8);for(T=b&(1<<-G)-1,b>>=-G,G+=s;G>0;T=T*256+t[r+O],O+=ie,G-=8);if(b===0)b=1-R;else{if(b===E)return T?NaN:(ue?-1:1)*(1/0);T=T+Math.pow(2,s),b=b-R}return(ue?-1:1)*T*Math.pow(2,b-s)};Ii.write=function(t,r,a,s,l,b){var T,L,E,R=b*8-l-1,G=(1<<R)-1,O=G>>1,ie=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,ue=s?0:b-1,ce=s?1:-1,Te=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(L=isNaN(r)?1:0,T=G):(T=Math.floor(Math.log(r)/Math.LN2),r*(E=Math.pow(2,-T))<1&&(T--,E*=2),T+O>=1?r+=ie/E:r+=ie*Math.pow(2,1-O),r*E>=2&&(T++,E/=2),T+O>=G?(L=0,T=G):T+O>=1?(L=(r*E-1)*Math.pow(2,l),T=T+O):(L=r*Math.pow(2,O-1)*Math.pow(2,l),T=0));l>=8;t[a+ue]=L&255,ue+=ce,L/=256,l-=8);for(T=T<<l|L,R+=l;R>0;t[a+ue]=T&255,ue+=ce,T/=256,R-=8);t[a+ue-ce]|=Te*128}});var Im=yo(Ot=>{"use strict";c();var Ei=dm(),Ft=um(),fm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ot.Buffer=S;Ot.SlowBuffer=cb;Ot.INSPECT_MAX_BYTES=50;var Sr=2147483647;Ot.kMaxLength=Sr;S.TYPED_ARRAY_SUPPORT=ob();!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 ob(){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 En(t){if(t>Sr)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 Di(t)}return xm(t,r,a)}S.poolSize=8192;function xm(t,r,a){if(typeof t=="string")return ab(t,r);if(ArrayBuffer.isView(t))return ib(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(dn(t,ArrayBuffer)||t&&dn(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(dn(t,SharedArrayBuffer)||t&&dn(t.buffer,SharedArrayBuffer)))return Ni(t,r,a);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var s=t.valueOf&&t.valueOf();if(s!=null&&s!==t)return S.from(s,r,a);var l=pb(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 xm(t,r,a)};Object.setPrototypeOf(S.prototype,Uint8Array.prototype);Object.setPrototypeOf(S,Uint8Array);function ym(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 rb(t,r,a){return ym(t),t<=0?En(t):r!==void 0?typeof a=="string"?En(t).fill(r,a):En(t).fill(r):En(t)}S.alloc=function(t,r,a){return rb(t,r,a)};function Di(t){return ym(t),En(t<0?0:Ri(t)|0)}S.allocUnsafe=function(t){return Di(t)};S.allocUnsafeSlow=function(t){return Di(t)};function ab(t,r){if((typeof r!="string"||r==="")&&(r="utf8"),!S.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var a=bm(t,r)|0,s=En(a),l=s.write(t,r);return l!==a&&(s=s.slice(0,l)),s}function Li(t){for(var r=t.length<0?0:Ri(t.length)|0,a=En(r),s=0;s<r;s+=1)a[s]=t[s]&255;return a}function ib(t){if(dn(t,Uint8Array)){var r=new Uint8Array(t);return Ni(r.buffer,r.byteOffset,r.byteLength)}return Li(t)}function Ni(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 s;return r===void 0&&a===void 0?s=new Uint8Array(t):a===void 0?s=new Uint8Array(t,r):s=new Uint8Array(t,r,a),Object.setPrototypeOf(s,S.prototype),s}function pb(t){if(S.isBuffer(t)){var r=Ri(t.length)|0,a=En(r);return a.length===0||t.copy(a,0,0,r),a}if(t.length!==void 0)return typeof t.length!="number"||Pi(t.length)?En(0):Li(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Li(t.data)}function Ri(t){if(t>=Sr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Sr.toString(16)+" bytes");return t|0}function cb(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(dn(r,Uint8Array)&&(r=S.from(r,r.offset,r.byteLength)),dn(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 s=r.length,l=a.length,b=0,T=Math.min(s,l);b<T;++b)if(r[b]!==a[b]){s=r[b],l=a[b];break}return s<l?-1:l<s?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 s;if(a===void 0)for(a=0,s=0;s<r.length;++s)a+=r[s].length;var l=S.allocUnsafe(a),b=0;for(s=0;s<r.length;++s){var T=r[s];if(dn(T,Uint8Array))b+T.length>l.length?S.from(T).copy(l,b):Uint8Array.prototype.set.call(l,T,b);else if(S.isBuffer(T))T.copy(l,b);else throw new TypeError('"list" argument must be an Array of Buffers');b+=T.length}return l};function bm(t,r){if(S.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||dn(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,s=arguments.length>2&&arguments[2]===!0;if(!s&&a===0)return 0;for(var l=!1;;)switch(r){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return Ci(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a*2;case"hex":return a>>>1;case"base64":return km(t).length;default:if(l)return s?-1:Ci(t).length;r=(""+r).toLowerCase(),l=!0}}S.byteLength=bm;function sb(t,r,a){var s=!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 yb(this,r,a);case"utf8":case"utf-8":return wm(this,r,a);case"ascii":return hb(this,r,a);case"latin1":case"binary":return xb(this,r,a);case"base64":return fb(this,r,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bb(this,r,a);default:if(s)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}S.prototype._isBuffer=!0;function ct(t,r,a){var s=t[r];t[r]=t[a],t[a]=s}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)ct(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)ct(this,a,a+3),ct(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)ct(this,a,a+7),ct(this,a+1,a+6),ct(this,a+2,a+5),ct(this,a+3,a+4);return this};S.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?wm(this,0,r):sb.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=Ot.INSPECT_MAX_BYTES;return r=this.toString("hex",0,a).replace(/(.{2})/g,"$1 ").trim(),this.length>a&&(r+=" ... "),"<Buffer "+r+">"};fm&&(S.prototype[fm]=S.prototype.inspect);S.prototype.compare=function(r,a,s,l,b){if(dn(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),s===void 0&&(s=r?r.length:0),l===void 0&&(l=0),b===void 0&&(b=this.length),a<0||s>r.length||l<0||b>this.length)throw new RangeError("out of range index");if(l>=b&&a>=s)return 0;if(l>=b)return-1;if(a>=s)return 1;if(a>>>=0,s>>>=0,l>>>=0,b>>>=0,this===r)return 0;for(var T=b-l,L=s-a,E=Math.min(T,L),R=this.slice(l,b),G=r.slice(a,s),O=0;O<E;++O)if(R[O]!==G[O]){T=R[O],L=G[O];break}return T<L?-1:L<T?1:0};function Tm(t,r,a,s,l){if(t.length===0)return-1;if(typeof a=="string"?(s=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,Pi(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,s)),S.isBuffer(r))return r.length===0?-1:gm(t,r,a,s,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):gm(t,[r],a,s,l);throw new TypeError("val must be string, number or Buffer")}function gm(t,r,a,s,l){var b=1,T=t.length,L=r.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(t.length<2||r.length<2)return-1;b=2,T/=2,L/=2,a/=2}function E(ue,ce){return b===1?ue[ce]:ue.readUInt16BE(ce*b)}var R;if(l){var G=-1;for(R=a;R<T;R++)if(E(t,R)===E(r,G===-1?0:R-G)){if(G===-1&&(G=R),R-G+1===L)return G*b}else G!==-1&&(R-=R-G),G=-1}else for(a+L>T&&(a=T-L),R=a;R>=0;R--){for(var O=!0,ie=0;ie<L;ie++)if(E(t,R+ie)!==E(r,ie)){O=!1;break}if(O)return R}return-1}S.prototype.includes=function(r,a,s){return this.indexOf(r,a,s)!==-1};S.prototype.indexOf=function(r,a,s){return Tm(this,r,a,s,!0)};S.prototype.lastIndexOf=function(r,a,s){return Tm(this,r,a,s,!1)};function mb(t,r,a,s){a=Number(a)||0;var l=t.length-a;s?(s=Number(s),s>l&&(s=l)):s=l;var b=r.length;s>b/2&&(s=b/2);for(var T=0;T<s;++T){var L=parseInt(r.substr(T*2,2),16);if(Pi(L))return T;t[a+T]=L}return T}function _b(t,r,a,s){return Ar(Ci(r,t.length-a),t,a,s)}function lb(t,r,a,s){return Ar(vb(r),t,a,s)}function db(t,r,a,s){return Ar(km(r),t,a,s)}function ub(t,r,a,s){return Ar(Sb(r,t.length-a),t,a,s)}S.prototype.write=function(r,a,s,l){if(a===void 0)l="utf8",s=this.length,a=0;else if(s===void 0&&typeof a=="string")l=a,s=this.length,a=0;else if(isFinite(a))a=a>>>0,isFinite(s)?(s=s>>>0,l===void 0&&(l="utf8")):(l=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var b=this.length-a;if((s===void 0||s>b)&&(s=b),r.length>0&&(s<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");l||(l="utf8");for(var T=!1;;)switch(l){case"hex":return mb(this,r,a,s);case"utf8":case"utf-8":return _b(this,r,a,s);case"ascii":case"latin1":case"binary":return lb(this,r,a,s);case"base64":return db(this,r,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ub(this,r,a,s);default:if(T)throw new TypeError("Unknown encoding: "+l);l=(""+l).toLowerCase(),T=!0}};S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function fb(t,r,a){return r===0&&a===t.length?Ei.fromByteArray(t):Ei.fromByteArray(t.slice(r,a))}function wm(t,r,a){a=Math.min(t.length,a);for(var s=[],l=r;l<a;){var b=t[l],T=null,L=b>239?4:b>223?3:b>191?2:1;if(l+L<=a){var E,R,G,O;switch(L){case 1:b<128&&(T=b);break;case 2:E=t[l+1],(E&192)===128&&(O=(b&31)<<6|E&63,O>127&&(T=O));break;case 3:E=t[l+1],R=t[l+2],(E&192)===128&&(R&192)===128&&(O=(b&15)<<12|(E&63)<<6|R&63,O>2047&&(O<55296||O>57343)&&(T=O));break;case 4:E=t[l+1],R=t[l+2],G=t[l+3],(E&192)===128&&(R&192)===128&&(G&192)===128&&(O=(b&15)<<18|(E&63)<<12|(R&63)<<6|G&63,O>65535&&O<1114112&&(T=O))}}T===null?(T=65533,L=1):T>65535&&(T-=65536,s.push(T>>>10&1023|55296),T=56320|T&1023),s.push(T),l+=L}return gb(s)}var hm=4096;function gb(t){var r=t.length;if(r<=hm)return String.fromCharCode.apply(String,t);for(var a="",s=0;s<r;)a+=String.fromCharCode.apply(String,t.slice(s,s+=hm));return a}function hb(t,r,a){var s="";a=Math.min(t.length,a);for(var l=r;l<a;++l)s+=String.fromCharCode(t[l]&127);return s}function xb(t,r,a){var s="";a=Math.min(t.length,a);for(var l=r;l<a;++l)s+=String.fromCharCode(t[l]);return s}function yb(t,r,a){var s=t.length;(!r||r<0)&&(r=0),(!a||a<0||a>s)&&(a=s);for(var l="",b=r;b<a;++b)l+=Ab[t[b]];return l}function bb(t,r,a){for(var s=t.slice(r,a),l="",b=0;b<s.length-1;b+=2)l+=String.fromCharCode(s[b]+s[b+1]*256);return l}S.prototype.slice=function(r,a){var s=this.length;r=~~r,a=a===void 0?s:~~a,r<0?(r+=s,r<0&&(r=0)):r>s&&(r=s),a<0?(a+=s,a<0&&(a=0)):a>s&&(a=s),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,s){r=r>>>0,a=a>>>0,s||be(r,a,this.length);for(var l=this[r],b=1,T=0;++T<a&&(b*=256);)l+=this[r+T]*b;return l};S.prototype.readUintBE=S.prototype.readUIntBE=function(r,a,s){r=r>>>0,a=a>>>0,s||be(r,a,this.length);for(var l=this[r+--a],b=1;a>0&&(b*=256);)l+=this[r+--a]*b;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,s){r=r>>>0,a=a>>>0,s||be(r,a,this.length);for(var l=this[r],b=1,T=0;++T<a&&(b*=256);)l+=this[r+T]*b;return b*=128,l>=b&&(l-=Math.pow(2,8*a)),l};S.prototype.readIntBE=function(r,a,s){r=r>>>0,a=a>>>0,s||be(r,a,this.length);for(var l=a,b=1,T=this[r+--l];l>0&&(b*=256);)T+=this[r+--l]*b;return b*=128,T>=b&&(T-=Math.pow(2,8*a)),T};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 s=this[r]|this[r+1]<<8;return s&32768?s|4294901760:s};S.prototype.readInt16BE=function(r,a){r=r>>>0,a||be(r,2,this.length);var s=this[r+1]|this[r]<<8;return s&32768?s|4294901760:s};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),Ft.read(this,r,!0,23,4)};S.prototype.readFloatBE=function(r,a){return r=r>>>0,a||be(r,4,this.length),Ft.read(this,r,!1,23,4)};S.prototype.readDoubleLE=function(r,a){return r=r>>>0,a||be(r,8,this.length),Ft.read(this,r,!0,52,8)};S.prototype.readDoubleBE=function(r,a){return r=r>>>0,a||be(r,8,this.length),Ft.read(this,r,!1,52,8)};function Re(t,r,a,s,l,b){if(!S.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>l||r<b)throw new RangeError('"value" argument is out of bounds');if(a+s>t.length)throw new RangeError("Index out of range")}S.prototype.writeUintLE=S.prototype.writeUIntLE=function(r,a,s,l){if(r=+r,a=a>>>0,s=s>>>0,!l){var b=Math.pow(2,8*s)-1;Re(this,r,a,s,b,0)}var T=1,L=0;for(this[a]=r&255;++L<s&&(T*=256);)this[a+L]=r/T&255;return a+s};S.prototype.writeUintBE=S.prototype.writeUIntBE=function(r,a,s,l){if(r=+r,a=a>>>0,s=s>>>0,!l){var b=Math.pow(2,8*s)-1;Re(this,r,a,s,b,0)}var T=s-1,L=1;for(this[a+T]=r&255;--T>=0&&(L*=256);)this[a+T]=r/L&255;return a+s};S.prototype.writeUint8=S.prototype.writeUInt8=function(r,a,s){return r=+r,a=a>>>0,s||Re(this,r,a,1,255,0),this[a]=r&255,a+1};S.prototype.writeUint16LE=S.prototype.writeUInt16LE=function(r,a,s){return r=+r,a=a>>>0,s||Re(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,s){return r=+r,a=a>>>0,s||Re(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,s){return r=+r,a=a>>>0,s||Re(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,s){return r=+r,a=a>>>0,s||Re(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,s,l){if(r=+r,a=a>>>0,!l){var b=Math.pow(2,8*s-1);Re(this,r,a,s,b-1,-b)}var T=0,L=1,E=0;for(this[a]=r&255;++T<s&&(L*=256);)r<0&&E===0&&this[a+T-1]!==0&&(E=1),this[a+T]=(r/L>>0)-E&255;return a+s};S.prototype.writeIntBE=function(r,a,s,l){if(r=+r,a=a>>>0,!l){var b=Math.pow(2,8*s-1);Re(this,r,a,s,b-1,-b)}var T=s-1,L=1,E=0;for(this[a+T]=r&255;--T>=0&&(L*=256);)r<0&&E===0&&this[a+T+1]!==0&&(E=1),this[a+T]=(r/L>>0)-E&255;return a+s};S.prototype.writeInt8=function(r,a,s){return r=+r,a=a>>>0,s||Re(this,r,a,1,127,-128),r<0&&(r=255+r+1),this[a]=r&255,a+1};S.prototype.writeInt16LE=function(r,a,s){return r=+r,a=a>>>0,s||Re(this,r,a,2,32767,-32768),this[a]=r&255,this[a+1]=r>>>8,a+2};S.prototype.writeInt16BE=function(r,a,s){return r=+r,a=a>>>0,s||Re(this,r,a,2,32767,-32768),this[a]=r>>>8,this[a+1]=r&255,a+2};S.prototype.writeInt32LE=function(r,a,s){return r=+r,a=a>>>0,s||Re(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,s){return r=+r,a=a>>>0,s||Re(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 vm(t,r,a,s,l,b){if(a+s>t.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function Sm(t,r,a,s,l){return r=+r,a=a>>>0,l||vm(t,r,a,4,34028234663852886e22,-34028234663852886e22),Ft.write(t,r,a,s,23,4),a+4}S.prototype.writeFloatLE=function(r,a,s){return Sm(this,r,a,!0,s)};S.prototype.writeFloatBE=function(r,a,s){return Sm(this,r,a,!1,s)};function Am(t,r,a,s,l){return r=+r,a=a>>>0,l||vm(t,r,a,8,17976931348623157e292,-17976931348623157e292),Ft.write(t,r,a,s,52,8),a+8}S.prototype.writeDoubleLE=function(r,a,s){return Am(this,r,a,!0,s)};S.prototype.writeDoubleBE=function(r,a,s){return Am(this,r,a,!1,s)};S.prototype.copy=function(r,a,s,l){if(!S.isBuffer(r))throw new TypeError("argument should be a Buffer");if(s||(s=0),!l&&l!==0&&(l=this.length),a>=r.length&&(a=r.length),a||(a=0),l>0&&l<s&&(l=s),l===s||r.length===0||this.length===0)return 0;if(a<0)throw new RangeError("targetStart out of bounds");if(s<0||s>=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-s&&(l=r.length-a+s);var b=l-s;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(a,s,l):Uint8Array.prototype.set.call(r,this.subarray(s,l),a),b};S.prototype.fill=function(r,a,s,l){if(typeof r=="string"){if(typeof a=="string"?(l=a,a=0,s=this.length):typeof s=="string"&&(l=s,s=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 b=r.charCodeAt(0);(l==="utf8"&&b<128||l==="latin1")&&(r=b)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(a<0||this.length<a||this.length<s)throw new RangeError("Out of range index");if(s<=a)return this;a=a>>>0,s=s===void 0?this.length:s>>>0,r||(r=0);var T;if(typeof r=="number")for(T=a;T<s;++T)this[T]=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(T=0;T<s-a;++T)this[T+a]=L[T%E]}return this};var Tb=/[^+/0-9A-Za-z-_]/g;function wb(t){if(t=t.split("=")[0],t=t.trim().replace(Tb,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ci(t,r){r=r||1/0;for(var a,s=t.length,l=null,b=[],T=0;T<s;++T){if(a=t.charCodeAt(T),a>55295&&a<57344){if(!l){if(a>56319){(r-=3)>-1&&b.push(239,191,189);continue}else if(T+1===s){(r-=3)>-1&&b.push(239,191,189);continue}l=a;continue}if(a<56320){(r-=3)>-1&&b.push(239,191,189),l=a;continue}a=(l-55296<<10|a-56320)+65536}else l&&(r-=3)>-1&&b.push(239,191,189);if(l=null,a<128){if((r-=1)<0)break;b.push(a)}else if(a<2048){if((r-=2)<0)break;b.push(a>>6|192,a&63|128)}else if(a<65536){if((r-=3)<0)break;b.push(a>>12|224,a>>6&63|128,a&63|128)}else if(a<1114112){if((r-=4)<0)break;b.push(a>>18|240,a>>12&63|128,a>>6&63|128,a&63|128)}else throw new Error("Invalid code point")}return b}function vb(t){for(var r=[],a=0;a<t.length;++a)r.push(t.charCodeAt(a)&255);return r}function Sb(t,r){for(var a,s,l,b=[],T=0;T<t.length&&!((r-=2)<0);++T)a=t.charCodeAt(T),s=a>>8,l=a%256,b.push(l),b.push(s);return b}function km(t){return Ei.toByteArray(wb(t))}function Ar(t,r,a,s){for(var l=0;l<s&&!(l+a>=r.length||l>=t.length);++l)r[l+a]=t[l];return l}function dn(t,r){return t instanceof r||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===r.name}function Pi(t){return t!==t}var Ab=function(){for(var t="0123456789abcdef",r=new Array(256),a=0;a<16;++a)for(var s=a*16,l=0;l<16;++l)r[s+l]=t[a]+t[l];return r}()});var Dm=yo((y1,Cm)=>{c();var _e=Cm.exports={},un,fn;function Fi(){throw new Error("setTimeout has not been defined")}function Oi(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?un=setTimeout:un=Fi}catch(t){un=Fi}try{typeof clearTimeout=="function"?fn=clearTimeout:fn=Oi}catch(t){fn=Oi}})();function Em(t){if(un===setTimeout)return setTimeout(t,0);if((un===Fi||!un)&&setTimeout)return un=setTimeout,setTimeout(t,0);try{return un(t,0)}catch(r){try{return un.call(null,t,0)}catch(a){return un.call(this,t,0)}}}function kb(t){if(fn===clearTimeout)return clearTimeout(t);if((fn===Oi||!fn)&&clearTimeout)return fn=clearTimeout,clearTimeout(t);try{return fn(t)}catch(r){try{return fn.call(null,t)}catch(a){return fn.call(this,t)}}}var Ln=[],Mt=!1,st,kr=-1;function Ib(){!Mt||!st||(Mt=!1,st.length?Ln=st.concat(Ln):kr=-1,Ln.length&&Lm())}function Lm(){if(!Mt){var t=Em(Ib);Mt=!0;for(var r=Ln.length;r;){for(st=Ln,Ln=[];++kr<r;)st&&st[kr].run();kr=-1,r=Ln.length}st=null,Mt=!1,kb(t)}}_e.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];Ln.push(new Nm(t,r)),Ln.length===1&&!Mt&&Em(Lm)};function Nm(t,r){this.fun=t,this.array=r}Nm.prototype.run=function(){this.fun.apply(null,this.array)};_e.title="browser";_e.browser=!0;_e.env={};_e.argv=[];_e.version="";_e.versions={};function Nn(){}_e.on=Nn;_e.addListener=Nn;_e.once=Nn;_e.off=Nn;_e.removeListener=Nn;_e.removeAllListeners=Nn;_e.emit=Nn;_e.prependListener=Nn;_e.prependOnceListener=Nn;_e.listeners=function(t){return[]};_e.binding=function(t){throw new Error("process.binding is not supported")};_e.cwd=function(){return"/"};_e.chdir=function(t){throw new Error("process.chdir is not supported")};_e.umask=function(){return 0}});var g,h,Eb,f,c=W(()=>{g=C(Im()),h=C(Dm()),Eb=function(t){function r(){var s=this||self;return delete t.prototype.__magic__,s}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),f=Eb});var Er,Bi=W(()=>{"use strict";c();Er=()=>Date.now()/1e3});var Mm=W(()=>{"use strict";c()});var Bm=W(()=>{"use strict";c()});var Um=W(()=>{"use strict";c();Bi();Mm();Bm()});var Wi={};it(Wi,{getItem:()=>Db,localStorageKeys:()=>mt,removeItem:()=>Rb,setItem:()=>Cb});var mt,Ui,Cb,Db,Rb,To=W(()=>{"use strict";c();Um();mt={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Ui=typeof localStorage!="undefined",Cb=({key:t,data:r,expires:a})=>{!Ui||localStorage.setItem(String(t),JSON.stringify({expires:a,data:r}))},Db=t=>{if(!Ui)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:Er()>=a.expires?(localStorage.removeItem(String(t)),null):a.data},Rb=t=>{!Ui||localStorage.removeItem(String(t))}});var $i={};it($i,{clear:()=>Gm,getItem:()=>$m,removeItem:()=>Hm,setItem:()=>Wm,storage:()=>Pb});var Wm,$m,Hm,Gm,Pb,zm=W(()=>{"use strict";c();Wm=({key:t,data:r,expires:a})=>{sessionStorage.setItem(String(t),JSON.stringify({expires:a,data:r}))},$m=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},Hm=t=>sessionStorage.removeItem(String(t)),Gm=()=>sessionStorage.clear(),Pb={setItem:Wm,getItem:$m,removeItem:Hm,clear:Gm}});var Ut,Lr=W(()=>{"use strict";c();To();zm();Ut={session:$i,local:Wi}});function wo(){return new Date().setHours(new Date().getHours()+24)}function vo(t){Ut.local.setItem({key:mt.loginExpiresAt,data:t,expires:t})}var Hi=W(()=>{"use strict";c();Lr();To()});var rn=W(()=>{"use strict";c()});var Vm=W(()=>{"use strict";c()});var qm=W(()=>{"use strict";c()});var ve=W(()=>{"use strict";c()});var Km=W(()=>{"use strict";c()});var Xm=W(()=>{"use strict";c()});var Zm=W(()=>{"use strict";c()});var Ym=W(()=>{"use strict";c()});var Vn=W(()=>{"use strict";c();qm();ve();rn();Km();Xm();Zm();Ym()});var Gi,Jm,j1,Qm,ev,jm,Fb,nv,tv,e_=W(()=>{"use strict";c();Vn();Gi={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:Jm,egldLabel:j1}=Gi["devnet"],{chainId:Qm,egldLabel:ev}=Gi["testnet"],{chainId:jm,egldLabel:Fb}=Gi["mainnet"],nv={["devnet"]:Jm,["testnet"]:Qm,["mainnet"]:jm},tv={[Jm]:"devnet",[Qm]:"testnet",[jm]:"mainnet"}});var zi=W(()=>{"use strict";c()});var n_=W(()=>{"use strict";c()});var t_,Vi=W(()=>{"use strict";c();t_="transaction-status-toast-id"});var qi,Ki,o_,Nr,r_,_t,le=W(()=>{"use strict";c();Vm();e_();zi();n_();Vi();qi=5e4,Ki=1e9,o_=1,Nr="logout",r_="login",_t="0"});var Xi,Pe,Cr,qn=W(()=>{"use strict";c();Xi=require("@reduxjs/toolkit");le();Pe=(0,Xi.createAction)(Nr),Cr=(0,Xi.createAction)(r_,t=>({payload:t}))});var i_,a_,p_,bv,Tv,wv,vv,Sv,Av,c_,s_,Zi=W(()=>{"use strict";c();i_=require("@reduxjs/toolkit");Hi();rn();qn();a_={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},p_=(0,i_.createSlice)({name:"loginInfoSlice",initialState:a_,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(Pe,()=>a_),t.addCase(Cr,(r,a)=>{r.loginMethod=a.payload.loginMethod,vo(wo())})}}),{setLoginMethod:bv,setWalletConnectLogin:Tv,setLedgerLogin:wv,setTokenLogin:vv,setTokenLoginSignature:Sv,setWalletLogin:Av,invalidateLoginSession:c_}=p_.actions,s_=p_.reducer});var m_=W(()=>{"use strict";c()});var __=W(()=>{"use strict";c();m_()});function Yi(t){return t[Math.floor(Math.random()*t.length)]}var l_=W(()=>{"use strict";c()});var d_=W(()=>{"use strict";c();zi()});var u_=W(()=>{"use strict";c();__();l_();d_()});var f_,g_,Ji,Mb,h_,$v,Hv,x_,Qi=W(()=>{"use strict";c();f_=require("@reduxjs/toolkit"),g_=C(require("lodash.omit"));u_();Ji={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Mb={network:Ji,chainID:"-1"},h_=(0,f_.createSlice)({name:"appConfig",initialState:Mb,reducers:{initializeNetworkConfig:(t,r)=>{let a=Yi(r.payload.walletConnectBridgeAddresses),s=Yi(r.payload.walletConnectV2RelayAddresses),l=(0,g_.default)(r.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");t.network=fe(J(J({},t.network),l),{walletConnectBridgeAddress:a,walletConnectV2RelayAddress:s})},setChainID:(t,r)=>{t.chainID=r.payload}}}),{initializeNetworkConfig:$v,setChainID:Hv}=h_.actions,x_=h_.reducer});var ep,y_,b_,Dr,ji,T_,w_,Yv,v_,Jv,Qv,jv,eS,nS,tS,oS,S_,np=W(()=>{"use strict";c();ep=require("@elrondnetwork/erdjs"),y_=require("@reduxjs/toolkit"),b_=require("redux-persist");le();Lr();To();qn();Dr={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:_t},ji={address:"",websocketEvent:null,accounts:{"":Dr},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},T_=(0,y_.createSlice)({name:"accountInfoSlice",initialState:ji,reducers:{setAddress:(t,r)=>{let a=r.payload;t.address=a,t.publicKey=new ep.Address(a).hex()},setAccount:(t,r)=>{let a=t.address===r.payload.address;t.accounts={[t.address]:a?r.payload:Dr},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(Pe,()=>(Ut.local.removeItem(mt.loginExpiresAt),ji)),t.addCase(Cr,(r,a)=>{let{address:s}=a.payload;r.address=s,r.publicKey=new ep.Address(s).hex()}),t.addCase(b_.REHYDRATE,(r,a)=>{var R;if(!((R=a.payload)!=null&&R.account))return;let{account:s}=a.payload,{address:l,shard:b,accounts:T,publicKey:L}=s;r.address=l,r.shard=b;let E=T&&l in T;r.accounts=E?T:ji.accounts,r.publicKey=L})}}),{setAccount:w_,setAddress:Yv,setAccountNonce:v_,setAccountShard:Jv,setLedgerAccount:Qv,updateLedgerAccount:jv,setWalletConnectAccount:eS,setIsAccountLoading:nS,setAccountLoadingError:tS,setWebsocketEvent:oS}=T_.actions,S_=T_.reducer});function A_(t){return t!=null&&(qb(t)||Yb(t))}function Rr(t){return t!=null&&(Kb(t)||Jb(t))}function Pr(t){return t!=null&&(Xb(t)||Qb(t))}function k_(t){return t!=null&&Zb(t)}function qb(t){return t!=null&&Ub.includes(t)}function Kb(t){return t!=null&&Wb.includes(t)}function Xb(t){return t!=null&&$b.includes(t)}function Zb(t){return t!=null&&Hb.includes(t)}function Yb(t){return t!=null&&Gb.includes(t)}function Jb(t){return t!=null&&zb.includes(t)}function Qb(t){return t!=null&&Vb.includes(t)}var Ub,Wb,$b,Hb,Gb,zb,Vb,op=W(()=>{"use strict";c();rn();Ub=["sent"],Wb=["success"],$b=["fail","cancelled","timedOut"],Hb=["timedOut"],Gb=["pending"],zb=["success"],Vb=["fail","invalid"]});var I_,E_,So,jb,L_,lS,dS,uS,fS,gS,hS,xS,yS,bS,TS,Fr,Or=W(()=>{"use strict";c();I_=require("@reduxjs/toolkit"),E_=require("redux-persist");rn();op();qn();So={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},jb={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},L_=(0,I_.createSlice)({name:"transactionsSlice",initialState:So,reducers:{moveTransactionsToSignedState:(t,r)=>{var E,R;let{sessionId:a,transactions:s,errorMessage:l,status:b,redirectRoute:T}=r.payload,L=((E=t.customTransactionInformationForSessionId)==null?void 0:E[a])||jb;t.signedTransactions[a]={transactions:s,status:b,errorMessage:l,redirectRoute:T,customTransactionInformation:L},((R=t==null?void 0:t.transactionsToSign)==null?void 0:R.sessionId)===a&&(t.transactionsToSign=So.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=J(J({},t.signedTransactions),r.payload)},updateSignedTransactions:(t,r)=>{let{sessionId:a,status:s,errorMessage:l,transactions:b}=r.payload;t.signedTransactions[a]!=null&&(t.signedTransactions[a].status=s,l!=null&&(t.signedTransactions[a].errorMessage=l),b!=null&&(t.signedTransactions[a].transactions=b))},updateSignedTransactionStatus:(t,r)=>{var L,E,R,G,O,ie;let{sessionId:a,status:s,errorMessage:l,transactionHash:b}=r.payload,T=(E=(L=t.signedTransactions)==null?void 0:L[a])==null?void 0:E.transactions;if(T!=null){t.signedTransactions[a].transactions=T.map(Te=>Te.hash===b?fe(J({},Te),{status:s,errorMessage:l}):Te);let ue=(G=(R=t.signedTransactions[a])==null?void 0:R.transactions)==null?void 0:G.every(Te=>Rr(Te.status)),ce=(ie=(O=t.signedTransactions[a])==null?void 0:O.transactions)==null?void 0:ie.every(Te=>Pr(Te.status));ue&&(t.signedTransactions[a].status="success"),ce&&(t.signedTransactions[a].status="fail")}},setTransactionsToSign:(t,r)=>{t.transactionsToSign=r.payload;let{sessionId:a,customTransactionInformation:s}=r.payload;t.customTransactionInformationForSessionId[a]=s,t.signTransactionsError=null},clearAllTransactionsToSign:t=>{t.transactionsToSign=So.transactionsToSign,t.signTransactionsError=null},clearAllSignedTransactions:t=>{t.signedTransactions=So.signedTransactions},setSignTransactionsError:(t,r)=>{t.signTransactionsError=r.payload},setSignTransactionsCancelMessage:(t,r)=>{t.signTransactionsCancelMessage=r.payload}},extraReducers:t=>{t.addCase(Pe,()=>So),t.addCase(E_.REHYDRATE,(r,a)=>{var T;if(r.signTransactionsCancelMessage=null,!((T=a.payload)!=null&&T.transactions))return;let{signedTransactions:s,customTransactionInformationForSessionId:l}=a.payload.transactions,b=Object.entries(s).reduce((L,[E,R])=>{let G=new Date(E),O=new Date;return O.setHours(O.getHours()+5),O-G>0||(L[E]=R),L},{});l!=null&&(r.customTransactionInformationForSessionId=l),s!=null&&(r.signedTransactions=b)})}}),{updateSignedTransactionStatus:lS,updateSignedTransactions:dS,setTransactionsToSign:uS,clearAllTransactionsToSign:fS,clearAllSignedTransactions:gS,clearSignedTransaction:hS,clearTransactionToSign:xS,setSignTransactionsError:yS,setSignTransactionsCancelMessage:bS,moveTransactionsToSignedState:TS}=L_.actions,Fr=L_.reducer});var N_,ap,ip,pp,eT,rp,C_,AS,kS,IS,Mr,Br=W(()=>{"use strict";c();N_=require("@reduxjs/toolkit");qn();ap="Transaction failed",ip="Transaction successful",pp="Processing transaction",eT="Transaction submitted",rp={},C_=(0,N_.createSlice)({name:"transactionsInfo",initialState:rp,reducers:{setTransactionsDisplayInfo(t,r){let{sessionId:a,transactionsDisplayInfo:s}=r.payload;a!=null&&(t[a]={errorMessage:(s==null?void 0:s.errorMessage)||ap,successMessage:(s==null?void 0:s.successMessage)||ip,processingMessage:(s==null?void 0:s.processingMessage)||pp,submittedMessage:(s==null?void 0:s.submittedMessage)||eT,transactionDuration:s==null?void 0:s.transactionDuration})},clearTransactionsInfoForSessionId(t,r){r.payload!=null&&delete t[r.payload]},clearTransactionsInfo:()=>rp},extraReducers:t=>{t.addCase(Pe,()=>rp)}}),{clearTransactionsInfo:AS,setTransactionsDisplayInfo:kS,clearTransactionsInfoForSessionId:IS}=C_.actions,Mr=C_.reducer});var R_,D_,P_,CS,DS,RS,PS,F_,cp=W(()=>{"use strict";c();R_=require("@reduxjs/toolkit");qn();D_={},P_=(0,R_.createSlice)({name:"modalsSlice",initialState:D_,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(Pe,()=>D_)}}),{setTxSubmittedModal:CS,setNotificationModal:DS,clearTxSubmittedModal:RS,clearNotificationModal:PS}=P_.actions,F_=P_.reducer});var M_,B_,O_,U_,HS,GS,zS,VS,qS,KS,Ur,Wr=W(()=>{"use strict";c();M_=require("@reduxjs/toolkit"),B_=require("redux-persist");Vi();Vn();Bi();qn();O_={customToasts:[],transactionToasts:[],failTransactionToast:null},U_=(0,M_.createSlice)({name:"toastsSlice",initialState:O_,reducers:{addCustomToast:(t,r)=>{t.customToasts.push(fe(J({},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:Er(),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=fe(J({},r.payload),{toastId:t_})},removeFailTransactionToast:t=>{t.failTransactionToast=null}},extraReducers:t=>{t.addCase(Pe,()=>O_),t.addCase(B_.REHYDRATE,(r,a)=>{var l,b;let s=(b=(l=a.customToasts)==null?void 0:l.filter(T=>!("component"in T)))!=null?b:[];r.customToasts=s})}}),{addCustomToast:HS,removeCustomToast:GS,addTransactionToast:zS,removeTransactionToast:VS,addFailTransactionToast:qS,removeFailTransactionToast:KS}=U_.actions,Ur=U_.reducer});var Wt=W(()=>{"use strict";c();Zi();Qi();np();Or();Br();cp();Wr()});var sp=W(()=>{"use strict";c()});var G_,H_,z_,dA,uA,fA,gA,hA,xA,V_,q_=W(()=>{"use strict";c();G_=require("@reduxjs/toolkit");qn();H_={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},z_=(0,G_.createSlice)({name:"dappModalsSlice",initialState:H_,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=J({},r.payload)}},extraReducers:t=>{t.addCase(Pe,()=>H_)}}),{setDappModalVisibility:dA,setDappModalHeaderVisibility:uA,setDappModalFooterVisibility:fA,setDappModalHeaderText:gA,setDappModalFooterText:hA,setDappModalConfig:xA}=z_.actions,V_=z_.reducer});var K_,rT,aT,$t,Hr=W(()=>{"use strict";c();K_=require("@reduxjs/toolkit");sp();np();q_();Zi();cp();Qi();Wr();Br();Or();rT={["account"]:S_,["networkConfig"]:x_,["loginInfo"]:s_,["modals"]:F_,["dappModal"]:V_,["toasts"]:Ur,["transactions"]:Fr,["transactionsInfo"]:Mr},aT=(t={})=>(0,K_.combineReducers)(J(J({},rT),t)),$t=aT});var Y_={};it(Y_,{default:()=>lT});function mp(t,r=[]){return{key:t,version:1,storage:Z_.default,blacklist:r}}var lt,X_,Z_,iT,pT,cT,sT,mT,_T,lT,J_=W(()=>{"use strict";c();lt=require("redux-persist"),X_=C(require("redux-persist/lib/storage")),Z_=C(require("redux-persist/lib/storage/session"));Hr();Wt();Wr();Br();Or();sp();iT={2:t=>fe(J({},t),{networkConfig:Ji})};pT=mp("dapp-core-transactionsInfo"),cT=mp("dapp-core-transactions",["transactionsToSign"]),sT=mp("dapp-core-toasts"),mT={key:"dapp-core-store",version:2,storage:X_.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,lt.createMigrate)(iT,{debug:!1})},_T={["toasts"]:(0,lt.persistReducer)(sT,Ur),["transactions"]:(0,lt.persistReducer)(cT,Fr),["transactionsInfo"]:(0,lt.persistReducer)(pT,Mr)},lT=(0,lt.persistReducer)(mT,$t(_T))});var Q_={};it(Q_,{default:()=>dT});var dT,j_=W(()=>{"use strict";c();Hr();dT=$t()});var el={};it(el,{default:()=>fT});var Je,uT,fT,nl=W(()=>{"use strict";c();Je=require("redux-persist"),uT=[Je.FLUSH,Je.REHYDRATE,Je.PAUSE,Je.PERSIST,Je.PURGE,Je.REGISTER],fT=uT});var rl={};it(rl,{default:()=>ol});function ol(t){return(0,tl.persistStore)(t)}var tl,al=W(()=>{"use strict";c();tl=require("redux-persist")});var zl=yo((Kt,Eo)=>{c();(function(){var t,r="4.17.21",a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",b="Invalid `variable` option passed into `_.template`",T="__lodash_hash_undefined__",L=500,E="__lodash_placeholder__",R=1,G=2,O=4,ie=1,ue=2,ce=1,Te=2,Lp=4,an=8,gt=16,pn=32,ht=64,hn=128,Xt=256,oa=512,Xl=30,Zl="...",Yl=800,Jl=16,Np=1,Ql=2,jl=3,Yn=1/0,Pn=9007199254740991,ed=17976931348623157e292,Lo=0/0,cn=4294967295,nd=cn-1,td=cn>>>1,od=[["ary",hn],["bind",ce],["bindKey",Te],["curry",an],["curryRight",gt],["flip",oa],["partial",pn],["partialRight",ht],["rearg",Xt]],xt="[object Arguments]",No="[object Array]",rd="[object AsyncFunction]",Zt="[object Boolean]",Yt="[object Date]",ad="[object DOMException]",Co="[object Error]",Do="[object Function]",Cp="[object GeneratorFunction]",Qe="[object Map]",Jt="[object Number]",id="[object Null]",xn="[object Object]",Dp="[object Promise]",pd="[object Proxy]",Qt="[object RegExp]",je="[object Set]",jt="[object String]",Ro="[object Symbol]",cd="[object Undefined]",eo="[object WeakMap]",sd="[object WeakSet]",no="[object ArrayBuffer]",yt="[object DataView]",ra="[object Float32Array]",aa="[object Float64Array]",ia="[object Int8Array]",pa="[object Int16Array]",ca="[object Int32Array]",sa="[object Uint8Array]",ma="[object Uint8ClampedArray]",_a="[object Uint16Array]",la="[object Uint32Array]",md=/\b__p \+= '';/g,_d=/\b(__p \+=) '' \+/g,ld=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Rp=/&(?:amp|lt|gt|quot|#39);/g,Pp=/[&<>"']/g,dd=RegExp(Rp.source),ud=RegExp(Pp.source),fd=/<%-([\s\S]+?)%>/g,gd=/<%([\s\S]+?)%>/g,Fp=/<%=([\s\S]+?)%>/g,hd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xd=/^\w*$/,yd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,da=/[\\^$.*+?()[\]{}|]/g,bd=RegExp(da.source),ua=/^\s+/,Td=/\s/,wd=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,vd=/\{\n\/\* \[wrapped with (.+)\] \*/,Sd=/,? & /,Ad=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,kd=/[()=,{}\[\]\/\s]/,Id=/\\(\\)?/g,Ed=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Op=/\w*$/,Ld=/^[-+]0x[0-9a-f]+$/i,Nd=/^0b[01]+$/i,Cd=/^\[object .+?Constructor\]$/,Dd=/^0o[0-7]+$/i,Rd=/^(?:0|[1-9]\d*)$/,Pd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Po=/($^)/,Fd=/['\n\r\u2028\u2029\\]/g,Fo="\\ud800-\\udfff",Od="\\u0300-\\u036f",Md="\\ufe20-\\ufe2f",Bd="\\u20d0-\\u20ff",Mp=Od+Md+Bd,Bp="\\u2700-\\u27bf",Up="a-z\\xdf-\\xf6\\xf8-\\xff",Ud="\\xac\\xb1\\xd7\\xf7",Wd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$d="\\u2000-\\u206f",Hd=" \\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",Wp="A-Z\\xc0-\\xd6\\xd8-\\xde",$p="\\ufe0e\\ufe0f",Hp=Ud+Wd+$d+Hd,fa="['\u2019]",Gd="["+Fo+"]",Gp="["+Hp+"]",Oo="["+Mp+"]",zp="\\d+",zd="["+Bp+"]",Vp="["+Up+"]",qp="[^"+Fo+Hp+zp+Bp+Up+Wp+"]",ga="\\ud83c[\\udffb-\\udfff]",Vd="(?:"+Oo+"|"+ga+")",Kp="[^"+Fo+"]",ha="(?:\\ud83c[\\udde6-\\uddff]){2}",xa="[\\ud800-\\udbff][\\udc00-\\udfff]",bt="["+Wp+"]",Xp="\\u200d",Zp="(?:"+Vp+"|"+qp+")",qd="(?:"+bt+"|"+qp+")",Yp="(?:"+fa+"(?:d|ll|m|re|s|t|ve))?",Jp="(?:"+fa+"(?:D|LL|M|RE|S|T|VE))?",Qp=Vd+"?",jp="["+$p+"]?",Kd="(?:"+Xp+"(?:"+[Kp,ha,xa].join("|")+")"+jp+Qp+")*",Xd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ec=jp+Qp+Kd,Yd="(?:"+[zd,ha,xa].join("|")+")"+ec,Jd="(?:"+[Kp+Oo+"?",Oo,ha,xa,Gd].join("|")+")",Qd=RegExp(fa,"g"),jd=RegExp(Oo,"g"),ya=RegExp(ga+"(?="+ga+")|"+Jd+ec,"g"),eu=RegExp([bt+"?"+Vp+"+"+Yp+"(?="+[Gp,bt,"$"].join("|")+")",qd+"+"+Jp+"(?="+[Gp,bt+Zp,"$"].join("|")+")",bt+"?"+Zp+"+"+Yp,bt+"+"+Jp,Zd,Xd,zp,Yd].join("|"),"g"),nu=RegExp("["+Xp+Fo+Mp+$p+"]"),tu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ou=["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"],ru=-1,oe={};oe[ra]=oe[aa]=oe[ia]=oe[pa]=oe[ca]=oe[sa]=oe[ma]=oe[_a]=oe[la]=!0,oe[xt]=oe[No]=oe[no]=oe[Zt]=oe[yt]=oe[Yt]=oe[Co]=oe[Do]=oe[Qe]=oe[Jt]=oe[xn]=oe[Qt]=oe[je]=oe[jt]=oe[eo]=!1;var te={};te[xt]=te[No]=te[no]=te[yt]=te[Zt]=te[Yt]=te[ra]=te[aa]=te[ia]=te[pa]=te[ca]=te[Qe]=te[Jt]=te[xn]=te[Qt]=te[je]=te[jt]=te[Ro]=te[sa]=te[ma]=te[_a]=te[la]=!0,te[Co]=te[Do]=te[eo]=!1;var au={\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:"i",\u00EE:"i",\u00EF:"i",