UNPKG

@sofaws/dapp-core

Version:

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

1 lines 163 kB
"use strict";var Br=Object.create;var fe=Object.defineProperty,Ur=Object.defineProperties,$r=Object.getOwnPropertyDescriptor,Vr=Object.getOwnPropertyDescriptors,Wr=Object.getOwnPropertyNames,Ie=Object.getOwnPropertySymbols,Gr=Object.getPrototypeOf,io=Object.prototype.hasOwnProperty,cn=Object.prototype.propertyIsEnumerable;var pn=(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={}))io.call(e,n)&&pn(o,n,e[n]);if(Ie)for(var n of Ie(e))cn.call(e,n)&&pn(o,n,e[n]);return o},S=(o,e)=>Ur(o,Vr(e));var he=(o,e)=>{var n={};for(var r in o)io.call(o,r)&&e.indexOf(r)<0&&(n[r]=o[r]);if(o!=null&&Ie)for(var r of Ie(o))e.indexOf(r)<0&&cn.call(o,r)&&(n[r]=o[r]);return n};var f=(o,e)=>()=>(o&&(e=o(o=0)),e);var Ee=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),Z=(o,e)=>{for(var n in e)fe(o,n,{get:e[n],enumerable:!0})},mn=(o,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Wr(e))!io.call(o,a)&&a!==n&&fe(o,a,{get:()=>e[a],enumerable:!(r=$r(e,a))||r.enumerable});return o};var y=(o,e,n)=>(n=o!=null?Br(Gr(o)):{},mn(e||!o||!o.__esModule?fe(n,"default",{value:o,enumerable:!0}):n,o)),xe=o=>mn(fe({},"__esModule",{value:!0}),o);var C=(o,e,n)=>new Promise((r,a)=>{var m=d=>{try{l(n.next(d))}catch(u){a(u)}},_=d=>{try{l(n.throw(d))}catch(u){a(u)}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(m,_);l((n=n.apply(o,e)).next())});var dn=Ee(Ne=>{"use strict";t();Ne.byteLength=zr;Ne.toByteArray=qr;Ne.fromByteArray=Yr;var M=[],R=[],Hr=typeof Uint8Array!="undefined"?Uint8Array:Array,po="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(J=0,_n=po.length;J<_n;++J)M[J]=po[J],R[po.charCodeAt(J)]=J;var J,_n;R["-".charCodeAt(0)]=62;R["_".charCodeAt(0)]=63;function sn(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 zr(o){var e=sn(o),n=e[0],r=e[1];return(n+r)*3/4-r}function jr(o,e,n){return(e+n)*3/4-n}function qr(o){var e,n=sn(o),r=n[0],a=n[1],m=new Hr(jr(o,r,a)),_=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[_++]=e>>16&255,m[_++]=e>>8&255,m[_++]=e&255;return a===2&&(e=R[o.charCodeAt(d)]<<2|R[o.charCodeAt(d+1)]>>4,m[_++]=e&255),a===1&&(e=R[o.charCodeAt(d)]<<10|R[o.charCodeAt(d+1)]<<4|R[o.charCodeAt(d+2)]>>2,m[_++]=e>>8&255,m[_++]=e&255),m}function Kr(o){return M[o>>18&63]+M[o>>12&63]+M[o>>6&63]+M[o&63]}function Xr(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(Kr(r));return a.join("")}function Yr(o){for(var e,n=o.length,r=n%3,a=[],m=16383,_=0,l=n-r;_<l;_+=m)a.push(Xr(o,_,_+m>l?l:_+m));return r===1?(e=o[n-1],a.push(M[e>>2]+M[e<<4&63]+"==")):r===2&&(e=(o[n-2]<<8)+o[n-1],a.push(M[e>>10]+M[e>>4&63]+M[e<<2&63]+"=")),a.join("")}});var ln=Ee(co=>{t();co.read=function(o,e,n,r,a){var m,_,l=a*8-r-1,d=(1<<l)-1,u=d>>1,x=-7,h=n?a-1:0,A=n?-1:1,I=o[e+h];for(h+=A,m=I&(1<<-x)-1,I>>=-x,x+=l;x>0;m=m*256+o[e+h],h+=A,x-=8);for(_=m&(1<<-x)-1,m>>=-x,x+=r;x>0;_=_*256+o[e+h],h+=A,x-=8);if(m===0)m=1-u;else{if(m===d)return _?NaN:(I?-1:1)*(1/0);_=_+Math.pow(2,r),m=m-u}return(I?-1:1)*_*Math.pow(2,m-r)};co.write=function(o,e,n,r,a,m){var _,l,d,u=m*8-a-1,x=(1<<u)-1,h=x>>1,A=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=r?0:m-1,q=r?1:-1,V=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+=A/d:e+=A*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+I]=l&255,I+=q,l/=256,a-=8);for(_=_<<a|l,u+=a;u>0;o[n+I]=_&255,I+=q,_/=256,u-=8);o[n+I-q]|=V*128}});var An=Ee(ie=>{"use strict";t();var mo=dn(),ae=ln(),un=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ie.Buffer=s;ie.SlowBuffer=na;ie.INSPECT_MAX_BYTES=50;var Le=2147483647;ie.kMaxLength=Le;s.TYPED_ARRAY_SUPPORT=Zr();!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 Zr(){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 W(o){if(o>Le)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 uo(o)}return hn(o,e,n)}s.poolSize=8192;function hn(o,e,n){if(typeof o=="string")return Qr(o,e);if(ArrayBuffer.isView(o))return ea(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(O(o,ArrayBuffer)||o&&O(o.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(O(o,SharedArrayBuffer)||o&&O(o.buffer,SharedArrayBuffer)))return so(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 s.from(r,e,n);var a=oa(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 hn(o,e,n)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function xn(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 xn(o),o<=0?W(o):e!==void 0?typeof n=="string"?W(o).fill(e,n):W(o).fill(e):W(o)}s.alloc=function(o,e,n){return Jr(o,e,n)};function uo(o){return xn(o),W(o<0?0:go(o)|0)}s.allocUnsafe=function(o){return uo(o)};s.allocUnsafeSlow=function(o){return uo(o)};function Qr(o,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=yn(o,e)|0,r=W(n),a=r.write(o,e);return a!==n&&(r=r.slice(0,a)),r}function _o(o){for(var e=o.length<0?0:go(o.length)|0,n=W(e),r=0;r<e;r+=1)n[r]=o[r]&255;return n}function ea(o){if(O(o,Uint8Array)){var e=new Uint8Array(o);return so(e.buffer,e.byteOffset,e.byteLength)}return _o(o)}function so(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,s.prototype),r}function oa(o){if(s.isBuffer(o)){var e=go(o.length)|0,n=W(e);return n.length===0||o.copy(n,0,0,e),n}if(o.length!==void 0)return typeof o.length!="number"||fo(o.length)?W(0):_o(o);if(o.type==="Buffer"&&Array.isArray(o.data))return _o(o.data)}function go(o){if(o>=Le)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Le.toString(16)+" bytes");return o|0}function na(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(O(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),O(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 r=e.length,a=n.length,m=0,_=Math.min(r,a);m<_;++m)if(e[m]!==n[m]){r=e[m],a=n[m];break}return r<a?-1:a<r?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 r;if(n===void 0)for(n=0,r=0;r<e.length;++r)n+=e[r].length;var a=s.allocUnsafe(n),m=0;for(r=0;r<e.length;++r){var _=e[r];if(O(_,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 yn(o,e){if(s.isBuffer(o))return o.length;if(ArrayBuffer.isView(o)||O(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 lo(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return vn(o).length;default:if(a)return r?-1:lo(o).length;e=(""+e).toLowerCase(),a=!0}}s.byteLength=yn;function ta(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 la(this,e,n);case"utf8":case"utf-8":return Tn(this,e,n);case"ascii":return sa(this,e,n);case"latin1":case"binary":return da(this,e,n);case"base64":return ma(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ua(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function Q(o,e,n){var r=o[e];o[e]=o[n],o[n]=r}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)Q(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)Q(this,n,n+3),Q(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)Q(this,n,n+7),Q(this,n+1,n+6),Q(this,n+2,n+5),Q(this,n+3,n+4);return this};s.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?Tn(this,0,e):ta.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=ie.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"};un&&(s.prototype[un]=s.prototype.inspect);s.prototype.compare=function(e,n,r,a,m){if(O(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),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 _=m-a,l=r-n,d=Math.min(_,l),u=this.slice(a,m),x=e.slice(n,r),h=0;h<d;++h)if(u[h]!==x[h]){_=u[h],l=x[h];break}return _<l?-1:l<_?1:0};function bn(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,fo(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,r)),s.isBuffer(e))return e.length===0?-1:gn(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):gn(o,[e],n,r,a);throw new TypeError("val must be string, number or Buffer")}function gn(o,e,n,r,a){var m=1,_=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,_/=2,l/=2,n/=2}function d(I,q){return m===1?I[q]:I.readUInt16BE(q*m)}var u;if(a){var x=-1;for(u=n;u<_;u++)if(d(o,u)===d(e,x===-1?0:u-x)){if(x===-1&&(x=u),u-x+1===l)return x*m}else x!==-1&&(u-=u-x),x=-1}else for(n+l>_&&(n=_-l),u=n;u>=0;u--){for(var h=!0,A=0;A<l;A++)if(d(o,u+A)!==d(e,A)){h=!1;break}if(h)return u}return-1}s.prototype.includes=function(e,n,r){return this.indexOf(e,n,r)!==-1};s.prototype.indexOf=function(e,n,r){return bn(this,e,n,r,!0)};s.prototype.lastIndexOf=function(e,n,r){return bn(this,e,n,r,!1)};function ra(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 _=0;_<r;++_){var l=parseInt(e.substr(_*2,2),16);if(fo(l))return _;o[n+_]=l}return _}function aa(o,e,n,r){return Ce(lo(e,o.length-n),o,n,r)}function ia(o,e,n,r){return Ce(ha(e),o,n,r)}function pa(o,e,n,r){return Ce(vn(e),o,n,r)}function ca(o,e,n,r){return Ce(xa(e,o.length-n),o,n,r)}s.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 _=!1;;)switch(a){case"hex":return ra(this,e,n,r);case"utf8":case"utf-8":return aa(this,e,n,r);case"ascii":case"latin1":case"binary":return ia(this,e,n,r);case"base64":return pa(this,e,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ca(this,e,n,r);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 ma(o,e,n){return e===0&&n===o.length?mo.fromByteArray(o):mo.fromByteArray(o.slice(e,n))}function Tn(o,e,n){n=Math.min(o.length,n);for(var r=[],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,u,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],u=o[a+2],(d&192)===128&&(u&192)===128&&(h=(m&15)<<12|(d&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(_=h));break;case 4:d=o[a+1],u=o[a+2],x=o[a+3],(d&192)===128&&(u&192)===128&&(x&192)===128&&(h=(m&15)<<18|(d&63)<<12|(u&63)<<6|x&63,h>65535&&h<1114112&&(_=h))}}_===null?(_=65533,l=1):_>65535&&(_-=65536,r.push(_>>>10&1023|55296),_=56320|_&1023),r.push(_),a+=l}return _a(r)}var fn=4096;function _a(o){var e=o.length;if(e<=fn)return String.fromCharCode.apply(String,o);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,o.slice(r,r+=fn));return n}function sa(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 da(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 la(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+=ya[o[m]];return a}function ua(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}s.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,s.prototype),a};function v(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,r){e=e>>>0,n=n>>>0,r||v(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,r){e=e>>>0,n=n>>>0,r||v(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||v(e,1,this.length),this[e]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,n){return e=e>>>0,n||v(e,2,this.length),this[e]|this[e+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,n){return e=e>>>0,n||v(e,2,this.length),this[e]<<8|this[e+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,n){return e=e>>>0,n||v(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||v(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};s.prototype.readIntLE=function(e,n,r){e=e>>>0,n=n>>>0,r||v(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,r){e=e>>>0,n=n>>>0,r||v(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||v(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};s.prototype.readInt16LE=function(e,n){e=e>>>0,n||v(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};s.prototype.readInt16BE=function(e,n){e=e>>>0,n||v(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};s.prototype.readInt32LE=function(e,n){return e=e>>>0,n||v(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||v(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||v(e,4,this.length),ae.read(this,e,!0,23,4)};s.prototype.readFloatBE=function(e,n){return e=e>>>0,n||v(e,4,this.length),ae.read(this,e,!1,23,4)};s.prototype.readDoubleLE=function(e,n){return e=e>>>0,n||v(e,8,this.length),ae.read(this,e,!0,52,8)};s.prototype.readDoubleBE=function(e,n){return e=e>>>0,n||v(e,8,this.length),ae.read(this,e,!1,52,8)};function N(o,e,n,r,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+r>o.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.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 _=1,l=0;for(this[n]=e&255;++l<r&&(_*=256);)this[n+l]=e/_&255;return n+r};s.prototype.writeUintBE=s.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 _=r-1,l=1;for(this[n+_]=e&255;--_>=0&&(l*=256);)this[n+_]=e/l&255;return n+r};s.prototype.writeUint8=s.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};s.prototype.writeUint16LE=s.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};s.prototype.writeUint16BE=s.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};s.prototype.writeUint32LE=s.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};s.prototype.writeUint32BE=s.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};s.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 _=0,l=1,d=0;for(this[n]=e&255;++_<r&&(l*=256);)e<0&&d===0&&this[n+_-1]!==0&&(d=1),this[n+_]=(e/l>>0)-d&255;return n+r};s.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 _=r-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+r};s.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};s.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};s.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};s.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};s.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 wn(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 Sn(o,e,n,r,a){return e=+e,n=n>>>0,a||wn(o,e,n,4,34028234663852886e22,-34028234663852886e22),ae.write(o,e,n,r,23,4),n+4}s.prototype.writeFloatLE=function(e,n,r){return Sn(this,e,n,!0,r)};s.prototype.writeFloatBE=function(e,n,r){return Sn(this,e,n,!1,r)};function kn(o,e,n,r,a){return e=+e,n=n>>>0,a||wn(o,e,n,8,17976931348623157e292,-17976931348623157e292),ae.write(o,e,n,r,52,8),n+8}s.prototype.writeDoubleLE=function(e,n,r){return kn(this,e,n,!0,r)};s.prototype.writeDoubleBE=function(e,n,r){return kn(this,e,n,!1,r)};s.prototype.copy=function(e,n,r,a){if(!s.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};s.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"&&!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<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 _;if(typeof e=="number")for(_=n;_<r;++_)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;_<r-n;++_)this[_+n]=l[_%d]}return this};var ga=/[^+/0-9A-Za-z-_]/g;function fa(o){if(o=o.split("=")[0],o=o.trim().replace(ga,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function lo(o,e){e=e||1/0;for(var n,r=o.length,a=null,m=[],_=0;_<r;++_){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===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 ha(o){for(var e=[],n=0;n<o.length;++n)e.push(o.charCodeAt(n)&255);return e}function xa(o,e){for(var n,r,a,m=[],_=0;_<o.length&&!((e-=2)<0);++_)n=o.charCodeAt(_),r=n>>8,a=n%256,m.push(a),m.push(r);return m}function vn(o){return mo.toByteArray(fa(o))}function Ce(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 O(o,e){return o instanceof e||o!=null&&o.constructor!=null&&o.constructor.name!=null&&o.constructor.name===e.name}function fo(o){return o!==o}var ya=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 Cn=Ee((gp,Ln)=>{t();var T=Ln.exports={},B,U;function ho(){throw new Error("setTimeout has not been defined")}function xo(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?B=setTimeout:B=ho}catch(o){B=ho}try{typeof clearTimeout=="function"?U=clearTimeout:U=xo}catch(o){U=xo}})();function In(o){if(B===setTimeout)return setTimeout(o,0);if((B===ho||!B)&&setTimeout)return B=setTimeout,setTimeout(o,0);try{return B(o,0)}catch(e){try{return B.call(null,o,0)}catch(n){return B.call(this,o,0)}}}function ba(o){if(U===clearTimeout)return clearTimeout(o);if((U===xo||!U)&&clearTimeout)return U=clearTimeout,clearTimeout(o);try{return U(o)}catch(e){try{return U.call(null,o)}catch(n){return U.call(this,o)}}}var G=[],pe=!1,ee,De=-1;function Ta(){!pe||!ee||(pe=!1,ee.length?G=ee.concat(G):De=-1,G.length&&En())}function En(){if(!pe){var o=In(Ta);pe=!0;for(var e=G.length;e;){for(ee=G,G=[];++De<e;)ee&&ee[De].run();De=-1,e=G.length}ee=null,pe=!1,ba(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];G.push(new Nn(o,e)),G.length===1&&!pe&&In(En)};function Nn(o,e){this.fun=o,this.array=e}Nn.prototype.run=function(){this.fun.apply(null,this.array)};T.title="browser";T.browser=!0;T.env={};T.argv=[];T.version="";T.versions={};function H(){}T.on=H;T.addListener=H;T.once=H;T.off=H;T.removeListener=H;T.removeAllListeners=H;T.emit=H;T.prependListener=H;T.prependOnceListener=H;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,fp,t=f(()=>{i=y(An()),p=y(Cn()),fp=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 Re,yo=f(()=>{"use strict";t();Re=()=>Date.now()/1e3});var Dn=f(()=>{"use strict";t()});var Rn=f(()=>{"use strict";t()});var Pn=f(()=>{"use strict";t();yo();Dn();Rn()});var To={};Z(To,{getItem:()=>Sa,localStorageKeys:()=>oe,removeItem:()=>ka,setItem:()=>wa});var oe,bo,wa,Sa,ka,ye=f(()=>{"use strict";t();Pn();oe={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},bo=typeof localStorage!="undefined",wa=({key:o,data:e,expires:n})=>{!bo||localStorage.setItem(String(o),JSON.stringify({expires:n,data:e}))},Sa=o=>{if(!bo)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:Re()>=n.expires?(localStorage.removeItem(String(o)),null):n.data},ka=o=>{!bo||localStorage.removeItem(String(o))}});var wo={};Z(wo,{clear:()=>Bn,getItem:()=>Mn,removeItem:()=>On,setItem:()=>Fn,storage:()=>va});var Fn,Mn,On,Bn,va,Un=f(()=>{"use strict";t();Fn=({key:o,data:e,expires:n})=>{sessionStorage.setItem(String(o),JSON.stringify({expires:n,data:e}))},Mn=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},On=o=>sessionStorage.removeItem(String(o)),Bn=()=>sessionStorage.clear(),va={setItem:Fn,getItem:Mn,removeItem:On,clear:Bn}});var ce,Pe=f(()=>{"use strict";t();ye();Un();ce={session:wo,local:To}});function be(){return new Date().setHours(new Date().getHours()+24)}function Te(o){ce.local.setItem({key:oe.loginExpiresAt,data:o,expires:o})}var So=f(()=>{"use strict";t();Pe();ye()});var F=f(()=>{"use strict";t()});var $n=f(()=>{"use strict";t()});var Vn=f(()=>{"use strict";t()});var E=f(()=>{"use strict";t()});var Wn=f(()=>{"use strict";t()});var Gn=f(()=>{"use strict";t()});var Hn=f(()=>{"use strict";t()});var zn=f(()=>{"use strict";t()});var K=f(()=>{"use strict";t();Vn();E();F();Wn();Gn();Hn();zn()});var we,jn,Hp,qn,zp,Kn,jp,qp,Aa,Se=f(()=>{"use strict";t();K();we={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:jn,egldLabel:Hp}=we["devnet"],{chainId:qn,egldLabel:zp}=we["testnet"],{chainId:Kn,egldLabel:jp}=we["mainnet"],qp={["devnet"]:jn,["testnet"]:qn,["mainnet"]:Kn},Aa={[jn]:"devnet",[qn]:"testnet",[Kn]:"mainnet"}});var ko=f(()=>{"use strict";t()});var Xn=f(()=>{"use strict";t()});var Yn,vo=f(()=>{"use strict";t();Yn="transaction-status-toast-id"});var Ao,Io,Zn,Fe,Jn,me,k=f(()=>{"use strict";t();$n();Se();ko();Xn();vo();Ao=5e4,Io=1e9,Zn=1,Fe="logout",Jn="login",me="0"});var Eo,L,Me,X=f(()=>{"use strict";t();Eo=require("@reduxjs/toolkit");k();L=(0,Eo.createAction)(Fe),Me=(0,Eo.createAction)(Jn,o=>({payload:o}))});var et,Qn,ot,sc,dc,lc,uc,gc,fc,nt,tt,No=f(()=>{"use strict";t();et=require("@reduxjs/toolkit");So();F();X();Qn={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},ot=(0,et.createSlice)({name:"loginInfoSlice",initialState:Qn,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,()=>Qn),o.addCase(Me,(e,n)=>{e.loginMethod=n.payload.loginMethod,Te(be())})}}),{setLoginMethod:sc,setWalletConnectLogin:dc,setLedgerLogin:lc,setTokenLogin:uc,setTokenLoginSignature:gc,setWalletLogin:fc,invalidateLoginSession:nt}=ot.actions,tt=ot.reducer});var rt=f(()=>{"use strict";t()});var at=f(()=>{"use strict";t();rt()});function Lo(o){return o[Math.floor(Math.random()*o.length)]}var it=f(()=>{"use strict";t()});var pt=f(()=>{"use strict";t();ko()});var ct=f(()=>{"use strict";t();at();it();pt()});var mt,_t,Co,Ea,st,Dc,Rc,dt,Do=f(()=>{"use strict";t();mt=require("@reduxjs/toolkit"),_t=y(require("lodash.omit"));ct();Co={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Ea={network:Co,chainID:"-1"},st=(0,mt.createSlice)({name:"appConfig",initialState:Ea,reducers:{initializeNetworkConfig:(o,e)=>{let n=Lo(e.payload.walletConnectBridgeAddresses),r=Lo(e.payload.walletConnectV2RelayAddresses),a=(0,_t.default)(e.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");o.network=S(b(b({},o.network),a),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(o,e)=>{o.chainID=e.payload}}}),{initializeNetworkConfig:Dc,setChainID:Rc}=st.actions,dt=st.reducer});var Po,lt,ut,Oe,Ro,gt,ft,Vc,ht,Wc,Gc,Hc,zc,jc,qc,Kc,xt,Fo=f(()=>{"use strict";t();Po=require("@elrondnetwork/erdjs"),lt=require("@reduxjs/toolkit"),ut=require("redux-persist");k();Pe();ye();X();Oe={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:me},Ro={address:"",websocketEvent:null,accounts:{"":Oe},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},gt=(0,lt.createSlice)({name:"accountInfoSlice",initialState:Ro,reducers:{setAddress:(o,e)=>{let n=e.payload;o.address=n,o.publicKey=new Po.Address(n).hex()},setAccount:(o,e)=>{let n=o.address===e.payload.address;o.accounts={[o.address]:n?e.payload:Oe},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,()=>(ce.local.removeItem(oe.loginExpiresAt),Ro)),o.addCase(Me,(e,n)=>{let{address:r}=n.payload;e.address=r,e.publicKey=new Po.Address(r).hex()}),o.addCase(ut.REHYDRATE,(e,n)=>{var u;if(!((u=n.payload)!=null&&u.account))return;let{account:r}=n.payload,{address:a,shard:m,accounts:_,publicKey:l}=r;e.address=a,e.shard=m;let d=_&&a in _;e.accounts=d?_:Ro.accounts,e.publicKey=l})}}),{setAccount:ft,setAddress:Vc,setAccountNonce:ht,setAccountShard:Wc,setLedgerAccount:Gc,updateLedgerAccount:Hc,setWalletConnectAccount:zc,setIsAccountLoading:jc,setAccountLoadingError:qc,setWebsocketEvent:Kc}=gt.actions,xt=gt.reducer});function yt(o){return o!=null&&(Oa(o)||Oo(o))}function Be(o){return o!=null&&(Ba(o)||Va(o))}function Ue(o){return o!=null&&(Ua(o)||Wa(o))}function bt(o){return o!=null&&$a(o)}function Oa(o){return o!=null&&La.includes(o)}function Ba(o){return o!=null&&Ca.includes(o)}function Ua(o){return o!=null&&Da.includes(o)}function $a(o){return o!=null&&Ra.includes(o)}function Oo(o){return o!=null&&Pa.includes(o)}function Va(o){return o!=null&&Fa.includes(o)}function Wa(o){return o!=null&&Ma.includes(o)}var La,Ca,Da,Ra,Pa,Fa,Ma,$e=f(()=>{"use strict";t();F();La=["sent"],Ca=["success"],Da=["fail","cancelled","timedOut"],Ra=["timedOut"],Pa=["pending"],Fa=["success"],Ma=["fail","invalid"]});var Tt,wt,ke,Ga,St,tm,rm,am,im,pm,cm,mm,_m,sm,dm,Ve,We=f(()=>{"use strict";t();Tt=require("@reduxjs/toolkit"),wt=require("redux-persist");F();$e();X();ke={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Ga={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},St=(0,Tt.createSlice)({name:"transactionsSlice",initialState:ke,reducers:{moveTransactionsToSignedState:(o,e)=>{var d,u;let{sessionId:n,transactions:r,errorMessage:a,status:m,redirectRoute:_}=e.payload,l=((d=o.customTransactionInformationForSessionId)==null?void 0:d[n])||Ga;o.signedTransactions[n]={transactions:r,status:m,errorMessage:a,redirectRoute:_,customTransactionInformation:l},((u=o==null?void 0:o.transactionsToSign)==null?void 0:u.sessionId)===n&&(o.transactionsToSign=ke.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,u,x,h,A;let{sessionId:n,status:r,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(V=>V.hash===m?S(b({},V),{status:r,errorMessage:a}):V);let I=(x=(u=o.signedTransactions[n])==null?void 0:u.transactions)==null?void 0:x.every(V=>Be(V.status)),q=(A=(h=o.signedTransactions[n])==null?void 0:h.transactions)==null?void 0:A.every(V=>Ue(V.status));I&&(o.signedTransactions[n].status="success"),q&&(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=ke.transactionsToSign,o.signTransactionsError=null},clearAllSignedTransactions:o=>{o.signedTransactions=ke.signedTransactions},setSignTransactionsError:(o,e)=>{o.signTransactionsError=e.payload},setSignTransactionsCancelMessage:(o,e)=>{o.signTransactionsCancelMessage=e.payload}},extraReducers:o=>{o.addCase(L,()=>ke),o.addCase(wt.REHYDRATE,(e,n)=>{var _;if(e.signTransactionsCancelMessage=null,!((_=n.payload)!=null&&_.transactions))return;let{signedTransactions:r,customTransactionInformationForSessionId:a}=n.payload.transactions,m=Object.entries(r).reduce((l,[d,u])=>{let x=new Date(d),h=new Date;return h.setHours(h.getHours()+5),h-x>0||(l[d]=u),l},{});a!=null&&(e.customTransactionInformationForSessionId=a),r!=null&&(e.signedTransactions=m)})}}),{updateSignedTransactionStatus:tm,updateSignedTransactions:rm,setTransactionsToSign:am,clearAllTransactionsToSign:im,clearAllSignedTransactions:pm,clearSignedTransaction:cm,clearTransactionToSign:mm,setSignTransactionsError:_m,setSignTransactionsCancelMessage:sm,moveTransactionsToSignedState:dm}=St.actions,Ve=St.reducer});var kt,Uo,$o,Vo,Ha,Bo,vt,fm,hm,xm,Ge,He=f(()=>{"use strict";t();kt=require("@reduxjs/toolkit");X();Uo="Transaction failed",$o="Transaction successful",Vo="Processing transaction",Ha="Transaction submitted",Bo={},vt=(0,kt.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)||Ha,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:fm,setTransactionsDisplayInfo:hm,clearTransactionsInfoForSessionId:xm}=vt.actions,Ge=vt.reducer});var It,At,Et,wm,Sm,km,vm,Nt,Wo=f(()=>{"use strict";t();It=require("@reduxjs/toolkit");X();At={},Et=(0,It.createSlice)({name:"modalsSlice",initialState:At,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,()=>At)}}),{setTxSubmittedModal:wm,setNotificationModal:Sm,clearTxSubmittedModal:km,clearNotificationModal:vm}=Et.actions,Nt=Et.reducer});var Ct,Dt,Lt,Rt,Rm,Pm,Fm,Mm,Om,Bm,ze,je=f(()=>{"use strict";t();Ct=require("@reduxjs/toolkit"),Dt=require("redux-persist");vo();K();yo();X();Lt={customToasts:[],transactionToasts:[],failTransactionToast:null},Rt=(0,Ct.createSlice)({name:"toastsSlice",initialState:Lt,reducers:{addCustomToast:(o,e)=>{o.customToasts.push(S(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:Re(),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=S(b({},e.payload),{toastId:Yn})},removeFailTransactionToast:o=>{o.failTransactionToast=null}},extraReducers:o=>{o.addCase(L,()=>Lt),o.addCase(Dt.REHYDRATE,(e,n)=>{var a,m;let r=(m=(a=n.customToasts)==null?void 0:a.filter(_=>!("component"in _)))!=null?m:[];e.customToasts=r})}}),{addCustomToast:Rm,removeCustomToast:Pm,addTransactionToast:Fm,removeTransactionToast:Mm,addFailTransactionToast:Om,removeFailTransactionToast:Bm}=Rt.actions,ze=Rt.reducer});var _e=f(()=>{"use strict";t();No();Do();Fo();We();He();Wo();je()});var qo=f(()=>{"use strict";t()});var Ht,Gt,zt,ks,vs,As,Is,Es,Ns,jt,qt=f(()=>{"use strict";t();Ht=require("@reduxjs/toolkit");X();Gt={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},zt=(0,Ht.createSlice)({name:"dappModalsSlice",initialState:Gt,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,()=>Gt)}}),{setDappModalVisibility:ks,setDappModalHeaderVisibility:vs,setDappModalFooterVisibility:As,setDappModalHeaderText:Is,setDappModalFooterText:Es,setDappModalConfig:Ns}=zt.actions,jt=zt.reducer});var Kt,oi,ni,de,Ye=f(()=>{"use strict";t();Kt=require("@reduxjs/toolkit");qo();Fo();qt();No();Wo();Do();je();He();We();oi={["account"]:xt,["networkConfig"]:dt,["loginInfo"]:tt,["modals"]:Nt,["dappModal"]:jt,["toasts"]:ze,["transactions"]:Ve,["transactionsInfo"]:Ge},ni=(o={})=>(0,Kt.combineReducers)(b(b({},oi),o)),de=ni});var Zt={};Z(Zt,{default:()=>mi});function Ko(o,e=[]){return{key:o,version:1,storage:Yt.default,blacklist:e}}var ne,Xt,Yt,ti,ri,ai,ii,pi,ci,mi,Jt=f(()=>{"use strict";t();ne=require("redux-persist"),Xt=y(require("redux-persist/lib/storage")),Yt=y(require("redux-persist/lib/storage/session"));Ye();_e();je();He();We();qo();ti={2:o=>S(b({},o),{networkConfig:Co})};ri=Ko("dapp-core-transactionsInfo"),ai=Ko("dapp-core-transactions",["transactionsToSign"]),ii=Ko("dapp-core-toasts"),pi={key:"dapp-core-store",version:2,storage:Xt.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,ne.createMigrate)(ti,{debug:!1})},ci={["toasts"]:(0,ne.persistReducer)(ii,ze),["transactions"]:(0,ne.persistReducer)(ai,Ve),["transactionsInfo"]:(0,ne.persistReducer)(ri,Ge)},mi=(0,ne.persistReducer)(pi,de(ci))});var Qt={};Z(Qt,{default:()=>_i});var _i,er=f(()=>{"use strict";t();Ye();_i=de()});var or={};Z(or,{default:()=>di});var P,si,di,nr=f(()=>{"use strict";t();P=require("redux-persist"),si=[P.FLUSH,P.REHYDRATE,P.PAUSE,P.PERSIST,P.PURGE,P.REGISTER],di=si});var ar={};Z(ar,{default:()=>rr});function rr(o){return(0,tr.persistStore)(o)}var tr,ir=f(()=>{"use strict";t();tr=require("redux-persist")});var _p={};Z(_p,{TransactionDetailsBody:()=>mp});module.exports=xe(_p);t();t();var re=y(require("react")),ge=require("@fortawesome/free-solid-svg-icons"),Or=require("@fortawesome/react-fontawesome"),an=y(require("classnames"));t();t();t();var Wi=y(require("axios"));t();t();_e();t();var Pt=y(require("lodash.isequal")),qe=require("reselect"),g=(0,qe.createSelectorCreator)(qe.defaultMemoize,Pt.default);var z=o=>o.account,Go=g(z,o=>o.address),Ho=g(z,Go,(o,e)=>e in o.accounts?o.accounts[e]:Oe),Zm=g(z,Ho,(o,e)=>{let a=o,{accounts:n}=a,r=he(a,["accounts"]);return S(b({},r),{account:e})}),Jm=g(Ho,o=>o.balance),Qm=g(Ho,o=>{var e;return((e=o==null?void 0:o.nonce)==null?void 0:e.valueOf())||0}),e_=g(z,o=>o.shard),o_=g(z,o=>o.ledgerAccount),n_=g(z,o=>o.walletConnectAccount),t_=g(z,o=>o.isAccountLoading),r_=g(z,o=>o.accountLoadingError),a_=g(z,o=>o.websocketEvent);t();var j=o=>o.networkConfig,c_=g(j,o=>o.chainID),m_=g(j,o=>o.network.walletConnectBridgeAddress),__=g(j,o=>o.network.walletConnectV2RelayAddress),s_=g(j,o=>o.network.walletConnectV2ProjectId),d_=g(j,o=>o.network.walletConnectDeepLink),Ke=g(j,o=>o.network),Ft=g(Ke,o=>o.apiAddress),Mt=g(Ke,o=>o.explorerAddress),l_=g(Ke,o=>o.egldLabel);t();F();var se=o=>o.loginInfo,x_=g(se,o=>o.loginMethod),y_=g(se,Go,(o,e)=>o.loginMethod!=""&&Boolean(e)),b_=g(se,o=>o.walletConnectLogin),T_=g(se,o=>o.ledgerLogin),w_=g(se,o=>o.walletLogin),S_=g(se,o=>o.isLoginSessionInvalid);t();t();var D=require("@elrondnetwork/erdjs");k();t();function zo(o){try{return i.Buffer.from(o,"base64").toString()===atob(o)}catch(e){return!1}}function jo(o){var a,m,_;let{data:e}=o,n=zo(e!=null?e:"")?D.TransactionPayload.fromEncoded(e):new D.TransactionPayload(e),r=new D.Transaction(b({value:o.value.valueOf(),data:n,nonce:o.nonce.valueOf(),receiver:new D.Address(o.receiver),sender:new D.Address(o.sender),gasLimit:(a=o.gasLimit.valueOf())!=null?a:Ao,gasPrice:(m=o.gasPrice.valueOf())!=null?m:Io,chainID:o.chainID.valueOf(),version:new D.TransactionVersion((_=o.version)!=null?_:Zn)},o.options?{options:new D.TransactionOptions(o.options)}:{}));return r.applySignature({hex:()=>o.signature||""},new D.Address(o.sender)),r}t();$e();t();var ja=y(require("bignumber.js"));K();t();t();t();t();var Ka=require("@elrondnetwork/erdjs"),Xa=y(require("bignumber.js"));F();t();var qa=require("@elrondnetwork/erdjs");t();t();t();var Za=require("@elrondnetwork/erdjs/out");t();k();t();var $t=require("@elrondnetwork/erdjs");K();t();t();t();t();F();t();t();var Xo=require("@reduxjs/toolkit"),_r=require("react-redux/es/utils/Subscription");_e();t();var Vt=y(require("lodash.throttle"));k();_e();So();Pe();ye();var Ja=[Fe],Qa=(0,Vt.default)(()=>{Te(be())},5e3),Wt=o=>e=>n=>{var d;if(Ja.includes(n.type))return e(n);let r=o.getState(),a=ce.local.getItem(oe.loginExpiresAt);if(!((d=r==null?void 0:r.loginInfo)==null?void 0:d.isLoggedIn))return e(n);if(a==null)return Te(be());let _=Date.now();return a-_<0?setTimeout(()=>C(void 0,null,function*(){console.log("session expired");try{o.dispatch(nt())}catch(u){console.error("error logging out",u)}}),1e3):(Qa(),e(n))};t();t();function Xe(){return typeof sessionStorage!="undefined"}var pr=Xe()?(Jt(),xe(Zt)).default:(er(),xe(Qt)).default,cr=Xe()?(nr(),xe(or)).default:[],mr=Xe()?(ir(),xe(ar)).default:o=>o;Ye();var $=(0,Xo.configureStore)({reducer:pr,middleware:o=>o({serializableCheck:{ignoredActions:[...cr,ht.type,ft.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(Wt)}),sr=(0,_r.createSubscription)($),ed=mr($),od=(0,Xo.configureStore)({reducer:de});t();t();t();t();t();t();var ve="transactions";t();t();t();t();E();t();var lr=!1;function gi(o){lr||(console.error(o),lr=!0)}function Yo({explorerAddress:o,to:e}){try{return new URL(e).href}catch(n){return e.startsWith("/")||(gi(`Link not prepended by / : ${e}`),e=`/${e}`),o?`${o}${e}`:e}}t();E();t();t();t();var yi=y(require("bignumber.js"));k();t();var xi=require("@elrondnetwork/erdjs"),Zo=y(require("bignumber.js"));k();t();var fi=y(require("bignumber.js"));t();Zo.default.config({ROUNDING_MODE:Zo.default.ROUND_FLOOR});t();t();t();k();t();t();t();t();k();t();k();t();var bi=require("@elrondnetwork/erdjs");k();t();var Qe=require("@elrondnetwork/erdjs"),wi=require("@elrondnetwork/erdjs"),Si=require("@elrondnetwork/erdjs-network-providers");k();t();t();var Ti=y(require("bignumber.js"));k();t();k();t();t();t();t();t();k();t();E();var vi=["reDelegateRewards","claimRewards","unBond"],Ai=["wrapEgld","unwrapEgld"],Ii=["unStake"],Ei=["unDelegate"];t();t();t();k();t();var Ci=y(require("bignumber.js"));t();t();t();E();t();var Di=y(require("bignumber.js"));t();t();t();t();E();t();t();t();var Pi=y(require("anchorme"));t();k();t();var Fi=y(require("bignumber.js"));t();K();t();t();F();t();F();t();t();t();E();t();E();t();var Mi=y(require("bignumber.js"));k();E();t();E();t();var xr=require("react");K();t();t();E();t();var Oi=require("@elrondnetwork/erdjs/out"),Bi=y(require("bignumber.js"));E();t();E();t();t();F();var $f=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];t();var yr