UNPKG

@sofaws/dapp-core

Version:

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

1 lines 330 kB
"use strict";var OS=Object.create;var Kr=Object.defineProperty,RS=Object.defineProperties,BS=Object.getOwnPropertyDescriptor,WS=Object.getOwnPropertyDescriptors,US=Object.getOwnPropertyNames,mi=Object.getOwnPropertySymbols,HS=Object.getPrototypeOf,Uc=Object.prototype.hasOwnProperty,ad=Object.prototype.propertyIsEnumerable;var rd=(n,t,a)=>t in n?Kr(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a,P=(n,t)=>{for(var a in t||(t={}))Uc.call(t,a)&&rd(n,a,t[a]);if(mi)for(var a of mi(t))ad.call(t,a)&&rd(n,a,t[a]);return n},z=(n,t)=>RS(n,WS(t));var Je=(n,t)=>{var a={};for(var c in n)Uc.call(n,c)&&t.indexOf(c)<0&&(a[c]=n[c]);if(n!=null&&mi)for(var c of mi(n))t.indexOf(c)<0&&ad.call(n,c)&&(a[c]=n[c]);return a};var V=(n,t)=>()=>(n&&(t=n(n=0)),t);var Zr=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),st=(n,t)=>{for(var a in t)Kr(n,a,{get:t[a],enumerable:!0})},id=(n,t,a,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let _ of US(t))!Uc.call(n,_)&&_!==a&&Kr(n,_,{get:()=>t[_],enumerable:!(c=BS(t,_))||c.enumerable});return n};var v=(n,t,a)=>(a=n!=null?OS(HS(n)):{},id(t||!n||!n.__esModule?Kr(a,"default",{value:n,enumerable:!0}):a,n)),Xr=n=>id(Kr({},"__esModule",{value:!0}),n);var oe=(n,t,a)=>new Promise((c,_)=>{var g=A=>{try{I(a.next(A))}catch(C){_(C)}},h=A=>{try{I(a.throw(A))}catch(C){_(C)}},I=A=>A.done?c(A.value):Promise.resolve(A.value).then(g,h);I((a=a.apply(n,t)).next())});var pd=Zr(li=>{"use strict";i();li.byteLength=$S;li.toByteArray=VS;li.fromByteArray=ZS;var Yn=[],Ln=[],GS=typeof Uint8Array!="undefined"?Uint8Array:Array,Hc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ct=0,sd=Hc.length;ct<sd;++ct)Yn[ct]=Hc[ct],Ln[Hc.charCodeAt(ct)]=ct;var ct,sd;Ln["-".charCodeAt(0)]=62;Ln["_".charCodeAt(0)]=63;function cd(n){var t=n.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=n.indexOf("=");a===-1&&(a=t);var c=a===t?0:4-a%4;return[a,c]}function $S(n){var t=cd(n),a=t[0],c=t[1];return(a+c)*3/4-c}function zS(n,t,a){return(t+a)*3/4-a}function VS(n){var t,a=cd(n),c=a[0],_=a[1],g=new GS(zS(n,c,_)),h=0,I=_>0?c-4:c,A;for(A=0;A<I;A+=4)t=Ln[n.charCodeAt(A)]<<18|Ln[n.charCodeAt(A+1)]<<12|Ln[n.charCodeAt(A+2)]<<6|Ln[n.charCodeAt(A+3)],g[h++]=t>>16&255,g[h++]=t>>8&255,g[h++]=t&255;return _===2&&(t=Ln[n.charCodeAt(A)]<<2|Ln[n.charCodeAt(A+1)]>>4,g[h++]=t&255),_===1&&(t=Ln[n.charCodeAt(A)]<<10|Ln[n.charCodeAt(A+1)]<<4|Ln[n.charCodeAt(A+2)]>>2,g[h++]=t>>8&255,g[h++]=t&255),g}function qS(n){return Yn[n>>18&63]+Yn[n>>12&63]+Yn[n>>6&63]+Yn[n&63]}function KS(n,t,a){for(var c,_=[],g=t;g<a;g+=3)c=(n[g]<<16&16711680)+(n[g+1]<<8&65280)+(n[g+2]&255),_.push(qS(c));return _.join("")}function ZS(n){for(var t,a=n.length,c=a%3,_=[],g=16383,h=0,I=a-c;h<I;h+=g)_.push(KS(n,h,h+g>I?I:h+g));return c===1?(t=n[a-1],_.push(Yn[t>>2]+Yn[t<<4&63]+"==")):c===2&&(t=(n[a-2]<<8)+n[a-1],_.push(Yn[t>>10]+Yn[t>>4&63]+Yn[t<<2&63]+"=")),_.join("")}});var md=Zr(Gc=>{i();Gc.read=function(n,t,a,c,_){var g,h,I=_*8-c-1,A=(1<<I)-1,C=A>>1,M=-7,F=a?_-1:0,W=a?-1:1,K=n[t+F];for(F+=W,g=K&(1<<-M)-1,K>>=-M,M+=I;M>0;g=g*256+n[t+F],F+=W,M-=8);for(h=g&(1<<-M)-1,g>>=-M,M+=c;M>0;h=h*256+n[t+F],F+=W,M-=8);if(g===0)g=1-C;else{if(g===A)return h?NaN:(K?-1:1)*(1/0);h=h+Math.pow(2,c),g=g-C}return(K?-1:1)*h*Math.pow(2,g-c)};Gc.write=function(n,t,a,c,_,g){var h,I,A,C=g*8-_-1,M=(1<<C)-1,F=M>>1,W=_===23?Math.pow(2,-24)-Math.pow(2,-77):0,K=c?0:g-1,te=c?1:-1,ae=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(I=isNaN(t)?1:0,h=M):(h=Math.floor(Math.log(t)/Math.LN2),t*(A=Math.pow(2,-h))<1&&(h--,A*=2),h+F>=1?t+=W/A:t+=W*Math.pow(2,1-F),t*A>=2&&(h++,A/=2),h+F>=M?(I=0,h=M):h+F>=1?(I=(t*A-1)*Math.pow(2,_),h=h+F):(I=t*Math.pow(2,F-1)*Math.pow(2,_),h=0));_>=8;n[a+K]=I&255,K+=te,I/=256,_-=8);for(h=h<<_|I,C+=_;C>0;n[a+K]=h&255,K+=te,h/=256,C-=8);n[a+K-te]|=ae*128}});var vd=Zr(qt=>{"use strict";i();var $c=pd(),Vt=md(),ld=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;qt.Buffer=E;qt.SlowBuffer=e1;qt.INSPECT_MAX_BYTES=50;var _i=2147483647;qt.kMaxLength=_i;E.TYPED_ARRAY_SUPPORT=XS();!E.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function XS(){try{var n=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(n,t),n.foo()===42}catch(a){return!1}}Object.defineProperty(E.prototype,"parent",{enumerable:!0,get:function(){if(!!E.isBuffer(this))return this.buffer}});Object.defineProperty(E.prototype,"offset",{enumerable:!0,get:function(){if(!!E.isBuffer(this))return this.byteOffset}});function go(n){if(n>_i)throw new RangeError('The value "'+n+'" is invalid for option "size"');var t=new Uint8Array(n);return Object.setPrototypeOf(t,E.prototype),t}function E(n,t,a){if(typeof n=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Kc(n)}return ud(n,t,a)}E.poolSize=8192;function ud(n,t,a){if(typeof n=="string")return jS(n,t);if(ArrayBuffer.isView(n))return JS(n);if(n==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n);if(jn(n,ArrayBuffer)||n&&jn(n.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(jn(n,SharedArrayBuffer)||n&&jn(n.buffer,SharedArrayBuffer)))return Vc(n,t,a);if(typeof n=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var c=n.valueOf&&n.valueOf();if(c!=null&&c!==n)return E.from(c,t,a);var _=QS(n);if(_)return _;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof n[Symbol.toPrimitive]=="function")return E.from(n[Symbol.toPrimitive]("string"),t,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}E.from=function(n,t,a){return ud(n,t,a)};Object.setPrototypeOf(E.prototype,Uint8Array.prototype);Object.setPrototypeOf(E,Uint8Array);function fd(n){if(typeof n!="number")throw new TypeError('"size" argument must be of type number');if(n<0)throw new RangeError('The value "'+n+'" is invalid for option "size"')}function YS(n,t,a){return fd(n),n<=0?go(n):t!==void 0?typeof a=="string"?go(n).fill(t,a):go(n).fill(t):go(n)}E.alloc=function(n,t,a){return YS(n,t,a)};function Kc(n){return fd(n),go(n<0?0:Zc(n)|0)}E.allocUnsafe=function(n){return Kc(n)};E.allocUnsafeSlow=function(n){return Kc(n)};function jS(n,t){if((typeof t!="string"||t==="")&&(t="utf8"),!E.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var a=gd(n,t)|0,c=go(a),_=c.write(n,t);return _!==a&&(c=c.slice(0,_)),c}function zc(n){for(var t=n.length<0?0:Zc(n.length)|0,a=go(t),c=0;c<t;c+=1)a[c]=n[c]&255;return a}function JS(n){if(jn(n,Uint8Array)){var t=new Uint8Array(n);return Vc(t.buffer,t.byteOffset,t.byteLength)}return zc(n)}function Vc(n,t,a){if(t<0||n.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(n.byteLength<t+(a||0))throw new RangeError('"length" is outside of buffer bounds');var c;return t===void 0&&a===void 0?c=new Uint8Array(n):a===void 0?c=new Uint8Array(n,t):c=new Uint8Array(n,t,a),Object.setPrototypeOf(c,E.prototype),c}function QS(n){if(E.isBuffer(n)){var t=Zc(n.length)|0,a=go(t);return a.length===0||n.copy(a,0,0,t),a}if(n.length!==void 0)return typeof n.length!="number"||Xc(n.length)?go(0):zc(n);if(n.type==="Buffer"&&Array.isArray(n.data))return zc(n.data)}function Zc(n){if(n>=_i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_i.toString(16)+" bytes");return n|0}function e1(n){return+n!=n&&(n=0),E.alloc(+n)}E.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==E.prototype};E.compare=function(t,a){if(jn(t,Uint8Array)&&(t=E.from(t,t.offset,t.byteLength)),jn(a,Uint8Array)&&(a=E.from(a,a.offset,a.byteLength)),!E.isBuffer(t)||!E.isBuffer(a))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===a)return 0;for(var c=t.length,_=a.length,g=0,h=Math.min(c,_);g<h;++g)if(t[g]!==a[g]){c=t[g],_=a[g];break}return c<_?-1:_<c?1:0};E.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};E.concat=function(t,a){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return E.alloc(0);var c;if(a===void 0)for(a=0,c=0;c<t.length;++c)a+=t[c].length;var _=E.allocUnsafe(a),g=0;for(c=0;c<t.length;++c){var h=t[c];if(jn(h,Uint8Array))g+h.length>_.length?E.from(h).copy(_,g):Uint8Array.prototype.set.call(_,h,g);else if(E.isBuffer(h))h.copy(_,g);else throw new TypeError('"list" argument must be an Array of Buffers');g+=h.length}return _};function gd(n,t){if(E.isBuffer(n))return n.length;if(ArrayBuffer.isView(n)||jn(n,ArrayBuffer))return n.byteLength;if(typeof n!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof n);var a=n.length,c=arguments.length>2&&arguments[2]===!0;if(!c&&a===0)return 0;for(var _=!1;;)switch(t){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return qc(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a*2;case"hex":return a>>>1;case"base64":return wd(n).length;default:if(_)return c?-1:qc(n).length;t=(""+t).toLowerCase(),_=!0}}E.byteLength=gd;function n1(n,t,a){var c=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((a===void 0||a>this.length)&&(a=this.length),a<=0)||(a>>>=0,t>>>=0,a<=t))return"";for(n||(n="utf8");;)switch(n){case"hex":return l1(this,t,a);case"utf8":case"utf-8":return yd(this,t,a);case"ascii":return p1(this,t,a);case"latin1":case"binary":return m1(this,t,a);case"base64":return s1(this,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _1(this,t,a);default:if(c)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),c=!0}}E.prototype._isBuffer=!0;function pt(n,t,a){var c=n[t];n[t]=n[a],n[a]=c}E.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var a=0;a<t;a+=2)pt(this,a,a+1);return this};E.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var a=0;a<t;a+=4)pt(this,a,a+3),pt(this,a+1,a+2);return this};E.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var a=0;a<t;a+=8)pt(this,a,a+7),pt(this,a+1,a+6),pt(this,a+2,a+5),pt(this,a+3,a+4);return this};E.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?yd(this,0,t):n1.apply(this,arguments)};E.prototype.toLocaleString=E.prototype.toString;E.prototype.equals=function(t){if(!E.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:E.compare(this,t)===0};E.prototype.inspect=function(){var t="",a=qt.INSPECT_MAX_BYTES;return t=this.toString("hex",0,a).replace(/(.{2})/g,"$1 ").trim(),this.length>a&&(t+=" ... "),"<Buffer "+t+">"};ld&&(E.prototype[ld]=E.prototype.inspect);E.prototype.compare=function(t,a,c,_,g){if(jn(t,Uint8Array)&&(t=E.from(t,t.offset,t.byteLength)),!E.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(a===void 0&&(a=0),c===void 0&&(c=t?t.length:0),_===void 0&&(_=0),g===void 0&&(g=this.length),a<0||c>t.length||_<0||g>this.length)throw new RangeError("out of range index");if(_>=g&&a>=c)return 0;if(_>=g)return-1;if(a>=c)return 1;if(a>>>=0,c>>>=0,_>>>=0,g>>>=0,this===t)return 0;for(var h=g-_,I=c-a,A=Math.min(h,I),C=this.slice(_,g),M=t.slice(a,c),F=0;F<A;++F)if(C[F]!==M[F]){h=C[F],I=M[F];break}return h<I?-1:I<h?1:0};function hd(n,t,a,c,_){if(n.length===0)return-1;if(typeof a=="string"?(c=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,Xc(a)&&(a=_?0:n.length-1),a<0&&(a=n.length+a),a>=n.length){if(_)return-1;a=n.length-1}else if(a<0)if(_)a=0;else return-1;if(typeof t=="string"&&(t=E.from(t,c)),E.isBuffer(t))return t.length===0?-1:_d(n,t,a,c,_);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?_?Uint8Array.prototype.indexOf.call(n,t,a):Uint8Array.prototype.lastIndexOf.call(n,t,a):_d(n,[t],a,c,_);throw new TypeError("val must be string, number or Buffer")}function _d(n,t,a,c,_){var g=1,h=n.length,I=t.length;if(c!==void 0&&(c=String(c).toLowerCase(),c==="ucs2"||c==="ucs-2"||c==="utf16le"||c==="utf-16le")){if(n.length<2||t.length<2)return-1;g=2,h/=2,I/=2,a/=2}function A(K,te){return g===1?K[te]:K.readUInt16BE(te*g)}var C;if(_){var M=-1;for(C=a;C<h;C++)if(A(n,C)===A(t,M===-1?0:C-M)){if(M===-1&&(M=C),C-M+1===I)return M*g}else M!==-1&&(C-=C-M),M=-1}else for(a+I>h&&(a=h-I),C=a;C>=0;C--){for(var F=!0,W=0;W<I;W++)if(A(n,C+W)!==A(t,W)){F=!1;break}if(F)return C}return-1}E.prototype.includes=function(t,a,c){return this.indexOf(t,a,c)!==-1};E.prototype.indexOf=function(t,a,c){return hd(this,t,a,c,!0)};E.prototype.lastIndexOf=function(t,a,c){return hd(this,t,a,c,!1)};function o1(n,t,a,c){a=Number(a)||0;var _=n.length-a;c?(c=Number(c),c>_&&(c=_)):c=_;var g=t.length;c>g/2&&(c=g/2);for(var h=0;h<c;++h){var I=parseInt(t.substr(h*2,2),16);if(Xc(I))return h;n[a+h]=I}return h}function t1(n,t,a,c){return di(qc(t,n.length-a),n,a,c)}function r1(n,t,a,c){return di(f1(t),n,a,c)}function a1(n,t,a,c){return di(wd(t),n,a,c)}function i1(n,t,a,c){return di(g1(t,n.length-a),n,a,c)}E.prototype.write=function(t,a,c,_){if(a===void 0)_="utf8",c=this.length,a=0;else if(c===void 0&&typeof a=="string")_=a,c=this.length,a=0;else if(isFinite(a))a=a>>>0,isFinite(c)?(c=c>>>0,_===void 0&&(_="utf8")):(_=c,c=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var g=this.length-a;if((c===void 0||c>g)&&(c=g),t.length>0&&(c<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");_||(_="utf8");for(var h=!1;;)switch(_){case"hex":return o1(this,t,a,c);case"utf8":case"utf-8":return t1(this,t,a,c);case"ascii":case"latin1":case"binary":return r1(this,t,a,c);case"base64":return a1(this,t,a,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i1(this,t,a,c);default:if(h)throw new TypeError("Unknown encoding: "+_);_=(""+_).toLowerCase(),h=!0}};E.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function s1(n,t,a){return t===0&&a===n.length?$c.fromByteArray(n):$c.fromByteArray(n.slice(t,a))}function yd(n,t,a){a=Math.min(n.length,a);for(var c=[],_=t;_<a;){var g=n[_],h=null,I=g>239?4:g>223?3:g>191?2:1;if(_+I<=a){var A,C,M,F;switch(I){case 1:g<128&&(h=g);break;case 2:A=n[_+1],(A&192)===128&&(F=(g&31)<<6|A&63,F>127&&(h=F));break;case 3:A=n[_+1],C=n[_+2],(A&192)===128&&(C&192)===128&&(F=(g&15)<<12|(A&63)<<6|C&63,F>2047&&(F<55296||F>57343)&&(h=F));break;case 4:A=n[_+1],C=n[_+2],M=n[_+3],(A&192)===128&&(C&192)===128&&(M&192)===128&&(F=(g&15)<<18|(A&63)<<12|(C&63)<<6|M&63,F>65535&&F<1114112&&(h=F))}}h===null?(h=65533,I=1):h>65535&&(h-=65536,c.push(h>>>10&1023|55296),h=56320|h&1023),c.push(h),_+=I}return c1(c)}var dd=4096;function c1(n){var t=n.length;if(t<=dd)return String.fromCharCode.apply(String,n);for(var a="",c=0;c<t;)a+=String.fromCharCode.apply(String,n.slice(c,c+=dd));return a}function p1(n,t,a){var c="";a=Math.min(n.length,a);for(var _=t;_<a;++_)c+=String.fromCharCode(n[_]&127);return c}function m1(n,t,a){var c="";a=Math.min(n.length,a);for(var _=t;_<a;++_)c+=String.fromCharCode(n[_]);return c}function l1(n,t,a){var c=n.length;(!t||t<0)&&(t=0),(!a||a<0||a>c)&&(a=c);for(var _="",g=t;g<a;++g)_+=h1[n[g]];return _}function _1(n,t,a){for(var c=n.slice(t,a),_="",g=0;g<c.length-1;g+=2)_+=String.fromCharCode(c[g]+c[g+1]*256);return _}E.prototype.slice=function(t,a){var c=this.length;t=~~t,a=a===void 0?c:~~a,t<0?(t+=c,t<0&&(t=0)):t>c&&(t=c),a<0?(a+=c,a<0&&(a=0)):a>c&&(a=c),a<t&&(a=t);var _=this.subarray(t,a);return Object.setPrototypeOf(_,E.prototype),_};function Me(n,t,a){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+t>a)throw new RangeError("Trying to access beyond buffer length")}E.prototype.readUintLE=E.prototype.readUIntLE=function(t,a,c){t=t>>>0,a=a>>>0,c||Me(t,a,this.length);for(var _=this[t],g=1,h=0;++h<a&&(g*=256);)_+=this[t+h]*g;return _};E.prototype.readUintBE=E.prototype.readUIntBE=function(t,a,c){t=t>>>0,a=a>>>0,c||Me(t,a,this.length);for(var _=this[t+--a],g=1;a>0&&(g*=256);)_+=this[t+--a]*g;return _};E.prototype.readUint8=E.prototype.readUInt8=function(t,a){return t=t>>>0,a||Me(t,1,this.length),this[t]};E.prototype.readUint16LE=E.prototype.readUInt16LE=function(t,a){return t=t>>>0,a||Me(t,2,this.length),this[t]|this[t+1]<<8};E.prototype.readUint16BE=E.prototype.readUInt16BE=function(t,a){return t=t>>>0,a||Me(t,2,this.length),this[t]<<8|this[t+1]};E.prototype.readUint32LE=E.prototype.readUInt32LE=function(t,a){return t=t>>>0,a||Me(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};E.prototype.readUint32BE=E.prototype.readUInt32BE=function(t,a){return t=t>>>0,a||Me(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};E.prototype.readIntLE=function(t,a,c){t=t>>>0,a=a>>>0,c||Me(t,a,this.length);for(var _=this[t],g=1,h=0;++h<a&&(g*=256);)_+=this[t+h]*g;return g*=128,_>=g&&(_-=Math.pow(2,8*a)),_};E.prototype.readIntBE=function(t,a,c){t=t>>>0,a=a>>>0,c||Me(t,a,this.length);for(var _=a,g=1,h=this[t+--_];_>0&&(g*=256);)h+=this[t+--_]*g;return g*=128,h>=g&&(h-=Math.pow(2,8*a)),h};E.prototype.readInt8=function(t,a){return t=t>>>0,a||Me(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};E.prototype.readInt16LE=function(t,a){t=t>>>0,a||Me(t,2,this.length);var c=this[t]|this[t+1]<<8;return c&32768?c|4294901760:c};E.prototype.readInt16BE=function(t,a){t=t>>>0,a||Me(t,2,this.length);var c=this[t+1]|this[t]<<8;return c&32768?c|4294901760:c};E.prototype.readInt32LE=function(t,a){return t=t>>>0,a||Me(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};E.prototype.readInt32BE=function(t,a){return t=t>>>0,a||Me(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};E.prototype.readFloatLE=function(t,a){return t=t>>>0,a||Me(t,4,this.length),Vt.read(this,t,!0,23,4)};E.prototype.readFloatBE=function(t,a){return t=t>>>0,a||Me(t,4,this.length),Vt.read(this,t,!1,23,4)};E.prototype.readDoubleLE=function(t,a){return t=t>>>0,a||Me(t,8,this.length),Vt.read(this,t,!0,52,8)};E.prototype.readDoubleBE=function(t,a){return t=t>>>0,a||Me(t,8,this.length),Vt.read(this,t,!1,52,8)};function Qe(n,t,a,c,_,g){if(!E.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>_||t<g)throw new RangeError('"value" argument is out of bounds');if(a+c>n.length)throw new RangeError("Index out of range")}E.prototype.writeUintLE=E.prototype.writeUIntLE=function(t,a,c,_){if(t=+t,a=a>>>0,c=c>>>0,!_){var g=Math.pow(2,8*c)-1;Qe(this,t,a,c,g,0)}var h=1,I=0;for(this[a]=t&255;++I<c&&(h*=256);)this[a+I]=t/h&255;return a+c};E.prototype.writeUintBE=E.prototype.writeUIntBE=function(t,a,c,_){if(t=+t,a=a>>>0,c=c>>>0,!_){var g=Math.pow(2,8*c)-1;Qe(this,t,a,c,g,0)}var h=c-1,I=1;for(this[a+h]=t&255;--h>=0&&(I*=256);)this[a+h]=t/I&255;return a+c};E.prototype.writeUint8=E.prototype.writeUInt8=function(t,a,c){return t=+t,a=a>>>0,c||Qe(this,t,a,1,255,0),this[a]=t&255,a+1};E.prototype.writeUint16LE=E.prototype.writeUInt16LE=function(t,a,c){return t=+t,a=a>>>0,c||Qe(this,t,a,2,65535,0),this[a]=t&255,this[a+1]=t>>>8,a+2};E.prototype.writeUint16BE=E.prototype.writeUInt16BE=function(t,a,c){return t=+t,a=a>>>0,c||Qe(this,t,a,2,65535,0),this[a]=t>>>8,this[a+1]=t&255,a+2};E.prototype.writeUint32LE=E.prototype.writeUInt32LE=function(t,a,c){return t=+t,a=a>>>0,c||Qe(this,t,a,4,4294967295,0),this[a+3]=t>>>24,this[a+2]=t>>>16,this[a+1]=t>>>8,this[a]=t&255,a+4};E.prototype.writeUint32BE=E.prototype.writeUInt32BE=function(t,a,c){return t=+t,a=a>>>0,c||Qe(this,t,a,4,4294967295,0),this[a]=t>>>24,this[a+1]=t>>>16,this[a+2]=t>>>8,this[a+3]=t&255,a+4};E.prototype.writeIntLE=function(t,a,c,_){if(t=+t,a=a>>>0,!_){var g=Math.pow(2,8*c-1);Qe(this,t,a,c,g-1,-g)}var h=0,I=1,A=0;for(this[a]=t&255;++h<c&&(I*=256);)t<0&&A===0&&this[a+h-1]!==0&&(A=1),this[a+h]=(t/I>>0)-A&255;return a+c};E.prototype.writeIntBE=function(t,a,c,_){if(t=+t,a=a>>>0,!_){var g=Math.pow(2,8*c-1);Qe(this,t,a,c,g-1,-g)}var h=c-1,I=1,A=0;for(this[a+h]=t&255;--h>=0&&(I*=256);)t<0&&A===0&&this[a+h+1]!==0&&(A=1),this[a+h]=(t/I>>0)-A&255;return a+c};E.prototype.writeInt8=function(t,a,c){return t=+t,a=a>>>0,c||Qe(this,t,a,1,127,-128),t<0&&(t=255+t+1),this[a]=t&255,a+1};E.prototype.writeInt16LE=function(t,a,c){return t=+t,a=a>>>0,c||Qe(this,t,a,2,32767,-32768),this[a]=t&255,this[a+1]=t>>>8,a+2};E.prototype.writeInt16BE=function(t,a,c){return t=+t,a=a>>>0,c||Qe(this,t,a,2,32767,-32768),this[a]=t>>>8,this[a+1]=t&255,a+2};E.prototype.writeInt32LE=function(t,a,c){return t=+t,a=a>>>0,c||Qe(this,t,a,4,2147483647,-2147483648),this[a]=t&255,this[a+1]=t>>>8,this[a+2]=t>>>16,this[a+3]=t>>>24,a+4};E.prototype.writeInt32BE=function(t,a,c){return t=+t,a=a>>>0,c||Qe(this,t,a,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[a]=t>>>24,this[a+1]=t>>>16,this[a+2]=t>>>8,this[a+3]=t&255,a+4};function xd(n,t,a,c,_,g){if(a+c>n.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function Td(n,t,a,c,_){return t=+t,a=a>>>0,_||xd(n,t,a,4,34028234663852886e22,-34028234663852886e22),Vt.write(n,t,a,c,23,4),a+4}E.prototype.writeFloatLE=function(t,a,c){return Td(this,t,a,!0,c)};E.prototype.writeFloatBE=function(t,a,c){return Td(this,t,a,!1,c)};function bd(n,t,a,c,_){return t=+t,a=a>>>0,_||xd(n,t,a,8,17976931348623157e292,-17976931348623157e292),Vt.write(n,t,a,c,52,8),a+8}E.prototype.writeDoubleLE=function(t,a,c){return bd(this,t,a,!0,c)};E.prototype.writeDoubleBE=function(t,a,c){return bd(this,t,a,!1,c)};E.prototype.copy=function(t,a,c,_){if(!E.isBuffer(t))throw new TypeError("argument should be a Buffer");if(c||(c=0),!_&&_!==0&&(_=this.length),a>=t.length&&(a=t.length),a||(a=0),_>0&&_<c&&(_=c),_===c||t.length===0||this.length===0)return 0;if(a<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("sourceEnd out of bounds");_>this.length&&(_=this.length),t.length-a<_-c&&(_=t.length-a+c);var g=_-c;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(a,c,_):Uint8Array.prototype.set.call(t,this.subarray(c,_),a),g};E.prototype.fill=function(t,a,c,_){if(typeof t=="string"){if(typeof a=="string"?(_=a,a=0,c=this.length):typeof c=="string"&&(_=c,c=this.length),_!==void 0&&typeof _!="string")throw new TypeError("encoding must be a string");if(typeof _=="string"&&!E.isEncoding(_))throw new TypeError("Unknown encoding: "+_);if(t.length===1){var g=t.charCodeAt(0);(_==="utf8"&&g<128||_==="latin1")&&(t=g)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(a<0||this.length<a||this.length<c)throw new RangeError("Out of range index");if(c<=a)return this;a=a>>>0,c=c===void 0?this.length:c>>>0,t||(t=0);var h;if(typeof t=="number")for(h=a;h<c;++h)this[h]=t;else{var I=E.isBuffer(t)?t:E.from(t,_),A=I.length;if(A===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(h=0;h<c-a;++h)this[h+a]=I[h%A]}return this};var d1=/[^+/0-9A-Za-z-_]/g;function u1(n){if(n=n.split("=")[0],n=n.trim().replace(d1,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function qc(n,t){t=t||1/0;for(var a,c=n.length,_=null,g=[],h=0;h<c;++h){if(a=n.charCodeAt(h),a>55295&&a<57344){if(!_){if(a>56319){(t-=3)>-1&&g.push(239,191,189);continue}else if(h+1===c){(t-=3)>-1&&g.push(239,191,189);continue}_=a;continue}if(a<56320){(t-=3)>-1&&g.push(239,191,189),_=a;continue}a=(_-55296<<10|a-56320)+65536}else _&&(t-=3)>-1&&g.push(239,191,189);if(_=null,a<128){if((t-=1)<0)break;g.push(a)}else if(a<2048){if((t-=2)<0)break;g.push(a>>6|192,a&63|128)}else if(a<65536){if((t-=3)<0)break;g.push(a>>12|224,a>>6&63|128,a&63|128)}else if(a<1114112){if((t-=4)<0)break;g.push(a>>18|240,a>>12&63|128,a>>6&63|128,a&63|128)}else throw new Error("Invalid code point")}return g}function f1(n){for(var t=[],a=0;a<n.length;++a)t.push(n.charCodeAt(a)&255);return t}function g1(n,t){for(var a,c,_,g=[],h=0;h<n.length&&!((t-=2)<0);++h)a=n.charCodeAt(h),c=a>>8,_=a%256,g.push(_),g.push(c);return g}function wd(n){return $c.toByteArray(u1(n))}function di(n,t,a,c){for(var _=0;_<c&&!(_+a>=t.length||_>=n.length);++_)t[_+a]=n[_];return _}function jn(n,t){return n instanceof t||n!=null&&n.constructor!=null&&n.constructor.name!=null&&n.constructor.name===t.name}function Xc(n){return n!==n}var h1=function(){for(var n="0123456789abcdef",t=new Array(256),a=0;a<16;++a)for(var c=a*16,_=0;_<16;++_)t[c+_]=n[a]+n[_];return t}()});var Ed=Zr((tE,kd)=>{i();var Se=kd.exports={},Jn,Qn;function Yc(){throw new Error("setTimeout has not been defined")}function jc(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Jn=setTimeout:Jn=Yc}catch(n){Jn=Yc}try{typeof clearTimeout=="function"?Qn=clearTimeout:Qn=jc}catch(n){Qn=jc}})();function Sd(n){if(Jn===setTimeout)return setTimeout(n,0);if((Jn===Yc||!Jn)&&setTimeout)return Jn=setTimeout,setTimeout(n,0);try{return Jn(n,0)}catch(t){try{return Jn.call(null,n,0)}catch(a){return Jn.call(this,n,0)}}}function y1(n){if(Qn===clearTimeout)return clearTimeout(n);if((Qn===jc||!Qn)&&clearTimeout)return Qn=clearTimeout,clearTimeout(n);try{return Qn(n)}catch(t){try{return Qn.call(null,n)}catch(a){return Qn.call(this,n)}}}var ho=[],Kt=!1,mt,ui=-1;function x1(){!Kt||!mt||(Kt=!1,mt.length?ho=mt.concat(ho):ui=-1,ho.length&&Ad())}function Ad(){if(!Kt){var n=Sd(x1);Kt=!0;for(var t=ho.length;t;){for(mt=ho,ho=[];++ui<t;)mt&&mt[ui].run();ui=-1,t=ho.length}mt=null,Kt=!1,y1(n)}}Se.nextTick=function(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)t[a-1]=arguments[a];ho.push(new Id(n,t)),ho.length===1&&!Kt&&Sd(Ad)};function Id(n,t){this.fun=n,this.array=t}Id.prototype.run=function(){this.fun.apply(null,this.array)};Se.title="browser";Se.browser=!0;Se.env={};Se.argv=[];Se.version="";Se.versions={};function yo(){}Se.on=yo;Se.addListener=yo;Se.once=yo;Se.off=yo;Se.removeListener=yo;Se.removeAllListeners=yo;Se.emit=yo;Se.prependListener=yo;Se.prependOnceListener=yo;Se.listeners=function(n){return[]};Se.binding=function(n){throw new Error("process.binding is not supported")};Se.cwd=function(){return"/"};Se.chdir=function(n){throw new Error("process.chdir is not supported")};Se.umask=function(){return 0}});var m,d,T1,l,i=V(()=>{m=v(vd()),d=v(Ed()),T1=function(n){function t(){var c=this||self;return delete n.prototype.__magic__,c}if(typeof globalThis=="object")return globalThis;if(this)return t();n.defineProperty(n.prototype,"__magic__",{configurable:!0,get:t});var a=__magic__;return a}(Object),l=T1});var Xt=V(()=>{"use strict";i()});var Pd=V(()=>{"use strict";i()});var Yr,Hn,ye=V(()=>{"use strict";i();Yr=(c=>(c.nft="nft",c.esdt="esdt",c.egld="egld",c))(Yr||{}),Hn=(_=>(_.raw="raw",_.text="text",_.decimal="decimal",_.smart="smart",_))(Hn||{})});var xe=V(()=>{"use strict";i()});var Md=V(()=>{"use strict";i()});var Fd=V(()=>{"use strict";i()});var Od=V(()=>{"use strict";i()});var Rd=V(()=>{"use strict";i()});var en=V(()=>{"use strict";i();Pd();ye();xe();Md();Fd();Od();Rd()});var ep,Bd,BE,Wd,WE,Ud,Hd,UE,HE,Gd=V(()=>{"use strict";i();en();ep={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:Bd,egldLabel:BE}=ep["devnet"],{chainId:Wd,egldLabel:WE}=ep["testnet"],{chainId:Ud,egldLabel:Hd}=ep["mainnet"],UE={["devnet"]:Bd,["testnet"]:Wd,["mainnet"]:Ud},HE={[Bd]:"devnet",[Wd]:"testnet",[Ud]:"mainnet"}});var np=V(()=>{"use strict";i()});var $d=V(()=>{"use strict";i()});var xi,op=V(()=>{"use strict";i();xi="transaction-status-toast-id"});var jr,Ti,He,lt,zd,tp,Vd,bi,qd,Kd,Ie,Gn,J=V(()=>{"use strict";i();Xt();Gd();np();$d();op();jr=5e4,Ti=1e9,He=18,lt=4,zd=1,tp=4294967295,Vd=4294967280,bi="logout",qd="login",Kd="refundedGas",Ie="N/A",Gn="0"});var Fi,up=V(()=>{"use strict";i();Fi=()=>Date.now()/1e3});var Fu=V(()=>{"use strict";i()});var Ou=V(()=>{"use strict";i()});var fp=V(()=>{"use strict";i();up();Fu();Ou()});var hp={};st(hp,{getItem:()=>X1,localStorageKeys:()=>Ko,removeItem:()=>Y1,setItem:()=>Z1});var Ko,gp,Z1,X1,Y1,er=V(()=>{"use strict";i();fp();Ko={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},gp=typeof localStorage!="undefined",Z1=({key:n,data:t,expires:a})=>{!gp||localStorage.setItem(String(n),JSON.stringify({expires:a,data:t}))},X1=n=>{if(!gp)return;let t=localStorage.getItem(String(n));if(!t)return null;let a=JSON.parse(t);return!a||!a.hasOwnProperty("expires")||!a.hasOwnProperty("data")?null:Fi()>=a.expires?(localStorage.removeItem(String(n)),null):a.data},Y1=n=>{!gp||localStorage.removeItem(String(n))}});var yp={};st(yp,{clear:()=>Uu,getItem:()=>Bu,removeItem:()=>Wu,setItem:()=>Ru,storage:()=>j1});var Ru,Bu,Wu,Uu,j1,Hu=V(()=>{"use strict";i();Ru=({key:n,data:t,expires:a})=>{sessionStorage.setItem(String(n),JSON.stringify({expires:a,data:t}))},Bu=n=>{let t=sessionStorage.getItem(String(n));if(!t)return null;let a=JSON.parse(t);return!a||!a.hasOwnProperty("expires")||!a.hasOwnProperty("data")?null:Date.now()>=a.expires?(sessionStorage.removeItem(String(n)),null):a.data},Wu=n=>sessionStorage.removeItem(String(n)),Uu=()=>sessionStorage.clear(),j1={setItem:Ru,getItem:Bu,removeItem:Wu,clear:Uu}});var ut,nr=V(()=>{"use strict";i();er();Hu();ut={session:yp,local:hp}});function oa(){return new Date().setHours(new Date().getHours()+24)}function ta(n){ut.local.setItem({key:Ko.loginExpiresAt,data:n,expires:n})}var xp=V(()=>{"use strict";i();nr();er()});var Tp,qe,So,tn=V(()=>{"use strict";i();Tp=require("@reduxjs/toolkit");J();qe=(0,Tp.createAction)(bi),So=(0,Tp.createAction)(qd,n=>({payload:n}))});var $u,Gu,zu,z3,Vu,J1,ra,qu,Q1,Ku,Zu,bp=V(()=>{"use strict";i();$u=require("@reduxjs/toolkit");xp();xe();tn();Gu={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},zu=(0,$u.createSlice)({name:"loginInfoSlice",initialState:Gu,reducers:{setLoginMethod:(n,t)=>{n.loginMethod=t.payload},setTokenLogin:(n,t)=>{n.tokenLogin=t.payload},setTokenLoginSignature:(n,t)=>{(n==null?void 0:n.tokenLogin)!=null&&(n.tokenLogin.signature=t.payload)},setWalletLogin:(n,t)=>{n.walletLogin=t.payload},setWalletConnectLogin:(n,t)=>{n.walletConnectLogin=t.payload},setLedgerLogin:(n,t)=>{n.ledgerLogin=t.payload},invalidateLoginSession:n=>{n.isLoginSessionInvalid=!0}},extraReducers:n=>{n.addCase(qe,()=>Gu),n.addCase(So,(t,a)=>{t.loginMethod=a.payload.loginMethod,ta(oa())})}}),{setLoginMethod:z3,setWalletConnectLogin:Vu,setLedgerLogin:J1,setTokenLogin:ra,setTokenLoginSignature:qu,setWalletLogin:Q1,invalidateLoginSession:Ku}=zu.actions,Zu=zu.reducer});var aa=V(()=>{"use strict";i()});var Yu=V(()=>{"use strict";i();aa()});function wp(n){return n[Math.floor(Math.random()*n.length)]}var ju=V(()=>{"use strict";i()});var vp=V(()=>{"use strict";i();np()});var or=V(()=>{"use strict";i();Yu();ju();vp()});var Ju,Qu,Sp,eA,ef,aD,iD,nf,Ap=V(()=>{"use strict";i();Ju=require("@reduxjs/toolkit"),Qu=v(require("lodash.omit"));or();Sp={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},eA={network:Sp,chainID:"-1"},ef=(0,Ju.createSlice)({name:"appConfig",initialState:eA,reducers:{initializeNetworkConfig:(n,t)=>{let a=wp(t.payload.walletConnectBridgeAddresses),c=wp(t.payload.walletConnectV2RelayAddresses),_=(0,Qu.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");n.network=z(P(P({},n.network),_),{walletConnectBridgeAddress:a,walletConnectV2RelayAddress:c})},setChainID:(n,t)=>{n.chainID=t.payload}}}),{initializeNetworkConfig:aD,setChainID:iD}=ef.actions,nf=ef.reducer});var kp,of,tf,Oi,Ip,rf,Ep,uD,Lp,fD,nA,oA,gD,hD,yD,tA,af,Np=V(()=>{"use strict";i();kp=require("@elrondnetwork/erdjs"),of=require("@reduxjs/toolkit"),tf=require("redux-persist");J();nr();er();tn();Oi={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Gn},Ip={address:"",websocketEvent:null,accounts:{"":Oi},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},rf=(0,of.createSlice)({name:"accountInfoSlice",initialState:Ip,reducers:{setAddress:(n,t)=>{let a=t.payload;n.address=a,n.publicKey=new kp.Address(a).hex()},setAccount:(n,t)=>{let a=n.address===t.payload.address;n.accounts={[n.address]:a?t.payload:Oi},n.isAccountLoading=!1,n.accountLoadingError=null},setAccountNonce:(n,t)=>{let{address:a}=n;n.accounts[a].nonce=t.payload},setAccountShard:(n,t)=>{n.shard=t.payload},setLedgerAccount:(n,t)=>{n.ledgerAccount=t.payload},updateLedgerAccount:(n,t)=>{n.ledgerAccount!=null&&(n.ledgerAccount.index=t.payload.index,n.ledgerAccount.address=t.payload.address)},setWalletConnectAccount:(n,t)=>{n.walletConnectAccount=t.payload},setIsAccountLoading:(n,t)=>{n.isAccountLoading=t.payload,n.accountLoadingError=null},setAccountLoadingError:(n,t)=>{n.accountLoadingError=t.payload,n.isAccountLoading=!1},setWebsocketEvent:(n,t)=>{n.websocketEvent={timestamp:Date.now(),message:t.payload}}},extraReducers:n=>{n.addCase(qe,()=>(ut.local.removeItem(Ko.loginExpiresAt),Ip)),n.addCase(So,(t,a)=>{let{address:c}=a.payload;t.address=c,t.publicKey=new kp.Address(c).hex()}),n.addCase(tf.REHYDRATE,(t,a)=>{var C;if(!((C=a.payload)!=null&&C.account))return;let{account:c}=a.payload,{address:_,shard:g,accounts:h,publicKey:I}=c;t.address=_,t.shard=g;let A=h&&_ in h;t.accounts=A?h:Ip.accounts,t.publicKey=I})}}),{setAccount:Ep,setAddress:uD,setAccountNonce:Lp,setAccountShard:fD,setLedgerAccount:nA,updateLedgerAccount:oA,setWalletConnectAccount:gD,setIsAccountLoading:hD,setAccountLoadingError:yD,setWebsocketEvent:tA}=rf.actions,af=rf.reducer});function tr(n){return n!=null&&(lA(n)||fA(n))}function rr(n){return n!=null&&(_A(n)||gA(n))}function ar(n){return n!=null&&(dA(n)||hA(n))}function Cp(n){return n!=null&&uA(n)}function lA(n){return n!=null&&rA.includes(n)}function _A(n){return n!=null&&aA.includes(n)}function dA(n){return n!=null&&iA.includes(n)}function uA(n){return n!=null&&sA.includes(n)}function fA(n){return n!=null&&cA.includes(n)}function gA(n){return n!=null&&pA.includes(n)}function hA(n){return n!=null&&mA.includes(n)}var rA,aA,iA,sA,cA,pA,mA,ir=V(()=>{"use strict";i();xe();rA=["sent"],aA=["success"],iA=["fail","cancelled","timedOut"],sA=["timedOut"],cA=["pending"],pA=["success"],mA=["fail","invalid"]});var sf,cf,ia,yA,pf,mf,lf,xA,Ri,TA,bA,kD,wA,Bi,Dp,Wi,Ui=V(()=>{"use strict";i();sf=require("@reduxjs/toolkit"),cf=require("redux-persist");xe();ir();tn();ia={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},yA={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},pf=(0,sf.createSlice)({name:"transactionsSlice",initialState:ia,reducers:{moveTransactionsToSignedState:(n,t)=>{var A,C;let{sessionId:a,transactions:c,errorMessage:_,status:g,redirectRoute:h}=t.payload,I=((A=n.customTransactionInformationForSessionId)==null?void 0:A[a])||yA;n.signedTransactions[a]={transactions:c,status:g,errorMessage:_,redirectRoute:h,customTransactionInformation:I},((C=n==null?void 0:n.transactionsToSign)==null?void 0:C.sessionId)===a&&(n.transactionsToSign=ia.transactionsToSign)},clearSignedTransaction:(n,t)=>{n.signedTransactions[t.payload]&&delete n.signedTransactions[t.payload]},clearTransactionToSign:n=>{n!=null&&n.transactionsToSign&&(n.transactionsToSign=null)},updateSignedTransaction:(n,t)=>{n.signedTransactions=P(P({},n.signedTransactions),t.payload)},updateSignedTransactions:(n,t)=>{let{sessionId:a,status:c,errorMessage:_,transactions:g}=t.payload;n.signedTransactions[a]!=null&&(n.signedTransactions[a].status=c,_!=null&&(n.signedTransactions[a].errorMessage=_),g!=null&&(n.signedTransactions[a].transactions=g))},updateSignedTransactionStatus:(n,t)=>{var I,A,C,M,F,W;let{sessionId:a,status:c,errorMessage:_,transactionHash:g}=t.payload,h=(A=(I=n.signedTransactions)==null?void 0:I[a])==null?void 0:A.transactions;if(h!=null){n.signedTransactions[a].transactions=h.map(ae=>ae.hash===g?z(P({},ae),{status:c,errorMessage:_}):ae);let K=(M=(C=n.signedTransactions[a])==null?void 0:C.transactions)==null?void 0:M.every(ae=>rr(ae.status)),te=(W=(F=n.signedTransactions[a])==null?void 0:F.transactions)==null?void 0:W.every(ae=>ar(ae.status));K&&(n.signedTransactions[a].status="success"),te&&(n.signedTransactions[a].status="fail")}},setTransactionsToSign:(n,t)=>{n.transactionsToSign=t.payload;let{sessionId:a,customTransactionInformation:c}=t.payload;n.customTransactionInformationForSessionId[a]=c,n.signTransactionsError=null},clearAllTransactionsToSign:n=>{n.transactionsToSign=ia.transactionsToSign,n.signTransactionsError=null},clearAllSignedTransactions:n=>{n.signedTransactions=ia.signedTransactions},setSignTransactionsError:(n,t)=>{n.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(n,t)=>{n.signTransactionsCancelMessage=t.payload}},extraReducers:n=>{n.addCase(qe,()=>ia),n.addCase(cf.REHYDRATE,(t,a)=>{var h;if(t.signTransactionsCancelMessage=null,!((h=a.payload)!=null&&h.transactions))return;let{signedTransactions:c,customTransactionInformationForSessionId:_}=a.payload.transactions,g=Object.entries(c).reduce((I,[A,C])=>{let M=new Date(A),F=new Date;return F.setHours(F.getHours()+5),F-M>0||(I[A]=C),I},{});_!=null&&(t.customTransactionInformationForSessionId=_),c!=null&&(t.signedTransactions=g)})}}),{updateSignedTransactionStatus:mf,updateSignedTransactions:lf,setTransactionsToSign:xA,clearAllTransactionsToSign:Ri,clearAllSignedTransactions:TA,clearSignedTransaction:bA,clearTransactionToSign:kD,setSignTransactionsError:wA,setSignTransactionsCancelMessage:Bi,moveTransactionsToSignedState:Dp}=pf.actions,Wi=pf.reducer});var _f,Mp,Fp,Op,vA,Pp,df,CD,SA,Rp,Hi,Gi=V(()=>{"use strict";i();_f=require("@reduxjs/toolkit");tn();Mp="Transaction failed",Fp="Transaction successful",Op="Processing transaction",vA="Transaction submitted",Pp={},df=(0,_f.createSlice)({name:"transactionsInfo",initialState:Pp,reducers:{setTransactionsDisplayInfo(n,t){let{sessionId:a,transactionsDisplayInfo:c}=t.payload;a!=null&&(n[a]={errorMessage:(c==null?void 0:c.errorMessage)||Mp,successMessage:(c==null?void 0:c.successMessage)||Fp,processingMessage:(c==null?void 0:c.processingMessage)||Op,submittedMessage:(c==null?void 0:c.submittedMessage)||vA,transactionDuration:c==null?void 0:c.transactionDuration})},clearTransactionsInfoForSessionId(n,t){t.payload!=null&&delete n[t.payload]},clearTransactionsInfo:()=>Pp},extraReducers:n=>{n.addCase(qe,()=>Pp)}}),{clearTransactionsInfo:CD,setTransactionsDisplayInfo:SA,clearTransactionsInfoForSessionId:Rp}=df.actions,Hi=df.reducer});var ff,uf,gf,FD,AA,OD,IA,hf,Bp=V(()=>{"use strict";i();ff=require("@reduxjs/toolkit");tn();uf={},gf=(0,ff.createSlice)({name:"modalsSlice",initialState:uf,reducers:{setTxSubmittedModal:(n,t)=>{n.txSubmittedModal=t.payload},setNotificationModal:(n,t)=>{n.notificationModal=t.payload},clearTxSubmittedModal:n=>{n.txSubmittedModal=void 0},clearNotificationModal:n=>{n.notificationModal=void 0}},extraReducers:n=>{n.addCase(qe,()=>uf)}}),{setTxSubmittedModal:FD,setNotificationModal:AA,clearTxSubmittedModal:OD,clearNotificationModal:IA}=gf.actions,hf=gf.reducer});var xf,Tf,yf,bf,kA,Wp,zD,VD,qD,KD,$i,zi=V(()=>{"use strict";i();xf=require("@reduxjs/toolkit"),Tf=require("redux-persist");op();en();up();tn();yf={customToasts:[],transactionToasts:[],failTransactionToast:null},bf=(0,xf.createSlice)({name:"toastsSlice",initialState:yf,reducers:{addCustomToast:(n,t)=>{n.customToasts.push(z(P({},t.payload),{type:"custom",toastId:t.payload.toastId||`custom-toast-${n.customToasts.length+1}`}))},removeCustomToast:(n,t)=>{n.customToasts=n.customToasts.filter(a=>a.toastId!==t.payload)},addTransactionToast:(n,t)=>{n.transactionToasts.push({type:"transaction",startTimestamp:Fi(),toastId:t.payload||`custom-toast-${n.transactionToasts.length+1}`})},removeTransactionToast:(n,t)=>{n.transactionToasts=n.transactionToasts.filter(a=>a.toastId!==t.payload)},addFailTransactionToast:(n,t)=>{n.failTransactionToast=z(P({},t.payload),{toastId:xi})},removeFailTransactionToast:n=>{n.failTransactionToast=null}},extraReducers:n=>{n.addCase(qe,()=>yf),n.addCase(Tf.REHYDRATE,(t,a)=>{var _,g;let c=(g=(_=a.customToasts)==null?void 0:_.filter(h=>!("component"in h)))!=null?g:[];t.customToasts=c})}}),{addCustomToast:kA,removeCustomToast:Wp,addTransactionToast:zD,removeTransactionToast:VD,addFailTransactionToast:qD,removeFailTransactionToast:KD}=bf.actions,$i=bf.reducer});var de=V(()=>{"use strict";i();bp();Ap();Np();Ui();Gi();Bp();zi()});var Up=V(()=>{"use strict";i()});var Af,Sf,If,d5,u5,f5,g5,h5,y5,kf,Ef=V(()=>{"use strict";i();Af=require("@reduxjs/toolkit");tn();Sf={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},If=(0,Af.createSlice)({name:"dappModalsSlice",initialState:Sf,reducers:{setDappModalVisibility:(n,t)=>{n.visible=t.payload},setDappModalHeaderVisibility:(n,t)=>{n.modal.showHeader=t.payload},setDappModalFooterVisibility:(n,t)=>{n.modal.showFooter=t.payload},setDappModalHeaderText:(n,t)=>{n.modal.headerText=t.payload},setDappModalFooterText:(n,t)=>{n.modal.footerText=t.payload},setDappModalConfig:(n,t)=>{n.modal=P({},t.payload)}},extraReducers:n=>{n.addCase(qe,()=>Sf)}}),{setDappModalVisibility:d5,setDappModalHeaderVisibility:u5,setDappModalFooterVisibility:f5,setDappModalHeaderText:g5,setDappModalFooterText:h5,setDappModalConfig:y5}=If.actions,kf=If.reducer});var Lf,CA,DA,sr,qi=V(()=>{"use strict";i();Lf=require("@reduxjs/toolkit");Up();Np();Ef();bp();Bp();Ap();zi();Gi();Ui();CA={["account"]:af,["networkConfig"]:nf,["loginInfo"]:Zu,["modals"]:hf,["dappModal"]:kf,["toasts"]:$i,["transactions"]:Wi,["transactionsInfo"]:Hi},DA=(n={})=>(0,Lf.combineReducers)(P(P({},CA),n)),sr=DA});var Df={};st(Df,{default:()=>WA});function Hp(n,t=[]){return{key:n,version:1,storage:Cf.default,blacklist:t}}var gt,Nf,Cf,PA,MA,FA,OA,RA,BA,WA,Pf=V(()=>{"use strict";i();gt=require("redux-persist"),Nf=v(require("redux-persist/lib/storage")),Cf=v(require("redux-persist/lib/storage/session"));qi();de();zi();Gi();Ui();Up();PA={2:n=>z(P({},n),{networkConfig:Sp})};MA=Hp("dapp-core-transactionsInfo"),FA=Hp("dapp-core-transactions",["transactionsToSign"]),OA=Hp("dapp-core-toasts"),RA={key:"dapp-core-store",version:2,storage:Nf.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,gt.createMigrate)(PA,{debug:!1})},BA={["toasts"]:(0,gt.persistReducer)(OA,$i),["transactions"]:(0,gt.persistReducer)(FA,Wi),["transactionsInfo"]:(0,gt.persistReducer)(MA,Hi)},WA=(0,gt.persistReducer)(RA,sr(BA))});var Mf={};st(Mf,{default:()=>UA});var UA,Ff=V(()=>{"use strict";i();qi();UA=sr()});var Of={};st(Of,{default:()=>GA});var Cn,HA,GA,Rf=V(()=>{"use strict";i();Cn=require("redux-persist"),HA=[Cn.FLUSH,Cn.REHYDRATE,Cn.PAUSE,Cn.PERSIST,Cn.PURGE,Cn.REGISTER],GA=HA});var Uf={};st(Uf,{default:()=>Wf});function Wf(n){return(0,Bf.persistStore)(n)}var Bf,Hf=V(()=>{"use strict";i();Bf=require("redux-persist")});var xg=Zr((ur,ca)=>{i();(function(){var n,t="4.17.21",a=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",_="Expected a function",g="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",I=500,A="__lodash_placeholder__",C=1,M=2,F=4,W=1,K=2,te=1,ae=2,Yo=4,cn=8,pn=16,Re=32,Ce=64,Ke=128,Vn=256,Sr=512,ys=30,Gh="...",$h=800,zh=16,Im=1,Vh=2,qh=3,jo=1/0,Po=9007199254740991,Kh=17976931348623157e292,ha=0/0,qn=4294967295,Zh=qn-1,Xh=qn>>>1,Yh=[["ary",Ke],["bind",te],["bindKey",ae],["curry",cn],["curryRight",pn],["flip",Sr],["partial",Re],["partialRight",Ce],["rearg",Vn]],Nt="[object Arguments]",ya="[object Array]",jh="[object AsyncFunction]",Ar="[object Boolean]",Ir="[object Date]",Jh="[object DOMException]",xa="[object Error]",Ta="[object Function]",km="[object GeneratorFunction]",Fn="[object Map]",kr="[object Number]",Qh="[object Null]",ao="[object Object]",Em="[object Promise]",ey="[object Proxy]",Er="[object RegExp]",On="[object Set]",Lr="[object String]",ba="[object Symbol]",ny="[object Undefined]",Nr="[object WeakMap]",oy="[object WeakSet]",Cr="[object ArrayBuffer]",Ct="[object DataView]",xs="[object Float32Array]",Ts="[object Float64Array]",bs="[object Int8Array]",ws="[object Int16Array]",vs="[object Int32Array]",Ss="[object Uint8Array]",As="[object Uint8ClampedArray]",Is="[object Uint16Array]",ks="[object Uint32Array]",ty=/\b__p \+= '';/g,ry=/\b(__p \+=) '' \+/g,ay=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Lm=/&(?:amp|lt|gt|quot|#39);/g,Nm=/[&<>"']/g,iy=RegExp(Lm.source),sy=RegExp(Nm.source),cy=/<%-([\s\S]+?)%>/g,py=/<%([\s\S]+?)%>/g,Cm=/<%=([\s\S]+?)%>/g,my=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ly=/^\w*$/,_y=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Es=/[\\^$.*+?()[\]{}|]/g,dy=RegExp(Es.source),Ls=/^\s+/,uy=/\s/,fy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,gy=/\{\n\/\* \[wrapped with (.+)\] \*/,hy=/,? & /,yy=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xy=/[()=,{}\[\]\/\s]/,Ty=/\\(\\)?/g,by=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Dm=/\w*$/,wy=/^[-+]0x[0-9a-f]+$/i,vy=/^0b[01]+$/i,Sy=/^\[object .+?Constructor\]$/,Ay=/^0o[0-7]+$/i,Iy=/^(?:0|[1-9]\d*)$/,ky=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wa=/($^)/,Ey=/['\n\r\u2028\u2029\\]/g,va="\\ud800-\\udfff",Ly="\\u0300-\\u036f",Ny="\\ufe20-\\ufe2f",Cy="\\u20d0-\\u20ff",Pm=Ly+Ny+Cy,Mm="\\u2700-\\u27bf",Fm="a-z\\xdf-\\xf6\\xf8-\\xff",Dy="\\xac\\xb1\\xd7\\xf7",Py="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",My="\\u2000-\\u206f",Fy=" \\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",Om="A-Z\\xc0-\\xd6\\xd8-\\xde",Rm="\\ufe0e\\ufe0f",Bm=Dy+Py+My+Fy,Ns="['\u2019]",Oy="["+va+"]",Wm="["+Bm+"]",Sa="["+Pm+"]",Um="\\d+",Ry="["+Mm+"]",Hm="["+Fm+"]",Gm="[^"+va+Bm+Um+Mm+Fm+Om+"]",Cs="\\ud83c[\\udffb-\\udfff]",By="(?:"+Sa+"|"+Cs+")",$m="[^"+va+"]",Ds="(?:\\ud83c[\\udde6-\\uddff]){2}",Ps="[\\ud800-\\udbff][\\udc00-\\udfff]",Dt="["+Om+"]",zm="\\u200d",Vm="(?:"+Hm+"|"+Gm+")",Wy="(?:"+Dt+"|"+Gm+")",qm="(?:"+Ns+"(?:d|ll|m|re|s|t|ve))?",Km="(?:"+Ns+"(?:D|LL|M|RE|S|T|VE))?",Zm=By+"?",Xm="["+Rm+"]?",Uy="(?:"+zm+"(?:"+[$m,Ds,Ps].join("|")+")"+Xm+Zm+")*",Hy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Gy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ym=Xm+Zm+Uy,$y="(?:"+[Ry,Ds,Ps].join("|")+")"+Ym,zy="(?:"+[$m+Sa+"?",Sa,Ds,Ps,Oy].join("|")+")",Vy=RegExp(Ns,"g"),qy=RegExp(Sa,"g"),Ms=RegExp(Cs+"(?="+Cs+")|"+zy+Ym,"g"),Ky=RegExp([Dt+"?"+Hm+"+"+qm+"(?="+[Wm,Dt,"$"].join("|")+")",Wy+"+"+Km+"(?="+[Wm,Dt+Vm,"$"].join("|")+")",Dt+"?"+Vm+"+"+qm,Dt+"+"+Km,Gy,Hy,Um,$y].join("|"),"g"),Zy=RegExp("["+zm+va+Pm+Rm+"]"),Xy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Yy=["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"],jy=-1,ue={};ue[xs]=ue[Ts]=ue[bs]=ue[ws]=ue[vs]=ue[Ss]=ue[As]=ue[Is]=ue[ks]=!0,ue[Nt]=ue[ya]=ue[Cr]=ue[Ar]=ue[Ct]=ue[Ir]=ue[xa]=ue[Ta]=ue[Fn]=ue[kr]=ue[ao]=ue[Er]=ue[On]=ue[Lr]=ue[Nr]=!1;var _e={};_e[Nt]=_e[ya]=_e[Cr]=_e[Ct]=_e[Ar]=_e[Ir]=_e[xs]=_e[Ts]=_e[bs]=_e[ws]=_e[vs]=_e[Fn]=_e[kr]=_e[ao]=_e[Er]=_e[On]=_e[Lr]=_e[ba]=_e[Ss]=_e[As]=_e[Is]=_e[ks]=!0,_e[xa]=_e[Ta]=_e[Nr]=!1;var Jy={\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