@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
193 lines (172 loc) • 174 kB
JavaScript
"use strict";var Oa=Object.create;var Le=Object.defineProperty,Ba=Object.defineProperties,Ua=Object.getOwnPropertyDescriptor,Va=Object.getOwnPropertyDescriptors,$a=Object.getOwnPropertyNames,je=Object.getOwnPropertySymbols,Wa=Object.getPrototypeOf,vo=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable;var Ln=(e,o,n)=>o in e?Le(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,b=(e,o)=>{for(var n in o||(o={}))vo.call(o,n)&&Ln(e,n,o[n]);if(je)for(var n of je(o))Dn.call(o,n)&&Ln(e,n,o[n]);return e},k=(e,o)=>Ba(e,Va(o));var Ge=(e,o)=>{var n={};for(var t in e)vo.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&je)for(var t of je(e))o.indexOf(t)<0&&Dn.call(e,t)&&(n[t]=e[t]);return n};var x=(e,o)=>()=>(e&&(o=e(e=0)),o);var ze=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),ie=(e,o)=>{for(var n in o)Le(e,n,{get:o[n],enumerable:!0})},Cn=(e,o,n,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of $a(o))!vo.call(e,a)&&a!==n&&Le(e,a,{get:()=>o[a],enumerable:!(t=Ua(o,a))||t.enumerable});return e};var w=(e,o,n)=>(n=e!=null?Oa(Wa(e)):{},Cn(o||!e||!e.__esModule?Le(n,"default",{value:e,enumerable:!0}):n,e)),De=e=>Cn(Le({},"__esModule",{value:!0}),e);var Rn=(e,o,n)=>new Promise((t,a)=>{var i=d=>{try{l(n.next(d))}catch(g){a(g)}},m=d=>{try{l(n.throw(d))}catch(g){a(g)}},l=d=>d.done?t(d.value):Promise.resolve(d.value).then(i,m);l((n=n.apply(e,o)).next())});var Mn=ze(qe=>{"use strict";r();qe.byteLength=ja;qe.toByteArray=za;qe.fromByteArray=Xa;var $=[],P=[],Ha=typeof Uint8Array!="undefined"?Uint8Array:Array,Ao="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(pe=0,Fn=Ao.length;pe<Fn;++pe)$[pe]=Ao[pe],P[Ao.charCodeAt(pe)]=pe;var pe,Fn;P["-".charCodeAt(0)]=62;P["_".charCodeAt(0)]=63;function Pn(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 t=n===o?0:4-n%4;return[n,t]}function ja(e){var o=Pn(e),n=o[0],t=o[1];return(n+t)*3/4-t}function Ga(e,o,n){return(o+n)*3/4-n}function za(e){var o,n=Pn(e),t=n[0],a=n[1],i=new Ha(Ga(e,t,a)),m=0,l=a>0?t-4:t,d;for(d=0;d<l;d+=4)o=P[e.charCodeAt(d)]<<18|P[e.charCodeAt(d+1)]<<12|P[e.charCodeAt(d+2)]<<6|P[e.charCodeAt(d+3)],i[m++]=o>>16&255,i[m++]=o>>8&255,i[m++]=o&255;return a===2&&(o=P[e.charCodeAt(d)]<<2|P[e.charCodeAt(d+1)]>>4,i[m++]=o&255),a===1&&(o=P[e.charCodeAt(d)]<<10|P[e.charCodeAt(d+1)]<<4|P[e.charCodeAt(d+2)]>>2,i[m++]=o>>8&255,i[m++]=o&255),i}function qa(e){return $[e>>18&63]+$[e>>12&63]+$[e>>6&63]+$[e&63]}function Ka(e,o,n){for(var t,a=[],i=o;i<n;i+=3)t=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),a.push(qa(t));return a.join("")}function Xa(e){for(var o,n=e.length,t=n%3,a=[],i=16383,m=0,l=n-t;m<l;m+=i)a.push(Ka(e,m,m+i>l?l:m+i));return t===1?(o=e[n-1],a.push($[o>>2]+$[o<<4&63]+"==")):t===2&&(o=(e[n-2]<<8)+e[n-1],a.push($[o>>10]+$[o>>4&63]+$[o<<2&63]+"=")),a.join("")}});var On=ze(Io=>{r();Io.read=function(e,o,n,t,a){var i,m,l=a*8-t-1,d=(1<<l)-1,g=d>>1,h=-7,u=n?a-1:0,T=n?-1:1,S=e[o+u];for(u+=T,i=S&(1<<-h)-1,S>>=-h,h+=l;h>0;i=i*256+e[o+u],u+=T,h-=8);for(m=i&(1<<-h)-1,i>>=-h,h+=t;h>0;m=m*256+e[o+u],u+=T,h-=8);if(i===0)i=1-g;else{if(i===d)return m?NaN:(S?-1:1)*(1/0);m=m+Math.pow(2,t),i=i-g}return(S?-1:1)*m*Math.pow(2,i-t)};Io.write=function(e,o,n,t,a,i){var m,l,d,g=i*8-a-1,h=(1<<g)-1,u=h>>1,T=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=t?0:i-1,N=t?1:-1,D=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(l=isNaN(o)?1:0,m=h):(m=Math.floor(Math.log(o)/Math.LN2),o*(d=Math.pow(2,-m))<1&&(m--,d*=2),m+u>=1?o+=T/d:o+=T*Math.pow(2,1-u),o*d>=2&&(m++,d/=2),m+u>=h?(l=0,m=h):m+u>=1?(l=(o*d-1)*Math.pow(2,a),m=m+u):(l=o*Math.pow(2,u-1)*Math.pow(2,a),m=0));a>=8;e[n+S]=l&255,S+=N,l/=256,a-=8);for(m=m<<a|l,g+=a;g>0;e[n+S]=m&255,S+=N,m/=256,g-=8);e[n+S-N]|=D*128}});var Zn=ze(fe=>{"use strict";r();var Eo=Mn(),ue=On(),Bn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;fe.Buffer=s;fe.SlowBuffer=oi;fe.INSPECT_MAX_BYTES=50;var Ke=2147483647;fe.kMaxLength=Ke;s.TYPED_ARRAY_SUPPORT=Za();!s.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 Za(){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(s.prototype,"parent",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.buffer}});Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.byteOffset}});function q(e){if(e>Ke)throw new RangeError('The value "'+e+'" is invalid for option "size"');var o=new Uint8Array(e);return Object.setPrototypeOf(o,s.prototype),o}function s(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 Co(e)}return $n(e,o,n)}s.poolSize=8192;function $n(e,o,n){if(typeof e=="string")return Ja(e,o);if(ArrayBuffer.isView(e))return Qa(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(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return Lo(e,o,n);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var t=e.valueOf&&e.valueOf();if(t!=null&&t!==e)return s.from(t,o,n);var a=ei(e);if(a)return a;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return s.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)}s.from=function(e,o,n){return $n(e,o,n)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function Wn(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 Ya(e,o,n){return Wn(e),e<=0?q(e):o!==void 0?typeof n=="string"?q(e).fill(o,n):q(e).fill(o):q(e)}s.alloc=function(e,o,n){return Ya(e,o,n)};function Co(e){return Wn(e),q(e<0?0:Ro(e)|0)}s.allocUnsafe=function(e){return Co(e)};s.allocUnsafeSlow=function(e){return Co(e)};function Ja(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=Hn(e,o)|0,t=q(n),a=t.write(e,o);return a!==n&&(t=t.slice(0,a)),t}function No(e){for(var o=e.length<0?0:Ro(e.length)|0,n=q(o),t=0;t<o;t+=1)n[t]=e[t]&255;return n}function Qa(e){if(W(e,Uint8Array)){var o=new Uint8Array(e);return Lo(o.buffer,o.byteOffset,o.byteLength)}return No(e)}function Lo(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 t;return o===void 0&&n===void 0?t=new Uint8Array(e):n===void 0?t=new Uint8Array(e,o):t=new Uint8Array(e,o,n),Object.setPrototypeOf(t,s.prototype),t}function ei(e){if(s.isBuffer(e)){var o=Ro(e.length)|0,n=q(o);return n.length===0||e.copy(n,0,0,o),n}if(e.length!==void 0)return typeof e.length!="number"||Fo(e.length)?q(0):No(e);if(e.type==="Buffer"&&Array.isArray(e.data))return No(e.data)}function Ro(e){if(e>=Ke)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ke.toString(16)+" bytes");return e|0}function oi(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==s.prototype};s.compare=function(o,n){if(W(o,Uint8Array)&&(o=s.from(o,o.offset,o.byteLength)),W(n,Uint8Array)&&(n=s.from(n,n.offset,n.byteLength)),!s.isBuffer(o)||!s.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(o===n)return 0;for(var t=o.length,a=n.length,i=0,m=Math.min(t,a);i<m;++i)if(o[i]!==n[i]){t=o[i],a=n[i];break}return t<a?-1:a<t?1:0};s.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}};s.concat=function(o,n){if(!Array.isArray(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return s.alloc(0);var t;if(n===void 0)for(n=0,t=0;t<o.length;++t)n+=o[t].length;var a=s.allocUnsafe(n),i=0;for(t=0;t<o.length;++t){var m=o[t];if(W(m,Uint8Array))i+m.length>a.length?s.from(m).copy(a,i):Uint8Array.prototype.set.call(a,m,i);else if(s.isBuffer(m))m.copy(a,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=m.length}return a};function Hn(e,o){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(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,t=arguments.length>2&&arguments[2]===!0;if(!t&&n===0)return 0;for(var a=!1;;)switch(o){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Do(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Xn(e).length;default:if(a)return t?-1:Do(e).length;o=(""+o).toLowerCase(),a=!0}}s.byteLength=Hn;function ni(e,o,n){var t=!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 di(this,o,n);case"utf8":case"utf-8":return Gn(this,o,n);case"ascii":return _i(this,o,n);case"latin1":case"binary":return si(this,o,n);case"base64":return ci(this,o,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return li(this,o,n);default:if(t)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),t=!0}}s.prototype._isBuffer=!0;function ce(e,o,n){var t=e[o];e[o]=e[n],e[n]=t}s.prototype.swap16=function(){var o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<o;n+=2)ce(this,n,n+1);return this};s.prototype.swap32=function(){var o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<o;n+=4)ce(this,n,n+3),ce(this,n+1,n+2);return this};s.prototype.swap64=function(){var o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<o;n+=8)ce(this,n,n+7),ce(this,n+1,n+6),ce(this,n+2,n+5),ce(this,n+3,n+4);return this};s.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?Gn(this,0,o):ni.apply(this,arguments)};s.prototype.toLocaleString=s.prototype.toString;s.prototype.equals=function(o){if(!s.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:s.compare(this,o)===0};s.prototype.inspect=function(){var o="",n=fe.INSPECT_MAX_BYTES;return o=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(o+=" ... "),"<Buffer "+o+">"};Bn&&(s.prototype[Bn]=s.prototype.inspect);s.prototype.compare=function(o,n,t,a,i){if(W(o,Uint8Array)&&(o=s.from(o,o.offset,o.byteLength)),!s.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),t===void 0&&(t=o?o.length:0),a===void 0&&(a=0),i===void 0&&(i=this.length),n<0||t>o.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&n>=t)return 0;if(a>=i)return-1;if(n>=t)return 1;if(n>>>=0,t>>>=0,a>>>=0,i>>>=0,this===o)return 0;for(var m=i-a,l=t-n,d=Math.min(m,l),g=this.slice(a,i),h=o.slice(n,t),u=0;u<d;++u)if(g[u]!==h[u]){m=g[u],l=h[u];break}return m<l?-1:l<m?1:0};function jn(e,o,n,t,a){if(e.length===0)return-1;if(typeof n=="string"?(t=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Fo(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=s.from(o,t)),s.isBuffer(o))return o.length===0?-1:Un(e,o,n,t,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):Un(e,[o],n,t,a);throw new TypeError("val must be string, number or Buffer")}function Un(e,o,n,t,a){var i=1,m=e.length,l=o.length;if(t!==void 0&&(t=String(t).toLowerCase(),t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le")){if(e.length<2||o.length<2)return-1;i=2,m/=2,l/=2,n/=2}function d(S,N){return i===1?S[N]:S.readUInt16BE(N*i)}var g;if(a){var h=-1;for(g=n;g<m;g++)if(d(e,g)===d(o,h===-1?0:g-h)){if(h===-1&&(h=g),g-h+1===l)return h*i}else h!==-1&&(g-=g-h),h=-1}else for(n+l>m&&(n=m-l),g=n;g>=0;g--){for(var u=!0,T=0;T<l;T++)if(d(e,g+T)!==d(o,T)){u=!1;break}if(u)return g}return-1}s.prototype.includes=function(o,n,t){return this.indexOf(o,n,t)!==-1};s.prototype.indexOf=function(o,n,t){return jn(this,o,n,t,!0)};s.prototype.lastIndexOf=function(o,n,t){return jn(this,o,n,t,!1)};function ti(e,o,n,t){n=Number(n)||0;var a=e.length-n;t?(t=Number(t),t>a&&(t=a)):t=a;var i=o.length;t>i/2&&(t=i/2);for(var m=0;m<t;++m){var l=parseInt(o.substr(m*2,2),16);if(Fo(l))return m;e[n+m]=l}return m}function ri(e,o,n,t){return Xe(Do(o,e.length-n),e,n,t)}function ai(e,o,n,t){return Xe(fi(o),e,n,t)}function ii(e,o,n,t){return Xe(Xn(o),e,n,t)}function pi(e,o,n,t){return Xe(hi(o,e.length-n),e,n,t)}s.prototype.write=function(o,n,t,a){if(n===void 0)a="utf8",t=this.length,n=0;else if(t===void 0&&typeof n=="string")a=n,t=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(t)?(t=t>>>0,a===void 0&&(a="utf8")):(a=t,t=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-n;if((t===void 0||t>i)&&(t=i),o.length>0&&(t<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var m=!1;;)switch(a){case"hex":return ti(this,o,n,t);case"utf8":case"utf-8":return ri(this,o,n,t);case"ascii":case"latin1":case"binary":return ai(this,o,n,t);case"base64":return ii(this,o,n,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pi(this,o,n,t);default:if(m)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),m=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ci(e,o,n){return o===0&&n===e.length?Eo.fromByteArray(e):Eo.fromByteArray(e.slice(o,n))}function Gn(e,o,n){n=Math.min(e.length,n);for(var t=[],a=o;a<n;){var i=e[a],m=null,l=i>239?4:i>223?3:i>191?2:1;if(a+l<=n){var d,g,h,u;switch(l){case 1:i<128&&(m=i);break;case 2:d=e[a+1],(d&192)===128&&(u=(i&31)<<6|d&63,u>127&&(m=u));break;case 3:d=e[a+1],g=e[a+2],(d&192)===128&&(g&192)===128&&(u=(i&15)<<12|(d&63)<<6|g&63,u>2047&&(u<55296||u>57343)&&(m=u));break;case 4:d=e[a+1],g=e[a+2],h=e[a+3],(d&192)===128&&(g&192)===128&&(h&192)===128&&(u=(i&15)<<18|(d&63)<<12|(g&63)<<6|h&63,u>65535&&u<1114112&&(m=u))}}m===null?(m=65533,l=1):m>65535&&(m-=65536,t.push(m>>>10&1023|55296),m=56320|m&1023),t.push(m),a+=l}return mi(t)}var Vn=4096;function mi(e){var o=e.length;if(o<=Vn)return String.fromCharCode.apply(String,e);for(var n="",t=0;t<o;)n+=String.fromCharCode.apply(String,e.slice(t,t+=Vn));return n}function _i(e,o,n){var t="";n=Math.min(e.length,n);for(var a=o;a<n;++a)t+=String.fromCharCode(e[a]&127);return t}function si(e,o,n){var t="";n=Math.min(e.length,n);for(var a=o;a<n;++a)t+=String.fromCharCode(e[a]);return t}function di(e,o,n){var t=e.length;(!o||o<0)&&(o=0),(!n||n<0||n>t)&&(n=t);for(var a="",i=o;i<n;++i)a+=xi[e[i]];return a}function li(e,o,n){for(var t=e.slice(o,n),a="",i=0;i<t.length-1;i+=2)a+=String.fromCharCode(t[i]+t[i+1]*256);return a}s.prototype.slice=function(o,n){var t=this.length;o=~~o,n=n===void 0?t:~~n,o<0?(o+=t,o<0&&(o=0)):o>t&&(o=t),n<0?(n+=t,n<0&&(n=0)):n>t&&(n=t),n<o&&(n=o);var a=this.subarray(o,n);return Object.setPrototypeOf(a,s.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")}s.prototype.readUintLE=s.prototype.readUIntLE=function(o,n,t){o=o>>>0,n=n>>>0,t||I(o,n,this.length);for(var a=this[o],i=1,m=0;++m<n&&(i*=256);)a+=this[o+m]*i;return a};s.prototype.readUintBE=s.prototype.readUIntBE=function(o,n,t){o=o>>>0,n=n>>>0,t||I(o,n,this.length);for(var a=this[o+--n],i=1;n>0&&(i*=256);)a+=this[o+--n]*i;return a};s.prototype.readUint8=s.prototype.readUInt8=function(o,n){return o=o>>>0,n||I(o,1,this.length),this[o]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(o,n){return o=o>>>0,n||I(o,2,this.length),this[o]|this[o+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(o,n){return o=o>>>0,n||I(o,2,this.length),this[o]<<8|this[o+1]};s.prototype.readUint32LE=s.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};s.prototype.readUint32BE=s.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])};s.prototype.readIntLE=function(o,n,t){o=o>>>0,n=n>>>0,t||I(o,n,this.length);for(var a=this[o],i=1,m=0;++m<n&&(i*=256);)a+=this[o+m]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*n)),a};s.prototype.readIntBE=function(o,n,t){o=o>>>0,n=n>>>0,t||I(o,n,this.length);for(var a=n,i=1,m=this[o+--a];a>0&&(i*=256);)m+=this[o+--a]*i;return i*=128,m>=i&&(m-=Math.pow(2,8*n)),m};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]};s.prototype.readInt16LE=function(o,n){o=o>>>0,n||I(o,2,this.length);var t=this[o]|this[o+1]<<8;return t&32768?t|4294901760:t};s.prototype.readInt16BE=function(o,n){o=o>>>0,n||I(o,2,this.length);var t=this[o+1]|this[o]<<8;return t&32768?t|4294901760:t};s.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};s.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]};s.prototype.readFloatLE=function(o,n){return o=o>>>0,n||I(o,4,this.length),ue.read(this,o,!0,23,4)};s.prototype.readFloatBE=function(o,n){return o=o>>>0,n||I(o,4,this.length),ue.read(this,o,!1,23,4)};s.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||I(o,8,this.length),ue.read(this,o,!0,52,8)};s.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||I(o,8,this.length),ue.read(this,o,!1,52,8)};function C(e,o,n,t,a,i){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>a||o<i)throw new RangeError('"value" argument is out of bounds');if(n+t>e.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(o,n,t,a){if(o=+o,n=n>>>0,t=t>>>0,!a){var i=Math.pow(2,8*t)-1;C(this,o,n,t,i,0)}var m=1,l=0;for(this[n]=o&255;++l<t&&(m*=256);)this[n+l]=o/m&255;return n+t};s.prototype.writeUintBE=s.prototype.writeUIntBE=function(o,n,t,a){if(o=+o,n=n>>>0,t=t>>>0,!a){var i=Math.pow(2,8*t)-1;C(this,o,n,t,i,0)}var m=t-1,l=1;for(this[n+m]=o&255;--m>=0&&(l*=256);)this[n+m]=o/l&255;return n+t};s.prototype.writeUint8=s.prototype.writeUInt8=function(o,n,t){return o=+o,n=n>>>0,t||C(this,o,n,1,255,0),this[n]=o&255,n+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(o,n,t){return o=+o,n=n>>>0,t||C(this,o,n,2,65535,0),this[n]=o&255,this[n+1]=o>>>8,n+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(o,n,t){return o=+o,n=n>>>0,t||C(this,o,n,2,65535,0),this[n]=o>>>8,this[n+1]=o&255,n+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(o,n,t){return o=+o,n=n>>>0,t||C(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};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(o,n,t){return o=+o,n=n>>>0,t||C(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};s.prototype.writeIntLE=function(o,n,t,a){if(o=+o,n=n>>>0,!a){var i=Math.pow(2,8*t-1);C(this,o,n,t,i-1,-i)}var m=0,l=1,d=0;for(this[n]=o&255;++m<t&&(l*=256);)o<0&&d===0&&this[n+m-1]!==0&&(d=1),this[n+m]=(o/l>>0)-d&255;return n+t};s.prototype.writeIntBE=function(o,n,t,a){if(o=+o,n=n>>>0,!a){var i=Math.pow(2,8*t-1);C(this,o,n,t,i-1,-i)}var m=t-1,l=1,d=0;for(this[n+m]=o&255;--m>=0&&(l*=256);)o<0&&d===0&&this[n+m+1]!==0&&(d=1),this[n+m]=(o/l>>0)-d&255;return n+t};s.prototype.writeInt8=function(o,n,t){return o=+o,n=n>>>0,t||C(this,o,n,1,127,-128),o<0&&(o=255+o+1),this[n]=o&255,n+1};s.prototype.writeInt16LE=function(o,n,t){return o=+o,n=n>>>0,t||C(this,o,n,2,32767,-32768),this[n]=o&255,this[n+1]=o>>>8,n+2};s.prototype.writeInt16BE=function(o,n,t){return o=+o,n=n>>>0,t||C(this,o,n,2,32767,-32768),this[n]=o>>>8,this[n+1]=o&255,n+2};s.prototype.writeInt32LE=function(o,n,t){return o=+o,n=n>>>0,t||C(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};s.prototype.writeInt32BE=function(o,n,t){return o=+o,n=n>>>0,t||C(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 zn(e,o,n,t,a,i){if(n+t>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function qn(e,o,n,t,a){return o=+o,n=n>>>0,a||zn(e,o,n,4,34028234663852886e22,-34028234663852886e22),ue.write(e,o,n,t,23,4),n+4}s.prototype.writeFloatLE=function(o,n,t){return qn(this,o,n,!0,t)};s.prototype.writeFloatBE=function(o,n,t){return qn(this,o,n,!1,t)};function Kn(e,o,n,t,a){return o=+o,n=n>>>0,a||zn(e,o,n,8,17976931348623157e292,-17976931348623157e292),ue.write(e,o,n,t,52,8),n+8}s.prototype.writeDoubleLE=function(o,n,t){return Kn(this,o,n,!0,t)};s.prototype.writeDoubleBE=function(o,n,t){return Kn(this,o,n,!1,t)};s.prototype.copy=function(o,n,t,a){if(!s.isBuffer(o))throw new TypeError("argument should be a Buffer");if(t||(t=0),!a&&a!==0&&(a=this.length),n>=o.length&&(n=o.length),n||(n=0),a>0&&a<t&&(a=t),a===t||o.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=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-t&&(a=o.length-n+t);var i=a-t;return this===o&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,t,a):Uint8Array.prototype.set.call(o,this.subarray(t,a),n),i};s.prototype.fill=function(o,n,t,a){if(typeof o=="string"){if(typeof n=="string"?(a=n,n=0,t=this.length):typeof t=="string"&&(a=t,t=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!s.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(o.length===1){var i=o.charCodeAt(0);(a==="utf8"&&i<128||a==="latin1")&&(o=i)}}else typeof o=="number"?o=o&255:typeof o=="boolean"&&(o=Number(o));if(n<0||this.length<n||this.length<t)throw new RangeError("Out of range index");if(t<=n)return this;n=n>>>0,t=t===void 0?this.length:t>>>0,o||(o=0);var m;if(typeof o=="number")for(m=n;m<t;++m)this[m]=o;else{var l=s.isBuffer(o)?o:s.from(o,a),d=l.length;if(d===0)throw new TypeError('The value "'+o+'" is invalid for argument "value"');for(m=0;m<t-n;++m)this[m+n]=l[m%d]}return this};var gi=/[^+/0-9A-Za-z-_]/g;function ui(e){if(e=e.split("=")[0],e=e.trim().replace(gi,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Do(e,o){o=o||1/0;for(var n,t=e.length,a=null,i=[],m=0;m<t;++m){if(n=e.charCodeAt(m),n>55295&&n<57344){if(!a){if(n>56319){(o-=3)>-1&&i.push(239,191,189);continue}else if(m+1===t){(o-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(o-=3)>-1&&i.push(239,191,189),a=n;continue}n=(a-55296<<10|n-56320)+65536}else a&&(o-=3)>-1&&i.push(239,191,189);if(a=null,n<128){if((o-=1)<0)break;i.push(n)}else if(n<2048){if((o-=2)<0)break;i.push(n>>6|192,n&63|128)}else if(n<65536){if((o-=3)<0)break;i.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((o-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return i}function fi(e){for(var o=[],n=0;n<e.length;++n)o.push(e.charCodeAt(n)&255);return o}function hi(e,o){for(var n,t,a,i=[],m=0;m<e.length&&!((o-=2)<0);++m)n=e.charCodeAt(m),t=n>>8,a=n%256,i.push(a),i.push(t);return i}function Xn(e){return Eo.toByteArray(ui(e))}function Xe(e,o,n,t){for(var a=0;a<t&&!(a+n>=o.length||a>=e.length);++a)o[a+n]=e[a];return a}function W(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function Fo(e){return e!==e}var xi=function(){for(var e="0123456789abcdef",o=new Array(256),n=0;n<16;++n)for(var t=n*16,a=0;a<16;++a)o[t+a]=e[n]+e[a];return o}()});var ot=ze((jp,et)=>{r();var v=et.exports={},H,j;function Po(){throw new Error("setTimeout has not been defined")}function Mo(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?H=setTimeout:H=Po}catch(e){H=Po}try{typeof clearTimeout=="function"?j=clearTimeout:j=Mo}catch(e){j=Mo}})();function Yn(e){if(H===setTimeout)return setTimeout(e,0);if((H===Po||!H)&&setTimeout)return H=setTimeout,setTimeout(e,0);try{return H(e,0)}catch(o){try{return H.call(null,e,0)}catch(n){return H.call(this,e,0)}}}function bi(e){if(j===clearTimeout)return clearTimeout(e);if((j===Mo||!j)&&clearTimeout)return j=clearTimeout,clearTimeout(e);try{return j(e)}catch(o){try{return j.call(null,e)}catch(n){return j.call(this,e)}}}var K=[],he=!1,me,Ze=-1;function yi(){!he||!me||(he=!1,me.length?K=me.concat(K):Ze=-1,K.length&&Jn())}function Jn(){if(!he){var e=Yn(yi);he=!0;for(var o=K.length;o;){for(me=K,K=[];++Ze<o;)me&&me[Ze].run();Ze=-1,o=K.length}me=null,he=!1,bi(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];K.push(new Qn(e,o)),K.length===1&&!he&&Yn(Jn)};function Qn(e,o){this.fun=e,this.array=o}Qn.prototype.run=function(){this.fun.apply(null,this.array)};v.title="browser";v.browser=!0;v.env={};v.argv=[];v.version="";v.versions={};function X(){}v.on=X;v.addListener=X;v.once=X;v.off=X;v.removeListener=X;v.removeAllListeners=X;v.emit=X;v.prependListener=X;v.prependOnceListener=X;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 p,c,Gp,r=x(()=>{p=w(Zn()),c=w(ot()),Gp=function(e){function o(){var t=this||self;return delete e.prototype.__magic__,t}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 nt=x(()=>{"use strict";r()});var tt=x(()=>{"use strict";r()});var Oo,L=x(()=>{"use strict";r();Oo=(t=>(t.nft="nft",t.esdt="esdt",t.egld="egld",t))(Oo||{})});var U=x(()=>{"use strict";r()});var rt=x(()=>{"use strict";r()});var at=x(()=>{"use strict";r()});var it=x(()=>{"use strict";r()});var pt=x(()=>{"use strict";r()});var ee=x(()=>{"use strict";r();tt();L();U();rt();at();it();pt()});var Bo,ct,mc,mt,_c,_t,st,sc,dc,dt=x(()=>{"use strict";r();ee();Bo={devnet:{id:"devnet",chainId:"D",name:"Devnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://devnet-wallet.elrond.com",apiAddress:"https://devnet-api.elrond.com",explorerAddress:"http://devnet-explorer.elrond.com",apiTimeout:"4000"},testnet:{id:"testnet",chainId:"T",name:"Testnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://testnet-wallet.elrond.com",apiAddress:"https://testnet-api.elrond.com",explorerAddress:"http://testnet-explorer.elrond.com",apiTimeout:"4000"},mainnet:{id:"mainnet",chainId:"1",name:"Mainnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://wallet.elrond.com",apiAddress:"https://api.elrond.com",explorerAddress:"https://explorer.elrond.com",apiTimeout:"4000"}},{chainId:ct,egldLabel:mc}=Bo["devnet"],{chainId:mt,egldLabel:_c}=Bo["testnet"],{chainId:_t,egldLabel:st}=Bo["mainnet"],sc={["devnet"]:ct,["testnet"]:mt,["mainnet"]:_t},dc={[ct]:"devnet",[mt]:"testnet",[_t]:"mainnet"}});var Uo=x(()=>{"use strict";r()});var lt=x(()=>{"use strict";r()});var gt,Vo=x(()=>{"use strict";r();gt="transaction-status-toast-id"});var $o,Wo,E,xe,ut,Ye,ft,G,A=x(()=>{"use strict";r();nt();dt();Uo();lt();Vo();$o=5e4,Wo=1e9,E=18,xe=4,ut=1,Ye="logout",ft="login",G="0"});var Je,Ho=x(()=>{"use strict";r();Je=()=>Date.now()/1e3});var yt=x(()=>{"use strict";r()});var Tt=x(()=>{"use strict";r()});var wt=x(()=>{"use strict";r();Ho();yt();Tt()});var Go={};ie(Go,{getItem:()=>Ii,localStorageKeys:()=>_e,removeItem:()=>Ei,setItem:()=>Ai});var _e,jo,Ai,Ii,Ei,Pe=x(()=>{"use strict";r();wt();_e={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},jo=typeof localStorage!="undefined",Ai=({key:e,data:o,expires:n})=>{!jo||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},Ii=e=>{if(!jo)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:Je()>=n.expires?(localStorage.removeItem(String(e)),null):n.data},Ei=e=>{!jo||localStorage.removeItem(String(e))}});var zo={};ie(zo,{clear:()=>At,getItem:()=>kt,removeItem:()=>vt,setItem:()=>St,storage:()=>Ni});var St,kt,vt,At,Ni,It=x(()=>{"use strict";r();St=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},kt=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},vt=e=>sessionStorage.removeItem(String(e)),At=()=>sessionStorage.clear(),Ni={setItem:St,getItem:kt,removeItem:vt,clear:At}});var ye,Qe=x(()=>{"use strict";r();Pe();It();ye={session:zo,local:Go}});function Me(){return new Date().setHours(new Date().getHours()+24)}function Oe(e){ye.local.setItem({key:_e.loginExpiresAt,data:e,expires:e})}var qo=x(()=>{"use strict";r();Qe();Pe()});var Ko,R,eo,te=x(()=>{"use strict";r();Ko=require("@reduxjs/toolkit");A();R=(0,Ko.createAction)(Ye),eo=(0,Ko.createAction)(ft,e=>({payload:e}))});var Nt,Et,Lt,rm,am,im,pm,cm,mm,Dt,Ct,Xo=x(()=>{"use strict";r();Nt=require("@reduxjs/toolkit");qo();U();te();Et={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Lt=(0,Nt.createSlice)({name:"loginInfoSlice",initialState:Et,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(R,()=>Et),e.addCase(eo,(o,n)=>{o.loginMethod=n.payload.loginMethod,Oe(Me())})}}),{setLoginMethod:rm,setWalletConnectLogin:am,setLedgerLogin:im,setTokenLogin:pm,setTokenLoginSignature:cm,setWalletLogin:mm,invalidateLoginSession:Dt}=Lt.actions,Ct=Lt.reducer});var Rt=x(()=>{"use strict";r()});var Ft=x(()=>{"use strict";r();Rt()});function Zo(e){return e[Math.floor(Math.random()*e.length)]}var Pt=x(()=>{"use strict";r()});var Mt=x(()=>{"use strict";r();Uo()});var Ot=x(()=>{"use strict";r();Ft();Pt();Mt()});var Bt,Ut,Yo,Di,Vt,vm,Am,$t,Jo=x(()=>{"use strict";r();Bt=require("@reduxjs/toolkit"),Ut=w(require("lodash.omit"));Ot();Yo={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Di={network:Yo,chainID:"-1"},Vt=(0,Bt.createSlice)({name:"appConfig",initialState:Di,reducers:{initializeNetworkConfig:(e,o)=>{let n=Zo(o.payload.walletConnectBridgeAddresses),t=Zo(o.payload.walletConnectV2RelayAddresses),a=(0,Ut.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=k(b(b({},e.network),a),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:t})},setChainID:(e,o)=>{e.chainID=o.payload}}}),{initializeNetworkConfig:vm,setChainID:Am}=Vt.actions,$t=Vt.reducer});var en,Wt,Ht,oo,Qo,jt,Gt,Fm,zt,Pm,Mm,Om,Bm,Um,Vm,$m,qt,on=x(()=>{"use strict";r();en=require("@elrondnetwork/erdjs"),Wt=require("@reduxjs/toolkit"),Ht=require("redux-persist");A();Qe();Pe();te();oo={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:G},Qo={address:"",websocketEvent:null,accounts:{"":oo},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},jt=(0,Wt.createSlice)({name:"accountInfoSlice",initialState:Qo,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new en.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:oo},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(R,()=>(ye.local.removeItem(_e.loginExpiresAt),Qo)),e.addCase(eo,(o,n)=>{let{address:t}=n.payload;o.address=t,o.publicKey=new en.Address(t).hex()}),e.addCase(Ht.REHYDRATE,(o,n)=>{var g;if(!((g=n.payload)!=null&&g.account))return;let{account:t}=n.payload,{address:a,shard:i,accounts:m,publicKey:l}=t;o.address=a,o.shard=i;let d=m&&a in m;o.accounts=d?m:Qo.accounts,o.publicKey=l})}}),{setAccount:Gt,setAddress:Fm,setAccountNonce:zt,setAccountShard:Pm,setLedgerAccount:Mm,updateLedgerAccount:Om,setWalletConnectAccount:Bm,setIsAccountLoading:Um,setAccountLoadingError:Vm,setWebsocketEvent:$m}=jt.actions,qt=jt.reducer});function Kt(e){return e!=null&&(Vi(e)||ji(e))}function no(e){return e!=null&&($i(e)||Gi(e))}function to(e){return e!=null&&(Wi(e)||zi(e))}function Xt(e){return e!=null&&Hi(e)}function Vi(e){return e!=null&&Ri.includes(e)}function $i(e){return e!=null&&Fi.includes(e)}function Wi(e){return e!=null&&Pi.includes(e)}function Hi(e){return e!=null&&Mi.includes(e)}function ji(e){return e!=null&&Oi.includes(e)}function Gi(e){return e!=null&&Bi.includes(e)}function zi(e){return e!=null&&Ui.includes(e)}var Ri,Fi,Pi,Mi,Oi,Bi,Ui,tn=x(()=>{"use strict";r();U();Ri=["sent"],Fi=["success"],Pi=["fail","cancelled","timedOut"],Mi=["timedOut"],Oi=["pending"],Bi=["success"],Ui=["fail","invalid"]});var Zt,Yt,Be,qi,Jt,Zm,Ym,Jm,Qm,e_,o_,n_,t_,r_,a_,ro,ao=x(()=>{"use strict";r();Zt=require("@reduxjs/toolkit"),Yt=require("redux-persist");U();tn();te();Be={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},qi={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Jt=(0,Zt.createSlice)({name:"transactionsSlice",initialState:Be,reducers:{moveTransactionsToSignedState:(e,o)=>{var d,g;let{sessionId:n,transactions:t,errorMessage:a,status:i,redirectRoute:m}=o.payload,l=((d=e.customTransactionInformationForSessionId)==null?void 0:d[n])||qi;e.signedTransactions[n]={transactions:t,status:i,errorMessage:a,redirectRoute:m,customTransactionInformation:l},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===n&&(e.transactionsToSign=Be.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:t,errorMessage:a,transactions:i}=o.payload;e.signedTransactions[n]!=null&&(e.signedTransactions[n].status=t,a!=null&&(e.signedTransactions[n].errorMessage=a),i!=null&&(e.signedTransactions[n].transactions=i))},updateSignedTransactionStatus:(e,o)=>{var l,d,g,h,u,T;let{sessionId:n,status:t,errorMessage:a,transactionHash:i}=o.payload,m=(d=(l=e.signedTransactions)==null?void 0:l[n])==null?void 0:d.transactions;if(m!=null){e.signedTransactions[n].transactions=m.map(D=>D.hash===i?k(b({},D),{status:t,errorMessage:a}):D);let S=(h=(g=e.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:h.every(D=>no(D.status)),N=(T=(u=e.signedTransactions[n])==null?void 0:u.transactions)==null?void 0:T.every(D=>to(D.status));S&&(e.signedTransactions[n].status="success"),N&&(e.signedTransactions[n].status="fail")}},setTransactionsToSign:(e,o)=>{e.transactionsToSign=o.payload;let{sessionId:n,customTransactionInformation:t}=o.payload;e.customTransactionInformationForSessionId[n]=t,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=Be.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Be.signedTransactions},setSignTransactionsError:(e,o)=>{e.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(e,o)=>{e.signTransactionsCancelMessage=o.payload}},extraReducers:e=>{e.addCase(R,()=>Be),e.addCase(Yt.REHYDRATE,(o,n)=>{var m;if(o.signTransactionsCancelMessage=null,!((m=n.payload)!=null&&m.transactions))return;let{signedTransactions:t,customTransactionInformationForSessionId:a}=n.payload.transactions,i=Object.entries(t).reduce((l,[d,g])=>{let h=new Date(d),u=new Date;return u.setHours(u.getHours()+5),u-h>0||(l[d]=g),l},{});a!=null&&(o.customTransactionInformationForSessionId=a),t!=null&&(o.signedTransactions=i)})}}),{updateSignedTransactionStatus:Zm,updateSignedTransactions:Ym,setTransactionsToSign:Jm,clearAllTransactionsToSign:Qm,clearAllSignedTransactions:e_,clearSignedTransaction:o_,clearTransactionToSign:n_,setSignTransactionsError:t_,setSignTransactionsCancelMessage:r_,moveTransactionsToSignedState:a_}=Jt.actions,ro=Jt.reducer});var Qt,an,pn,cn,Ki,rn,er,m_,__,s_,io,po=x(()=>{"use strict";r();Qt=require("@reduxjs/toolkit");te();an="Transaction failed",pn="Transaction successful",cn="Processing transaction",Ki="Transaction submitted",rn={},er=(0,Qt.createSlice)({name:"transactionsInfo",initialState:rn,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:t}=o.payload;n!=null&&(e[n]={errorMessage:(t==null?void 0:t.errorMessage)||an,successMessage:(t==null?void 0:t.successMessage)||pn,processingMessage:(t==null?void 0:t.processingMessage)||cn,submittedMessage:(t==null?void 0:t.submittedMessage)||Ki,transactionDuration:t==null?void 0:t.transactionDuration})},clearTransactionsInfoForSessionId(e,o){o.payload!=null&&delete e[o.payload]},clearTransactionsInfo:()=>rn},extraReducers:e=>{e.addCase(R,()=>rn)}}),{clearTransactionsInfo:m_,setTransactionsDisplayInfo:__,clearTransactionsInfoForSessionId:s_}=er.actions,io=er.reducer});var nr,or,tr,u_,f_,h_,x_,rr,mn=x(()=>{"use strict";r();nr=require("@reduxjs/toolkit");te();or={},tr=(0,nr.createSlice)({name:"modalsSlice",initialState:or,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(R,()=>or)}}),{setTxSubmittedModal:u_,setNotificationModal:f_,clearTxSubmittedModal:h_,clearNotificationModal:x_}=tr.actions,rr=tr.reducer});var ir,pr,ar,cr,A_,I_,E_,N_,L_,D_,co,mo=x(()=>{"use strict";r();ir=require("@reduxjs/toolkit"),pr=require("redux-persist");Vo();ee();Ho();te();ar={customToasts:[],transactionToasts:[],failTransactionToast:null},cr=(0,ir.createSlice)({name:"toastsSlice",initialState:ar,reducers:{addCustomToast:(e,o)=>{e.customToasts.push(k(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:Je(),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=k(b({},o.payload),{toastId:gt})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(R,()=>ar),e.addCase(pr.REHYDRATE,(o,n)=>{var a,i;let t=(i=(a=n.customToasts)==null?void 0:a.filter(m=>!("component"in m)))!=null?i:[];o.customToasts=t})}}),{addCustomToast:A_,removeCustomToast:I_,addTransactionToast:E_,removeTransactionToast:N_,addFailTransactionToast:L_,removeFailTransactionToast:D_}=cr.actions,co=cr.reducer});var Te=x(()=>{"use strict";r();Xo();Jo();on();ao();po();mn();mo()});var _n=x(()=>{"use strict";r()});var dr,sr,lr,Y_,J_,Q_,es,os,ns,gr,ur=x(()=>{"use strict";r();dr=require("@reduxjs/toolkit");te();sr={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},lr=(0,dr.createSlice)({name:"dappModalsSlice",initialState:sr,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(R,()=>sr)}}),{setDappModalVisibility:Y_,setDappModalHeaderVisibility:J_,setDappModalFooterVisibility:Q_,setDappModalHeaderText:es,setDappModalFooterText:os,setDappModalConfig:ns}=lr.actions,gr=lr.reducer});var fr,Ji,Qi,we,so=x(()=>{"use strict";r();fr=require("@reduxjs/toolkit");_n();on();ur();Xo();mn();Jo();mo();po();ao();Ji={["account"]:qt,["networkConfig"]:$t,["loginInfo"]:Ct,["modals"]:rr,["dappModal"]:gr,["toasts"]:co,["transactions"]:ro,["transactionsInfo"]:io},Qi=(e={})=>(0,fr.combineReducers)(b(b({},Ji),e)),we=Qi});var br={};ie(br,{default:()=>ip});function sn(e,o=[]){return{key:e,version:1,storage:xr.default,blacklist:o}}var se,hr,xr,ep,op,np,tp,rp,ap,ip,yr=x(()=>{"use strict";r();se=require("redux-persist"),hr=w(require("redux-persist/lib/storage")),xr=w(require("redux-persist/lib/storage/session"));so();Te();mo();po();ao();_n();ep={2:e=>k(b({},e),{networkConfig:Yo})};op=sn("dapp-core-transactionsInfo"),np=sn("dapp-core-transactions",["transactionsToSign"]),tp=sn("dapp-core-toasts"),rp={key:"dapp-core-store",version:2,storage:hr.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,se.createMigrate)(ep,{debug:!1})},ap={["toasts"]:(0,se.persistReducer)(tp,co),["transactions"]:(0,se.persistReducer)(np,ro),["transactionsInfo"]:(0,se.persistReducer)(op,io)},ip=(0,se.persistReducer)(rp,we(ap))});var Tr={};ie(Tr,{default:()=>pp});var pp,wr=x(()=>{"use strict";r();so();pp=we()});var Sr={};ie(Sr,{default:()=>mp});var M,cp,mp,kr=x(()=>{"use strict";r();M=require("redux-persist"),cp=[M.FLUSH,M.REHYDRATE,M.PAUSE,M.PERSIST,M.PURGE,M.REGISTER],mp=cp});var Ir={};ie(Ir,{default:()=>Ar});function Ar(e){return(0,vr.persistStore)(e)}var vr,Er=x(()=>{"use strict";r();vr=require("redux-persist")});var Bp={};ie(Bp,{TransactionValue:()=>Op});module.exports=De(Bp);r();var V=w(require("react")),Ra=require("@fortawesome/free-solid-svg-icons"),Fa=require("@fortawesome/react-fontawesome"),Nn=w(require("classnames"));r();var Ce=(t=>(t.NonFungibleESDT="NonFungibleESDT",t.SemiFungibleESDT="SemiFungibleESDT",t.MetaESDT="MetaESDT",t))(Ce||{});r();r();var ne=w(require("react")),bt=w(require("classnames"));r();var Ti=`.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;
animat