UNPKG

@sofaws/dapp-core

Version:

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

199 lines (178 loc) 165 kB
"use strict";var ei=Object.create;var Ue=Object.defineProperty,oi=Object.defineProperties,ni=Object.getOwnPropertyDescriptor,ti=Object.getOwnPropertyDescriptors,ri=Object.getOwnPropertyNames,Qe=Object.getOwnPropertySymbols,ai=Object.getPrototypeOf,Ro=Object.prototype.hasOwnProperty,Yn=Object.prototype.propertyIsEnumerable;var Xn=(e,o,n)=>o in e?Ue(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,T=(e,o)=>{for(var n in o||(o={}))Ro.call(o,n)&&Xn(e,n,o[n]);if(Qe)for(var n of Qe(o))Yn.call(o,n)&&Xn(e,n,o[n]);return e},S=(e,o)=>oi(e,ti(o));var eo=(e,o)=>{var n={};for(var r in e)Ro.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Qe)for(var r of Qe(e))o.indexOf(r)<0&&Yn.call(e,r)&&(n[r]=e[r]);return n};var x=(e,o)=>()=>(e&&(o=e(e=0)),o);var oo=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),ce=(e,o)=>{for(var n in o)Ue(e,n,{get:o[n],enumerable:!0})},Zn=(e,o,n,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of ri(o))!Ro.call(e,p)&&p!==n&&Ue(e,p,{get:()=>o[p],enumerable:!(r=ni(o,p))||r.enumerable});return e};var h=(e,o,n)=>(n=e!=null?ei(ai(e)):{},Zn(o||!e||!e.__esModule?Ue(n,"default",{value:e,enumerable:!0}):n,e)),We=e=>Zn(Ue({},"__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 et=oo(no=>{"use strict";t();no.byteLength=ci;no.toByteArray=si;no.fromByteArray=_i;var z=[],G=[],ii=typeof Uint8Array!="undefined"?Uint8Array:Array,Fo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(pe=0,Jn=Fo.length;pe<Jn;++pe)z[pe]=Fo[pe],G[Fo.charCodeAt(pe)]=pe;var pe,Jn;G["-".charCodeAt(0)]=62;G["_".charCodeAt(0)]=63;function Qn(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 ci(e){var o=Qn(e),n=o[0],r=o[1];return(n+r)*3/4-r}function pi(e,o,n){return(o+n)*3/4-n}function si(e){var o,n=Qn(e),r=n[0],p=n[1],s=new ii(pi(e,r,p)),m=0,l=p>0?r-4:r,_;for(_=0;_<l;_+=4)o=G[e.charCodeAt(_)]<<18|G[e.charCodeAt(_+1)]<<12|G[e.charCodeAt(_+2)]<<6|G[e.charCodeAt(_+3)],s[m++]=o>>16&255,s[m++]=o>>8&255,s[m++]=o&255;return p===2&&(o=G[e.charCodeAt(_)]<<2|G[e.charCodeAt(_+1)]>>4,s[m++]=o&255),p===1&&(o=G[e.charCodeAt(_)]<<10|G[e.charCodeAt(_+1)]<<4|G[e.charCodeAt(_+2)]>>2,s[m++]=o>>8&255,s[m++]=o&255),s}function mi(e){return z[e>>18&63]+z[e>>12&63]+z[e>>6&63]+z[e&63]}function di(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(mi(r));return p.join("")}function _i(e){for(var o,n=e.length,r=n%3,p=[],s=16383,m=0,l=n-r;m<l;m+=s)p.push(di(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 ot=oo(Oo=>{t();Oo.read=function(e,o,n,r,p){var s,m,l=p*8-r-1,_=(1<<l)-1,g=_>>1,y=-7,f=n?p-1:0,D=n?-1:1,N=e[o+f];for(f+=D,s=N&(1<<-y)-1,N>>=-y,y+=l;y>0;s=s*256+e[o+f],f+=D,y-=8);for(m=s&(1<<-y)-1,s>>=-y,y+=r;y>0;m=m*256+e[o+f],f+=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)};Oo.write=function(e,o,n,r,p,s){var m,l,_,g=s*8-p-1,y=(1<<g)-1,f=y>>1,D=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,N=r?0:s-1,j=r?1:-1,$=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+f>=1?o+=D/_:o+=D*Math.pow(2,1-f),o*_>=2&&(m++,_/=2),m+f>=y?(l=0,m=y):m+f>=1?(l=(o*_-1)*Math.pow(2,p),m=m+f):(l=o*Math.pow(2,f-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]|=$*128}});var gt=oo(he=>{"use strict";t();var Bo=et(),fe=ot(),nt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;he.Buffer=d;he.SlowBuffer=Ti;he.INSPECT_MAX_BYTES=50;var to=2147483647;he.kMaxLength=to;d.TYPED_ARRAY_SUPPORT=li();!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 li(){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 J(e){if(e>to)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 Ho(e)}return at(e,o,n)}d.poolSize=8192;function at(e,o,n){if(typeof e=="string")return ui(e,o);if(ArrayBuffer.isView(e))return fi(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 Wo(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=hi(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 at(e,o,n)};Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function it(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 gi(e,o,n){return it(e),e<=0?J(e):o!==void 0?typeof n=="string"?J(e).fill(o,n):J(e).fill(o):J(e)}d.alloc=function(e,o,n){return gi(e,o,n)};function Ho(e){return it(e),J(e<0?0:Vo(e)|0)}d.allocUnsafe=function(e){return Ho(e)};d.allocUnsafeSlow=function(e){return Ho(e)};function ui(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!d.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=ct(e,o)|0,r=J(n),p=r.write(e,o);return p!==n&&(r=r.slice(0,p)),r}function Uo(e){for(var o=e.length<0?0:Vo(e.length)|0,n=J(o),r=0;r<o;r+=1)n[r]=e[r]&255;return n}function fi(e){if(q(e,Uint8Array)){var o=new Uint8Array(e);return Wo(o.buffer,o.byteOffset,o.byteLength)}return Uo(e)}function Wo(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 hi(e){if(d.isBuffer(e)){var o=Vo(e.length)|0,n=J(o);return n.length===0||e.copy(n,0,0,o),n}if(e.length!==void 0)return typeof e.length!="number"||$o(e.length)?J(0):Uo(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Uo(e.data)}function Vo(e){if(e>=to)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+to.toString(16)+" bytes");return e|0}function Ti(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 ct(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 Go(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return lt(e).length;default:if(p)return r?-1:Go(e).length;o=(""+o).toLowerCase(),p=!0}}d.byteLength=ct;function xi(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 Ci(this,o,n);case"utf8":case"utf-8":return st(this,o,n);case"ascii":return Ai(this,o,n);case"latin1":case"binary":return Ei(this,o,n);case"base64":return ki(this,o,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Li(this,o,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}d.prototype._isBuffer=!0;function se(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)se(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)se(this,n,n+3),se(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)se(this,n,n+7),se(this,n+1,n+6),se(this,n+2,n+5),se(this,n+3,n+4);return this};d.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?st(this,0,o):xi.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=he.INSPECT_MAX_BYTES;return o=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(o+=" ... "),"<Buffer "+o+">"};nt&&(d.prototype[nt]=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),f=0;f<_;++f)if(g[f]!==y[f]){m=g[f],l=y[f];break}return m<l?-1:l<m?1:0};function pt(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,$o(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:tt(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):tt(e,[o],n,r,p);throw new TypeError("val must be string, number or Buffer")}function tt(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 f=!0,D=0;D<l;D++)if(_(e,g+D)!==_(o,D)){f=!1;break}if(f)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 pt(this,o,n,r,!0)};d.prototype.lastIndexOf=function(o,n,r){return pt(this,o,n,r,!1)};function yi(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($o(l))return m;e[n+m]=l}return m}function bi(e,o,n,r){return ro(Go(o,e.length-n),e,n,r)}function Si(e,o,n,r){return ro(Pi(o),e,n,r)}function wi(e,o,n,r){return ro(lt(o),e,n,r)}function vi(e,o,n,r){return ro(Mi(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 yi(this,o,n,r);case"utf8":case"utf-8":return bi(this,o,n,r);case"ascii":case"latin1":case"binary":return Si(this,o,n,r);case"base64":return wi(this,o,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vi(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 ki(e,o,n){return o===0&&n===e.length?Bo.fromByteArray(e):Bo.fromByteArray(e.slice(o,n))}function st(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,f;switch(l){case 1:s<128&&(m=s);break;case 2:_=e[p+1],(_&192)===128&&(f=(s&31)<<6|_&63,f>127&&(m=f));break;case 3:_=e[p+1],g=e[p+2],(_&192)===128&&(g&192)===128&&(f=(s&15)<<12|(_&63)<<6|g&63,f>2047&&(f<55296||f>57343)&&(m=f));break;case 4:_=e[p+1],g=e[p+2],y=e[p+3],(_&192)===128&&(g&192)===128&&(y&192)===128&&(f=(s&15)<<18|(_&63)<<12|(g&63)<<6|y&63,f>65535&&f<1114112&&(m=f))}}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 Ii(r)}var rt=4096;function Ii(e){var o=e.length;if(o<=rt)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<o;)n+=String.fromCharCode.apply(String,e.slice(r,r+=rt));return n}function Ai(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 Ei(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 Ci(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+=Ri[e[s]];return p}function Li(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),fe.read(this,o,!0,23,4)};d.prototype.readFloatBE=function(o,n){return o=o>>>0,n||L(o,4,this.length),fe.read(this,o,!1,23,4)};d.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||L(o,8,this.length),fe.read(this,o,!0,52,8)};d.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||L(o,8,this.length),fe.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 mt(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 dt(e,o,n,r,p){return o=+o,n=n>>>0,p||mt(e,o,n,4,34028234663852886e22,-34028234663852886e22),fe.write(e,o,n,r,23,4),n+4}d.prototype.writeFloatLE=function(o,n,r){return dt(this,o,n,!0,r)};d.prototype.writeFloatBE=function(o,n,r){return dt(this,o,n,!1,r)};function _t(e,o,n,r,p){return o=+o,n=n>>>0,p||mt(e,o,n,8,17976931348623157e292,-17976931348623157e292),fe.write(e,o,n,r,52,8),n+8}d.prototype.writeDoubleLE=function(o,n,r){return _t(this,o,n,!0,r)};d.prototype.writeDoubleBE=function(o,n,r){return _t(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 Di=/[^+/0-9A-Za-z-_]/g;function Ni(e){if(e=e.split("=")[0],e=e.trim().replace(Di,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Go(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 Pi(e){for(var o=[],n=0;n<e.length;++n)o.push(e.charCodeAt(n)&255);return o}function Mi(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 lt(e){return Bo.toByteArray(Ni(e))}function ro(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 $o(e){return e!==e}var Ri=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 xt=oo((Rs,Tt)=>{t();var E=Tt.exports={},K,X;function jo(){throw new Error("setTimeout has not been defined")}function zo(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?K=setTimeout:K=jo}catch(e){K=jo}try{typeof clearTimeout=="function"?X=clearTimeout:X=zo}catch(e){X=zo}})();function ut(e){if(K===setTimeout)return setTimeout(e,0);if((K===jo||!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 Fi(e){if(X===clearTimeout)return clearTimeout(e);if((X===zo||!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 Q=[],Te=!1,me,ao=-1;function Oi(){!Te||!me||(Te=!1,me.length?Q=me.concat(Q):ao=-1,Q.length&&ft())}function ft(){if(!Te){var e=ut(Oi);Te=!0;for(var o=Q.length;o;){for(me=Q,Q=[];++ao<o;)me&&me[ao].run();ao=-1,o=Q.length}me=null,Te=!1,Fi(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];Q.push(new ht(e,o)),Q.length===1&&!Te&&ut(ft)};function ht(e,o){this.fun=e,this.array=o}ht.prototype.run=function(){this.fun.apply(null,this.array)};E.title="browser";E.browser=!0;E.env={};E.argv=[];E.version="";E.versions={};function ee(){}E.on=ee;E.addListener=ee;E.once=ee;E.off=ee;E.removeListener=ee;E.removeAllListeners=ee;E.emit=ee;E.prependListener=ee;E.prependOnceListener=ee;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,Fs,t=x(()=>{a=h(gt()),i=h(xt()),Fs=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 qo,xe=x(()=>{"use strict";t();qo="Transaction canceled"});var yt=x(()=>{"use strict";t()});var P=x(()=>{"use strict";t()});var A=x(()=>{"use strict";t()});var bt=x(()=>{"use strict";t()});var St=x(()=>{"use strict";t()});var wt=x(()=>{"use strict";t()});var vt=x(()=>{"use strict";t()});var O=x(()=>{"use strict";t();yt();P();A();bt();St();wt();vt()});var Ko,kt,Qs,It,em,At,om,nm,tm,Et=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:kt,egldLabel:Qs}=Ko["devnet"],{chainId:It,egldLabel:em}=Ko["testnet"],{chainId:At,egldLabel:om}=Ko["mainnet"],nm={["devnet"]:kt,["testnet"]:It,["mainnet"]:At},tm={[kt]:"devnet",[It]:"testnet",[At]:"mainnet"}});var Xo=x(()=>{"use strict";t()});var Ct=x(()=>{"use strict";t()});var io,Yo=x(()=>{"use strict";t();io="transaction-status-toast-id"});var Ge,co,Lt,po,Dt,Nt,ye,k=x(()=>{"use strict";t();xe();Et();Xo();Ct();Yo();Ge=5e4,co=1e9,Lt=1,po="logout",Dt="login",Nt="cancelSignTx",ye="0"});var so,Zo=x(()=>{"use strict";t();so=()=>Date.now()/1e3});var Pt=x(()=>{"use strict";t()});var Mt=x(()=>{"use strict";t()});var Jo=x(()=>{"use strict";t();Zo();Pt();Mt()});var en={};ce(en,{getItem:()=>Wi,localStorageKeys:()=>re,removeItem:()=>Gi,setItem:()=>Ui});var re,Qo,Ui,Wi,Gi,be=x(()=>{"use strict";t();Jo();re={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Qo=typeof localStorage!="undefined",Ui=({key:e,data:o,expires:n})=>{!Qo||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},Wi=e=>{if(!Qo)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:so()>=n.expires?(localStorage.removeItem(String(e)),null):n.data},Gi=e=>{!Qo||localStorage.removeItem(String(e))}});var on={};ce(on,{clear:()=>Bt,getItem:()=>Ft,removeItem:()=>Ot,setItem:()=>Rt,storage:()=>Hi});var Rt,Ft,Ot,Bt,Hi,Ut=x(()=>{"use strict";t();Rt=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},Ft=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},Ot=e=>sessionStorage.removeItem(String(e)),Bt=()=>sessionStorage.clear(),Hi={setItem:Rt,getItem:Ft,removeItem:Ot,clear:Bt}});var de,Se=x(()=>{"use strict";t();be();Ut();de={session:on,local:en}});function He(){return new Date().setHours(new Date().getHours()+24)}function Ve(e){de.local.setItem({key:re.loginExpiresAt,data:e,expires:e})}var nn=x(()=>{"use strict";t();Se();be()});var tn,M,oe,B=x(()=>{"use strict";t();tn=require("@reduxjs/toolkit");k();M=(0,tn.createAction)(po),oe=(0,tn.createAction)(Dt,e=>({payload:e}))});var Gt,Wt,Ht,Pm,Vt,Vi,$e,$t,$i,jt,zt,rn=x(()=>{"use strict";t();Gt=require("@reduxjs/toolkit");nn();A();B();Wt={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Ht=(0,Gt.createSlice)({name:"loginInfoSlice",initialState:Wt,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,()=>Wt),e.addCase(oe,(o,n)=>{o.loginMethod=n.payload.loginMethod,Ve(He())})}}),{setLoginMethod:Pm,setWalletConnectLogin:Vt,setLedgerLogin:Vi,setTokenLogin:$e,setTokenLoginSignature:$t,setWalletLogin:$i,invalidateLoginSession:jt}=Ht.actions,zt=Ht.reducer});var je=x(()=>{"use strict";t()});var Kt=x(()=>{"use strict";t();je()});function an(e){return e[Math.floor(Math.random()*e.length)]}var Xt=x(()=>{"use strict";t()});var cn=x(()=>{"use strict";t();Xo()});var we=x(()=>{"use strict";t();Kt();Xt();cn()});var Yt,Zt,pn,ji,Jt,Km,Xm,Qt,sn=x(()=>{"use strict";t();Yt=require("@reduxjs/toolkit"),Zt=h(require("lodash.omit"));we();pn={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},ji={network:pn,chainID:"-1"},Jt=(0,Yt.createSlice)({name:"appConfig",initialState:ji,reducers:{initializeNetworkConfig:(e,o)=>{let n=an(o.payload.walletConnectBridgeAddresses),r=an(o.payload.walletConnectV2RelayAddresses),p=(0,Zt.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=S(T(T({},e.network),p),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(e,o)=>{e.chainID=o.payload}}}),{initializeNetworkConfig:Km,setChainID:Xm}=Jt.actions,Qt=Jt.reducer});var dn,er,or,mo,mn,nr,_n,td,ln,rd,zi,qi,ad,id,cd,Ki,tr,gn=x(()=>{"use strict";t();dn=require("@elrondnetwork/erdjs"),er=require("@reduxjs/toolkit"),or=require("redux-persist");k();Se();be();B();mo={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:ye},mn={address:"",websocketEvent:null,accounts:{"":mo},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},nr=(0,er.createSlice)({name:"accountInfoSlice",initialState:mn,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new dn.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:mo},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,()=>(de.local.removeItem(re.loginExpiresAt),mn)),e.addCase(oe,(o,n)=>{let{address:r}=n.payload;o.address=r,o.publicKey=new dn.Address(r).hex()}),e.addCase(or.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:mn.accounts,o.publicKey=l})}}),{setAccount:_n,setAddress:td,setAccountNonce:ln,setAccountShard:rd,setLedgerAccount:zi,updateLedgerAccount:qi,setWalletConnectAccount:ad,setIsAccountLoading:id,setAccountLoadingError:cd,setWebsocketEvent:Ki}=nr.actions,tr=nr.reducer});function ve(e){return e!=null&&(nc(e)||ic(e))}function ke(e){return e!=null&&(tc(e)||cc(e))}function Ie(e){return e!=null&&(rc(e)||pc(e))}function un(e){return e!=null&&ac(e)}function nc(e){return e!=null&&Xi.includes(e)}function tc(e){return e!=null&&Yi.includes(e)}function rc(e){return e!=null&&Zi.includes(e)}function ac(e){return e!=null&&Ji.includes(e)}function ic(e){return e!=null&&Qi.includes(e)}function cc(e){return e!=null&&ec.includes(e)}function pc(e){return e!=null&&oc.includes(e)}var Xi,Yi,Zi,Ji,Qi,ec,oc,Ae=x(()=>{"use strict";t();A();Xi=["sent"],Yi=["success"],Zi=["fail","cancelled","timedOut"],Ji=["timedOut"],Qi=["pending"],ec=["success"],oc=["fail","invalid"]});var rr,ar,qe,sc,ir,cr,pr,mc,Ke,dc,_c,fd,lc,Xe,fn,_o,lo=x(()=>{"use strict";t();rr=require("@reduxjs/toolkit"),ar=require("redux-persist");A();Ae();B();qe={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},sc={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},ir=(0,rr.createSlice)({name:"transactionsSlice",initialState:qe,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])||sc;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=qe.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=T(T({},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,f,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($=>$.hash===s?S(T({},$),{status:r,errorMessage:p}):$);let N=(y=(g=e.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:y.every($=>ke($.status)),j=(D=(f=e.signedTransactions[n])==null?void 0:f.transactions)==null?void 0:D.every($=>Ie($.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=qe.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=qe.signedTransactions},setSignTransactionsError:(e,o)=>{e.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(e,o)=>{e.signTransactionsCancelMessage=o.payload}},extraReducers:e=>{e.addCase(M,()=>qe),e.addCase(ar.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(_),f=new Date;return f.setHours(f.getHours()+5),f-y>0||(l[_]=g),l},{});p!=null&&(o.customTransactionInformationForSessionId=p),r!=null&&(o.signedTransactions=s)})}}),{updateSignedTransactionStatus:cr,updateSignedTransactions:pr,setTransactionsToSign:mc,clearAllTransactionsToSign:Ke,clearAllSignedTransactions:dc,clearSignedTransaction:_c,clearTransactionToSign:fd,setSignTransactionsError:lc,setSignTransactionsCancelMessage:Xe,moveTransactionsToSignedState:fn}=ir.actions,_o=ir.reducer});var sr,Tn,xn,yn,gc,hn,mr,yd,uc,go,uo,fo=x(()=>{"use strict";t();sr=require("@reduxjs/toolkit");B();Tn="Transaction failed",xn="Transaction successful",yn="Processing transaction",gc="Transaction submitted",hn={},mr=(0,sr.createSlice)({name:"transactionsInfo",initialState:hn,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:r}=o.payload;n!=null&&(e[n]={errorMessage:(r==null?void 0:r.errorMessage)||Tn,successMessage:(r==null?void 0:r.successMessage)||xn,processingMessage:(r==null?void 0:r.processingMessage)||yn,submittedMessage:(r==null?void 0:r.submittedMessage)||gc,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(e,o){o.payload!=null&&delete e[o.payload]},clearTransactionsInfo:()=>hn},extraReducers:e=>{e.addCase(M,()=>hn)}}),{clearTransactionsInfo:yd,setTransactionsDisplayInfo:uc,clearTransactionsInfoForSessionId:go}=mr.actions,uo=mr.reducer});var _r,dr,lr,vd,fc,kd,hc,gr,bn=x(()=>{"use strict";t();_r=require("@reduxjs/toolkit");B();dr={},lr=(0,_r.createSlice)({name:"modalsSlice",initialState:dr,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,()=>dr)}}),{setTxSubmittedModal:vd,setNotificationModal:fc,clearTxSubmittedModal:kd,clearNotificationModal:hc}=lr.actions,gr=lr.reducer});var fr,hr,ur,Tr,Tc,Sn,Pd,Md,Rd,Fd,ho,To=x(()=>{"use strict";t();fr=require("@reduxjs/toolkit"),hr=require("redux-persist");Yo();O();Zo();B();ur={customToasts:[],transactionToasts:[],failTransactionToast:null},Tr=(0,fr.createSlice)({name:"toastsSlice",initialState:ur,reducers:{addCustomToast:(e,o)=>{e.customToasts.push(S(T({},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:so(),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(T({},o.payload),{toastId:io})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(M,()=>ur),e.addCase(hr.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:Tc,removeCustomToast:Sn,addTransactionToast:Pd,removeTransactionToast:Md,addFailTransactionToast:Rd,removeFailTransactionToast:Fd}=Tr.actions,ho=Tr.reducer});var I=x(()=>{"use strict";t();rn();sn();gn();lo();fo();bn();To()});var wn=x(()=>{"use strict";t()});var Sr,br,wr,vn,n_,t_,r_,a_,vr,kr,kn=x(()=>{"use strict";t();Sr=require("@reduxjs/toolkit");B();br={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},wr=(0,Sr.createSlice)({name:"dappModalsSlice",initialState:br,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=T({},o.payload)}},extraReducers:e=>{e.addCase(M,()=>br)}}),{setDappModalVisibility:vn,setDappModalHeaderVisibility:n_,setDappModalFooterVisibility:t_,setDappModalHeaderText:r_,setDappModalFooterText:a_,setDappModalConfig:vr}=wr.actions,kr=wr.reducer});var Ir,Sc,wc,Ee,yo=x(()=>{"use strict";t();Ir=require("@reduxjs/toolkit");wn();gn();kn();rn();bn();sn();To();fo();lo();Sc={["account"]:tr,["networkConfig"]:Qt,["loginInfo"]:zt,["modals"]:gr,["dappModal"]:kr,["toasts"]:ho,["transactions"]:_o,["transactionsInfo"]:uo},wc=(e={})=>(0,Ir.combineReducers)(T(T({},Sc),e)),Ee=wc});var Cr={};ce(Cr,{default:()=>Lc});function In(e,o=[]){return{key:e,version:1,storage:Er.default,blacklist:o}}var le,Ar,Er,vc,kc,Ic,Ac,Ec,Cc,Lc,Lr=x(()=>{"use strict";t();le=require("redux-persist"),Ar=h(require("redux-persist/lib/storage")),Er=h(require("redux-persist/lib/storage/session"));yo();I();To();fo();lo();wn();vc={2:e=>S(T({},e),{networkConfig:pn})};kc=In("dapp-core-transactionsInfo"),Ic=In("dapp-core-transactions",["transactionsToSign"]),Ac=In("dapp-core-toasts"),Ec={key:"dapp-core-store",version:2,storage:Ar.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,le.createMigrate)(vc,{debug:!1})},Cc={["toasts"]:(0,le.persistReducer)(Ac,ho),["transactions"]:(0,le.persistReducer)(Ic,_o),["transactionsInfo"]:(0,le.persistReducer)(kc,uo)},Lc=(0,le.persistReducer)(Ec,Ee(Cc))});var Dr={};ce(Dr,{default:()=>Dc});var Dc,Nr=x(()=>{"use strict";t();yo();Dc=Ee()});var Pr={};ce(Pr,{default:()=>Pc});var H,Nc,Pc,Mr=x(()=>{"use strict";t();H=require("redux-persist"),Nc=[H.FLUSH,H.REHYDRATE,H.PAUSE,H.PERSIST,H.PURGE,H.REGISTER],Pc=Nc});var Or={};ce(Or,{default:()=>Fr});function Fr(e){return(0,Rr.persistStore)(e)}var Rr,Br=x(()=>{"use strict";t();Rr=require("redux-persist")});var Ls={};ce(Ls,{SignWithWalletConnectModal:()=>Cs});module.exports=We(Ls);t();var Mo=h(require("react")),Ya=require("@fortawesome/free-solid-svg-icons"),Kn=h(require("classnames"));t();var Bi=`.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; } .dap