@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 63.6 kB
JavaScript
"use strict";var Ji=Object.create;var Ae=Object.defineProperty,Qi=Object.defineProperties,ea=Object.getOwnPropertyDescriptor,ta=Object.getOwnPropertyDescriptors,ra=Object.getOwnPropertyNames,Ve=Object.getOwnPropertySymbols,na=Object.getPrototypeOf,Lt=Object.prototype.hasOwnProperty,jr=Object.prototype.propertyIsEnumerable;var qr=(e,t,r)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w=(e,t)=>{for(var r in t||(t={}))Lt.call(t,r)&&qr(e,r,t[r]);if(Ve)for(var r of Ve(t))jr.call(t,r)&&qr(e,r,t[r]);return e},b=(e,t)=>Qi(e,ta(t));var zr=(e,t)=>{var r={};for(var n in e)Lt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ve)for(var n of Ve(e))t.indexOf(n)<0&&jr.call(e,n)&&(r[n]=e[n]);return r};var x=(e,t)=>()=>(e&&(t=e(e=0)),t);var We=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),se=(e,t)=>{for(var r in t)Ae(e,r,{get:t[r],enumerable:!0})},Kr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ra(t))!Lt.call(e,i)&&i!==r&&Ae(e,i,{get:()=>t[i],enumerable:!(n=ea(t,i))||n.enumerable});return e};var A=(e,t,r)=>(r=e!=null?Ji(na(e)):{},Kr(t||!e||!e.__esModule?Ae(r,"default",{value:e,enumerable:!0}):r,e)),Ie=e=>Kr(Ae({},"__esModule",{value:!0}),e);var L=(e,t,r)=>new Promise((n,i)=>{var a=d=>{try{m(r.next(d))}catch(g){i(g)}},p=d=>{try{m(r.throw(d))}catch(g){i(g)}},m=d=>d.done?n(d.value):Promise.resolve(d.value).then(a,p);m((r=r.apply(e,t)).next())});var Xr=We(He=>{"use strict";o();He.byteLength=ia;He.toByteArray=sa;He.fromByteArray=pa;var G=[],W=[],oa=typeof Uint8Array!="undefined"?Uint8Array:Array,Nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ce=0,Yr=Nt.length;ce<Yr;++ce)G[ce]=Nt[ce],W[Nt.charCodeAt(ce)]=ce;var ce,Yr;W["-".charCodeAt(0)]=62;W["_".charCodeAt(0)]=63;function Zr(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function ia(e){var t=Zr(e),r=t[0],n=t[1];return(r+n)*3/4-n}function aa(e,t,r){return(t+r)*3/4-r}function sa(e){var t,r=Zr(e),n=r[0],i=r[1],a=new oa(aa(e,n,i)),p=0,m=i>0?n-4:n,d;for(d=0;d<m;d+=4)t=W[e.charCodeAt(d)]<<18|W[e.charCodeAt(d+1)]<<12|W[e.charCodeAt(d+2)]<<6|W[e.charCodeAt(d+3)],a[p++]=t>>16&255,a[p++]=t>>8&255,a[p++]=t&255;return i===2&&(t=W[e.charCodeAt(d)]<<2|W[e.charCodeAt(d+1)]>>4,a[p++]=t&255),i===1&&(t=W[e.charCodeAt(d)]<<10|W[e.charCodeAt(d+1)]<<4|W[e.charCodeAt(d+2)]>>2,a[p++]=t>>8&255,a[p++]=t&255),a}function ca(e){return G[e>>18&63]+G[e>>12&63]+G[e>>6&63]+G[e&63]}function la(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(ca(n));return i.join("")}function pa(e){for(var t,r=e.length,n=r%3,i=[],a=16383,p=0,m=r-n;p<m;p+=a)i.push(la(e,p,p+a>m?m:p+a));return n===1?(t=e[r-1],i.push(G[t>>2]+G[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(G[t>>10]+G[t>>4&63]+G[t<<2&63]+"=")),i.join("")}});var Jr=We(Pt=>{o();Pt.read=function(e,t,r,n,i){var a,p,m=i*8-n-1,d=(1<<m)-1,g=d>>1,T=-7,f=r?i-1:0,S=r?-1:1,y=e[t+f];for(f+=S,a=y&(1<<-T)-1,y>>=-T,T+=m;T>0;a=a*256+e[t+f],f+=S,T-=8);for(p=a&(1<<-T)-1,a>>=-T,T+=n;T>0;p=p*256+e[t+f],f+=S,T-=8);if(a===0)a=1-g;else{if(a===d)return p?NaN:(y?-1:1)*(1/0);p=p+Math.pow(2,n),a=a-g}return(y?-1:1)*p*Math.pow(2,a-n)};Pt.write=function(e,t,r,n,i,a){var p,m,d,g=a*8-i-1,T=(1<<g)-1,f=T>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,v=n?1:-1,P=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,p=T):(p=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-p))<1&&(p--,d*=2),p+f>=1?t+=S/d:t+=S*Math.pow(2,1-f),t*d>=2&&(p++,d/=2),p+f>=T?(m=0,p=T):p+f>=1?(m=(t*d-1)*Math.pow(2,i),p=p+f):(m=t*Math.pow(2,f-1)*Math.pow(2,i),p=0));i>=8;e[r+y]=m&255,y+=v,m/=256,i-=8);for(p=p<<i|m,g+=i;g>0;e[r+y]=p&255,y+=v,p/=256,g-=8);e[r+y-v]|=P*128}});var dn=We(Te=>{"use strict";o();var Ct=Xr(),fe=Jr(),Qr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Te.Buffer=u;Te.SlowBuffer=Ta;Te.INSPECT_MAX_BYTES=50;var Ge=2147483647;Te.kMaxLength=Ge;u.TYPED_ARRAY_SUPPORT=ua();!u.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 ua(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(r){return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function Z(e){if(e>Ge)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _t(e)}return rn(e,t,r)}u.poolSize=8192;function rn(e,t,r){if(typeof e=="string")return ma(e,t);if(ArrayBuffer.isView(e))return ga(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return Ft(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return u.from(n,t,r);var i=fa(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}u.from=function(e,t,r){return rn(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function nn(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 da(e,t,r){return nn(e),e<=0?Z(e):t!==void 0?typeof r=="string"?Z(e).fill(t,r):Z(e).fill(t):Z(e)}u.alloc=function(e,t,r){return da(e,t,r)};function _t(e){return nn(e),Z(e<0?0:Ot(e)|0)}u.allocUnsafe=function(e){return _t(e)};u.allocUnsafeSlow=function(e){return _t(e)};function ma(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=on(e,t)|0,n=Z(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Rt(e){for(var t=e.length<0?0:Ot(e.length)|0,r=Z(t),n=0;n<t;n+=1)r[n]=e[n]&255;return r}function ga(e){if(q(e,Uint8Array)){var t=new Uint8Array(e);return Ft(t.buffer,t.byteOffset,t.byteLength)}return Rt(e)}function Ft(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function fa(e){if(u.isBuffer(e)){var t=Ot(e.length)|0,r=Z(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||Bt(e.length)?Z(0):Rt(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Rt(e.data)}function Ot(e){if(e>=Ge)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ge.toString(16)+" bytes");return e|0}function Ta(e){return+e!=e&&(e=0),u.alloc(+e)}u.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==u.prototype};u.compare=function(t,r){if(q(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),q(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(t)||!u.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var n=t.length,i=r.length,a=0,p=Math.min(n,i);a<p;++a)if(t[a]!==r[a]){n=t[a],i=r[a];break}return n<i?-1:i<n?1:0};u.isEncoding=function(t){switch(String(t).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}};u.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return u.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=u.allocUnsafe(r),a=0;for(n=0;n<t.length;++n){var p=t[n];if(q(p,Uint8Array))a+p.length>i.length?u.from(p).copy(i,a):Uint8Array.prototype.set.call(i,p,a);else if(u.isBuffer(p))p.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=p.length}return i};function on(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Mt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return un(e).length;default:if(i)return n?-1:Mt(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=on;function ya(e,t,r){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return ka(this,t,r);case"utf8":case"utf-8":return sn(this,t,r);case"ascii":return Ia(this,t,r);case"latin1":case"binary":return Ea(this,t,r);case"base64":return va(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Da(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function le(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}u.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)le(this,r,r+1);return this};u.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)le(this,r,r+3),le(this,r+1,r+2);return this};u.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)le(this,r,r+7),le(this,r+1,r+6),le(this,r+2,r+5),le(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?sn(this,0,t):ya.apply(this,arguments)};u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:u.compare(this,t)===0};u.prototype.inspect=function(){var t="",r=Te.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Qr&&(u.prototype[Qr]=u.prototype.inspect);u.prototype.compare=function(t,r,n,i,a){if(q(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),r<0||n>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,a>>>=0,this===t)return 0;for(var p=a-i,m=n-r,d=Math.min(p,m),g=this.slice(i,a),T=t.slice(r,n),f=0;f<d;++f)if(g[f]!==T[f]){p=g[f],m=T[f];break}return p<m?-1:m<p?1:0};function an(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Bt(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=u.from(t,n)),u.isBuffer(t))return t.length===0?-1:en(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):en(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function en(e,t,r,n,i){var a=1,p=e.length,m=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,p/=2,m/=2,r/=2}function d(y,v){return a===1?y[v]:y.readUInt16BE(v*a)}var g;if(i){var T=-1;for(g=r;g<p;g++)if(d(e,g)===d(t,T===-1?0:g-T)){if(T===-1&&(T=g),g-T+1===m)return T*a}else T!==-1&&(g-=g-T),T=-1}else for(r+m>p&&(r=p-m),g=r;g>=0;g--){for(var f=!0,S=0;S<m;S++)if(d(e,g+S)!==d(t,S)){f=!1;break}if(f)return g}return-1}u.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};u.prototype.indexOf=function(t,r,n){return an(this,t,r,n,!0)};u.prototype.lastIndexOf=function(t,r,n){return an(this,t,r,n,!1)};function ha(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var a=t.length;n>a/2&&(n=a/2);for(var p=0;p<n;++p){var m=parseInt(t.substr(p*2,2),16);if(Bt(m))return p;e[r+p]=m}return p}function xa(e,t,r,n){return qe(Mt(t,e.length-r),e,r,n)}function Sa(e,t,r,n){return qe(Pa(t),e,r,n)}function wa(e,t,r,n){return qe(un(t),e,r,n)}function ba(e,t,r,n){return qe(Ca(t,e.length-r),e,r,n)}u.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-r;if((n===void 0||n>a)&&(n=a),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var p=!1;;)switch(i){case"hex":return ha(this,t,r,n);case"utf8":case"utf-8":return xa(this,t,r,n);case"ascii":case"latin1":case"binary":return Sa(this,t,r,n);case"base64":return wa(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ba(this,t,r,n);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function va(e,t,r){return t===0&&r===e.length?Ct.fromByteArray(e):Ct.fromByteArray(e.slice(t,r))}function sn(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a=e[i],p=null,m=a>239?4:a>223?3:a>191?2:1;if(i+m<=r){var d,g,T,f;switch(m){case 1:a<128&&(p=a);break;case 2:d=e[i+1],(d&192)===128&&(f=(a&31)<<6|d&63,f>127&&(p=f));break;case 3:d=e[i+1],g=e[i+2],(d&192)===128&&(g&192)===128&&(f=(a&15)<<12|(d&63)<<6|g&63,f>2047&&(f<55296||f>57343)&&(p=f));break;case 4:d=e[i+1],g=e[i+2],T=e[i+3],(d&192)===128&&(g&192)===128&&(T&192)===128&&(f=(a&15)<<18|(d&63)<<12|(g&63)<<6|T&63,f>65535&&f<1114112&&(p=f))}}p===null?(p=65533,m=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),i+=m}return Aa(n)}var tn=4096;function Aa(e){var t=e.length;if(t<=tn)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=tn));return r}function Ia(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function Ea(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function ka(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=Ra[e[a]];return i}function Da(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}u.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);var i=this.subarray(t,r);return Object.setPrototypeOf(i,u.prototype),i};function N(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||N(t,r,this.length);for(var i=this[t],a=1,p=0;++p<r&&(a*=256);)i+=this[t+p]*a;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||N(t,r,this.length);for(var i=this[t+--r],a=1;r>0&&(a*=256);)i+=this[t+--r]*a;return i};u.prototype.readUint8=u.prototype.readUInt8=function(t,r){return t=t>>>0,r||N(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||N(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||N(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||N(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||N(t,r,this.length);for(var i=this[t],a=1,p=0;++p<r&&(a*=256);)i+=this[t+p]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||N(t,r,this.length);for(var i=r,a=1,p=this[t+--i];i>0&&(a*=256);)p+=this[t+--i]*a;return a*=128,p>=a&&(p-=Math.pow(2,8*r)),p};u.prototype.readInt8=function(t,r){return t=t>>>0,r||N(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||N(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(t,r){t=t>>>0,r||N(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(t,r){return t=t>>>0,r||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};u.prototype.readInt32BE=function(t,r){return t=t>>>0,r||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};u.prototype.readFloatLE=function(t,r){return t=t>>>0,r||N(t,4,this.length),fe.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||N(t,4,this.length),fe.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||N(t,8,this.length),fe.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||N(t,8,this.length),fe.read(this,t,!1,52,8)};function _(e,t,r,n,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var a=Math.pow(2,8*n)-1;_(this,t,r,n,a,0)}var p=1,m=0;for(this[r]=t&255;++m<n&&(p*=256);)this[r+m]=t/p&255;return r+n};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var a=Math.pow(2,8*n)-1;_(this,t,r,n,a,0)}var p=n-1,m=1;for(this[r+p]=t&255;--p>=0&&(m*=256);)this[r+p]=t/m&255;return r+n};u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||_(this,t,r,1,255,0),this[r]=t&255,r+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||_(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||_(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||_(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||_(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};u.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var a=Math.pow(2,8*n-1);_(this,t,r,n,a-1,-a)}var p=0,m=1,d=0;for(this[r]=t&255;++p<n&&(m*=256);)t<0&&d===0&&this[r+p-1]!==0&&(d=1),this[r+p]=(t/m>>0)-d&255;return r+n};u.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var a=Math.pow(2,8*n-1);_(this,t,r,n,a-1,-a)}var p=n-1,m=1,d=0;for(this[r+p]=t&255;--p>=0&&(m*=256);)t<0&&d===0&&this[r+p+1]!==0&&(d=1),this[r+p]=(t/m>>0)-d&255;return r+n};u.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||_(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};u.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||_(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||_(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||_(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};u.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||_(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function cn(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ln(e,t,r,n,i){return t=+t,r=r>>>0,i||cn(e,t,r,4,34028234663852886e22,-34028234663852886e22),fe.write(e,t,r,n,23,4),r+4}u.prototype.writeFloatLE=function(t,r,n){return ln(this,t,r,!0,n)};u.prototype.writeFloatBE=function(t,r,n){return ln(this,t,r,!1,n)};function pn(e,t,r,n,i){return t=+t,r=r>>>0,i||cn(e,t,r,8,17976931348623157e292,-17976931348623157e292),fe.write(e,t,r,n,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,n){return pn(this,t,r,!0,n)};u.prototype.writeDoubleBE=function(t,r,n){return pn(this,t,r,!1,n)};u.prototype.copy=function(t,r,n,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var a=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),a};u.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var a=t.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var p;if(typeof t=="number")for(p=r;p<n;++p)this[p]=t;else{var m=u.isBuffer(t)?t:u.from(t,i),d=m.length;if(d===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(p=0;p<n-r;++p)this[p+r]=m[p%d]}return this};var La=/[^+/0-9A-Za-z-_]/g;function Na(e){if(e=e.split("=")[0],e=e.trim().replace(La,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Mt(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],p=0;p<n;++p){if(r=e.charCodeAt(p),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(p+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function Pa(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Ca(e,t){for(var r,n,i,a=[],p=0;p<e.length&&!((t-=2)<0);++p)r=e.charCodeAt(p),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function un(e){return Ct.toByteArray(Na(e))}function qe(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function q(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Bt(e){return e!==e}var Ra=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=r*16,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()});var yn=We((pc,Tn)=>{o();var E=Tn.exports={},j,z;function Ut(){throw new Error("setTimeout has not been defined")}function $t(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?j=setTimeout:j=Ut}catch(e){j=Ut}try{typeof clearTimeout=="function"?z=clearTimeout:z=$t}catch(e){z=$t}})();function mn(e){if(j===setTimeout)return setTimeout(e,0);if((j===Ut||!j)&&setTimeout)return j=setTimeout,setTimeout(e,0);try{return j(e,0)}catch(t){try{return j.call(null,e,0)}catch(r){return j.call(this,e,0)}}}function Fa(e){if(z===clearTimeout)return clearTimeout(e);if((z===$t||!z)&&clearTimeout)return z=clearTimeout,clearTimeout(e);try{return z(e)}catch(t){try{return z.call(null,e)}catch(r){return z.call(this,e)}}}var X=[],ye=!1,pe,je=-1;function Ma(){!ye||!pe||(ye=!1,pe.length?X=pe.concat(X):je=-1,X.length&&gn())}function gn(){if(!ye){var e=mn(Ma);ye=!0;for(var t=X.length;t;){for(pe=X,X=[];++je<t;)pe&&pe[je].run();je=-1,t=X.length}pe=null,ye=!1,Fa(e)}}E.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];X.push(new fn(e,t)),X.length===1&&!ye&&mn(gn)};function fn(e,t){this.fun=e,this.array=t}fn.prototype.run=function(){this.fun.apply(null,this.array)};E.title="browser";E.browser=!0;E.env={};E.argv=[];E.version="";E.versions={};function J(){}E.on=J;E.addListener=J;E.once=J;E.off=J;E.removeListener=J;E.removeAllListeners=J;E.emit=J;E.prependListener=J;E.prependOnceListener=J;E.listeners=function(e){return[]};E.binding=function(e){throw new Error("process.binding is not supported")};E.cwd=function(){return"/"};E.chdir=function(e){throw new Error("process.chdir is not supported")};E.umask=function(){return 0}});var s,c,uc,o=x(()=>{s=A(dn()),c=A(yn()),uc=function(e){function t(){var n=this||self;return delete e.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var r=__magic__;return r}(Object)});var ze,Vt=x(()=>{"use strict";o();ze=()=>Date.now()/1e3});var hn=x(()=>{"use strict";o()});var xn=x(()=>{"use strict";o()});var Sn=x(()=>{"use strict";o();Vt();hn();xn()});var Ht={};se(Ht,{getItem:()=>Oa,localStorageKeys:()=>ue,removeItem:()=>Ba,setItem:()=>_a});var ue,Wt,_a,Oa,Ba,Ee=x(()=>{"use strict";o();Sn();ue={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Wt=typeof localStorage!="undefined",_a=({key:e,data:t,expires:r})=>{!Wt||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Oa=e=>{if(!Wt)return;let t=localStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:ze()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},Ba=e=>{!Wt||localStorage.removeItem(String(e))}});var Gt={};se(Gt,{clear:()=>An,getItem:()=>bn,removeItem:()=>vn,setItem:()=>wn,storage:()=>Ua});var wn,bn,vn,An,Ua,In=x(()=>{"use strict";o();wn=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},bn=e=>{let t=sessionStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Date.now()>=r.expires?(sessionStorage.removeItem(String(e)),null):r.data},vn=e=>sessionStorage.removeItem(String(e)),An=()=>sessionStorage.clear(),Ua={setItem:wn,getItem:bn,removeItem:vn,clear:An}});var he,Ke=x(()=>{"use strict";o();Ee();In();he={session:Gt,local:Ht}});function ke(){return new Date().setHours(new Date().getHours()+24)}function De(e){he.local.setItem({key:ue.loginExpiresAt,data:e,expires:e})}var qt=x(()=>{"use strict";o();Ke();Ee()});var U=x(()=>{"use strict";o()});var En,jt=x(()=>{"use strict";o();En="Transaction canceled"});var kn=x(()=>{"use strict";o()});var M=x(()=>{"use strict";o()});var Dn=x(()=>{"use strict";o()});var Ln=x(()=>{"use strict";o()});var Nn=x(()=>{"use strict";o()});var Pn=x(()=>{"use strict";o()});var Q=x(()=>{"use strict";o();kn();M();U();Dn();Ln();Nn();Pn()});var zt,Cn,Uc,Rn,$c,Fn,Vc,Wc,Hc,Mn=x(()=>{"use strict";o();Q();zt={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:Cn,egldLabel:Uc}=zt["devnet"],{chainId:Rn,egldLabel:$c}=zt["testnet"],{chainId:Fn,egldLabel:Vc}=zt["mainnet"],Wc={["devnet"]:Cn,["testnet"]:Rn,["mainnet"]:Fn},Hc={[Cn]:"devnet",[Rn]:"testnet",[Fn]:"mainnet"}});var Kt,Yt=x(()=>{"use strict";o();Kt={36864:{code:"codeSuccess",message:"Success"},27013:{code:"ERR_USER_DENIED",message:"Rejected by user"},27904:{code:"ERR_UNKNOWN_INSTRUCTION",message:"Unknown instruction"},28160:{code:"ERR_WRONG_CLA",message:"Wrong CLA"},28161:{code:"ERR_INVALID_ARGUMENTS",message:"Invalid arguments"},28162:{code:"ERR_INVALID_MESSAGE",message:"Invalid message"},28163:{code:"ERR_INVALID_P1",message:"Invalid P1"},28164:{code:"ERR_MESSAGE_TOO_LONG",message:"Message too long"},28165:{code:"ERR_RECEIVER_TOO_LONG",message:"Receiver too long"},28166:{code:"ERR_AMOUNT_TOO_LONG",message:"Amount too long"},28167:{code:"ERR_CONTRACT_DATA_DISABLED",message:"Contract data disabled in app options"},28168:{code:"ERR_MESSAGE_INCOMPLETE",message:"Message incomplete"},28176:{code:"ERR_SIGNATURE_FAILED",message:"Signature failed"},28169:{code:"ERR_WRONG_TX_VERSION",message:"Wrong TX version"},28170:{code:"ERR_NONCE_TOO_LONG",message:"Nonce too long"},28171:{code:"ERR_INVALID_AMOUNT",message:"Invalid amount"},28172:{code:"ERR_INVALID_FEE",message:"Invalid fee"},28173:{code:"ERR_PRETTY_FAILED",message:"Pretty failed"},28174:{code:"ERR_DATA_TOO_LONG",message:"Data too long"},28175:{code:"ERR_WRONG_TX_OPTIONS",message:"Invalid transaction options"},28177:{code:"ERR_SIGN_TX_DEPRECATED",message:"Regular transaction signing is deprecated in this version. Use hash signing."}}});var _n=x(()=>{"use strict";o()});var Ye,Zt=x(()=>{"use strict";o();Ye="transaction-status-toast-id"});var Xt,Jt,On,Bn,Qt,Ze,Un,xe,I=x(()=>{"use strict";o();jt();Mn();Yt();_n();Zt();Xt=5e4,Jt=1e9,On=1,Bn="/dapp/init",Qt="signSession",Ze="logout",Un="login",xe="0"});var er,O,Xe,re=x(()=>{"use strict";o();er=require("@reduxjs/toolkit");I();O=(0,er.createAction)(Ze),Xe=(0,er.createAction)(Un,e=>({payload:e}))});var Vn,$n,Wn,sl,cl,ll,pl,ul,dl,Hn,Gn,rr=x(()=>{"use strict";o();Vn=require("@reduxjs/toolkit");qt();U();re();$n={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Wn=(0,Vn.createSlice)({name:"loginInfoSlice",initialState:$n,reducers:{setLoginMethod:(e,t)=>{e.loginMethod=t.payload},setTokenLogin:(e,t)=>{e.tokenLogin=t.payload},setTokenLoginSignature:(e,t)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=t.payload)},setWalletLogin:(e,t)=>{e.walletLogin=t.payload},setWalletConnectLogin:(e,t)=>{e.walletConnectLogin=t.payload},setLedgerLogin:(e,t)=>{e.ledgerLogin=t.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0}},extraReducers:e=>{e.addCase(O,()=>$n),e.addCase(Xe,(t,r)=>{t.loginMethod=r.payload.loginMethod,De(ke())})}}),{setLoginMethod:sl,setWalletConnectLogin:cl,setLedgerLogin:ll,setTokenLogin:pl,setTokenLoginSignature:ul,setWalletLogin:dl,invalidateLoginSession:Hn}=Wn.actions,Gn=Wn.reducer});var $a,nr,or=x(()=>{"use strict";o();$a=!1,nr=(e,t=0)=>{$a||setTimeout(()=>{window.location.href=e},t)}});var qn=x(()=>{"use strict";o();or()});function ir(e){return e[Math.floor(Math.random()*e.length)]}var jn=x(()=>{"use strict";o()});function Kn(e){let t=null;if((e==null?void 0:e.statusCode)in Kt){let r=e==null?void 0:e.statusCode,{message:n}=Kt[r];t=Ha.includes(r)?zn:n}return{errorMessage:t,defaultErrorMessage:zn}}var zn,Va,Wa,Ha,ar=x(()=>{"use strict";o();Yt();zn="Check if Elrond app is open on Ledger",Va=28161,Wa=28160,Ha=[Va,Wa]});var Yn=x(()=>{"use strict";o();qn();jn();ar()});var Zn,Xn,sr,Ga,Jn,El,kl,Qn,cr=x(()=>{"use strict";o();Zn=require("@reduxjs/toolkit"),Xn=A(require("lodash.omit"));Yn();sr={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Ga={network:sr,chainID:"-1"},Jn=(0,Zn.createSlice)({name:"appConfig",initialState:Ga,reducers:{initializeNetworkConfig:(e,t)=>{let r=ir(t.payload.walletConnectBridgeAddresses),n=ir(t.payload.walletConnectV2RelayAddresses),i=(0,Xn.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=b(w(w({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:n})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:El,setChainID:kl}=Jn.actions,Qn=Jn.reducer});var pr,eo,to,Je,lr,ro,no,Ml,oo,_l,Ol,Bl,Ul,$l,Vl,Wl,io,ur=x(()=>{"use strict";o();pr=require("@elrondnetwork/erdjs"),eo=require("@reduxjs/toolkit"),to=require("redux-persist");I();Ke();Ee();re();Je={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:xe},lr={address:"",websocketEvent:null,accounts:{"":Je},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},ro=(0,eo.createSlice)({name:"accountInfoSlice",initialState:lr,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new pr.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Je},e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,t)=>{let{address:r}=e;e.accounts[r].nonce=t.payload},setAccountShard:(e,t)=>{e.shard=t.payload},setLedgerAccount:(e,t)=>{e.ledgerAccount=t.payload},updateLedgerAccount:(e,t)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=t.payload.index,e.ledgerAccount.address=t.payload.address)},setWalletConnectAccount:(e,t)=>{e.walletConnectAccount=t.payload},setIsAccountLoading:(e,t)=>{e.isAccountLoading=t.payload,e.accountLoadingError=null},setAccountLoadingError:(e,t)=>{e.accountLoadingError=t.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,t)=>{e.websocketEvent={timestamp:Date.now(),message:t.payload}}},extraReducers:e=>{e.addCase(O,()=>(he.local.removeItem(ue.loginExpiresAt),lr)),e.addCase(Xe,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new pr.Address(n).hex()}),e.addCase(to.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:i,shard:a,accounts:p,publicKey:m}=n;t.address=i,t.shard=a;let d=p&&i in p;t.accounts=d?p:lr.accounts,t.publicKey=m})}}),{setAccount:no,setAddress:Ml,setAccountNonce:oo,setAccountShard:_l,setLedgerAccount:Ol,updateLedgerAccount:Bl,setWalletConnectAccount:Ul,setIsAccountLoading:$l,setAccountLoadingError:Vl,setWebsocketEvent:Wl}=ro.actions,io=ro.reducer});function ao(e){return e!=null&&(Ja(e)||rs(e))}function Qe(e){return e!=null&&(Qa(e)||ns(e))}function et(e){return e!=null&&(es(e)||os(e))}function so(e){return e!=null&&ts(e)}function Ja(e){return e!=null&&qa.includes(e)}function Qa(e){return e!=null&&ja.includes(e)}function es(e){return e!=null&&za.includes(e)}function ts(e){return e!=null&&Ka.includes(e)}function rs(e){return e!=null&&Ya.includes(e)}function ns(e){return e!=null&&Za.includes(e)}function os(e){return e!=null&&Xa.includes(e)}var qa,ja,za,Ka,Ya,Za,Xa,gr=x(()=>{"use strict";o();U();qa=["sent"],ja=["success"],za=["fail","cancelled","timedOut"],Ka=["timedOut"],Ya=["pending"],Za=["success"],Xa=["fail","invalid"]});var co,lo,Le,is,po,Xl,Jl,Ql,tt,ep,tp,rp,uo,rt,Ne,nt,ot=x(()=>{"use strict";o();co=require("@reduxjs/toolkit"),lo=require("redux-persist");U();gr();re();Le={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},is={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},po=(0,co.createSlice)({name:"transactionsSlice",initialState:Le,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,g;let{sessionId:r,transactions:n,errorMessage:i,status:a,redirectRoute:p}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||is;e.signedTransactions[r]={transactions:n,status:a,errorMessage:i,redirectRoute:p,customTransactionInformation:m},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===r&&(e.transactionsToSign=Le.transactionsToSign)},clearSignedTransaction:(e,t)=>{e.signedTransactions[t.payload]&&delete e.signedTransactions[t.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,t)=>{e.signedTransactions=w(w({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:n,errorMessage:i,transactions:a}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=n,i!=null&&(e.signedTransactions[r].errorMessage=i),a!=null&&(e.signedTransactions[r].transactions=a))},updateSignedTransactionStatus:(e,t)=>{var m,d,g,T,f,S;let{sessionId:r,status:n,errorMessage:i,transactionHash:a}=t.payload,p=(d=(m=e.signedTransactions)==null?void 0:m[r])==null?void 0:d.transactions;if(p!=null){e.signedTransactions[r].transactions=p.map(P=>P.hash===a?b(w({},P),{status:n,errorMessage:i}):P);let y=(T=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:T.every(P=>Qe(P.status)),v=(S=(f=e.signedTransactions[r])==null?void 0:f.transactions)==null?void 0:S.every(P=>et(P.status));y&&(e.signedTransactions[r].status="success"),v&&(e.signedTransactions[r].status="fail")}},setTransactionsToSign:(e,t)=>{e.transactionsToSign=t.payload;let{sessionId:r,customTransactionInformation:n}=t.payload;e.customTransactionInformationForSessionId[r]=n,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=Le.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Le.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(O,()=>Le),e.addCase(lo.REHYDRATE,(t,r)=>{var p;if(t.signTransactionsCancelMessage=null,!((p=r.payload)!=null&&p.transactions))return;let{signedTransactions:n,customTransactionInformationForSessionId:i}=r.payload.transactions,a=Object.entries(n).reduce((m,[d,g])=>{let T=new Date(d),f=new Date;return f.setHours(f.getHours()+5),f-T>0||(m[d]=g),m},{});i!=null&&(t.customTransactionInformationForSessionId=i),n!=null&&(t.signedTransactions=a)})}}),{updateSignedTransactionStatus:Xl,updateSignedTransactions:Jl,setTransactionsToSign:Ql,clearAllTransactionsToSign:tt,clearAllSignedTransactions:ep,clearSignedTransaction:tp,clearTransactionToSign:rp,setSignTransactionsError:uo,setSignTransactionsCancelMessage:rt,moveTransactionsToSignedState:Ne}=po.actions,nt=po.reducer});var mo,Tr,yr,hr,as,fr,go,ap,sp,it,at,st=x(()=>{"use strict";o();mo=require("@reduxjs/toolkit");re();Tr="Transaction failed",yr="Transaction successful",hr="Processing transaction",as="Transaction submitted",fr={},go=(0,mo.createSlice)({name:"transactionsInfo",initialState:fr,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||Tr,successMessage:(n==null?void 0:n.successMessage)||yr,processingMessage:(n==null?void 0:n.processingMessage)||hr,submittedMessage:(n==null?void 0:n.submittedMessage)||as,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>fr},extraReducers:e=>{e.addCase(O,()=>fr)}}),{clearTransactionsInfo:ap,setTransactionsDisplayInfo:sp,clearTransactionsInfoForSessionId:it}=go.actions,at=go.reducer});var To,fo,yo,up,dp,mp,gp,ho,xr=x(()=>{"use strict";o();To=require("@reduxjs/toolkit");re();fo={},yo=(0,To.createSlice)({name:"modalsSlice",initialState:fo,reducers:{setTxSubmittedModal:(e,t)=>{e.txSubmittedModal=t.payload},setNotificationModal:(e,t)=>{e.notificationModal=t.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(O,()=>fo)}}),{setTxSubmittedModal:up,setNotificationModal:dp,clearTxSubmittedModal:mp,clearNotificationModal:gp}=yo.actions,ho=yo.reducer});var So,wo,xo,bo,bp,vo,vp,Ap,Ip,Ep,ct,lt=x(()=>{"use strict";o();So=require("@reduxjs/toolkit"),wo=require("redux-persist");Zt();Q();Vt();re();xo={customToasts:[],transactionToasts:[],failTransactionToast:null},bo=(0,So.createSlice)({name:"toastsSlice",initialState:xo,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(b(w({},t.payload),{type:"custom",toastId:t.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,t)=>{e.customToasts=e.customToasts.filter(r=>r.toastId!==t.payload)},addTransactionToast:(e,t)=>{e.transactionToasts.push({type:"transaction",startTimestamp:ze(),toastId:t.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,t)=>{e.transactionToasts=e.transactionToasts.filter(r=>r.toastId!==t.payload)},addFailTransactionToast:(e,t)=>{e.failTransactionToast=b(w({},t.payload),{toastId:Ye})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(O,()=>xo),e.addCase(wo.REHYDRATE,(t,r)=>{var i,a;let n=(a=(i=r.customToasts)==null?void 0:i.filter(p=>!("component"in p)))!=null?a:[];t.customToasts=n})}}),{addCustomToast:bp,removeCustomToast:vo,addTransactionToast:vp,removeTransactionToast:Ap,addFailTransactionToast:Ip,removeFailTransactionToast:Ep}=bo.actions,ct=bo.reducer});var K=x(()=>{"use strict";o();rr();cr();ur();ot();st();xr();lt()});var kr=x(()=>{"use strict";o()});var $o,Uo,Vo,ad,sd,cd,ld,pd,ud,Wo,Ho=x(()=>{"use strict";o();$o=require("@reduxjs/toolkit");re();Uo={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Vo=(0,$o.createSlice)({name:"dappModalsSlice",initialState:Uo,reducers:{setDappModalVisibility:(e,t)=>{e.visible=t.payload},setDappModalHeaderVisibility:(e,t)=>{e.modal.showHeader=t.payload},setDappModalFooterVisibility:(e,t)=>{e.modal.showFooter=t.payload},setDappModalHeaderText:(e,t)=>{e.modal.headerText=t.payload},setDappModalFooterText:(e,t)=>{e.modal.footerText=t.payload},setDappModalConfig:(e,t)=>{e.modal=w({},t.payload)}},extraReducers:e=>{e.addCase(O,()=>Uo)}}),{setDappModalVisibility:ad,setDappModalHeaderVisibility:sd,setDappModalFooterVisibility:cd,setDappModalHeaderText:ld,setDappModalFooterText:pd,setDappModalConfig:ud}=Vo.actions,Wo=Vo.reducer});var Go,fs,Ts,Se,ft=x(()=>{"use strict";o();Go=require("@reduxjs/toolkit");kr();ur();Ho();rr();xr();cr();lt();st();ot();fs={["account"]:io,["networkConfig"]:Qn,["loginInfo"]:Gn,["modals"]:ho,["dappModal"]:Wo,["toasts"]:ct,["transactions"]:nt,["transactionsInfo"]:at},Ts=(e={})=>(0,Go.combineReducers)(w(w({},fs),e)),Se=Ts});var zo={};se(zo,{default:()=>vs});function Dr(e,t=[]){return{key:e,version:1,storage:jo.default,blacklist:t}}var me,qo,jo,ys,hs,xs,Ss,ws,bs,vs,Ko=x(()=>{"use strict";o();me=require("redux-persist"),qo=A(require("redux-persist/lib/storage")),jo=A(require("redux-persist/lib/storage/session"));ft();K();lt();st();ot();kr();ys={2:e=>b(w({},e),{networkConfig:sr})};hs=Dr("dapp-core-transactionsInfo"),xs=Dr("dapp-core-transactions",["transactionsToSign"]),Ss=Dr("dapp-core-toasts"),ws={key:"dapp-core-store",version:2,storage:qo.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,me.createMigrate)(ys,{debug:!1})},bs={["toasts"]:(0,me.persistReducer)(Ss,ct),["transactions"]:(0,me.persistReducer)(xs,nt),["transactionsInfo"]:(0,me.persistReducer)(hs,at)},vs=(0,me.persistReducer)(ws,Se(bs))});var Yo={};se(Yo,{default:()=>As});var As,Zo=x(()=>{"use strict";o();ft();As=Se()});var Xo={};se(Xo,{default:()=>Es});var H,Is,Es,Jo=x(()=>{"use strict";o();H=require("redux-persist"),Is=[H.FLUSH,H.REHYDRATE,H.PAUSE,H.PERSIST,H.PURGE,H.REGISTER],Es=Is});var ti={};se(ti,{default:()=>ei});function ei(e){return(0,Qo.persistStore)(e)}var Qo,ri=x(()=>{"use strict";o();Qo=require("redux-persist")});var ic={};se(ic,{useSignTransactionsWithDevice:()=>oc});module.exports=Ie(ic);o();o();var yi=A(require("axios"));o();o();K();o();var Ao=A(require("lodash.isequal")),pt=require("reselect"),h=(0,pt.createSelectorCreator)(pt.defaultMemoize,Ao.default);var ee=e=>e.account,Pe=h(ee,e=>e.address),Ce=h(ee,Pe,(e,t)=>t in e.accounts?e.accounts[t]:Je),Io=h(ee,Ce,(e,t)=>{let i=e,{accounts:r}=i,n=zr(i,["accounts"]);return b(w({},n),{account:t})}),Up=h(Ce,e=>e.balance),Eo=h(Ce,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),$p=h(ee,e=>e.shard),Vp=h(ee,e=>e.ledgerAccount),Wp=h(ee,e=>e.walletConnectAccount),Hp=h(ee,e=>e.isAccountLoading),Gp=h(ee,e=>e.accountLoadingError),ss=h(ee,e=>e.websocketEvent);o();var ne=e=>e.networkConfig,zp=h(ne,e=>e.chainID),Kp=h(ne,e=>e.network.walletConnectBridgeAddress),Yp=h(ne,e=>e.network.walletConnectV2RelayAddress),Zp=h(ne,e=>e.network.walletConnectV2ProjectId),Xp=h(ne,e=>e.network.walletConnectDeepLink),Re=h(ne,e=>e.network),ko=h(Re,e=>e.apiAddress),Do=h(Re,e=>e.explorerAddress),Lo=h(Re,e=>e.egldLabel);o();U();var de=e=>e.loginInfo,ru=h(de,e=>e.loginMethod),No=h(de,Pe,(e,t)=>e.loginMethod!=""&&Boolean(t)),nu=h(de,e=>e.walletConnectLogin),ou=h(de,e=>e.ledgerLogin),iu=h(de,e=>e.walletLogin),au=h(de,e=>e.isLoginSessionInvalid);o();o();var $=require("@elrondnetwork/erdjs");I();o();function Sr(e){try{return s.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function ut(e){var i,a,p;let{data:t}=e,r=Sr(t!=null?t:"")?$.TransactionPayload.fromEncoded(t):new $.TransactionPayload(t),n=new $.Transaction(w({value:e.value.valueOf(),data:r,nonce:e.nonce.valueOf(),receiver:new $.Address(e.receiver),sender:new $.Address(e.sender),gasLimit:(i=e.gasLimit.valueOf())!=null?i:Xt,gasPrice:(a=e.gasPrice.valueOf())!=null?a:Jt,chainID:e.chainID.valueOf(),version:new $.TransactionVersion((p=e.version)!=null?p:On)},e.options?{options:new $.TransactionOptions(e.options)}:{}));return n.applySignature({hex:()=>e.signature||""},new $.Address(e.sender)),n}o();gr();o();var br=A(require("bignumber.js"));Q();o();o();function wr(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)return!1;return!0}function Fe(e){let t=e;try{let r=s.Buffer.from(e,"hex").toString();wr(r)&&r.length>1&&(t=r)}catch(r){}return t}o();var Po=(e,t)=>{let r=[],n=e.indexOf(t,0);for(;n>=0;)r.push(n),n=e.indexOf(t,n+1);return r};function Ro(e){let t=[],r=0;try{if((e==null?void 0:e.startsWith("MultiESDTNFTTransfer"))&&(e==null?void 0:e.includes("@"))){let[,n,i,...a]=e==null?void 0:e.split("@");if(n){let p=new br.default(i,16).toNumber(),m=0;for(let f=0;f<p;f++){let S={type:"nftTransaction",data:"",receiver:n};for(let y=0;y<3;y++){switch(y){case 0:S.token=Fe(a[m]),S.data=a[m];break;case 1:{let v=a[m]&&a[m].length?a[m]:"";v?S.nonce=v:S.type="esdtTransaction",S.data=`${S.data}@${a[m]}`;break}case 2:S.amount=new br.default(a[m],16).toString(10),S.data=`${S.data}@${a[m]}`;break;default:break}r=m+1,m++}t[f]=S}let d=t.length!==p,g=t.some(f=>Po(f.data,"@").length!==2),T=t.some(f=>f.data.startsWith("@"));if(d||g||T)return[];if(a[r]){let f=a[r];for(let S=r+1;S<a.length;S++)f+="@"+a[S];t[p]={type:"scCall",data:f,receiver:n}}}}}catch(n){return console.error("failed parsing tx",n),t}return t}o();var Ar=require("@elrondnetwork/erdjs"),Ir=A(require("bignumber.js"));U();o();var Fo=re