@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
193 lines (171 loc) • 217 kB
JavaScript
"use strict";var oi=Object.create;var Me=Object.defineProperty,ti=Object.defineProperties,ri=Object.getOwnPropertyDescriptor,ai=Object.getOwnPropertyDescriptors,ii=Object.getOwnPropertyNames,Xe=Object.getOwnPropertySymbols,ci=Object.getPrototypeOf,Pn=Object.prototype.hasOwnProperty,Go=Object.prototype.propertyIsEnumerable;var Vo=(e,n,o)=>n in e?Me(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,x=(e,n)=>{for(var o in n||(n={}))Pn.call(n,o)&&Vo(e,o,n[o]);if(Xe)for(var o of Xe(n))Go.call(n,o)&&Vo(e,o,n[o]);return e},k=(e,n)=>ti(e,ai(n));var Ke=(e,n)=>{var o={};for(var t in e)Pn.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(e!=null&&Xe)for(var t of Xe(e))n.indexOf(t)<0&&Go.call(e,t)&&(o[t]=e[t]);return o};var b=(e,n)=>()=>(e&&(n=e(e=0)),n);var Je=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),fe=(e,n)=>{for(var o in n)Me(e,o,{get:n[o],enumerable:!0})},Wo=(e,n,o,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of ii(n))!Pn.call(e,a)&&a!==o&&Me(e,a,{get:()=>n[a],enumerable:!(t=ri(n,a))||t.enumerable});return e};var w=(e,n,o)=>(o=e!=null?oi(ci(e)):{},Wo(n||!e||!e.__esModule?Me(o,"default",{value:e,enumerable:!0}):o,e)),en=e=>Wo(Me({},"__esModule",{value:!0}),e);var Ho=(e,n,o)=>new Promise((t,a)=>{var i=l=>{try{_(o.next(l))}catch(g){a(g)}},c=l=>{try{_(o.throw(l))}catch(g){a(g)}},_=l=>l.done?t(l.value):Promise.resolve(l.value).then(i,c);_((o=o.apply(e,n)).next())});var $o=Je(nn=>{"use strict";r();nn.byteLength=si;nn.toByteArray=di;nn.fromByteArray=gi;var O=[],R=[],pi=typeof Uint8Array!="undefined"?Uint8Array:Array,jn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(pe=0,Zo=jn.length;pe<Zo;++pe)O[pe]=jn[pe],R[jn.charCodeAt(pe)]=pe;var pe,Zo;R["-".charCodeAt(0)]=62;R["_".charCodeAt(0)]=63;function Yo(e){var n=e.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.indexOf("=");o===-1&&(o=n);var t=o===n?0:4-o%4;return[o,t]}function si(e){var n=Yo(e),o=n[0],t=n[1];return(o+t)*3/4-t}function mi(e,n,o){return(n+o)*3/4-o}function di(e){var n,o=Yo(e),t=o[0],a=o[1],i=new pi(mi(e,t,a)),c=0,_=a>0?t-4:t,l;for(l=0;l<_;l+=4)n=R[e.charCodeAt(l)]<<18|R[e.charCodeAt(l+1)]<<12|R[e.charCodeAt(l+2)]<<6|R[e.charCodeAt(l+3)],i[c++]=n>>16&255,i[c++]=n>>8&255,i[c++]=n&255;return a===2&&(n=R[e.charCodeAt(l)]<<2|R[e.charCodeAt(l+1)]>>4,i[c++]=n&255),a===1&&(n=R[e.charCodeAt(l)]<<10|R[e.charCodeAt(l+1)]<<4|R[e.charCodeAt(l+2)]>>2,i[c++]=n>>8&255,i[c++]=n&255),i}function _i(e){return O[e>>18&63]+O[e>>12&63]+O[e>>6&63]+O[e&63]}function li(e,n,o){for(var t,a=[],i=n;i<o;i+=3)t=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),a.push(_i(t));return a.join("")}function gi(e){for(var n,o=e.length,t=o%3,a=[],i=16383,c=0,_=o-t;c<_;c+=i)a.push(li(e,c,c+i>_?_:c+i));return t===1?(n=e[o-1],a.push(O[n>>2]+O[n<<4&63]+"==")):t===2&&(n=(e[o-2]<<8)+e[o-1],a.push(O[n>>10]+O[n>>4&63]+O[n<<2&63]+"=")),a.join("")}});var Qo=Je(zn=>{r();zn.read=function(e,n,o,t,a){var i,c,_=a*8-t-1,l=(1<<_)-1,g=l>>1,u=-7,f=o?a-1:0,T=o?-1:1,q=e[n+f];for(f+=T,i=q&(1<<-u)-1,q>>=-u,u+=_;u>0;i=i*256+e[n+f],f+=T,u-=8);for(c=i&(1<<-u)-1,i>>=-u,u+=t;u>0;c=c*256+e[n+f],f+=T,u-=8);if(i===0)i=1-g;else{if(i===l)return c?NaN:(q?-1:1)*(1/0);c=c+Math.pow(2,t),i=i-g}return(q?-1:1)*c*Math.pow(2,i-t)};zn.write=function(e,n,o,t,a,i){var c,_,l,g=i*8-a-1,u=(1<<g)-1,f=u>>1,T=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,q=t?0:i-1,A=t?1:-1,E=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(_=isNaN(n)?1:0,c=u):(c=Math.floor(Math.log(n)/Math.LN2),n*(l=Math.pow(2,-c))<1&&(c--,l*=2),c+f>=1?n+=T/l:n+=T*Math.pow(2,1-f),n*l>=2&&(c++,l/=2),c+f>=u?(_=0,c=u):c+f>=1?(_=(n*l-1)*Math.pow(2,a),c=c+f):(_=n*Math.pow(2,f-1)*Math.pow(2,a),c=0));a>=8;e[o+q]=_&255,q+=A,_/=256,a-=8);for(c=c<<a|_,g+=a;g>0;e[o+q]=c&255,q+=A,c/=256,g-=8);e[o+q-A]|=E*128}});var mt=Je(he=>{"use strict";r();var Un=$o(),ue=Qo(),Xo=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;he.Buffer=d;he.SlowBuffer=yi;he.INSPECT_MAX_BYTES=50;var on=2147483647;he.kMaxLength=on;d.TYPED_ARRAY_SUPPORT=fi();!d.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function fi(){try{var e=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(e,n),e.foo()===42}catch(o){return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(!!d.isBuffer(this))return this.buffer}});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(!!d.isBuffer(this))return this.byteOffset}});function Y(e){if(e>on)throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=new Uint8Array(e);return Object.setPrototypeOf(n,d.prototype),n}function d(e,n,o){if(typeof e=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Gn(e)}return et(e,n,o)}d.poolSize=8192;function et(e,n,o){if(typeof e=="string")return hi(e,n);if(ArrayBuffer.isView(e))return bi(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(V(e,ArrayBuffer)||e&&V(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(V(e,SharedArrayBuffer)||e&&V(e.buffer,SharedArrayBuffer)))return On(e,n,o);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 d.from(t,n,o);var a=xi(e);if(a)return a;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return d.from(e[Symbol.toPrimitive]("string"),n,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}d.from=function(e,n,o){return et(e,n,o)};Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function nt(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 ui(e,n,o){return nt(e),e<=0?Y(e):n!==void 0?typeof o=="string"?Y(e).fill(n,o):Y(e).fill(n):Y(e)}d.alloc=function(e,n,o){return ui(e,n,o)};function Gn(e){return nt(e),Y(e<0?0:Wn(e)|0)}d.allocUnsafe=function(e){return Gn(e)};d.allocUnsafeSlow=function(e){return Gn(e)};function hi(e,n){if((typeof n!="string"||n==="")&&(n="utf8"),!d.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=ot(e,n)|0,t=Y(o),a=t.write(e,n);return a!==o&&(t=t.slice(0,a)),t}function Bn(e){for(var n=e.length<0?0:Wn(e.length)|0,o=Y(n),t=0;t<n;t+=1)o[t]=e[t]&255;return o}function bi(e){if(V(e,Uint8Array)){var n=new Uint8Array(e);return On(n.buffer,n.byteOffset,n.byteLength)}return Bn(e)}function On(e,n,o){if(n<0||e.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<n+(o||0))throw new RangeError('"length" is outside of buffer bounds');var t;return n===void 0&&o===void 0?t=new Uint8Array(e):o===void 0?t=new Uint8Array(e,n):t=new Uint8Array(e,n,o),Object.setPrototypeOf(t,d.prototype),t}function xi(e){if(d.isBuffer(e)){var n=Wn(e.length)|0,o=Y(n);return o.length===0||e.copy(o,0,0,n),o}if(e.length!==void 0)return typeof e.length!="number"||Hn(e.length)?Y(0):Bn(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Bn(e.data)}function Wn(e){if(e>=on)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+on.toString(16)+" bytes");return e|0}function yi(e){return+e!=e&&(e=0),d.alloc(+e)}d.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==d.prototype};d.compare=function(n,o){if(V(n,Uint8Array)&&(n=d.from(n,n.offset,n.byteLength)),V(o,Uint8Array)&&(o=d.from(o,o.offset,o.byteLength)),!d.isBuffer(n)||!d.isBuffer(o))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===o)return 0;for(var t=n.length,a=o.length,i=0,c=Math.min(t,a);i<c;++i)if(n[i]!==o[i]){t=n[i],a=o[i];break}return t<a?-1:a<t?1:0};d.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};d.concat=function(n,o){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return d.alloc(0);var t;if(o===void 0)for(o=0,t=0;t<n.length;++t)o+=n[t].length;var a=d.allocUnsafe(o),i=0;for(t=0;t<n.length;++t){var c=n[t];if(V(c,Uint8Array))i+c.length>a.length?d.from(c).copy(a,i):Uint8Array.prototype.set.call(a,c,i);else if(d.isBuffer(c))c.copy(a,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=c.length}return a};function ot(e,n){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||V(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 o=e.length,t=arguments.length>2&&arguments[2]===!0;if(!t&&o===0)return 0;for(var a=!1;;)switch(n){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":return Vn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o*2;case"hex":return o>>>1;case"base64":return st(e).length;default:if(a)return t?-1:Vn(e).length;n=(""+n).toLowerCase(),a=!0}}d.byteLength=ot;function Ti(e,n,o){var t=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((o===void 0||o>this.length)&&(o=this.length),o<=0)||(o>>>=0,n>>>=0,o<=n))return"";for(e||(e="utf8");;)switch(e){case"hex":return Mi(this,n,o);case"utf8":case"utf-8":return rt(this,n,o);case"ascii":return Ei(this,n,o);case"latin1":case"binary":return Di(this,n,o);case"base64":return Ai(this,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Li(this,n,o);default:if(t)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),t=!0}}d.prototype._isBuffer=!0;function se(e,n,o){var t=e[n];e[n]=e[o],e[o]=t}d.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var o=0;o<n;o+=2)se(this,o,o+1);return this};d.prototype.swap32=function(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var o=0;o<n;o+=4)se(this,o,o+3),se(this,o+1,o+2);return this};d.prototype.swap64=function(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var o=0;o<n;o+=8)se(this,o,o+7),se(this,o+1,o+6),se(this,o+2,o+5),se(this,o+3,o+4);return this};d.prototype.toString=function(){var n=this.length;return n===0?"":arguments.length===0?rt(this,0,n):Ti.apply(this,arguments)};d.prototype.toLocaleString=d.prototype.toString;d.prototype.equals=function(n){if(!d.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:d.compare(this,n)===0};d.prototype.inspect=function(){var n="",o=he.INSPECT_MAX_BYTES;return n=this.toString("hex",0,o).replace(/(.{2})/g,"$1 ").trim(),this.length>o&&(n+=" ... "),"<Buffer "+n+">"};Xo&&(d.prototype[Xo]=d.prototype.inspect);d.prototype.compare=function(n,o,t,a,i){if(V(n,Uint8Array)&&(n=d.from(n,n.offset,n.byteLength)),!d.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(o===void 0&&(o=0),t===void 0&&(t=n?n.length:0),a===void 0&&(a=0),i===void 0&&(i=this.length),o<0||t>n.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&o>=t)return 0;if(a>=i)return-1;if(o>=t)return 1;if(o>>>=0,t>>>=0,a>>>=0,i>>>=0,this===n)return 0;for(var c=i-a,_=t-o,l=Math.min(c,_),g=this.slice(a,i),u=n.slice(o,t),f=0;f<l;++f)if(g[f]!==u[f]){c=g[f],_=u[f];break}return c<_?-1:_<c?1:0};function tt(e,n,o,t,a){if(e.length===0)return-1;if(typeof o=="string"?(t=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,Hn(o)&&(o=a?0:e.length-1),o<0&&(o=e.length+o),o>=e.length){if(a)return-1;o=e.length-1}else if(o<0)if(a)o=0;else return-1;if(typeof n=="string"&&(n=d.from(n,t)),d.isBuffer(n))return n.length===0?-1:Ko(e,n,o,t,a);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e,n,o):Uint8Array.prototype.lastIndexOf.call(e,n,o):Ko(e,[n],o,t,a);throw new TypeError("val must be string, number or Buffer")}function Ko(e,n,o,t,a){var i=1,c=e.length,_=n.length;if(t!==void 0&&(t=String(t).toLowerCase(),t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le")){if(e.length<2||n.length<2)return-1;i=2,c/=2,_/=2,o/=2}function l(q,A){return i===1?q[A]:q.readUInt16BE(A*i)}var g;if(a){var u=-1;for(g=o;g<c;g++)if(l(e,g)===l(n,u===-1?0:g-u)){if(u===-1&&(u=g),g-u+1===_)return u*i}else u!==-1&&(g-=g-u),u=-1}else for(o+_>c&&(o=c-_),g=o;g>=0;g--){for(var f=!0,T=0;T<_;T++)if(l(e,g+T)!==l(n,T)){f=!1;break}if(f)return g}return-1}d.prototype.includes=function(n,o,t){return this.indexOf(n,o,t)!==-1};d.prototype.indexOf=function(n,o,t){return tt(this,n,o,t,!0)};d.prototype.lastIndexOf=function(n,o,t){return tt(this,n,o,t,!1)};function wi(e,n,o,t){o=Number(o)||0;var a=e.length-o;t?(t=Number(t),t>a&&(t=a)):t=a;var i=n.length;t>i/2&&(t=i/2);for(var c=0;c<t;++c){var _=parseInt(n.substr(c*2,2),16);if(Hn(_))return c;e[o+c]=_}return c}function qi(e,n,o,t){return tn(Vn(n,e.length-o),e,o,t)}function ki(e,n,o,t){return tn(Ri(n),e,o,t)}function vi(e,n,o,t){return tn(st(n),e,o,t)}function Si(e,n,o,t){return tn(Fi(n,e.length-o),e,o,t)}d.prototype.write=function(n,o,t,a){if(o===void 0)a="utf8",t=this.length,o=0;else if(t===void 0&&typeof o=="string")a=o,t=this.length,o=0;else if(isFinite(o))o=o>>>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-o;if((t===void 0||t>i)&&(t=i),n.length>0&&(t<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var c=!1;;)switch(a){case"hex":return wi(this,n,o,t);case"utf8":case"utf-8":return qi(this,n,o,t);case"ascii":case"latin1":case"binary":return ki(this,n,o,t);case"base64":return vi(this,n,o,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Si(this,n,o,t);default:if(c)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),c=!0}};d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ai(e,n,o){return n===0&&o===e.length?Un.fromByteArray(e):Un.fromByteArray(e.slice(n,o))}function rt(e,n,o){o=Math.min(e.length,o);for(var t=[],a=n;a<o;){var i=e[a],c=null,_=i>239?4:i>223?3:i>191?2:1;if(a+_<=o){var l,g,u,f;switch(_){case 1:i<128&&(c=i);break;case 2:l=e[a+1],(l&192)===128&&(f=(i&31)<<6|l&63,f>127&&(c=f));break;case 3:l=e[a+1],g=e[a+2],(l&192)===128&&(g&192)===128&&(f=(i&15)<<12|(l&63)<<6|g&63,f>2047&&(f<55296||f>57343)&&(c=f));break;case 4:l=e[a+1],g=e[a+2],u=e[a+3],(l&192)===128&&(g&192)===128&&(u&192)===128&&(f=(i&15)<<18|(l&63)<<12|(g&63)<<6|u&63,f>65535&&f<1114112&&(c=f))}}c===null?(c=65533,_=1):c>65535&&(c-=65536,t.push(c>>>10&1023|55296),c=56320|c&1023),t.push(c),a+=_}return Ni(t)}var Jo=4096;function Ni(e){var n=e.length;if(n<=Jo)return String.fromCharCode.apply(String,e);for(var o="",t=0;t<n;)o+=String.fromCharCode.apply(String,e.slice(t,t+=Jo));return o}function Ei(e,n,o){var t="";o=Math.min(e.length,o);for(var a=n;a<o;++a)t+=String.fromCharCode(e[a]&127);return t}function Di(e,n,o){var t="";o=Math.min(e.length,o);for(var a=n;a<o;++a)t+=String.fromCharCode(e[a]);return t}function Mi(e,n,o){var t=e.length;(!n||n<0)&&(n=0),(!o||o<0||o>t)&&(o=t);for(var a="",i=n;i<o;++i)a+=Pi[e[i]];return a}function Li(e,n,o){for(var t=e.slice(n,o),a="",i=0;i<t.length-1;i+=2)a+=String.fromCharCode(t[i]+t[i+1]*256);return a}d.prototype.slice=function(n,o){var t=this.length;n=~~n,o=o===void 0?t:~~o,n<0?(n+=t,n<0&&(n=0)):n>t&&(n=t),o<0?(o+=t,o<0&&(o=0)):o>t&&(o=t),o<n&&(o=n);var a=this.subarray(n,o);return Object.setPrototypeOf(a,d.prototype),a};function N(e,n,o){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+n>o)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(n,o,t){n=n>>>0,o=o>>>0,t||N(n,o,this.length);for(var a=this[n],i=1,c=0;++c<o&&(i*=256);)a+=this[n+c]*i;return a};d.prototype.readUintBE=d.prototype.readUIntBE=function(n,o,t){n=n>>>0,o=o>>>0,t||N(n,o,this.length);for(var a=this[n+--o],i=1;o>0&&(i*=256);)a+=this[n+--o]*i;return a};d.prototype.readUint8=d.prototype.readUInt8=function(n,o){return n=n>>>0,o||N(n,1,this.length),this[n]};d.prototype.readUint16LE=d.prototype.readUInt16LE=function(n,o){return n=n>>>0,o||N(n,2,this.length),this[n]|this[n+1]<<8};d.prototype.readUint16BE=d.prototype.readUInt16BE=function(n,o){return n=n>>>0,o||N(n,2,this.length),this[n]<<8|this[n+1]};d.prototype.readUint32LE=d.prototype.readUInt32LE=function(n,o){return n=n>>>0,o||N(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216};d.prototype.readUint32BE=d.prototype.readUInt32BE=function(n,o){return n=n>>>0,o||N(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])};d.prototype.readIntLE=function(n,o,t){n=n>>>0,o=o>>>0,t||N(n,o,this.length);for(var a=this[n],i=1,c=0;++c<o&&(i*=256);)a+=this[n+c]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*o)),a};d.prototype.readIntBE=function(n,o,t){n=n>>>0,o=o>>>0,t||N(n,o,this.length);for(var a=o,i=1,c=this[n+--a];a>0&&(i*=256);)c+=this[n+--a]*i;return i*=128,c>=i&&(c-=Math.pow(2,8*o)),c};d.prototype.readInt8=function(n,o){return n=n>>>0,o||N(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]};d.prototype.readInt16LE=function(n,o){n=n>>>0,o||N(n,2,this.length);var t=this[n]|this[n+1]<<8;return t&32768?t|4294901760:t};d.prototype.readInt16BE=function(n,o){n=n>>>0,o||N(n,2,this.length);var t=this[n+1]|this[n]<<8;return t&32768?t|4294901760:t};d.prototype.readInt32LE=function(n,o){return n=n>>>0,o||N(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24};d.prototype.readInt32BE=function(n,o){return n=n>>>0,o||N(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]};d.prototype.readFloatLE=function(n,o){return n=n>>>0,o||N(n,4,this.length),ue.read(this,n,!0,23,4)};d.prototype.readFloatBE=function(n,o){return n=n>>>0,o||N(n,4,this.length),ue.read(this,n,!1,23,4)};d.prototype.readDoubleLE=function(n,o){return n=n>>>0,o||N(n,8,this.length),ue.read(this,n,!0,52,8)};d.prototype.readDoubleBE=function(n,o){return n=n>>>0,o||N(n,8,this.length),ue.read(this,n,!1,52,8)};function L(e,n,o,t,a,i){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>a||n<i)throw new RangeError('"value" argument is out of bounds');if(o+t>e.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(n,o,t,a){if(n=+n,o=o>>>0,t=t>>>0,!a){var i=Math.pow(2,8*t)-1;L(this,n,o,t,i,0)}var c=1,_=0;for(this[o]=n&255;++_<t&&(c*=256);)this[o+_]=n/c&255;return o+t};d.prototype.writeUintBE=d.prototype.writeUIntBE=function(n,o,t,a){if(n=+n,o=o>>>0,t=t>>>0,!a){var i=Math.pow(2,8*t)-1;L(this,n,o,t,i,0)}var c=t-1,_=1;for(this[o+c]=n&255;--c>=0&&(_*=256);)this[o+c]=n/_&255;return o+t};d.prototype.writeUint8=d.prototype.writeUInt8=function(n,o,t){return n=+n,o=o>>>0,t||L(this,n,o,1,255,0),this[o]=n&255,o+1};d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(n,o,t){return n=+n,o=o>>>0,t||L(this,n,o,2,65535,0),this[o]=n&255,this[o+1]=n>>>8,o+2};d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(n,o,t){return n=+n,o=o>>>0,t||L(this,n,o,2,65535,0),this[o]=n>>>8,this[o+1]=n&255,o+2};d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(n,o,t){return n=+n,o=o>>>0,t||L(this,n,o,4,4294967295,0),this[o+3]=n>>>24,this[o+2]=n>>>16,this[o+1]=n>>>8,this[o]=n&255,o+4};d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(n,o,t){return n=+n,o=o>>>0,t||L(this,n,o,4,4294967295,0),this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255,o+4};d.prototype.writeIntLE=function(n,o,t,a){if(n=+n,o=o>>>0,!a){var i=Math.pow(2,8*t-1);L(this,n,o,t,i-1,-i)}var c=0,_=1,l=0;for(this[o]=n&255;++c<t&&(_*=256);)n<0&&l===0&&this[o+c-1]!==0&&(l=1),this[o+c]=(n/_>>0)-l&255;return o+t};d.prototype.writeIntBE=function(n,o,t,a){if(n=+n,o=o>>>0,!a){var i=Math.pow(2,8*t-1);L(this,n,o,t,i-1,-i)}var c=t-1,_=1,l=0;for(this[o+c]=n&255;--c>=0&&(_*=256);)n<0&&l===0&&this[o+c+1]!==0&&(l=1),this[o+c]=(n/_>>0)-l&255;return o+t};d.prototype.writeInt8=function(n,o,t){return n=+n,o=o>>>0,t||L(this,n,o,1,127,-128),n<0&&(n=255+n+1),this[o]=n&255,o+1};d.prototype.writeInt16LE=function(n,o,t){return n=+n,o=o>>>0,t||L(this,n,o,2,32767,-32768),this[o]=n&255,this[o+1]=n>>>8,o+2};d.prototype.writeInt16BE=function(n,o,t){return n=+n,o=o>>>0,t||L(this,n,o,2,32767,-32768),this[o]=n>>>8,this[o+1]=n&255,o+2};d.prototype.writeInt32LE=function(n,o,t){return n=+n,o=o>>>0,t||L(this,n,o,4,2147483647,-2147483648),this[o]=n&255,this[o+1]=n>>>8,this[o+2]=n>>>16,this[o+3]=n>>>24,o+4};d.prototype.writeInt32BE=function(n,o,t){return n=+n,o=o>>>0,t||L(this,n,o,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255,o+4};function at(e,n,o,t,a,i){if(o+t>e.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function ct(e,n,o,t,a){return n=+n,o=o>>>0,a||at(e,n,o,4,34028234663852886e22,-34028234663852886e22),ue.write(e,n,o,t,23,4),o+4}d.prototype.writeFloatLE=function(n,o,t){return ct(this,n,o,!0,t)};d.prototype.writeFloatBE=function(n,o,t){return ct(this,n,o,!1,t)};function pt(e,n,o,t,a){return n=+n,o=o>>>0,a||at(e,n,o,8,17976931348623157e292,-17976931348623157e292),ue.write(e,n,o,t,52,8),o+8}d.prototype.writeDoubleLE=function(n,o,t){return pt(this,n,o,!0,t)};d.prototype.writeDoubleBE=function(n,o,t){return pt(this,n,o,!1,t)};d.prototype.copy=function(n,o,t,a){if(!d.isBuffer(n))throw new TypeError("argument should be a Buffer");if(t||(t=0),!a&&a!==0&&(a=this.length),o>=n.length&&(o=n.length),o||(o=0),a>0&&a<t&&(a=t),a===t||n.length===0||this.length===0)return 0;if(o<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),n.length-o<a-t&&(a=n.length-o+t);var i=a-t;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(o,t,a):Uint8Array.prototype.set.call(n,this.subarray(t,a),o),i};d.prototype.fill=function(n,o,t,a){if(typeof n=="string"){if(typeof o=="string"?(a=o,o=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"&&!d.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(n.length===1){var i=n.charCodeAt(0);(a==="utf8"&&i<128||a==="latin1")&&(n=i)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(o<0||this.length<o||this.length<t)throw new RangeError("Out of range index");if(t<=o)return this;o=o>>>0,t=t===void 0?this.length:t>>>0,n||(n=0);var c;if(typeof n=="number")for(c=o;c<t;++c)this[c]=n;else{var _=d.isBuffer(n)?n:d.from(n,a),l=_.length;if(l===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(c=0;c<t-o;++c)this[c+o]=_[c%l]}return this};var Ii=/[^+/0-9A-Za-z-_]/g;function Ci(e){if(e=e.split("=")[0],e=e.trim().replace(Ii,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Vn(e,n){n=n||1/0;for(var o,t=e.length,a=null,i=[],c=0;c<t;++c){if(o=e.charCodeAt(c),o>55295&&o<57344){if(!a){if(o>56319){(n-=3)>-1&&i.push(239,191,189);continue}else if(c+1===t){(n-=3)>-1&&i.push(239,191,189);continue}a=o;continue}if(o<56320){(n-=3)>-1&&i.push(239,191,189),a=o;continue}o=(a-55296<<10|o-56320)+65536}else a&&(n-=3)>-1&&i.push(239,191,189);if(a=null,o<128){if((n-=1)<0)break;i.push(o)}else if(o<2048){if((n-=2)<0)break;i.push(o>>6|192,o&63|128)}else if(o<65536){if((n-=3)<0)break;i.push(o>>12|224,o>>6&63|128,o&63|128)}else if(o<1114112){if((n-=4)<0)break;i.push(o>>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else throw new Error("Invalid code point")}return i}function Ri(e){for(var n=[],o=0;o<e.length;++o)n.push(e.charCodeAt(o)&255);return n}function Fi(e,n){for(var o,t,a,i=[],c=0;c<e.length&&!((n-=2)<0);++c)o=e.charCodeAt(c),t=o>>8,a=o%256,i.push(a),i.push(t);return i}function st(e){return Un.toByteArray(Ci(e))}function tn(e,n,o,t){for(var a=0;a<t&&!(a+o>=n.length||a>=e.length);++a)n[a+o]=e[a];return a}function V(e,n){return e instanceof n||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===n.name}function Hn(e){return e!==e}var Pi=function(){for(var e="0123456789abcdef",n=new Array(256),o=0;o<16;++o)for(var t=o*16,a=0;a<16;++a)n[t+a]=e[o]+e[a];return n}()});var ft=Je((sp,gt)=>{r();var S=gt.exports={},G,W;function Zn(){throw new Error("setTimeout has not been defined")}function Yn(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?G=setTimeout:G=Zn}catch(e){G=Zn}try{typeof clearTimeout=="function"?W=clearTimeout:W=Yn}catch(e){W=Yn}})();function dt(e){if(G===setTimeout)return setTimeout(e,0);if((G===Zn||!G)&&setTimeout)return G=setTimeout,setTimeout(e,0);try{return G(e,0)}catch(n){try{return G.call(null,e,0)}catch(o){return G.call(this,e,0)}}}function ji(e){if(W===clearTimeout)return clearTimeout(e);if((W===Yn||!W)&&clearTimeout)return W=clearTimeout,clearTimeout(e);try{return W(e)}catch(n){try{return W.call(null,e)}catch(o){return W.call(this,e)}}}var $=[],be=!1,me,rn=-1;function zi(){!be||!me||(be=!1,me.length?$=me.concat($):rn=-1,$.length&&_t())}function _t(){if(!be){var e=dt(zi);be=!0;for(var n=$.length;n;){for(me=$,$=[];++rn<n;)me&&me[rn].run();rn=-1,n=$.length}me=null,be=!1,ji(e)}}S.nextTick=function(e){var n=new Array(arguments.length-1);if(arguments.length>1)for(var o=1;o<arguments.length;o++)n[o-1]=arguments[o];$.push(new lt(e,n)),$.length===1&&!be&&dt(_t)};function lt(e,n){this.fun=e,this.array=n}lt.prototype.run=function(){this.fun.apply(null,this.array)};S.title="browser";S.browser=!0;S.env={};S.argv=[];S.version="";S.versions={};function Q(){}S.on=Q;S.addListener=Q;S.once=Q;S.off=Q;S.removeListener=Q;S.removeAllListeners=Q;S.emit=Q;S.prependListener=Q;S.prependOnceListener=Q;S.listeners=function(e){return[]};S.binding=function(e){throw new Error("process.binding is not supported")};S.cwd=function(){return"/"};S.chdir=function(e){throw new Error("process.chdir is not supported")};S.umask=function(){return 0}});var p,s,mp,r=b(()=>{p=w(mt()),s=w(ft()),mp=function(e){function n(){var t=this||self;return delete e.prototype.__magic__,t}if(typeof globalThis=="object")return globalThis;if(this)return n();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:n});var o=__magic__;return o}(Object)});var ut=b(()=>{"use strict";r()});var ht=b(()=>{"use strict";r()});var $n,M=b(()=>{"use strict";r();$n=(t=>(t.nft="nft",t.esdt="esdt",t.egld="egld",t))($n||{})});var U=b(()=>{"use strict";r()});var bt=b(()=>{"use strict";r()});var xt=b(()=>{"use strict";r()});var yt=b(()=>{"use strict";r()});var Tt=b(()=>{"use strict";r()});var ne=b(()=>{"use strict";r();ht();M();U();bt();xt();yt();Tt()});var Ie,wt,Np,qt,Ep,kt,vt,Dp,Mp,St=b(()=>{"use strict";r();ne();Ie={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:wt,egldLabel:Np}=Ie["devnet"],{chainId:qt,egldLabel:Ep}=Ie["testnet"],{chainId:kt,egldLabel:vt}=Ie["mainnet"],Dp={["devnet"]:wt,["testnet"]:qt,["mainnet"]:kt},Mp={[wt]:"devnet",[qt]:"testnet",[kt]:"mainnet"}});var Qn=b(()=>{"use strict";r()});var At=b(()=>{"use strict";r()});var Nt,Xn=b(()=>{"use strict";r();Nt="transaction-status-toast-id"});var Kn,Jn,D,xe,Et,an,Dt,H,v=b(()=>{"use strict";r();ut();St();Qn();At();Xn();Kn=5e4,Jn=1e9,D=18,xe=4,Et=1,an="logout",Dt="login",H="0"});var cn,eo=b(()=>{"use strict";r();cn=()=>Date.now()/1e3});var Ct=b(()=>{"use strict";r()});var Rt=b(()=>{"use strict";r()});var Ft=b(()=>{"use strict";r();eo();Ct();Rt()});var oo={};fe(oo,{getItem:()=>Hi,localStorageKeys:()=>de,removeItem:()=>Zi,setItem:()=>Wi});var de,no,Wi,Hi,Zi,Fe=b(()=>{"use strict";r();Ft();de={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},no=typeof localStorage!="undefined",Wi=({key:e,data:n,expires:o})=>{!no||localStorage.setItem(String(e),JSON.stringify({expires:o,data:n}))},Hi=e=>{if(!no)return;let n=localStorage.getItem(String(e));if(!n)return null;let o=JSON.parse(n);return!o||!o.hasOwnProperty("expires")||!o.hasOwnProperty("data")?null:cn()>=o.expires?(localStorage.removeItem(String(e)),null):o.data},Zi=e=>{!no||localStorage.removeItem(String(e))}});var to={};fe(to,{clear:()=>Ut,getItem:()=>jt,removeItem:()=>zt,setItem:()=>Pt,storage:()=>Yi});var Pt,jt,zt,Ut,Yi,Bt=b(()=>{"use strict";r();Pt=({key:e,data:n,expires:o})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:o,data:n}))},jt=e=>{let n=sessionStorage.getItem(String(e));if(!n)return null;let o=JSON.parse(n);return!o||!o.hasOwnProperty("expires")||!o.hasOwnProperty("data")?null:Date.now()>=o.expires?(sessionStorage.removeItem(String(e)),null):o.data},zt=e=>sessionStorage.removeItem(String(e)),Ut=()=>sessionStorage.clear(),Yi={setItem:Pt,getItem:jt,removeItem:zt,clear:Ut}});var Te,pn=b(()=>{"use strict";r();Fe();Bt();Te={session:to,local:oo}});function Pe(){return new Date().setHours(new Date().getHours()+24)}function je(e){Te.local.setItem({key:de.loginExpiresAt,data:e,expires:e})}var ro=b(()=>{"use strict";r();pn();Fe()});var ao,I,sn,re=b(()=>{"use strict";r();ao=require("@reduxjs/toolkit");v();I=(0,ao.createAction)(an),sn=(0,ao.createAction)(Dt,e=>({payload:e}))});var Vt,Ot,Gt,qs,ks,vs,Ss,As,Ns,Wt,Ht,io=b(()=>{"use strict";r();Vt=require("@reduxjs/toolkit");ro();U();re();Ot={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Gt=(0,Vt.createSlice)({name:"loginInfoSlice",initialState:Ot,reducers:{setLoginMethod:(e,n)=>{e.loginMethod=n.payload},setTokenLogin:(e,n)=>{e.tokenLogin=n.payload},setTokenLoginSignature:(e,n)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=n.payload)},setWalletLogin:(e,n)=>{e.walletLogin=n.payload},setWalletConnectLogin:(e,n)=>{e.walletConnectLogin=n.payload},setLedgerLogin:(e,n)=>{e.ledgerLogin=n.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0}},extraReducers:e=>{e.addCase(I,()=>Ot),e.addCase(sn,(n,o)=>{n.loginMethod=o.payload.loginMethod,je(Pe())})}}),{setLoginMethod:qs,setWalletConnectLogin:ks,setLedgerLogin:vs,setTokenLogin:Ss,setTokenLoginSignature:As,setWalletLogin:Ns,invalidateLoginSession:Wt}=Gt.actions,Ht=Gt.reducer});var Zt=b(()=>{"use strict";r()});var Yt=b(()=>{"use strict";r();Zt()});function co(e){return e[Math.floor(Math.random()*e.length)]}var $t=b(()=>{"use strict";r()});var Qt=b(()=>{"use strict";r();Qn()});var Xt=b(()=>{"use strict";r();Yt();$t();Qt()});var Kt,Jt,po,Qi,er,Gs,Ws,nr,so=b(()=>{"use strict";r();Kt=require("@reduxjs/toolkit"),Jt=w(require("lodash.omit"));Xt();po={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Qi={network:po,chainID:"-1"},er=(0,Kt.createSlice)({name:"appConfig",initialState:Qi,reducers:{initializeNetworkConfig:(e,n)=>{let o=co(n.payload.walletConnectBridgeAddresses),t=co(n.payload.walletConnectV2RelayAddresses),a=(0,Jt.default)(n.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=k(x(x({},e.network),a),{walletConnectBridgeAddress:o,walletConnectV2RelayAddress:t})},setChainID:(e,n)=>{e.chainID=n.payload}}}),{initializeNetworkConfig:Gs,setChainID:Ws}=er.actions,nr=er.reducer});var _o,or,tr,mn,mo,rr,ar,Js,ir,em,nm,om,tm,rm,am,im,cr,lo=b(()=>{"use strict";r();_o=require("@elrondnetwork/erdjs"),or=require("@reduxjs/toolkit"),tr=require("redux-persist");v();pn();Fe();re();mn={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:H},mo={address:"",websocketEvent:null,accounts:{"":mn},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},rr=(0,or.createSlice)({name:"accountInfoSlice",initialState:mo,reducers:{setAddress:(e,n)=>{let o=n.payload;e.address=o,e.publicKey=new _o.Address(o).hex()},setAccount:(e,n)=>{let o=e.address===n.payload.address;e.accounts={[e.address]:o?n.payload:mn},e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,n)=>{let{address:o}=e;e.accounts[o].nonce=n.payload},setAccountShard:(e,n)=>{e.shard=n.payload},setLedgerAccount:(e,n)=>{e.ledgerAccount=n.payload},updateLedgerAccount:(e,n)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=n.payload.index,e.ledgerAccount.address=n.payload.address)},setWalletConnectAccount:(e,n)=>{e.walletConnectAccount=n.payload},setIsAccountLoading:(e,n)=>{e.isAccountLoading=n.payload,e.accountLoadingError=null},setAccountLoadingError:(e,n)=>{e.accountLoadingError=n.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,n)=>{e.websocketEvent={timestamp:Date.now(),message:n.payload}}},extraReducers:e=>{e.addCase(I,()=>(Te.local.removeItem(de.loginExpiresAt),mo)),e.addCase(sn,(n,o)=>{let{address:t}=o.payload;n.address=t,n.publicKey=new _o.Address(t).hex()}),e.addCase(tr.REHYDRATE,(n,o)=>{var g;if(!((g=o.payload)!=null&&g.account))return;let{account:t}=o.payload,{address:a,shard:i,accounts:c,publicKey:_}=t;n.address=a,n.shard=i;let l=c&&a in c;n.accounts=l?c:mo.accounts,n.publicKey=_})}}),{setAccount:ar,setAddress:Js,setAccountNonce:ir,setAccountShard:em,setLedgerAccount:nm,updateLedgerAccount:om,setWalletConnectAccount:tm,setIsAccountLoading:rm,setAccountLoadingError:am,setWebsocketEvent:im}=rr.actions,cr=rr.reducer});function pr(e){return e!=null&&(ac(e)||sc(e))}function dn(e){return e!=null&&(ic(e)||mc(e))}function _n(e){return e!=null&&(cc(e)||dc(e))}function sr(e){return e!=null&&pc(e)}function ac(e){return e!=null&&Ki.includes(e)}function ic(e){return e!=null&&Ji.includes(e)}function cc(e){return e!=null&&ec.includes(e)}function pc(e){return e!=null&&nc.includes(e)}function sc(e){return e!=null&&oc.includes(e)}function mc(e){return e!=null&&tc.includes(e)}function dc(e){return e!=null&&rc.includes(e)}var Ki,Ji,ec,nc,oc,tc,rc,fo=b(()=>{"use strict";r();U();Ki=["sent"],Ji=["success"],ec=["fail","cancelled","timedOut"],nc=["timedOut"],oc=["pending"],tc=["success"],rc=["fail","invalid"]});var mr,dr,ze,_c,_r,fm,um,hm,bm,xm,ym,Tm,wm,qm,km,ln,gn=b(()=>{"use strict";r();mr=require("@reduxjs/toolkit"),dr=require("redux-persist");U();fo();re();ze={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},_c={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},_r=(0,mr.createSlice)({name:"transactionsSlice",initialState:ze,reducers:{moveTransactionsToSignedState:(e,n)=>{var l,g;let{sessionId:o,transactions:t,errorMessage:a,status:i,redirectRoute:c}=n.payload,_=((l=e.customTransactionInformationForSessionId)==null?void 0:l[o])||_c;e.signedTransactions[o]={transactions:t,status:i,errorMessage:a,redirectRoute:c,customTransactionInformation:_},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===o&&(e.transactionsToSign=ze.transactionsToSign)},clearSignedTransaction:(e,n)=>{e.signedTransactions[n.payload]&&delete e.signedTransactions[n.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,n)=>{e.signedTransactions=x(x({},e.signedTransactions),n.payload)},updateSignedTransactions:(e,n)=>{let{sessionId:o,status:t,errorMessage:a,transactions:i}=n.payload;e.signedTransactions[o]!=null&&(e.signedTransactions[o].status=t,a!=null&&(e.signedTransactions[o].errorMessage=a),i!=null&&(e.signedTransactions[o].transactions=i))},updateSignedTransactionStatus:(e,n)=>{var _,l,g,u,f,T;let{sessionId:o,status:t,errorMessage:a,transactionHash:i}=n.payload,c=(l=(_=e.signedTransactions)==null?void 0:_[o])==null?void 0:l.transactions;if(c!=null){e.signedTransactions[o].transactions=c.map(E=>E.hash===i?k(x({},E),{status:t,errorMessage:a}):E);let q=(u=(g=e.signedTransactions[o])==null?void 0:g.transactions)==null?void 0:u.every(E=>dn(E.status)),A=(T=(f=e.signedTransactions[o])==null?void 0:f.transactions)==null?void 0:T.every(E=>_n(E.status));q&&(e.signedTransactions[o].status="success"),A&&(e.signedTransactions[o].status="fail")}},setTransactionsToSign:(e,n)=>{e.transactionsToSign=n.payload;let{sessionId:o,customTransactionInformation:t}=n.payload;e.customTransactionInformationForSessionId[o]=t,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=ze.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=ze.signedTransactions},setSignTransactionsError:(e,n)=>{e.signTransactionsError=n.payload},setSignTransactionsCancelMessage:(e,n)=>{e.signTransactionsCancelMessage=n.payload}},extraReducers:e=>{e.addCase(I,()=>ze),e.addCase(dr.REHYDRATE,(n,o)=>{var c;if(n.signTransactionsCancelMessage=null,!((c=o.payload)!=null&&c.transactions))return;let{signedTransactions:t,customTransactionInformationForSessionId:a}=o.payload.transactions,i=Object.entries(t).reduce((_,[l,g])=>{let u=new Date(l),f=new Date;return f.setHours(f.getHours()+5),f-u>0||(_[l]=g),_},{});a!=null&&(n.customTransactionInformationForSessionId=a),t!=null&&(n.signedTransactions=i)})}}),{updateSignedTransactionStatus:fm,updateSignedTransactions:um,setTransactionsToSign:hm,clearAllTransactionsToSign:bm,clearAllSignedTransactions:xm,clearSignedTransaction:ym,clearTransactionToSign:Tm,setSignTransactionsError:wm,setSignTransactionsCancelMessage:qm,moveTransactionsToSignedState:km}=_r.actions,ln=_r.reducer});var lr,ho,bo,xo,lc,uo,gr,Nm,Em,Dm,fn,un=b(()=>{"use strict";r();lr=require("@reduxjs/toolkit");re();ho="Transaction failed",bo="Transaction successful",xo="Processing transaction",lc="Transaction submitted",uo={},gr=(0,lr.createSlice)({name:"transactionsInfo",initialState:uo,reducers:{setTransactionsDisplayInfo(e,n){let{sessionId:o,transactionsDisplayInfo:t}=n.payload;o!=null&&(e[o]={errorMessage:(t==null?void 0:t.errorMessage)||ho,successMessage:(t==null?void 0:t.successMessage)||bo,processingMessage:(t==null?void 0:t.processingMessage)||xo,submittedMessage:(t==null?void 0:t.submittedMessage)||lc,transactionDuration:t==null?void 0:t.transactionDuration})},clearTransactionsInfoForSessionId(e,n){n.payload!=null&&delete e[n.payload]},clearTransactionsInfo:()=>uo},extraReducers:e=>{e.addCase(I,()=>uo)}}),{clearTransactionsInfo:Nm,setTransactionsDisplayInfo:Em,clearTransactionsInfoForSessionId:Dm}=gr.actions,fn=gr.reducer});var ur,fr,hr,Cm,Rm,Fm,Pm,br,yo=b(()=>{"use strict";r();ur=require("@reduxjs/toolkit");re();fr={},hr=(0,ur.createSlice)({name:"modalsSlice",initialState:fr,reducers:{setTxSubmittedModal:(e,n)=>{e.txSubmittedModal=n.payload},setNotificationModal:(e,n)=>{e.notificationModal=n.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(I,()=>fr)}}),{setTxSubmittedModal:Cm,setNotificationModal:Rm,clearTxSubmittedModal:Fm,clearNotificationModal:Pm}=hr.actions,br=hr.reducer});var yr,Tr,xr,wr,Wm,Hm,Zm,Ym,$m,Qm,hn,bn=b(()=>{"use strict";r();yr=require("@reduxjs/toolkit"),Tr=require("redux-persist");Xn();ne();eo();re();xr={customToasts:[],transactionToasts:[],failTransactionToast:null},wr=(0,yr.createSlice)({name:"toastsSlice",initialState:xr,reducers:{addCustomToast:(e,n)=>{e.customToasts.push(k(x({},n.payload),{type:"custom",toastId:n.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,n)=>{e.customToasts=e.customToasts.filter(o=>o.toastId!==n.payload)},addTransactionToast:(e,n)=>{e.transactionToasts.push({type:"transaction",startTimestamp:cn(),toastId:n.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,n)=>{e.transactionToasts=e.transactionToasts.filter(o=>o.toastId!==n.payload)},addFailTransactionToast:(e,n)=>{e.failTransactionToast=k(x({},n.payload),{toastId:Nt})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(I,()=>xr),e.addCase(Tr.REHYDRATE,(n,o)=>{var a,i;let t=(i=(a=o.customToasts)==null?void 0:a.filter(c=>!("component"in c)))!=null?i:[];n.customToasts=t})}}),{addCustomToast:Wm,removeCustomToast:Hm,addTransactionToast:Zm,removeTransactionToast:Ym,addFailTransactionToast:$m,removeFailTransactionToast:Qm}=wr.actions,hn=wr.reducer});var we=b(()=>{"use strict";r();io();so();lo();gn();un();yo();bn()});var To=b(()=>{"use strict";r()});var Sr,vr,Ar,ud,hd,bd,xd,yd,Td,Nr,Er=b(()=>{"use strict";r();Sr=require("@reduxjs/toolkit");re();vr={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Ar=(0,Sr.createSlice)({name:"dappModalsSlice",initialState:vr,reducers:{setDappModalVisibility:(e,n)=>{e.visible=n.payload},setDappModalHeaderVisibility:(e,n)=>{e.modal.showHeader=n.payload},setDappModalFooterVisibility:(e,n)=>{e.modal.showFooter=n.payload},setDappModalHeaderText:(e,n)=>{e.modal.headerText=n.payload},setDappModalFooterText:(e,n)=>{e.modal.footerText=n.payload},setDappModalConfig:(e,n)=>{e.modal=x({},n.payload)}},extraReducers:e=>{e.addCase(I,()=>vr)}}),{setDappModalVisibility:ud,setDappModalHeaderVisibility:hd,setDappModalFooterVisibility:bd,setDappModalHeaderText:xd,setDappModalFooterText:yd,setDappModalConfig:Td}=Ar.actions,Nr=Ar.reducer});var Dr,hc,bc,qe,yn=b(()=>{"use strict";r();Dr=require("@reduxjs/toolkit");To();lo();Er();io();yo();so();bn();un();gn();hc={["account"]:cr,["networkConfig"]:nr,["loginInfo"]:Ht,["modals"]:br,["dappModal"]:Nr,["toasts"]:hn,["transactions"]:ln,["transactionsInfo"]:fn},bc=(e={})=>(0,Dr.combineReducers)(x(x({},hc),e)),qe=bc});var Ir={};fe(Ir,{default:()=>vc});function wo(e,n=[]){return{key:e,version:1,storage:Lr.default,blacklist:n}}var _e,Mr,Lr,xc,yc,Tc,wc,qc,kc,vc,Cr=b(()=>{"use strict";r();_e=require("redux-persist"),Mr=w(require("redux-persist/lib/storage")),Lr=w(require("redux-persist/lib/storage/session"));yn();we();bn();un();gn();To();xc={2:e=>k(x({},e),{networkConfig:po})};yc=wo("dapp-core-transactionsInfo"),Tc=wo("dapp-core-transactions",["transactionsToSign"]),wc=wo("dapp-core-toasts"),qc={key:"dapp-core-store",version:2,storage:Mr.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,_e.createMigrate)(xc,{debug:!1})},kc={["toasts"]:(0,_e.persistReducer)(wc,hn),["transactions"]:(0,_e.persistReducer)(Tc,ln),["transactionsInfo"]:(0,_e.persistReducer)(yc,fn)},vc=(0,_e.persistReducer)(qc,qe(kc))});var Rr={};fe(Rr,{default:()=>Sc});var Sc,Fr=b(()=>{"use strict";r();yn();Sc=qe()});var Pr={};fe(Pr,{default:()=>Nc});var F,Ac,Nc,jr=b(()=>{"use strict";r();F=require("redux-persist"),Ac=[F.FLUSH,F.REHYDRATE,F.PAUSE,F.PERSIST,F.PURGE,F.REGISTER],Nc=Ac});var Br={};fe(Br,{default:()=>Ur});function Ur(e){return(0,zr.persistStore)(e)}var zr,Or=b(()=>{"use strict";r();zr=require("redux-persist")});r();var He=w(require("react")),Ze=require("@testing-library/react");r();r();var B=w(require("react")),Ka=require("@fortawesome/free-solid-svg-icons"),Ja=require("@fortawesome/react-fontawesome"),Bo=w(require("classnames"));r();var Le=(t=>(t.NonFungibleESDT="NonFungibleESDT",t.SemiFungibleESDT="SemiFungibleESDT",t.MetaESDT="MetaESDT",t))(Le||{});r();r();var te=w(require("react")),It=w(require("classnames"));r();var Ui=`.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;