UNPKG

@sofaws/dapp-core

Version:

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

199 lines (178 loc) 163 kB
"use strict";var qa=Object.create;var Fe=Object.defineProperty,Ka=Object.defineProperties,Xa=Object.getOwnPropertyDescriptor,Ya=Object.getOwnPropertyDescriptors,Za=Object.getOwnPropertyNames,Ke=Object.getOwnPropertySymbols,Ja=Object.getPrototypeOf,Co=Object.prototype.hasOwnProperty,qn=Object.prototype.propertyIsEnumerable;var zn=(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={}))Co.call(o,n)&&zn(e,n,o[n]);if(Ke)for(var n of Ke(o))qn.call(o,n)&&zn(e,n,o[n]);return e},w=(e,o)=>Ka(e,Ya(o));var Xe=(e,o)=>{var n={};for(var r in e)Co.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ke)for(var r of Ke(e))o.indexOf(r)<0&&qn.call(e,r)&&(n[r]=e[r]);return n};var x=(e,o)=>()=>(e&&(o=e(e=0)),o);var Ye=(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})},Kn=(e,o,n,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of Za(o))!Co.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)):{},Kn(o||!e||!e.__esModule?Fe(n,"default",{value:e,enumerable:!0}):n,e)),Oe=e=>Kn(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 Zn=Ye(Ze=>{"use strict";t();Ze.byteLength=ei;Ze.toByteArray=ni;Ze.fromByteArray=ai;var z=[],W=[],Qa=typeof Uint8Array!="undefined"?Uint8Array:Array,Do="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ie=0,Xn=Do.length;ie<Xn;++ie)z[ie]=Do[ie],W[Do.charCodeAt(ie)]=ie;var ie,Xn;W["-".charCodeAt(0)]=62;W["_".charCodeAt(0)]=63;function Yn(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=Yn(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=Yn(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 Jn=Ye(No=>{t();No.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,C=n?-1:1,D=e[o+T];for(T+=C,s=D&(1<<-y)-1,D>>=-y,y+=l;y>0;s=s*256+e[o+T],T+=C,y-=8);for(m=s&(1<<-y)-1,s>>=-y,y+=r;y>0;m=m*256+e[o+T],T+=C,y-=8);if(s===0)s=1-g;else{if(s===_)return m?NaN:(D?-1:1)*(1/0);m=m+Math.pow(2,r),s=s-g}return(D?-1:1)*m*Math.pow(2,s-r)};No.write=function(e,o,n,r,p,s){var m,l,_,g=s*8-p-1,y=(1<<g)-1,T=y>>1,C=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,D=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+=C/_:o+=C*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+D]=l&255,D+=j,l/=256,p-=8);for(m=m<<p|l,g+=p;g>0;e[n+D]=m&255,D+=j,m/=256,g-=8);e[n+D-j]|=V*128}});var dt=Ye(fe=>{"use strict";t();var Po=Zn(),ue=Jn(),Qn=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 Je=2147483647;fe.kMaxLength=Je;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>Je)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 Oo(e)}return nt(e,o,n)}d.poolSize=8192;function nt(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 Ro(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 nt(e,o,n)};Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function tt(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 tt(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 Oo(e){return tt(e),Y(e<0?0:Bo(e)|0)}d.allocUnsafe=function(e){return Oo(e)};d.allocUnsafeSlow=function(e){return Oo(e)};function pi(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!d.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=rt(e,o)|0,r=Y(n),p=r.write(e,o);return p!==n&&(r=r.slice(0,p)),r}function Mo(e){for(var o=e.length<0?0:Bo(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 Ro(o.buffer,o.byteOffset,o.byteLength)}return Mo(e)}function Ro(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=Bo(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"||Uo(e.length)?Y(0):Mo(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Mo(e.data)}function Bo(e){if(e>=Je)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Je.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 rt(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 Fo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return mt(e).length;default:if(p)return r?-1:Fo(e).length;o=(""+o).toLowerCase(),p=!0}}d.byteLength=rt;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 it(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?it(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+">"};Qn&&(d.prototype[Qn]=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 at(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,Uo(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:et(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):et(e,[o],n,r,p);throw new TypeError("val must be string, number or Buffer")}function et(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,j){return s===1?D[j]:D.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,C=0;C<l;C++)if(_(e,g+C)!==_(o,C)){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 at(this,o,n,r,!0)};d.prototype.lastIndexOf=function(o,n,r){return at(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(Uo(l))return m;e[n+m]=l}return m}function gi(e,o,n,r){return Qe(Fo(o,e.length-n),e,n,r)}function ui(e,o,n,r){return Qe(Ii(o),e,n,r)}function fi(e,o,n,r){return Qe(mt(o),e,n,r)}function hi(e,o,n,r){return Qe(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?Po.fromByteArray(e):Po.fromByteArray(e.slice(o,n))}function it(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 ot=4096;function xi(e){var o=e.length;if(o<=ot)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<o;)n+=String.fromCharCode.apply(String,e.slice(r,r+=ot));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 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")}d.prototype.readUintLE=d.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};d.prototype.readUintBE=d.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};d.prototype.readUint8=d.prototype.readUInt8=function(o,n){return o=o>>>0,n||L(o,1,this.length),this[o]};d.prototype.readUint16LE=d.prototype.readUInt16LE=function(o,n){return o=o>>>0,n||L(o,2,this.length),this[o]|this[o+1]<<8};d.prototype.readUint16BE=d.prototype.readUInt16BE=function(o,n){return o=o>>>0,n||L(o,2,this.length),this[o]<<8|this[o+1]};d.prototype.readUint32LE=d.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};d.prototype.readUint32BE=d.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])};d.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};d.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};d.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]};d.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};d.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};d.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};d.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]};d.prototype.readFloatLE=function(o,n){return o=o>>>0,n||L(o,4,this.length),ue.read(this,o,!0,23,4)};d.prototype.readFloatBE=function(o,n){return o=o>>>0,n||L(o,4,this.length),ue.read(this,o,!1,23,4)};d.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||L(o,8,this.length),ue.read(this,o,!0,52,8)};d.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||L(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 ct(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 pt(e,o,n,r,p){return o=+o,n=n>>>0,p||ct(e,o,n,4,34028234663852886e22,-34028234663852886e22),ue.write(e,o,n,r,23,4),n+4}d.prototype.writeFloatLE=function(o,n,r){return pt(this,o,n,!0,r)};d.prototype.writeFloatBE=function(o,n,r){return pt(this,o,n,!1,r)};function st(e,o,n,r,p){return o=+o,n=n>>>0,p||ct(e,o,n,8,17976931348623157e292,-17976931348623157e292),ue.write(e,o,n,r,52,8),n+8}d.prototype.writeDoubleLE=function(o,n,r){return st(this,o,n,!0,r)};d.prototype.writeDoubleBE=function(o,n,r){return st(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 Fo(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 mt(e){return Po.toByteArray(ki(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 q(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function Uo(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 ft=Ye((Ds,ut)=>{t();var E=ut.exports={},K,X;function Wo(){throw new Error("setTimeout has not been defined")}function Go(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?K=setTimeout:K=Wo}catch(e){K=Wo}try{typeof clearTimeout=="function"?X=clearTimeout:X=Go}catch(e){X=Go}})();function _t(e){if(K===setTimeout)return setTimeout(e,0);if((K===Wo||!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===Go||!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,eo=-1;function Ci(){!he||!pe||(he=!1,pe.length?Z=pe.concat(Z):eo=-1,Z.length&&lt())}function lt(){if(!he){var e=_t(Ci);he=!0;for(var o=Z.length;o;){for(pe=Z,Z=[];++eo<o;)pe&&pe[eo].run();eo=-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 gt(e,o)),Z.length===1&&!he&&_t(lt)};function gt(e,o){this.fun=e,this.array=o}gt.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,Ns,t=x(()=>{a=f(dt()),i=f(ft()),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 oo,Ho=x(()=>{"use strict";t();oo=()=>Date.now()/1e3});var ht=x(()=>{"use strict";t()});var Tt=x(()=>{"use strict";t()});var $o=x(()=>{"use strict";t();Ho();ht();Tt()});var jo={};ae(jo,{getItem:()=>Pi,localStorageKeys:()=>ne,removeItem:()=>Mi,setItem:()=>Ni});var ne,Vo,Ni,Pi,Mi,Te=x(()=>{"use strict";t();$o();ne={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Vo=typeof localStorage!="undefined",Ni=({key:e,data:o,expires:n})=>{!Vo||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},Pi=e=>{if(!Vo)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:oo()>=n.expires?(localStorage.removeItem(String(e)),null):n.data},Mi=e=>{!Vo||localStorage.removeItem(String(e))}});var zo={};ae(zo,{clear:()=>St,getItem:()=>yt,removeItem:()=>bt,setItem:()=>xt,storage:()=>Ri});var xt,yt,bt,St,Ri,wt=x(()=>{"use strict";t();xt=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},yt=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},bt=e=>sessionStorage.removeItem(String(e)),St=()=>sessionStorage.clear(),Ri={setItem:xt,getItem:yt,removeItem:bt,clear:St}});var se,xe=x(()=>{"use strict";t();Te();wt();se={session:zo,local:jo}});function Be(){return new Date().setHours(new Date().getHours()+24)}function Ue(e){se.local.setItem({key:ne.loginExpiresAt,data:e,expires:e})}var qo=x(()=>{"use strict";t();xe();Te()});var A=x(()=>{"use strict";t()});var ye=x(()=>{"use strict";t()});var vt=x(()=>{"use strict";t()});var P=x(()=>{"use strict";t()});var kt=x(()=>{"use strict";t()});var It=x(()=>{"use strict";t()});var At=x(()=>{"use strict";t()});var Et=x(()=>{"use strict";t()});var O=x(()=>{"use strict";t();vt();P();A();kt();It();At();Et()});var Ko,Lt,cm,Ct,pm,Dt,sm,mm,dm,Nt=x(()=>{"use strict";t();O();Ko={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:Lt,egldLabel:cm}=Ko["devnet"],{chainId:Ct,egldLabel:pm}=Ko["testnet"],{chainId:Dt,egldLabel:sm}=Ko["mainnet"],mm={["devnet"]:Lt,["testnet"]:Ct,["mainnet"]:Dt},dm={[Lt]:"devnet",[Ct]:"testnet",[Dt]:"mainnet"}});var Xo=x(()=>{"use strict";t()});var Pt=x(()=>{"use strict";t()});var no,Yo=x(()=>{"use strict";t();no="transaction-status-toast-id"});var We,to,Mt,ro,Rt,be,k=x(()=>{"use strict";t();ye();Nt();Xo();Pt();Yo();We=5e4,to=1e9,Mt=1,ro="logout",Rt="login",be="0"});var Zo,M,Q,B=x(()=>{"use strict";t();Zo=require("@reduxjs/toolkit");k();M=(0,Zo.createAction)(ro),Q=(0,Zo.createAction)(Rt,e=>({payload:e}))});var Ot,Ft,Bt,Lm,Ut,Fi,Ge,Wt,Oi,Gt,Ht,Jo=x(()=>{"use strict";t();Ot=require("@reduxjs/toolkit");qo();A();B();Ft={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Bt=(0,Ot.createSlice)({name:"loginInfoSlice",initialState:Ft,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,()=>Ft),e.addCase(Q,(o,n)=>{o.loginMethod=n.payload.loginMethod,Ue(Be())})}}),{setLoginMethod:Lm,setWalletConnectLogin:Ut,setLedgerLogin:Fi,setTokenLogin:Ge,setTokenLoginSignature:Wt,setWalletLogin:Oi,invalidateLoginSession:Gt}=Bt.actions,Ht=Bt.reducer});var He=x(()=>{"use strict";t()});var Vt=x(()=>{"use strict";t();He()});function Qo(e){return e[Math.floor(Math.random()*e.length)]}var jt=x(()=>{"use strict";t()});var en=x(()=>{"use strict";t();Xo()});var Se=x(()=>{"use strict";t();Vt();jt();en()});var zt,qt,on,Bi,Kt,Vm,jm,Xt,nn=x(()=>{"use strict";t();zt=require("@reduxjs/toolkit"),qt=f(require("lodash.omit"));Se();on={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:on,chainID:"-1"},Kt=(0,zt.createSlice)({name:"appConfig",initialState:Bi,reducers:{initializeNetworkConfig:(e,o)=>{let n=Qo(o.payload.walletConnectBridgeAddresses),r=Qo(o.payload.walletConnectV2RelayAddresses),p=(0,qt.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=w(h(h({},e.network),p),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(e,o)=>{e.chainID=o.payload}}}),{initializeNetworkConfig:Vm,setChainID:jm}=Kt.actions,Xt=Kt.reducer});var rn,Yt,Zt,ao,tn,Jt,an,Qm,cn,ed,Ui,Wi,od,nd,td,Gi,Qt,pn=x(()=>{"use strict";t();rn=require("@elrondnetwork/erdjs"),Yt=require("@reduxjs/toolkit"),Zt=require("redux-persist");k();xe();Te();B();ao={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:be},tn={address:"",websocketEvent:null,accounts:{"":ao},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Jt=(0,Yt.createSlice)({name:"accountInfoSlice",initialState:tn,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new rn.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:ao},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),tn)),e.addCase(Q,(o,n)=>{let{address:r}=n.payload;o.address=r,o.publicKey=new rn.Address(r).hex()}),e.addCase(Zt.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:tn.accounts,o.publicKey=l})}}),{setAccount:an,setAddress:Qm,setAccountNonce:cn,setAccountShard:ed,setLedgerAccount:Ui,updateLedgerAccount:Wi,setWalletConnectAccount:od,setIsAccountLoading:nd,setAccountLoadingError:td,setWebsocketEvent:Gi}=Jt.actions,Qt=Jt.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 sn(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 er,or,Ve,nc,nr,tr,rr,tc,io,rc,ac,_d,ic,co,mn,po,so=x(()=>{"use strict";t();er=require("@reduxjs/toolkit"),or=require("redux-persist");A();Ie();B();Ve={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},nc={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},nr=(0,er.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,C;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?w(h({},V),{status:r,errorMessage:p}):V);let D=(y=(g=e.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:y.every(V=>ve(V.status)),j=(C=(T=e.signedTransactions[n])==null?void 0:T.transactions)==null?void 0:C.every(V=>ke(V.status));D&&(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(or.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:tr,updateSignedTransactions:rr,setTransactionsToSign:tc,clearAllTransactionsToSign:io,clearAllSignedTransactions:rc,clearSignedTransaction:ac,clearTransactionToSign:_d,setSignTransactionsError:ic,setSignTransactionsCancelMessage:co,moveTransactionsToSignedState:mn}=nr.actions,po=nr.reducer});var ar,_n,ln,gn,cc,dn,ir,fd,pc,un,mo,_o=x(()=>{"use strict";t();ar=require("@reduxjs/toolkit");B();_n="Transaction failed",ln="Transaction successful",gn="Processing transaction",cc="Transaction submitted",dn={},ir=(0,ar.createSlice)({name:"transactionsInfo",initialState:dn,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:r}=o.payload;n!=null&&(e[n]={errorMessage:(r==null?void 0:r.errorMessage)||_n,successMessage:(r==null?void 0:r.successMessage)||ln,processingMessage:(r==null?void 0:r.processingMessage)||gn,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:()=>dn},extraReducers:e=>{e.addCase(M,()=>dn)}}),{clearTransactionsInfo:fd,setTransactionsDisplayInfo:pc,clearTransactionsInfoForSessionId:un}=ir.actions,mo=ir.reducer});var pr,cr,sr,yd,sc,bd,mr,dr,fn=x(()=>{"use strict";t();pr=require("@reduxjs/toolkit");B();cr={},sr=(0,pr.createSlice)({name:"modalsSlice",initialState:cr,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,()=>cr)}}),{setTxSubmittedModal:yd,setNotificationModal:sc,clearTxSubmittedModal:bd,clearNotificationModal:mr}=sr.actions,dr=sr.reducer});var lr,gr,_r,ur,mc,hn,Ld,Cd,Dd,Nd,lo,go=x(()=>{"use strict";t();lr=require("@reduxjs/toolkit"),gr=require("redux-persist");Yo();O();Ho();B();_r={customToasts:[],transactionToasts:[],failTransactionToast:null},ur=(0,lr.createSlice)({name:"toastsSlice",initialState:_r,reducers:{addCustomToast:(e,o)=>{e.customToasts.push(w(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:oo(),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(h({},o.payload),{toastId:no})},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:mc,removeCustomToast:hn,addTransactionToast:Ld,removeTransactionToast:Cd,addFailTransactionToast:Dd,removeFailTransactionToast:Nd}=ur.actions,lo=ur.reducer});var I=x(()=>{"use strict";t();Jo();nn();pn();so();_o();fn();go()});var Tn=x(()=>{"use strict";t()});var xr,Tr,yr,xn,Jd,Qd,e_,o_,br,Sr,yn=x(()=>{"use strict";t();xr=require("@reduxjs/toolkit");B();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:xn,setDappModalHeaderVisibility:Jd,setDappModalFooterVisibility:Qd,setDappModalHeaderText:e_,setDappModalFooterText:o_,setDappModalConfig:br}=yr.actions,Sr=yr.reducer});var wr,gc,uc,Ae,fo=x(()=>{"use strict";t();wr=require("@reduxjs/toolkit");Tn();pn();yn();Jo();fn();nn();go();_o();so();gc={["account"]:Qt,["networkConfig"]:Xt,["loginInfo"]:Ht,["modals"]:dr,["dappModal"]:Sr,["toasts"]:lo,["transactions"]:po,["transactionsInfo"]:mo},uc=(e={})=>(0,wr.combineReducers)(h(h({},gc),e)),Ae=uc});var Ir={};ae(Ir,{default:()=>Sc});function bn(e,o=[]){return{key:e,version:1,storage:kr.default,blacklist:o}}var de,vr,kr,fc,hc,Tc,xc,yc,bc,Sc,Ar=x(()=>{"use strict";t();de=require("redux-persist"),vr=f(require("redux-persist/lib/storage")),kr=f(require("redux-persist/lib/storage/session"));fo();I();go();_o();so();Tn();fc={2:e=>w(h({},e),{networkConfig:on})};hc=bn("dapp-core-transactionsInfo"),Tc=bn("dapp-core-transactions",["transactionsToSign"]),xc=bn("dapp-core-toasts"),yc={key:"dapp-core-store",version:2,storage:vr.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,de.createMigrate)(fc,{debug:!1})},bc={["toasts"]:(0,de.persistReducer)(xc,lo),["transactions"]:(0,de.persistReducer)(Tc,po),["transactionsInfo"]:(0,de.persistReducer)(hc,mo)},Sc=(0,de.persistReducer)(yc,Ae(bc))});var Er={};ae(Er,{default:()=>wc});var wc,Lr=x(()=>{"use strict";t();fo();wc=Ae()});var Cr={};ae(Cr,{default:()=>kc});var H,vc,kc,Dr=x(()=>{"use strict";t();H=require("redux-persist"),vc=[H.FLUSH,H.REHYDRATE,H.PAUSE,H.PERSIST,H.PURGE,H.REGISTER],kc=vc});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 Is={};ae(Is,{NotificationModal:()=>ks});module.exports=Oe(Is);t();var Lo=f(require("react")),jn=require("@fortawesome/free-solid-svg-icons"),Vn=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 .dapp-core-component__main__lds-ellips