UNPKG

@sofaws/dapp-core

Version:

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

1 lines 153 kB
"use strict";var gr=Object.create;var _e=Object.defineProperty,ur=Object.defineProperties,fr=Object.getOwnPropertyDescriptor,hr=Object.getOwnPropertyDescriptors,xr=Object.getOwnPropertyNames,he=Object.getOwnPropertySymbols,br=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty,zo=Object.prototype.propertyIsEnumerable;var Go=(o,e,n)=>e in o?_e(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n,b=(o,e)=>{for(var n in e||(e={}))ze.call(e,n)&&Go(o,n,e[n]);if(he)for(var n of he(e))zo.call(e,n)&&Go(o,n,e[n]);return o},k=(o,e)=>ur(o,hr(e));var xe=(o,e)=>{var n={};for(var t in o)ze.call(o,t)&&e.indexOf(t)<0&&(n[t]=o[t]);if(o!=null&&he)for(var t of he(o))e.indexOf(t)<0&&zo.call(o,t)&&(n[t]=o[t]);return n};var f=(o,e)=>()=>(o&&(e=o(o=0)),e);var be=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),K=(o,e)=>{for(var n in e)_e(o,n,{get:e[n],enumerable:!0})},qo=(o,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of xr(e))!ze.call(o,a)&&a!==n&&_e(o,a,{get:()=>e[a],enumerable:!(t=fr(e,a))||t.enumerable});return o};var y=(o,e,n)=>(n=o!=null?gr(br(o)):{},qo(e||!o||!o.__esModule?_e(n,"default",{value:o,enumerable:!0}):n,o)),se=o=>qo(_e({},"__esModule",{value:!0}),o);var Ko=(o,e,n)=>new Promise((t,a)=>{var m=d=>{try{l(n.next(d))}catch(g){a(g)}},_=d=>{try{l(n.throw(d))}catch(g){a(g)}},l=d=>d.done?t(d.value):Promise.resolve(d.value).then(m,_);l((n=n.apply(o,e)).next())});var Zo=be(ye=>{"use strict";r();ye.byteLength=Tr;ye.toByteArray=Sr;ye.fromByteArray=Ar;var P=[],D=[],yr=typeof Uint8Array!="undefined"?Uint8Array:Array,qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(X=0,Xo=qe.length;X<Xo;++X)P[X]=qe[X],D[qe.charCodeAt(X)]=X;var X,Xo;D["-".charCodeAt(0)]=62;D["_".charCodeAt(0)]=63;function Yo(o){var e=o.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=o.indexOf("=");n===-1&&(n=e);var t=n===e?0:4-n%4;return[n,t]}function Tr(o){var e=Yo(o),n=e[0],t=e[1];return(n+t)*3/4-t}function wr(o,e,n){return(e+n)*3/4-n}function Sr(o){var e,n=Yo(o),t=n[0],a=n[1],m=new yr(wr(o,t,a)),_=0,l=a>0?t-4:t,d;for(d=0;d<l;d+=4)e=D[o.charCodeAt(d)]<<18|D[o.charCodeAt(d+1)]<<12|D[o.charCodeAt(d+2)]<<6|D[o.charCodeAt(d+3)],m[_++]=e>>16&255,m[_++]=e>>8&255,m[_++]=e&255;return a===2&&(e=D[o.charCodeAt(d)]<<2|D[o.charCodeAt(d+1)]>>4,m[_++]=e&255),a===1&&(e=D[o.charCodeAt(d)]<<10|D[o.charCodeAt(d+1)]<<4|D[o.charCodeAt(d+2)]>>2,m[_++]=e>>8&255,m[_++]=e&255),m}function kr(o){return P[o>>18&63]+P[o>>12&63]+P[o>>6&63]+P[o&63]}function vr(o,e,n){for(var t,a=[],m=e;m<n;m+=3)t=(o[m]<<16&16711680)+(o[m+1]<<8&65280)+(o[m+2]&255),a.push(kr(t));return a.join("")}function Ar(o){for(var e,n=o.length,t=n%3,a=[],m=16383,_=0,l=n-t;_<l;_+=m)a.push(vr(o,_,_+m>l?l:_+m));return t===1?(e=o[n-1],a.push(P[e>>2]+P[e<<4&63]+"==")):t===2&&(e=(o[n-2]<<8)+o[n-1],a.push(P[e>>10]+P[e>>4&63]+P[e<<2&63]+"=")),a.join("")}});var Jo=be(Ke=>{r();Ke.read=function(o,e,n,t,a){var m,_,l=a*8-t-1,d=(1<<l)-1,g=d>>1,x=-7,h=n?a-1:0,v=n?-1:1,A=o[e+h];for(h+=v,m=A&(1<<-x)-1,A>>=-x,x+=l;x>0;m=m*256+o[e+h],h+=v,x-=8);for(_=m&(1<<-x)-1,m>>=-x,x+=t;x>0;_=_*256+o[e+h],h+=v,x-=8);if(m===0)m=1-g;else{if(m===d)return _?NaN:(A?-1:1)*(1/0);_=_+Math.pow(2,t),m=m-g}return(A?-1:1)*_*Math.pow(2,m-t)};Ke.write=function(o,e,n,t,a,m){var _,l,d,g=m*8-a-1,x=(1<<g)-1,h=x>>1,v=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=t?0:m-1,j=t?1:-1,B=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,_=x):(_=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-_))<1&&(_--,d*=2),_+h>=1?e+=v/d:e+=v*Math.pow(2,1-h),e*d>=2&&(_++,d/=2),_+h>=x?(l=0,_=x):_+h>=1?(l=(e*d-1)*Math.pow(2,a),_=_+h):(l=e*Math.pow(2,h-1)*Math.pow(2,a),_=0));a>=8;o[n+A]=l&255,A+=j,l/=256,a-=8);for(_=_<<a|l,g+=a;g>0;o[n+A]=_&255,A+=j,_/=256,g-=8);o[n+A-j]|=B*128}});var dn=be(oe=>{"use strict";r();var Xe=Zo(),ee=Jo(),Qo=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;oe.Buffer=s;oe.SlowBuffer=Cr;oe.INSPECT_MAX_BYTES=50;var Te=2147483647;oe.kMaxLength=Te;s.TYPED_ARRAY_SUPPORT=Ir();!s.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Ir(){try{var o=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(o,e),o.foo()===42}catch(n){return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.buffer}});Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.byteOffset}});function U(o){if(o>Te)throw new RangeError('The value "'+o+'" is invalid for option "size"');var e=new Uint8Array(o);return Object.setPrototypeOf(e,s.prototype),e}function s(o,e,n){if(typeof o=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Qe(o)}return nn(o,e,n)}s.poolSize=8192;function nn(o,e,n){if(typeof o=="string")return Lr(o,e);if(ArrayBuffer.isView(o))return Nr(o);if(o==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof o);if(F(o,ArrayBuffer)||o&&F(o.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(F(o,SharedArrayBuffer)||o&&F(o.buffer,SharedArrayBuffer)))return Ze(o,e,n);if(typeof o=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var t=o.valueOf&&o.valueOf();if(t!=null&&t!==o)return s.from(t,e,n);var a=Dr(o);if(a)return a;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof o[Symbol.toPrimitive]=="function")return s.from(o[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof o)}s.from=function(o,e,n){return nn(o,e,n)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function tn(o){if(typeof o!="number")throw new TypeError('"size" argument must be of type number');if(o<0)throw new RangeError('The value "'+o+'" is invalid for option "size"')}function Er(o,e,n){return tn(o),o<=0?U(o):e!==void 0?typeof n=="string"?U(o).fill(e,n):U(o).fill(e):U(o)}s.alloc=function(o,e,n){return Er(o,e,n)};function Qe(o){return tn(o),U(o<0?0:eo(o)|0)}s.allocUnsafe=function(o){return Qe(o)};s.allocUnsafeSlow=function(o){return Qe(o)};function Lr(o,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=rn(o,e)|0,t=U(n),a=t.write(o,e);return a!==n&&(t=t.slice(0,a)),t}function Ye(o){for(var e=o.length<0?0:eo(o.length)|0,n=U(e),t=0;t<e;t+=1)n[t]=o[t]&255;return n}function Nr(o){if(F(o,Uint8Array)){var e=new Uint8Array(o);return Ze(e.buffer,e.byteOffset,e.byteLength)}return Ye(o)}function Ze(o,e,n){if(e<0||o.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(o.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var t;return e===void 0&&n===void 0?t=new Uint8Array(o):n===void 0?t=new Uint8Array(o,e):t=new Uint8Array(o,e,n),Object.setPrototypeOf(t,s.prototype),t}function Dr(o){if(s.isBuffer(o)){var e=eo(o.length)|0,n=U(e);return n.length===0||o.copy(n,0,0,e),n}if(o.length!==void 0)return typeof o.length!="number"||oo(o.length)?U(0):Ye(o);if(o.type==="Buffer"&&Array.isArray(o.data))return Ye(o.data)}function eo(o){if(o>=Te)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Te.toString(16)+" bytes");return o|0}function Cr(o){return+o!=o&&(o=0),s.alloc(+o)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype};s.compare=function(e,n){if(F(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),F(n,Uint8Array)&&(n=s.from(n,n.offset,n.byteLength)),!s.isBuffer(e)||!s.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===n)return 0;for(var t=e.length,a=n.length,m=0,_=Math.min(t,a);m<_;++m)if(e[m]!==n[m]){t=e[m],a=n[m];break}return t<a?-1:a<t?1:0};s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(e,n){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return s.alloc(0);var t;if(n===void 0)for(n=0,t=0;t<e.length;++t)n+=e[t].length;var a=s.allocUnsafe(n),m=0;for(t=0;t<e.length;++t){var _=e[t];if(F(_,Uint8Array))m+_.length>a.length?s.from(_).copy(a,m):Uint8Array.prototype.set.call(a,_,m);else if(s.isBuffer(_))_.copy(a,m);else throw new TypeError('"list" argument must be an Array of Buffers');m+=_.length}return a};function rn(o,e){if(s.isBuffer(o))return o.length;if(ArrayBuffer.isView(o)||F(o,ArrayBuffer))return o.byteLength;if(typeof o!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof o);var n=o.length,t=arguments.length>2&&arguments[2]===!0;if(!t&&n===0)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Je(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return sn(o).length;default:if(a)return t?-1:Je(o).length;e=(""+e).toLowerCase(),a=!0}}s.byteLength=rn;function Rr(o,e,n){var t=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,e>>>=0,n<=e))return"";for(o||(o="utf8");;)switch(o){case"hex":return jr(this,e,n);case"utf8":case"utf-8":return pn(this,e,n);case"ascii":return $r(this,e,n);case"latin1":case"binary":return Hr(this,e,n);case"base64":return Ur(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wr(this,e,n);default:if(t)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),t=!0}}s.prototype._isBuffer=!0;function Y(o,e,n){var t=o[e];o[e]=o[n],o[n]=t}s.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<e;n+=2)Y(this,n,n+1);return this};s.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<e;n+=4)Y(this,n,n+3),Y(this,n+1,n+2);return this};s.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<e;n+=8)Y(this,n,n+7),Y(this,n+1,n+6),Y(this,n+2,n+5),Y(this,n+3,n+4);return this};s.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?pn(this,0,e):Rr.apply(this,arguments)};s.prototype.toLocaleString=s.prototype.toString;s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:s.compare(this,e)===0};s.prototype.inspect=function(){var e="",n=oe.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"};Qo&&(s.prototype[Qo]=s.prototype.inspect);s.prototype.compare=function(e,n,t,a,m){if(F(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(n===void 0&&(n=0),t===void 0&&(t=e?e.length:0),a===void 0&&(a=0),m===void 0&&(m=this.length),n<0||t>e.length||a<0||m>this.length)throw new RangeError("out of range index");if(a>=m&&n>=t)return 0;if(a>=m)return-1;if(n>=t)return 1;if(n>>>=0,t>>>=0,a>>>=0,m>>>=0,this===e)return 0;for(var _=m-a,l=t-n,d=Math.min(_,l),g=this.slice(a,m),x=e.slice(n,t),h=0;h<d;++h)if(g[h]!==x[h]){_=g[h],l=x[h];break}return _<l?-1:l<_?1:0};function an(o,e,n,t,a){if(o.length===0)return-1;if(typeof n=="string"?(t=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,oo(n)&&(n=a?0:o.length-1),n<0&&(n=o.length+n),n>=o.length){if(a)return-1;n=o.length-1}else if(n<0)if(a)n=0;else return-1;if(typeof e=="string"&&(e=s.from(e,t)),s.isBuffer(e))return e.length===0?-1:en(o,e,n,t,a);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(o,e,n):Uint8Array.prototype.lastIndexOf.call(o,e,n):en(o,[e],n,t,a);throw new TypeError("val must be string, number or Buffer")}function en(o,e,n,t,a){var m=1,_=o.length,l=e.length;if(t!==void 0&&(t=String(t).toLowerCase(),t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le")){if(o.length<2||e.length<2)return-1;m=2,_/=2,l/=2,n/=2}function d(A,j){return m===1?A[j]:A.readUInt16BE(j*m)}var g;if(a){var x=-1;for(g=n;g<_;g++)if(d(o,g)===d(e,x===-1?0:g-x)){if(x===-1&&(x=g),g-x+1===l)return x*m}else x!==-1&&(g-=g-x),x=-1}else for(n+l>_&&(n=_-l),g=n;g>=0;g--){for(var h=!0,v=0;v<l;v++)if(d(o,g+v)!==d(e,v)){h=!1;break}if(h)return g}return-1}s.prototype.includes=function(e,n,t){return this.indexOf(e,n,t)!==-1};s.prototype.indexOf=function(e,n,t){return an(this,e,n,t,!0)};s.prototype.lastIndexOf=function(e,n,t){return an(this,e,n,t,!1)};function Pr(o,e,n,t){n=Number(n)||0;var a=o.length-n;t?(t=Number(t),t>a&&(t=a)):t=a;var m=e.length;t>m/2&&(t=m/2);for(var _=0;_<t;++_){var l=parseInt(e.substr(_*2,2),16);if(oo(l))return _;o[n+_]=l}return _}function Fr(o,e,n,t){return we(Je(e,o.length-n),o,n,t)}function Mr(o,e,n,t){return we(qr(e),o,n,t)}function Or(o,e,n,t){return we(sn(e),o,n,t)}function Br(o,e,n,t){return we(Kr(e,o.length-n),o,n,t)}s.prototype.write=function(e,n,t,a){if(n===void 0)a="utf8",t=this.length,n=0;else if(t===void 0&&typeof n=="string")a=n,t=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(t)?(t=t>>>0,a===void 0&&(a="utf8")):(a=t,t=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var m=this.length-n;if((t===void 0||t>m)&&(t=m),e.length>0&&(t<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var _=!1;;)switch(a){case"hex":return Pr(this,e,n,t);case"utf8":case"utf-8":return Fr(this,e,n,t);case"ascii":case"latin1":case"binary":return Mr(this,e,n,t);case"base64":return Or(this,e,n,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Br(this,e,n,t);default:if(_)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),_=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ur(o,e,n){return e===0&&n===o.length?Xe.fromByteArray(o):Xe.fromByteArray(o.slice(e,n))}function pn(o,e,n){n=Math.min(o.length,n);for(var t=[],a=e;a<n;){var m=o[a],_=null,l=m>239?4:m>223?3:m>191?2:1;if(a+l<=n){var d,g,x,h;switch(l){case 1:m<128&&(_=m);break;case 2:d=o[a+1],(d&192)===128&&(h=(m&31)<<6|d&63,h>127&&(_=h));break;case 3:d=o[a+1],g=o[a+2],(d&192)===128&&(g&192)===128&&(h=(m&15)<<12|(d&63)<<6|g&63,h>2047&&(h<55296||h>57343)&&(_=h));break;case 4:d=o[a+1],g=o[a+2],x=o[a+3],(d&192)===128&&(g&192)===128&&(x&192)===128&&(h=(m&15)<<18|(d&63)<<12|(g&63)<<6|x&63,h>65535&&h<1114112&&(_=h))}}_===null?(_=65533,l=1):_>65535&&(_-=65536,t.push(_>>>10&1023|55296),_=56320|_&1023),t.push(_),a+=l}return Vr(t)}var on=4096;function Vr(o){var e=o.length;if(e<=on)return String.fromCharCode.apply(String,o);for(var n="",t=0;t<e;)n+=String.fromCharCode.apply(String,o.slice(t,t+=on));return n}function $r(o,e,n){var t="";n=Math.min(o.length,n);for(var a=e;a<n;++a)t+=String.fromCharCode(o[a]&127);return t}function Hr(o,e,n){var t="";n=Math.min(o.length,n);for(var a=e;a<n;++a)t+=String.fromCharCode(o[a]);return t}function jr(o,e,n){var t=o.length;(!e||e<0)&&(e=0),(!n||n<0||n>t)&&(n=t);for(var a="",m=e;m<n;++m)a+=Xr[o[m]];return a}function Wr(o,e,n){for(var t=o.slice(e,n),a="",m=0;m<t.length-1;m+=2)a+=String.fromCharCode(t[m]+t[m+1]*256);return a}s.prototype.slice=function(e,n){var t=this.length;e=~~e,n=n===void 0?t:~~n,e<0?(e+=t,e<0&&(e=0)):e>t&&(e=t),n<0?(n+=t,n<0&&(n=0)):n>t&&(n=t),n<e&&(n=e);var a=this.subarray(e,n);return Object.setPrototypeOf(a,s.prototype),a};function S(o,e,n){if(o%1!==0||o<0)throw new RangeError("offset is not uint");if(o+e>n)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,n,t){e=e>>>0,n=n>>>0,t||S(e,n,this.length);for(var a=this[e],m=1,_=0;++_<n&&(m*=256);)a+=this[e+_]*m;return a};s.prototype.readUintBE=s.prototype.readUIntBE=function(e,n,t){e=e>>>0,n=n>>>0,t||S(e,n,this.length);for(var a=this[e+--n],m=1;n>0&&(m*=256);)a+=this[e+--n]*m;return a};s.prototype.readUint8=s.prototype.readUInt8=function(e,n){return e=e>>>0,n||S(e,1,this.length),this[e]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,n){return e=e>>>0,n||S(e,2,this.length),this[e]|this[e+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,n){return e=e>>>0,n||S(e,2,this.length),this[e]<<8|this[e+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,n){return e=e>>>0,n||S(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,n){return e=e>>>0,n||S(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};s.prototype.readIntLE=function(e,n,t){e=e>>>0,n=n>>>0,t||S(e,n,this.length);for(var a=this[e],m=1,_=0;++_<n&&(m*=256);)a+=this[e+_]*m;return m*=128,a>=m&&(a-=Math.pow(2,8*n)),a};s.prototype.readIntBE=function(e,n,t){e=e>>>0,n=n>>>0,t||S(e,n,this.length);for(var a=n,m=1,_=this[e+--a];a>0&&(m*=256);)_+=this[e+--a]*m;return m*=128,_>=m&&(_-=Math.pow(2,8*n)),_};s.prototype.readInt8=function(e,n){return e=e>>>0,n||S(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};s.prototype.readInt16LE=function(e,n){e=e>>>0,n||S(e,2,this.length);var t=this[e]|this[e+1]<<8;return t&32768?t|4294901760:t};s.prototype.readInt16BE=function(e,n){e=e>>>0,n||S(e,2,this.length);var t=this[e+1]|this[e]<<8;return t&32768?t|4294901760:t};s.prototype.readInt32LE=function(e,n){return e=e>>>0,n||S(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};s.prototype.readInt32BE=function(e,n){return e=e>>>0,n||S(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};s.prototype.readFloatLE=function(e,n){return e=e>>>0,n||S(e,4,this.length),ee.read(this,e,!0,23,4)};s.prototype.readFloatBE=function(e,n){return e=e>>>0,n||S(e,4,this.length),ee.read(this,e,!1,23,4)};s.prototype.readDoubleLE=function(e,n){return e=e>>>0,n||S(e,8,this.length),ee.read(this,e,!0,52,8)};s.prototype.readDoubleBE=function(e,n){return e=e>>>0,n||S(e,8,this.length),ee.read(this,e,!1,52,8)};function E(o,e,n,t,a,m){if(!s.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<m)throw new RangeError('"value" argument is out of bounds');if(n+t>o.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,n,t,a){if(e=+e,n=n>>>0,t=t>>>0,!a){var m=Math.pow(2,8*t)-1;E(this,e,n,t,m,0)}var _=1,l=0;for(this[n]=e&255;++l<t&&(_*=256);)this[n+l]=e/_&255;return n+t};s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,n,t,a){if(e=+e,n=n>>>0,t=t>>>0,!a){var m=Math.pow(2,8*t)-1;E(this,e,n,t,m,0)}var _=t-1,l=1;for(this[n+_]=e&255;--_>=0&&(l*=256);)this[n+_]=e/l&255;return n+t};s.prototype.writeUint8=s.prototype.writeUInt8=function(e,n,t){return e=+e,n=n>>>0,t||E(this,e,n,1,255,0),this[n]=e&255,n+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,n,t){return e=+e,n=n>>>0,t||E(this,e,n,2,65535,0),this[n]=e&255,this[n+1]=e>>>8,n+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,n,t){return e=+e,n=n>>>0,t||E(this,e,n,2,65535,0),this[n]=e>>>8,this[n+1]=e&255,n+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,n,t){return e=+e,n=n>>>0,t||E(this,e,n,4,4294967295,0),this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=e&255,n+4};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,n,t){return e=+e,n=n>>>0,t||E(this,e,n,4,4294967295,0),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e&255,n+4};s.prototype.writeIntLE=function(e,n,t,a){if(e=+e,n=n>>>0,!a){var m=Math.pow(2,8*t-1);E(this,e,n,t,m-1,-m)}var _=0,l=1,d=0;for(this[n]=e&255;++_<t&&(l*=256);)e<0&&d===0&&this[n+_-1]!==0&&(d=1),this[n+_]=(e/l>>0)-d&255;return n+t};s.prototype.writeIntBE=function(e,n,t,a){if(e=+e,n=n>>>0,!a){var m=Math.pow(2,8*t-1);E(this,e,n,t,m-1,-m)}var _=t-1,l=1,d=0;for(this[n+_]=e&255;--_>=0&&(l*=256);)e<0&&d===0&&this[n+_+1]!==0&&(d=1),this[n+_]=(e/l>>0)-d&255;return n+t};s.prototype.writeInt8=function(e,n,t){return e=+e,n=n>>>0,t||E(this,e,n,1,127,-128),e<0&&(e=255+e+1),this[n]=e&255,n+1};s.prototype.writeInt16LE=function(e,n,t){return e=+e,n=n>>>0,t||E(this,e,n,2,32767,-32768),this[n]=e&255,this[n+1]=e>>>8,n+2};s.prototype.writeInt16BE=function(e,n,t){return e=+e,n=n>>>0,t||E(this,e,n,2,32767,-32768),this[n]=e>>>8,this[n+1]=e&255,n+2};s.prototype.writeInt32LE=function(e,n,t){return e=+e,n=n>>>0,t||E(this,e,n,4,2147483647,-2147483648),this[n]=e&255,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24,n+4};s.prototype.writeInt32BE=function(e,n,t){return e=+e,n=n>>>0,t||E(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e&255,n+4};function cn(o,e,n,t,a,m){if(n+t>o.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function mn(o,e,n,t,a){return e=+e,n=n>>>0,a||cn(o,e,n,4,34028234663852886e22,-34028234663852886e22),ee.write(o,e,n,t,23,4),n+4}s.prototype.writeFloatLE=function(e,n,t){return mn(this,e,n,!0,t)};s.prototype.writeFloatBE=function(e,n,t){return mn(this,e,n,!1,t)};function _n(o,e,n,t,a){return e=+e,n=n>>>0,a||cn(o,e,n,8,17976931348623157e292,-17976931348623157e292),ee.write(o,e,n,t,52,8),n+8}s.prototype.writeDoubleLE=function(e,n,t){return _n(this,e,n,!0,t)};s.prototype.writeDoubleBE=function(e,n,t){return _n(this,e,n,!1,t)};s.prototype.copy=function(e,n,t,a){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(t||(t=0),!a&&a!==0&&(a=this.length),n>=e.length&&(n=e.length),n||(n=0),a>0&&a<t&&(a=t),a===t||e.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=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),e.length-n<a-t&&(a=e.length-n+t);var m=a-t;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,t,a):Uint8Array.prototype.set.call(e,this.subarray(t,a),n),m};s.prototype.fill=function(e,n,t,a){if(typeof e=="string"){if(typeof n=="string"?(a=n,n=0,t=this.length):typeof t=="string"&&(a=t,t=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!s.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(e.length===1){var m=e.charCodeAt(0);(a==="utf8"&&m<128||a==="latin1")&&(e=m)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(n<0||this.length<n||this.length<t)throw new RangeError("Out of range index");if(t<=n)return this;n=n>>>0,t=t===void 0?this.length:t>>>0,e||(e=0);var _;if(typeof e=="number")for(_=n;_<t;++_)this[_]=e;else{var l=s.isBuffer(e)?e:s.from(e,a),d=l.length;if(d===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(_=0;_<t-n;++_)this[_+n]=l[_%d]}return this};var Gr=/[^+/0-9A-Za-z-_]/g;function zr(o){if(o=o.split("=")[0],o=o.trim().replace(Gr,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function Je(o,e){e=e||1/0;for(var n,t=o.length,a=null,m=[],_=0;_<t;++_){if(n=o.charCodeAt(_),n>55295&&n<57344){if(!a){if(n>56319){(e-=3)>-1&&m.push(239,191,189);continue}else if(_+1===t){(e-=3)>-1&&m.push(239,191,189);continue}a=n;continue}if(n<56320){(e-=3)>-1&&m.push(239,191,189),a=n;continue}n=(a-55296<<10|n-56320)+65536}else a&&(e-=3)>-1&&m.push(239,191,189);if(a=null,n<128){if((e-=1)<0)break;m.push(n)}else if(n<2048){if((e-=2)<0)break;m.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;m.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;m.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return m}function qr(o){for(var e=[],n=0;n<o.length;++n)e.push(o.charCodeAt(n)&255);return e}function Kr(o,e){for(var n,t,a,m=[],_=0;_<o.length&&!((e-=2)<0);++_)n=o.charCodeAt(_),t=n>>8,a=n%256,m.push(a),m.push(t);return m}function sn(o){return Xe.toByteArray(zr(o))}function we(o,e,n,t){for(var a=0;a<t&&!(a+n>=e.length||a>=o.length);++a)e[a+n]=o[a];return a}function F(o,e){return o instanceof e||o!=null&&o.constructor!=null&&o.constructor.name!=null&&o.constructor.name===e.name}function oo(o){return o!==o}var Xr=function(){for(var o="0123456789abcdef",e=new Array(256),n=0;n<16;++n)for(var t=n*16,a=0;a<16;++a)e[t+a]=o[n]+o[a];return e}()});var hn=be((Ii,fn)=>{r();var T=fn.exports={},M,O;function no(){throw new Error("setTimeout has not been defined")}function to(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?M=setTimeout:M=no}catch(o){M=no}try{typeof clearTimeout=="function"?O=clearTimeout:O=to}catch(o){O=to}})();function ln(o){if(M===setTimeout)return setTimeout(o,0);if((M===no||!M)&&setTimeout)return M=setTimeout,setTimeout(o,0);try{return M(o,0)}catch(e){try{return M.call(null,o,0)}catch(n){return M.call(this,o,0)}}}function Yr(o){if(O===clearTimeout)return clearTimeout(o);if((O===to||!O)&&clearTimeout)return O=clearTimeout,clearTimeout(o);try{return O(o)}catch(e){try{return O.call(null,o)}catch(n){return O.call(this,o)}}}var V=[],ne=!1,Z,Se=-1;function Zr(){!ne||!Z||(ne=!1,Z.length?V=Z.concat(V):Se=-1,V.length&&gn())}function gn(){if(!ne){var o=ln(Zr);ne=!0;for(var e=V.length;e;){for(Z=V,V=[];++Se<e;)Z&&Z[Se].run();Se=-1,e=V.length}Z=null,ne=!1,Yr(o)}}T.nextTick=function(o){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];V.push(new un(o,e)),V.length===1&&!ne&&ln(gn)};function un(o,e){this.fun=o,this.array=e}un.prototype.run=function(){this.fun.apply(null,this.array)};T.title="browser";T.browser=!0;T.env={};T.argv=[];T.version="";T.versions={};function $(){}T.on=$;T.addListener=$;T.once=$;T.off=$;T.removeListener=$;T.removeAllListeners=$;T.emit=$;T.prependListener=$;T.prependOnceListener=$;T.listeners=function(o){return[]};T.binding=function(o){throw new Error("process.binding is not supported")};T.cwd=function(){return"/"};T.chdir=function(o){throw new Error("process.chdir is not supported")};T.umask=function(){return 0}});var i,p,Ei,r=f(()=>{i=y(dn()),p=y(hn()),Ei=function(o){function e(){var t=this||self;return delete o.prototype.__magic__,t}if(typeof globalThis=="object")return globalThis;if(this)return e();o.defineProperty(o.prototype,"__magic__",{configurable:!0,get:e});var n=__magic__;return n}(Object)});var ke,ro=f(()=>{"use strict";r();ke=()=>Date.now()/1e3});var xn=f(()=>{"use strict";r()});var bn=f(()=>{"use strict";r()});var yn=f(()=>{"use strict";r();ro();xn();bn()});var io={};K(io,{getItem:()=>Qr,localStorageKeys:()=>J,removeItem:()=>ea,setItem:()=>Jr});var J,ao,Jr,Qr,ea,de=f(()=>{"use strict";r();yn();J={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},ao=typeof localStorage!="undefined",Jr=({key:o,data:e,expires:n})=>{!ao||localStorage.setItem(String(o),JSON.stringify({expires:n,data:e}))},Qr=o=>{if(!ao)return;let e=localStorage.getItem(String(o));if(!e)return null;let n=JSON.parse(e);return!n||!n.hasOwnProperty("expires")||!n.hasOwnProperty("data")?null:ke()>=n.expires?(localStorage.removeItem(String(o)),null):n.data},ea=o=>{!ao||localStorage.removeItem(String(o))}});var po={};K(po,{clear:()=>kn,getItem:()=>wn,removeItem:()=>Sn,setItem:()=>Tn,storage:()=>oa});var Tn,wn,Sn,kn,oa,vn=f(()=>{"use strict";r();Tn=({key:o,data:e,expires:n})=>{sessionStorage.setItem(String(o),JSON.stringify({expires:n,data:e}))},wn=o=>{let e=sessionStorage.getItem(String(o));if(!e)return null;let n=JSON.parse(e);return!n||!n.hasOwnProperty("expires")||!n.hasOwnProperty("data")?null:Date.now()>=n.expires?(sessionStorage.removeItem(String(o)),null):n.data},Sn=o=>sessionStorage.removeItem(String(o)),kn=()=>sessionStorage.clear(),oa={setItem:Tn,getItem:wn,removeItem:Sn,clear:kn}});var te,ve=f(()=>{"use strict";r();de();vn();te={session:po,local:io}});function le(){return new Date().setHours(new Date().getHours()+24)}function ge(o){te.local.setItem({key:J.loginExpiresAt,data:o,expires:o})}var co=f(()=>{"use strict";r();ve();de()});var R=f(()=>{"use strict";r()});var An=f(()=>{"use strict";r()});var In=f(()=>{"use strict";r()});var I=f(()=>{"use strict";r()});var En=f(()=>{"use strict";r()});var Ln=f(()=>{"use strict";r()});var Nn=f(()=>{"use strict";r()});var Dn=f(()=>{"use strict";r()});var W=f(()=>{"use strict";r();In();I();R();En();Ln();Nn();Dn()});var mo,Cn,np,Rn,tp,Pn,rp,ap,ip,Fn=f(()=>{"use strict";r();W();mo={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:Cn,egldLabel:np}=mo["devnet"],{chainId:Rn,egldLabel:tp}=mo["testnet"],{chainId:Pn,egldLabel:rp}=mo["mainnet"],ap={["devnet"]:Cn,["testnet"]:Rn,["mainnet"]:Pn},ip={[Cn]:"devnet",[Rn]:"testnet",[Pn]:"mainnet"}});var _o=f(()=>{"use strict";r()});var Mn=f(()=>{"use strict";r()});var On,so=f(()=>{"use strict";r();On="transaction-status-toast-id"});var lo,go,Bn,Ae,Un,re,w=f(()=>{"use strict";r();An();Fn();_o();Mn();so();lo=5e4,go=1e9,Bn=1,Ae="logout",Un="login",re="0"});var uo,L,Ie,G=f(()=>{"use strict";r();uo=require("@reduxjs/toolkit");w();L=(0,uo.createAction)(Ae),Ie=(0,uo.createAction)(Un,o=>({payload:o}))});var $n,Vn,Hn,kp,vp,Ap,Ip,Ep,Lp,jn,Wn,fo=f(()=>{"use strict";r();$n=require("@reduxjs/toolkit");co();R();G();Vn={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Hn=(0,$n.createSlice)({name:"loginInfoSlice",initialState:Vn,reducers:{setLoginMethod:(o,e)=>{o.loginMethod=e.payload},setTokenLogin:(o,e)=>{o.tokenLogin=e.payload},setTokenLoginSignature:(o,e)=>{(o==null?void 0:o.tokenLogin)!=null&&(o.tokenLogin.signature=e.payload)},setWalletLogin:(o,e)=>{o.walletLogin=e.payload},setWalletConnectLogin:(o,e)=>{o.walletConnectLogin=e.payload},setLedgerLogin:(o,e)=>{o.ledgerLogin=e.payload},invalidateLoginSession:o=>{o.isLoginSessionInvalid=!0}},extraReducers:o=>{o.addCase(L,()=>Vn),o.addCase(Ie,(e,n)=>{e.loginMethod=n.payload.loginMethod,ge(le())})}}),{setLoginMethod:kp,setWalletConnectLogin:vp,setLedgerLogin:Ap,setTokenLogin:Ip,setTokenLoginSignature:Ep,setWalletLogin:Lp,invalidateLoginSession:jn}=Hn.actions,Wn=Hn.reducer});var Gn=f(()=>{"use strict";r()});var zn=f(()=>{"use strict";r();Gn()});function ho(o){return o[Math.floor(Math.random()*o.length)]}var qn=f(()=>{"use strict";r()});var Kn=f(()=>{"use strict";r();_o()});var Xn=f(()=>{"use strict";r();zn();qn();Kn()});var Yn,Zn,xo,ta,Jn,Gp,zp,Qn,bo=f(()=>{"use strict";r();Yn=require("@reduxjs/toolkit"),Zn=y(require("lodash.omit"));Xn();xo={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},ta={network:xo,chainID:"-1"},Jn=(0,Yn.createSlice)({name:"appConfig",initialState:ta,reducers:{initializeNetworkConfig:(o,e)=>{let n=ho(e.payload.walletConnectBridgeAddresses),t=ho(e.payload.walletConnectV2RelayAddresses),a=(0,Zn.default)(e.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");o.network=k(b(b({},o.network),a),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:t})},setChainID:(o,e)=>{o.chainID=e.payload}}}),{initializeNetworkConfig:Gp,setChainID:zp}=Jn.actions,Qn=Jn.reducer});var To,et,ot,Ee,yo,nt,tt,ec,rt,oc,nc,tc,rc,ac,ic,pc,at,wo=f(()=>{"use strict";r();To=require("@elrondnetwork/erdjs"),et=require("@reduxjs/toolkit"),ot=require("redux-persist");w();ve();de();G();Ee={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:re},yo={address:"",websocketEvent:null,accounts:{"":Ee},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},nt=(0,et.createSlice)({name:"accountInfoSlice",initialState:yo,reducers:{setAddress:(o,e)=>{let n=e.payload;o.address=n,o.publicKey=new To.Address(n).hex()},setAccount:(o,e)=>{let n=o.address===e.payload.address;o.accounts={[o.address]:n?e.payload:Ee},o.isAccountLoading=!1,o.accountLoadingError=null},setAccountNonce:(o,e)=>{let{address:n}=o;o.accounts[n].nonce=e.payload},setAccountShard:(o,e)=>{o.shard=e.payload},setLedgerAccount:(o,e)=>{o.ledgerAccount=e.payload},updateLedgerAccount:(o,e)=>{o.ledgerAccount!=null&&(o.ledgerAccount.index=e.payload.index,o.ledgerAccount.address=e.payload.address)},setWalletConnectAccount:(o,e)=>{o.walletConnectAccount=e.payload},setIsAccountLoading:(o,e)=>{o.isAccountLoading=e.payload,o.accountLoadingError=null},setAccountLoadingError:(o,e)=>{o.accountLoadingError=e.payload,o.isAccountLoading=!1},setWebsocketEvent:(o,e)=>{o.websocketEvent={timestamp:Date.now(),message:e.payload}}},extraReducers:o=>{o.addCase(L,()=>(te.local.removeItem(J.loginExpiresAt),yo)),o.addCase(Ie,(e,n)=>{let{address:t}=n.payload;e.address=t,e.publicKey=new To.Address(t).hex()}),o.addCase(ot.REHYDRATE,(e,n)=>{var g;if(!((g=n.payload)!=null&&g.account))return;let{account:t}=n.payload,{address:a,shard:m,accounts:_,publicKey:l}=t;e.address=a,e.shard=m;let d=_&&a in _;e.accounts=d?_:yo.accounts,e.publicKey=l})}}),{setAccount:tt,setAddress:ec,setAccountNonce:rt,setAccountShard:oc,setLedgerAccount:nc,updateLedgerAccount:tc,setWalletConnectAccount:rc,setIsAccountLoading:ac,setAccountLoadingError:ic,setWebsocketEvent:pc}=nt.actions,at=nt.reducer});function it(o){return o!=null&&(da(o)||fa(o))}function Le(o){return o!=null&&(la(o)||ha(o))}function Ne(o){return o!=null&&(ga(o)||xa(o))}function pt(o){return o!=null&&ua(o)}function da(o){return o!=null&&aa.includes(o)}function la(o){return o!=null&&ia.includes(o)}function ga(o){return o!=null&&pa.includes(o)}function ua(o){return o!=null&&ca.includes(o)}function fa(o){return o!=null&&ma.includes(o)}function ha(o){return o!=null&&_a.includes(o)}function xa(o){return o!=null&&sa.includes(o)}var aa,ia,pa,ca,ma,_a,sa,ko=f(()=>{"use strict";r();R();aa=["sent"],ia=["success"],pa=["fail","cancelled","timedOut"],ca=["timedOut"],ma=["pending"],_a=["success"],sa=["fail","invalid"]});var ct,mt,ue,ba,_t,fc,hc,xc,bc,yc,Tc,wc,Sc,kc,vc,De,Ce=f(()=>{"use strict";r();ct=require("@reduxjs/toolkit"),mt=require("redux-persist");R();ko();G();ue={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},ba={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},_t=(0,ct.createSlice)({name:"transactionsSlice",initialState:ue,reducers:{moveTransactionsToSignedState:(o,e)=>{var d,g;let{sessionId:n,transactions:t,errorMessage:a,status:m,redirectRoute:_}=e.payload,l=((d=o.customTransactionInformationForSessionId)==null?void 0:d[n])||ba;o.signedTransactions[n]={transactions:t,status:m,errorMessage:a,redirectRoute:_,customTransactionInformation:l},((g=o==null?void 0:o.transactionsToSign)==null?void 0:g.sessionId)===n&&(o.transactionsToSign=ue.transactionsToSign)},clearSignedTransaction:(o,e)=>{o.signedTransactions[e.payload]&&delete o.signedTransactions[e.payload]},clearTransactionToSign:o=>{o!=null&&o.transactionsToSign&&(o.transactionsToSign=null)},updateSignedTransaction:(o,e)=>{o.signedTransactions=b(b({},o.signedTransactions),e.payload)},updateSignedTransactions:(o,e)=>{let{sessionId:n,status:t,errorMessage:a,transactions:m}=e.payload;o.signedTransactions[n]!=null&&(o.signedTransactions[n].status=t,a!=null&&(o.signedTransactions[n].errorMessage=a),m!=null&&(o.signedTransactions[n].transactions=m))},updateSignedTransactionStatus:(o,e)=>{var l,d,g,x,h,v;let{sessionId:n,status:t,errorMessage:a,transactionHash:m}=e.payload,_=(d=(l=o.signedTransactions)==null?void 0:l[n])==null?void 0:d.transactions;if(_!=null){o.signedTransactions[n].transactions=_.map(B=>B.hash===m?k(b({},B),{status:t,errorMessage:a}):B);let A=(x=(g=o.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:x.every(B=>Le(B.status)),j=(v=(h=o.signedTransactions[n])==null?void 0:h.transactions)==null?void 0:v.every(B=>Ne(B.status));A&&(o.signedTransactions[n].status="success"),j&&(o.signedTransactions[n].status="fail")}},setTransactionsToSign:(o,e)=>{o.transactionsToSign=e.payload;let{sessionId:n,customTransactionInformation:t}=e.payload;o.customTransactionInformationForSessionId[n]=t,o.signTransactionsError=null},clearAllTransactionsToSign:o=>{o.transactionsToSign=ue.transactionsToSign,o.signTransactionsError=null},clearAllSignedTransactions:o=>{o.signedTransactions=ue.signedTransactions},setSignTransactionsError:(o,e)=>{o.signTransactionsError=e.payload},setSignTransactionsCancelMessage:(o,e)=>{o.signTransactionsCancelMessage=e.payload}},extraReducers:o=>{o.addCase(L,()=>ue),o.addCase(mt.REHYDRATE,(e,n)=>{var _;if(e.signTransactionsCancelMessage=null,!((_=n.payload)!=null&&_.transactions))return;let{signedTransactions:t,customTransactionInformationForSessionId:a}=n.payload.transactions,m=Object.entries(t).reduce((l,[d,g])=>{let x=new Date(d),h=new Date;return h.setHours(h.getHours()+5),h-x>0||(l[d]=g),l},{});a!=null&&(e.customTransactionInformationForSessionId=a),t!=null&&(e.signedTransactions=m)})}}),{updateSignedTransactionStatus:fc,updateSignedTransactions:hc,setTransactionsToSign:xc,clearAllTransactionsToSign:bc,clearAllSignedTransactions:yc,clearSignedTransaction:Tc,clearTransactionToSign:wc,setSignTransactionsError:Sc,setSignTransactionsCancelMessage:kc,moveTransactionsToSignedState:vc}=_t.actions,De=_t.reducer});var st,Ao,Io,Eo,ya,vo,dt,Lc,Nc,Dc,Re,Pe=f(()=>{"use strict";r();st=require("@reduxjs/toolkit");G();Ao="Transaction failed",Io="Transaction successful",Eo="Processing transaction",ya="Transaction submitted",vo={},dt=(0,st.createSlice)({name:"transactionsInfo",initialState:vo,reducers:{setTransactionsDisplayInfo(o,e){let{sessionId:n,transactionsDisplayInfo:t}=e.payload;n!=null&&(o[n]={errorMessage:(t==null?void 0:t.errorMessage)||Ao,successMessage:(t==null?void 0:t.successMessage)||Io,processingMessage:(t==null?void 0:t.processingMessage)||Eo,submittedMessage:(t==null?void 0:t.submittedMessage)||ya,transactionDuration:t==null?void 0:t.transactionDuration})},clearTransactionsInfoForSessionId(o,e){e.payload!=null&&delete o[e.payload]},clearTransactionsInfo:()=>vo},extraReducers:o=>{o.addCase(L,()=>vo)}}),{clearTransactionsInfo:Lc,setTransactionsDisplayInfo:Nc,clearTransactionsInfoForSessionId:Dc}=dt.actions,Re=dt.reducer});var gt,lt,ut,Fc,Mc,Oc,Bc,ft,Lo=f(()=>{"use strict";r();gt=require("@reduxjs/toolkit");G();lt={},ut=(0,gt.createSlice)({name:"modalsSlice",initialState:lt,reducers:{setTxSubmittedModal:(o,e)=>{o.txSubmittedModal=e.payload},setNotificationModal:(o,e)=>{o.notificationModal=e.payload},clearTxSubmittedModal:o=>{o.txSubmittedModal=void 0},clearNotificationModal:o=>{o.notificationModal=void 0}},extraReducers:o=>{o.addCase(L,()=>lt)}}),{setTxSubmittedModal:Fc,setNotificationModal:Mc,clearTxSubmittedModal:Oc,clearNotificationModal:Bc}=ut.actions,ft=ut.reducer});var xt,bt,ht,yt,zc,qc,Kc,Xc,Yc,Zc,Fe,Me=f(()=>{"use strict";r();xt=require("@reduxjs/toolkit"),bt=require("redux-persist");so();W();ro();G();ht={customToasts:[],transactionToasts:[],failTransactionToast:null},yt=(0,xt.createSlice)({name:"toastsSlice",initialState:ht,reducers:{addCustomToast:(o,e)=>{o.customToasts.push(k(b({},e.payload),{type:"custom",toastId:e.payload.toastId||`custom-toast-${o.customToasts.length+1}`}))},removeCustomToast:(o,e)=>{o.customToasts=o.customToasts.filter(n=>n.toastId!==e.payload)},addTransactionToast:(o,e)=>{o.transactionToasts.push({type:"transaction",startTimestamp:ke(),toastId:e.payload||`custom-toast-${o.transactionToasts.length+1}`})},removeTransactionToast:(o,e)=>{o.transactionToasts=o.transactionToasts.filter(n=>n.toastId!==e.payload)},addFailTransactionToast:(o,e)=>{o.failTransactionToast=k(b({},e.payload),{toastId:On})},removeFailTransactionToast:o=>{o.failTransactionToast=null}},extraReducers:o=>{o.addCase(L,()=>ht),o.addCase(bt.REHYDRATE,(e,n)=>{var a,m;let t=(m=(a=n.customToasts)==null?void 0:a.filter(_=>!("component"in _)))!=null?m:[];e.customToasts=t})}}),{addCustomToast:zc,removeCustomToast:qc,addTransactionToast:Kc,removeTransactionToast:Xc,addFailTransactionToast:Yc,removeFailTransactionToast:Zc}=yt.actions,Fe=yt.reducer});var ae=f(()=>{"use strict";r();fo();bo();wo();Ce();Pe();Lo();Me()});var No=f(()=>{"use strict";r()});var kt,St,vt,hm,xm,bm,ym,Tm,wm,At,It=f(()=>{"use strict";r();kt=require("@reduxjs/toolkit");G();St={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},vt=(0,kt.createSlice)({name:"dappModalsSlice",initialState:St,reducers:{setDappModalVisibility:(o,e)=>{o.visible=e.payload},setDappModalHeaderVisibility:(o,e)=>{o.modal.showHeader=e.payload},setDappModalFooterVisibility:(o,e)=>{o.modal.showFooter=e.payload},setDappModalHeaderText:(o,e)=>{o.modal.headerText=e.payload},setDappModalFooterText:(o,e)=>{o.modal.footerText=e.payload},setDappModalConfig:(o,e)=>{o.modal=b({},e.payload)}},extraReducers:o=>{o.addCase(L,()=>St)}}),{setDappModalVisibility:hm,setDappModalHeaderVisibility:xm,setDappModalFooterVisibility:bm,setDappModalHeaderText:ym,setDappModalFooterText:Tm,setDappModalConfig:wm}=vt.actions,At=vt.reducer});var Et,ka,va,ie,Be=f(()=>{"use strict";r();Et=require("@reduxjs/toolkit");No();wo();It();fo();Lo();bo();Me();Pe();Ce();ka={["account"]:at,["networkConfig"]:Qn,["loginInfo"]:Wn,["modals"]:ft,["dappModal"]:At,["toasts"]:Fe,["transactions"]:De,["transactionsInfo"]:Re},va=(o={})=>(0,Et.combineReducers)(b(b({},ka),o)),ie=va});var Dt={};K(Dt,{default:()=>Ca});function Do(o,e=[]){return{key:o,version:1,storage:Nt.default,blacklist:e}}var Q,Lt,Nt,Aa,Ia,Ea,La,Na,Da,Ca,Ct=f(()=>{"use strict";r();Q=require("redux-persist"),Lt=y(require("redux-persist/lib/storage")),Nt=y(require("redux-persist/lib/storage/session"));Be();ae();Me();Pe();Ce();No();Aa={2:o=>k(b({},o),{networkConfig:xo})};Ia=Do("dapp-core-transactionsInfo"),Ea=Do("dapp-core-transactions",["transactionsToSign"]),La=Do("dapp-core-toasts"),Na={key:"dapp-core-store",version:2,storage:Lt.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,Q.createMigrate)(Aa,{debug:!1})},Da={["toasts"]:(0,Q.persistReducer)(La,Fe),["transactions"]:(0,Q.persistReducer)(Ea,De),["transactionsInfo"]:(0,Q.persistReducer)(Ia,Re)},Ca=(0,Q.persistReducer)(Na,ie(Da))});var Rt={};K(Rt,{default:()=>Ra});var Ra,Pt=f(()=>{"use strict";r();Be();Ra=ie()});var Ft={};K(Ft,{default:()=>Fa});var C,Pa,Fa,Mt=f(()=>{"use strict";r();C=require("redux-persist"),Pa=[C.FLUSH,C.REHYDRATE,C.PAUSE,C.PERSIST,C.PURGE,C.REGISTER],Fa=Pa});var Ut={};K(Ut,{default:()=>Bt});function Bt(o){return(0,Ot.persistStore)(o)}var Ot,Vt=f(()=>{"use strict";r();Ot=require("redux-persist")});var wi={};K(wi,{ExplorerLink:()=>Ti});module.exports=se(wi);r();r();var Wo=y(require("react")),sr=require("@fortawesome/free-solid-svg-icons"),dr=require("@fortawesome/react-fontawesome"),lr=y(require("classnames"));r();r();var zt=require("react"),ce=require("react-redux");r();var Co=require("@reduxjs/toolkit"),Wt=require("react-redux/es/utils/Subscription");ae();r();var Tt=y(require("lodash.throttle"));w();ae();co();ve();de();var Ta=[Ae],wa=(0,Tt.default)(()=>{ge(le())},5e3),wt=o=>e=>n=>{var d;if(Ta.includes(n.type))return e(n);let t=o.getState(),a=te.local.getItem(J.loginExpiresAt);if(!((d=t==null?void 0:t.loginInfo)==null?void 0:d.isLoggedIn))return e(n);if(a==null)return ge(le());let _=Date.now();return a-_<0?setTimeout(()=>Ko(void 0,null,function*(){console.log("session expired");try{o.dispatch(jn())}catch(g){console.error("error logging out",g)}}),1e3):(wa(),e(n))};r();r();function Oe(){return typeof sessionStorage!="undefined"}var $t=Oe()?(Ct(),se(Dt)).default:(Pt(),se(Rt)).default,Ht=Oe()?(Mt(),se(Ft)).default:[],jt=Oe()?(Vt(),se(Ut)).default:o=>o;Be();var pe=(0,Co.configureStore)({reducer:$t,middleware:o=>o({serializableCheck:{ignoredActions:[...Ht,rt.type,tt.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(wt)}),Gt=(0,Wt.createSubscription)(pe),qm=jt(pe),Km=(0,Co.configureStore)({reducer:ie});var Ma={store:pe,subscription:Gt},Ro=(0,zt.createContext)(Ma),Jm=(0,ce.createStoreHook)(Ro),Qm=(0,ce.createDispatchHook)(Ro),qt=(0,ce.createSelectorHook)(Ro);r();r();ae();r();var Kt=y(require("lodash.isequal")),Ue=require("reselect"),u=(0,Ue.createSelectorCreator)(Ue.defaultMemoize,Kt.default);var H=o=>o.account,Po=u(H,o=>o.address),Fo=u(H,Po,(o,e)=>e in o.accounts?o.accounts[e]:Ee),r_=u(H,Fo,(o,e)=>{let a=o,{accounts:n}=a,t=xe(a,["accounts"]);return k(b({},t),{account:e})}),a_=u(Fo,o=>o.balance),i_=u(Fo,o=>{var e;return((e=o==null?void 0:o.nonce)==null?void 0:e.valueOf())||0}),p_=u(H,o=>o.shard),c_=u(H,o=>o.ledgerAccount),m_=u(H,o=>o.walletConnectAccount),__=u(H,o=>o.isAccountLoading),s_=u(H,o=>o.accountLoadingError),d_=u(H,o=>o.websocketEvent);r();var z=o=>o.networkConfig,u_=u(z,o=>o.chainID),f_=u(z,o=>o.network.walletConnectBridgeAddress),h_=u(z,o=>o.network.walletConnectV2RelayAddress),x_=u(z,o=>o.network.walletConnectV2ProjectId),b_=u(z,o=>o.network.walletConnectDeepLink),Mo=u(z,o=>o.network),y_=u(Mo,o=>o.apiAddress),Xt=u(Mo,o=>o.explorerAddress),T_=u(Mo,o=>o.egldLabel);r();R();var me=o=>o.loginInfo,A_=u(me,o=>o.loginMethod),I_=u(me,Po,(o,e)=>o.loginMethod!=""&&Boolean(e)),E_=u(me,o=>o.walletConnectLogin),L_=u(me,o=>o.ledgerLogin),N_=u(me,o=>o.walletLogin),D_=u(me,o=>o.isLoginSessionInvalid);r();r();var N=require("@elrondnetwork/erdjs");w();r();function Oo(o){try{return i.Buffer.from(o,"base64").toString()===atob(o)}catch(e){return!1}}function Bo(o){var a,m,_;let{data:e}=o,n=Oo(e!=null?e:"")?N.TransactionPayload.fromEncoded(e):new N.TransactionPayload(e),t=new N.Transaction(b({value:o.value.valueOf(),data:n,nonce:o.nonce.valueOf(),receiver:new N.Address(o.receiver),sender:new N.Address(o.sender),gasLimit:(a=o.gasLimit.valueOf())!=null?a:lo,gasPrice:(m=o.gasPrice.valueOf())!=null?m:go,chainID:o.chainID.valueOf(),version:new N.TransactionVersion((_=o.version)!=null?_:Bn)},o.options?{options:new N.TransactionOptions(o.options)}:{}));return t.applySignature({hex:()=>o.signature||""},new N.Address(o.sender)),t}r();ko();r();var Ba=y(require("bignumber.js"));W();r();r();r();r();var Va=require("@elrondnetwork/erdjs"),$a=y(require("bignumber.js"));R();r();var Ua=require("@elrondnetwork/erdjs");r();r();r();var ja=require("@elrondnetwork/erdjs/out");r();w();r();var Qt=require("@elrondnetwork/erdjs");W();r();r();r();r();R();r();r();r();r();r();r();r();r();r();r();r();I();r();var er=!1;function za(o){er||(console.error(o),er=!0)}function Uo({explorerAddress:o,to:e}){try{return new URL(e).href}catch(n){return e.startsWith("/")||(za(`Link not prepended by / : ${e}`),e=`/${e}`),o?`${o}${e}`:e}}r();I();r();r();r();var Ya=y(require("bignumber.js"));w();r();var Xa=require("@elrondnetwork/erdjs"),Vo=y(require("bignumber.js"));w();r();var qa=y(require("bignumber.js"));r();Vo.default.config({ROUNDING_MODE:Vo.default.ROUND_FLOOR});r();r();r();w();r();r();r();r();w();r();w();r();var Za=require("@elrondnetwork/erdjs");w();r();var He=require("@elrondnetwork/erdjs"),Qa=require("@elrondnetwork/erdjs"),ei=require("@elrondnetwork/erdjs-network-providers");w();r();r();var Ja=y(require("bignumber.js"));w();r();w();r();r();r();r();r();w();r();I();var ni=["reDelegateRewards","claimRewards","unBond"],ti=["wrapEgld","unwrapEgld"],ri=["unStake"],ai=["unDelegate"];r();r();r();w();r();var ci=y(require("bignumber.js"));r();r();r();I();r();var mi=y(require("bignumber.js"));r();r();r();r();I();r();r();r();var si=y(require("anchorme"));r();w();r();var di=y(require("bignumber.js"));r();W();r();r();R();r();R();r();r();r();I();r();I();r();var li=y(require("bignumber.js"));w();I();r();I();r();var ar=require("react");W();r();r();I();r();var gi=require("@elrondnetwork/erdjs/out"),ui=y(require("bignumber.js"));I();r();I();r();r();R();var pf=[