UNPKG

@sofaws/dapp-core

Version:

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

1 lines 52.3 kB
"use strict";var go=Object.create;var pe=Object.defineProperty,fo=Object.defineProperties,To=Object.getOwnPropertyDescriptor,yo=Object.getOwnPropertyDescriptors,ho=Object.getOwnPropertyNames,we=Object.getOwnPropertySymbols,xo=Object.getPrototypeOf,Ye=Object.prototype.hasOwnProperty,Gt=Object.prototype.propertyIsEnumerable;var Ht=(e,t,r)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))Ye.call(t,r)&&Ht(e,r,t[r]);if(we)for(var r of we(t))Gt.call(t,r)&&Ht(e,r,t[r]);return e},k=(e,t)=>fo(e,yo(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&&we)for(var n of we(e))t.indexOf(n)<0&&Gt.call(e,n)&&(r[n]=e[n]);return r};var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Y=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},qt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ho(t))!Ye.call(e,i)&&i!==r&&pe(e,i,{get:()=>t[i],enumerable:!(n=To(t,i))||n.enumerable});return e};var S=(e,t,r)=>(r=e!=null?go(xo(e)):{},qt(t||!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),ue=e=>qt(pe({},"__esModule",{value:!0}),e);var q=(e,t,r)=>new Promise((n,i)=>{var l=d=>{try{m(r.next(d))}catch(g){i(g)}},p=d=>{try{m(r.throw(d))}catch(g){i(g)}},m=d=>d.done?n(d.value):Promise.resolve(d.value).then(l,p);m((r=r.apply(e,t)).next())});var Kt=be(Ae=>{"use strict";o();Ae.byteLength=wo;Ae.toByteArray=Ao;Ae.fromByteArray=ko;var O=[],C=[],So=typeof Uint8Array!="undefined"?Uint8Array:Array,Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Z=0,jt=Ze.length;Z<jt;++Z)O[Z]=Ze[Z],C[Ze.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 wo(e){var t=zt(e),r=t[0],n=t[1];return(r+n)*3/4-n}function bo(e,t,r){return(t+r)*3/4-r}function Ao(e){var t,r=zt(e),n=r[0],i=r[1],l=new So(bo(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 vo(e){return O[e>>18&63]+O[e>>12&63]+O[e>>6&63]+O[e&63]}function Io(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(vo(n));return i.join("")}function ko(e){for(var t,r=e.length,n=r%3,i=[],l=16383,p=0,m=r-n;p<m;p+=l)i.push(Io(e,p,p+l>m?m:p+l));return n===1?(t=e[r-1],i.push(O[t>>2]+O[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(O[t>>10]+O[t>>4&63]+O[t<<2&63]+"=")),i.join("")}});var Yt=be(Xe=>{o();Xe.read=function(e,t,r,n,i){var l,p,m=i*8-n-1,d=(1<<m)-1,g=d>>1,h=-7,T=r?i-1:0,v=r?-1:1,I=e[t+T];for(T+=v,l=I&(1<<-h)-1,I>>=-h,h+=m;h>0;l=l*256+e[t+T],T+=v,h-=8);for(p=l&(1<<-h)-1,l>>=-h,h+=n;h>0;p=p*256+e[t+T],T+=v,h-=8);if(l===0)l=1-g;else{if(l===d)return p?NaN:(I?-1:1)*(1/0);p=p+Math.pow(2,n),l=l-g}return(I?-1:1)*p*Math.pow(2,l-n)};Xe.write=function(e,t,r,n,i,l){var p,m,d,g=l*8-i-1,h=(1<<g)-1,T=h>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=n?0:l-1,P=n?1:-1,F=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+T>=1?t+=v/d:t+=v*Math.pow(2,1-T),t*d>=2&&(p++,d/=2),p+T>=h?(m=0,p=h):p+T>=1?(m=(t*d-1)*Math.pow(2,i),p=p+T):(m=t*Math.pow(2,T-1)*Math.pow(2,i),p=0));i>=8;e[r+I]=m&255,I+=P,m/=256,i-=8);for(p=p<<i|m,g+=i;g>0;e[r+I]=p&255,I+=P,p/=256,g-=8);e[r+I-P]|=F*128}});var cr=be(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=Ro;re.INSPECT_MAX_BYTES=50;var ve=2147483647;re.kMaxLength=ve;u.TYPED_ARRAY_SUPPORT=Eo();!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 Eo(){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 $(e){if(e>ve)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 Do(e,t);if(ArrayBuffer.isView(e))return No(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(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(B(e,SharedArrayBuffer)||e&&B(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=Co(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 Lo(e,t,r){return er(e),e<=0?$(e):t!==void 0?typeof r=="string"?$(e).fill(t,r):$(e).fill(t):$(e)}u.alloc=function(e,t,r){return Lo(e,t,r)};function rt(e){return er(e),$(e<0?0:nt(e)|0)}u.allocUnsafe=function(e){return rt(e)};u.allocUnsafeSlow=function(e){return rt(e)};function Do(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=$(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=$(t),n=0;n<t;n+=1)r[n]=e[n]&255;return r}function No(e){if(B(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 Co(e){if(u.isBuffer(e)){var t=nt(e.length)|0,r=$(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)?$(0):Qe(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Qe(e.data)}function nt(e){if(e>=ve)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ve.toString(16)+" bytes");return e|0}function Ro(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(B(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),B(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(B(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)||B(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 Po(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 Go(this,t,r);case"utf8":case"utf-8":return nr(this,t,r);case"ascii":return $o(this,t,r);case"latin1":case"binary":return Ho(this,t,r);case"base64":return Uo(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wo(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):Po.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(B(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),T=0;T<d;++T)if(g[T]!==h[T]){p=g[T],m=h[T];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,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,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(I,P){return l===1?I[P]:I.readUInt16BE(P*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 T=!0,v=0;v<m;v++)if(d(e,g+v)!==d(t,v)){T=!1;break}if(T)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 Fo(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(ot(m))return p;e[r+p]=m}return p}function _o(e,t,r,n){return Ie(tt(t,e.length-r),e,r,n)}function Mo(e,t,r,n){return Ie(zo(t),e,r,n)}function Oo(e,t,r,n){return Ie(sr(t),e,r,n)}function Bo(e,t,r,n){return Ie(Ko(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 Fo(this,t,r,n);case"utf8":case"utf-8":return _o(this,t,r,n);case"ascii":case"latin1":case"binary":return Mo(this,t,r,n);case"base64":return Oo(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bo(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 Uo(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],p=null,m=l>239?4:l>223?3:l>191?2:1;if(i+m<=r){var d,g,h,T;switch(m){case 1:l<128&&(p=l);break;case 2:d=e[i+1],(d&192)===128&&(T=(l&31)<<6|d&63,T>127&&(p=T));break;case 3:d=e[i+1],g=e[i+2],(d&192)===128&&(g&192)===128&&(T=(l&15)<<12|(d&63)<<6|g&63,T>2047&&(T<55296||T>57343)&&(p=T));break;case 4:d=e[i+1],g=e[i+2],h=e[i+3],(d&192)===128&&(g&192)===128&&(h&192)===128&&(T=(l&15)<<18|(d&63)<<12|(g&63)<<6|h&63,T>65535&&T<1114112&&(p=T))}}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 Vo(n)}var Jt=4096;function Vo(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 $o(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 Ho(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 Go(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+=Yo[e[l]];return i}function Wo(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 qo=/[^+/0-9A-Za-z-_]/g;function jo(e){if(e=e.split("=")[0],e=e.trim().replace(qo,""),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=[],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 zo(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Ko(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 Je.toByteArray(jo(e))}function Ie(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 B(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 Yo=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=be((va,dr)=>{o();var w=dr.exports={},U,V;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"?U=setTimeout:U=it}catch(e){U=it}try{typeof clearTimeout=="function"?V=clearTimeout:V=at}catch(e){V=at}})();function lr(e){if(U===setTimeout)return setTimeout(e,0);if((U===it||!U)&&setTimeout)return U=setTimeout,setTimeout(e,0);try{return U(e,0)}catch(t){try{return U.call(null,e,0)}catch(r){return U.call(this,e,0)}}}function Zo(e){if(V===clearTimeout)return clearTimeout(e);if((V===at||!V)&&clearTimeout)return V=clearTimeout,clearTimeout(e);try{return V(e)}catch(t){try{return V.call(null,e)}catch(r){return V.call(this,e)}}}var H=[],ne=!1,J,ke=-1;function Xo(){!ne||!J||(ne=!1,J.length?H=J.concat(H):ke=-1,H.length&&pr())}function pr(){if(!ne){var e=lr(Xo);ne=!0;for(var t=H.length;t;){for(J=H,H=[];++ke<t;)J&&J[ke].run();ke=-1,t=H.length}J=null,ne=!1,Zo(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];H.push(new ur(e,t)),H.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 G(){}w.on=G;w.addListener=G;w.once=G;w.off=G;w.removeListener=G;w.removeAllListeners=G;w.emit=G;w.prependListener=G;w.prependOnceListener=G;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 a,s,Ia,o=y(()=>{a=S(cr()),s=S(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 gr=y(()=>{"use strict";o()});var fr=y(()=>{"use strict";o()});var E=y(()=>{"use strict";o()});var _=y(()=>{"use strict";o()});var Tr=y(()=>{"use strict";o()});var yr=y(()=>{"use strict";o()});var hr=y(()=>{"use strict";o()});var xr=y(()=>{"use strict";o()});var j=y(()=>{"use strict";o();fr();E();_();Tr();yr();hr();xr()});var st,Sr,$a,wr,Ha,br,Ga,Wa,qa,Ar=y(()=>{"use strict";o();j();st={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:Sr,egldLabel:$a}=st["devnet"],{chainId:wr,egldLabel:Ha}=st["testnet"],{chainId:br,egldLabel:Ga}=st["mainnet"],Wa={["devnet"]:Sr,["testnet"]:wr,["mainnet"]:br},qa={[Sr]:"devnet",[wr]:"testnet",[br]:"mainnet"}});var ct=y(()=>{"use strict";o()});var vr=y(()=>{"use strict";o()});var Ir,lt=y(()=>{"use strict";o();Ir="transaction-status-toast-id"});var kr,de,me,Er,Ee,Lr,oe,b=y(()=>{"use strict";o();gr();Ar();ct();vr();lt();kr=1500,de=5e4,me=1e9,Er=1,Ee="logout",Lr="login",oe="0"});var Le,ut=y(()=>{"use strict";o();Le=()=>Date.now()/1e3});var Dr=y(()=>{"use strict";o()});var Nr=y(()=>{"use strict";o()});var Cr=y(()=>{"use strict";o();ut();Dr();Nr()});var mt={};Y(mt,{getItem:()=>Qo,localStorageKeys:()=>Q,removeItem:()=>ei,setItem:()=>Jo});var Q,dt,Jo,Qo,ei,fe=y(()=>{"use strict";o();Cr();Q={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},dt=typeof localStorage!="undefined",Jo=({key:e,data:t,expires:r})=>{!dt||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Qo=e=>{if(!dt)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:Le()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},ei=e=>{!dt||localStorage.removeItem(String(e))}});var gt={};Y(gt,{clear:()=>_r,getItem:()=>Pr,removeItem:()=>Fr,setItem:()=>Rr,storage:()=>ti});var Rr,Pr,Fr,_r,ti,Mr=y(()=>{"use strict";o();Rr=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Pr=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},Fr=e=>sessionStorage.removeItem(String(e)),_r=()=>sessionStorage.clear(),ti={setItem:Rr,getItem:Pr,removeItem:Fr,clear:_r}});var ie,De=y(()=>{"use strict";o();fe();Mr();ie={session:gt,local:mt}});function Te(){return new Date().setHours(new Date().getHours()+24)}function ye(e){ie.local.setItem({key:Q.loginExpiresAt,data:e,expires:e})}var ft=y(()=>{"use strict";o();De();fe()});var Tt,D,Ne,z=y(()=>{"use strict";o();Tt=require("@reduxjs/toolkit");b();D=(0,Tt.createAction)(Ee),Ne=(0,Tt.createAction)(Lr,e=>({payload:e}))});var Br,Or,Ur,Is,ks,Es,Ls,Ds,Ns,Vr,$r,yt=y(()=>{"use strict";o();Br=require("@reduxjs/toolkit");ft();_();z();Or={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Ur=(0,Br.createSlice)({name:"loginInfoSlice",initialState:Or,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,()=>Or),e.addCase(Ne,(t,r)=>{t.loginMethod=r.payload.loginMethod,ye(Te())})}}),{setLoginMethod:Is,setWalletConnectLogin:ks,setLedgerLogin:Es,setTokenLogin:Ls,setTokenLoginSignature:Ds,setWalletLogin:Ns,invalidateLoginSession:Vr}=Ur.actions,$r=Ur.reducer});var Hr=y(()=>{"use strict";o()});var Gr=y(()=>{"use strict";o();Hr()});function ht(e){return e[Math.floor(Math.random()*e.length)]}var Wr=y(()=>{"use strict";o()});var qr=y(()=>{"use strict";o();ct()});var jr=y(()=>{"use strict";o();Gr();Wr();qr()});var zr,Kr,xt,ni,Yr,js,zs,Zr,St=y(()=>{"use strict";o();zr=require("@reduxjs/toolkit"),Kr=S(require("lodash.omit"));jr();xt={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},ni={network:xt,chainID:"-1"},Yr=(0,zr.createSlice)({name:"appConfig",initialState:ni,reducers:{initializeNetworkConfig:(e,t)=>{let r=ht(t.payload.walletConnectBridgeAddresses),n=ht(t.payload.walletConnectV2RelayAddresses),i=(0,Kr.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=k(x(x({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:n})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:js,setChainID:zs}=Yr.actions,Zr=Yr.reducer});var bt,Xr,Jr,Ce,wt,Qr,en,tc,tn,rc,nc,oc,ic,ac,sc,cc,rn,At=y(()=>{"use strict";o();bt=require("@elrondnetwork/erdjs"),Xr=require("@reduxjs/toolkit"),Jr=require("redux-persist");b();De();fe();z();Ce={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:oe},wt={address:"",websocketEvent:null,accounts:{"":Ce},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Qr=(0,Xr.createSlice)({name:"accountInfoSlice",initialState:wt,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new bt.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Ce},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,()=>(ie.local.removeItem(Q.loginExpiresAt),wt)),e.addCase(Ne,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new bt.Address(n).hex()}),e.addCase(Jr.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:wt.accounts,t.publicKey=m})}}),{setAccount:en,setAddress:tc,setAccountNonce:tn,setAccountShard:rc,setLedgerAccount:nc,updateLedgerAccount:oc,setWalletConnectAccount:ic,setIsAccountLoading:ac,setAccountLoadingError:sc,setWebsocketEvent:cc}=Qr.actions,rn=Qr.reducer});function nn(e){return e!=null&&(di(e)||Ti(e))}function Re(e){return e!=null&&(mi(e)||yi(e))}function Pe(e){return e!=null&&(gi(e)||hi(e))}function on(e){return e!=null&&fi(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)}function hi(e){return e!=null&&ui.includes(e)}var ii,ai,si,ci,li,pi,ui,It=y(()=>{"use strict";o();_();ii=["sent"],ai=["success"],si=["fail","cancelled","timedOut"],ci=["timedOut"],li=["pending"],pi=["success"],ui=["fail","invalid"]});var an,sn,he,xi,cn,yc,hc,xc,Sc,wc,bc,Ac,vc,Ic,kc,Fe,_e=y(()=>{"use strict";o();an=require("@reduxjs/toolkit"),sn=require("redux-persist");_();It();z();he={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},xi={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},cn=(0,an.createSlice)({name:"transactionsSlice",initialState:he,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])||xi;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=he.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,T,v;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(F=>F.hash===l?k(x({},F),{status:n,errorMessage:i}):F);let I=(h=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:h.every(F=>Re(F.status)),P=(v=(T=e.signedTransactions[r])==null?void 0:T.transactions)==null?void 0:v.every(F=>Pe(F.status));I&&(e.signedTransactions[r].status="success"),P&&(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=he.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=he.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(D,()=>he),e.addCase(sn.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),T=new Date;return T.setHours(T.getHours()+5),T-h>0||(m[d]=g),m},{});i!=null&&(t.customTransactionInformationForSessionId=i),n!=null&&(t.signedTransactions=l)})}}),{updateSignedTransactionStatus:yc,updateSignedTransactions:hc,setTransactionsToSign:xc,clearAllTransactionsToSign:Sc,clearAllSignedTransactions:wc,clearSignedTransaction:bc,clearTransactionToSign:Ac,setSignTransactionsError:vc,setSignTransactionsCancelMessage:Ic,moveTransactionsToSignedState:kc}=cn.actions,Fe=cn.reducer});var ln,Et,Lt,Dt,Si,kt,pn,Nc,Cc,Rc,Me,Oe=y(()=>{"use strict";o();ln=require("@reduxjs/toolkit");z();Et="Transaction failed",Lt="Transaction successful",Dt="Processing transaction",Si="Transaction submitted",kt={},pn=(0,ln.createSlice)({name:"transactionsInfo",initialState:kt,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||Et,successMessage:(n==null?void 0:n.successMessage)||Lt,processingMessage:(n==null?void 0:n.processingMessage)||Dt,submittedMessage:(n==null?void 0:n.submittedMessage)||Si,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>kt},extraReducers:e=>{e.addCase(D,()=>kt)}}),{clearTransactionsInfo:Nc,setTransactionsDisplayInfo:Cc,clearTransactionsInfoForSessionId:Rc}=pn.actions,Me=pn.reducer});var dn,un,mn,Mc,Oc,Bc,Uc,gn,Nt=y(()=>{"use strict";o();dn=require("@reduxjs/toolkit");z();un={},mn=(0,dn.createSlice)({name:"modalsSlice",initialState:un,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,()=>un)}}),{setTxSubmittedModal:Mc,setNotificationModal:Oc,clearTxSubmittedModal:Bc,clearNotificationModal:Uc}=mn.actions,gn=mn.reducer});var Tn,yn,fn,hn,zc,Kc,Yc,Zc,Xc,Jc,Be,Ue=y(()=>{"use strict";o();Tn=require("@reduxjs/toolkit"),yn=require("redux-persist");lt();j();ut();z();fn={customToasts:[],transactionToasts:[],failTransactionToast:null},hn=(0,Tn.createSlice)({name:"toastsSlice",initialState:fn,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(k(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:Le(),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=k(x({},t.payload),{toastId:Ir})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(D,()=>fn),e.addCase(yn.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:zc,removeCustomToast:Kc,addTransactionToast:Yc,removeTransactionToast:Zc,addFailTransactionToast:Xc,removeFailTransactionToast:Jc}=hn.actions,Be=hn.reducer});var ae=y(()=>{"use strict";o();yt();St();At();_e();Oe();Nt();Ue()});var Pt=y(()=>{"use strict";o()});var Cn,Nn,Rn,Rp,Pp,Fp,_p,Mp,Op,Pn,Fn=y(()=>{"use strict";o();Cn=require("@reduxjs/toolkit");z();Nn={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Rn=(0,Cn.createSlice)({name:"dappModalsSlice",initialState:Nn,reducers:{setDappModalVisibility:(e,t)=>{e.visible=t.payload},setDappModalHeaderVisibility:(e,t)=>{e.modal.showHeader=t.payload},setDappModalFooterVisibility:(e,t)=>{e.modal.showFooter=t.payload},setDappModalHeaderText:(e,t)=>{e.modal.headerText=t.payload},setDappModalFooterText:(e,t)=>{e.modal.footerText=t.payload},setDappModalConfig:(e,t)=>{e.modal=x({},t.payload)}},extraReducers:e=>{e.addCase(D,()=>Nn)}}),{setDappModalVisibility:Rp,setDappModalHeaderVisibility:Pp,setDappModalFooterVisibility:Fp,setDappModalHeaderText:_p,setDappModalFooterText:Mp,setDappModalConfig:Op}=Rn.actions,Pn=Rn.reducer});var _n,Ci,Ri,le,He=y(()=>{"use strict";o();_n=require("@reduxjs/toolkit");Pt();At();Fn();yt();Nt();St();Ue();Oe();_e();Ci={["account"]:rn,["networkConfig"]:Zr,["loginInfo"]:$r,["modals"]:gn,["dappModal"]:Pn,["toasts"]:Be,["transactions"]:Fe,["transactionsInfo"]:Me},Ri=(e={})=>(0,_n.combineReducers)(x(x({},Ci),e)),le=Ri});var Bn={};Y(Bn,{default:()=>Ui});function Ft(e,t=[]){return{key:e,version:1,storage:On.default,blacklist:t}}var ee,Mn,On,Pi,Fi,_i,Mi,Oi,Bi,Ui,Un=y(()=>{"use strict";o();ee=require("redux-persist"),Mn=S(require("redux-persist/lib/storage")),On=S(require("redux-persist/lib/storage/session"));He();ae();Ue();Oe();_e();Pt();Pi={2:e=>k(x({},e),{networkConfig:xt})};Fi=Ft("dapp-core-transactionsInfo"),_i=Ft("dapp-core-transactions",["transactionsToSign"]),Mi=Ft("dapp-core-toasts"),Oi={key:"dapp-core-store",version:2,storage:Mn.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,ee.createMigrate)(Pi,{debug:!1})},Bi={["toasts"]:(0,ee.persistReducer)(Mi,Be),["transactions"]:(0,ee.persistReducer)(_i,Fe),["transactionsInfo"]:(0,ee.persistReducer)(Fi,Me)},Ui=(0,ee.persistReducer)(Oi,le(Bi))});var Vn={};Y(Vn,{default:()=>Vi});var Vi,$n=y(()=>{"use strict";o();He();Vi=le()});var Hn={};Y(Hn,{default:()=>Hi});var R,$i,Hi,Gn=y(()=>{"use strict";o();R=require("redux-persist"),$i=[R.FLUSH,R.REHYDRATE,R.PAUSE,R.PERSIST,R.PURGE,R.REGISTER],Hi=$i});var jn={};Y(jn,{default:()=>qn});function qn(e){return(0,Wn.persistStore)(e)}var Wn,zn=y(()=>{"use strict";o();Wn=require("redux-persist")});var xa={};Y(xa,{transformAndSignTransactions:()=>ha});module.exports=ue(xa);o();var Vt=require("@elrondnetwork/erdjs"),$t=S(require("bignumber.js"));b();o();var N=require("@elrondnetwork/erdjs");b();o();function pt(e){try{return a.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function ge(e){var i,l,p;let{data:t}=e,r=pt(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:de,gasPrice:(l=e.gasPrice.valueOf())!=null?l:me,chainID:e.chainID.valueOf(),version:new N.TransactionVersion((p=e.version)!=null?p:Er)},e.options?{options:new N.TransactionOptions(e.options)}:{}));return n.applySignature({hex:()=>e.signature||""},new N.Address(e.sender)),n}o();o();ae();o();var xn=S(require("lodash.isequal")),Ve=require("reselect"),f=(0,Ve.createSelectorCreator)(Ve.defaultMemoize,xn.default);var W=e=>e.account,xe=f(W,e=>e.address),Ct=f(W,xe,(e,t)=>t in e.accounts?e.accounts[t]:Ce),ul=f(W,Ct,(e,t)=>{let i=e,{accounts:r}=i,n=Wt(i,["accounts"]);return k(x({},n),{account:t})}),dl=f(Ct,e=>e.balance),Sn=f(Ct,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),ml=f(W,e=>e.shard),gl=f(W,e=>e.ledgerAccount),fl=f(W,e=>e.walletConnectAccount),Tl=f(W,e=>e.isAccountLoading),yl=f(W,e=>e.accountLoadingError),hl=f(W,e=>e.websocketEvent);o();var se=e=>e.networkConfig,wn=f(se,e=>e.chainID),wl=f(se,e=>e.network.walletConnectBridgeAddress),bl=f(se,e=>e.network.walletConnectV2RelayAddress),Al=f(se,e=>e.network.walletConnectV2ProjectId),vl=f(se,e=>e.network.walletConnectDeepLink),Rt=f(se,e=>e.network),bn=f(Rt,e=>e.apiAddress),An=f(Rt,e=>e.explorerAddress),Il=f(Rt,e=>e.egldLabel);o();_();var ce=e=>e.loginInfo,Nl=f(ce,e=>e.loginMethod),Cl=f(ce,xe,(e,t)=>e.loginMethod!=""&&Boolean(t)),Rl=f(ce,e=>e.walletConnectLogin),Pl=f(ce,e=>e.ledgerLogin),Fl=f(ce,e=>e.walletLogin),_l=f(ce,e=>e.isLoginSessionInvalid);o();o();It();o();var bi=S(require("bignumber.js"));j();o();o();o();o();var vi=require("@elrondnetwork/erdjs"),Ii=S(require("bignumber.js"));_();o();var Ai=require("@elrondnetwork/erdjs");o();o();o();var Ei=require("@elrondnetwork/erdjs/out");o();b();o();var En=require("@elrondnetwork/erdjs");j();o();o();o();o();_();o();o();var _t=require("@reduxjs/toolkit"),Xn=require("react-redux/es/utils/Subscription");ae();o();var Ln=S(require("lodash.throttle"));b();ae();ft();De();fe();var Li=[Ee],Di=(0,Ln.default)(()=>{ye(Te())},5e3),Dn=e=>t=>r=>{var d;if(Li.includes(r.type))return t(r);let n=e.getState(),i=ie.local.getItem(Q.loginExpiresAt);if(!((d=n==null?void 0:n.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(i==null)return ye(Te());let p=Date.now();return i-p<0?setTimeout(()=>q(void 0,null,function*(){console.log("session expired");try{e.dispatch(Vr())}catch(g){console.error("error logging out",g)}}),1e3):(Di(),t(r))};o();o();function $e(){return typeof sessionStorage!="undefined"}var Kn=$e()?(Un(),ue(Bn)).default:($n(),ue(Vn)).default,Yn=$e()?(Gn(),ue(Hn)).default:[],Zn=$e()?(zn(),ue(jn)).default:e=>e;He();var M=(0,_t.configureStore)({reducer:Kn,middleware:e=>e({serializableCheck:{ignoredActions:[...Yn,tn.type,en.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(Dn)}),cu=(0,Xn.createSubscription)(M),lu=Zn(M),pu=(0,_t.configureStore)({reducer:le});o();o();o();o();o();o();var Mt="accounts";o();o();o();o();E();o();o();E();o();o();o();var Ki=S(require("bignumber.js"));b();o();var zi=require("@elrondnetwork/erdjs"),Ot=S(require("bignumber.js"));b();o();var qi=S(require("bignumber.js"));o();Ot.default.config({ROUNDING_MODE:Ot.default.ROUND_FLOOR});o();o();o();b();o();o();o();o();b();o();b();o();var Yi=require("@elrondnetwork/erdjs");b();o();var qe=require("@elrondnetwork/erdjs"),Xi=require("@elrondnetwork/erdjs"),Ji=require("@elrondnetwork/erdjs-network-providers");b();o();o();var Zi=S(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=S(require("bignumber.js"));o();o();o();E();o();var sa=S(require("bignumber.js"));o();o();o();o();E();o();o();o();var la=S(require("anchorme"));o();b();o();var pa=S(require("bignumber.js"));o();j();o();o();_();o();_();o();o();o();E();o();E();o();var ua=S(require("bignumber.js"));b();E();o();E();o();var ro=require("react");j();o();o();E();o();var da=require("@elrondnetwork/erdjs/out"),ma=S(require("bignumber.js"));E();o();E();o();o();_();var Xf=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];o();var no=require("react");j();o();var fa=require("react");E();var oT=["create","localMint","ESDTLocalMint","addQuantity","burn","localBurn","ESDTLocalBurn","wipe","writeLog","signalError"];var ze=e=>e.transactions,Se=f(ze,e=>e.signedTransactions),HT=f(ze,e=>e.signTransactionsError),GT=f(ze,e=>e.signTransactionsCancelMessage),Ke=e=>t=>Obj