UNPKG

@sofaws/dapp-core

Version:

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

1 lines 60.8 kB
"use strict";var zi=Object.create;var Re=Object.defineProperty,qi=Object.defineProperties,Ki=Object.getOwnPropertyDescriptor,Yi=Object.getOwnPropertyDescriptors,Zi=Object.getOwnPropertyNames,Ke=Object.getOwnPropertySymbols,Xi=Object.getPrototypeOf,_t=Object.prototype.hasOwnProperty,Hr=Object.prototype.propertyIsEnumerable;var Vr=(e,t,r)=>t in e?Re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t)=>{for(var r in t||(t={}))_t.call(t,r)&&Vr(e,r,t[r]);if(Ke)for(var r of Ke(t))Hr.call(t,r)&&Vr(e,r,t[r]);return e},I=(e,t)=>qi(e,Yi(t));var Ye=(e,t)=>{var r={};for(var o in e)_t.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Ke)for(var o of Ke(e))t.indexOf(o)<0&&Hr.call(e,o)&&(r[o]=e[o]);return r};var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ze=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ae=(e,t)=>{for(var r in t)Re(e,r,{get:t[r],enumerable:!0})},jr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zi(t))!_t.call(e,i)&&i!==r&&Re(e,i,{get:()=>t[i],enumerable:!(o=Ki(t,i))||o.enumerable});return e};var v=(e,t,r)=>(r=e!=null?zi(Xi(e)):{},jr(t||!e||!e.__esModule?Re(r,"default",{value:e,enumerable:!0}):r,e)),Me=e=>jr(Re({},"__esModule",{value:!0}),e);var S=(e,t,r)=>new Promise((o,i)=>{var p=d=>{try{m(r.next(d))}catch(f){i(f)}},l=d=>{try{m(r.throw(d))}catch(f){i(f)}},m=d=>d.done?o(d.value):Promise.resolve(d.value).then(p,l);m((r=r.apply(e,t)).next())});var Kr=Ze(Xe=>{"use strict";n();Xe.byteLength=Qi;Xe.toByteArray=ts;Xe.fromByteArray=os;var V=[],U=[],Ji=typeof Uint8Array!="undefined"?Uint8Array:Array,Bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ce=0,zr=Bt.length;ce<zr;++ce)V[ce]=Bt[ce],U[Bt.charCodeAt(ce)]=ce;var ce,zr;U["-".charCodeAt(0)]=62;U["_".charCodeAt(0)]=63;function qr(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 o=r===t?0:4-r%4;return[r,o]}function Qi(e){var t=qr(e),r=t[0],o=t[1];return(r+o)*3/4-o}function es(e,t,r){return(t+r)*3/4-r}function ts(e){var t,r=qr(e),o=r[0],i=r[1],p=new Ji(es(e,o,i)),l=0,m=i>0?o-4:o,d;for(d=0;d<m;d+=4)t=U[e.charCodeAt(d)]<<18|U[e.charCodeAt(d+1)]<<12|U[e.charCodeAt(d+2)]<<6|U[e.charCodeAt(d+3)],p[l++]=t>>16&255,p[l++]=t>>8&255,p[l++]=t&255;return i===2&&(t=U[e.charCodeAt(d)]<<2|U[e.charCodeAt(d+1)]>>4,p[l++]=t&255),i===1&&(t=U[e.charCodeAt(d)]<<10|U[e.charCodeAt(d+1)]<<4|U[e.charCodeAt(d+2)]>>2,p[l++]=t>>8&255,p[l++]=t&255),p}function rs(e){return V[e>>18&63]+V[e>>12&63]+V[e>>6&63]+V[e&63]}function ns(e,t,r){for(var o,i=[],p=t;p<r;p+=3)o=(e[p]<<16&16711680)+(e[p+1]<<8&65280)+(e[p+2]&255),i.push(rs(o));return i.join("")}function os(e){for(var t,r=e.length,o=r%3,i=[],p=16383,l=0,m=r-o;l<m;l+=p)i.push(ns(e,l,l+p>m?m:l+p));return o===1?(t=e[r-1],i.push(V[t>>2]+V[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],i.push(V[t>>10]+V[t>>4&63]+V[t<<2&63]+"=")),i.join("")}});var Yr=Ze(Ut=>{n();Ut.read=function(e,t,r,o,i){var p,l,m=i*8-o-1,d=(1<<m)-1,f=d>>1,w=-7,h=r?i-1:0,P=r?-1:1,C=e[t+h];for(h+=P,p=C&(1<<-w)-1,C>>=-w,w+=m;w>0;p=p*256+e[t+h],h+=P,w-=8);for(l=p&(1<<-w)-1,p>>=-w,w+=o;w>0;l=l*256+e[t+h],h+=P,w-=8);if(p===0)p=1-f;else{if(p===d)return l?NaN:(C?-1:1)*(1/0);l=l+Math.pow(2,o),p=p-f}return(C?-1:1)*l*Math.pow(2,p-o)};Ut.write=function(e,t,r,o,i,p){var l,m,d,f=p*8-i-1,w=(1<<f)-1,h=w>>1,P=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=o?0:p-1,oe=o?1:-1,q=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,l=w):(l=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-l))<1&&(l--,d*=2),l+h>=1?t+=P/d:t+=P*Math.pow(2,1-h),t*d>=2&&(l++,d/=2),l+h>=w?(m=0,l=w):l+h>=1?(m=(t*d-1)*Math.pow(2,i),l=l+h):(m=t*Math.pow(2,h-1)*Math.pow(2,i),l=0));i>=8;e[r+C]=m&255,C+=oe,m/=256,i-=8);for(l=l<<i|m,f+=i;f>0;e[r+C]=l&255,C+=oe,l/=256,f-=8);e[r+C-oe]|=q*128}});var ln=Ze(we=>{"use strict";n();var Wt=Kr(),xe=Yr(),Zr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;we.Buffer=u;we.SlowBuffer=ps;we.INSPECT_MAX_BYTES=50;var Je=2147483647;we.kMaxLength=Je;u.TYPED_ARRAY_SUPPORT=is();!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 is(){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 K(e){if(e>Je)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 Ht(e)}return Qr(e,t,r)}u.poolSize=8192;function Qr(e,t,r){if(typeof e=="string")return as(e,t);if(ArrayBuffer.isView(e))return cs(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(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(H(e,SharedArrayBuffer)||e&&H(e.buffer,SharedArrayBuffer)))return $t(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(o!=null&&o!==e)return u.from(o,t,r);var i=ls(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 Qr(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function en(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 ss(e,t,r){return en(e),e<=0?K(e):t!==void 0?typeof r=="string"?K(e).fill(t,r):K(e).fill(t):K(e)}u.alloc=function(e,t,r){return ss(e,t,r)};function Ht(e){return en(e),K(e<0?0:jt(e)|0)}u.allocUnsafe=function(e){return Ht(e)};u.allocUnsafeSlow=function(e){return Ht(e)};function as(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=tn(e,t)|0,o=K(r),i=o.write(e,t);return i!==r&&(o=o.slice(0,i)),o}function Gt(e){for(var t=e.length<0?0:jt(e.length)|0,r=K(t),o=0;o<t;o+=1)r[o]=e[o]&255;return r}function cs(e){if(H(e,Uint8Array)){var t=new Uint8Array(e);return $t(t.buffer,t.byteOffset,t.byteLength)}return Gt(e)}function $t(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 o;return t===void 0&&r===void 0?o=new Uint8Array(e):r===void 0?o=new Uint8Array(e,t):o=new Uint8Array(e,t,r),Object.setPrototypeOf(o,u.prototype),o}function ls(e){if(u.isBuffer(e)){var t=jt(e.length)|0,r=K(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||zt(e.length)?K(0):Gt(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Gt(e.data)}function jt(e){if(e>=Je)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Je.toString(16)+" bytes");return e|0}function ps(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(H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),H(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 o=t.length,i=r.length,p=0,l=Math.min(o,i);p<l;++p)if(t[p]!==r[p]){o=t[p],i=r[p];break}return o<i?-1:i<o?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 o;if(r===void 0)for(r=0,o=0;o<t.length;++o)r+=t[o].length;var i=u.allocUnsafe(r),p=0;for(o=0;o<t.length;++o){var l=t[o];if(H(l,Uint8Array))p+l.length>i.length?u.from(l).copy(i,p):Uint8Array.prototype.set.call(i,l,p);else if(u.isBuffer(l))l.copy(i,p);else throw new TypeError('"list" argument must be an Array of Buffers');p+=l.length}return i};function tn(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(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,o=arguments.length>2&&arguments[2]===!0;if(!o&&r===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Vt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return cn(e).length;default:if(i)return o?-1:Vt(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=tn;function us(e,t,r){var o=!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 ws(this,t,r);case"utf8":case"utf-8":return nn(this,t,r);case"ascii":return Ss(this,t,r);case"latin1":case"binary":return xs(this,t,r);case"base64":return ys(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vs(this,t,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}u.prototype._isBuffer=!0;function le(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}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)le(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)le(this,r,r+3),le(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)le(this,r,r+7),le(this,r+1,r+6),le(this,r+2,r+5),le(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?nn(this,0,t):us.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=we.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Zr&&(u.prototype[Zr]=u.prototype.inspect);u.prototype.compare=function(t,r,o,i,p){if(H(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),o===void 0&&(o=t?t.length:0),i===void 0&&(i=0),p===void 0&&(p=this.length),r<0||o>t.length||i<0||p>this.length)throw new RangeError("out of range index");if(i>=p&&r>=o)return 0;if(i>=p)return-1;if(r>=o)return 1;if(r>>>=0,o>>>=0,i>>>=0,p>>>=0,this===t)return 0;for(var l=p-i,m=o-r,d=Math.min(l,m),f=this.slice(i,p),w=t.slice(r,o),h=0;h<d;++h)if(f[h]!==w[h]){l=f[h],m=w[h];break}return l<m?-1:m<l?1:0};function rn(e,t,r,o,i){if(e.length===0)return-1;if(typeof r=="string"?(o=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,zt(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,o)),u.isBuffer(t))return t.length===0?-1:Xr(e,t,r,o,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):Xr(e,[t],r,o,i);throw new TypeError("val must be string, number or Buffer")}function Xr(e,t,r,o,i){var p=1,l=e.length,m=t.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(e.length<2||t.length<2)return-1;p=2,l/=2,m/=2,r/=2}function d(C,oe){return p===1?C[oe]:C.readUInt16BE(oe*p)}var f;if(i){var w=-1;for(f=r;f<l;f++)if(d(e,f)===d(t,w===-1?0:f-w)){if(w===-1&&(w=f),f-w+1===m)return w*p}else w!==-1&&(f-=f-w),w=-1}else for(r+m>l&&(r=l-m),f=r;f>=0;f--){for(var h=!0,P=0;P<m;P++)if(d(e,f+P)!==d(t,P)){h=!1;break}if(h)return f}return-1}u.prototype.includes=function(t,r,o){return this.indexOf(t,r,o)!==-1};u.prototype.indexOf=function(t,r,o){return rn(this,t,r,o,!0)};u.prototype.lastIndexOf=function(t,r,o){return rn(this,t,r,o,!1)};function ds(e,t,r,o){r=Number(r)||0;var i=e.length-r;o?(o=Number(o),o>i&&(o=i)):o=i;var p=t.length;o>p/2&&(o=p/2);for(var l=0;l<o;++l){var m=parseInt(t.substr(l*2,2),16);if(zt(m))return l;e[r+l]=m}return l}function ms(e,t,r,o){return Qe(Vt(t,e.length-r),e,r,o)}function gs(e,t,r,o){return Qe(As(t),e,r,o)}function fs(e,t,r,o){return Qe(cn(t),e,r,o)}function Ts(e,t,r,o){return Qe(Es(t,e.length-r),e,r,o)}u.prototype.write=function(t,r,o,i){if(r===void 0)i="utf8",o=this.length,r=0;else if(o===void 0&&typeof r=="string")i=r,o=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(o)?(o=o>>>0,i===void 0&&(i="utf8")):(i=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var p=this.length-r;if((o===void 0||o>p)&&(o=p),t.length>0&&(o<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var l=!1;;)switch(i){case"hex":return ds(this,t,r,o);case"utf8":case"utf-8":return ms(this,t,r,o);case"ascii":case"latin1":case"binary":return gs(this,t,r,o);case"base64":return fs(this,t,r,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ts(this,t,r,o);default:if(l)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),l=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ys(e,t,r){return t===0&&r===e.length?Wt.fromByteArray(e):Wt.fromByteArray(e.slice(t,r))}function nn(e,t,r){r=Math.min(e.length,r);for(var o=[],i=t;i<r;){var p=e[i],l=null,m=p>239?4:p>223?3:p>191?2:1;if(i+m<=r){var d,f,w,h;switch(m){case 1:p<128&&(l=p);break;case 2:d=e[i+1],(d&192)===128&&(h=(p&31)<<6|d&63,h>127&&(l=h));break;case 3:d=e[i+1],f=e[i+2],(d&192)===128&&(f&192)===128&&(h=(p&15)<<12|(d&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(l=h));break;case 4:d=e[i+1],f=e[i+2],w=e[i+3],(d&192)===128&&(f&192)===128&&(w&192)===128&&(h=(p&15)<<18|(d&63)<<12|(f&63)<<6|w&63,h>65535&&h<1114112&&(l=h))}}l===null?(l=65533,m=1):l>65535&&(l-=65536,o.push(l>>>10&1023|55296),l=56320|l&1023),o.push(l),i+=m}return hs(o)}var Jr=4096;function hs(e){var t=e.length;if(t<=Jr)return String.fromCharCode.apply(String,e);for(var r="",o=0;o<t;)r+=String.fromCharCode.apply(String,e.slice(o,o+=Jr));return r}function Ss(e,t,r){var o="";r=Math.min(e.length,r);for(var i=t;i<r;++i)o+=String.fromCharCode(e[i]&127);return o}function xs(e,t,r){var o="";r=Math.min(e.length,r);for(var i=t;i<r;++i)o+=String.fromCharCode(e[i]);return o}function ws(e,t,r){var o=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>o)&&(r=o);for(var i="",p=t;p<r;++p)i+=ks[e[p]];return i}function vs(e,t,r){for(var o=e.slice(t,r),i="",p=0;p<o.length-1;p+=2)i+=String.fromCharCode(o[p]+o[p+1]*256);return i}u.prototype.slice=function(t,r){var o=this.length;t=~~t,r=r===void 0?o:~~r,t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),r<0?(r+=o,r<0&&(r=0)):r>o&&(r=o),r<t&&(r=t);var i=this.subarray(t,r);return Object.setPrototypeOf(i,u.prototype),i};function D(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,o){t=t>>>0,r=r>>>0,o||D(t,r,this.length);for(var i=this[t],p=1,l=0;++l<r&&(p*=256);)i+=this[t+l]*p;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||D(t,r,this.length);for(var i=this[t+--r],p=1;r>0&&(p*=256);)i+=this[t+--r]*p;return i};u.prototype.readUint8=u.prototype.readUInt8=function(t,r){return t=t>>>0,r||D(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||D(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||D(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||D(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||D(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||D(t,r,this.length);for(var i=this[t],p=1,l=0;++l<r&&(p*=256);)i+=this[t+l]*p;return p*=128,i>=p&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||D(t,r,this.length);for(var i=r,p=1,l=this[t+--i];i>0&&(p*=256);)l+=this[t+--i]*p;return p*=128,l>=p&&(l-=Math.pow(2,8*r)),l};u.prototype.readInt8=function(t,r){return t=t>>>0,r||D(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||D(t,2,this.length);var o=this[t]|this[t+1]<<8;return o&32768?o|4294901760:o};u.prototype.readInt16BE=function(t,r){t=t>>>0,r||D(t,2,this.length);var o=this[t+1]|this[t]<<8;return o&32768?o|4294901760:o};u.prototype.readInt32LE=function(t,r){return t=t>>>0,r||D(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||D(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||D(t,4,this.length),xe.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||D(t,4,this.length),xe.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||D(t,8,this.length),xe.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||D(t,8,this.length),xe.read(this,t,!1,52,8)};function M(e,t,r,o,i,p){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<p)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,r,o,i){if(t=+t,r=r>>>0,o=o>>>0,!i){var p=Math.pow(2,8*o)-1;M(this,t,r,o,p,0)}var l=1,m=0;for(this[r]=t&255;++m<o&&(l*=256);)this[r+m]=t/l&255;return r+o};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,r,o,i){if(t=+t,r=r>>>0,o=o>>>0,!i){var p=Math.pow(2,8*o)-1;M(this,t,r,o,p,0)}var l=o-1,m=1;for(this[r+l]=t&255;--l>=0&&(m*=256);)this[r+l]=t/m&255;return r+o};u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,o){return t=+t,r=r>>>0,o||M(this,t,r,1,255,0),this[r]=t&255,r+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||M(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,o){return t=+t,r=r>>>0,o||M(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,o){return t=+t,r=r>>>0,o||M(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,o){return t=+t,r=r>>>0,o||M(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,o,i){if(t=+t,r=r>>>0,!i){var p=Math.pow(2,8*o-1);M(this,t,r,o,p-1,-p)}var l=0,m=1,d=0;for(this[r]=t&255;++l<o&&(m*=256);)t<0&&d===0&&this[r+l-1]!==0&&(d=1),this[r+l]=(t/m>>0)-d&255;return r+o};u.prototype.writeIntBE=function(t,r,o,i){if(t=+t,r=r>>>0,!i){var p=Math.pow(2,8*o-1);M(this,t,r,o,p-1,-p)}var l=o-1,m=1,d=0;for(this[r+l]=t&255;--l>=0&&(m*=256);)t<0&&d===0&&this[r+l+1]!==0&&(d=1),this[r+l]=(t/m>>0)-d&255;return r+o};u.prototype.writeInt8=function(t,r,o){return t=+t,r=r>>>0,o||M(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};u.prototype.writeInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||M(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeInt16BE=function(t,r,o){return t=+t,r=r>>>0,o||M(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeInt32LE=function(t,r,o){return t=+t,r=r>>>0,o||M(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,o){return t=+t,r=r>>>0,o||M(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 on(e,t,r,o,i,p){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function sn(e,t,r,o,i){return t=+t,r=r>>>0,i||on(e,t,r,4,34028234663852886e22,-34028234663852886e22),xe.write(e,t,r,o,23,4),r+4}u.prototype.writeFloatLE=function(t,r,o){return sn(this,t,r,!0,o)};u.prototype.writeFloatBE=function(t,r,o){return sn(this,t,r,!1,o)};function an(e,t,r,o,i){return t=+t,r=r>>>0,i||on(e,t,r,8,17976931348623157e292,-17976931348623157e292),xe.write(e,t,r,o,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,o){return an(this,t,r,!0,o)};u.prototype.writeDoubleBE=function(t,r,o){return an(this,t,r,!1,o)};u.prototype.copy=function(t,r,o,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(o||(o=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<o&&(i=o),i===o||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=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-o&&(i=t.length-r+o);var p=i-o;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,o,i):Uint8Array.prototype.set.call(t,this.subarray(o,i),r),p};u.prototype.fill=function(t,r,o,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,o=this.length):typeof o=="string"&&(i=o,o=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var p=t.charCodeAt(0);(i==="utf8"&&p<128||i==="latin1")&&(t=p)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<o)throw new RangeError("Out of range index");if(o<=r)return this;r=r>>>0,o=o===void 0?this.length:o>>>0,t||(t=0);var l;if(typeof t=="number")for(l=r;l<o;++l)this[l]=t;else{var m=u.isBuffer(t)?t:u.from(t,i),d=m.length;if(d===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(l=0;l<o-r;++l)this[l+r]=m[l%d]}return this};var bs=/[^+/0-9A-Za-z-_]/g;function Is(e){if(e=e.split("=")[0],e=e.trim().replace(bs,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Vt(e,t){t=t||1/0;for(var r,o=e.length,i=null,p=[],l=0;l<o;++l){if(r=e.charCodeAt(l),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&p.push(239,191,189);continue}else if(l+1===o){(t-=3)>-1&&p.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&p.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&p.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;p.push(r)}else if(r<2048){if((t-=2)<0)break;p.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;p.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;p.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return p}function As(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Es(e,t){for(var r,o,i,p=[],l=0;l<e.length&&!((t-=2)<0);++l)r=e.charCodeAt(l),o=r>>8,i=r%256,p.push(i),p.push(o);return p}function cn(e){return Wt.toByteArray(Is(e))}function Qe(e,t,r,o){for(var i=0;i<o&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function H(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function zt(e){return e!==e}var ks=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=r*16,i=0;i<16;++i)t[o+i]=e[r]+e[i];return t}()});var gn=Ze((Tl,mn)=>{n();var L=mn.exports={},j,z;function qt(){throw new Error("setTimeout has not been defined")}function Kt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?j=setTimeout:j=qt}catch(e){j=qt}try{typeof clearTimeout=="function"?z=clearTimeout:z=Kt}catch(e){z=Kt}})();function pn(e){if(j===setTimeout)return setTimeout(e,0);if((j===qt||!j)&&setTimeout)return j=setTimeout,setTimeout(e,0);try{return j(e,0)}catch(t){try{return j.call(null,e,0)}catch(r){return j.call(this,e,0)}}}function Ls(e){if(z===clearTimeout)return clearTimeout(e);if((z===Kt||!z)&&clearTimeout)return z=clearTimeout,clearTimeout(e);try{return z(e)}catch(t){try{return z.call(null,e)}catch(r){return z.call(this,e)}}}var Y=[],ve=!1,pe,et=-1;function Ds(){!ve||!pe||(ve=!1,pe.length?Y=pe.concat(Y):et=-1,Y.length&&un())}function un(){if(!ve){var e=pn(Ds);ve=!0;for(var t=Y.length;t;){for(pe=Y,Y=[];++et<t;)pe&&pe[et].run();et=-1,t=Y.length}pe=null,ve=!1,Ls(e)}}L.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];Y.push(new dn(e,t)),Y.length===1&&!ve&&pn(un)};function dn(e,t){this.fun=e,this.array=t}dn.prototype.run=function(){this.fun.apply(null,this.array)};L.title="browser";L.browser=!0;L.env={};L.argv=[];L.version="";L.versions={};function Z(){}L.on=Z;L.addListener=Z;L.once=Z;L.off=Z;L.removeListener=Z;L.removeAllListeners=Z;L.emit=Z;L.prependListener=Z;L.prependOnceListener=Z;L.listeners=function(e){return[]};L.binding=function(e){throw new Error("process.binding is not supported")};L.cwd=function(){return"/"};L.chdir=function(e){throw new Error("process.chdir is not supported")};L.umask=function(){return 0}});var s,a,yl,n=y(()=>{s=v(ln()),a=v(gn()),yl=function(e){function t(){var o=this||self;return delete e.prototype.__magic__,o}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 tt,Yt=y(()=>{"use strict";n();tt=()=>Date.now()/1e3});var fn=y(()=>{"use strict";n()});var Tn=y(()=>{"use strict";n()});var Zt=y(()=>{"use strict";n();Yt();fn();Tn()});var Jt={};ae(Jt,{getItem:()=>Cs,localStorageKeys:()=>ie,removeItem:()=>Ns,setItem:()=>Ps});var ie,Xt,Ps,Cs,Ns,be=y(()=>{"use strict";n();Zt();ie={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Xt=typeof localStorage!="undefined",Ps=({key:e,data:t,expires:r})=>{!Xt||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Cs=e=>{if(!Xt)return;let t=localStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:tt()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},Ns=e=>{!Xt||localStorage.removeItem(String(e))}});var Qt={};ae(Qt,{clear:()=>xn,getItem:()=>hn,removeItem:()=>Sn,setItem:()=>yn,storage:()=>Rs});var yn,hn,Sn,xn,Rs,wn=y(()=>{"use strict";n();yn=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},hn=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},Sn=e=>sessionStorage.removeItem(String(e)),xn=()=>sessionStorage.clear(),Rs={setItem:yn,getItem:hn,removeItem:Sn,clear:xn}});var ue,Ie=y(()=>{"use strict";n();be();wn();ue={session:Qt,local:Jt}});function Oe(){return new Date().setHours(new Date().getHours()+24)}function Fe(e){ue.local.setItem({key:ie.loginExpiresAt,data:e,expires:e})}var er=y(()=>{"use strict";n();Ie();be()});var k=y(()=>{"use strict";n()});var Ae=y(()=>{"use strict";n()});var vn=y(()=>{"use strict";n()});var N=y(()=>{"use strict";n()});var bn=y(()=>{"use strict";n()});var In=y(()=>{"use strict";n()});var An=y(()=>{"use strict";n()});var En=y(()=>{"use strict";n()});var F=y(()=>{"use strict";n();vn();N();k();bn();In();An();En()});var tr,kn,jl,Ln,zl,Dn,ql,Kl,Yl,Pn=y(()=>{"use strict";n();F();tr={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:kn,egldLabel:jl}=tr["devnet"],{chainId:Ln,egldLabel:zl}=tr["testnet"],{chainId:Dn,egldLabel:ql}=tr["mainnet"],Kl={["devnet"]:kn,["testnet"]:Ln,["mainnet"]:Dn},Yl={[kn]:"devnet",[Ln]:"testnet",[Dn]:"mainnet"}});var rr=y(()=>{"use strict";n()});var Cn=y(()=>{"use strict";n()});var rt,nr=y(()=>{"use strict";n();rt="transaction-status-toast-id"});var _e,nt,Nn,ot,Rn,Ee,A=y(()=>{"use strict";n();Ae();Pn();rr();Cn();nr();_e=5e4,nt=1e9,Nn=1,ot="logout",Rn="login",Ee="0"});var or,R,X,O=y(()=>{"use strict";n();or=require("@reduxjs/toolkit");A();R=(0,or.createAction)(ot),X=(0,or.createAction)(Rn,e=>({payload:e}))});var On,Mn,Fn,mp,_n,Ms,Be,Bn,Os,Un,Wn,ir=y(()=>{"use strict";n();On=require("@reduxjs/toolkit");er();k();O();Mn={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Fn=(0,On.createSlice)({name:"loginInfoSlice",initialState:Mn,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(R,()=>Mn),e.addCase(X,(t,r)=>{t.loginMethod=r.payload.loginMethod,Fe(Oe())})}}),{setLoginMethod:mp,setWalletConnectLogin:_n,setLedgerLogin:Ms,setTokenLogin:Be,setTokenLoginSignature:Bn,setWalletLogin:Os,invalidateLoginSession:Un}=Fn.actions,Wn=Fn.reducer});var Ue=y(()=>{"use strict";n()});var $n=y(()=>{"use strict";n();Ue()});function sr(e){return e[Math.floor(Math.random()*e.length)]}var Vn=y(()=>{"use strict";n()});var ar=y(()=>{"use strict";n();rr()});var ke=y(()=>{"use strict";n();$n();Vn();ar()});var Hn,jn,cr,Fs,zn,Lp,Dp,qn,lr=y(()=>{"use strict";n();Hn=require("@reduxjs/toolkit"),jn=v(require("lodash.omit"));ke();cr={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Fs={network:cr,chainID:"-1"},zn=(0,Hn.createSlice)({name:"appConfig",initialState:Fs,reducers:{initializeNetworkConfig:(e,t)=>{let r=sr(t.payload.walletConnectBridgeAddresses),o=sr(t.payload.walletConnectV2RelayAddresses),i=(0,jn.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=I(T(T({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:o})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:Lp,setChainID:Dp}=zn.actions,qn=zn.reducer});var ur,Kn,Yn,it,pr,Zn,st,_p,dr,Bp,_s,Bs,Up,Wp,Gp,Xn,Jn,mr=y(()=>{"use strict";n();ur=require("@elrondnetwork/erdjs"),Kn=require("@reduxjs/toolkit"),Yn=require("redux-persist");A();Ie();be();O();it={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Ee},pr={address:"",websocketEvent:null,accounts:{"":it},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Zn=(0,Kn.createSlice)({name:"accountInfoSlice",initialState:pr,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new ur.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:it},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(R,()=>(ue.local.removeItem(ie.loginExpiresAt),pr)),e.addCase(X,(t,r)=>{let{address:o}=r.payload;t.address=o,t.publicKey=new ur.Address(o).hex()}),e.addCase(Yn.REHYDRATE,(t,r)=>{var f;if(!((f=r.payload)!=null&&f.account))return;let{account:o}=r.payload,{address:i,shard:p,accounts:l,publicKey:m}=o;t.address=i,t.shard=p;let d=l&&i in l;t.accounts=d?l:pr.accounts,t.publicKey=m})}}),{setAccount:st,setAddress:_p,setAccountNonce:dr,setAccountShard:Bp,setLedgerAccount:_s,updateLedgerAccount:Bs,setWalletConnectAccount:Up,setIsAccountLoading:Wp,setAccountLoadingError:Gp,setWebsocketEvent:Xn}=Zn.actions,Jn=Zn.reducer});function J(e){return e!=null&&(zs(e)||Zs(e))}function me(e){return e!=null&&(qs(e)||Xs(e))}function ge(e){return e!=null&&(Ks(e)||Js(e))}function gr(e){return e!=null&&Ys(e)}function zs(e){return e!=null&&Us.includes(e)}function qs(e){return e!=null&&Ws.includes(e)}function Ks(e){return e!=null&&Gs.includes(e)}function Ys(e){return e!=null&&$s.includes(e)}function Zs(e){return e!=null&&Vs.includes(e)}function Xs(e){return e!=null&&Hs.includes(e)}function Js(e){return e!=null&&js.includes(e)}var Us,Ws,Gs,$s,Vs,Hs,js,Le=y(()=>{"use strict";n();k();Us=["sent"],Ws=["success"],Gs=["fail","cancelled","timedOut"],$s=["timedOut"],Vs=["pending"],Hs=["success"],js=["fail","invalid"]});var Qn,eo,Ge,Qs,to,$e,at,ea,ct,ta,ra,Zp,na,lt,fr,pt,ut=y(()=>{"use strict";n();Qn=require("@reduxjs/toolkit"),eo=require("redux-persist");k();Le();O();Ge={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Qs={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},to=(0,Qn.createSlice)({name:"transactionsSlice",initialState:Ge,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,f;let{sessionId:r,transactions:o,errorMessage:i,status:p,redirectRoute:l}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||Qs;e.signedTransactions[r]={transactions:o,status:p,errorMessage:i,redirectRoute:l,customTransactionInformation:m},((f=e==null?void 0:e.transactionsToSign)==null?void 0:f.sessionId)===r&&(e.transactionsToSign=Ge.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=T(T({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:o,errorMessage:i,transactions:p}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=o,i!=null&&(e.signedTransactions[r].errorMessage=i),p!=null&&(e.signedTransactions[r].transactions=p))},updateSignedTransactionStatus:(e,t)=>{var m,d,f,w,h,P;let{sessionId:r,status:o,errorMessage:i,transactionHash:p}=t.payload,l=(d=(m=e.signedTransactions)==null?void 0:m[r])==null?void 0:d.transactions;if(l!=null){e.signedTransactions[r].transactions=l.map(q=>q.hash===p?I(T({},q),{status:o,errorMessage:i}):q);let C=(w=(f=e.signedTransactions[r])==null?void 0:f.transactions)==null?void 0:w.every(q=>me(q.status)),oe=(P=(h=e.signedTransactions[r])==null?void 0:h.transactions)==null?void 0:P.every(q=>ge(q.status));C&&(e.signedTransactions[r].status="success"),oe&&(e.signedTransactions[r].status="fail")}},setTransactionsToSign:(e,t)=>{e.transactionsToSign=t.payload;let{sessionId:r,customTransactionInformation:o}=t.payload;e.customTransactionInformationForSessionId[r]=o,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=Ge.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Ge.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(R,()=>Ge),e.addCase(eo.REHYDRATE,(t,r)=>{var l;if(t.signTransactionsCancelMessage=null,!((l=r.payload)!=null&&l.transactions))return;let{signedTransactions:o,customTransactionInformationForSessionId:i}=r.payload.transactions,p=Object.entries(o).reduce((m,[d,f])=>{let w=new Date(d),h=new Date;return h.setHours(h.getHours()+5),h-w>0||(m[d]=f),m},{});i!=null&&(t.customTransactionInformationForSessionId=i),o!=null&&(t.signedTransactions=p)})}}),{updateSignedTransactionStatus:$e,updateSignedTransactions:at,setTransactionsToSign:ea,clearAllTransactionsToSign:ct,clearAllSignedTransactions:ta,clearSignedTransaction:ra,clearTransactionToSign:Zp,setSignTransactionsError:na,setSignTransactionsCancelMessage:lt,moveTransactionsToSignedState:fr}=to.actions,pt=to.reducer});var ro,yr,hr,Sr,oa,Tr,no,eu,ia,xr,dt,mt=y(()=>{"use strict";n();ro=require("@reduxjs/toolkit");O();yr="Transaction failed",hr="Transaction successful",Sr="Processing transaction",oa="Transaction submitted",Tr={},no=(0,ro.createSlice)({name:"transactionsInfo",initialState:Tr,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:o}=t.payload;r!=null&&(e[r]={errorMessage:(o==null?void 0:o.errorMessage)||yr,successMessage:(o==null?void 0:o.successMessage)||hr,processingMessage:(o==null?void 0:o.processingMessage)||Sr,submittedMessage:(o==null?void 0:o.submittedMessage)||oa,transactionDuration:o==null?void 0:o.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>Tr},extraReducers:e=>{e.addCase(R,()=>Tr)}}),{clearTransactionsInfo:eu,setTransactionsDisplayInfo:ia,clearTransactionsInfoForSessionId:xr}=no.actions,dt=no.reducer});var io,oo,so,ou,sa,iu,aa,ao,wr=y(()=>{"use strict";n();io=require("@reduxjs/toolkit");O();oo={},so=(0,io.createSlice)({name:"modalsSlice",initialState:oo,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(R,()=>oo)}}),{setTxSubmittedModal:ou,setNotificationModal:sa,clearTxSubmittedModal:iu,clearNotificationModal:aa}=so.actions,ao=so.reducer});var lo,po,co,uo,ca,vr,mu,gu,fu,Tu,gt,ft=y(()=>{"use strict";n();lo=require("@reduxjs/toolkit"),po=require("redux-persist");nr();F();Yt();O();co={customToasts:[],transactionToasts:[],failTransactionToast:null},uo=(0,lo.createSlice)({name:"toastsSlice",initialState:co,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(I(T({},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:tt(),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=I(T({},t.payload),{toastId:rt})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(R,()=>co),e.addCase(po.REHYDRATE,(t,r)=>{var i,p;let o=(p=(i=r.customToasts)==null?void 0:i.filter(l=>!("component"in l)))!=null?p:[];t.customToasts=o})}}),{addCustomToast:ca,removeCustomToast:vr,addTransactionToast:mu,removeTransactionToast:gu,addFailTransactionToast:fu,removeFailTransactionToast:Tu}=uo.actions,gt=uo.reducer});var E=y(()=>{"use strict";n();ir();lr();mr();ut();mt();wr();ft()});var Ar=y(()=>{"use strict";n()});var Eo,Ao,ko,Vd,Hd,jd,zd,qd,Kd,Lo,Do=y(()=>{"use strict";n();Eo=require("@reduxjs/toolkit");O();Ao={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},ko=(0,Eo.createSlice)({name:"dappModalsSlice",initialState:Ao,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=T({},t.payload)}},extraReducers:e=>{e.addCase(R,()=>Ao)}}),{setDappModalVisibility:Vd,setDappModalHeaderVisibility:Hd,setDappModalFooterVisibility:jd,setDappModalHeaderText:zd,setDappModalFooterText:qd,setDappModalConfig:Kd}=ko.actions,Lo=ko.reducer});var Po,Aa,Ea,Pe,wt=y(()=>{"use strict";n();Po=require("@reduxjs/toolkit");Ar();mr();Do();ir();wr();lr();ft();mt();ut();Aa={["account"]:Jn,["networkConfig"]:qn,["loginInfo"]:Wn,["modals"]:ao,["dappModal"]:Lo,["toasts"]:gt,["transactions"]:pt,["transactionsInfo"]:dt},Ea=(e={})=>(0,Po.combineReducers)(T(T({},Aa),e)),Pe=Ea});var Ro={};ae(Ro,{default:()=>Ra});function Er(e,t=[]){return{key:e,version:1,storage:No.default,blacklist:t}}var he,Co,No,ka,La,Da,Pa,Ca,Na,Ra,Mo=y(()=>{"use strict";n();he=require("redux-persist"),Co=v(require("redux-persist/lib/storage")),No=v(require("redux-persist/lib/storage/session"));wt();E();ft();mt();ut();Ar();ka={2:e=>I(T({},e),{networkConfig:cr})};La=Er("dapp-core-transactionsInfo"),Da=Er("dapp-core-transactions",["transactionsToSign"]),Pa=Er("dapp-core-toasts"),Ca={key:"dapp-core-store",version:2,storage:Co.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,he.createMigrate)(ka,{debug:!1})},Na={["toasts"]:(0,he.persistReducer)(Pa,gt),["transactions"]:(0,he.persistReducer)(Da,pt),["transactionsInfo"]:(0,he.persistReducer)(La,dt)},Ra=(0,he.persistReducer)(Ca,Pe(Na))});var Oo={};ae(Oo,{default:()=>Ma});var Ma,Fo=y(()=>{"use strict";n();wt();Ma=Pe()});var _o={};ae(_o,{default:()=>Fa});var G,Oa,Fa,Bo=y(()=>{"use strict";n();G=require("redux-persist"),Oa=[G.FLUSH,G.REHYDRATE,G.PAUSE,G.PERSIST,G.PURGE,G.REGISTER],Fa=Oa});var Go={};ae(Go,{default:()=>Wo});function Wo(e){return(0,Uo.persistStore)(e)}var Uo,$o=y(()=>{"use strict";n();Uo=require("redux-persist")});var ul={};ae(ul,{TransactionsTracker:()=>pl});module.exports=Me(ul);n();n();var Hi=require("react");n();n();var wc=v(require("axios"));n();n();E();n();var mo=v(require("lodash.isequal")),Tt=require("reselect"),g=(0,Tt.createSelectorCreator)(Tt.defaultMemoize,mo.default);var Q=e=>e.account,fe=g(Q,e=>e.address),De=g(Q,fe,(e,t)=>t in e.accounts?e.accounts[t]:it),la=g(Q,De,(e,t)=>{let i=e,{accounts:r}=i,o=Ye(i,["accounts"]);return I(T({},o),{account:t})}),pa=g(De,e=>e.balance),go=g(De,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),Du=g(Q,e=>e.shard),ua=g(Q,e=>e.ledgerAccount),Pu=g(Q,e=>e.walletConnectAccount),Cu=g(Q,e=>e.isAccountLoading),Nu=g(Q,e=>e.accountLoadingError),br=g(Q,e=>e.websocketEvent);n();var ee=e=>e.networkConfig,yt=g(ee,e=>e.chainID),da=g(ee,e=>e.network.walletConnectBridgeAddress),ma=g(ee,e=>e.network.walletConnectV2RelayAddress),ga=g(ee,e=>e.network.walletConnectV2ProjectId),fo=g(ee,e=>e.network.walletConnectDeepLink),Te=g(ee,e=>e.network),ht=g(Te,e=>e.apiAddress),To=g(Te,e=>e.explorerAddress),yo=g(Te,e=>e.egldLabel);n();k();var ye=e=>e.loginInfo,Uu=g(ye,e=>e.loginMethod),Ve=g(ye,fe,(e,t)=>e.loginMethod!=""&&Boolean(t)),Wu=g(ye,e=>e.walletConnectLogin),Gu=g(ye,e=>e.ledgerLogin),ho=g(ye,e=>e.walletLogin),$u=g(ye,e=>e.isLoginSessionInvalid);n();n();var _=require("@elrondnetwork/erdjs");A();n();function Ir(e){try{return s.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function St(e){var i,p,l;let{data:t}=e,r=Ir(t!=null?t:"")?_.TransactionPayload.fromEncoded(t):new _.TransactionPayload(t),o=new _.Transaction(T({value:e.value.valueOf(),data:r,nonce:e.nonce.valueOf(),receiver:new _.Address(e.receiver),sender:new _.Address(e.sender),gasLimit:(i=e.gasLimit.valueOf())!=null?i:_e,gasPrice:(p=e.gasPrice.valueOf())!=null?p:nt,chainID:e.chainID.valueOf(),version:new _.TransactionVersion((l=e.version)!=null?l:Nn)},e.options?{options:new _.TransactionOptions(e.options)}:{}));return o.applySignature({hex:()=>e.signature||""},new _.Address(e.sender)),o}n();Le();n();var Ta=v(require("bignumber.js"));F();n();n();n();n();var ha=require("@elrondnetwork/erdjs"),Sa=v(require("bignumber.js"));k();n();var wo=require("@elrondnetwork/erdjs");function ya(e){try{let t=new wo.Address(e);return Boolean(t.bech32())}catch(t){return!1}}function He(e){return(e==null?void 0:e.startsWith("erd"))&&e.length===62&&/^\w+$/.test(e)&&ya(e)}n();n();n();var wa=require("@elrondnetwork/erdjs/out");n();A();n();var vo=require("@elrondnetwork/erdjs");F();n();n();n();n();k();n();n();var kr=require("@reduxjs/toolkit"),zo=require("react-redux/es/utils/Subscription");E();n();var bo=v(require("lodash.throttle"));A();E();er();Ie();be();var va=[ot],ba=(0,bo.default)(()=>{Fe(Oe())},5e3),Io=e=>t=>r=>{var d;if(va.includes(r.type))return t(r);let o=e.getState(),i=ue.local.getItem(ie.loginExpiresAt);if(!((d=o==null?void 0:o.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(i==null)return Fe(Oe());let l=Date.now();return i-l<0?setTimeout(()=>S(void 0,null,function*(){console.log("session expired");try{e.dispatch(Un())}catch(f){console.error("error logging out",f)}}),1e3):(ba(),t(r))};n();n();function xt(){return typeof sessionStorage!="undefined"}var Vo=xt()?(Mo(),Me(Ro)).default:(Fo(),Me(Oo)).default,Ho=xt()?(Bo(),Me(_o)).default:[],jo=xt()?($o(),Me(Go)).default:e=>e;wt();var x=(0,kr.configureStore)({reducer:Vo,middleware:e=>e({serializableCheck:{ignoredActions:[...Ho,dr.type,st.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(Io)}),qo=(0,zo.createSubscription)(x),Sm=jo(x),xm=(0,kr.configureStore)({reducer:Pe});n();n();n();n();n();n();var vt="accounts";n();n();n();n();N();n();n();N();n();n();n();var Ha=v(require("bignumber.js"));A();n();var Va=require("@elrondnetwork/erdjs"),Lr=v(require("bignumber.js"));A();n();var Ga=v(require("bignumber.js"));n();Lr.default.config({ROUNDING_MODE:Lr.default.ROUND_FLOOR});n();n();n();A();n();n();n();n();A();n();A();n();var ja=require("@elrondnetwork/erdjs");A();n();var At=require("@elrondnetwork/erdjs"),Ka=require("@elrondnetwork/erdjs"),Ya=require("@elrondnetwork/erdjs-network-providers");A();n();n();var za=v(require("bignumber.js"));A();n();A();n();n();n();n();n();A();n();N();var Xa=["reDelegateRewards","claimRewards","unBond"],Ja=["wrapEgld","unwrapEgld"],Qa=["unStake"],ec=["unDelegate"];n();n();n();A();n();var oc=v(require("bignumber.js"));n();n();n();N();n();var ic=v(require("bignumber.js"));n();n();n();n();N();n();n();n();var cc=v(require("anchorme"));n();A();n();var lc=v(require("bignumber.js"));n();F();n();n();k();n();k();n();n();n();N();n();N();n();var pc=v(require("bignumber.js"));A();N();n();N();n();var Qo=require("react");F();n();n();N();n();var uc=require("@elrondnetwork/erdjs/out"),dc=v(require("bignumber.js"));N();n();N();n();n();k();var th=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];n();var ei=require("react");F();n();var gc=require("react");N();var ch=["create","localMint","ESDTLocalMint","addQuantity","burn","localBurn","ESDTL