@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 51.4 kB
JavaScript
"use strict";var oo=Object.create;var pe=Object.defineProperty,io=Object.defineProperties,ao=Object.getOwnPropertyDescriptor,so=Object.getOwnPropertyDescriptors,co=Object.getOwnPropertyNames,ye=Object.getOwnPropertySymbols,lo=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;var Vt=(e,t,r)=>t in e?pe(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)&&Vt(e,r,t[r]);if(ye)for(var r of ye(t))$t.call(t,r)&&Vt(e,r,t[r]);return e},v=(e,t)=>io(e,so(t));var Ht=(e,t)=>{var r={};for(var n in e)qe.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ye)for(var n of ye(e))t.indexOf(n)<0&&$t.call(e,n)&&(r[n]=e[n]);return r};var T=(e,t)=>()=>(e&&(t=e(e=0)),t);var he=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),z=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},Gt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of co(t))!qe.call(e,i)&&i!==r&&pe(e,i,{get:()=>t[i],enumerable:!(n=ao(t,i))||n.enumerable});return e};var w=(e,t,r)=>(r=e!=null?oo(lo(e)):{},Gt(t||!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),ue=e=>Gt(pe({},"__esModule",{value:!0}),e);var Q=(e,t,r)=>new Promise((n,i)=>{var l=d=>{try{m(r.next(d))}catch(g){i(g)}},p=d=>{try{m(r.throw(d))}catch(g){i(g)}},m=d=>d.done?n(d.value):Promise.resolve(d.value).then(l,p);m((r=r.apply(e,t)).next())});var jt=he(xe=>{"use strict";o();xe.byteLength=uo;xe.toByteArray=go;xe.fromByteArray=yo;var F=[],C=[],po=typeof Uint8Array!="undefined"?Uint8Array:Array,je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(K=0,Wt=je.length;K<Wt;++K)F[K]=je[K],C[je.charCodeAt(K)]=K;var K,Wt;C["-".charCodeAt(0)]=62;C["_".charCodeAt(0)]=63;function qt(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 uo(e){var t=qt(e),r=t[0],n=t[1];return(r+n)*3/4-n}function mo(e,t,r){return(t+r)*3/4-r}function go(e){var t,r=qt(e),n=r[0],i=r[1],l=new po(mo(e,n,i)),p=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)],l[p++]=t>>16&255,l[p++]=t>>8&255,l[p++]=t&255;return i===2&&(t=C[e.charCodeAt(d)]<<2|C[e.charCodeAt(d+1)]>>4,l[p++]=t&255),i===1&&(t=C[e.charCodeAt(d)]<<10|C[e.charCodeAt(d+1)]<<4|C[e.charCodeAt(d+2)]>>2,l[p++]=t>>8&255,l[p++]=t&255),l}function fo(e){return F[e>>18&63]+F[e>>12&63]+F[e>>6&63]+F[e&63]}function To(e,t,r){for(var n,i=[],l=t;l<r;l+=3)n=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),i.push(fo(n));return i.join("")}function yo(e){for(var t,r=e.length,n=r%3,i=[],l=16383,p=0,m=r-n;p<m;p+=l)i.push(To(e,p,p+l>m?m:p+l));return n===1?(t=e[r-1],i.push(F[t>>2]+F[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(F[t>>10]+F[t>>4&63]+F[t<<2&63]+"=")),i.join("")}});var zt=he(ze=>{o();ze.read=function(e,t,r,n,i){var l,p,m=i*8-n-1,d=(1<<m)-1,g=d>>1,h=-7,y=r?i-1:0,I=r?-1:1,k=e[t+y];for(y+=I,l=k&(1<<-h)-1,k>>=-h,h+=m;h>0;l=l*256+e[t+y],y+=I,h-=8);for(p=l&(1<<-h)-1,l>>=-h,h+=n;h>0;p=p*256+e[t+y],y+=I,h-=8);if(l===0)l=1-g;else{if(l===d)return p?NaN:(k?-1:1)*(1/0);p=p+Math.pow(2,n),l=l-g}return(k?-1:1)*p*Math.pow(2,l-n)};ze.write=function(e,t,r,n,i,l){var p,m,d,g=l*8-i-1,h=(1<<g)-1,y=h>>1,I=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=n?0:l-1,G=n?1:-1,B=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,p=h):(p=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-p))<1&&(p--,d*=2),p+y>=1?t+=I/d:t+=I*Math.pow(2,1-y),t*d>=2&&(p++,d/=2),p+y>=h?(m=0,p=h):p+y>=1?(m=(t*d-1)*Math.pow(2,i),p=p+y):(m=t*Math.pow(2,y-1)*Math.pow(2,i),p=0));i>=8;e[r+k]=m&255,k+=G,m/=256,i-=8);for(p=p<<i|m,g+=i;g>0;e[r+k]=p&255,k+=G,p/=256,g-=8);e[r+k-G]|=B*128}});var ar=he(te=>{"use strict";o();var Ke=jt(),ee=zt(),Kt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;te.Buffer=u;te.SlowBuffer=Ao;te.INSPECT_MAX_BYTES=50;var Se=2147483647;te.kMaxLength=Se;u.TYPED_ARRAY_SUPPORT=ho();!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 ho(){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 U(e){if(e>Se)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 Je(e)}return Xt(e,t,r)}u.poolSize=8192;function Xt(e,t,r){if(typeof e=="string")return So(e,t);if(ArrayBuffer.isView(e))return wo(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(_(e,ArrayBuffer)||e&&_(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(_(e,SharedArrayBuffer)||e&&_(e.buffer,SharedArrayBuffer)))return Ze(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=bo(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 Xt(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function Jt(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 xo(e,t,r){return Jt(e),e<=0?U(e):t!==void 0?typeof r=="string"?U(e).fill(t,r):U(e).fill(t):U(e)}u.alloc=function(e,t,r){return xo(e,t,r)};function Je(e){return Jt(e),U(e<0?0:Qe(e)|0)}u.allocUnsafe=function(e){return Je(e)};u.allocUnsafeSlow=function(e){return Je(e)};function So(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=Qt(e,t)|0,n=U(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Ye(e){for(var t=e.length<0?0:Qe(e.length)|0,r=U(t),n=0;n<t;n+=1)r[n]=e[n]&255;return r}function wo(e){if(_(e,Uint8Array)){var t=new Uint8Array(e);return Ze(t.buffer,t.byteOffset,t.byteLength)}return Ye(e)}function Ze(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 bo(e){if(u.isBuffer(e)){var t=Qe(e.length)|0,r=U(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||et(e.length)?U(0):Ye(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Ye(e.data)}function Qe(e){if(e>=Se)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Se.toString(16)+" bytes");return e|0}function Ao(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(_(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),_(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,l=0,p=Math.min(n,i);l<p;++l)if(t[l]!==r[l]){n=t[l],i=r[l];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),l=0;for(n=0;n<t.length;++n){var p=t[n];if(_(p,Uint8Array))l+p.length>i.length?u.from(p).copy(i,l):Uint8Array.prototype.set.call(i,p,l);else if(u.isBuffer(p))p.copy(i,l);else throw new TypeError('"list" argument must be an Array of Buffers');l+=p.length}return i};function Qt(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||_(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 Xe(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ir(e).length;default:if(i)return n?-1:Xe(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=Qt;function vo(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 Fo(this,t,r);case"utf8":case"utf-8":return tr(this,t,r);case"ascii":return Ro(this,t,r);case"latin1":case"binary":return Po(this,t,r);case"base64":return No(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _o(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function Y(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)Y(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)Y(this,r,r+3),Y(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)Y(this,r,r+7),Y(this,r+1,r+6),Y(this,r+2,r+5),Y(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?tr(this,0,t):vo.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=te.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Kt&&(u.prototype[Kt]=u.prototype.inspect);u.prototype.compare=function(t,r,n,i,l){if(_(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),l===void 0&&(l=this.length),r<0||n>t.length||i<0||l>this.length)throw new RangeError("out of range index");if(i>=l&&r>=n)return 0;if(i>=l)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,l>>>=0,this===t)return 0;for(var p=l-i,m=n-r,d=Math.min(p,m),g=this.slice(i,l),h=t.slice(r,n),y=0;y<d;++y)if(g[y]!==h[y]){p=g[y],m=h[y];break}return p<m?-1:m<p?1:0};function er(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,et(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:Yt(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):Yt(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Yt(e,t,r,n,i){var l=1,p=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;l=2,p/=2,m/=2,r/=2}function d(k,G){return l===1?k[G]:k.readUInt16BE(G*l)}var g;if(i){var h=-1;for(g=r;g<p;g++)if(d(e,g)===d(t,h===-1?0:g-h)){if(h===-1&&(h=g),g-h+1===m)return h*l}else h!==-1&&(g-=g-h),h=-1}else for(r+m>p&&(r=p-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 er(this,t,r,n,!0)};u.prototype.lastIndexOf=function(t,r,n){return er(this,t,r,n,!1)};function Io(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var l=t.length;n>l/2&&(n=l/2);for(var p=0;p<n;++p){var m=parseInt(t.substr(p*2,2),16);if(et(m))return p;e[r+p]=m}return p}function ko(e,t,r,n){return we(Xe(t,e.length-r),e,r,n)}function Eo(e,t,r,n){return we(Bo(t),e,r,n)}function Lo(e,t,r,n){return we(ir(t),e,r,n)}function Do(e,t,r,n){return we(Uo(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 l=this.length-r;if((n===void 0||n>l)&&(n=l),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var p=!1;;)switch(i){case"hex":return Io(this,t,r,n);case"utf8":case"utf-8":return ko(this,t,r,n);case"ascii":case"latin1":case"binary":return Eo(this,t,r,n);case"base64":return Lo(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Do(this,t,r,n);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function No(e,t,r){return t===0&&r===e.length?Ke.fromByteArray(e):Ke.fromByteArray(e.slice(t,r))}function tr(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var l=e[i],p=null,m=l>239?4:l>223?3:l>191?2:1;if(i+m<=r){var d,g,h,y;switch(m){case 1:l<128&&(p=l);break;case 2:d=e[i+1],(d&192)===128&&(y=(l&31)<<6|d&63,y>127&&(p=y));break;case 3:d=e[i+1],g=e[i+2],(d&192)===128&&(g&192)===128&&(y=(l&15)<<12|(d&63)<<6|g&63,y>2047&&(y<55296||y>57343)&&(p=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=(l&15)<<18|(d&63)<<12|(g&63)<<6|h&63,y>65535&&y<1114112&&(p=y))}}p===null?(p=65533,m=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),i+=m}return Co(n)}var Zt=4096;function Co(e){var t=e.length;if(t<=Zt)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Zt));return r}function Ro(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 Po(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 Fo(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",l=t;l<r;++l)i+=Vo[e[l]];return i}function _o(e,t,r){for(var n=e.slice(t,r),i="",l=0;l<n.length-1;l+=2)i+=String.fromCharCode(n[l]+n[l+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],l=1,p=0;++p<r&&(l*=256);)i+=this[t+p]*l;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],l=1;r>0&&(l*=256);)i+=this[t+--r]*l;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],l=1,p=0;++p<r&&(l*=256);)i+=this[t+p]*l;return l*=128,i>=l&&(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,l=1,p=this[t+--i];i>0&&(l*=256);)p+=this[t+--i]*l;return l*=128,p>=l&&(p-=Math.pow(2,8*r)),p};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),ee.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||A(t,4,this.length),ee.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||A(t,8,this.length),ee.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||A(t,8,this.length),ee.read(this,t,!1,52,8)};function L(e,t,r,n,i,l){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<l)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 l=Math.pow(2,8*n)-1;L(this,t,r,n,l,0)}var p=1,m=0;for(this[r]=t&255;++m<n&&(p*=256);)this[r+m]=t/p&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 l=Math.pow(2,8*n)-1;L(this,t,r,n,l,0)}var p=n-1,m=1;for(this[r+p]=t&255;--p>=0&&(m*=256);)this[r+p]=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 l=Math.pow(2,8*n-1);L(this,t,r,n,l-1,-l)}var p=0,m=1,d=0;for(this[r]=t&255;++p<n&&(m*=256);)t<0&&d===0&&this[r+p-1]!==0&&(d=1),this[r+p]=(t/m>>0)-d&255;return r+n};u.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var l=Math.pow(2,8*n-1);L(this,t,r,n,l-1,-l)}var p=n-1,m=1,d=0;for(this[r+p]=t&255;--p>=0&&(m*=256);)t<0&&d===0&&this[r+p+1]!==0&&(d=1),this[r+p]=(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 rr(e,t,r,n,i,l){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function nr(e,t,r,n,i){return t=+t,r=r>>>0,i||rr(e,t,r,4,34028234663852886e22,-34028234663852886e22),ee.write(e,t,r,n,23,4),r+4}u.prototype.writeFloatLE=function(t,r,n){return nr(this,t,r,!0,n)};u.prototype.writeFloatBE=function(t,r,n){return nr(this,t,r,!1,n)};function or(e,t,r,n,i){return t=+t,r=r>>>0,i||rr(e,t,r,8,17976931348623157e292,-17976931348623157e292),ee.write(e,t,r,n,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,n){return or(this,t,r,!0,n)};u.prototype.writeDoubleBE=function(t,r,n){return or(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 l=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),l};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 l=t.charCodeAt(0);(i==="utf8"&&l<128||i==="latin1")&&(t=l)}}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 p;if(typeof t=="number")for(p=r;p<n;++p)this[p]=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(p=0;p<n-r;++p)this[p+r]=m[p%d]}return this};var Mo=/[^+/0-9A-Za-z-_]/g;function Oo(e){if(e=e.split("=")[0],e=e.trim().replace(Mo,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Xe(e,t){t=t||1/0;for(var r,n=e.length,i=null,l=[],p=0;p<n;++p){if(r=e.charCodeAt(p),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&l.push(239,191,189);continue}else if(p+1===n){(t-=3)>-1&&l.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&l.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&l.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;l.push(r)}else if(r<2048){if((t-=2)<0)break;l.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;l.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;l.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return l}function Bo(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Uo(e,t){for(var r,n,i,l=[],p=0;p<e.length&&!((t-=2)<0);++p)r=e.charCodeAt(p),n=r>>8,i=r%256,l.push(i),l.push(n);return l}function ir(e){return Ke.toByteArray(Oo(e))}function we(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 _(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function et(e){return e!==e}var Vo=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 ur=he((ga,pr)=>{o();var S=pr.exports={},M,O;function tt(){throw new Error("setTimeout has not been defined")}function rt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?M=setTimeout:M=tt}catch(e){M=tt}try{typeof clearTimeout=="function"?O=clearTimeout:O=rt}catch(e){O=rt}})();function sr(e){if(M===setTimeout)return setTimeout(e,0);if((M===tt||!M)&&setTimeout)return M=setTimeout,setTimeout(e,0);try{return M(e,0)}catch(t){try{return M.call(null,e,0)}catch(r){return M.call(this,e,0)}}}function $o(e){if(O===clearTimeout)return clearTimeout(e);if((O===rt||!O)&&clearTimeout)return O=clearTimeout,clearTimeout(e);try{return O(e)}catch(t){try{return O.call(null,e)}catch(r){return O.call(this,e)}}}var V=[],re=!1,Z,be=-1;function Ho(){!re||!Z||(re=!1,Z.length?V=Z.concat(V):be=-1,V.length&&cr())}function cr(){if(!re){var e=sr(Ho);re=!0;for(var t=V.length;t;){for(Z=V,V=[];++be<t;)Z&&Z[be].run();be=-1,t=V.length}Z=null,re=!1,$o(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];V.push(new lr(e,t)),V.length===1&&!re&&sr(cr)};function lr(e,t){this.fun=e,this.array=t}lr.prototype.run=function(){this.fun.apply(null,this.array)};S.title="browser";S.browser=!0;S.env={};S.argv=[];S.version="";S.versions={};function $(){}S.on=$;S.addListener=$;S.once=$;S.off=$;S.removeListener=$;S.removeAllListeners=$;S.emit=$;S.prependListener=$;S.prependOnceListener=$;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,fa,o=T(()=>{a=w(ar()),s=w(ur()),fa=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 Ae,ot=T(()=>{"use strict";o();Ae=()=>Date.now()/1e3});var dr=T(()=>{"use strict";o()});var mr=T(()=>{"use strict";o()});var gr=T(()=>{"use strict";o();ot();dr();mr()});var at={};z(at,{getItem:()=>Wo,localStorageKeys:()=>X,removeItem:()=>qo,setItem:()=>Go});var X,it,Go,Wo,qo,de=T(()=>{"use strict";o();gr();X={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},it=typeof localStorage!="undefined",Go=({key:e,data:t,expires:r})=>{!it||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Wo=e=>{if(!it)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:Ae()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},qo=e=>{!it||localStorage.removeItem(String(e))}});var st={};z(st,{clear:()=>hr,getItem:()=>Tr,removeItem:()=>yr,setItem:()=>fr,storage:()=>jo});var fr,Tr,yr,hr,jo,xr=T(()=>{"use strict";o();fr=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Tr=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},yr=e=>sessionStorage.removeItem(String(e)),hr=()=>sessionStorage.clear(),jo={setItem:fr,getItem:Tr,removeItem:yr,clear:hr}});var ne,ve=T(()=>{"use strict";o();de();xr();ne={session:st,local:at}});function me(){return new Date().setHours(new Date().getHours()+24)}function ge(e){ne.local.setItem({key:X.loginExpiresAt,data:e,expires:e})}var ct=T(()=>{"use strict";o();ve();de()});var P=T(()=>{"use strict";o()});var Sr=T(()=>{"use strict";o()});var wr=T(()=>{"use strict";o()});var E=T(()=>{"use strict";o()});var br=T(()=>{"use strict";o()});var Ar=T(()=>{"use strict";o()});var vr=T(()=>{"use strict";o()});var Ir=T(()=>{"use strict";o()});var W=T(()=>{"use strict";o();wr();E();P();br();Ar();vr();Ir()});var lt,kr,Wa,Er,qa,Lr,ja,za,Ka,Dr=T(()=>{"use strict";o();W();lt={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:Wa}=lt["devnet"],{chainId:Er,egldLabel:qa}=lt["testnet"],{chainId:Lr,egldLabel:ja}=lt["mainnet"],za={["devnet"]:kr,["testnet"]:Er,["mainnet"]:Lr},Ka={[kr]:"devnet",[Er]:"testnet",[Lr]:"mainnet"}});var pt=T(()=>{"use strict";o()});var Nr=T(()=>{"use strict";o()});var Cr,ut=T(()=>{"use strict";o();Cr="transaction-status-toast-id"});var dt,mt,Rr,Ie,Pr,oe,b=T(()=>{"use strict";o();Sr();Dr();pt();Nr();ut();dt=5e4,mt=1e9,Rr=1,Ie="logout",Pr="login",oe="0"});var gt,D,ke,q=T(()=>{"use strict";o();gt=require("@reduxjs/toolkit");b();D=(0,gt.createAction)(Ie),ke=(0,gt.createAction)(Pr,e=>({payload:e}))});var _r,Fr,Mr,ds,ms,gs,fs,Ts,ys,Or,Br,ft=T(()=>{"use strict";o();_r=require("@reduxjs/toolkit");ct();P();q();Fr={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Mr=(0,_r.createSlice)({name:"loginInfoSlice",initialState:Fr,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,()=>Fr),e.addCase(ke,(t,r)=>{t.loginMethod=r.payload.loginMethod,ge(me())})}}),{setLoginMethod:ds,setWalletConnectLogin:ms,setLedgerLogin:gs,setTokenLogin:fs,setTokenLoginSignature:Ts,setWalletLogin:ys,invalidateLoginSession:Or}=Mr.actions,Br=Mr.reducer});var Ur=T(()=>{"use strict";o()});var Vr=T(()=>{"use strict";o();Ur()});function Tt(e){return e[Math.floor(Math.random()*e.length)]}var $r=T(()=>{"use strict";o()});var Hr=T(()=>{"use strict";o();pt()});var Gr=T(()=>{"use strict";o();Vr();$r();Hr()});var Wr,qr,yt,Ko,jr,Ps,Fs,zr,ht=T(()=>{"use strict";o();Wr=require("@reduxjs/toolkit"),qr=w(require("lodash.omit"));Gr();yt={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Ko={network:yt,chainID:"-1"},jr=(0,Wr.createSlice)({name:"appConfig",initialState:Ko,reducers:{initializeNetworkConfig:(e,t)=>{let r=Tt(t.payload.walletConnectBridgeAddresses),n=Tt(t.payload.walletConnectV2RelayAddresses),i=(0,qr.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:Ps,setChainID:Fs}=jr.actions,zr=jr.reducer});var St,Kr,Yr,Ee,xt,Zr,Xr,Hs,Jr,Gs,Ws,qs,js,zs,Ks,Ys,Qr,wt=T(()=>{"use strict";o();St=require("@elrondnetwork/erdjs"),Kr=require("@reduxjs/toolkit"),Yr=require("redux-persist");b();ve();de();q();Ee={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:oe},xt={address:"",websocketEvent:null,accounts:{"":Ee},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Zr=(0,Kr.createSlice)({name:"accountInfoSlice",initialState:xt,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new St.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Ee},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,()=>(ne.local.removeItem(X.loginExpiresAt),xt)),e.addCase(ke,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new St.Address(n).hex()}),e.addCase(Yr.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:i,shard:l,accounts:p,publicKey:m}=n;t.address=i,t.shard=l;let d=p&&i in p;t.accounts=d?p:xt.accounts,t.publicKey=m})}}),{setAccount:Xr,setAddress:Hs,setAccountNonce:Jr,setAccountShard:Gs,setLedgerAccount:Ws,updateLedgerAccount:qs,setWalletConnectAccount:js,setIsAccountLoading:zs,setAccountLoadingError:Ks,setWebsocketEvent:Ys}=Zr.actions,Qr=Zr.reducer});function en(e){return e!=null&&(ni(e)||si(e))}function Le(e){return e!=null&&(oi(e)||ci(e))}function De(e){return e!=null&&(ii(e)||li(e))}function tn(e){return e!=null&&ai(e)}function ni(e){return e!=null&&Zo.includes(e)}function oi(e){return e!=null&&Xo.includes(e)}function ii(e){return e!=null&&Jo.includes(e)}function ai(e){return e!=null&&Qo.includes(e)}function si(e){return e!=null&&ei.includes(e)}function ci(e){return e!=null&&ti.includes(e)}function li(e){return e!=null&&ri.includes(e)}var Zo,Xo,Jo,Qo,ei,ti,ri,At=T(()=>{"use strict";o();P();Zo=["sent"],Xo=["success"],Jo=["fail","cancelled","timedOut"],Qo=["timedOut"],ei=["pending"],ti=["success"],ri=["fail","invalid"]});var rn,nn,fe,pi,on,oc,ic,ac,sc,cc,lc,pc,uc,dc,mc,Ne,Ce=T(()=>{"use strict";o();rn=require("@reduxjs/toolkit"),nn=require("redux-persist");P();At();q();fe={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},pi={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},on=(0,rn.createSlice)({name:"transactionsSlice",initialState:fe,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,g;let{sessionId:r,transactions:n,errorMessage:i,status:l,redirectRoute:p}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||pi;e.signedTransactions[r]={transactions:n,status:l,errorMessage:i,redirectRoute:p,customTransactionInformation:m},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===r&&(e.transactionsToSign=fe.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:l}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=n,i!=null&&(e.signedTransactions[r].errorMessage=i),l!=null&&(e.signedTransactions[r].transactions=l))},updateSignedTransactionStatus:(e,t)=>{var m,d,g,h,y,I;let{sessionId:r,status:n,errorMessage:i,transactionHash:l}=t.payload,p=(d=(m=e.signedTransactions)==null?void 0:m[r])==null?void 0:d.transactions;if(p!=null){e.signedTransactions[r].transactions=p.map(B=>B.hash===l?v(x({},B),{status:n,errorMessage:i}):B);let k=(h=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:h.every(B=>Le(B.status)),G=(I=(y=e.signedTransactions[r])==null?void 0:y.transactions)==null?void 0:I.every(B=>De(B.status));k&&(e.signedTransactions[r].status="success"),G&&(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=fe.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=fe.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(D,()=>fe),e.addCase(nn.REHYDRATE,(t,r)=>{var p;if(t.signTransactionsCancelMessage=null,!((p=r.payload)!=null&&p.transactions))return;let{signedTransactions:n,customTransactionInformationForSessionId:i}=r.payload.transactions,l=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=l)})}}),{updateSignedTransactionStatus:oc,updateSignedTransactions:ic,setTransactionsToSign:ac,clearAllTransactionsToSign:sc,clearAllSignedTransactions:cc,clearSignedTransaction:lc,clearTransactionToSign:pc,setSignTransactionsError:uc,setSignTransactionsCancelMessage:dc,moveTransactionsToSignedState:mc}=on.actions,Ne=on.reducer});var an,It,kt,Et,ui,vt,sn,yc,hc,xc,Re,Pe=T(()=>{"use strict";o();an=require("@reduxjs/toolkit");q();It="Transaction failed",kt="Transaction successful",Et="Processing transaction",ui="Transaction submitted",vt={},sn=(0,an.createSlice)({name:"transactionsInfo",initialState:vt,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||It,successMessage:(n==null?void 0:n.successMessage)||kt,processingMessage:(n==null?void 0:n.processingMessage)||Et,submittedMessage:(n==null?void 0:n.submittedMessage)||ui,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>vt},extraReducers:e=>{e.addCase(D,()=>vt)}}),{clearTransactionsInfo:yc,setTransactionsDisplayInfo:hc,clearTransactionsInfoForSessionId:xc}=sn.actions,Re=sn.reducer});var ln,cn,pn,Ac,vc,Ic,kc,un,Lt=T(()=>{"use strict";o();ln=require("@reduxjs/toolkit");q();cn={},pn=(0,ln.createSlice)({name:"modalsSlice",initialState:cn,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,()=>cn)}}),{setTxSubmittedModal:Ac,setNotificationModal:vc,clearTxSubmittedModal:Ic,clearNotificationModal:kc}=pn.actions,un=pn.reducer});var mn,gn,dn,fn,Fc,_c,Mc,Oc,Bc,Uc,Fe,_e=T(()=>{"use strict";o();mn=require("@reduxjs/toolkit"),gn=require("redux-persist");ut();W();ot();q();dn={customToasts:[],transactionToasts:[],failTransactionToast:null},fn=(0,mn.createSlice)({name:"toastsSlice",initialState:dn,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:Ae(),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,()=>dn),e.addCase(gn.REHYDRATE,(t,r)=>{var i,l;let n=(l=(i=r.customToasts)==null?void 0:i.filter(p=>!("component"in p)))!=null?l:[];t.customToasts=n})}}),{addCustomToast:Fc,removeCustomToast:_c,addTransactionToast:Mc,removeTransactionToast:Oc,addFailTransactionToast:Bc,removeFailTransactionToast:Uc}=fn.actions,Fe=fn.reducer});var ie=T(()=>{"use strict";o();ft();ht();wt();Ce();Pe();Lt();_e()});var Ft=T(()=>{"use strict";o()});var kn,In,En,Ip,kp,Ep,Lp,Dp,Np,Ln,Dn=T(()=>{"use strict";o();kn=require("@reduxjs/toolkit");q();In={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},En=(0,kn.createSlice)({name:"dappModalsSlice",initialState:In,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,()=>In)}}),{setDappModalVisibility:Ip,setDappModalHeaderVisibility:kp,setDappModalFooterVisibility:Ep,setDappModalHeaderText:Lp,setDappModalFooterText:Dp,setDappModalConfig:Np}=En.actions,Ln=En.reducer});var Nn,bi,Ai,ce,Be=T(()=>{"use strict";o();Nn=require("@reduxjs/toolkit");Ft();wt();Dn();ft();Lt();ht();_e();Pe();Ce();bi={["account"]:Qr,["networkConfig"]:zr,["loginInfo"]:Br,["modals"]:un,["dappModal"]:Ln,["toasts"]:Fe,["transactions"]:Ne,["transactionsInfo"]:Re},Ai=(e={})=>(0,Nn.combineReducers)(x(x({},bi),e)),ce=Ai});var Pn={};z(Pn,{default:()=>Ni});function _t(e,t=[]){return{key:e,version:1,storage:Rn.default,blacklist:t}}var J,Cn,Rn,vi,Ii,ki,Ei,Li,Di,Ni,Fn=T(()=>{"use strict";o();J=require("redux-persist"),Cn=w(require("redux-persist/lib/storage")),Rn=w(require("redux-persist/lib/storage/session"));Be();ie();_e();Pe();Ce();Ft();vi={2:e=>v(x({},e),{networkConfig:yt})};Ii=_t("dapp-core-transactionsInfo"),ki=_t("dapp-core-transactions",["transactionsToSign"]),Ei=_t("dapp-core-toasts"),Li={key:"dapp-core-store",version:2,storage:Cn.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,J.createMigrate)(vi,{debug:!1})},Di={["toasts"]:(0,J.persistReducer)(Ei,Fe),["transactions"]:(0,J.persistReducer)(ki,Ne),["transactionsInfo"]:(0,J.persistReducer)(Ii,Re)},Ni=(0,J.persistReducer)(Li,ce(Di))});var _n={};z(_n,{default:()=>Ci});var Ci,Mn=T(()=>{"use strict";o();Be();Ci=ce()});var On={};z(On,{default:()=>Pi});var R,Ri,Pi,Bn=T(()=>{"use strict";o();R=require("redux-persist"),Ri=[R.FLUSH,R.REHYDRATE,R.PAUSE,R.PERSIST,R.PURGE,R.REGISTER],Pi=Ri});var $n={};z($n,{default:()=>Vn});function Vn(e){return(0,Un.persistStore)(e)}var Un,Hn=T(()=>{"use strict";o();Un=require("redux-persist")});var la={};z(la,{getAccount:()=>ca});module.exports=ue(la);o();o();var ro=w(require("axios"));o();var nt="accounts";o();o();o();o();ie();o();var Tn=w(require("lodash.isequal")),Me=require("reselect"),f=(0,Me.createSelectorCreator)(Me.defaultMemoize,Tn.default);var H=e=>e.account,Dt=f(H,e=>e.address),Nt=f(H,Dt,(e,t)=>t in e.accounts?e.accounts[t]:Ee),Jc=f(H,Nt,(e,t)=>{let i=e,{accounts:r}=i,n=Ht(i,["accounts"]);return v(x({},n),{account:t})}),Qc=f(Nt,e=>e.balance),el=f(Nt,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),tl=f(H,e=>e.shard),rl=f(H,e=>e.ledgerAccount),nl=f(H,e=>e.walletConnectAccount),ol=f(H,e=>e.isAccountLoading),il=f(H,e=>e.accountLoadingError),al=f(H,e=>e.websocketEvent);o();var ae=e=>e.networkConfig,ll=f(ae,e=>e.chainID),pl=f(ae,e=>e.network.walletConnectBridgeAddress),ul=f(ae,e=>e.network.walletConnectV2RelayAddress),dl=f(ae,e=>e.network.walletConnectV2ProjectId),ml=f(ae,e=>e.network.walletConnectDeepLink),Ct=f(ae,e=>e.network),yn=f(Ct,e=>e.apiAddress),hn=f(Ct,e=>e.explorerAddress),gl=f(Ct,e=>e.egldLabel);o();P();var se=e=>e.loginInfo,xl=f(se,e=>e.loginMethod),Sl=f(se,Dt,(e,t)=>e.loginMethod!=""&&Boolean(t)),wl=f(se,e=>e.walletConnectLogin),bl=f(se,e=>e.ledgerLogin),Al=f(se,e=>e.walletLogin),vl=f(se,e=>e.isLoginSessionInvalid);o();o();var N=require("@elrondnetwork/erdjs");b();o();function Rt(e){try{return a.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function Pt(e){var i,l,p;let{data:t}=e,r=Rt(t!=null?t:"")?N.TransactionPayload.fromEncoded(t):new N.TransactionPayload(t),n=new N.Transaction(x({value:e.value.valueOf(),data:r,nonce:e.nonce.valueOf(),receiver:new N.Address(e.receiver),sender:new N.Address(e.sender),gasLimit:(i=e.gasLimit.valueOf())!=null?i:dt,gasPrice:(l=e.gasPrice.valueOf())!=null?l:mt,chainID:e.chainID.valueOf(),version:new N.TransactionVersion((p=e.version)!=null?p:Rr)},e.options?{options:new N.TransactionOptions(e.options)}:{}));return n.applySignature({hex:()=>e.signature||""},new N.Address(e.sender)),n}o();At();o();var mi=w(require("bignumber.js"));W();o();o();o();o();var fi=require("@elrondnetwork/erdjs"),Ti=w(require("bignumber.js"));P();o();var gi=require("@elrondnetwork/erdjs");o();o();o();var hi=require("@elrondnetwork/erdjs/out");o();b();o();var bn=require("@elrondnetwork/erdjs");W();o();o();o();o();P();o();o();var Mt=require("@reduxjs/toolkit"),jn=require("react-redux/es/utils/Subscription");ie();o();var An=w(require("lodash.throttle"));b();ie();ct();ve();de();var xi=[Ie],Si=(0,An.default)(()=>{ge(me())},5e3),vn=e=>t=>r=>{var d;if(xi.includes(r.type))return t(r);let n=e.getState(),i=ne.local.getItem(X.loginExpiresAt);if(!((d=n==null?void 0:n.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(i==null)return ge(me());let p=Date.now();return i-p<0?setTimeout(()=>Q(void 0,null,function*(){console.log("session expired");try{e.dispatch(Or())}catch(g){console.error("error logging out",g)}}),1e3):(Si(),t(r))};o();o();function Oe(){return typeof sessionStorage!="undefined"}var Gn=Oe()?(Fn(),ue(Pn)).default:(Mn(),ue(_n)).default,Wn=Oe()?(Bn(),ue(On)).default:[],qn=Oe()?(Hn(),ue($n)).default:e=>e;Be();var le=(0,Mt.configureStore)({reducer:Gn,middleware:e=>e({serializableCheck:{ignoredActions:[...Wn,Jr.type,Xr.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(vn)}),tu=(0,jn.createSubscription)(le),ru=qn(le),nu=(0,Mt.configureStore)({reducer:ce});o();o();o();o();o();o();o();o();o();E();o();o();E();o();o();o();var Ui=w(require("bignumber.js"));b();o();var Bi=require("@elrondnetwork/erdjs"),Ot=w(require("bignumber.js"));b();o();var Mi=w(require("bignumber.js"));o();Ot.default.config({ROUNDING_MODE:Ot.default.ROUND_FLOOR});o();o();o();b();o();o();o();o();b();o();b();o();var Vi=require("@elrondnetwork/erdjs");b();o();var $e=require("@elrondnetwork/erdjs"),Hi=require("@elrondnetwork/erdjs"),Gi=require("@elrondnetwork/erdjs-network-providers");b();o();o();var $i=w(require("bignumber.js"));b();o();b();o();o();o();o();o();b();o();E();var qi=["reDelegateRewards","claimRewards","unBond"],ji=["wrapEgld","unwrapEgld"],zi=["unStake"],Ki=["unDelegate"];o();o();o();b();o();var Xi=w(require("bignumber.js"));o();o();o();E();o();var Ji=w(require("bignumber.js"));o();o();o();o();E();o();o();o();var ea=w(require("anchorme"));o();b();o();var ta=w(require("bignumber.js"));o();W();o();o();P();o();P();o();o();o();E();o();E();o();var ra=w(require("bignumber.js"));b();E();o();E();o();var Xn=require("react");W();o();o();E();o();var na=require("@elrondnetwork/erdjs/out"),oa=w(require("bignumber.js"));E();o();E();o();o();P();var Gf=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];o();var Jn=require("react");W();o();var aa=require("react");E();var Zf=["create","localMint","ESDTLocalMint","addQuantity","burn","localBurn","ESDTLocalBurn","wipe","writeLog","signalError"];var Ge=e=>e.transactions,Te=f(Ge,e=>e.signedTransactions),FT=f(Ge,e=>e.signTransactionsError),_T=f(Ge,e=>e.signTransactionsCancelMessage),We=e=>t=>Object.entries(t).reduce((r,[n,i])=>(e(i.status)&&(r[n]=i),r),{}),MT=f