UNPKG

@sofaws/dapp-core

Version:

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

1 lines 202 kB
"use strict";var Cp=Object.create;var Je=Object.defineProperty,Dp=Object.defineProperties,Lp=Object.getOwnPropertyDescriptor,Pp=Object.getOwnPropertyDescriptors,Fp=Object.getOwnPropertyNames,Ao=Object.getOwnPropertySymbols,Rp=Object.getPrototypeOf,xn=Object.prototype.hasOwnProperty,Lt=Object.prototype.propertyIsEnumerable;var Dt=(e,o,n)=>o in e?Je(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,f=(e,o)=>{for(var n in o||(o={}))xn.call(o,n)&&Dt(e,n,o[n]);if(Ao)for(var n of Ao(o))Lt.call(o,n)&&Dt(e,n,o[n]);return e},S=(e,o)=>Dp(e,Pp(o));var be=(e,o)=>{var n={};for(var r in e)xn.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ao)for(var r of Ao(e))o.indexOf(r)<0&&Lt.call(e,r)&&(n[r]=e[r]);return n};var b=(e,o)=>()=>(e&&(o=e(e=0)),o);var Io=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),we=(e,o)=>{for(var n in o)Je(e,n,{get:o[n],enumerable:!0})},Pt=(e,o,n,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of Fp(o))!xn.call(e,a)&&a!==n&&Je(e,a,{get:()=>o[a],enumerable:!(r=Lp(o,a))||r.enumerable});return e};var u=(e,o,n)=>(n=e!=null?Cp(Rp(e)):{},Pt(o||!e||!e.__esModule?Je(n,"default",{value:e,enumerable:!0}):n,e)),Qe=e=>Pt(Je({},"__esModule",{value:!0}),e);var I=(e,o,n)=>new Promise((r,a)=>{var s=l=>{try{d(n.next(l))}catch(g){a(g)}},m=l=>{try{d(n.throw(l))}catch(g){a(g)}},d=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,m);d((n=n.apply(e,o)).next())});var Mt=Io(Eo=>{"use strict";t();Eo.byteLength=Op;Eo.toByteArray=Up;Eo.fromByteArray=Vp;var K=[],$=[],Mp=typeof Uint8Array!="undefined"?Uint8Array:Array,yn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Se=0,Ft=yn.length;Se<Ft;++Se)K[Se]=yn[Se],$[yn.charCodeAt(Se)]=Se;var Se,Ft;$["-".charCodeAt(0)]=62;$["_".charCodeAt(0)]=63;function Rt(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 Op(e){var o=Rt(e),n=o[0],r=o[1];return(n+r)*3/4-r}function Bp(e,o,n){return(o+n)*3/4-n}function Up(e){var o,n=Rt(e),r=n[0],a=n[1],s=new Mp(Bp(e,r,a)),m=0,d=a>0?r-4:r,l;for(l=0;l<d;l+=4)o=$[e.charCodeAt(l)]<<18|$[e.charCodeAt(l+1)]<<12|$[e.charCodeAt(l+2)]<<6|$[e.charCodeAt(l+3)],s[m++]=o>>16&255,s[m++]=o>>8&255,s[m++]=o&255;return a===2&&(o=$[e.charCodeAt(l)]<<2|$[e.charCodeAt(l+1)]>>4,s[m++]=o&255),a===1&&(o=$[e.charCodeAt(l)]<<10|$[e.charCodeAt(l+1)]<<4|$[e.charCodeAt(l+2)]>>2,s[m++]=o>>8&255,s[m++]=o&255),s}function $p(e){return K[e>>18&63]+K[e>>12&63]+K[e>>6&63]+K[e&63]}function Wp(e,o,n){for(var r,a=[],s=o;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),a.push($p(r));return a.join("")}function Vp(e){for(var o,n=e.length,r=n%3,a=[],s=16383,m=0,d=n-r;m<d;m+=s)a.push(Wp(e,m,m+s>d?d:m+s));return r===1?(o=e[n-1],a.push(K[o>>2]+K[o<<4&63]+"==")):r===2&&(o=(e[n-2]<<8)+e[n-1],a.push(K[o>>10]+K[o>>4&63]+K[o<<2&63]+"=")),a.join("")}});var Ot=Io(Tn=>{t();Tn.read=function(e,o,n,r,a){var s,m,d=a*8-r-1,l=(1<<d)-1,g=l>>1,x=-7,h=n?a-1:0,w=n?-1:1,v=e[o+h];for(h+=w,s=v&(1<<-x)-1,v>>=-x,x+=d;x>0;s=s*256+e[o+h],h+=w,x-=8);for(m=s&(1<<-x)-1,s>>=-x,x+=r;x>0;m=m*256+e[o+h],h+=w,x-=8);if(s===0)s=1-g;else{if(s===l)return m?NaN:(v?-1:1)*(1/0);m=m+Math.pow(2,r),s=s-g}return(v?-1:1)*m*Math.pow(2,s-r)};Tn.write=function(e,o,n,r,a,s){var m,d,l,g=s*8-a-1,x=(1<<g)-1,h=x>>1,w=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=r?0:s-1,C=r?1:-1,L=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(d=isNaN(o)?1:0,m=x):(m=Math.floor(Math.log(o)/Math.LN2),o*(l=Math.pow(2,-m))<1&&(m--,l*=2),m+h>=1?o+=w/l:o+=w*Math.pow(2,1-h),o*l>=2&&(m++,l/=2),m+h>=x?(d=0,m=x):m+h>=1?(d=(o*l-1)*Math.pow(2,a),m=m+h):(d=o*Math.pow(2,h-1)*Math.pow(2,a),m=0));a>=8;e[n+v]=d&255,v+=C,d/=256,a-=8);for(m=m<<a|d,g+=a;g>0;e[n+v]=m&255,v+=C,m/=256,g-=8);e[n+v-C]|=L*128}});var Zt=Io(Pe=>{"use strict";t();var bn=Mt(),Le=Ot(),Bt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Pe.Buffer=_;Pe.SlowBuffer=Kp;Pe.INSPECT_MAX_BYTES=50;var No=2147483647;Pe.kMaxLength=No;_.TYPED_ARRAY_SUPPORT=zp();!_.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 zp(){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(_.prototype,"parent",{enumerable:!0,get:function(){if(!!_.isBuffer(this))return this.buffer}});Object.defineProperty(_.prototype,"offset",{enumerable:!0,get:function(){if(!!_.isBuffer(this))return this.byteOffset}});function ie(e){if(e>No)throw new RangeError('The value "'+e+'" is invalid for option "size"');var o=new Uint8Array(e);return Object.setPrototypeOf(o,_.prototype),o}function _(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 kn(e)}return Wt(e,o,n)}_.poolSize=8192;function Wt(e,o,n){if(typeof e=="string")return Hp(e,o);if(ArrayBuffer.isView(e))return jp(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(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return Sn(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 _.from(r,o,n);var a=qp(e);if(a)return a;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return _.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)}_.from=function(e,o,n){return Wt(e,o,n)};Object.setPrototypeOf(_.prototype,Uint8Array.prototype);Object.setPrototypeOf(_,Uint8Array);function Vt(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 Gp(e,o,n){return Vt(e),e<=0?ie(e):o!==void 0?typeof n=="string"?ie(e).fill(o,n):ie(e).fill(o):ie(e)}_.alloc=function(e,o,n){return Gp(e,o,n)};function kn(e){return Vt(e),ie(e<0?0:An(e)|0)}_.allocUnsafe=function(e){return kn(e)};_.allocUnsafeSlow=function(e){return kn(e)};function Hp(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!_.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=zt(e,o)|0,r=ie(n),a=r.write(e,o);return a!==n&&(r=r.slice(0,a)),r}function wn(e){for(var o=e.length<0?0:An(e.length)|0,n=ie(o),r=0;r<o;r+=1)n[r]=e[r]&255;return n}function jp(e){if(X(e,Uint8Array)){var o=new Uint8Array(e);return Sn(o.buffer,o.byteOffset,o.byteLength)}return wn(e)}function Sn(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,_.prototype),r}function qp(e){if(_.isBuffer(e)){var o=An(e.length)|0,n=ie(o);return n.length===0||e.copy(n,0,0,o),n}if(e.length!==void 0)return typeof e.length!="number"||In(e.length)?ie(0):wn(e);if(e.type==="Buffer"&&Array.isArray(e.data))return wn(e.data)}function An(e){if(e>=No)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+No.toString(16)+" bytes");return e|0}function Kp(e){return+e!=e&&(e=0),_.alloc(+e)}_.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==_.prototype};_.compare=function(o,n){if(X(o,Uint8Array)&&(o=_.from(o,o.offset,o.byteLength)),X(n,Uint8Array)&&(n=_.from(n,n.offset,n.byteLength)),!_.isBuffer(o)||!_.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,s=0,m=Math.min(r,a);s<m;++s)if(o[s]!==n[s]){r=o[s],a=n[s];break}return r<a?-1:a<r?1:0};_.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}};_.concat=function(o,n){if(!Array.isArray(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return _.alloc(0);var r;if(n===void 0)for(n=0,r=0;r<o.length;++r)n+=o[r].length;var a=_.allocUnsafe(n),s=0;for(r=0;r<o.length;++r){var m=o[r];if(X(m,Uint8Array))s+m.length>a.length?_.from(m).copy(a,s):Uint8Array.prototype.set.call(a,m,s);else if(_.isBuffer(m))m.copy(a,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=m.length}return a};function zt(e,o){if(_.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(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 vn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Xt(e).length;default:if(a)return r?-1:vn(e).length;o=(""+o).toLowerCase(),a=!0}}_.byteLength=zt;function Xp(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 ac(this,o,n);case"utf8":case"utf-8":return Ht(this,o,n);case"ascii":return tc(this,o,n);case"latin1":case"binary":return rc(this,o,n);case"base64":return oc(this,o,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ic(this,o,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}_.prototype._isBuffer=!0;function ve(e,o,n){var r=e[o];e[o]=e[n],e[n]=r}_.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)ve(this,n,n+1);return this};_.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)ve(this,n,n+3),ve(this,n+1,n+2);return this};_.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)ve(this,n,n+7),ve(this,n+1,n+6),ve(this,n+2,n+5),ve(this,n+3,n+4);return this};_.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?Ht(this,0,o):Xp.apply(this,arguments)};_.prototype.toLocaleString=_.prototype.toString;_.prototype.equals=function(o){if(!_.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:_.compare(this,o)===0};_.prototype.inspect=function(){var o="",n=Pe.INSPECT_MAX_BYTES;return o=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(o+=" ... "),"<Buffer "+o+">"};Bt&&(_.prototype[Bt]=_.prototype.inspect);_.prototype.compare=function(o,n,r,a,s){if(X(o,Uint8Array)&&(o=_.from(o,o.offset,o.byteLength)),!_.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),s===void 0&&(s=this.length),n<0||r>o.length||a<0||s>this.length)throw new RangeError("out of range index");if(a>=s&&n>=r)return 0;if(a>=s)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,a>>>=0,s>>>=0,this===o)return 0;for(var m=s-a,d=r-n,l=Math.min(m,d),g=this.slice(a,s),x=o.slice(n,r),h=0;h<l;++h)if(g[h]!==x[h]){m=g[h],d=x[h];break}return m<d?-1:d<m?1:0};function Gt(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,In(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=_.from(o,r)),_.isBuffer(o))return o.length===0?-1:Ut(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):Ut(e,[o],n,r,a);throw new TypeError("val must be string, number or Buffer")}function Ut(e,o,n,r,a){var s=1,m=e.length,d=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;s=2,m/=2,d/=2,n/=2}function l(v,C){return s===1?v[C]:v.readUInt16BE(C*s)}var g;if(a){var x=-1;for(g=n;g<m;g++)if(l(e,g)===l(o,x===-1?0:g-x)){if(x===-1&&(x=g),g-x+1===d)return x*s}else x!==-1&&(g-=g-x),x=-1}else for(n+d>m&&(n=m-d),g=n;g>=0;g--){for(var h=!0,w=0;w<d;w++)if(l(e,g+w)!==l(o,w)){h=!1;break}if(h)return g}return-1}_.prototype.includes=function(o,n,r){return this.indexOf(o,n,r)!==-1};_.prototype.indexOf=function(o,n,r){return Gt(this,o,n,r,!0)};_.prototype.lastIndexOf=function(o,n,r){return Gt(this,o,n,r,!1)};function Zp(e,o,n,r){n=Number(n)||0;var a=e.length-n;r?(r=Number(r),r>a&&(r=a)):r=a;var s=o.length;r>s/2&&(r=s/2);for(var m=0;m<r;++m){var d=parseInt(o.substr(m*2,2),16);if(In(d))return m;e[n+m]=d}return m}function Yp(e,o,n,r){return Co(vn(o,e.length-n),e,n,r)}function Jp(e,o,n,r){return Co(sc(o),e,n,r)}function Qp(e,o,n,r){return Co(Xt(o),e,n,r)}function ec(e,o,n,r){return Co(mc(o,e.length-n),e,n,r)}_.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 s=this.length-n;if((r===void 0||r>s)&&(r=s),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 Zp(this,o,n,r);case"utf8":case"utf-8":return Yp(this,o,n,r);case"ascii":case"latin1":case"binary":return Jp(this,o,n,r);case"base64":return Qp(this,o,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ec(this,o,n,r);default:if(m)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),m=!0}};_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function oc(e,o,n){return o===0&&n===e.length?bn.fromByteArray(e):bn.fromByteArray(e.slice(o,n))}function Ht(e,o,n){n=Math.min(e.length,n);for(var r=[],a=o;a<n;){var s=e[a],m=null,d=s>239?4:s>223?3:s>191?2:1;if(a+d<=n){var l,g,x,h;switch(d){case 1:s<128&&(m=s);break;case 2:l=e[a+1],(l&192)===128&&(h=(s&31)<<6|l&63,h>127&&(m=h));break;case 3:l=e[a+1],g=e[a+2],(l&192)===128&&(g&192)===128&&(h=(s&15)<<12|(l&63)<<6|g&63,h>2047&&(h<55296||h>57343)&&(m=h));break;case 4:l=e[a+1],g=e[a+2],x=e[a+3],(l&192)===128&&(g&192)===128&&(x&192)===128&&(h=(s&15)<<18|(l&63)<<12|(g&63)<<6|x&63,h>65535&&h<1114112&&(m=h))}}m===null?(m=65533,d=1):m>65535&&(m-=65536,r.push(m>>>10&1023|55296),m=56320|m&1023),r.push(m),a+=d}return nc(r)}var $t=4096;function nc(e){var o=e.length;if(o<=$t)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<o;)n+=String.fromCharCode.apply(String,e.slice(r,r+=$t));return n}function tc(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 rc(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 ac(e,o,n){var r=e.length;(!o||o<0)&&(o=0),(!n||n<0||n>r)&&(n=r);for(var a="",s=o;s<n;++s)a+=_c[e[s]];return a}function ic(e,o,n){for(var r=e.slice(o,n),a="",s=0;s<r.length-1;s+=2)a+=String.fromCharCode(r[s]+r[s+1]*256);return a}_.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,_.prototype),a};function D(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")}_.prototype.readUintLE=_.prototype.readUIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||D(o,n,this.length);for(var a=this[o],s=1,m=0;++m<n&&(s*=256);)a+=this[o+m]*s;return a};_.prototype.readUintBE=_.prototype.readUIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||D(o,n,this.length);for(var a=this[o+--n],s=1;n>0&&(s*=256);)a+=this[o+--n]*s;return a};_.prototype.readUint8=_.prototype.readUInt8=function(o,n){return o=o>>>0,n||D(o,1,this.length),this[o]};_.prototype.readUint16LE=_.prototype.readUInt16LE=function(o,n){return o=o>>>0,n||D(o,2,this.length),this[o]|this[o+1]<<8};_.prototype.readUint16BE=_.prototype.readUInt16BE=function(o,n){return o=o>>>0,n||D(o,2,this.length),this[o]<<8|this[o+1]};_.prototype.readUint32LE=_.prototype.readUInt32LE=function(o,n){return o=o>>>0,n||D(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216};_.prototype.readUint32BE=_.prototype.readUInt32BE=function(o,n){return o=o>>>0,n||D(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])};_.prototype.readIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||D(o,n,this.length);for(var a=this[o],s=1,m=0;++m<n&&(s*=256);)a+=this[o+m]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*n)),a};_.prototype.readIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||D(o,n,this.length);for(var a=n,s=1,m=this[o+--a];a>0&&(s*=256);)m+=this[o+--a]*s;return s*=128,m>=s&&(m-=Math.pow(2,8*n)),m};_.prototype.readInt8=function(o,n){return o=o>>>0,n||D(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]};_.prototype.readInt16LE=function(o,n){o=o>>>0,n||D(o,2,this.length);var r=this[o]|this[o+1]<<8;return r&32768?r|4294901760:r};_.prototype.readInt16BE=function(o,n){o=o>>>0,n||D(o,2,this.length);var r=this[o+1]|this[o]<<8;return r&32768?r|4294901760:r};_.prototype.readInt32LE=function(o,n){return o=o>>>0,n||D(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24};_.prototype.readInt32BE=function(o,n){return o=o>>>0,n||D(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]};_.prototype.readFloatLE=function(o,n){return o=o>>>0,n||D(o,4,this.length),Le.read(this,o,!0,23,4)};_.prototype.readFloatBE=function(o,n){return o=o>>>0,n||D(o,4,this.length),Le.read(this,o,!1,23,4)};_.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||D(o,8,this.length),Le.read(this,o,!0,52,8)};_.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||D(o,8,this.length),Le.read(this,o,!1,52,8)};function M(e,o,n,r,a,s){if(!_.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>a||o<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}_.prototype.writeUintLE=_.prototype.writeUIntLE=function(o,n,r,a){if(o=+o,n=n>>>0,r=r>>>0,!a){var s=Math.pow(2,8*r)-1;M(this,o,n,r,s,0)}var m=1,d=0;for(this[n]=o&255;++d<r&&(m*=256);)this[n+d]=o/m&255;return n+r};_.prototype.writeUintBE=_.prototype.writeUIntBE=function(o,n,r,a){if(o=+o,n=n>>>0,r=r>>>0,!a){var s=Math.pow(2,8*r)-1;M(this,o,n,r,s,0)}var m=r-1,d=1;for(this[n+m]=o&255;--m>=0&&(d*=256);)this[n+m]=o/d&255;return n+r};_.prototype.writeUint8=_.prototype.writeUInt8=function(o,n,r){return o=+o,n=n>>>0,r||M(this,o,n,1,255,0),this[n]=o&255,n+1};_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||M(this,o,n,2,65535,0),this[n]=o&255,this[n+1]=o>>>8,n+2};_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||M(this,o,n,2,65535,0),this[n]=o>>>8,this[n+1]=o&255,n+2};_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||M(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};_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||M(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};_.prototype.writeIntLE=function(o,n,r,a){if(o=+o,n=n>>>0,!a){var s=Math.pow(2,8*r-1);M(this,o,n,r,s-1,-s)}var m=0,d=1,l=0;for(this[n]=o&255;++m<r&&(d*=256);)o<0&&l===0&&this[n+m-1]!==0&&(l=1),this[n+m]=(o/d>>0)-l&255;return n+r};_.prototype.writeIntBE=function(o,n,r,a){if(o=+o,n=n>>>0,!a){var s=Math.pow(2,8*r-1);M(this,o,n,r,s-1,-s)}var m=r-1,d=1,l=0;for(this[n+m]=o&255;--m>=0&&(d*=256);)o<0&&l===0&&this[n+m+1]!==0&&(l=1),this[n+m]=(o/d>>0)-l&255;return n+r};_.prototype.writeInt8=function(o,n,r){return o=+o,n=n>>>0,r||M(this,o,n,1,127,-128),o<0&&(o=255+o+1),this[n]=o&255,n+1};_.prototype.writeInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||M(this,o,n,2,32767,-32768),this[n]=o&255,this[n+1]=o>>>8,n+2};_.prototype.writeInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||M(this,o,n,2,32767,-32768),this[n]=o>>>8,this[n+1]=o&255,n+2};_.prototype.writeInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||M(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};_.prototype.writeInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||M(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 jt(e,o,n,r,a,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function qt(e,o,n,r,a){return o=+o,n=n>>>0,a||jt(e,o,n,4,34028234663852886e22,-34028234663852886e22),Le.write(e,o,n,r,23,4),n+4}_.prototype.writeFloatLE=function(o,n,r){return qt(this,o,n,!0,r)};_.prototype.writeFloatBE=function(o,n,r){return qt(this,o,n,!1,r)};function Kt(e,o,n,r,a){return o=+o,n=n>>>0,a||jt(e,o,n,8,17976931348623157e292,-17976931348623157e292),Le.write(e,o,n,r,52,8),n+8}_.prototype.writeDoubleLE=function(o,n,r){return Kt(this,o,n,!0,r)};_.prototype.writeDoubleBE=function(o,n,r){return Kt(this,o,n,!1,r)};_.prototype.copy=function(o,n,r,a){if(!_.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 s=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),s};_.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"&&!_.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(o.length===1){var s=o.charCodeAt(0);(a==="utf8"&&s<128||a==="latin1")&&(o=s)}}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:_.from(o,a),l=d.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]=d[m%l]}return this};var pc=/[^+/0-9A-Za-z-_]/g;function cc(e){if(e=e.split("=")[0],e=e.trim().replace(pc,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function vn(e,o){o=o||1/0;for(var n,r=e.length,a=null,s=[],m=0;m<r;++m){if(n=e.charCodeAt(m),n>55295&&n<57344){if(!a){if(n>56319){(o-=3)>-1&&s.push(239,191,189);continue}else if(m+1===r){(o-=3)>-1&&s.push(239,191,189);continue}a=n;continue}if(n<56320){(o-=3)>-1&&s.push(239,191,189),a=n;continue}n=(a-55296<<10|n-56320)+65536}else a&&(o-=3)>-1&&s.push(239,191,189);if(a=null,n<128){if((o-=1)<0)break;s.push(n)}else if(n<2048){if((o-=2)<0)break;s.push(n>>6|192,n&63|128)}else if(n<65536){if((o-=3)<0)break;s.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((o-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return s}function sc(e){for(var o=[],n=0;n<e.length;++n)o.push(e.charCodeAt(n)&255);return o}function mc(e,o){for(var n,r,a,s=[],m=0;m<e.length&&!((o-=2)<0);++m)n=e.charCodeAt(m),r=n>>8,a=n%256,s.push(a),s.push(r);return s}function Xt(e){return bn.toByteArray(cc(e))}function Co(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 X(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function In(e){return e!==e}var _c=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 or=Io((km,er)=>{t();var E=er.exports={},Z,Y;function En(){throw new Error("setTimeout has not been defined")}function Nn(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Z=setTimeout:Z=En}catch(e){Z=En}try{typeof clearTimeout=="function"?Y=clearTimeout:Y=Nn}catch(e){Y=Nn}})();function Yt(e){if(Z===setTimeout)return setTimeout(e,0);if((Z===En||!Z)&&setTimeout)return Z=setTimeout,setTimeout(e,0);try{return Z(e,0)}catch(o){try{return Z.call(null,e,0)}catch(n){return Z.call(this,e,0)}}}function dc(e){if(Y===clearTimeout)return clearTimeout(e);if((Y===Nn||!Y)&&clearTimeout)return Y=clearTimeout,clearTimeout(e);try{return Y(e)}catch(o){try{return Y.call(null,e)}catch(n){return Y.call(this,e)}}}var pe=[],Fe=!1,ke,Do=-1;function lc(){!Fe||!ke||(Fe=!1,ke.length?pe=ke.concat(pe):Do=-1,pe.length&&Jt())}function Jt(){if(!Fe){var e=Yt(lc);Fe=!0;for(var o=pe.length;o;){for(ke=pe,pe=[];++Do<o;)ke&&ke[Do].run();Do=-1,o=pe.length}ke=null,Fe=!1,dc(e)}}E.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];pe.push(new Qt(e,o)),pe.length===1&&!Fe&&Yt(Jt)};function Qt(e,o){this.fun=e,this.array=o}Qt.prototype.run=function(){this.fun.apply(null,this.array)};E.title="browser";E.browser=!0;E.env={};E.argv=[];E.version="";E.versions={};function ce(){}E.on=ce;E.addListener=ce;E.once=ce;E.off=ce;E.removeListener=ce;E.removeAllListeners=ce;E.emit=ce;E.prependListener=ce;E.prependOnceListener=ce;E.listeners=function(e){return[]};E.binding=function(e){throw new Error("process.binding is not supported")};E.cwd=function(){return"/"};E.chdir=function(e){throw new Error("process.chdir is not supported")};E.umask=function(){return 0}});var i,p,Am,t=b(()=>{i=u(Zt()),p=u(or()),Am=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 Lo,Cn=b(()=>{"use strict";t();Lo=()=>Date.now()/1e3});var nr=b(()=>{"use strict";t()});var tr=b(()=>{"use strict";t()});var Dn=b(()=>{"use strict";t();Cn();nr();tr()});var Pn={};we(Pn,{getItem:()=>gc,localStorageKeys:()=>ge,removeItem:()=>fc,setItem:()=>uc});var ge,Ln,uc,gc,fc,Re=b(()=>{"use strict";t();Dn();ge={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Ln=typeof localStorage!="undefined",uc=({key:e,data:o,expires:n})=>{!Ln||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},gc=e=>{if(!Ln)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:Lo()>=n.expires?(localStorage.removeItem(String(e)),null):n.data},fc=e=>{!Ln||localStorage.removeItem(String(e))}});var Fn={};we(Fn,{clear:()=>pr,getItem:()=>ar,removeItem:()=>ir,setItem:()=>rr,storage:()=>hc});var rr,ar,ir,pr,hc,cr=b(()=>{"use strict";t();rr=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},ar=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},ir=e=>sessionStorage.removeItem(String(e)),pr=()=>sessionStorage.clear(),hc={setItem:rr,getItem:ar,removeItem:ir,clear:pr}});var Ae,Me=b(()=>{"use strict";t();Re();cr();Ae={session:Fn,local:Pn}});function eo(){return new Date().setHours(new Date().getHours()+24)}function oo(e){Ae.local.setItem({key:ge.loginExpiresAt,data:e,expires:e})}var Rn=b(()=>{"use strict";t();Me();Re()});var O=b(()=>{"use strict";t()});var sr,mr=b(()=>{"use strict";t();sr="Undefined transaction status"});var _r=b(()=>{"use strict";t()});var Mn,F=b(()=>{"use strict";t();Mn=(r=>(r.nft="nft",r.esdt="esdt",r.egld="egld",r))(Mn||{})});var dr=b(()=>{"use strict";t()});var lr=b(()=>{"use strict";t()});var ur=b(()=>{"use strict";t()});var gr=b(()=>{"use strict";t()});var J=b(()=>{"use strict";t();_r();F();O();dr();lr();ur();gr()});var no,fr,e_,hr,o_,xr,yr,n_,xc,to=b(()=>{"use strict";t();J();no={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:fr,egldLabel:e_}=no["devnet"],{chainId:hr,egldLabel:o_}=no["testnet"],{chainId:xr,egldLabel:yr}=no["mainnet"],n_={["devnet"]:fr,["testnet"]:hr,["mainnet"]:xr},xc={[fr]:"devnet",[hr]:"testnet",[xr]:"mainnet"}});var On=b(()=>{"use strict";t()});var Tr=b(()=>{"use strict";t()});var br,Bn=b(()=>{"use strict";t();br="transaction-status-toast-id"});var Un,$n,P,Oe,wr,Po,Sr,Q,k=b(()=>{"use strict";t();mr();to();On();Tr();Bn();Un=5e4,$n=1e9,P=18,Oe=4,wr=1,Po="logout",Sr="login",Q="0"});var Wn,R,ro,ee=b(()=>{"use strict";t();Wn=require("@reduxjs/toolkit");k();R=(0,Wn.createAction)(Po),ro=(0,Wn.createAction)(Sr,e=>({payload:e}))});var kr,vr,Ar,T_,b_,w_,S_,v_,k_,Ir,Er,Vn=b(()=>{"use strict";t();kr=require("@reduxjs/toolkit");Rn();O();ee();vr={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Ar=(0,kr.createSlice)({name:"loginInfoSlice",initialState:vr,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(R,()=>vr),e.addCase(ro,(o,n)=>{o.loginMethod=n.payload.loginMethod,oo(eo())})}}),{setLoginMethod:T_,setWalletConnectLogin:b_,setLedgerLogin:w_,setTokenLogin:S_,setTokenLoginSignature:v_,setWalletLogin:k_,invalidateLoginSession:Ir}=Ar.actions,Er=Ar.reducer});var Fo=b(()=>{"use strict";t()});var Nr=b(()=>{"use strict";t();Fo()});function zn(e){return e[Math.floor(Math.random()*e.length)]}var Cr=b(()=>{"use strict";t()});var Dr=b(()=>{"use strict";t();On()});var Lr=b(()=>{"use strict";t();Nr();Cr();Dr()});var Pr,Fr,Gn,Tc,Rr,$_,W_,Mr,Hn=b(()=>{"use strict";t();Pr=require("@reduxjs/toolkit"),Fr=u(require("lodash.omit"));Lr();Gn={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Tc={network:Gn,chainID:"-1"},Rr=(0,Pr.createSlice)({name:"appConfig",initialState:Tc,reducers:{initializeNetworkConfig:(e,o)=>{let n=zn(o.payload.walletConnectBridgeAddresses),r=zn(o.payload.walletConnectV2RelayAddresses),a=(0,Fr.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:$_,setChainID:W_}=Rr.actions,Mr=Rr.reducer});var qn,Or,Br,Ro,jn,Ur,Kn,X_,Xn,Z_,Y_,J_,Q_,ed,od,nd,$r,Zn=b(()=>{"use strict";t();qn=require("@elrondnetwork/erdjs"),Or=require("@reduxjs/toolkit"),Br=require("redux-persist");k();Me();Re();ee();Ro={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Q},jn={address:"",websocketEvent:null,accounts:{"":Ro},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Ur=(0,Or.createSlice)({name:"accountInfoSlice",initialState:jn,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new qn.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:Ro},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(R,()=>(Ae.local.removeItem(ge.loginExpiresAt),jn)),e.addCase(ro,(o,n)=>{let{address:r}=n.payload;o.address=r,o.publicKey=new qn.Address(r).hex()}),e.addCase(Br.REHYDRATE,(o,n)=>{var g;if(!((g=n.payload)!=null&&g.account))return;let{account:r}=n.payload,{address:a,shard:s,accounts:m,publicKey:d}=r;o.address=a,o.shard=s;let l=m&&a in m;o.accounts=l?m:jn.accounts,o.publicKey=d})}}),{setAccount:Kn,setAddress:X_,setAccountNonce:Xn,setAccountShard:Z_,setLedgerAccount:Y_,updateLedgerAccount:J_,setWalletConnectAccount:Q_,setIsAccountLoading:ed,setAccountLoadingError:od,setWebsocketEvent:nd}=Ur.actions,$r=Ur.reducer});function Wr(e){return e!=null&&(Nc(e)||Bo(e))}function Mo(e){return e!=null&&(Cc(e)||Pc(e))}function Oo(e){return e!=null&&(Dc(e)||Fc(e))}function Vr(e){return e!=null&&Lc(e)}function Nc(e){return e!=null&&wc.includes(e)}function Cc(e){return e!=null&&Sc.includes(e)}function Dc(e){return e!=null&&vc.includes(e)}function Lc(e){return e!=null&&kc.includes(e)}function Bo(e){return e!=null&&Ac.includes(e)}function Pc(e){return e!=null&&Ic.includes(e)}function Fc(e){return e!=null&&Ec.includes(e)}var wc,Sc,vc,kc,Ac,Ic,Ec,io=b(()=>{"use strict";t();O();wc=["sent"],Sc=["success"],vc=["fail","cancelled","timedOut"],kc=["timedOut"],Ac=["pending"],Ic=["success"],Ec=["fail","invalid"]});var zr,Gr,po,Rc,Hr,_d,dd,ld,ud,gd,fd,hd,xd,yd,Td,Uo,$o=b(()=>{"use strict";t();zr=require("@reduxjs/toolkit"),Gr=require("redux-persist");O();io();ee();po={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Rc={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Hr=(0,zr.createSlice)({name:"transactionsSlice",initialState:po,reducers:{moveTransactionsToSignedState:(e,o)=>{var l,g;let{sessionId:n,transactions:r,errorMessage:a,status:s,redirectRoute:m}=o.payload,d=((l=e.customTransactionInformationForSessionId)==null?void 0:l[n])||Rc;e.signedTransactions[n]={transactions:r,status:s,errorMessage:a,redirectRoute:m,customTransactionInformation:d},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===n&&(e.transactionsToSign=po.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:s}=o.payload;e.signedTransactions[n]!=null&&(e.signedTransactions[n].status=r,a!=null&&(e.signedTransactions[n].errorMessage=a),s!=null&&(e.signedTransactions[n].transactions=s))},updateSignedTransactionStatus:(e,o)=>{var d,l,g,x,h,w;let{sessionId:n,status:r,errorMessage:a,transactionHash:s}=o.payload,m=(l=(d=e.signedTransactions)==null?void 0:d[n])==null?void 0:l.transactions;if(m!=null){e.signedTransactions[n].transactions=m.map(L=>L.hash===s?S(f({},L),{status:r,errorMessage:a}):L);let v=(x=(g=e.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:x.every(L=>Mo(L.status)),C=(w=(h=e.signedTransactions[n])==null?void 0:h.transactions)==null?void 0:w.every(L=>Oo(L.status));v&&(e.signedTransactions[n].status="success"),C&&(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=po.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=po.signedTransactions},setSignTransactionsError:(e,o)=>{e.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(e,o)=>{e.signTransactionsCancelMessage=o.payload}},extraReducers:e=>{e.addCase(R,()=>po),e.addCase(Gr.REHYDRATE,(o,n)=>{var m;if(o.signTransactionsCancelMessage=null,!((m=n.payload)!=null&&m.transactions))return;let{signedTransactions:r,customTransactionInformationForSessionId:a}=n.payload.transactions,s=Object.entries(r).reduce((d,[l,g])=>{let x=new Date(l),h=new Date;return h.setHours(h.getHours()+5),h-x>0||(d[l]=g),d},{});a!=null&&(o.customTransactionInformationForSessionId=a),r!=null&&(o.signedTransactions=s)})}}),{updateSignedTransactionStatus:_d,updateSignedTransactions:dd,setTransactionsToSign:ld,clearAllTransactionsToSign:ud,clearAllSignedTransactions:gd,clearSignedTransaction:fd,clearTransactionToSign:hd,setSignTransactionsError:xd,setSignTransactionsCancelMessage:yd,moveTransactionsToSignedState:Td}=Hr.actions,Uo=Hr.reducer});var jr,Qn,et,ot,Mc,Jn,qr,vd,kd,Ad,Wo,Vo=b(()=>{"use strict";t();jr=require("@reduxjs/toolkit");ee();Qn="Transaction failed",et="Transaction successful",ot="Processing transaction",Mc="Transaction submitted",Jn={},qr=(0,jr.createSlice)({name:"transactionsInfo",initialState:Jn,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:r}=o.payload;n!=null&&(e[n]={errorMessage:(r==null?void 0:r.errorMessage)||Qn,successMessage:(r==null?void 0:r.successMessage)||et,processingMessage:(r==null?void 0:r.processingMessage)||ot,submittedMessage:(r==null?void 0:r.submittedMessage)||Mc,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(e,o){o.payload!=null&&delete e[o.payload]},clearTransactionsInfo:()=>Jn},extraReducers:e=>{e.addCase(R,()=>Jn)}}),{clearTransactionsInfo:vd,setTransactionsDisplayInfo:kd,clearTransactionsInfoForSessionId:Ad}=qr.actions,Wo=qr.reducer});var Xr,Kr,Zr,Cd,Dd,Ld,Pd,Yr,nt=b(()=>{"use strict";t();Xr=require("@reduxjs/toolkit");ee();Kr={},Zr=(0,Xr.createSlice)({name:"modalsSlice",initialState:Kr,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(R,()=>Kr)}}),{setTxSubmittedModal:Cd,setNotificationModal:Dd,clearTxSubmittedModal:Ld,clearNotificationModal:Pd}=Zr.actions,Yr=Zr.reducer});var Qr,ea,Jr,oa,Oc,Bc,Wd,Vd,na,ta,zo,Go=b(()=>{"use strict";t();Qr=require("@reduxjs/toolkit"),ea=require("redux-persist");Bn();J();Cn();ee();Jr={customToasts:[],transactionToasts:[],failTransactionToast:null},oa=(0,Qr.createSlice)({name:"toastsSlice",initialState:Jr,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:Lo(),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:br})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(R,()=>Jr),e.addCase(ea.REHYDRATE,(o,n)=>{var a,s;let r=(s=(a=n.customToasts)==null?void 0:a.filter(m=>!("component"in m)))!=null?s:[];o.customToasts=r})}}),{addCustomToast:Oc,removeCustomToast:Bc,addTransactionToast:Wd,removeTransactionToast:Vd,addFailTransactionToast:na,removeFailTransactionToast:ta}=oa.actions,zo=oa.reducer});var oe=b(()=>{"use strict";t();Vn();Hn();Zn();$o();Vo();nt();Go()});var tt=b(()=>{"use strict";t()});var pa,ia,ca,cl,sl,ml,_l,dl,ll,sa,ma=b(()=>{"use strict";t();pa=require("@reduxjs/toolkit");ee();ia={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},ca=(0,pa.createSlice)({name:"dappModalsSlice",initialState:ia,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(R,()=>ia)}}),{setDappModalVisibility:cl,setDappModalHeaderVisibility:sl,setDappModalFooterVisibility:ml,setDappModalHeaderText:_l,setDappModalFooterText:dl,setDappModalConfig:ll}=ca.actions,sa=ca.reducer});var _a,Vc,zc,Be,jo=b(()=>{"use strict";t();_a=require("@reduxjs/toolkit");tt();Zn();ma();Vn();nt();Hn();Go();Vo();$o();Vc={["account"]:$r,["networkConfig"]:Mr,["loginInfo"]:Er,["modals"]:Yr,["dappModal"]:sa,["toasts"]:zo,["transactions"]:Uo,["transactionsInfo"]:Wo},zc=(e={})=>(0,_a.combineReducers)(f(f({},Vc),e)),Be=zc});var ua={};we(ua,{default:()=>Zc});function rt(e,o=[]){return{key:e,version:1,storage:la.default,blacklist:o}}var Ie,da,la,Gc,Hc,jc,qc,Kc,Xc,Zc,ga=b(()=>{"use strict";t();Ie=require("redux-persist"),da=u(require("redux-persist/lib/storage")),la=u(require("redux-persist/lib/storage/session"));jo();oe();Go();Vo();$o();tt();Gc={2:e=>S(f({},e),{networkConfig:Gn})};Hc=rt("dapp-core-transactionsInfo"),jc=rt("dapp-core-transactions",["transactionsToSign"]),qc=rt("dapp-core-toasts"),Kc={key:"dapp-core-store",version:2,storage:da.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,Ie.createMigrate)(Gc,{debug:!1})},Xc={["toasts"]:(0,Ie.persistReducer)(qc,zo),["transactions"]:(0,Ie.persistReducer)(jc,Uo),["transactionsInfo"]:(0,Ie.persistReducer)(Hc,Wo)},Zc=(0,Ie.persistReducer)(Kc,Be(Xc))});var fa={};we(fa,{default:()=>Yc});var Yc,ha=b(()=>{"use strict";t();jo();Yc=Be()});var xa={};we(xa,{default:()=>Qc});var W,Jc,Qc,ya=b(()=>{"use strict";t();W=require("redux-persist"),Jc=[W.FLUSH,W.REHYDRATE,W.PAUSE,W.PERSIST,W.PURGE,W.REGISTER],Qc=Jc});var wa={};we(wa,{default:()=>ba});function ba(e){return(0,Ta.persistStore)(e)}var Ta,Sa=b(()=>{"use strict";t();Ta=require("redux-persist")});var ym={};we(ym,{TransactionStatusToast:()=>xm});module.exports=Qe(ym);t();var wo=u(require("react"));t();var bo=u(require("react")),Ap=u(require("classnames"));t();var Na=require("react"),Ue=require("react-redux");t();var at=require("@reduxjs/toolkit"),Ia=require("react-redux/es/utils/Subscription");oe();t();var ra=u(require("lodash.throttle"));k();oe();Rn();Me();Re();var Uc=[Po],$c=(0,ra.default)(()=>{oo(eo())},5e3),aa=e=>o=>n=>{var l;if(Uc.includes(n.type))return o(n);let r=e.getState(),a=Ae.local.getItem(ge.loginExpiresAt);if(!((l=r==null?void 0:r.loginInfo)==null?void 0:l.isLoggedIn))return o(n);if(a==null)return oo(eo());let m=Date.now();return a-m<0?setTimeout(()=>I(void 0,null,function*(){console.log("session expired");try{e.dispatch(Ir())}catch(g){console.error("error logging out",g)}}),1e3):($c(),o(n))};t();t();function Ho(){return typeof sessionStorage!="undefined"}var va=Ho()?(ga(),Qe(ua)).default:(ha(),Qe(fa)).default,ka=Ho()?(ya(),Qe(xa)).default:[],Aa=Ho()?(Sa(),Qe(wa)).default:e=>e;jo();var A=(0,at.configureStore)({reducer:va,middleware:e=>e({serializableCheck:{ignoredActions:[...ka,Xn.type,Kn.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(aa)}),Ea=(0,Ia.createSubscription)(A),Bl=Aa(A),Ul=(0,at.configureStore)({reducer:Be});var es={store:A,subscription:Ea},it=(0,Na.createContext)(es),zl=(0,Ue.createStoreHook)(it),Ca=(0,Ue.createDispatchHook)(it),$e=(0,Ue.createSelectorHook)(it);t();t();oe();t();var Da=u(require("lodash.isequal")),qo=require("reselect"),y=(0,qo.createSelectorCreator)(qo.defaultMemoize,Da.default);var se=e=>e.account,Ko=y(se,e=>e.address),We=y(se,Ko,(e,o)=>o in e.accounts?e.accounts[o]:Ro),Kl=y(se,We,(e,o)=>{let a=e,{accounts:n}=a,r=be(a,["accounts"]);return S(f({},r),{account:o})}),Xl=y(We,e=>e.balance),os=y(We,e=>{var o;return((o=e==null?void 0:e.nonce)==null?void 0:o.valueOf())||0}),Zl=y(se,e=>e.shard),Yl=y(se,e=>e.ledgerAccount),Jl=y(se,e=>e.walletConnectAccount),Ql=y(se,e=>e.isAccountLoading),eu=y(se,e=>e.accountLoadingError),ou=y(se,e=>e.websocketEvent);t();var me=e=>e.networkConfig,ns=y(me,e=>e.chainID),ru=y(me,e=>e.network.walletConnectBridgeAddress),au=y(me,e=>e.network.walletConnectV2RelayAddress),iu=y(me,e=>e.network.walletConnectV2ProjectId),pu=y(me,e=>e.network.walletConnectDeepLink),co=y(me,e=>e.network),La=y(co,e=>e.apiAddress),Pa=y(co,e=>e.explorerAddress),ts=y(co,e=>e.egldLabel);t();O();var Ve=e=>e.loginInfo,du=y(Ve,e=>e.loginMethod),Fa=y(Ve,Ko,(e,o)=>e.loginMethod!=""&&Boolean(o)),lu=y(Ve,e=>e.walletConnectLogin),uu=y(Ve,e=>e.ledgerLogin),rs=y(Ve,e=>e.walletLogin),gu=y(Ve,e=>e.isLoginSessionInvalid);t();t();var B=require("@elrondnetwork/erdjs");k();t();function Xo(e){try{return i.Buffer.from(e,"base64").toString()===atob(e)}catch(o){return!1}}function Ra(e){return atob(e)}function so(e){var a,s,m;let{data:o}=e,n=Xo(o!=null?o:"")?B.TransactionPayload.fromEncoded(o):new B.TransactionPayload(o),r=new B.Transaction(f({value:e.value.valueOf(),data:n,nonce:e.nonce.valueOf(),receiver:new B.Address(e.receiver),sender:new B.Address(e.sender),gasLimit:(a=e.gasLimit.valueOf())!=null?a:Un,gasPrice:(s=e.gasPrice.valueOf())!=null?s:$n,chainID:e.chainID.valueOf(),version:new B.TransactionVersion((m=e.version)!=null?m:wr)},e.options?{options:new B.TransactionOptions(e.options)}:{}));return r.applySignature({hex:()=>e.signature||""},new B.Address(e.sender)),r}t();io();t();var as=u(require("bignumber.js"));J();t();t();function pt(e){for(let o=0;o<e.length;o++)if(e.charCodeAt(o)>127)return!1;return!0}function Zo(e){let o=e;try{let n=i.Buffer.from(e,"hex").toString();pt(n)&&n.length>1&&(o=n)}catch(n){}return o}t();t();var st=require("@elrondnetwork/erdjs"),mt=u(require("bignumber.js"));O();t();var Oa=require("@elrondnetwork/erdjs");function is(e){try{let o=new Oa.Address(e);return Boolean(o.bech32())}catch(o){return!1}}function ze(e){return(e==null?void 0:e.startsWith("erd"))&&e.length===62&&/^\w+$/.test(e)&&is(e)}var ct={tokenId:"",amount:""},ps=e=>e.split("@").map((s,m)=>[2,3].includes(m)?s:Zo(s));function Ba(e){if(!e)return ct;let o=e.startsWith("ESDTTransfer"),n=e.startsWith("ESDTNFTTransfer")&&e.includes("@");if(o){let[,r,a]=e.split("@");try{let s=i.Buffer.from(r,"hex").toString("ascii");if(!s)return ct;let m=new mt.default("0x"+a.replace("0x","")).toString(10);return{tokenId:s,amount:m}}catch(s){console.error("Error getting token from transaction data",s)}}if(n)try{let[,r,a,s,m]=ps(e);if([r,a,s,m].every(d=>Boolean(d))&&ze(new st.Address(m).bech32()))return{tokenId:`${r}-${a}`,amount:new mt.default(s,16).toString(10),collection:r,nonce:a,receiver:new st.Address(m).bech32()}}catch(r){}return ct}t();t();t();var ss=require("@elrondnetwork/erdjs/out");t();k();t();var mo=require("@elrondnetwork/erdjs");J();var ms=["ESDTNFTTransfer","ESDTNFTBurn","ESDTNFTAddQuantity","ESDTNFTCreate","MultiESDTNFTTransfer","ESDTTransfer","ESDTBurn","ESDTLocalMint","ESDTLocalBurn","ESDTWipe","ESDT