UNPKG

@sofaws/dapp-core

Version:

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

201 lines (179 loc) 159 kB
"use strict";var Br=Object.create;var we=Object.defineProperty,Ur=Object.defineProperties,$r=Object.getOwnPropertyDescriptor,Vr=Object.getOwnPropertyDescriptors,Wr=Object.getOwnPropertyNames,Be=Object.getOwnPropertySymbols,Hr=Object.getPrototypeOf,uo=Object.prototype.hasOwnProperty,ln=Object.prototype.propertyIsEnumerable;var dn=(e,o,n)=>o in e?we(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,b=(e,o)=>{for(var n in o||(o={}))uo.call(o,n)&&dn(e,n,o[n]);if(Be)for(var n of Be(o))ln.call(o,n)&&dn(e,n,o[n]);return e},w=(e,o)=>Ur(e,Vr(o));var Ue=(e,o)=>{var n={};for(var r in e)uo.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Be)for(var r of Be(e))o.indexOf(r)<0&&ln.call(e,r)&&(n[r]=e[r]);return n};var h=(e,o)=>()=>(e&&(o=e(e=0)),o);var $e=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),ae=(e,o)=>{for(var n in o)we(e,n,{get:o[n],enumerable:!0})},un=(e,o,n,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of Wr(o))!uo.call(e,a)&&a!==n&&we(e,a,{get:()=>o[a],enumerable:!(r=$r(o,a))||r.enumerable});return e};var T=(e,o,n)=>(n=e!=null?Br(Hr(e)):{},un(o||!e||!e.__esModule?we(n,"default",{value:e,enumerable:!0}):n,e)),Se=e=>un(we({},"__esModule",{value:!0}),e);var L=(e,o,n)=>new Promise((r,a)=>{var m=d=>{try{l(n.next(d))}catch(u){a(u)}},s=d=>{try{l(n.throw(d))}catch(u){a(u)}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(m,s);l((n=n.apply(e,o)).next())});var hn=$e(Ve=>{"use strict";t();Ve.byteLength=zr;Ve.toByteArray=qr;Ve.fromByteArray=Yr;var W=[],O=[],jr=typeof Uint8Array!="undefined"?Uint8Array:Array,go="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ie=0,gn=go.length;ie<gn;++ie)W[ie]=go[ie],O[go.charCodeAt(ie)]=ie;var ie,gn;O["-".charCodeAt(0)]=62;O["_".charCodeAt(0)]=63;function fn(e){var o=e.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=o);var r=n===o?0:4-n%4;return[n,r]}function zr(e){var o=fn(e),n=o[0],r=o[1];return(n+r)*3/4-r}function Gr(e,o,n){return(o+n)*3/4-n}function qr(e){var o,n=fn(e),r=n[0],a=n[1],m=new jr(Gr(e,r,a)),s=0,l=a>0?r-4:r,d;for(d=0;d<l;d+=4)o=O[e.charCodeAt(d)]<<18|O[e.charCodeAt(d+1)]<<12|O[e.charCodeAt(d+2)]<<6|O[e.charCodeAt(d+3)],m[s++]=o>>16&255,m[s++]=o>>8&255,m[s++]=o&255;return a===2&&(o=O[e.charCodeAt(d)]<<2|O[e.charCodeAt(d+1)]>>4,m[s++]=o&255),a===1&&(o=O[e.charCodeAt(d)]<<10|O[e.charCodeAt(d+1)]<<4|O[e.charCodeAt(d+2)]>>2,m[s++]=o>>8&255,m[s++]=o&255),m}function Kr(e){return W[e>>18&63]+W[e>>12&63]+W[e>>6&63]+W[e&63]}function Xr(e,o,n){for(var r,a=[],m=o;m<n;m+=3)r=(e[m]<<16&16711680)+(e[m+1]<<8&65280)+(e[m+2]&255),a.push(Kr(r));return a.join("")}function Yr(e){for(var o,n=e.length,r=n%3,a=[],m=16383,s=0,l=n-r;s<l;s+=m)a.push(Xr(e,s,s+m>l?l:s+m));return r===1?(o=e[n-1],a.push(W[o>>2]+W[o<<4&63]+"==")):r===2&&(o=(e[n-2]<<8)+e[n-1],a.push(W[o>>10]+W[o>>4&63]+W[o<<2&63]+"=")),a.join("")}});var xn=$e(fo=>{t();fo.read=function(e,o,n,r,a){var m,s,l=a*8-r-1,d=(1<<l)-1,u=d>>1,x=-7,g=n?a-1:0,y=n?-1:1,S=e[o+g];for(g+=y,m=S&(1<<-x)-1,S>>=-x,x+=l;x>0;m=m*256+e[o+g],g+=y,x-=8);for(s=m&(1<<-x)-1,m>>=-x,x+=r;x>0;s=s*256+e[o+g],g+=y,x-=8);if(m===0)m=1-u;else{if(m===d)return s?NaN:(S?-1:1)*(1/0);s=s+Math.pow(2,r),m=m-u}return(S?-1:1)*s*Math.pow(2,m-r)};fo.write=function(e,o,n,r,a,m){var s,l,d,u=m*8-a-1,x=(1<<u)-1,g=x>>1,y=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=r?0:m-1,$=r?1:-1,F=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(l=isNaN(o)?1:0,s=x):(s=Math.floor(Math.log(o)/Math.LN2),o*(d=Math.pow(2,-s))<1&&(s--,d*=2),s+g>=1?o+=y/d:o+=y*Math.pow(2,1-g),o*d>=2&&(s++,d/=2),s+g>=x?(l=0,s=x):s+g>=1?(l=(o*d-1)*Math.pow(2,a),s=s+g):(l=o*Math.pow(2,g-1)*Math.pow(2,a),s=0));a>=8;e[n+S]=l&255,S+=$,l/=256,a-=8);for(s=s<<a|l,u+=a;u>0;e[n+S]=s&255,S+=$,s/=256,u-=8);e[n+S-$]|=F*128}});var Dn=$e(le=>{"use strict";t();var ho=hn(),de=xn(),bn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;le.Buffer=_;le.SlowBuffer=na;le.INSPECT_MAX_BYTES=50;var We=2147483647;le.kMaxLength=We;_.TYPED_ARRAY_SUPPORT=Zr();!_.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 Zr(){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 X(e){if(e>We)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 To(e)}return wn(e,o,n)}_.poolSize=8192;function wn(e,o,n){if(typeof e=="string")return Qr(e,o);if(ArrayBuffer.isView(e))return ea(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(H(e,SharedArrayBuffer)||e&&H(e.buffer,SharedArrayBuffer)))return bo(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 a=oa(e);if(a)return a;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 wn(e,o,n)};Object.setPrototypeOf(_.prototype,Uint8Array.prototype);Object.setPrototypeOf(_,Uint8Array);function Sn(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 Jr(e,o,n){return Sn(e),e<=0?X(e):o!==void 0?typeof n=="string"?X(e).fill(o,n):X(e).fill(o):X(e)}_.alloc=function(e,o,n){return Jr(e,o,n)};function To(e){return Sn(e),X(e<0?0:wo(e)|0)}_.allocUnsafe=function(e){return To(e)};_.allocUnsafeSlow=function(e){return To(e)};function Qr(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!_.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=vn(e,o)|0,r=X(n),a=r.write(e,o);return a!==n&&(r=r.slice(0,a)),r}function xo(e){for(var o=e.length<0?0:wo(e.length)|0,n=X(o),r=0;r<o;r+=1)n[r]=e[r]&255;return n}function ea(e){if(H(e,Uint8Array)){var o=new Uint8Array(e);return bo(o.buffer,o.byteOffset,o.byteLength)}return xo(e)}function bo(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 oa(e){if(_.isBuffer(e)){var o=wo(e.length)|0,n=X(o);return n.length===0||e.copy(n,0,0,o),n}if(e.length!==void 0)return typeof e.length!="number"||So(e.length)?X(0):xo(e);if(e.type==="Buffer"&&Array.isArray(e.data))return xo(e.data)}function wo(e){if(e>=We)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+We.toString(16)+" bytes");return e|0}function na(e){return+e!=e&&(e=0),_.alloc(+e)}_.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==_.prototype};_.compare=function(o,n){if(H(o,Uint8Array)&&(o=_.from(o,o.offset,o.byteLength)),H(n,Uint8Array)&&(n=_.from(n,n.offset,n.byteLength)),!_.isBuffer(o)||!_.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(o===n)return 0;for(var r=o.length,a=n.length,m=0,s=Math.min(r,a);m<s;++m)if(o[m]!==n[m]){r=o[m],a=n[m];break}return r<a?-1:a<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 a=_.allocUnsafe(n),m=0;for(r=0;r<o.length;++r){var s=o[r];if(H(s,Uint8Array))m+s.length>a.length?_.from(s).copy(a,m):Uint8Array.prototype.set.call(a,s,m);else if(_.isBuffer(s))s.copy(a,m);else throw new TypeError('"list" argument must be an Array of Buffers');m+=s.length}return a};function vn(e,o){if(_.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;for(var a=!1;;)switch(o){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return yo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Nn(e).length;default:if(a)return r?-1:yo(e).length;o=(""+o).toLowerCase(),a=!0}}_.byteLength=vn;function ta(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 la(this,o,n);case"utf8":case"utf-8":return An(this,o,n);case"ascii":return _a(this,o,n);case"latin1":case"binary":return da(this,o,n);case"base64":return ma(this,o,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ua(this,o,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}_.prototype._isBuffer=!0;function pe(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)pe(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)pe(this,n,n+3),pe(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)pe(this,n,n+7),pe(this,n+1,n+6),pe(this,n+2,n+5),pe(this,n+3,n+4);return this};_.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?An(this,0,o):ta.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=le.INSPECT_MAX_BYTES;return o=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(o+=" ... "),"<Buffer "+o+">"};bn&&(_.prototype[bn]=_.prototype.inspect);_.prototype.compare=function(o,n,r,a,m){if(H(o,Uint8Array)&&(o=_.from(o,o.offset,o.byteLength)),!_.isBuffer(o))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof o);if(n===void 0&&(n=0),r===void 0&&(r=o?o.length:0),a===void 0&&(a=0),m===void 0&&(m=this.length),n<0||r>o.length||a<0||m>this.length)throw new RangeError("out of range index");if(a>=m&&n>=r)return 0;if(a>=m)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,a>>>=0,m>>>=0,this===o)return 0;for(var s=m-a,l=r-n,d=Math.min(s,l),u=this.slice(a,m),x=o.slice(n,r),g=0;g<d;++g)if(u[g]!==x[g]){s=u[g],l=x[g];break}return s<l?-1:l<s?1:0};function kn(e,o,n,r,a){if(e.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,So(n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0)if(a)n=0;else return-1;if(typeof o=="string"&&(o=_.from(o,r)),_.isBuffer(o))return o.length===0?-1:yn(e,o,n,r,a);if(typeof o=="number")return o=o&255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e,o,n):Uint8Array.prototype.lastIndexOf.call(e,o,n):yn(e,[o],n,r,a);throw new TypeError("val must be string, number or Buffer")}function yn(e,o,n,r,a){var m=1,s=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;m=2,s/=2,l/=2,n/=2}function d(S,$){return m===1?S[$]:S.readUInt16BE($*m)}var u;if(a){var x=-1;for(u=n;u<s;u++)if(d(e,u)===d(o,x===-1?0:u-x)){if(x===-1&&(x=u),u-x+1===l)return x*m}else x!==-1&&(u-=u-x),x=-1}else for(n+l>s&&(n=s-l),u=n;u>=0;u--){for(var g=!0,y=0;y<l;y++)if(d(e,u+y)!==d(o,y)){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 kn(this,o,n,r,!0)};_.prototype.lastIndexOf=function(o,n,r){return kn(this,o,n,r,!1)};function ra(e,o,n,r){n=Number(n)||0;var a=e.length-n;r?(r=Number(r),r>a&&(r=a)):r=a;var m=o.length;r>m/2&&(r=m/2);for(var s=0;s<r;++s){var l=parseInt(o.substr(s*2,2),16);if(So(l))return s;e[n+s]=l}return s}function aa(e,o,n,r){return He(yo(o,e.length-n),e,n,r)}function ia(e,o,n,r){return He(ha(o),e,n,r)}function pa(e,o,n,r){return He(Nn(o),e,n,r)}function ca(e,o,n,r){return He(xa(o,e.length-n),e,n,r)}_.prototype.write=function(o,n,r,a){if(n===void 0)a="utf8",r=this.length,n=0;else if(r===void 0&&typeof n=="string")a=n,r=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(r)?(r=r>>>0,a===void 0&&(a="utf8")):(a=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var m=this.length-n;if((r===void 0||r>m)&&(r=m),o.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var s=!1;;)switch(a){case"hex":return ra(this,o,n,r);case"utf8":case"utf-8":return aa(this,o,n,r);case"ascii":case"latin1":case"binary":return ia(this,o,n,r);case"base64":return pa(this,o,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ca(this,o,n,r);default:if(s)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),s=!0}};_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ma(e,o,n){return o===0&&n===e.length?ho.fromByteArray(e):ho.fromByteArray(e.slice(o,n))}function An(e,o,n){n=Math.min(e.length,n);for(var r=[],a=o;a<n;){var m=e[a],s=null,l=m>239?4:m>223?3:m>191?2:1;if(a+l<=n){var d,u,x,g;switch(l){case 1:m<128&&(s=m);break;case 2:d=e[a+1],(d&192)===128&&(g=(m&31)<<6|d&63,g>127&&(s=g));break;case 3:d=e[a+1],u=e[a+2],(d&192)===128&&(u&192)===128&&(g=(m&15)<<12|(d&63)<<6|u&63,g>2047&&(g<55296||g>57343)&&(s=g));break;case 4:d=e[a+1],u=e[a+2],x=e[a+3],(d&192)===128&&(u&192)===128&&(x&192)===128&&(g=(m&15)<<18|(d&63)<<12|(u&63)<<6|x&63,g>65535&&g<1114112&&(s=g))}}s===null?(s=65533,l=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),a+=l}return sa(r)}var Tn=4096;function sa(e){var o=e.length;if(o<=Tn)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<o;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Tn));return n}function _a(e,o,n){var r="";n=Math.min(e.length,n);for(var a=o;a<n;++a)r+=String.fromCharCode(e[a]&127);return r}function da(e,o,n){var r="";n=Math.min(e.length,n);for(var a=o;a<n;++a)r+=String.fromCharCode(e[a]);return r}function la(e,o,n){var r=e.length;(!o||o<0)&&(o=0),(!n||n<0||n>r)&&(n=r);for(var a="",m=o;m<n;++m)a+=ba[e[m]];return a}function ua(e,o,n){for(var r=e.slice(o,n),a="",m=0;m<r.length-1;m+=2)a+=String.fromCharCode(r[m]+r[m+1]*256);return a}_.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 a=this.subarray(o,n);return Object.setPrototypeOf(a,_.prototype),a};function I(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||I(o,n,this.length);for(var a=this[o],m=1,s=0;++s<n&&(m*=256);)a+=this[o+s]*m;return a};_.prototype.readUintBE=_.prototype.readUIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||I(o,n,this.length);for(var a=this[o+--n],m=1;n>0&&(m*=256);)a+=this[o+--n]*m;return a};_.prototype.readUint8=_.prototype.readUInt8=function(o,n){return o=o>>>0,n||I(o,1,this.length),this[o]};_.prototype.readUint16LE=_.prototype.readUInt16LE=function(o,n){return o=o>>>0,n||I(o,2,this.length),this[o]|this[o+1]<<8};_.prototype.readUint16BE=_.prototype.readUInt16BE=function(o,n){return o=o>>>0,n||I(o,2,this.length),this[o]<<8|this[o+1]};_.prototype.readUint32LE=_.prototype.readUInt32LE=function(o,n){return o=o>>>0,n||I(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||I(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||I(o,n,this.length);for(var a=this[o],m=1,s=0;++s<n&&(m*=256);)a+=this[o+s]*m;return m*=128,a>=m&&(a-=Math.pow(2,8*n)),a};_.prototype.readIntBE=function(o,n,r){o=o>>>0,n=n>>>0,r||I(o,n,this.length);for(var a=n,m=1,s=this[o+--a];a>0&&(m*=256);)s+=this[o+--a]*m;return m*=128,s>=m&&(s-=Math.pow(2,8*n)),s};_.prototype.readInt8=function(o,n){return o=o>>>0,n||I(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]};_.prototype.readInt16LE=function(o,n){o=o>>>0,n||I(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||I(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||I(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||I(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||I(o,4,this.length),de.read(this,o,!0,23,4)};_.prototype.readFloatBE=function(o,n){return o=o>>>0,n||I(o,4,this.length),de.read(this,o,!1,23,4)};_.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||I(o,8,this.length),de.read(this,o,!0,52,8)};_.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||I(o,8,this.length),de.read(this,o,!1,52,8)};function P(e,o,n,r,a,m){if(!_.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>a||o<m)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,a){if(o=+o,n=n>>>0,r=r>>>0,!a){var m=Math.pow(2,8*r)-1;P(this,o,n,r,m,0)}var s=1,l=0;for(this[n]=o&255;++l<r&&(s*=256);)this[n+l]=o/s&255;return n+r};_.prototype.writeUintBE=_.prototype.writeUIntBE=function(o,n,r,a){if(o=+o,n=n>>>0,r=r>>>0,!a){var m=Math.pow(2,8*r)-1;P(this,o,n,r,m,0)}var s=r-1,l=1;for(this[n+s]=o&255;--s>=0&&(l*=256);)this[n+s]=o/l&255;return n+r};_.prototype.writeUint8=_.prototype.writeUInt8=function(o,n,r){return o=+o,n=n>>>0,r||P(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||P(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||P(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||P(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||P(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,a){if(o=+o,n=n>>>0,!a){var m=Math.pow(2,8*r-1);P(this,o,n,r,m-1,-m)}var s=0,l=1,d=0;for(this[n]=o&255;++s<r&&(l*=256);)o<0&&d===0&&this[n+s-1]!==0&&(d=1),this[n+s]=(o/l>>0)-d&255;return n+r};_.prototype.writeIntBE=function(o,n,r,a){if(o=+o,n=n>>>0,!a){var m=Math.pow(2,8*r-1);P(this,o,n,r,m-1,-m)}var s=r-1,l=1,d=0;for(this[n+s]=o&255;--s>=0&&(l*=256);)o<0&&d===0&&this[n+s+1]!==0&&(d=1),this[n+s]=(o/l>>0)-d&255;return n+r};_.prototype.writeInt8=function(o,n,r){return o=+o,n=n>>>0,r||P(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||P(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||P(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||P(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||P(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 In(e,o,n,r,a,m){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function En(e,o,n,r,a){return o=+o,n=n>>>0,a||In(e,o,n,4,34028234663852886e22,-34028234663852886e22),de.write(e,o,n,r,23,4),n+4}_.prototype.writeFloatLE=function(o,n,r){return En(this,o,n,!0,r)};_.prototype.writeFloatBE=function(o,n,r){return En(this,o,n,!1,r)};function Ln(e,o,n,r,a){return o=+o,n=n>>>0,a||In(e,o,n,8,17976931348623157e292,-17976931348623157e292),de.write(e,o,n,r,52,8),n+8}_.prototype.writeDoubleLE=function(o,n,r){return Ln(this,o,n,!0,r)};_.prototype.writeDoubleBE=function(o,n,r){return Ln(this,o,n,!1,r)};_.prototype.copy=function(o,n,r,a){if(!_.isBuffer(o))throw new TypeError("argument should be a Buffer");if(r||(r=0),!a&&a!==0&&(a=this.length),n>=o.length&&(n=o.length),n||(n=0),a>0&&a<r&&(a=r),a===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(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),o.length-n<a-r&&(a=o.length-n+r);var m=a-r;return this===o&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,r,a):Uint8Array.prototype.set.call(o,this.subarray(r,a),n),m};_.prototype.fill=function(o,n,r,a){if(typeof o=="string"){if(typeof n=="string"?(a=n,n=0,r=this.length):typeof r=="string"&&(a=r,r=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!_.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(o.length===1){var m=o.charCodeAt(0);(a==="utf8"&&m<128||a==="latin1")&&(o=m)}}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 s;if(typeof o=="number")for(s=n;s<r;++s)this[s]=o;else{var l=_.isBuffer(o)?o:_.from(o,a),d=l.length;if(d===0)throw new TypeError('The value "'+o+'" is invalid for argument "value"');for(s=0;s<r-n;++s)this[s+n]=l[s%d]}return this};var ga=/[^+/0-9A-Za-z-_]/g;function fa(e){if(e=e.split("=")[0],e=e.trim().replace(ga,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function yo(e,o){o=o||1/0;for(var n,r=e.length,a=null,m=[],s=0;s<r;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!a){if(n>56319){(o-=3)>-1&&m.push(239,191,189);continue}else if(s+1===r){(o-=3)>-1&&m.push(239,191,189);continue}a=n;continue}if(n<56320){(o-=3)>-1&&m.push(239,191,189),a=n;continue}n=(a-55296<<10|n-56320)+65536}else a&&(o-=3)>-1&&m.push(239,191,189);if(a=null,n<128){if((o-=1)<0)break;m.push(n)}else if(n<2048){if((o-=2)<0)break;m.push(n>>6|192,n&63|128)}else if(n<65536){if((o-=3)<0)break;m.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((o-=4)<0)break;m.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return m}function ha(e){for(var o=[],n=0;n<e.length;++n)o.push(e.charCodeAt(n)&255);return o}function xa(e,o){for(var n,r,a,m=[],s=0;s<e.length&&!((o-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,a=n%256,m.push(a),m.push(r);return m}function Nn(e){return ho.toByteArray(fa(e))}function He(e,o,n,r){for(var a=0;a<r&&!(a+n>=o.length||a>=e.length);++a)o[a+n]=e[a];return a}function H(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function So(e){return e!==e}var ba=function(){for(var e="0123456789abcdef",o=new Array(256),n=0;n<16;++n)for(var r=n*16,a=0;a<16;++a)o[r+a]=e[n]+e[a];return o}()});var Fn=$e((mp,Mn)=>{t();var v=Mn.exports={},j,z;function vo(){throw new Error("setTimeout has not been defined")}function ko(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?j=setTimeout:j=vo}catch(e){j=vo}try{typeof clearTimeout=="function"?z=clearTimeout:z=ko}catch(e){z=ko}})();function Cn(e){if(j===setTimeout)return setTimeout(e,0);if((j===vo||!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 ya(e){if(z===clearTimeout)return clearTimeout(e);if((z===ko||!z)&&clearTimeout)return z=clearTimeout,clearTimeout(e);try{return z(e)}catch(o){try{return z.call(null,e)}catch(n){return z.call(this,e)}}}var Y=[],ue=!1,ce,je=-1;function Ta(){!ue||!ce||(ue=!1,ce.length?Y=ce.concat(Y):je=-1,Y.length&&Pn())}function Pn(){if(!ue){var e=Cn(Ta);ue=!0;for(var o=Y.length;o;){for(ce=Y,Y=[];++je<o;)ce&&ce[je].run();je=-1,o=Y.length}ce=null,ue=!1,ya(e)}}v.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];Y.push(new Rn(e,o)),Y.length===1&&!ue&&Cn(Pn)};function Rn(e,o){this.fun=e,this.array=o}Rn.prototype.run=function(){this.fun.apply(null,this.array)};v.title="browser";v.browser=!0;v.env={};v.argv=[];v.version="";v.versions={};function Z(){}v.on=Z;v.addListener=Z;v.once=Z;v.off=Z;v.removeListener=Z;v.removeAllListeners=Z;v.emit=Z;v.prependListener=Z;v.prependOnceListener=Z;v.listeners=function(e){return[]};v.binding=function(e){throw new Error("process.binding is not supported")};v.cwd=function(){return"/"};v.chdir=function(e){throw new Error("process.chdir is not supported")};v.umask=function(){return 0}});var i,p,sp,t=h(()=>{i=T(Dn()),p=T(Fn()),sp=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 On=h(()=>{"use strict";t()});var Bn=h(()=>{"use strict";t()});var N=h(()=>{"use strict";t()});var R=h(()=>{"use strict";t()});var Un=h(()=>{"use strict";t()});var $n=h(()=>{"use strict";t()});var Vn=h(()=>{"use strict";t()});var Wn=h(()=>{"use strict";t()});var G=h(()=>{"use strict";t();Bn();N();R();Un();$n();Vn();Wn()});var Ao,Hn,Ip,jn,Ep,zn,Gn,Lp,Np,qn=h(()=>{"use strict";t();G();Ao={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:Hn,egldLabel:Ip}=Ao["devnet"],{chainId:jn,egldLabel:Ep}=Ao["testnet"],{chainId:zn,egldLabel:Gn}=Ao["mainnet"],Lp={["devnet"]:Hn,["testnet"]:jn,["mainnet"]:zn},Np={[Hn]:"devnet",[jn]:"testnet",[zn]:"mainnet"}});var Io=h(()=>{"use strict";t()});var Kn=h(()=>{"use strict";t()});var Xn,Eo=h(()=>{"use strict";t();Xn="transaction-status-toast-id"});var Lo,No,B,ge,Yn,ze,Zn,q,k=h(()=>{"use strict";t();On();qn();Io();Kn();Eo();Lo=5e4,No=1e9,B=18,ge=4,Yn=1,ze="logout",Zn="login",q="0"});var Co,D,Ee,K=h(()=>{"use strict";t();Co=require("@reduxjs/toolkit");k();D=(0,Co.createAction)(ze),Ee=(0,Co.createAction)(Zn,e=>({payload:e}))});var Ge,Po=h(()=>{"use strict";t();Ge=()=>Date.now()/1e3});var tt=h(()=>{"use strict";t()});var rt=h(()=>{"use strict";t()});var Ro=h(()=>{"use strict";t();Po();tt();rt()});var Fo={};ae(Fo,{getItem:()=>Ca,localStorageKeys:()=>re,removeItem:()=>Pa,setItem:()=>Da});var re,Mo,Da,Ca,Pa,fe=h(()=>{"use strict";t();Ro();re={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Mo=typeof localStorage!="undefined",Da=({key:e,data:o,expires:n})=>{!Mo||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},Ca=e=>{if(!Mo)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:Ge()>=n.expires?(localStorage.removeItem(String(e)),null):n.data},Pa=e=>{!Mo||localStorage.removeItem(String(e))}});var Oo={};ae(Oo,{clear:()=>ct,getItem:()=>it,removeItem:()=>pt,setItem:()=>at,storage:()=>Ra});var at,it,pt,ct,Ra,mt=h(()=>{"use strict";t();at=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},it=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},pt=e=>sessionStorage.removeItem(String(e)),ct=()=>sessionStorage.clear(),Ra={setItem:at,getItem:it,removeItem:pt,clear:ct}});var se,he=h(()=>{"use strict";t();fe();mt();se={session:Oo,local:Fo}});function Le(){return new Date().setHours(new Date().getHours()+24)}function Ne(e){se.local.setItem({key:re.loginExpiresAt,data:e,expires:e})}var Bo=h(()=>{"use strict";t();he();fe()});var _t,st,dt,Nc,Dc,Cc,Pc,Rc,Mc,lt,ut,Uo=h(()=>{"use strict";t();_t=require("@reduxjs/toolkit");Bo();R();K();st={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},dt=(0,_t.createSlice)({name:"loginInfoSlice",initialState:st,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(D,()=>st),e.addCase(Ee,(o,n)=>{o.loginMethod=n.payload.loginMethod,Ne(Le())})}}),{setLoginMethod:Nc,setWalletConnectLogin:Dc,setLedgerLogin:Cc,setTokenLogin:Pc,setTokenLoginSignature:Rc,setWalletLogin:Mc,invalidateLoginSession:lt}=dt.actions,ut=dt.reducer});var qe=h(()=>{"use strict";t()});var gt=h(()=>{"use strict";t();qe()});function $o(e){return e[Math.floor(Math.random()*e.length)]}var ft=h(()=>{"use strict";t()});var ht=h(()=>{"use strict";t();Io()});var xt=h(()=>{"use strict";t();gt();ft();ht()});var bt,yt,Vo,Fa,Tt,Yc,Zc,wt,Wo=h(()=>{"use strict";t();bt=require("@reduxjs/toolkit"),yt=T(require("lodash.omit"));xt();Vo={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Fa={network:Vo,chainID:"-1"},Tt=(0,bt.createSlice)({name:"appConfig",initialState:Fa,reducers:{initializeNetworkConfig:(e,o)=>{let n=$o(o.payload.walletConnectBridgeAddresses),r=$o(o.payload.walletConnectV2RelayAddresses),a=(0,yt.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=w(b(b({},e.network),a),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:r})},setChainID:(e,o)=>{e.chainID=o.payload}}}),{initializeNetworkConfig:Yc,setChainID:Zc}=Tt.actions,wt=Tt.reducer});var jo,St,vt,Ke,Ho,kt,zo,am,Go,im,pm,cm,mm,sm,_m,dm,At,qo=h(()=>{"use strict";t();jo=require("@elrondnetwork/erdjs"),St=require("@reduxjs/toolkit"),vt=require("redux-persist");k();he();fe();K();Ke={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:q},Ho={address:"",websocketEvent:null,accounts:{"":Ke},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},kt=(0,St.createSlice)({name:"accountInfoSlice",initialState:Ho,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new jo.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:Ke},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(D,()=>(se.local.removeItem(re.loginExpiresAt),Ho)),e.addCase(Ee,(o,n)=>{let{address:r}=n.payload;o.address=r,o.publicKey=new jo.Address(r).hex()}),e.addCase(vt.REHYDRATE,(o,n)=>{var u;if(!((u=n.payload)!=null&&u.account))return;let{account:r}=n.payload,{address:a,shard:m,accounts:s,publicKey:l}=r;o.address=a,o.shard=m;let d=s&&a in s;o.accounts=d?s:Ho.accounts,o.publicKey=l})}}),{setAccount:zo,setAddress:am,setAccountNonce:Go,setAccountShard:im,setLedgerAccount:pm,updateLedgerAccount:cm,setWalletConnectAccount:mm,setIsAccountLoading:sm,setAccountLoadingError:_m,setWebsocketEvent:dm}=kt.actions,At=kt.reducer});function It(e){return e!=null&&(za(e)||Xa(e))}function Xe(e){return e!=null&&(Ga(e)||Ya(e))}function Ye(e){return e!=null&&(qa(e)||Za(e))}function Et(e){return e!=null&&Ka(e)}function za(e){return e!=null&&Ba.includes(e)}function Ga(e){return e!=null&&Ua.includes(e)}function qa(e){return e!=null&&$a.includes(e)}function Ka(e){return e!=null&&Va.includes(e)}function Xa(e){return e!=null&&Wa.includes(e)}function Ya(e){return e!=null&&Ha.includes(e)}function Za(e){return e!=null&&ja.includes(e)}var Ba,Ua,$a,Va,Wa,Ha,ja,Xo=h(()=>{"use strict";t();R();Ba=["sent"],Ua=["success"],$a=["fail","cancelled","timedOut"],Va=["timedOut"],Wa=["pending"],Ha=["success"],ja=["fail","invalid"]});var Lt,Nt,De,Ja,Dt,Tm,wm,Sm,vm,km,Am,Im,Em,Lm,Nm,Ze,Je=h(()=>{"use strict";t();Lt=require("@reduxjs/toolkit"),Nt=require("redux-persist");R();Xo();K();De={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Ja={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Dt=(0,Lt.createSlice)({name:"transactionsSlice",initialState:De,reducers:{moveTransactionsToSignedState:(e,o)=>{var d,u;let{sessionId:n,transactions:r,errorMessage:a,status:m,redirectRoute:s}=o.payload,l=((d=e.customTransactionInformationForSessionId)==null?void 0:d[n])||Ja;e.signedTransactions[n]={transactions:r,status:m,errorMessage:a,redirectRoute:s,customTransactionInformation:l},((u=e==null?void 0:e.transactionsToSign)==null?void 0:u.sessionId)===n&&(e.transactionsToSign=De.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=b(b({},e.signedTransactions),o.payload)},updateSignedTransactions:(e,o)=>{let{sessionId:n,status:r,errorMessage:a,transactions:m}=o.payload;e.signedTransactions[n]!=null&&(e.signedTransactions[n].status=r,a!=null&&(e.signedTransactions[n].errorMessage=a),m!=null&&(e.signedTransactions[n].transactions=m))},updateSignedTransactionStatus:(e,o)=>{var l,d,u,x,g,y;let{sessionId:n,status:r,errorMessage:a,transactionHash:m}=o.payload,s=(d=(l=e.signedTransactions)==null?void 0:l[n])==null?void 0:d.transactions;if(s!=null){e.signedTransactions[n].transactions=s.map(F=>F.hash===m?w(b({},F),{status:r,errorMessage:a}):F);let S=(x=(u=e.signedTransactions[n])==null?void 0:u.transactions)==null?void 0:x.every(F=>Xe(F.status)),$=(y=(g=e.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:y.every(F=>Ye(F.status));S&&(e.signedTransactions[n].status="success"),$&&(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=De.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=De.signedTransactions},setSignTransactionsError:(e,o)=>{e.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(e,o)=>{e.signTransactionsCancelMessage=o.payload}},extraReducers:e=>{e.addCase(D,()=>De),e.addCase(Nt.REHYDRATE,(o,n)=>{var s;if(o.signTransactionsCancelMessage=null,!((s=n.payload)!=null&&s.transactions))return;let{signedTransactions:r,customTransactionInformationForSessionId:a}=n.payload.transactions,m=Object.entries(r).reduce((l,[d,u])=>{let x=new Date(d),g=new Date;return g.setHours(g.getHours()+5),g-x>0||(l[d]=u),l},{});a!=null&&(o.customTransactionInformationForSessionId=a),r!=null&&(o.signedTransactions=m)})}}),{updateSignedTransactionStatus:Tm,updateSignedTransactions:wm,setTransactionsToSign:Sm,clearAllTransactionsToSign:vm,clearAllSignedTransactions:km,clearSignedTransaction:Am,clearTransactionToSign:Im,setSignTransactionsError:Em,setSignTransactionsCancelMessage:Lm,moveTransactionsToSignedState:Nm}=Dt.actions,Ze=Dt.reducer});var Ct,Zo,Jo,Qo,Qa,Yo,Pt,Rm,Mm,Fm,Qe,eo=h(()=>{"use strict";t();Ct=require("@reduxjs/toolkit");K();Zo="Transaction failed",Jo="Transaction successful",Qo="Processing transaction",Qa="Transaction submitted",Yo={},Pt=(0,Ct.createSlice)({name:"transactionsInfo",initialState:Yo,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:r}=o.payload;n!=null&&(e[n]={errorMessage:(r==null?void 0:r.errorMessage)||Zo,successMessage:(r==null?void 0:r.successMessage)||Jo,processingMessage:(r==null?void 0:r.processingMessage)||Qo,submittedMessage:(r==null?void 0:r.submittedMessage)||Qa,transactionDuration:r==null?void 0:r.transactionDuration})},clearTransactionsInfoForSessionId(e,o){o.payload!=null&&delete e[o.payload]},clearTransactionsInfo:()=>Yo},extraReducers:e=>{e.addCase(D,()=>Yo)}}),{clearTransactionsInfo:Rm,setTransactionsDisplayInfo:Mm,clearTransactionsInfoForSessionId:Fm}=Pt.actions,Qe=Pt.reducer});var Mt,Rt,Ft,$m,Vm,Wm,Hm,Ot,en=h(()=>{"use strict";t();Mt=require("@reduxjs/toolkit");K();Rt={},Ft=(0,Mt.createSlice)({name:"modalsSlice",initialState:Rt,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(D,()=>Rt)}}),{setTxSubmittedModal:$m,setNotificationModal:Vm,clearTxSubmittedModal:Wm,clearNotificationModal:Hm}=Ft.actions,Ot=Ft.reducer});var Ut,$t,Bt,Vt,ei,oi,Zm,Jm,Qm,es,oo,no=h(()=>{"use strict";t();Ut=require("@reduxjs/toolkit"),$t=require("redux-persist");Eo();G();Po();K();Bt={customToasts:[],transactionToasts:[],failTransactionToast:null},Vt=(0,Ut.createSlice)({name:"toastsSlice",initialState:Bt,reducers:{addCustomToast:(e,o)=>{e.customToasts.push(w(b({},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:Ge(),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(b({},o.payload),{toastId:Xn})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(D,()=>Bt),e.addCase($t.REHYDRATE,(o,n)=>{var a,m;let r=(m=(a=n.customToasts)==null?void 0:a.filter(s=>!("component"in s)))!=null?m:[];o.customToasts=r})}}),{addCustomToast:ei,removeCustomToast:oi,addTransactionToast:Zm,removeTransactionToast:Jm,addFailTransactionToast:Qm,removeFailTransactionToast:es}=Vt.actions,oo=Vt.reducer});var ee=h(()=>{"use strict";t();Uo();Wo();qo();Je();eo();en();no()});var on=h(()=>{"use strict";t()});var zt,jt,Gt,ys,Ts,ws,Ss,vs,ks,qt,Kt=h(()=>{"use strict";t();zt=require("@reduxjs/toolkit");K();jt={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Gt=(0,zt.createSlice)({name:"dappModalsSlice",initialState:jt,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=b({},o.payload)}},extraReducers:e=>{e.addCase(D,()=>jt)}}),{setDappModalVisibility:ys,setDappModalHeaderVisibility:Ts,setDappModalFooterVisibility:ws,setDappModalHeaderText:Ss,setDappModalFooterText:vs,setDappModalConfig:ks}=Gt.actions,qt=Gt.reducer});var Xt,ai,ii,xe,ro=h(()=>{"use strict";t();Xt=require("@reduxjs/toolkit");on();qo();Kt();Uo();en();Wo();no();eo();Je();ai={["account"]:At,["networkConfig"]:wt,["loginInfo"]:ut,["modals"]:Ot,["dappModal"]:qt,["toasts"]:oo,["transactions"]:Ze,["transactionsInfo"]:Qe},ii=(e={})=>(0,Xt.combineReducers)(b(b({},ai),e)),xe=ii});var Jt={};ae(Jt,{default:()=>li});function nn(e,o=[]){return{key:e,version:1,storage:Zt.default,blacklist:o}}var _e,Yt,Zt,pi,ci,mi,si,_i,di,li,Qt=h(()=>{"use strict";t();_e=require("redux-persist"),Yt=T(require("redux-persist/lib/storage")),Zt=T(require("redux-persist/lib/storage/session"));ro();ee();no();eo();Je();on();pi={2:e=>w(b({},e),{networkConfig:Vo})};ci=nn("dapp-core-transactionsInfo"),mi=nn("dapp-core-transactions",["transactionsToSign"]),si=nn("dapp-core-toasts"),_i={key:"dapp-core-store",version:2,storage:Yt.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,_e.createMigrate)(pi,{debug:!1})},di={["toasts"]:(0,_e.persistReducer)(si,oo),["transactions"]:(0,_e.persistReducer)(mi,Ze),["transactionsInfo"]:(0,_e.persistReducer)(ci,Qe)},li=(0,_e.persistReducer)(_i,xe(di))});var er={};ae(er,{default:()=>ui});var ui,or=h(()=>{"use strict";t();ro();ui=xe()});var nr={};ae(nr,{default:()=>fi});var U,gi,fi,tr=h(()=>{"use strict";t();U=require("redux-persist"),gi=[U.FLUSH,U.REHYDRATE,U.PAUSE,U.PERSIST,U.PURGE,U.REGISTER],fi=gi});var ir={};ae(ir,{default:()=>ar});function ar(e){return(0,rr.persistStore)(e)}var rr,pr=h(()=>{"use strict";t();rr=require("redux-persist")});var tp={};ae(tp,{AddressRow:()=>np});module.exports=Se(tp);t();var C=T(require("react")),Re=T(require("classnames"));t();var wa=`.dapp-core-component__main__link-style { color: #1392ff; } .dapp-core-component__main__link-second-style { color: #9dabbd; } .dapp-core-component__main__link-second-style:hover { color: #1392ff; } .dapp-core-component__main__link-second-style:hover svg { color: #1392ff; } .dapp-core-component__main__wrapper { min-height: 100vh; } .dapp-core-component__main__opacity-6 { opacity: 0.6; } .dapp-core-component__main__qr-code-svg-container { width: 15rem; height: 15rem; } .dapp-core-component__main__pair-list { max-height: 20rem; overflow-y: auto; margin-bottom: -0.5rem; } .dapp-core-component__main__pair-image { width: 4rem; overflow: hidden; height: auto; min-width: 2rem; } .dapp-core-component__main__pair-remove { padding: 0 0.5rem; position: absolute; right: 0; top: 0; } .dapp-core-component__main__dapp-icon { padding: 5px; border-radius: 50%; background-color: #fafafa; width: 4.6428571429rem; height: 4.6428571429rem; display: flex; align-items: center; justify-content: center; margin: 0 auto; } .dapp-core-component__main__dapp-icon.dapp-core-component__main__icon-medium { width: 80px; height: 80px; } .dapp-core-component__main__centering { display: flex; justify-content: center; align-items: center; } .dapp-core-component__main__border-n { border: none !important; } .dapp-core-component__main__t-shadow { text-shadow: 0px 4px 7px rgba(0, 0, 0, 0.3); } .dapp-core-component__main__btn { box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.04) !important; } .dapp-core-component__main__media { display: flex; align-items: flex-start; } .dapp-core-component__main__media-body { flex: 1; } .dapp-core-component__main__connect-btns .dapp-core-component__main__btn { display: flex; height: 48px; justify-content: center; align-items: center; color: #fff !important; background-color: #1392ff; padding: 15px 20px 15px 16px; border-radius: 6px; gap: 8px; } .dapp-core-component__main__connect-btns .dapp-core-component__main__btn:hover, .dapp-core-component__main__connect-btns .dapp-core-component__main__btn:active { background-color: #1392ff; background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0); } .dapp-core-component__main__connect-btns .dapp-core-component__main__info { color: #1392ff; margin-left: 48px; } .dapp-core-component__main__btn { transition: none !important; } .dapp-core-component__main__trust-badge { width: 20px; height: 20px; } /* Navbar -------------------------------------------------- */ .dapp-core-component__main__navbar .dapp-core-component__main__dapp-name { display: flex; align-items: center; font-size: 1.7142857143rem; font-weight: 400; color: #9ba5b4; margin-left: 1.6428571429rem; } .dapp-core-component__main__navbar .dapp-core-component__main__dapp-name:before { content: ""; display: block; width: 1px; height: 3rem; margin-right: 1.7142857143rem; } /* Dashboard -------------------------------------------------- */ .dapp-core-component__main__action-btn { display: flex; flex-direction: column; justify-content: center; align-items: center; color: #fff; margin: 0 7px; } .dapp-core-component__main__action-btn button { border-radius: 50%; width: 40px; height: 40px; background-color: #fff; } .dapp-core-component__main__action-btn button:hover { opacity: 0.9; } .dapp-core-component__main__transactions .dapp-core-component__main__transaction-icon { border-radius: 50%; width: 40px; height: 40px; } .dapp-core-component__main__transactions.dapp-core-component__main__table td { white-space: nowrap; vertical-align: middle; } .dapp-core-component__main__transactions.dapp-core-component__main__table tr:last-of-type td { border-bottom: 1px solid #dee2e6; } /* Loader, Transaction Success/Fail -------------------------------------------------- */ .dapp-core-component__main__page-state .dapp-core-component__main__lds-ellipsis { display: inline-block; position: relative; width: 64px; height: 64px; } .dapp-core-component__main__page-state .dapp-core-component__main__lds-ellipsis div { position: absolute; top: 27px; width: 11px; height: 11px; border-radius: 50%; background: rgba(0, 0, 0, 0.1); animation-timing-function: cubic-bezier(0, 1, 1, 0); } .dapp-core-component__main__page-state .dapp-core-component__main__bg-blue .dapp-core-component__main__lds-ellipsis div { background: rgba(255, 255, 255, 0.4); } .dapp-core-component__main__page-state .dapp-core-component__main__lds-ellipsis div:nth-child(1) { left: 6px; animation: dapp-core-component__main__lds-ellipsis1 0.6s infinite; } .dapp-core-component__main__page-state .dapp-core-component__main__lds-ellipsis div:nth-child(2) { left: 6px; animation: dapp-core-component__main__lds-ellipsis2 0.6s infinite; } .dapp-core-component__main__page-state .dapp-core-component__main__lds-ellipsis div:nth-child(3) { left: 26px;