UNPKG

@sofaws/dapp-core

Version:

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

193 lines (172 loc) 157 kB
"use strict";var ya=Object.create;var Ce=Object.defineProperty,ba=Object.defineProperties,Sa=Object.getOwnPropertyDescriptor,wa=Object.getOwnPropertyDescriptors,va=Object.getOwnPropertyNames,$e=Object.getOwnPropertySymbols,ka=Object.getPrototypeOf,Ao=Object.prototype.hasOwnProperty,Rn=Object.prototype.propertyIsEnumerable;var Pn=(e,o,n)=>o in e?Ce(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,f=(e,o)=>{for(var n in o||(o={}))Ao.call(o,n)&&Pn(e,n,o[n]);if($e)for(var n of $e(o))Rn.call(o,n)&&Pn(e,n,o[n]);return e},w=(e,o)=>ba(e,wa(o));var Ve=(e,o)=>{var n={};for(var r in e)Ao.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$e)for(var r of $e(e))o.indexOf(r)<0&&Rn.call(e,r)&&(n[r]=e[r]);return n};var T=(e,o)=>()=>(e&&(o=e(e=0)),o);var He=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),re=(e,o)=>{for(var n in o)Ce(e,n,{get:o[n],enumerable:!0})},Mn=(e,o,n,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of va(o))!Ao.call(e,p)&&p!==n&&Ce(e,p,{get:()=>o[p],enumerable:!(r=Sa(o,p))||r.enumerable});return e};var x=(e,o,n)=>(n=e!=null?ya(ka(e)):{},Mn(o||!e||!e.__esModule?Ce(n,"default",{value:e,enumerable:!0}):n,e)),Ne=e=>Mn(Ce({},"__esModule",{value:!0}),e);var b=(e,o,n)=>new Promise((r,p)=>{var s=d=>{try{l(n.next(d))}catch(g){p(g)}},m=d=>{try{l(n.throw(d))}catch(g){p(g)}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(s,m);l((n=n.apply(e,o)).next())});var Bn=He(je=>{"use strict";t();je.byteLength=Aa;je.toByteArray=La;je.fromByteArray=Na;var V=[],U=[],Ia=typeof Uint8Array!="undefined"?Uint8Array:Array,Eo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ae=0,On=Eo.length;ae<On;++ae)V[ae]=Eo[ae],U[Eo.charCodeAt(ae)]=ae;var ae,On;U["-".charCodeAt(0)]=62;U["_".charCodeAt(0)]=63;function Fn(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 Aa(e){var o=Fn(e),n=o[0],r=o[1];return(n+r)*3/4-r}function Ea(e,o,n){return(o+n)*3/4-n}function La(e){var o,n=Fn(e),r=n[0],p=n[1],s=new Ia(Ea(e,r,p)),m=0,l=p>0?r-4:r,d;for(d=0;d<l;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)],s[m++]=o>>16&255,s[m++]=o>>8&255,s[m++]=o&255;return p===2&&(o=U[e.charCodeAt(d)]<<2|U[e.charCodeAt(d+1)]>>4,s[m++]=o&255),p===1&&(o=U[e.charCodeAt(d)]<<10|U[e.charCodeAt(d+1)]<<4|U[e.charCodeAt(d+2)]>>2,s[m++]=o>>8&255,s[m++]=o&255),s}function Da(e){return V[e>>18&63]+V[e>>12&63]+V[e>>6&63]+V[e&63]}function Ca(e,o,n){for(var r,p=[],s=o;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),p.push(Da(r));return p.join("")}function Na(e){for(var o,n=e.length,r=n%3,p=[],s=16383,m=0,l=n-r;m<l;m+=s)p.push(Ca(e,m,m+s>l?l:m+s));return r===1?(o=e[n-1],p.push(V[o>>2]+V[o<<4&63]+"==")):r===2&&(o=(e[n-2]<<8)+e[n-1],p.push(V[o>>10]+V[o>>4&63]+V[o<<2&63]+"=")),p.join("")}});var Un=He(Lo=>{t();Lo.read=function(e,o,n,r,p){var s,m,l=p*8-r-1,d=(1<<l)-1,g=d>>1,y=-7,h=n?p-1:0,C=n?-1:1,N=e[o+h];for(h+=C,s=N&(1<<-y)-1,N>>=-y,y+=l;y>0;s=s*256+e[o+h],h+=C,y-=8);for(m=s&(1<<-y)-1,s>>=-y,y+=r;y>0;m=m*256+e[o+h],h+=C,y-=8);if(s===0)s=1-g;else{if(s===d)return m?NaN:(N?-1:1)*(1/0);m=m+Math.pow(2,r),s=s-g}return(N?-1:1)*m*Math.pow(2,s-r)};Lo.write=function(e,o,n,r,p,s){var m,l,d,g=s*8-p-1,y=(1<<g)-1,h=y>>1,C=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,N=r?0:s-1,ee=r?1:-1,q=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(l=isNaN(o)?1:0,m=y):(m=Math.floor(Math.log(o)/Math.LN2),o*(d=Math.pow(2,-m))<1&&(m--,d*=2),m+h>=1?o+=C/d:o+=C*Math.pow(2,1-h),o*d>=2&&(m++,d/=2),m+h>=y?(l=0,m=y):m+h>=1?(l=(o*d-1)*Math.pow(2,p),m=m+h):(l=o*Math.pow(2,h-1)*Math.pow(2,p),m=0));p>=8;e[n+N]=l&255,N+=ee,l/=256,p-=8);for(m=m<<p|l,g+=p;g>0;e[n+N]=m&255,N+=ee,m/=256,g-=8);e[n+N-ee]|=q*128}});var Jn=He(ge=>{"use strict";t();var Do=Bn(),ue=Un(),Wn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ge.Buffer=_;ge.SlowBuffer=Ba;ge.INSPECT_MAX_BYTES=50;var ze=2147483647;ge.kMaxLength=ze;_.TYPED_ARRAY_SUPPORT=Pa();!_.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 Pa(){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 K(e){if(e>ze)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 Ro(e)}return Vn(e,o,n)}_.poolSize=8192;function Vn(e,o,n){if(typeof e=="string")return Ma(e,o);if(ArrayBuffer.isView(e))return Oa(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(H(e,SharedArrayBuffer)||e&&H(e.buffer,SharedArrayBuffer)))return No(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 p=Fa(e);if(p)return p;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 Vn(e,o,n)};Object.setPrototypeOf(_.prototype,Uint8Array.prototype);Object.setPrototypeOf(_,Uint8Array);function Hn(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 Ra(e,o,n){return Hn(e),e<=0?K(e):o!==void 0?typeof n=="string"?K(e).fill(o,n):K(e).fill(o):K(e)}_.alloc=function(e,o,n){return Ra(e,o,n)};function Ro(e){return Hn(e),K(e<0?0:Mo(e)|0)}_.allocUnsafe=function(e){return Ro(e)};_.allocUnsafeSlow=function(e){return Ro(e)};function Ma(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!_.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=jn(e,o)|0,r=K(n),p=r.write(e,o);return p!==n&&(r=r.slice(0,p)),r}function Co(e){for(var o=e.length<0?0:Mo(e.length)|0,n=K(o),r=0;r<o;r+=1)n[r]=e[r]&255;return n}function Oa(e){if(H(e,Uint8Array)){var o=new Uint8Array(e);return No(o.buffer,o.byteOffset,o.byteLength)}return Co(e)}function No(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 Fa(e){if(_.isBuffer(e)){var o=Mo(e.length)|0,n=K(o);return n.length===0||e.copy(n,0,0,o),n}if(e.length!==void 0)return typeof e.length!="number"||Oo(e.length)?K(0):Co(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Co(e.data)}function Mo(e){if(e>=ze)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ze.toString(16)+" bytes");return e|0}function Ba(e){return+e!=e&&(e=0),_.alloc(+e)}_.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==_.prototype};_.compare=function(o,n){if(H(o,Uint8Array)&&(o=_.from(o,o.offset,o.byteLength)),H(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,p=n.length,s=0,m=Math.min(r,p);s<m;++s)if(o[s]!==n[s]){r=o[s],p=n[s];break}return r<p?-1:p<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 p=_.allocUnsafe(n),s=0;for(r=0;r<o.length;++r){var m=o[r];if(H(m,Uint8Array))s+m.length>p.length?_.from(m).copy(p,s):Uint8Array.prototype.set.call(p,m,s);else if(_.isBuffer(m))m.copy(p,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=m.length}return p};function jn(e,o){if(_.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;for(var p=!1;;)switch(o){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Po(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Zn(e).length;default:if(p)return r?-1:Po(e).length;o=(""+o).toLowerCase(),p=!0}}_.byteLength=jn;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 Xa(this,o,n);case"utf8":case"utf-8":return qn(this,o,n);case"ascii":return qa(this,o,n);case"latin1":case"binary":return Ka(this,o,n);case"base64":return ja(this,o,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ya(this,o,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}_.prototype._isBuffer=!0;function ie(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)ie(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)ie(this,n,n+3),ie(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)ie(this,n,n+7),ie(this,n+1,n+6),ie(this,n+2,n+5),ie(this,n+3,n+4);return this};_.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?qn(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+">"};Wn&&(_.prototype[Wn]=_.prototype.inspect);_.prototype.compare=function(o,n,r,p,s){if(H(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),p===void 0&&(p=0),s===void 0&&(s=this.length),n<0||r>o.length||p<0||s>this.length)throw new RangeError("out of range index");if(p>=s&&n>=r)return 0;if(p>=s)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,p>>>=0,s>>>=0,this===o)return 0;for(var m=s-p,l=r-n,d=Math.min(m,l),g=this.slice(p,s),y=o.slice(n,r),h=0;h<d;++h)if(g[h]!==y[h]){m=g[h],l=y[h];break}return m<l?-1:l<m?1:0};function zn(e,o,n,r,p){if(e.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Oo(n)&&(n=p?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(p)return-1;n=e.length-1}else if(n<0)if(p)n=0;else return-1;if(typeof o=="string"&&(o=_.from(o,r)),_.isBuffer(o))return o.length===0?-1:Gn(e,o,n,r,p);if(typeof o=="number")return o=o&255,typeof Uint8Array.prototype.indexOf=="function"?p?Uint8Array.prototype.indexOf.call(e,o,n):Uint8Array.prototype.lastIndexOf.call(e,o,n):Gn(e,[o],n,r,p);throw new TypeError("val must be string, number or Buffer")}function Gn(e,o,n,r,p){var s=1,m=e.length,l=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;s=2,m/=2,l/=2,n/=2}function d(N,ee){return s===1?N[ee]:N.readUInt16BE(ee*s)}var g;if(p){var y=-1;for(g=n;g<m;g++)if(d(e,g)===d(o,y===-1?0:g-y)){if(y===-1&&(y=g),g-y+1===l)return y*s}else y!==-1&&(g-=g-y),y=-1}else for(n+l>m&&(n=m-l),g=n;g>=0;g--){for(var h=!0,C=0;C<l;C++)if(d(e,g+C)!==d(o,C)){h=!1;break}if(h)return g}return-1}_.prototype.includes=function(o,n,r){return this.indexOf(o,n,r)!==-1};_.prototype.indexOf=function(o,n,r){return zn(this,o,n,r,!0)};_.prototype.lastIndexOf=function(o,n,r){return zn(this,o,n,r,!1)};function Wa(e,o,n,r){n=Number(n)||0;var p=e.length-n;r?(r=Number(r),r>p&&(r=p)):r=p;var s=o.length;r>s/2&&(r=s/2);for(var m=0;m<r;++m){var l=parseInt(o.substr(m*2,2),16);if(Oo(l))return m;e[n+m]=l}return m}function Ga(e,o,n,r){return qe(Po(o,e.length-n),e,n,r)}function $a(e,o,n,r){return qe(Qa(o),e,n,r)}function Va(e,o,n,r){return qe(Zn(o),e,n,r)}function Ha(e,o,n,r){return qe(ei(o,e.length-n),e,n,r)}_.prototype.write=function(o,n,r,p){if(n===void 0)p="utf8",r=this.length,n=0;else if(r===void 0&&typeof n=="string")p=n,r=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(r)?(r=r>>>0,p===void 0&&(p="utf8")):(p=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-n;if((r===void 0||r>s)&&(r=s),o.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");p||(p="utf8");for(var m=!1;;)switch(p){case"hex":return Wa(this,o,n,r);case"utf8":case"utf-8":return Ga(this,o,n,r);case"ascii":case"latin1":case"binary":return $a(this,o,n,r);case"base64":return Va(this,o,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ha(this,o,n,r);default:if(m)throw new TypeError("Unknown encoding: "+p);p=(""+p).toLowerCase(),m=!0}};_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ja(e,o,n){return o===0&&n===e.length?Do.fromByteArray(e):Do.fromByteArray(e.slice(o,n))}function qn(e,o,n){n=Math.min(e.length,n);for(var r=[],p=o;p<n;){var s=e[p],m=null,l=s>239?4:s>223?3:s>191?2:1;if(p+l<=n){var d,g,y,h;switch(l){case 1:s<128&&(m=s);break;case 2:d=e[p+1],(d&192)===128&&(h=(s&31)<<6|d&63,h>127&&(m=h));break;case 3:d=e[p+1],g=e[p+2],(d&192)===128&&(g&192)===128&&(h=(s&15)<<12|(d&63)<<6|g&63,h>2047&&(h<55296||h>57343)&&(m=h));break;case 4:d=e[p+1],g=e[p+2],y=e[p+3],(d&192)===128&&(g&192)===128&&(y&192)===128&&(h=(s&15)<<18|(d&63)<<12|(g&63)<<6|y&63,h>65535&&h<1114112&&(m=h))}}m===null?(m=65533,l=1):m>65535&&(m-=65536,r.push(m>>>10&1023|55296),m=56320|m&1023),r.push(m),p+=l}return za(r)}var $n=4096;function za(e){var o=e.length;if(o<=$n)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<o;)n+=String.fromCharCode.apply(String,e.slice(r,r+=$n));return n}function qa(e,o,n){var r="";n=Math.min(e.length,n);for(var p=o;p<n;++p)r+=String.fromCharCode(e[p]&127);return r}function Ka(e,o,n){var r="";n=Math.min(e.length,n);for(var p=o;p<n;++p)r+=String.fromCharCode(e[p]);return r}function Xa(e,o,n){var r=e.length;(!o||o<0)&&(o=0),(!n||n<0||n>r)&&(n=r);for(var p="",s=o;s<n;++s)p+=oi[e[s]];return p}function Ya(e,o,n){for(var r=e.slice(o,n),p="",s=0;s<r.length-1;s+=2)p+=String.fromCharCode(r[s]+r[s+1]*256);return p}_.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 p=this.subarray(o,n);return Object.setPrototypeOf(p,_.prototype),p};function L(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||L(o,n,this.length);for(var p=this[o],s=1,m=0;++m<n&&(s*=256);)p+=this[o+m]*s;return p};_.prototype.readUintBE=_.prototype.readUIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||L(o,n,this.length);for(var p=this[o+--n],s=1;n>0&&(s*=256);)p+=this[o+--n]*s;return p};_.prototype.readUint8=_.prototype.readUInt8=function(o,n){return o=o>>>0,n||L(o,1,this.length),this[o]};_.prototype.readUint16LE=_.prototype.readUInt16LE=function(o,n){return o=o>>>0,n||L(o,2,this.length),this[o]|this[o+1]<<8};_.prototype.readUint16BE=_.prototype.readUInt16BE=function(o,n){return o=o>>>0,n||L(o,2,this.length),this[o]<<8|this[o+1]};_.prototype.readUint32LE=_.prototype.readUInt32LE=function(o,n){return o=o>>>0,n||L(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||L(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||L(o,n,this.length);for(var p=this[o],s=1,m=0;++m<n&&(s*=256);)p+=this[o+m]*s;return s*=128,p>=s&&(p-=Math.pow(2,8*n)),p};_.prototype.readIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||L(o,n,this.length);for(var p=n,s=1,m=this[o+--p];p>0&&(s*=256);)m+=this[o+--p]*s;return s*=128,m>=s&&(m-=Math.pow(2,8*n)),m};_.prototype.readInt8=function(o,n){return o=o>>>0,n||L(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]};_.prototype.readInt16LE=function(o,n){o=o>>>0,n||L(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||L(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||L(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||L(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||L(o,4,this.length),ue.read(this,o,!0,23,4)};_.prototype.readFloatBE=function(o,n){return o=o>>>0,n||L(o,4,this.length),ue.read(this,o,!1,23,4)};_.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||L(o,8,this.length),ue.read(this,o,!0,52,8)};_.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||L(o,8,this.length),ue.read(this,o,!1,52,8)};function M(e,o,n,r,p,s){if(!_.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>p||o<s)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,p){if(o=+o,n=n>>>0,r=r>>>0,!p){var s=Math.pow(2,8*r)-1;M(this,o,n,r,s,0)}var m=1,l=0;for(this[n]=o&255;++l<r&&(m*=256);)this[n+l]=o/m&255;return n+r};_.prototype.writeUintBE=_.prototype.writeUIntBE=function(o,n,r,p){if(o=+o,n=n>>>0,r=r>>>0,!p){var s=Math.pow(2,8*r)-1;M(this,o,n,r,s,0)}var m=r-1,l=1;for(this[n+m]=o&255;--m>=0&&(l*=256);)this[n+m]=o/l&255;return n+r};_.prototype.writeUint8=_.prototype.writeUInt8=function(o,n,r){return o=+o,n=n>>>0,r||M(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||M(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||M(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||M(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||M(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,p){if(o=+o,n=n>>>0,!p){var s=Math.pow(2,8*r-1);M(this,o,n,r,s-1,-s)}var m=0,l=1,d=0;for(this[n]=o&255;++m<r&&(l*=256);)o<0&&d===0&&this[n+m-1]!==0&&(d=1),this[n+m]=(o/l>>0)-d&255;return n+r};_.prototype.writeIntBE=function(o,n,r,p){if(o=+o,n=n>>>0,!p){var s=Math.pow(2,8*r-1);M(this,o,n,r,s-1,-s)}var m=r-1,l=1,d=0;for(this[n+m]=o&255;--m>=0&&(l*=256);)o<0&&d===0&&this[n+m+1]!==0&&(d=1),this[n+m]=(o/l>>0)-d&255;return n+r};_.prototype.writeInt8=function(o,n,r){return o=+o,n=n>>>0,r||M(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||M(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||M(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||M(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||M(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 Kn(e,o,n,r,p,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Xn(e,o,n,r,p){return o=+o,n=n>>>0,p||Kn(e,o,n,4,34028234663852886e22,-34028234663852886e22),ue.write(e,o,n,r,23,4),n+4}_.prototype.writeFloatLE=function(o,n,r){return Xn(this,o,n,!0,r)};_.prototype.writeFloatBE=function(o,n,r){return Xn(this,o,n,!1,r)};function Yn(e,o,n,r,p){return o=+o,n=n>>>0,p||Kn(e,o,n,8,17976931348623157e292,-17976931348623157e292),ue.write(e,o,n,r,52,8),n+8}_.prototype.writeDoubleLE=function(o,n,r){return Yn(this,o,n,!0,r)};_.prototype.writeDoubleBE=function(o,n,r){return Yn(this,o,n,!1,r)};_.prototype.copy=function(o,n,r,p){if(!_.isBuffer(o))throw new TypeError("argument should be a Buffer");if(r||(r=0),!p&&p!==0&&(p=this.length),n>=o.length&&(n=o.length),n||(n=0),p>0&&p<r&&(p=r),p===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(p<0)throw new RangeError("sourceEnd out of bounds");p>this.length&&(p=this.length),o.length-n<p-r&&(p=o.length-n+r);var s=p-r;return this===o&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,r,p):Uint8Array.prototype.set.call(o,this.subarray(r,p),n),s};_.prototype.fill=function(o,n,r,p){if(typeof o=="string"){if(typeof n=="string"?(p=n,n=0,r=this.length):typeof r=="string"&&(p=r,r=this.length),p!==void 0&&typeof p!="string")throw new TypeError("encoding must be a string");if(typeof p=="string"&&!_.isEncoding(p))throw new TypeError("Unknown encoding: "+p);if(o.length===1){var s=o.charCodeAt(0);(p==="utf8"&&s<128||p==="latin1")&&(o=s)}}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 m;if(typeof o=="number")for(m=n;m<r;++m)this[m]=o;else{var l=_.isBuffer(o)?o:_.from(o,p),d=l.length;if(d===0)throw new TypeError('The value "'+o+'" is invalid for argument "value"');for(m=0;m<r-n;++m)this[m+n]=l[m%d]}return this};var Za=/[^+/0-9A-Za-z-_]/g;function Ja(e){if(e=e.split("=")[0],e=e.trim().replace(Za,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Po(e,o){o=o||1/0;for(var n,r=e.length,p=null,s=[],m=0;m<r;++m){if(n=e.charCodeAt(m),n>55295&&n<57344){if(!p){if(n>56319){(o-=3)>-1&&s.push(239,191,189);continue}else if(m+1===r){(o-=3)>-1&&s.push(239,191,189);continue}p=n;continue}if(n<56320){(o-=3)>-1&&s.push(239,191,189),p=n;continue}n=(p-55296<<10|n-56320)+65536}else p&&(o-=3)>-1&&s.push(239,191,189);if(p=null,n<128){if((o-=1)<0)break;s.push(n)}else if(n<2048){if((o-=2)<0)break;s.push(n>>6|192,n&63|128)}else if(n<65536){if((o-=3)<0)break;s.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((o-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return s}function Qa(e){for(var o=[],n=0;n<e.length;++n)o.push(e.charCodeAt(n)&255);return o}function ei(e,o){for(var n,r,p,s=[],m=0;m<e.length&&!((o-=2)<0);++m)n=e.charCodeAt(m),r=n>>8,p=n%256,s.push(p),s.push(r);return s}function Zn(e){return Do.toByteArray(Ja(e))}function qe(e,o,n,r){for(var p=0;p<r&&!(p+n>=o.length||p>=e.length);++p)o[p+n]=e[p];return p}function H(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function Oo(e){return e!==e}var oi=function(){for(var e="0123456789abcdef",o=new Array(256),n=0;n<16;++n)for(var r=n*16,p=0;p<16;++p)o[r+p]=e[n]+e[p];return o}()});var tt=He((os,nt)=>{t();var E=nt.exports={},j,z;function Fo(){throw new Error("setTimeout has not been defined")}function Bo(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?j=setTimeout:j=Fo}catch(e){j=Fo}try{typeof clearTimeout=="function"?z=clearTimeout:z=Bo}catch(e){z=Bo}})();function Qn(e){if(j===setTimeout)return setTimeout(e,0);if((j===Fo||!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 ni(e){if(z===clearTimeout)return clearTimeout(e);if((z===Bo||!z)&&clearTimeout)return z=clearTimeout,clearTimeout(e);try{return z(e)}catch(o){try{return z.call(null,e)}catch(n){return z.call(this,e)}}}var X=[],fe=!1,ce,Ke=-1;function ti(){!fe||!ce||(fe=!1,ce.length?X=ce.concat(X):Ke=-1,X.length&&et())}function et(){if(!fe){var e=Qn(ti);fe=!0;for(var o=X.length;o;){for(ce=X,X=[];++Ke<o;)ce&&ce[Ke].run();Ke=-1,o=X.length}ce=null,fe=!1,ni(e)}}E.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];X.push(new ot(e,o)),X.length===1&&!fe&&Qn(et)};function ot(e,o){this.fun=e,this.array=o}ot.prototype.run=function(){this.fun.apply(null,this.array)};E.title="browser";E.browser=!0;E.env={};E.argv=[];E.version="";E.versions={};function Y(){}E.on=Y;E.addListener=Y;E.once=Y;E.off=Y;E.removeListener=Y;E.removeAllListeners=Y;E.emit=Y;E.prependListener=Y;E.prependOnceListener=Y;E.listeners=function(e){return[]};E.binding=function(e){throw new Error("process.binding is not supported")};E.cwd=function(){return"/"};E.chdir=function(e){throw new Error("process.chdir is not supported")};E.umask=function(){return 0}});var a,i,ns,t=T(()=>{a=x(Jn()),i=x(tt()),ns=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 Ze,Uo=T(()=>{"use strict";t();Ze=()=>Date.now()/1e3});var it=T(()=>{"use strict";t()});var ct=T(()=>{"use strict";t()});var Wo=T(()=>{"use strict";t();Uo();it();ct()});var $o={};re($o,{getItem:()=>ci,localStorageKeys:()=>oe,removeItem:()=>pi,setItem:()=>ii});var oe,Go,ii,ci,pi,Te=T(()=>{"use strict";t();Wo();oe={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Go=typeof localStorage!="undefined",ii=({key:e,data:o,expires:n})=>{!Go||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},ci=e=>{if(!Go)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},pi=e=>{!Go||localStorage.removeItem(String(e))}});var Vo={};re(Vo,{clear:()=>_t,getItem:()=>st,removeItem:()=>mt,setItem:()=>pt,storage:()=>si});var pt,st,mt,_t,si,dt=T(()=>{"use strict";t();pt=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},st=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},mt=e=>sessionStorage.removeItem(String(e)),_t=()=>sessionStorage.clear(),si={setItem:pt,getItem:st,removeItem:mt,clear:_t}});var pe,he=T(()=>{"use strict";t();Te();dt();pe={session:Vo,local:$o}});function Pe(){return new Date().setHours(new Date().getHours()+24)}function Re(e){pe.local.setItem({key:oe.loginExpiresAt,data:e,expires:e})}var Ho=T(()=>{"use strict";t();he();Te()});var A=T(()=>{"use strict";t()});var xe=T(()=>{"use strict";t()});var lt=T(()=>{"use strict";t()});var P=T(()=>{"use strict";t()});var ut=T(()=>{"use strict";t()});var gt=T(()=>{"use strict";t()});var ft=T(()=>{"use strict";t()});var Tt=T(()=>{"use strict";t()});var F=T(()=>{"use strict";t();lt();P();A();ut();gt();ft();Tt()});var jo,ht,Os,xt,Fs,yt,Bs,Us,Ws,bt=T(()=>{"use strict";t();F();jo={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:ht,egldLabel:Os}=jo["devnet"],{chainId:xt,egldLabel:Fs}=jo["testnet"],{chainId:yt,egldLabel:Bs}=jo["mainnet"],Us={["devnet"]:ht,["testnet"]:xt,["mainnet"]:yt},Ws={[ht]:"devnet",[xt]:"testnet",[yt]:"mainnet"}});var zo=T(()=>{"use strict";t()});var St=T(()=>{"use strict";t()});var Je,qo=T(()=>{"use strict";t();Je="transaction-status-toast-id"});var Me,Qe,wt,eo,vt,ye,k=T(()=>{"use strict";t();xe();bt();zo();St();qo();Me=5e4,Qe=1e9,wt=1,eo="logout",vt="login",ye="0"});var Ko,R,Z,O=T(()=>{"use strict";t();Ko=require("@reduxjs/toolkit");k();R=(0,Ko.createAction)(eo),Z=(0,Ko.createAction)(vt,e=>({payload:e}))});var It,kt,At,rm,Et,mi,Oe,Lt,_i,Dt,Ct,Xo=T(()=>{"use strict";t();It=require("@reduxjs/toolkit");Ho();A();O();kt={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},At=(0,It.createSlice)({name:"loginInfoSlice",initialState:kt,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(R,()=>kt),e.addCase(Z,(o,n)=>{o.loginMethod=n.payload.loginMethod,Re(Pe())})}}),{setLoginMethod:rm,setWalletConnectLogin:Et,setLedgerLogin:mi,setTokenLogin:Oe,setTokenLoginSignature:Lt,setWalletLogin:_i,invalidateLoginSession:Dt}=At.actions,Ct=At.reducer});var Fe=T(()=>{"use strict";t()});var Pt=T(()=>{"use strict";t();Fe()});function Yo(e){return e[Math.floor(Math.random()*e.length)]}var Rt=T(()=>{"use strict";t()});var Zo=T(()=>{"use strict";t();zo()});var be=T(()=>{"use strict";t();Pt();Rt();Zo()});var Mt,Ot,Jo,di,Ft,xm,ym,Bt,Qo=T(()=>{"use strict";t();Mt=require("@reduxjs/toolkit"),Ot=x(require("lodash.omit"));be();Jo={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},di={network:Jo,chainID:"-1"},Ft=(0,Mt.createSlice)({name:"appConfig",initialState:di,reducers:{initializeNetworkConfig:(e,o)=>{let n=Yo(o.payload.walletConnectBridgeAddresses),r=Yo(o.payload.walletConnectV2RelayAddresses),p=(0,Ot.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=w(f(f({},e.network),p),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(e,o)=>{e.chainID=o.payload}}}),{initializeNetworkConfig:xm,setChainID:ym}=Ft.actions,Bt=Ft.reducer});var on,Ut,Wt,oo,en,Gt,nn,Em,tn,Lm,li,ui,Dm,Cm,Nm,gi,$t,rn=T(()=>{"use strict";t();on=require("@elrondnetwork/erdjs"),Ut=require("@reduxjs/toolkit"),Wt=require("redux-persist");k();he();Te();O();oo={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:ye},en={address:"",websocketEvent:null,accounts:{"":oo},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Gt=(0,Ut.createSlice)({name:"accountInfoSlice",initialState:en,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new on.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:oo},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(R,()=>(pe.local.removeItem(oe.loginExpiresAt),en)),e.addCase(Z,(o,n)=>{let{address:r}=n.payload;o.address=r,o.publicKey=new on.Address(r).hex()}),e.addCase(Wt.REHYDRATE,(o,n)=>{var g;if(!((g=n.payload)!=null&&g.account))return;let{account:r}=n.payload,{address:p,shard:s,accounts:m,publicKey:l}=r;o.address=p,o.shard=s;let d=m&&p in m;o.accounts=d?m:en.accounts,o.publicKey=l})}}),{setAccount:nn,setAddress:Em,setAccountNonce:tn,setAccountShard:Lm,setLedgerAccount:li,updateLedgerAccount:ui,setWalletConnectAccount:Dm,setIsAccountLoading:Cm,setAccountLoadingError:Nm,setWebsocketEvent:gi}=Gt.actions,$t=Gt.reducer});function Se(e){return e!=null&&(wi(e)||Ai(e))}function we(e){return e!=null&&(vi(e)||Ei(e))}function ve(e){return e!=null&&(ki(e)||Li(e))}function an(e){return e!=null&&Ii(e)}function wi(e){return e!=null&&fi.includes(e)}function vi(e){return e!=null&&Ti.includes(e)}function ki(e){return e!=null&&hi.includes(e)}function Ii(e){return e!=null&&xi.includes(e)}function Ai(e){return e!=null&&yi.includes(e)}function Ei(e){return e!=null&&bi.includes(e)}function Li(e){return e!=null&&Si.includes(e)}var fi,Ti,hi,xi,yi,bi,Si,ke=T(()=>{"use strict";t();A();fi=["sent"],Ti=["success"],hi=["fail","cancelled","timedOut"],xi=["timedOut"],yi=["pending"],bi=["success"],Si=["fail","invalid"]});var Vt,Ht,Ue,Di,jt,zt,qt,Ci,no,Ni,Pi,Gm,Ri,to,cn,ro,ao=T(()=>{"use strict";t();Vt=require("@reduxjs/toolkit"),Ht=require("redux-persist");A();ke();O();Ue={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Di={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},jt=(0,Vt.createSlice)({name:"transactionsSlice",initialState:Ue,reducers:{moveTransactionsToSignedState:(e,o)=>{var d,g;let{sessionId:n,transactions:r,errorMessage:p,status:s,redirectRoute:m}=o.payload,l=((d=e.customTransactionInformationForSessionId)==null?void 0:d[n])||Di;e.signedTransactions[n]={transactions:r,status:s,errorMessage:p,redirectRoute:m,customTransactionInformation:l},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===n&&(e.transactionsToSign=Ue.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=f(f({},e.signedTransactions),o.payload)},updateSignedTransactions:(e,o)=>{let{sessionId:n,status:r,errorMessage:p,transactions:s}=o.payload;e.signedTransactions[n]!=null&&(e.signedTransactions[n].status=r,p!=null&&(e.signedTransactions[n].errorMessage=p),s!=null&&(e.signedTransactions[n].transactions=s))},updateSignedTransactionStatus:(e,o)=>{var l,d,g,y,h,C;let{sessionId:n,status:r,errorMessage:p,transactionHash:s}=o.payload,m=(d=(l=e.signedTransactions)==null?void 0:l[n])==null?void 0:d.transactions;if(m!=null){e.signedTransactions[n].transactions=m.map(q=>q.hash===s?w(f({},q),{status:r,errorMessage:p}):q);let N=(y=(g=e.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:y.every(q=>we(q.status)),ee=(C=(h=e.signedTransactions[n])==null?void 0:h.transactions)==null?void 0:C.every(q=>ve(q.status));N&&(e.signedTransactions[n].status="success"),ee&&(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=Ue.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Ue.signedTransactions},setSignTransactionsError:(e,o)=>{e.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(e,o)=>{e.signTransactionsCancelMessage=o.payload}},extraReducers:e=>{e.addCase(R,()=>Ue),e.addCase(Ht.REHYDRATE,(o,n)=>{var m;if(o.signTransactionsCancelMessage=null,!((m=n.payload)!=null&&m.transactions))return;let{signedTransactions:r,customTransactionInformationForSessionId:p}=n.payload.transactions,s=Object.entries(r).reduce((l,[d,g])=>{let y=new Date(d),h=new Date;return h.setHours(h.getHours()+5),h-y>0||(l[d]=g),l},{});p!=null&&(o.customTransactionInformationForSessionId=p),r!=null&&(o.signedTransactions=s)})}}),{updateSignedTransactionStatus:zt,updateSignedTransactions:qt,setTransactionsToSign:Ci,clearAllTransactionsToSign:no,clearAllSignedTransactions:Ni,clearSignedTransaction:Pi,clearTransactionToSign:Gm,setSignTransactionsError:Ri,setSignTransactionsCancelMessage:to,moveTransactionsToSignedState:cn}=jt.actions,ro=jt.reducer});var Kt,sn,mn,_n,Mi,pn,Xt,jm,Oi,dn,io,co=T(()=>{"use strict";t();Kt=require("@reduxjs/toolkit");O();sn="Transaction failed",mn="Transaction successful",_n="Processing transaction",Mi="Transaction submitted",pn={},Xt=(0,Kt.createSlice)({name:"transactionsInfo",initialState:pn,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:r}=o.payload;n!=null&&(e[n]={errorMessage:(r==null?void 0:r.errorMessage)||sn,successMessage:(r==null?void 0:r.successMessage)||mn,processingMessage:(r==null?void 0:r.processingMessage)||_n,submittedMessage:(r==null?void 0:r.submittedMessage)||Mi,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(e,o){o.payload!=null&&delete e[o.payload]},clearTransactionsInfo:()=>pn},extraReducers:e=>{e.addCase(R,()=>pn)}}),{clearTransactionsInfo:jm,setTransactionsDisplayInfo:Oi,clearTransactionsInfoForSessionId:dn}=Xt.actions,io=Xt.reducer});var Zt,Yt,Jt,Xm,Fi,Ym,Bi,Qt,ln=T(()=>{"use strict";t();Zt=require("@reduxjs/toolkit");O();Yt={},Jt=(0,Zt.createSlice)({name:"modalsSlice",initialState:Yt,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(R,()=>Yt)}}),{setTxSubmittedModal:Xm,setNotificationModal:Fi,clearTxSubmittedModal:Ym,clearNotificationModal:Bi}=Jt.actions,Qt=Jt.reducer});var or,nr,er,tr,Ui,un,r_,a_,i_,c_,po,so=T(()=>{"use strict";t();or=require("@reduxjs/toolkit"),nr=require("redux-persist");qo();F();Uo();O();er={customToasts:[],transactionToasts:[],failTransactionToast:null},tr=(0,or.createSlice)({name:"toastsSlice",initialState:er,reducers:{addCustomToast:(e,o)=>{e.customToasts.push(w(f({},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=w(f({},o.payload),{toastId:Je})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(R,()=>er),e.addCase(nr.REHYDRATE,(o,n)=>{var p,s;let r=(s=(p=n.customToasts)==null?void 0:p.filter(m=>!("component"in m)))!=null?s:[];o.customToasts=r})}}),{addCustomToast:Ui,removeCustomToast:un,addTransactionToast:r_,removeTransactionToast:a_,addFailTransactionToast:i_,removeFailTransactionToast:c_}=tr.actions,po=tr.reducer});var I=T(()=>{"use strict";t();Xo();Qo();rn();ao();co();ln();so()});var gn=T(()=>{"use strict";t()});var cr,ir,pr,A_,E_,L_,D_,C_,N_,sr,mr=T(()=>{"use strict";t();cr=require("@reduxjs/toolkit");O();ir={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},pr=(0,cr.createSlice)({name:"dappModalsSlice",initialState:ir,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=f({},o.payload)}},extraReducers:e=>{e.addCase(R,()=>ir)}}),{setDappModalVisibility:A_,setDappModalHeaderVisibility:E_,setDappModalFooterVisibility:L_,setDappModalHeaderText:D_,setDappModalFooterText:C_,setDappModalConfig:N_}=pr.actions,sr=pr.reducer});var _r,Vi,Hi,Ie,_o=T(()=>{"use strict";t();_r=require("@reduxjs/toolkit");gn();rn();mr();Xo();ln();Qo();so();co();ao();Vi={["account"]:$t,["networkConfig"]:Bt,["loginInfo"]:Ct,["modals"]:Qt,["dappModal"]:sr,["toasts"]:po,["transactions"]:ro,["transactionsInfo"]:io},Hi=(e={})=>(0,_r.combineReducers)(f(f({},Vi),e)),Ie=Hi});var ur={};re(ur,{default:()=>Zi});function fn(e,o=[]){return{key:e,version:1,storage:lr.default,blacklist:o}}var me,dr,lr,ji,zi,qi,Ki,Xi,Yi,Zi,gr=T(()=>{"use strict";t();me=require("redux-persist"),dr=x(require("redux-persist/lib/storage")),lr=x(require("redux-persist/lib/storage/session"));_o();I();so();co();ao();gn();ji={2:e=>w(f({},e),{networkConfig:Jo})};zi=fn("dapp-core-transactionsInfo"),qi=fn("dapp-core-transactions",["transactionsToSign"]),Ki=fn("dapp-core-toasts"),Xi={key:"dapp-core-store",version:2,storage:dr.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,me.createMigrate)(ji,{debug:!1})},Yi={["toasts"]:(0,me.persistReducer)(Ki,po),["transactions"]:(0,me.persistReducer)(qi,ro),["transactionsInfo"]:(0,me.persistReducer)(zi,io)},Zi=(0,me.persistReducer)(Xi,Ie(Yi))});var fr={};re(fr,{default:()=>Ji});var Ji,Tr=T(()=>{"use strict";t();_o();Ji=Ie()});var hr={};re(hr,{default:()=>ec});var G,Qi,ec,xr=T(()=>{"use strict";t();G=require("redux-persist"),Qi=[G.FLUSH,G.REHYDRATE,G.PAUSE,G.PERSIST,G.PURGE,G.REGISTER],ec=Qi});var Sr={};re(Sr,{default:()=>br});function br(e){return(0,yr.persistStore)(e)}var yr,wr=T(()=>{"use strict";t();yr=require("redux-persist")});var Yp={};re(Yp,{TransactionInfoNonce:()=>Xp});module.exports=Ne(Yp);t();var Ge=x(require("react"));t();var Xe=x(require("react")),Ye=x(require("classnames"));t();var ri=`.dapp-core-component__detailItem-module__detail-item:last-child { border-bottom: 0 !important; }`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(ri));var rt={"detail-item":"dapp-core-component__detailItem-module__detail-item",detailItem:"dapp-core-component__detailItem-module__detail-item"};t();var ai=`.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(