@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
196 lines (174 loc) • 163 kB
JavaScript
"use strict";var Xr=Object.create;var Ae=Object.defineProperty,Yr=Object.defineProperties,Zr=Object.getOwnPropertyDescriptor,Jr=Object.getOwnPropertyDescriptors,Qr=Object.getOwnPropertyNames,He=Object.getOwnPropertySymbols,ea=Object.getPrototypeOf,bo=Object.prototype.hasOwnProperty,bn=Object.prototype.propertyIsEnumerable;var xn=(e,o,n)=>o in e?Ae(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,y=(e,o)=>{for(var n in o||(o={}))bo.call(o,n)&&xn(e,n,o[n]);if(He)for(var n of He(o))bn.call(o,n)&&xn(e,n,o[n]);return e},k=(e,o)=>Yr(e,Jr(o));var ze=(e,o)=>{var n={};for(var r in e)bo.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&He)for(var r of He(e))o.indexOf(r)<0&&bn.call(e,r)&&(n[r]=e[r]);return n};var b=(e,o)=>()=>(e&&(o=e(e=0)),o);var je=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),pe=(e,o)=>{for(var n in o)Ae(e,n,{get:o[n],enumerable:!0})},yn=(e,o,n,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of Qr(o))!bo.call(e,a)&&a!==n&&Ae(e,a,{get:()=>o[a],enumerable:!(r=Zr(o,a))||r.enumerable});return e};var w=(e,o,n)=>(n=e!=null?Xr(ea(e)):{},yn(o||!e||!e.__esModule?Ae(n,"default",{value:e,enumerable:!0}):n,e)),Ie=e=>yn(Ae({},"__esModule",{value:!0}),e);var L=(e,o,n)=>new Promise((r,a)=>{var m=d=>{try{u(n.next(d))}catch(l){a(l)}},s=d=>{try{u(n.throw(d))}catch(l){a(l)}},u=d=>d.done?r(d.value):Promise.resolve(d.value).then(m,s);u((n=n.apply(e,o)).next())});var Sn=je(Ge=>{"use strict";t();Ge.byteLength=na;Ge.toByteArray=ra;Ge.fromByteArray=pa;var H=[],U=[],oa=typeof Uint8Array!="undefined"?Uint8Array:Array,yo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ce=0,Tn=yo.length;ce<Tn;++ce)H[ce]=yo[ce],U[yo.charCodeAt(ce)]=ce;var ce,Tn;U["-".charCodeAt(0)]=62;U["_".charCodeAt(0)]=63;function wn(e){var o=e.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=o);var r=n===o?0:4-n%4;return[n,r]}function na(e){var o=wn(e),n=o[0],r=o[1];return(n+r)*3/4-r}function ta(e,o,n){return(o+n)*3/4-n}function ra(e){var o,n=wn(e),r=n[0],a=n[1],m=new oa(ta(e,r,a)),s=0,u=a>0?r-4:r,d;for(d=0;d<u;d+=4)o=U[e.charCodeAt(d)]<<18|U[e.charCodeAt(d+1)]<<12|U[e.charCodeAt(d+2)]<<6|U[e.charCodeAt(d+3)],m[s++]=o>>16&255,m[s++]=o>>8&255,m[s++]=o&255;return a===2&&(o=U[e.charCodeAt(d)]<<2|U[e.charCodeAt(d+1)]>>4,m[s++]=o&255),a===1&&(o=U[e.charCodeAt(d)]<<10|U[e.charCodeAt(d+1)]<<4|U[e.charCodeAt(d+2)]>>2,m[s++]=o>>8&255,m[s++]=o&255),m}function aa(e){return H[e>>18&63]+H[e>>12&63]+H[e>>6&63]+H[e&63]}function ia(e,o,n){for(var r,a=[],m=o;m<n;m+=3)r=(e[m]<<16&16711680)+(e[m+1]<<8&65280)+(e[m+2]&255),a.push(aa(r));return a.join("")}function pa(e){for(var o,n=e.length,r=n%3,a=[],m=16383,s=0,u=n-r;s<u;s+=m)a.push(ia(e,s,s+m>u?u:s+m));return r===1?(o=e[n-1],a.push(H[o>>2]+H[o<<4&63]+"==")):r===2&&(o=(e[n-2]<<8)+e[n-1],a.push(H[o>>10]+H[o>>4&63]+H[o<<2&63]+"=")),a.join("")}});var vn=je(To=>{t();To.read=function(e,o,n,r,a){var m,s,u=a*8-r-1,d=(1<<u)-1,l=d>>1,x=-7,f=n?a-1:0,T=n?-1:1,v=e[o+f];for(f+=T,m=v&(1<<-x)-1,v>>=-x,x+=u;x>0;m=m*256+e[o+f],f+=T,x-=8);for(s=m&(1<<-x)-1,m>>=-x,x+=r;x>0;s=s*256+e[o+f],f+=T,x-=8);if(m===0)m=1-l;else{if(m===d)return s?NaN:(v?-1:1)*(1/0);s=s+Math.pow(2,r),m=m-l}return(v?-1:1)*s*Math.pow(2,m-r)};To.write=function(e,o,n,r,a,m){var s,u,d,l=m*8-a-1,x=(1<<l)-1,f=x>>1,T=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=r?0:m-1,F=r?1:-1,B=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(u=isNaN(o)?1:0,s=x):(s=Math.floor(Math.log(o)/Math.LN2),o*(d=Math.pow(2,-s))<1&&(s--,d*=2),s+f>=1?o+=T/d:o+=T*Math.pow(2,1-f),o*d>=2&&(s++,d/=2),s+f>=x?(u=0,s=x):s+f>=1?(u=(o*d-1)*Math.pow(2,a),s=s+f):(u=o*Math.pow(2,f-1)*Math.pow(2,a),s=0));a>=8;e[n+v]=u&255,v+=F,u/=256,a-=8);for(s=s<<a|u,l+=a;l>0;e[n+v]=s&255,v+=F,s/=256,l-=8);e[n+v-F]|=B*128}});var On=je(ge=>{"use strict";t();var wo=Sn(),ue=vn(),kn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ge.Buffer=_;ge.SlowBuffer=la;ge.INSPECT_MAX_BYTES=50;var qe=2147483647;ge.kMaxLength=qe;_.TYPED_ARRAY_SUPPORT=ca();!_.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 ca(){try{var e=new Uint8Array(1),o={foo:function(){return 42}};return Object.setPrototypeOf(o,Uint8Array.prototype),Object.setPrototypeOf(e,o),e.foo()===42}catch(n){return!1}}Object.defineProperty(_.prototype,"parent",{enumerable:!0,get:function(){if(!!_.isBuffer(this))return this.buffer}});Object.defineProperty(_.prototype,"offset",{enumerable:!0,get:function(){if(!!_.isBuffer(this))return this.byteOffset}});function Z(e){if(e>qe)throw new RangeError('The value "'+e+'" is invalid for option "size"');var o=new Uint8Array(e);return Object.setPrototypeOf(o,_.prototype),o}function _(e,o,n){if(typeof e=="number"){if(typeof o=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Ao(e)}return En(e,o,n)}_.poolSize=8192;function En(e,o,n){if(typeof e=="string")return sa(e,o);if(ArrayBuffer.isView(e))return _a(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(z(e,ArrayBuffer)||e&&z(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(z(e,SharedArrayBuffer)||e&&z(e.buffer,SharedArrayBuffer)))return vo(e,o,n);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return _.from(r,o,n);var a=da(e);if(a)return a;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return _.from(e[Symbol.toPrimitive]("string"),o,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}_.from=function(e,o,n){return En(e,o,n)};Object.setPrototypeOf(_.prototype,Uint8Array.prototype);Object.setPrototypeOf(_,Uint8Array);function Nn(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 ma(e,o,n){return Nn(e),e<=0?Z(e):o!==void 0?typeof n=="string"?Z(e).fill(o,n):Z(e).fill(o):Z(e)}_.alloc=function(e,o,n){return ma(e,o,n)};function Ao(e){return Nn(e),Z(e<0?0:Io(e)|0)}_.allocUnsafe=function(e){return Ao(e)};_.allocUnsafeSlow=function(e){return Ao(e)};function sa(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!_.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=Ln(e,o)|0,r=Z(n),a=r.write(e,o);return a!==n&&(r=r.slice(0,a)),r}function So(e){for(var o=e.length<0?0:Io(e.length)|0,n=Z(o),r=0;r<o;r+=1)n[r]=e[r]&255;return n}function _a(e){if(z(e,Uint8Array)){var o=new Uint8Array(e);return vo(o.buffer,o.byteOffset,o.byteLength)}return So(e)}function vo(e,o,n){if(o<0||e.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<o+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return o===void 0&&n===void 0?r=new Uint8Array(e):n===void 0?r=new Uint8Array(e,o):r=new Uint8Array(e,o,n),Object.setPrototypeOf(r,_.prototype),r}function da(e){if(_.isBuffer(e)){var o=Io(e.length)|0,n=Z(o);return n.length===0||e.copy(n,0,0,o),n}if(e.length!==void 0)return typeof e.length!="number"||Eo(e.length)?Z(0):So(e);if(e.type==="Buffer"&&Array.isArray(e.data))return So(e.data)}function Io(e){if(e>=qe)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+qe.toString(16)+" bytes");return e|0}function la(e){return+e!=e&&(e=0),_.alloc(+e)}_.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==_.prototype};_.compare=function(o,n){if(z(o,Uint8Array)&&(o=_.from(o,o.offset,o.byteLength)),z(n,Uint8Array)&&(n=_.from(n,n.offset,n.byteLength)),!_.isBuffer(o)||!_.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(o===n)return 0;for(var r=o.length,a=n.length,m=0,s=Math.min(r,a);m<s;++m)if(o[m]!==n[m]){r=o[m],a=n[m];break}return r<a?-1:a<r?1:0};_.isEncoding=function(o){switch(String(o).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}};_.concat=function(o,n){if(!Array.isArray(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return _.alloc(0);var r;if(n===void 0)for(n=0,r=0;r<o.length;++r)n+=o[r].length;var a=_.allocUnsafe(n),m=0;for(r=0;r<o.length;++r){var s=o[r];if(z(s,Uint8Array))m+s.length>a.length?_.from(s).copy(a,m):Uint8Array.prototype.set.call(a,s,m);else if(_.isBuffer(s))s.copy(a,m);else throw new TypeError('"list" argument must be an Array of Buffers');m+=s.length}return a};function Ln(e,o){if(_.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(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 n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;for(var a=!1;;)switch(o){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return ko(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Mn(e).length;default:if(a)return r?-1:ko(e).length;o=(""+o).toLowerCase(),a=!0}}_.byteLength=Ln;function ua(e,o,n){var r=!1;if((o===void 0||o<0)&&(o=0),o>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,o>>>=0,n<=o))return"";for(e||(e="utf8");;)switch(e){case"hex":return va(this,o,n);case"utf8":case"utf-8":return Cn(this,o,n);case"ascii":return wa(this,o,n);case"latin1":case"binary":return Sa(this,o,n);case"base64":return ya(this,o,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ka(this,o,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}_.prototype._isBuffer=!0;function me(e,o,n){var r=e[o];e[o]=e[n],e[n]=r}_.prototype.swap16=function(){var o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<o;n+=2)me(this,n,n+1);return this};_.prototype.swap32=function(){var o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<o;n+=4)me(this,n,n+3),me(this,n+1,n+2);return this};_.prototype.swap64=function(){var o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<o;n+=8)me(this,n,n+7),me(this,n+1,n+6),me(this,n+2,n+5),me(this,n+3,n+4);return this};_.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?Cn(this,0,o):ua.apply(this,arguments)};_.prototype.toLocaleString=_.prototype.toString;_.prototype.equals=function(o){if(!_.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:_.compare(this,o)===0};_.prototype.inspect=function(){var o="",n=ge.INSPECT_MAX_BYTES;return o=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(o+=" ... "),"<Buffer "+o+">"};kn&&(_.prototype[kn]=_.prototype.inspect);_.prototype.compare=function(o,n,r,a,m){if(z(o,Uint8Array)&&(o=_.from(o,o.offset,o.byteLength)),!_.isBuffer(o))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof o);if(n===void 0&&(n=0),r===void 0&&(r=o?o.length:0),a===void 0&&(a=0),m===void 0&&(m=this.length),n<0||r>o.length||a<0||m>this.length)throw new RangeError("out of range index");if(a>=m&&n>=r)return 0;if(a>=m)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,a>>>=0,m>>>=0,this===o)return 0;for(var s=m-a,u=r-n,d=Math.min(s,u),l=this.slice(a,m),x=o.slice(n,r),f=0;f<d;++f)if(l[f]!==x[f]){s=l[f],u=x[f];break}return s<u?-1:u<s?1:0};function Dn(e,o,n,r,a){if(e.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Eo(n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0)if(a)n=0;else return-1;if(typeof o=="string"&&(o=_.from(o,r)),_.isBuffer(o))return o.length===0?-1:An(e,o,n,r,a);if(typeof o=="number")return o=o&255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e,o,n):Uint8Array.prototype.lastIndexOf.call(e,o,n):An(e,[o],n,r,a);throw new TypeError("val must be string, number or Buffer")}function An(e,o,n,r,a){var m=1,s=e.length,u=o.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(e.length<2||o.length<2)return-1;m=2,s/=2,u/=2,n/=2}function d(v,F){return m===1?v[F]:v.readUInt16BE(F*m)}var l;if(a){var x=-1;for(l=n;l<s;l++)if(d(e,l)===d(o,x===-1?0:l-x)){if(x===-1&&(x=l),l-x+1===u)return x*m}else x!==-1&&(l-=l-x),x=-1}else for(n+u>s&&(n=s-u),l=n;l>=0;l--){for(var f=!0,T=0;T<u;T++)if(d(e,l+T)!==d(o,T)){f=!1;break}if(f)return l}return-1}_.prototype.includes=function(o,n,r){return this.indexOf(o,n,r)!==-1};_.prototype.indexOf=function(o,n,r){return Dn(this,o,n,r,!0)};_.prototype.lastIndexOf=function(o,n,r){return Dn(this,o,n,r,!1)};function ga(e,o,n,r){n=Number(n)||0;var a=e.length-n;r?(r=Number(r),r>a&&(r=a)):r=a;var m=o.length;r>m/2&&(r=m/2);for(var s=0;s<r;++s){var u=parseInt(o.substr(s*2,2),16);if(Eo(u))return s;e[n+s]=u}return s}function fa(e,o,n,r){return Ke(ko(o,e.length-n),e,n,r)}function ha(e,o,n,r){return Ke(Ea(o),e,n,r)}function xa(e,o,n,r){return Ke(Mn(o),e,n,r)}function ba(e,o,n,r){return Ke(Na(o,e.length-n),e,n,r)}_.prototype.write=function(o,n,r,a){if(n===void 0)a="utf8",r=this.length,n=0;else if(r===void 0&&typeof n=="string")a=n,r=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(r)?(r=r>>>0,a===void 0&&(a="utf8")):(a=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var m=this.length-n;if((r===void 0||r>m)&&(r=m),o.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var s=!1;;)switch(a){case"hex":return ga(this,o,n,r);case"utf8":case"utf-8":return fa(this,o,n,r);case"ascii":case"latin1":case"binary":return ha(this,o,n,r);case"base64":return xa(this,o,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ba(this,o,n,r);default:if(s)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),s=!0}};_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ya(e,o,n){return o===0&&n===e.length?wo.fromByteArray(e):wo.fromByteArray(e.slice(o,n))}function Cn(e,o,n){n=Math.min(e.length,n);for(var r=[],a=o;a<n;){var m=e[a],s=null,u=m>239?4:m>223?3:m>191?2:1;if(a+u<=n){var d,l,x,f;switch(u){case 1:m<128&&(s=m);break;case 2:d=e[a+1],(d&192)===128&&(f=(m&31)<<6|d&63,f>127&&(s=f));break;case 3:d=e[a+1],l=e[a+2],(d&192)===128&&(l&192)===128&&(f=(m&15)<<12|(d&63)<<6|l&63,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:d=e[a+1],l=e[a+2],x=e[a+3],(d&192)===128&&(l&192)===128&&(x&192)===128&&(f=(m&15)<<18|(d&63)<<12|(l&63)<<6|x&63,f>65535&&f<1114112&&(s=f))}}s===null?(s=65533,u=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),a+=u}return Ta(r)}var In=4096;function Ta(e){var o=e.length;if(o<=In)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<o;)n+=String.fromCharCode.apply(String,e.slice(r,r+=In));return n}function wa(e,o,n){var r="";n=Math.min(e.length,n);for(var a=o;a<n;++a)r+=String.fromCharCode(e[a]&127);return r}function Sa(e,o,n){var r="";n=Math.min(e.length,n);for(var a=o;a<n;++a)r+=String.fromCharCode(e[a]);return r}function va(e,o,n){var r=e.length;(!o||o<0)&&(o=0),(!n||n<0||n>r)&&(n=r);for(var a="",m=o;m<n;++m)a+=La[e[m]];return a}function ka(e,o,n){for(var r=e.slice(o,n),a="",m=0;m<r.length-1;m+=2)a+=String.fromCharCode(r[m]+r[m+1]*256);return a}_.prototype.slice=function(o,n){var r=this.length;o=~~o,n=n===void 0?r:~~n,o<0?(o+=r,o<0&&(o=0)):o>r&&(o=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n<o&&(n=o);var a=this.subarray(o,n);return Object.setPrototypeOf(a,_.prototype),a};function N(e,o,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+o>n)throw new RangeError("Trying to access beyond buffer length")}_.prototype.readUintLE=_.prototype.readUIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||N(o,n,this.length);for(var a=this[o],m=1,s=0;++s<n&&(m*=256);)a+=this[o+s]*m;return a};_.prototype.readUintBE=_.prototype.readUIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||N(o,n,this.length);for(var a=this[o+--n],m=1;n>0&&(m*=256);)a+=this[o+--n]*m;return a};_.prototype.readUint8=_.prototype.readUInt8=function(o,n){return o=o>>>0,n||N(o,1,this.length),this[o]};_.prototype.readUint16LE=_.prototype.readUInt16LE=function(o,n){return o=o>>>0,n||N(o,2,this.length),this[o]|this[o+1]<<8};_.prototype.readUint16BE=_.prototype.readUInt16BE=function(o,n){return o=o>>>0,n||N(o,2,this.length),this[o]<<8|this[o+1]};_.prototype.readUint32LE=_.prototype.readUInt32LE=function(o,n){return o=o>>>0,n||N(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216};_.prototype.readUint32BE=_.prototype.readUInt32BE=function(o,n){return o=o>>>0,n||N(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])};_.prototype.readIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||N(o,n,this.length);for(var a=this[o],m=1,s=0;++s<n&&(m*=256);)a+=this[o+s]*m;return m*=128,a>=m&&(a-=Math.pow(2,8*n)),a};_.prototype.readIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||N(o,n,this.length);for(var a=n,m=1,s=this[o+--a];a>0&&(m*=256);)s+=this[o+--a]*m;return m*=128,s>=m&&(s-=Math.pow(2,8*n)),s};_.prototype.readInt8=function(o,n){return o=o>>>0,n||N(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]};_.prototype.readInt16LE=function(o,n){o=o>>>0,n||N(o,2,this.length);var r=this[o]|this[o+1]<<8;return r&32768?r|4294901760:r};_.prototype.readInt16BE=function(o,n){o=o>>>0,n||N(o,2,this.length);var r=this[o+1]|this[o]<<8;return r&32768?r|4294901760:r};_.prototype.readInt32LE=function(o,n){return o=o>>>0,n||N(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24};_.prototype.readInt32BE=function(o,n){return o=o>>>0,n||N(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]};_.prototype.readFloatLE=function(o,n){return o=o>>>0,n||N(o,4,this.length),ue.read(this,o,!0,23,4)};_.prototype.readFloatBE=function(o,n){return o=o>>>0,n||N(o,4,this.length),ue.read(this,o,!1,23,4)};_.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||N(o,8,this.length),ue.read(this,o,!0,52,8)};_.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||N(o,8,this.length),ue.read(this,o,!1,52,8)};function R(e,o,n,r,a,m){if(!_.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>a||o<m)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}_.prototype.writeUintLE=_.prototype.writeUIntLE=function(o,n,r,a){if(o=+o,n=n>>>0,r=r>>>0,!a){var m=Math.pow(2,8*r)-1;R(this,o,n,r,m,0)}var s=1,u=0;for(this[n]=o&255;++u<r&&(s*=256);)this[n+u]=o/s&255;return n+r};_.prototype.writeUintBE=_.prototype.writeUIntBE=function(o,n,r,a){if(o=+o,n=n>>>0,r=r>>>0,!a){var m=Math.pow(2,8*r)-1;R(this,o,n,r,m,0)}var s=r-1,u=1;for(this[n+s]=o&255;--s>=0&&(u*=256);)this[n+s]=o/u&255;return n+r};_.prototype.writeUint8=_.prototype.writeUInt8=function(o,n,r){return o=+o,n=n>>>0,r||R(this,o,n,1,255,0),this[n]=o&255,n+1};_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||R(this,o,n,2,65535,0),this[n]=o&255,this[n+1]=o>>>8,n+2};_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||R(this,o,n,2,65535,0),this[n]=o>>>8,this[n+1]=o&255,n+2};_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||R(this,o,n,4,4294967295,0),this[n+3]=o>>>24,this[n+2]=o>>>16,this[n+1]=o>>>8,this[n]=o&255,n+4};_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||R(this,o,n,4,4294967295,0),this[n]=o>>>24,this[n+1]=o>>>16,this[n+2]=o>>>8,this[n+3]=o&255,n+4};_.prototype.writeIntLE=function(o,n,r,a){if(o=+o,n=n>>>0,!a){var m=Math.pow(2,8*r-1);R(this,o,n,r,m-1,-m)}var s=0,u=1,d=0;for(this[n]=o&255;++s<r&&(u*=256);)o<0&&d===0&&this[n+s-1]!==0&&(d=1),this[n+s]=(o/u>>0)-d&255;return n+r};_.prototype.writeIntBE=function(o,n,r,a){if(o=+o,n=n>>>0,!a){var m=Math.pow(2,8*r-1);R(this,o,n,r,m-1,-m)}var s=r-1,u=1,d=0;for(this[n+s]=o&255;--s>=0&&(u*=256);)o<0&&d===0&&this[n+s+1]!==0&&(d=1),this[n+s]=(o/u>>0)-d&255;return n+r};_.prototype.writeInt8=function(o,n,r){return o=+o,n=n>>>0,r||R(this,o,n,1,127,-128),o<0&&(o=255+o+1),this[n]=o&255,n+1};_.prototype.writeInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||R(this,o,n,2,32767,-32768),this[n]=o&255,this[n+1]=o>>>8,n+2};_.prototype.writeInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||R(this,o,n,2,32767,-32768),this[n]=o>>>8,this[n+1]=o&255,n+2};_.prototype.writeInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||R(this,o,n,4,2147483647,-2147483648),this[n]=o&255,this[n+1]=o>>>8,this[n+2]=o>>>16,this[n+3]=o>>>24,n+4};_.prototype.writeInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||R(this,o,n,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),this[n]=o>>>24,this[n+1]=o>>>16,this[n+2]=o>>>8,this[n+3]=o&255,n+4};function Pn(e,o,n,r,a,m){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Rn(e,o,n,r,a){return o=+o,n=n>>>0,a||Pn(e,o,n,4,34028234663852886e22,-34028234663852886e22),ue.write(e,o,n,r,23,4),n+4}_.prototype.writeFloatLE=function(o,n,r){return Rn(this,o,n,!0,r)};_.prototype.writeFloatBE=function(o,n,r){return Rn(this,o,n,!1,r)};function Fn(e,o,n,r,a){return o=+o,n=n>>>0,a||Pn(e,o,n,8,17976931348623157e292,-17976931348623157e292),ue.write(e,o,n,r,52,8),n+8}_.prototype.writeDoubleLE=function(o,n,r){return Fn(this,o,n,!0,r)};_.prototype.writeDoubleBE=function(o,n,r){return Fn(this,o,n,!1,r)};_.prototype.copy=function(o,n,r,a){if(!_.isBuffer(o))throw new TypeError("argument should be a Buffer");if(r||(r=0),!a&&a!==0&&(a=this.length),n>=o.length&&(n=o.length),n||(n=0),a>0&&a<r&&(a=r),a===r||o.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),o.length-n<a-r&&(a=o.length-n+r);var m=a-r;return this===o&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,r,a):Uint8Array.prototype.set.call(o,this.subarray(r,a),n),m};_.prototype.fill=function(o,n,r,a){if(typeof o=="string"){if(typeof n=="string"?(a=n,n=0,r=this.length):typeof r=="string"&&(a=r,r=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!_.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(o.length===1){var m=o.charCodeAt(0);(a==="utf8"&&m<128||a==="latin1")&&(o=m)}}else typeof o=="number"?o=o&255:typeof o=="boolean"&&(o=Number(o));if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;n=n>>>0,r=r===void 0?this.length:r>>>0,o||(o=0);var s;if(typeof o=="number")for(s=n;s<r;++s)this[s]=o;else{var u=_.isBuffer(o)?o:_.from(o,a),d=u.length;if(d===0)throw new TypeError('The value "'+o+'" is invalid for argument "value"');for(s=0;s<r-n;++s)this[s+n]=u[s%d]}return this};var Aa=/[^+/0-9A-Za-z-_]/g;function Ia(e){if(e=e.split("=")[0],e=e.trim().replace(Aa,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function ko(e,o){o=o||1/0;for(var n,r=e.length,a=null,m=[],s=0;s<r;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!a){if(n>56319){(o-=3)>-1&&m.push(239,191,189);continue}else if(s+1===r){(o-=3)>-1&&m.push(239,191,189);continue}a=n;continue}if(n<56320){(o-=3)>-1&&m.push(239,191,189),a=n;continue}n=(a-55296<<10|n-56320)+65536}else a&&(o-=3)>-1&&m.push(239,191,189);if(a=null,n<128){if((o-=1)<0)break;m.push(n)}else if(n<2048){if((o-=2)<0)break;m.push(n>>6|192,n&63|128)}else if(n<65536){if((o-=3)<0)break;m.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((o-=4)<0)break;m.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return m}function Ea(e){for(var o=[],n=0;n<e.length;++n)o.push(e.charCodeAt(n)&255);return o}function Na(e,o){for(var n,r,a,m=[],s=0;s<e.length&&!((o-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,a=n%256,m.push(a),m.push(r);return m}function Mn(e){return wo.toByteArray(Ia(e))}function Ke(e,o,n,r){for(var a=0;a<r&&!(a+n>=o.length||a>=e.length);++a)o[a+n]=e[a];return a}function z(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function Eo(e){return e!==e}var La=function(){for(var e="0123456789abcdef",o=new Array(256),n=0;n<16;++n)for(var r=n*16,a=0;a<16;++a)o[r+a]=e[n]+e[a];return o}()});var Wn=je((vp,Vn)=>{t();var A=Vn.exports={},j,G;function No(){throw new Error("setTimeout has not been defined")}function Lo(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?j=setTimeout:j=No}catch(e){j=No}try{typeof clearTimeout=="function"?G=clearTimeout:G=Lo}catch(e){G=Lo}})();function Bn(e){if(j===setTimeout)return setTimeout(e,0);if((j===No||!j)&&setTimeout)return j=setTimeout,setTimeout(e,0);try{return j(e,0)}catch(o){try{return j.call(null,e,0)}catch(n){return j.call(this,e,0)}}}function Da(e){if(G===clearTimeout)return clearTimeout(e);if((G===Lo||!G)&&clearTimeout)return G=clearTimeout,clearTimeout(e);try{return G(e)}catch(o){try{return G.call(null,e)}catch(n){return G.call(this,e)}}}var J=[],fe=!1,se,Xe=-1;function Ca(){!fe||!se||(fe=!1,se.length?J=se.concat(J):Xe=-1,J.length&&Un())}function Un(){if(!fe){var e=Bn(Ca);fe=!0;for(var o=J.length;o;){for(se=J,J=[];++Xe<o;)se&&se[Xe].run();Xe=-1,o=J.length}se=null,fe=!1,Da(e)}}A.nextTick=function(e){var o=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)o[n-1]=arguments[n];J.push(new $n(e,o)),J.length===1&&!fe&&Bn(Un)};function $n(e,o){this.fun=e,this.array=o}$n.prototype.run=function(){this.fun.apply(null,this.array)};A.title="browser";A.browser=!0;A.env={};A.argv=[];A.version="";A.versions={};function Q(){}A.on=Q;A.addListener=Q;A.once=Q;A.off=Q;A.removeListener=Q;A.removeAllListeners=Q;A.emit=Q;A.prependListener=Q;A.prependOnceListener=Q;A.listeners=function(e){return[]};A.binding=function(e){throw new Error("process.binding is not supported")};A.cwd=function(){return"/"};A.chdir=function(e){throw new Error("process.chdir is not supported")};A.umask=function(){return 0}});var i,p,kp,t=b(()=>{i=w(On()),p=w(Wn()),kp=function(e){function o(){var r=this||self;return delete e.prototype.__magic__,r}if(typeof globalThis=="object")return globalThis;if(this)return o();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:o});var n=__magic__;return n}(Object)});var Gn=b(()=>{"use strict";t()});var qn=b(()=>{"use strict";t()});var D=b(()=>{"use strict";t()});var M=b(()=>{"use strict";t()});var Kn=b(()=>{"use strict";t()});var Xn=b(()=>{"use strict";t()});var Yn=b(()=>{"use strict";t()});var Zn=b(()=>{"use strict";t()});var q=b(()=>{"use strict";t();qn();D();M();Kn();Xn();Yn();Zn()});var Do,Jn,qp,Qn,Kp,et,ot,Xp,Yp,nt=b(()=>{"use strict";t();q();Do={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:Jn,egldLabel:qp}=Do["devnet"],{chainId:Qn,egldLabel:Kp}=Do["testnet"],{chainId:et,egldLabel:ot}=Do["mainnet"],Xp={["devnet"]:Jn,["testnet"]:Qn,["mainnet"]:et},Yp={[Jn]:"devnet",[Qn]:"testnet",[et]:"mainnet"}});var Co=b(()=>{"use strict";t()});var tt=b(()=>{"use strict";t()});var rt,Po=b(()=>{"use strict";t();rt="transaction-status-toast-id"});var Ro,Fo,$,xe,at,Ye,it,K,I=b(()=>{"use strict";t();Gn();nt();Co();tt();Po();Ro=5e4,Fo=1e9,$=18,xe=4,at=1,Ye="logout",it="login",K="0"});var Oo,C,Pe,X=b(()=>{"use strict";t();Oo=require("@reduxjs/toolkit");I();C=(0,Oo.createAction)(Ye),Pe=(0,Oo.createAction)(it,e=>({payload:e}))});var Ze,Bo=b(()=>{"use strict";t();Ze=()=>Date.now()/1e3});var dt=b(()=>{"use strict";t()});var lt=b(()=>{"use strict";t()});var Uo=b(()=>{"use strict";t();Bo();dt();lt()});var Vo={};pe(Vo,{getItem:()=>za,localStorageKeys:()=>ie,removeItem:()=>ja,setItem:()=>Ha});var ie,$o,Ha,za,ja,be=b(()=>{"use strict";t();Uo();ie={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},$o=typeof localStorage!="undefined",Ha=({key:e,data:o,expires:n})=>{!$o||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},za=e=>{if(!$o)return;let o=localStorage.getItem(String(e));if(!o)return null;let n=JSON.parse(o);return!n||!n.hasOwnProperty("expires")||!n.hasOwnProperty("data")?null:Ze()>=n.expires?(localStorage.removeItem(String(e)),null):n.data},ja=e=>{!$o||localStorage.removeItem(String(e))}});var Wo={};pe(Wo,{clear:()=>ht,getItem:()=>gt,removeItem:()=>ft,setItem:()=>ut,storage:()=>Ga});var ut,gt,ft,ht,Ga,xt=b(()=>{"use strict";t();ut=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},gt=e=>{let o=sessionStorage.getItem(String(e));if(!o)return null;let n=JSON.parse(o);return!n||!n.hasOwnProperty("expires")||!n.hasOwnProperty("data")?null:Date.now()>=n.expires?(sessionStorage.removeItem(String(e)),null):n.data},ft=e=>sessionStorage.removeItem(String(e)),ht=()=>sessionStorage.clear(),Ga={setItem:ut,getItem:gt,removeItem:ft,clear:ht}});var de,ye=b(()=>{"use strict";t();be();xt();de={session:Wo,local:Vo}});function Re(){return new Date().setHours(new Date().getHours()+24)}function Fe(e){de.local.setItem({key:ie.loginExpiresAt,data:e,expires:e})}var Ho=b(()=>{"use strict";t();ye();be()});var yt,bt,Tt,Yc,Zc,Jc,Qc,em,om,wt,St,zo=b(()=>{"use strict";t();yt=require("@reduxjs/toolkit");Ho();M();X();bt={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Tt=(0,yt.createSlice)({name:"loginInfoSlice",initialState:bt,reducers:{setLoginMethod:(e,o)=>{e.loginMethod=o.payload},setTokenLogin:(e,o)=>{e.tokenLogin=o.payload},setTokenLoginSignature:(e,o)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=o.payload)},setWalletLogin:(e,o)=>{e.walletLogin=o.payload},setWalletConnectLogin:(e,o)=>{e.walletConnectLogin=o.payload},setLedgerLogin:(e,o)=>{e.ledgerLogin=o.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0}},extraReducers:e=>{e.addCase(C,()=>bt),e.addCase(Pe,(o,n)=>{o.loginMethod=n.payload.loginMethod,Fe(Re())})}}),{setLoginMethod:Yc,setWalletConnectLogin:Zc,setLedgerLogin:Jc,setTokenLogin:Qc,setTokenLoginSignature:em,setWalletLogin:om,invalidateLoginSession:wt}=Tt.actions,St=Tt.reducer});var Je=b(()=>{"use strict";t()});var vt=b(()=>{"use strict";t();Je()});function jo(e){return e[Math.floor(Math.random()*e.length)]}var kt=b(()=>{"use strict";t()});var At=b(()=>{"use strict";t();Co()});var It=b(()=>{"use strict";t();vt();kt();At()});var Et,Nt,Go,Ka,Lt,fm,hm,Dt,qo=b(()=>{"use strict";t();Et=require("@reduxjs/toolkit"),Nt=w(require("lodash.omit"));It();Go={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Ka={network:Go,chainID:"-1"},Lt=(0,Et.createSlice)({name:"appConfig",initialState:Ka,reducers:{initializeNetworkConfig:(e,o)=>{let n=jo(o.payload.walletConnectBridgeAddresses),r=jo(o.payload.walletConnectV2RelayAddresses),a=(0,Nt.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=k(y(y({},e.network),a),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(e,o)=>{e.chainID=o.payload}}}),{initializeNetworkConfig:fm,setChainID:hm}=Lt.actions,Dt=Lt.reducer});var Xo,Ct,Pt,Qe,Ko,Rt,Yo,km,Zo,Am,Im,Em,Nm,Lm,Dm,Cm,Ft,Jo=b(()=>{"use strict";t();Xo=require("@elrondnetwork/erdjs"),Ct=require("@reduxjs/toolkit"),Pt=require("redux-persist");I();ye();be();X();Qe={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:K},Ko={address:"",websocketEvent:null,accounts:{"":Qe},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Rt=(0,Ct.createSlice)({name:"accountInfoSlice",initialState:Ko,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new Xo.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:Qe},e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,o)=>{let{address:n}=e;e.accounts[n].nonce=o.payload},setAccountShard:(e,o)=>{e.shard=o.payload},setLedgerAccount:(e,o)=>{e.ledgerAccount=o.payload},updateLedgerAccount:(e,o)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=o.payload.index,e.ledgerAccount.address=o.payload.address)},setWalletConnectAccount:(e,o)=>{e.walletConnectAccount=o.payload},setIsAccountLoading:(e,o)=>{e.isAccountLoading=o.payload,e.accountLoadingError=null},setAccountLoadingError:(e,o)=>{e.accountLoadingError=o.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,o)=>{e.websocketEvent={timestamp:Date.now(),message:o.payload}}},extraReducers:e=>{e.addCase(C,()=>(de.local.removeItem(ie.loginExpiresAt),Ko)),e.addCase(Pe,(o,n)=>{let{address:r}=n.payload;o.address=r,o.publicKey=new Xo.Address(r).hex()}),e.addCase(Pt.REHYDRATE,(o,n)=>{var l;if(!((l=n.payload)!=null&&l.account))return;let{account:r}=n.payload,{address:a,shard:m,accounts:s,publicKey:u}=r;o.address=a,o.shard=m;let d=s&&a in s;o.accounts=d?s:Ko.accounts,o.publicKey=u})}}),{setAccount:Yo,setAddress:km,setAccountNonce:Zo,setAccountShard:Am,setLedgerAccount:Im,updateLedgerAccount:Em,setWalletConnectAccount:Nm,setIsAccountLoading:Lm,setAccountLoadingError:Dm,setWebsocketEvent:Cm}=Rt.actions,Ft=Rt.reducer});function Mt(e){return e!=null&&(ti(e)||pi(e))}function eo(e){return e!=null&&(ri(e)||ci(e))}function oo(e){return e!=null&&(ai(e)||mi(e))}function Ot(e){return e!=null&&ii(e)}function ti(e){return e!=null&&Ya.includes(e)}function ri(e){return e!=null&&Za.includes(e)}function ai(e){return e!=null&&Ja.includes(e)}function ii(e){return e!=null&&Qa.includes(e)}function pi(e){return e!=null&&ei.includes(e)}function ci(e){return e!=null&&oi.includes(e)}function mi(e){return e!=null&&ni.includes(e)}var Ya,Za,Ja,Qa,ei,oi,ni,en=b(()=>{"use strict";t();M();Ya=["sent"],Za=["success"],Ja=["fail","cancelled","timedOut"],Qa=["timedOut"],ei=["pending"],oi=["success"],ni=["fail","invalid"]});var Bt,Ut,Me,si,$t,Vm,Wm,Hm,zm,jm,Gm,qm,Km,Xm,Ym,no,to=b(()=>{"use strict";t();Bt=require("@reduxjs/toolkit"),Ut=require("redux-persist");M();en();X();Me={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},si={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},$t=(0,Bt.createSlice)({name:"transactionsSlice",initialState:Me,reducers:{moveTransactionsToSignedState:(e,o)=>{var d,l;let{sessionId:n,transactions:r,errorMessage:a,status:m,redirectRoute:s}=o.payload,u=((d=e.customTransactionInformationForSessionId)==null?void 0:d[n])||si;e.signedTransactions[n]={transactions:r,status:m,errorMessage:a,redirectRoute:s,customTransactionInformation:u},((l=e==null?void 0:e.transactionsToSign)==null?void 0:l.sessionId)===n&&(e.transactionsToSign=Me.transactionsToSign)},clearSignedTransaction:(e,o)=>{e.signedTransactions[o.payload]&&delete e.signedTransactions[o.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,o)=>{e.signedTransactions=y(y({},e.signedTransactions),o.payload)},updateSignedTransactions:(e,o)=>{let{sessionId:n,status:r,errorMessage:a,transactions:m}=o.payload;e.signedTransactions[n]!=null&&(e.signedTransactions[n].status=r,a!=null&&(e.signedTransactions[n].errorMessage=a),m!=null&&(e.signedTransactions[n].transactions=m))},updateSignedTransactionStatus:(e,o)=>{var u,d,l,x,f,T;let{sessionId:n,status:r,errorMessage:a,transactionHash:m}=o.payload,s=(d=(u=e.signedTransactions)==null?void 0:u[n])==null?void 0:d.transactions;if(s!=null){e.signedTransactions[n].transactions=s.map(B=>B.hash===m?k(y({},B),{status:r,errorMessage:a}):B);let v=(x=(l=e.signedTransactions[n])==null?void 0:l.transactions)==null?void 0:x.every(B=>eo(B.status)),F=(T=(f=e.signedTransactions[n])==null?void 0:f.transactions)==null?void 0:T.every(B=>oo(B.status));v&&(e.signedTransactions[n].status="success"),F&&(e.signedTransactions[n].status="fail")}},setTransactionsToSign:(e,o)=>{e.transactionsToSign=o.payload;let{sessionId:n,customTransactionInformation:r}=o.payload;e.customTransactionInformationForSessionId[n]=r,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=Me.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Me.signedTransactions},setSignTransactionsError:(e,o)=>{e.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(e,o)=>{e.signTransactionsCancelMessage=o.payload}},extraReducers:e=>{e.addCase(C,()=>Me),e.addCase(Ut.REHYDRATE,(o,n)=>{var s;if(o.signTransactionsCancelMessage=null,!((s=n.payload)!=null&&s.transactions))return;let{signedTransactions:r,customTransactionInformationForSessionId:a}=n.payload.transactions,m=Object.entries(r).reduce((u,[d,l])=>{let x=new Date(d),f=new Date;return f.setHours(f.getHours()+5),f-x>0||(u[d]=l),u},{});a!=null&&(o.customTransactionInformationForSessionId=a),r!=null&&(o.signedTransactions=m)})}}),{updateSignedTransactionStatus:Vm,updateSignedTransactions:Wm,setTransactionsToSign:Hm,clearAllTransactionsToSign:zm,clearAllSignedTransactions:jm,clearSignedTransaction:Gm,clearTransactionToSign:qm,setSignTransactionsError:Km,setSignTransactionsCancelMessage:Xm,moveTransactionsToSignedState:Ym}=$t.actions,no=$t.reducer});var Vt,nn,tn,rn,_i,on,Wt,es,os,ns,ro,ao=b(()=>{"use strict";t();Vt=require("@reduxjs/toolkit");X();nn="Transaction failed",tn="Transaction successful",rn="Processing transaction",_i="Transaction submitted",on={},Wt=(0,Vt.createSlice)({name:"transactionsInfo",initialState:on,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:r}=o.payload;n!=null&&(e[n]={errorMessage:(r==null?void 0:r.errorMessage)||nn,successMessage:(r==null?void 0:r.successMessage)||tn,processingMessage:(r==null?void 0:r.processingMessage)||rn,submittedMessage:(r==null?void 0:r.submittedMessage)||_i,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(e,o){o.payload!=null&&delete e[o.payload]},clearTransactionsInfo:()=>on},extraReducers:e=>{e.addCase(C,()=>on)}}),{clearTransactionsInfo:es,setTransactionsDisplayInfo:os,clearTransactionsInfoForSessionId:ns}=Wt.actions,ro=Wt.reducer});var zt,Ht,jt,is,ps,cs,ms,Gt,an=b(()=>{"use strict";t();zt=require("@reduxjs/toolkit");X();Ht={},jt=(0,zt.createSlice)({name:"modalsSlice",initialState:Ht,reducers:{setTxSubmittedModal:(e,o)=>{e.txSubmittedModal=o.payload},setNotificationModal:(e,o)=>{e.notificationModal=o.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(C,()=>Ht)}}),{setTxSubmittedModal:is,setNotificationModal:ps,clearTxSubmittedModal:cs,clearNotificationModal:ms}=jt.actions,Gt=jt.reducer});var Kt,Xt,qt,Yt,di,li,hs,xs,bs,ys,io,po=b(()=>{"use strict";t();Kt=require("@reduxjs/toolkit"),Xt=require("redux-persist");Po();q();Bo();X();qt={customToasts:[],transactionToasts:[],failTransactionToast:null},Yt=(0,Kt.createSlice)({name:"toastsSlice",initialState:qt,reducers:{addCustomToast:(e,o)=>{e.customToasts.push(k(y({},o.payload),{type:"custom",toastId:o.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,o)=>{e.customToasts=e.customToasts.filter(n=>n.toastId!==o.payload)},addTransactionToast:(e,o)=>{e.transactionToasts.push({type:"transaction",startTimestamp:Ze(),toastId:o.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,o)=>{e.transactionToasts=e.transactionToasts.filter(n=>n.toastId!==o.payload)},addFailTransactionToast:(e,o)=>{e.failTransactionToast=k(y({},o.payload),{toastId:rt})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(C,()=>qt),e.addCase(Xt.REHYDRATE,(o,n)=>{var a,m;let r=(m=(a=n.customToasts)==null?void 0:a.filter(s=>!("component"in s)))!=null?m:[];o.customToasts=r})}}),{addCustomToast:di,removeCustomToast:li,addTransactionToast:hs,removeTransactionToast:xs,addFailTransactionToast:bs,removeFailTransactionToast:ys}=Yt.actions,io=Yt.reducer});var ne=b(()=>{"use strict";t();zo();qo();Jo();to();ao();an();po()});var pn=b(()=>{"use strict";t()});var er,Qt,or,$s,Vs,Ws,Hs,zs,js,nr,tr=b(()=>{"use strict";t();er=require("@reduxjs/toolkit");X();Qt={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},or=(0,er.createSlice)({name:"dappModalsSlice",initialState:Qt,reducers:{setDappModalVisibility:(e,o)=>{e.visible=o.payload},setDappModalHeaderVisibility:(e,o)=>{e.modal.showHeader=o.payload},setDappModalFooterVisibility:(e,o)=>{e.modal.showFooter=o.payload},setDappModalHeaderText:(e,o)=>{e.modal.headerText=o.payload},setDappModalFooterText:(e,o)=>{e.modal.footerText=o.payload},setDappModalConfig:(e,o)=>{e.modal=y({},o.payload)}},extraReducers:e=>{e.addCase(C,()=>Qt)}}),{setDappModalVisibility:$s,setDappModalHeaderVisibility:Vs,setDappModalFooterVisibility:Ws,setDappModalHeaderText:Hs,setDappModalFooterText:zs,setDappModalConfig:js}=or.actions,nr=or.reducer});var rr,hi,xi,Te,mo=b(()=>{"use strict";t();rr=require("@reduxjs/toolkit");pn();Jo();tr();zo();an();qo();po();ao();to();hi={["account"]:Ft,["networkConfig"]:Dt,["loginInfo"]:St,["modals"]:Gt,["dappModal"]:nr,["toasts"]:io,["transactions"]:no,["transactionsInfo"]:ro},xi=(e={})=>(0,rr.combineReducers)(y(y({},hi),e)),Te=xi});var pr={};pe(pr,{default:()=>ki});function cn(e,o=[]){return{key:e,version:1,storage:ir.default,blacklist:o}}var le,ar,ir,bi,yi,Ti,wi,Si,vi,ki,cr=b(()=>{"use strict";t();le=require("redux-persist"),ar=w(require("redux-persist/lib/storage")),ir=w(require("redux-persist/lib/storage/session"));mo();ne();po();ao();to();pn();bi={2:e=>k(y({},e),{networkConfig:Go})};yi=cn("dapp-core-transactionsInfo"),Ti=cn("dapp-core-transactions",["transactionsToSign"]),wi=cn("dapp-core-toasts"),Si={key:"dapp-core-store",version:2,storage:ar.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,le.createMigrate)(bi,{debug:!1})},vi={["toasts"]:(0,le.persistReducer)(wi,io),["transactions"]:(0,le.persistReducer)(Ti,no),["transactionsInfo"]:(0,le.persistReducer)(yi,ro)},ki=(0,le.persistReducer)(Si,Te(vi))});var mr={};pe(mr,{default:()=>Ai});var Ai,sr=b(()=>{"use strict";t();mo();Ai=Te()});var _r={};pe(_r,{default:()=>Ei});var V,Ii,Ei,dr=b(()=>{"use strict";t();V=require("redux-persist"),Ii=[V.FLUSH,V.REHYDRATE,V.PAUSE,V.PERSIST,V.PURGE,V.REGISTER],Ei=Ii});var gr={};pe(gr,{default:()=>ur});function ur(e){return(0,lr.persistStore)(e)}var lr,fr=b(()=>{"use strict";t();lr=require("redux-persist")});var xp={};pe(xp,{AddressTable:()=>hp});module.exports=Ie(xp);t();var S=w(require("react")),ve=require("@fortawesome/free-solid-svg-icons"),hn=require("@fortawesome/react-fontawesome"),Y=w(require("classnames"));t();var he=w(require("react")),zn=require("@fortawesome/react-fontawesome"),Ee=w(require("classnames"));t();var Pa=`.dapp-core-component__main__link-style {
color: #1392ff;
}
.dapp-core-component__main__link-second-style {
color: #9dabbd;
}
.dapp-core-component__main__link-second-style:hover {
color: #1392ff;
}
.dapp-core-component__main__link-second-style:hover svg {
color: #1392ff;
}
.dapp-core-component__main__wrapper {
min-height: 100vh;
}
.dapp-core-component__main__opacity-6 {
opacity: 0.6;
}
.dapp-core-component__main__qr-code-svg-container {
width: 15rem;
height: 15rem;
}
.dapp-core-component__main__pair-list {
max-height: 20rem;
overflow-y: auto;
margin-bottom: -0.5rem;
}
.dapp-core-component__main__pair-image {
width: 4rem;
overflow: hidden;
height: auto;
min-width: 2rem;
}
.dapp-core-component__main__pair-remove {
padding: 0 0.5rem;
position: absolute;
right: 0;
top: 0;
}
.dapp-core-component__main__dapp-icon {
padding: 5px;
border-radius: 50%;
background-color: #fafafa;
width: 4.6428571429rem;
height: 4.6428571429rem;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
}
.dapp-core-component__main__dapp-icon.dapp-core-component__main__icon-medium {
width: 80px;
height: 80px;
}
.dapp-core-component__main__centering {
display: flex;
justify-content: center;
align-items: center;
}
.dapp-core-component__main__border-n {
border: none !important;
}
.dapp-core-component__main__t-shadow {
text-shadow: 0px 4px 7px rgba(0, 0, 0, 0.3);
}
.dapp-core-component__main__btn {
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.04) !important;
}
.dapp-core-component__main__media {
display: flex;
align-items: flex-start;
}
.dapp-core-component__main__media-body {
flex: 1;
}
.dapp-core-component__main__connect-btns .dapp-core-component__main__btn {
display: flex;
height: 48px;
justify-content: center;
align-items: center;
color: #fff !important;
background-color: #1392ff;
padding: 15px 20px 15px 16px;
border-radius: 6px;
gap: 8px;
}
.dapp-core-component__main__connect-btns .dapp-core-component__main__btn:hover, .dapp-core-component__main__connect-btns .dapp-core-component__main__btn:active {
background-color: #1392ff;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.dapp-core-component__main__connect-btns .dapp-core-component__main__info {
color: #1392ff;
margin-left: 48px;
}
.dapp-core-component__main__btn {
transition: none !important;
}
.dapp-core-component__main__trust-badge {
width: 20px;
height: 20px;
}
/* Navbar
-------------------------------------------------- */
.dapp-core-component__main__navbar .dapp-core-component__main__dapp-name {
display: flex;
align-items: center;
font-size: 1.7142857143rem;
font-weight: 400;
color: #9ba5b4;
margin-left: 1.6428571429rem;
}
.dapp-core-component__main__navbar .dapp-core-component__main__dapp-name:before {
content: "";
display: block;
width: 1px;
height: 3rem;
margin-right: 1.7142857143rem;
}
/* Dashboard
-------------------------------------------------- */
.dapp-core-component__main__action-btn {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #fff;
margin: 0 7px;
}
.dapp-core-component__main__action-btn button {
border-radius: 50%;
width: 40px;
height: 40px;
background-color: #fff;
}
.dapp-core-component__main__action-btn button:hover {
opacity: 0.9;
}
.dapp-core-component__main__transactions .dapp-core-component__main__transaction-icon {
border-radius: 50%;
width: 40px;
height: 40px;
}
.dapp-core-component__main__transactions.dapp-core-component__main__table td {
white-space: nowrap;
vertical-align: middle;
}
.dapp-core-component__main__transactions.dapp-core-component__main__table tr:last-of-type td {
border-bottom: 1px solid #dee2e6;
}
/* Loader, Transaction Success/Fail
-------------------------------------------------- */
.dapp-core-component__main__page-state .dapp-core-component__main__lds-ellipsis {
display: inline-block;
position: relative;
width: 64px;
height: 64px;
}
.dapp-core-component__main__page-state .dapp-core-component__main__lds-ellipsis div {
position: absolute;
top: 27px;
width: 11px;
height: 11px;
border-radius: 50%;
background: rgba(0, 0, 0, 0.1);
animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.dapp-core-component__main__page-state .dapp-core-component__main__bg-blue .dapp-core-component__main__lds-ellipsis div {
background: rgba(255, 255, 255, 0.4);
}
.dapp-core-component__main__page-state .dapp-core-component__main__lds-ellipsis div:nth-child(1) {
left: 6px;
animation: dapp-core-component__main__lds-ellipsis1 0.6s infinite;
}
.dapp-core-component__main__page-state .dapp-core-component__main__lds-ellipsis div:nth-child(2) {