@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 273 kB
JavaScript
"use strict";var Hw=Object.create;var or=Object.defineProperty,Vw=Object.defineProperties,zw=Object.getOwnPropertyDescriptor,qw=Object.getOwnPropertyDescriptors,Kw=Object.getOwnPropertyNames,xa=Object.getOwnPropertySymbols,Xw=Object.getPrototypeOf,Bc=Object.prototype.hasOwnProperty,Bl=Object.prototype.propertyIsEnumerable;var Fl=(t,o,a)=>o in t?or(t,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[o]=a,F=(t,o)=>{for(var a in o||(o={}))Bc.call(o,a)&&Fl(t,a,o[a]);if(xa)for(var a of xa(o))Bl.call(o,a)&&Fl(t,a,o[a]);return t},J=(t,o)=>Vw(t,qw(o));var Rn=(t,o)=>{var a={};for(var s in t)Bc.call(t,s)&&o.indexOf(s)<0&&(a[s]=t[s]);if(t!=null&&xa)for(var s of xa(t))o.indexOf(s)<0&&Bl.call(t,s)&&(a[s]=t[s]);return a};var V=(t,o)=>()=>(t&&(o=t(t=0)),o);var rr=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports),Ft=(t,o)=>{for(var a in o)or(t,a,{get:o[a],enumerable:!0})},Ul=(t,o,a,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of Kw(o))!Bc.call(t,m)&&m!==a&&or(t,m,{get:()=>o[m],enumerable:!(s=zw(o,m))||s.enumerable});return t};var P=(t,o,a)=>(a=t!=null?Hw(Xw(t)):{},Ul(o||!t||!t.__esModule?or(a,"default",{value:t,enumerable:!0}):a,t)),ar=t=>Ul(or({},"__esModule",{value:!0}),t);var re=(t,o,a)=>new Promise((s,m)=>{var h=S=>{try{A(a.next(S))}catch(N){m(N)}},T=S=>{try{A(a.throw(S))}catch(N){m(N)}},A=S=>S.done?s(S.value):Promise.resolve(S.value).then(h,T);A((a=a.apply(t,o)).next())});var $l=rr(ya=>{"use strict";i();ya.byteLength=Yw;ya.toByteArray=Jw;ya.fromByteArray=nS;var Mn=[],_n=[],Zw=typeof Uint8Array!="undefined"?Uint8Array:Array,Uc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Bt=0,Wl=Uc.length;Bt<Wl;++Bt)Mn[Bt]=Uc[Bt],_n[Uc.charCodeAt(Bt)]=Bt;var Bt,Wl;_n["-".charCodeAt(0)]=62;_n["_".charCodeAt(0)]=63;function Gl(t){var o=t.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=t.indexOf("=");a===-1&&(a=o);var s=a===o?0:4-a%4;return[a,s]}function Yw(t){var o=Gl(t),a=o[0],s=o[1];return(a+s)*3/4-s}function jw(t,o,a){return(o+a)*3/4-a}function Jw(t){var o,a=Gl(t),s=a[0],m=a[1],h=new Zw(jw(t,s,m)),T=0,A=m>0?s-4:s,S;for(S=0;S<A;S+=4)o=_n[t.charCodeAt(S)]<<18|_n[t.charCodeAt(S+1)]<<12|_n[t.charCodeAt(S+2)]<<6|_n[t.charCodeAt(S+3)],h[T++]=o>>16&255,h[T++]=o>>8&255,h[T++]=o&255;return m===2&&(o=_n[t.charCodeAt(S)]<<2|_n[t.charCodeAt(S+1)]>>4,h[T++]=o&255),m===1&&(o=_n[t.charCodeAt(S)]<<10|_n[t.charCodeAt(S+1)]<<4|_n[t.charCodeAt(S+2)]>>2,h[T++]=o>>8&255,h[T++]=o&255),h}function Qw(t){return Mn[t>>18&63]+Mn[t>>12&63]+Mn[t>>6&63]+Mn[t&63]}function eS(t,o,a){for(var s,m=[],h=o;h<a;h+=3)s=(t[h]<<16&16711680)+(t[h+1]<<8&65280)+(t[h+2]&255),m.push(Qw(s));return m.join("")}function nS(t){for(var o,a=t.length,s=a%3,m=[],h=16383,T=0,A=a-s;T<A;T+=h)m.push(eS(t,T,T+h>A?A:T+h));return s===1?(o=t[a-1],m.push(Mn[o>>2]+Mn[o<<4&63]+"==")):s===2&&(o=(t[a-2]<<8)+t[a-1],m.push(Mn[o>>10]+Mn[o>>4&63]+Mn[o<<2&63]+"=")),m.join("")}});var Hl=rr(Wc=>{i();Wc.read=function(t,o,a,s,m){var h,T,A=m*8-s-1,S=(1<<A)-1,N=S>>1,O=-7,R=a?m-1:0,W=a?-1:1,ee=t[o+R];for(R+=W,h=ee&(1<<-O)-1,ee>>=-O,O+=A;O>0;h=h*256+t[o+R],R+=W,O-=8);for(T=h&(1<<-O)-1,h>>=-O,O+=s;O>0;T=T*256+t[o+R],R+=W,O-=8);if(h===0)h=1-N;else{if(h===S)return T?NaN:(ee?-1:1)*(1/0);T=T+Math.pow(2,s),h=h-N}return(ee?-1:1)*T*Math.pow(2,h-s)};Wc.write=function(t,o,a,s,m,h){var T,A,S,N=h*8-m-1,O=(1<<N)-1,R=O>>1,W=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,ee=s?0:h-1,ne=s?1:-1,me=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(A=isNaN(o)?1:0,T=O):(T=Math.floor(Math.log(o)/Math.LN2),o*(S=Math.pow(2,-T))<1&&(T--,S*=2),T+R>=1?o+=W/S:o+=W*Math.pow(2,1-R),o*S>=2&&(T++,S/=2),T+R>=O?(A=0,T=O):T+R>=1?(A=(o*S-1)*Math.pow(2,m),T=T+R):(A=o*Math.pow(2,R-1)*Math.pow(2,m),T=0));m>=8;t[a+ee]=A&255,ee+=ne,A/=256,m-=8);for(T=T<<m|A,N+=m;N>0;t[a+ee]=T&255,ee+=ne,T/=256,N-=8);t[a+ee-ne]|=me*128}});var t_=rr(fo=>{"use strict";i();var Gc=$l(),uo=Hl(),Vl=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;fo.Buffer=I;fo.SlowBuffer=cS;fo.INSPECT_MAX_BYTES=50;var ba=2147483647;fo.kMaxLength=ba;I.TYPED_ARRAY_SUPPORT=tS();!I.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 tS(){try{var t=new Uint8Array(1),o={foo:function(){return 42}};return Object.setPrototypeOf(o,Uint8Array.prototype),Object.setPrototypeOf(t,o),t.foo()===42}catch(a){return!1}}Object.defineProperty(I.prototype,"parent",{enumerable:!0,get:function(){if(!!I.isBuffer(this))return this.buffer}});Object.defineProperty(I.prototype,"offset",{enumerable:!0,get:function(){if(!!I.isBuffer(this))return this.byteOffset}});function jn(t){if(t>ba)throw new RangeError('The value "'+t+'" is invalid for option "size"');var o=new Uint8Array(t);return Object.setPrototypeOf(o,I.prototype),o}function I(t,o,a){if(typeof t=="number"){if(typeof o=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return zc(t)}return Kl(t,o,a)}I.poolSize=8192;function Kl(t,o,a){if(typeof t=="string")return rS(t,o);if(ArrayBuffer.isView(t))return aS(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(On(t,ArrayBuffer)||t&&On(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(On(t,SharedArrayBuffer)||t&&On(t.buffer,SharedArrayBuffer)))return Hc(t,o,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 I.from(s,o,a);var m=iS(t);if(m)return m;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return I.from(t[Symbol.toPrimitive]("string"),o,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}I.from=function(t,o,a){return Kl(t,o,a)};Object.setPrototypeOf(I.prototype,Uint8Array.prototype);Object.setPrototypeOf(I,Uint8Array);function Xl(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 oS(t,o,a){return Xl(t),t<=0?jn(t):o!==void 0?typeof a=="string"?jn(t).fill(o,a):jn(t).fill(o):jn(t)}I.alloc=function(t,o,a){return oS(t,o,a)};function zc(t){return Xl(t),jn(t<0?0:qc(t)|0)}I.allocUnsafe=function(t){return zc(t)};I.allocUnsafeSlow=function(t){return zc(t)};function rS(t,o){if((typeof o!="string"||o==="")&&(o="utf8"),!I.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var a=Zl(t,o)|0,s=jn(a),m=s.write(t,o);return m!==a&&(s=s.slice(0,m)),s}function $c(t){for(var o=t.length<0?0:qc(t.length)|0,a=jn(o),s=0;s<o;s+=1)a[s]=t[s]&255;return a}function aS(t){if(On(t,Uint8Array)){var o=new Uint8Array(t);return Hc(o.buffer,o.byteOffset,o.byteLength)}return $c(t)}function Hc(t,o,a){if(o<0||t.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<o+(a||0))throw new RangeError('"length" is outside of buffer bounds');var s;return o===void 0&&a===void 0?s=new Uint8Array(t):a===void 0?s=new Uint8Array(t,o):s=new Uint8Array(t,o,a),Object.setPrototypeOf(s,I.prototype),s}function iS(t){if(I.isBuffer(t)){var o=qc(t.length)|0,a=jn(o);return a.length===0||t.copy(a,0,0,o),a}if(t.length!==void 0)return typeof t.length!="number"||Kc(t.length)?jn(0):$c(t);if(t.type==="Buffer"&&Array.isArray(t.data))return $c(t.data)}function qc(t){if(t>=ba)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ba.toString(16)+" bytes");return t|0}function cS(t){return+t!=t&&(t=0),I.alloc(+t)}I.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==I.prototype};I.compare=function(o,a){if(On(o,Uint8Array)&&(o=I.from(o,o.offset,o.byteLength)),On(a,Uint8Array)&&(a=I.from(a,a.offset,a.byteLength)),!I.isBuffer(o)||!I.isBuffer(a))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(o===a)return 0;for(var s=o.length,m=a.length,h=0,T=Math.min(s,m);h<T;++h)if(o[h]!==a[h]){s=o[h],m=a[h];break}return s<m?-1:m<s?1:0};I.isEncoding=function(o){switch(String(o).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}};I.concat=function(o,a){if(!Array.isArray(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return I.alloc(0);var s;if(a===void 0)for(a=0,s=0;s<o.length;++s)a+=o[s].length;var m=I.allocUnsafe(a),h=0;for(s=0;s<o.length;++s){var T=o[s];if(On(T,Uint8Array))h+T.length>m.length?I.from(T).copy(m,h):Uint8Array.prototype.set.call(m,T,h);else if(I.isBuffer(T))T.copy(m,h);else throw new TypeError('"list" argument must be an Array of Buffers');h+=T.length}return m};function Zl(t,o){if(I.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||On(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 m=!1;;)switch(o){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return Vc(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a*2;case"hex":return a>>>1;case"base64":return n_(t).length;default:if(m)return s?-1:Vc(t).length;o=(""+o).toLowerCase(),m=!0}}I.byteLength=Zl;function sS(t,o,a){var s=!1;if((o===void 0||o<0)&&(o=0),o>this.length||((a===void 0||a>this.length)&&(a=this.length),a<=0)||(a>>>=0,o>>>=0,a<=o))return"";for(t||(t="utf8");;)switch(t){case"hex":return TS(this,o,a);case"utf8":case"utf-8":return jl(this,o,a);case"ascii":return gS(this,o,a);case"latin1":case"binary":return hS(this,o,a);case"base64":return uS(this,o,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xS(this,o,a);default:if(s)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}I.prototype._isBuffer=!0;function Ut(t,o,a){var s=t[o];t[o]=t[a],t[a]=s}I.prototype.swap16=function(){var o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var a=0;a<o;a+=2)Ut(this,a,a+1);return this};I.prototype.swap32=function(){var o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var a=0;a<o;a+=4)Ut(this,a,a+3),Ut(this,a+1,a+2);return this};I.prototype.swap64=function(){var o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var a=0;a<o;a+=8)Ut(this,a,a+7),Ut(this,a+1,a+6),Ut(this,a+2,a+5),Ut(this,a+3,a+4);return this};I.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?jl(this,0,o):sS.apply(this,arguments)};I.prototype.toLocaleString=I.prototype.toString;I.prototype.equals=function(o){if(!I.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:I.compare(this,o)===0};I.prototype.inspect=function(){var o="",a=fo.INSPECT_MAX_BYTES;return o=this.toString("hex",0,a).replace(/(.{2})/g,"$1 ").trim(),this.length>a&&(o+=" ... "),"<Buffer "+o+">"};Vl&&(I.prototype[Vl]=I.prototype.inspect);I.prototype.compare=function(o,a,s,m,h){if(On(o,Uint8Array)&&(o=I.from(o,o.offset,o.byteLength)),!I.isBuffer(o))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof o);if(a===void 0&&(a=0),s===void 0&&(s=o?o.length:0),m===void 0&&(m=0),h===void 0&&(h=this.length),a<0||s>o.length||m<0||h>this.length)throw new RangeError("out of range index");if(m>=h&&a>=s)return 0;if(m>=h)return-1;if(a>=s)return 1;if(a>>>=0,s>>>=0,m>>>=0,h>>>=0,this===o)return 0;for(var T=h-m,A=s-a,S=Math.min(T,A),N=this.slice(m,h),O=o.slice(a,s),R=0;R<S;++R)if(N[R]!==O[R]){T=N[R],A=O[R];break}return T<A?-1:A<T?1:0};function Yl(t,o,a,s,m){if(t.length===0)return-1;if(typeof a=="string"?(s=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,Kc(a)&&(a=m?0:t.length-1),a<0&&(a=t.length+a),a>=t.length){if(m)return-1;a=t.length-1}else if(a<0)if(m)a=0;else return-1;if(typeof o=="string"&&(o=I.from(o,s)),I.isBuffer(o))return o.length===0?-1:zl(t,o,a,s,m);if(typeof o=="number")return o=o&255,typeof Uint8Array.prototype.indexOf=="function"?m?Uint8Array.prototype.indexOf.call(t,o,a):Uint8Array.prototype.lastIndexOf.call(t,o,a):zl(t,[o],a,s,m);throw new TypeError("val must be string, number or Buffer")}function zl(t,o,a,s,m){var h=1,T=t.length,A=o.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(t.length<2||o.length<2)return-1;h=2,T/=2,A/=2,a/=2}function S(ee,ne){return h===1?ee[ne]:ee.readUInt16BE(ne*h)}var N;if(m){var O=-1;for(N=a;N<T;N++)if(S(t,N)===S(o,O===-1?0:N-O)){if(O===-1&&(O=N),N-O+1===A)return O*h}else O!==-1&&(N-=N-O),O=-1}else for(a+A>T&&(a=T-A),N=a;N>=0;N--){for(var R=!0,W=0;W<A;W++)if(S(t,N+W)!==S(o,W)){R=!1;break}if(R)return N}return-1}I.prototype.includes=function(o,a,s){return this.indexOf(o,a,s)!==-1};I.prototype.indexOf=function(o,a,s){return Yl(this,o,a,s,!0)};I.prototype.lastIndexOf=function(o,a,s){return Yl(this,o,a,s,!1)};function pS(t,o,a,s){a=Number(a)||0;var m=t.length-a;s?(s=Number(s),s>m&&(s=m)):s=m;var h=o.length;s>h/2&&(s=h/2);for(var T=0;T<s;++T){var A=parseInt(o.substr(T*2,2),16);if(Kc(A))return T;t[a+T]=A}return T}function mS(t,o,a,s){return wa(Vc(o,t.length-a),t,a,s)}function lS(t,o,a,s){return wa(wS(o),t,a,s)}function _S(t,o,a,s){return wa(n_(o),t,a,s)}function dS(t,o,a,s){return wa(SS(o,t.length-a),t,a,s)}I.prototype.write=function(o,a,s,m){if(a===void 0)m="utf8",s=this.length,a=0;else if(s===void 0&&typeof a=="string")m=a,s=this.length,a=0;else if(isFinite(a))a=a>>>0,isFinite(s)?(s=s>>>0,m===void 0&&(m="utf8")):(m=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var h=this.length-a;if((s===void 0||s>h)&&(s=h),o.length>0&&(s<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");m||(m="utf8");for(var T=!1;;)switch(m){case"hex":return pS(this,o,a,s);case"utf8":case"utf-8":return mS(this,o,a,s);case"ascii":case"latin1":case"binary":return lS(this,o,a,s);case"base64":return _S(this,o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dS(this,o,a,s);default:if(T)throw new TypeError("Unknown encoding: "+m);m=(""+m).toLowerCase(),T=!0}};I.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function uS(t,o,a){return o===0&&a===t.length?Gc.fromByteArray(t):Gc.fromByteArray(t.slice(o,a))}function jl(t,o,a){a=Math.min(t.length,a);for(var s=[],m=o;m<a;){var h=t[m],T=null,A=h>239?4:h>223?3:h>191?2:1;if(m+A<=a){var S,N,O,R;switch(A){case 1:h<128&&(T=h);break;case 2:S=t[m+1],(S&192)===128&&(R=(h&31)<<6|S&63,R>127&&(T=R));break;case 3:S=t[m+1],N=t[m+2],(S&192)===128&&(N&192)===128&&(R=(h&15)<<12|(S&63)<<6|N&63,R>2047&&(R<55296||R>57343)&&(T=R));break;case 4:S=t[m+1],N=t[m+2],O=t[m+3],(S&192)===128&&(N&192)===128&&(O&192)===128&&(R=(h&15)<<18|(S&63)<<12|(N&63)<<6|O&63,R>65535&&R<1114112&&(T=R))}}T===null?(T=65533,A=1):T>65535&&(T-=65536,s.push(T>>>10&1023|55296),T=56320|T&1023),s.push(T),m+=A}return fS(s)}var ql=4096;function fS(t){var o=t.length;if(o<=ql)return String.fromCharCode.apply(String,t);for(var a="",s=0;s<o;)a+=String.fromCharCode.apply(String,t.slice(s,s+=ql));return a}function gS(t,o,a){var s="";a=Math.min(t.length,a);for(var m=o;m<a;++m)s+=String.fromCharCode(t[m]&127);return s}function hS(t,o,a){var s="";a=Math.min(t.length,a);for(var m=o;m<a;++m)s+=String.fromCharCode(t[m]);return s}function TS(t,o,a){var s=t.length;(!o||o<0)&&(o=0),(!a||a<0||a>s)&&(a=s);for(var m="",h=o;h<a;++h)m+=vS[t[h]];return m}function xS(t,o,a){for(var s=t.slice(o,a),m="",h=0;h<s.length-1;h+=2)m+=String.fromCharCode(s[h]+s[h+1]*256);return m}I.prototype.slice=function(o,a){var s=this.length;o=~~o,a=a===void 0?s:~~a,o<0?(o+=s,o<0&&(o=0)):o>s&&(o=s),a<0?(a+=s,a<0&&(a=0)):a>s&&(a=s),a<o&&(a=o);var m=this.subarray(o,a);return Object.setPrototypeOf(m,I.prototype),m};function Le(t,o,a){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+o>a)throw new RangeError("Trying to access beyond buffer length")}I.prototype.readUintLE=I.prototype.readUIntLE=function(o,a,s){o=o>>>0,a=a>>>0,s||Le(o,a,this.length);for(var m=this[o],h=1,T=0;++T<a&&(h*=256);)m+=this[o+T]*h;return m};I.prototype.readUintBE=I.prototype.readUIntBE=function(o,a,s){o=o>>>0,a=a>>>0,s||Le(o,a,this.length);for(var m=this[o+--a],h=1;a>0&&(h*=256);)m+=this[o+--a]*h;return m};I.prototype.readUint8=I.prototype.readUInt8=function(o,a){return o=o>>>0,a||Le(o,1,this.length),this[o]};I.prototype.readUint16LE=I.prototype.readUInt16LE=function(o,a){return o=o>>>0,a||Le(o,2,this.length),this[o]|this[o+1]<<8};I.prototype.readUint16BE=I.prototype.readUInt16BE=function(o,a){return o=o>>>0,a||Le(o,2,this.length),this[o]<<8|this[o+1]};I.prototype.readUint32LE=I.prototype.readUInt32LE=function(o,a){return o=o>>>0,a||Le(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216};I.prototype.readUint32BE=I.prototype.readUInt32BE=function(o,a){return o=o>>>0,a||Le(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])};I.prototype.readIntLE=function(o,a,s){o=o>>>0,a=a>>>0,s||Le(o,a,this.length);for(var m=this[o],h=1,T=0;++T<a&&(h*=256);)m+=this[o+T]*h;return h*=128,m>=h&&(m-=Math.pow(2,8*a)),m};I.prototype.readIntBE=function(o,a,s){o=o>>>0,a=a>>>0,s||Le(o,a,this.length);for(var m=a,h=1,T=this[o+--m];m>0&&(h*=256);)T+=this[o+--m]*h;return h*=128,T>=h&&(T-=Math.pow(2,8*a)),T};I.prototype.readInt8=function(o,a){return o=o>>>0,a||Le(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]};I.prototype.readInt16LE=function(o,a){o=o>>>0,a||Le(o,2,this.length);var s=this[o]|this[o+1]<<8;return s&32768?s|4294901760:s};I.prototype.readInt16BE=function(o,a){o=o>>>0,a||Le(o,2,this.length);var s=this[o+1]|this[o]<<8;return s&32768?s|4294901760:s};I.prototype.readInt32LE=function(o,a){return o=o>>>0,a||Le(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24};I.prototype.readInt32BE=function(o,a){return o=o>>>0,a||Le(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]};I.prototype.readFloatLE=function(o,a){return o=o>>>0,a||Le(o,4,this.length),uo.read(this,o,!0,23,4)};I.prototype.readFloatBE=function(o,a){return o=o>>>0,a||Le(o,4,this.length),uo.read(this,o,!1,23,4)};I.prototype.readDoubleLE=function(o,a){return o=o>>>0,a||Le(o,8,this.length),uo.read(this,o,!0,52,8)};I.prototype.readDoubleBE=function(o,a){return o=o>>>0,a||Le(o,8,this.length),uo.read(this,o,!1,52,8)};function Ke(t,o,a,s,m,h){if(!I.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>m||o<h)throw new RangeError('"value" argument is out of bounds');if(a+s>t.length)throw new RangeError("Index out of range")}I.prototype.writeUintLE=I.prototype.writeUIntLE=function(o,a,s,m){if(o=+o,a=a>>>0,s=s>>>0,!m){var h=Math.pow(2,8*s)-1;Ke(this,o,a,s,h,0)}var T=1,A=0;for(this[a]=o&255;++A<s&&(T*=256);)this[a+A]=o/T&255;return a+s};I.prototype.writeUintBE=I.prototype.writeUIntBE=function(o,a,s,m){if(o=+o,a=a>>>0,s=s>>>0,!m){var h=Math.pow(2,8*s)-1;Ke(this,o,a,s,h,0)}var T=s-1,A=1;for(this[a+T]=o&255;--T>=0&&(A*=256);)this[a+T]=o/A&255;return a+s};I.prototype.writeUint8=I.prototype.writeUInt8=function(o,a,s){return o=+o,a=a>>>0,s||Ke(this,o,a,1,255,0),this[a]=o&255,a+1};I.prototype.writeUint16LE=I.prototype.writeUInt16LE=function(o,a,s){return o=+o,a=a>>>0,s||Ke(this,o,a,2,65535,0),this[a]=o&255,this[a+1]=o>>>8,a+2};I.prototype.writeUint16BE=I.prototype.writeUInt16BE=function(o,a,s){return o=+o,a=a>>>0,s||Ke(this,o,a,2,65535,0),this[a]=o>>>8,this[a+1]=o&255,a+2};I.prototype.writeUint32LE=I.prototype.writeUInt32LE=function(o,a,s){return o=+o,a=a>>>0,s||Ke(this,o,a,4,4294967295,0),this[a+3]=o>>>24,this[a+2]=o>>>16,this[a+1]=o>>>8,this[a]=o&255,a+4};I.prototype.writeUint32BE=I.prototype.writeUInt32BE=function(o,a,s){return o=+o,a=a>>>0,s||Ke(this,o,a,4,4294967295,0),this[a]=o>>>24,this[a+1]=o>>>16,this[a+2]=o>>>8,this[a+3]=o&255,a+4};I.prototype.writeIntLE=function(o,a,s,m){if(o=+o,a=a>>>0,!m){var h=Math.pow(2,8*s-1);Ke(this,o,a,s,h-1,-h)}var T=0,A=1,S=0;for(this[a]=o&255;++T<s&&(A*=256);)o<0&&S===0&&this[a+T-1]!==0&&(S=1),this[a+T]=(o/A>>0)-S&255;return a+s};I.prototype.writeIntBE=function(o,a,s,m){if(o=+o,a=a>>>0,!m){var h=Math.pow(2,8*s-1);Ke(this,o,a,s,h-1,-h)}var T=s-1,A=1,S=0;for(this[a+T]=o&255;--T>=0&&(A*=256);)o<0&&S===0&&this[a+T+1]!==0&&(S=1),this[a+T]=(o/A>>0)-S&255;return a+s};I.prototype.writeInt8=function(o,a,s){return o=+o,a=a>>>0,s||Ke(this,o,a,1,127,-128),o<0&&(o=255+o+1),this[a]=o&255,a+1};I.prototype.writeInt16LE=function(o,a,s){return o=+o,a=a>>>0,s||Ke(this,o,a,2,32767,-32768),this[a]=o&255,this[a+1]=o>>>8,a+2};I.prototype.writeInt16BE=function(o,a,s){return o=+o,a=a>>>0,s||Ke(this,o,a,2,32767,-32768),this[a]=o>>>8,this[a+1]=o&255,a+2};I.prototype.writeInt32LE=function(o,a,s){return o=+o,a=a>>>0,s||Ke(this,o,a,4,2147483647,-2147483648),this[a]=o&255,this[a+1]=o>>>8,this[a+2]=o>>>16,this[a+3]=o>>>24,a+4};I.prototype.writeInt32BE=function(o,a,s){return o=+o,a=a>>>0,s||Ke(this,o,a,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),this[a]=o>>>24,this[a+1]=o>>>16,this[a+2]=o>>>8,this[a+3]=o&255,a+4};function Jl(t,o,a,s,m,h){if(a+s>t.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function Ql(t,o,a,s,m){return o=+o,a=a>>>0,m||Jl(t,o,a,4,34028234663852886e22,-34028234663852886e22),uo.write(t,o,a,s,23,4),a+4}I.prototype.writeFloatLE=function(o,a,s){return Ql(this,o,a,!0,s)};I.prototype.writeFloatBE=function(o,a,s){return Ql(this,o,a,!1,s)};function e_(t,o,a,s,m){return o=+o,a=a>>>0,m||Jl(t,o,a,8,17976931348623157e292,-17976931348623157e292),uo.write(t,o,a,s,52,8),a+8}I.prototype.writeDoubleLE=function(o,a,s){return e_(this,o,a,!0,s)};I.prototype.writeDoubleBE=function(o,a,s){return e_(this,o,a,!1,s)};I.prototype.copy=function(o,a,s,m){if(!I.isBuffer(o))throw new TypeError("argument should be a Buffer");if(s||(s=0),!m&&m!==0&&(m=this.length),a>=o.length&&(a=o.length),a||(a=0),m>0&&m<s&&(m=s),m===s||o.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(m<0)throw new RangeError("sourceEnd out of bounds");m>this.length&&(m=this.length),o.length-a<m-s&&(m=o.length-a+s);var h=m-s;return this===o&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(a,s,m):Uint8Array.prototype.set.call(o,this.subarray(s,m),a),h};I.prototype.fill=function(o,a,s,m){if(typeof o=="string"){if(typeof a=="string"?(m=a,a=0,s=this.length):typeof s=="string"&&(m=s,s=this.length),m!==void 0&&typeof m!="string")throw new TypeError("encoding must be a string");if(typeof m=="string"&&!I.isEncoding(m))throw new TypeError("Unknown encoding: "+m);if(o.length===1){var h=o.charCodeAt(0);(m==="utf8"&&h<128||m==="latin1")&&(o=h)}}else typeof o=="number"?o=o&255:typeof o=="boolean"&&(o=Number(o));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,o||(o=0);var T;if(typeof o=="number")for(T=a;T<s;++T)this[T]=o;else{var A=I.isBuffer(o)?o:I.from(o,m),S=A.length;if(S===0)throw new TypeError('The value "'+o+'" is invalid for argument "value"');for(T=0;T<s-a;++T)this[T+a]=A[T%S]}return this};var yS=/[^+/0-9A-Za-z-_]/g;function bS(t){if(t=t.split("=")[0],t=t.trim().replace(yS,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Vc(t,o){o=o||1/0;for(var a,s=t.length,m=null,h=[],T=0;T<s;++T){if(a=t.charCodeAt(T),a>55295&&a<57344){if(!m){if(a>56319){(o-=3)>-1&&h.push(239,191,189);continue}else if(T+1===s){(o-=3)>-1&&h.push(239,191,189);continue}m=a;continue}if(a<56320){(o-=3)>-1&&h.push(239,191,189),m=a;continue}a=(m-55296<<10|a-56320)+65536}else m&&(o-=3)>-1&&h.push(239,191,189);if(m=null,a<128){if((o-=1)<0)break;h.push(a)}else if(a<2048){if((o-=2)<0)break;h.push(a>>6|192,a&63|128)}else if(a<65536){if((o-=3)<0)break;h.push(a>>12|224,a>>6&63|128,a&63|128)}else if(a<1114112){if((o-=4)<0)break;h.push(a>>18|240,a>>12&63|128,a>>6&63|128,a&63|128)}else throw new Error("Invalid code point")}return h}function wS(t){for(var o=[],a=0;a<t.length;++a)o.push(t.charCodeAt(a)&255);return o}function SS(t,o){for(var a,s,m,h=[],T=0;T<t.length&&!((o-=2)<0);++T)a=t.charCodeAt(T),s=a>>8,m=a%256,h.push(m),h.push(s);return h}function n_(t){return Gc.toByteArray(bS(t))}function wa(t,o,a,s){for(var m=0;m<s&&!(m+a>=o.length||m>=t.length);++m)o[m+a]=t[m];return m}function On(t,o){return t instanceof o||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===o.name}function Kc(t){return t!==t}var vS=function(){for(var t="0123456789abcdef",o=new Array(256),a=0;a<16;++a)for(var s=a*16,m=0;m<16;++m)o[s+m]=t[a]+t[m];return o}()});var c_=rr((kA,i_)=>{i();var be=i_.exports={},Fn,Bn;function Xc(){throw new Error("setTimeout has not been defined")}function Zc(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Fn=setTimeout:Fn=Xc}catch(t){Fn=Xc}try{typeof clearTimeout=="function"?Bn=clearTimeout:Bn=Zc}catch(t){Bn=Zc}})();function o_(t){if(Fn===setTimeout)return setTimeout(t,0);if((Fn===Xc||!Fn)&&setTimeout)return Fn=setTimeout,setTimeout(t,0);try{return Fn(t,0)}catch(o){try{return Fn.call(null,t,0)}catch(a){return Fn.call(this,t,0)}}}function AS(t){if(Bn===clearTimeout)return clearTimeout(t);if((Bn===Zc||!Bn)&&clearTimeout)return Bn=clearTimeout,clearTimeout(t);try{return Bn(t)}catch(o){try{return Bn.call(null,t)}catch(a){return Bn.call(this,t)}}}var Jn=[],go=!1,Wt,Sa=-1;function IS(){!go||!Wt||(go=!1,Wt.length?Jn=Wt.concat(Jn):Sa=-1,Jn.length&&r_())}function r_(){if(!go){var t=o_(IS);go=!0;for(var o=Jn.length;o;){for(Wt=Jn,Jn=[];++Sa<o;)Wt&&Wt[Sa].run();Sa=-1,o=Jn.length}Wt=null,go=!1,AS(t)}}be.nextTick=function(t){var o=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)o[a-1]=arguments[a];Jn.push(new a_(t,o)),Jn.length===1&&!go&&o_(r_)};function a_(t,o){this.fun=t,this.array=o}a_.prototype.run=function(){this.fun.apply(null,this.array)};be.title="browser";be.browser=!0;be.env={};be.argv=[];be.version="";be.versions={};function Qn(){}be.on=Qn;be.addListener=Qn;be.once=Qn;be.off=Qn;be.removeListener=Qn;be.removeAllListeners=Qn;be.emit=Qn;be.prependListener=Qn;be.prependOnceListener=Qn;be.listeners=function(t){return[]};be.binding=function(t){throw new Error("process.binding is not supported")};be.cwd=function(){return"/"};be.chdir=function(t){throw new Error("process.chdir is not supported")};be.umask=function(){return 0}});var u,f,kS,d,i=V(()=>{u=P(t_()),f=P(c_()),kS=function(t){function o(){var s=this||self;return delete t.prototype.__magic__,s}if(typeof globalThis=="object")return globalThis;if(this)return o();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:o});var a=__magic__;return a}(Object),d=kS});var ka,es=V(()=>{"use strict";i();ka=()=>Date.now()/1e3});var w_=V(()=>{"use strict";i()});var S_=V(()=>{"use strict";i()});var ns=V(()=>{"use strict";i();es();w_();S_()});var os={};Ft(os,{getItem:()=>$S,localStorageKeys:()=>bt,removeItem:()=>HS,setItem:()=>GS});var bt,ts,GS,$S,HS,To=V(()=>{"use strict";i();ns();bt={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},ts=typeof localStorage!="undefined",GS=({key:t,data:o,expires:a})=>{!ts||localStorage.setItem(String(t),JSON.stringify({expires:a,data:o}))},$S=t=>{if(!ts)return;let o=localStorage.getItem(String(t));if(!o)return null;let a=JSON.parse(o);return!a||!a.hasOwnProperty("expires")||!a.hasOwnProperty("data")?null:ka()>=a.expires?(localStorage.removeItem(String(t)),null):a.data},HS=t=>{!ts||localStorage.removeItem(String(t))}});var rs={};Ft(rs,{clear:()=>k_,getItem:()=>A_,removeItem:()=>I_,setItem:()=>v_,storage:()=>VS});var v_,A_,I_,k_,VS,E_=V(()=>{"use strict";i();v_=({key:t,data:o,expires:a})=>{sessionStorage.setItem(String(t),JSON.stringify({expires:a,data:o}))},A_=t=>{let o=sessionStorage.getItem(String(t));if(!o)return null;let a=JSON.parse(o);return!a||!a.hasOwnProperty("expires")||!a.hasOwnProperty("data")?null:Date.now()>=a.expires?(sessionStorage.removeItem(String(t)),null):a.data},I_=t=>sessionStorage.removeItem(String(t)),k_=()=>sessionStorage.clear(),VS={setItem:v_,getItem:A_,removeItem:I_,clear:k_}});var $t,xo=V(()=>{"use strict";i();To();E_();$t={session:rs,local:os}});function ir(){return new Date().setHours(new Date().getHours()+24)}function cr(t){$t.local.setItem({key:bt.loginExpiresAt,data:t,expires:t})}var as=V(()=>{"use strict";i();xo();To()});var Te=V(()=>{"use strict";i()});var yo=V(()=>{"use strict";i()});var L_=V(()=>{"use strict";i()});var is,De=V(()=>{"use strict";i();is=(s=>(s.nft="nft",s.esdt="esdt",s.egld="egld",s))(is||{})});var C_=V(()=>{"use strict";i()});var N_=V(()=>{"use strict";i()});var P_=V(()=>{"use strict";i()});var D_=V(()=>{"use strict";i()});var nn=V(()=>{"use strict";i();L_();De();Te();C_();N_();P_();D_()});var cs,R_,AI,M_,II,O_,F_,kI,EI,B_=V(()=>{"use strict";i();nn();cs={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:AI}=cs["devnet"],{chainId:M_,egldLabel:II}=cs["testnet"],{chainId:O_,egldLabel:F_}=cs["mainnet"],kI={["devnet"]:R_,["testnet"]:M_,["mainnet"]:O_},EI={[R_]:"devnet",[M_]:"testnet",[O_]:"mainnet"}});var ss=V(()=>{"use strict";i()});var U_=V(()=>{"use strict";i()});var Ea,ps=V(()=>{"use strict";i();Ea="transaction-status-toast-id"});var sr,La,Ce,Ht,W_,ms,G_,Ca,$_,H_,Wn,se=V(()=>{"use strict";i();yo();B_();ss();U_();ps();sr=5e4,La=1e9,Ce=18,Ht=4,W_=1,ms=4294967295,G_=4294967280,Ca="logout",$_="login",H_="refundedGas",Wn="0"});var ls,We,nt,Xe=V(()=>{"use strict";i();ls=require("@reduxjs/toolkit");se();We=(0,ls.createAction)(Ca),nt=(0,ls.createAction)($_,t=>({payload:t}))});var z_,V_,q_,qI,K_,zS,pr,X_,qS,Z_,Y_,_s=V(()=>{"use strict";i();z_=require("@reduxjs/toolkit");as();Te();Xe();V_={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},q_=(0,z_.createSlice)({name:"loginInfoSlice",initialState:V_,reducers:{setLoginMethod:(t,o)=>{t.loginMethod=o.payload},setTokenLogin:(t,o)=>{t.tokenLogin=o.payload},setTokenLoginSignature:(t,o)=>{(t==null?void 0:t.tokenLogin)!=null&&(t.tokenLogin.signature=o.payload)},setWalletLogin:(t,o)=>{t.walletLogin=o.payload},setWalletConnectLogin:(t,o)=>{t.walletConnectLogin=o.payload},setLedgerLogin:(t,o)=>{t.ledgerLogin=o.payload},invalidateLoginSession:t=>{t.isLoginSessionInvalid=!0}},extraReducers:t=>{t.addCase(We,()=>V_),t.addCase(nt,(o,a)=>{o.loginMethod=a.payload.loginMethod,cr(ir())})}}),{setLoginMethod:qI,setWalletConnectLogin:K_,setLedgerLogin:zS,setTokenLogin:pr,setTokenLoginSignature:X_,setWalletLogin:qS,invalidateLoginSession:Z_}=q_.actions,Y_=q_.reducer});var mr=V(()=>{"use strict";i()});var J_=V(()=>{"use strict";i();mr()});function ds(t){return t[Math.floor(Math.random()*t.length)]}var Q_=V(()=>{"use strict";i()});var us=V(()=>{"use strict";i();ss()});var bo=V(()=>{"use strict";i();J_();Q_();us()});var ed,nd,fs,KS,td,ck,sk,od,gs=V(()=>{"use strict";i();ed=require("@reduxjs/toolkit"),nd=P(require("lodash.omit"));bo();fs={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},KS={network:fs,chainID:"-1"},td=(0,ed.createSlice)({name:"appConfig",initialState:KS,reducers:{initializeNetworkConfig:(t,o)=>{let a=ds(o.payload.walletConnectBridgeAddresses),s=ds(o.payload.walletConnectV2RelayAddresses),m=(0,nd.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");t.network=J(F(F({},t.network),m),{walletConnectBridgeAddress:a,walletConnectV2RelayAddress:s})},setChainID:(t,o)=>{t.chainID=o.payload}}}),{initializeNetworkConfig:ck,setChainID:sk}=td.actions,od=td.reducer});var Ts,rd,ad,Na,hs,id,xs,gk,ys,hk,XS,ZS,Tk,xk,yk,YS,cd,bs=V(()=>{"use strict";i();Ts=require("@elrondnetwork/erdjs"),rd=require("@reduxjs/toolkit"),ad=require("redux-persist");se();xo();To();Xe();Na={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Wn},hs={address:"",websocketEvent:null,accounts:{"":Na},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},id=(0,rd.createSlice)({name:"accountInfoSlice",initialState:hs,reducers:{setAddress:(t,o)=>{let a=o.payload;t.address=a,t.publicKey=new Ts.Address(a).hex()},setAccount:(t,o)=>{let a=t.address===o.payload.address;t.accounts={[t.address]:a?o.payload:Na},t.isAccountLoading=!1,t.accountLoadingError=null},setAccountNonce:(t,o)=>{let{address:a}=t;t.accounts[a].nonce=o.payload},setAccountShard:(t,o)=>{t.shard=o.payload},setLedgerAccount:(t,o)=>{t.ledgerAccount=o.payload},updateLedgerAccount:(t,o)=>{t.ledgerAccount!=null&&(t.ledgerAccount.index=o.payload.index,t.ledgerAccount.address=o.payload.address)},setWalletConnectAccount:(t,o)=>{t.walletConnectAccount=o.payload},setIsAccountLoading:(t,o)=>{t.isAccountLoading=o.payload,t.accountLoadingError=null},setAccountLoadingError:(t,o)=>{t.accountLoadingError=o.payload,t.isAccountLoading=!1},setWebsocketEvent:(t,o)=>{t.websocketEvent={timestamp:Date.now(),message:o.payload}}},extraReducers:t=>{t.addCase(We,()=>($t.local.removeItem(bt.loginExpiresAt),hs)),t.addCase(nt,(o,a)=>{let{address:s}=a.payload;o.address=s,o.publicKey=new Ts.Address(s).hex()}),t.addCase(ad.REHYDRATE,(o,a)=>{var N;if(!((N=a.payload)!=null&&N.account))return;let{account:s}=a.payload,{address:m,shard:h,accounts:T,publicKey:A}=s;o.address=m,o.shard=h;let S=T&&m in T;o.accounts=S?T:hs.accounts,o.publicKey=A})}}),{setAccount:xs,setAddress:gk,setAccountNonce:ys,setAccountShard:hk,setLedgerAccount:XS,updateLedgerAccount:ZS,setWalletConnectAccount:Tk,setIsAccountLoading:xk,setAccountLoadingError:yk,setWebsocketEvent:YS}=id.actions,cd=id.reducer});function wo(t){return t!=null&&(rv(t)||sv(t))}function So(t){return t!=null&&(av(t)||pv(t))}function vo(t){return t!=null&&(iv(t)||mv(t))}function ws(t){return t!=null&&cv(t)}function rv(t){return t!=null&&jS.includes(t)}function av(t){return t!=null&&JS.includes(t)}function iv(t){return t!=null&&QS.includes(t)}function cv(t){return t!=null&&ev.includes(t)}function sv(t){return t!=null&&nv.includes(t)}function pv(t){return t!=null&&tv.includes(t)}function mv(t){return t!=null&&ov.includes(t)}var jS,JS,QS,ev,nv,tv,ov,Ao=V(()=>{"use strict";i();Te();jS=["sent"],JS=["success"],QS=["fail","cancelled","timedOut"],ev=["timedOut"],nv=["pending"],tv=["success"],ov=["fail","invalid"]});var sd,pd,_r,lv,md,ld,_d,_v,Pa,dv,uv,Lk,fv,Da,Ss,Ra,Ma=V(()=>{"use strict";i();sd=require("@reduxjs/toolkit"),pd=require("redux-persist");Te();Ao();Xe();_r={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},lv={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},md=(0,sd.createSlice)({name:"transactionsSlice",initialState:_r,reducers:{moveTransactionsToSignedState:(t,o)=>{var S,N;let{sessionId:a,transactions:s,errorMessage:m,status:h,redirectRoute:T}=o.payload,A=((S=t.customTransactionInformationForSessionId)==null?void 0:S[a])||lv;t.signedTransactions[a]={transactions:s,status:h,errorMessage:m,redirectRoute:T,customTransactionInformation:A},((N=t==null?void 0:t.transactionsToSign)==null?void 0:N.sessionId)===a&&(t.transactionsToSign=_r.transactionsToSign)},clearSignedTransaction:(t,o)=>{t.signedTransactions[o.payload]&&delete t.signedTransactions[o.payload]},clearTransactionToSign:t=>{t!=null&&t.transactionsToSign&&(t.transactionsToSign=null)},updateSignedTransaction:(t,o)=>{t.signedTransactions=F(F({},t.signedTransactions),o.payload)},updateSignedTransactions:(t,o)=>{let{sessionId:a,status:s,errorMessage:m,transactions:h}=o.payload;t.signedTransactions[a]!=null&&(t.signedTransactions[a].status=s,m!=null&&(t.signedTransactions[a].errorMessage=m),h!=null&&(t.signedTransactions[a].transactions=h))},updateSignedTransactionStatus:(t,o)=>{var A,S,N,O,R,W;let{sessionId:a,status:s,errorMessage:m,transactionHash:h}=o.payload,T=(S=(A=t.signedTransactions)==null?void 0:A[a])==null?void 0:S.transactions;if(T!=null){t.signedTransactions[a].transactions=T.map(me=>me.hash===h?J(F({},me),{status:s,errorMessage:m}):me);let ee=(O=(N=t.signedTransactions[a])==null?void 0:N.transactions)==null?void 0:O.every(me=>So(me.status)),ne=(W=(R=t.signedTransactions[a])==null?void 0:R.transactions)==null?void 0:W.every(me=>vo(me.status));ee&&(t.signedTransactions[a].status="success"),ne&&(t.signedTransactions[a].status="fail")}},setTransactionsToSign:(t,o)=>{t.transactionsToSign=o.payload;let{sessionId:a,customTransactionInformation:s}=o.payload;t.customTransactionInformationForSessionId[a]=s,t.signTransactionsError=null},clearAllTransactionsToSign:t=>{t.transactionsToSign=_r.transactionsToSign,t.signTransactionsError=null},clearAllSignedTransactions:t=>{t.signedTransactions=_r.signedTransactions},setSignTransactionsError:(t,o)=>{t.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(t,o)=>{t.signTransactionsCancelMessage=o.payload}},extraReducers:t=>{t.addCase(We,()=>_r),t.addCase(pd.REHYDRATE,(o,a)=>{var T;if(o.signTransactionsCancelMessage=null,!((T=a.payload)!=null&&T.transactions))return;let{signedTransactions:s,customTransactionInformationForSessionId:m}=a.payload.transactions,h=Object.entries(s).reduce((A,[S,N])=>{let O=new Date(S),R=new Date;return R.setHours(R.getHours()+5),R-O>0||(A[S]=N),A},{});m!=null&&(o.customTransactionInformationForSessionId=m),s!=null&&(o.signedTransactions=h)})}}),{updateSignedTransactionStatus:ld,updateSignedTransactions:_d,setTransactionsToSign:_v,clearAllTransactionsToSign:Pa,clearAllSignedTransactions:dv,clearSignedTransaction:uv,clearTransactionToSign:Lk,setSignTransactionsError:fv,setSignTransactionsCancelMessage:Da,moveTransactionsToSignedState:Ss}=md.actions,Ra=md.reducer});var dd,As,Is,ks,gv,vs,ud,Dk,hv,Es,Oa,Fa=V(()=>{"use strict";i();dd=require("@reduxjs/toolkit");Xe();As="Transaction failed",Is="Transaction successful",ks="Processing transaction",gv="Transaction submitted",vs={},ud=(0,dd.createSlice)({name:"transactionsInfo",initialState:vs,reducers:{setTransactionsDisplayInfo(t,o){let{sessionId:a,transactionsDisplayInfo:s}=o.payload;a!=null&&(t[a]={errorMessage:(s==null?void 0:s.errorMessage)||As,successMessage:(s==null?void 0:s.successMessage)||Is,processingMessage:(s==null?void 0:s.processingMessage)||ks,submittedMessage:(s==null?void 0:s.submittedMessage)||gv,transactionDuration:s==null?void 0:s.transactionDuration})},clearTransactionsInfoForSessionId(t,o){o.payload!=null&&delete t[o.payload]},clearTransactionsInfo:()=>vs},extraReducers:t=>{t.addCase(We,()=>vs)}}),{clearTransactionsInfo:Dk,setTransactionsDisplayInfo:hv,clearTransactionsInfoForSessionId:Es}=ud.actions,Oa=ud.reducer});var gd,fd,hd,Fk,Tv,Bk,xv,Td,Ls=V(()=>{"use strict";i();gd=require("@reduxjs/toolkit");Xe();fd={},hd=(0,gd.createSlice)({name:"modalsSlice",initialState:fd,reducers:{setTxSubmittedModal:(t,o)=>{t.txSubmittedModal=o.payload},setNotificationModal:(t,o)=>{t.notificationModal=o.payload},clearTxSubmittedModal:t=>{t.txSubmittedModal=void 0},clearNotificationModal:t=>{t.notificationModal=void 0}},extraReducers:t=>{t.addCase(We,()=>fd)}}),{setTxSubmittedModal:Fk,setNotificationModal:Tv,clearTxSubmittedModal:Bk,clearNotificationModal:xv}=hd.actions,Td=hd.reducer});var yd,bd,xd,wd,yv,Cs,qk,Kk,Xk,Zk,Ba,Ua=V(()=>{"use strict";i();yd=require("@reduxjs/toolkit"),bd=require("redux-persist");ps();nn();es();Xe();xd={customToasts:[],transactionToasts:[],failTransactionToast:null},wd=(0,yd.createSlice)({name:"toastsSlice",initialState:xd,reducers:{addCustomToast:(t,o)=>{t.customToasts.push(J(F({},o.payload),{type:"custom",toastId:o.payload.toastId||`custom-toast-${t.customToasts.length+1}`}))},removeCustomToast:(t,o)=>{t.customToasts=t.customToasts.filter(a=>a.toastId!==o.payload)},addTransactionToast:(t,o)=>{t.transactionToasts.push({type:"transaction",startTimestamp:ka(),toastId:o.payload||`custom-toast-${t.transactionToasts.length+1}`})},removeTransactionToast:(t,o)=>{t.transactionToasts=t.transactionToasts.filter(a=>a.toastId!==o.payload)},addFailTransactionToast:(t,o)=>{t.failTransactionToast=J(F({},o.payload),{toastId:Ea})},removeFailTransactionToast:t=>{t.failTransactionToast=null}},extraReducers:t=>{t.addCase(We,()=>xd),t.addCase(bd.REHYDRATE,(o,a)=>{var m,h;let s=(h=(m=a.customToasts)==null?void 0:m.filter(T=>!("component"in T)))!=null?h:[];o.customToasts=s})}}),{addCustomToast:yv,removeCustomToast:Cs,addTransactionToast:qk,removeTransactionToast:Kk,addFailTransactionToast:Xk,removeFailTransactionToast:Zk}=wd.actions,Ba=wd.reducer});var de=V(()=>{"use strict";i();_s();gs();bs();Ma();Fa();Ls();Ua()});var Ns=V(()=>{"use strict";i()});var Id,Ad,kd,fE,gE,hE,TE,xE,yE,Ed,Ld=V(()=>{"use strict";i();Id=require("@reduxjs/toolkit");Xe();Ad={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},kd=(0,Id.createSlice)({name:"dappModalsSlice",initialState:Ad,reducers:{setDappModalVisibility:(t,o)=>{t.visible=o.payload},setDappModalHeaderVisibility:(t,o)=>{t.modal.showHeader=o.payload},setDappModalFooterVisibility:(t,o)=>{t.modal.showFooter=o.payload},setDappModalHeaderText:(t,o)=>{t.modal.headerText=o.payload},setDappModalFooterText:(t,o)=>{t.modal.footerText=o.payload},setDappModalConfig:(t,o)=>{t.modal=F({},o.payload)}},extraReducers:t=>{t.addCase(We,()=>Ad)}}),{setDappModalVisibility:fE,setDappModalHeaderVisibility:gE,setDappModalFooterVisibility:hE,setDappModalHeaderText:TE,setDappModalFooterText:xE,setDappModalConfig:yE}=kd.actions,Ed=kd.reducer});var Cd,vv,Av,Io,Ga=V(()=>{"use strict";i();Cd=require("@reduxjs/toolkit");Ns();bs();Ld();_s();Ls();gs();Ua();Fa();Ma();vv={["account"]:cd,["networkConfig"]:od,["loginInfo"]:Y_,["modals"]:Td,["dappModal"]:Ed,["toasts"]:Ba,["transactions"]:Ra,["transactionsInfo"]:Oa},Av=(t={})=>(0,Cd.combineReducers)(F(F({},vv),t)),Io=Av});var Dd={};Ft(Dd,{default:()=>Pv});function Ps(t,o=[]){return{key:t,version:1,storage:Pd.default,blacklist:o}}var zt,Nd,Pd,Iv,kv,Ev,Lv,Cv,Nv,Pv,Rd=V(()=>{"use strict";i();zt=require("redux-persist"),Nd=P(require("redux-persist/lib/storage")),Pd=P(require("redux-persist/lib/storage/session"));Ga();de();Ua();Fa();Ma();Ns();Iv={2:t=>J(F({},t),{networkConfig:fs})};kv=Ps("dapp-core-transactionsInfo"),Ev=Ps("dapp-core-transactions",["transactionsToSign"]),Lv=Ps("dapp-core-toasts"),Cv={key:"dapp-core-store",version:2,storage:Nd.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,zt.createMigrate)(Iv,{debug:!1})},Nv={["toasts"]:(0,zt.persistReducer)(Lv,Ba),["transactions"]:(0,zt.persistReducer)(Ev,Ra),["transactionsInfo"]:(0,zt.persistReducer)(kv,Oa)},Pv=(0,zt.persistReducer)(Cv,Io(Nv))});var Md={};Ft(Md,{default:()=>Dv});var Dv,Od=V(()=>{"use strict";i();Ga();Dv=Io()});var Fd={};Ft(Fd,{default:()=>Mv});var un,Rv,Mv,Bd=V(()=>{"use strict";i();un=require("redux-persist"),Rv=[un.FLUSH,un.REHYDRATE,un.PAUSE,un.PERSIST,un.PURGE,un.REGISTER],Mv=Rv});var Gd={};Ft(Gd,{default:()=>Wd});function Wd(t){return(0,Ud.persistStore)(t)}var Ud,$d=V(()=>{"use strict";i();Ud=require("redux-persist")});var af=rr((No,Tr)=>{i();(function(){var t,o="4.17.21",a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",m="Expected a function",h="Invalid `variable` option passed into `_.template`",T="__lodash_hash_undefined__",A=500,S="__lodash_placeholder__",N=1,O=2,R=4,W=1,ee=2,ne=1,me=2,It=4,Tn=8,xn=16,Re=32,Ie=64,$e=128,Ln=256,Ro=512,gi=30,Zf="...",Yf=800,jf=16,ap=1,Jf=2,Qf=3,kt=1/0,pt=9007199254740991,eg=17976931348623157e292,Ir=0/0,Cn=4294967295,ng=Cn-1,tg=Cn>>>1,og=[["ary",$e],["bind",ne],["bindKey",me],["curry",Tn],["curryRight",xn],["flip",Ro],["partial",Re],["partialRight",Ie],["rearg",Ln]],Jt="[object Arguments]",kr="[object Array]",rg="[object AsyncFunction]",Mo="[object Boolean]",Oo="[object Date]",ag="[object DOMException]",Er="[object Error]",Lr="[object Function]",ip="[object GeneratorFunction]",yn="[object Map]",Fo="[object Number]",ig="[object Null]",Gn="[object Object]",cp="[object Promise]",cg="[object Proxy]",Bo="[object RegExp]",bn="[object Set]",Uo="[object String]",Cr="[object Symbol]",sg="[object Undefined]",Wo="[object WeakMap]",pg="[object WeakSet]",Go="[object ArrayBuffer]",Qt="[object DataView]",hi="[object Float32Array]",Ti="[object Float64Array]",xi="[object Int8Array]",yi="[object Int16Array]",bi="[object Int32Array]",wi="[object Uint8Array]",Si="[object Uint8ClampedArray]",vi="[object Uint16Array]",Ai="[object Uint32Array]",mg=/\b__p \+= '';/g,lg=/\b(__p \+=) '' \+/g,_g=/(__e\(.*?\)|\b__t\)) \+\n'';/g,sp=/&(?:amp|lt|gt|quot|#39);/g,pp=/[&<>"']/g,dg=RegExp(sp.source),ug=RegExp(pp.source),fg=/<%-([\s\S]+?)%>/g,gg=/<%([\s\S]+?)%>/g,mp=/<%=([\s\S]+?)%>/g,hg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tg=/^\w*$/,xg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ii=/[\\^$.*+?()[\]{}|]/g,yg=RegExp(Ii.source),ki=/^\s+/,bg=/\s/,wg=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Sg=/\{\n\/\* \[wrapped with (.+)\] \*/,vg=/,? & /,Ag=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ig=/[()=,{}\[\]\/\s]/,kg=/\\(\\)?/g,Eg=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,lp=/\w*$/,Lg=/^[-+]0x[0-9a-f]+$/i,Cg=/^0b[01]+$/i,Ng=/^\[object .+?Constructor\]$/,Pg=/^0o[0-7]+$/i,Dg=/^(?:0|[1-9]\d*)$/,Rg=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nr=/($^)/,Mg=/['\n\r\u2028\u2029\\]/g,Pr="\\ud800-\\udfff",Og="\\u0300-\\u036f",Fg="\\ufe20-\\ufe2f",Bg="\\u20d0-\\u20ff",_p=Og+Fg+Bg,dp="\\u2700-\\u27bf",up="a-z\\xdf-\\xf6\\xf8-\\xff",Ug="\\xac\\xb1\\xd7\\xf7",Wg="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Gg="\\u2000-\\u206f",$g=" \\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",fp="A-Z\\xc0-\\xd6\\xd8-\\xde",gp="\\ufe0e\\ufe0f",hp=Ug+Wg+Gg+$g,Ei="['\u2019]",Hg="["+Pr+"]",Tp="["+hp+"]",Dr="["+_p+"]",xp="\\d+",Vg="["+dp+"]",yp="["+up+"]",bp="[^"+Pr+hp+xp+dp+up+fp+"]",Li="\\ud83c[\\udffb-\\udfff]",zg="(?:"+Dr+"|"+Li+")",wp="[^"+Pr+"]",Ci="(?:\\ud83c[\\udde6-\\uddff]){2}",Ni="[\\ud800-\\udbff][\\udc00-\\udfff]",eo="["+fp+"]",Sp="\\u200d",vp="(?:"+yp+"|"+bp+")",qg="(?:"+eo+"|"+bp+")",Ap="(?:"+Ei+"(?:d|ll|m|re|s|t|ve))?",Ip="(?:"+Ei+"(?:D|LL|M|RE|S|T|VE))?",kp=zg+"?",Ep="["+gp+"]?",Kg="(?:"+Sp+"(?:"+[wp,Ci,Ni].join("|")+")"+Ep+kp+")*",Xg="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Lp=Ep+kp+Kg,Yg="(?:"+[Vg,Ci,Ni].join("|")+")"+Lp,jg="(?:"+[wp+Dr+"?",Dr,Ci,Ni,Hg].join("|")+")",Jg=RegExp(Ei,"g"),Qg=RegExp(Dr,"g"),Pi=RegExp(Li+"(?="+Li+")|"+jg+Lp,"g"),eh=RegExp([eo+"?"+yp+"+"+Ap+"(?="+[Tp,eo,"$"].join("|")+")",qg+"+"+Ip+"(?="+[Tp,eo+vp,"$"].join("|")+")",eo+"?"+vp+"+"+Ap,eo+"+"+Ip,Zg,Xg,xp,Yg].join("|"),"g"),nh=RegExp("["+Sp+Pr+_p+gp+"]"),th=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,oh=["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"],rh=-1,ue={};ue[hi]=ue[Ti]=ue[xi]=ue[yi]=ue[bi]=ue[wi]=ue[Si]=ue[vi]=ue[Ai]=!0,ue[Jt]=ue[kr]=ue[Go]=ue[Mo]=ue[Qt]=ue[Oo]=ue[Er]=ue[Lr]=ue[yn]=ue[Fo]=ue[Gn]=ue[Bo]=ue[bn]=ue[Uo]=ue[Wo]=!1;var _e={};_e[Jt]=_e[kr]=_e[Go]=_e[Qt]=_e[Mo]=_e[Oo]=_e[hi]=_e[Ti]=_e[xi]=_e[yi]=_e[bi]=_e[yn]=_e[Fo]=_e[Gn]=_e[Bo]=_e[bn]=_e[Uo]=_e[Cr]=_e[wi]=_e[Si]=_e[vi]=_e[Ai]=!0,_e[Er]=_e[Lr]=_e[Wo]=!1;var ah={\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