@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 207 kB
JavaScript
"use strict";var Vs=Object.create;var yo=Object.defineProperty,$s=Object.defineProperties,Hs=Object.getOwnPropertyDescriptor,zs=Object.getOwnPropertyDescriptors,js=Object.getOwnPropertyNames,Yo=Object.getOwnPropertySymbols,qs=Object.getPrototypeOf,Zn=Object.prototype.hasOwnProperty,vr=Object.prototype.propertyIsEnumerable;var Sr=(e,o,n)=>o in e?yo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,g=(e,o)=>{for(var n in o||(o={}))Zn.call(o,n)&&Sr(e,n,o[n]);if(Yo)for(var n of Yo(o))vr.call(o,n)&&Sr(e,n,o[n]);return e},w=(e,o)=>$s(e,zs(o));var Ne=(e,o)=>{var n={};for(var r in e)Zn.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Yo)for(var r of Yo(e))o.indexOf(r)<0&&vr.call(e,r)&&(n[r]=e[r]);return n};var b=(e,o)=>()=>(e&&(o=e(e=0)),o);var Jo=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),De=(e,o)=>{for(var n in o)yo(e,n,{get:o[n],enumerable:!0})},kr=(e,o,n,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of js(o))!Zn.call(e,a)&&a!==n&&yo(e,a,{get:()=>o[a],enumerable:!(r=Hs(o,a))||r.enumerable});return e};var u=(e,o,n)=>(n=e!=null?Vs(qs(e)):{},kr(o||!e||!e.__esModule?yo(n,"default",{value:e,enumerable:!0}):n,e)),xo=e=>kr(yo({},"__esModule",{value:!0}),e);var S=(e,o,n)=>new Promise((r,a)=>{var p=d=>{try{l(n.next(d))}catch(f){a(f)}},m=d=>{try{l(n.throw(d))}catch(f){a(f)}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(p,m);l((n=n.apply(e,o)).next())});var Er=Jo(Qo=>{"use strict";t();Qo.byteLength=Xs;Qo.toByteArray=Ys;Qo.fromByteArray=ep;var re=[],j=[],Ks=typeof Uint8Array!="undefined"?Uint8Array:Array,Yn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Pe=0,Ir=Yn.length;Pe<Ir;++Pe)re[Pe]=Yn[Pe],j[Yn.charCodeAt(Pe)]=Pe;var Pe,Ir;j["-".charCodeAt(0)]=62;j["_".charCodeAt(0)]=63;function Ar(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 Xs(e){var o=Ar(e),n=o[0],r=o[1];return(n+r)*3/4-r}function Zs(e,o,n){return(o+n)*3/4-n}function Ys(e){var o,n=Ar(e),r=n[0],a=n[1],p=new Ks(Zs(e,r,a)),m=0,l=a>0?r-4:r,d;for(d=0;d<l;d+=4)o=j[e.charCodeAt(d)]<<18|j[e.charCodeAt(d+1)]<<12|j[e.charCodeAt(d+2)]<<6|j[e.charCodeAt(d+3)],p[m++]=o>>16&255,p[m++]=o>>8&255,p[m++]=o&255;return a===2&&(o=j[e.charCodeAt(d)]<<2|j[e.charCodeAt(d+1)]>>4,p[m++]=o&255),a===1&&(o=j[e.charCodeAt(d)]<<10|j[e.charCodeAt(d+1)]<<4|j[e.charCodeAt(d+2)]>>2,p[m++]=o>>8&255,p[m++]=o&255),p}function Js(e){return re[e>>18&63]+re[e>>12&63]+re[e>>6&63]+re[e&63]}function Qs(e,o,n){for(var r,a=[],p=o;p<n;p+=3)r=(e[p]<<16&16711680)+(e[p+1]<<8&65280)+(e[p+2]&255),a.push(Js(r));return a.join("")}function ep(e){for(var o,n=e.length,r=n%3,a=[],p=16383,m=0,l=n-r;m<l;m+=p)a.push(Qs(e,m,m+p>l?l:m+p));return r===1?(o=e[n-1],a.push(re[o>>2]+re[o<<4&63]+"==")):r===2&&(o=(e[n-2]<<8)+e[n-1],a.push(re[o>>10]+re[o>>4&63]+re[o<<2&63]+"=")),a.join("")}});var Lr=Jo(Jn=>{t();Jn.read=function(e,o,n,r,a){var p,m,l=a*8-r-1,d=(1<<l)-1,f=d>>1,T=-7,h=n?a-1:0,v=n?-1:1,I=e[o+h];for(h+=v,p=I&(1<<-T)-1,I>>=-T,T+=l;T>0;p=p*256+e[o+h],h+=v,T-=8);for(m=p&(1<<-T)-1,p>>=-T,T+=r;T>0;m=m*256+e[o+h],h+=v,T-=8);if(p===0)p=1-f;else{if(p===d)return m?NaN:(I?-1:1)*(1/0);m=m+Math.pow(2,r),p=p-f}return(I?-1:1)*m*Math.pow(2,p-r)};Jn.write=function(e,o,n,r,a,p){var m,l,d,f=p*8-a-1,T=(1<<f)-1,h=T>>1,v=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=r?0:p-1,C=r?1:-1,N=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(l=isNaN(o)?1:0,m=T):(m=Math.floor(Math.log(o)/Math.LN2),o*(d=Math.pow(2,-m))<1&&(m--,d*=2),m+h>=1?o+=v/d:o+=v*Math.pow(2,1-h),o*d>=2&&(m++,d/=2),m+h>=T?(l=0,m=T):m+h>=1?(l=(o*d-1)*Math.pow(2,a),m=m+h):(l=o*Math.pow(2,h-1)*Math.pow(2,a),m=0));a>=8;e[n+I]=l&255,I+=C,l/=256,a-=8);for(m=m<<a|l,f+=a;f>0;e[n+I]=m&255,I+=C,m/=256,f-=8);e[n+I-C]|=N*128}});var Vr=Jo(Xe=>{"use strict";t();var Qn=Er(),Ke=Lr(),Cr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Xe.Buffer=_;Xe.SlowBuffer=ip;Xe.INSPECT_MAX_BYTES=50;var en=2147483647;Xe.kMaxLength=en;_.TYPED_ARRAY_SUPPORT=op();!_.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 op(){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 le(e){if(e>en)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 tt(e)}return Pr(e,o,n)}_.poolSize=8192;function Pr(e,o,n){if(typeof e=="string")return tp(e,o);if(ArrayBuffer.isView(e))return rp(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(ae(e,ArrayBuffer)||e&&ae(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(ae(e,SharedArrayBuffer)||e&&ae(e.buffer,SharedArrayBuffer)))return ot(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=ap(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 Pr(e,o,n)};Object.setPrototypeOf(_.prototype,Uint8Array.prototype);Object.setPrototypeOf(_,Uint8Array);function Rr(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 np(e,o,n){return Rr(e),e<=0?le(e):o!==void 0?typeof n=="string"?le(e).fill(o,n):le(e).fill(o):le(e)}_.alloc=function(e,o,n){return np(e,o,n)};function tt(e){return Rr(e),le(e<0?0:rt(e)|0)}_.allocUnsafe=function(e){return tt(e)};_.allocUnsafeSlow=function(e){return tt(e)};function tp(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!_.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=Mr(e,o)|0,r=le(n),a=r.write(e,o);return a!==n&&(r=r.slice(0,a)),r}function et(e){for(var o=e.length<0?0:rt(e.length)|0,n=le(o),r=0;r<o;r+=1)n[r]=e[r]&255;return n}function rp(e){if(ae(e,Uint8Array)){var o=new Uint8Array(e);return ot(o.buffer,o.byteOffset,o.byteLength)}return et(e)}function ot(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 ap(e){if(_.isBuffer(e)){var o=rt(e.length)|0,n=le(o);return n.length===0||e.copy(n,0,0,o),n}if(e.length!==void 0)return typeof e.length!="number"||at(e.length)?le(0):et(e);if(e.type==="Buffer"&&Array.isArray(e.data))return et(e.data)}function rt(e){if(e>=en)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+en.toString(16)+" bytes");return e|0}function ip(e){return+e!=e&&(e=0),_.alloc(+e)}_.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==_.prototype};_.compare=function(o,n){if(ae(o,Uint8Array)&&(o=_.from(o,o.offset,o.byteLength)),ae(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,p=0,m=Math.min(r,a);p<m;++p)if(o[p]!==n[p]){r=o[p],a=n[p];break}return r<a?-1:a<r?1:0};_.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),p=0;for(r=0;r<o.length;++r){var m=o[r];if(ae(m,Uint8Array))p+m.length>a.length?_.from(m).copy(a,p):Uint8Array.prototype.set.call(a,m,p);else if(_.isBuffer(m))m.copy(a,p);else throw new TypeError('"list" argument must be an Array of Buffers');p+=m.length}return a};function Mr(e,o){if(_.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ae(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 nt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Gr(e).length;default:if(a)return r?-1:nt(e).length;o=(""+o).toLowerCase(),a=!0}}_.byteLength=Mr;function cp(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 Tp(this,o,n);case"utf8":case"utf-8":return Or(this,o,n);case"ascii":return gp(this,o,n);case"latin1":case"binary":return fp(this,o,n);case"base64":return dp(this,o,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return hp(this,o,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}_.prototype._isBuffer=!0;function Re(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)Re(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)Re(this,n,n+3),Re(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)Re(this,n,n+7),Re(this,n+1,n+6),Re(this,n+2,n+5),Re(this,n+3,n+4);return this};_.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?Or(this,0,o):cp.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=Xe.INSPECT_MAX_BYTES;return o=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(o+=" ... "),"<Buffer "+o+">"};Cr&&(_.prototype[Cr]=_.prototype.inspect);_.prototype.compare=function(o,n,r,a,p){if(ae(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),p===void 0&&(p=this.length),n<0||r>o.length||a<0||p>this.length)throw new RangeError("out of range index");if(a>=p&&n>=r)return 0;if(a>=p)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,a>>>=0,p>>>=0,this===o)return 0;for(var m=p-a,l=r-n,d=Math.min(m,l),f=this.slice(a,p),T=o.slice(n,r),h=0;h<d;++h)if(f[h]!==T[h]){m=f[h],l=T[h];break}return m<l?-1:l<m?1:0};function Fr(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,at(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:Nr(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):Nr(e,[o],n,r,a);throw new TypeError("val must be string, number or Buffer")}function Nr(e,o,n,r,a){var p=1,m=e.length,l=o.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(e.length<2||o.length<2)return-1;p=2,m/=2,l/=2,n/=2}function d(I,C){return p===1?I[C]:I.readUInt16BE(C*p)}var f;if(a){var T=-1;for(f=n;f<m;f++)if(d(e,f)===d(o,T===-1?0:f-T)){if(T===-1&&(T=f),f-T+1===l)return T*p}else T!==-1&&(f-=f-T),T=-1}else for(n+l>m&&(n=m-l),f=n;f>=0;f--){for(var h=!0,v=0;v<l;v++)if(d(e,f+v)!==d(o,v)){h=!1;break}if(h)return f}return-1}_.prototype.includes=function(o,n,r){return this.indexOf(o,n,r)!==-1};_.prototype.indexOf=function(o,n,r){return Fr(this,o,n,r,!0)};_.prototype.lastIndexOf=function(o,n,r){return Fr(this,o,n,r,!1)};function sp(e,o,n,r){n=Number(n)||0;var a=e.length-n;r?(r=Number(r),r>a&&(r=a)):r=a;var p=o.length;r>p/2&&(r=p/2);for(var m=0;m<r;++m){var l=parseInt(o.substr(m*2,2),16);if(at(l))return m;e[n+m]=l}return m}function pp(e,o,n,r){return on(nt(o,e.length-n),e,n,r)}function mp(e,o,n,r){return on(bp(o),e,n,r)}function _p(e,o,n,r){return on(Gr(o),e,n,r)}function lp(e,o,n,r){return on(wp(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 p=this.length-n;if((r===void 0||r>p)&&(r=p),o.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var m=!1;;)switch(a){case"hex":return sp(this,o,n,r);case"utf8":case"utf-8":return pp(this,o,n,r);case"ascii":case"latin1":case"binary":return mp(this,o,n,r);case"base64":return _p(this,o,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lp(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 dp(e,o,n){return o===0&&n===e.length?Qn.fromByteArray(e):Qn.fromByteArray(e.slice(o,n))}function Or(e,o,n){n=Math.min(e.length,n);for(var r=[],a=o;a<n;){var p=e[a],m=null,l=p>239?4:p>223?3:p>191?2:1;if(a+l<=n){var d,f,T,h;switch(l){case 1:p<128&&(m=p);break;case 2:d=e[a+1],(d&192)===128&&(h=(p&31)<<6|d&63,h>127&&(m=h));break;case 3:d=e[a+1],f=e[a+2],(d&192)===128&&(f&192)===128&&(h=(p&15)<<12|(d&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(m=h));break;case 4:d=e[a+1],f=e[a+2],T=e[a+3],(d&192)===128&&(f&192)===128&&(T&192)===128&&(h=(p&15)<<18|(d&63)<<12|(f&63)<<6|T&63,h>65535&&h<1114112&&(m=h))}}m===null?(m=65533,l=1):m>65535&&(m-=65536,r.push(m>>>10&1023|55296),m=56320|m&1023),r.push(m),a+=l}return up(r)}var Dr=4096;function up(e){var o=e.length;if(o<=Dr)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<o;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Dr));return n}function gp(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 fp(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 Tp(e,o,n){var r=e.length;(!o||o<0)&&(o=0),(!n||n<0||n>r)&&(n=r);for(var a="",p=o;p<n;++p)a+=Sp[e[p]];return a}function hp(e,o,n){for(var r=e.slice(o,n),a="",p=0;p<r.length-1;p+=2)a+=String.fromCharCode(r[p]+r[p+1]*256);return a}_.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 M(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||M(o,n,this.length);for(var a=this[o],p=1,m=0;++m<n&&(p*=256);)a+=this[o+m]*p;return a};_.prototype.readUintBE=_.prototype.readUIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||M(o,n,this.length);for(var a=this[o+--n],p=1;n>0&&(p*=256);)a+=this[o+--n]*p;return a};_.prototype.readUint8=_.prototype.readUInt8=function(o,n){return o=o>>>0,n||M(o,1,this.length),this[o]};_.prototype.readUint16LE=_.prototype.readUInt16LE=function(o,n){return o=o>>>0,n||M(o,2,this.length),this[o]|this[o+1]<<8};_.prototype.readUint16BE=_.prototype.readUInt16BE=function(o,n){return o=o>>>0,n||M(o,2,this.length),this[o]<<8|this[o+1]};_.prototype.readUint32LE=_.prototype.readUInt32LE=function(o,n){return o=o>>>0,n||M(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||M(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||M(o,n,this.length);for(var a=this[o],p=1,m=0;++m<n&&(p*=256);)a+=this[o+m]*p;return p*=128,a>=p&&(a-=Math.pow(2,8*n)),a};_.prototype.readIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||M(o,n,this.length);for(var a=n,p=1,m=this[o+--a];a>0&&(p*=256);)m+=this[o+--a]*p;return p*=128,m>=p&&(m-=Math.pow(2,8*n)),m};_.prototype.readInt8=function(o,n){return o=o>>>0,n||M(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]};_.prototype.readInt16LE=function(o,n){o=o>>>0,n||M(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||M(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||M(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||M(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||M(o,4,this.length),Ke.read(this,o,!0,23,4)};_.prototype.readFloatBE=function(o,n){return o=o>>>0,n||M(o,4,this.length),Ke.read(this,o,!1,23,4)};_.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||M(o,8,this.length),Ke.read(this,o,!0,52,8)};_.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||M(o,8,this.length),Ke.read(this,o,!1,52,8)};function W(e,o,n,r,a,p){if(!_.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>a||o<p)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}_.prototype.writeUintLE=_.prototype.writeUIntLE=function(o,n,r,a){if(o=+o,n=n>>>0,r=r>>>0,!a){var p=Math.pow(2,8*r)-1;W(this,o,n,r,p,0)}var m=1,l=0;for(this[n]=o&255;++l<r&&(m*=256);)this[n+l]=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 p=Math.pow(2,8*r)-1;W(this,o,n,r,p,0)}var m=r-1,l=1;for(this[n+m]=o&255;--m>=0&&(l*=256);)this[n+m]=o/l&255;return n+r};_.prototype.writeUint8=_.prototype.writeUInt8=function(o,n,r){return o=+o,n=n>>>0,r||W(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||W(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||W(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||W(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||W(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 p=Math.pow(2,8*r-1);W(this,o,n,r,p-1,-p)}var m=0,l=1,d=0;for(this[n]=o&255;++m<r&&(l*=256);)o<0&&d===0&&this[n+m-1]!==0&&(d=1),this[n+m]=(o/l>>0)-d&255;return n+r};_.prototype.writeIntBE=function(o,n,r,a){if(o=+o,n=n>>>0,!a){var p=Math.pow(2,8*r-1);W(this,o,n,r,p-1,-p)}var m=r-1,l=1,d=0;for(this[n+m]=o&255;--m>=0&&(l*=256);)o<0&&d===0&&this[n+m+1]!==0&&(d=1),this[n+m]=(o/l>>0)-d&255;return n+r};_.prototype.writeInt8=function(o,n,r){return o=+o,n=n>>>0,r||W(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||W(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||W(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||W(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||W(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 Br(e,o,n,r,a,p){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Ur(e,o,n,r,a){return o=+o,n=n>>>0,a||Br(e,o,n,4,34028234663852886e22,-34028234663852886e22),Ke.write(e,o,n,r,23,4),n+4}_.prototype.writeFloatLE=function(o,n,r){return Ur(this,o,n,!0,r)};_.prototype.writeFloatBE=function(o,n,r){return Ur(this,o,n,!1,r)};function Wr(e,o,n,r,a){return o=+o,n=n>>>0,a||Br(e,o,n,8,17976931348623157e292,-17976931348623157e292),Ke.write(e,o,n,r,52,8),n+8}_.prototype.writeDoubleLE=function(o,n,r){return Wr(this,o,n,!0,r)};_.prototype.writeDoubleBE=function(o,n,r){return Wr(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 p=a-r;return this===o&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,r,a):Uint8Array.prototype.set.call(o,this.subarray(r,a),n),p};_.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 p=o.charCodeAt(0);(a==="utf8"&&p<128||a==="latin1")&&(o=p)}}else typeof o=="number"?o=o&255:typeof o=="boolean"&&(o=Number(o));if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;n=n>>>0,r=r===void 0?this.length:r>>>0,o||(o=0);var m;if(typeof o=="number")for(m=n;m<r;++m)this[m]=o;else{var l=_.isBuffer(o)?o:_.from(o,a),d=l.length;if(d===0)throw new TypeError('The value "'+o+'" is invalid for argument "value"');for(m=0;m<r-n;++m)this[m+n]=l[m%d]}return this};var yp=/[^+/0-9A-Za-z-_]/g;function xp(e){if(e=e.split("=")[0],e=e.trim().replace(yp,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function nt(e,o){o=o||1/0;for(var n,r=e.length,a=null,p=[],m=0;m<r;++m){if(n=e.charCodeAt(m),n>55295&&n<57344){if(!a){if(n>56319){(o-=3)>-1&&p.push(239,191,189);continue}else if(m+1===r){(o-=3)>-1&&p.push(239,191,189);continue}a=n;continue}if(n<56320){(o-=3)>-1&&p.push(239,191,189),a=n;continue}n=(a-55296<<10|n-56320)+65536}else a&&(o-=3)>-1&&p.push(239,191,189);if(a=null,n<128){if((o-=1)<0)break;p.push(n)}else if(n<2048){if((o-=2)<0)break;p.push(n>>6|192,n&63|128)}else if(n<65536){if((o-=3)<0)break;p.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((o-=4)<0)break;p.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return p}function bp(e){for(var o=[],n=0;n<e.length;++n)o.push(e.charCodeAt(n)&255);return o}function wp(e,o){for(var n,r,a,p=[],m=0;m<e.length&&!((o-=2)<0);++m)n=e.charCodeAt(m),r=n>>8,a=n%256,p.push(a),p.push(r);return p}function Gr(e){return Qn.toByteArray(xp(e))}function on(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 ae(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function at(e){return e!==e}var Sp=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 qr=Jo((hl,jr)=>{t();var P=jr.exports={},ie,ce;function it(){throw new Error("setTimeout has not been defined")}function ct(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ie=setTimeout:ie=it}catch(e){ie=it}try{typeof clearTimeout=="function"?ce=clearTimeout:ce=ct}catch(e){ce=ct}})();function $r(e){if(ie===setTimeout)return setTimeout(e,0);if((ie===it||!ie)&&setTimeout)return ie=setTimeout,setTimeout(e,0);try{return ie(e,0)}catch(o){try{return ie.call(null,e,0)}catch(n){return ie.call(this,e,0)}}}function vp(e){if(ce===clearTimeout)return clearTimeout(e);if((ce===ct||!ce)&&clearTimeout)return ce=clearTimeout,clearTimeout(e);try{return ce(e)}catch(o){try{return ce.call(null,e)}catch(n){return ce.call(this,e)}}}var de=[],Ze=!1,Me,nn=-1;function kp(){!Ze||!Me||(Ze=!1,Me.length?de=Me.concat(de):nn=-1,de.length&&Hr())}function Hr(){if(!Ze){var e=$r(kp);Ze=!0;for(var o=de.length;o;){for(Me=de,de=[];++nn<o;)Me&&Me[nn].run();nn=-1,o=de.length}Me=null,Ze=!1,vp(e)}}P.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];de.push(new zr(e,o)),de.length===1&&!Ze&&$r(Hr)};function zr(e,o){this.fun=e,this.array=o}zr.prototype.run=function(){this.fun.apply(null,this.array)};P.title="browser";P.browser=!0;P.env={};P.argv=[];P.version="";P.versions={};function ue(){}P.on=ue;P.addListener=ue;P.once=ue;P.off=ue;P.removeListener=ue;P.removeAllListeners=ue;P.emit=ue;P.prependListener=ue;P.prependOnceListener=ue;P.listeners=function(e){return[]};P.binding=function(e){throw new Error("process.binding is not supported")};P.cwd=function(){return"/"};P.chdir=function(e){throw new Error("process.chdir is not supported")};P.umask=function(){return 0}});var i,c,yl,t=b(()=>{i=u(Vr()),c=u(qr()),yl=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 tn,st=b(()=>{"use strict";t();tn=()=>Date.now()/1e3});var Kr=b(()=>{"use strict";t()});var Xr=b(()=>{"use strict";t()});var pt=b(()=>{"use strict";t();st();Kr();Xr()});var _t={};De(_t,{getItem:()=>Ap,localStorageKeys:()=>Se,removeItem:()=>Ep,setItem:()=>Ip});var Se,mt,Ip,Ap,Ep,Ye=b(()=>{"use strict";t();pt();Se={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},mt=typeof localStorage!="undefined",Ip=({key:e,data:o,expires:n})=>{!mt||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},Ap=e=>{if(!mt)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:tn()>=n.expires?(localStorage.removeItem(String(e)),null):n.data},Ep=e=>{!mt||localStorage.removeItem(String(e))}});var lt={};De(lt,{clear:()=>Qr,getItem:()=>Yr,removeItem:()=>Jr,setItem:()=>Zr,storage:()=>Lp});var Zr,Yr,Jr,Qr,Lp,ea=b(()=>{"use strict";t();Zr=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},Yr=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},Jr=e=>sessionStorage.removeItem(String(e)),Qr=()=>sessionStorage.clear(),Lp={setItem:Zr,getItem:Yr,removeItem:Jr,clear:Qr}});var Fe,Je=b(()=>{"use strict";t();Ye();ea();Fe={session:lt,local:_t}});function bo(){return new Date().setHours(new Date().getHours()+24)}function wo(e){Fe.local.setItem({key:Se.loginExpiresAt,data:e,expires:e})}var dt=b(()=>{"use strict";t();Je();Ye()});var D=b(()=>{"use strict";t()});var oa,Qe=b(()=>{"use strict";t();oa="Undefined transaction status"});var na=b(()=>{"use strict";t()});var ut,B=b(()=>{"use strict";t();ut=(r=>(r.nft="nft",r.esdt="esdt",r.egld="egld",r))(ut||{})});var ta=b(()=>{"use strict";t()});var ra=b(()=>{"use strict";t()});var aa=b(()=>{"use strict";t()});var ia=b(()=>{"use strict";t()});var V=b(()=>{"use strict";t();na();B();D();ta();ra();aa();ia()});var So,ca,ql,sa,Kl,pa,ma,Xl,Cp,vo=b(()=>{"use strict";t();V();So={devnet:{id:"devnet",chainId:"D",name:"Devnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://devnet-wallet.elrond.com",apiAddress:"https://devnet-api.elrond.com",explorerAddress:"http://devnet-explorer.elrond.com",apiTimeout:"4000"},testnet:{id:"testnet",chainId:"T",name:"Testnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://testnet-wallet.elrond.com",apiAddress:"https://testnet-api.elrond.com",explorerAddress:"http://testnet-explorer.elrond.com",apiTimeout:"4000"},mainnet:{id:"mainnet",chainId:"1",name:"Mainnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://wallet.elrond.com",apiAddress:"https://api.elrond.com",explorerAddress:"https://explorer.elrond.com",apiTimeout:"4000"}},{chainId:ca,egldLabel:ql}=So["devnet"],{chainId:sa,egldLabel:Kl}=So["testnet"],{chainId:pa,egldLabel:ma}=So["mainnet"],Xl={["devnet"]:ca,["testnet"]:sa,["mainnet"]:pa},Cp={[ca]:"devnet",[sa]:"testnet",[pa]:"mainnet"}});var gt=b(()=>{"use strict";t()});var _a=b(()=>{"use strict";t()});var ko,ft=b(()=>{"use strict";t();ko="transaction-status-toast-id"});var Io,rn,F,eo,la,da,an,cn,ua,se,E=b(()=>{"use strict";t();Qe();vo();gt();_a();ft();Io=5e4,rn=1e9,F=18,eo=4,la=1,da="/dapp/init",an="signSession",cn="logout",ua="login",se="0"});var Tt,U,ge,G=b(()=>{"use strict";t();Tt=require("@reduxjs/toolkit");E();U=(0,Tt.createAction)(cn),ge=(0,Tt.createAction)(ua,e=>({payload:e}))});var fa,ga,Ta,dd,ha,Np,Ao,ya,Dp,xa,ba,ht=b(()=>{"use strict";t();fa=require("@reduxjs/toolkit");dt();D();G();ga={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Ta=(0,fa.createSlice)({name:"loginInfoSlice",initialState:ga,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(U,()=>ga),e.addCase(ge,(o,n)=>{o.loginMethod=n.payload.loginMethod,wo(bo())})}}),{setLoginMethod:dd,setWalletConnectLogin:ha,setLedgerLogin:Np,setTokenLogin:Ao,setTokenLoginSignature:ya,setWalletLogin:Dp,invalidateLoginSession:xa}=Ta.actions,ba=Ta.reducer});var Eo=b(()=>{"use strict";t()});var Sa=b(()=>{"use strict";t();Eo()});function yt(e){return e[Math.floor(Math.random()*e.length)]}var va=b(()=>{"use strict";t()});var xt=b(()=>{"use strict";t();gt()});var oo=b(()=>{"use strict";t();Sa();va();xt()});var ka,Ia,bt,Pp,Aa,Ed,Ld,Ea,wt=b(()=>{"use strict";t();ka=require("@reduxjs/toolkit"),Ia=u(require("lodash.omit"));oo();bt={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Pp={network:bt,chainID:"-1"},Aa=(0,ka.createSlice)({name:"appConfig",initialState:Pp,reducers:{initializeNetworkConfig:(e,o)=>{let n=yt(o.payload.walletConnectBridgeAddresses),r=yt(o.payload.walletConnectV2RelayAddresses),a=(0,Ia.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=w(g(g({},e.network),a),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(e,o)=>{e.chainID=o.payload}}}),{initializeNetworkConfig:Ed,setChainID:Ld}=Aa.actions,Ea=Aa.reducer});var vt,La,Ca,sn,St,Na,kt,Od,It,Bd,Rp,Mp,Ud,Wd,Gd,Fp,Da,At=b(()=>{"use strict";t();vt=require("@elrondnetwork/erdjs"),La=require("@reduxjs/toolkit"),Ca=require("redux-persist");E();Je();Ye();G();sn={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:se},St={address:"",websocketEvent:null,accounts:{"":sn},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Na=(0,La.createSlice)({name:"accountInfoSlice",initialState:St,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new vt.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:sn},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(U,()=>(Fe.local.removeItem(Se.loginExpiresAt),St)),e.addCase(ge,(o,n)=>{let{address:r}=n.payload;o.address=r,o.publicKey=new vt.Address(r).hex()}),e.addCase(Ca.REHYDRATE,(o,n)=>{var f;if(!((f=n.payload)!=null&&f.account))return;let{account:r}=n.payload,{address:a,shard:p,accounts:m,publicKey:l}=r;o.address=a,o.shard=p;let d=m&&a in m;o.accounts=d?m:St.accounts,o.publicKey=l})}}),{setAccount:kt,setAddress:Od,setAccountNonce:It,setAccountShard:Bd,setLedgerAccount:Rp,updateLedgerAccount:Mp,setWalletConnectAccount:Ud,setIsAccountLoading:Wd,setAccountLoadingError:Gd,setWebsocketEvent:Fp}=Na.actions,Da=Na.reducer});function no(e){return e!=null&&(Hp(e)||pn(e))}function to(e){return e!=null&&(zp(e)||Kp(e))}function ro(e){return e!=null&&(jp(e)||Xp(e))}function Et(e){return e!=null&&qp(e)}function Hp(e){return e!=null&&Op.includes(e)}function zp(e){return e!=null&&Bp.includes(e)}function jp(e){return e!=null&&Up.includes(e)}function qp(e){return e!=null&&Wp.includes(e)}function pn(e){return e!=null&&Gp.includes(e)}function Kp(e){return e!=null&&Vp.includes(e)}function Xp(e){return e!=null&&$p.includes(e)}var Op,Bp,Up,Wp,Gp,Vp,$p,ve=b(()=>{"use strict";t();D();Op=["sent"],Bp=["success"],Up=["fail","cancelled","timedOut"],Wp=["timedOut"],Gp=["pending"],Vp=["success"],$p=["fail","invalid"]});var Pa,Ra,Co,Zp,Ma,Fa,Oa,Yp,No,Jp,Qp,Zd,em,Do,Po,mn,_n=b(()=>{"use strict";t();Pa=require("@reduxjs/toolkit"),Ra=require("redux-persist");D();ve();G();Co={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Zp={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Ma=(0,Pa.createSlice)({name:"transactionsSlice",initialState:Co,reducers:{moveTransactionsToSignedState:(e,o)=>{var d,f;let{sessionId:n,transactions:r,errorMessage:a,status:p,redirectRoute:m}=o.payload,l=((d=e.customTransactionInformationForSessionId)==null?void 0:d[n])||Zp;e.signedTransactions[n]={transactions:r,status:p,errorMessage:a,redirectRoute:m,customTransactionInformation:l},((f=e==null?void 0:e.transactionsToSign)==null?void 0:f.sessionId)===n&&(e.transactionsToSign=Co.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=g(g({},e.signedTransactions),o.payload)},updateSignedTransactions:(e,o)=>{let{sessionId:n,status:r,errorMessage:a,transactions:p}=o.payload;e.signedTransactions[n]!=null&&(e.signedTransactions[n].status=r,a!=null&&(e.signedTransactions[n].errorMessage=a),p!=null&&(e.signedTransactions[n].transactions=p))},updateSignedTransactionStatus:(e,o)=>{var l,d,f,T,h,v;let{sessionId:n,status:r,errorMessage:a,transactionHash:p}=o.payload,m=(d=(l=e.signedTransactions)==null?void 0:l[n])==null?void 0:d.transactions;if(m!=null){e.signedTransactions[n].transactions=m.map(N=>N.hash===p?w(g({},N),{status:r,errorMessage:a}):N);let I=(T=(f=e.signedTransactions[n])==null?void 0:f.transactions)==null?void 0:T.every(N=>to(N.status)),C=(v=(h=e.signedTransactions[n])==null?void 0:h.transactions)==null?void 0:v.every(N=>ro(N.status));I&&(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=Co.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Co.signedTransactions},setSignTransactionsError:(e,o)=>{e.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(e,o)=>{e.signTransactionsCancelMessage=o.payload}},extraReducers:e=>{e.addCase(U,()=>Co),e.addCase(Ra.REHYDRATE,(o,n)=>{var m;if(o.signTransactionsCancelMessage=null,!((m=n.payload)!=null&&m.transactions))return;let{signedTransactions:r,customTransactionInformationForSessionId:a}=n.payload.transactions,p=Object.entries(r).reduce((l,[d,f])=>{let T=new Date(d),h=new Date;return h.setHours(h.getHours()+5),h-T>0||(l[d]=f),l},{});a!=null&&(o.customTransactionInformationForSessionId=a),r!=null&&(o.signedTransactions=p)})}}),{updateSignedTransactionStatus:Fa,updateSignedTransactions:Oa,setTransactionsToSign:Yp,clearAllTransactionsToSign:No,clearAllSignedTransactions:Jp,clearSignedTransaction:Qp,clearTransactionToSign:Zd,setSignTransactionsError:em,setSignTransactionsCancelMessage:Do,moveTransactionsToSignedState:Po}=Ma.actions,mn=Ma.reducer});var Ba,Ct,Nt,Dt,om,Lt,Ua,eu,nm,ln,dn,un=b(()=>{"use strict";t();Ba=require("@reduxjs/toolkit");G();Ct="Transaction failed",Nt="Transaction successful",Dt="Processing transaction",om="Transaction submitted",Lt={},Ua=(0,Ba.createSlice)({name:"transactionsInfo",initialState:Lt,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:r}=o.payload;n!=null&&(e[n]={errorMessage:(r==null?void 0:r.errorMessage)||Ct,successMessage:(r==null?void 0:r.successMessage)||Nt,processingMessage:(r==null?void 0:r.processingMessage)||Dt,submittedMessage:(r==null?void 0:r.submittedMessage)||om,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(e,o){o.payload!=null&&delete e[o.payload]},clearTransactionsInfo:()=>Lt},extraReducers:e=>{e.addCase(U,()=>Lt)}}),{clearTransactionsInfo:eu,setTransactionsDisplayInfo:nm,clearTransactionsInfoForSessionId:ln}=Ua.actions,dn=Ua.reducer});var Ga,Wa,Va,ru,tm,au,rm,$a,Pt=b(()=>{"use strict";t();Ga=require("@reduxjs/toolkit");G();Wa={},Va=(0,Ga.createSlice)({name:"modalsSlice",initialState:Wa,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(U,()=>Wa)}}),{setTxSubmittedModal:ru,setNotificationModal:tm,clearTxSubmittedModal:au,clearNotificationModal:rm}=Va.actions,$a=Va.reducer});var za,ja,Ha,qa,am,gn,du,uu,Ka,Xa,fn,Tn=b(()=>{"use strict";t();za=require("@reduxjs/toolkit"),ja=require("redux-persist");ft();V();st();G();Ha={customToasts:[],transactionToasts:[],failTransactionToast:null},qa=(0,za.createSlice)({name:"toastsSlice",initialState:Ha,reducers:{addCustomToast:(e,o)=>{e.customToasts.push(w(g({},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:tn(),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=w(g({},o.payload),{toastId:ko})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(U,()=>Ha),e.addCase(ja.REHYDRATE,(o,n)=>{var a,p;let r=(p=(a=n.customToasts)==null?void 0:a.filter(m=>!("component"in m)))!=null?p:[];o.customToasts=r})}}),{addCustomToast:am,removeCustomToast:gn,addTransactionToast:du,removeTransactionToast:uu,addFailTransactionToast:Ka,removeFailTransactionToast:Xa}=qa.actions,fn=qa.reducer});var L=b(()=>{"use strict";t();ht();wt();At();_n();un();Pt();Tn()});var Rt=b(()=>{"use strict";t()});var Qa,Ja,ei,Ru,Mu,Fu,Ou,Bu,Uu,oi,ni=b(()=>{"use strict";t();Qa=require("@reduxjs/toolkit");G();Ja={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},ei=(0,Qa.createSlice)({name:"dappModalsSlice",initialState:Ja,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=g({},o.payload)}},extraReducers:e=>{e.addCase(U,()=>Ja)}}),{setDappModalVisibility:Ru,setDappModalHeaderVisibility:Mu,setDappModalFooterVisibility:Fu,setDappModalHeaderText:Ou,setDappModalFooterText:Bu,setDappModalConfig:Uu}=ei.actions,oi=ei.reducer});var ti,pm,mm,ao,yn=b(()=>{"use strict";t();ti=require("@reduxjs/toolkit");Rt();At();ni();ht();Pt();wt();Tn();un();_n();pm={["account"]:Da,["networkConfig"]:Ea,["loginInfo"]:ba,["modals"]:$a,["dappModal"]:oi,["toasts"]:fn,["transactions"]:mn,["transactionsInfo"]:dn},mm=(e={})=>(0,ti.combineReducers)(g(g({},pm),e)),ao=mm});var ii={};De(ii,{default:()=>Tm});function Mt(e,o=[]){return{key:e,version:1,storage:ai.default,blacklist:o}}var Be,ri,ai,_m,lm,dm,um,gm,fm,Tm,ci=b(()=>{"use strict";t();Be=require("redux-persist"),ri=u(require("redux-persist/lib/storage")),ai=u(require("redux-persist/lib/storage/session"));yn();L();Tn();un();_n();Rt();_m={2:e=>w(g({},e),{networkConfig:bt})};lm=Mt("dapp-core-transactionsInfo"),dm=Mt("dapp-core-transactions",["transactionsToSign"]),um=Mt("dapp-core-toasts"),gm={key:"dapp-core-store",version:2,storage:ri.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,Be.createMigrate)(_m,{debug:!1})},fm={["toasts"]:(0,Be.persistReducer)(um,fn),["transactions"]:(0,Be.persistReducer)(dm,mn),["transactionsInfo"]:(0,Be.persistReducer)(lm,dn)},Tm=(0,Be.persistReducer)(gm,ao(fm))});var si={};De(si,{default:()=>hm});var hm,pi=b(()=>{"use strict";t();yn();hm=ao()});var mi={};De(mi,{default:()=>xm});var K,ym,xm,_i=b(()=>{"use strict";t();K=require("redux-persist"),ym=[K.FLUSH,K.REHYDRATE,K.PAUSE,K.PERSIST,K.PURGE,K.REGISTER],xm=ym});var ui={};De(ui,{default:()=>di});function di(e){return(0,li.persistStore)(e)}var li,gi=b(()=>{"use strict";t();li=require("redux-persist")});var dl={};De(dl,{DeviceConfirmationScreen:()=>ll});module.exports=xo(dl);t();var wr=u(require("react"));t();t();t();var bi=require("react"),io=require("react-redux");t();var Ft=require("@reduxjs/toolkit"),yi=require("react-redux/es/utils/Subscription");L();t();var Za=u(require("lodash.throttle"));E();L();dt();Je();Ye();var im=[cn],cm=(0,Za.default)(()=>{wo(bo())},5e3),Ya=e=>o=>n=>{var d;if(im.includes(n.type))return o(n);let r=e.getState(),a=Fe.local.getItem(Se.loginExpiresAt);if(!((d=r==null?void 0:r.loginInfo)==null?void 0:d.isLoggedIn))return o(n);if(a==null)return wo(bo());let m=Date.now();return a-m<0?setTimeout(()=>S(void 0,null,function*(){console.log("session expired");try{e.dispatch(xa())}catch(f){console.error("error logging out",f)}}),1e3):(cm(),o(n))};t();t();function hn(){return typeof sessionStorage!="undefined"}var fi=hn()?(ci(),xo(ii)).default:(pi(),xo(si)).default,Ti=hn()?(_i(),xo(mi)).default:[],hi=hn()?(gi(),xo(ui)).default:e=>e;yn();var A=(0,Ft.configureStore)({reducer:fi,middleware:e=>e({serializableCheck:{ignoredActions:[...Ti,It.type,kt.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(Ya)}),xi=(0,yi.createSubscription)(A),mg=hi(A),_g=(0,Ft.configureStore)({reducer:ao});var bm={store:A,subscription:xi},Ot=(0,bi.createContext)(bm),gg=(0,io.createStoreHook)(Ot),O=(0,io.createDispatchHook)(Ot),k=(0,io.createSelectorHook)(Ot);t();t();L();t();var wi=u(require("lodash.isequal")),xn=require("reselect"),y=(0,xn.createSelectorCreator)(xn.defaultMemoize,wi.default);var fe=e=>e.account,Ue=y(fe,e=>e.address),co=y(fe,Ue,(e,o)=>o in e.accounts?e.accounts[o]:sn),wm=y(fe,co,(e,o)=>{let a=e,{accounts:n}=a,r=Ne(a,["accounts"]);return w(g({},r),{account:o})}),Sm=y(co,e=>e.balance),Si=y(co,e=>{var o;return((o=e==null?void 0:e.nonce)==null?void 0:o.valueOf())||0}),xg=y(fe,e=>e.shard),vm=y(fe,e=>e.ledgerAccount),bg=y(fe,e=>e.walletConnectAccount),wg=y(fe,e=>e.isAccountLoading),Sg=y(fe,e=>e.accountLoadingError),vi=y(fe,e=>e.websocketEvent);t();var Te=e=>e.networkConfig,bn=y(Te,e=>e.chainID),km=y(Te,e=>e.network.walletConnectBridgeAddress),Im=y(Te,e=>e.network.walletConnectV2RelayAddress),Am=y(Te,e=>e.network.walletConnectV2ProjectId),ki=y(Te,e=>e.network.walletConnectDeepLink),ke=y(Te,e=>e.network),Bt=y(ke,e=>e.apiAddress),Ii=y(ke,e=>e.explorerAddress),Ai=y(ke,e=>e.egldLabel);t();D();var We=e=>e.loginInfo,Cg=y(We,e=>e.loginMethod),wn=y(We,Ue,(e,o)=>e.loginMethod!=""&&Boolean(o)),Ng=y(We,e=>e.walletConnectLogin),Dg=y(We,e=>e.ledgerLogin),Em=y(We,e=>e.walletLogin),Pg=y(We,e=>e.isLoginSessionInvalid);t();t();var $=require("@elrondnetwork/erdjs");E();t();function Sn(e){try{return i.Buffer.from(e,"base64").toString()===atob(e)}catch(o){return!1}}function Ei(e){return atob(e)}function Ge(e){var a,p,m;let{data:o}=e,n=Sn(o!=null?o:"")?$.TransactionPayload.fromEncoded(o):new $.TransactionPayload(o),r=new $.Transaction(g({value:e.value.valueOf(),data:n,nonce:e.nonce.valueOf(),receiver:new $.Address(e.receiver),sender:new $.Address(e.sender),gasLimit:(a=e.gasLimit.valueOf())!=null?a:Io,gasPrice:(p=e.gasPrice.valueOf())!=null?p:rn,chainID:e.chainID.valueOf(),version:new $.TransactionVersion((m=e.version)!=null?m:la)},e.options?{options:new $.TransactionOptions(e.options)}:{}));return r.applySignature({hex:()=>e.signature||""},new $.Address(e.sender)),r}t();ve();t();var Lm=u(require("bignumber.js"));V();t();t();function Ut(e){for(let o=0;o<e.length;o++)if(e.charCodeAt(o)>127)return!1;return!0}function vn(e){let o=e;try{let n=i.Buffer.from(e,"hex").toString();Ut(n)&&n.length>1&&(o=n)}catch(n){}return o}t();t();var Gt=require("@elrondnetwork/erdjs"),Vt=u(require("bignumber.js"));D();t();var Ci=require("@elrondnetwork/erdjs");function Cm(e){try{let o=new Ci.Address(e);return Boolean(o.bech32())}catch(o){return!1}}function so(e){return(e==null?void 0:e.startsWith("erd"))&&e.length===62&&/^\w+$/.test(e)&&Cm(e)}var Wt={tokenId:"",amount:""},Nm=e=>e.split("@").map((p,m)=>[2,3].includes(m)?p:vn(p));function $t(e){if(!e)return Wt;let o=e.startsWith("ESDTTransfer"),n=e.startsWith("ESDTNFTTransfer")&&e.includes("@");if(o){let[,r,a]=e.split("@");try{let p=i.Buffer.from(r,"hex").toString("ascii");if(!p)return Wt;let m=new Vt.default("0x"+a.replace("0x","")).toString(10);return{tokenId:p,amount:m}}catch(p){console.error("Error getting token from transaction data",p)}}if(n)try{let[,r,a,p,m]=Nm(e);if([r,a,p,m].every(l=>Boolean(l))&&so(new Gt.Address(m).bech32()))return{tokenId:`${r}-${a}`,amount:new Vt.default(p,16).toString(10),collection:r,nonce:a,receiver:new Gt.Address(m).bech32()}}catch(r){}return Wt}t();t();t();var Pm=require("@elrondnetwork/erdjs/out");t();E();t();var Ro=require("@elrondnetwork/erdjs");V();var Rm=["ESDTNFTTransfer","ESDTNFTBurn","ESDTNFTAddQuantity","ESDTNFTCreate","MultiESDTNFTTransfer","ESDTTransfer","ESDTBurn","ESDTLocalMint","ESDTLocal