@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 54.2 kB
JavaScript
"use strict";var Io=Object.create;var de=Object.defineProperty,Eo=Object.defineProperties,ko=Object.getOwnPropertyDescriptor,Lo=Object.getOwnPropertyDescriptors,Do=Object.getOwnPropertyNames,be=Object.getOwnPropertySymbols,No=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable;var Yt=(e,t,r)=>t in e?de(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))Qe.call(t,r)&&Yt(e,r,t[r]);if(be)for(var r of be(t))Zt.call(t,r)&&Yt(e,r,t[r]);return e},v=(e,t)=>Eo(e,Lo(t));var Xt=(e,t)=>{var r={};for(var n in e)Qe.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&be)for(var n of be(e))t.indexOf(n)<0&&Zt.call(e,n)&&(r[n]=e[n]);return r};var T=(e,t)=>()=>(e&&(t=e(e=0)),t);var ve=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Z=(e,t)=>{for(var r in t)de(e,r,{get:t[r],enumerable:!0})},Jt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Do(t))!Qe.call(e,i)&&i!==r&&de(e,i,{get:()=>t[i],enumerable:!(n=ko(t,i))||n.enumerable});return e};var w=(e,t,r)=>(r=e!=null?Io(No(e)):{},Jt(t||!e||!e.__esModule?de(r,"default",{value:e,enumerable:!0}):r,e)),me=e=>Jt(de({},"__esModule",{value:!0}),e);var _=(e,t,r)=>new Promise((n,i)=>{var p=d=>{try{m(r.next(d))}catch(g){i(g)}},l=d=>{try{m(r.throw(d))}catch(g){i(g)}},m=d=>d.done?n(d.value):Promise.resolve(d.value).then(p,l);m((r=r.apply(e,t)).next())});var tr=ve(Ae=>{"use strict";o();Ae.byteLength=Co;Ae.toByteArray=Fo;Ae.fromByteArray=Oo;var M=[],C=[],Po=typeof Uint8Array!="undefined"?Uint8Array:Array,et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(X=0,Qt=et.length;X<Qt;++X)M[X]=et[X],C[et.charCodeAt(X)]=X;var X,Qt;C["-".charCodeAt(0)]=62;C["_".charCodeAt(0)]=63;function er(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function Co(e){var t=er(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Ro(e,t,r){return(t+r)*3/4-r}function Fo(e){var t,r=er(e),n=r[0],i=r[1],p=new Po(Ro(e,n,i)),l=0,m=i>0?n-4:n,d;for(d=0;d<m;d+=4)t=C[e.charCodeAt(d)]<<18|C[e.charCodeAt(d+1)]<<12|C[e.charCodeAt(d+2)]<<6|C[e.charCodeAt(d+3)],p[l++]=t>>16&255,p[l++]=t>>8&255,p[l++]=t&255;return i===2&&(t=C[e.charCodeAt(d)]<<2|C[e.charCodeAt(d+1)]>>4,p[l++]=t&255),i===1&&(t=C[e.charCodeAt(d)]<<10|C[e.charCodeAt(d+1)]<<4|C[e.charCodeAt(d+2)]>>2,p[l++]=t>>8&255,p[l++]=t&255),p}function _o(e){return M[e>>18&63]+M[e>>12&63]+M[e>>6&63]+M[e&63]}function Mo(e,t,r){for(var n,i=[],p=t;p<r;p+=3)n=(e[p]<<16&16711680)+(e[p+1]<<8&65280)+(e[p+2]&255),i.push(_o(n));return i.join("")}function Oo(e){for(var t,r=e.length,n=r%3,i=[],p=16383,l=0,m=r-n;l<m;l+=p)i.push(Mo(e,l,l+p>m?m:l+p));return n===1?(t=e[r-1],i.push(M[t>>2]+M[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(M[t>>10]+M[t>>4&63]+M[t<<2&63]+"=")),i.join("")}});var rr=ve(tt=>{o();tt.read=function(e,t,r,n,i){var p,l,m=i*8-n-1,d=(1<<m)-1,g=d>>1,h=-7,y=r?i-1:0,I=r?-1:1,E=e[t+y];for(y+=I,p=E&(1<<-h)-1,E>>=-h,h+=m;h>0;p=p*256+e[t+y],y+=I,h-=8);for(l=p&(1<<-h)-1,p>>=-h,h+=n;h>0;l=l*256+e[t+y],y+=I,h-=8);if(p===0)p=1-g;else{if(p===d)return l?NaN:(E?-1:1)*(1/0);l=l+Math.pow(2,n),p=p-g}return(E?-1:1)*l*Math.pow(2,p-n)};tt.write=function(e,t,r,n,i,p){var l,m,d,g=p*8-i-1,h=(1<<g)-1,y=h>>1,I=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:p-1,z=n?1:-1,$=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,l=h):(l=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-l))<1&&(l--,d*=2),l+y>=1?t+=I/d:t+=I*Math.pow(2,1-y),t*d>=2&&(l++,d/=2),l+y>=h?(m=0,l=h):l+y>=1?(m=(t*d-1)*Math.pow(2,i),l=l+y):(m=t*Math.pow(2,y-1)*Math.pow(2,i),l=0));i>=8;e[r+E]=m&255,E+=z,m/=256,i-=8);for(l=l<<i|m,g+=i;g>0;e[r+E]=l&255,E+=z,l/=256,g-=8);e[r+E-z]|=$*128}});var fr=ve(ie=>{"use strict";o();var rt=tr(),oe=rr(),nr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ie.Buffer=u;ie.SlowBuffer=Wo;ie.INSPECT_MAX_BYTES=50;var Ie=2147483647;ie.kMaxLength=Ie;u.TYPED_ARRAY_SUPPORT=Bo();!u.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 Bo(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(r){return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function V(e){if(e>Ie)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return at(e)}return ar(e,t,r)}u.poolSize=8192;function ar(e,t,r){if(typeof e=="string")return $o(e,t);if(ArrayBuffer.isView(e))return Vo(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(O(e,SharedArrayBuffer)||e&&O(e.buffer,SharedArrayBuffer)))return ot(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return u.from(n,t,r);var i=Ho(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}u.from=function(e,t,r){return ar(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function sr(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Uo(e,t,r){return sr(e),e<=0?V(e):t!==void 0?typeof r=="string"?V(e).fill(t,r):V(e).fill(t):V(e)}u.alloc=function(e,t,r){return Uo(e,t,r)};function at(e){return sr(e),V(e<0?0:st(e)|0)}u.allocUnsafe=function(e){return at(e)};u.allocUnsafeSlow=function(e){return at(e)};function $o(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=cr(e,t)|0,n=V(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function nt(e){for(var t=e.length<0?0:st(e.length)|0,r=V(t),n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Vo(e){if(O(e,Uint8Array)){var t=new Uint8Array(e);return ot(t.buffer,t.byteOffset,t.byteLength)}return nt(e)}function ot(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function Ho(e){if(u.isBuffer(e)){var t=st(e.length)|0,r=V(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||ct(e.length)?V(0):nt(e);if(e.type==="Buffer"&&Array.isArray(e.data))return nt(e.data)}function st(e){if(e>=Ie)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ie.toString(16)+" bytes");return e|0}function Wo(e){return+e!=e&&(e=0),u.alloc(+e)}u.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==u.prototype};u.compare=function(t,r){if(O(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),O(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(t)||!u.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var n=t.length,i=r.length,p=0,l=Math.min(n,i);p<l;++p)if(t[p]!==r[p]){n=t[p],i=r[p];break}return n<i?-1:i<n?1:0};u.isEncoding=function(t){switch(String(t).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}};u.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return u.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=u.allocUnsafe(r),p=0;for(n=0;n<t.length;++n){var l=t[n];if(O(l,Uint8Array))p+l.length>i.length?u.from(l).copy(i,p):Uint8Array.prototype.set.call(i,l,p);else if(u.isBuffer(l))l.copy(i,p);else throw new TypeError('"list" argument must be an Array of Buffers');p+=l.length}return i};function cr(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return it(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return gr(e).length;default:if(i)return n?-1:it(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=cr;function Go(e,t,r){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return ei(this,t,r);case"utf8":case"utf-8":return pr(this,t,r);case"ascii":return Jo(this,t,r);case"latin1":case"binary":return Qo(this,t,r);case"base64":return Zo(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ti(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function J(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}u.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)J(this,r,r+1);return this};u.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)J(this,r,r+3),J(this,r+1,r+2);return this};u.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)J(this,r,r+7),J(this,r+1,r+6),J(this,r+2,r+5),J(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?pr(this,0,t):Go.apply(this,arguments)};u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:u.compare(this,t)===0};u.prototype.inspect=function(){var t="",r=ie.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};nr&&(u.prototype[nr]=u.prototype.inspect);u.prototype.compare=function(t,r,n,i,p){if(O(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),p===void 0&&(p=this.length),r<0||n>t.length||i<0||p>this.length)throw new RangeError("out of range index");if(i>=p&&r>=n)return 0;if(i>=p)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,p>>>=0,this===t)return 0;for(var l=p-i,m=n-r,d=Math.min(l,m),g=this.slice(i,p),h=t.slice(r,n),y=0;y<d;++y)if(g[y]!==h[y]){l=g[y],m=h[y];break}return l<m?-1:m<l?1:0};function lr(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,ct(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=u.from(t,n)),u.isBuffer(t))return t.length===0?-1:or(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):or(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function or(e,t,r,n,i){var p=1,l=e.length,m=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;p=2,l/=2,m/=2,r/=2}function d(E,z){return p===1?E[z]:E.readUInt16BE(z*p)}var g;if(i){var h=-1;for(g=r;g<l;g++)if(d(e,g)===d(t,h===-1?0:g-h)){if(h===-1&&(h=g),g-h+1===m)return h*p}else h!==-1&&(g-=g-h),h=-1}else for(r+m>l&&(r=l-m),g=r;g>=0;g--){for(var y=!0,I=0;I<m;I++)if(d(e,g+I)!==d(t,I)){y=!1;break}if(y)return g}return-1}u.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};u.prototype.indexOf=function(t,r,n){return lr(this,t,r,n,!0)};u.prototype.lastIndexOf=function(t,r,n){return lr(this,t,r,n,!1)};function qo(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var p=t.length;n>p/2&&(n=p/2);for(var l=0;l<n;++l){var m=parseInt(t.substr(l*2,2),16);if(ct(m))return l;e[r+l]=m}return l}function zo(e,t,r,n){return Ee(it(t,e.length-r),e,r,n)}function jo(e,t,r,n){return Ee(oi(t),e,r,n)}function Ko(e,t,r,n){return Ee(gr(t),e,r,n)}function Yo(e,t,r,n){return Ee(ii(t,e.length-r),e,r,n)}u.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var p=this.length-r;if((n===void 0||n>p)&&(n=p),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var l=!1;;)switch(i){case"hex":return qo(this,t,r,n);case"utf8":case"utf-8":return zo(this,t,r,n);case"ascii":case"latin1":case"binary":return jo(this,t,r,n);case"base64":return Ko(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yo(this,t,r,n);default:if(l)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),l=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Zo(e,t,r){return t===0&&r===e.length?rt.fromByteArray(e):rt.fromByteArray(e.slice(t,r))}function pr(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var p=e[i],l=null,m=p>239?4:p>223?3:p>191?2:1;if(i+m<=r){var d,g,h,y;switch(m){case 1:p<128&&(l=p);break;case 2:d=e[i+1],(d&192)===128&&(y=(p&31)<<6|d&63,y>127&&(l=y));break;case 3:d=e[i+1],g=e[i+2],(d&192)===128&&(g&192)===128&&(y=(p&15)<<12|(d&63)<<6|g&63,y>2047&&(y<55296||y>57343)&&(l=y));break;case 4:d=e[i+1],g=e[i+2],h=e[i+3],(d&192)===128&&(g&192)===128&&(h&192)===128&&(y=(p&15)<<18|(d&63)<<12|(g&63)<<6|h&63,y>65535&&y<1114112&&(l=y))}}l===null?(l=65533,m=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|l&1023),n.push(l),i+=m}return Xo(n)}var ir=4096;function Xo(e){var t=e.length;if(t<=ir)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=ir));return r}function Jo(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function Qo(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function ei(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",p=t;p<r;++p)i+=ai[e[p]];return i}function ti(e,t,r){for(var n=e.slice(t,r),i="",p=0;p<n.length-1;p+=2)i+=String.fromCharCode(n[p]+n[p+1]*256);return i}u.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);var i=this.subarray(t,r);return Object.setPrototypeOf(i,u.prototype),i};function A(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||A(t,r,this.length);for(var i=this[t],p=1,l=0;++l<r&&(p*=256);)i+=this[t+l]*p;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||A(t,r,this.length);for(var i=this[t+--r],p=1;r>0&&(p*=256);)i+=this[t+--r]*p;return i};u.prototype.readUint8=u.prototype.readUInt8=function(t,r){return t=t>>>0,r||A(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||A(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||A(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||A(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||A(t,r,this.length);for(var i=this[t],p=1,l=0;++l<r&&(p*=256);)i+=this[t+l]*p;return p*=128,i>=p&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||A(t,r,this.length);for(var i=r,p=1,l=this[t+--i];i>0&&(p*=256);)l+=this[t+--i]*p;return p*=128,l>=p&&(l-=Math.pow(2,8*r)),l};u.prototype.readInt8=function(t,r){return t=t>>>0,r||A(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||A(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(t,r){t=t>>>0,r||A(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(t,r){return t=t>>>0,r||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};u.prototype.readInt32BE=function(t,r){return t=t>>>0,r||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};u.prototype.readFloatLE=function(t,r){return t=t>>>0,r||A(t,4,this.length),oe.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||A(t,4,this.length),oe.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||A(t,8,this.length),oe.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||A(t,8,this.length),oe.read(this,t,!1,52,8)};function L(e,t,r,n,i,p){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<p)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var p=Math.pow(2,8*n)-1;L(this,t,r,n,p,0)}var l=1,m=0;for(this[r]=t&255;++m<n&&(l*=256);)this[r+m]=t/l&255;return r+n};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var p=Math.pow(2,8*n)-1;L(this,t,r,n,p,0)}var l=n-1,m=1;for(this[r+l]=t&255;--l>=0&&(m*=256);)this[r+l]=t/m&255;return r+n};u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,1,255,0),this[r]=t&255,r+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};u.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var p=Math.pow(2,8*n-1);L(this,t,r,n,p-1,-p)}var l=0,m=1,d=0;for(this[r]=t&255;++l<n&&(m*=256);)t<0&&d===0&&this[r+l-1]!==0&&(d=1),this[r+l]=(t/m>>0)-d&255;return r+n};u.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var p=Math.pow(2,8*n-1);L(this,t,r,n,p-1,-p)}var l=n-1,m=1,d=0;for(this[r+l]=t&255;--l>=0&&(m*=256);)t<0&&d===0&&this[r+l+1]!==0&&(d=1),this[r+l]=(t/m>>0)-d&255;return r+n};u.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};u.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};u.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function ur(e,t,r,n,i,p){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function dr(e,t,r,n,i){return t=+t,r=r>>>0,i||ur(e,t,r,4,34028234663852886e22,-34028234663852886e22),oe.write(e,t,r,n,23,4),r+4}u.prototype.writeFloatLE=function(t,r,n){return dr(this,t,r,!0,n)};u.prototype.writeFloatBE=function(t,r,n){return dr(this,t,r,!1,n)};function mr(e,t,r,n,i){return t=+t,r=r>>>0,i||ur(e,t,r,8,17976931348623157e292,-17976931348623157e292),oe.write(e,t,r,n,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,n){return mr(this,t,r,!0,n)};u.prototype.writeDoubleBE=function(t,r,n){return mr(this,t,r,!1,n)};u.prototype.copy=function(t,r,n,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var p=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),p};u.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var p=t.charCodeAt(0);(i==="utf8"&&p<128||i==="latin1")&&(t=p)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var l;if(typeof t=="number")for(l=r;l<n;++l)this[l]=t;else{var m=u.isBuffer(t)?t:u.from(t,i),d=m.length;if(d===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(l=0;l<n-r;++l)this[l+r]=m[l%d]}return this};var ri=/[^+/0-9A-Za-z-_]/g;function ni(e){if(e=e.split("=")[0],e=e.trim().replace(ri,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function it(e,t){t=t||1/0;for(var r,n=e.length,i=null,p=[],l=0;l<n;++l){if(r=e.charCodeAt(l),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&p.push(239,191,189);continue}else if(l+1===n){(t-=3)>-1&&p.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&p.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&p.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;p.push(r)}else if(r<2048){if((t-=2)<0)break;p.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;p.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;p.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return p}function oi(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function ii(e,t){for(var r,n,i,p=[],l=0;l<e.length&&!((t-=2)<0);++l)r=e.charCodeAt(l),n=r>>8,i=r%256,p.push(i),p.push(n);return p}function gr(e){return rt.toByteArray(ni(e))}function Ee(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function O(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function ct(e){return e!==e}var ai=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=r*16,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()});var Sr=ve((Fa,xr)=>{o();var S=xr.exports={},B,U;function lt(){throw new Error("setTimeout has not been defined")}function pt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?B=setTimeout:B=lt}catch(e){B=lt}try{typeof clearTimeout=="function"?U=clearTimeout:U=pt}catch(e){U=pt}})();function Tr(e){if(B===setTimeout)return setTimeout(e,0);if((B===lt||!B)&&setTimeout)return B=setTimeout,setTimeout(e,0);try{return B(e,0)}catch(t){try{return B.call(null,e,0)}catch(r){return B.call(this,e,0)}}}function si(e){if(U===clearTimeout)return clearTimeout(e);if((U===pt||!U)&&clearTimeout)return U=clearTimeout,clearTimeout(e);try{return U(e)}catch(t){try{return U.call(null,e)}catch(r){return U.call(this,e)}}}var H=[],ae=!1,Q,ke=-1;function ci(){!ae||!Q||(ae=!1,Q.length?H=Q.concat(H):ke=-1,H.length&&yr())}function yr(){if(!ae){var e=Tr(ci);ae=!0;for(var t=H.length;t;){for(Q=H,H=[];++ke<t;)Q&&Q[ke].run();ke=-1,t=H.length}Q=null,ae=!1,si(e)}}S.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];H.push(new hr(e,t)),H.length===1&&!ae&&Tr(yr)};function hr(e,t){this.fun=e,this.array=t}hr.prototype.run=function(){this.fun.apply(null,this.array)};S.title="browser";S.browser=!0;S.env={};S.argv=[];S.version="";S.versions={};function W(){}S.on=W;S.addListener=W;S.once=W;S.off=W;S.removeListener=W;S.removeAllListeners=W;S.emit=W;S.prependListener=W;S.prependOnceListener=W;S.listeners=function(e){return[]};S.binding=function(e){throw new Error("process.binding is not supported")};S.cwd=function(){return"/"};S.chdir=function(e){throw new Error("process.chdir is not supported")};S.umask=function(){return 0}});var a,s,_a,o=T(()=>{a=w(fr()),s=w(Sr()),_a=function(e){function t(){var n=this||self;return delete e.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var r=__magic__;return r}(Object)});var wr=T(()=>{"use strict";o()});var br=T(()=>{"use strict";o()});var k=T(()=>{"use strict";o()});var N=T(()=>{"use strict";o()});var vr=T(()=>{"use strict";o()});var Ar=T(()=>{"use strict";o()});var Ir=T(()=>{"use strict";o()});var Er=T(()=>{"use strict";o()});var j=T(()=>{"use strict";o();br();k();N();vr();Ar();Ir();Er()});var ut,kr,Xa,Lr,Ja,Dr,Qa,es,ts,Nr=T(()=>{"use strict";o();j();ut={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:kr,egldLabel:Xa}=ut["devnet"],{chainId:Lr,egldLabel:Ja}=ut["testnet"],{chainId:Dr,egldLabel:Qa}=ut["mainnet"],es={["devnet"]:kr,["testnet"]:Lr,["mainnet"]:Dr},ts={[kr]:"devnet",[Lr]:"testnet",[Dr]:"mainnet"}});var dt=T(()=>{"use strict";o()});var Pr=T(()=>{"use strict";o()});var Cr,mt=T(()=>{"use strict";o();Cr="transaction-status-toast-id"});var gt,ft,Rr,Le,Fr,se,b=T(()=>{"use strict";o();wr();Nr();dt();Pr();mt();gt=5e4,ft=1e9,Rr=1,Le="logout",Fr="login",se="0"});var Pe,ht=T(()=>{"use strict";o();Pe=()=>Date.now()/1e3});var Ur=T(()=>{"use strict";o()});var $r=T(()=>{"use strict";o()});var Vr=T(()=>{"use strict";o();ht();Ur();$r()});var St={};Z(St,{getItem:()=>ui,localStorageKeys:()=>te,removeItem:()=>di,setItem:()=>pi});var te,xt,pi,ui,di,ge=T(()=>{"use strict";o();Vr();te={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},xt=typeof localStorage!="undefined",pi=({key:e,data:t,expires:r})=>{!xt||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},ui=e=>{if(!xt)return;let t=localStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Pe()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},di=e=>{!xt||localStorage.removeItem(String(e))}});var wt={};Z(wt,{clear:()=>qr,getItem:()=>Wr,removeItem:()=>Gr,setItem:()=>Hr,storage:()=>mi});var Hr,Wr,Gr,qr,mi,zr=T(()=>{"use strict";o();Hr=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Wr=e=>{let t=sessionStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Date.now()>=r.expires?(sessionStorage.removeItem(String(e)),null):r.data},Gr=e=>sessionStorage.removeItem(String(e)),qr=()=>sessionStorage.clear(),mi={setItem:Hr,getItem:Wr,removeItem:Gr,clear:qr}});var ce,Ce=T(()=>{"use strict";o();ge();zr();ce={session:wt,local:St}});function fe(){return new Date().setHours(new Date().getHours()+24)}function Te(e){ce.local.setItem({key:te.loginExpiresAt,data:e,expires:e})}var bt=T(()=>{"use strict";o();Ce();ge()});var vt,D,Re,K=T(()=>{"use strict";o();vt=require("@reduxjs/toolkit");b();D=(0,vt.createAction)(Le),Re=(0,vt.createAction)(Fr,e=>({payload:e}))});var Kr,jr,Yr,Hs,Ws,Gs,qs,zs,js,Zr,Xr,At=T(()=>{"use strict";o();Kr=require("@reduxjs/toolkit");bt();N();K();jr={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Yr=(0,Kr.createSlice)({name:"loginInfoSlice",initialState:jr,reducers:{setLoginMethod:(e,t)=>{e.loginMethod=t.payload},setTokenLogin:(e,t)=>{e.tokenLogin=t.payload},setTokenLoginSignature:(e,t)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=t.payload)},setWalletLogin:(e,t)=>{e.walletLogin=t.payload},setWalletConnectLogin:(e,t)=>{e.walletConnectLogin=t.payload},setLedgerLogin:(e,t)=>{e.ledgerLogin=t.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0}},extraReducers:e=>{e.addCase(D,()=>jr),e.addCase(Re,(t,r)=>{t.loginMethod=r.payload.loginMethod,Te(fe())})}}),{setLoginMethod:Hs,setWalletConnectLogin:Ws,setLedgerLogin:Gs,setTokenLogin:qs,setTokenLoginSignature:zs,setWalletLogin:js,invalidateLoginSession:Zr}=Yr.actions,Xr=Yr.reducer});var Jr=T(()=>{"use strict";o()});var Qr=T(()=>{"use strict";o();Jr()});function It(e){return e[Math.floor(Math.random()*e.length)]}var en=T(()=>{"use strict";o()});var tn=T(()=>{"use strict";o();dt()});var rn=T(()=>{"use strict";o();Qr();en();tn()});var nn,on,Et,gi,an,lc,pc,sn,kt=T(()=>{"use strict";o();nn=require("@reduxjs/toolkit"),on=w(require("lodash.omit"));rn();Et={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},gi={network:Et,chainID:"-1"},an=(0,nn.createSlice)({name:"appConfig",initialState:gi,reducers:{initializeNetworkConfig:(e,t)=>{let r=It(t.payload.walletConnectBridgeAddresses),n=It(t.payload.walletConnectV2RelayAddresses),i=(0,on.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=v(x(x({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:n})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:lc,setChainID:pc}=an.actions,sn=an.reducer});var Dt,cn,ln,Fe,Lt,pn,_e,hc,un,xc,Sc,wc,bc,vc,Ac,Ic,dn,Nt=T(()=>{"use strict";o();Dt=require("@elrondnetwork/erdjs"),cn=require("@reduxjs/toolkit"),ln=require("redux-persist");b();Ce();ge();K();Fe={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:se},Lt={address:"",websocketEvent:null,accounts:{"":Fe},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},pn=(0,cn.createSlice)({name:"accountInfoSlice",initialState:Lt,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new Dt.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Fe},e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,t)=>{let{address:r}=e;e.accounts[r].nonce=t.payload},setAccountShard:(e,t)=>{e.shard=t.payload},setLedgerAccount:(e,t)=>{e.ledgerAccount=t.payload},updateLedgerAccount:(e,t)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=t.payload.index,e.ledgerAccount.address=t.payload.address)},setWalletConnectAccount:(e,t)=>{e.walletConnectAccount=t.payload},setIsAccountLoading:(e,t)=>{e.isAccountLoading=t.payload,e.accountLoadingError=null},setAccountLoadingError:(e,t)=>{e.accountLoadingError=t.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,t)=>{e.websocketEvent={timestamp:Date.now(),message:t.payload}}},extraReducers:e=>{e.addCase(D,()=>(ce.local.removeItem(te.loginExpiresAt),Lt)),e.addCase(Re,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new Dt.Address(n).hex()}),e.addCase(ln.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:i,shard:p,accounts:l,publicKey:m}=n;t.address=i,t.shard=p;let d=l&&i in l;t.accounts=d?l:Lt.accounts,t.publicKey=m})}}),{setAccount:_e,setAddress:hc,setAccountNonce:un,setAccountShard:xc,setLedgerAccount:Sc,updateLedgerAccount:wc,setWalletConnectAccount:bc,setIsAccountLoading:vc,setAccountLoadingError:Ac,setWebsocketEvent:Ic}=pn.actions,dn=pn.reducer});function mn(e){return e!=null&&(vi(e)||ki(e))}function Me(e){return e!=null&&(Ai(e)||Li(e))}function Oe(e){return e!=null&&(Ii(e)||Di(e))}function gn(e){return e!=null&&Ei(e)}function vi(e){return e!=null&&Ti.includes(e)}function Ai(e){return e!=null&&yi.includes(e)}function Ii(e){return e!=null&&hi.includes(e)}function Ei(e){return e!=null&&xi.includes(e)}function ki(e){return e!=null&&Si.includes(e)}function Li(e){return e!=null&&wi.includes(e)}function Di(e){return e!=null&&bi.includes(e)}var Ti,yi,hi,xi,Si,wi,bi,Ct=T(()=>{"use strict";o();N();Ti=["sent"],yi=["success"],hi=["fail","cancelled","timedOut"],xi=["timedOut"],Si=["pending"],wi=["success"],bi=["fail","invalid"]});var fn,Tn,ye,Ni,yn,Fc,_c,Mc,Oc,Bc,Uc,$c,Vc,Hc,Wc,Be,Ue=T(()=>{"use strict";o();fn=require("@reduxjs/toolkit"),Tn=require("redux-persist");N();Ct();K();ye={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Ni={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},yn=(0,fn.createSlice)({name:"transactionsSlice",initialState:ye,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,g;let{sessionId:r,transactions:n,errorMessage:i,status:p,redirectRoute:l}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||Ni;e.signedTransactions[r]={transactions:n,status:p,errorMessage:i,redirectRoute:l,customTransactionInformation:m},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===r&&(e.transactionsToSign=ye.transactionsToSign)},clearSignedTransaction:(e,t)=>{e.signedTransactions[t.payload]&&delete e.signedTransactions[t.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,t)=>{e.signedTransactions=x(x({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:n,errorMessage:i,transactions:p}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=n,i!=null&&(e.signedTransactions[r].errorMessage=i),p!=null&&(e.signedTransactions[r].transactions=p))},updateSignedTransactionStatus:(e,t)=>{var m,d,g,h,y,I;let{sessionId:r,status:n,errorMessage:i,transactionHash:p}=t.payload,l=(d=(m=e.signedTransactions)==null?void 0:m[r])==null?void 0:d.transactions;if(l!=null){e.signedTransactions[r].transactions=l.map($=>$.hash===p?v(x({},$),{status:n,errorMessage:i}):$);let E=(h=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:h.every($=>Me($.status)),z=(I=(y=e.signedTransactions[r])==null?void 0:y.transactions)==null?void 0:I.every($=>Oe($.status));E&&(e.signedTransactions[r].status="success"),z&&(e.signedTransactions[r].status="fail")}},setTransactionsToSign:(e,t)=>{e.transactionsToSign=t.payload;let{sessionId:r,customTransactionInformation:n}=t.payload;e.customTransactionInformationForSessionId[r]=n,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=ye.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=ye.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(D,()=>ye),e.addCase(Tn.REHYDRATE,(t,r)=>{var l;if(t.signTransactionsCancelMessage=null,!((l=r.payload)!=null&&l.transactions))return;let{signedTransactions:n,customTransactionInformationForSessionId:i}=r.payload.transactions,p=Object.entries(n).reduce((m,[d,g])=>{let h=new Date(d),y=new Date;return y.setHours(y.getHours()+5),y-h>0||(m[d]=g),m},{});i!=null&&(t.customTransactionInformationForSessionId=i),n!=null&&(t.signedTransactions=p)})}}),{updateSignedTransactionStatus:Fc,updateSignedTransactions:_c,setTransactionsToSign:Mc,clearAllTransactionsToSign:Oc,clearAllSignedTransactions:Bc,clearSignedTransaction:Uc,clearTransactionToSign:$c,setSignTransactionsError:Vc,setSignTransactionsCancelMessage:Hc,moveTransactionsToSignedState:Wc}=yn.actions,Be=yn.reducer});var hn,Ft,_t,Mt,Pi,Rt,xn,jc,Kc,Yc,$e,Ve=T(()=>{"use strict";o();hn=require("@reduxjs/toolkit");K();Ft="Transaction failed",_t="Transaction successful",Mt="Processing transaction",Pi="Transaction submitted",Rt={},xn=(0,hn.createSlice)({name:"transactionsInfo",initialState:Rt,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||Ft,successMessage:(n==null?void 0:n.successMessage)||_t,processingMessage:(n==null?void 0:n.processingMessage)||Mt,submittedMessage:(n==null?void 0:n.submittedMessage)||Pi,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>Rt},extraReducers:e=>{e.addCase(D,()=>Rt)}}),{clearTransactionsInfo:jc,setTransactionsDisplayInfo:Kc,clearTransactionsInfoForSessionId:Yc}=xn.actions,$e=xn.reducer});var wn,Sn,bn,Qc,el,tl,rl,vn,Ot=T(()=>{"use strict";o();wn=require("@reduxjs/toolkit");K();Sn={},bn=(0,wn.createSlice)({name:"modalsSlice",initialState:Sn,reducers:{setTxSubmittedModal:(e,t)=>{e.txSubmittedModal=t.payload},setNotificationModal:(e,t)=>{e.notificationModal=t.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(D,()=>Sn)}}),{setTxSubmittedModal:Qc,setNotificationModal:el,clearTxSubmittedModal:tl,clearNotificationModal:rl}=bn.actions,vn=bn.reducer});var In,En,An,kn,pl,ul,dl,ml,gl,fl,He,We=T(()=>{"use strict";o();In=require("@reduxjs/toolkit"),En=require("redux-persist");mt();j();ht();K();An={customToasts:[],transactionToasts:[],failTransactionToast:null},kn=(0,In.createSlice)({name:"toastsSlice",initialState:An,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(v(x({},t.payload),{type:"custom",toastId:t.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,t)=>{e.customToasts=e.customToasts.filter(r=>r.toastId!==t.payload)},addTransactionToast:(e,t)=>{e.transactionToasts.push({type:"transaction",startTimestamp:Pe(),toastId:t.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,t)=>{e.transactionToasts=e.transactionToasts.filter(r=>r.toastId!==t.payload)},addFailTransactionToast:(e,t)=>{e.failTransactionToast=v(x({},t.payload),{toastId:Cr})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(D,()=>An),e.addCase(En.REHYDRATE,(t,r)=>{var i,p;let n=(p=(i=r.customToasts)==null?void 0:i.filter(l=>!("component"in l)))!=null?p:[];t.customToasts=n})}}),{addCustomToast:pl,removeCustomToast:ul,addTransactionToast:dl,removeTransactionToast:ml,addFailTransactionToast:gl,removeFailTransactionToast:fl}=kn.actions,He=kn.reducer});var re=T(()=>{"use strict";o();At();kt();Nt();Ue();Ve();Ot();We()});var Bt=T(()=>{"use strict";o()});var Pn,Nn,Cn,_l,Ml,Ol,Bl,Ul,$l,Rn,Fn=T(()=>{"use strict";o();Pn=require("@reduxjs/toolkit");K();Nn={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Cn=(0,Pn.createSlice)({name:"dappModalsSlice",initialState:Nn,reducers:{setDappModalVisibility:(e,t)=>{e.visible=t.payload},setDappModalHeaderVisibility:(e,t)=>{e.modal.showHeader=t.payload},setDappModalFooterVisibility:(e,t)=>{e.modal.showFooter=t.payload},setDappModalHeaderText:(e,t)=>{e.modal.headerText=t.payload},setDappModalFooterText:(e,t)=>{e.modal.footerText=t.payload},setDappModalConfig:(e,t)=>{e.modal=x({},t.payload)}},extraReducers:e=>{e.addCase(D,()=>Nn)}}),{setDappModalVisibility:_l,setDappModalHeaderVisibility:Ml,setDappModalFooterVisibility:Ol,setDappModalHeaderText:Bl,setDappModalFooterText:Ul,setDappModalConfig:$l}=Cn.actions,Rn=Cn.reducer});var _n,_i,Mi,le,qe=T(()=>{"use strict";o();_n=require("@reduxjs/toolkit");Bt();Nt();Fn();At();Ot();kt();We();Ve();Ue();_i={["account"]:dn,["networkConfig"]:sn,["loginInfo"]:Xr,["modals"]:vn,["dappModal"]:Rn,["toasts"]:He,["transactions"]:Be,["transactionsInfo"]:$e},Mi=(e={})=>(0,_n.combineReducers)(x(x({},_i),e)),le=Mi});var Bn={};Z(Bn,{default:()=>Wi});function Ut(e,t=[]){return{key:e,version:1,storage:On.default,blacklist:t}}var ne,Mn,On,Oi,Bi,Ui,$i,Vi,Hi,Wi,Un=T(()=>{"use strict";o();ne=require("redux-persist"),Mn=w(require("redux-persist/lib/storage")),On=w(require("redux-persist/lib/storage/session"));qe();re();We();Ve();Ue();Bt();Oi={2:e=>v(x({},e),{networkConfig:Et})};Bi=Ut("dapp-core-transactionsInfo"),Ui=Ut("dapp-core-transactions",["transactionsToSign"]),$i=Ut("dapp-core-toasts"),Vi={key:"dapp-core-store",version:2,storage:Mn.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,ne.createMigrate)(Oi,{debug:!1})},Hi={["toasts"]:(0,ne.persistReducer)($i,He),["transactions"]:(0,ne.persistReducer)(Ui,Be),["transactionsInfo"]:(0,ne.persistReducer)(Bi,$e)},Wi=(0,ne.persistReducer)(Vi,le(Hi))});var $n={};Z($n,{default:()=>Gi});var Gi,Vn=T(()=>{"use strict";o();qe();Gi=le()});var Hn={};Z(Hn,{default:()=>zi});var R,qi,zi,Wn=T(()=>{"use strict";o();R=require("redux-persist"),qi=[R.FLUSH,R.REHYDRATE,R.PAUSE,R.PERSIST,R.PURGE,R.REGISTER],zi=qi});var zn={};Z(zn,{default:()=>qn});function qn(e){return(0,Gn.persistStore)(e)}var Gn,jn=T(()=>{"use strict";o();Gn=require("redux-persist")});var Da={};Z(Da,{refreshAccount:()=>La});module.exports=me(Da);o();o();o();o();var _r=require("@elrondnetwork/erdjs-extension-provider"),Mr=require("@elrondnetwork/erdjs-hw-provider"),Ne=require("@elrondnetwork/erdjs-wallet-connect-provider"),Or=require("@elrondnetwork/erdjs-web-wallet-provider");b();N();var Br=e=>{switch(e==null?void 0:e.constructor){case Or.WalletProvider:return"wallet";case Ne.WalletConnectProvider:return"walletconnect";case Ne.WalletConnectV2Provider:return"walletconnectv2";case Mr.HWProvider:return"ledger";case _r.ExtensionProvider:return"extension";case De:return"";default:return"extra"}};var G=e=>`Unable to perform ${e}, Provider not initialized`,De=class{init(){return Promise.resolve(!1)}login(t){throw new Error(G(`login with options: ${t}`))}logout(t){throw new Error(G(`logout with options: ${t}`))}getAddress(){throw new Error(G("getAddress"))}isInitialized(){return!1}isConnected(){return Promise.resolve(!1)}sendTransaction(t,r){throw new Error(G(`sendTransaction with transactions: ${t} options: ${r}`))}signTransaction(t,r){throw new Error(G(`signTransaction with transactions: ${t} options: ${r}`))}signTransactions(t,r){throw new Error(G(`signTransactions with transactions: ${t} options: ${r}`))}signMessage(t,r){throw new Error(G(`signTransactions with ${t} and options ${r}`))}sendCustomMessage({method:t,params:r}){throw new Error(G(`sendCustomMessage with method: ${t} params: ${r}`))}sendCustomRequest(t){throw new Error(G(`sendSessionEvent with options: ${t}`))}ping(){return Promise.resolve(!1)}},yt=new De;var li=yt;function ee(){return li||yt}re();o();var $t=require("@reduxjs/toolkit"),Xn=require("react-redux/es/utils/Subscription");re();o();var Ln=w(require("lodash.throttle"));b();re();bt();Ce();ge();var Ci=[Le],Ri=(0,Ln.default)(()=>{Te(fe())},5e3),Dn=e=>t=>r=>{var d;if(Ci.includes(r.type))return t(r);let n=e.getState(),i=ce.local.getItem(te.loginExpiresAt);if(!((d=n==null?void 0:n.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(i==null)return Te(fe());let l=Date.now();return i-l<0?setTimeout(()=>_(void 0,null,function*(){console.log("session expired");try{e.dispatch(Zr())}catch(g){console.error("error logging out",g)}}),1e3):(Ri(),t(r))};o();o();function Ge(){return typeof sessionStorage!="undefined"}var Kn=Ge()?(Un(),me(Bn)).default:(Vn(),me($n)).default,Yn=Ge()?(Wn(),me(Hn)).default:[],Zn=Ge()?(jn(),me(zn)).default:e=>e;qe();var F=(0,$t.configureStore)({reducer:Kn,middleware:e=>e({serializableCheck:{ignoredActions:[...Yn,un.type,_e.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(Dn)}),up=(0,Xn.createSubscription)(F),dp=Zn(F),mp=(0,$t.configureStore)({reducer:le});o();o();var ho=w(require("axios"));o();var Vt="accounts";o();o();o();o();re();o();var Jn=w(require("lodash.isequal")),ze=require("reselect"),f=(0,ze.createSelectorCreator)(ze.defaultMemoize,Jn.default);var q=e=>e.account,he=f(q,e=>e.address),Ht=f(q,he,(e,t)=>t in e.accounts?e.accounts[t]:Fe),xp=f(q,Ht,(e,t)=>{let i=e,{accounts:r}=i,n=Xt(i,["accounts"]);return v(x({},n),{account:t})}),Sp=f(Ht,e=>e.balance),Qn=f(Ht,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),wp=f(q,e=>e.shard),bp=f(q,e=>e.ledgerAccount),vp=f(q,e=>e.walletConnectAccount),Ap=f(q,e=>e.isAccountLoading),Ip=f(q,e=>e.accountLoadingError),Ep=f(q,e=>e.websocketEvent);o();var pe=e=>e.networkConfig,Dp=f(pe,e=>e.chainID),Np=f(pe,e=>e.network.walletConnectBridgeAddress),Pp=f(pe,e=>e.network.walletConnectV2RelayAddress),Cp=f(pe,e=>e.network.walletConnectV2ProjectId),Rp=f(pe,e=>e.network.walletConnectDeepLink),Wt=f(pe,e=>e.network),eo=f(Wt,e=>e.apiAddress),to=f(Wt,e=>e.explorerAddress),Fp=f(Wt,e=>e.egldLabel);o();N();var ue=e=>e.loginInfo,Up=f(ue,e=>e.loginMethod),ro=f(ue,he,(e,t)=>e.loginMethod!=""&&Boolean(t)),$p=f(ue,e=>e.walletConnectLogin),Vp=f(ue,e=>e.ledgerLogin),no=f(ue,e=>e.walletLogin),Hp=f(ue,e=>e.isLoginSessionInvalid);o();o();var P=require("@elrondnetwork/erdjs");b();o();function Gt(e){try{return a.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function qt(e){var i,p,l;let{data:t}=e,r=Gt(t!=null?t:"")?P.TransactionPayload.fromEncoded(t):new P.TransactionPayload(t),n=new P.Transaction(x({value:e.value.valueOf(),data:r,nonce:e.nonce.valueOf(),receiver:new P.Address(e.receiver),sender:new P.Address(e.sender),gasLimit:(i=e.gasLimit.valueOf())!=null?i:gt,gasPrice:(p=e.gasPrice.valueOf())!=null?p:ft,chainID:e.chainID.valueOf(),version:new P.TransactionVersion((l=e.version)!=null?l:Rr)},e.options?{options:new P.TransactionOptions(e.options)}:{}));return n.applySignature({hex:()=>e.signature||""},new P.Address(e.sender)),n}o();Ct();o();var Ki=w(require("bignumber.js"));j();o();o();o();o();var Zi=require("@elrondnetwork/erdjs"),Xi=w(require("bignumber.js"));N();o();var ao=require("@elrondnetwork/erdjs");function Yi(e){try{let t=new ao.Address(e);return Boolean(t.bech32())}catch(t){return!1}}function xe(e){return(e==null?void 0:e.startsWith("erd"))&&e.length===62&&/^\w+$/.test(e)&&Yi(e)}o();o();o();var Qi=require("@elrondnetwork/erdjs/out");o();b();o();var so=require("@elrondnetwork/erdjs