@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 52 kB
JavaScript
"use strict";var uo=Object.create;var pe=Object.defineProperty,mo=Object.defineProperties,go=Object.getOwnPropertyDescriptor,fo=Object.getOwnPropertyDescriptors,To=Object.getOwnPropertyNames,ye=Object.getOwnPropertySymbols,yo=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable;var Wt=(t,e,r)=>e in t?pe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e||(e={}))qe.call(e,r)&&Wt(t,r,e[r]);if(ye)for(var r of ye(e))qt.call(e,r)&&Wt(t,r,e[r]);return t},b=(t,e)=>mo(t,fo(e));var jt=(t,e)=>{var r={};for(var n in t)qe.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&ye)for(var n of ye(t))e.indexOf(n)<0&&qt.call(t,n)&&(r[n]=t[n]);return r};var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var he=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),K=(t,e)=>{for(var r in e)pe(t,r,{get:e[r],enumerable:!0})},zt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of To(e))!qe.call(t,i)&&i!==r&&pe(t,i,{get:()=>e[i],enumerable:!(n=go(e,i))||n.enumerable});return t};var S=(t,e,r)=>(r=t!=null?uo(yo(t)):{},zt(e||!t||!t.__esModule?pe(r,"default",{value:t,enumerable:!0}):r,t)),ue=t=>zt(pe({},"__esModule",{value:!0}),t);var Kt=(t,e,r)=>new Promise((n,i)=>{var c=d=>{try{m(r.next(d))}catch(g){i(g)}},a=d=>{try{m(r.throw(d))}catch(g){i(g)}},m=d=>d.done?n(d.value):Promise.resolve(d.value).then(c,a);m((r=r.apply(t,e)).next())});var Xt=he(xe=>{"use strict";o();xe.byteLength=xo;xe.toByteArray=wo;xe.fromByteArray=vo;var _=[],C=[],ho=typeof Uint8Array!="undefined"?Uint8Array:Array,je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Y=0,Yt=je.length;Y<Yt;++Y)_[Y]=je[Y],C[je.charCodeAt(Y)]=Y;var Y,Yt;C["-".charCodeAt(0)]=62;C["_".charCodeAt(0)]=63;function Zt(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function xo(t){var e=Zt(t),r=e[0],n=e[1];return(r+n)*3/4-n}function So(t,e,r){return(e+r)*3/4-r}function wo(t){var e,r=Zt(t),n=r[0],i=r[1],c=new ho(So(t,n,i)),a=0,m=i>0?n-4:n,d;for(d=0;d<m;d+=4)e=C[t.charCodeAt(d)]<<18|C[t.charCodeAt(d+1)]<<12|C[t.charCodeAt(d+2)]<<6|C[t.charCodeAt(d+3)],c[a++]=e>>16&255,c[a++]=e>>8&255,c[a++]=e&255;return i===2&&(e=C[t.charCodeAt(d)]<<2|C[t.charCodeAt(d+1)]>>4,c[a++]=e&255),i===1&&(e=C[t.charCodeAt(d)]<<10|C[t.charCodeAt(d+1)]<<4|C[t.charCodeAt(d+2)]>>2,c[a++]=e>>8&255,c[a++]=e&255),c}function bo(t){return _[t>>18&63]+_[t>>12&63]+_[t>>6&63]+_[t&63]}function Ao(t,e,r){for(var n,i=[],c=e;c<r;c+=3)n=(t[c]<<16&16711680)+(t[c+1]<<8&65280)+(t[c+2]&255),i.push(bo(n));return i.join("")}function vo(t){for(var e,r=t.length,n=r%3,i=[],c=16383,a=0,m=r-n;a<m;a+=c)i.push(Ao(t,a,a+c>m?m:a+c));return n===1?(e=t[r-1],i.push(_[e>>2]+_[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(_[e>>10]+_[e>>4&63]+_[e<<2&63]+"=")),i.join("")}});var Jt=he(ze=>{o();ze.read=function(t,e,r,n,i){var c,a,m=i*8-n-1,d=(1<<m)-1,g=d>>1,h=-7,T=r?i-1:0,v=r?-1:1,k=t[e+T];for(T+=v,c=k&(1<<-h)-1,k>>=-h,h+=m;h>0;c=c*256+t[e+T],T+=v,h-=8);for(a=c&(1<<-h)-1,c>>=-h,h+=n;h>0;a=a*256+t[e+T],T+=v,h-=8);if(c===0)c=1-g;else{if(c===d)return a?NaN:(k?-1:1)*(1/0);a=a+Math.pow(2,n),c=c-g}return(k?-1:1)*a*Math.pow(2,c-n)};ze.write=function(t,e,r,n,i,c){var a,m,d,g=c*8-i-1,h=(1<<g)-1,T=h>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=n?0:c-1,F=n?1:-1,U=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+T>=1?e+=v/d:e+=v*Math.pow(2,1-T),e*d>=2&&(a++,d/=2),a+T>=h?(m=0,a=h):a+T>=1?(m=(e*d-1)*Math.pow(2,i),a=a+T):(m=e*Math.pow(2,T-1)*Math.pow(2,i),a=0));i>=8;t[r+k]=m&255,k+=F,m/=256,i-=8);for(a=a<<i|m,g+=i;g>0;t[r+k]=a&255,k+=F,a/=256,g-=8);t[r+k-F]|=U*128}});var ur=he(te=>{"use strict";o();var Ke=Xt(),ee=Jt(),Qt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;te.Buffer=u;te.SlowBuffer=No;te.INSPECT_MAX_BYTES=50;var Se=2147483647;te.kMaxLength=Se;u.TYPED_ARRAY_SUPPORT=Io();!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 Io(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(r){return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function V(t){if(t>Se)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Je(t)}return rr(t,e,r)}u.poolSize=8192;function rr(t,e,r){if(typeof t=="string")return Eo(t,e);if(ArrayBuffer.isView(t))return Do(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(M(t,ArrayBuffer)||t&&M(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(M(t,SharedArrayBuffer)||t&&M(t.buffer,SharedArrayBuffer)))return Ze(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return u.from(n,e,r);var i=Lo(t);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}u.from=function(t,e,r){return rr(t,e,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function nr(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function ko(t,e,r){return nr(t),t<=0?V(t):e!==void 0?typeof r=="string"?V(t).fill(e,r):V(t).fill(e):V(t)}u.alloc=function(t,e,r){return ko(t,e,r)};function Je(t){return nr(t),V(t<0?0:Qe(t)|0)}u.allocUnsafe=function(t){return Je(t)};u.allocUnsafeSlow=function(t){return Je(t)};function Eo(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=or(t,e)|0,n=V(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function Ye(t){for(var e=t.length<0?0:Qe(t.length)|0,r=V(e),n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Do(t){if(M(t,Uint8Array)){var e=new Uint8Array(t);return Ze(e.buffer,e.byteOffset,e.byteLength)}return Ye(t)}function Ze(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function Lo(t){if(u.isBuffer(t)){var e=Qe(t.length)|0,r=V(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||et(t.length)?V(0):Ye(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Ye(t.data)}function Qe(t){if(t>=Se)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Se.toString(16)+" bytes");return t|0}function No(t){return+t!=t&&(t=0),u.alloc(+t)}u.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==u.prototype};u.compare=function(e,r){if(M(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),M(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(e)||!u.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var n=e.length,i=r.length,c=0,a=Math.min(n,i);c<a;++c)if(e[c]!==r[c]){n=e[c],i=r[c];break}return n<i?-1:i<n?1:0};u.isEncoding=function(e){switch(String(e).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(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return u.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=u.allocUnsafe(r),c=0;for(n=0;n<e.length;++n){var a=e[n];if(M(a,Uint8Array))c+a.length>i.length?u.from(a).copy(i,c):Uint8Array.prototype.set.call(i,a,c);else if(u.isBuffer(a))a.copy(i,c);else throw new TypeError('"list" argument must be an Array of Buffers');c+=a.length}return i};function or(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||M(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Xe(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return pr(t).length;default:if(i)return n?-1:Xe(t).length;e=(""+e).toLowerCase(),i=!0}}u.byteLength=or;function Co(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return $o(this,e,r);case"utf8":case"utf-8":return ar(this,e,r);case"ascii":return Uo(this,e,r);case"latin1":case"binary":return Vo(this,e,r);case"base64":return Oo(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ho(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function Z(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}u.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)Z(this,r,r+1);return this};u.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)Z(this,r,r+3),Z(this,r+1,r+2);return this};u.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)Z(this,r,r+7),Z(this,r+1,r+6),Z(this,r+2,r+5),Z(this,r+3,r+4);return this};u.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?ar(this,0,e):Co.apply(this,arguments)};u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:u.compare(this,e)===0};u.prototype.inspect=function(){var e="",r=te.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Qt&&(u.prototype[Qt]=u.prototype.inspect);u.prototype.compare=function(e,r,n,i,c){if(M(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),c===void 0&&(c=this.length),r<0||n>e.length||i<0||c>this.length)throw new RangeError("out of range index");if(i>=c&&r>=n)return 0;if(i>=c)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,c>>>=0,this===e)return 0;for(var a=c-i,m=n-r,d=Math.min(a,m),g=this.slice(i,c),h=e.slice(r,n),T=0;T<d;++T)if(g[T]!==h[T]){a=g[T],m=h[T];break}return a<m?-1:m<a?1:0};function ir(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,et(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=u.from(e,n)),u.isBuffer(e))return e.length===0?-1:er(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):er(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function er(t,e,r,n,i){var c=1,a=t.length,m=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;c=2,a/=2,m/=2,r/=2}function d(k,F){return c===1?k[F]:k.readUInt16BE(F*c)}var g;if(i){var h=-1;for(g=r;g<a;g++)if(d(t,g)===d(e,h===-1?0:g-h)){if(h===-1&&(h=g),g-h+1===m)return h*c}else h!==-1&&(g-=g-h),h=-1}else for(r+m>a&&(r=a-m),g=r;g>=0;g--){for(var T=!0,v=0;v<m;v++)if(d(t,g+v)!==d(e,v)){T=!1;break}if(T)return g}return-1}u.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};u.prototype.indexOf=function(e,r,n){return ir(this,e,r,n,!0)};u.prototype.lastIndexOf=function(e,r,n){return ir(this,e,r,n,!1)};function Ro(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var c=e.length;n>c/2&&(n=c/2);for(var a=0;a<n;++a){var m=parseInt(e.substr(a*2,2),16);if(et(m))return a;t[r+a]=m}return a}function Po(t,e,r,n){return we(Xe(e,t.length-r),t,r,n)}function Fo(t,e,r,n){return we(qo(e),t,r,n)}function _o(t,e,r,n){return we(pr(e),t,r,n)}function Mo(t,e,r,n){return we(jo(e,t.length-r),t,r,n)}u.prototype.write=function(e,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 c=this.length-r;if((n===void 0||n>c)&&(n=c),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return Ro(this,e,r,n);case"utf8":case"utf-8":return Po(this,e,r,n);case"ascii":case"latin1":case"binary":return Fo(this,e,r,n);case"base64":return _o(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mo(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Oo(t,e,r){return e===0&&r===t.length?Ke.fromByteArray(t):Ke.fromByteArray(t.slice(e,r))}function ar(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var c=t[i],a=null,m=c>239?4:c>223?3:c>191?2:1;if(i+m<=r){var d,g,h,T;switch(m){case 1:c<128&&(a=c);break;case 2:d=t[i+1],(d&192)===128&&(T=(c&31)<<6|d&63,T>127&&(a=T));break;case 3:d=t[i+1],g=t[i+2],(d&192)===128&&(g&192)===128&&(T=(c&15)<<12|(d&63)<<6|g&63,T>2047&&(T<55296||T>57343)&&(a=T));break;case 4:d=t[i+1],g=t[i+2],h=t[i+3],(d&192)===128&&(g&192)===128&&(h&192)===128&&(T=(c&15)<<18|(d&63)<<12|(g&63)<<6|h&63,T>65535&&T<1114112&&(a=T))}}a===null?(a=65533,m=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=m}return Bo(n)}var tr=4096;function Bo(t){var e=t.length;if(e<=tr)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=tr));return r}function Uo(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function Vo(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function $o(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",c=e;c<r;++c)i+=zo[t[c]];return i}function Ho(t,e,r){for(var n=t.slice(e,r),i="",c=0;c<n.length-1;c+=2)i+=String.fromCharCode(n[c]+n[c+1]*256);return i}u.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i=this.subarray(e,r);return Object.setPrototypeOf(i,u.prototype),i};function I(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||I(e,r,this.length);for(var i=this[e],c=1,a=0;++a<r&&(c*=256);)i+=this[e+a]*c;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||I(e,r,this.length);for(var i=this[e+--r],c=1;r>0&&(c*=256);)i+=this[e+--r]*c;return i};u.prototype.readUint8=u.prototype.readUInt8=function(e,r){return e=e>>>0,r||I(e,1,this.length),this[e]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||I(e,2,this.length),this[e]|this[e+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||I(e,2,this.length),this[e]<<8|this[e+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||I(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};u.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||I(e,r,this.length);for(var i=this[e],c=1,a=0;++a<r&&(c*=256);)i+=this[e+a]*c;return c*=128,i>=c&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||I(e,r,this.length);for(var i=r,c=1,a=this[e+--i];i>0&&(c*=256);)a+=this[e+--i]*c;return c*=128,a>=c&&(a-=Math.pow(2,8*r)),a};u.prototype.readInt8=function(e,r){return e=e>>>0,r||I(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};u.prototype.readInt16LE=function(e,r){e=e>>>0,r||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(e,r){e=e>>>0,r||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(e,r){return e=e>>>0,r||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};u.prototype.readInt32BE=function(e,r){return e=e>>>0,r||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};u.prototype.readFloatLE=function(e,r){return e=e>>>0,r||I(e,4,this.length),ee.read(this,e,!0,23,4)};u.prototype.readFloatBE=function(e,r){return e=e>>>0,r||I(e,4,this.length),ee.read(this,e,!1,23,4)};u.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||I(e,8,this.length),ee.read(this,e,!0,52,8)};u.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||I(e,8,this.length),ee.read(this,e,!1,52,8)};function D(t,e,r,n,i,c){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<c)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){var c=Math.pow(2,8*n)-1;D(this,e,r,n,c,0)}var a=1,m=0;for(this[r]=e&255;++m<n&&(a*=256);)this[r+m]=e/a&255;return r+n};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){var c=Math.pow(2,8*n)-1;D(this,e,r,n,c,0)}var a=n-1,m=1;for(this[r+a]=e&255;--a>=0&&(m*=256);)this[r+a]=e/m&255;return r+n};u.prototype.writeUint8=u.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,1,255,0),this[r]=e&255,r+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};u.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){var c=Math.pow(2,8*n-1);D(this,e,r,n,c-1,-c)}var a=0,m=1,d=0;for(this[r]=e&255;++a<n&&(m*=256);)e<0&&d===0&&this[r+a-1]!==0&&(d=1),this[r+a]=(e/m>>0)-d&255;return r+n};u.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){var c=Math.pow(2,8*n-1);D(this,e,r,n,c-1,-c)}var a=n-1,m=1,d=0;for(this[r+a]=e&255;--a>=0&&(m*=256);)e<0&&d===0&&this[r+a+1]!==0&&(d=1),this[r+a]=(e/m>>0)-d&255;return r+n};u.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};u.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};u.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};u.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};u.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function sr(t,e,r,n,i,c){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function cr(t,e,r,n,i){return e=+e,r=r>>>0,i||sr(t,e,r,4,34028234663852886e22,-34028234663852886e22),ee.write(t,e,r,n,23,4),r+4}u.prototype.writeFloatLE=function(e,r,n){return cr(this,e,r,!0,n)};u.prototype.writeFloatBE=function(e,r,n){return cr(this,e,r,!1,n)};function lr(t,e,r,n,i){return e=+e,r=r>>>0,i||sr(t,e,r,8,17976931348623157e292,-17976931348623157e292),ee.write(t,e,r,n,52,8),r+8}u.prototype.writeDoubleLE=function(e,r,n){return lr(this,e,r,!0,n)};u.prototype.writeDoubleBE=function(e,r,n){return lr(this,e,r,!1,n)};u.prototype.copy=function(e,r,n,i){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.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),e.length-r<i-n&&(i=e.length-r+n);var c=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),c};u.prototype.fill=function(e,r,n,i){if(typeof e=="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(e.length===1){var c=e.charCodeAt(0);(i==="utf8"&&c<128||i==="latin1")&&(e=c)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));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,e||(e=0);var a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var m=u.isBuffer(e)?e:u.from(e,i),d=m.length;if(d===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<n-r;++a)this[a+r]=m[a%d]}return this};var Go=/[^+/0-9A-Za-z-_]/g;function Wo(t){if(t=t.split("=")[0],t=t.trim().replace(Go,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Xe(t,e){e=e||1/0;for(var r,n=t.length,i=null,c=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&c.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&c.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&c.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&c.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;c.push(r)}else if(r<2048){if((e-=2)<0)break;c.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;c.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;c.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return c}function qo(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function jo(t,e){for(var r,n,i,c=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,c.push(i),c.push(n);return c}function pr(t){return Ke.toByteArray(Wo(t))}function we(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function M(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function et(t){return t!==t}var zo=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=r*16,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()});var Tr=he((Aa,fr)=>{o();var w=fr.exports={},O,B;function tt(){throw new Error("setTimeout has not been defined")}function rt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?O=setTimeout:O=tt}catch(t){O=tt}try{typeof clearTimeout=="function"?B=clearTimeout:B=rt}catch(t){B=rt}})();function dr(t){if(O===setTimeout)return setTimeout(t,0);if((O===tt||!O)&&setTimeout)return O=setTimeout,setTimeout(t,0);try{return O(t,0)}catch(e){try{return O.call(null,t,0)}catch(r){return O.call(this,t,0)}}}function Ko(t){if(B===clearTimeout)return clearTimeout(t);if((B===rt||!B)&&clearTimeout)return B=clearTimeout,clearTimeout(t);try{return B(t)}catch(e){try{return B.call(null,t)}catch(r){return B.call(this,t)}}}var $=[],re=!1,X,be=-1;function Yo(){!re||!X||(re=!1,X.length?$=X.concat($):be=-1,$.length&&mr())}function mr(){if(!re){var t=dr(Yo);re=!0;for(var e=$.length;e;){for(X=$,$=[];++be<e;)X&&X[be].run();be=-1,e=$.length}X=null,re=!1,Ko(t)}}w.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];$.push(new gr(t,e)),$.length===1&&!re&&dr(mr)};function gr(t,e){this.fun=t,this.array=e}gr.prototype.run=function(){this.fun.apply(null,this.array)};w.title="browser";w.browser=!0;w.env={};w.argv=[];w.version="";w.versions={};function H(){}w.on=H;w.addListener=H;w.once=H;w.off=H;w.removeListener=H;w.removeAllListeners=H;w.emit=H;w.prependListener=H;w.prependOnceListener=H;w.listeners=function(t){return[]};w.binding=function(t){throw new Error("process.binding is not supported")};w.cwd=function(){return"/"};w.chdir=function(t){throw new Error("process.chdir is not supported")};w.umask=function(){return 0}});var s,l,va,o=y(()=>{s=S(ur()),l=S(Tr()),va=function(t){function e(){var n=this||self;return delete t.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return e();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:e});var r=__magic__;return r}(Object)});var Ae,it=y(()=>{"use strict";o();Ae=()=>Date.now()/1e3});var yr=y(()=>{"use strict";o()});var hr=y(()=>{"use strict";o()});var xr=y(()=>{"use strict";o();it();yr();hr()});var st={};K(st,{getItem:()=>Xo,localStorageKeys:()=>J,removeItem:()=>Jo,setItem:()=>Zo});var J,at,Zo,Xo,Jo,de=y(()=>{"use strict";o();xr();J={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},at=typeof localStorage!="undefined",Zo=({key:t,data:e,expires:r})=>{!at||localStorage.setItem(String(t),JSON.stringify({expires:r,data:e}))},Xo=t=>{if(!at)return;let e=localStorage.getItem(String(t));if(!e)return null;let r=JSON.parse(e);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Ae()>=r.expires?(localStorage.removeItem(String(t)),null):r.data},Jo=t=>{!at||localStorage.removeItem(String(t))}});var ct={};K(ct,{clear:()=>Ar,getItem:()=>wr,removeItem:()=>br,setItem:()=>Sr,storage:()=>Qo});var Sr,wr,br,Ar,Qo,vr=y(()=>{"use strict";o();Sr=({key:t,data:e,expires:r})=>{sessionStorage.setItem(String(t),JSON.stringify({expires:r,data:e}))},wr=t=>{let e=sessionStorage.getItem(String(t));if(!e)return null;let r=JSON.parse(e);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Date.now()>=r.expires?(sessionStorage.removeItem(String(t)),null):r.data},br=t=>sessionStorage.removeItem(String(t)),Ar=()=>sessionStorage.clear(),Qo={setItem:Sr,getItem:wr,removeItem:br,clear:Ar}});var ne,ve=y(()=>{"use strict";o();de();vr();ne={session:ct,local:st}});function me(){return new Date().setHours(new Date().getHours()+24)}function ge(t){ne.local.setItem({key:J.loginExpiresAt,data:t,expires:t})}var lt=y(()=>{"use strict";o();ve();de()});var P=y(()=>{"use strict";o()});var Ir=y(()=>{"use strict";o()});var kr=y(()=>{"use strict";o()});var E=y(()=>{"use strict";o()});var Er=y(()=>{"use strict";o()});var Dr=y(()=>{"use strict";o()});var Lr=y(()=>{"use strict";o()});var Nr=y(()=>{"use strict";o()});var W=y(()=>{"use strict";o();kr();E();P();Er();Dr();Lr();Nr()});var pt,Cr,Qa,Rr,es,Pr,ts,rs,ns,Fr=y(()=>{"use strict";o();W();pt={devnet:{id:"devnet",chainId:"D",name:"Devnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://devnet-wallet.elrond.com",apiAddress:"https://devnet-api.elrond.com",explorerAddress:"http://devnet-explorer.elrond.com",apiTimeout:"4000"},testnet:{id:"testnet",chainId:"T",name:"Testnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://testnet-wallet.elrond.com",apiAddress:"https://testnet-api.elrond.com",explorerAddress:"http://testnet-explorer.elrond.com",apiTimeout:"4000"},mainnet:{id:"mainnet",chainId:"1",name:"Mainnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://wallet.elrond.com",apiAddress:"https://api.elrond.com",explorerAddress:"https://explorer.elrond.com",apiTimeout:"4000"}},{chainId:Cr,egldLabel:Qa}=pt["devnet"],{chainId:Rr,egldLabel:es}=pt["testnet"],{chainId:Pr,egldLabel:ts}=pt["mainnet"],rs={["devnet"]:Cr,["testnet"]:Rr,["mainnet"]:Pr},ns={[Cr]:"devnet",[Rr]:"testnet",[Pr]:"mainnet"}});var ut=y(()=>{"use strict";o()});var _r=y(()=>{"use strict";o()});var Mr,dt=y(()=>{"use strict";o();Mr="transaction-status-toast-id"});var mt,gt,Or,Ie,Br,oe,A=y(()=>{"use strict";o();Ir();Fr();ut();_r();dt();mt=5e4,gt=1e9,Or=1,Ie="logout",Br="login",oe="0"});var ft,L,ke,q=y(()=>{"use strict";o();ft=require("@reduxjs/toolkit");A();L=(0,ft.createAction)(Ie),ke=(0,ft.createAction)(Br,t=>({payload:t}))});var Vr,Ur,$r,ws,bs,As,vs,Is,ks,Hr,Gr,Tt=y(()=>{"use strict";o();Vr=require("@reduxjs/toolkit");lt();P();q();Ur={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},$r=(0,Vr.createSlice)({name:"loginInfoSlice",initialState:Ur,reducers:{setLoginMethod:(t,e)=>{t.loginMethod=e.payload},setTokenLogin:(t,e)=>{t.tokenLogin=e.payload},setTokenLoginSignature:(t,e)=>{(t==null?void 0:t.tokenLogin)!=null&&(t.tokenLogin.signature=e.payload)},setWalletLogin:(t,e)=>{t.walletLogin=e.payload},setWalletConnectLogin:(t,e)=>{t.walletConnectLogin=e.payload},setLedgerLogin:(t,e)=>{t.ledgerLogin=e.payload},invalidateLoginSession:t=>{t.isLoginSessionInvalid=!0}},extraReducers:t=>{t.addCase(L,()=>Ur),t.addCase(ke,(e,r)=>{e.loginMethod=r.payload.loginMethod,ge(me())})}}),{setLoginMethod:ws,setWalletConnectLogin:bs,setLedgerLogin:As,setTokenLogin:vs,setTokenLoginSignature:Is,setWalletLogin:ks,invalidateLoginSession:Hr}=$r.actions,Gr=$r.reducer});var Wr=y(()=>{"use strict";o()});var qr=y(()=>{"use strict";o();Wr()});function yt(t){return t[Math.floor(Math.random()*t.length)]}var jr=y(()=>{"use strict";o()});var zr=y(()=>{"use strict";o();ut()});var Kr=y(()=>{"use strict";o();qr();jr();zr()});var Yr,Zr,ht,ti,Xr,Hs,Gs,Jr,xt=y(()=>{"use strict";o();Yr=require("@reduxjs/toolkit"),Zr=S(require("lodash.omit"));Kr();ht={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},ti={network:ht,chainID:"-1"},Xr=(0,Yr.createSlice)({name:"appConfig",initialState:ti,reducers:{initializeNetworkConfig:(t,e)=>{let r=yt(e.payload.walletConnectBridgeAddresses),n=yt(e.payload.walletConnectV2RelayAddresses),i=(0,Zr.default)(e.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");t.network=b(x(x({},t.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:n})},setChainID:(t,e)=>{t.chainID=e.payload}}}),{initializeNetworkConfig:Hs,setChainID:Gs}=Xr.actions,Jr=Xr.reducer});var wt,Qr,en,Ee,St,tn,rn,Xs,nn,Js,Qs,ec,tc,rc,nc,oc,on,bt=y(()=>{"use strict";o();wt=require("@elrondnetwork/erdjs"),Qr=require("@reduxjs/toolkit"),en=require("redux-persist");A();ve();de();q();Ee={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:oe},St={address:"",websocketEvent:null,accounts:{"":Ee},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},tn=(0,Qr.createSlice)({name:"accountInfoSlice",initialState:St,reducers:{setAddress:(t,e)=>{let r=e.payload;t.address=r,t.publicKey=new wt.Address(r).hex()},setAccount:(t,e)=>{let r=t.address===e.payload.address;t.accounts={[t.address]:r?e.payload:Ee},t.isAccountLoading=!1,t.accountLoadingError=null},setAccountNonce:(t,e)=>{let{address:r}=t;t.accounts[r].nonce=e.payload},setAccountShard:(t,e)=>{t.shard=e.payload},setLedgerAccount:(t,e)=>{t.ledgerAccount=e.payload},updateLedgerAccount:(t,e)=>{t.ledgerAccount!=null&&(t.ledgerAccount.index=e.payload.index,t.ledgerAccount.address=e.payload.address)},setWalletConnectAccount:(t,e)=>{t.walletConnectAccount=e.payload},setIsAccountLoading:(t,e)=>{t.isAccountLoading=e.payload,t.accountLoadingError=null},setAccountLoadingError:(t,e)=>{t.accountLoadingError=e.payload,t.isAccountLoading=!1},setWebsocketEvent:(t,e)=>{t.websocketEvent={timestamp:Date.now(),message:e.payload}}},extraReducers:t=>{t.addCase(L,()=>(ne.local.removeItem(J.loginExpiresAt),St)),t.addCase(ke,(e,r)=>{let{address:n}=r.payload;e.address=n,e.publicKey=new wt.Address(n).hex()}),t.addCase(en.REHYDRATE,(e,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:i,shard:c,accounts:a,publicKey:m}=n;e.address=i,e.shard=c;let d=a&&i in a;e.accounts=d?a:St.accounts,e.publicKey=m})}}),{setAccount:rn,setAddress:Xs,setAccountNonce:nn,setAccountShard:Js,setLedgerAccount:Qs,updateLedgerAccount:ec,setWalletConnectAccount:tc,setIsAccountLoading:rc,setAccountLoadingError:nc,setWebsocketEvent:oc}=tn.actions,on=tn.reducer});function an(t){return t!=null&&(pi(t)||gi(t))}function De(t){return t!=null&&(ui(t)||fi(t))}function Le(t){return t!=null&&(di(t)||Ti(t))}function sn(t){return t!=null&&mi(t)}function pi(t){return t!=null&&ni.includes(t)}function ui(t){return t!=null&&oi.includes(t)}function di(t){return t!=null&&ii.includes(t)}function mi(t){return t!=null&&ai.includes(t)}function gi(t){return t!=null&&si.includes(t)}function fi(t){return t!=null&&ci.includes(t)}function Ti(t){return t!=null&&li.includes(t)}var ni,oi,ii,ai,si,ci,li,vt=y(()=>{"use strict";o();P();ni=["sent"],oi=["success"],ii=["fail","cancelled","timedOut"],ai=["timedOut"],si=["pending"],ci=["success"],li=["fail","invalid"]});var cn,ln,fe,yi,pn,mc,gc,fc,Tc,yc,hc,xc,Sc,wc,bc,Ne,Ce=y(()=>{"use strict";o();cn=require("@reduxjs/toolkit"),ln=require("redux-persist");P();vt();q();fe={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},yi={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},pn=(0,cn.createSlice)({name:"transactionsSlice",initialState:fe,reducers:{moveTransactionsToSignedState:(t,e)=>{var d,g;let{sessionId:r,transactions:n,errorMessage:i,status:c,redirectRoute:a}=e.payload,m=((d=t.customTransactionInformationForSessionId)==null?void 0:d[r])||yi;t.signedTransactions[r]={transactions:n,status:c,errorMessage:i,redirectRoute:a,customTransactionInformation:m},((g=t==null?void 0:t.transactionsToSign)==null?void 0:g.sessionId)===r&&(t.transactionsToSign=fe.transactionsToSign)},clearSignedTransaction:(t,e)=>{t.signedTransactions[e.payload]&&delete t.signedTransactions[e.payload]},clearTransactionToSign:t=>{t!=null&&t.transactionsToSign&&(t.transactionsToSign=null)},updateSignedTransaction:(t,e)=>{t.signedTransactions=x(x({},t.signedTransactions),e.payload)},updateSignedTransactions:(t,e)=>{let{sessionId:r,status:n,errorMessage:i,transactions:c}=e.payload;t.signedTransactions[r]!=null&&(t.signedTransactions[r].status=n,i!=null&&(t.signedTransactions[r].errorMessage=i),c!=null&&(t.signedTransactions[r].transactions=c))},updateSignedTransactionStatus:(t,e)=>{var m,d,g,h,T,v;let{sessionId:r,status:n,errorMessage:i,transactionHash:c}=e.payload,a=(d=(m=t.signedTransactions)==null?void 0:m[r])==null?void 0:d.transactions;if(a!=null){t.signedTransactions[r].transactions=a.map(U=>U.hash===c?b(x({},U),{status:n,errorMessage:i}):U);let k=(h=(g=t.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:h.every(U=>De(U.status)),F=(v=(T=t.signedTransactions[r])==null?void 0:T.transactions)==null?void 0:v.every(U=>Le(U.status));k&&(t.signedTransactions[r].status="success"),F&&(t.signedTransactions[r].status="fail")}},setTransactionsToSign:(t,e)=>{t.transactionsToSign=e.payload;let{sessionId:r,customTransactionInformation:n}=e.payload;t.customTransactionInformationForSessionId[r]=n,t.signTransactionsError=null},clearAllTransactionsToSign:t=>{t.transactionsToSign=fe.transactionsToSign,t.signTransactionsError=null},clearAllSignedTransactions:t=>{t.signedTransactions=fe.signedTransactions},setSignTransactionsError:(t,e)=>{t.signTransactionsError=e.payload},setSignTransactionsCancelMessage:(t,e)=>{t.signTransactionsCancelMessage=e.payload}},extraReducers:t=>{t.addCase(L,()=>fe),t.addCase(ln.REHYDRATE,(e,r)=>{var a;if(e.signTransactionsCancelMessage=null,!((a=r.payload)!=null&&a.transactions))return;let{signedTransactions:n,customTransactionInformationForSessionId:i}=r.payload.transactions,c=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&&(e.customTransactionInformationForSessionId=i),n!=null&&(e.signedTransactions=c)})}}),{updateSignedTransactionStatus:mc,updateSignedTransactions:gc,setTransactionsToSign:fc,clearAllTransactionsToSign:Tc,clearAllSignedTransactions:yc,clearSignedTransaction:hc,clearTransactionToSign:xc,setSignTransactionsError:Sc,setSignTransactionsCancelMessage:wc,moveTransactionsToSignedState:bc}=pn.actions,Ne=pn.reducer});var un,kt,Et,Dt,hi,It,dn,kc,Ec,Dc,Re,Pe=y(()=>{"use strict";o();un=require("@reduxjs/toolkit");q();kt="Transaction failed",Et="Transaction successful",Dt="Processing transaction",hi="Transaction submitted",It={},dn=(0,un.createSlice)({name:"transactionsInfo",initialState:It,reducers:{setTransactionsDisplayInfo(t,e){let{sessionId:r,transactionsDisplayInfo:n}=e.payload;r!=null&&(t[r]={errorMessage:(n==null?void 0:n.errorMessage)||kt,successMessage:(n==null?void 0:n.successMessage)||Et,processingMessage:(n==null?void 0:n.processingMessage)||Dt,submittedMessage:(n==null?void 0:n.submittedMessage)||hi,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(t,e){e.payload!=null&&delete t[e.payload]},clearTransactionsInfo:()=>It},extraReducers:t=>{t.addCase(L,()=>It)}}),{clearTransactionsInfo:kc,setTransactionsDisplayInfo:Ec,clearTransactionsInfoForSessionId:Dc}=dn.actions,Re=dn.reducer});var gn,mn,fn,Rc,Pc,Fc,_c,Tn,Lt=y(()=>{"use strict";o();gn=require("@reduxjs/toolkit");q();mn={},fn=(0,gn.createSlice)({name:"modalsSlice",initialState:mn,reducers:{setTxSubmittedModal:(t,e)=>{t.txSubmittedModal=e.payload},setNotificationModal:(t,e)=>{t.notificationModal=e.payload},clearTxSubmittedModal:t=>{t.txSubmittedModal=void 0},clearNotificationModal:t=>{t.notificationModal=void 0}},extraReducers:t=>{t.addCase(L,()=>mn)}}),{setTxSubmittedModal:Rc,setNotificationModal:Pc,clearTxSubmittedModal:Fc,clearNotificationModal:_c}=fn.actions,Tn=fn.reducer});var hn,xn,yn,Sn,Gc,Wc,qc,jc,zc,Kc,Fe,_e=y(()=>{"use strict";o();hn=require("@reduxjs/toolkit"),xn=require("redux-persist");dt();W();it();q();yn={customToasts:[],transactionToasts:[],failTransactionToast:null},Sn=(0,hn.createSlice)({name:"toastsSlice",initialState:yn,reducers:{addCustomToast:(t,e)=>{t.customToasts.push(b(x({},e.payload),{type:"custom",toastId:e.payload.toastId||`custom-toast-${t.customToasts.length+1}`}))},removeCustomToast:(t,e)=>{t.customToasts=t.customToasts.filter(r=>r.toastId!==e.payload)},addTransactionToast:(t,e)=>{t.transactionToasts.push({type:"transaction",startTimestamp:Ae(),toastId:e.payload||`custom-toast-${t.transactionToasts.length+1}`})},removeTransactionToast:(t,e)=>{t.transactionToasts=t.transactionToasts.filter(r=>r.toastId!==e.payload)},addFailTransactionToast:(t,e)=>{t.failTransactionToast=b(x({},e.payload),{toastId:Mr})},removeFailTransactionToast:t=>{t.failTransactionToast=null}},extraReducers:t=>{t.addCase(L,()=>yn),t.addCase(xn.REHYDRATE,(e,r)=>{var i,c;let n=(c=(i=r.customToasts)==null?void 0:i.filter(a=>!("component"in a)))!=null?c:[];e.customToasts=n})}}),{addCustomToast:Gc,removeCustomToast:Wc,addTransactionToast:qc,removeTransactionToast:jc,addFailTransactionToast:zc,removeFailTransactionToast:Kc}=Sn.actions,Fe=Sn.reducer});var ie=y(()=>{"use strict";o();Tt();xt();bt();Ce();Pe();Lt();_e()});var Nt=y(()=>{"use strict";o()});var vn,An,In,gl,fl,Tl,yl,hl,xl,kn,En=y(()=>{"use strict";o();vn=require("@reduxjs/toolkit");q();An={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},In=(0,vn.createSlice)({name:"dappModalsSlice",initialState:An,reducers:{setDappModalVisibility:(t,e)=>{t.visible=e.payload},setDappModalHeaderVisibility:(t,e)=>{t.modal.showHeader=e.payload},setDappModalFooterVisibility:(t,e)=>{t.modal.showFooter=e.payload},setDappModalHeaderText:(t,e)=>{t.modal.headerText=e.payload},setDappModalFooterText:(t,e)=>{t.modal.footerText=e.payload},setDappModalConfig:(t,e)=>{t.modal=x({},e.payload)}},extraReducers:t=>{t.addCase(L,()=>An)}}),{setDappModalVisibility:gl,setDappModalHeaderVisibility:fl,setDappModalFooterVisibility:Tl,setDappModalHeaderText:yl,setDappModalFooterText:hl,setDappModalConfig:xl}=In.actions,kn=In.reducer});var Dn,bi,Ai,ae,Oe=y(()=>{"use strict";o();Dn=require("@reduxjs/toolkit");Nt();bt();En();Tt();Lt();xt();_e();Pe();Ce();bi={["account"]:on,["networkConfig"]:Jr,["loginInfo"]:Gr,["modals"]:Tn,["dappModal"]:kn,["toasts"]:Fe,["transactions"]:Ne,["transactionsInfo"]:Re},Ai=(t={})=>(0,Dn.combineReducers)(x(x({},bi),t)),ae=Ai});var Cn={};K(Cn,{default:()=>Ni});function Ct(t,e=[]){return{key:t,version:1,storage:Nn.default,blacklist:e}}var Q,Ln,Nn,vi,Ii,ki,Ei,Di,Li,Ni,Rn=y(()=>{"use strict";o();Q=require("redux-persist"),Ln=S(require("redux-persist/lib/storage")),Nn=S(require("redux-persist/lib/storage/session"));Oe();ie();_e();Pe();Ce();Nt();vi={2:t=>b(x({},t),{networkConfig:ht})};Ii=Ct("dapp-core-transactionsInfo"),ki=Ct("dapp-core-transactions",["transactionsToSign"]),Ei=Ct("dapp-core-toasts"),Di={key:"dapp-core-store",version:2,storage:Ln.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,Q.createMigrate)(vi,{debug:!1})},Li={["toasts"]:(0,Q.persistReducer)(Ei,Fe),["transactions"]:(0,Q.persistReducer)(ki,Ne),["transactionsInfo"]:(0,Q.persistReducer)(Ii,Re)},Ni=(0,Q.persistReducer)(Di,ae(Li))});var Pn={};K(Pn,{default:()=>Ci});var Ci,Fn=y(()=>{"use strict";o();Oe();Ci=ae()});var _n={};K(_n,{default:()=>Pi});var R,Ri,Pi,Mn=y(()=>{"use strict";o();R=require("redux-persist"),Ri=[R.FLUSH,R.REHYDRATE,R.PAUSE,R.PERSIST,R.PURGE,R.REGISTER],Pi=Ri});var Un={};K(Un,{default:()=>Bn});function Bn(t){return(0,On.persistStore)(t)}var On,Vn=y(()=>{"use strict";o();On=require("redux-persist")});var ha={};K(ha,{useGetTokenDetails:()=>ya});module.exports=ue(ha);o();var lo=S(require("axios")),po=S(require("swr"));o();var nt="tokens";var ot="collections";o();o();var jn=require("react"),ce=require("react-redux");o();var Rt=require("@reduxjs/toolkit"),Wn=require("react-redux/es/utils/Subscription");ie();o();var wn=S(require("lodash.throttle"));A();ie();lt();ve();de();var xi=[Ie],Si=(0,wn.default)(()=>{ge(me())},5e3),bn=t=>e=>r=>{var d;if(xi.includes(r.type))return e(r);let n=t.getState(),i=ne.local.getItem(J.loginExpiresAt);if(!((d=n==null?void 0:n.loginInfo)==null?void 0:d.isLoggedIn))return e(r);if(i==null)return ge(me());let a=Date.now();return i-a<0?setTimeout(()=>Kt(void 0,null,function*(){console.log("session expired");try{t.dispatch(Hr())}catch(g){console.error("error logging out",g)}}),1e3):(Si(),e(r))};o();o();function Me(){return typeof sessionStorage!="undefined"}var $n=Me()?(Rn(),ue(Cn)).default:(Fn(),ue(Pn)).default,Hn=Me()?(Mn(),ue(_n)).default:[],Gn=Me()?(Vn(),ue(Un)).default:t=>t;Oe();var se=(0,Rt.configureStore)({reducer:$n,middleware:t=>t({serializableCheck:{ignoredActions:[...Hn,nn.type,rn.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(bn)}),qn=(0,Wn.createSubscription)(se),Wl=Gn(se),ql=(0,Rt.configureStore)({reducer:ae});var Fi={store:se,subscription:qn},Pt=(0,jn.createContext)(Fi),Yl=(0,ce.createStoreHook)(Pt),Zl=(0,ce.createDispatchHook)(Pt),zn=(0,ce.createSelectorHook)(Pt);o();o();ie();o();var Kn=S(require("lodash.isequal")),Be=require("reselect"),f=(0,Be.createSelectorCreator)(Be.defaultMemoize,Kn.default);var G=t=>t.account,Ft=f(G,t=>t.address),_t=f(G,Ft,(t,e)=>e in t.accounts?t.accounts[e]:Ee),tp=f(G,_t,(t,e)=>{let i=t,{accounts:r}=i,n=jt(i,["accounts"]);return b(x({},n),{account:e})}),rp=f(_t,t=>t.balance),np=f(_t,t=>{var e;return((e=t==null?void 0:t.nonce)==null?void 0:e.valueOf())||0}),op=f(G,t=>t.shard),ip=f(G,t=>t.ledgerAccount),ap=f(G,t=>t.walletConnectAccount),sp=f(G,t=>t.isAccountLoading),cp=f(G,t=>t.accountLoadingError),lp=f(G,t=>t.websocketEvent);o();var j=t=>t.networkConfig,dp=f(j,t=>t.chainID),mp=f(j,t=>t.network.walletConnectBridgeAddress),gp=f(j,t=>t.network.walletConnectV2RelayAddress),fp=f(j,t=>t.network.walletConnectV2ProjectId),Tp=f(j,t=>t.network.walletConnectDeepLink),Mt=f(j,t=>t.network),yp=f(Mt,t=>t.apiAddress),Yn=f(Mt,t=>t.explorerAddress),hp=f(Mt,t=>t.egldLabel);o();P();var le=t=>t.loginInfo,Ap=f(le,t=>t.loginMethod),vp=f(le,Ft,(t,e)=>t.loginMethod!=""&&Boolean(e)),Ip=f(le,t=>t.walletConnectLogin),kp=f(le,t=>t.ledgerLogin),Ep=f(le,t=>t.walletLogin),Dp=f(le,t=>t.isLoginSessionInvalid);o();o();var N=require("@elrondnetwork/erdjs");A();o();function Ot(t){try{return s.Buffer.from(t,"base64").toString()===atob(t)}catch(e){return!1}}function Bt(t){var i,c,a;let{data:e}=t,r=Ot(e!=null?e:"")?N.TransactionPayload.fromEncoded(e):new N.TransactionPayload(e),n=new N.Transaction(x({value:t.value.valueOf(),data:r,nonce:t.nonce.valueOf(),receiver:new N.Address(t.receiver),sender:new N.Address(t.sender),gasLimit:(i=t.gasLimit.valueOf())!=null?i:mt,gasPrice:(c=t.gasPrice.valueOf())!=null?c:gt,chainID:t.chainID.valueOf(),version:new N.TransactionVersion((a=t.version)!=null?a:Or)},t.options?{options:new N.TransactionOptions(t.options)}:{}));return n.applySignature({hex:()=>t.signature||""},new N.Address(t.sender)),n}o();vt();o();var Mi=S(require("bignumber.js"));W();o();o();o();o();var Bi=require("@elrondnetwork/erdjs"),Ui=S(require("bignumber.js"));P();o();var Oi=require("@elrondnetwork/erdjs");o();o();o();var $i=require("@elrondnetwork/erdjs/out");o();A();o();var Qn=require("@elrondnetwork/erdjs");W();o();o();o();o();P();o();o();o();o();o();o();o();o();o();o();E();o();o();E();o();o();o();var zi=S(require("bignumber.js"));A();o();var ji=require("@elrondnetwork/erdjs"),Ut=S(require("bignumber.js"));A();o();var Wi=S(require("bignumber.js"));o();Ut.default.config({ROUNDING_MODE:Ut.default.ROUND_FLOOR});o();o();o();A();o();o();o();o();A();o();A();o();var Ki=require("@elrondnetwork/erdjs");A();o();var $e=require("@elrondnetwork/erdjs"),Zi=require("@elrondnetwork/erdjs"),Xi=require("@elrondnetwork/erdjs-network-providers");A();o();o();var Yi=S(require("bignumber.js"));A();o();A();o();var Vt={isEsdt:!1,isNft:!1,isEgld:!1};function $t(t){let e=t==null?void 0:t.split("-").length;return e===2?b(x({},Vt),{isEsdt:!0}):e===3?b(x({},Vt),{isNft:!0}):b(x({},Vt),{isEgld:!0})}o();o();o();o();A();o();E();var Qi=["reDelegateRewards","claimRewards","unBond"],ea=["wrapEgld","unwrapEgld"],ta=["unStake"],ra=["unDelegate"];o();o();o();A();o();var ia=S(require("bignumber.js"));o();o();o();E();o();var aa=S(require("bignumber.js"));o();o();o();o();E();o();o();o();var ca=S(require("anchorme"));o();A();o();var la=S(require("bignumber.js"));o();W();o();o();P();o();P();o();o();o();E();o();E();o();var pa=S(require("bignumber.js"));A();E();o();E();o();var oo=require("react");W();o();o();E();o();var ua=require("@elrondnetwork/erdjs/out"),da=S(require("bignumber.js"));E();o();E();o();o();P();var tT=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"