UNPKG

@sofaws/dapp-core

Version:

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

117 lines (102 loc) 180 kB
"use strict";var Pi=Object.create;var Xe=Object.defineProperty,Ri=Object.defineProperties,Mi=Object.getOwnPropertyDescriptor,Oi=Object.getOwnPropertyDescriptors,Fi=Object.getOwnPropertyNames,lo=Object.getOwnPropertySymbols,Bi=Object.getPrototypeOf,Qo=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable;var ft=(e,o,n)=>o in e?Xe(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,x=(e,o)=>{for(var n in o||(o={}))Qo.call(o,n)&&ft(e,n,o[n]);if(lo)for(var n of lo(o))Tt.call(o,n)&&ft(e,n,o[n]);return e},w=(e,o)=>Ri(e,Oi(o));var ge=(e,o)=>{var n={};for(var r in e)Qo.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lo)for(var r of lo(e))o.indexOf(r)<0&&Tt.call(e,r)&&(n[r]=e[r]);return n};var y=(e,o)=>()=>(e&&(o=e(e=0)),o);var uo=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),fe=(e,o)=>{for(var n in o)Xe(e,n,{get:o[n],enumerable:!0})},ht=(e,o,n,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of Fi(o))!Qo.call(e,s)&&s!==n&&Xe(e,s,{get:()=>o[s],enumerable:!(r=Mi(o,s))||r.enumerable});return e};var f=(e,o,n)=>(n=e!=null?Pi(Bi(e)):{},ht(o||!e||!e.__esModule?Xe(n,"default",{value:e,enumerable:!0}):n,e)),Ye=e=>ht(Xe({},"__esModule",{value:!0}),e);var b=(e,o,n)=>new Promise((r,s)=>{var p=l=>{try{d(n.next(l))}catch(u){s(u)}},m=l=>{try{d(n.throw(l))}catch(u){s(u)}},d=l=>l.done?r(l.value):Promise.resolve(l.value).then(p,m);d((n=n.apply(e,o)).next())});var bt=uo(go=>{"use strict";t();go.byteLength=Wi;go.toByteArray=$i;go.fromByteArray=ji;var Y=[],H=[],Ui=typeof Uint8Array!="undefined"?Uint8Array:Array,en="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Te=0,xt=en.length;Te<xt;++Te)Y[Te]=en[Te],H[en.charCodeAt(Te)]=Te;var Te,xt;H["-".charCodeAt(0)]=62;H["_".charCodeAt(0)]=63;function yt(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 Wi(e){var o=yt(e),n=o[0],r=o[1];return(n+r)*3/4-r}function Gi(e,o,n){return(o+n)*3/4-n}function $i(e){var o,n=yt(e),r=n[0],s=n[1],p=new Ui(Gi(e,r,s)),m=0,d=s>0?r-4:r,l;for(l=0;l<d;l+=4)o=H[e.charCodeAt(l)]<<18|H[e.charCodeAt(l+1)]<<12|H[e.charCodeAt(l+2)]<<6|H[e.charCodeAt(l+3)],p[m++]=o>>16&255,p[m++]=o>>8&255,p[m++]=o&255;return s===2&&(o=H[e.charCodeAt(l)]<<2|H[e.charCodeAt(l+1)]>>4,p[m++]=o&255),s===1&&(o=H[e.charCodeAt(l)]<<10|H[e.charCodeAt(l+1)]<<4|H[e.charCodeAt(l+2)]>>2,p[m++]=o>>8&255,p[m++]=o&255),p}function Vi(e){return Y[e>>18&63]+Y[e>>12&63]+Y[e>>6&63]+Y[e&63]}function Hi(e,o,n){for(var r,s=[],p=o;p<n;p+=3)r=(e[p]<<16&16711680)+(e[p+1]<<8&65280)+(e[p+2]&255),s.push(Vi(r));return s.join("")}function ji(e){for(var o,n=e.length,r=n%3,s=[],p=16383,m=0,d=n-r;m<d;m+=p)s.push(Hi(e,m,m+p>d?d:m+p));return r===1?(o=e[n-1],s.push(Y[o>>2]+Y[o<<4&63]+"==")):r===2&&(o=(e[n-2]<<8)+e[n-1],s.push(Y[o>>10]+Y[o>>4&63]+Y[o<<2&63]+"=")),s.join("")}});var wt=uo(on=>{t();on.read=function(e,o,n,r,s){var p,m,d=s*8-r-1,l=(1<<d)-1,u=l>>1,h=-7,g=n?s-1:0,E=n?-1:1,L=e[o+g];for(g+=E,p=L&(1<<-h)-1,L>>=-h,h+=d;h>0;p=p*256+e[o+g],g+=E,h-=8);for(m=p&(1<<-h)-1,p>>=-h,h+=r;h>0;m=m*256+e[o+g],g+=E,h-=8);if(p===0)p=1-u;else{if(p===l)return m?NaN:(L?-1:1)*(1/0);m=m+Math.pow(2,r),p=p-u}return(L?-1:1)*m*Math.pow(2,p-r)};on.write=function(e,o,n,r,s,p){var m,d,l,u=p*8-s-1,h=(1<<u)-1,g=h>>1,E=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=r?0:p-1,R=r?1:-1,M=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(d=isNaN(o)?1:0,m=h):(m=Math.floor(Math.log(o)/Math.LN2),o*(l=Math.pow(2,-m))<1&&(m--,l*=2),m+g>=1?o+=E/l:o+=E*Math.pow(2,1-g),o*l>=2&&(m++,l/=2),m+g>=h?(d=0,m=h):m+g>=1?(d=(o*l-1)*Math.pow(2,s),m=m+g):(d=o*Math.pow(2,g-1)*Math.pow(2,s),m=0));s>=8;e[n+L]=d&255,L+=R,d/=256,s-=8);for(m=m<<s|d,u+=s;u>0;e[n+L]=m&255,L+=R,m/=256,u-=8);e[n+L-R]|=M*128}});var Mt=uo(Ce=>{"use strict";t();var nn=bt(),Le=wt(),St=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ce.Buffer=_;Ce.SlowBuffer=Zi;Ce.INSPECT_MAX_BYTES=50;var fo=2147483647;Ce.kMaxLength=fo;_.TYPED_ARRAY_SUPPORT=zi();!_.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 zi(){try{var e=new Uint8Array(1),o={foo:function(){return 42}};return Object.setPrototypeOf(o,Uint8Array.prototype),Object.setPrototypeOf(e,o),e.foo()===42}catch(n){return!1}}Object.defineProperty(_.prototype,"parent",{enumerable:!0,get:function(){if(!!_.isBuffer(this))return this.buffer}});Object.defineProperty(_.prototype,"offset",{enumerable:!0,get:function(){if(!!_.isBuffer(this))return this.byteOffset}});function ee(e){if(e>fo)throw new RangeError('The value "'+e+'" is invalid for option "size"');var o=new Uint8Array(e);return Object.setPrototypeOf(o,_.prototype),o}function _(e,o,n){if(typeof e=="number"){if(typeof o=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return cn(e)}return At(e,o,n)}_.poolSize=8192;function At(e,o,n){if(typeof e=="string")return Ki(e,o);if(ArrayBuffer.isView(e))return Xi(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return rn(e,o,n);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return _.from(r,o,n);var s=Yi(e);if(s)return s;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return _.from(e[Symbol.toPrimitive]("string"),o,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}_.from=function(e,o,n){return At(e,o,n)};Object.setPrototypeOf(_.prototype,Uint8Array.prototype);Object.setPrototypeOf(_,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 qi(e,o,n){return It(e),e<=0?ee(e):o!==void 0?typeof n=="string"?ee(e).fill(o,n):ee(e).fill(o):ee(e)}_.alloc=function(e,o,n){return qi(e,o,n)};function cn(e){return It(e),ee(e<0?0:sn(e)|0)}_.allocUnsafe=function(e){return cn(e)};_.allocUnsafeSlow=function(e){return cn(e)};function Ki(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!_.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=Et(e,o)|0,r=ee(n),s=r.write(e,o);return s!==n&&(r=r.slice(0,s)),r}function tn(e){for(var o=e.length<0?0:sn(e.length)|0,n=ee(o),r=0;r<o;r+=1)n[r]=e[r]&255;return n}function Xi(e){if(Z(e,Uint8Array)){var o=new Uint8Array(e);return rn(o.buffer,o.byteOffset,o.byteLength)}return tn(e)}function rn(e,o,n){if(o<0||e.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<o+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return o===void 0&&n===void 0?r=new Uint8Array(e):n===void 0?r=new Uint8Array(e,o):r=new Uint8Array(e,o,n),Object.setPrototypeOf(r,_.prototype),r}function Yi(e){if(_.isBuffer(e)){var o=sn(e.length)|0,n=ee(o);return n.length===0||e.copy(n,0,0,o),n}if(e.length!==void 0)return typeof e.length!="number"||pn(e.length)?ee(0):tn(e);if(e.type==="Buffer"&&Array.isArray(e.data))return tn(e.data)}function sn(e){if(e>=fo)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+fo.toString(16)+" bytes");return e|0}function Zi(e){return+e!=e&&(e=0),_.alloc(+e)}_.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==_.prototype};_.compare=function(o,n){if(Z(o,Uint8Array)&&(o=_.from(o,o.offset,o.byteLength)),Z(n,Uint8Array)&&(n=_.from(n,n.offset,n.byteLength)),!_.isBuffer(o)||!_.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(o===n)return 0;for(var r=o.length,s=n.length,p=0,m=Math.min(r,s);p<m;++p)if(o[p]!==n[p]){r=o[p],s=n[p];break}return r<s?-1:s<r?1:0};_.isEncoding=function(o){switch(String(o).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};_.concat=function(o,n){if(!Array.isArray(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return _.alloc(0);var r;if(n===void 0)for(n=0,r=0;r<o.length;++r)n+=o[r].length;var s=_.allocUnsafe(n),p=0;for(r=0;r<o.length;++r){var m=o[r];if(Z(m,Uint8Array))p+m.length>s.length?_.from(m).copy(s,p):Uint8Array.prototype.set.call(s,m,p);else if(_.isBuffer(m))m.copy(s,p);else throw new TypeError('"list" argument must be an Array of Buffers');p+=m.length}return s};function Et(e,o){if(_.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;for(var s=!1;;)switch(o){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return an(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Rt(e).length;default:if(s)return r?-1:an(e).length;o=(""+o).toLowerCase(),s=!0}}_.byteLength=Et;function Ji(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 sc(this,o,n);case"utf8":case"utf-8":return Ct(this,o,n);case"ascii":return ic(this,o,n);case"latin1":case"binary":return cc(this,o,n);case"base64":return rc(this,o,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pc(this,o,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}_.prototype._isBuffer=!0;function he(e,o,n){var r=e[o];e[o]=e[n],e[n]=r}_.prototype.swap16=function(){var o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<o;n+=2)he(this,n,n+1);return this};_.prototype.swap32=function(){var o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<o;n+=4)he(this,n,n+3),he(this,n+1,n+2);return this};_.prototype.swap64=function(){var o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<o;n+=8)he(this,n,n+7),he(this,n+1,n+6),he(this,n+2,n+5),he(this,n+3,n+4);return this};_.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?Ct(this,0,o):Ji.apply(this,arguments)};_.prototype.toLocaleString=_.prototype.toString;_.prototype.equals=function(o){if(!_.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:_.compare(this,o)===0};_.prototype.inspect=function(){var o="",n=Ce.INSPECT_MAX_BYTES;return o=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(o+=" ... "),"<Buffer "+o+">"};St&&(_.prototype[St]=_.prototype.inspect);_.prototype.compare=function(o,n,r,s,p){if(Z(o,Uint8Array)&&(o=_.from(o,o.offset,o.byteLength)),!_.isBuffer(o))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof o);if(n===void 0&&(n=0),r===void 0&&(r=o?o.length:0),s===void 0&&(s=0),p===void 0&&(p=this.length),n<0||r>o.length||s<0||p>this.length)throw new RangeError("out of range index");if(s>=p&&n>=r)return 0;if(s>=p)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,s>>>=0,p>>>=0,this===o)return 0;for(var m=p-s,d=r-n,l=Math.min(m,d),u=this.slice(s,p),h=o.slice(n,r),g=0;g<l;++g)if(u[g]!==h[g]){m=u[g],d=h[g];break}return m<d?-1:d<m?1:0};function Lt(e,o,n,r,s){if(e.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,pn(n)&&(n=s?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(s)return-1;n=e.length-1}else if(n<0)if(s)n=0;else return-1;if(typeof o=="string"&&(o=_.from(o,r)),_.isBuffer(o))return o.length===0?-1:vt(e,o,n,r,s);if(typeof o=="number")return o=o&255,typeof Uint8Array.prototype.indexOf=="function"?s?Uint8Array.prototype.indexOf.call(e,o,n):Uint8Array.prototype.lastIndexOf.call(e,o,n):vt(e,[o],n,r,s);throw new TypeError("val must be string, number or Buffer")}function vt(e,o,n,r,s){var p=1,m=e.length,d=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;p=2,m/=2,d/=2,n/=2}function l(L,R){return p===1?L[R]:L.readUInt16BE(R*p)}var u;if(s){var h=-1;for(u=n;u<m;u++)if(l(e,u)===l(o,h===-1?0:u-h)){if(h===-1&&(h=u),u-h+1===d)return h*p}else h!==-1&&(u-=u-h),h=-1}else for(n+d>m&&(n=m-d),u=n;u>=0;u--){for(var g=!0,E=0;E<d;E++)if(l(e,u+E)!==l(o,E)){g=!1;break}if(g)return u}return-1}_.prototype.includes=function(o,n,r){return this.indexOf(o,n,r)!==-1};_.prototype.indexOf=function(o,n,r){return Lt(this,o,n,r,!0)};_.prototype.lastIndexOf=function(o,n,r){return Lt(this,o,n,r,!1)};function Qi(e,o,n,r){n=Number(n)||0;var s=e.length-n;r?(r=Number(r),r>s&&(r=s)):r=s;var p=o.length;r>p/2&&(r=p/2);for(var m=0;m<r;++m){var d=parseInt(o.substr(m*2,2),16);if(pn(d))return m;e[n+m]=d}return m}function ec(e,o,n,r){return To(an(o,e.length-n),e,n,r)}function oc(e,o,n,r){return To(dc(o),e,n,r)}function nc(e,o,n,r){return To(Rt(o),e,n,r)}function tc(e,o,n,r){return To(lc(o,e.length-n),e,n,r)}_.prototype.write=function(o,n,r,s){if(n===void 0)s="utf8",r=this.length,n=0;else if(r===void 0&&typeof n=="string")s=n,r=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(r)?(r=r>>>0,s===void 0&&(s="utf8")):(s=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var p=this.length-n;if((r===void 0||r>p)&&(r=p),o.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");for(var m=!1;;)switch(s){case"hex":return Qi(this,o,n,r);case"utf8":case"utf-8":return ec(this,o,n,r);case"ascii":case"latin1":case"binary":return oc(this,o,n,r);case"base64":return nc(this,o,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tc(this,o,n,r);default:if(m)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),m=!0}};_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function rc(e,o,n){return o===0&&n===e.length?nn.fromByteArray(e):nn.fromByteArray(e.slice(o,n))}function Ct(e,o,n){n=Math.min(e.length,n);for(var r=[],s=o;s<n;){var p=e[s],m=null,d=p>239?4:p>223?3:p>191?2:1;if(s+d<=n){var l,u,h,g;switch(d){case 1:p<128&&(m=p);break;case 2:l=e[s+1],(l&192)===128&&(g=(p&31)<<6|l&63,g>127&&(m=g));break;case 3:l=e[s+1],u=e[s+2],(l&192)===128&&(u&192)===128&&(g=(p&15)<<12|(l&63)<<6|u&63,g>2047&&(g<55296||g>57343)&&(m=g));break;case 4:l=e[s+1],u=e[s+2],h=e[s+3],(l&192)===128&&(u&192)===128&&(h&192)===128&&(g=(p&15)<<18|(l&63)<<12|(u&63)<<6|h&63,g>65535&&g<1114112&&(m=g))}}m===null?(m=65533,d=1):m>65535&&(m-=65536,r.push(m>>>10&1023|55296),m=56320|m&1023),r.push(m),s+=d}return ac(r)}var kt=4096;function ac(e){var o=e.length;if(o<=kt)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<o;)n+=String.fromCharCode.apply(String,e.slice(r,r+=kt));return n}function ic(e,o,n){var r="";n=Math.min(e.length,n);for(var s=o;s<n;++s)r+=String.fromCharCode(e[s]&127);return r}function cc(e,o,n){var r="";n=Math.min(e.length,n);for(var s=o;s<n;++s)r+=String.fromCharCode(e[s]);return r}function sc(e,o,n){var r=e.length;(!o||o<0)&&(o=0),(!n||n<0||n>r)&&(n=r);for(var s="",p=o;p<n;++p)s+=uc[e[p]];return s}function pc(e,o,n){for(var r=e.slice(o,n),s="",p=0;p<r.length-1;p+=2)s+=String.fromCharCode(r[p]+r[p+1]*256);return s}_.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 s=this.subarray(o,n);return Object.setPrototypeOf(s,_.prototype),s};function P(e,o,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+o>n)throw new RangeError("Trying to access beyond buffer length")}_.prototype.readUintLE=_.prototype.readUIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||P(o,n,this.length);for(var s=this[o],p=1,m=0;++m<n&&(p*=256);)s+=this[o+m]*p;return s};_.prototype.readUintBE=_.prototype.readUIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||P(o,n,this.length);for(var s=this[o+--n],p=1;n>0&&(p*=256);)s+=this[o+--n]*p;return s};_.prototype.readUint8=_.prototype.readUInt8=function(o,n){return o=o>>>0,n||P(o,1,this.length),this[o]};_.prototype.readUint16LE=_.prototype.readUInt16LE=function(o,n){return o=o>>>0,n||P(o,2,this.length),this[o]|this[o+1]<<8};_.prototype.readUint16BE=_.prototype.readUInt16BE=function(o,n){return o=o>>>0,n||P(o,2,this.length),this[o]<<8|this[o+1]};_.prototype.readUint32LE=_.prototype.readUInt32LE=function(o,n){return o=o>>>0,n||P(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216};_.prototype.readUint32BE=_.prototype.readUInt32BE=function(o,n){return o=o>>>0,n||P(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])};_.prototype.readIntLE=function(o,n,r){o=o>>>0,n=n>>>0,r||P(o,n,this.length);for(var s=this[o],p=1,m=0;++m<n&&(p*=256);)s+=this[o+m]*p;return p*=128,s>=p&&(s-=Math.pow(2,8*n)),s};_.prototype.readIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||P(o,n,this.length);for(var s=n,p=1,m=this[o+--s];s>0&&(p*=256);)m+=this[o+--s]*p;return p*=128,m>=p&&(m-=Math.pow(2,8*n)),m};_.prototype.readInt8=function(o,n){return o=o>>>0,n||P(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]};_.prototype.readInt16LE=function(o,n){o=o>>>0,n||P(o,2,this.length);var r=this[o]|this[o+1]<<8;return r&32768?r|4294901760:r};_.prototype.readInt16BE=function(o,n){o=o>>>0,n||P(o,2,this.length);var r=this[o+1]|this[o]<<8;return r&32768?r|4294901760:r};_.prototype.readInt32LE=function(o,n){return o=o>>>0,n||P(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24};_.prototype.readInt32BE=function(o,n){return o=o>>>0,n||P(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]};_.prototype.readFloatLE=function(o,n){return o=o>>>0,n||P(o,4,this.length),Le.read(this,o,!0,23,4)};_.prototype.readFloatBE=function(o,n){return o=o>>>0,n||P(o,4,this.length),Le.read(this,o,!1,23,4)};_.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||P(o,8,this.length),Le.read(this,o,!0,52,8)};_.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||P(o,8,this.length),Le.read(this,o,!1,52,8)};function W(e,o,n,r,s,p){if(!_.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>s||o<p)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}_.prototype.writeUintLE=_.prototype.writeUIntLE=function(o,n,r,s){if(o=+o,n=n>>>0,r=r>>>0,!s){var p=Math.pow(2,8*r)-1;W(this,o,n,r,p,0)}var m=1,d=0;for(this[n]=o&255;++d<r&&(m*=256);)this[n+d]=o/m&255;return n+r};_.prototype.writeUintBE=_.prototype.writeUIntBE=function(o,n,r,s){if(o=+o,n=n>>>0,r=r>>>0,!s){var p=Math.pow(2,8*r)-1;W(this,o,n,r,p,0)}var m=r-1,d=1;for(this[n+m]=o&255;--m>=0&&(d*=256);)this[n+m]=o/d&255;return n+r};_.prototype.writeUint8=_.prototype.writeUInt8=function(o,n,r){return o=+o,n=n>>>0,r||W(this,o,n,1,255,0),this[n]=o&255,n+1};_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||W(this,o,n,2,65535,0),this[n]=o&255,this[n+1]=o>>>8,n+2};_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||W(this,o,n,2,65535,0),this[n]=o>>>8,this[n+1]=o&255,n+2};_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||W(this,o,n,4,4294967295,0),this[n+3]=o>>>24,this[n+2]=o>>>16,this[n+1]=o>>>8,this[n]=o&255,n+4};_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||W(this,o,n,4,4294967295,0),this[n]=o>>>24,this[n+1]=o>>>16,this[n+2]=o>>>8,this[n+3]=o&255,n+4};_.prototype.writeIntLE=function(o,n,r,s){if(o=+o,n=n>>>0,!s){var p=Math.pow(2,8*r-1);W(this,o,n,r,p-1,-p)}var m=0,d=1,l=0;for(this[n]=o&255;++m<r&&(d*=256);)o<0&&l===0&&this[n+m-1]!==0&&(l=1),this[n+m]=(o/d>>0)-l&255;return n+r};_.prototype.writeIntBE=function(o,n,r,s){if(o=+o,n=n>>>0,!s){var p=Math.pow(2,8*r-1);W(this,o,n,r,p-1,-p)}var m=r-1,d=1,l=0;for(this[n+m]=o&255;--m>=0&&(d*=256);)o<0&&l===0&&this[n+m+1]!==0&&(l=1),this[n+m]=(o/d>>0)-l&255;return n+r};_.prototype.writeInt8=function(o,n,r){return o=+o,n=n>>>0,r||W(this,o,n,1,127,-128),o<0&&(o=255+o+1),this[n]=o&255,n+1};_.prototype.writeInt16LE=function(o,n,r){return o=+o,n=n>>>0,r||W(this,o,n,2,32767,-32768),this[n]=o&255,this[n+1]=o>>>8,n+2};_.prototype.writeInt16BE=function(o,n,r){return o=+o,n=n>>>0,r||W(this,o,n,2,32767,-32768),this[n]=o>>>8,this[n+1]=o&255,n+2};_.prototype.writeInt32LE=function(o,n,r){return o=+o,n=n>>>0,r||W(this,o,n,4,2147483647,-2147483648),this[n]=o&255,this[n+1]=o>>>8,this[n+2]=o>>>16,this[n+3]=o>>>24,n+4};_.prototype.writeInt32BE=function(o,n,r){return o=+o,n=n>>>0,r||W(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 Dt(e,o,n,r,s,p){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Nt(e,o,n,r,s){return o=+o,n=n>>>0,s||Dt(e,o,n,4,34028234663852886e22,-34028234663852886e22),Le.write(e,o,n,r,23,4),n+4}_.prototype.writeFloatLE=function(o,n,r){return Nt(this,o,n,!0,r)};_.prototype.writeFloatBE=function(o,n,r){return Nt(this,o,n,!1,r)};function Pt(e,o,n,r,s){return o=+o,n=n>>>0,s||Dt(e,o,n,8,17976931348623157e292,-17976931348623157e292),Le.write(e,o,n,r,52,8),n+8}_.prototype.writeDoubleLE=function(o,n,r){return Pt(this,o,n,!0,r)};_.prototype.writeDoubleBE=function(o,n,r){return Pt(this,o,n,!1,r)};_.prototype.copy=function(o,n,r,s){if(!_.isBuffer(o))throw new TypeError("argument should be a Buffer");if(r||(r=0),!s&&s!==0&&(s=this.length),n>=o.length&&(n=o.length),n||(n=0),s>0&&s<r&&(s=r),s===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(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),o.length-n<s-r&&(s=o.length-n+r);var p=s-r;return this===o&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,r,s):Uint8Array.prototype.set.call(o,this.subarray(r,s),n),p};_.prototype.fill=function(o,n,r,s){if(typeof o=="string"){if(typeof n=="string"?(s=n,n=0,r=this.length):typeof r=="string"&&(s=r,r=this.length),s!==void 0&&typeof s!="string")throw new TypeError("encoding must be a string");if(typeof s=="string"&&!_.isEncoding(s))throw new TypeError("Unknown encoding: "+s);if(o.length===1){var p=o.charCodeAt(0);(s==="utf8"&&p<128||s==="latin1")&&(o=p)}}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 d=_.isBuffer(o)?o:_.from(o,s),l=d.length;if(l===0)throw new TypeError('The value "'+o+'" is invalid for argument "value"');for(m=0;m<r-n;++m)this[m+n]=d[m%l]}return this};var mc=/[^+/0-9A-Za-z-_]/g;function _c(e){if(e=e.split("=")[0],e=e.trim().replace(mc,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function an(e,o){o=o||1/0;for(var n,r=e.length,s=null,p=[],m=0;m<r;++m){if(n=e.charCodeAt(m),n>55295&&n<57344){if(!s){if(n>56319){(o-=3)>-1&&p.push(239,191,189);continue}else if(m+1===r){(o-=3)>-1&&p.push(239,191,189);continue}s=n;continue}if(n<56320){(o-=3)>-1&&p.push(239,191,189),s=n;continue}n=(s-55296<<10|n-56320)+65536}else s&&(o-=3)>-1&&p.push(239,191,189);if(s=null,n<128){if((o-=1)<0)break;p.push(n)}else if(n<2048){if((o-=2)<0)break;p.push(n>>6|192,n&63|128)}else if(n<65536){if((o-=3)<0)break;p.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((o-=4)<0)break;p.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return p}function dc(e){for(var o=[],n=0;n<e.length;++n)o.push(e.charCodeAt(n)&255);return o}function lc(e,o){for(var n,r,s,p=[],m=0;m<e.length&&!((o-=2)<0);++m)n=e.charCodeAt(m),r=n>>8,s=n%256,p.push(s),p.push(r);return p}function Rt(e){return nn.toByteArray(_c(e))}function To(e,o,n,r){for(var s=0;s<r&&!(s+n>=o.length||s>=e.length);++s)o[s+n]=e[s];return s}function Z(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function pn(e){return e!==e}var uc=function(){for(var e="0123456789abcdef",o=new Array(256),n=0;n<16;++n)for(var r=n*16,s=0;s<16;++s)o[r+s]=e[n]+e[s];return o}()});var Wt=uo((Em,Ut)=>{t();var D=Ut.exports={},J,Q;function mn(){throw new Error("setTimeout has not been defined")}function _n(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?J=setTimeout:J=mn}catch(e){J=mn}try{typeof clearTimeout=="function"?Q=clearTimeout:Q=_n}catch(e){Q=_n}})();function Ot(e){if(J===setTimeout)return setTimeout(e,0);if((J===mn||!J)&&setTimeout)return J=setTimeout,setTimeout(e,0);try{return J(e,0)}catch(o){try{return J.call(null,e,0)}catch(n){return J.call(this,e,0)}}}function gc(e){if(Q===clearTimeout)return clearTimeout(e);if((Q===_n||!Q)&&clearTimeout)return Q=clearTimeout,clearTimeout(e);try{return Q(e)}catch(o){try{return Q.call(null,e)}catch(n){return Q.call(this,e)}}}var oe=[],De=!1,xe,ho=-1;function fc(){!De||!xe||(De=!1,xe.length?oe=xe.concat(oe):ho=-1,oe.length&&Ft())}function Ft(){if(!De){var e=Ot(fc);De=!0;for(var o=oe.length;o;){for(xe=oe,oe=[];++ho<o;)xe&&xe[ho].run();ho=-1,o=oe.length}xe=null,De=!1,gc(e)}}D.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];oe.push(new Bt(e,o)),oe.length===1&&!De&&Ot(Ft)};function Bt(e,o){this.fun=e,this.array=o}Bt.prototype.run=function(){this.fun.apply(null,this.array)};D.title="browser";D.browser=!0;D.env={};D.argv=[];D.version="";D.versions={};function ne(){}D.on=ne;D.addListener=ne;D.once=ne;D.off=ne;D.removeListener=ne;D.removeAllListeners=ne;D.emit=ne;D.prependListener=ne;D.prependOnceListener=ne;D.listeners=function(e){return[]};D.binding=function(e){throw new Error("process.binding is not supported")};D.cwd=function(){return"/"};D.chdir=function(e){throw new Error("process.chdir is not supported")};D.umask=function(){return 0}});var a,i,Lm,t=y(()=>{a=f(Mt()),i=f(Wt()),Lm=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 Ne,xo=y(()=>{"use strict";t();Ne=()=>Date.now()/1e3});var Gt,dn=y(()=>{"use strict";t();Gt=e=>new Date().setMilliseconds(new Date().getMilliseconds()+e)/1e3});var $t,Vt=y(()=>{"use strict";t();$t=e=>new Date().setSeconds(new Date().getSeconds()+e)/1e3});var yo=y(()=>{"use strict";t();xo();dn();Vt()});var un={};fe(un,{getItem:()=>hc,localStorageKeys:()=>me,removeItem:()=>xc,setItem:()=>Tc});var me,ln,Tc,hc,xc,Pe=y(()=>{"use strict";t();yo();me={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},ln=typeof localStorage!="undefined",Tc=({key:e,data:o,expires:n})=>{!ln||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},hc=e=>{if(!ln)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:Ne()>=n.expires?(localStorage.removeItem(String(e)),null):n.data},xc=e=>{!ln||localStorage.removeItem(String(e))}});var gn={};fe(gn,{clear:()=>Kt,getItem:()=>zt,removeItem:()=>qt,setItem:()=>jt,storage:()=>yc});var jt,zt,qt,Kt,yc,Xt=y(()=>{"use strict";t();jt=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},zt=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},qt=e=>sessionStorage.removeItem(String(e)),Kt=()=>sessionStorage.clear(),yc={setItem:jt,getItem:zt,removeItem:qt,clear:Kt}});var j,ye=y(()=>{"use strict";t();Pe();Xt();j={session:gn,local:un}});var C=y(()=>{"use strict";t()});function _e(e){return e!=null&&(Cc(e)||Qe(e))}function Me(e){return e!=null&&(Dc(e)||Rc(e))}function Oe(e){return e!=null&&(Nc(e)||Mc(e))}function Je(e){return e!=null&&Pc(e)}function Cc(e){return e!=null&&Sc.includes(e)}function Dc(e){return e!=null&&vc.includes(e)}function Nc(e){return e!=null&&kc.includes(e)}function Pc(e){return e!=null&&Ac.includes(e)}function Qe(e){return e!=null&&Ic.includes(e)}function Rc(e){return e!=null&&Ec.includes(e)}function Mc(e){return e!=null&&Lc.includes(e)}var Sc,vc,kc,Ac,Ic,Ec,Lc,re=y(()=>{"use strict";t();C();Sc=["sent"],vc=["success"],kc=["fail","cancelled","timedOut"],Ac=["timedOut"],Ic=["pending"],Ec=["success"],Lc=["fail","invalid"]});function eo(){return new Date().setHours(new Date().getHours()+24)}function oo(e){j.local.setItem({key:me.loginExpiresAt,data:e,expires:e})}var hn=y(()=>{"use strict";t();ye();Pe()});var Fe=y(()=>{"use strict";t()});var or=y(()=>{"use strict";t()});var F=y(()=>{"use strict";t()});var nr=y(()=>{"use strict";t()});var tr=y(()=>{"use strict";t()});var rr=y(()=>{"use strict";t()});var ar=y(()=>{"use strict";t()});var B=y(()=>{"use strict";t();or();F();C();nr();tr();rr();ar()});var no,ir,g_,cr,f_,sr,T_,h_,Oc,to=y(()=>{"use strict";t();B();no={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:ir,egldLabel:g_}=no["devnet"],{chainId:cr,egldLabel:f_}=no["testnet"],{chainId:sr,egldLabel:T_}=no["mainnet"],h_={["devnet"]:ir,["testnet"]:cr,["mainnet"]:sr},Oc={[ir]:"devnet",[cr]:"testnet",[sr]:"mainnet"}});var xn=y(()=>{"use strict";t()});var pr=y(()=>{"use strict";t()});var wo,yn=y(()=>{"use strict";t();wo="transaction-status-toast-id"});var ro,So,mr,bn,vo,_r,Be,k=y(()=>{"use strict";t();Fe();to();xn();pr();yn();ro=5e4,So=1e9,mr=1,bn=4294967295,vo="logout",_r="login",Be="0"});var wn,U,ae,G=y(()=>{"use strict";t();wn=require("@reduxjs/toolkit");k();U=(0,wn.createAction)(vo),ae=(0,wn.createAction)(_r,e=>({payload:e}))});var lr,dr,ur,O_,gr,Fc,ao,fr,Bc,Tr,hr,Sn=y(()=>{"use strict";t();lr=require("@reduxjs/toolkit");hn();C();G();dr={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},ur=(0,lr.createSlice)({name:"loginInfoSlice",initialState:dr,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(U,()=>dr),e.addCase(ae,(o,n)=>{o.loginMethod=n.payload.loginMethod,oo(eo())})}}),{setLoginMethod:O_,setWalletConnectLogin:gr,setLedgerLogin:Fc,setTokenLogin:ao,setTokenLoginSignature:fr,setWalletLogin:Bc,invalidateLoginSession:Tr}=ur.actions,hr=ur.reducer});var io=y(()=>{"use strict";t()});var yr=y(()=>{"use strict";t();io()});function vn(e){return e[Math.floor(Math.random()*e.length)]}var br=y(()=>{"use strict";t()});var kn=y(()=>{"use strict";t();xn()});var Ue=y(()=>{"use strict";t();yr();br();kn()});var wr,Sr,An,Uc,vr,Z_,J_,kr,In=y(()=>{"use strict";t();wr=require("@reduxjs/toolkit"),Sr=f(require("lodash.omit"));Ue();An={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Uc={network:An,chainID:"-1"},vr=(0,wr.createSlice)({name:"appConfig",initialState:Uc,reducers:{initializeNetworkConfig:(e,o)=>{let n=vn(o.payload.walletConnectBridgeAddresses),r=vn(o.payload.walletConnectV2RelayAddresses),s=(0,Sr.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=w(x(x({},e.network),s),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(e,o)=>{e.chainID=o.payload}}}),{initializeNetworkConfig:Z_,setChainID:J_}=vr.actions,kr=vr.reducer});var Ln,Ar,Ir,ko,En,Er,Cn,id,Dn,cd,Wc,Gc,sd,pd,md,$c,Lr,Nn=y(()=>{"use strict";t();Ln=require("@elrondnetwork/erdjs"),Ar=require("@reduxjs/toolkit"),Ir=require("redux-persist");k();ye();Pe();G();ko={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Be},En={address:"",websocketEvent:null,accounts:{"":ko},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Er=(0,Ar.createSlice)({name:"accountInfoSlice",initialState:En,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new Ln.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:ko},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(U,()=>(j.local.removeItem(me.loginExpiresAt),En)),e.addCase(ae,(o,n)=>{let{address:r}=n.payload;o.address=r,o.publicKey=new Ln.Address(r).hex()}),e.addCase(Ir.REHYDRATE,(o,n)=>{var u;if(!((u=n.payload)!=null&&u.account))return;let{account:r}=n.payload,{address:s,shard:p,accounts:m,publicKey:d}=r;o.address=s,o.shard=p;let l=m&&s in m;o.accounts=l?m:En.accounts,o.publicKey=d})}}),{setAccount:Cn,setAddress:id,setAccountNonce:Dn,setAccountShard:cd,setLedgerAccount:Wc,updateLedgerAccount:Gc,setWalletConnectAccount:sd,setIsAccountLoading:pd,setAccountLoadingError:md,setWebsocketEvent:$c}=Er.actions,Lr=Er.reducer});var Cr,Dr,co,Vc,Nr,Pr,Rr,Hc,Ao,jc,zc,Td,qc,Io,Pn,Eo,Lo=y(()=>{"use strict";t();Cr=require("@reduxjs/toolkit"),Dr=require("redux-persist");C();re();G();co={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Vc={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Nr=(0,Cr.createSlice)({name:"transactionsSlice",initialState:co,reducers:{moveTransactionsToSignedState:(e,o)=>{var l,u;let{sessionId:n,transactions:r,errorMessage:s,status:p,redirectRoute:m}=o.payload,d=((l=e.customTransactionInformationForSessionId)==null?void 0:l[n])||Vc;e.signedTransactions[n]={transactions:r,status:p,errorMessage:s,redirectRoute:m,customTransactionInformation:d},((u=e==null?void 0:e.transactionsToSign)==null?void 0:u.sessionId)===n&&(e.transactionsToSign=co.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=x(x({},e.signedTransactions),o.payload)},updateSignedTransactions:(e,o)=>{let{sessionId:n,status:r,errorMessage:s,transactions:p}=o.payload;e.signedTransactions[n]!=null&&(e.signedTransactions[n].status=r,s!=null&&(e.signedTransactions[n].errorMessage=s),p!=null&&(e.signedTransactions[n].transactions=p))},updateSignedTransactionStatus:(e,o)=>{var d,l,u,h,g,E;let{sessionId:n,status:r,errorMessage:s,transactionHash:p}=o.payload,m=(l=(d=e.signedTransactions)==null?void 0:d[n])==null?void 0:l.transactions;if(m!=null){e.signedTransactions[n].transactions=m.map(M=>M.hash===p?w(x({},M),{status:r,errorMessage:s}):M);let L=(h=(u=e.signedTransactions[n])==null?void 0:u.transactions)==null?void 0:h.every(M=>Me(M.status)),R=(E=(g=e.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:E.every(M=>Oe(M.status));L&&(e.signedTransactions[n].status="success"),R&&(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=co.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=co.signedTransactions},setSignTransactionsError:(e,o)=>{e.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(e,o)=>{e.signTransactionsCancelMessage=o.payload}},extraReducers:e=>{e.addCase(U,()=>co),e.addCase(Dr.REHYDRATE,(o,n)=>{var m;if(o.signTransactionsCancelMessage=null,!((m=n.payload)!=null&&m.transactions))return;let{signedTransactions:r,customTransactionInformationForSessionId:s}=n.payload.transactions,p=Object.entries(r).reduce((d,[l,u])=>{let h=new Date(l),g=new Date;return g.setHours(g.getHours()+5),g-h>0||(d[l]=u),d},{});s!=null&&(o.customTransactionInformationForSessionId=s),r!=null&&(o.signedTransactions=p)})}}),{updateSignedTransactionStatus:Pr,updateSignedTransactions:Rr,setTransactionsToSign:Hc,clearAllTransactionsToSign:Ao,clearAllSignedTransactions:jc,clearSignedTransaction:zc,clearTransactionToSign:Td,setSignTransactionsError:qc,setSignTransactionsCancelMessage:Io,moveTransactionsToSignedState:Pn}=Nr.actions,Eo=Nr.reducer});var Mr,Mn,On,Fn,Kc,Rn,Or,bd,Xc,Bn,Co,Do=y(()=>{"use strict";t();Mr=require("@reduxjs/toolkit");G();Mn="Transaction failed",On="Transaction successful",Fn="Processing transaction",Kc="Transaction submitted",Rn={},Or=(0,Mr.createSlice)({name:"transactionsInfo",initialState:Rn,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:r}=o.payload;n!=null&&(e[n]={errorMessage:(r==null?void 0:r.errorMessage)||Mn,successMessage:(r==null?void 0:r.successMessage)||On,processingMessage:(r==null?void 0:r.processingMessage)||Fn,submittedMessage:(r==null?void 0:r.submittedMessage)||Kc,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(e,o){o.payload!=null&&delete e[o.payload]},clearTransactionsInfo:()=>Rn},extraReducers:e=>{e.addCase(U,()=>Rn)}}),{clearTransactionsInfo:bd,setTransactionsDisplayInfo:Xc,clearTransactionsInfoForSessionId:Bn}=Or.actions,Co=Or.reducer});var Br,Fr,Ur,kd,Yc,Ad,Zc,Wr,Un=y(()=>{"use strict";t();Br=require("@reduxjs/toolkit");G();Fr={},Ur=(0,Br.createSlice)({name:"modalsSlice",initialState:Fr,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(U,()=>Fr)}}),{setTxSubmittedModal:kd,setNotificationModal:Yc,clearTxSubmittedModal:Ad,clearNotificationModal:Zc}=Ur.actions,Wr=Ur.reducer});var $r,Vr,Gr,Hr,Jc,Wn,Rd,Md,Od,Fd,No,Po=y(()=>{"use strict";t();$r=require("@reduxjs/toolkit"),Vr=require("redux-persist");yn();B();xo();G();Gr={customToasts:[],transactionToasts:[],failTransactionToast:null},Hr=(0,$r.createSlice)({name:"toastsSlice",initialState:Gr,reducers:{addCustomToast:(e,o)=>{e.customToasts.push(w(x({},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:Ne(),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(x({},o.payload),{toastId:wo})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(U,()=>Gr),e.addCase(Vr.REHYDRATE,(o,n)=>{var s,p;let r=(p=(s=n.customToasts)==null?void 0:s.filter(m=>!("component"in m)))!=null?p:[];o.customToasts=r})}}),{addCustomToast:Jc,removeCustomToast:Wn,addTransactionToast:Rd,removeTransactionToast:Md,addFailTransactionToast:Od,removeFailTransactionToast:Fd}=Hr.actions,No=Hr.reducer});var A=y(()=>{"use strict";t();Sn();In();Nn();Lo();Do();Un();Po()});var jn=y(()=>{"use strict";t()});var ia,aa,ca,iu,cu,su,pu,mu,_u,sa,pa=y(()=>{"use strict";t();ia=require("@reduxjs/toolkit");G();aa={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},ca=(0,ia.createSlice)({name:"dappModalsSlice",initialState:aa,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=x({},o.payload)}},extraReducers:e=>{e.addCase(U,()=>aa)}}),{setDappModalVisibility:iu,setDappModalHeaderVisibility:cu,setDappModalFooterVisibility:su,setDappModalHeaderText:pu,setDappModalFooterText:mu,setDappModalConfig:_u}=ca.actions,sa=ca.reducer});var ma,Ts,hs,Ge,Wo=y(()=>{"use strict";t();ma=require("@reduxjs/toolkit");jn();Nn();pa();Sn();Un();In();Po();Do();Lo();Ts={["account"]:Lr,["networkConfig"]:kr,["loginInfo"]:hr,["modals"]:Wr,["dappModal"]:sa,["toasts"]:No,["transactions"]:Eo,["transactionsInfo"]:Co},hs=(e={})=>(0,ma.combineReducers)(x(x({},Ts),e)),Ge=hs});var la={};fe(la,{default:()=>ks});function zn(e,o=[]){return{key:e,version:1,storage:da.default,blacklist:o}}var Se,_a,da,xs,ys,bs,ws,Ss,vs,ks,ua=y(()=>{"use strict";t();Se=require("redux-persist"),_a=f(require("redux-persist/lib/storage")),da=f(require("redux-persist/lib/storage/session"));Wo();A();Po();Do();Lo();jn();xs={2:e=>w(x({},e),{networkConfig:An})};ys=zn("dapp-core-transactionsInfo"),bs=zn("dapp-core-transactions",["transactionsToSign"]),ws=zn("dapp-core-toasts"),Ss={key:"dapp-core-store",version:2,storage:_a.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,Se.createMigrate)(xs,{debug:!1})},vs={["toasts"]:(0,Se.persistReducer)(ws,No),["transactions"]:(0,Se.persistReducer)(bs,Eo),["transactionsInfo"]:(0,Se.persistReducer)(ys,Co)},ks=(0,Se.persistReducer)(Ss,Ge(vs))});var ga={};fe(ga,{default:()=>As});var As,fa=y(()=>{"use strict";t();Wo();As=Ge()});var Ta={};fe(Ta,{default:()=>Es});var q,Is,Es,ha=y(()=>{"use strict";t();q=require("redux-persist"),Is=[q.FLUSH,q.REHYDRATE,q.PAUSE,q.PERSIST,q.PURGE,q.REGISTER],Es=Is});var ba={};fe(ba,{default:()=>ya});function ya(e){return(0,xa.persistStore)(e)}var xa,wa=y(()=>{"use strict";t();xa=require("redux-persist")});var Sm={};fe(Sm,{TransactionToastGuard:()=>wm});module.exports=Ye(Sm);t();var Ni=f(require("react"));t();t();var Zo=f(require("react"));t();var $=f(require("react")),Yt=f(require("classnames"));yo();t();var Ht=e=>{let r=Math.log(.005),p=(Math.log(2)-r)/(10-0);return Math.exp(r+p*(e-0))};ye();t();var bc=`.dapp-core-component__progressStyles__progress { position: relative; } .dapp-core-component__progressStyles__progress .dapp-core-component__progressStyles__bar { position: absolute; pointer-events: none; left: -0.5rem; right: -0.5rem; bottom: -0.5rem; top: -0.5rem; background-color: #495057; opacity: 0.25; transition: width 0.6s ease; max-width: calc(100% + 1rem); }`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(bc));var fn={progress:"dapp-core-component__progressStyles__progress",bar:"dapp-core-component__progressStyles__bar"};var bo="toastProgress",Zt=({id:e,children:o,progress:n,done:r,expiresIn:s=10*60,className:p="dapp-progress"})=>{let m=(0,$.useMemo)(()=>{let I=n?n.endTime-n.startTime:0,O=j.session.getItem(bo),Jo=Math.floor(Date.now()/1e3),Ke=n?(n.endTime-Jo)*100/I:0;return{currentRemaining:O&&e in O?O[e]:Ke,totalSeconds:I}},[]),{totalSeconds:d,currentRemaining:l}=m,u=(0,$.useRef)(null),h=(0,$.useRef)(),g=(0,$.useRef)(l);(0,$.useEffect)(()=>{if(n!=null)return r?M():qe(),()=>{clearInterval(h.current)}},[n,r]);function E(){let I=j.session.getItem(bo);!Boolean(I==null?void 0:I[e])||(delete I[e],R(I))}function L(I){let O=j.session.getItem(bo)||{};O[e]=I,R(O)}function R(I){j.session.setItem({key:bo,data:I,expires:$t(s)})}function M(){h.current=setInterval(()=>{if(u.current==null)return;let O=g.current-1;O<=0?(clearInterval(h.current),E(),pe(0)):(L(O),pe(O))},5)}function qe(){let O=d/90,Jo=parseFloat(O.toFixed(2))*1e3;h.current=setInterval(()=>{if(u.current==null)return;let Ke=g.current,ut=Ke>100-90?1:Ht(Ke),gt=Ke-ut;L(gt),pe(gt)},Jo)}function pe(I){g.current=I,ue()}function ue(){if(u.current==null)return;let I=g.current;u.current.style.width=`${I}%`,u.current.ariaValueNow=I}return n?$.default.createElement("div",{className:(0,Yt.default)(fn.progress,p)},$.default.createElement("div",{ref:u,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,className:fn.bar}),o):$.default.createElement($.default.Fragment,null,o)};t();t();var Tn=f(require("react")),Jt=require("@fortawesome/free-solid-svg-icons"),Qt=require("@fortawesome/react-fontawesome"),er=({className:e="dapp-default-toast-delete-button",onClick:o})=>Tn.default.createElement("button",{type:"button",className:e,onClick:o},Tn.default.createElement(Qt.FontAwesomeIcon,{icon:Jt.faTimes,size:"xs"}));t();var X=f(require("react")),ii=require("@fortawesome/react-fontawesome"),rt=f(require("classnames"));t();var wc=`.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 { backgrou