UNPKG

@sofaws/dapp-core

Version:

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

116 lines (101 loc) 208 kB
"use strict";var Ds=Object.create;var wo=Object.defineProperty,Ps=Object.defineProperties,Rs=Object.getOwnPropertyDescriptor,Ms=Object.getOwnPropertyDescriptors,Fs=Object.getOwnPropertyNames,qo=Object.getOwnPropertySymbols,Os=Object.getPrototypeOf,zn=Object.prototype.hasOwnProperty,yr=Object.prototype.propertyIsEnumerable;var hr=(e,o,n)=>o in e?wo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,f=(e,o)=>{for(var n in o||(o={}))zn.call(o,n)&&hr(e,n,o[n]);if(qo)for(var n of qo(o))yr.call(o,n)&&hr(e,n,o[n]);return e},S=(e,o)=>Ps(e,Ms(o));var Oe=(e,o)=>{var n={};for(var r in e)zn.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qo)for(var r of qo(e))o.indexOf(r)<0&&yr.call(e,r)&&(n[r]=e[r]);return n};var x=(e,o)=>()=>(e&&(o=e(e=0)),o);var Ko=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),Be=(e,o)=>{for(var n in o)wo(e,n,{get:o[n],enumerable:!0})},xr=(e,o,n,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of Fs(o))!zn.call(e,a)&&a!==n&&wo(e,a,{get:()=>o[a],enumerable:!(r=Rs(o,a))||r.enumerable});return e};var g=(e,o,n)=>(n=e!=null?Ds(Os(e)):{},xr(o||!e||!e.__esModule?wo(n,"default",{value:e,enumerable:!0}):n,e)),So=e=>xr(wo({},"__esModule",{value:!0}),e);var v=(e,o,n)=>new Promise((r,a)=>{var p=l=>{try{_(n.next(l))}catch(u){a(u)}},m=l=>{try{_(n.throw(l))}catch(u){a(u)}},_=l=>l.done?r(l.value):Promise.resolve(l.value).then(p,m);_((n=n.apply(e,o)).next())});var Sr=Ko(Xo=>{"use strict";t();Xo.byteLength=Us;Xo.toByteArray=Gs;Xo.fromByteArray=Hs;var ie=[],K=[],Bs=typeof Uint8Array!="undefined"?Uint8Array:Array,jn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ue=0,br=jn.length;Ue<br;++Ue)ie[Ue]=jn[Ue],K[jn.charCodeAt(Ue)]=Ue;var Ue,br;K["-".charCodeAt(0)]=62;K["_".charCodeAt(0)]=63;function wr(e){var o=e.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=o);var r=n===o?0:4-n%4;return[n,r]}function Us(e){var o=wr(e),n=o[0],r=o[1];return(n+r)*3/4-r}function Ws(e,o,n){return(o+n)*3/4-n}function Gs(e){var o,n=wr(e),r=n[0],a=n[1],p=new Bs(Ws(e,r,a)),m=0,_=a>0?r-4:r,l;for(l=0;l<_;l+=4)o=K[e.charCodeAt(l)]<<18|K[e.charCodeAt(l+1)]<<12|K[e.charCodeAt(l+2)]<<6|K[e.charCodeAt(l+3)],p[m++]=o>>16&255,p[m++]=o>>8&255,p[m++]=o&255;return a===2&&(o=K[e.charCodeAt(l)]<<2|K[e.charCodeAt(l+1)]>>4,p[m++]=o&255),a===1&&(o=K[e.charCodeAt(l)]<<10|K[e.charCodeAt(l+1)]<<4|K[e.charCodeAt(l+2)]>>2,p[m++]=o>>8&255,p[m++]=o&255),p}function Vs(e){return ie[e>>18&63]+ie[e>>12&63]+ie[e>>6&63]+ie[e&63]}function $s(e,o,n){for(var r,a=[],p=o;p<n;p+=3)r=(e[p]<<16&16711680)+(e[p+1]<<8&65280)+(e[p+2]&255),a.push(Vs(r));return a.join("")}function Hs(e){for(var o,n=e.length,r=n%3,a=[],p=16383,m=0,_=n-r;m<_;m+=p)a.push($s(e,m,m+p>_?_:m+p));return r===1?(o=e[n-1],a.push(ie[o>>2]+ie[o<<4&63]+"==")):r===2&&(o=(e[n-2]<<8)+e[n-1],a.push(ie[o>>10]+ie[o>>4&63]+ie[o<<2&63]+"=")),a.join("")}});var vr=Ko(qn=>{t();qn.read=function(e,o,n,r,a){var p,m,_=a*8-r-1,l=(1<<_)-1,u=l>>1,h=-7,T=n?a-1:0,b=n?-1:1,k=e[o+T];for(T+=b,p=k&(1<<-h)-1,k>>=-h,h+=_;h>0;p=p*256+e[o+T],T+=b,h-=8);for(m=p&(1<<-h)-1,p>>=-h,h+=r;h>0;m=m*256+e[o+T],T+=b,h-=8);if(p===0)p=1-u;else{if(p===l)return m?NaN:(k?-1:1)*(1/0);m=m+Math.pow(2,r),p=p-u}return(k?-1:1)*m*Math.pow(2,p-r)};qn.write=function(e,o,n,r,a,p){var m,_,l,u=p*8-a-1,h=(1<<u)-1,T=h>>1,b=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=r?0:p-1,D=r?1:-1,P=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(_=isNaN(o)?1:0,m=h):(m=Math.floor(Math.log(o)/Math.LN2),o*(l=Math.pow(2,-m))<1&&(m--,l*=2),m+T>=1?o+=b/l:o+=b*Math.pow(2,1-T),o*l>=2&&(m++,l/=2),m+T>=h?(_=0,m=h):m+T>=1?(_=(o*l-1)*Math.pow(2,a),m=m+T):(_=o*Math.pow(2,T-1)*Math.pow(2,a),m=0));a>=8;e[n+k]=_&255,k+=D,_/=256,a-=8);for(m=m<<a|_,u+=a;u>0;e[n+k]=m&255,k+=D,m/=256,u-=8);e[n+k-D]|=P*128}});var Or=Ko(Qe=>{"use strict";t();var Kn=Sr(),Je=vr(),kr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Qe.Buffer=d;Qe.SlowBuffer=Zs;Qe.INSPECT_MAX_BYTES=50;var Zo=2147483647;Qe.kMaxLength=Zo;d.TYPED_ARRAY_SUPPORT=zs();!d.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 zs(){try{var e=new Uint8Array(1),o={foo:function(){return 42}};return Object.setPrototypeOf(o,Uint8Array.prototype),Object.setPrototypeOf(e,o),e.foo()===42}catch(n){return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(!!d.isBuffer(this))return this.buffer}});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(!!d.isBuffer(this))return this.byteOffset}});function fe(e){if(e>Zo)throw new RangeError('The value "'+e+'" is invalid for option "size"');var o=new Uint8Array(e);return Object.setPrototypeOf(o,d.prototype),o}function d(e,o,n){if(typeof e=="number"){if(typeof o=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Jn(e)}return Er(e,o,n)}d.poolSize=8192;function Er(e,o,n){if(typeof e=="string")return qs(e,o);if(ArrayBuffer.isView(e))return Ks(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(ce(e,ArrayBuffer)||e&&ce(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(ce(e,SharedArrayBuffer)||e&&ce(e.buffer,SharedArrayBuffer)))return Zn(e,o,n);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return d.from(r,o,n);var a=Xs(e);if(a)return a;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return d.from(e[Symbol.toPrimitive]("string"),o,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}d.from=function(e,o,n){return Er(e,o,n)};Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Cr(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function js(e,o,n){return Cr(e),e<=0?fe(e):o!==void 0?typeof n=="string"?fe(e).fill(o,n):fe(e).fill(o):fe(e)}d.alloc=function(e,o,n){return js(e,o,n)};function Jn(e){return Cr(e),fe(e<0?0:Qn(e)|0)}d.allocUnsafe=function(e){return Jn(e)};d.allocUnsafeSlow=function(e){return Jn(e)};function qs(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!d.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=Lr(e,o)|0,r=fe(n),a=r.write(e,o);return a!==n&&(r=r.slice(0,a)),r}function Xn(e){for(var o=e.length<0?0:Qn(e.length)|0,n=fe(o),r=0;r<o;r+=1)n[r]=e[r]&255;return n}function Ks(e){if(ce(e,Uint8Array)){var o=new Uint8Array(e);return Zn(o.buffer,o.byteOffset,o.byteLength)}return Xn(e)}function Zn(e,o,n){if(o<0||e.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<o+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return o===void 0&&n===void 0?r=new Uint8Array(e):n===void 0?r=new Uint8Array(e,o):r=new Uint8Array(e,o,n),Object.setPrototypeOf(r,d.prototype),r}function Xs(e){if(d.isBuffer(e)){var o=Qn(e.length)|0,n=fe(o);return n.length===0||e.copy(n,0,0,o),n}if(e.length!==void 0)return typeof e.length!="number"||et(e.length)?fe(0):Xn(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Xn(e.data)}function Qn(e){if(e>=Zo)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Zo.toString(16)+" bytes");return e|0}function Zs(e){return+e!=e&&(e=0),d.alloc(+e)}d.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==d.prototype};d.compare=function(o,n){if(ce(o,Uint8Array)&&(o=d.from(o,o.offset,o.byteLength)),ce(n,Uint8Array)&&(n=d.from(n,n.offset,n.byteLength)),!d.isBuffer(o)||!d.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(o===n)return 0;for(var r=o.length,a=n.length,p=0,m=Math.min(r,a);p<m;++p)if(o[p]!==n[p]){r=o[p],a=n[p];break}return r<a?-1:a<r?1:0};d.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}};d.concat=function(o,n){if(!Array.isArray(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return d.alloc(0);var r;if(n===void 0)for(n=0,r=0;r<o.length;++r)n+=o[r].length;var a=d.allocUnsafe(n),p=0;for(r=0;r<o.length;++r){var m=o[r];if(ce(m,Uint8Array))p+m.length>a.length?d.from(m).copy(a,p):Uint8Array.prototype.set.call(a,m,p);else if(d.isBuffer(m))m.copy(a,p);else throw new TypeError('"list" argument must be an Array of Buffers');p+=m.length}return a};function Lr(e,o){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ce(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;for(var a=!1;;)switch(o){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Yn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Fr(e).length;default:if(a)return r?-1:Yn(e).length;o=(""+o).toLowerCase(),a=!0}}d.byteLength=Lr;function Ys(e,o,n){var r=!1;if((o===void 0||o<0)&&(o=0),o>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,o>>>=0,n<=o))return"";for(e||(e="utf8");;)switch(e){case"hex":return cp(this,o,n);case"utf8":case"utf-8":return Dr(this,o,n);case"ascii":return ap(this,o,n);case"latin1":case"binary":return ip(this,o,n);case"base64":return tp(this,o,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sp(this,o,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}d.prototype._isBuffer=!0;function We(e,o,n){var r=e[o];e[o]=e[n],e[n]=r}d.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 n=0;n<o;n+=2)We(this,n,n+1);return this};d.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 n=0;n<o;n+=4)We(this,n,n+3),We(this,n+1,n+2);return this};d.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 n=0;n<o;n+=8)We(this,n,n+7),We(this,n+1,n+6),We(this,n+2,n+5),We(this,n+3,n+4);return this};d.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?Dr(this,0,o):Ys.apply(this,arguments)};d.prototype.toLocaleString=d.prototype.toString;d.prototype.equals=function(o){if(!d.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:d.compare(this,o)===0};d.prototype.inspect=function(){var o="",n=Qe.INSPECT_MAX_BYTES;return o=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(o+=" ... "),"<Buffer "+o+">"};kr&&(d.prototype[kr]=d.prototype.inspect);d.prototype.compare=function(o,n,r,a,p){if(ce(o,Uint8Array)&&(o=d.from(o,o.offset,o.byteLength)),!d.isBuffer(o))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof o);if(n===void 0&&(n=0),r===void 0&&(r=o?o.length:0),a===void 0&&(a=0),p===void 0&&(p=this.length),n<0||r>o.length||a<0||p>this.length)throw new RangeError("out of range index");if(a>=p&&n>=r)return 0;if(a>=p)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,a>>>=0,p>>>=0,this===o)return 0;for(var m=p-a,_=r-n,l=Math.min(m,_),u=this.slice(a,p),h=o.slice(n,r),T=0;T<l;++T)if(u[T]!==h[T]){m=u[T],_=h[T];break}return m<_?-1:_<m?1:0};function Nr(e,o,n,r,a){if(e.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,et(n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0)if(a)n=0;else return-1;if(typeof o=="string"&&(o=d.from(o,r)),d.isBuffer(o))return o.length===0?-1:Ar(e,o,n,r,a);if(typeof o=="number")return o=o&255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e,o,n):Uint8Array.prototype.lastIndexOf.call(e,o,n):Ar(e,[o],n,r,a);throw new TypeError("val must be string, number or Buffer")}function Ar(e,o,n,r,a){var p=1,m=e.length,_=o.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(e.length<2||o.length<2)return-1;p=2,m/=2,_/=2,n/=2}function l(k,D){return p===1?k[D]:k.readUInt16BE(D*p)}var u;if(a){var h=-1;for(u=n;u<m;u++)if(l(e,u)===l(o,h===-1?0:u-h)){if(h===-1&&(h=u),u-h+1===_)return h*p}else h!==-1&&(u-=u-h),h=-1}else for(n+_>m&&(n=m-_),u=n;u>=0;u--){for(var T=!0,b=0;b<_;b++)if(l(e,u+b)!==l(o,b)){T=!1;break}if(T)return u}return-1}d.prototype.includes=function(o,n,r){return this.indexOf(o,n,r)!==-1};d.prototype.indexOf=function(o,n,r){return Nr(this,o,n,r,!0)};d.prototype.lastIndexOf=function(o,n,r){return Nr(this,o,n,r,!1)};function Js(e,o,n,r){n=Number(n)||0;var a=e.length-n;r?(r=Number(r),r>a&&(r=a)):r=a;var p=o.length;r>p/2&&(r=p/2);for(var m=0;m<r;++m){var _=parseInt(o.substr(m*2,2),16);if(et(_))return m;e[n+m]=_}return m}function Qs(e,o,n,r){return Yo(Yn(o,e.length-n),e,n,r)}function ep(e,o,n,r){return Yo(_p(o),e,n,r)}function op(e,o,n,r){return Yo(Fr(o),e,n,r)}function np(e,o,n,r){return Yo(lp(o,e.length-n),e,n,r)}d.prototype.write=function(o,n,r,a){if(n===void 0)a="utf8",r=this.length,n=0;else if(r===void 0&&typeof n=="string")a=n,r=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(r)?(r=r>>>0,a===void 0&&(a="utf8")):(a=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var p=this.length-n;if((r===void 0||r>p)&&(r=p),o.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var m=!1;;)switch(a){case"hex":return Js(this,o,n,r);case"utf8":case"utf-8":return Qs(this,o,n,r);case"ascii":case"latin1":case"binary":return ep(this,o,n,r);case"base64":return op(this,o,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return np(this,o,n,r);default:if(m)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),m=!0}};d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function tp(e,o,n){return o===0&&n===e.length?Kn.fromByteArray(e):Kn.fromByteArray(e.slice(o,n))}function Dr(e,o,n){n=Math.min(e.length,n);for(var r=[],a=o;a<n;){var p=e[a],m=null,_=p>239?4:p>223?3:p>191?2:1;if(a+_<=n){var l,u,h,T;switch(_){case 1:p<128&&(m=p);break;case 2:l=e[a+1],(l&192)===128&&(T=(p&31)<<6|l&63,T>127&&(m=T));break;case 3:l=e[a+1],u=e[a+2],(l&192)===128&&(u&192)===128&&(T=(p&15)<<12|(l&63)<<6|u&63,T>2047&&(T<55296||T>57343)&&(m=T));break;case 4:l=e[a+1],u=e[a+2],h=e[a+3],(l&192)===128&&(u&192)===128&&(h&192)===128&&(T=(p&15)<<18|(l&63)<<12|(u&63)<<6|h&63,T>65535&&T<1114112&&(m=T))}}m===null?(m=65533,_=1):m>65535&&(m-=65536,r.push(m>>>10&1023|55296),m=56320|m&1023),r.push(m),a+=_}return rp(r)}var Ir=4096;function rp(e){var o=e.length;if(o<=Ir)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<o;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Ir));return n}function ap(e,o,n){var r="";n=Math.min(e.length,n);for(var a=o;a<n;++a)r+=String.fromCharCode(e[a]&127);return r}function ip(e,o,n){var r="";n=Math.min(e.length,n);for(var a=o;a<n;++a)r+=String.fromCharCode(e[a]);return r}function cp(e,o,n){var r=e.length;(!o||o<0)&&(o=0),(!n||n<0||n>r)&&(n=r);for(var a="",p=o;p<n;++p)a+=dp[e[p]];return a}function sp(e,o,n){for(var r=e.slice(o,n),a="",p=0;p<r.length-1;p+=2)a+=String.fromCharCode(r[p]+r[p+1]*256);return a}d.prototype.slice=function(o,n){var r=this.length;o=~~o,n=n===void 0?r:~~n,o<0?(o+=r,o<0&&(o=0)):o>r&&(o=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n<o&&(n=o);var a=this.subarray(o,n);return Object.setPrototypeOf(a,d.prototype),a};function O(e,o,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+o>n)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||O(o,n,this.length);for(var a=this[o],p=1,m=0;++m<n&&(p*=256);)a+=this[o+m]*p;return a};d.prototype.readUintBE=d.prototype.readUIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||O(o,n,this.length);for(var a=this[o+--n],p=1;n>0&&(p*=256);)a+=this[o+--n]*p;return a};d.prototype.readUint8=d.prototype.readUInt8=function(o,n){return o=o>>>0,n||O(o,1,this.length),this[o]};d.prototype.readUint16LE=d.prototype.readUInt16LE=function(o,n){return o=o>>>0,n||O(o,2,this.length),this[o]|this[o+1]<<8};d.prototype.readUint16BE=d.prototype.readUInt16BE=function(o,n){return o=o>>>0,n||O(o,2,this.length),this[o]<<8|this[o+1]};d.prototype.readUint32LE=d.prototype.readUInt32LE=function(o,n){return o=o>>>0,n||O(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216};d.prototype.readUint32BE=d.prototype.readUInt32BE=function(o,n){return o=o>>>0,n||O(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])};d.prototype.readIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||O(o,n,this.length);for(var a=this[o],p=1,m=0;++m<n&&(p*=256);)a+=this[o+m]*p;return p*=128,a>=p&&(a-=Math.pow(2,8*n)),a};d.prototype.readIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||O(o,n,this.length);for(var a=n,p=1,m=this[o+--a];a>0&&(p*=256);)m+=this[o+--a]*p;return p*=128,m>=p&&(m-=Math.pow(2,8*n)),m};d.prototype.readInt8=function(o,n){return o=o>>>0,n||O(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]};d.prototype.readInt16LE=function(o,n){o=o>>>0,n||O(o,2,this.length);var r=this[o]|this[o+1]<<8;return r&32768?r|4294901760:r};d.prototype.readInt16BE=function(o,n){o=o>>>0,n||O(o,2,this.length);var r=this[o+1]|this[o]<<8;return r&32768?r|4294901760:r};d.prototype.readInt32LE=function(o,n){return o=o>>>0,n||O(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24};d.prototype.readInt32BE=function(o,n){return o=o>>>0,n||O(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]};d.prototype.readFloatLE=function(o,n){return o=o>>>0,n||O(o,4,this.length),Je.read(this,o,!0,23,4)};d.prototype.readFloatBE=function(o,n){return o=o>>>0,n||O(o,4,this.length),Je.read(this,o,!1,23,4)};d.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||O(o,8,this.length),Je.read(this,o,!0,52,8)};d.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||O(o,8,this.length),Je.read(this,o,!1,52,8)};function $(e,o,n,r,a,p){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>a||o<p)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(o,n,r,a){if(o=+o,n=n>>>0,r=r>>>0,!a){var p=Math.pow(2,8*r)-1;$(this,o,n,r,p,0)}var m=1,_=0;for(this[n]=o&255;++_<r&&(m*=256);)this[n+_]=o/m&255;return n+r};d.prototype.writeUintBE=d.prototype.writeUIntBE=function(o,n,r,a){if(o=+o,n=n>>>0,r=r>>>0,!a){var p=Math.pow(2,8*r)-1;$(this,o,n,r,p,0)}var m=r-1,_=1;for(this[n+m]=o&255;--m>=0&&(_*=256);)this[n+m]=o/_&255;return n+r};d.prototype.writeUint8=d.prototype.writeUInt8=function(o,n,r){return o=+o,n=n>>>0,r||$(this,o,n,1,255,0),this[n]=o&255,n+1};d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||$(this,o,n,2,65535,0),this[n]=o&255,this[n+1]=o>>>8,n+2};d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||$(this,o,n,2,65535,0),this[n]=o>>>8,this[n+1]=o&255,n+2};d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||$(this,o,n,4,4294967295,0),this[n+3]=o>>>24,this[n+2]=o>>>16,this[n+1]=o>>>8,this[n]=o&255,n+4};d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||$(this,o,n,4,4294967295,0),this[n]=o>>>24,this[n+1]=o>>>16,this[n+2]=o>>>8,this[n+3]=o&255,n+4};d.prototype.writeIntLE=function(o,n,r,a){if(o=+o,n=n>>>0,!a){var p=Math.pow(2,8*r-1);$(this,o,n,r,p-1,-p)}var m=0,_=1,l=0;for(this[n]=o&255;++m<r&&(_*=256);)o<0&&l===0&&this[n+m-1]!==0&&(l=1),this[n+m]=(o/_>>0)-l&255;return n+r};d.prototype.writeIntBE=function(o,n,r,a){if(o=+o,n=n>>>0,!a){var p=Math.pow(2,8*r-1);$(this,o,n,r,p-1,-p)}var m=r-1,_=1,l=0;for(this[n+m]=o&255;--m>=0&&(_*=256);)o<0&&l===0&&this[n+m+1]!==0&&(l=1),this[n+m]=(o/_>>0)-l&255;return n+r};d.prototype.writeInt8=function(o,n,r){return o=+o,n=n>>>0,r||$(this,o,n,1,127,-128),o<0&&(o=255+o+1),this[n]=o&255,n+1};d.prototype.writeInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||$(this,o,n,2,32767,-32768),this[n]=o&255,this[n+1]=o>>>8,n+2};d.prototype.writeInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||$(this,o,n,2,32767,-32768),this[n]=o>>>8,this[n+1]=o&255,n+2};d.prototype.writeInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||$(this,o,n,4,2147483647,-2147483648),this[n]=o&255,this[n+1]=o>>>8,this[n+2]=o>>>16,this[n+3]=o>>>24,n+4};d.prototype.writeInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||$(this,o,n,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),this[n]=o>>>24,this[n+1]=o>>>16,this[n+2]=o>>>8,this[n+3]=o&255,n+4};function Pr(e,o,n,r,a,p){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Rr(e,o,n,r,a){return o=+o,n=n>>>0,a||Pr(e,o,n,4,34028234663852886e22,-34028234663852886e22),Je.write(e,o,n,r,23,4),n+4}d.prototype.writeFloatLE=function(o,n,r){return Rr(this,o,n,!0,r)};d.prototype.writeFloatBE=function(o,n,r){return Rr(this,o,n,!1,r)};function Mr(e,o,n,r,a){return o=+o,n=n>>>0,a||Pr(e,o,n,8,17976931348623157e292,-17976931348623157e292),Je.write(e,o,n,r,52,8),n+8}d.prototype.writeDoubleLE=function(o,n,r){return Mr(this,o,n,!0,r)};d.prototype.writeDoubleBE=function(o,n,r){return Mr(this,o,n,!1,r)};d.prototype.copy=function(o,n,r,a){if(!d.isBuffer(o))throw new TypeError("argument should be a Buffer");if(r||(r=0),!a&&a!==0&&(a=this.length),n>=o.length&&(n=o.length),n||(n=0),a>0&&a<r&&(a=r),a===r||o.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),o.length-n<a-r&&(a=o.length-n+r);var p=a-r;return this===o&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,r,a):Uint8Array.prototype.set.call(o,this.subarray(r,a),n),p};d.prototype.fill=function(o,n,r,a){if(typeof o=="string"){if(typeof n=="string"?(a=n,n=0,r=this.length):typeof r=="string"&&(a=r,r=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!d.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(o.length===1){var p=o.charCodeAt(0);(a==="utf8"&&p<128||a==="latin1")&&(o=p)}}else typeof o=="number"?o=o&255:typeof o=="boolean"&&(o=Number(o));if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;n=n>>>0,r=r===void 0?this.length:r>>>0,o||(o=0);var m;if(typeof o=="number")for(m=n;m<r;++m)this[m]=o;else{var _=d.isBuffer(o)?o:d.from(o,a),l=_.length;if(l===0)throw new TypeError('The value "'+o+'" is invalid for argument "value"');for(m=0;m<r-n;++m)this[m+n]=_[m%l]}return this};var pp=/[^+/0-9A-Za-z-_]/g;function mp(e){if(e=e.split("=")[0],e=e.trim().replace(pp,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Yn(e,o){o=o||1/0;for(var n,r=e.length,a=null,p=[],m=0;m<r;++m){if(n=e.charCodeAt(m),n>55295&&n<57344){if(!a){if(n>56319){(o-=3)>-1&&p.push(239,191,189);continue}else if(m+1===r){(o-=3)>-1&&p.push(239,191,189);continue}a=n;continue}if(n<56320){(o-=3)>-1&&p.push(239,191,189),a=n;continue}n=(a-55296<<10|n-56320)+65536}else a&&(o-=3)>-1&&p.push(239,191,189);if(a=null,n<128){if((o-=1)<0)break;p.push(n)}else if(n<2048){if((o-=2)<0)break;p.push(n>>6|192,n&63|128)}else if(n<65536){if((o-=3)<0)break;p.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((o-=4)<0)break;p.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return p}function _p(e){for(var o=[],n=0;n<e.length;++n)o.push(e.charCodeAt(n)&255);return o}function lp(e,o){for(var n,r,a,p=[],m=0;m<e.length&&!((o-=2)<0);++m)n=e.charCodeAt(m),r=n>>8,a=n%256,p.push(a),p.push(r);return p}function Fr(e){return Kn.toByteArray(mp(e))}function Yo(e,o,n,r){for(var a=0;a<r&&!(a+n>=o.length||a>=e.length);++a)o[a+n]=e[a];return a}function ce(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function et(e){return e!==e}var dp=function(){for(var e="0123456789abcdef",o=new Array(256),n=0;n<16;++n)for(var r=n*16,a=0;a<16;++a)o[r+a]=e[n]+e[a];return o}()});var Vr=Ko((yl,Gr)=>{t();var M=Gr.exports={},se,pe;function ot(){throw new Error("setTimeout has not been defined")}function nt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?se=setTimeout:se=ot}catch(e){se=ot}try{typeof clearTimeout=="function"?pe=clearTimeout:pe=nt}catch(e){pe=nt}})();function Br(e){if(se===setTimeout)return setTimeout(e,0);if((se===ot||!se)&&setTimeout)return se=setTimeout,setTimeout(e,0);try{return se(e,0)}catch(o){try{return se.call(null,e,0)}catch(n){return se.call(this,e,0)}}}function up(e){if(pe===clearTimeout)return clearTimeout(e);if((pe===nt||!pe)&&clearTimeout)return pe=clearTimeout,clearTimeout(e);try{return pe(e)}catch(o){try{return pe.call(null,e)}catch(n){return pe.call(this,e)}}}var Te=[],eo=!1,Ge,Jo=-1;function gp(){!eo||!Ge||(eo=!1,Ge.length?Te=Ge.concat(Te):Jo=-1,Te.length&&Ur())}function Ur(){if(!eo){var e=Br(gp);eo=!0;for(var o=Te.length;o;){for(Ge=Te,Te=[];++Jo<o;)Ge&&Ge[Jo].run();Jo=-1,o=Te.length}Ge=null,eo=!1,up(e)}}M.nextTick=function(e){var o=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)o[n-1]=arguments[n];Te.push(new Wr(e,o)),Te.length===1&&!eo&&Br(Ur)};function Wr(e,o){this.fun=e,this.array=o}Wr.prototype.run=function(){this.fun.apply(null,this.array)};M.title="browser";M.browser=!0;M.env={};M.argv=[];M.version="";M.versions={};function he(){}M.on=he;M.addListener=he;M.once=he;M.off=he;M.removeListener=he;M.removeAllListeners=he;M.emit=he;M.prependListener=he;M.prependOnceListener=he;M.listeners=function(e){return[]};M.binding=function(e){throw new Error("process.binding is not supported")};M.cwd=function(){return"/"};M.chdir=function(e){throw new Error("process.chdir is not supported")};M.umask=function(){return 0}});var i,c,xl,t=x(()=>{i=g(Or()),c=g(Vr()),xl=function(e){function o(){var r=this||self;return delete e.prototype.__magic__,r}if(typeof globalThis=="object")return globalThis;if(this)return o();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:o});var n=__magic__;return n}(Object)});var oo,Qo=x(()=>{"use strict";t();oo=()=>Date.now()/1e3});var $r,tt=x(()=>{"use strict";t();$r=e=>new Date().setMilliseconds(new Date().getMilliseconds()+e)/1e3});var Hr,zr=x(()=>{"use strict";t();Hr=e=>new Date().setSeconds(new Date().getSeconds()+e)/1e3});var en=x(()=>{"use strict";t();Qo();tt();zr()});var at={};Be(at,{getItem:()=>Tp,localStorageKeys:()=>Ce,removeItem:()=>hp,setItem:()=>fp});var Ce,rt,fp,Tp,hp,no=x(()=>{"use strict";t();en();Ce={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},rt=typeof localStorage!="undefined",fp=({key:e,data:o,expires:n})=>{!rt||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},Tp=e=>{if(!rt)return;let o=localStorage.getItem(String(e));if(!o)return null;let n=JSON.parse(o);return!n||!n.hasOwnProperty("expires")||!n.hasOwnProperty("data")?null:oo()>=n.expires?(localStorage.removeItem(String(e)),null):n.data},hp=e=>{!rt||localStorage.removeItem(String(e))}});var it={};Be(it,{clear:()=>Zr,getItem:()=>Kr,removeItem:()=>Xr,setItem:()=>qr,storage:()=>yp});var qr,Kr,Xr,Zr,yp,Yr=x(()=>{"use strict";t();qr=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},Kr=e=>{let o=sessionStorage.getItem(String(e));if(!o)return null;let n=JSON.parse(o);return!n||!n.hasOwnProperty("expires")||!n.hasOwnProperty("data")?null:Date.now()>=n.expires?(sessionStorage.removeItem(String(e)),null):n.data},Xr=e=>sessionStorage.removeItem(String(e)),Zr=()=>sessionStorage.clear(),yp={setItem:qr,getItem:Kr,removeItem:Xr,clear:Zr}});var X,Ve=x(()=>{"use strict";t();no();Yr();X={session:it,local:at}});var R=x(()=>{"use strict";t()});function Le(e){return e!=null&&(Cp(e)||Ao(e))}function to(e){return e!=null&&(Lp(e)||Pp(e))}function ro(e){return e!=null&&(Np(e)||Rp(e))}function ko(e){return e!=null&&Dp(e)}function Cp(e){return e!=null&&wp.includes(e)}function Lp(e){return e!=null&&Sp.includes(e)}function Np(e){return e!=null&&vp.includes(e)}function Dp(e){return e!=null&&kp.includes(e)}function Ao(e){return e!=null&&Ap.includes(e)}function Pp(e){return e!=null&&Ip.includes(e)}function Rp(e){return e!=null&&Ep.includes(e)}var wp,Sp,vp,kp,Ap,Ip,Ep,xe=x(()=>{"use strict";t();R();wp=["sent"],Sp=["success"],vp=["fail","cancelled","timedOut"],kp=["timedOut"],Ap=["pending"],Ip=["success"],Ep=["fail","invalid"]});function Io(){return new Date().setHours(new Date().getHours()+24)}function Eo(e){X.local.setItem({key:Ce.loginExpiresAt,data:e,expires:e})}var pt=x(()=>{"use strict";t();Ve();no()});var ao=x(()=>{"use strict";t()});var na=x(()=>{"use strict";t()});var mt,W=x(()=>{"use strict";t();mt=(r=>(r.nft="nft",r.esdt="esdt",r.egld="egld",r))(mt||{})});var ta=x(()=>{"use strict";t()});var ra=x(()=>{"use strict";t()});var aa=x(()=>{"use strict";t()});var ia=x(()=>{"use strict";t()});var G=x(()=>{"use strict";t();na();W();R();ta();ra();aa();ia()});var Co,ca,id,sa,cd,pa,ma,sd,Mp,Lo=x(()=>{"use strict";t();G();Co={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:ca,egldLabel:id}=Co["devnet"],{chainId:sa,egldLabel:cd}=Co["testnet"],{chainId:pa,egldLabel:ma}=Co["mainnet"],sd={["devnet"]:ca,["testnet"]:sa,["mainnet"]:pa},Mp={[ca]:"devnet",[sa]:"testnet",[pa]:"mainnet"}});var _t=x(()=>{"use strict";t()});var _a=x(()=>{"use strict";t()});var tn,lt=x(()=>{"use strict";t();tn="transaction-status-toast-id"});var No,rn,B,io,la,dt,an,da,me,E=x(()=>{"use strict";t();ao();Lo();_t();_a();lt();No=5e4,rn=1e9,B=18,io=4,la=1,dt=4294967295,an="logout",da="login",me="0"});var ut,V,be,H=x(()=>{"use strict";t();ut=require("@reduxjs/toolkit");E();V=(0,ut.createAction)(an),be=(0,ut.createAction)(da,e=>({payload:e}))});var ga,ua,fa,Ad,Ta,Fp,Do,ha,Op,ya,xa,gt=x(()=>{"use strict";t();ga=require("@reduxjs/toolkit");pt();R();H();ua={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},fa=(0,ga.createSlice)({name:"loginInfoSlice",initialState:ua,reducers:{setLoginMethod:(e,o)=>{e.loginMethod=o.payload},setTokenLogin:(e,o)=>{e.tokenLogin=o.payload},setTokenLoginSignature:(e,o)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=o.payload)},setWalletLogin:(e,o)=>{e.walletLogin=o.payload},setWalletConnectLogin:(e,o)=>{e.walletConnectLogin=o.payload},setLedgerLogin:(e,o)=>{e.ledgerLogin=o.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0}},extraReducers:e=>{e.addCase(V,()=>ua),e.addCase(be,(o,n)=>{o.loginMethod=n.payload.loginMethod,Eo(Io())})}}),{setLoginMethod:Ad,setWalletConnectLogin:Ta,setLedgerLogin:Fp,setTokenLogin:Do,setTokenLoginSignature:ha,setWalletLogin:Op,invalidateLoginSession:ya}=fa.actions,xa=fa.reducer});var Po=x(()=>{"use strict";t()});var wa=x(()=>{"use strict";t();Po()});function ft(e){return e[Math.floor(Math.random()*e.length)]}var Sa=x(()=>{"use strict";t()});var Tt=x(()=>{"use strict";t();_t()});var co=x(()=>{"use strict";t();wa();Sa();Tt()});var va,ka,ht,Bp,Aa,Gd,Vd,Ia,yt=x(()=>{"use strict";t();va=require("@reduxjs/toolkit"),ka=g(require("lodash.omit"));co();ht={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Bp={network:ht,chainID:"-1"},Aa=(0,va.createSlice)({name:"appConfig",initialState:Bp,reducers:{initializeNetworkConfig:(e,o)=>{let n=ft(o.payload.walletConnectBridgeAddresses),r=ft(o.payload.walletConnectV2RelayAddresses),a=(0,ka.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=S(f(f({},e.network),a),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(e,o)=>{e.chainID=o.payload}}}),{initializeNetworkConfig:Gd,setChainID:Vd}=Aa.actions,Ia=Aa.reducer});var bt,Ea,Ca,cn,xt,La,wt,Zd,St,Yd,Up,Wp,Jd,Qd,eu,Gp,Na,vt=x(()=>{"use strict";t();bt=require("@elrondnetwork/erdjs"),Ea=require("@reduxjs/toolkit"),Ca=require("redux-persist");E();Ve();no();H();cn={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:me},xt={address:"",websocketEvent:null,accounts:{"":cn},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},La=(0,Ea.createSlice)({name:"accountInfoSlice",initialState:xt,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new bt.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:cn},e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,o)=>{let{address:n}=e;e.accounts[n].nonce=o.payload},setAccountShard:(e,o)=>{e.shard=o.payload},setLedgerAccount:(e,o)=>{e.ledgerAccount=o.payload},updateLedgerAccount:(e,o)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=o.payload.index,e.ledgerAccount.address=o.payload.address)},setWalletConnectAccount:(e,o)=>{e.walletConnectAccount=o.payload},setIsAccountLoading:(e,o)=>{e.isAccountLoading=o.payload,e.accountLoadingError=null},setAccountLoadingError:(e,o)=>{e.accountLoadingError=o.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,o)=>{e.websocketEvent={timestamp:Date.now(),message:o.payload}}},extraReducers:e=>{e.addCase(V,()=>(X.local.removeItem(Ce.loginExpiresAt),xt)),e.addCase(be,(o,n)=>{let{address:r}=n.payload;o.address=r,o.publicKey=new bt.Address(r).hex()}),e.addCase(Ca.REHYDRATE,(o,n)=>{var u;if(!((u=n.payload)!=null&&u.account))return;let{account:r}=n.payload,{address:a,shard:p,accounts:m,publicKey:_}=r;o.address=a,o.shard=p;let l=m&&a in m;o.accounts=l?m:xt.accounts,o.publicKey=_})}}),{setAccount:wt,setAddress:Zd,setAccountNonce:St,setAccountShard:Yd,setLedgerAccount:Up,updateLedgerAccount:Wp,setWalletConnectAccount:Jd,setIsAccountLoading:Qd,setAccountLoadingError:eu,setWebsocketEvent:Gp}=La.actions,Na=La.reducer});var Da,Pa,Ro,Vp,Ra,Ma,Fa,$p,sn,Hp,zp,cu,jp,pn,kt,mn,_n=x(()=>{"use strict";t();Da=require("@reduxjs/toolkit"),Pa=require("redux-persist");R();xe();H();Ro={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Vp={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Ra=(0,Da.createSlice)({name:"transactionsSlice",initialState:Ro,reducers:{moveTransactionsToSignedState:(e,o)=>{var l,u;let{sessionId:n,transactions:r,errorMessage:a,status:p,redirectRoute:m}=o.payload,_=((l=e.customTransactionInformationForSessionId)==null?void 0:l[n])||Vp;e.signedTransactions[n]={transactions:r,status:p,errorMessage:a,redirectRoute:m,customTransactionInformation:_},((u=e==null?void 0:e.transactionsToSign)==null?void 0:u.sessionId)===n&&(e.transactionsToSign=Ro.transactionsToSign)},clearSignedTransaction:(e,o)=>{e.signedTransactions[o.payload]&&delete e.signedTransactions[o.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,o)=>{e.signedTransactions=f(f({},e.signedTransactions),o.payload)},updateSignedTransactions:(e,o)=>{let{sessionId:n,status:r,errorMessage:a,transactions:p}=o.payload;e.signedTransactions[n]!=null&&(e.signedTransactions[n].status=r,a!=null&&(e.signedTransactions[n].errorMessage=a),p!=null&&(e.signedTransactions[n].transactions=p))},updateSignedTransactionStatus:(e,o)=>{var _,l,u,h,T,b;let{sessionId:n,status:r,errorMessage:a,transactionHash:p}=o.payload,m=(l=(_=e.signedTransactions)==null?void 0:_[n])==null?void 0:l.transactions;if(m!=null){e.signedTransactions[n].transactions=m.map(P=>P.hash===p?S(f({},P),{status:r,errorMessage:a}):P);let k=(h=(u=e.signedTransactions[n])==null?void 0:u.transactions)==null?void 0:h.every(P=>to(P.status)),D=(b=(T=e.signedTransactions[n])==null?void 0:T.transactions)==null?void 0:b.every(P=>ro(P.status));k&&(e.signedTransactions[n].status="success"),D&&(e.signedTransactions[n].status="fail")}},setTransactionsToSign:(e,o)=>{e.transactionsToSign=o.payload;let{sessionId:n,customTransactionInformation:r}=o.payload;e.customTransactionInformationForSessionId[n]=r,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=Ro.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Ro.signedTransactions},setSignTransactionsError:(e,o)=>{e.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(e,o)=>{e.signTransactionsCancelMessage=o.payload}},extraReducers:e=>{e.addCase(V,()=>Ro),e.addCase(Pa.REHYDRATE,(o,n)=>{var m;if(o.signTransactionsCancelMessage=null,!((m=n.payload)!=null&&m.transactions))return;let{signedTransactions:r,customTransactionInformationForSessionId:a}=n.payload.transactions,p=Object.entries(r).reduce((_,[l,u])=>{let h=new Date(l),T=new Date;return T.setHours(T.getHours()+5),T-h>0||(_[l]=u),_},{});a!=null&&(o.customTransactionInformationForSessionId=a),r!=null&&(o.signedTransactions=p)})}}),{updateSignedTransactionStatus:Ma,updateSignedTransactions:Fa,setTransactionsToSign:$p,clearAllTransactionsToSign:sn,clearAllSignedTransactions:Hp,clearSignedTransaction:zp,clearTransactionToSign:cu,setSignTransactionsError:jp,setSignTransactionsCancelMessage:pn,moveTransactionsToSignedState:kt}=Ra.actions,mn=Ra.reducer});var Oa,It,Et,Ct,qp,At,Ba,_u,Kp,Lt,ln,dn=x(()=>{"use strict";t();Oa=require("@reduxjs/toolkit");H();It="Transaction failed",Et="Transaction successful",Ct="Processing transaction",qp="Transaction submitted",At={},Ba=(0,Oa.createSlice)({name:"transactionsInfo",initialState:At,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:r}=o.payload;n!=null&&(e[n]={errorMessage:(r==null?void 0:r.errorMessage)||It,successMessage:(r==null?void 0:r.successMessage)||Et,processingMessage:(r==null?void 0:r.processingMessage)||Ct,submittedMessage:(r==null?void 0:r.submittedMessage)||qp,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(e,o){o.payload!=null&&delete e[o.payload]},clearTransactionsInfo:()=>At},extraReducers:e=>{e.addCase(V,()=>At)}}),{clearTransactionsInfo:_u,setTransactionsDisplayInfo:Kp,clearTransactionsInfoForSessionId:Lt}=Ba.actions,ln=Ba.reducer});var Wa,Ua,Ga,gu,Xp,fu,Zp,Va,Nt=x(()=>{"use strict";t();Wa=require("@reduxjs/toolkit");H();Ua={},Ga=(0,Wa.createSlice)({name:"modalsSlice",initialState:Ua,reducers:{setTxSubmittedModal:(e,o)=>{e.txSubmittedModal=o.payload},setNotificationModal:(e,o)=>{e.notificationModal=o.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(V,()=>Ua)}}),{setTxSubmittedModal:gu,setNotificationModal:Xp,clearTxSubmittedModal:fu,clearNotificationModal:Zp}=Ga.actions,Va=Ga.reducer});var Ha,za,$a,ja,Yp,Dt,vu,ku,Au,Iu,un,gn=x(()=>{"use strict";t();Ha=require("@reduxjs/toolkit"),za=require("redux-persist");lt();G();Qo();H();$a={customToasts:[],transactionToasts:[],failTransactionToast:null},ja=(0,Ha.createSlice)({name:"toastsSlice",initialState:$a,reducers:{addCustomToast:(e,o)=>{e.customToasts.push(S(f({},o.payload),{type:"custom",toastId:o.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,o)=>{e.customToasts=e.customToasts.filter(n=>n.toastId!==o.payload)},addTransactionToast:(e,o)=>{e.transactionToasts.push({type:"transaction",startTimestamp:oo(),toastId:o.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,o)=>{e.transactionToasts=e.transactionToasts.filter(n=>n.toastId!==o.payload)},addFailTransactionToast:(e,o)=>{e.failTransactionToast=S(f({},o.payload),{toastId:tn})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(V,()=>$a),e.addCase(za.REHYDRATE,(o,n)=>{var a,p;let r=(p=(a=n.customToasts)==null?void 0:a.filter(m=>!("component"in m)))!=null?p:[];o.customToasts=r})}}),{addCustomToast:Yp,removeCustomToast:Dt,addTransactionToast:vu,removeTransactionToast:ku,addFailTransactionToast:Au,removeFailTransactionToast:Iu}=ja.actions,un=ja.reducer});var N=x(()=>{"use strict";t();gt();yt();vt();_n();dn();Nt();gn()});var Gt=x(()=>{"use strict";t()});var pi,si,mi,Zg,Yg,Jg,Qg,ef,of,_i,li=x(()=>{"use strict";t();pi=require("@reduxjs/toolkit");H();si={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},mi=(0,pi.createSlice)({name:"dappModalsSlice",initialState:si,reducers:{setDappModalVisibility:(e,o)=>{e.visible=o.payload},setDappModalHeaderVisibility:(e,o)=>{e.modal.showHeader=o.payload},setDappModalFooterVisibility:(e,o)=>{e.modal.showFooter=o.payload},setDappModalHeaderText:(e,o)=>{e.modal.headerText=o.payload},setDappModalFooterText:(e,o)=>{e.modal.footerText=o.payload},setDappModalConfig:(e,o)=>{e.modal=f({},o.payload)}},extraReducers:e=>{e.addCase(V,()=>si)}}),{setDappModalVisibility:Zg,setDappModalHeaderVisibility:Yg,setDappModalFooterVisibility:Jg,setDappModalHeaderText:Qg,setDappModalFooterText:ef,setDappModalConfig:of}=mi.actions,_i=mi.reducer});var di,hm,ym,lo,wn=x(()=>{"use strict";t();di=require("@reduxjs/toolkit");Gt();vt();li();gt();Nt();yt();gn();dn();_n();hm={["account"]:Na,["networkConfig"]:Ia,["loginInfo"]:xa,["modals"]:Va,["dappModal"]:_i,["toasts"]:un,["transactions"]:mn,["transactionsInfo"]:ln},ym=(e={})=>(0,di.combineReducers)(f(f({},hm),e)),lo=ym});var fi={};Be(fi,{default:()=>Am});function Vt(e,o=[]){return{key:e,version:1,storage:gi.default,blacklist:o}}var ze,ui,gi,xm,bm,wm,Sm,vm,km,Am,Ti=x(()=>{"use strict";t();ze=require("redux-persist"),ui=g(require("redux-persist/lib/storage")),gi=g(require("redux-persist/lib/storage/session"));wn();N();gn();dn();_n();Gt();xm={2:e=>S(f({},e),{networkConfig:ht})};bm=Vt("dapp-core-transactionsInfo"),wm=Vt("dapp-core-transactions",["transactionsToSign"]),Sm=Vt("dapp-core-toasts"),vm={key:"dapp-core-store",version:2,storage:ui.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,ze.createMigrate)(xm,{debug:!1})},km={["toasts"]:(0,ze.persistReducer)(Sm,un),["transactions"]:(0,ze.persistReducer)(wm,mn),["transactionsInfo"]:(0,ze.persistReducer)(bm,ln)},Am=(0,ze.persistReducer)(vm,lo(km))});var hi={};Be(hi,{default:()=>Im});var Im,yi=x(()=>{"use strict";t();wn();Im=lo()});var xi={};Be(xi,{default:()=>Cm});var Y,Em,Cm,bi=x(()=>{"use strict";t();Y=require("redux-persist"),Em=[Y.FLUSH,Y.REHYDRATE,Y.PAUSE,Y.PERSIST,Y.PURGE,Y.REGISTER],Cm=Em});var vi={};Be(vi,{default:()=>Si});function Si(e){return(0,wi.persistStore)(e)}var wi,ki=x(()=>{"use strict";t();wi=require("redux-persist")});var ul={};Be(ul,{CustomToast:()=>ll,TransactionToast:()=>lr,TransactionToastGuard:()=>dl});module.exports=So(ul);t();t();t();var Bn=g(require("react"));t();var z=g(require("react")),Jr=g(require("classnames"));en();t();var jr=e=>{let r=Math.log(.005),p=(Math.log(2)-r)/(10-0);return Math.exp(r+p*(e-0))};Ve();t();var xp=`.dapp-core-component__progressStyles__progress { position: relative; } .dapp-core-component__progressStyles__progress .dapp-core-component__progressStyles__bar { position: absolute; pointer-events: none; left: -0.5rem; right: -0.5rem; bottom: -0.5rem; top: -0.5rem; background-color: #495057; opacity: 0.25; transition: width 0.6s ease; max-width: calc(100% + 1rem); }`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(xp));var ct={progress:"dapp-core-component__progressStyles__progress",bar:"dapp-core-component__progressStyles__bar"};var on="toastProgress",Qr=({id:e,children:o,progress:n,done:r,expiresIn:a=10*60,className:p="dapp-progress"})=>{let m=(0,z.useMemo)(()=>{let I=n?n.endTime-n.startTime:0,L=X.session.getItem(on),Ee=Math.floor(Date.now()/1e3),ae=n?(n.endTime-Ee)*100/I:0;return{currentRemaining:L&&e in L?L[e]:ae,totalSeconds:I}},[]),{totalSeconds:_,currentRemaining:l}=m,u=(0,z.useRef)(null),h=(0,z.useRef)(),T=(0,z.useRef)(l);(0,z.useEffect)(()=>{if(n!=null)return r?P():ue(),()=>{clearInterval(h.current)}},[n,r]);function b(){let I=X.session.getItem(on);!Boolean(I==null?void 0:I[e])||(delete I[e],D(I))}function k(I){let L=X.session.getItem(on)||{};L[e]=I,D(L)}function D(I){X.session.setItem({key:on,data:I,expires:Hr(a)})}function P(){h.current=setInterval(()=>{if(u.current==null)return;let L=T.current-1;L<=0?(clearInterval(h.current),b(),ge(0)):(k(L),ge(L))},5)}function ue(){let L=_/90,Ee=parseFloat(L.toFixed(2))*1e3;h.current=setInterval(()=>{if(u.current==null)return;let ae=T.current,zo=ae>100-90?1:jr(ae),jo=ae-zo;k(jo),ge(jo)},Ee)}function ge(I){T.current=I,q()}function q(){if(u.current==null)return;let I=T.current;u.current.style.width=`${I}%`,u.current.ariaValueNow=I}return n?z.default.createElement("div",{className:(0,Jr.default)(ct.progress,p)},z.default.createElement("div",{ref:u,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,className:ct.bar}),o):z.default.createElement(z.default.Fragment,null,o)};t();t();var st=g(require("react")),ea=require("@fortawesome/free-solid-svg-icons"),oa=require("@fortawesome/react-fontawesome"),nn=({className:e="dapp-default-toast-delete-button",onClick:o})=>st.default.createElement("button",{type:"button",className:e,onClick:o},st.default.createElement(oa.FontAwesomeIcon,{icon:ea.faTimes,size:"xs"}));t();var te=g(require("react")),Rc=require("@fortawesome/react-fontawesome"),tr=g(require("classnames"));t();var bp=`.dapp-core-component__main__link-style { color: #1392ff; } .dapp-core-component__main__link-second-style { color: #9dabbd; } .dapp-core-component__main__link-second-style:hover { color: #1392ff; } .dapp-core-component__main__link-second-style:hover svg { color: #1392ff; } .dapp-core-component__main__wrapper { min-height: 100vh; } .dapp-core-component__main__opacity-6 { opacity: 0.6; } .dapp-core-component__main__qr-code-svg-container { width: 15rem; height: 15rem; } .dapp-core-component__main__pair-list { max-height: 20rem; overflow-y: auto; margin-bottom: -0.5rem; } .dapp-core-component__main__pair-image { width: 4rem; overflow: hidden; height: auto; min-width: 2rem; } .dapp-core-component__main__pair-remove { padding: 0 0.5rem; position: absolute; right: 0; top: 0; } .dapp-core-component__main__dapp-icon { padding: 5px; border-radius: 50%; background-color: #fafafa; width: 4.6428571429rem; height: 4.6428571429rem; display: flex; align-items: center; justify-content: center; margin: 0 auto; } .dapp-core-component__main__dapp-icon.dapp-core-component__main__icon-medium { width: 80px; height: 80px; } .dapp-core-component__main__centering { display: flex; justify-content: center; align-items: center; } .dapp-core-component__main__border-n { border: none !important; } .dapp-core-component__main__t-shadow { text-shadow: 0px 4px 7px rgba(0, 0, 0, 0.3); } .dapp-core-component__main__btn { box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.04) !important; } .dapp-core-component__main__media { display: flex; align-items: flex-start; } .dapp-core-component__main__media-body { flex: 1; } .dapp-core-component__main__connect-btns .dapp-core-component__main__btn { display: flex; height: 48px; justify-content: center; align-items: center; color: #fff !important; background-color: #1392ff; padding: 15px 20px 15px 16px; border-radius: 6px; gap: 8px; } .dapp-core-component__main__connect