UNPKG

@sofaws/dapp-core

Version:

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

1 lines 51.9 kB
"use strict";var mo=Object.create;var ue=Object.defineProperty,go=Object.defineProperties,fo=Object.getOwnPropertyDescriptor,To=Object.getOwnPropertyDescriptors,yo=Object.getOwnPropertyNames,xe=Object.getOwnPropertySymbols,ho=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty,Gt=Object.prototype.propertyIsEnumerable;var Ht=(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={}))ze.call(t,r)&&Ht(e,r,t[r]);if(xe)for(var r of xe(t))Gt.call(t,r)&&Ht(e,r,t[r]);return e},v=(e,t)=>go(e,To(t));var Wt=(e,t)=>{var r={};for(var n in e)ze.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&xe)for(var n of xe(e))t.indexOf(n)<0&&Gt.call(e,n)&&(r[n]=e[n]);return r};var T=(e,t)=>()=>(e&&(t=e(e=0)),t);var Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Y=(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 yo(t))!ze.call(e,i)&&i!==r&&ue(e,i,{get:()=>t[i],enumerable:!(n=fo(t,i))||n.enumerable});return e};var w=(e,t,r)=>(r=e!=null?mo(ho(e)):{},qt(t||!e||!e.__esModule?ue(r,"default",{value:e,enumerable:!0}):r,e)),de=e=>qt(ue({},"__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 Kt=Se(we=>{"use strict";o();we.byteLength=So;we.toByteArray=bo;we.fromByteArray=Io;var F=[],C=[],xo=typeof Uint8Array!="undefined"?Uint8Array:Array,Ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Z=0,jt=Ke.length;Z<jt;++Z)F[Z]=Ke[Z],C[Ke.charCodeAt(Z)]=Z;var Z,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 So(e){var t=zt(e),r=t[0],n=t[1];return(r+n)*3/4-n}function wo(e,t,r){return(t+r)*3/4-r}function bo(e){var t,r=zt(e),n=r[0],i=r[1],l=new xo(wo(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 Ao(e){return F[e>>18&63]+F[e>>12&63]+F[e>>6&63]+F[e&63]}function vo(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(Ao(n));return i.join("")}function Io(e){for(var t,r=e.length,n=r%3,i=[],l=16383,p=0,m=r-n;p<m;p+=l)i.push(vo(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 Yt=Se(Ye=>{o();Ye.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)};Ye.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,W=n?1:-1,U=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+=W,m/=256,i-=8);for(p=p<<i|m,g+=i;g>0;e[r+k]=p&255,k+=W,p/=256,g-=8);e[r+k-W]|=U*128}});var cr=Se(re=>{"use strict";o();var Ze=Kt(),te=Yt(),Zt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;re.Buffer=u;re.SlowBuffer=Co;re.INSPECT_MAX_BYTES=50;var be=2147483647;re.kMaxLength=be;u.TYPED_ARRAY_SUPPORT=ko();!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 ko(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(r){return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function V(e){if(e>be)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 et(e)}return Qt(e,t,r)}u.poolSize=8192;function Qt(e,t,r){if(typeof e=="string")return Lo(e,t);if(ArrayBuffer.isView(e))return Do(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 Je(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=No(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 Eo(e,t,r){return er(e),e<=0?V(e):t!==void 0?typeof r=="string"?V(e).fill(t,r):V(e).fill(t):V(e)}u.alloc=function(e,t,r){return Eo(e,t,r)};function et(e){return er(e),V(e<0?0:tt(e)|0)}u.allocUnsafe=function(e){return et(e)};u.allocUnsafeSlow=function(e){return et(e)};function Lo(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=V(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Xe(e){for(var t=e.length<0?0:tt(e.length)|0,r=V(t),n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Do(e){if(_(e,Uint8Array)){var t=new Uint8Array(e);return Je(t.buffer,t.byteOffset,t.byteLength)}return Xe(e)}function Je(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 No(e){if(u.isBuffer(e)){var t=tt(e.length)|0,r=V(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||rt(e.length)?V(0):Xe(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Xe(e.data)}function tt(e){if(e>=be)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+be.toString(16)+" bytes");return e|0}function Co(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 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 Qe(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:Qe(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=tr;function Ro(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 Ho(this,t,r);case"utf8":case"utf-8":return nr(this,t,r);case"ascii":return Vo(this,t,r);case"latin1":case"binary":return $o(this,t,r);case"base64":return Bo(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Go(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function X(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)X(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)X(this,r,r+3),X(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)X(this,r,r+7),X(this,r+1,r+6),X(this,r+2,r+5),X(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):Ro.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 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 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,rt(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,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,W){return l===1?k[W]:k.readUInt16BE(W*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 rr(this,t,r,n,!0)};u.prototype.lastIndexOf=function(t,r,n){return rr(this,t,r,n,!1)};function Po(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(rt(m))return p;e[r+p]=m}return p}function Fo(e,t,r,n){return Ae(Qe(t,e.length-r),e,r,n)}function _o(e,t,r,n){return Ae(jo(t),e,r,n)}function Mo(e,t,r,n){return Ae(sr(t),e,r,n)}function Oo(e,t,r,n){return Ae(zo(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 Po(this,t,r,n);case"utf8":case"utf-8":return Fo(this,t,r,n);case"ascii":case"latin1":case"binary":return _o(this,t,r,n);case"base64":return Mo(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oo(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 Bo(e,t,r){return t===0&&r===e.length?Ze.fromByteArray(e):Ze.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],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 Uo(n)}var Jt=4096;function Uo(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 Vo(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 $o(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 Ho(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+=Ko[e[l]];return i}function Go(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),te.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||A(t,4,this.length),te.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||A(t,8,this.length),te.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||A(t,8,this.length),te.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 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 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 Wo=/[^+/0-9A-Za-z-_]/g;function qo(e){if(e=e.split("=")[0],e=e.trim().replace(Wo,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Qe(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 jo(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function zo(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 sr(e){return Ze.toByteArray(qo(e))}function Ae(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 rt(e){return e!==e}var Ko=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=Se((va,dr)=>{o();var S=dr.exports={},M,O;function nt(){throw new Error("setTimeout has not been defined")}function ot(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?M=setTimeout:M=nt}catch(e){M=nt}try{typeof clearTimeout=="function"?O=clearTimeout:O=ot}catch(e){O=ot}})();function lr(e){if(M===setTimeout)return setTimeout(e,0);if((M===nt||!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 Yo(e){if(O===clearTimeout)return clearTimeout(e);if((O===ot||!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,J,ve=-1;function Zo(){!ne||!J||(ne=!1,J.length?$=J.concat($):ve=-1,$.length&&pr())}function pr(){if(!ne){var e=lr(Zo);ne=!0;for(var t=$.length;t;){for(J=$,$=[];++ve<t;)J&&J[ve].run();ve=-1,t=$.length}J=null,ne=!1,Yo(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];$.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)};S.title="browser";S.browser=!0;S.env={};S.argv=[];S.version="";S.versions={};function H(){}S.on=H;S.addListener=H;S.once=H;S.off=H;S.removeListener=H;S.removeAllListeners=H;S.emit=H;S.prependListener=H;S.prependOnceListener=H;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,Ia,o=T(()=>{a=w(cr()),s=w(mr()),Ia=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 Ie,it=T(()=>{"use strict";o();Ie=()=>Date.now()/1e3});var gr=T(()=>{"use strict";o()});var fr=T(()=>{"use strict";o()});var Tr=T(()=>{"use strict";o();it();gr();fr()});var st={};Y(st,{getItem:()=>Jo,localStorageKeys:()=>Q,removeItem:()=>Qo,setItem:()=>Xo});var Q,at,Xo,Jo,Qo,me=T(()=>{"use strict";o();Tr();Q={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},at=typeof localStorage!="undefined",Xo=({key:e,data:t,expires:r})=>{!at||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Jo=e=>{if(!at)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:Ie()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},Qo=e=>{!at||localStorage.removeItem(String(e))}});var ct={};Y(ct,{clear:()=>Sr,getItem:()=>hr,removeItem:()=>xr,setItem:()=>yr,storage:()=>ei});var yr,hr,xr,Sr,ei,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(),ei={setItem:yr,getItem:hr,removeItem:xr,clear:Sr}});var oe,ke=T(()=>{"use strict";o();me();wr();oe={session:ct,local:st}});function ge(){return new Date().setHours(new Date().getHours()+24)}function fe(e){oe.local.setItem({key:Q.loginExpiresAt,data:e,expires:e})}var lt=T(()=>{"use strict";o();ke();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 j=T(()=>{"use strict";o();Ar();E();P();vr();Ir();kr();Er()});var pt,Lr,Qa,Dr,es,Nr,ts,rs,ns,Cr=T(()=>{"use strict";o();j();pt={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:Lr,egldLabel:Qa}=pt["devnet"],{chainId:Dr,egldLabel:es}=pt["testnet"],{chainId:Nr,egldLabel:ts}=pt["mainnet"],rs={["devnet"]:Lr,["testnet"]:Dr,["mainnet"]:Nr},ns={[Lr]:"devnet",[Dr]:"testnet",[Nr]:"mainnet"}});var ut=T(()=>{"use strict";o()});var Rr=T(()=>{"use strict";o()});var Pr,dt=T(()=>{"use strict";o();Pr="transaction-status-toast-id"});var mt,gt,Fr,Ee,_r,ie,b=T(()=>{"use strict";o();br();Cr();ut();Rr();dt();mt=5e4,gt=1e9,Fr=1,Ee="logout",_r="login",ie="0"});var ft,D,Le,z=T(()=>{"use strict";o();ft=require("@reduxjs/toolkit");b();D=(0,ft.createAction)(Ee),Le=(0,ft.createAction)(_r,e=>({payload:e}))});var Or,Mr,Br,ws,bs,As,vs,Is,ks,Ur,Vr,Tt=T(()=>{"use strict";o();Or=require("@reduxjs/toolkit");lt();P();z();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(D,()=>Mr),e.addCase(Le,(t,r)=>{t.loginMethod=r.payload.loginMethod,fe(ge())})}}),{setLoginMethod:ws,setWalletConnectLogin:bs,setLedgerLogin:As,setTokenLogin:vs,setTokenLoginSignature:Is,setWalletLogin:ks,invalidateLoginSession:Ur}=Br.actions,Vr=Br.reducer});var $r=T(()=>{"use strict";o()});var Hr=T(()=>{"use strict";o();$r()});function yt(e){return e[Math.floor(Math.random()*e.length)]}var Gr=T(()=>{"use strict";o()});var Wr=T(()=>{"use strict";o();ut()});var qr=T(()=>{"use strict";o();Hr();Gr();Wr()});var jr,zr,ht,ri,Kr,Hs,Gs,Yr,xt=T(()=>{"use strict";o();jr=require("@reduxjs/toolkit"),zr=w(require("lodash.omit"));qr();ht={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},ri={network:ht,chainID:"-1"},Kr=(0,jr.createSlice)({name:"appConfig",initialState:ri,reducers:{initializeNetworkConfig:(e,t)=>{let r=yt(t.payload.walletConnectBridgeAddresses),n=yt(t.payload.walletConnectV2RelayAddresses),i=(0,zr.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:Hs,setChainID:Gs}=Kr.actions,Yr=Kr.reducer});var wt,Zr,Xr,De,St,Jr,Qr,Xs,en,Js,Qs,ec,tc,rc,nc,oc,tn,bt=T(()=>{"use strict";o();wt=require("@elrondnetwork/erdjs"),Zr=require("@reduxjs/toolkit"),Xr=require("redux-persist");b();ke();me();z();De={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:ie},St={address:"",websocketEvent:null,accounts:{"":De},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Jr=(0,Zr.createSlice)({name:"accountInfoSlice",initialState:St,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new wt.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:De},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,()=>(oe.local.removeItem(Q.loginExpiresAt),St)),e.addCase(Le,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new wt.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:p,publicKey:m}=n;t.address=i,t.shard=l;let d=p&&i in p;t.accounts=d?p:St.accounts,t.publicKey=m})}}),{setAccount:Qr,setAddress:Xs,setAccountNonce:en,setAccountShard:Js,setLedgerAccount:Qs,updateLedgerAccount:ec,setWalletConnectAccount:tc,setIsAccountLoading:rc,setAccountLoadingError:nc,setWebsocketEvent:oc}=Jr.actions,tn=Jr.reducer});function rn(e){return e!=null&&(ui(e)||fi(e))}function Ne(e){return e!=null&&(di(e)||Ti(e))}function Ce(e){return e!=null&&(mi(e)||yi(e))}function nn(e){return e!=null&&gi(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)}function fi(e){return e!=null&&ci.includes(e)}function Ti(e){return e!=null&&li.includes(e)}function yi(e){return e!=null&&pi.includes(e)}var oi,ii,ai,si,ci,li,pi,vt=T(()=>{"use strict";o();P();oi=["sent"],ii=["success"],ai=["fail","cancelled","timedOut"],si=["timedOut"],ci=["pending"],li=["success"],pi=["fail","invalid"]});var on,an,Te,hi,sn,mc,gc,fc,Tc,yc,hc,xc,Sc,wc,bc,Re,Pe=T(()=>{"use strict";o();on=require("@reduxjs/toolkit"),an=require("redux-persist");P();vt();z();Te={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},hi={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:p}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||hi;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=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,p=(d=(m=e.signedTransactions)==null?void 0:m[r])==null?void 0:d.transactions;if(p!=null){e.signedTransactions[r].transactions=p.map(U=>U.hash===l?v(x({},U),{status:n,errorMessage:i}):U);let k=(h=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:h.every(U=>Ne(U.status)),W=(I=(y=e.signedTransactions[r])==null?void 0:y.transactions)==null?void 0:I.every(U=>Ce(U.status));k&&(e.signedTransactions[r].status="success"),W&&(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(D,()=>Te),e.addCase(an.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:mc,updateSignedTransactions:gc,setTransactionsToSign:fc,clearAllTransactionsToSign:Tc,clearAllSignedTransactions:yc,clearSignedTransaction:hc,clearTransactionToSign:xc,setSignTransactionsError:Sc,setSignTransactionsCancelMessage:wc,moveTransactionsToSignedState:bc}=sn.actions,Re=sn.reducer});var cn,kt,Et,Lt,xi,It,ln,kc,Ec,Lc,Fe,_e=T(()=>{"use strict";o();cn=require("@reduxjs/toolkit");z();kt="Transaction failed",Et="Transaction successful",Lt="Processing transaction",xi="Transaction submitted",It={},ln=(0,cn.createSlice)({name:"transactionsInfo",initialState:It,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||kt,successMessage:(n==null?void 0:n.successMessage)||Et,processingMessage:(n==null?void 0:n.processingMessage)||Lt,submittedMessage:(n==null?void 0:n.submittedMessage)||xi,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>It},extraReducers:e=>{e.addCase(D,()=>It)}}),{clearTransactionsInfo:kc,setTransactionsDisplayInfo:Ec,clearTransactionsInfoForSessionId:Lc}=ln.actions,Fe=ln.reducer});var un,pn,dn,Rc,Pc,Fc,_c,mn,Dt=T(()=>{"use strict";o();un=require("@reduxjs/toolkit");z();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(D,()=>pn)}}),{setTxSubmittedModal:Rc,setNotificationModal:Pc,clearTxSubmittedModal:Fc,clearNotificationModal:_c}=dn.actions,mn=dn.reducer});var fn,Tn,gn,yn,Gc,Wc,qc,jc,zc,Kc,Me,Oe=T(()=>{"use strict";o();fn=require("@reduxjs/toolkit"),Tn=require("redux-persist");dt();j();it();z();gn={customToasts:[],transactionToasts:[],failTransactionToast:null},yn=(0,fn.createSlice)({name:"toastsSlice",initialState:gn,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:Ie(),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:Pr})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(D,()=>gn),e.addCase(Tn.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:Gc,removeCustomToast:Wc,addTransactionToast:qc,removeTransactionToast:jc,addFailTransactionToast:zc,removeFailTransactionToast:Kc}=yn.actions,Me=yn.reducer});var ae=T(()=>{"use strict";o();Tt();xt();bt();Pe();_e();Dt();Oe()});var Nt=T(()=>{"use strict";o()});var wn,Sn,bn,gl,fl,Tl,yl,hl,xl,An,vn=T(()=>{"use strict";o();wn=require("@reduxjs/toolkit");z();Sn={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},bn=(0,wn.createSlice)({name:"dappModalsSlice",initialState:Sn,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,()=>Sn)}}),{setDappModalVisibility:gl,setDappModalHeaderVisibility:fl,setDappModalFooterVisibility:Tl,setDappModalHeaderText:yl,setDappModalFooterText:hl,setDappModalConfig:xl}=bn.actions,An=bn.reducer});var In,Ai,vi,se,Ue=T(()=>{"use strict";o();In=require("@reduxjs/toolkit");Nt();bt();vn();Tt();Dt();xt();Oe();_e();Pe();Ai={["account"]:tn,["networkConfig"]:Yr,["loginInfo"]:Vr,["modals"]:mn,["dappModal"]:An,["toasts"]:Me,["transactions"]:Re,["transactionsInfo"]:Fe},vi=(e={})=>(0,In.combineReducers)(x(x({},Ai),e)),se=vi});var Ln={};Y(Ln,{default:()=>Ci});function Ct(e,t=[]){return{key:e,version:1,storage:En.default,blacklist:t}}var ee,kn,En,Ii,ki,Ei,Li,Di,Ni,Ci,Dn=T(()=>{"use strict";o();ee=require("redux-persist"),kn=w(require("redux-persist/lib/storage")),En=w(require("redux-persist/lib/storage/session"));Ue();ae();Oe();_e();Pe();Nt();Ii={2:e=>v(x({},e),{networkConfig:ht})};ki=Ct("dapp-core-transactionsInfo"),Ei=Ct("dapp-core-transactions",["transactionsToSign"]),Li=Ct("dapp-core-toasts"),Di={key:"dapp-core-store",version:2,storage:kn.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,ee.createMigrate)(Ii,{debug:!1})},Ni={["toasts"]:(0,ee.persistReducer)(Li,Me),["transactions"]:(0,ee.persistReducer)(Ei,Re),["transactionsInfo"]:(0,ee.persistReducer)(ki,Fe)},Ci=(0,ee.persistReducer)(Di,se(Ni))});var Nn={};Y(Nn,{default:()=>Ri});var Ri,Cn=T(()=>{"use strict";o();Ue();Ri=se()});var Rn={};Y(Rn,{default:()=>Fi});var R,Pi,Fi,Pn=T(()=>{"use strict";o();R=require("redux-persist"),Pi=[R.FLUSH,R.REHYDRATE,R.PAUSE,R.PERSIST,R.PURGE,R.REGISTER],Fi=Pi});var Mn={};Y(Mn,{default:()=>_n});function _n(e){return(0,Fn.persistStore)(e)}var Fn,On=T(()=>{"use strict";o();Fn=require("redux-persist")});var xa={};Y(xa,{useSetTransactionNonces:()=>ha});module.exports=de(xa);o();o();var Gn=require("react"),ce=require("react-redux");o();var Rt=require("@reduxjs/toolkit"),$n=require("react-redux/es/utils/Subscription");ae();o();var hn=w(require("lodash.throttle"));b();ae();lt();ke();me();var Si=[Ee],wi=(0,hn.default)(()=>{fe(ge())},5e3),xn=e=>t=>r=>{var d;if(Si.includes(r.type))return t(r);let n=e.getState(),i=oe.local.getItem(Q.loginExpiresAt);if(!((d=n==null?void 0:n.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(i==null)return fe(ge());let p=Date.now();return i-p<0?setTimeout(()=>q(void 0,null,function*(){console.log("session expired");try{e.dispatch(Ur())}catch(g){console.error("error logging out",g)}}),1e3):(wi(),t(r))};o();o();function Be(){return typeof sessionStorage!="undefined"}var Bn=Be()?(Dn(),de(Ln)).default:(Cn(),de(Nn)).default,Un=Be()?(Pn(),de(Rn)).default:[],Vn=Be()?(On(),de(Mn)).default:e=>e;Ue();var B=(0,Rt.configureStore)({reducer:Bn,middleware:e=>e({serializableCheck:{ignoredActions:[...Un,en.type,Qr.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(xn)}),Hn=(0,$n.createSubscription)(B),Wl=Vn(B),ql=(0,Rt.configureStore)({reducer:se});var _i={store:B,subscription:Hn},Pt=(0,Gn.createContext)(_i),Yl=(0,ce.createStoreHook)(Pt),Zl=(0,ce.createDispatchHook)(Pt),Wn=(0,ce.createSelectorHook)(Pt);o();o();ae();o();var qn=w(require("lodash.isequal")),Ve=require("reselect"),f=(0,Ve.createSelectorCreator)(Ve.defaultMemoize,qn.default);var G=e=>e.account,ye=f(G,e=>e.address),Ft=f(G,ye,(e,t)=>t in e.accounts?e.accounts[t]:De),tp=f(G,Ft,(e,t)=>{let i=e,{accounts:r}=i,n=Wt(i,["accounts"]);return v(x({},n),{account:t})}),rp=f(Ft,e=>e.balance),jn=f(Ft,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),np=f(G,e=>e.shard),op=f(G,e=>e.ledgerAccount),ip=f(G,e=>e.walletConnectAccount),ap=f(G,e=>e.isAccountLoading),sp=f(G,e=>e.accountLoadingError),cp=f(G,e=>e.websocketEvent);o();var le=e=>e.networkConfig,up=f(le,e=>e.chainID),dp=f(le,e=>e.network.walletConnectBridgeAddress),mp=f(le,e=>e.network.walletConnectV2RelayAddress),gp=f(le,e=>e.network.walletConnectV2ProjectId),fp=f(le,e=>e.network.walletConnectDeepLink),_t=f(le,e=>e.network),zn=f(_t,e=>e.apiAddress),Kn=f(_t,e=>e.explorerAddress),Tp=f(_t,e=>e.egldLabel);o();P();var pe=e=>e.loginInfo,wp=f(pe,e=>e.loginMethod),bp=f(pe,ye,(e,t)=>e.loginMethod!=""&&Boolean(t)),Ap=f(pe,e=>e.walletConnectLogin),vp=f(pe,e=>e.ledgerLogin),Ip=f(pe,e=>e.walletLogin),kp=f(pe,e=>e.isLoginSessionInvalid);o();o();var N=require("@elrondnetwork/erdjs");b();o();function Mt(e){try{return a.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function Ot(e){var i,l,p;let{data:t}=e,r=Mt(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:mt,gasPrice:(l=e.gasPrice.valueOf())!=null?l:gt,chainID:e.chainID.valueOf(),version:new N.TransactionVersion((p=e.version)!=null?p:Fr)},e.options?{options:new N.TransactionOptions(e.options)}:{}));return n.applySignature({hex:()=>e.signature||""},new N.Address(e.sender)),n}o();vt();o();var Oi=w(require("bignumber.js"));j();o();o();o();o();var Ui=require("@elrondnetwork/erdjs"),Vi=w(require("bignumber.js"));P();o();var Bi=require("@elrondnetwork/erdjs");o();o();o();var Hi=require("@elrondnetwork/erdjs/out");o();b();o();var Jn=require("@elrondnetwork/erdjs");j();o();o();o();o();P();o();o();o();o();o();o();o();var Bt="accounts";o();o();o();o();E();o();o();E();o();o();o();var Ki=w(require("bignumber.js"));b();o();var zi=require("@elrondnetwork/erdjs"),Ut=w(require("bignumber.js"));b();o();var qi=w(require("bignumber.js"));o();Ut.default.config({ROUNDING_MODE:Ut.default.ROUND_FLOOR});o();o();o();b();o();o();o();o();b();o();b();o();var Yi=require("@elrondnetwork/erdjs");b();o();var Ge=require("@elrondnetwork/erdjs"),Xi=require("@elrondnetwork/erdjs"),Ji=require("@elrondnetwork/erdjs-network-providers");b();o();o();var Zi=w(require("bignumber.js"));b();o();b();o();o();o();o();o();b();o();E();var ea=["reDelegateRewards","claimRewards","unBond"],ta=["wrapEgld","unwrapEgld"],ra=["unStake"],na=["unDelegate"];o();o();o();b();o();var aa=w(require("bignumber.js"));o();o();o();E();o();var sa=w(require("bignumber.js"));o();o();o();o();E();o();o();o();var la=w(require("anchorme"));o();b();o();var pa=w(require("bignumber.js"));o();j();o();o();P();o();P();o();o();o();E();o();E();o();var ua=w(require("bignumber.js"));b();E();o();E();o();var no=require("react");j();o();o();E();o();var da=require("@elrondnetwork/erdjs/out"),ma=w(require("bignumber.js"));E();o();E();o();o();P();var rT=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];o();var oo=require("react");j();o();var fa=require("react");E();var lT=["create","localMint","ESDTLocalMint","addQuantity","burn","localBurn","ESDTLocalBurn","wipe","writeLog","signalError"];var qe=e=>e.transactions,he=