UNPKG

@sofaws/dapp-core

Version:

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

1 lines 157 kB
"use strict";var Nr=Object.create;var fe=Object.defineProperty,Dr=Object.defineProperties,Cr=Object.getOwnPropertyDescriptor,Pr=Object.getOwnPropertyDescriptors,Rr=Object.getOwnPropertyNames,ke=Object.getOwnPropertySymbols,Mr=Object.getPrototypeOf,oo=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable;var rn=(o,e,n)=>e in o?fe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n,b=(o,e)=>{for(var n in e||(e={}))oo.call(e,n)&&rn(o,n,e[n]);if(ke)for(var n of ke(e))an.call(e,n)&&rn(o,n,e[n]);return o},T=(o,e)=>Dr(o,Pr(e));var Ae=(o,e)=>{var n={};for(var r in o)oo.call(o,r)&&e.indexOf(r)<0&&(n[r]=o[r]);if(o!=null&&ke)for(var r of ke(o))e.indexOf(r)<0&&an.call(o,r)&&(n[r]=o[r]);return n};var x=(o,e)=>()=>(o&&(e=o(o=0)),e);var Ie=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),J=(o,e)=>{for(var n in e)fe(o,n,{get:e[n],enumerable:!0})},pn=(o,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Rr(e))!oo.call(o,a)&&a!==n&&fe(o,a,{get:()=>e[a],enumerable:!(r=Cr(e,a))||r.enumerable});return o};var y=(o,e,n)=>(n=o!=null?Nr(Mr(o)):{},pn(e||!o||!o.__esModule?fe(n,"default",{value:o,enumerable:!0}):n,o)),xe=o=>pn(fe({},"__esModule",{value:!0}),o);var D=(o,e,n)=>new Promise((r,a)=>{var m=d=>{try{l(n.next(d))}catch(g){a(g)}},s=d=>{try{l(n.throw(d))}catch(g){a(g)}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(m,s);l((n=n.apply(o,e)).next())});var sn=Ie(Ee=>{"use strict";t();Ee.byteLength=Or;Ee.toByteArray=Ur;Ee.fromByteArray=Wr;var B=[],R=[],Fr=typeof Uint8Array!="undefined"?Uint8Array:Array,no="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Q=0,cn=no.length;Q<cn;++Q)B[Q]=no[Q],R[no.charCodeAt(Q)]=Q;var Q,cn;R["-".charCodeAt(0)]=62;R["_".charCodeAt(0)]=63;function mn(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 r=n===e?0:4-n%4;return[n,r]}function Or(o){var e=mn(o),n=e[0],r=e[1];return(n+r)*3/4-r}function Br(o,e,n){return(e+n)*3/4-n}function Ur(o){var e,n=mn(o),r=n[0],a=n[1],m=new Fr(Br(o,r,a)),s=0,l=a>0?r-4:r,d;for(d=0;d<l;d+=4)e=R[o.charCodeAt(d)]<<18|R[o.charCodeAt(d+1)]<<12|R[o.charCodeAt(d+2)]<<6|R[o.charCodeAt(d+3)],m[s++]=e>>16&255,m[s++]=e>>8&255,m[s++]=e&255;return a===2&&(e=R[o.charCodeAt(d)]<<2|R[o.charCodeAt(d+1)]>>4,m[s++]=e&255),a===1&&(e=R[o.charCodeAt(d)]<<10|R[o.charCodeAt(d+1)]<<4|R[o.charCodeAt(d+2)]>>2,m[s++]=e>>8&255,m[s++]=e&255),m}function $r(o){return B[o>>18&63]+B[o>>12&63]+B[o>>6&63]+B[o&63]}function Vr(o,e,n){for(var r,a=[],m=e;m<n;m+=3)r=(o[m]<<16&16711680)+(o[m+1]<<8&65280)+(o[m+2]&255),a.push($r(r));return a.join("")}function Wr(o){for(var e,n=o.length,r=n%3,a=[],m=16383,s=0,l=n-r;s<l;s+=m)a.push(Vr(o,s,s+m>l?l:s+m));return r===1?(e=o[n-1],a.push(B[e>>2]+B[e<<4&63]+"==")):r===2&&(e=(o[n-2]<<8)+o[n-1],a.push(B[e>>10]+B[e>>4&63]+B[e<<2&63]+"=")),a.join("")}});var _n=Ie(to=>{t();to.read=function(o,e,n,r,a){var m,s,l=a*8-r-1,d=(1<<l)-1,g=d>>1,h=-7,f=n?a-1:0,S=n?-1:1,A=o[e+f];for(f+=S,m=A&(1<<-h)-1,A>>=-h,h+=l;h>0;m=m*256+o[e+f],f+=S,h-=8);for(s=m&(1<<-h)-1,m>>=-h,h+=r;h>0;s=s*256+o[e+f],f+=S,h-=8);if(m===0)m=1-g;else{if(m===d)return s?NaN:(A?-1:1)*(1/0);s=s+Math.pow(2,r),m=m-g}return(A?-1:1)*s*Math.pow(2,m-r)};to.write=function(o,e,n,r,a,m){var s,l,d,g=m*8-a-1,h=(1<<g)-1,f=h>>1,S=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:m-1,F=r?1:-1,O=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-s))<1&&(s--,d*=2),s+f>=1?e+=S/d:e+=S*Math.pow(2,1-f),e*d>=2&&(s++,d/=2),s+f>=h?(l=0,s=h):s+f>=1?(l=(e*d-1)*Math.pow(2,a),s=s+f):(l=e*Math.pow(2,f-1)*Math.pow(2,a),s=0));a>=8;o[n+A]=l&255,A+=F,l/=256,a-=8);for(s=s<<a|l,g+=a;g>0;o[n+A]=s&255,A+=F,s/=256,g-=8);o[n+A-F]|=O*128}});var vn=Ie(ae=>{"use strict";t();var ro=sn(),re=_n(),dn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ae.Buffer=_;ae.SlowBuffer=Kr;ae.INSPECT_MAX_BYTES=50;var Le=2147483647;ae.kMaxLength=Le;_.TYPED_ARRAY_SUPPORT=Hr();!_.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 Hr(){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(_.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 z(o){if(o>Le)throw new RangeError('The value "'+o+'" is invalid for option "size"');var e=new Uint8Array(o);return Object.setPrototypeOf(e,_.prototype),e}function _(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 co(o)}return un(o,e,n)}_.poolSize=8192;function un(o,e,n){if(typeof o=="string")return zr(o,e);if(ArrayBuffer.isView(o))return Gr(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(U(o,ArrayBuffer)||o&&U(o.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(U(o,SharedArrayBuffer)||o&&U(o.buffer,SharedArrayBuffer)))return io(o,e,n);if(typeof o=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var r=o.valueOf&&o.valueOf();if(r!=null&&r!==o)return _.from(r,e,n);var a=qr(o);if(a)return a;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof o[Symbol.toPrimitive]=="function")return _.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)}_.from=function(o,e,n){return un(o,e,n)};Object.setPrototypeOf(_.prototype,Uint8Array.prototype);Object.setPrototypeOf(_,Uint8Array);function fn(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 jr(o,e,n){return fn(o),o<=0?z(o):e!==void 0?typeof n=="string"?z(o).fill(e,n):z(o).fill(e):z(o)}_.alloc=function(o,e,n){return jr(o,e,n)};function co(o){return fn(o),z(o<0?0:mo(o)|0)}_.allocUnsafe=function(o){return co(o)};_.allocUnsafeSlow=function(o){return co(o)};function zr(o,e){if((typeof e!="string"||e==="")&&(e="utf8"),!_.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=xn(o,e)|0,r=z(n),a=r.write(o,e);return a!==n&&(r=r.slice(0,a)),r}function ao(o){for(var e=o.length<0?0:mo(o.length)|0,n=z(e),r=0;r<e;r+=1)n[r]=o[r]&255;return n}function Gr(o){if(U(o,Uint8Array)){var e=new Uint8Array(o);return io(e.buffer,e.byteOffset,e.byteLength)}return ao(o)}function io(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 r;return e===void 0&&n===void 0?r=new Uint8Array(o):n===void 0?r=new Uint8Array(o,e):r=new Uint8Array(o,e,n),Object.setPrototypeOf(r,_.prototype),r}function qr(o){if(_.isBuffer(o)){var e=mo(o.length)|0,n=z(e);return n.length===0||o.copy(n,0,0,e),n}if(o.length!==void 0)return typeof o.length!="number"||so(o.length)?z(0):ao(o);if(o.type==="Buffer"&&Array.isArray(o.data))return ao(o.data)}function mo(o){if(o>=Le)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Le.toString(16)+" bytes");return o|0}function Kr(o){return+o!=o&&(o=0),_.alloc(+o)}_.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==_.prototype};_.compare=function(e,n){if(U(e,Uint8Array)&&(e=_.from(e,e.offset,e.byteLength)),U(n,Uint8Array)&&(n=_.from(n,n.offset,n.byteLength)),!_.isBuffer(e)||!_.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===n)return 0;for(var r=e.length,a=n.length,m=0,s=Math.min(r,a);m<s;++m)if(e[m]!==n[m]){r=e[m],a=n[m];break}return r<a?-1:a<r?1:0};_.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}};_.concat=function(e,n){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return _.alloc(0);var r;if(n===void 0)for(n=0,r=0;r<e.length;++r)n+=e[r].length;var a=_.allocUnsafe(n),m=0;for(r=0;r<e.length;++r){var s=e[r];if(U(s,Uint8Array))m+s.length>a.length?_.from(s).copy(a,m):Uint8Array.prototype.set.call(a,s,m);else if(_.isBuffer(s))s.copy(a,m);else throw new TypeError('"list" argument must be an Array of Buffers');m+=s.length}return a};function xn(o,e){if(_.isBuffer(o))return o.length;if(ArrayBuffer.isView(o)||U(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,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return po(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 r?-1:po(o).length;e=(""+e).toLowerCase(),a=!0}}_.byteLength=xn;function Xr(o,e,n){var r=!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 aa(this,e,n);case"utf8":case"utf-8":return bn(this,e,n);case"ascii":return ta(this,e,n);case"latin1":case"binary":return ra(this,e,n);case"base64":return oa(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ia(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),r=!0}}_.prototype._isBuffer=!0;function ee(o,e,n){var r=o[e];o[e]=o[n],o[n]=r}_.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)ee(this,n,n+1);return this};_.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)ee(this,n,n+3),ee(this,n+1,n+2);return this};_.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)ee(this,n,n+7),ee(this,n+1,n+6),ee(this,n+2,n+5),ee(this,n+3,n+4);return this};_.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?bn(this,0,e):Xr.apply(this,arguments)};_.prototype.toLocaleString=_.prototype.toString;_.prototype.equals=function(e){if(!_.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:_.compare(this,e)===0};_.prototype.inspect=function(){var e="",n=ae.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"};dn&&(_.prototype[dn]=_.prototype.inspect);_.prototype.compare=function(e,n,r,a,m){if(U(e,Uint8Array)&&(e=_.from(e,e.offset,e.byteLength)),!_.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),r===void 0&&(r=e?e.length:0),a===void 0&&(a=0),m===void 0&&(m=this.length),n<0||r>e.length||a<0||m>this.length)throw new RangeError("out of range index");if(a>=m&&n>=r)return 0;if(a>=m)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,a>>>=0,m>>>=0,this===e)return 0;for(var s=m-a,l=r-n,d=Math.min(s,l),g=this.slice(a,m),h=e.slice(n,r),f=0;f<d;++f)if(g[f]!==h[f]){s=g[f],l=h[f];break}return s<l?-1:l<s?1:0};function hn(o,e,n,r,a){if(o.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,so(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=_.from(e,r)),_.isBuffer(e))return e.length===0?-1:ln(o,e,n,r,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):ln(o,[e],n,r,a);throw new TypeError("val must be string, number or Buffer")}function ln(o,e,n,r,a){var m=1,s=o.length,l=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(o.length<2||e.length<2)return-1;m=2,s/=2,l/=2,n/=2}function d(A,F){return m===1?A[F]:A.readUInt16BE(F*m)}var g;if(a){var h=-1;for(g=n;g<s;g++)if(d(o,g)===d(e,h===-1?0:g-h)){if(h===-1&&(h=g),g-h+1===l)return h*m}else h!==-1&&(g-=g-h),h=-1}else for(n+l>s&&(n=s-l),g=n;g>=0;g--){for(var f=!0,S=0;S<l;S++)if(d(o,g+S)!==d(e,S)){f=!1;break}if(f)return g}return-1}_.prototype.includes=function(e,n,r){return this.indexOf(e,n,r)!==-1};_.prototype.indexOf=function(e,n,r){return hn(this,e,n,r,!0)};_.prototype.lastIndexOf=function(e,n,r){return hn(this,e,n,r,!1)};function Yr(o,e,n,r){n=Number(n)||0;var a=o.length-n;r?(r=Number(r),r>a&&(r=a)):r=a;var m=e.length;r>m/2&&(r=m/2);for(var s=0;s<r;++s){var l=parseInt(e.substr(s*2,2),16);if(so(l))return s;o[n+s]=l}return s}function Zr(o,e,n,r){return Ne(po(e,o.length-n),o,n,r)}function Jr(o,e,n,r){return Ne(ma(e),o,n,r)}function Qr(o,e,n,r){return Ne(Sn(e),o,n,r)}function ea(o,e,n,r){return Ne(sa(e,o.length-n),o,n,r)}_.prototype.write=function(e,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 m=this.length-n;if((r===void 0||r>m)&&(r=m),e.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var s=!1;;)switch(a){case"hex":return Yr(this,e,n,r);case"utf8":case"utf-8":return Zr(this,e,n,r);case"ascii":case"latin1":case"binary":return Jr(this,e,n,r);case"base64":return Qr(this,e,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ea(this,e,n,r);default:if(s)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),s=!0}};_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function oa(o,e,n){return e===0&&n===o.length?ro.fromByteArray(o):ro.fromByteArray(o.slice(e,n))}function bn(o,e,n){n=Math.min(o.length,n);for(var r=[],a=e;a<n;){var m=o[a],s=null,l=m>239?4:m>223?3:m>191?2:1;if(a+l<=n){var d,g,h,f;switch(l){case 1:m<128&&(s=m);break;case 2:d=o[a+1],(d&192)===128&&(f=(m&31)<<6|d&63,f>127&&(s=f));break;case 3:d=o[a+1],g=o[a+2],(d&192)===128&&(g&192)===128&&(f=(m&15)<<12|(d&63)<<6|g&63,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:d=o[a+1],g=o[a+2],h=o[a+3],(d&192)===128&&(g&192)===128&&(h&192)===128&&(f=(m&15)<<18|(d&63)<<12|(g&63)<<6|h&63,f>65535&&f<1114112&&(s=f))}}s===null?(s=65533,l=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),a+=l}return na(r)}var gn=4096;function na(o){var e=o.length;if(e<=gn)return String.fromCharCode.apply(String,o);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,o.slice(r,r+=gn));return n}function ta(o,e,n){var r="";n=Math.min(o.length,n);for(var a=e;a<n;++a)r+=String.fromCharCode(o[a]&127);return r}function ra(o,e,n){var r="";n=Math.min(o.length,n);for(var a=e;a<n;++a)r+=String.fromCharCode(o[a]);return r}function aa(o,e,n){var r=o.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var a="",m=e;m<n;++m)a+=_a[o[m]];return a}function ia(o,e,n){for(var r=o.slice(e,n),a="",m=0;m<r.length-1;m+=2)a+=String.fromCharCode(r[m]+r[m+1]*256);return a}_.prototype.slice=function(e,n){var r=this.length;e=~~e,n=n===void 0?r:~~n,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n<e&&(n=e);var a=this.subarray(e,n);return Object.setPrototypeOf(a,_.prototype),a};function I(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")}_.prototype.readUintLE=_.prototype.readUIntLE=function(e,n,r){e=e>>>0,n=n>>>0,r||I(e,n,this.length);for(var a=this[e],m=1,s=0;++s<n&&(m*=256);)a+=this[e+s]*m;return a};_.prototype.readUintBE=_.prototype.readUIntBE=function(e,n,r){e=e>>>0,n=n>>>0,r||I(e,n,this.length);for(var a=this[e+--n],m=1;n>0&&(m*=256);)a+=this[e+--n]*m;return a};_.prototype.readUint8=_.prototype.readUInt8=function(e,n){return e=e>>>0,n||I(e,1,this.length),this[e]};_.prototype.readUint16LE=_.prototype.readUInt16LE=function(e,n){return e=e>>>0,n||I(e,2,this.length),this[e]|this[e+1]<<8};_.prototype.readUint16BE=_.prototype.readUInt16BE=function(e,n){return e=e>>>0,n||I(e,2,this.length),this[e]<<8|this[e+1]};_.prototype.readUint32LE=_.prototype.readUInt32LE=function(e,n){return e=e>>>0,n||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};_.prototype.readUint32BE=_.prototype.readUInt32BE=function(e,n){return e=e>>>0,n||I(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};_.prototype.readIntLE=function(e,n,r){e=e>>>0,n=n>>>0,r||I(e,n,this.length);for(var a=this[e],m=1,s=0;++s<n&&(m*=256);)a+=this[e+s]*m;return m*=128,a>=m&&(a-=Math.pow(2,8*n)),a};_.prototype.readIntBE=function(e,n,r){e=e>>>0,n=n>>>0,r||I(e,n,this.length);for(var a=n,m=1,s=this[e+--a];a>0&&(m*=256);)s+=this[e+--a]*m;return m*=128,s>=m&&(s-=Math.pow(2,8*n)),s};_.prototype.readInt8=function(e,n){return e=e>>>0,n||I(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};_.prototype.readInt16LE=function(e,n){e=e>>>0,n||I(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};_.prototype.readInt16BE=function(e,n){e=e>>>0,n||I(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};_.prototype.readInt32LE=function(e,n){return e=e>>>0,n||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};_.prototype.readInt32BE=function(e,n){return e=e>>>0,n||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};_.prototype.readFloatLE=function(e,n){return e=e>>>0,n||I(e,4,this.length),re.read(this,e,!0,23,4)};_.prototype.readFloatBE=function(e,n){return e=e>>>0,n||I(e,4,this.length),re.read(this,e,!1,23,4)};_.prototype.readDoubleLE=function(e,n){return e=e>>>0,n||I(e,8,this.length),re.read(this,e,!0,52,8)};_.prototype.readDoubleBE=function(e,n){return e=e>>>0,n||I(e,8,this.length),re.read(this,e,!1,52,8)};function N(o,e,n,r,a,m){if(!_.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+r>o.length)throw new RangeError("Index out of range")}_.prototype.writeUintLE=_.prototype.writeUIntLE=function(e,n,r,a){if(e=+e,n=n>>>0,r=r>>>0,!a){var m=Math.pow(2,8*r)-1;N(this,e,n,r,m,0)}var s=1,l=0;for(this[n]=e&255;++l<r&&(s*=256);)this[n+l]=e/s&255;return n+r};_.prototype.writeUintBE=_.prototype.writeUIntBE=function(e,n,r,a){if(e=+e,n=n>>>0,r=r>>>0,!a){var m=Math.pow(2,8*r)-1;N(this,e,n,r,m,0)}var s=r-1,l=1;for(this[n+s]=e&255;--s>=0&&(l*=256);)this[n+s]=e/l&255;return n+r};_.prototype.writeUint8=_.prototype.writeUInt8=function(e,n,r){return e=+e,n=n>>>0,r||N(this,e,n,1,255,0),this[n]=e&255,n+1};_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(e,n,r){return e=+e,n=n>>>0,r||N(this,e,n,2,65535,0),this[n]=e&255,this[n+1]=e>>>8,n+2};_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(e,n,r){return e=+e,n=n>>>0,r||N(this,e,n,2,65535,0),this[n]=e>>>8,this[n+1]=e&255,n+2};_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(e,n,r){return e=+e,n=n>>>0,r||N(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};_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(e,n,r){return e=+e,n=n>>>0,r||N(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};_.prototype.writeIntLE=function(e,n,r,a){if(e=+e,n=n>>>0,!a){var m=Math.pow(2,8*r-1);N(this,e,n,r,m-1,-m)}var s=0,l=1,d=0;for(this[n]=e&255;++s<r&&(l*=256);)e<0&&d===0&&this[n+s-1]!==0&&(d=1),this[n+s]=(e/l>>0)-d&255;return n+r};_.prototype.writeIntBE=function(e,n,r,a){if(e=+e,n=n>>>0,!a){var m=Math.pow(2,8*r-1);N(this,e,n,r,m-1,-m)}var s=r-1,l=1,d=0;for(this[n+s]=e&255;--s>=0&&(l*=256);)e<0&&d===0&&this[n+s+1]!==0&&(d=1),this[n+s]=(e/l>>0)-d&255;return n+r};_.prototype.writeInt8=function(e,n,r){return e=+e,n=n>>>0,r||N(this,e,n,1,127,-128),e<0&&(e=255+e+1),this[n]=e&255,n+1};_.prototype.writeInt16LE=function(e,n,r){return e=+e,n=n>>>0,r||N(this,e,n,2,32767,-32768),this[n]=e&255,this[n+1]=e>>>8,n+2};_.prototype.writeInt16BE=function(e,n,r){return e=+e,n=n>>>0,r||N(this,e,n,2,32767,-32768),this[n]=e>>>8,this[n+1]=e&255,n+2};_.prototype.writeInt32LE=function(e,n,r){return e=+e,n=n>>>0,r||N(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};_.prototype.writeInt32BE=function(e,n,r){return e=+e,n=n>>>0,r||N(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 yn(o,e,n,r,a,m){if(n+r>o.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Tn(o,e,n,r,a){return e=+e,n=n>>>0,a||yn(o,e,n,4,34028234663852886e22,-34028234663852886e22),re.write(o,e,n,r,23,4),n+4}_.prototype.writeFloatLE=function(e,n,r){return Tn(this,e,n,!0,r)};_.prototype.writeFloatBE=function(e,n,r){return Tn(this,e,n,!1,r)};function wn(o,e,n,r,a){return e=+e,n=n>>>0,a||yn(o,e,n,8,17976931348623157e292,-17976931348623157e292),re.write(o,e,n,r,52,8),n+8}_.prototype.writeDoubleLE=function(e,n,r){return wn(this,e,n,!0,r)};_.prototype.writeDoubleBE=function(e,n,r){return wn(this,e,n,!1,r)};_.prototype.copy=function(e,n,r,a){if(!_.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!a&&a!==0&&(a=this.length),n>=e.length&&(n=e.length),n||(n=0),a>0&&a<r&&(a=r),a===r||e.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),e.length-n<a-r&&(a=e.length-n+r);var m=a-r;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,r,a):Uint8Array.prototype.set.call(e,this.subarray(r,a),n),m};_.prototype.fill=function(e,n,r,a){if(typeof e=="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(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<r)throw new RangeError("Out of range index");if(r<=n)return this;n=n>>>0,r=r===void 0?this.length:r>>>0,e||(e=0);var s;if(typeof e=="number")for(s=n;s<r;++s)this[s]=e;else{var l=_.isBuffer(e)?e:_.from(e,a),d=l.length;if(d===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-n;++s)this[s+n]=l[s%d]}return this};var pa=/[^+/0-9A-Za-z-_]/g;function ca(o){if(o=o.split("=")[0],o=o.trim().replace(pa,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function po(o,e){e=e||1/0;for(var n,r=o.length,a=null,m=[],s=0;s<r;++s){if(n=o.charCodeAt(s),n>55295&&n<57344){if(!a){if(n>56319){(e-=3)>-1&&m.push(239,191,189);continue}else if(s+1===r){(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 ma(o){for(var e=[],n=0;n<o.length;++n)e.push(o.charCodeAt(n)&255);return e}function sa(o,e){for(var n,r,a,m=[],s=0;s<o.length&&!((e-=2)<0);++s)n=o.charCodeAt(s),r=n>>8,a=n%256,m.push(a),m.push(r);return m}function Sn(o){return ro.toByteArray(ca(o))}function Ne(o,e,n,r){for(var a=0;a<r&&!(a+n>=e.length||a>=o.length);++a)e[a+n]=o[a];return a}function U(o,e){return o instanceof e||o!=null&&o.constructor!=null&&o.constructor.name!=null&&o.constructor.name===e.name}function so(o){return o!==o}var _a=function(){for(var o="0123456789abcdef",e=new Array(256),n=0;n<16;++n)for(var r=n*16,a=0;a<16;++a)e[r+a]=o[n]+o[a];return e}()});var Ln=Ie((ap,En)=>{t();var w=En.exports={},$,V;function _o(){throw new Error("setTimeout has not been defined")}function lo(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?$=setTimeout:$=_o}catch(o){$=_o}try{typeof clearTimeout=="function"?V=clearTimeout:V=lo}catch(o){V=lo}})();function kn(o){if($===setTimeout)return setTimeout(o,0);if(($===_o||!$)&&setTimeout)return $=setTimeout,setTimeout(o,0);try{return $(o,0)}catch(e){try{return $.call(null,o,0)}catch(n){return $.call(this,o,0)}}}function da(o){if(V===clearTimeout)return clearTimeout(o);if((V===lo||!V)&&clearTimeout)return V=clearTimeout,clearTimeout(o);try{return V(o)}catch(e){try{return V.call(null,o)}catch(n){return V.call(this,o)}}}var G=[],ie=!1,oe,De=-1;function la(){!ie||!oe||(ie=!1,oe.length?G=oe.concat(G):De=-1,G.length&&An())}function An(){if(!ie){var o=kn(la);ie=!0;for(var e=G.length;e;){for(oe=G,G=[];++De<e;)oe&&oe[De].run();De=-1,e=G.length}oe=null,ie=!1,da(o)}}w.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];G.push(new In(o,e)),G.length===1&&!ie&&kn(An)};function In(o,e){this.fun=o,this.array=e}In.prototype.run=function(){this.fun.apply(null,this.array)};w.title="browser";w.browser=!0;w.env={};w.argv=[];w.version="";w.versions={};function q(){}w.on=q;w.addListener=q;w.once=q;w.off=q;w.removeListener=q;w.removeAllListeners=q;w.emit=q;w.prependListener=q;w.prependOnceListener=q;w.listeners=function(o){return[]};w.binding=function(o){throw new Error("process.binding is not supported")};w.cwd=function(){return"/"};w.chdir=function(o){throw new Error("process.chdir is not supported")};w.umask=function(){return 0}});var i,p,ip,t=x(()=>{i=y(vn()),p=y(Ln()),ip=function(o){function e(){var r=this||self;return delete o.prototype.__magic__,r}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 Nn,go=x(()=>{"use strict";t();Nn="Action not allowed. User is logged in. Call logout() first"});var Ce,uo=x(()=>{"use strict";t();Ce=()=>Date.now()/1e3});var Dn=x(()=>{"use strict";t()});var Cn=x(()=>{"use strict";t()});var fo=x(()=>{"use strict";t();uo();Dn();Cn()});var ho={};J(ho,{getItem:()=>ua,localStorageKeys:()=>Y,removeItem:()=>fa,setItem:()=>ga});var Y,xo,ga,ua,fa,pe=x(()=>{"use strict";t();fo();Y={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},xo=typeof localStorage!="undefined",ga=({key:o,data:e,expires:n})=>{!xo||localStorage.setItem(String(o),JSON.stringify({expires:n,data:e}))},ua=o=>{if(!xo)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:Ce()>=n.expires?(localStorage.removeItem(String(o)),null):n.data},fa=o=>{!xo||localStorage.removeItem(String(o))}});var bo={};J(bo,{clear:()=>Fn,getItem:()=>Rn,removeItem:()=>Mn,setItem:()=>Pn,storage:()=>xa});var Pn,Rn,Mn,Fn,xa,On=x(()=>{"use strict";t();Pn=({key:o,data:e,expires:n})=>{sessionStorage.setItem(String(o),JSON.stringify({expires:n,data:e}))},Rn=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},Mn=o=>sessionStorage.removeItem(String(o)),Fn=()=>sessionStorage.clear(),xa={setItem:Pn,getItem:Rn,removeItem:Mn,clear:Fn}});var ne,ce=x(()=>{"use strict";t();pe();On();ne={session:bo,local:ho}});function he(){return new Date().setHours(new Date().getHours()+24)}function be(o){ne.local.setItem({key:Y.loginExpiresAt,data:o,expires:o})}var yo=x(()=>{"use strict";t();ce();pe()});var C=x(()=>{"use strict";t()});var Bn=x(()=>{"use strict";t()});var E=x(()=>{"use strict";t()});var Un=x(()=>{"use strict";t()});var $n=x(()=>{"use strict";t()});var Vn=x(()=>{"use strict";t()});var Wn=x(()=>{"use strict";t()});var W=x(()=>{"use strict";t();Bn();E();C();Un();$n();Vn();Wn()});var To,Hn,Rp,jn,Mp,zn,Fp,Op,Bp,Gn=x(()=>{"use strict";t();W();To={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:Hn,egldLabel:Rp}=To["devnet"],{chainId:jn,egldLabel:Mp}=To["testnet"],{chainId:zn,egldLabel:Fp}=To["mainnet"],Op={["devnet"]:Hn,["testnet"]:jn,["mainnet"]:zn},Bp={[Hn]:"devnet",[jn]:"testnet",[zn]:"mainnet"}});var wo=x(()=>{"use strict";t()});var qn=x(()=>{"use strict";t()});var Kn,So=x(()=>{"use strict";t();Kn="transaction-status-toast-id"});var vo,ko,Xn,Pe,Yn,me,v=x(()=>{"use strict";t();go();Gn();wo();qn();So();vo=5e4,ko=1e9,Xn=1,Pe="logout",Yn="login",me="0"});var Ao,L,ye,H=x(()=>{"use strict";t();Ao=require("@reduxjs/toolkit");v();L=(0,Ao.createAction)(Pe),ye=(0,Ao.createAction)(Yn,o=>({payload:o}))});var Jn,Zn,Qn,nc,tc,rc,et,ac,ot,nt,tt,Io=x(()=>{"use strict";t();Jn=require("@reduxjs/toolkit");yo();C();H();Zn={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Qn=(0,Jn.createSlice)({name:"loginInfoSlice",initialState:Zn,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,()=>Zn),o.addCase(ye,(e,n)=>{e.loginMethod=n.payload.loginMethod,be(he())})}}),{setLoginMethod:nc,setWalletConnectLogin:tc,setLedgerLogin:rc,setTokenLogin:et,setTokenLoginSignature:ac,setWalletLogin:ot,invalidateLoginSession:nt}=Qn.actions,tt=Qn.reducer});var Re=x(()=>{"use strict";t()});var rt=x(()=>{"use strict";t();Re()});function Eo(o){return o[Math.floor(Math.random()*o.length)]}var at=x(()=>{"use strict";t()});var it=x(()=>{"use strict";t();wo()});var pt=x(()=>{"use strict";t();rt();at();it()});var ct,mt,Lo,ba,st,yc,Tc,_t,No=x(()=>{"use strict";t();ct=require("@reduxjs/toolkit"),mt=y(require("lodash.omit"));pt();Lo={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},ba={network:Lo,chainID:"-1"},st=(0,ct.createSlice)({name:"appConfig",initialState:ba,reducers:{initializeNetworkConfig:(o,e)=>{let n=Eo(e.payload.walletConnectBridgeAddresses),r=Eo(e.payload.walletConnectV2RelayAddresses),a=(0,mt.default)(e.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");o.network=T(b(b({},o.network),a),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(o,e)=>{o.chainID=e.payload}}}),{initializeNetworkConfig:yc,setChainID:Tc}=st.actions,_t=st.reducer});var Co,dt,lt,Me,Do,gt,Po,Lc,Ro,Nc,Dc,Cc,Pc,Rc,Mc,Fc,ut,Mo=x(()=>{"use strict";t();Co=require("@elrondnetwork/erdjs"),dt=require("@reduxjs/toolkit"),lt=require("redux-persist");v();ce();pe();H();Me={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:me},Do={address:"",websocketEvent:null,accounts:{"":Me},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},gt=(0,dt.createSlice)({name:"accountInfoSlice",initialState:Do,reducers:{setAddress:(o,e)=>{let n=e.payload;o.address=n,o.publicKey=new Co.Address(n).hex()},setAccount:(o,e)=>{let n=o.address===e.payload.address;o.accounts={[o.address]:n?e.payload:Me},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,()=>(ne.local.removeItem(Y.loginExpiresAt),Do)),o.addCase(ye,(e,n)=>{let{address:r}=n.payload;e.address=r,e.publicKey=new Co.Address(r).hex()}),o.addCase(lt.REHYDRATE,(e,n)=>{var g;if(!((g=n.payload)!=null&&g.account))return;let{account:r}=n.payload,{address:a,shard:m,accounts:s,publicKey:l}=r;e.address=a,e.shard=m;let d=s&&a in s;e.accounts=d?s:Do.accounts,e.publicKey=l})}}),{setAccount:Po,setAddress:Lc,setAccountNonce:Ro,setAccountShard:Nc,setLedgerAccount:Dc,updateLedgerAccount:Cc,setWalletConnectAccount:Pc,setIsAccountLoading:Rc,setAccountLoadingError:Mc,setWebsocketEvent:Fc}=gt.actions,ut=gt.reducer});function ft(o){return o!=null&&(Ea(o)||Ca(o))}function Fe(o){return o!=null&&(La(o)||Pa(o))}function Oe(o){return o!=null&&(Na(o)||Ra(o))}function xt(o){return o!=null&&Da(o)}function Ea(o){return o!=null&&Ta.includes(o)}function La(o){return o!=null&&wa.includes(o)}function Na(o){return o!=null&&Sa.includes(o)}function Da(o){return o!=null&&va.includes(o)}function Ca(o){return o!=null&&ka.includes(o)}function Pa(o){return o!=null&&Aa.includes(o)}function Ra(o){return o!=null&&Ia.includes(o)}var Ta,wa,Sa,va,ka,Aa,Ia,Oo=x(()=>{"use strict";t();C();Ta=["sent"],wa=["success"],Sa=["fail","cancelled","timedOut"],va=["timedOut"],ka=["pending"],Aa=["success"],Ia=["fail","invalid"]});var ht,bt,we,Ma,yt,zc,Gc,qc,Kc,Xc,Yc,Zc,Jc,Qc,em,Be,Ue=x(()=>{"use strict";t();ht=require("@reduxjs/toolkit"),bt=require("redux-persist");C();Oo();H();we={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Ma={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},yt=(0,ht.createSlice)({name:"transactionsSlice",initialState:we,reducers:{moveTransactionsToSignedState:(o,e)=>{var d,g;let{sessionId:n,transactions:r,errorMessage:a,status:m,redirectRoute:s}=e.payload,l=((d=o.customTransactionInformationForSessionId)==null?void 0:d[n])||Ma;o.signedTransactions[n]={transactions:r,status:m,errorMessage:a,redirectRoute:s,customTransactionInformation:l},((g=o==null?void 0:o.transactionsToSign)==null?void 0:g.sessionId)===n&&(o.transactionsToSign=we.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:r,errorMessage:a,transactions:m}=e.payload;o.signedTransactions[n]!=null&&(o.signedTransactions[n].status=r,a!=null&&(o.signedTransactions[n].errorMessage=a),m!=null&&(o.signedTransactions[n].transactions=m))},updateSignedTransactionStatus:(o,e)=>{var l,d,g,h,f,S;let{sessionId:n,status:r,errorMessage:a,transactionHash:m}=e.payload,s=(d=(l=o.signedTransactions)==null?void 0:l[n])==null?void 0:d.transactions;if(s!=null){o.signedTransactions[n].transactions=s.map(O=>O.hash===m?T(b({},O),{status:r,errorMessage:a}):O);let A=(h=(g=o.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:h.every(O=>Fe(O.status)),F=(S=(f=o.signedTransactions[n])==null?void 0:f.transactions)==null?void 0:S.every(O=>Oe(O.status));A&&(o.signedTransactions[n].status="success"),F&&(o.signedTransactions[n].status="fail")}},setTransactionsToSign:(o,e)=>{o.transactionsToSign=e.payload;let{sessionId:n,customTransactionInformation:r}=e.payload;o.customTransactionInformationForSessionId[n]=r,o.signTransactionsError=null},clearAllTransactionsToSign:o=>{o.transactionsToSign=we.transactionsToSign,o.signTransactionsError=null},clearAllSignedTransactions:o=>{o.signedTransactions=we.signedTransactions},setSignTransactionsError:(o,e)=>{o.signTransactionsError=e.payload},setSignTransactionsCancelMessage:(o,e)=>{o.signTransactionsCancelMessage=e.payload}},extraReducers:o=>{o.addCase(L,()=>we),o.addCase(bt.REHYDRATE,(e,n)=>{var s;if(e.signTransactionsCancelMessage=null,!((s=n.payload)!=null&&s.transactions))return;let{signedTransactions:r,customTransactionInformationForSessionId:a}=n.payload.transactions,m=Object.entries(r).reduce((l,[d,g])=>{let h=new Date(d),f=new Date;return f.setHours(f.getHours()+5),f-h>0||(l[d]=g),l},{});a!=null&&(e.customTransactionInformationForSessionId=a),r!=null&&(e.signedTransactions=m)})}}),{updateSignedTransactionStatus:zc,updateSignedTransactions:Gc,setTransactionsToSign:qc,clearAllTransactionsToSign:Kc,clearAllSignedTransactions:Xc,clearSignedTransaction:Yc,clearTransactionToSign:Zc,setSignTransactionsError:Jc,setSignTransactionsCancelMessage:Qc,moveTransactionsToSignedState:em}=yt.actions,Be=yt.reducer});var Tt,Uo,$o,Vo,Fa,Bo,wt,rm,am,im,$e,Ve=x(()=>{"use strict";t();Tt=require("@reduxjs/toolkit");H();Uo="Transaction failed",$o="Transaction successful",Vo="Processing transaction",Fa="Transaction submitted",Bo={},wt=(0,Tt.createSlice)({name:"transactionsInfo",initialState:Bo,reducers:{setTransactionsDisplayInfo(o,e){let{sessionId:n,transactionsDisplayInfo:r}=e.payload;n!=null&&(o[n]={errorMessage:(r==null?void 0:r.errorMessage)||Uo,successMessage:(r==null?void 0:r.successMessage)||$o,processingMessage:(r==null?void 0:r.processingMessage)||Vo,submittedMessage:(r==null?void 0:r.submittedMessage)||Fa,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(o,e){e.payload!=null&&delete o[e.payload]},clearTransactionsInfo:()=>Bo},extraReducers:o=>{o.addCase(L,()=>Bo)}}),{clearTransactionsInfo:rm,setTransactionsDisplayInfo:am,clearTransactionsInfoForSessionId:im}=wt.actions,$e=wt.reducer});var vt,St,kt,sm,_m,dm,lm,At,Wo=x(()=>{"use strict";t();vt=require("@reduxjs/toolkit");H();St={},kt=(0,vt.createSlice)({name:"modalsSlice",initialState:St,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,()=>St)}}),{setTxSubmittedModal:sm,setNotificationModal:_m,clearTxSubmittedModal:dm,clearNotificationModal:lm}=kt.actions,At=kt.reducer});var Et,Lt,It,Nt,Oa,Ba,Tm,wm,Sm,vm,We,He=x(()=>{"use strict";t();Et=require("@reduxjs/toolkit"),Lt=require("redux-persist");So();W();uo();H();It={customToasts:[],transactionToasts:[],failTransactionToast:null},Nt=(0,Et.createSlice)({name:"toastsSlice",initialState:It,reducers:{addCustomToast:(o,e)=>{o.customToasts.push(T(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:Ce(),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=T(b({},e.payload),{toastId:Kn})},removeFailTransactionToast:o=>{o.failTransactionToast=null}},extraReducers:o=>{o.addCase(L,()=>It),o.addCase(Lt.REHYDRATE,(e,n)=>{var a,m;let r=(m=(a=n.customToasts)==null?void 0:a.filter(s=>!("component"in s)))!=null?m:[];e.customToasts=r})}}),{addCustomToast:Oa,removeCustomToast:Ba,addTransactionToast:Tm,removeTransactionToast:wm,addFailTransactionToast:Sm,removeFailTransactionToast:vm}=Nt.actions,We=Nt.reducer});var j=x(()=>{"use strict";t();Io();No();Mo();Ue();Ve();Wo();He()});var Ho=x(()=>{"use strict";t()});var Rt,Pt,Mt,jm,zm,Gm,qm,Km,Xm,Ft,Ot=x(()=>{"use strict";t();Rt=require("@reduxjs/toolkit");H();Pt={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Mt=(0,Rt.createSlice)({name:"dappModalsSlice",initialState:Pt,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,()=>Pt)}}),{setDappModalVisibility:jm,setDappModalHeaderVisibility:zm,setDappModalFooterVisibility:Gm,setDappModalHeaderText:qm,setDappModalFooterText:Km,setDappModalConfig:Xm}=Mt.actions,Ft=Mt.reducer});var Bt,Wa,Ha,se,ze=x(()=>{"use strict";t();Bt=require("@reduxjs/toolkit");Ho();Mo();Ot();Io();Wo();No();He();Ve();Ue();Wa={["account"]:ut,["networkConfig"]:_t,["loginInfo"]:tt,["modals"]:At,["dappModal"]:Ft,["toasts"]:We,["transactions"]:Be,["transactionsInfo"]:$e},Ha=(o={})=>(0,Bt.combineReducers)(b(b({},Wa),o)),se=Ha});var Vt={};J(Vt,{default:()=>Ya});function jo(o,e=[]){return{key:o,version:1,storage:$t.default,blacklist:e}}var te,Ut,$t,ja,za,Ga,qa,Ka,Xa,Ya,Wt=x(()=>{"use strict";t();te=require("redux-persist"),Ut=y(require("redux-persist/lib/storage")),$t=y(require("redux-persist/lib/storage/session"));ze();j();He();Ve();Ue();Ho();ja={2:o=>T(b({},o),{networkConfig:Lo})};za=jo("dapp-core-transactionsInfo"),Ga=jo("dapp-core-transactions",["transactionsToSign"]),qa=jo("dapp-core-toasts"),Ka={key:"dapp-core-store",version:2,storage:Ut.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,te.createMigrate)(ja,{debug:!1})},Xa={["toasts"]:(0,te.persistReducer)(qa,We),["transactions"]:(0,te.persistReducer)(Ga,Be),["transactionsInfo"]:(0,te.persistReducer)(za,$e)},Ya=(0,te.persistReducer)(Ka,se(Xa))});var Ht={};J(Ht,{default:()=>Za});var Za,jt=x(()=>{"use strict";t();ze();Za=se()});var zt={};J(zt,{default:()=>Qa});var M,Ja,Qa,Gt=x(()=>{"use strict";t();M=require("redux-persist"),Ja=[M.FLUSH,M.REHYDRATE,M.PAUSE,M.PERSIST,M.PURGE,M.REGISTER],Qa=Ja});var Xt={};J(Xt,{default:()=>Kt});function Kt(o){return(0,qt.persistStore)(o)}var qt,Yt=x(()=>{"use strict";t();qt=require("redux-persist")});var ep={};J(ep,{WebWalletLoginButton:()=>Qi});module.exports=xe(ep);t();var Ir=y(require("react"));t();var nn=require("react");go();t();var nr=require("react"),_e=require("react-redux");t();var zo=require("@reduxjs/toolkit"),er=require("react-redux/es/utils/Subscription");j();t();var Dt=y(require("lodash.throttle"));v();j();yo();ce();pe();var Ua=[Pe],$a=(0,Dt.default)(()=>{be(he())},5e3),Ct=o=>e=>n=>{var d;if(Ua.includes(n.type))return e(n);let r=o.getState(),a=ne.local.getItem(Y.loginExpiresAt);if(!((d=r==null?void 0:r.loginInfo)==null?void 0:d.isLoggedIn))return e(n);if(a==null)return be(he());let s=Date.now();return a-s<0?setTimeout(()=>D(void 0,null,function*(){console.log("session expired");try{o.dispatch(nt())}catch(g){console.error("error logging out",g)}}),1e3):($a(),e(n))};t();t();function je(){return typeof sessionStorage!="undefined"}var Zt=je()?(Wt(),xe(Vt)).default:(jt(),xe(Ht)).default,Jt=je()?(Gt(),xe(zt)).default:[],Qt=je()?(Yt(),xe(Xt)).default:o=>o;ze();var k=(0,zo.configureStore)({reducer:Zt,middleware:o=>o({serializableCheck:{ignoredActions:[...Jt,Ro.type,Po.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(Ct)}),or=(0,er.createSubscription)(k),ys=Qt(k),Ts=(0,zo.configureStore)({reducer:se});var ei={store:k,subscription:or},Go=(0,nr.createContext)(ei),ks=(0,_e.createStoreHook)(Go),tr=(0,_e.createDispatchHook)(Go),rr=(0,_e.createSelectorHook)(Go);t();t();j();t();var ar=y(require("lodash.isequal")),Ge=require("reselect"),u=(0,Ge.createSelectorCreator)(Ge.defaultMemoize,ar.default);var K=o=>o.account,qe=u(K,o=>o.address),Ke=u(K,qe,(o,e)=>e in o.accounts?o.accounts[e]:Me),Ns=u(K,Ke,(o,e)=>{let a=o,{accounts:n}=a,r=Ae(a,["accounts"]);return T(b({},r),{account:e})}),Ds=u(Ke,o=>o.balance),oi=u(Ke,o=>{var e;return((e=o==null?void 0:o.nonce)==null?void 0:e.valueOf())||0}),Cs=u(K,o=>o.shard),Ps=u(K,o=>o.ledgerAccount),Rs=u(K,o=>o.walletConnectAccount),Ms=u(K,o=>o.isAccountLoading),Fs=u(K,o=>o.accountLoadingError),Os=u(K,o=>o.websocketEvent);t();var de=o=>o.networkConfig,ni=u(de,o=>o.chainID),$s=u(de,o=>o.network.walletConnectBridgeAddress),Vs=u(de,o=>o.network.walletConnectV2RelayAddress),Ws=u(de,o=>o.network.walletConnectV2ProjectId),Hs=u(de,o=>o.network.walletConnectDeepLink),le=u(de,o=>o.network),ti=u(le,o=>o.apiAddress),ir=u(le,o=>o.explorerAddress),ri=u(le,o=>o.egldLabel);t();C();var ge=o=>o.loginInfo,Ks=u(ge,o=>o.loginMethod),qo=u(ge,qe,(o,e)=>o.loginMethod!=""&&Boolean(e)),Xs=u(ge,o=>o.walletConnectLogin),Ys=u(ge,o=>o.ledgerLogin),ai=u(ge,o=>o.walletLogin),Zs=u(ge,o=>o.isLoginSessionInvalid);t();t();var P=require("@elrondnetwork/erdjs");v();t();function Ko(o){try{return i.Buffer.from(o,"base64").toString()===atob(o)}catch(e){return!1}}function Xo(o){var a,m,s;let{data:e}=o,n=Ko(e!=null?e:"")?P.TransactionPayload.fromEncoded(e):new P.TransactionPayload(e),r=new P.Transaction(b({value:o.value.valueOf(),data:n,nonce:o.nonce.valueOf(),receiver:new P.Address(o.receiver),sender:new P.Address(o.sender),gasLimit:(a=o.gasLimit.valueOf())!=null?a:vo,gasPrice:(m=o.gasPrice.valueOf())!=null?m:ko,chainID:o.chainID.valueOf(),version:new P.TransactionVersion((s=o.version)!=null?s:Xn)},o.options?{options:new P.TransactionOptions(o.options)}:{}));return r.applySignature({hex:()=>o.signature||""},new P.Address(o.sender)),r}t();Oo();t();var pi=y(require("bignumber.js"));W();t();t();t();t();var mi=require("@elrondnetwork/erdjs"),si=y(require("bignumber.js"));C();t();var ci=require("@elrondnetwork/erdjs");t();t();t();var di=require("@elrondnetwork/erdjs/out");t();v();t();var mr=require("@elrondnetwork/erdjs");W();t();t();t();t();C();t();t();t();t();t();t();t();t();t();t();t();E();t();t();E();t();t();t();var bi=y(require("bignumber.js"));v();t();var hi=require("@elrondnetwork/erdjs"),Zo=y(require("bignumber.js"));v();t();var fi=y(require("bignumber.js"));t();Zo.default.config({ROUNDING_MODE:Zo.default.ROUND_FLOOR});t();t();t();v();t();t();t();t();v();t();v();t();var yi=require("@elrondnetwork/erdjs");v();t();var Ze=require("@elrondnetwork/erdjs"),wi=require("@elrondnetwork/erdjs"),Si=require("@elrondnetwork/erdjs-network-providers");v();t();t();var Ti=y(require("bignumber.js"));v();t();v();t();t();t();t();t();v();t();E();var ki=["reDelegateRewards","claimRewards","unBond"],Ai=["wrapEgld","unwrapEgld"],Ii=["unStake"],Ei=["unDelegate"];t();t();t();v();t();var Di=y(require("bignumber.js"));t();t();t();E();t();var Ci=y(require("bignumber.js"));t();t();t();t();E();t();t();t();var Ri=y(require("anchorme"));t();v();t();var Mi=y(require("bignumber.js"));t();W();t();t();C();t();C();t();t();t();E();t();E();t();var Fi=y(require("bignumber.js"));v();E();t();E();t();var gr=require("react");W();t();t();E();t();var Oi=require("@elrondnetwork/erdjs/out"),Bi=y(require("bignumber.js"));E();t();E();t();t();C();var If=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];t();var ur=require("react");W();t();var $i=require("react");E();var Rf=["create","localMint","ESDTLoca