@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 53 kB
JavaScript
"use strict";var mo=Object.create;var ue=Object.defineProperty,go=Object.defineProperties,fo=Object.getOwnPropertyDescriptor,To=Object.getOwnPropertyDescriptors,yo=Object.getOwnPropertyNames,ye=Object.getOwnPropertySymbols,ho=Object.getPrototypeOf,je=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable;var Wt=(e,t,r)=>t in e?ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))je.call(t,r)&&Wt(e,r,t[r]);if(ye)for(var r of ye(t))qt.call(t,r)&&Wt(e,r,t[r]);return e},I=(e,t)=>go(e,To(t));var jt=(e,t)=>{var r={};for(var n in e)je.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ye)for(var n of ye(e))t.indexOf(n)<0&&qt.call(e,n)&&(r[n]=e[n]);return r};var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var he=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),z=(e,t)=>{for(var r in t)ue(e,r,{get:t[r],enumerable:!0})},zt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of yo(t))!je.call(e,i)&&i!==r&&ue(e,i,{get:()=>t[i],enumerable:!(n=fo(t,i))||n.enumerable});return e};var w=(e,t,r)=>(r=e!=null?mo(ho(e)):{},zt(t||!e||!e.__esModule?ue(r,"default",{value:e,enumerable:!0}):r,e)),pe=e=>zt(ue({},"__esModule",{value:!0}),e);var Kt=(e,t,r)=>new Promise((n,i)=>{var a=d=>{try{m(r.next(d))}catch(g){i(g)}},u=d=>{try{m(r.throw(d))}catch(g){i(g)}},m=d=>d.done?n(d.value):Promise.resolve(d.value).then(a,u);m((r=r.apply(e,t)).next())});var Xt=he(xe=>{"use strict";o();xe.byteLength=So;xe.toByteArray=bo;xe.fromByteArray=Io;var F=[],N=[],xo=typeof Uint8Array!="undefined"?Uint8Array:Array,ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(K=0,Yt=ze.length;K<Yt;++K)F[K]=ze[K],N[ze.charCodeAt(K)]=K;var K,Yt;N["-".charCodeAt(0)]=62;N["_".charCodeAt(0)]=63;function Zt(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 So(e){var t=Zt(e),r=t[0],n=t[1];return(r+n)*3/4-n}function wo(e,t,r){return(t+r)*3/4-r}function bo(e){var t,r=Zt(e),n=r[0],i=r[1],a=new xo(wo(e,n,i)),u=0,m=i>0?n-4:n,d;for(d=0;d<m;d+=4)t=N[e.charCodeAt(d)]<<18|N[e.charCodeAt(d+1)]<<12|N[e.charCodeAt(d+2)]<<6|N[e.charCodeAt(d+3)],a[u++]=t>>16&255,a[u++]=t>>8&255,a[u++]=t&255;return i===2&&(t=N[e.charCodeAt(d)]<<2|N[e.charCodeAt(d+1)]>>4,a[u++]=t&255),i===1&&(t=N[e.charCodeAt(d)]<<10|N[e.charCodeAt(d+1)]<<4|N[e.charCodeAt(d+2)]>>2,a[u++]=t>>8&255,a[u++]=t&255),a}function Ao(e){return F[e>>18&63]+F[e>>12&63]+F[e>>6&63]+F[e&63]}function vo(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(Ao(n));return i.join("")}function Io(e){for(var t,r=e.length,n=r%3,i=[],a=16383,u=0,m=r-n;u<m;u+=a)i.push(vo(e,u,u+a>m?m:u+a));return n===1?(t=e[r-1],i.push(F[t>>2]+F[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(F[t>>10]+F[t>>4&63]+F[t<<2&63]+"=")),i.join("")}});var Jt=he(Ke=>{o();Ke.read=function(e,t,r,n,i){var a,u,m=i*8-n-1,d=(1<<m)-1,g=d>>1,h=-7,T=r?i-1:0,v=r?-1:1,k=e[t+T];for(T+=v,a=k&(1<<-h)-1,k>>=-h,h+=m;h>0;a=a*256+e[t+T],T+=v,h-=8);for(u=a&(1<<-h)-1,a>>=-h,h+=n;h>0;u=u*256+e[t+T],T+=v,h-=8);if(a===0)a=1-g;else{if(a===d)return u?NaN:(k?-1:1)*(1/0);u=u+Math.pow(2,n),a=a-g}return(k?-1:1)*u*Math.pow(2,a-n)};Ke.write=function(e,t,r,n,i,a){var u,m,d,g=a*8-i-1,h=(1<<g)-1,T=h>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=n?0:a-1,G=n?1:-1,B=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,u=h):(u=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-u))<1&&(u--,d*=2),u+T>=1?t+=v/d:t+=v*Math.pow(2,1-T),t*d>=2&&(u++,d/=2),u+T>=h?(m=0,u=h):u+T>=1?(m=(t*d-1)*Math.pow(2,i),u=u+T):(m=t*Math.pow(2,T-1)*Math.pow(2,i),u=0));i>=8;e[r+k]=m&255,k+=G,m/=256,i-=8);for(u=u<<i|m,g+=i;g>0;e[r+k]=u&255,k+=G,u/=256,g-=8);e[r+k-G]|=B*128}});var pr=he(ee=>{"use strict";o();var Ye=Xt(),Q=Jt(),Qt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ee.Buffer=p;ee.SlowBuffer=No;ee.INSPECT_MAX_BYTES=50;var Se=2147483647;ee.kMaxLength=Se;p.TYPED_ARRAY_SUPPORT=ko();!p.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 ko(){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(p.prototype,"parent",{enumerable:!0,get:function(){if(!!p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(!!p.isBuffer(this))return this.byteOffset}});function U(e){if(e>Se)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,p.prototype),t}function p(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 Qe(e)}return rr(e,t,r)}p.poolSize=8192;function rr(e,t,r){if(typeof e=="string")return Lo(e,t);if(ArrayBuffer.isView(e))return Do(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(_(e,ArrayBuffer)||e&&_(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(_(e,SharedArrayBuffer)||e&&_(e.buffer,SharedArrayBuffer)))return Xe(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 p.from(n,t,r);var i=Ro(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return p.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)}p.from=function(e,t,r){return rr(e,t,r)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function nr(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 Eo(e,t,r){return nr(e),e<=0?U(e):t!==void 0?typeof r=="string"?U(e).fill(t,r):U(e).fill(t):U(e)}p.alloc=function(e,t,r){return Eo(e,t,r)};function Qe(e){return nr(e),U(e<0?0:et(e)|0)}p.allocUnsafe=function(e){return Qe(e)};p.allocUnsafeSlow=function(e){return Qe(e)};function Lo(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!p.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=or(e,t)|0,n=U(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Ze(e){for(var t=e.length<0?0:et(e.length)|0,r=U(t),n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Do(e){if(_(e,Uint8Array)){var t=new Uint8Array(e);return Xe(t.buffer,t.byteOffset,t.byteLength)}return Ze(e)}function Xe(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,p.prototype),n}function Ro(e){if(p.isBuffer(e)){var t=et(e.length)|0,r=U(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||tt(e.length)?U(0):Ze(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Ze(e.data)}function et(e){if(e>=Se)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Se.toString(16)+" bytes");return e|0}function No(e){return+e!=e&&(e=0),p.alloc(+e)}p.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==p.prototype};p.compare=function(t,r){if(_(t,Uint8Array)&&(t=p.from(t,t.offset,t.byteLength)),_(r,Uint8Array)&&(r=p.from(r,r.offset,r.byteLength)),!p.isBuffer(t)||!p.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,u=Math.min(n,i);a<u;++a)if(t[a]!==r[a]){n=t[a],i=r[a];break}return n<i?-1:i<n?1:0};p.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}};p.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return p.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=p.allocUnsafe(r),a=0;for(n=0;n<t.length;++n){var u=t[n];if(_(u,Uint8Array))a+u.length>i.length?p.from(u).copy(i,a):Uint8Array.prototype.set.call(i,u,a);else if(p.isBuffer(u))u.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=u.length}return i};function or(e,t){if(p.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||_(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 Je(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ur(e).length;default:if(i)return n?-1:Je(e).length;t=(""+t).toLowerCase(),i=!0}}p.byteLength=or;function Po(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 Ho(this,t,r);case"utf8":case"utf-8":return ar(this,t,r);case"ascii":return $o(this,t,r);case"latin1":case"binary":return Vo(this,t,r);case"base64":return Bo(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Go(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}p.prototype._isBuffer=!0;function Y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}p.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)Y(this,r,r+1);return this};p.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)Y(this,r,r+3),Y(this,r+1,r+2);return this};p.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)Y(this,r,r+7),Y(this,r+1,r+6),Y(this,r+2,r+5),Y(this,r+3,r+4);return this};p.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?ar(this,0,t):Po.apply(this,arguments)};p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=function(t){if(!p.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:p.compare(this,t)===0};p.prototype.inspect=function(){var t="",r=ee.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Qt&&(p.prototype[Qt]=p.prototype.inspect);p.prototype.compare=function(t,r,n,i,a){if(_(t,Uint8Array)&&(t=p.from(t,t.offset,t.byteLength)),!p.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 u=a-i,m=n-r,d=Math.min(u,m),g=this.slice(i,a),h=t.slice(r,n),T=0;T<d;++T)if(g[T]!==h[T]){u=g[T],m=h[T];break}return u<m?-1:m<u?1:0};function ir(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,tt(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=p.from(t,n)),p.isBuffer(t))return t.length===0?-1:er(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):er(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function er(e,t,r,n,i){var a=1,u=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,u/=2,m/=2,r/=2}function d(k,G){return a===1?k[G]:k.readUInt16BE(G*a)}var g;if(i){var h=-1;for(g=r;g<u;g++)if(d(e,g)===d(t,h===-1?0:g-h)){if(h===-1&&(h=g),g-h+1===m)return h*a}else h!==-1&&(g-=g-h),h=-1}else for(r+m>u&&(r=u-m),g=r;g>=0;g--){for(var T=!0,v=0;v<m;v++)if(d(e,g+v)!==d(t,v)){T=!1;break}if(T)return g}return-1}p.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};p.prototype.indexOf=function(t,r,n){return ir(this,t,r,n,!0)};p.prototype.lastIndexOf=function(t,r,n){return ir(this,t,r,n,!1)};function Co(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 u=0;u<n;++u){var m=parseInt(t.substr(u*2,2),16);if(tt(m))return u;e[r+u]=m}return u}function Fo(e,t,r,n){return we(Je(t,e.length-r),e,r,n)}function _o(e,t,r,n){return we(jo(t),e,r,n)}function Mo(e,t,r,n){return we(ur(t),e,r,n)}function Oo(e,t,r,n){return we(zo(t,e.length-r),e,r,n)}p.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 u=!1;;)switch(i){case"hex":return Co(this,t,r,n);case"utf8":case"utf-8":return Fo(this,t,r,n);case"ascii":case"latin1":case"binary":return _o(this,t,r,n);case"base64":return Mo(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oo(this,t,r,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Bo(e,t,r){return t===0&&r===e.length?Ye.fromByteArray(e):Ye.fromByteArray(e.slice(t,r))}function ar(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a=e[i],u=null,m=a>239?4:a>223?3:a>191?2:1;if(i+m<=r){var d,g,h,T;switch(m){case 1:a<128&&(u=a);break;case 2:d=e[i+1],(d&192)===128&&(T=(a&31)<<6|d&63,T>127&&(u=T));break;case 3:d=e[i+1],g=e[i+2],(d&192)===128&&(g&192)===128&&(T=(a&15)<<12|(d&63)<<6|g&63,T>2047&&(T<55296||T>57343)&&(u=T));break;case 4:d=e[i+1],g=e[i+2],h=e[i+3],(d&192)===128&&(g&192)===128&&(h&192)===128&&(T=(a&15)<<18|(d&63)<<12|(g&63)<<6|h&63,T>65535&&T<1114112&&(u=T))}}u===null?(u=65533,m=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=m}return Uo(n)}var tr=4096;function Uo(e){var t=e.length;if(t<=tr)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=tr));return r}function $o(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 Vo(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 Ho(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+=Ko[e[a]];return i}function Go(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}p.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,p.prototype),i};function A(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")}p.prototype.readUintLE=p.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||A(t,r,this.length);for(var i=this[t],a=1,u=0;++u<r&&(a*=256);)i+=this[t+u]*a;return i};p.prototype.readUintBE=p.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||A(t,r,this.length);for(var i=this[t+--r],a=1;r>0&&(a*=256);)i+=this[t+--r]*a;return i};p.prototype.readUint8=p.prototype.readUInt8=function(t,r){return t=t>>>0,r||A(t,1,this.length),this[t]};p.prototype.readUint16LE=p.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||A(t,2,this.length),this[t]|this[t+1]<<8};p.prototype.readUint16BE=p.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||A(t,2,this.length),this[t]<<8|this[t+1]};p.prototype.readUint32LE=p.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};p.prototype.readUint32BE=p.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||A(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};p.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||A(t,r,this.length);for(var i=this[t],a=1,u=0;++u<r&&(a*=256);)i+=this[t+u]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*r)),i};p.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||A(t,r,this.length);for(var i=r,a=1,u=this[t+--i];i>0&&(a*=256);)u+=this[t+--i]*a;return a*=128,u>=a&&(u-=Math.pow(2,8*r)),u};p.prototype.readInt8=function(t,r){return t=t>>>0,r||A(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};p.prototype.readInt16LE=function(t,r){t=t>>>0,r||A(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};p.prototype.readInt16BE=function(t,r){t=t>>>0,r||A(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};p.prototype.readInt32LE=function(t,r){return t=t>>>0,r||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};p.prototype.readInt32BE=function(t,r){return t=t>>>0,r||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};p.prototype.readFloatLE=function(t,r){return t=t>>>0,r||A(t,4,this.length),Q.read(this,t,!0,23,4)};p.prototype.readFloatBE=function(t,r){return t=t>>>0,r||A(t,4,this.length),Q.read(this,t,!1,23,4)};p.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||A(t,8,this.length),Q.read(this,t,!0,52,8)};p.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||A(t,8,this.length),Q.read(this,t,!1,52,8)};function L(e,t,r,n,i,a){if(!p.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")}p.prototype.writeUintLE=p.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;L(this,t,r,n,a,0)}var u=1,m=0;for(this[r]=t&255;++m<n&&(u*=256);)this[r+m]=t/u&255;return r+n};p.prototype.writeUintBE=p.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;L(this,t,r,n,a,0)}var u=n-1,m=1;for(this[r+u]=t&255;--u>=0&&(m*=256);)this[r+u]=t/m&255;return r+n};p.prototype.writeUint8=p.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,1,255,0),this[r]=t&255,r+1};p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||L(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};p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||L(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};p.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var a=Math.pow(2,8*n-1);L(this,t,r,n,a-1,-a)}var u=0,m=1,d=0;for(this[r]=t&255;++u<n&&(m*=256);)t<0&&d===0&&this[r+u-1]!==0&&(d=1),this[r+u]=(t/m>>0)-d&255;return r+n};p.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var a=Math.pow(2,8*n-1);L(this,t,r,n,a-1,-a)}var u=n-1,m=1,d=0;for(this[r+u]=t&255;--u>=0&&(m*=256);)t<0&&d===0&&this[r+u+1]!==0&&(d=1),this[r+u]=(t/m>>0)-d&255;return r+n};p.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};p.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};p.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};p.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||L(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};p.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||L(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 sr(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 cr(e,t,r,n,i){return t=+t,r=r>>>0,i||sr(e,t,r,4,34028234663852886e22,-34028234663852886e22),Q.write(e,t,r,n,23,4),r+4}p.prototype.writeFloatLE=function(t,r,n){return cr(this,t,r,!0,n)};p.prototype.writeFloatBE=function(t,r,n){return cr(this,t,r,!1,n)};function lr(e,t,r,n,i){return t=+t,r=r>>>0,i||sr(e,t,r,8,17976931348623157e292,-17976931348623157e292),Q.write(e,t,r,n,52,8),r+8}p.prototype.writeDoubleLE=function(t,r,n){return lr(this,t,r,!0,n)};p.prototype.writeDoubleBE=function(t,r,n){return lr(this,t,r,!1,n)};p.prototype.copy=function(t,r,n,i){if(!p.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};p.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"&&!p.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 u;if(typeof t=="number")for(u=r;u<n;++u)this[u]=t;else{var m=p.isBuffer(t)?t:p.from(t,i),d=m.length;if(d===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(u=0;u<n-r;++u)this[u+r]=m[u%d]}return this};var Wo=/[^+/0-9A-Za-z-_]/g;function qo(e){if(e=e.split("=")[0],e=e.trim().replace(Wo,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Je(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],u=0;u<n;++u){if(r=e.charCodeAt(u),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(u+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 jo(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function zo(e,t){for(var r,n,i,a=[],u=0;u<e.length&&!((t-=2)<0);++u)r=e.charCodeAt(u),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function ur(e){return Ye.toByteArray(qo(e))}function we(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 _(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function tt(e){return e!==e}var Ko=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 Tr=he((ka,fr)=>{o();var S=fr.exports={},M,O;function rt(){throw new Error("setTimeout has not been defined")}function nt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?M=setTimeout:M=rt}catch(e){M=rt}try{typeof clearTimeout=="function"?O=clearTimeout:O=nt}catch(e){O=nt}})();function dr(e){if(M===setTimeout)return setTimeout(e,0);if((M===rt||!M)&&setTimeout)return M=setTimeout,setTimeout(e,0);try{return M(e,0)}catch(t){try{return M.call(null,e,0)}catch(r){return M.call(this,e,0)}}}function Yo(e){if(O===clearTimeout)return clearTimeout(e);if((O===nt||!O)&&clearTimeout)return O=clearTimeout,clearTimeout(e);try{return O(e)}catch(t){try{return O.call(null,e)}catch(r){return O.call(this,e)}}}var $=[],te=!1,Z,be=-1;function Zo(){!te||!Z||(te=!1,Z.length?$=Z.concat($):be=-1,$.length&&mr())}function mr(){if(!te){var e=dr(Zo);te=!0;for(var t=$.length;t;){for(Z=$,$=[];++be<t;)Z&&Z[be].run();be=-1,t=$.length}Z=null,te=!1,Yo(e)}}S.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];$.push(new gr(e,t)),$.length===1&&!te&&dr(mr)};function gr(e,t){this.fun=e,this.array=t}gr.prototype.run=function(){this.fun.apply(null,this.array)};S.title="browser";S.browser=!0;S.env={};S.argv=[];S.version="";S.versions={};function V(){}S.on=V;S.addListener=V;S.once=V;S.off=V;S.removeListener=V;S.removeAllListeners=V;S.emit=V;S.prependListener=V;S.prependOnceListener=V;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 s,c,Ea,o=y(()=>{s=w(pr()),c=w(Tr()),Ea=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 Ae,ot=y(()=>{"use strict";o();Ae=()=>Date.now()/1e3});var yr=y(()=>{"use strict";o()});var hr=y(()=>{"use strict";o()});var xr=y(()=>{"use strict";o();ot();yr();hr()});var at={};z(at,{getItem:()=>Jo,localStorageKeys:()=>X,removeItem:()=>Qo,setItem:()=>Xo});var X,it,Xo,Jo,Qo,de=y(()=>{"use strict";o();xr();X={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},it=typeof localStorage!="undefined",Xo=({key:e,data:t,expires:r})=>{!it||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Jo=e=>{if(!it)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:Ae()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},Qo=e=>{!it||localStorage.removeItem(String(e))}});var st={};z(st,{clear:()=>Ar,getItem:()=>wr,removeItem:()=>br,setItem:()=>Sr,storage:()=>ei});var Sr,wr,br,Ar,ei,vr=y(()=>{"use strict";o();Sr=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},wr=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},br=e=>sessionStorage.removeItem(String(e)),Ar=()=>sessionStorage.clear(),ei={setItem:Sr,getItem:wr,removeItem:br,clear:Ar}});var re,ve=y(()=>{"use strict";o();de();vr();re={session:st,local:at}});function me(){return new Date().setHours(new Date().getHours()+24)}function ge(e){re.local.setItem({key:X.loginExpiresAt,data:e,expires:e})}var ct=y(()=>{"use strict";o();ve();de()});var C=y(()=>{"use strict";o()});var Ir=y(()=>{"use strict";o()});var kr=y(()=>{"use strict";o()});var E=y(()=>{"use strict";o()});var Er=y(()=>{"use strict";o()});var Lr=y(()=>{"use strict";o()});var Dr=y(()=>{"use strict";o()});var Rr=y(()=>{"use strict";o()});var W=y(()=>{"use strict";o();kr();E();C();Er();Lr();Dr();Rr()});var lt,Nr,ts,Pr,rs,Cr,ns,os,is,Fr=y(()=>{"use strict";o();W();lt={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:Nr,egldLabel:ts}=lt["devnet"],{chainId:Pr,egldLabel:rs}=lt["testnet"],{chainId:Cr,egldLabel:ns}=lt["mainnet"],os={["devnet"]:Nr,["testnet"]:Pr,["mainnet"]:Cr},is={[Nr]:"devnet",[Pr]:"testnet",[Cr]:"mainnet"}});var ut=y(()=>{"use strict";o()});var _r=y(()=>{"use strict";o()});var Mr,pt=y(()=>{"use strict";o();Mr="transaction-status-toast-id"});var dt,mt,Or,Ie,Br,ne,b=y(()=>{"use strict";o();Ir();Fr();ut();_r();pt();dt=5e4,mt=1e9,Or=1,Ie="logout",Br="login",ne="0"});var gt,D,ke,q=y(()=>{"use strict";o();gt=require("@reduxjs/toolkit");b();D=(0,gt.createAction)(Ie),ke=(0,gt.createAction)(Br,e=>({payload:e}))});var $r,Ur,Vr,As,vs,Is,ks,Es,Ls,Hr,Gr,ft=y(()=>{"use strict";o();$r=require("@reduxjs/toolkit");ct();C();q();Ur={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Vr=(0,$r.createSlice)({name:"loginInfoSlice",initialState:Ur,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(D,()=>Ur),e.addCase(ke,(t,r)=>{t.loginMethod=r.payload.loginMethod,ge(me())})}}),{setLoginMethod:As,setWalletConnectLogin:vs,setLedgerLogin:Is,setTokenLogin:ks,setTokenLoginSignature:Es,setWalletLogin:Ls,invalidateLoginSession:Hr}=Vr.actions,Gr=Vr.reducer});var ri,Tt,yt=y(()=>{"use strict";o();ri=!1,Tt=(e,t=0)=>{ri||setTimeout(()=>{window.location.href=e},t)}});var Wr=y(()=>{"use strict";o();yt()});function ht(e){return e[Math.floor(Math.random()*e.length)]}var qr=y(()=>{"use strict";o()});var jr=y(()=>{"use strict";o();ut()});var zr=y(()=>{"use strict";o();Wr();qr();jr()});var Kr,Yr,xt,ni,Zr,Gs,Ws,Xr,St=y(()=>{"use strict";o();Kr=require("@reduxjs/toolkit"),Yr=w(require("lodash.omit"));zr();xt={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},ni={network:xt,chainID:"-1"},Zr=(0,Kr.createSlice)({name:"appConfig",initialState:ni,reducers:{initializeNetworkConfig:(e,t)=>{let r=ht(t.payload.walletConnectBridgeAddresses),n=ht(t.payload.walletConnectV2RelayAddresses),i=(0,Yr.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=I(x(x({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:n})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:Gs,setChainID:Ws}=Zr.actions,Xr=Zr.reducer});var bt,Jr,Qr,Ee,wt,en,tn,Js,rn,Qs,ec,tc,rc,nc,oc,ic,nn,At=y(()=>{"use strict";o();bt=require("@elrondnetwork/erdjs"),Jr=require("@reduxjs/toolkit"),Qr=require("redux-persist");b();ve();de();q();Ee={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:ne},wt={address:"",websocketEvent:null,accounts:{"":Ee},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},en=(0,Jr.createSlice)({name:"accountInfoSlice",initialState:wt,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new bt.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Ee},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(D,()=>(re.local.removeItem(X.loginExpiresAt),wt)),e.addCase(ke,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new bt.Address(n).hex()}),e.addCase(Qr.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:i,shard:a,accounts:u,publicKey:m}=n;t.address=i,t.shard=a;let d=u&&i in u;t.accounts=d?u:wt.accounts,t.publicKey=m})}}),{setAccount:tn,setAddress:Js,setAccountNonce:rn,setAccountShard:Qs,setLedgerAccount:ec,updateLedgerAccount:tc,setWalletConnectAccount:rc,setIsAccountLoading:nc,setAccountLoadingError:oc,setWebsocketEvent:ic}=en.actions,nn=en.reducer});function on(e){return e!=null&&(di(e)||Ti(e))}function Le(e){return e!=null&&(mi(e)||yi(e))}function De(e){return e!=null&&(gi(e)||hi(e))}function an(e){return e!=null&&fi(e)}function di(e){return e!=null&&ii.includes(e)}function mi(e){return e!=null&&ai.includes(e)}function gi(e){return e!=null&&si.includes(e)}function fi(e){return e!=null&&ci.includes(e)}function Ti(e){return e!=null&&li.includes(e)}function yi(e){return e!=null&&ui.includes(e)}function hi(e){return e!=null&&pi.includes(e)}var ii,ai,si,ci,li,ui,pi,It=y(()=>{"use strict";o();C();ii=["sent"],ai=["success"],si=["fail","cancelled","timedOut"],ci=["timedOut"],li=["pending"],ui=["success"],pi=["fail","invalid"]});var sn,cn,fe,xi,ln,gc,fc,Tc,yc,hc,xc,Sc,wc,bc,Ac,Re,Ne=y(()=>{"use strict";o();sn=require("@reduxjs/toolkit"),cn=require("redux-persist");C();It();q();fe={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},xi={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},ln=(0,sn.createSlice)({name:"transactionsSlice",initialState:fe,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,g;let{sessionId:r,transactions:n,errorMessage:i,status:a,redirectRoute:u}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||xi;e.signedTransactions[r]={transactions:n,status:a,errorMessage:i,redirectRoute:u,customTransactionInformation:m},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===r&&(e.transactionsToSign=fe.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=x(x({},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,h,T,v;let{sessionId:r,status:n,errorMessage:i,transactionHash:a}=t.payload,u=(d=(m=e.signedTransactions)==null?void 0:m[r])==null?void 0:d.transactions;if(u!=null){e.signedTransactions[r].transactions=u.map(B=>B.hash===a?I(x({},B),{status:n,errorMessage:i}):B);let k=(h=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:h.every(B=>Le(B.status)),G=(v=(T=e.signedTransactions[r])==null?void 0:T.transactions)==null?void 0:v.every(B=>De(B.status));k&&(e.signedTransactions[r].status="success"),G&&(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=fe.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=fe.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(D,()=>fe),e.addCase(cn.REHYDRATE,(t,r)=>{var u;if(t.signTransactionsCancelMessage=null,!((u=r.payload)!=null&&u.transactions))return;let{signedTransactions:n,customTransactionInformationForSessionId:i}=r.payload.transactions,a=Object.entries(n).reduce((m,[d,g])=>{let h=new Date(d),T=new Date;return T.setHours(T.getHours()+5),T-h>0||(m[d]=g),m},{});i!=null&&(t.customTransactionInformationForSessionId=i),n!=null&&(t.signedTransactions=a)})}}),{updateSignedTransactionStatus:gc,updateSignedTransactions:fc,setTransactionsToSign:Tc,clearAllTransactionsToSign:yc,clearAllSignedTransactions:hc,clearSignedTransaction:xc,clearTransactionToSign:Sc,setSignTransactionsError:wc,setSignTransactionsCancelMessage:bc,moveTransactionsToSignedState:Ac}=ln.actions,Re=ln.reducer});var un,Et,Lt,Dt,Si,kt,pn,Ec,Lc,Dc,Pe,Ce=y(()=>{"use strict";o();un=require("@reduxjs/toolkit");q();Et="Transaction failed",Lt="Transaction successful",Dt="Processing transaction",Si="Transaction submitted",kt={},pn=(0,un.createSlice)({name:"transactionsInfo",initialState:kt,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||Et,successMessage:(n==null?void 0:n.successMessage)||Lt,processingMessage:(n==null?void 0:n.processingMessage)||Dt,submittedMessage:(n==null?void 0:n.submittedMessage)||Si,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>kt},extraReducers:e=>{e.addCase(D,()=>kt)}}),{clearTransactionsInfo:Ec,setTransactionsDisplayInfo:Lc,clearTransactionsInfoForSessionId:Dc}=pn.actions,Pe=pn.reducer});var mn,dn,gn,Cc,Fc,_c,Mc,fn,Rt=y(()=>{"use strict";o();mn=require("@reduxjs/toolkit");q();dn={},gn=(0,mn.createSlice)({name:"modalsSlice",initialState:dn,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(D,()=>dn)}}),{setTxSubmittedModal:Cc,setNotificationModal:Fc,clearTxSubmittedModal:_c,clearNotificationModal:Mc}=gn.actions,fn=gn.reducer});var yn,hn,Tn,xn,Wc,qc,jc,zc,Kc,Yc,Fe,_e=y(()=>{"use strict";o();yn=require("@reduxjs/toolkit"),hn=require("redux-persist");pt();W();ot();q();Tn={customToasts:[],transactionToasts:[],failTransactionToast:null},xn=(0,yn.createSlice)({name:"toastsSlice",initialState:Tn,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(I(x({},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:Ae(),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=I(x({},t.payload),{toastId:Mr})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(D,()=>Tn),e.addCase(hn.REHYDRATE,(t,r)=>{var i,a;let n=(a=(i=r.customToasts)==null?void 0:i.filter(u=>!("component"in u)))!=null?a:[];t.customToasts=n})}}),{addCustomToast:Wc,removeCustomToast:qc,addTransactionToast:jc,removeTransactionToast:zc,addFailTransactionToast:Kc,removeFailTransactionToast:Yc}=xn.actions,Fe=xn.reducer});var oe=y(()=>{"use strict";o();ft();St();At();Ne();Ce();Rt();_e()});var Nt=y(()=>{"use strict";o()});var An,bn,vn,fl,Tl,yl,hl,xl,Sl,In,kn=y(()=>{"use strict";o();An=require("@reduxjs/toolkit");q();bn={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},vn=(0,An.createSlice)({name:"dappModalsSlice",initialState:bn,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=x({},t.payload)}},extraReducers:e=>{e.addCase(D,()=>bn)}}),{setDappModalVisibility:fl,setDappModalHeaderVisibility:Tl,setDappModalFooterVisibility:yl,setDappModalHeaderText:hl,setDappModalFooterText:xl,setDappModalConfig:Sl}=vn.actions,In=vn.reducer});var En,vi,Ii,ie,Oe=y(()=>{"use strict";o();En=require("@reduxjs/toolkit");Nt();At();kn();ft();Rt();St();_e();Ce();Ne();vi={["account"]:nn,["networkConfig"]:Xr,["loginInfo"]:Gr,["modals"]:fn,["dappModal"]:In,["toasts"]:Fe,["transactions"]:Re,["transactionsInfo"]:Pe},Ii=(e={})=>(0,En.combineReducers)(x(x({},vi),e)),ie=Ii});var Rn={};z(Rn,{default:()=>Pi});function Pt(e,t=[]){return{key:e,version:1,storage:Dn.default,blacklist:t}}var J,Ln,Dn,ki,Ei,Li,Di,Ri,Ni,Pi,Nn=y(()=>{"use strict";o();J=require("redux-persist"),Ln=w(require("redux-persist/lib/storage")),Dn=w(require("redux-persist/lib/storage/session"));Oe();oe();_e();Ce();Ne();Nt();ki={2:e=>I(x({},e),{networkConfig:xt})};Ei=Pt("dapp-core-transactionsInfo"),Li=Pt("dapp-core-transactions",["transactionsToSign"]),Di=Pt("dapp-core-toasts"),Ri={key:"dapp-core-store",version:2,storage:Ln.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,J.createMigrate)(ki,{debug:!1})},Ni={["toasts"]:(0,J.persistReducer)(Di,Fe),["transactions"]:(0,J.persistReducer)(Li,Re),["transactionsInfo"]:(0,J.persistReducer)(Ei,Pe)},Pi=(0,J.persistReducer)(Ri,ie(Ni))});var Pn={};z(Pn,{default:()=>Ci});var Ci,Cn=y(()=>{"use strict";o();Oe();Ci=ie()});var Fn={};z(Fn,{default:()=>_i});var P,Fi,_i,_n=y(()=>{"use strict";o();P=require("redux-persist"),Fi=[P.FLUSH,P.REHYDRATE,P.PAUSE,P.PERSIST,P.PURGE,P.REGISTER],_i=Fi});var Bn={};z(Bn,{default:()=>On});function On(e){return(0,Mn.persistStore)(e)}var Mn,Un=y(()=>{"use strict";o();Mn=require("redux-persist")});var wa={};z(wa,{AuthenticatedRoutesWrapper:()=>Sa});module.exports=pe(wa);o();var Gt=w(require("react"));o();var qn=require("react"),se=require("react-redux");o();var Ct=require("@reduxjs/toolkit"),Gn=require("react-redux/es/utils/Subscription");oe();o();var Sn=w(require("lodash.throttle"));b();oe();ct();ve();de();var wi=[Ie],bi=(0,Sn.default)(()=>{ge(me())},5e3),wn=e=>t=>r=>{var d;if(wi.includes(r.type))return t(r);let n=e.getState(),i=re.local.getItem(X.loginExpiresAt);if(!((d=n==null?void 0:n.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(i==null)return ge(me());let u=Date.now();return i-u<0?setTimeout(()=>Kt(void 0,null,function*(){console.log("session expired");try{e.dispatch(Hr())}catch(g){console.error("error logging out",g)}}),1e3):(bi(),t(r))};o();o();function Me(){return typeof sessionStorage!="undefined"}var $n=Me()?(Nn(),pe(Rn)).default:(Cn(),pe(Pn)).default,Vn=Me()?(_n(),pe(Fn)).default:[],Hn=Me()?(Un(),pe(Bn)).default:e=>e;Oe();var ae=(0,Ct.configureStore)({reducer:$n,middleware:e=>e({serializableCheck:{ignoredActions:[...Vn,rn.type,tn.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(wn)}),Wn=(0,Gn.createSubscription)(ae),ql=Hn(ae),jl=(0,Ct.configureStore)({reducer:ie});var Mi={store:ae,subscription:Wn},Ft=(0,qn.createContext)(Mi),Zl=(0,se.createStoreHook)(Ft),Xl=(0,se.createDispatchHook)(Ft),Be=(0,se.createSelectorHook)(Ft);o();o();oe();o();var jn=w(require("lodash.isequal")),Ue=require("reselect"),f=(0,Ue.createSelectorCreator)(Ue.defaultMemoize,jn.default);var H=e=>e.account,_t=f(H,e=>e.address),Mt=f(H,_t,(e,t)=>t in e.accounts?e.accounts[t]:Ee),ru=f(H,Mt,(e,t)=>{let i=e,{accounts:r}=i,n=jt(i,["accounts"]);return I(x({},n),{account:t})}),nu=f(Mt,e=>e.balance),ou=f(Mt,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),iu=f(H,e=>e.shard),au=f(H,e=>e.ledgerAccount),su=f(H,e=>e.walletConnectAccount),zn=f(H,e=>e.isAccountLoading),cu=f(H,e=>e.accountLoadingError),lu=f(H,e=>e.websocketEvent);o();var ce=e=>e.networkConfig,du=f(ce,e=>e.chainID),mu=f(ce,e=>e.network.walletConnectBridgeAddress),gu=f(ce,e=>e.network.walletConnectV2RelayAddress),fu=f(ce,e=>e.network.walletConnectV2ProjectId),Tu=f(ce,e=>e.network.walletConnectDeepLink),Ot=f(ce,e=>e.network),yu=f(Ot,e=>e.apiAddress),Kn=f(Ot,e=>e.explorerAddress),hu=f(Ot,e=>e.egldLabel);o();C();var le=e=>e.loginInfo,Au=f(le,e=>e.loginMethod),Yn=f(le,_t,(e,t)=>e.loginMethod!=""&&Boolean(t)),vu=f(le,e=>e.walletConnectLogin),Iu=f(le,e=>e.ledgerLogin),Zn=f(le,e=>e.walletLogin),ku=f(le,e=>e.isLoginSessionInvalid);o();o();var R=require("@elrondnetwork/erdjs");b();o();function Bt(e){try{return s.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function Ut(e){var i,a,u;let{data:t}=e,r=Bt(t!=null?t:"")?R.TransactionPayload.fromEncoded(t):new R.TransactionPayload(t),n=new R.Transaction(x({value:e.value.valueOf(),data:r,nonce:e.nonce.valueOf(),receiver:new R.Address(e.receiver),sender:new R.Address(e.sender),gasLimit:(i=e.gasLimit.valueOf())!=null?i:dt,gasPrice:(a=e.gasPrice.valueOf())!=null?a:mt,chainID:e.chainID.valueOf(),version:new R.TransactionVersion((u=e.version)!=null?u:Or)},e.options?{options:new R.TransactionOptions(e.options)}:{}));return n.applySignature({hex:()=>e.signature||""},new R.Address(e.sender)),n}o();It();o();var Bi=w(require("bignumber.js"));W();o();o();o();o();var $i=require("@elrondnetwork/erdjs"),Vi=w(require("bignumber.js"));C();o();var Ui=require("@elrondnetwork/erdjs");o();o();o();var Gi=require("@elrondnetwork/erdjs/out");o();b();o();var eo=require("@elrondnetwork/erdjs");W();o();o();o();o();C();o();o();o();o();o();o();o();o();o();o();o();E();o();o();E();o();o();o();var Yi=w(require("bignumber.js"));b();o();var Ki=require("@elrondnetwork/erdjs"),$t=w(require("bignumber.js"));b();o();var ji=w(require("bignumber.js"));o();$t.default.config({ROUNDING_MODE:$t.default.ROUND_FLOOR});o();o();o();b();o();o();o();o();b();o();b();o();var Zi=require("@elrondnetwork/erdjs");b();o();var He=require("@elrondnetwork/erdjs"),Ji=require("@elrondnetwork/erdjs"),Qi=require("@elrondnetwork/erdjs-network-providers");b();o();o();var Xi=w(require("bignumber.js"));b();o();b();o();o();o();o();o();b();o();E();var ta=["reDelegateRewards","claimRewards","unBond"],ra=["wrapEgld","unwrapEgld"],na=["unStake"],oa=["unDelegate"];o();o();o();b();o();var sa=w(require("bignumber.js"));o();o();o();E();o();var ca=w(require("bignumber.js"));o();o();o();o();E();o();o();o();var ua=w(require("anchorme"));o();b();o();var pa=w(require("bignumber.js"));o();W();o();o();C();o();C();o();o();o();E();o();E();o();var da=w(require("bignumber.js"));b();E();o();E();o();var io=require("react");W();o();o();E();o();var ma=require("@elrondnetwork/erdjs/out"),ga=w(require("bignumber.js"));E();o();E();o();o();C();var nT=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];o();var ao=require("react");W();o();var Ta=require("react");E();var uT=["create","localMint","ESDTLocalMint","addQuantity","burn","localBurn",