@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 52.7 kB
JavaScript
"use strict";var lo=Object.create;var ue=Object.defineProperty,po=Object.defineProperties,uo=Object.getOwnPropertyDescriptor,mo=Object.getOwnPropertyDescriptors,go=Object.getOwnPropertyNames,Se=Object.getOwnPropertySymbols,fo=Object.getPrototypeOf,Ye=Object.prototype.hasOwnProperty,Ht=Object.prototype.propertyIsEnumerable;var Gt=(e,t,r)=>t in e?ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))Ye.call(t,r)&&Gt(e,r,t[r]);if(Se)for(var r of Se(t))Ht.call(t,r)&&Gt(e,r,t[r]);return e},b=(e,t)=>po(e,mo(t));var Wt=(e,t)=>{var r={};for(var n in e)Ye.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Se)for(var n of Se(e))t.indexOf(n)<0&&Ht.call(e,n)&&(r[n]=e[n]);return r};var T=(e,t)=>()=>(e&&(t=e(e=0)),t);var we=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),K=(e,t)=>{for(var r in t)ue(e,r,{get:t[r],enumerable:!0})},qt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of go(t))!Ye.call(e,i)&&i!==r&&ue(e,i,{get:()=>t[i],enumerable:!(n=uo(t,i))||n.enumerable});return e};var S=(e,t,r)=>(r=e!=null?lo(fo(e)):{},qt(t||!e||!e.__esModule?ue(r,"default",{value:e,enumerable:!0}):r,e)),de=e=>qt(ue({},"__esModule",{value:!0}),e);var ee=(e,t,r)=>new Promise((n,i)=>{var l=d=>{try{m(r.next(d))}catch(g){i(g)}},a=d=>{try{m(r.throw(d))}catch(g){i(g)}},m=d=>d.done?n(d.value):Promise.resolve(d.value).then(l,a);m((r=r.apply(e,t)).next())});var Kt=we(be=>{"use strict";o();be.byteLength=yo;be.toByteArray=xo;be.fromByteArray=bo;var F=[],C=[],To=typeof Uint8Array!="undefined"?Uint8Array:Array,Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Y=0,jt=Ze.length;Y<jt;++Y)F[Y]=Ze[Y],C[Ze.charCodeAt(Y)]=Y;var Y,jt;C["-".charCodeAt(0)]=62;C["_".charCodeAt(0)]=63;function zt(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 yo(e){var t=zt(e),r=t[0],n=t[1];return(r+n)*3/4-n}function ho(e,t,r){return(t+r)*3/4-r}function xo(e){var t,r=zt(e),n=r[0],i=r[1],l=new To(ho(e,n,i)),a=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[a++]=t>>16&255,l[a++]=t>>8&255,l[a++]=t&255;return i===2&&(t=C[e.charCodeAt(d)]<<2|C[e.charCodeAt(d+1)]>>4,l[a++]=t&255),i===1&&(t=C[e.charCodeAt(d)]<<10|C[e.charCodeAt(d+1)]<<4|C[e.charCodeAt(d+2)]>>2,l[a++]=t>>8&255,l[a++]=t&255),l}function So(e){return F[e>>18&63]+F[e>>12&63]+F[e>>6&63]+F[e&63]}function wo(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(So(n));return i.join("")}function bo(e){for(var t,r=e.length,n=r%3,i=[],l=16383,a=0,m=r-n;a<m;a+=l)i.push(wo(e,a,a+l>m?m:a+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 Yt=we(Xe=>{o();Xe.read=function(e,t,r,n,i){var l,a,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(a=l&(1<<-h)-1,l>>=-h,h+=n;h>0;a=a*256+e[t+y],y+=I,h-=8);if(l===0)l=1-g;else{if(l===d)return a?NaN:(k?-1:1)*(1/0);a=a+Math.pow(2,n),l=l-g}return(k?-1:1)*a*Math.pow(2,l-n)};Xe.write=function(e,t,r,n,i,l){var a,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,H=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,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+y>=1?t+=I/d:t+=I*Math.pow(2,1-y),t*d>=2&&(a++,d/=2),a+y>=h?(m=0,a=h):a+y>=1?(m=(t*d-1)*Math.pow(2,i),a=a+y):(m=t*Math.pow(2,y-1)*Math.pow(2,i),a=0));i>=8;e[r+k]=m&255,k+=H,m/=256,i-=8);for(a=a<<i|m,g+=i;g>0;e[r+k]=a&255,k+=H,a/=256,g-=8);e[r+k-H]|=B*128}});var cr=we(re=>{"use strict";o();var Je=Kt(),te=Yt(),Zt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;re.Buffer=u;re.SlowBuffer=Do;re.INSPECT_MAX_BYTES=50;var Ae=2147483647;re.kMaxLength=Ae;u.TYPED_ARRAY_SUPPORT=Ao();!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 Ao(){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>Ae)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 rt(e)}return Qt(e,t,r)}u.poolSize=8192;function Qt(e,t,r){if(typeof e=="string")return Io(e,t);if(ArrayBuffer.isView(e))return ko(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 et(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=Eo(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 Qt(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function er(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 vo(e,t,r){return er(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 vo(e,t,r)};function rt(e){return er(e),U(e<0?0:nt(e)|0)}u.allocUnsafe=function(e){return rt(e)};u.allocUnsafeSlow=function(e){return rt(e)};function Io(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=tr(e,t)|0,n=U(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Qe(e){for(var t=e.length<0?0:nt(e.length)|0,r=U(t),n=0;n<t;n+=1)r[n]=e[n]&255;return r}function ko(e){if(_(e,Uint8Array)){var t=new Uint8Array(e);return et(t.buffer,t.byteOffset,t.byteLength)}return Qe(e)}function et(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 Eo(e){if(u.isBuffer(e)){var t=nt(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"||ot(e.length)?U(0):Qe(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Qe(e.data)}function nt(e){if(e>=Ae)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ae.toString(16)+" bytes");return e|0}function Do(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,a=Math.min(n,i);l<a;++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 a=t[n];if(_(a,Uint8Array))l+a.length>i.length?u.from(a).copy(i,l):Uint8Array.prototype.set.call(i,a,l);else if(u.isBuffer(a))a.copy(i,l);else throw new TypeError('"list" argument must be an Array of Buffers');l+=a.length}return i};function tr(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 tt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return sr(e).length;default:if(i)return n?-1:tt(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=tr;function Lo(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 Uo(this,t,r);case"utf8":case"utf-8":return nr(this,t,r);case"ascii":return Oo(this,t,r);case"latin1":case"binary":return Bo(this,t,r);case"base64":return _o(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 Z(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)Z(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)Z(this,r,r+3),Z(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)Z(this,r,r+7),Z(this,r+1,r+6),Z(this,r+2,r+5),Z(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?nr(this,0,t):Lo.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=re.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Zt&&(u.prototype[Zt]=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 a=l-i,m=n-r,d=Math.min(a,m),g=this.slice(i,l),h=t.slice(r,n),y=0;y<d;++y)if(g[y]!==h[y]){a=g[y],m=h[y];break}return a<m?-1:m<a?1:0};function rr(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,ot(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:Xt(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):Xt(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Xt(e,t,r,n,i){var l=1,a=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,a/=2,m/=2,r/=2}function d(k,H){return l===1?k[H]:k.readUInt16BE(H*l)}var g;if(i){var h=-1;for(g=r;g<a;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>a&&(r=a-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 rr(this,t,r,n,!0)};u.prototype.lastIndexOf=function(t,r,n){return rr(this,t,r,n,!1)};function No(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 a=0;a<n;++a){var m=parseInt(t.substr(a*2,2),16);if(ot(m))return a;e[r+a]=m}return a}function Co(e,t,r,n){return ve(tt(t,e.length-r),e,r,n)}function Ro(e,t,r,n){return ve(Ho(t),e,r,n)}function Po(e,t,r,n){return ve(sr(t),e,r,n)}function Fo(e,t,r,n){return ve(Wo(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 a=!1;;)switch(i){case"hex":return No(this,t,r,n);case"utf8":case"utf-8":return Co(this,t,r,n);case"ascii":case"latin1":case"binary":return Ro(this,t,r,n);case"base64":return Po(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fo(this,t,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _o(e,t,r){return t===0&&r===e.length?Je.fromByteArray(e):Je.fromByteArray(e.slice(t,r))}function nr(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var l=e[i],a=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&&(a=l);break;case 2:d=e[i+1],(d&192)===128&&(y=(l&31)<<6|d&63,y>127&&(a=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)&&(a=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&&(a=y))}}a===null?(a=65533,m=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=m}return Mo(n)}var Jt=4096;function Mo(e){var t=e.length;if(t<=Jt)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Jt));return r}function Oo(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 Bo(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 Uo(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+=qo[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 v(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||v(t,r,this.length);for(var i=this[t],l=1,a=0;++a<r&&(l*=256);)i+=this[t+a]*l;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||v(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||v(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||v(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||v(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||v(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||v(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||v(t,r,this.length);for(var i=this[t],l=1,a=0;++a<r&&(l*=256);)i+=this[t+a]*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||v(t,r,this.length);for(var i=r,l=1,a=this[t+--i];i>0&&(l*=256);)a+=this[t+--i]*l;return l*=128,a>=l&&(a-=Math.pow(2,8*r)),a};u.prototype.readInt8=function(t,r){return t=t>>>0,r||v(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||v(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||v(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||v(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||v(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||v(t,4,this.length),te.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||v(t,4,this.length),te.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||v(t,8,this.length),te.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||v(t,8,this.length),te.read(this,t,!1,52,8)};function D(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;D(this,t,r,n,l,0)}var a=1,m=0;for(this[r]=t&255;++m<n&&(a*=256);)this[r+m]=t/a&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;D(this,t,r,n,l,0)}var a=n-1,m=1;for(this[r+a]=t&255;--a>=0&&(m*=256);)this[r+a]=t/m&255;return r+n};u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||D(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||D(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||D(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||D(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||D(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);D(this,t,r,n,l-1,-l)}var a=0,m=1,d=0;for(this[r]=t&255;++a<n&&(m*=256);)t<0&&d===0&&this[r+a-1]!==0&&(d=1),this[r+a]=(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);D(this,t,r,n,l-1,-l)}var a=n-1,m=1,d=0;for(this[r+a]=t&255;--a>=0&&(m*=256);)t<0&&d===0&&this[r+a+1]!==0&&(d=1),this[r+a]=(t/m>>0)-d&255;return r+n};u.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||D(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||D(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||D(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||D(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||D(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 or(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 ir(e,t,r,n,i){return t=+t,r=r>>>0,i||or(e,t,r,4,34028234663852886e22,-34028234663852886e22),te.write(e,t,r,n,23,4),r+4}u.prototype.writeFloatLE=function(t,r,n){return ir(this,t,r,!0,n)};u.prototype.writeFloatBE=function(t,r,n){return ir(this,t,r,!1,n)};function ar(e,t,r,n,i){return t=+t,r=r>>>0,i||or(e,t,r,8,17976931348623157e292,-17976931348623157e292),te.write(e,t,r,n,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,n){return ar(this,t,r,!0,n)};u.prototype.writeDoubleBE=function(t,r,n){return ar(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 a;if(typeof t=="number")for(a=r;a<n;++a)this[a]=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(a=0;a<n-r;++a)this[a+r]=m[a%d]}return this};var Vo=/[^+/0-9A-Za-z-_]/g;function Go(e){if(e=e.split("=")[0],e=e.trim().replace(Vo,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function tt(e,t){t=t||1/0;for(var r,n=e.length,i=null,l=[],a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&l.push(239,191,189);continue}else if(a+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 Ho(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Wo(e,t){for(var r,n,i,l=[],a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,l.push(i),l.push(n);return l}function sr(e){return Je.toByteArray(Go(e))}function ve(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 ot(e){return e!==e}var qo=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 mr=we((Aa,dr)=>{o();var w=dr.exports={},M,O;function it(){throw new Error("setTimeout has not been defined")}function at(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?M=setTimeout:M=it}catch(e){M=it}try{typeof clearTimeout=="function"?O=clearTimeout:O=at}catch(e){O=at}})();function lr(e){if(M===setTimeout)return setTimeout(e,0);if((M===it||!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 jo(e){if(O===clearTimeout)return clearTimeout(e);if((O===at||!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 $=[],ne=!1,X,Ie=-1;function zo(){!ne||!X||(ne=!1,X.length?$=X.concat($):Ie=-1,$.length&&pr())}function pr(){if(!ne){var e=lr(zo);ne=!0;for(var t=$.length;t;){for(X=$,$=[];++Ie<t;)X&&X[Ie].run();Ie=-1,t=$.length}X=null,ne=!1,jo(e)}}w.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];$.push(new ur(e,t)),$.length===1&&!ne&&lr(pr)};function ur(e,t){this.fun=e,this.array=t}ur.prototype.run=function(){this.fun.apply(null,this.array)};w.title="browser";w.browser=!0;w.env={};w.argv=[];w.version="";w.versions={};function V(){}w.on=V;w.addListener=V;w.once=V;w.off=V;w.removeListener=V;w.removeAllListeners=V;w.emit=V;w.prependListener=V;w.prependOnceListener=V;w.listeners=function(e){return[]};w.binding=function(e){throw new Error("process.binding is not supported")};w.cwd=function(){return"/"};w.chdir=function(e){throw new Error("process.chdir is not supported")};w.umask=function(){return 0}});var s,c,va,o=T(()=>{s=S(cr()),c=S(mr()),va=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 ke,st=T(()=>{"use strict";o();ke=()=>Date.now()/1e3});var gr=T(()=>{"use strict";o()});var fr=T(()=>{"use strict";o()});var Tr=T(()=>{"use strict";o();st();gr();fr()});var lt={};K(lt,{getItem:()=>Yo,localStorageKeys:()=>J,removeItem:()=>Zo,setItem:()=>Ko});var J,ct,Ko,Yo,Zo,me=T(()=>{"use strict";o();Tr();J={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},ct=typeof localStorage!="undefined",Ko=({key:e,data:t,expires:r})=>{!ct||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Yo=e=>{if(!ct)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:ke()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},Zo=e=>{!ct||localStorage.removeItem(String(e))}});var pt={};K(pt,{clear:()=>Sr,getItem:()=>hr,removeItem:()=>xr,setItem:()=>yr,storage:()=>Xo});var yr,hr,xr,Sr,Xo,wr=T(()=>{"use strict";o();yr=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},hr=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},xr=e=>sessionStorage.removeItem(String(e)),Sr=()=>sessionStorage.clear(),Xo={setItem:yr,getItem:hr,removeItem:xr,clear:Sr}});var oe,Ee=T(()=>{"use strict";o();me();wr();oe={session:pt,local:lt}});function ge(){return new Date().setHours(new Date().getHours()+24)}function fe(e){oe.local.setItem({key:J.loginExpiresAt,data:e,expires:e})}var ut=T(()=>{"use strict";o();Ee();me()});var P=T(()=>{"use strict";o()});var br=T(()=>{"use strict";o()});var Ar=T(()=>{"use strict";o()});var E=T(()=>{"use strict";o()});var vr=T(()=>{"use strict";o()});var Ir=T(()=>{"use strict";o()});var kr=T(()=>{"use strict";o()});var Er=T(()=>{"use strict";o()});var W=T(()=>{"use strict";o();Ar();E();P();vr();Ir();kr();Er()});var dt,Dr,Ja,Lr,Qa,Nr,es,ts,rs,Cr=T(()=>{"use strict";o();W();dt={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:Dr,egldLabel:Ja}=dt["devnet"],{chainId:Lr,egldLabel:Qa}=dt["testnet"],{chainId:Nr,egldLabel:es}=dt["mainnet"],ts={["devnet"]:Dr,["testnet"]:Lr,["mainnet"]:Nr},rs={[Dr]:"devnet",[Lr]:"testnet",[Nr]:"mainnet"}});var mt=T(()=>{"use strict";o()});var Rr=T(()=>{"use strict";o()});var Pr,gt=T(()=>{"use strict";o();Pr="transaction-status-toast-id"});var ft,Tt,Fr,De,_r,ie,A=T(()=>{"use strict";o();br();Cr();mt();Rr();gt();ft=5e4,Tt=1e9,Fr=1,De="logout",_r="login",ie="0"});var yt,L,Le,q=T(()=>{"use strict";o();yt=require("@reduxjs/toolkit");A();L=(0,yt.createAction)(De),Le=(0,yt.createAction)(_r,e=>({payload:e}))});var Or,Mr,Br,Ss,ws,bs,As,vs,Is,Ur,$r,ht=T(()=>{"use strict";o();Or=require("@reduxjs/toolkit");ut();P();q();Mr={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Br=(0,Or.createSlice)({name:"loginInfoSlice",initialState:Mr,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(L,()=>Mr),e.addCase(Le,(t,r)=>{t.loginMethod=r.payload.loginMethod,fe(ge())})}}),{setLoginMethod:Ss,setWalletConnectLogin:ws,setLedgerLogin:bs,setTokenLogin:As,setTokenLoginSignature:vs,setWalletLogin:Is,invalidateLoginSession:Ur}=Br.actions,$r=Br.reducer});var Vr=T(()=>{"use strict";o()});var Gr=T(()=>{"use strict";o();Vr()});function xt(e){return e[Math.floor(Math.random()*e.length)]}var Hr=T(()=>{"use strict";o()});var Wr=T(()=>{"use strict";o();mt()});var qr=T(()=>{"use strict";o();Gr();Hr();Wr()});var jr,zr,St,Qo,Kr,Vs,Gs,Yr,wt=T(()=>{"use strict";o();jr=require("@reduxjs/toolkit"),zr=S(require("lodash.omit"));qr();St={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Qo={network:St,chainID:"-1"},Kr=(0,jr.createSlice)({name:"appConfig",initialState:Qo,reducers:{initializeNetworkConfig:(e,t)=>{let r=xt(t.payload.walletConnectBridgeAddresses),n=xt(t.payload.walletConnectV2RelayAddresses),i=(0,zr.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=b(x(x({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:n})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:Vs,setChainID:Gs}=Kr.actions,Yr=Kr.reducer});var At,Zr,Xr,Ne,bt,Jr,Qr,Zs,en,Xs,Js,Qs,ec,tc,rc,nc,tn,vt=T(()=>{"use strict";o();At=require("@elrondnetwork/erdjs"),Zr=require("@reduxjs/toolkit"),Xr=require("redux-persist");A();Ee();me();q();Ne={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:ie},bt={address:"",websocketEvent:null,accounts:{"":Ne},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Jr=(0,Zr.createSlice)({name:"accountInfoSlice",initialState:bt,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new At.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Ne},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(L,()=>(oe.local.removeItem(J.loginExpiresAt),bt)),e.addCase(Le,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new At.Address(n).hex()}),e.addCase(Xr.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:i,shard:l,accounts:a,publicKey:m}=n;t.address=i,t.shard=l;let d=a&&i in a;t.accounts=d?a:bt.accounts,t.publicKey=m})}}),{setAccount:Qr,setAddress:Zs,setAccountNonce:en,setAccountShard:Xs,setLedgerAccount:Js,updateLedgerAccount:Qs,setWalletConnectAccount:ec,setIsAccountLoading:tc,setAccountLoadingError:rc,setWebsocketEvent:nc}=Jr.actions,tn=Jr.reducer});function rn(e){return e!=null&&(ci(e)||di(e))}function Ce(e){return e!=null&&(li(e)||mi(e))}function Re(e){return e!=null&&(pi(e)||gi(e))}function nn(e){return e!=null&&ui(e)}function ci(e){return e!=null&&ti.includes(e)}function li(e){return e!=null&&ri.includes(e)}function pi(e){return e!=null&&ni.includes(e)}function ui(e){return e!=null&&oi.includes(e)}function di(e){return e!=null&&ii.includes(e)}function mi(e){return e!=null&&ai.includes(e)}function gi(e){return e!=null&&si.includes(e)}var ti,ri,ni,oi,ii,ai,si,kt=T(()=>{"use strict";o();P();ti=["sent"],ri=["success"],ni=["fail","cancelled","timedOut"],oi=["timedOut"],ii=["pending"],ai=["success"],si=["fail","invalid"]});var on,an,Te,fi,sn,dc,mc,gc,fc,Tc,yc,hc,xc,Sc,wc,Pe,Fe=T(()=>{"use strict";o();on=require("@reduxjs/toolkit"),an=require("redux-persist");P();kt();q();Te={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},fi={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},sn=(0,on.createSlice)({name:"transactionsSlice",initialState:Te,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,g;let{sessionId:r,transactions:n,errorMessage:i,status:l,redirectRoute:a}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||fi;e.signedTransactions[r]={transactions:n,status:l,errorMessage:i,redirectRoute:a,customTransactionInformation:m},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===r&&(e.transactionsToSign=Te.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,a=(d=(m=e.signedTransactions)==null?void 0:m[r])==null?void 0:d.transactions;if(a!=null){e.signedTransactions[r].transactions=a.map(B=>B.hash===l?b(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=>Ce(B.status)),H=(I=(y=e.signedTransactions[r])==null?void 0:y.transactions)==null?void 0:I.every(B=>Re(B.status));k&&(e.signedTransactions[r].status="success"),H&&(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=Te.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Te.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(L,()=>Te),e.addCase(an.REHYDRATE,(t,r)=>{var a;if(t.signTransactionsCancelMessage=null,!((a=r.payload)!=null&&a.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:dc,updateSignedTransactions:mc,setTransactionsToSign:gc,clearAllTransactionsToSign:fc,clearAllSignedTransactions:Tc,clearSignedTransaction:yc,clearTransactionToSign:hc,setSignTransactionsError:xc,setSignTransactionsCancelMessage:Sc,moveTransactionsToSignedState:wc}=sn.actions,Pe=sn.reducer});var cn,Dt,Lt,Nt,Ti,Et,ln,Ic,kc,Ec,_e,Me=T(()=>{"use strict";o();cn=require("@reduxjs/toolkit");q();Dt="Transaction failed",Lt="Transaction successful",Nt="Processing transaction",Ti="Transaction submitted",Et={},ln=(0,cn.createSlice)({name:"transactionsInfo",initialState:Et,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||Dt,successMessage:(n==null?void 0:n.successMessage)||Lt,processingMessage:(n==null?void 0:n.processingMessage)||Nt,submittedMessage:(n==null?void 0:n.submittedMessage)||Ti,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>Et},extraReducers:e=>{e.addCase(L,()=>Et)}}),{clearTransactionsInfo:Ic,setTransactionsDisplayInfo:kc,clearTransactionsInfoForSessionId:Ec}=ln.actions,_e=ln.reducer});var un,pn,dn,Cc,Rc,Pc,Fc,mn,Ct=T(()=>{"use strict";o();un=require("@reduxjs/toolkit");q();pn={},dn=(0,un.createSlice)({name:"modalsSlice",initialState:pn,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(L,()=>pn)}}),{setTxSubmittedModal:Cc,setNotificationModal:Rc,clearTxSubmittedModal:Pc,clearNotificationModal:Fc}=dn.actions,mn=dn.reducer});var fn,Tn,gn,yn,Gc,Hc,Wc,qc,jc,zc,Oe,Be=T(()=>{"use strict";o();fn=require("@reduxjs/toolkit"),Tn=require("redux-persist");gt();W();st();q();gn={customToasts:[],transactionToasts:[],failTransactionToast:null},yn=(0,fn.createSlice)({name:"toastsSlice",initialState:gn,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(b(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:ke(),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=b(x({},t.payload),{toastId:Pr})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(L,()=>gn),e.addCase(Tn.REHYDRATE,(t,r)=>{var i,l;let n=(l=(i=r.customToasts)==null?void 0:i.filter(a=>!("component"in a)))!=null?l:[];t.customToasts=n})}}),{addCustomToast:Gc,removeCustomToast:Hc,addTransactionToast:Wc,removeTransactionToast:qc,addFailTransactionToast:jc,removeFailTransactionToast:zc}=yn.actions,Oe=yn.reducer});var ae=T(()=>{"use strict";o();ht();wt();vt();Fe();Me();Ct();Be()});var Mt=T(()=>{"use strict";o()});var Dn,En,Ln,Pp,Fp,_p,Mp,Op,Bp,Nn,Cn=T(()=>{"use strict";o();Dn=require("@reduxjs/toolkit");q();En={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Ln=(0,Dn.createSlice)({name:"dappModalsSlice",initialState:En,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(L,()=>En)}}),{setDappModalVisibility:Pp,setDappModalHeaderVisibility:Fp,setDappModalFooterVisibility:_p,setDappModalHeaderText:Mp,setDappModalFooterText:Op,setDappModalConfig:Bp}=Ln.actions,Nn=Ln.reducer});var Rn,Ei,Di,le,Ve=T(()=>{"use strict";o();Rn=require("@reduxjs/toolkit");Mt();vt();Cn();ht();Ct();wt();Be();Me();Fe();Ei={["account"]:tn,["networkConfig"]:Yr,["loginInfo"]:$r,["modals"]:mn,["dappModal"]:Nn,["toasts"]:Oe,["transactions"]:Pe,["transactionsInfo"]:_e},Di=(e={})=>(0,Rn.combineReducers)(x(x({},Ei),e)),le=Di});var _n={};K(_n,{default:()=>_i});function Ot(e,t=[]){return{key:e,version:1,storage:Fn.default,blacklist:t}}var Q,Pn,Fn,Li,Ni,Ci,Ri,Pi,Fi,_i,Mn=T(()=>{"use strict";o();Q=require("redux-persist"),Pn=S(require("redux-persist/lib/storage")),Fn=S(require("redux-persist/lib/storage/session"));Ve();ae();Be();Me();Fe();Mt();Li={2:e=>b(x({},e),{networkConfig:St})};Ni=Ot("dapp-core-transactionsInfo"),Ci=Ot("dapp-core-transactions",["transactionsToSign"]),Ri=Ot("dapp-core-toasts"),Pi={key:"dapp-core-store",version:2,storage:Pn.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,Q.createMigrate)(Li,{debug:!1})},Fi={["toasts"]:(0,Q.persistReducer)(Ri,Oe),["transactions"]:(0,Q.persistReducer)(Ci,Pe),["transactionsInfo"]:(0,Q.persistReducer)(Ni,_e)},_i=(0,Q.persistReducer)(Pi,le(Fi))});var On={};K(On,{default:()=>Mi});var Mi,Bn=T(()=>{"use strict";o();Ve();Mi=le()});var Un={};K(Un,{default:()=>Bi});var R,Oi,Bi,$n=T(()=>{"use strict";o();R=require("redux-persist"),Oi=[R.FLUSH,R.REHYDRATE,R.PAUSE,R.PERSIST,R.PURGE,R.REGISTER],Bi=Oi});var Hn={};K(Hn,{default:()=>Gn});function Gn(e){return(0,Vn.persistStore)(e)}var Vn,Wn=T(()=>{"use strict";o();Vn=require("redux-persist")});var ha={};K(ha,{getTransaction:()=>ya,getTransactions:()=>fa,getTransactionsByHashes:()=>ga,getTransactionsCount:()=>Ta,sendSignedTransactions:()=>ma});module.exports=de(ha);o();o();var oo=S(require("axios"));o();o();ae();o();var hn=S(require("lodash.isequal")),Ue=require("reselect"),f=(0,Ue.createSelectorCreator)(Ue.defaultMemoize,hn.default);var G=e=>e.account,Rt=f(G,e=>e.address),Pt=f(G,Rt,(e,t)=>t in e.accounts?e.accounts[t]:Ne),al=f(G,Pt,(e,t)=>{let i=e,{accounts:r}=i,n=Wt(i,["accounts"]);return b(x({},n),{account:t})}),sl=f(Pt,e=>e.balance),cl=f(Pt,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),ll=f(G,e=>e.shard),pl=f(G,e=>e.ledgerAccount),ul=f(G,e=>e.walletConnectAccount),dl=f(G,e=>e.isAccountLoading),ml=f(G,e=>e.accountLoadingError),gl=f(G,e=>e.websocketEvent);o();var se=e=>e.networkConfig,yl=f(se,e=>e.chainID),hl=f(se,e=>e.network.walletConnectBridgeAddress),xl=f(se,e=>e.network.walletConnectV2RelayAddress),Sl=f(se,e=>e.network.walletConnectV2ProjectId),wl=f(se,e=>e.network.walletConnectDeepLink),ye=f(se,e=>e.network),xn=f(ye,e=>e.apiAddress),Sn=f(ye,e=>e.explorerAddress),bl=f(ye,e=>e.egldLabel);o();P();var ce=e=>e.loginInfo,El=f(ce,e=>e.loginMethod),Dl=f(ce,Rt,(e,t)=>e.loginMethod!=""&&Boolean(t)),Ll=f(ce,e=>e.walletConnectLogin),Nl=f(ce,e=>e.ledgerLogin),Cl=f(ce,e=>e.walletLogin),Rl=f(ce,e=>e.isLoginSessionInvalid);o();o();var N=require("@elrondnetwork/erdjs");A();o();function Ft(e){try{return s.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function _t(e){var i,l,a;let{data:t}=e,r=Ft(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:ft,gasPrice:(l=e.gasPrice.valueOf())!=null?l:Tt,chainID:e.chainID.valueOf(),version:new N.TransactionVersion((a=e.version)!=null?a:Fr)},e.options?{options:new N.TransactionOptions(e.options)}:{}));return n.applySignature({hex:()=>e.signature||""},new N.Address(e.sender)),n}o();kt();o();var hi=S(require("bignumber.js"));W();o();o();o();o();var Si=require("@elrondnetwork/erdjs"),wi=S(require("bignumber.js"));P();o();var xi=require("@elrondnetwork/erdjs");o();o();o();var Ai=require("@elrondnetwork/erdjs/out");o();A();o();var vn=require("@elrondnetwork/erdjs");W();o();o();o();o();P();o();o();var Bt=require("@reduxjs/toolkit"),Kn=require("react-redux/es/utils/Subscription");ae();o();var In=S(require("lodash.throttle"));A();ae();ut();Ee();me();var vi=[De],Ii=(0,In.default)(()=>{fe(ge())},5e3),kn=e=>t=>r=>{var d;if(vi.includes(r.type))return t(r);let n=e.getState(),i=oe.local.getItem(J.loginExpiresAt);if(!((d=n==null?void 0:n.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(i==null)return fe(ge());let a=Date.now();return i-a<0?setTimeout(()=>ee(void 0,null,function*(){console.log("session expired");try{e.dispatch(Ur())}catch(g){console.error("error logging out",g)}}),1e3):(Ii(),t(r))};o();o();function $e(){return typeof sessionStorage!="undefined"}var qn=$e()?(Mn(),de(_n)).default:(Bn(),de(On)).default,jn=$e()?($n(),de(Un)).default:[],zn=$e()?(Wn(),de(Hn)).default:e=>e;Ve();var j=(0,Bt.configureStore)({reducer:qn,middleware:e=>e({serializableCheck:{ignoredActions:[...jn,en.type,Qr.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(kn)}),lu=(0,Kn.createSubscription)(j),pu=zn(j),uu=(0,Bt.configureStore)({reducer:le});o();o();o();o();o();o();var he="transactions";var Yn="transactions/count";o();o();o();o();E();o();o();E();o();o();o();var Wi=S(require("bignumber.js"));A();o();var Hi=require("@elrondnetwork/erdjs"),Ut=S(require("bignumber.js"));A();o();var Vi=S(require("bignumber.js"));o();Ut.default.config({ROUNDING_MODE:Ut.default.ROUND_FLOOR});o();o();o();A();o();o();o();o();A();o();A();o();var qi=require("@elrondnetwork/erdjs");A();o();var We=require("@elrondnetwork/erdjs"),zi=require("@elrondnetwork/erdjs"),Ki=require("@elrondnetwork/erdjs-network-providers");A();o();o();var ji=S(require("bignumber.js"));A();o();A();o();o();o();o();o();A();o();E();var Zi=["reDelegateRewards","claimRewards","unBond"],Xi=["wrapEgld","unwrapEgld"],Ji=["unStake"],Qi=["unDelegate"];o();o();o();A();o();var ra=S(require("bignumber.js"));o();o();o();E();o();var na=S(require("bignumber.js"));o();o();o();o();E();o();o();o();var ia=S(require("anchorme"));o();A();o();var aa=S(require("bignumber.js"));o();W();o();o();P();o();P();o();o();o();E();o();E();o();var sa=S(require("bignumber.js"));A();E();o();E();o();var eo=require("react");W();o();o();E();o();var ca=require("@elrondnetwork/erdjs/out"),la=S(require("bignumber.js"));E();o();E();o();o();P();var Jf=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];o();var to=require("react");W();o();var ua=require("react");E();var iT=["create","localMint","ESDTLocalMint","addQuantity","burn","localBurn","ESDTLocalBurn","wipe","writeLog","signalError"];var je=e=>e.transactions,xe=f(je,e=>e.signedTransactions),HT=f(je,e=>e.signTra