@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 274 kB
JavaScript
"use strict";var Vw=Object.create;var or=Object.defineProperty,zw=Object.defineProperties,qw=Object.getOwnPropertyDescriptor,Kw=Object.getOwnPropertyDescriptors,Xw=Object.getOwnPropertyNames,xa=Object.getOwnPropertySymbols,Zw=Object.getPrototypeOf,Vc=Object.prototype.hasOwnProperty,Vl=Object.prototype.propertyIsEnumerable;var Hl=(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={}))Vc.call(o,a)&&Hl(t,a,o[a]);if(xa)for(var a of xa(o))Vl.call(o,a)&&Hl(t,a,o[a]);return t},J=(t,o)=>zw(t,Kw(o));var Rn=(t,o)=>{var a={};for(var s in t)Vc.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&&Vl.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})},zl=(t,o,a,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of Xw(o))!Vc.call(t,m)&&m!==a&&or(t,m,{get:()=>o[m],enumerable:!(s=qw(o,m))||s.enumerable});return t};var P=(t,o,a)=>(a=t!=null?Vw(Zw(t)):{},zl(o||!t||!t.__esModule?or(a,"default",{value:t,enumerable:!0}):a,t)),ar=t=>zl(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 Xl=rr(ya=>{"use strict";i();ya.byteLength=jw;ya.toByteArray=Qw;ya.fromByteArray=tS;var Mn=[],_n=[],Yw=typeof Uint8Array!="undefined"?Uint8Array:Array,zc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Bt=0,ql=zc.length;Bt<ql;++Bt)Mn[Bt]=zc[Bt],_n[zc.charCodeAt(Bt)]=Bt;var Bt,ql;_n["-".charCodeAt(0)]=62;_n["_".charCodeAt(0)]=63;function Kl(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 jw(t){var o=Kl(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 Qw(t){var o,a=Kl(t),s=a[0],m=a[1],h=new Yw(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 eS(t){return Mn[t>>18&63]+Mn[t>>12&63]+Mn[t>>6&63]+Mn[t&63]}function nS(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(eS(s));return m.join("")}function tS(t){for(var o,a=t.length,s=a%3,m=[],h=16383,T=0,A=a-s;T<A;T+=h)m.push(nS(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 Zl=rr(qc=>{i();qc.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)};qc.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 s_=rr(fo=>{"use strict";i();var Kc=Xl(),uo=Zl(),Yl=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;fo.Buffer=I;fo.SlowBuffer=sS;fo.INSPECT_MAX_BYTES=50;var ba=2147483647;fo.kMaxLength=ba;I.TYPED_ARRAY_SUPPORT=oS();!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 oS(){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 jc(t)}return Ql(t,o,a)}I.poolSize=8192;function Ql(t,o,a){if(typeof t=="string")return aS(t,o);if(ArrayBuffer.isView(t))return iS(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 Zc(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=cS(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 Ql(t,o,a)};Object.setPrototypeOf(I.prototype,Uint8Array.prototype);Object.setPrototypeOf(I,Uint8Array);function e_(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 rS(t,o,a){return e_(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 rS(t,o,a)};function jc(t){return e_(t),jn(t<0?0:Jc(t)|0)}I.allocUnsafe=function(t){return jc(t)};I.allocUnsafeSlow=function(t){return jc(t)};function aS(t,o){if((typeof o!="string"||o==="")&&(o="utf8"),!I.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var a=n_(t,o)|0,s=jn(a),m=s.write(t,o);return m!==a&&(s=s.slice(0,m)),s}function Xc(t){for(var o=t.length<0?0:Jc(t.length)|0,a=jn(o),s=0;s<o;s+=1)a[s]=t[s]&255;return a}function iS(t){if(On(t,Uint8Array)){var o=new Uint8Array(t);return Zc(o.buffer,o.byteOffset,o.byteLength)}return Xc(t)}function Zc(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 cS(t){if(I.isBuffer(t)){var o=Jc(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"||Qc(t.length)?jn(0):Xc(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Xc(t.data)}function Jc(t){if(t>=ba)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ba.toString(16)+" bytes");return t|0}function sS(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 n_(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 Yc(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a*2;case"hex":return a>>>1;case"base64":return c_(t).length;default:if(m)return s?-1:Yc(t).length;o=(""+o).toLowerCase(),m=!0}}I.byteLength=n_;function pS(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 xS(this,o,a);case"utf8":case"utf-8":return o_(this,o,a);case"ascii":return hS(this,o,a);case"latin1":case"binary":return TS(this,o,a);case"base64":return fS(this,o,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return yS(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?o_(this,0,o):pS.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+">"};Yl&&(I.prototype[Yl]=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 t_(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,Qc(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:jl(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):jl(t,[o],a,s,m);throw new TypeError("val must be string, number or Buffer")}function jl(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 t_(this,o,a,s,!0)};I.prototype.lastIndexOf=function(o,a,s){return t_(this,o,a,s,!1)};function mS(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(Qc(A))return T;t[a+T]=A}return T}function lS(t,o,a,s){return wa(Yc(o,t.length-a),t,a,s)}function _S(t,o,a,s){return wa(SS(o),t,a,s)}function dS(t,o,a,s){return wa(c_(o),t,a,s)}function uS(t,o,a,s){return wa(vS(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 mS(this,o,a,s);case"utf8":case"utf-8":return lS(this,o,a,s);case"ascii":case"latin1":case"binary":return _S(this,o,a,s);case"base64":return dS(this,o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return uS(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 fS(t,o,a){return o===0&&a===t.length?Kc.fromByteArray(t):Kc.fromByteArray(t.slice(o,a))}function o_(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 gS(s)}var Jl=4096;function gS(t){var o=t.length;if(o<=Jl)return String.fromCharCode.apply(String,t);for(var a="",s=0;s<o;)a+=String.fromCharCode.apply(String,t.slice(s,s+=Jl));return a}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]&127);return s}function TS(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 xS(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+=AS[t[h]];return m}function yS(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 r_(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 a_(t,o,a,s,m){return o=+o,a=a>>>0,m||r_(t,o,a,4,34028234663852886e22,-34028234663852886e22),uo.write(t,o,a,s,23,4),a+4}I.prototype.writeFloatLE=function(o,a,s){return a_(this,o,a,!0,s)};I.prototype.writeFloatBE=function(o,a,s){return a_(this,o,a,!1,s)};function i_(t,o,a,s,m){return o=+o,a=a>>>0,m||r_(t,o,a,8,17976931348623157e292,-17976931348623157e292),uo.write(t,o,a,s,52,8),a+8}I.prototype.writeDoubleLE=function(o,a,s){return i_(this,o,a,!0,s)};I.prototype.writeDoubleBE=function(o,a,s){return i_(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 bS=/[^+/0-9A-Za-z-_]/g;function wS(t){if(t=t.split("=")[0],t=t.trim().replace(bS,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Yc(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 SS(t){for(var o=[],a=0;a<t.length;++a)o.push(t.charCodeAt(a)&255);return o}function vS(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 c_(t){return Kc.toByteArray(wS(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 Qc(t){return t!==t}var AS=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 d_=rr((kA,__)=>{i();var be=__.exports={},Fn,Bn;function es(){throw new Error("setTimeout has not been defined")}function ns(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Fn=setTimeout:Fn=es}catch(t){Fn=es}try{typeof clearTimeout=="function"?Bn=clearTimeout:Bn=ns}catch(t){Bn=ns}})();function p_(t){if(Fn===setTimeout)return setTimeout(t,0);if((Fn===es||!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 IS(t){if(Bn===clearTimeout)return clearTimeout(t);if((Bn===ns||!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 kS(){!go||!Wt||(go=!1,Wt.length?Jn=Wt.concat(Jn):Sa=-1,Jn.length&&m_())}function m_(){if(!go){var t=p_(kS);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,IS(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 l_(t,o)),Jn.length===1&&!go&&p_(m_)};function l_(t,o){this.fun=t,this.array=o}l_.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,ES,d,i=V(()=>{u=P(s_()),f=P(d_()),ES=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=ES});var ts,De=V(()=>{"use strict";i();ts=(s=>(s.nft="nft",s.esdt="esdt",s.egld="egld",s))(ts||{})});var Ea,os=V(()=>{"use strict";i();Ea=()=>Date.now()/1e3});var u_=V(()=>{"use strict";i()});var f_=V(()=>{"use strict";i()});var rs=V(()=>{"use strict";i();os();u_();f_()});var is={};Ft(is,{getItem:()=>DS,localStorageKeys:()=>yt,removeItem:()=>RS,setItem:()=>PS});var yt,as,PS,DS,RS,ho=V(()=>{"use strict";i();rs();yt={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},as=typeof localStorage!="undefined",PS=({key:t,data:o,expires:a})=>{!as||localStorage.setItem(String(t),JSON.stringify({expires:a,data:o}))},DS=t=>{if(!as)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:Ea()>=a.expires?(localStorage.removeItem(String(t)),null):a.data},RS=t=>{!as||localStorage.removeItem(String(t))}});var cs={};Ft(cs,{clear:()=>x_,getItem:()=>h_,removeItem:()=>T_,setItem:()=>g_,storage:()=>MS});var g_,h_,T_,x_,MS,y_=V(()=>{"use strict";i();g_=({key:t,data:o,expires:a})=>{sessionStorage.setItem(String(t),JSON.stringify({expires:a,data:o}))},h_=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},T_=t=>sessionStorage.removeItem(String(t)),x_=()=>sessionStorage.clear(),MS={setItem:g_,getItem:h_,removeItem:T_,clear:x_}});var Gt,To=V(()=>{"use strict";i();ho();y_();Gt={session:cs,local:is}});function cr(){return new Date().setHours(new Date().getHours()+24)}function sr(t){Gt.local.setItem({key:yt.loginExpiresAt,data:t,expires:t})}var ss=V(()=>{"use strict";i();To();ho()});var Te=V(()=>{"use strict";i()});var xo=V(()=>{"use strict";i()});var b_=V(()=>{"use strict";i()});var w_=V(()=>{"use strict";i()});var S_=V(()=>{"use strict";i()});var v_=V(()=>{"use strict";i()});var A_=V(()=>{"use strict";i()});var nn=V(()=>{"use strict";i();b_();De();Te();w_();S_();v_();A_()});var ps,I_,mI,k_,lI,E_,L_,_I,dI,C_=V(()=>{"use strict";i();nn();ps={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:I_,egldLabel:mI}=ps["devnet"],{chainId:k_,egldLabel:lI}=ps["testnet"],{chainId:E_,egldLabel:L_}=ps["mainnet"],_I={["devnet"]:I_,["testnet"]:k_,["mainnet"]:E_},dI={[I_]:"devnet",[k_]:"testnet",[E_]:"mainnet"}});var ms=V(()=>{"use strict";i()});var N_=V(()=>{"use strict";i()});var La,ls=V(()=>{"use strict";i();La="transaction-status-toast-id"});var pr,Ca,Ce,$t,P_,_s,D_,Na,R_,M_,Un,se=V(()=>{"use strict";i();xo();C_();ms();N_();ls();pr=5e4,Ca=1e9,Ce=18,$t=4,P_=1,_s=4294967295,D_=4294967280,Na="logout",R_="login",M_="refundedGas",Un="0"});var ds,We,et,Xe=V(()=>{"use strict";i();ds=require("@reduxjs/toolkit");se();We=(0,ds.createAction)(Na),et=(0,ds.createAction)(R_,t=>({payload:t}))});var F_,O_,B_,NI,U_,OS,mr,W_,FS,G_,$_,us=V(()=>{"use strict";i();F_=require("@reduxjs/toolkit");ss();Te();Xe();O_={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},B_=(0,F_.createSlice)({name:"loginInfoSlice",initialState:O_,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,()=>O_),t.addCase(et,(o,a)=>{o.loginMethod=a.payload.loginMethod,sr(cr())})}}),{setLoginMethod:NI,setWalletConnectLogin:U_,setLedgerLogin:OS,setTokenLogin:mr,setTokenLoginSignature:W_,setWalletLogin:FS,invalidateLoginSession:G_}=B_.actions,$_=B_.reducer});var lr=V(()=>{"use strict";i()});var V_=V(()=>{"use strict";i();lr()});function fs(t){return t[Math.floor(Math.random()*t.length)]}var z_=V(()=>{"use strict";i()});var gs=V(()=>{"use strict";i();ms()});var yo=V(()=>{"use strict";i();V_();z_();gs()});var q_,K_,hs,BS,X_,qI,KI,Z_,Ts=V(()=>{"use strict";i();q_=require("@reduxjs/toolkit"),K_=P(require("lodash.omit"));yo();hs={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},BS={network:hs,chainID:"-1"},X_=(0,q_.createSlice)({name:"appConfig",initialState:BS,reducers:{initializeNetworkConfig:(t,o)=>{let a=fs(o.payload.walletConnectBridgeAddresses),s=fs(o.payload.walletConnectV2RelayAddresses),m=(0,K_.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:qI,setChainID:KI}=X_.actions,Z_=X_.reducer});var ys,Y_,j_,Pa,xs,J_,bs,nk,ws,tk,US,WS,ok,rk,ak,GS,Q_,Ss=V(()=>{"use strict";i();ys=require("@elrondnetwork/erdjs"),Y_=require("@reduxjs/toolkit"),j_=require("redux-persist");se();To();ho();Xe();Pa={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Un},xs={address:"",websocketEvent:null,accounts:{"":Pa},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},J_=(0,Y_.createSlice)({name:"accountInfoSlice",initialState:xs,reducers:{setAddress:(t,o)=>{let a=o.payload;t.address=a,t.publicKey=new ys.Address(a).hex()},setAccount:(t,o)=>{let a=t.address===o.payload.address;t.accounts={[t.address]:a?o.payload:Pa},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,()=>(Gt.local.removeItem(yt.loginExpiresAt),xs)),t.addCase(et,(o,a)=>{let{address:s}=a.payload;o.address=s,o.publicKey=new ys.Address(s).hex()}),t.addCase(j_.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:xs.accounts,o.publicKey=A})}}),{setAccount:bs,setAddress:nk,setAccountNonce:ws,setAccountShard:tk,setLedgerAccount:US,updateLedgerAccount:WS,setWalletConnectAccount:ok,setIsAccountLoading:rk,setAccountLoadingError:ak,setWebsocketEvent:GS}=J_.actions,Q_=J_.reducer});function bo(t){return t!=null&&(ZS(t)||QS(t))}function wo(t){return t!=null&&(YS(t)||ev(t))}function So(t){return t!=null&&(jS(t)||nv(t))}function vs(t){return t!=null&&JS(t)}function ZS(t){return t!=null&&$S.includes(t)}function YS(t){return t!=null&&HS.includes(t)}function jS(t){return t!=null&&VS.includes(t)}function JS(t){return t!=null&&zS.includes(t)}function QS(t){return t!=null&&qS.includes(t)}function ev(t){return t!=null&&KS.includes(t)}function nv(t){return t!=null&&XS.includes(t)}var $S,HS,VS,zS,qS,KS,XS,vo=V(()=>{"use strict";i();Te();$S=["sent"],HS=["success"],VS=["fail","cancelled","timedOut"],zS=["timedOut"],qS=["pending"],KS=["success"],XS=["fail","invalid"]});var ed,nd,dr,tv,td,od,rd,ov,Da,rv,av,uk,iv,Ra,As,Ma,Oa=V(()=>{"use strict";i();ed=require("@reduxjs/toolkit"),nd=require("redux-persist");Te();vo();Xe();dr={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},tv={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},td=(0,ed.createSlice)({name:"transactionsSlice",initialState:dr,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])||tv;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=dr.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=>wo(me.status)),ne=(W=(R=t.signedTransactions[a])==null?void 0:R.transactions)==null?void 0:W.every(me=>So(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=dr.transactionsToSign,t.signTransactionsError=null},clearAllSignedTransactions:t=>{t.signedTransactions=dr.signedTransactions},setSignTransactionsError:(t,o)=>{t.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(t,o)=>{t.signTransactionsCancelMessage=o.payload}},extraReducers:t=>{t.addCase(We,()=>dr),t.addCase(nd.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:od,updateSignedTransactions:rd,setTransactionsToSign:ov,clearAllTransactionsToSign:Da,clearAllSignedTransactions:rv,clearSignedTransaction:av,clearTransactionToSign:uk,setSignTransactionsError:iv,setSignTransactionsCancelMessage:Ra,moveTransactionsToSignedState:As}=td.actions,Ma=td.reducer});var ad,ks,Es,Ls,cv,Is,id,Tk,sv,Cs,Fa,Ba=V(()=>{"use strict";i();ad=require("@reduxjs/toolkit");Xe();ks="Transaction failed",Es="Transaction successful",Ls="Processing transaction",cv="Transaction submitted",Is={},id=(0,ad.createSlice)({name:"transactionsInfo",initialState:Is,reducers:{setTransactionsDisplayInfo(t,o){let{sessionId:a,transactionsDisplayInfo:s}=o.payload;a!=null&&(t[a]={errorMessage:(s==null?void 0:s.errorMessage)||ks,successMessage:(s==null?void 0:s.successMessage)||Es,processingMessage:(s==null?void 0:s.processingMessage)||Ls,submittedMessage:(s==null?void 0:s.submittedMessage)||cv,transactionDuration:s==null?void 0:s.transactionDuration})},clearTransactionsInfoForSessionId(t,o){o.payload!=null&&delete t[o.payload]},clearTransactionsInfo:()=>Is},extraReducers:t=>{t.addCase(We,()=>Is)}}),{clearTransactionsInfo:Tk,setTransactionsDisplayInfo:sv,clearTransactionsInfoForSessionId:Cs}=id.actions,Fa=id.reducer});var sd,cd,pd,wk,pv,Sk,mv,md,Ns=V(()=>{"use strict";i();sd=require("@reduxjs/toolkit");Xe();cd={},pd=(0,sd.createSlice)({name:"modalsSlice",initialState:cd,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,()=>cd)}}),{setTxSubmittedModal:wk,setNotificationModal:pv,clearTxSubmittedModal:Sk,clearNotificationModal:mv}=pd.actions,md=pd.reducer});var _d,dd,ld,ud,lv,Ps,Nk,Pk,Dk,Rk,Ua,Wa=V(()=>{"use strict";i();_d=require("@reduxjs/toolkit"),dd=require("redux-persist");ls();nn();os();Xe();ld={customToasts:[],transactionToasts:[],failTransactionToast:null},ud=(0,_d.createSlice)({name:"toastsSlice",initialState:ld,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:Ea(),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:La})},removeFailTransactionToast:t=>{t.failTransactionToast=null}},extraReducers:t=>{t.addCase(We,()=>ld),t.addCase(dd.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:lv,removeCustomToast:Ps,addTransactionToast:Nk,removeTransactionToast:Pk,addFailTransactionToast:Dk,removeFailTransactionToast:Rk}=ud.actions,Ua=ud.reducer});var de=V(()=>{"use strict";i();us();Ts();Ss();Oa();Ba();Ns();Wa()});var Ds=V(()=>{"use strict";i()});var Td,hd,xd,eE,nE,tE,oE,rE,aE,yd,bd=V(()=>{"use strict";i();Td=require("@reduxjs/toolkit");Xe();hd={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},xd=(0,Td.createSlice)({name:"dappModalsSlice",initialState:hd,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,()=>hd)}}),{setDappModalVisibility:eE,setDappModalHeaderVisibility:nE,setDappModalFooterVisibility:tE,setDappModalHeaderText:oE,setDappModalFooterText:rE,setDappModalConfig:aE}=xd.actions,yd=xd.reducer});var wd,fv,gv,Ao,$a=V(()=>{"use strict";i();wd=require("@reduxjs/toolkit");Ds();Ss();bd();us();Ns();Ts();Wa();Ba();Oa();fv={["account"]:Q_,["networkConfig"]:Z_,["loginInfo"]:$_,["modals"]:md,["dappModal"]:yd,["toasts"]:Ua,["transactions"]:Ma,["transactionsInfo"]:Fa},gv=(t={})=>(0,wd.combineReducers)(F(F({},fv),t)),Ao=gv});var Ad={};Ft(Ad,{default:()=>Sv});function Rs(t,o=[]){return{key:t,version:1,storage:vd.default,blacklist:o}}var Vt,Sd,vd,hv,Tv,xv,yv,bv,wv,Sv,Id=V(()=>{"use strict";i();Vt=require("redux-persist"),Sd=P(require("redux-persist/lib/storage")),vd=P(require("redux-persist/lib/storage/session"));$a();de();Wa();Ba();Oa();Ds();hv={2:t=>J(F({},t),{networkConfig:hs})};Tv=Rs("dapp-core-transactionsInfo"),xv=Rs("dapp-core-transactions",["transactionsToSign"]),yv=Rs("dapp-core-toasts"),bv={key:"dapp-core-store",version:2,storage:Sd.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,Vt.createMigrate)(hv,{debug:!1})},wv={["toasts"]:(0,Vt.persistReducer)(yv,Ua),["transactions"]:(0,Vt.persistReducer)(xv,Ma),["transactionsInfo"]:(0,Vt.persistReducer)(Tv,Fa)},Sv=(0,Vt.persistReducer)(bv,Ao(wv))});var kd={};Ft(kd,{default:()=>vv});var vv,Ed=V(()=>{"use strict";i();$a();vv=Ao()});var Ld={};Ft(Ld,{default:()=>Iv});var un,Av,Iv,Cd=V(()=>{"use strict";i();un=require("redux-persist"),Av=[un.FLUSH,un.REHYDRATE,un.PAUSE,un.PERSIST,un.PURGE,un.REGISTER],Iv=Av});var Dd={};Ft(Dd,{default:()=>Pd});function Pd(t){return(0,Nd.persistStore)(t)}var Nd,Rd=V(()=>{"use strict";i();Nd=require("redux-persist")});var _f=rr((No,xr)=>{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,wi=30,Yf="...",jf=800,Jf=16,lp=1,Qf=2,eg=3,kt=1/0,pt=9007199254740991,ng=17976931348623157e292,Ir=0/0,Cn=4294967295,tg=Cn-1,og=Cn>>>1,rg=[["ary",$e],["bind",ne],["bindKey",me],["curry",Tn],["curryRight",xn],["flip",Ro],["partial",Re],["partialRight",Ie],["rearg",Ln]],Jt="[object Arguments]",kr="[object Array]",ag="[object AsyncFunction]",Mo="[object Boolean]",Oo="[object Date]",ig="[object DOMException]",Er="[object Error]",Lr="[object Function]",_p="[object GeneratorFunction]",yn="[object Map]",Fo="[object Number]",cg="[object Null]",Gn="[object Object]",dp="[object Promise]",sg="[object Proxy]",Bo="[object RegExp]",bn="[object Set]",Uo="[object String]",Cr="[object Symbol]",pg="[object Undefined]",Wo="[object WeakMap]",mg="[object WeakSet]",Go="[object ArrayBuffer]",Qt="[object DataView]",Si="[object Float32Array]",vi="[object Float64Array]",Ai="[object Int8Array]",Ii="[object Int16Array]",ki="[object Int32Array]",Ei="[object Uint8Array]",Li="[object Uint8ClampedArray]",Ci="[object Uint16Array]",Ni="[object Uint32Array]",lg=/\b__p \+= '';/g,_g=/\b(__p \+=) '' \+/g,dg=/(__e\(.*?\)|\b__t\)) \+\n'';/g,up=/&(?:amp|lt|gt|quot|#39);/g,fp=/[&<>"']/g,ug=RegExp(up.source),fg=RegExp(fp.source),gg=/<%-([\s\S]+?)%>/g,hg=/<%([\s\S]+?)%>/g,gp=/<%=([\s\S]+?)%>/g,Tg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xg=/^\w*$/,yg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pi=/[\\^$.*+?()[\]{}|]/g,bg=RegExp(Pi.source),Di=/^\s+/,wg=/\s/,Sg=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,vg=/\{\n\/\* \[wrapped with (.+)\] \*/,Ag=/,? & /,Ig=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,kg=/[()=,{}\[\]\/\s]/,Eg=/\\(\\)?/g,Lg=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,hp=/\w*$/,Cg=/^[-+]0x[0-9a-f]+$/i,Ng=/^0b[01]+$/i,Pg=/^\[object .+?Constructor\]$/,Dg=/^0o[0-7]+$/i,Rg=/^(?:0|[1-9]\d*)$/,Mg=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nr=/($^)/,Og=/['\n\r\u2028\u2029\\]/g,Pr="\\ud800-\\udfff",Fg="\\u0300-\\u036f",Bg="\\ufe20-\\ufe2f",Ug="\\u20d0-\\u20ff",Tp=Fg+Bg+Ug,xp="\\u2700-\\u27bf",yp="a-z\\xdf-\\xf6\\xf8-\\xff",Wg="\\xac\\xb1\\xd7\\xf7",Gg="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$g="\\u2000-\\u206f",Hg=" \\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",bp="A-Z\\xc0-\\xd6\\xd8-\\xde",wp="\\ufe0e\\ufe0f",Sp=Wg+Gg+$g+Hg,Ri="['\u2019]",Vg="["+Pr+"]",vp="["+Sp+"]",Dr="["+Tp+"]",Ap="\\d+",zg="["+xp+"]",Ip="["+yp+"]",kp="[^"+Pr+Sp+Ap+xp+yp+bp+"]",Mi="\\ud83c[\\udffb-\\udfff]",qg="(?:"+Dr+"|"+Mi+")",Ep="[^"+Pr+"]",Oi="(?:\\ud83c[\\udde6-\\uddff]){2}",Fi="[\\ud800-\\udbff][\\udc00-\\udfff]",eo="["+bp+"]",Lp="\\u200d",Cp="(?:"+Ip+"|"+kp+")",Kg="(?:"+eo+"|"+kp+")",Np="(?:"+Ri+"(?:d|ll|m|re|s|t|ve))?",Pp="(?:"+Ri+"(?:D|LL|M|RE|S|T|VE))?",Dp=qg+"?",Rp="["+wp+"]?",Xg="(?:"+Lp+"(?:"+[Ep,Oi,Fi].join("|")+")"+Rp+Dp+")*",Zg="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Yg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Mp=Rp+Dp+Xg,jg="(?:"+[zg,Oi,Fi].join("|")+")"+Mp,Jg="(?:"+[Ep+Dr+"?",Dr,Oi,Fi,Vg].join("|")+")",Qg=RegExp(Ri,"g"),eh=RegExp(Dr,"g"),Bi=RegExp(Mi+"(?="+Mi+")|"+Jg+Mp,"g"),nh=RegExp([eo+"?"+Ip+"+"+Np+"(?="+[vp,eo,"$"].join("|")+")",Kg+"+"+Pp+"(?="+[vp,eo+Cp,"$"].join("|")+")",eo+"?"+Cp+"+"+Np,eo+"+"+Pp,Yg,Zg,Ap,jg].join("|"),"g"),th=RegExp("["+Lp+Pr+Tp+wp+"]"),oh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rh=["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"],ah=-1,ue={};ue[Si]=ue[vi]=ue[Ai]=ue[Ii]=ue[ki]=ue[Ei]=ue[Li]=ue[Ci]=ue[Ni]=!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[Si]=_e[vi]=_e[Ai]=_e[Ii]=_e[ki]=_e[yn]=_e[Fo]=_e[Gn]=_e[Bo]=_e[bn]=_e[Uo]=_e[Cr]=_e[Ei]=_e[Li]=_e[Ci]=_e[Ni]=!0,_e[Er]=_e[Lr]=_e[Wo]=!1;var ih={\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