@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 52.9 kB
JavaScript
"use strict";var Eo=Object.create;var me=Object.defineProperty,Do=Object.defineProperties,Lo=Object.getOwnPropertyDescriptor,No=Object.getOwnPropertyDescriptors,Co=Object.getOwnPropertyNames,be=Object.getOwnPropertySymbols,Ro=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable;var Yt=(t,e,r)=>e in t?me(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e||(e={}))Qe.call(e,r)&&Yt(t,r,e[r]);if(be)for(var r of be(e))Zt.call(e,r)&&Yt(t,r,e[r]);return t},b=(t,e)=>Do(t,No(e));var Xt=(t,e)=>{var r={};for(var n in t)Qe.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&be)for(var n of be(t))e.indexOf(n)<0&&Zt.call(t,n)&&(r[n]=t[n]);return r};var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ae=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Z=(t,e)=>{for(var r in e)me(t,r,{get:e[r],enumerable:!0})},Jt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Co(e))!Qe.call(t,i)&&i!==r&&me(t,i,{get:()=>e[i],enumerable:!(n=Lo(e,i))||n.enumerable});return t};var S=(t,e,r)=>(r=t!=null?Eo(Ro(t)):{},Jt(e||!t||!t.__esModule?me(r,"default",{value:t,enumerable:!0}):r,t)),ge=t=>Jt(me({},"__esModule",{value:!0}),t);var X=(t,e,r)=>new Promise((n,i)=>{var l=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(l,p);m((r=r.apply(t,e)).next())});var tr=Ae(ve=>{"use strict";o();ve.byteLength=Fo;ve.toByteArray=Mo;ve.fromByteArray=Uo;var O=[],R=[],Po=typeof Uint8Array!="undefined"?Uint8Array:Array,et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(J=0,Qt=et.length;J<Qt;++J)O[J]=et[J],R[et.charCodeAt(J)]=J;var J,Qt;R["-".charCodeAt(0)]=62;R["_".charCodeAt(0)]=63;function er(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Fo(t){var e=er(t),r=e[0],n=e[1];return(r+n)*3/4-n}function _o(t,e,r){return(e+r)*3/4-r}function Mo(t){var e,r=er(t),n=r[0],i=r[1],l=new Po(_o(t,n,i)),p=0,m=i>0?n-4:n,d;for(d=0;d<m;d+=4)e=R[t.charCodeAt(d)]<<18|R[t.charCodeAt(d+1)]<<12|R[t.charCodeAt(d+2)]<<6|R[t.charCodeAt(d+3)],l[p++]=e>>16&255,l[p++]=e>>8&255,l[p++]=e&255;return i===2&&(e=R[t.charCodeAt(d)]<<2|R[t.charCodeAt(d+1)]>>4,l[p++]=e&255),i===1&&(e=R[t.charCodeAt(d)]<<10|R[t.charCodeAt(d+1)]<<4|R[t.charCodeAt(d+2)]>>2,l[p++]=e>>8&255,l[p++]=e&255),l}function Oo(t){return O[t>>18&63]+O[t>>12&63]+O[t>>6&63]+O[t&63]}function Bo(t,e,r){for(var n,i=[],l=e;l<r;l+=3)n=(t[l]<<16&16711680)+(t[l+1]<<8&65280)+(t[l+2]&255),i.push(Oo(n));return i.join("")}function Uo(t){for(var e,r=t.length,n=r%3,i=[],l=16383,p=0,m=r-n;p<m;p+=l)i.push(Bo(t,p,p+l>m?m:p+l));return n===1?(e=t[r-1],i.push(O[e>>2]+O[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(O[e>>10]+O[e>>4&63]+O[e<<2&63]+"=")),i.join("")}});var rr=Ae(tt=>{o();tt.read=function(t,e,r,n,i){var l,p,m=i*8-n-1,d=(1<<m)-1,g=d>>1,h=-7,T=r?i-1:0,A=r?-1:1,k=t[e+T];for(T+=A,l=k&(1<<-h)-1,k>>=-h,h+=m;h>0;l=l*256+t[e+T],T+=A,h-=8);for(p=l&(1<<-h)-1,l>>=-h,h+=n;h>0;p=p*256+t[e+T],T+=A,h-=8);if(l===0)l=1-g;else{if(l===d)return p?NaN:(k?-1:1)*(1/0);p=p+Math.pow(2,n),l=l-g}return(k?-1:1)*p*Math.pow(2,l-n)};tt.write=function(t,e,r,n,i,l){var p,m,d,g=l*8-i-1,h=(1<<g)-1,T=h>>1,A=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=n?0:l-1,N=n?1:-1,_=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,p=h):(p=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-p))<1&&(p--,d*=2),p+T>=1?e+=A/d:e+=A*Math.pow(2,1-T),e*d>=2&&(p++,d/=2),p+T>=h?(m=0,p=h):p+T>=1?(m=(e*d-1)*Math.pow(2,i),p=p+T):(m=e*Math.pow(2,T-1)*Math.pow(2,i),p=0));i>=8;t[r+k]=m&255,k+=N,m/=256,i-=8);for(p=p<<i|m,g+=i;g>0;t[r+k]=p&255,k+=N,p/=256,g-=8);t[r+k-N]|=_*128}});var fr=Ae(ie=>{"use strict";o();var rt=tr(),oe=rr(),nr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ie.Buffer=u;ie.SlowBuffer=qo;ie.INSPECT_MAX_BYTES=50;var Ie=2147483647;ie.kMaxLength=Ie;u.TYPED_ARRAY_SUPPORT=Vo();!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 Vo(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.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 $(t){if(t>Ie)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return at(t)}return ar(t,e,r)}u.poolSize=8192;function ar(t,e,r){if(typeof t=="string")return Ho(t,e);if(ArrayBuffer.isView(t))return Go(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(B(t,SharedArrayBuffer)||t&&B(t.buffer,SharedArrayBuffer)))return ot(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return u.from(n,e,r);var i=Wo(t);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}u.from=function(t,e,r){return ar(t,e,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function sr(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function $o(t,e,r){return sr(t),t<=0?$(t):e!==void 0?typeof r=="string"?$(t).fill(e,r):$(t).fill(e):$(t)}u.alloc=function(t,e,r){return $o(t,e,r)};function at(t){return sr(t),$(t<0?0:st(t)|0)}u.allocUnsafe=function(t){return at(t)};u.allocUnsafeSlow=function(t){return at(t)};function Ho(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=cr(t,e)|0,n=$(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function nt(t){for(var e=t.length<0?0:st(t.length)|0,r=$(e),n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Go(t){if(B(t,Uint8Array)){var e=new Uint8Array(t);return ot(e.buffer,e.byteOffset,e.byteLength)}return nt(t)}function ot(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function Wo(t){if(u.isBuffer(t)){var e=st(t.length)|0,r=$(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||ct(t.length)?$(0):nt(t);if(t.type==="Buffer"&&Array.isArray(t.data))return nt(t.data)}function st(t){if(t>=Ie)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ie.toString(16)+" bytes");return t|0}function qo(t){return+t!=t&&(t=0),u.alloc(+t)}u.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==u.prototype};u.compare=function(e,r){if(B(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),B(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(e)||!u.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var n=e.length,i=r.length,l=0,p=Math.min(n,i);l<p;++l)if(e[l]!==r[l]){n=e[l],i=r[l];break}return n<i?-1:i<n?1:0};u.isEncoding=function(e){switch(String(e).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(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return u.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=u.allocUnsafe(r),l=0;for(n=0;n<e.length;++n){var p=e[n];if(B(p,Uint8Array))l+p.length>i.length?u.from(p).copy(i,l):Uint8Array.prototype.set.call(i,p,l);else if(u.isBuffer(p))p.copy(i,l);else throw new TypeError('"list" argument must be an Array of Buffers');l+=p.length}return i};function cr(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return it(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return gr(t).length;default:if(i)return n?-1:it(t).length;e=(""+e).toLowerCase(),i=!0}}u.byteLength=cr;function jo(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return ri(this,e,r);case"utf8":case"utf-8":return pr(this,e,r);case"ascii":return ei(this,e,r);case"latin1":case"binary":return ti(this,e,r);case"base64":return Jo(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ni(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function Q(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}u.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)Q(this,r,r+1);return this};u.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)Q(this,r,r+3),Q(this,r+1,r+2);return this};u.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)Q(this,r,r+7),Q(this,r+1,r+6),Q(this,r+2,r+5),Q(this,r+3,r+4);return this};u.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?pr(this,0,e):jo.apply(this,arguments)};u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:u.compare(this,e)===0};u.prototype.inspect=function(){var e="",r=ie.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};nr&&(u.prototype[nr]=u.prototype.inspect);u.prototype.compare=function(e,r,n,i,l){if(B(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),l===void 0&&(l=this.length),r<0||n>e.length||i<0||l>this.length)throw new RangeError("out of range index");if(i>=l&&r>=n)return 0;if(i>=l)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,l>>>=0,this===e)return 0;for(var p=l-i,m=n-r,d=Math.min(p,m),g=this.slice(i,l),h=e.slice(r,n),T=0;T<d;++T)if(g[T]!==h[T]){p=g[T],m=h[T];break}return p<m?-1:m<p?1:0};function lr(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,ct(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=u.from(e,n)),u.isBuffer(e))return e.length===0?-1:or(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):or(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function or(t,e,r,n,i){var l=1,p=t.length,m=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;l=2,p/=2,m/=2,r/=2}function d(k,N){return l===1?k[N]:k.readUInt16BE(N*l)}var g;if(i){var h=-1;for(g=r;g<p;g++)if(d(t,g)===d(e,h===-1?0:g-h)){if(h===-1&&(h=g),g-h+1===m)return h*l}else h!==-1&&(g-=g-h),h=-1}else for(r+m>p&&(r=p-m),g=r;g>=0;g--){for(var T=!0,A=0;A<m;A++)if(d(t,g+A)!==d(e,A)){T=!1;break}if(T)return g}return-1}u.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};u.prototype.indexOf=function(e,r,n){return lr(this,e,r,n,!0)};u.prototype.lastIndexOf=function(e,r,n){return lr(this,e,r,n,!1)};function zo(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var l=e.length;n>l/2&&(n=l/2);for(var p=0;p<n;++p){var m=parseInt(e.substr(p*2,2),16);if(ct(m))return p;t[r+p]=m}return p}function Ko(t,e,r,n){return ke(it(e,t.length-r),t,r,n)}function Yo(t,e,r,n){return ke(ai(e),t,r,n)}function Zo(t,e,r,n){return ke(gr(e),t,r,n)}function Xo(t,e,r,n){return ke(si(e,t.length-r),t,r,n)}u.prototype.write=function(e,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 l=this.length-r;if((n===void 0||n>l)&&(n=l),e.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 zo(this,e,r,n);case"utf8":case"utf-8":return Ko(this,e,r,n);case"ascii":case"latin1":case"binary":return Yo(this,e,r,n);case"base64":return Zo(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xo(this,e,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 Jo(t,e,r){return e===0&&r===t.length?rt.fromByteArray(t):rt.fromByteArray(t.slice(e,r))}function pr(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var l=t[i],p=null,m=l>239?4:l>223?3:l>191?2:1;if(i+m<=r){var d,g,h,T;switch(m){case 1:l<128&&(p=l);break;case 2:d=t[i+1],(d&192)===128&&(T=(l&31)<<6|d&63,T>127&&(p=T));break;case 3:d=t[i+1],g=t[i+2],(d&192)===128&&(g&192)===128&&(T=(l&15)<<12|(d&63)<<6|g&63,T>2047&&(T<55296||T>57343)&&(p=T));break;case 4:d=t[i+1],g=t[i+2],h=t[i+3],(d&192)===128&&(g&192)===128&&(h&192)===128&&(T=(l&15)<<18|(d&63)<<12|(g&63)<<6|h&63,T>65535&&T<1114112&&(p=T))}}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 Qo(n)}var ir=4096;function Qo(t){var e=t.length;if(e<=ir)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=ir));return r}function ei(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function ti(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function ri(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",l=e;l<r;++l)i+=ci[t[l]];return i}function ni(t,e,r){for(var n=t.slice(e,r),i="",l=0;l<n.length-1;l+=2)i+=String.fromCharCode(n[l]+n[l+1]*256);return i}u.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i=this.subarray(e,r);return Object.setPrototypeOf(i,u.prototype),i};function I(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||I(e,r,this.length);for(var i=this[e],l=1,p=0;++p<r&&(l*=256);)i+=this[e+p]*l;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||I(e,r,this.length);for(var i=this[e+--r],l=1;r>0&&(l*=256);)i+=this[e+--r]*l;return i};u.prototype.readUint8=u.prototype.readUInt8=function(e,r){return e=e>>>0,r||I(e,1,this.length),this[e]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||I(e,2,this.length),this[e]|this[e+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||I(e,2,this.length),this[e]<<8|this[e+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||I(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};u.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||I(e,r,this.length);for(var i=this[e],l=1,p=0;++p<r&&(l*=256);)i+=this[e+p]*l;return l*=128,i>=l&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||I(e,r,this.length);for(var i=r,l=1,p=this[e+--i];i>0&&(l*=256);)p+=this[e+--i]*l;return l*=128,p>=l&&(p-=Math.pow(2,8*r)),p};u.prototype.readInt8=function(e,r){return e=e>>>0,r||I(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};u.prototype.readInt16LE=function(e,r){e=e>>>0,r||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(e,r){e=e>>>0,r||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(e,r){return e=e>>>0,r||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};u.prototype.readInt32BE=function(e,r){return e=e>>>0,r||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};u.prototype.readFloatLE=function(e,r){return e=e>>>0,r||I(e,4,this.length),oe.read(this,e,!0,23,4)};u.prototype.readFloatBE=function(e,r){return e=e>>>0,r||I(e,4,this.length),oe.read(this,e,!1,23,4)};u.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||I(e,8,this.length),oe.read(this,e,!0,52,8)};u.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||I(e,8,this.length),oe.read(this,e,!1,52,8)};function D(t,e,r,n,i,l){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<l)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){var l=Math.pow(2,8*n)-1;D(this,e,r,n,l,0)}var p=1,m=0;for(this[r]=e&255;++m<n&&(p*=256);)this[r+m]=e/p&255;return r+n};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){var l=Math.pow(2,8*n)-1;D(this,e,r,n,l,0)}var p=n-1,m=1;for(this[r+p]=e&255;--p>=0&&(m*=256);)this[r+p]=e/m&255;return r+n};u.prototype.writeUint8=u.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,1,255,0),this[r]=e&255,r+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};u.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){var l=Math.pow(2,8*n-1);D(this,e,r,n,l-1,-l)}var p=0,m=1,d=0;for(this[r]=e&255;++p<n&&(m*=256);)e<0&&d===0&&this[r+p-1]!==0&&(d=1),this[r+p]=(e/m>>0)-d&255;return r+n};u.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){var l=Math.pow(2,8*n-1);D(this,e,r,n,l-1,-l)}var p=n-1,m=1,d=0;for(this[r+p]=e&255;--p>=0&&(m*=256);)e<0&&d===0&&this[r+p+1]!==0&&(d=1),this[r+p]=(e/m>>0)-d&255;return r+n};u.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};u.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};u.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};u.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};u.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||D(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function ur(t,e,r,n,i,l){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function dr(t,e,r,n,i){return e=+e,r=r>>>0,i||ur(t,e,r,4,34028234663852886e22,-34028234663852886e22),oe.write(t,e,r,n,23,4),r+4}u.prototype.writeFloatLE=function(e,r,n){return dr(this,e,r,!0,n)};u.prototype.writeFloatBE=function(e,r,n){return dr(this,e,r,!1,n)};function mr(t,e,r,n,i){return e=+e,r=r>>>0,i||ur(t,e,r,8,17976931348623157e292,-17976931348623157e292),oe.write(t,e,r,n,52,8),r+8}u.prototype.writeDoubleLE=function(e,r,n){return mr(this,e,r,!0,n)};u.prototype.writeDoubleBE=function(e,r,n){return mr(this,e,r,!1,n)};u.prototype.copy=function(e,r,n,i){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.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),e.length-r<i-n&&(i=e.length-r+n);var l=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),l};u.prototype.fill=function(e,r,n,i){if(typeof e=="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(e.length===1){var l=e.charCodeAt(0);(i==="utf8"&&l<128||i==="latin1")&&(e=l)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));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,e||(e=0);var p;if(typeof e=="number")for(p=r;p<n;++p)this[p]=e;else{var m=u.isBuffer(e)?e:u.from(e,i),d=m.length;if(d===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(p=0;p<n-r;++p)this[p+r]=m[p%d]}return this};var oi=/[^+/0-9A-Za-z-_]/g;function ii(t){if(t=t.split("=")[0],t=t.trim().replace(oi,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function it(t,e){e=e||1/0;for(var r,n=t.length,i=null,l=[],p=0;p<n;++p){if(r=t.charCodeAt(p),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&l.push(239,191,189);continue}else if(p+1===n){(e-=3)>-1&&l.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&l.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&l.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;l.push(r)}else if(r<2048){if((e-=2)<0)break;l.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;l.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;l.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return l}function ai(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function si(t,e){for(var r,n,i,l=[],p=0;p<t.length&&!((e-=2)<0);++p)r=t.charCodeAt(p),n=r>>8,i=r%256,l.push(i),l.push(n);return l}function gr(t){return rt.toByteArray(ii(t))}function ke(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function B(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function ct(t){return t!==t}var ci=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=r*16,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()});var Sr=Ae((Wa,xr)=>{o();var w=xr.exports={},U,V;function lt(){throw new Error("setTimeout has not been defined")}function pt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?U=setTimeout:U=lt}catch(t){U=lt}try{typeof clearTimeout=="function"?V=clearTimeout:V=pt}catch(t){V=pt}})();function Tr(t){if(U===setTimeout)return setTimeout(t,0);if((U===lt||!U)&&setTimeout)return U=setTimeout,setTimeout(t,0);try{return U(t,0)}catch(e){try{return U.call(null,t,0)}catch(r){return U.call(this,t,0)}}}function li(t){if(V===clearTimeout)return clearTimeout(t);if((V===pt||!V)&&clearTimeout)return V=clearTimeout,clearTimeout(t);try{return V(t)}catch(e){try{return V.call(null,t)}catch(r){return V.call(this,t)}}}var H=[],ae=!1,ee,Ee=-1;function pi(){!ae||!ee||(ae=!1,ee.length?H=ee.concat(H):Ee=-1,H.length&&yr())}function yr(){if(!ae){var t=Tr(pi);ae=!0;for(var e=H.length;e;){for(ee=H,H=[];++Ee<e;)ee&&ee[Ee].run();Ee=-1,e=H.length}ee=null,ae=!1,li(t)}}w.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];H.push(new hr(t,e)),H.length===1&&!ae&&Tr(yr)};function hr(t,e){this.fun=t,this.array=e}hr.prototype.run=function(){this.fun.apply(null,this.array)};w.title="browser";w.browser=!0;w.env={};w.argv=[];w.version="";w.versions={};function G(){}w.on=G;w.addListener=G;w.once=G;w.off=G;w.removeListener=G;w.removeAllListeners=G;w.emit=G;w.prependListener=G;w.prependOnceListener=G;w.listeners=function(t){return[]};w.binding=function(t){throw new Error("process.binding is not supported")};w.cwd=function(){return"/"};w.chdir=function(t){throw new Error("process.chdir is not supported")};w.umask=function(){return 0}});var a,s,qa,o=y(()=>{a=S(fr()),s=S(Sr()),qa=function(t){function e(){var n=this||self;return delete t.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return e();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:e});var r=__magic__;return r}(Object)});var De,ut=y(()=>{"use strict";o();De=()=>Date.now()/1e3});var wr=y(()=>{"use strict";o()});var br=y(()=>{"use strict";o()});var Ar=y(()=>{"use strict";o();ut();wr();br()});var mt={};Z(mt,{getItem:()=>di,localStorageKeys:()=>te,removeItem:()=>mi,setItem:()=>ui});var te,dt,ui,di,mi,fe=y(()=>{"use strict";o();Ar();te={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},dt=typeof localStorage!="undefined",ui=({key:t,data:e,expires:r})=>{!dt||localStorage.setItem(String(t),JSON.stringify({expires:r,data:e}))},di=t=>{if(!dt)return;let e=localStorage.getItem(String(t));if(!e)return null;let r=JSON.parse(e);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:De()>=r.expires?(localStorage.removeItem(String(t)),null):r.data},mi=t=>{!dt||localStorage.removeItem(String(t))}});var gt={};Z(gt,{clear:()=>Er,getItem:()=>Ir,removeItem:()=>kr,setItem:()=>vr,storage:()=>gi});var vr,Ir,kr,Er,gi,Dr=y(()=>{"use strict";o();vr=({key:t,data:e,expires:r})=>{sessionStorage.setItem(String(t),JSON.stringify({expires:r,data:e}))},Ir=t=>{let e=sessionStorage.getItem(String(t));if(!e)return null;let r=JSON.parse(e);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Date.now()>=r.expires?(sessionStorage.removeItem(String(t)),null):r.data},kr=t=>sessionStorage.removeItem(String(t)),Er=()=>sessionStorage.clear(),gi={setItem:vr,getItem:Ir,removeItem:kr,clear:Er}});var se,Le=y(()=>{"use strict";o();fe();Dr();se={session:gt,local:mt}});function Te(){return new Date().setHours(new Date().getHours()+24)}function ye(t){se.local.setItem({key:te.loginExpiresAt,data:t,expires:t})}var ft=y(()=>{"use strict";o();Le();fe()});var P=y(()=>{"use strict";o()});var Lr=y(()=>{"use strict";o()});var Nr=y(()=>{"use strict";o()});var E=y(()=>{"use strict";o()});var Cr=y(()=>{"use strict";o()});var Rr=y(()=>{"use strict";o()});var Pr=y(()=>{"use strict";o()});var Fr=y(()=>{"use strict";o()});var q=y(()=>{"use strict";o();Nr();E();P();Cr();Rr();Pr();Fr()});var Tt,_r,xs,Mr,Ss,Or,ws,bs,As,Br=y(()=>{"use strict";o();q();Tt={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:_r,egldLabel:xs}=Tt["devnet"],{chainId:Mr,egldLabel:Ss}=Tt["testnet"],{chainId:Or,egldLabel:ws}=Tt["mainnet"],bs={["devnet"]:_r,["testnet"]:Mr,["mainnet"]:Or},As={[_r]:"devnet",[Mr]:"testnet",[Or]:"mainnet"}});var yt=y(()=>{"use strict";o()});var Ur=y(()=>{"use strict";o()});var Vr,ht=y(()=>{"use strict";o();Vr="transaction-status-toast-id"});var xt,St,$r,Ne,Hr,ce,v=y(()=>{"use strict";o();Lr();Br();yt();Ur();ht();xt=5e4,St=1e9,$r=1,Ne="logout",Hr="login",ce="0"});var wt,L,Ce,j=y(()=>{"use strict";o();wt=require("@reduxjs/toolkit");v();L=(0,wt.createAction)(Ne),Ce=(0,wt.createAction)(Hr,t=>({payload:t}))});var Wr,Gr,qr,$s,Hs,Gs,Ws,qs,js,jr,zr,bt=y(()=>{"use strict";o();Wr=require("@reduxjs/toolkit");ft();P();j();Gr={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},qr=(0,Wr.createSlice)({name:"loginInfoSlice",initialState:Gr,reducers:{setLoginMethod:(t,e)=>{t.loginMethod=e.payload},setTokenLogin:(t,e)=>{t.tokenLogin=e.payload},setTokenLoginSignature:(t,e)=>{(t==null?void 0:t.tokenLogin)!=null&&(t.tokenLogin.signature=e.payload)},setWalletLogin:(t,e)=>{t.walletLogin=e.payload},setWalletConnectLogin:(t,e)=>{t.walletConnectLogin=e.payload},setLedgerLogin:(t,e)=>{t.ledgerLogin=e.payload},invalidateLoginSession:t=>{t.isLoginSessionInvalid=!0}},extraReducers:t=>{t.addCase(L,()=>Gr),t.addCase(Ce,(e,r)=>{e.loginMethod=r.payload.loginMethod,ye(Te())})}}),{setLoginMethod:$s,setWalletConnectLogin:Hs,setLedgerLogin:Gs,setTokenLogin:Ws,setTokenLoginSignature:qs,setWalletLogin:js,invalidateLoginSession:jr}=qr.actions,zr=qr.reducer});var Ti,At,vt=y(()=>{"use strict";o();Ti=!1,At=(t,e=0)=>{Ti||setTimeout(()=>{window.location.href=t},e)}});var Kr=y(()=>{"use strict";o();vt()});function It(t){return t[Math.floor(Math.random()*t.length)]}var Yr=y(()=>{"use strict";o()});var Zr=y(()=>{"use strict";o();yt()});var Xr=y(()=>{"use strict";o();Kr();Yr();Zr()});var Jr,Qr,kt,yi,en,sc,cc,tn,Et=y(()=>{"use strict";o();Jr=require("@reduxjs/toolkit"),Qr=S(require("lodash.omit"));Xr();kt={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},yi={network:kt,chainID:"-1"},en=(0,Jr.createSlice)({name:"appConfig",initialState:yi,reducers:{initializeNetworkConfig:(t,e)=>{let r=It(e.payload.walletConnectBridgeAddresses),n=It(e.payload.walletConnectV2RelayAddresses),i=(0,Qr.default)(e.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");t.network=b(x(x({},t.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:n})},setChainID:(t,e)=>{t.chainID=e.payload}}}),{initializeNetworkConfig:sc,setChainID:cc}=en.actions,tn=en.reducer});var Lt,rn,nn,Re,Dt,on,an,Tc,Pe,yc,hc,xc,Sc,wc,bc,Ac,sn,Nt=y(()=>{"use strict";o();Lt=require("@elrondnetwork/erdjs"),rn=require("@reduxjs/toolkit"),nn=require("redux-persist");v();Le();fe();j();Re={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:ce},Dt={address:"",websocketEvent:null,accounts:{"":Re},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},on=(0,rn.createSlice)({name:"accountInfoSlice",initialState:Dt,reducers:{setAddress:(t,e)=>{let r=e.payload;t.address=r,t.publicKey=new Lt.Address(r).hex()},setAccount:(t,e)=>{let r=t.address===e.payload.address;t.accounts={[t.address]:r?e.payload:Re},t.isAccountLoading=!1,t.accountLoadingError=null},setAccountNonce:(t,e)=>{let{address:r}=t;t.accounts[r].nonce=e.payload},setAccountShard:(t,e)=>{t.shard=e.payload},setLedgerAccount:(t,e)=>{t.ledgerAccount=e.payload},updateLedgerAccount:(t,e)=>{t.ledgerAccount!=null&&(t.ledgerAccount.index=e.payload.index,t.ledgerAccount.address=e.payload.address)},setWalletConnectAccount:(t,e)=>{t.walletConnectAccount=e.payload},setIsAccountLoading:(t,e)=>{t.isAccountLoading=e.payload,t.accountLoadingError=null},setAccountLoadingError:(t,e)=>{t.accountLoadingError=e.payload,t.isAccountLoading=!1},setWebsocketEvent:(t,e)=>{t.websocketEvent={timestamp:Date.now(),message:e.payload}}},extraReducers:t=>{t.addCase(L,()=>(se.local.removeItem(te.loginExpiresAt),Dt)),t.addCase(Ce,(e,r)=>{let{address:n}=r.payload;e.address=n,e.publicKey=new Lt.Address(n).hex()}),t.addCase(nn.REHYDRATE,(e,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:i,shard:l,accounts:p,publicKey:m}=n;e.address=i,e.shard=l;let d=p&&i in p;e.accounts=d?p:Dt.accounts,e.publicKey=m})}}),{setAccount:an,setAddress:Tc,setAccountNonce:Pe,setAccountShard:yc,setLedgerAccount:hc,updateLedgerAccount:xc,setWalletConnectAccount:Sc,setIsAccountLoading:wc,setAccountLoadingError:bc,setWebsocketEvent:Ac}=on.actions,sn=on.reducer});function ln(t){return t!=null&&(Ii(t)||Li(t))}function _e(t){return t!=null&&(ki(t)||Ni(t))}function Me(t){return t!=null&&(Ei(t)||Ci(t))}function pn(t){return t!=null&&Di(t)}function Ii(t){return t!=null&&hi.includes(t)}function ki(t){return t!=null&&xi.includes(t)}function Ei(t){return t!=null&&Si.includes(t)}function Di(t){return t!=null&&wi.includes(t)}function Li(t){return t!=null&&bi.includes(t)}function Ni(t){return t!=null&&Ai.includes(t)}function Ci(t){return t!=null&&vi.includes(t)}var hi,xi,Si,wi,bi,Ai,vi,Ct=y(()=>{"use strict";o();P();hi=["sent"],xi=["success"],Si=["fail","cancelled","timedOut"],wi=["timedOut"],bi=["pending"],Ai=["success"],vi=["fail","invalid"]});var un,dn,he,Ri,mn,Rc,Rt,Pc,gn,Fc,_c,Mc,Oc,Bc,Uc,Oe,Be=y(()=>{"use strict";o();un=require("@reduxjs/toolkit"),dn=require("redux-persist");P();Ct();j();he={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Ri={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},mn=(0,un.createSlice)({name:"transactionsSlice",initialState:he,reducers:{moveTransactionsToSignedState:(t,e)=>{var d,g;let{sessionId:r,transactions:n,errorMessage:i,status:l,redirectRoute:p}=e.payload,m=((d=t.customTransactionInformationForSessionId)==null?void 0:d[r])||Ri;t.signedTransactions[r]={transactions:n,status:l,errorMessage:i,redirectRoute:p,customTransactionInformation:m},((g=t==null?void 0:t.transactionsToSign)==null?void 0:g.sessionId)===r&&(t.transactionsToSign=he.transactionsToSign)},clearSignedTransaction:(t,e)=>{t.signedTransactions[e.payload]&&delete t.signedTransactions[e.payload]},clearTransactionToSign:t=>{t!=null&&t.transactionsToSign&&(t.transactionsToSign=null)},updateSignedTransaction:(t,e)=>{t.signedTransactions=x(x({},t.signedTransactions),e.payload)},updateSignedTransactions:(t,e)=>{let{sessionId:r,status:n,errorMessage:i,transactions:l}=e.payload;t.signedTransactions[r]!=null&&(t.signedTransactions[r].status=n,i!=null&&(t.signedTransactions[r].errorMessage=i),l!=null&&(t.signedTransactions[r].transactions=l))},updateSignedTransactionStatus:(t,e)=>{var m,d,g,h,T,A;let{sessionId:r,status:n,errorMessage:i,transactionHash:l}=e.payload,p=(d=(m=t.signedTransactions)==null?void 0:m[r])==null?void 0:d.transactions;if(p!=null){t.signedTransactions[r].transactions=p.map(_=>_.hash===l?b(x({},_),{status:n,errorMessage:i}):_);let k=(h=(g=t.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:h.every(_=>_e(_.status)),N=(A=(T=t.signedTransactions[r])==null?void 0:T.transactions)==null?void 0:A.every(_=>Me(_.status));k&&(t.signedTransactions[r].status="success"),N&&(t.signedTransactions[r].status="fail")}},setTransactionsToSign:(t,e)=>{t.transactionsToSign=e.payload;let{sessionId:r,customTransactionInformation:n}=e.payload;t.customTransactionInformationForSessionId[r]=n,t.signTransactionsError=null},clearAllTransactionsToSign:t=>{t.transactionsToSign=he.transactionsToSign,t.signTransactionsError=null},clearAllSignedTransactions:t=>{t.signedTransactions=he.signedTransactions},setSignTransactionsError:(t,e)=>{t.signTransactionsError=e.payload},setSignTransactionsCancelMessage:(t,e)=>{t.signTransactionsCancelMessage=e.payload}},extraReducers:t=>{t.addCase(L,()=>he),t.addCase(dn.REHYDRATE,(e,r)=>{var p;if(e.signTransactionsCancelMessage=null,!((p=r.payload)!=null&&p.transactions))return;let{signedTransactions:n,customTransactionInformationForSessionId:i}=r.payload.transactions,l=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&&(e.customTransactionInformationForSessionId=i),n!=null&&(e.signedTransactions=l)})}}),{updateSignedTransactionStatus:Rc,updateSignedTransactions:Rt,setTransactionsToSign:Pc,clearAllTransactionsToSign:gn,clearAllSignedTransactions:Fc,clearSignedTransaction:_c,clearTransactionToSign:Mc,setSignTransactionsError:Oc,setSignTransactionsCancelMessage:Bc,moveTransactionsToSignedState:Uc}=mn.actions,Oe=mn.reducer});var fn,Ft,_t,Mt,Pi,Pt,Tn,Gc,Wc,qc,Ue,Ve=y(()=>{"use strict";o();fn=require("@reduxjs/toolkit");j();Ft="Transaction failed",_t="Transaction successful",Mt="Processing transaction",Pi="Transaction submitted",Pt={},Tn=(0,fn.createSlice)({name:"transactionsInfo",initialState:Pt,reducers:{setTransactionsDisplayInfo(t,e){let{sessionId:r,transactionsDisplayInfo:n}=e.payload;r!=null&&(t[r]={errorMessage:(n==null?void 0:n.errorMessage)||Ft,successMessage:(n==null?void 0:n.successMessage)||_t,processingMessage:(n==null?void 0:n.processingMessage)||Mt,submittedMessage:(n==null?void 0:n.submittedMessage)||Pi,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(t,e){e.payload!=null&&delete t[e.payload]},clearTransactionsInfo:()=>Pt},extraReducers:t=>{t.addCase(L,()=>Pt)}}),{clearTransactionsInfo:Gc,setTransactionsDisplayInfo:Wc,clearTransactionsInfoForSessionId:qc}=Tn.actions,Ue=Tn.reducer});var hn,yn,xn,Sn,Yc,Zc,Xc,wn,Ot=y(()=>{"use strict";o();hn=require("@reduxjs/toolkit");j();yn={},xn=(0,hn.createSlice)({name:"modalsSlice",initialState:yn,reducers:{setTxSubmittedModal:(t,e)=>{t.txSubmittedModal=e.payload},setNotificationModal:(t,e)=>{t.notificationModal=e.payload},clearTxSubmittedModal:t=>{t.txSubmittedModal=void 0},clearNotificationModal:t=>{t.notificationModal=void 0}},extraReducers:t=>{t.addCase(L,()=>yn)}}),{setTxSubmittedModal:Sn,setNotificationModal:Yc,clearTxSubmittedModal:Zc,clearNotificationModal:Xc}=xn.actions,wn=xn.reducer});var An,vn,bn,In,il,al,sl,cl,ll,pl,$e,He=y(()=>{"use strict";o();An=require("@reduxjs/toolkit"),vn=require("redux-persist");ht();q();ut();j();bn={customToasts:[],transactionToasts:[],failTransactionToast:null},In=(0,An.createSlice)({name:"toastsSlice",initialState:bn,reducers:{addCustomToast:(t,e)=>{t.customToasts.push(b(x({},e.payload),{type:"custom",toastId:e.payload.toastId||`custom-toast-${t.customToasts.length+1}`}))},removeCustomToast:(t,e)=>{t.customToasts=t.customToasts.filter(r=>r.toastId!==e.payload)},addTransactionToast:(t,e)=>{t.transactionToasts.push({type:"transaction",startTimestamp:De(),toastId:e.payload||`custom-toast-${t.transactionToasts.length+1}`})},removeTransactionToast:(t,e)=>{t.transactionToasts=t.transactionToasts.filter(r=>r.toastId!==e.payload)},addFailTransactionToast:(t,e)=>{t.failTransactionToast=b(x({},e.payload),{toastId:Vr})},removeFailTransactionToast:t=>{t.failTransactionToast=null}},extraReducers:t=>{t.addCase(L,()=>bn),t.addCase(vn.REHYDRATE,(e,r)=>{var i,l;let n=(l=(i=r.customToasts)==null?void 0:i.filter(p=>!("component"in p)))!=null?l:[];e.customToasts=n})}}),{addCustomToast:il,removeCustomToast:al,addTransactionToast:sl,removeTransactionToast:cl,addFailTransactionToast:ll,removeFailTransactionToast:pl}=In.actions,$e=In.reducer});var z=y(()=>{"use strict";o();bt();Et();Nt();Be();Ve();Ot();He()});var Vt=y(()=>{"use strict";o()});var _n,Fn,Mn,Zp,Xp,Jp,Qp,eu,tu,On,Bn=y(()=>{"use strict";o();_n=require("@reduxjs/toolkit");j();Fn={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Mn=(0,_n.createSlice)({name:"dappModalsSlice",initialState:Fn,reducers:{setDappModalVisibility:(t,e)=>{t.visible=e.payload},setDappModalHeaderVisibility:(t,e)=>{t.modal.showHeader=e.payload},setDappModalFooterVisibility:(t,e)=>{t.modal.showFooter=e.payload},setDappModalHeaderText:(t,e)=>{t.modal.headerText=e.payload},setDappModalFooterText:(t,e)=>{t.modal.footerText=e.payload},setDappModalConfig:(t,e)=>{t.modal=x({},e.payload)}},extraReducers:t=>{t.addCase(L,()=>Fn)}}),{setDappModalVisibility:Zp,setDappModalHeaderVisibility:Xp,setDappModalFooterVisibility:Jp,setDappModalHeaderText:Qp,setDappModalFooterText:eu,setDappModalConfig:tu}=Mn.actions,On=Mn.reducer});var Un,qi,ji,ue,qe=y(()=>{"use strict";o();Un=require("@reduxjs/toolkit");Vt();Nt();Bn();bt();Ot();Et();He();Ve();Be();qi={["account"]:sn,["networkConfig"]:tn,["loginInfo"]:zr,["modals"]:wn,["dappModal"]:On,["toasts"]:$e,["transactions"]:Oe,["transactionsInfo"]:Ue},ji=(t={})=>(0,Un.combineReducers)(x(x({},qi),t)),ue=ji});var Hn={};Z(Hn,{default:()=>Qi});function $t(t,e=[]){return{key:t,version:1,storage:$n.default,blacklist:e}}var re,Vn,$n,zi,Ki,Yi,Zi,Xi,Ji,Qi,Gn=y(()=>{"use strict";o();re=require("redux-persist"),Vn=S(require("redux-persist/lib/storage")),$n=S(require("redux-persist/lib/storage/session"));qe();z();He();Ve();Be();Vt();zi={2:t=>b(x({},t),{networkConfig:kt})};Ki=$t("dapp-core-transactionsInfo"),Yi=$t("dapp-core-transactions",["transactionsToSign"]),Zi=$t("dapp-core-toasts"),Xi={key:"dapp-core-store",version:2,storage:Vn.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,re.createMigrate)(zi,{debug:!1})},Ji={["toasts"]:(0,re.persistReducer)(Zi,$e),["transactions"]:(0,re.persistReducer)(Yi,Oe),["transactionsInfo"]:(0,re.persistReducer)(Ki,Ue)},Qi=(0,re.persistReducer)(Xi,ue(Ji))});var Wn={};Z(Wn,{default:()=>ea});var ea,qn=y(()=>{"use strict";o();qe();ea=ue()});var jn={};Z(jn,{default:()=>ra});var F,ta,ra,zn=y(()=>{"use strict";o();F=require("redux-persist"),ta=[F.FLUSH,F.REHYDRATE,F.PAUSE,F.PERSIST,F.PURGE,F.REGISTER],ra=ta});var Zn={};Z(Zn,{default:()=>Yn});function Yn(t){return(0,Kn.persistStore)(t)}var Kn,Xn=y(()=>{"use strict";o();Kn=require("redux-persist")});var Ba={};Z(Ba,{TransactionSender:()=>Oa});module.exports=ge(Ba);o();var Je=require("react"),So=require("@elrondnetwork/erdjs"),wo=require("@elrondnetwork/erdjs/out/signature");o();o();var mo=S(require("axios"));o();o();z();o();var kn=S(require("lodash.isequal")),Ge=require("reselect"),f=(0,Ge.createSelectorCreator)(Ge.defaultMemoize,kn.default);var W=t=>t.account,Bt=f(W,t=>t.address),xe=f(W,Bt,(t,e)=>e in t.accounts?t.accounts[e]:Re),Al=f(W,xe,(t,e)=>{let i=t,{accounts:r}=i,n=Xt(i,["accounts"]);return b(x({},n),{account:e})}),vl=f(xe,t=>t.balance),Il=f(xe,t=>{var e;return((e=t==null?void 0:t.nonce)==null?void 0:e.valueOf())||0}),kl=f(W,t=>t.shard),El=f(W,t=>t.ledgerAccount),Dl=f(W,t=>t.walletConnectAccount),Ll=f(W,t=>t.isAccountLoading),Nl=f(W,t=>t.accountLoadingError),Cl=f(W,t=>t.websocketEvent);o();var le=t=>t.networkConfig,Fl=f(le,t=>t.chainID),_l=f(le,t=>t.network.walletConnectBridgeAddress),Ml=f(le,t=>t.network.walletConnectV2RelayAddress),Ol=f(le,t=>t.network.walletConnectV2ProjectId),Bl=f(le,t=>t.network.walletConnectDeepLink),Se=f(le,t=>t.network),Fi=f(Se,t=>t.apiAddress),En=f(Se,t=>t.explorerAddress),Ul=f(Se,t=>t.egldLabel);o();P();var pe=t=>t.loginInfo,Wl=f(pe,t=>t.loginMethod),ql=f(pe,Bt,(t,e)=>t.loginMethod!=""&&Boolean(e)),jl=f(pe,t=>t.walletConnectLogin),zl=f(pe,t=>t.ledgerLogin),Kl=f(pe,t=>t.walletLogin),Yl=f(pe,t=>t.isLoginSessionInvalid);o();o();var C=require("@elrondnetwork/erdjs");v();o();function Ut(t){try{return a.Buffer.from(t,"base64").toString()===atob(t)}catch(e){return!1}}function we(t){var i,l,p;let{data:e}=t,r=Ut(e!=null?e:"")?C.TransactionPayload.fromEncoded(e):new C.TransactionPayload(e),n=new C.Transaction(x({value:t.value.valueOf(),data:r,nonce:t.nonce.valueOf(),receiver:new C.Address(t.receiver),sender:new C.Address(t.sender),gasLimit:(i=t.gasLimit.valueOf())!=null?i:xt,gasPrice:(l=t.gasPrice.valueOf())!=null?l:St,chainID:t.chainID.valueOf(),version:new C.TransactionVersion((p=t.version)!=null?p:$r)},t.options?{options:new C.TransactionOptions(t.options)}:{}));return n.applySignature({hex:()=>t.signature||""},new C.Address(t.sender)),n}o();Ct();o();var Mi=S(require("bignumber.js"));q();o();o();o();o();var Bi=require("@elrondnetwork/erdjs"),Ui=S(require("bignumber.js"));P();o();var Oi=require("@elrondnetwork/erdjs");o();o();o();var $i=require("@elrondnetwork/erdjs/out");o();v();o();var Cn=require("@elrondnetwork/erdjs");q();o();o();o();o();P();o();o();var Ht=require("@reduxjs/toolkit"),to=require("react-redux/es/utils/Subscription");z();o();var Rn=S(require("lodash.throttle"));v();z();ft();Le();fe();var Hi=[Ne],Gi=(0,Rn.default)(()=>{ye(Te())},5e3),Pn=t=>e=>r=>{var d;if(Hi.includes(r.type))return e(r);let n=t.getState(),i=se.local.getItem(te.loginExpiresAt);if(!((d=n==null?void 0:n.loginInfo)==null?void 0:d.isLoggedIn))return e(r);if(i==null)return ye(Te());let p=Date.now();return i-p<0?setTimeout(()=>X(void 0,null,function*(){console.log("session expired");try{t.dispatch(jr())}catch(g){console.error("error logging out",g)}}),1e3):(Gi(),e(r))};o();o();function We(){return typeof sessionStorage!="undefined"}var Jn=We()?(Gn(),ge(Hn)).default:(qn(),ge(Wn)).default,Qn=We()?(zn(),ge(jn)).default:[],eo=We()?(Xn(),ge(Zn)).default:t=>t;qe();var M=(0,Ht.configureStore)({reducer:Jn,middleware:t=>t({serializableCheck:{ignoredActions:[...Qn,Pe.type,an.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(Pn)}),ro=(0,to.createSubscription)(M),ku=eo(M),Eu=(0,Ht.configureStore)({reducer:ue});o();o();o();o();o();o();o();o();o();o();E();o();o();E();o();o();o();var ca=S(require("bignumber.js"));v();o();var sa=require("@elrondnetwork/erdjs"),Gt=S(require("bignumber.js"));v();o();var ia=S(require("bignumber.js"));o();Gt.default.config({ROUNDING_MODE:Gt.default.ROUND_FLOOR});o();o();o();v();o();o();o();o();v();o();v();o();var la=require("@elrondnetwork/erdjs");v();o();var Ke=require("@elrondnetwork/erdjs"),ua=require("@elrondnetwork/erdjs"),da=require("@elrondnetwork/erdjs-network-providers");v();o();o();var pa=S(require("bignumber.js"));v();o();v();o();o();o();o();o();v();o();E();var ga=["reDelegateRewards","claimRewards","unBond"],fa=["wrapEgld","unwrapEgld"],Ta=["unStake"],ya=["unDelegate"];o();o();o();v();o();var Sa=S(require("bignumber.js"));o();o();o();E();o();var wa=S(require("bignumber.js"));o();o();o();o();E();o();o();o();var Aa=S(require("anchorme"));o();v();o();var va=S(require("bignumber.js"));o();q();o();o();P();o();P();o();o();o();E();o();E();o();var Ia=S(require("bignumber.js"));v();E();o();E();o();var co=require("react");q();o();o();E();o();var ka=require("@elrondnetwork/erdjs/out"),Ea=S(require("bignumber.js"));E();o();E();o();o();P();var gT=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];o();var lo=require("react");q();o();var La=require("react");E();var wT=["create","localMint","ESDTLocalMint","addQuantity","burn","localBurn","ESDTLocalBurn","wipe","writeLog","signalError"];var Ze=t=>t.transactions,ne=f(Ze,t=>t.