@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
199 lines (178 loc) • 164 kB
JavaScript
"use strict";var qa=Object.create;var Fe=Object.defineProperty,Ka=Object.defineProperties,Xa=Object.getOwnPropertyDescriptor,Ya=Object.getOwnPropertyDescriptors,Za=Object.getOwnPropertyNames,Ye=Object.getOwnPropertySymbols,Ja=Object.getPrototypeOf,Do=Object.prototype.hasOwnProperty,Kn=Object.prototype.propertyIsEnumerable;var qn=(e,o,n)=>o in e?Fe(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,h=(e,o)=>{for(var n in o||(o={}))Do.call(o,n)&&qn(e,n,o[n]);if(Ye)for(var n of Ye(o))Kn.call(o,n)&&qn(e,n,o[n]);return e},S=(e,o)=>Ka(e,Ya(o));var Ze=(e,o)=>{var n={};for(var r in e)Do.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ye)for(var r of Ye(e))o.indexOf(r)<0&&Kn.call(e,r)&&(n[r]=e[r]);return n};var x=(e,o)=>()=>(e&&(o=e(e=0)),o);var Je=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),ae=(e,o)=>{for(var n in o)Fe(e,n,{get:o[n],enumerable:!0})},Xn=(e,o,n,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of Za(o))!Do.call(e,p)&&p!==n&&Fe(e,p,{get:()=>o[p],enumerable:!(r=Xa(o,p))||r.enumerable});return e};var f=(e,o,n)=>(n=e!=null?qa(Ja(e)):{},Xn(o||!e||!e.__esModule?Fe(n,"default",{value:e,enumerable:!0}):n,e)),Oe=e=>Xn(Fe({},"__esModule",{value:!0}),e);var b=(e,o,n)=>new Promise((r,p)=>{var s=_=>{try{l(n.next(_))}catch(g){p(g)}},m=_=>{try{l(n.throw(_))}catch(g){p(g)}},l=_=>_.done?r(_.value):Promise.resolve(_.value).then(s,m);l((n=n.apply(e,o)).next())});var Jn=Je(Qe=>{"use strict";t();Qe.byteLength=ei;Qe.toByteArray=ni;Qe.fromByteArray=ai;var z=[],W=[],Qa=typeof Uint8Array!="undefined"?Uint8Array:Array,No="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ie=0,Yn=No.length;ie<Yn;++ie)z[ie]=No[ie],W[No.charCodeAt(ie)]=ie;var ie,Yn;W["-".charCodeAt(0)]=62;W["_".charCodeAt(0)]=63;function Zn(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 ei(e){var o=Zn(e),n=o[0],r=o[1];return(n+r)*3/4-r}function oi(e,o,n){return(o+n)*3/4-n}function ni(e){var o,n=Zn(e),r=n[0],p=n[1],s=new Qa(oi(e,r,p)),m=0,l=p>0?r-4:r,_;for(_=0;_<l;_+=4)o=W[e.charCodeAt(_)]<<18|W[e.charCodeAt(_+1)]<<12|W[e.charCodeAt(_+2)]<<6|W[e.charCodeAt(_+3)],s[m++]=o>>16&255,s[m++]=o>>8&255,s[m++]=o&255;return p===2&&(o=W[e.charCodeAt(_)]<<2|W[e.charCodeAt(_+1)]>>4,s[m++]=o&255),p===1&&(o=W[e.charCodeAt(_)]<<10|W[e.charCodeAt(_+1)]<<4|W[e.charCodeAt(_+2)]>>2,s[m++]=o>>8&255,s[m++]=o&255),s}function ti(e){return z[e>>18&63]+z[e>>12&63]+z[e>>6&63]+z[e&63]}function ri(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(ti(r));return p.join("")}function ai(e){for(var o,n=e.length,r=n%3,p=[],s=16383,m=0,l=n-r;m<l;m+=s)p.push(ri(e,m,m+s>l?l:m+s));return r===1?(o=e[n-1],p.push(z[o>>2]+z[o<<4&63]+"==")):r===2&&(o=(e[n-2]<<8)+e[n-1],p.push(z[o>>10]+z[o>>4&63]+z[o<<2&63]+"=")),p.join("")}});var Qn=Je(Po=>{t();Po.read=function(e,o,n,r,p){var s,m,l=p*8-r-1,_=(1<<l)-1,g=_>>1,y=-7,T=n?p-1:0,D=n?-1:1,N=e[o+T];for(T+=D,s=N&(1<<-y)-1,N>>=-y,y+=l;y>0;s=s*256+e[o+T],T+=D,y-=8);for(m=s&(1<<-y)-1,s>>=-y,y+=r;y>0;m=m*256+e[o+T],T+=D,y-=8);if(s===0)s=1-g;else{if(s===_)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)};Po.write=function(e,o,n,r,p,s){var m,l,_,g=s*8-p-1,y=(1<<g)-1,T=y>>1,D=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,N=r?0:s-1,j=r?1:-1,V=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*(_=Math.pow(2,-m))<1&&(m--,_*=2),m+T>=1?o+=D/_:o+=D*Math.pow(2,1-T),o*_>=2&&(m++,_/=2),m+T>=y?(l=0,m=y):m+T>=1?(l=(o*_-1)*Math.pow(2,p),m=m+T):(l=o*Math.pow(2,T-1)*Math.pow(2,p),m=0));p>=8;e[n+N]=l&255,N+=j,l/=256,p-=8);for(m=m<<p|l,g+=p;g>0;e[n+N]=m&255,N+=j,m/=256,g-=8);e[n+N-j]|=V*128}});var _t=Je(fe=>{"use strict";t();var Mo=Jn(),ue=Qn(),et=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;fe.Buffer=d;fe.SlowBuffer=di;fe.INSPECT_MAX_BYTES=50;var eo=2147483647;fe.kMaxLength=eo;d.TYPED_ARRAY_SUPPORT=ii();!d.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 ii(){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(d.prototype,"parent",{enumerable:!0,get:function(){if(!!d.isBuffer(this))return this.buffer}});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(!!d.isBuffer(this))return this.byteOffset}});function Y(e){if(e>eo)throw new RangeError('The value "'+e+'" is invalid for option "size"');var o=new Uint8Array(e);return Object.setPrototypeOf(o,d.prototype),o}function d(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 Bo(e)}return tt(e,o,n)}d.poolSize=8192;function tt(e,o,n){if(typeof e=="string")return pi(e,o);if(ArrayBuffer.isView(e))return si(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(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return Fo(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 d.from(r,o,n);var p=mi(e);if(p)return p;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return d.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)}d.from=function(e,o,n){return tt(e,o,n)};Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function rt(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 ci(e,o,n){return rt(e),e<=0?Y(e):o!==void 0?typeof n=="string"?Y(e).fill(o,n):Y(e).fill(o):Y(e)}d.alloc=function(e,o,n){return ci(e,o,n)};function Bo(e){return rt(e),Y(e<0?0:Uo(e)|0)}d.allocUnsafe=function(e){return Bo(e)};d.allocUnsafeSlow=function(e){return Bo(e)};function pi(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!d.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=at(e,o)|0,r=Y(n),p=r.write(e,o);return p!==n&&(r=r.slice(0,p)),r}function Ro(e){for(var o=e.length<0?0:Uo(e.length)|0,n=Y(o),r=0;r<o;r+=1)n[r]=e[r]&255;return n}function si(e){if(q(e,Uint8Array)){var o=new Uint8Array(e);return Fo(o.buffer,o.byteOffset,o.byteLength)}return Ro(e)}function Fo(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,d.prototype),r}function mi(e){if(d.isBuffer(e)){var o=Uo(e.length)|0,n=Y(o);return n.length===0||e.copy(n,0,0,o),n}if(e.length!==void 0)return typeof e.length!="number"||Wo(e.length)?Y(0):Ro(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Ro(e.data)}function Uo(e){if(e>=eo)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+eo.toString(16)+" bytes");return e|0}function di(e){return+e!=e&&(e=0),d.alloc(+e)}d.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==d.prototype};d.compare=function(o,n){if(q(o,Uint8Array)&&(o=d.from(o,o.offset,o.byteLength)),q(n,Uint8Array)&&(n=d.from(n,n.offset,n.byteLength)),!d.isBuffer(o)||!d.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};d.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}};d.concat=function(o,n){if(!Array.isArray(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return d.alloc(0);var r;if(n===void 0)for(n=0,r=0;r<o.length;++r)n+=o[r].length;var p=d.allocUnsafe(n),s=0;for(r=0;r<o.length;++r){var m=o[r];if(q(m,Uint8Array))s+m.length>p.length?d.from(m).copy(p,s):Uint8Array.prototype.set.call(p,m,s);else if(d.isBuffer(m))m.copy(p,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=m.length}return p};function at(e,o){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(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 Oo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return dt(e).length;default:if(p)return r?-1:Oo(e).length;o=(""+o).toLowerCase(),p=!0}}d.byteLength=at;function _i(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 Si(this,o,n);case"utf8":case"utf-8":return ct(this,o,n);case"ascii":return yi(this,o,n);case"latin1":case"binary":return bi(this,o,n);case"base64":return Ti(this,o,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wi(this,o,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}d.prototype._isBuffer=!0;function ce(e,o,n){var r=e[o];e[o]=e[n],e[n]=r}d.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)ce(this,n,n+1);return this};d.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)ce(this,n,n+3),ce(this,n+1,n+2);return this};d.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)ce(this,n,n+7),ce(this,n+1,n+6),ce(this,n+2,n+5),ce(this,n+3,n+4);return this};d.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?ct(this,0,o):_i.apply(this,arguments)};d.prototype.toLocaleString=d.prototype.toString;d.prototype.equals=function(o){if(!d.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:d.compare(this,o)===0};d.prototype.inspect=function(){var o="",n=fe.INSPECT_MAX_BYTES;return o=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(o+=" ... "),"<Buffer "+o+">"};et&&(d.prototype[et]=d.prototype.inspect);d.prototype.compare=function(o,n,r,p,s){if(q(o,Uint8Array)&&(o=d.from(o,o.offset,o.byteLength)),!d.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,_=Math.min(m,l),g=this.slice(p,s),y=o.slice(n,r),T=0;T<_;++T)if(g[T]!==y[T]){m=g[T],l=y[T];break}return m<l?-1:l<m?1:0};function it(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,Wo(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=d.from(o,r)),d.isBuffer(o))return o.length===0?-1:ot(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):ot(e,[o],n,r,p);throw new TypeError("val must be string, number or Buffer")}function ot(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 _(N,j){return s===1?N[j]:N.readUInt16BE(j*s)}var g;if(p){var y=-1;for(g=n;g<m;g++)if(_(e,g)===_(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 T=!0,D=0;D<l;D++)if(_(e,g+D)!==_(o,D)){T=!1;break}if(T)return g}return-1}d.prototype.includes=function(o,n,r){return this.indexOf(o,n,r)!==-1};d.prototype.indexOf=function(o,n,r){return it(this,o,n,r,!0)};d.prototype.lastIndexOf=function(o,n,r){return it(this,o,n,r,!1)};function li(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(Wo(l))return m;e[n+m]=l}return m}function gi(e,o,n,r){return oo(Oo(o,e.length-n),e,n,r)}function ui(e,o,n,r){return oo(Ii(o),e,n,r)}function fi(e,o,n,r){return oo(dt(o),e,n,r)}function hi(e,o,n,r){return oo(Ai(o,e.length-n),e,n,r)}d.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 li(this,o,n,r);case"utf8":case"utf-8":return gi(this,o,n,r);case"ascii":case"latin1":case"binary":return ui(this,o,n,r);case"base64":return fi(this,o,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return hi(this,o,n,r);default:if(m)throw new TypeError("Unknown encoding: "+p);p=(""+p).toLowerCase(),m=!0}};d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ti(e,o,n){return o===0&&n===e.length?Mo.fromByteArray(e):Mo.fromByteArray(e.slice(o,n))}function ct(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 _,g,y,T;switch(l){case 1:s<128&&(m=s);break;case 2:_=e[p+1],(_&192)===128&&(T=(s&31)<<6|_&63,T>127&&(m=T));break;case 3:_=e[p+1],g=e[p+2],(_&192)===128&&(g&192)===128&&(T=(s&15)<<12|(_&63)<<6|g&63,T>2047&&(T<55296||T>57343)&&(m=T));break;case 4:_=e[p+1],g=e[p+2],y=e[p+3],(_&192)===128&&(g&192)===128&&(y&192)===128&&(T=(s&15)<<18|(_&63)<<12|(g&63)<<6|y&63,T>65535&&T<1114112&&(m=T))}}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 xi(r)}var nt=4096;function xi(e){var o=e.length;if(o<=nt)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<o;)n+=String.fromCharCode.apply(String,e.slice(r,r+=nt));return n}function yi(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 bi(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 Si(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+=Ei[e[s]];return p}function wi(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}d.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,d.prototype),p};function C(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")}d.prototype.readUintLE=d.prototype.readUIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||C(o,n,this.length);for(var p=this[o],s=1,m=0;++m<n&&(s*=256);)p+=this[o+m]*s;return p};d.prototype.readUintBE=d.prototype.readUIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||C(o,n,this.length);for(var p=this[o+--n],s=1;n>0&&(s*=256);)p+=this[o+--n]*s;return p};d.prototype.readUint8=d.prototype.readUInt8=function(o,n){return o=o>>>0,n||C(o,1,this.length),this[o]};d.prototype.readUint16LE=d.prototype.readUInt16LE=function(o,n){return o=o>>>0,n||C(o,2,this.length),this[o]|this[o+1]<<8};d.prototype.readUint16BE=d.prototype.readUInt16BE=function(o,n){return o=o>>>0,n||C(o,2,this.length),this[o]<<8|this[o+1]};d.prototype.readUint32LE=d.prototype.readUInt32LE=function(o,n){return o=o>>>0,n||C(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216};d.prototype.readUint32BE=d.prototype.readUInt32BE=function(o,n){return o=o>>>0,n||C(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])};d.prototype.readIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||C(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};d.prototype.readIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||C(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};d.prototype.readInt8=function(o,n){return o=o>>>0,n||C(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]};d.prototype.readInt16LE=function(o,n){o=o>>>0,n||C(o,2,this.length);var r=this[o]|this[o+1]<<8;return r&32768?r|4294901760:r};d.prototype.readInt16BE=function(o,n){o=o>>>0,n||C(o,2,this.length);var r=this[o+1]|this[o]<<8;return r&32768?r|4294901760:r};d.prototype.readInt32LE=function(o,n){return o=o>>>0,n||C(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24};d.prototype.readInt32BE=function(o,n){return o=o>>>0,n||C(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]};d.prototype.readFloatLE=function(o,n){return o=o>>>0,n||C(o,4,this.length),ue.read(this,o,!0,23,4)};d.prototype.readFloatBE=function(o,n){return o=o>>>0,n||C(o,4,this.length),ue.read(this,o,!1,23,4)};d.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||C(o,8,this.length),ue.read(this,o,!0,52,8)};d.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||C(o,8,this.length),ue.read(this,o,!1,52,8)};function F(e,o,n,r,p,s){if(!d.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")}d.prototype.writeUintLE=d.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;F(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};d.prototype.writeUintBE=d.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;F(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};d.prototype.writeUint8=d.prototype.writeUInt8=function(o,n,r){return o=+o,n=n>>>0,r||F(this,o,n,1,255,0),this[n]=o&255,n+1};d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||F(this,o,n,2,65535,0),this[n]=o&255,this[n+1]=o>>>8,n+2};d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||F(this,o,n,2,65535,0),this[n]=o>>>8,this[n+1]=o&255,n+2};d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||F(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};d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||F(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};d.prototype.writeIntLE=function(o,n,r,p){if(o=+o,n=n>>>0,!p){var s=Math.pow(2,8*r-1);F(this,o,n,r,s-1,-s)}var m=0,l=1,_=0;for(this[n]=o&255;++m<r&&(l*=256);)o<0&&_===0&&this[n+m-1]!==0&&(_=1),this[n+m]=(o/l>>0)-_&255;return n+r};d.prototype.writeIntBE=function(o,n,r,p){if(o=+o,n=n>>>0,!p){var s=Math.pow(2,8*r-1);F(this,o,n,r,s-1,-s)}var m=r-1,l=1,_=0;for(this[n+m]=o&255;--m>=0&&(l*=256);)o<0&&_===0&&this[n+m+1]!==0&&(_=1),this[n+m]=(o/l>>0)-_&255;return n+r};d.prototype.writeInt8=function(o,n,r){return o=+o,n=n>>>0,r||F(this,o,n,1,127,-128),o<0&&(o=255+o+1),this[n]=o&255,n+1};d.prototype.writeInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||F(this,o,n,2,32767,-32768),this[n]=o&255,this[n+1]=o>>>8,n+2};d.prototype.writeInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||F(this,o,n,2,32767,-32768),this[n]=o>>>8,this[n+1]=o&255,n+2};d.prototype.writeInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||F(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};d.prototype.writeInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||F(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 pt(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 st(e,o,n,r,p){return o=+o,n=n>>>0,p||pt(e,o,n,4,34028234663852886e22,-34028234663852886e22),ue.write(e,o,n,r,23,4),n+4}d.prototype.writeFloatLE=function(o,n,r){return st(this,o,n,!0,r)};d.prototype.writeFloatBE=function(o,n,r){return st(this,o,n,!1,r)};function mt(e,o,n,r,p){return o=+o,n=n>>>0,p||pt(e,o,n,8,17976931348623157e292,-17976931348623157e292),ue.write(e,o,n,r,52,8),n+8}d.prototype.writeDoubleLE=function(o,n,r){return mt(this,o,n,!0,r)};d.prototype.writeDoubleBE=function(o,n,r){return mt(this,o,n,!1,r)};d.prototype.copy=function(o,n,r,p){if(!d.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};d.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"&&!d.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=d.isBuffer(o)?o:d.from(o,p),_=l.length;if(_===0)throw new TypeError('The value "'+o+'" is invalid for argument "value"');for(m=0;m<r-n;++m)this[m+n]=l[m%_]}return this};var vi=/[^+/0-9A-Za-z-_]/g;function ki(e){if(e=e.split("=")[0],e=e.trim().replace(vi,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Oo(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 Ii(e){for(var o=[],n=0;n<e.length;++n)o.push(e.charCodeAt(n)&255);return o}function Ai(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 dt(e){return Mo.toByteArray(ki(e))}function oo(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 q(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function Wo(e){return e!==e}var Ei=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 ht=Je((Cs,ft)=>{t();var E=ft.exports={},K,X;function Go(){throw new Error("setTimeout has not been defined")}function Ho(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?K=setTimeout:K=Go}catch(e){K=Go}try{typeof clearTimeout=="function"?X=clearTimeout:X=Ho}catch(e){X=Ho}})();function lt(e){if(K===setTimeout)return setTimeout(e,0);if((K===Go||!K)&&setTimeout)return K=setTimeout,setTimeout(e,0);try{return K(e,0)}catch(o){try{return K.call(null,e,0)}catch(n){return K.call(this,e,0)}}}function Li(e){if(X===clearTimeout)return clearTimeout(e);if((X===Ho||!X)&&clearTimeout)return X=clearTimeout,clearTimeout(e);try{return X(e)}catch(o){try{return X.call(null,e)}catch(n){return X.call(this,e)}}}var Z=[],he=!1,pe,no=-1;function Ci(){!he||!pe||(he=!1,pe.length?Z=pe.concat(Z):no=-1,Z.length&>())}function gt(){if(!he){var e=lt(Ci);he=!0;for(var o=Z.length;o;){for(pe=Z,Z=[];++no<o;)pe&&pe[no].run();no=-1,o=Z.length}pe=null,he=!1,Li(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];Z.push(new ut(e,o)),Z.length===1&&!he&<(gt)};function ut(e,o){this.fun=e,this.array=o}ut.prototype.run=function(){this.fun.apply(null,this.array)};E.title="browser";E.browser=!0;E.env={};E.argv=[];E.version="";E.versions={};function J(){}E.on=J;E.addListener=J;E.once=J;E.off=J;E.removeListener=J;E.removeAllListeners=J;E.emit=J;E.prependListener=J;E.prependOnceListener=J;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,Ds,t=x(()=>{a=f(_t()),i=f(ht()),Ds=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 $o,Te=x(()=>{"use strict";t();$o="Transaction canceled"});var to,Vo=x(()=>{"use strict";t();to=()=>Date.now()/1e3});var Tt=x(()=>{"use strict";t()});var xt=x(()=>{"use strict";t()});var jo=x(()=>{"use strict";t();Vo();Tt();xt()});var qo={};ae(qo,{getItem:()=>Pi,localStorageKeys:()=>ne,removeItem:()=>Mi,setItem:()=>Ni});var ne,zo,Ni,Pi,Mi,xe=x(()=>{"use strict";t();jo();ne={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},zo=typeof localStorage!="undefined",Ni=({key:e,data:o,expires:n})=>{!zo||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},Pi=e=>{if(!zo)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:to()>=n.expires?(localStorage.removeItem(String(e)),null):n.data},Mi=e=>{!zo||localStorage.removeItem(String(e))}});var Ko={};ae(Ko,{clear:()=>wt,getItem:()=>bt,removeItem:()=>St,setItem:()=>yt,storage:()=>Ri});var yt,bt,St,wt,Ri,vt=x(()=>{"use strict";t();yt=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},bt=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},St=e=>sessionStorage.removeItem(String(e)),wt=()=>sessionStorage.clear(),Ri={setItem:yt,getItem:bt,removeItem:St,clear:wt}});var se,ye=x(()=>{"use strict";t();xe();vt();se={session:Ko,local:qo}});function Be(){return new Date().setHours(new Date().getHours()+24)}function Ue(e){se.local.setItem({key:ne.loginExpiresAt,data:e,expires:e})}var Xo=x(()=>{"use strict";t();ye();xe()});var A=x(()=>{"use strict";t()});var kt=x(()=>{"use strict";t()});var P=x(()=>{"use strict";t()});var It=x(()=>{"use strict";t()});var At=x(()=>{"use strict";t()});var Et=x(()=>{"use strict";t()});var Lt=x(()=>{"use strict";t()});var B=x(()=>{"use strict";t();kt();P();A();It();At();Et();Lt()});var Yo,Ct,im,Dt,cm,Nt,pm,sm,mm,Pt=x(()=>{"use strict";t();B();Yo={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:Ct,egldLabel:im}=Yo["devnet"],{chainId:Dt,egldLabel:cm}=Yo["testnet"],{chainId:Nt,egldLabel:pm}=Yo["mainnet"],sm={["devnet"]:Ct,["testnet"]:Dt,["mainnet"]:Nt},mm={[Ct]:"devnet",[Dt]:"testnet",[Nt]:"mainnet"}});var Zo=x(()=>{"use strict";t()});var Mt=x(()=>{"use strict";t()});var ro,Jo=x(()=>{"use strict";t();ro="transaction-status-toast-id"});var We,ao,Rt,io,Ft,be,k=x(()=>{"use strict";t();Te();Pt();Zo();Mt();Jo();We=5e4,ao=1e9,Rt=1,io="logout",Ft="login",be="0"});var Qo,M,Q,O=x(()=>{"use strict";t();Qo=require("@reduxjs/toolkit");k();M=(0,Qo.createAction)(io),Q=(0,Qo.createAction)(Ft,e=>({payload:e}))});var Bt,Ot,Ut,Em,Wt,Fi,Ge,Gt,Oi,Ht,$t,en=x(()=>{"use strict";t();Bt=require("@reduxjs/toolkit");Xo();A();O();Ot={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Ut=(0,Bt.createSlice)({name:"loginInfoSlice",initialState:Ot,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(M,()=>Ot),e.addCase(Q,(o,n)=>{o.loginMethod=n.payload.loginMethod,Ue(Be())})}}),{setLoginMethod:Em,setWalletConnectLogin:Wt,setLedgerLogin:Fi,setTokenLogin:Ge,setTokenLoginSignature:Gt,setWalletLogin:Oi,invalidateLoginSession:Ht}=Ut.actions,$t=Ut.reducer});var He=x(()=>{"use strict";t()});var jt=x(()=>{"use strict";t();He()});function on(e){return e[Math.floor(Math.random()*e.length)]}var zt=x(()=>{"use strict";t()});var nn=x(()=>{"use strict";t();Zo()});var Se=x(()=>{"use strict";t();jt();zt();nn()});var qt,Kt,tn,Bi,Xt,$m,Vm,Yt,rn=x(()=>{"use strict";t();qt=require("@reduxjs/toolkit"),Kt=f(require("lodash.omit"));Se();tn={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Bi={network:tn,chainID:"-1"},Xt=(0,qt.createSlice)({name:"appConfig",initialState:Bi,reducers:{initializeNetworkConfig:(e,o)=>{let n=on(o.payload.walletConnectBridgeAddresses),r=on(o.payload.walletConnectV2RelayAddresses),p=(0,Kt.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=S(h(h({},e.network),p),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(e,o)=>{e.chainID=o.payload}}}),{initializeNetworkConfig:$m,setChainID:Vm}=Xt.actions,Yt=Xt.reducer});var cn,Zt,Jt,co,an,Qt,pn,Jm,sn,Qm,Ui,Wi,ed,od,nd,Gi,er,mn=x(()=>{"use strict";t();cn=require("@elrondnetwork/erdjs"),Zt=require("@reduxjs/toolkit"),Jt=require("redux-persist");k();ye();xe();O();co={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:be},an={address:"",websocketEvent:null,accounts:{"":co},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Qt=(0,Zt.createSlice)({name:"accountInfoSlice",initialState:an,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new cn.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:co},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(M,()=>(se.local.removeItem(ne.loginExpiresAt),an)),e.addCase(Q,(o,n)=>{let{address:r}=n.payload;o.address=r,o.publicKey=new cn.Address(r).hex()}),e.addCase(Jt.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 _=m&&p in m;o.accounts=_?m:an.accounts,o.publicKey=l})}}),{setAccount:pn,setAddress:Jm,setAccountNonce:sn,setAccountShard:Qm,setLedgerAccount:Ui,updateLedgerAccount:Wi,setWalletConnectAccount:ed,setIsAccountLoading:od,setAccountLoadingError:nd,setWebsocketEvent:Gi}=Qt.actions,er=Qt.reducer});function we(e){return e!=null&&(Xi(e)||Qi(e))}function ve(e){return e!=null&&(Yi(e)||ec(e))}function ke(e){return e!=null&&(Zi(e)||oc(e))}function dn(e){return e!=null&&Ji(e)}function Xi(e){return e!=null&&Hi.includes(e)}function Yi(e){return e!=null&&$i.includes(e)}function Zi(e){return e!=null&&Vi.includes(e)}function Ji(e){return e!=null&&ji.includes(e)}function Qi(e){return e!=null&&zi.includes(e)}function ec(e){return e!=null&&qi.includes(e)}function oc(e){return e!=null&&Ki.includes(e)}var Hi,$i,Vi,ji,zi,qi,Ki,Ie=x(()=>{"use strict";t();A();Hi=["sent"],$i=["success"],Vi=["fail","cancelled","timedOut"],ji=["timedOut"],zi=["pending"],qi=["success"],Ki=["fail","invalid"]});var or,nr,Ve,nc,tr,rr,ar,tc,je,rc,ac,dd,ic,ze,_n,po,so=x(()=>{"use strict";t();or=require("@reduxjs/toolkit"),nr=require("redux-persist");A();Ie();O();Ve={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},nc={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},tr=(0,or.createSlice)({name:"transactionsSlice",initialState:Ve,reducers:{moveTransactionsToSignedState:(e,o)=>{var _,g;let{sessionId:n,transactions:r,errorMessage:p,status:s,redirectRoute:m}=o.payload,l=((_=e.customTransactionInformationForSessionId)==null?void 0:_[n])||nc;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=Ve.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=h(h({},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,_,g,y,T,D;let{sessionId:n,status:r,errorMessage:p,transactionHash:s}=o.payload,m=(_=(l=e.signedTransactions)==null?void 0:l[n])==null?void 0:_.transactions;if(m!=null){e.signedTransactions[n].transactions=m.map(V=>V.hash===s?S(h({},V),{status:r,errorMessage:p}):V);let N=(y=(g=e.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:y.every(V=>ve(V.status)),j=(D=(T=e.signedTransactions[n])==null?void 0:T.transactions)==null?void 0:D.every(V=>ke(V.status));N&&(e.signedTransactions[n].status="success"),j&&(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=Ve.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Ve.signedTransactions},setSignTransactionsError:(e,o)=>{e.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(e,o)=>{e.signTransactionsCancelMessage=o.payload}},extraReducers:e=>{e.addCase(M,()=>Ve),e.addCase(nr.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,[_,g])=>{let y=new Date(_),T=new Date;return T.setHours(T.getHours()+5),T-y>0||(l[_]=g),l},{});p!=null&&(o.customTransactionInformationForSessionId=p),r!=null&&(o.signedTransactions=s)})}}),{updateSignedTransactionStatus:rr,updateSignedTransactions:ar,setTransactionsToSign:tc,clearAllTransactionsToSign:je,clearAllSignedTransactions:rc,clearSignedTransaction:ac,clearTransactionToSign:dd,setSignTransactionsError:ic,setSignTransactionsCancelMessage:ze,moveTransactionsToSignedState:_n}=tr.actions,po=tr.reducer});var ir,gn,un,fn,cc,ln,cr,ud,pc,mo,_o,lo=x(()=>{"use strict";t();ir=require("@reduxjs/toolkit");O();gn="Transaction failed",un="Transaction successful",fn="Processing transaction",cc="Transaction submitted",ln={},cr=(0,ir.createSlice)({name:"transactionsInfo",initialState:ln,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:r}=o.payload;n!=null&&(e[n]={errorMessage:(r==null?void 0:r.errorMessage)||gn,successMessage:(r==null?void 0:r.successMessage)||un,processingMessage:(r==null?void 0:r.processingMessage)||fn,submittedMessage:(r==null?void 0:r.submittedMessage)||cc,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(e,o){o.payload!=null&&delete e[o.payload]},clearTransactionsInfo:()=>ln},extraReducers:e=>{e.addCase(M,()=>ln)}}),{clearTransactionsInfo:ud,setTransactionsDisplayInfo:pc,clearTransactionsInfoForSessionId:mo}=cr.actions,_o=cr.reducer});var sr,pr,mr,xd,sc,yd,mc,dr,hn=x(()=>{"use strict";t();sr=require("@reduxjs/toolkit");O();pr={},mr=(0,sr.createSlice)({name:"modalsSlice",initialState:pr,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(M,()=>pr)}}),{setTxSubmittedModal:xd,setNotificationModal:sc,clearTxSubmittedModal:yd,clearNotificationModal:mc}=mr.actions,dr=mr.reducer});var lr,gr,_r,ur,dc,Tn,Ed,Ld,Cd,Dd,go,uo=x(()=>{"use strict";t();lr=require("@reduxjs/toolkit"),gr=require("redux-persist");Jo();B();Vo();O();_r={customToasts:[],transactionToasts:[],failTransactionToast:null},ur=(0,lr.createSlice)({name:"toastsSlice",initialState:_r,reducers:{addCustomToast:(e,o)=>{e.customToasts.push(S(h({},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:to(),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=S(h({},o.payload),{toastId:ro})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(M,()=>_r),e.addCase(gr.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:dc,removeCustomToast:Tn,addTransactionToast:Ed,removeTransactionToast:Ld,addFailTransactionToast:Cd,removeFailTransactionToast:Dd}=ur.actions,go=ur.reducer});var I=x(()=>{"use strict";t();en();rn();mn();so();lo();hn();uo()});var xn=x(()=>{"use strict";t()});var xr,Tr,yr,yn,Zd,Jd,Qd,e_,br,Sr,bn=x(()=>{"use strict";t();xr=require("@reduxjs/toolkit");O();Tr={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},yr=(0,xr.createSlice)({name:"dappModalsSlice",initialState:Tr,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=h({},o.payload)}},extraReducers:e=>{e.addCase(M,()=>Tr)}}),{setDappModalVisibility:yn,setDappModalHeaderVisibility:Zd,setDappModalFooterVisibility:Jd,setDappModalHeaderText:Qd,setDappModalFooterText:e_,setDappModalConfig:br}=yr.actions,Sr=yr.reducer});var wr,uc,fc,Ae,ho=x(()=>{"use strict";t();wr=require("@reduxjs/toolkit");xn();mn();bn();en();hn();rn();uo();lo();so();uc={["account"]:er,["networkConfig"]:Yt,["loginInfo"]:$t,["modals"]:dr,["dappModal"]:Sr,["toasts"]:go,["transactions"]:po,["transactionsInfo"]:_o},fc=(e={})=>(0,wr.combineReducers)(h(h({},uc),e)),Ae=fc});var Ir={};ae(Ir,{default:()=>wc});function Sn(e,o=[]){return{key:e,version:1,storage:kr.default,blacklist:o}}var de,vr,kr,hc,Tc,xc,yc,bc,Sc,wc,Ar=x(()=>{"use strict";t();de=require("redux-persist"),vr=f(require("redux-persist/lib/storage")),kr=f(require("redux-persist/lib/storage/session"));ho();I();uo();lo();so();xn();hc={2:e=>S(h({},e),{networkConfig:tn})};Tc=Sn("dapp-core-transactionsInfo"),xc=Sn("dapp-core-transactions",["transactionsToSign"]),yc=Sn("dapp-core-toasts"),bc={key:"dapp-core-store",version:2,storage:vr.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,de.createMigrate)(hc,{debug:!1})},Sc={["toasts"]:(0,de.persistReducer)(yc,go),["transactions"]:(0,de.persistReducer)(xc,po),["transactionsInfo"]:(0,de.persistReducer)(Tc,_o)},wc=(0,de.persistReducer)(bc,Ae(Sc))});var Er={};ae(Er,{default:()=>vc});var vc,Lr=x(()=>{"use strict";t();ho();vc=Ae()});var Cr={};ae(Cr,{default:()=>Ic});var H,kc,Ic,Dr=x(()=>{"use strict";t();H=require("redux-persist"),kc=[H.FLUSH,H.REHYDRATE,H.PAUSE,H.PERSIST,H.PURGE,H.REGISTER],Ic=kc});var Mr={};ae(Mr,{default:()=>Pr});function Pr(e){return(0,Nr.persistStore)(e)}var Nr,Rr=x(()=>{"use strict";t();Nr=require("redux-persist")});var ks={};ae(ks,{SignWithExtensionModal:()=>vs});module.exports=Oe(ks);t();var Co=f(require("react")),$a=require("@fortawesome/free-solid-svg-icons"),zn=f(require("classnames"));t();var Di=`.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) {
left: 6px;
animation: dapp-core-component__main__lds-ellipsis2 0.6s infinite;
}
.dapp-core-component__main__page-state .dap