UNPKG

@sofaws/dapp-core

Version:

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

1 lines 156 kB
"use strict";var ua=Object.create;var Ce=Object.defineProperty,ga=Object.defineProperties,fa=Object.getOwnPropertyDescriptor,Ta=Object.getOwnPropertyDescriptors,ha=Object.getOwnPropertyNames,Ge=Object.getOwnPropertySymbols,xa=Object.getPrototypeOf,vo=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable;var Dn=(o,e,n)=>e in o?Ce(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n,f=(o,e)=>{for(var n in e||(e={}))vo.call(e,n)&&Dn(o,n,e[n]);if(Ge)for(var n of Ge(e))Cn.call(e,n)&&Dn(o,n,e[n]);return o},w=(o,e)=>ga(o,Ta(e));var $e=(o,e)=>{var n={};for(var r in o)vo.call(o,r)&&e.indexOf(r)<0&&(n[r]=o[r]);if(o!=null&&Ge)for(var r of Ge(o))e.indexOf(r)<0&&Cn.call(o,r)&&(n[r]=o[r]);return n};var T=(o,e)=>()=>(o&&(e=o(o=0)),e);var Ve=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),te=(o,e)=>{for(var n in e)Ce(o,n,{get:e[n],enumerable:!0})},Pn=(o,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of ha(e))!vo.call(o,p)&&p!==n&&Ce(o,p,{get:()=>e[p],enumerable:!(r=fa(e,p))||r.enumerable});return o};var y=(o,e,n)=>(n=o!=null?ua(xa(o)):{},Pn(e||!o||!o.__esModule?Ce(n,"default",{value:o,enumerable:!0}):n,o)),Pe=o=>Pn(Ce({},"__esModule",{value:!0}),o);var b=(o,e,n)=>new Promise((r,p)=>{var s=d=>{try{l(n.next(d))}catch(g){p(g)}},m=d=>{try{l(n.throw(d))}catch(g){p(g)}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(s,m);l((n=n.apply(o,e)).next())});var Mn=Ve(He=>{"use strict";t();He.byteLength=ba;He.toByteArray=wa;He.fromByteArray=Ia;var $=[],B=[],ya=typeof Uint8Array!="undefined"?Uint8Array:Array,ko="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(re=0,Nn=ko.length;re<Nn;++re)$[re]=ko[re],B[ko.charCodeAt(re)]=re;var re,Nn;B["-".charCodeAt(0)]=62;B["_".charCodeAt(0)]=63;function Rn(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 ba(o){var e=Rn(o),n=e[0],r=e[1];return(n+r)*3/4-r}function Sa(o,e,n){return(e+n)*3/4-n}function wa(o){var e,n=Rn(o),r=n[0],p=n[1],s=new ya(Sa(o,r,p)),m=0,l=p>0?r-4:r,d;for(d=0;d<l;d+=4)e=B[o.charCodeAt(d)]<<18|B[o.charCodeAt(d+1)]<<12|B[o.charCodeAt(d+2)]<<6|B[o.charCodeAt(d+3)],s[m++]=e>>16&255,s[m++]=e>>8&255,s[m++]=e&255;return p===2&&(e=B[o.charCodeAt(d)]<<2|B[o.charCodeAt(d+1)]>>4,s[m++]=e&255),p===1&&(e=B[o.charCodeAt(d)]<<10|B[o.charCodeAt(d+1)]<<4|B[o.charCodeAt(d+2)]>>2,s[m++]=e>>8&255,s[m++]=e&255),s}function va(o){return $[o>>18&63]+$[o>>12&63]+$[o>>6&63]+$[o&63]}function ka(o,e,n){for(var r,p=[],s=e;s<n;s+=3)r=(o[s]<<16&16711680)+(o[s+1]<<8&65280)+(o[s+2]&255),p.push(va(r));return p.join("")}function Ia(o){for(var e,n=o.length,r=n%3,p=[],s=16383,m=0,l=n-r;m<l;m+=s)p.push(ka(o,m,m+s>l?l:m+s));return r===1?(e=o[n-1],p.push($[e>>2]+$[e<<4&63]+"==")):r===2&&(e=(o[n-2]<<8)+o[n-1],p.push($[e>>10]+$[e>>4&63]+$[e<<2&63]+"=")),p.join("")}});var On=Ve(Io=>{t();Io.read=function(o,e,n,r,p){var s,m,l=p*8-r-1,d=(1<<l)-1,g=d>>1,x=-7,h=n?p-1:0,D=n?-1:1,C=o[e+h];for(h+=D,s=C&(1<<-x)-1,C>>=-x,x+=l;x>0;s=s*256+o[e+h],h+=D,x-=8);for(m=s&(1<<-x)-1,s>>=-x,x+=r;x>0;m=m*256+o[e+h],h+=D,x-=8);if(s===0)s=1-g;else{if(s===d)return m?NaN:(C?-1:1)*(1/0);m=m+Math.pow(2,r),s=s-g}return(C?-1:1)*m*Math.pow(2,s-r)};Io.write=function(o,e,n,r,p,s){var m,l,d,g=s*8-p-1,x=(1<<g)-1,h=x>>1,D=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=r?0:s-1,Q=r?1:-1,z=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,m=x):(m=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-m))<1&&(m--,d*=2),m+h>=1?e+=D/d:e+=D*Math.pow(2,1-h),e*d>=2&&(m++,d/=2),m+h>=x?(l=0,m=x):m+h>=1?(l=(e*d-1)*Math.pow(2,p),m=m+h):(l=e*Math.pow(2,h-1)*Math.pow(2,p),m=0));p>=8;o[n+C]=l&255,C+=Q,l/=256,p-=8);for(m=m<<p|l,g+=p;g>0;o[n+C]=m&255,C+=Q,m/=256,g-=8);o[n+C-Q]|=z*128}});var Xn=Ve(ue=>{"use strict";t();var Ao=Mn(),le=On(),Fn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ue.Buffer=_;ue.SlowBuffer=Pa;ue.INSPECT_MAX_BYTES=50;var je=2147483647;ue.kMaxLength=je;_.TYPED_ARRAY_SUPPORT=Aa();!_.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 Aa(){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 q(o){if(o>je)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 Wn(o,e,n)}_.poolSize=8192;function Wn(o,e,n){if(typeof o=="string")return La(o,e);if(ArrayBuffer.isView(o))return Da(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(V(o,ArrayBuffer)||o&&V(o.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(V(o,SharedArrayBuffer)||o&&V(o.buffer,SharedArrayBuffer)))return Lo(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 p=Ca(o);if(p)return p;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 Wn(o,e,n)};Object.setPrototypeOf(_.prototype,Uint8Array.prototype);Object.setPrototypeOf(_,Uint8Array);function Gn(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 Ea(o,e,n){return Gn(o),o<=0?q(o):e!==void 0?typeof n=="string"?q(o).fill(e,n):q(o).fill(e):q(o)}_.alloc=function(o,e,n){return Ea(o,e,n)};function Co(o){return Gn(o),q(o<0?0:Po(o)|0)}_.allocUnsafe=function(o){return Co(o)};_.allocUnsafeSlow=function(o){return Co(o)};function La(o,e){if((typeof e!="string"||e==="")&&(e="utf8"),!_.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=$n(o,e)|0,r=q(n),p=r.write(o,e);return p!==n&&(r=r.slice(0,p)),r}function Eo(o){for(var e=o.length<0?0:Po(o.length)|0,n=q(e),r=0;r<e;r+=1)n[r]=o[r]&255;return n}function Da(o){if(V(o,Uint8Array)){var e=new Uint8Array(o);return Lo(e.buffer,e.byteOffset,e.byteLength)}return Eo(o)}function Lo(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 Ca(o){if(_.isBuffer(o)){var e=Po(o.length)|0,n=q(e);return n.length===0||o.copy(n,0,0,e),n}if(o.length!==void 0)return typeof o.length!="number"||No(o.length)?q(0):Eo(o);if(o.type==="Buffer"&&Array.isArray(o.data))return Eo(o.data)}function Po(o){if(o>=je)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+je.toString(16)+" bytes");return o|0}function Pa(o){return+o!=o&&(o=0),_.alloc(+o)}_.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==_.prototype};_.compare=function(e,n){if(V(e,Uint8Array)&&(e=_.from(e,e.offset,e.byteLength)),V(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,p=n.length,s=0,m=Math.min(r,p);s<m;++s)if(e[s]!==n[s]){r=e[s],p=n[s];break}return r<p?-1:p<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 p=_.allocUnsafe(n),s=0;for(r=0;r<e.length;++r){var m=e[r];if(V(m,Uint8Array))s+m.length>p.length?_.from(m).copy(p,s):Uint8Array.prototype.set.call(p,m,s);else if(_.isBuffer(m))m.copy(p,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=m.length}return p};function $n(o,e){if(_.isBuffer(o))return o.length;if(ArrayBuffer.isView(o)||V(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 p=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Do(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Kn(o).length;default:if(p)return r?-1:Do(o).length;e=(""+e).toLowerCase(),p=!0}}_.byteLength=$n;function Na(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 Va(this,e,n);case"utf8":case"utf-8":return Hn(this,e,n);case"ascii":return Ga(this,e,n);case"latin1":case"binary":return $a(this,e,n);case"base64":return Ua(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ha(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),r=!0}}_.prototype._isBuffer=!0;function ae(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)ae(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)ae(this,n,n+3),ae(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)ae(this,n,n+7),ae(this,n+1,n+6),ae(this,n+2,n+5),ae(this,n+3,n+4);return this};_.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?Hn(this,0,e):Na.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=ue.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"};Fn&&(_.prototype[Fn]=_.prototype.inspect);_.prototype.compare=function(e,n,r,p,s){if(V(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),p===void 0&&(p=0),s===void 0&&(s=this.length),n<0||r>e.length||p<0||s>this.length)throw new RangeError("out of range index");if(p>=s&&n>=r)return 0;if(p>=s)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,p>>>=0,s>>>=0,this===e)return 0;for(var m=s-p,l=r-n,d=Math.min(m,l),g=this.slice(p,s),x=e.slice(n,r),h=0;h<d;++h)if(g[h]!==x[h]){m=g[h],l=x[h];break}return m<l?-1:l<m?1:0};function Vn(o,e,n,r,p){if(o.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,No(n)&&(n=p?0:o.length-1),n<0&&(n=o.length+n),n>=o.length){if(p)return-1;n=o.length-1}else if(n<0)if(p)n=0;else return-1;if(typeof e=="string"&&(e=_.from(e,r)),_.isBuffer(e))return e.length===0?-1:Bn(o,e,n,r,p);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?p?Uint8Array.prototype.indexOf.call(o,e,n):Uint8Array.prototype.lastIndexOf.call(o,e,n):Bn(o,[e],n,r,p);throw new TypeError("val must be string, number or Buffer")}function Bn(o,e,n,r,p){var s=1,m=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;s=2,m/=2,l/=2,n/=2}function d(C,Q){return s===1?C[Q]:C.readUInt16BE(Q*s)}var g;if(p){var x=-1;for(g=n;g<m;g++)if(d(o,g)===d(e,x===-1?0:g-x)){if(x===-1&&(x=g),g-x+1===l)return x*s}else x!==-1&&(g-=g-x),x=-1}else for(n+l>m&&(n=m-l),g=n;g>=0;g--){for(var h=!0,D=0;D<l;D++)if(d(o,g+D)!==d(e,D)){h=!1;break}if(h)return g}return-1}_.prototype.includes=function(e,n,r){return this.indexOf(e,n,r)!==-1};_.prototype.indexOf=function(e,n,r){return Vn(this,e,n,r,!0)};_.prototype.lastIndexOf=function(e,n,r){return Vn(this,e,n,r,!1)};function Ra(o,e,n,r){n=Number(n)||0;var p=o.length-n;r?(r=Number(r),r>p&&(r=p)):r=p;var s=e.length;r>s/2&&(r=s/2);for(var m=0;m<r;++m){var l=parseInt(e.substr(m*2,2),16);if(No(l))return m;o[n+m]=l}return m}function Ma(o,e,n,r){return ze(Do(e,o.length-n),o,n,r)}function Oa(o,e,n,r){return ze(qa(e),o,n,r)}function Fa(o,e,n,r){return ze(Kn(e),o,n,r)}function Ba(o,e,n,r){return ze(Ka(e,o.length-n),o,n,r)}_.prototype.write=function(e,n,r,p){if(n===void 0)p="utf8",r=this.length,n=0;else if(r===void 0&&typeof n=="string")p=n,r=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(r)?(r=r>>>0,p===void 0&&(p="utf8")):(p=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-n;if((r===void 0||r>s)&&(r=s),e.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");p||(p="utf8");for(var m=!1;;)switch(p){case"hex":return Ra(this,e,n,r);case"utf8":case"utf-8":return Ma(this,e,n,r);case"ascii":case"latin1":case"binary":return Oa(this,e,n,r);case"base64":return Fa(this,e,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ba(this,e,n,r);default:if(m)throw new TypeError("Unknown encoding: "+p);p=(""+p).toLowerCase(),m=!0}};_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ua(o,e,n){return e===0&&n===o.length?Ao.fromByteArray(o):Ao.fromByteArray(o.slice(e,n))}function Hn(o,e,n){n=Math.min(o.length,n);for(var r=[],p=e;p<n;){var s=o[p],m=null,l=s>239?4:s>223?3:s>191?2:1;if(p+l<=n){var d,g,x,h;switch(l){case 1:s<128&&(m=s);break;case 2:d=o[p+1],(d&192)===128&&(h=(s&31)<<6|d&63,h>127&&(m=h));break;case 3:d=o[p+1],g=o[p+2],(d&192)===128&&(g&192)===128&&(h=(s&15)<<12|(d&63)<<6|g&63,h>2047&&(h<55296||h>57343)&&(m=h));break;case 4:d=o[p+1],g=o[p+2],x=o[p+3],(d&192)===128&&(g&192)===128&&(x&192)===128&&(h=(s&15)<<18|(d&63)<<12|(g&63)<<6|x&63,h>65535&&h<1114112&&(m=h))}}m===null?(m=65533,l=1):m>65535&&(m-=65536,r.push(m>>>10&1023|55296),m=56320|m&1023),r.push(m),p+=l}return Wa(r)}var Un=4096;function Wa(o){var e=o.length;if(e<=Un)return String.fromCharCode.apply(String,o);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,o.slice(r,r+=Un));return n}function Ga(o,e,n){var r="";n=Math.min(o.length,n);for(var p=e;p<n;++p)r+=String.fromCharCode(o[p]&127);return r}function $a(o,e,n){var r="";n=Math.min(o.length,n);for(var p=e;p<n;++p)r+=String.fromCharCode(o[p]);return r}function Va(o,e,n){var r=o.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var p="",s=e;s<n;++s)p+=Xa[o[s]];return p}function Ha(o,e,n){for(var r=o.slice(e,n),p="",s=0;s<r.length-1;s+=2)p+=String.fromCharCode(r[s]+r[s+1]*256);return p}_.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 p=this.subarray(e,n);return Object.setPrototypeOf(p,_.prototype),p};function L(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||L(e,n,this.length);for(var p=this[e],s=1,m=0;++m<n&&(s*=256);)p+=this[e+m]*s;return p};_.prototype.readUintBE=_.prototype.readUIntBE=function(e,n,r){e=e>>>0,n=n>>>0,r||L(e,n,this.length);for(var p=this[e+--n],s=1;n>0&&(s*=256);)p+=this[e+--n]*s;return p};_.prototype.readUint8=_.prototype.readUInt8=function(e,n){return e=e>>>0,n||L(e,1,this.length),this[e]};_.prototype.readUint16LE=_.prototype.readUInt16LE=function(e,n){return e=e>>>0,n||L(e,2,this.length),this[e]|this[e+1]<<8};_.prototype.readUint16BE=_.prototype.readUInt16BE=function(e,n){return e=e>>>0,n||L(e,2,this.length),this[e]<<8|this[e+1]};_.prototype.readUint32LE=_.prototype.readUInt32LE=function(e,n){return e=e>>>0,n||L(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||L(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||L(e,n,this.length);for(var p=this[e],s=1,m=0;++m<n&&(s*=256);)p+=this[e+m]*s;return s*=128,p>=s&&(p-=Math.pow(2,8*n)),p};_.prototype.readIntBE=function(e,n,r){e=e>>>0,n=n>>>0,r||L(e,n,this.length);for(var p=n,s=1,m=this[e+--p];p>0&&(s*=256);)m+=this[e+--p]*s;return s*=128,m>=s&&(m-=Math.pow(2,8*n)),m};_.prototype.readInt8=function(e,n){return e=e>>>0,n||L(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};_.prototype.readInt16LE=function(e,n){e=e>>>0,n||L(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||L(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||L(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||L(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||L(e,4,this.length),le.read(this,e,!0,23,4)};_.prototype.readFloatBE=function(e,n){return e=e>>>0,n||L(e,4,this.length),le.read(this,e,!1,23,4)};_.prototype.readDoubleLE=function(e,n){return e=e>>>0,n||L(e,8,this.length),le.read(this,e,!0,52,8)};_.prototype.readDoubleBE=function(e,n){return e=e>>>0,n||L(e,8,this.length),le.read(this,e,!1,52,8)};function R(o,e,n,r,p,s){if(!_.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>p||e<s)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,p){if(e=+e,n=n>>>0,r=r>>>0,!p){var s=Math.pow(2,8*r)-1;R(this,e,n,r,s,0)}var m=1,l=0;for(this[n]=e&255;++l<r&&(m*=256);)this[n+l]=e/m&255;return n+r};_.prototype.writeUintBE=_.prototype.writeUIntBE=function(e,n,r,p){if(e=+e,n=n>>>0,r=r>>>0,!p){var s=Math.pow(2,8*r)-1;R(this,e,n,r,s,0)}var m=r-1,l=1;for(this[n+m]=e&255;--m>=0&&(l*=256);)this[n+m]=e/l&255;return n+r};_.prototype.writeUint8=_.prototype.writeUInt8=function(e,n,r){return e=+e,n=n>>>0,r||R(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||R(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||R(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||R(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||R(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,p){if(e=+e,n=n>>>0,!p){var s=Math.pow(2,8*r-1);R(this,e,n,r,s-1,-s)}var m=0,l=1,d=0;for(this[n]=e&255;++m<r&&(l*=256);)e<0&&d===0&&this[n+m-1]!==0&&(d=1),this[n+m]=(e/l>>0)-d&255;return n+r};_.prototype.writeIntBE=function(e,n,r,p){if(e=+e,n=n>>>0,!p){var s=Math.pow(2,8*r-1);R(this,e,n,r,s-1,-s)}var m=r-1,l=1,d=0;for(this[n+m]=e&255;--m>=0&&(l*=256);)e<0&&d===0&&this[n+m+1]!==0&&(d=1),this[n+m]=(e/l>>0)-d&255;return n+r};_.prototype.writeInt8=function(e,n,r){return e=+e,n=n>>>0,r||R(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||R(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||R(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||R(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||R(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 jn(o,e,n,r,p,s){if(n+r>o.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function zn(o,e,n,r,p){return e=+e,n=n>>>0,p||jn(o,e,n,4,34028234663852886e22,-34028234663852886e22),le.write(o,e,n,r,23,4),n+4}_.prototype.writeFloatLE=function(e,n,r){return zn(this,e,n,!0,r)};_.prototype.writeFloatBE=function(e,n,r){return zn(this,e,n,!1,r)};function qn(o,e,n,r,p){return e=+e,n=n>>>0,p||jn(o,e,n,8,17976931348623157e292,-17976931348623157e292),le.write(o,e,n,r,52,8),n+8}_.prototype.writeDoubleLE=function(e,n,r){return qn(this,e,n,!0,r)};_.prototype.writeDoubleBE=function(e,n,r){return qn(this,e,n,!1,r)};_.prototype.copy=function(e,n,r,p){if(!_.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!p&&p!==0&&(p=this.length),n>=e.length&&(n=e.length),n||(n=0),p>0&&p<r&&(p=r),p===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(p<0)throw new RangeError("sourceEnd out of bounds");p>this.length&&(p=this.length),e.length-n<p-r&&(p=e.length-n+r);var s=p-r;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,r,p):Uint8Array.prototype.set.call(e,this.subarray(r,p),n),s};_.prototype.fill=function(e,n,r,p){if(typeof e=="string"){if(typeof n=="string"?(p=n,n=0,r=this.length):typeof r=="string"&&(p=r,r=this.length),p!==void 0&&typeof p!="string")throw new TypeError("encoding must be a string");if(typeof p=="string"&&!_.isEncoding(p))throw new TypeError("Unknown encoding: "+p);if(e.length===1){var s=e.charCodeAt(0);(p==="utf8"&&s<128||p==="latin1")&&(e=s)}}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 m;if(typeof e=="number")for(m=n;m<r;++m)this[m]=e;else{var l=_.isBuffer(e)?e:_.from(e,p),d=l.length;if(d===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(m=0;m<r-n;++m)this[m+n]=l[m%d]}return this};var ja=/[^+/0-9A-Za-z-_]/g;function za(o){if(o=o.split("=")[0],o=o.trim().replace(ja,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function Do(o,e){e=e||1/0;for(var n,r=o.length,p=null,s=[],m=0;m<r;++m){if(n=o.charCodeAt(m),n>55295&&n<57344){if(!p){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(m+1===r){(e-=3)>-1&&s.push(239,191,189);continue}p=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),p=n;continue}n=(p-55296<<10|n-56320)+65536}else p&&(e-=3)>-1&&s.push(239,191,189);if(p=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return s}function qa(o){for(var e=[],n=0;n<o.length;++n)e.push(o.charCodeAt(n)&255);return e}function Ka(o,e){for(var n,r,p,s=[],m=0;m<o.length&&!((e-=2)<0);++m)n=o.charCodeAt(m),r=n>>8,p=n%256,s.push(p),s.push(r);return s}function Kn(o){return Ao.toByteArray(za(o))}function ze(o,e,n,r){for(var p=0;p<r&&!(p+n>=e.length||p>=o.length);++p)e[p+n]=o[p];return p}function V(o,e){return o instanceof e||o!=null&&o.constructor!=null&&o.constructor.name!=null&&o.constructor.name===e.name}function No(o){return o!==o}var Xa=function(){for(var o="0123456789abcdef",e=new Array(256),n=0;n<16;++n)for(var r=n*16,p=0;p<16;++p)e[r+p]=o[n]+o[p];return e}()});var et=Ve((Kp,Qn)=>{t();var E=Qn.exports={},H,j;function Ro(){throw new Error("setTimeout has not been defined")}function Mo(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?H=setTimeout:H=Ro}catch(o){H=Ro}try{typeof clearTimeout=="function"?j=clearTimeout:j=Mo}catch(o){j=Mo}})();function Yn(o){if(H===setTimeout)return setTimeout(o,0);if((H===Ro||!H)&&setTimeout)return H=setTimeout,setTimeout(o,0);try{return H(o,0)}catch(e){try{return H.call(null,o,0)}catch(n){return H.call(this,o,0)}}}function Ya(o){if(j===clearTimeout)return clearTimeout(o);if((j===Mo||!j)&&clearTimeout)return j=clearTimeout,clearTimeout(o);try{return j(o)}catch(e){try{return j.call(null,o)}catch(n){return j.call(this,o)}}}var K=[],ge=!1,ie,qe=-1;function Za(){!ge||!ie||(ge=!1,ie.length?K=ie.concat(K):qe=-1,K.length&&Zn())}function Zn(){if(!ge){var o=Yn(Za);ge=!0;for(var e=K.length;e;){for(ie=K,K=[];++qe<e;)ie&&ie[qe].run();qe=-1,e=K.length}ie=null,ge=!1,Ya(o)}}E.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];K.push(new Jn(o,e)),K.length===1&&!ge&&Yn(Zn)};function Jn(o,e){this.fun=o,this.array=e}Jn.prototype.run=function(){this.fun.apply(null,this.array)};E.title="browser";E.browser=!0;E.env={};E.argv=[];E.version="";E.versions={};function X(){}E.on=X;E.addListener=X;E.once=X;E.off=X;E.removeListener=X;E.removeAllListeners=X;E.emit=X;E.prependListener=X;E.prependOnceListener=X;E.listeners=function(o){return[]};E.binding=function(o){throw new Error("process.binding is not supported")};E.cwd=function(){return"/"};E.chdir=function(o){throw new Error("process.chdir is not supported")};E.umask=function(){return 0}});var a,i,Xp,t=T(()=>{a=y(Xn()),i=y(et()),Xp=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 Ke,Oo=T(()=>{"use strict";t();Ke=()=>Date.now()/1e3});var ot=T(()=>{"use strict";t()});var nt=T(()=>{"use strict";t()});var Fo=T(()=>{"use strict";t();Oo();ot();nt()});var Uo={};te(Uo,{getItem:()=>Qa,localStorageKeys:()=>ee,removeItem:()=>ei,setItem:()=>Ja});var ee,Bo,Ja,Qa,ei,fe=T(()=>{"use strict";t();Fo();ee={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Bo=typeof localStorage!="undefined",Ja=({key:o,data:e,expires:n})=>{!Bo||localStorage.setItem(String(o),JSON.stringify({expires:n,data:e}))},Qa=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:Ke()>=n.expires?(localStorage.removeItem(String(o)),null):n.data},ei=o=>{!Bo||localStorage.removeItem(String(o))}});var Wo={};te(Wo,{clear:()=>it,getItem:()=>rt,removeItem:()=>at,setItem:()=>tt,storage:()=>oi});var tt,rt,at,it,oi,ct=T(()=>{"use strict";t();tt=({key:o,data:e,expires:n})=>{sessionStorage.setItem(String(o),JSON.stringify({expires:n,data:e}))},rt=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},at=o=>sessionStorage.removeItem(String(o)),it=()=>sessionStorage.clear(),oi={setItem:tt,getItem:rt,removeItem:at,clear:it}});var ce,Te=T(()=>{"use strict";t();fe();ct();ce={session:Wo,local:Uo}});function Ne(){return new Date().setHours(new Date().getHours()+24)}function Re(o){ce.local.setItem({key:ee.loginExpiresAt,data:o,expires:o})}var Go=T(()=>{"use strict";t();Te();fe()});var A=T(()=>{"use strict";t()});var he=T(()=>{"use strict";t()});var pt=T(()=>{"use strict";t()});var P=T(()=>{"use strict";t()});var st=T(()=>{"use strict";t()});var mt=T(()=>{"use strict";t()});var _t=T(()=>{"use strict";t()});var dt=T(()=>{"use strict";t()});var O=T(()=>{"use strict";t();pt();P();A();st();mt();_t();dt()});var $o,lt,ws,ut,vs,gt,ks,Is,As,ft=T(()=>{"use strict";t();O();$o={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:lt,egldLabel:ws}=$o["devnet"],{chainId:ut,egldLabel:vs}=$o["testnet"],{chainId:gt,egldLabel:ks}=$o["mainnet"],Is={["devnet"]:lt,["testnet"]:ut,["mainnet"]:gt},As={[lt]:"devnet",[ut]:"testnet",[gt]:"mainnet"}});var Vo=T(()=>{"use strict";t()});var Tt=T(()=>{"use strict";t()});var Xe,Ho=T(()=>{"use strict";t();Xe="transaction-status-toast-id"});var Me,Ye,ht,Ze,xt,xe,k=T(()=>{"use strict";t();he();ft();Vo();Tt();Ho();Me=5e4,Ye=1e9,ht=1,Ze="logout",xt="login",xe="0"});var jo,N,Y,M=T(()=>{"use strict";t();jo=require("@reduxjs/toolkit");k();N=(0,jo.createAction)(Ze),Y=(0,jo.createAction)(xt,o=>({payload:o}))});var bt,yt,St,js,wt,ni,Oe,vt,ti,kt,It,zo=T(()=>{"use strict";t();bt=require("@reduxjs/toolkit");Go();A();M();yt={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},St=(0,bt.createSlice)({name:"loginInfoSlice",initialState:yt,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(N,()=>yt),o.addCase(Y,(e,n)=>{e.loginMethod=n.payload.loginMethod,Re(Ne())})}}),{setLoginMethod:js,setWalletConnectLogin:wt,setLedgerLogin:ni,setTokenLogin:Oe,setTokenLoginSignature:vt,setWalletLogin:ti,invalidateLoginSession:kt}=St.actions,It=St.reducer});var Fe=T(()=>{"use strict";t()});var Et=T(()=>{"use strict";t();Fe()});function qo(o){return o[Math.floor(Math.random()*o.length)]}var Lt=T(()=>{"use strict";t()});var Ko=T(()=>{"use strict";t();Vo()});var ye=T(()=>{"use strict";t();Et();Lt();Ko()});var Dt,Ct,Xo,ri,Pt,im,cm,Nt,Yo=T(()=>{"use strict";t();Dt=require("@reduxjs/toolkit"),Ct=y(require("lodash.omit"));ye();Xo={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},ri={network:Xo,chainID:"-1"},Pt=(0,Dt.createSlice)({name:"appConfig",initialState:ri,reducers:{initializeNetworkConfig:(o,e)=>{let n=qo(e.payload.walletConnectBridgeAddresses),r=qo(e.payload.walletConnectV2RelayAddresses),p=(0,Ct.default)(e.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");o.network=w(f(f({},o.network),p),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(o,e)=>{o.chainID=e.payload}}}),{initializeNetworkConfig:im,setChainID:cm}=Pt.actions,Nt=Pt.reducer});var Jo,Rt,Mt,Je,Zo,Ot,Qo,gm,en,fm,ai,ii,Tm,hm,xm,ci,Ft,on=T(()=>{"use strict";t();Jo=require("@elrondnetwork/erdjs"),Rt=require("@reduxjs/toolkit"),Mt=require("redux-persist");k();Te();fe();M();Je={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:xe},Zo={address:"",websocketEvent:null,accounts:{"":Je},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Ot=(0,Rt.createSlice)({name:"accountInfoSlice",initialState:Zo,reducers:{setAddress:(o,e)=>{let n=e.payload;o.address=n,o.publicKey=new Jo.Address(n).hex()},setAccount:(o,e)=>{let n=o.address===e.payload.address;o.accounts={[o.address]:n?e.payload:Je},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(N,()=>(ce.local.removeItem(ee.loginExpiresAt),Zo)),o.addCase(Y,(e,n)=>{let{address:r}=n.payload;e.address=r,e.publicKey=new Jo.Address(r).hex()}),o.addCase(Mt.REHYDRATE,(e,n)=>{var g;if(!((g=n.payload)!=null&&g.account))return;let{account:r}=n.payload,{address:p,shard:s,accounts:m,publicKey:l}=r;e.address=p,e.shard=s;let d=m&&p in m;e.accounts=d?m:Zo.accounts,e.publicKey=l})}}),{setAccount:Qo,setAddress:gm,setAccountNonce:en,setAccountShard:fm,setLedgerAccount:ai,updateLedgerAccount:ii,setWalletConnectAccount:Tm,setIsAccountLoading:hm,setAccountLoadingError:xm,setWebsocketEvent:ci}=Ot.actions,Ft=Ot.reducer});function be(o){return o!=null&&(gi(o)||xi(o))}function Se(o){return o!=null&&(fi(o)||yi(o))}function we(o){return o!=null&&(Ti(o)||bi(o))}function nn(o){return o!=null&&hi(o)}function gi(o){return o!=null&&pi.includes(o)}function fi(o){return o!=null&&si.includes(o)}function Ti(o){return o!=null&&mi.includes(o)}function hi(o){return o!=null&&_i.includes(o)}function xi(o){return o!=null&&di.includes(o)}function yi(o){return o!=null&&li.includes(o)}function bi(o){return o!=null&&ui.includes(o)}var pi,si,mi,_i,di,li,ui,ve=T(()=>{"use strict";t();A();pi=["sent"],si=["success"],mi=["fail","cancelled","timedOut"],_i=["timedOut"],di=["pending"],li=["success"],ui=["fail","invalid"]});var Bt,Ut,Ue,Si,Wt,Gt,$t,wi,Qe,vi,ki,Em,Ii,eo,tn,oo,no=T(()=>{"use strict";t();Bt=require("@reduxjs/toolkit"),Ut=require("redux-persist");A();ve();M();Ue={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Si={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Wt=(0,Bt.createSlice)({name:"transactionsSlice",initialState:Ue,reducers:{moveTransactionsToSignedState:(o,e)=>{var d,g;let{sessionId:n,transactions:r,errorMessage:p,status:s,redirectRoute:m}=e.payload,l=((d=o.customTransactionInformationForSessionId)==null?void 0:d[n])||Si;o.signedTransactions[n]={transactions:r,status:s,errorMessage:p,redirectRoute:m,customTransactionInformation:l},((g=o==null?void 0:o.transactionsToSign)==null?void 0:g.sessionId)===n&&(o.transactionsToSign=Ue.transactionsToSign)},clearSignedTransaction:(o,e)=>{o.signedTransactions[e.payload]&&delete o.signedTransactions[e.payload]},clearTransactionToSign:o=>{o!=null&&o.transactionsToSign&&(o.transactionsToSign=null)},updateSignedTransaction:(o,e)=>{o.signedTransactions=f(f({},o.signedTransactions),e.payload)},updateSignedTransactions:(o,e)=>{let{sessionId:n,status:r,errorMessage:p,transactions:s}=e.payload;o.signedTransactions[n]!=null&&(o.signedTransactions[n].status=r,p!=null&&(o.signedTransactions[n].errorMessage=p),s!=null&&(o.signedTransactions[n].transactions=s))},updateSignedTransactionStatus:(o,e)=>{var l,d,g,x,h,D;let{sessionId:n,status:r,errorMessage:p,transactionHash:s}=e.payload,m=(d=(l=o.signedTransactions)==null?void 0:l[n])==null?void 0:d.transactions;if(m!=null){o.signedTransactions[n].transactions=m.map(z=>z.hash===s?w(f({},z),{status:r,errorMessage:p}):z);let C=(x=(g=o.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:x.every(z=>Se(z.status)),Q=(D=(h=o.signedTransactions[n])==null?void 0:h.transactions)==null?void 0:D.every(z=>we(z.status));C&&(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=Ue.transactionsToSign,o.signTransactionsError=null},clearAllSignedTransactions:o=>{o.signedTransactions=Ue.signedTransactions},setSignTransactionsError:(o,e)=>{o.signTransactionsError=e.payload},setSignTransactionsCancelMessage:(o,e)=>{o.signTransactionsCancelMessage=e.payload}},extraReducers:o=>{o.addCase(N,()=>Ue),o.addCase(Ut.REHYDRATE,(e,n)=>{var m;if(e.signTransactionsCancelMessage=null,!((m=n.payload)!=null&&m.transactions))return;let{signedTransactions:r,customTransactionInformationForSessionId:p}=n.payload.transactions,s=Object.entries(r).reduce((l,[d,g])=>{let x=new Date(d),h=new Date;return h.setHours(h.getHours()+5),h-x>0||(l[d]=g),l},{});p!=null&&(e.customTransactionInformationForSessionId=p),r!=null&&(e.signedTransactions=s)})}}),{updateSignedTransactionStatus:Gt,updateSignedTransactions:$t,setTransactionsToSign:wi,clearAllTransactionsToSign:Qe,clearAllSignedTransactions:vi,clearSignedTransaction:ki,clearTransactionToSign:Em,setSignTransactionsError:Ii,setSignTransactionsCancelMessage:eo,moveTransactionsToSignedState:tn}=Wt.actions,oo=Wt.reducer});var Vt,an,cn,pn,Ai,rn,Ht,Pm,Ei,sn,to,ro=T(()=>{"use strict";t();Vt=require("@reduxjs/toolkit");M();an="Transaction failed",cn="Transaction successful",pn="Processing transaction",Ai="Transaction submitted",rn={},Ht=(0,Vt.createSlice)({name:"transactionsInfo",initialState:rn,reducers:{setTransactionsDisplayInfo(o,e){let{sessionId:n,transactionsDisplayInfo:r}=e.payload;n!=null&&(o[n]={errorMessage:(r==null?void 0:r.errorMessage)||an,successMessage:(r==null?void 0:r.successMessage)||cn,processingMessage:(r==null?void 0:r.processingMessage)||pn,submittedMessage:(r==null?void 0:r.submittedMessage)||Ai,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(o,e){e.payload!=null&&delete o[e.payload]},clearTransactionsInfo:()=>rn},extraReducers:o=>{o.addCase(N,()=>rn)}}),{clearTransactionsInfo:Pm,setTransactionsDisplayInfo:Ei,clearTransactionsInfoForSessionId:sn}=Ht.actions,to=Ht.reducer});var zt,jt,qt,Om,Li,Fm,Di,Kt,mn=T(()=>{"use strict";t();zt=require("@reduxjs/toolkit");M();jt={},qt=(0,zt.createSlice)({name:"modalsSlice",initialState:jt,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(N,()=>jt)}}),{setTxSubmittedModal:Om,setNotificationModal:Li,clearTxSubmittedModal:Fm,clearNotificationModal:Di}=qt.actions,Kt=qt.reducer});var Yt,Zt,Xt,Jt,Ci,_n,jm,zm,qm,Km,ao,io=T(()=>{"use strict";t();Yt=require("@reduxjs/toolkit"),Zt=require("redux-persist");Ho();O();Oo();M();Xt={customToasts:[],transactionToasts:[],failTransactionToast:null},Jt=(0,Yt.createSlice)({name:"toastsSlice",initialState:Xt,reducers:{addCustomToast:(o,e)=>{o.customToasts.push(w(f({},e.payload),{type:"custom",toastId:e.payload.toastId||`custom-toast-${o.customToasts.length+1}`}))},removeCustomToast:(o,e)=>{o.customToasts=o.customToasts.filter(n=>n.toastId!==e.payload)},addTransactionToast:(o,e)=>{o.transactionToasts.push({type:"transaction",startTimestamp:Ke(),toastId:e.payload||`custom-toast-${o.transactionToasts.length+1}`})},removeTransactionToast:(o,e)=>{o.transactionToasts=o.transactionToasts.filter(n=>n.toastId!==e.payload)},addFailTransactionToast:(o,e)=>{o.failTransactionToast=w(f({},e.payload),{toastId:Xe})},removeFailTransactionToast:o=>{o.failTransactionToast=null}},extraReducers:o=>{o.addCase(N,()=>Xt),o.addCase(Zt.REHYDRATE,(e,n)=>{var p,s;let r=(s=(p=n.customToasts)==null?void 0:p.filter(m=>!("component"in m)))!=null?s:[];e.customToasts=r})}}),{addCustomToast:Ci,removeCustomToast:_n,addTransactionToast:jm,removeTransactionToast:zm,addFailTransactionToast:qm,removeFailTransactionToast:Km}=Jt.actions,ao=Jt.reducer});var I=T(()=>{"use strict";t();zo();Yo();on();no();ro();mn();io()});var dn=T(()=>{"use strict";t()});var nr,or,tr,u_,g_,f_,T_,h_,x_,rr,ar=T(()=>{"use strict";t();nr=require("@reduxjs/toolkit");M();or={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},tr=(0,nr.createSlice)({name:"dappModalsSlice",initialState:or,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=f({},e.payload)}},extraReducers:o=>{o.addCase(N,()=>or)}}),{setDappModalVisibility:u_,setDappModalHeaderVisibility:g_,setDappModalFooterVisibility:f_,setDappModalHeaderText:T_,setDappModalFooterText:h_,setDappModalConfig:x_}=tr.actions,rr=tr.reducer});var ir,Mi,Oi,ke,po=T(()=>{"use strict";t();ir=require("@reduxjs/toolkit");dn();on();ar();zo();mn();Yo();io();ro();no();Mi={["account"]:Ft,["networkConfig"]:Nt,["loginInfo"]:It,["modals"]:Kt,["dappModal"]:rr,["toasts"]:ao,["transactions"]:oo,["transactionsInfo"]:to},Oi=(o={})=>(0,ir.combineReducers)(f(f({},Mi),o)),ke=Oi});var sr={};te(sr,{default:()=>Vi});function ln(o,e=[]){return{key:o,version:1,storage:pr.default,blacklist:e}}var se,cr,pr,Fi,Bi,Ui,Wi,Gi,$i,Vi,mr=T(()=>{"use strict";t();se=require("redux-persist"),cr=y(require("redux-persist/lib/storage")),pr=y(require("redux-persist/lib/storage/session"));po();I();io();ro();no();dn();Fi={2:o=>w(f({},o),{networkConfig:Xo})};Bi=ln("dapp-core-transactionsInfo"),Ui=ln("dapp-core-transactions",["transactionsToSign"]),Wi=ln("dapp-core-toasts"),Gi={key:"dapp-core-store",version:2,storage:cr.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,se.createMigrate)(Fi,{debug:!1})},$i={["toasts"]:(0,se.persistReducer)(Wi,ao),["transactions"]:(0,se.persistReducer)(Ui,oo),["transactionsInfo"]:(0,se.persistReducer)(Bi,to)},Vi=(0,se.persistReducer)(Gi,ke($i))});var _r={};te(_r,{default:()=>Hi});var Hi,dr=T(()=>{"use strict";t();po();Hi=ke()});var lr={};te(lr,{default:()=>zi});var W,ji,zi,ur=T(()=>{"use strict";t();W=require("redux-persist"),ji=[W.FLUSH,W.REHYDRATE,W.PAUSE,W.PERSIST,W.PURGE,W.REGISTER],zi=ji});var Tr={};te(Tr,{default:()=>fr});function fr(o){return(0,gr.persistStore)(o)}var gr,hr=T(()=>{"use strict";t();gr=require("redux-persist")});var Vp={};te(Vp,{NonceMessage:()=>$p});module.exports=Pe(Vp);t();var wo=y(require("react")),da=require("@fortawesome/free-solid-svg-icons"),la=require("@fortawesome/react-fontawesome"),Ln=y(require("classnames"));t();t();t();var vr=require("react"),Ie=require("react-redux");t();var un=require("@reduxjs/toolkit"),Sr=require("react-redux/es/utils/Subscription");I();t();var Qt=y(require("lodash.throttle"));k();I();Go();Te();fe();var Pi=[Ze],Ni=(0,Qt.default)(()=>{Re(Ne())},5e3),er=o=>e=>n=>{var d;if(Pi.includes(n.type))return e(n);let r=o.getState(),p=ce.local.getItem(ee.loginExpiresAt);if(!((d=r==null?void 0:r.loginInfo)==null?void 0:d.isLoggedIn))return e(n);if(p==null)return Re(Ne());let m=Date.now();return p-m<0?setTimeout(()=>b(void 0,null,function*(){console.log("session expired");try{o.dispatch(kt())}catch(g){console.error("error logging out",g)}}),1e3):(Ni(),e(n))};t();t();function co(){return typeof sessionStorage!="undefined"}var xr=co()?(mr(),Pe(sr)).default:(dr(),Pe(_r)).default,yr=co()?(ur(),Pe(lr)).default:[],br=co()?(hr(),Pe(Tr)).default:o=>o;po();var S=(0,un.configureStore)({reducer:xr,middleware:o=>o({serializableCheck:{ignoredActions:[...yr,en.type,Qo.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(er)}),wr=(0,Sr.createSubscription)(S),H_=br(S),j_=(0,un.configureStore)({reducer:ke});var qi={store:S,subscription:wr},gn=(0,vr.createContext)(qi),X_=(0,Ie.createStoreHook)(gn),G=(0,Ie.createDispatchHook)(gn),v=(0,Ie.createSelectorHook)(gn);t();t();I();t();var kr=y(require("lodash.isequal")),so=require("reselect"),u=(0,so.createSelectorCreator)(so.defaultMemoize,kr.default);var Z=o=>o.account,Ae=u(Z,o=>o.address),Ee=u(Z,Ae,(o,e)=>e in o.accounts?o.accounts[e]:Je),Ki=u(Z,Ee,(o,e)=>{let p=o,{accounts:n}=p,r=$e(p,["accounts"]);return w(f({},r),{account:e})}),Xi=u(Ee,o=>o.balance),Yi=u(Ee,o=>{var e;return((e=o==null?void 0:o.nonce)==null?void 0:e.valueOf())||0}),ed=u(Z,o=>o.shard),Zi=u(Z,o=>o.ledgerAccount),od=u(Z,o=>o.walletConnectAccount),nd=u(Z,o=>o.isAccountLoading),td=u(Z,o=>o.accountLoadingError),Ir=u(Z,o=>o.websocketEvent);t();var oe=o=>o.networkConfig,mo=u(oe,o=>o.chainID),Ji=u(oe,o=>o.network.walletConnectBridgeAddress),Qi=u(oe,o=>o.network.walletConnectV2RelayAddress),ec=u(oe,o=>o.network.walletConnectV2ProjectId),Ar=u(oe,o=>o.network.walletConnectDeepLink),me=u(oe,o=>o.network),Er=u(me,o=>o.apiAddress),Lr=u(me,o=>o.explorerAddress),Dr=u(me,o=>o.egldLabel);t();A();var _e=o=>o.loginInfo,md=u(_e,o=>o.loginMethod),_o=u(_e,Ae,(o,e)=>o.loginMethod!=""&&Boolean(e)),_d=u(_e,o=>o.walletConnectLogin),dd=u(_e,o=>o.ledgerLogin),oc=u(_e,o=>o.walletLogin),ld=u(_e,o=>o.isLoginSessionInvalid);t();t();var F=require("@elrondnetwork/erdjs");k();t();function fn(o){try{return a.Buffer.from(o,"base64").toString()===atob(o)}catch(e){return!1}}function lo(o){var p,s,m;let{data:e}=o,n=fn(e!=null?e:"")?F.TransactionPayload.fromEncoded(e):new F.TransactionPayload(e),r=new F.Transaction(f({value:o.value.valueOf(),data:n,nonce:o.nonce.valueOf(),receiver:new F.Address(o.receiver),sender:new F.Address(o.sender),gasLimit:(p=o.gasLimit.valueOf())!=null?p:Me,gasPrice:(s=o.gasPrice.valueOf())!=null?s:Ye,chainID:o.chainID.valueOf(),version:new F.TransactionVersion((m=o.version)!=null?m:ht)},o.options?{options:new F.TransactionOptions(o.options)}:{}));return r.applySignature({hex:()=>o.signature||""},new F.Address(o.sender)),r}t();ve();t();var tc=y(require("bignumber.js"));O();t();t();t();t();var ac=require("@elrondnetwork/erdjs"),ic=y(require("bignumber.js"));A();t();var rc=require("@elrondnetwork/erdjs");t();t();t();var pc=require("@elrondnetwork/erdjs/out");t();k();t();var Nr=require("@elrondnetwork/erdjs");O();t();t();t();t();A();t();t();t();t();t();t();t();t();t();t();t();P();t();t();P();t();t();t();var fc=y(require("bignumber.js"));k();t();var gc=require("@elrondnetwork/erdjs"),hn=y(require("bignumber.js"));k();t();var lc=y(require("bignumber.js"));t();hn.default.config({ROUNDING_MODE:hn.default.ROUND_FLOOR});t();t();t();k();t();t();t();t();k();t();k();t();var Tc=require("@elrondnetwork/erdjs");k();t();var fo=require("@elrondnetwork/erdjs"),yc=require("@elrondnetwork/erdjs"),bc=require("@elrondnetwork/erdjs-network-providers");k();t();t();var hc=y(require("bignumber.js"));k();t();k();t();t();t();t();t();k();t();P();var wc=["reDelegateRewards","claimRewards","unBond"],vc=["wrapEgld","unwrapEgld"],kc=["unStake"],Ic=["unDelegate"];t();t();t();k();t();var Dc=y(require("bignumber.js"));t();t();t();P();t();var Cc=y(require("bignumber.js"));t();t();t();t();P();t();t();t();var Rc=y(require("anchorme"));t();k();t();var Mc=y(require("bignumber.js"));t();O();t();t();A();t();A();t();t();t();P();t();P();t();var Oc=y(require("bignumber.js"));k();P();t();P();t();var Wr=require("react");O();t();t();P();t();var Fc=require("@elrondnetwork/erdjs/out"),Bc=y(require("bignumber.js"));P();t();P();t();t();A();var FT=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];t();var Gr=require("react");O();t();var Wc=require("react");P();v