UNPKG

@sofaws/dapp-core

Version:

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

1 lines 266 kB
"use strict";var AT=Object.create;var Fo=Object.defineProperty,kT=Object.defineProperties,IT=Object.getOwnPropertyDescriptor,ET=Object.getOwnPropertyDescriptors,LT=Object.getOwnPropertyNames,Xr=Object.getOwnPropertySymbols,NT=Object.getPrototypeOf,op=Object.prototype.hasOwnProperty,qm=Object.prototype.propertyIsEnumerable;var Vm=(t,r,a)=>r in t?Fo(t,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[r]=a,V=(t,r)=>{for(var a in r||(r={}))op.call(r,a)&&Vm(t,a,r[a]);if(Xr)for(var a of Xr(r))qm.call(r,a)&&Vm(t,a,r[a]);return t},pe=(t,r)=>kT(t,ET(r));var ot=(t,r)=>{var a={};for(var p in t)op.call(t,p)&&r.indexOf(p)<0&&(a[p]=t[p]);if(t!=null&&Xr)for(var p of Xr(t))r.indexOf(p)<0&&qm.call(t,p)&&(a[p]=t[p]);return a};var H=(t,r)=>()=>(t&&(r=t(t=0)),r);var Oo=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),wt=(t,r)=>{for(var a in r)Fo(t,a,{get:r[a],enumerable:!0})},Km=(t,r,a,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let _ of LT(r))!op.call(t,_)&&_!==a&&Fo(t,_,{get:()=>r[_],enumerable:!(p=IT(r,_))||p.enumerable});return t};var P=(t,r,a)=>(a=t!=null?AT(NT(t)):{},Km(r||!t||!t.__esModule?Fo(a,"default",{value:t,enumerable:!0}):a,t)),Mo=t=>Km(Fo({},"__esModule",{value:!0}),t);var Xm=(t,r,a)=>new Promise((p,_)=>{var u=I=>{try{E(a.next(I))}catch(C){_(C)}},f=I=>{try{E(a.throw(I))}catch(C){_(C)}},E=I=>I.done?p(I.value):Promise.resolve(I.value).then(u,f);E((a=a.apply(t,r)).next())});var Jm=Oo(Zr=>{"use strict";s();Zr.byteLength=DT;Zr.toByteArray=PT;Zr.fromByteArray=MT;var wn=[],tn=[],CT=typeof Uint8Array!="undefined"?Uint8Array:Array,rp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(vt=0,Zm=rp.length;vt<Zm;++vt)wn[vt]=rp[vt],tn[rp.charCodeAt(vt)]=vt;var vt,Zm;tn["-".charCodeAt(0)]=62;tn["_".charCodeAt(0)]=63;function Ym(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=t.indexOf("=");a===-1&&(a=r);var p=a===r?0:4-a%4;return[a,p]}function DT(t){var r=Ym(t),a=r[0],p=r[1];return(a+p)*3/4-p}function RT(t,r,a){return(r+a)*3/4-a}function PT(t){var r,a=Ym(t),p=a[0],_=a[1],u=new CT(RT(t,p,_)),f=0,E=_>0?p-4:p,I;for(I=0;I<E;I+=4)r=tn[t.charCodeAt(I)]<<18|tn[t.charCodeAt(I+1)]<<12|tn[t.charCodeAt(I+2)]<<6|tn[t.charCodeAt(I+3)],u[f++]=r>>16&255,u[f++]=r>>8&255,u[f++]=r&255;return _===2&&(r=tn[t.charCodeAt(I)]<<2|tn[t.charCodeAt(I+1)]>>4,u[f++]=r&255),_===1&&(r=tn[t.charCodeAt(I)]<<10|tn[t.charCodeAt(I+1)]<<4|tn[t.charCodeAt(I+2)]>>2,u[f++]=r>>8&255,u[f++]=r&255),u}function FT(t){return wn[t>>18&63]+wn[t>>12&63]+wn[t>>6&63]+wn[t&63]}function OT(t,r,a){for(var p,_=[],u=r;u<a;u+=3)p=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(t[u+2]&255),_.push(FT(p));return _.join("")}function MT(t){for(var r,a=t.length,p=a%3,_=[],u=16383,f=0,E=a-p;f<E;f+=u)_.push(OT(t,f,f+u>E?E:f+u));return p===1?(r=t[a-1],_.push(wn[r>>2]+wn[r<<4&63]+"==")):p===2&&(r=(t[a-2]<<8)+t[a-1],_.push(wn[r>>10]+wn[r>>4&63]+wn[r<<2&63]+"=")),_.join("")}});var Qm=Oo(ap=>{s();ap.read=function(t,r,a,p,_){var u,f,E=_*8-p-1,I=(1<<E)-1,C=I>>1,M=-7,F=a?_-1:0,G=a?-1:1,ee=t[r+F];for(F+=G,u=ee&(1<<-M)-1,ee>>=-M,M+=E;M>0;u=u*256+t[r+F],F+=G,M-=8);for(f=u&(1<<-M)-1,u>>=-M,M+=p;M>0;f=f*256+t[r+F],F+=G,M-=8);if(u===0)u=1-C;else{if(u===I)return f?NaN:(ee?-1:1)*(1/0);f=f+Math.pow(2,p),u=u-C}return(ee?-1:1)*f*Math.pow(2,u-p)};ap.write=function(t,r,a,p,_,u){var f,E,I,C=u*8-_-1,M=(1<<C)-1,F=M>>1,G=_===23?Math.pow(2,-24)-Math.pow(2,-77):0,ee=p?0:u-1,ne=p?1:-1,_e=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(E=isNaN(r)?1:0,f=M):(f=Math.floor(Math.log(r)/Math.LN2),r*(I=Math.pow(2,-f))<1&&(f--,I*=2),f+F>=1?r+=G/I:r+=G*Math.pow(2,1-F),r*I>=2&&(f++,I/=2),f+F>=M?(E=0,f=M):f+F>=1?(E=(r*I-1)*Math.pow(2,_),f=f+F):(E=r*Math.pow(2,F-1)*Math.pow(2,_),f=0));_>=8;t[a+ee]=E&255,ee+=ne,E/=256,_-=8);for(f=f<<_|E,C+=_;C>0;t[a+ee]=f&255,ee+=ne,f/=256,C-=8);t[a+ee-ne]|=_e*128}});var __=Oo(Qt=>{"use strict";s();var ip=Jm(),Jt=Qm(),jm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Qt.Buffer=S;Qt.SlowBuffer=GT;Qt.INSPECT_MAX_BYTES=50;var Yr=2147483647;Qt.kMaxLength=Yr;S.TYPED_ARRAY_SUPPORT=BT();!S.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function BT(){try{var t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),t.foo()===42}catch(a){return!1}}Object.defineProperty(S.prototype,"parent",{enumerable:!0,get:function(){if(!!S.isBuffer(this))return this.buffer}});Object.defineProperty(S.prototype,"offset",{enumerable:!0,get:function(){if(!!S.isBuffer(this))return this.byteOffset}});function Mn(t){if(t>Yr)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,S.prototype),r}function S(t,r,a){if(typeof t=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return mp(t)}return t_(t,r,a)}S.poolSize=8192;function t_(t,r,a){if(typeof t=="string")return WT(t,r);if(ArrayBuffer.isView(t))return $T(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(vn(t,ArrayBuffer)||t&&vn(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(vn(t,SharedArrayBuffer)||t&&vn(t.buffer,SharedArrayBuffer)))return cp(t,r,a);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var p=t.valueOf&&t.valueOf();if(p!=null&&p!==t)return S.from(p,r,a);var _=HT(t);if(_)return _;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return S.from(t[Symbol.toPrimitive]("string"),r,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}S.from=function(t,r,a){return t_(t,r,a)};Object.setPrototypeOf(S.prototype,Uint8Array.prototype);Object.setPrototypeOf(S,Uint8Array);function o_(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function UT(t,r,a){return o_(t),t<=0?Mn(t):r!==void 0?typeof a=="string"?Mn(t).fill(r,a):Mn(t).fill(r):Mn(t)}S.alloc=function(t,r,a){return UT(t,r,a)};function mp(t){return o_(t),Mn(t<0?0:_p(t)|0)}S.allocUnsafe=function(t){return mp(t)};S.allocUnsafeSlow=function(t){return mp(t)};function WT(t,r){if((typeof r!="string"||r==="")&&(r="utf8"),!S.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var a=r_(t,r)|0,p=Mn(a),_=p.write(t,r);return _!==a&&(p=p.slice(0,_)),p}function pp(t){for(var r=t.length<0?0:_p(t.length)|0,a=Mn(r),p=0;p<r;p+=1)a[p]=t[p]&255;return a}function $T(t){if(vn(t,Uint8Array)){var r=new Uint8Array(t);return cp(r.buffer,r.byteOffset,r.byteLength)}return pp(t)}function cp(t,r,a){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(a||0))throw new RangeError('"length" is outside of buffer bounds');var p;return r===void 0&&a===void 0?p=new Uint8Array(t):a===void 0?p=new Uint8Array(t,r):p=new Uint8Array(t,r,a),Object.setPrototypeOf(p,S.prototype),p}function HT(t){if(S.isBuffer(t)){var r=_p(t.length)|0,a=Mn(r);return a.length===0||t.copy(a,0,0,r),a}if(t.length!==void 0)return typeof t.length!="number"||lp(t.length)?Mn(0):pp(t);if(t.type==="Buffer"&&Array.isArray(t.data))return pp(t.data)}function _p(t){if(t>=Yr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Yr.toString(16)+" bytes");return t|0}function GT(t){return+t!=t&&(t=0),S.alloc(+t)}S.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==S.prototype};S.compare=function(r,a){if(vn(r,Uint8Array)&&(r=S.from(r,r.offset,r.byteLength)),vn(a,Uint8Array)&&(a=S.from(a,a.offset,a.byteLength)),!S.isBuffer(r)||!S.isBuffer(a))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===a)return 0;for(var p=r.length,_=a.length,u=0,f=Math.min(p,_);u<f;++u)if(r[u]!==a[u]){p=r[u],_=a[u];break}return p<_?-1:_<p?1:0};S.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};S.concat=function(r,a){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return S.alloc(0);var p;if(a===void 0)for(a=0,p=0;p<r.length;++p)a+=r[p].length;var _=S.allocUnsafe(a),u=0;for(p=0;p<r.length;++p){var f=r[p];if(vn(f,Uint8Array))u+f.length>_.length?S.from(f).copy(_,u):Uint8Array.prototype.set.call(_,f,u);else if(S.isBuffer(f))f.copy(_,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=f.length}return _};function r_(t,r){if(S.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||vn(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var a=t.length,p=arguments.length>2&&arguments[2]===!0;if(!p&&a===0)return 0;for(var _=!1;;)switch(r){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return sp(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a*2;case"hex":return a>>>1;case"base64":return m_(t).length;default:if(_)return p?-1:sp(t).length;r=(""+r).toLowerCase(),_=!0}}S.byteLength=r_;function zT(t,r,a){var p=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((a===void 0||a>this.length)&&(a=this.length),a<=0)||(a>>>=0,r>>>=0,a<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return ew(this,r,a);case"utf8":case"utf-8":return i_(this,r,a);case"ascii":return QT(this,r,a);case"latin1":case"binary":return jT(this,r,a);case"base64":return YT(this,r,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nw(this,r,a);default:if(p)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),p=!0}}S.prototype._isBuffer=!0;function St(t,r,a){var p=t[r];t[r]=t[a],t[a]=p}S.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var a=0;a<r;a+=2)St(this,a,a+1);return this};S.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var a=0;a<r;a+=4)St(this,a,a+3),St(this,a+1,a+2);return this};S.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var a=0;a<r;a+=8)St(this,a,a+7),St(this,a+1,a+6),St(this,a+2,a+5),St(this,a+3,a+4);return this};S.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?i_(this,0,r):zT.apply(this,arguments)};S.prototype.toLocaleString=S.prototype.toString;S.prototype.equals=function(r){if(!S.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:S.compare(this,r)===0};S.prototype.inspect=function(){var r="",a=Qt.INSPECT_MAX_BYTES;return r=this.toString("hex",0,a).replace(/(.{2})/g,"$1 ").trim(),this.length>a&&(r+=" ... "),"<Buffer "+r+">"};jm&&(S.prototype[jm]=S.prototype.inspect);S.prototype.compare=function(r,a,p,_,u){if(vn(r,Uint8Array)&&(r=S.from(r,r.offset,r.byteLength)),!S.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(a===void 0&&(a=0),p===void 0&&(p=r?r.length:0),_===void 0&&(_=0),u===void 0&&(u=this.length),a<0||p>r.length||_<0||u>this.length)throw new RangeError("out of range index");if(_>=u&&a>=p)return 0;if(_>=u)return-1;if(a>=p)return 1;if(a>>>=0,p>>>=0,_>>>=0,u>>>=0,this===r)return 0;for(var f=u-_,E=p-a,I=Math.min(f,E),C=this.slice(_,u),M=r.slice(a,p),F=0;F<I;++F)if(C[F]!==M[F]){f=C[F],E=M[F];break}return f<E?-1:E<f?1:0};function a_(t,r,a,p,_){if(t.length===0)return-1;if(typeof a=="string"?(p=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,lp(a)&&(a=_?0:t.length-1),a<0&&(a=t.length+a),a>=t.length){if(_)return-1;a=t.length-1}else if(a<0)if(_)a=0;else return-1;if(typeof r=="string"&&(r=S.from(r,p)),S.isBuffer(r))return r.length===0?-1:e_(t,r,a,p,_);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?_?Uint8Array.prototype.indexOf.call(t,r,a):Uint8Array.prototype.lastIndexOf.call(t,r,a):e_(t,[r],a,p,_);throw new TypeError("val must be string, number or Buffer")}function e_(t,r,a,p,_){var u=1,f=t.length,E=r.length;if(p!==void 0&&(p=String(p).toLowerCase(),p==="ucs2"||p==="ucs-2"||p==="utf16le"||p==="utf-16le")){if(t.length<2||r.length<2)return-1;u=2,f/=2,E/=2,a/=2}function I(ee,ne){return u===1?ee[ne]:ee.readUInt16BE(ne*u)}var C;if(_){var M=-1;for(C=a;C<f;C++)if(I(t,C)===I(r,M===-1?0:C-M)){if(M===-1&&(M=C),C-M+1===E)return M*u}else M!==-1&&(C-=C-M),M=-1}else for(a+E>f&&(a=f-E),C=a;C>=0;C--){for(var F=!0,G=0;G<E;G++)if(I(t,C+G)!==I(r,G)){F=!1;break}if(F)return C}return-1}S.prototype.includes=function(r,a,p){return this.indexOf(r,a,p)!==-1};S.prototype.indexOf=function(r,a,p){return a_(this,r,a,p,!0)};S.prototype.lastIndexOf=function(r,a,p){return a_(this,r,a,p,!1)};function VT(t,r,a,p){a=Number(a)||0;var _=t.length-a;p?(p=Number(p),p>_&&(p=_)):p=_;var u=r.length;p>u/2&&(p=u/2);for(var f=0;f<p;++f){var E=parseInt(r.substr(f*2,2),16);if(lp(E))return f;t[a+f]=E}return f}function qT(t,r,a,p){return Jr(sp(r,t.length-a),t,a,p)}function KT(t,r,a,p){return Jr(rw(r),t,a,p)}function XT(t,r,a,p){return Jr(m_(r),t,a,p)}function ZT(t,r,a,p){return Jr(aw(r,t.length-a),t,a,p)}S.prototype.write=function(r,a,p,_){if(a===void 0)_="utf8",p=this.length,a=0;else if(p===void 0&&typeof a=="string")_=a,p=this.length,a=0;else if(isFinite(a))a=a>>>0,isFinite(p)?(p=p>>>0,_===void 0&&(_="utf8")):(_=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var u=this.length-a;if((p===void 0||p>u)&&(p=u),r.length>0&&(p<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");_||(_="utf8");for(var f=!1;;)switch(_){case"hex":return VT(this,r,a,p);case"utf8":case"utf-8":return qT(this,r,a,p);case"ascii":case"latin1":case"binary":return KT(this,r,a,p);case"base64":return XT(this,r,a,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ZT(this,r,a,p);default:if(f)throw new TypeError("Unknown encoding: "+_);_=(""+_).toLowerCase(),f=!0}};S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function YT(t,r,a){return r===0&&a===t.length?ip.fromByteArray(t):ip.fromByteArray(t.slice(r,a))}function i_(t,r,a){a=Math.min(t.length,a);for(var p=[],_=r;_<a;){var u=t[_],f=null,E=u>239?4:u>223?3:u>191?2:1;if(_+E<=a){var I,C,M,F;switch(E){case 1:u<128&&(f=u);break;case 2:I=t[_+1],(I&192)===128&&(F=(u&31)<<6|I&63,F>127&&(f=F));break;case 3:I=t[_+1],C=t[_+2],(I&192)===128&&(C&192)===128&&(F=(u&15)<<12|(I&63)<<6|C&63,F>2047&&(F<55296||F>57343)&&(f=F));break;case 4:I=t[_+1],C=t[_+2],M=t[_+3],(I&192)===128&&(C&192)===128&&(M&192)===128&&(F=(u&15)<<18|(I&63)<<12|(C&63)<<6|M&63,F>65535&&F<1114112&&(f=F))}}f===null?(f=65533,E=1):f>65535&&(f-=65536,p.push(f>>>10&1023|55296),f=56320|f&1023),p.push(f),_+=E}return JT(p)}var n_=4096;function JT(t){var r=t.length;if(r<=n_)return String.fromCharCode.apply(String,t);for(var a="",p=0;p<r;)a+=String.fromCharCode.apply(String,t.slice(p,p+=n_));return a}function QT(t,r,a){var p="";a=Math.min(t.length,a);for(var _=r;_<a;++_)p+=String.fromCharCode(t[_]&127);return p}function jT(t,r,a){var p="";a=Math.min(t.length,a);for(var _=r;_<a;++_)p+=String.fromCharCode(t[_]);return p}function ew(t,r,a){var p=t.length;(!r||r<0)&&(r=0),(!a||a<0||a>p)&&(a=p);for(var _="",u=r;u<a;++u)_+=iw[t[u]];return _}function nw(t,r,a){for(var p=t.slice(r,a),_="",u=0;u<p.length-1;u+=2)_+=String.fromCharCode(p[u]+p[u+1]*256);return _}S.prototype.slice=function(r,a){var p=this.length;r=~~r,a=a===void 0?p:~~a,r<0?(r+=p,r<0&&(r=0)):r>p&&(r=p),a<0?(a+=p,a<0&&(a=0)):a>p&&(a=p),a<r&&(a=r);var _=this.subarray(r,a);return Object.setPrototypeOf(_,S.prototype),_};function ve(t,r,a){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>a)throw new RangeError("Trying to access beyond buffer length")}S.prototype.readUintLE=S.prototype.readUIntLE=function(r,a,p){r=r>>>0,a=a>>>0,p||ve(r,a,this.length);for(var _=this[r],u=1,f=0;++f<a&&(u*=256);)_+=this[r+f]*u;return _};S.prototype.readUintBE=S.prototype.readUIntBE=function(r,a,p){r=r>>>0,a=a>>>0,p||ve(r,a,this.length);for(var _=this[r+--a],u=1;a>0&&(u*=256);)_+=this[r+--a]*u;return _};S.prototype.readUint8=S.prototype.readUInt8=function(r,a){return r=r>>>0,a||ve(r,1,this.length),this[r]};S.prototype.readUint16LE=S.prototype.readUInt16LE=function(r,a){return r=r>>>0,a||ve(r,2,this.length),this[r]|this[r+1]<<8};S.prototype.readUint16BE=S.prototype.readUInt16BE=function(r,a){return r=r>>>0,a||ve(r,2,this.length),this[r]<<8|this[r+1]};S.prototype.readUint32LE=S.prototype.readUInt32LE=function(r,a){return r=r>>>0,a||ve(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};S.prototype.readUint32BE=S.prototype.readUInt32BE=function(r,a){return r=r>>>0,a||ve(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};S.prototype.readIntLE=function(r,a,p){r=r>>>0,a=a>>>0,p||ve(r,a,this.length);for(var _=this[r],u=1,f=0;++f<a&&(u*=256);)_+=this[r+f]*u;return u*=128,_>=u&&(_-=Math.pow(2,8*a)),_};S.prototype.readIntBE=function(r,a,p){r=r>>>0,a=a>>>0,p||ve(r,a,this.length);for(var _=a,u=1,f=this[r+--_];_>0&&(u*=256);)f+=this[r+--_]*u;return u*=128,f>=u&&(f-=Math.pow(2,8*a)),f};S.prototype.readInt8=function(r,a){return r=r>>>0,a||ve(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};S.prototype.readInt16LE=function(r,a){r=r>>>0,a||ve(r,2,this.length);var p=this[r]|this[r+1]<<8;return p&32768?p|4294901760:p};S.prototype.readInt16BE=function(r,a){r=r>>>0,a||ve(r,2,this.length);var p=this[r+1]|this[r]<<8;return p&32768?p|4294901760:p};S.prototype.readInt32LE=function(r,a){return r=r>>>0,a||ve(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};S.prototype.readInt32BE=function(r,a){return r=r>>>0,a||ve(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};S.prototype.readFloatLE=function(r,a){return r=r>>>0,a||ve(r,4,this.length),Jt.read(this,r,!0,23,4)};S.prototype.readFloatBE=function(r,a){return r=r>>>0,a||ve(r,4,this.length),Jt.read(this,r,!1,23,4)};S.prototype.readDoubleLE=function(r,a){return r=r>>>0,a||ve(r,8,this.length),Jt.read(this,r,!0,52,8)};S.prototype.readDoubleBE=function(r,a){return r=r>>>0,a||ve(r,8,this.length),Jt.read(this,r,!1,52,8)};function Ue(t,r,a,p,_,u){if(!S.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>_||r<u)throw new RangeError('"value" argument is out of bounds');if(a+p>t.length)throw new RangeError("Index out of range")}S.prototype.writeUintLE=S.prototype.writeUIntLE=function(r,a,p,_){if(r=+r,a=a>>>0,p=p>>>0,!_){var u=Math.pow(2,8*p)-1;Ue(this,r,a,p,u,0)}var f=1,E=0;for(this[a]=r&255;++E<p&&(f*=256);)this[a+E]=r/f&255;return a+p};S.prototype.writeUintBE=S.prototype.writeUIntBE=function(r,a,p,_){if(r=+r,a=a>>>0,p=p>>>0,!_){var u=Math.pow(2,8*p)-1;Ue(this,r,a,p,u,0)}var f=p-1,E=1;for(this[a+f]=r&255;--f>=0&&(E*=256);)this[a+f]=r/E&255;return a+p};S.prototype.writeUint8=S.prototype.writeUInt8=function(r,a,p){return r=+r,a=a>>>0,p||Ue(this,r,a,1,255,0),this[a]=r&255,a+1};S.prototype.writeUint16LE=S.prototype.writeUInt16LE=function(r,a,p){return r=+r,a=a>>>0,p||Ue(this,r,a,2,65535,0),this[a]=r&255,this[a+1]=r>>>8,a+2};S.prototype.writeUint16BE=S.prototype.writeUInt16BE=function(r,a,p){return r=+r,a=a>>>0,p||Ue(this,r,a,2,65535,0),this[a]=r>>>8,this[a+1]=r&255,a+2};S.prototype.writeUint32LE=S.prototype.writeUInt32LE=function(r,a,p){return r=+r,a=a>>>0,p||Ue(this,r,a,4,4294967295,0),this[a+3]=r>>>24,this[a+2]=r>>>16,this[a+1]=r>>>8,this[a]=r&255,a+4};S.prototype.writeUint32BE=S.prototype.writeUInt32BE=function(r,a,p){return r=+r,a=a>>>0,p||Ue(this,r,a,4,4294967295,0),this[a]=r>>>24,this[a+1]=r>>>16,this[a+2]=r>>>8,this[a+3]=r&255,a+4};S.prototype.writeIntLE=function(r,a,p,_){if(r=+r,a=a>>>0,!_){var u=Math.pow(2,8*p-1);Ue(this,r,a,p,u-1,-u)}var f=0,E=1,I=0;for(this[a]=r&255;++f<p&&(E*=256);)r<0&&I===0&&this[a+f-1]!==0&&(I=1),this[a+f]=(r/E>>0)-I&255;return a+p};S.prototype.writeIntBE=function(r,a,p,_){if(r=+r,a=a>>>0,!_){var u=Math.pow(2,8*p-1);Ue(this,r,a,p,u-1,-u)}var f=p-1,E=1,I=0;for(this[a+f]=r&255;--f>=0&&(E*=256);)r<0&&I===0&&this[a+f+1]!==0&&(I=1),this[a+f]=(r/E>>0)-I&255;return a+p};S.prototype.writeInt8=function(r,a,p){return r=+r,a=a>>>0,p||Ue(this,r,a,1,127,-128),r<0&&(r=255+r+1),this[a]=r&255,a+1};S.prototype.writeInt16LE=function(r,a,p){return r=+r,a=a>>>0,p||Ue(this,r,a,2,32767,-32768),this[a]=r&255,this[a+1]=r>>>8,a+2};S.prototype.writeInt16BE=function(r,a,p){return r=+r,a=a>>>0,p||Ue(this,r,a,2,32767,-32768),this[a]=r>>>8,this[a+1]=r&255,a+2};S.prototype.writeInt32LE=function(r,a,p){return r=+r,a=a>>>0,p||Ue(this,r,a,4,2147483647,-2147483648),this[a]=r&255,this[a+1]=r>>>8,this[a+2]=r>>>16,this[a+3]=r>>>24,a+4};S.prototype.writeInt32BE=function(r,a,p){return r=+r,a=a>>>0,p||Ue(this,r,a,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[a]=r>>>24,this[a+1]=r>>>16,this[a+2]=r>>>8,this[a+3]=r&255,a+4};function p_(t,r,a,p,_,u){if(a+p>t.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function c_(t,r,a,p,_){return r=+r,a=a>>>0,_||p_(t,r,a,4,34028234663852886e22,-34028234663852886e22),Jt.write(t,r,a,p,23,4),a+4}S.prototype.writeFloatLE=function(r,a,p){return c_(this,r,a,!0,p)};S.prototype.writeFloatBE=function(r,a,p){return c_(this,r,a,!1,p)};function s_(t,r,a,p,_){return r=+r,a=a>>>0,_||p_(t,r,a,8,17976931348623157e292,-17976931348623157e292),Jt.write(t,r,a,p,52,8),a+8}S.prototype.writeDoubleLE=function(r,a,p){return s_(this,r,a,!0,p)};S.prototype.writeDoubleBE=function(r,a,p){return s_(this,r,a,!1,p)};S.prototype.copy=function(r,a,p,_){if(!S.isBuffer(r))throw new TypeError("argument should be a Buffer");if(p||(p=0),!_&&_!==0&&(_=this.length),a>=r.length&&(a=r.length),a||(a=0),_>0&&_<p&&(_=p),_===p||r.length===0||this.length===0)return 0;if(a<0)throw new RangeError("targetStart out of bounds");if(p<0||p>=this.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("sourceEnd out of bounds");_>this.length&&(_=this.length),r.length-a<_-p&&(_=r.length-a+p);var u=_-p;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(a,p,_):Uint8Array.prototype.set.call(r,this.subarray(p,_),a),u};S.prototype.fill=function(r,a,p,_){if(typeof r=="string"){if(typeof a=="string"?(_=a,a=0,p=this.length):typeof p=="string"&&(_=p,p=this.length),_!==void 0&&typeof _!="string")throw new TypeError("encoding must be a string");if(typeof _=="string"&&!S.isEncoding(_))throw new TypeError("Unknown encoding: "+_);if(r.length===1){var u=r.charCodeAt(0);(_==="utf8"&&u<128||_==="latin1")&&(r=u)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(a<0||this.length<a||this.length<p)throw new RangeError("Out of range index");if(p<=a)return this;a=a>>>0,p=p===void 0?this.length:p>>>0,r||(r=0);var f;if(typeof r=="number")for(f=a;f<p;++f)this[f]=r;else{var E=S.isBuffer(r)?r:S.from(r,_),I=E.length;if(I===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(f=0;f<p-a;++f)this[f+a]=E[f%I]}return this};var tw=/[^+/0-9A-Za-z-_]/g;function ow(t){if(t=t.split("=")[0],t=t.trim().replace(tw,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function sp(t,r){r=r||1/0;for(var a,p=t.length,_=null,u=[],f=0;f<p;++f){if(a=t.charCodeAt(f),a>55295&&a<57344){if(!_){if(a>56319){(r-=3)>-1&&u.push(239,191,189);continue}else if(f+1===p){(r-=3)>-1&&u.push(239,191,189);continue}_=a;continue}if(a<56320){(r-=3)>-1&&u.push(239,191,189),_=a;continue}a=(_-55296<<10|a-56320)+65536}else _&&(r-=3)>-1&&u.push(239,191,189);if(_=null,a<128){if((r-=1)<0)break;u.push(a)}else if(a<2048){if((r-=2)<0)break;u.push(a>>6|192,a&63|128)}else if(a<65536){if((r-=3)<0)break;u.push(a>>12|224,a>>6&63|128,a&63|128)}else if(a<1114112){if((r-=4)<0)break;u.push(a>>18|240,a>>12&63|128,a>>6&63|128,a&63|128)}else throw new Error("Invalid code point")}return u}function rw(t){for(var r=[],a=0;a<t.length;++a)r.push(t.charCodeAt(a)&255);return r}function aw(t,r){for(var a,p,_,u=[],f=0;f<t.length&&!((r-=2)<0);++f)a=t.charCodeAt(f),p=a>>8,_=a%256,u.push(_),u.push(p);return u}function m_(t){return ip.toByteArray(ow(t))}function Jr(t,r,a,p){for(var _=0;_<p&&!(_+a>=r.length||_>=t.length);++_)r[_+a]=t[_];return _}function vn(t,r){return t instanceof r||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===r.name}function lp(t){return t!==t}var iw=function(){for(var t="0123456789abcdef",r=new Array(256),a=0;a<16;++a)for(var p=a*16,_=0;_<16;++_)r[p+_]=t[a]+t[_];return r}()});var g_=Oo((K1,f_)=>{s();var fe=f_.exports={},Sn,An;function dp(){throw new Error("setTimeout has not been defined")}function up(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Sn=setTimeout:Sn=dp}catch(t){Sn=dp}try{typeof clearTimeout=="function"?An=clearTimeout:An=up}catch(t){An=up}})();function l_(t){if(Sn===setTimeout)return setTimeout(t,0);if((Sn===dp||!Sn)&&setTimeout)return Sn=setTimeout,setTimeout(t,0);try{return Sn(t,0)}catch(r){try{return Sn.call(null,t,0)}catch(a){return Sn.call(this,t,0)}}}function pw(t){if(An===clearTimeout)return clearTimeout(t);if((An===up||!An)&&clearTimeout)return An=clearTimeout,clearTimeout(t);try{return An(t)}catch(r){try{return An.call(null,t)}catch(a){return An.call(this,t)}}}var Bn=[],jt=!1,At,Qr=-1;function cw(){!jt||!At||(jt=!1,At.length?Bn=At.concat(Bn):Qr=-1,Bn.length&&d_())}function d_(){if(!jt){var t=l_(cw);jt=!0;for(var r=Bn.length;r;){for(At=Bn,Bn=[];++Qr<r;)At&&At[Qr].run();Qr=-1,r=Bn.length}At=null,jt=!1,pw(t)}}fe.nextTick=function(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)r[a-1]=arguments[a];Bn.push(new u_(t,r)),Bn.length===1&&!jt&&l_(d_)};function u_(t,r){this.fun=t,this.array=r}u_.prototype.run=function(){this.fun.apply(null,this.array)};fe.title="browser";fe.browser=!0;fe.env={};fe.argv=[];fe.version="";fe.versions={};function Un(){}fe.on=Un;fe.addListener=Un;fe.once=Un;fe.off=Un;fe.removeListener=Un;fe.removeAllListeners=Un;fe.emit=Un;fe.prependListener=Un;fe.prependOnceListener=Un;fe.listeners=function(t){return[]};fe.binding=function(t){throw new Error("process.binding is not supported")};fe.cwd=function(){return"/"};fe.chdir=function(t){throw new Error("process.chdir is not supported")};fe.umask=function(){return 0}});var x,y,sw,h,s=H(()=>{x=P(__()),y=P(g_()),sw=function(t){function r(){var p=this||self;return delete t.prototype.__magic__,p}if(typeof globalThis=="object")return globalThis;if(this)return r();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:r});var a=__magic__;return a}(Object),h=sw});var ta,yp=H(()=>{"use strict";s();ta=()=>Date.now()/1e3});var D_=H(()=>{"use strict";s()});var R_=H(()=>{"use strict";s()});var P_=H(()=>{"use strict";s();yp();D_();R_()});var Tp={};wt(Tp,{getItem:()=>fw,localStorageKeys:()=>Lt,removeItem:()=>gw,setItem:()=>uw});var Lt,bp,uw,fw,gw,Uo=H(()=>{"use strict";s();P_();Lt={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},bp=typeof localStorage!="undefined",uw=({key:t,data:r,expires:a})=>{!bp||localStorage.setItem(String(t),JSON.stringify({expires:a,data:r}))},fw=t=>{if(!bp)return;let r=localStorage.getItem(String(t));if(!r)return null;let a=JSON.parse(r);return!a||!a.hasOwnProperty("expires")||!a.hasOwnProperty("data")?null:ta()>=a.expires?(localStorage.removeItem(String(t)),null):a.data},gw=t=>{!bp||localStorage.removeItem(String(t))}});var wp={};wt(wp,{clear:()=>B_,getItem:()=>O_,removeItem:()=>M_,setItem:()=>F_,storage:()=>hw});var F_,O_,M_,B_,hw,U_=H(()=>{"use strict";s();F_=({key:t,data:r,expires:a})=>{sessionStorage.setItem(String(t),JSON.stringify({expires:a,data:r}))},O_=t=>{let r=sessionStorage.getItem(String(t));if(!r)return null;let a=JSON.parse(r);return!a||!a.hasOwnProperty("expires")||!a.hasOwnProperty("data")?null:Date.now()>=a.expires?(sessionStorage.removeItem(String(t)),null):a.data},M_=t=>sessionStorage.removeItem(String(t)),B_=()=>sessionStorage.clear(),hw={setItem:F_,getItem:O_,removeItem:M_,clear:B_}});var no,oa=H(()=>{"use strict";s();Uo();U_();no={session:wp,local:Tp}});function Wo(){return new Date().setHours(new Date().getHours()+24)}function $o(t){no.local.setItem({key:Lt.loginExpiresAt,data:t,expires:t})}var vp=H(()=>{"use strict";s();oa();Uo()});var un=H(()=>{"use strict";s()});var W_=H(()=>{"use strict";s()});var $_=H(()=>{"use strict";s()});var Sp,ke=H(()=>{"use strict";s();Sp=(p=>(p.nft="nft",p.esdt="esdt",p.egld="egld",p))(Sp||{})});var H_=H(()=>{"use strict";s()});var G_=H(()=>{"use strict";s()});var z_=H(()=>{"use strict";s()});var V_=H(()=>{"use strict";s()});var it=H(()=>{"use strict";s();$_();ke();un();H_();G_();z_();V_()});var Ap,q_,Mv,K_,Bv,X_,Z_,Uv,Wv,Y_=H(()=>{"use strict";s();it();Ap={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:q_,egldLabel:Mv}=Ap["devnet"],{chainId:K_,egldLabel:Bv}=Ap["testnet"],{chainId:X_,egldLabel:Z_}=Ap["mainnet"],Uv={["devnet"]:q_,["testnet"]:K_,["mainnet"]:X_},Wv={[q_]:"devnet",[K_]:"testnet",[X_]:"mainnet"}});var kp=H(()=>{"use strict";s()});var J_=H(()=>{"use strict";s()});var Q_,Ip=H(()=>{"use strict";s();Q_="transaction-status-toast-id"});var Ep,Lp,Se,Nt,j_,Np,el,ra,nl,tl,kn,he=H(()=>{"use strict";s();W_();Y_();kp();J_();Ip();Ep=5e4,Lp=1e9,Se=18,Nt=4,j_=1,Np=4294967295,el=4294967280,ra="logout",nl="login",tl="refundedGas",kn="0"});var Cp,We,aa,pt=H(()=>{"use strict";s();Cp=require("@reduxjs/toolkit");he();We=(0,Cp.createAction)(ra),aa=(0,Cp.createAction)(nl,t=>({payload:t}))});var rl,ol,al,rS,aS,iS,pS,cS,sS,il,pl,Dp=H(()=>{"use strict";s();rl=require("@reduxjs/toolkit");vp();un();pt();ol={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},al=(0,rl.createSlice)({name:"loginInfoSlice",initialState:ol,reducers:{setLoginMethod:(t,r)=>{t.loginMethod=r.payload},setTokenLogin:(t,r)=>{t.tokenLogin=r.payload},setTokenLoginSignature:(t,r)=>{(t==null?void 0:t.tokenLogin)!=null&&(t.tokenLogin.signature=r.payload)},setWalletLogin:(t,r)=>{t.walletLogin=r.payload},setWalletConnectLogin:(t,r)=>{t.walletConnectLogin=r.payload},setLedgerLogin:(t,r)=>{t.ledgerLogin=r.payload},invalidateLoginSession:t=>{t.isLoginSessionInvalid=!0}},extraReducers:t=>{t.addCase(We,()=>ol),t.addCase(aa,(r,a)=>{r.loginMethod=a.payload.loginMethod,$o(Wo())})}}),{setLoginMethod:rS,setWalletConnectLogin:aS,setLedgerLogin:iS,setTokenLogin:pS,setTokenLoginSignature:cS,setWalletLogin:sS,invalidateLoginSession:il}=al.actions,pl=al.reducer});var cl=H(()=>{"use strict";s()});var sl=H(()=>{"use strict";s();cl()});function Rp(t){return t[Math.floor(Math.random()*t.length)]}var ml=H(()=>{"use strict";s()});var _l=H(()=>{"use strict";s();kp()});var ll=H(()=>{"use strict";s();sl();ml();_l()});var dl,ul,Pp,yw,fl,AS,kS,gl,Fp=H(()=>{"use strict";s();dl=require("@reduxjs/toolkit"),ul=P(require("lodash.omit"));ll();Pp={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},yw={network:Pp,chainID:"-1"},fl=(0,dl.createSlice)({name:"appConfig",initialState:yw,reducers:{initializeNetworkConfig:(t,r)=>{let a=Rp(r.payload.walletConnectBridgeAddresses),p=Rp(r.payload.walletConnectV2RelayAddresses),_=(0,ul.default)(r.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");t.network=pe(V(V({},t.network),_),{walletConnectBridgeAddress:a,walletConnectV2RelayAddress:p})},setChainID:(t,r)=>{t.chainID=r.payload}}}),{initializeNetworkConfig:AS,setChainID:kS}=fl.actions,gl=fl.reducer});var Mp,hl,xl,ia,Op,yl,bl,PS,Tl,FS,OS,MS,BS,US,WS,$S,wl,Bp=H(()=>{"use strict";s();Mp=require("@elrondnetwork/erdjs"),hl=require("@reduxjs/toolkit"),xl=require("redux-persist");he();oa();Uo();pt();ia={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:kn},Op={address:"",websocketEvent:null,accounts:{"":ia},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},yl=(0,hl.createSlice)({name:"accountInfoSlice",initialState:Op,reducers:{setAddress:(t,r)=>{let a=r.payload;t.address=a,t.publicKey=new Mp.Address(a).hex()},setAccount:(t,r)=>{let a=t.address===r.payload.address;t.accounts={[t.address]:a?r.payload:ia},t.isAccountLoading=!1,t.accountLoadingError=null},setAccountNonce:(t,r)=>{let{address:a}=t;t.accounts[a].nonce=r.payload},setAccountShard:(t,r)=>{t.shard=r.payload},setLedgerAccount:(t,r)=>{t.ledgerAccount=r.payload},updateLedgerAccount:(t,r)=>{t.ledgerAccount!=null&&(t.ledgerAccount.index=r.payload.index,t.ledgerAccount.address=r.payload.address)},setWalletConnectAccount:(t,r)=>{t.walletConnectAccount=r.payload},setIsAccountLoading:(t,r)=>{t.isAccountLoading=r.payload,t.accountLoadingError=null},setAccountLoadingError:(t,r)=>{t.accountLoadingError=r.payload,t.isAccountLoading=!1},setWebsocketEvent:(t,r)=>{t.websocketEvent={timestamp:Date.now(),message:r.payload}}},extraReducers:t=>{t.addCase(We,()=>(no.local.removeItem(Lt.loginExpiresAt),Op)),t.addCase(aa,(r,a)=>{let{address:p}=a.payload;r.address=p,r.publicKey=new Mp.Address(p).hex()}),t.addCase(xl.REHYDRATE,(r,a)=>{var C;if(!((C=a.payload)!=null&&C.account))return;let{account:p}=a.payload,{address:_,shard:u,accounts:f,publicKey:E}=p;r.address=_,r.shard=u;let I=f&&_ in f;r.accounts=I?f:Op.accounts,r.publicKey=E})}}),{setAccount:bl,setAddress:PS,setAccountNonce:Tl,setAccountShard:FS,setLedgerAccount:OS,updateLedgerAccount:MS,setWalletConnectAccount:BS,setIsAccountLoading:US,setAccountLoadingError:WS,setWebsocketEvent:$S}=yl.actions,wl=yl.reducer});function vl(t){return t!=null&&(Ew(t)||Dw(t))}function pa(t){return t!=null&&(Lw(t)||Rw(t))}function ca(t){return t!=null&&(Nw(t)||Pw(t))}function Sl(t){return t!=null&&Cw(t)}function Ew(t){return t!=null&&Tw.includes(t)}function Lw(t){return t!=null&&ww.includes(t)}function Nw(t){return t!=null&&vw.includes(t)}function Cw(t){return t!=null&&Sw.includes(t)}function Dw(t){return t!=null&&Aw.includes(t)}function Rw(t){return t!=null&&kw.includes(t)}function Pw(t){return t!=null&&Iw.includes(t)}var Tw,ww,vw,Sw,Aw,kw,Iw,Wp=H(()=>{"use strict";s();un();Tw=["sent"],ww=["success"],vw=["fail","cancelled","timedOut"],Sw=["timedOut"],Aw=["pending"],kw=["success"],Iw=["fail","invalid"]});var Al,kl,Ho,Fw,Il,YS,JS,QS,jS,eA,nA,tA,oA,rA,aA,sa,ma=H(()=>{"use strict";s();Al=require("@reduxjs/toolkit"),kl=require("redux-persist");un();Wp();pt();Ho={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Fw={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Il=(0,Al.createSlice)({name:"transactionsSlice",initialState:Ho,reducers:{moveTransactionsToSignedState:(t,r)=>{var I,C;let{sessionId:a,transactions:p,errorMessage:_,status:u,redirectRoute:f}=r.payload,E=((I=t.customTransactionInformationForSessionId)==null?void 0:I[a])||Fw;t.signedTransactions[a]={transactions:p,status:u,errorMessage:_,redirectRoute:f,customTransactionInformation:E},((C=t==null?void 0:t.transactionsToSign)==null?void 0:C.sessionId)===a&&(t.transactionsToSign=Ho.transactionsToSign)},clearSignedTransaction:(t,r)=>{t.signedTransactions[r.payload]&&delete t.signedTransactions[r.payload]},clearTransactionToSign:t=>{t!=null&&t.transactionsToSign&&(t.transactionsToSign=null)},updateSignedTransaction:(t,r)=>{t.signedTransactions=V(V({},t.signedTransactions),r.payload)},updateSignedTransactions:(t,r)=>{let{sessionId:a,status:p,errorMessage:_,transactions:u}=r.payload;t.signedTransactions[a]!=null&&(t.signedTransactions[a].status=p,_!=null&&(t.signedTransactions[a].errorMessage=_),u!=null&&(t.signedTransactions[a].transactions=u))},updateSignedTransactionStatus:(t,r)=>{var E,I,C,M,F,G;let{sessionId:a,status:p,errorMessage:_,transactionHash:u}=r.payload,f=(I=(E=t.signedTransactions)==null?void 0:E[a])==null?void 0:I.transactions;if(f!=null){t.signedTransactions[a].transactions=f.map(_e=>_e.hash===u?pe(V({},_e),{status:p,errorMessage:_}):_e);let ee=(M=(C=t.signedTransactions[a])==null?void 0:C.transactions)==null?void 0:M.every(_e=>pa(_e.status)),ne=(G=(F=t.signedTransactions[a])==null?void 0:F.transactions)==null?void 0:G.every(_e=>ca(_e.status));ee&&(t.signedTransactions[a].status="success"),ne&&(t.signedTransactions[a].status="fail")}},setTransactionsToSign:(t,r)=>{t.transactionsToSign=r.payload;let{sessionId:a,customTransactionInformation:p}=r.payload;t.customTransactionInformationForSessionId[a]=p,t.signTransactionsError=null},clearAllTransactionsToSign:t=>{t.transactionsToSign=Ho.transactionsToSign,t.signTransactionsError=null},clearAllSignedTransactions:t=>{t.signedTransactions=Ho.signedTransactions},setSignTransactionsError:(t,r)=>{t.signTransactionsError=r.payload},setSignTransactionsCancelMessage:(t,r)=>{t.signTransactionsCancelMessage=r.payload}},extraReducers:t=>{t.addCase(We,()=>Ho),t.addCase(kl.REHYDRATE,(r,a)=>{var f;if(r.signTransactionsCancelMessage=null,!((f=a.payload)!=null&&f.transactions))return;let{signedTransactions:p,customTransactionInformationForSessionId:_}=a.payload.transactions,u=Object.entries(p).reduce((E,[I,C])=>{let M=new Date(I),F=new Date;return F.setHours(F.getHours()+5),F-M>0||(E[I]=C),E},{});_!=null&&(r.customTransactionInformationForSessionId=_),p!=null&&(r.signedTransactions=u)})}}),{updateSignedTransactionStatus:YS,updateSignedTransactions:JS,setTransactionsToSign:QS,clearAllTransactionsToSign:jS,clearAllSignedTransactions:eA,clearSignedTransaction:nA,clearTransactionToSign:tA,setSignTransactionsError:oA,setSignTransactionsCancelMessage:rA,moveTransactionsToSignedState:aA}=Il.actions,sa=Il.reducer});var El,Hp,Gp,zp,Ow,$p,Ll,sA,mA,_A,_a,la=H(()=>{"use strict";s();El=require("@reduxjs/toolkit");pt();Hp="Transaction failed",Gp="Transaction successful",zp="Processing transaction",Ow="Transaction submitted",$p={},Ll=(0,El.createSlice)({name:"transactionsInfo",initialState:$p,reducers:{setTransactionsDisplayInfo(t,r){let{sessionId:a,transactionsDisplayInfo:p}=r.payload;a!=null&&(t[a]={errorMessage:(p==null?void 0:p.errorMessage)||Hp,successMessage:(p==null?void 0:p.successMessage)||Gp,processingMessage:(p==null?void 0:p.processingMessage)||zp,submittedMessage:(p==null?void 0:p.submittedMessage)||Ow,transactionDuration:p==null?void 0:p.transactionDuration})},clearTransactionsInfoForSessionId(t,r){r.payload!=null&&delete t[r.payload]},clearTransactionsInfo:()=>$p},extraReducers:t=>{t.addCase(We,()=>$p)}}),{clearTransactionsInfo:sA,setTransactionsDisplayInfo:mA,clearTransactionsInfoForSessionId:_A}=Ll.actions,_a=Ll.reducer});var Cl,Nl,Dl,fA,gA,hA,xA,Rl,Vp=H(()=>{"use strict";s();Cl=require("@reduxjs/toolkit");pt();Nl={},Dl=(0,Cl.createSlice)({name:"modalsSlice",initialState:Nl,reducers:{setTxSubmittedModal:(t,r)=>{t.txSubmittedModal=r.payload},setNotificationModal:(t,r)=>{t.notificationModal=r.payload},clearTxSubmittedModal:t=>{t.txSubmittedModal=void 0},clearNotificationModal:t=>{t.notificationModal=void 0}},extraReducers:t=>{t.addCase(We,()=>Nl)}}),{setTxSubmittedModal:fA,setNotificationModal:gA,clearTxSubmittedModal:hA,clearNotificationModal:xA}=Dl.actions,Rl=Dl.reducer});var Fl,Ol,Pl,Ml,kA,IA,EA,LA,NA,CA,da,ua=H(()=>{"use strict";s();Fl=require("@reduxjs/toolkit"),Ol=require("redux-persist");Ip();it();yp();pt();Pl={customToasts:[],transactionToasts:[],failTransactionToast:null},Ml=(0,Fl.createSlice)({name:"toastsSlice",initialState:Pl,reducers:{addCustomToast:(t,r)=>{t.customToasts.push(pe(V({},r.payload),{type:"custom",toastId:r.payload.toastId||`custom-toast-${t.customToasts.length+1}`}))},removeCustomToast:(t,r)=>{t.customToasts=t.customToasts.filter(a=>a.toastId!==r.payload)},addTransactionToast:(t,r)=>{t.transactionToasts.push({type:"transaction",startTimestamp:ta(),toastId:r.payload||`custom-toast-${t.transactionToasts.length+1}`})},removeTransactionToast:(t,r)=>{t.transactionToasts=t.transactionToasts.filter(a=>a.toastId!==r.payload)},addFailTransactionToast:(t,r)=>{t.failTransactionToast=pe(V({},r.payload),{toastId:Q_})},removeFailTransactionToast:t=>{t.failTransactionToast=null}},extraReducers:t=>{t.addCase(We,()=>Pl),t.addCase(Ol.REHYDRATE,(r,a)=>{var _,u;let p=(u=(_=a.customToasts)==null?void 0:_.filter(f=>!("component"in f)))!=null?u:[];r.customToasts=p})}}),{addCustomToast:kA,removeCustomToast:IA,addTransactionToast:EA,removeTransactionToast:LA,addFailTransactionToast:NA,removeFailTransactionToast:CA}=Ml.actions,da=Ml.reducer});var to=H(()=>{"use strict";s();Dp();Fp();Bp();ma();la();Vp();ua()});var qp=H(()=>{"use strict";s()});var $l,Wl,Hl,JA,QA,jA,e2,n2,t2,Gl,zl=H(()=>{"use strict";s();$l=require("@reduxjs/toolkit");pt();Wl={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Hl=(0,$l.createSlice)({name:"dappModalsSlice",initialState:Wl,reducers:{setDappModalVisibility:(t,r)=>{t.visible=r.payload},setDappModalHeaderVisibility:(t,r)=>{t.modal.showHeader=r.payload},setDappModalFooterVisibility:(t,r)=>{t.modal.showFooter=r.payload},setDappModalHeaderText:(t,r)=>{t.modal.headerText=r.payload},setDappModalFooterText:(t,r)=>{t.modal.footerText=r.payload},setDappModalConfig:(t,r)=>{t.modal=V({},r.payload)}},extraReducers:t=>{t.addCase(We,()=>Wl)}}),{setDappModalVisibility:JA,setDappModalHeaderVisibility:QA,setDappModalFooterVisibility:jA,setDappModalHeaderText:e2,setDappModalFooterText:n2,setDappModalConfig:t2}=Hl.actions,Gl=Hl.reducer});var Vl,Ww,$w,oo,ga=H(()=>{"use strict";s();Vl=require("@reduxjs/toolkit");qp();Bp();zl();Dp();Vp();Fp();ua();la();ma();Ww={["account"]:wl,["networkConfig"]:gl,["loginInfo"]:pl,["modals"]:Rl,["dappModal"]:Gl,["toasts"]:da,["transactions"]:sa,["transactionsInfo"]:_a},$w=(t={})=>(0,Vl.combineReducers)(V(V({},Ww),t)),oo=$w});var Xl={};wt(Xl,{default:()=>Xw});function Kp(t,r=[]){return{key:t,version:1,storage:Kl.default,blacklist:r}}var Ct,ql,Kl,Hw,Gw,zw,Vw,qw,Kw,Xw,Zl=H(()=>{"use strict";s();Ct=require("redux-persist"),ql=P(require("redux-persist/lib/storage")),Kl=P(require("redux-persist/lib/storage/session"));ga();to();ua();la();ma();qp();Hw={2:t=>pe(V({},t),{networkConfig:Pp})};Gw=Kp("dapp-core-transactionsInfo"),zw=Kp("dapp-core-transactions",["transactionsToSign"]),Vw=Kp("dapp-core-toasts"),qw={key:"dapp-core-store",version:2,storage:ql.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,Ct.createMigrate)(Hw,{debug:!1})},Kw={["toasts"]:(0,Ct.persistReducer)(Vw,da),["transactions"]:(0,Ct.persistReducer)(zw,sa),["transactionsInfo"]:(0,Ct.persistReducer)(Gw,_a)},Xw=(0,Ct.persistReducer)(qw,oo(Kw))});var Yl={};wt(Yl,{default:()=>Zw});var Zw,Jl=H(()=>{"use strict";s();ga();Zw=oo()});var Ql={};wt(Ql,{default:()=>Jw});var on,Yw,Jw,jl=H(()=>{"use strict";s();on=require("redux-persist"),Yw=[on.FLUSH,on.REHYDRATE,on.PAUSE,on.PERSIST,on.PURGE,on.REGISTER],Jw=Yw});var td={};wt(td,{default:()=>nd});function nd(t){return(0,ed.persistStore)(t)}var ed,od=H(()=>{"use strict";s();ed=require("redux-persist")});var lu=Oo((co,Zo)=>{s();(function(){var t,r="4.17.21",a=200,p="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",_="Expected a function",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",E=500,I="__lodash_placeholder__",C=1,M=2,F=4,G=1,ee=2,ne=1,_e=2,Ft=4,an=8,pn=16,Ie=32,be=64,Pe=128,hn=256,_o=512,Fa=30,Nu="...",Cu=800,Du=16,dc=1,Ru=2,Pu=3,lt=1/0,qn=9007199254740991,Fu=17976931348623157e292,nr=0/0,xn=4294967295,Ou=xn-1,Mu=xn>>>1,Bu=[["ary",Pe],["bind",ne],["bindKey",_e],["curry",an],["curryRight",pn],["flip",_o],["partial",Ie],["partialRight",be],["rearg",hn]],Ot="[object Arguments]",tr="[object Array]",Uu="[object AsyncFunction]",lo="[object Boolean]",uo="[object Date]",Wu="[object DOMException]",or="[object Error]",rr="[object Function]",uc="[object GeneratorFunction]",cn="[object Map]",fo="[object Number]",$u="[object Null]",In="[object Object]",fc="[object Promise]",Hu="[object Proxy]",go="[object RegExp]",sn="[object Set]",ho="[object String]",ar="[object Symbol]",Gu="[object Undefined]",xo="[object WeakMap]",zu="[object WeakSet]",yo="[object ArrayBuffer]",Mt="[object DataView]",Oa="[object Float32Array]",Ma="[object Float64Array]",Ba="[object Int8Array]",Ua="[object Int16Array]",Wa="[object Int32Array]",$a="[object Uint8Array]",Ha="[object Uint8ClampedArray]",Ga="[object Uint16Array]",za="[object Uint32Array]",Vu=/\b__p \+= '';/g,qu=/\b(__p \+=) '' \+/g,Ku=/(__e\(.*?\)|\b__t\)) \+\n'';/g,gc=/&(?:amp|lt|gt|quot|#39);/g,hc=/[&<>"']/g,Xu=RegExp(gc.source),Zu=RegExp(hc.source),Yu=/<%-([\s\S]+?)%>/g,Ju=/<%([\s\S]+?)%>/g,xc=/<%=([\s\S]+?)%>/g,Qu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ju=/^\w*$/,ef=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Va=/[\\^$.*+?()[\]{}|]/g,nf=RegExp(Va.source),qa=/^\s+/,tf=/\s/,of=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,rf=/\{\n\/\* \[wrapped with (.+)\] \*/,af=/,? & /,pf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,cf=/[()=,{}\[\]\/\s]/,sf=/\\(\\)?/g,mf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yc=/\w*$/,_f=/^[-+]0x[0-9a-f]+$/i,lf=/^0b[01]+$/i,df=/^\[object .+?Constructor\]$/,uf=/^0o[0-7]+$/i,ff=/^(?:0|[1-9]\d*)$/,gf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ir=/($^)/,hf=/['\n\r\u2028\u2029\\]/g,pr="\\ud800-\\udfff",xf="\\u0300-\\u036f",yf="\\ufe20-\\ufe2f",bf="\\u20d0-\\u20ff",bc=xf+yf+bf,Tc="\\u2700-\\u27bf",wc="a-z\\xdf-\\xf6\\xf8-\\xff",Tf="\\xac\\xb1\\xd7\\xf7",wf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vf="\\u2000-\\u206f",Sf=" \\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",vc="A-Z\\xc0-\\xd6\\xd8-\\xde",Sc="\\ufe0e\\ufe0f",Ac=Tf+wf+vf+Sf,Ka="['\u2019]",Af="["+pr+"]",kc="["+Ac+"]",cr="["+bc+"]",Ic="\\d+",kf="["+Tc+"]",Ec="["+wc+"]",Lc="[^"+pr+Ac+Ic+Tc+wc+vc+"]",Xa="\\ud83c[\\udffb-\\udfff]",If="(?:"+cr+"|"+Xa+")",Nc="[^"+pr+"]",Za="(?:\\ud83c[\\udde6-\\uddff]){2}",Ya="[\\ud800-\\udbff][\\udc00-\\udfff]",Bt="["+vc+"]",Cc="\\u200d",Dc="(?:"+Ec+"|"+Lc+")",Ef="(?:"+Bt+"|"+Lc+")",Rc="(?:"+Ka+"(?:d|ll|m|re|s|t|ve))?",Pc="(?:"+Ka+"(?:D|LL|M|RE|S|T|VE))?",Fc=If+"?",Oc="["+Sc+"]?",Lf="(?:"+Cc+"(?:"+[Nc,Za,Ya].join("|")+")"+Oc+Fc+")*",Nf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Cf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Mc=Oc+Fc+Lf,Df="(?:"+[kf,Za,Ya].join("|")+")"+Mc,Rf="(?:"+[Nc+cr+"?",cr,Za,Ya,Af].join("|")+")",Pf=RegExp(Ka,"g"),Ff=RegExp(cr,"g"),Ja=RegExp(Xa+"(?="+Xa+")|"+Rf+Mc,"g"),Of=RegExp([Bt+"?"+Ec+"+"+Rc+"(?="+[kc,Bt,"$"].join("|")+")",Ef+"+"+Pc+"(?="+[kc,Bt+Dc,"$"].join("|")+")",Bt+"?"+Dc+"+"+Rc,Bt+"+"+Pc,Cf,Nf,Ic,Df].join("|"),"g"),Mf=RegExp("["+Cc+pr+bc+Sc+"]"),Bf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Uf=["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"],Wf=-1,ce={};ce[Oa]=ce[Ma]=ce[Ba]=ce[Ua]=ce[Wa]=ce[$a]=ce[Ha]=ce[Ga]=ce[za]=!0,ce[Ot]=ce[tr]=ce[yo]=ce[lo]=ce[Mt]=ce[uo]=ce[or]=ce[rr]=ce[cn]=ce[fo]=ce[In]=ce[go]=ce[sn]=ce[ho]=ce[xo]=!1;var ie={};ie[Ot]=ie[tr]=ie[yo]=ie[Mt]=ie[lo]=ie[uo]=ie[Oa]=ie[Ma]=ie[Ba]=ie[Ua]=ie[Wa]=ie[cn]=ie[fo]=ie[In]=ie[go]=ie[sn]=ie[ho]=ie[ar]=ie[$a]=ie[Ha]=ie[Ga]=ie[za]=!0,ie[or]=ie[rr]=ie[xo]=!1;var $f={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u0