@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 56 kB
JavaScript
"use strict";var Zo=Object.create;var he=Object.defineProperty,Xo=Object.defineProperties,Jo=Object.getOwnPropertyDescriptor,Qo=Object.getOwnPropertyDescriptors,ei=Object.getOwnPropertyNames,Le=Object.getOwnPropertySymbols,ti=Object.getPrototypeOf,dt=Object.prototype.hasOwnProperty,gr=Object.prototype.propertyIsEnumerable;var mr=(e,t,r)=>t in e?he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h=(e,t)=>{for(var r in t||(t={}))dt.call(t,r)&&mr(e,r,t[r]);if(Le)for(var r of Le(t))gr.call(t,r)&&mr(e,r,t[r]);return e},v=(e,t)=>Xo(e,Qo(t));var fr=e=>typeof e=="symbol"?e:e+"",Ne=(e,t)=>{var r={};for(var o in e)dt.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Le)for(var o of Le(e))t.indexOf(o)<0&&gr.call(e,o)&&(r[o]=e[o]);return r};var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var Pe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),te=(e,t)=>{for(var r in t)he(e,r,{get:t[r],enumerable:!0})},Tr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ei(t))!dt.call(e,i)&&i!==r&&he(e,i,{get:()=>t[i],enumerable:!(o=Jo(t,i))||o.enumerable});return e};var S=(e,t,r)=>(r=e!=null?Zo(ti(e)):{},Tr(t||!e||!e.__esModule?he(r,"default",{value:e,enumerable:!0}):r,e)),xe=e=>Tr(he({},"__esModule",{value:!0}),e);var b=(e,t,r)=>new Promise((o,i)=>{var p=d=>{try{m(r.next(d))}catch(g){i(g)}},l=d=>{try{m(r.throw(d))}catch(g){i(g)}},m=d=>d.done?o(d.value):Promise.resolve(d.value).then(p,l);m((r=r.apply(e,t)).next())});var xr=Pe(Ce=>{"use strict";n();Ce.byteLength=ni;Ce.toByteArray=ii;Ce.fromByteArray=ci;var B=[],_=[],ri=typeof Uint8Array!="undefined"?Uint8Array:Array,mt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(re=0,yr=mt.length;re<yr;++re)B[re]=mt[re],_[mt.charCodeAt(re)]=re;var re,yr;_["-".charCodeAt(0)]=62;_["_".charCodeAt(0)]=63;function hr(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 o=r===t?0:4-r%4;return[r,o]}function ni(e){var t=hr(e),r=t[0],o=t[1];return(r+o)*3/4-o}function oi(e,t,r){return(t+r)*3/4-r}function ii(e){var t,r=hr(e),o=r[0],i=r[1],p=new ri(oi(e,o,i)),l=0,m=i>0?o-4:o,d;for(d=0;d<m;d+=4)t=_[e.charCodeAt(d)]<<18|_[e.charCodeAt(d+1)]<<12|_[e.charCodeAt(d+2)]<<6|_[e.charCodeAt(d+3)],p[l++]=t>>16&255,p[l++]=t>>8&255,p[l++]=t&255;return i===2&&(t=_[e.charCodeAt(d)]<<2|_[e.charCodeAt(d+1)]>>4,p[l++]=t&255),i===1&&(t=_[e.charCodeAt(d)]<<10|_[e.charCodeAt(d+1)]<<4|_[e.charCodeAt(d+2)]>>2,p[l++]=t>>8&255,p[l++]=t&255),p}function ai(e){return B[e>>18&63]+B[e>>12&63]+B[e>>6&63]+B[e&63]}function si(e,t,r){for(var o,i=[],p=t;p<r;p+=3)o=(e[p]<<16&16711680)+(e[p+1]<<8&65280)+(e[p+2]&255),i.push(ai(o));return i.join("")}function ci(e){for(var t,r=e.length,o=r%3,i=[],p=16383,l=0,m=r-o;l<m;l+=p)i.push(si(e,l,l+p>m?m:l+p));return o===1?(t=e[r-1],i.push(B[t>>2]+B[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],i.push(B[t>>10]+B[t>>4&63]+B[t<<2&63]+"=")),i.join("")}});var Sr=Pe(gt=>{n();gt.read=function(e,t,r,o,i){var p,l,m=i*8-o-1,d=(1<<m)-1,g=d>>1,x=-7,T=r?i-1:0,E=r?-1:1,D=e[t+T];for(T+=E,p=D&(1<<-x)-1,D>>=-x,x+=m;x>0;p=p*256+e[t+T],T+=E,x-=8);for(l=p&(1<<-x)-1,p>>=-x,x+=o;x>0;l=l*256+e[t+T],T+=E,x-=8);if(p===0)p=1-g;else{if(p===d)return l?NaN:(D?-1:1)*(1/0);l=l+Math.pow(2,o),p=p-g}return(D?-1:1)*l*Math.pow(2,p-o)};gt.write=function(e,t,r,o,i,p){var l,m,d,g=p*8-i-1,x=(1<<g)-1,T=x>>1,E=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,D=o?0:p-1,P=o?1:-1,O=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,l=x):(l=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-l))<1&&(l--,d*=2),l+T>=1?t+=E/d:t+=E*Math.pow(2,1-T),t*d>=2&&(l++,d/=2),l+T>=x?(m=0,l=x):l+T>=1?(m=(t*d-1)*Math.pow(2,i),l=l+T):(m=t*Math.pow(2,T-1)*Math.pow(2,i),l=0));i>=8;e[r+D]=m&255,D+=P,m/=256,i-=8);for(l=l<<i|m,g+=i;g>0;e[r+D]=l&255,D+=P,l/=256,g-=8);e[r+D-P]|=O*128}});var Rr=Pe(pe=>{"use strict";n();var ft=xr(),le=Sr(),wr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;pe.Buffer=u;pe.SlowBuffer=gi;pe.INSPECT_MAX_BYTES=50;var Re=2147483647;pe.kMaxLength=Re;u.TYPED_ARRAY_SUPPORT=li();!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 li(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(r){return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function q(e){if(e>Re)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return xt(e)}return Ar(e,t,r)}u.poolSize=8192;function Ar(e,t,r){if(typeof e=="string")return ui(e,t);if(ArrayBuffer.isView(e))return di(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(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(U(e,SharedArrayBuffer)||e&&U(e.buffer,SharedArrayBuffer)))return yt(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(o!=null&&o!==e)return u.from(o,t,r);var i=mi(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}u.from=function(e,t,r){return Ar(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function Ir(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 pi(e,t,r){return Ir(e),e<=0?q(e):t!==void 0?typeof r=="string"?q(e).fill(t,r):q(e).fill(t):q(e)}u.alloc=function(e,t,r){return pi(e,t,r)};function xt(e){return Ir(e),q(e<0?0:St(e)|0)}u.allocUnsafe=function(e){return xt(e)};u.allocUnsafeSlow=function(e){return xt(e)};function ui(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=Er(e,t)|0,o=q(r),i=o.write(e,t);return i!==r&&(o=o.slice(0,i)),o}function Tt(e){for(var t=e.length<0?0:St(e.length)|0,r=q(t),o=0;o<t;o+=1)r[o]=e[o]&255;return r}function di(e){if(U(e,Uint8Array)){var t=new Uint8Array(e);return yt(t.buffer,t.byteOffset,t.byteLength)}return Tt(e)}function yt(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 o;return t===void 0&&r===void 0?o=new Uint8Array(e):r===void 0?o=new Uint8Array(e,t):o=new Uint8Array(e,t,r),Object.setPrototypeOf(o,u.prototype),o}function mi(e){if(u.isBuffer(e)){var t=St(e.length)|0,r=q(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||wt(e.length)?q(0):Tt(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Tt(e.data)}function St(e){if(e>=Re)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Re.toString(16)+" bytes");return e|0}function gi(e){return+e!=e&&(e=0),u.alloc(+e)}u.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==u.prototype};u.compare=function(t,r){if(U(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),U(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(t)||!u.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var o=t.length,i=r.length,p=0,l=Math.min(o,i);p<l;++p)if(t[p]!==r[p]){o=t[p],i=r[p];break}return o<i?-1:i<o?1:0};u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return u.alloc(0);var o;if(r===void 0)for(r=0,o=0;o<t.length;++o)r+=t[o].length;var i=u.allocUnsafe(r),p=0;for(o=0;o<t.length;++o){var l=t[o];if(U(l,Uint8Array))p+l.length>i.length?u.from(l).copy(i,p):Uint8Array.prototype.set.call(i,l,p);else if(u.isBuffer(l))l.copy(i,p);else throw new TypeError('"list" argument must be an Array of Buffers');p+=l.length}return i};function Er(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||U(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,o=arguments.length>2&&arguments[2]===!0;if(!o&&r===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return ht(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Cr(e).length;default:if(i)return o?-1:ht(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=Er;function fi(e,t,r){var o=!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 Ii(this,t,r);case"utf8":case"utf-8":return Dr(this,t,r);case"ascii":return vi(this,t,r);case"latin1":case"binary":return Ai(this,t,r);case"base64":return wi(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ei(this,t,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}u.prototype._isBuffer=!0;function ne(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}u.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)ne(this,r,r+1);return this};u.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)ne(this,r,r+3),ne(this,r+1,r+2);return this};u.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)ne(this,r,r+7),ne(this,r+1,r+6),ne(this,r+2,r+5),ne(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?Dr(this,0,t):fi.apply(this,arguments)};u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:u.compare(this,t)===0};u.prototype.inspect=function(){var t="",r=pe.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};wr&&(u.prototype[wr]=u.prototype.inspect);u.prototype.compare=function(t,r,o,i,p){if(U(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),o===void 0&&(o=t?t.length:0),i===void 0&&(i=0),p===void 0&&(p=this.length),r<0||o>t.length||i<0||p>this.length)throw new RangeError("out of range index");if(i>=p&&r>=o)return 0;if(i>=p)return-1;if(r>=o)return 1;if(r>>>=0,o>>>=0,i>>>=0,p>>>=0,this===t)return 0;for(var l=p-i,m=o-r,d=Math.min(l,m),g=this.slice(i,p),x=t.slice(r,o),T=0;T<d;++T)if(g[T]!==x[T]){l=g[T],m=x[T];break}return l<m?-1:m<l?1:0};function kr(e,t,r,o,i){if(e.length===0)return-1;if(typeof r=="string"?(o=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,wt(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=u.from(t,o)),u.isBuffer(t))return t.length===0?-1:br(e,t,r,o,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):br(e,[t],r,o,i);throw new TypeError("val must be string, number or Buffer")}function br(e,t,r,o,i){var p=1,l=e.length,m=t.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(e.length<2||t.length<2)return-1;p=2,l/=2,m/=2,r/=2}function d(D,P){return p===1?D[P]:D.readUInt16BE(P*p)}var g;if(i){var x=-1;for(g=r;g<l;g++)if(d(e,g)===d(t,x===-1?0:g-x)){if(x===-1&&(x=g),g-x+1===m)return x*p}else x!==-1&&(g-=g-x),x=-1}else for(r+m>l&&(r=l-m),g=r;g>=0;g--){for(var T=!0,E=0;E<m;E++)if(d(e,g+E)!==d(t,E)){T=!1;break}if(T)return g}return-1}u.prototype.includes=function(t,r,o){return this.indexOf(t,r,o)!==-1};u.prototype.indexOf=function(t,r,o){return kr(this,t,r,o,!0)};u.prototype.lastIndexOf=function(t,r,o){return kr(this,t,r,o,!1)};function Ti(e,t,r,o){r=Number(r)||0;var i=e.length-r;o?(o=Number(o),o>i&&(o=i)):o=i;var p=t.length;o>p/2&&(o=p/2);for(var l=0;l<o;++l){var m=parseInt(t.substr(l*2,2),16);if(wt(m))return l;e[r+l]=m}return l}function yi(e,t,r,o){return Fe(ht(t,e.length-r),e,r,o)}function hi(e,t,r,o){return Fe(Li(t),e,r,o)}function xi(e,t,r,o){return Fe(Cr(t),e,r,o)}function Si(e,t,r,o){return Fe(Ni(t,e.length-r),e,r,o)}u.prototype.write=function(t,r,o,i){if(r===void 0)i="utf8",o=this.length,r=0;else if(o===void 0&&typeof r=="string")i=r,o=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(o)?(o=o>>>0,i===void 0&&(i="utf8")):(i=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var p=this.length-r;if((o===void 0||o>p)&&(o=p),t.length>0&&(o<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var l=!1;;)switch(i){case"hex":return Ti(this,t,r,o);case"utf8":case"utf-8":return yi(this,t,r,o);case"ascii":case"latin1":case"binary":return hi(this,t,r,o);case"base64":return xi(this,t,r,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Si(this,t,r,o);default:if(l)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),l=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function wi(e,t,r){return t===0&&r===e.length?ft.fromByteArray(e):ft.fromByteArray(e.slice(t,r))}function Dr(e,t,r){r=Math.min(e.length,r);for(var o=[],i=t;i<r;){var p=e[i],l=null,m=p>239?4:p>223?3:p>191?2:1;if(i+m<=r){var d,g,x,T;switch(m){case 1:p<128&&(l=p);break;case 2:d=e[i+1],(d&192)===128&&(T=(p&31)<<6|d&63,T>127&&(l=T));break;case 3:d=e[i+1],g=e[i+2],(d&192)===128&&(g&192)===128&&(T=(p&15)<<12|(d&63)<<6|g&63,T>2047&&(T<55296||T>57343)&&(l=T));break;case 4:d=e[i+1],g=e[i+2],x=e[i+3],(d&192)===128&&(g&192)===128&&(x&192)===128&&(T=(p&15)<<18|(d&63)<<12|(g&63)<<6|x&63,T>65535&&T<1114112&&(l=T))}}l===null?(l=65533,m=1):l>65535&&(l-=65536,o.push(l>>>10&1023|55296),l=56320|l&1023),o.push(l),i+=m}return bi(o)}var vr=4096;function bi(e){var t=e.length;if(t<=vr)return String.fromCharCode.apply(String,e);for(var r="",o=0;o<t;)r+=String.fromCharCode.apply(String,e.slice(o,o+=vr));return r}function vi(e,t,r){var o="";r=Math.min(e.length,r);for(var i=t;i<r;++i)o+=String.fromCharCode(e[i]&127);return o}function Ai(e,t,r){var o="";r=Math.min(e.length,r);for(var i=t;i<r;++i)o+=String.fromCharCode(e[i]);return o}function Ii(e,t,r){var o=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>o)&&(r=o);for(var i="",p=t;p<r;++p)i+=Pi[e[p]];return i}function Ei(e,t,r){for(var o=e.slice(t,r),i="",p=0;p<o.length-1;p+=2)i+=String.fromCharCode(o[p]+o[p+1]*256);return i}u.prototype.slice=function(t,r){var o=this.length;t=~~t,r=r===void 0?o:~~r,t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),r<0?(r+=o,r<0&&(r=0)):r>o&&(r=o),r<t&&(r=t);var i=this.subarray(t,r);return Object.setPrototypeOf(i,u.prototype),i};function k(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||k(t,r,this.length);for(var i=this[t],p=1,l=0;++l<r&&(p*=256);)i+=this[t+l]*p;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||k(t,r,this.length);for(var i=this[t+--r],p=1;r>0&&(p*=256);)i+=this[t+--r]*p;return i};u.prototype.readUint8=u.prototype.readUInt8=function(t,r){return t=t>>>0,r||k(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||k(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||k(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||k(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||k(t,r,this.length);for(var i=this[t],p=1,l=0;++l<r&&(p*=256);)i+=this[t+l]*p;return p*=128,i>=p&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||k(t,r,this.length);for(var i=r,p=1,l=this[t+--i];i>0&&(p*=256);)l+=this[t+--i]*p;return p*=128,l>=p&&(l-=Math.pow(2,8*r)),l};u.prototype.readInt8=function(t,r){return t=t>>>0,r||k(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||k(t,2,this.length);var o=this[t]|this[t+1]<<8;return o&32768?o|4294901760:o};u.prototype.readInt16BE=function(t,r){t=t>>>0,r||k(t,2,this.length);var o=this[t+1]|this[t]<<8;return o&32768?o|4294901760:o};u.prototype.readInt32LE=function(t,r){return t=t>>>0,r||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};u.prototype.readInt32BE=function(t,r){return t=t>>>0,r||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};u.prototype.readFloatLE=function(t,r){return t=t>>>0,r||k(t,4,this.length),le.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||k(t,4,this.length),le.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||k(t,8,this.length),le.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||k(t,8,this.length),le.read(this,t,!1,52,8)};function C(e,t,r,o,i,p){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<p)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,r,o,i){if(t=+t,r=r>>>0,o=o>>>0,!i){var p=Math.pow(2,8*o)-1;C(this,t,r,o,p,0)}var l=1,m=0;for(this[r]=t&255;++m<o&&(l*=256);)this[r+m]=t/l&255;return r+o};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,r,o,i){if(t=+t,r=r>>>0,o=o>>>0,!i){var p=Math.pow(2,8*o)-1;C(this,t,r,o,p,0)}var l=o-1,m=1;for(this[r+l]=t&255;--l>=0&&(m*=256);)this[r+l]=t/m&255;return r+o};u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,1,255,0),this[r]=t&255,r+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};u.prototype.writeIntLE=function(t,r,o,i){if(t=+t,r=r>>>0,!i){var p=Math.pow(2,8*o-1);C(this,t,r,o,p-1,-p)}var l=0,m=1,d=0;for(this[r]=t&255;++l<o&&(m*=256);)t<0&&d===0&&this[r+l-1]!==0&&(d=1),this[r+l]=(t/m>>0)-d&255;return r+o};u.prototype.writeIntBE=function(t,r,o,i){if(t=+t,r=r>>>0,!i){var p=Math.pow(2,8*o-1);C(this,t,r,o,p-1,-p)}var l=o-1,m=1,d=0;for(this[r+l]=t&255;--l>=0&&(m*=256);)t<0&&d===0&&this[r+l+1]!==0&&(d=1),this[r+l]=(t/m>>0)-d&255;return r+o};u.prototype.writeInt8=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};u.prototype.writeInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeInt16BE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeInt32LE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};u.prototype.writeInt32BE=function(t,r,o){return t=+t,r=r>>>0,o||C(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 Lr(e,t,r,o,i,p){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Nr(e,t,r,o,i){return t=+t,r=r>>>0,i||Lr(e,t,r,4,34028234663852886e22,-34028234663852886e22),le.write(e,t,r,o,23,4),r+4}u.prototype.writeFloatLE=function(t,r,o){return Nr(this,t,r,!0,o)};u.prototype.writeFloatBE=function(t,r,o){return Nr(this,t,r,!1,o)};function Pr(e,t,r,o,i){return t=+t,r=r>>>0,i||Lr(e,t,r,8,17976931348623157e292,-17976931348623157e292),le.write(e,t,r,o,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,o){return Pr(this,t,r,!0,o)};u.prototype.writeDoubleBE=function(t,r,o){return Pr(this,t,r,!1,o)};u.prototype.copy=function(t,r,o,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(o||(o=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<o&&(i=o),i===o||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=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-o&&(i=t.length-r+o);var p=i-o;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,o,i):Uint8Array.prototype.set.call(t,this.subarray(o,i),r),p};u.prototype.fill=function(t,r,o,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,o=this.length):typeof o=="string"&&(i=o,o=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var p=t.charCodeAt(0);(i==="utf8"&&p<128||i==="latin1")&&(t=p)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<o)throw new RangeError("Out of range index");if(o<=r)return this;r=r>>>0,o=o===void 0?this.length:o>>>0,t||(t=0);var l;if(typeof t=="number")for(l=r;l<o;++l)this[l]=t;else{var m=u.isBuffer(t)?t:u.from(t,i),d=m.length;if(d===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(l=0;l<o-r;++l)this[l+r]=m[l%d]}return this};var ki=/[^+/0-9A-Za-z-_]/g;function Di(e){if(e=e.split("=")[0],e=e.trim().replace(ki,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function ht(e,t){t=t||1/0;for(var r,o=e.length,i=null,p=[],l=0;l<o;++l){if(r=e.charCodeAt(l),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&p.push(239,191,189);continue}else if(l+1===o){(t-=3)>-1&&p.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&p.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&p.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;p.push(r)}else if(r<2048){if((t-=2)<0)break;p.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;p.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;p.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return p}function Li(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Ni(e,t){for(var r,o,i,p=[],l=0;l<e.length&&!((t-=2)<0);++l)r=e.charCodeAt(l),o=r>>8,i=r%256,p.push(i),p.push(o);return p}function Cr(e){return ft.toByteArray(Di(e))}function Fe(e,t,r,o){for(var i=0;i<o&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function U(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function wt(e){return e!==e}var Pi=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=r*16,i=0;i<16;++i)t[o+i]=e[r]+e[i];return t}()});var Br=Pe((Ss,Or)=>{n();var A=Or.exports={},$,V;function bt(){throw new Error("setTimeout has not been defined")}function vt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?$=setTimeout:$=bt}catch(e){$=bt}try{typeof clearTimeout=="function"?V=clearTimeout:V=vt}catch(e){V=vt}})();function Fr(e){if($===setTimeout)return setTimeout(e,0);if(($===bt||!$)&&setTimeout)return $=setTimeout,setTimeout(e,0);try{return $(e,0)}catch(t){try{return $.call(null,e,0)}catch(r){return $.call(this,e,0)}}}function Ci(e){if(V===clearTimeout)return clearTimeout(e);if((V===vt||!V)&&clearTimeout)return V=clearTimeout,clearTimeout(e);try{return V(e)}catch(t){try{return V.call(null,e)}catch(r){return V.call(this,e)}}}var j=[],ue=!1,oe,_e=-1;function Ri(){!ue||!oe||(ue=!1,oe.length?j=oe.concat(j):_e=-1,j.length&&_r())}function _r(){if(!ue){var e=Fr(Ri);ue=!0;for(var t=j.length;t;){for(oe=j,j=[];++_e<t;)oe&&oe[_e].run();_e=-1,t=j.length}oe=null,ue=!1,Ci(e)}}A.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];j.push(new Mr(e,t)),j.length===1&&!ue&&Fr(_r)};function Mr(e,t){this.fun=e,this.array=t}Mr.prototype.run=function(){this.fun.apply(null,this.array)};A.title="browser";A.browser=!0;A.env={};A.argv=[];A.version="";A.versions={};function K(){}A.on=K;A.addListener=K;A.once=K;A.off=K;A.removeListener=K;A.removeAllListeners=K;A.emit=K;A.prependListener=K;A.prependOnceListener=K;A.listeners=function(e){return[]};A.binding=function(e){throw new Error("process.binding is not supported")};A.cwd=function(){return"/"};A.chdir=function(e){throw new Error("process.chdir is not supported")};A.umask=function(){return 0}});var a,s,ws,n=y(()=>{a=S(Rr()),s=S(Br()),ws=function(e){function t(){var o=this||self;return delete e.prototype.__magic__,o}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 Me,At=y(()=>{"use strict";n();Me=()=>Date.now()/1e3});var Ur=y(()=>{"use strict";n()});var $r=y(()=>{"use strict";n()});var Vr=y(()=>{"use strict";n();At();Ur();$r()});var Et={};te(Et,{getItem:()=>_i,localStorageKeys:()=>H,removeItem:()=>Mi,setItem:()=>Fi});var H,It,Fi,_i,Mi,de=y(()=>{"use strict";n();Vr();H={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},It=typeof localStorage!="undefined",Fi=({key:e,data:t,expires:r})=>{!It||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},_i=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:Me()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},Mi=e=>{!It||localStorage.removeItem(String(e))}});var kt={};te(kt,{clear:()=>zr,getItem:()=>Gr,removeItem:()=>Wr,setItem:()=>Hr,storage:()=>Oi});var Hr,Gr,Wr,zr,Oi,qr=y(()=>{"use strict";n();Hr=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Gr=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},Wr=e=>sessionStorage.removeItem(String(e)),zr=()=>sessionStorage.clear(),Oi={setItem:Hr,getItem:Gr,removeItem:Wr,clear:zr}});var Y,Se=y(()=>{"use strict";n();de();qr();Y={session:kt,local:Et}});function we(){return new Date().setHours(new Date().getHours()+24)}function be(e){Y.local.setItem({key:H.loginExpiresAt,data:e,expires:e})}var Dt=y(()=>{"use strict";n();Se();de()});var R=y(()=>{"use strict";n()});var jr=y(()=>{"use strict";n()});var Kr=y(()=>{"use strict";n()});var N=y(()=>{"use strict";n()});var Yr=y(()=>{"use strict";n()});var Zr=y(()=>{"use strict";n()});var Xr=y(()=>{"use strict";n()});var Jr=y(()=>{"use strict";n()});var G=y(()=>{"use strict";n();Kr();N();R();Yr();Zr();Xr();Jr()});var ie,Qr,Ys,en,Zs,tn,Xs,Js,Bi,me=y(()=>{"use strict";n();G();ie={devnet:{id:"devnet",chainId:"D",name:"Devnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://devnet-wallet.elrond.com",apiAddress:"https://devnet-api.elrond.com",explorerAddress:"http://devnet-explorer.elrond.com",apiTimeout:"4000"},testnet:{id:"testnet",chainId:"T",name:"Testnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://testnet-wallet.elrond.com",apiAddress:"https://testnet-api.elrond.com",explorerAddress:"http://testnet-explorer.elrond.com",apiTimeout:"4000"},mainnet:{id:"mainnet",chainId:"1",name:"Mainnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://wallet.elrond.com",apiAddress:"https://api.elrond.com",explorerAddress:"https://explorer.elrond.com",apiTimeout:"4000"}},{chainId:Qr,egldLabel:Ys}=ie["devnet"],{chainId:en,egldLabel:Zs}=ie["testnet"],{chainId:tn,egldLabel:Xs}=ie["mainnet"],Js={["devnet"]:Qr,["testnet"]:en,["mainnet"]:tn},Bi={[Qr]:"devnet",[en]:"testnet",[tn]:"mainnet"}});var Lt=y(()=>{"use strict";n()});var rn=y(()=>{"use strict";n()});var nn,Nt=y(()=>{"use strict";n();nn="transaction-status-toast-id"});var Pt,Ct,on,Oe,an,ge,I=y(()=>{"use strict";n();jr();me();Lt();rn();Nt();Pt=5e4,Ct=1e9,on=1,Oe="logout",an="login",ge="0"});var Rt,L,ve,W=y(()=>{"use strict";n();Rt=require("@reduxjs/toolkit");I();L=(0,Rt.createAction)(Oe),ve=(0,Rt.createAction)(an,e=>({payload:e}))});var cn,sn,ln,Tc,yc,hc,xc,Sc,wc,pn,un,Ft=y(()=>{"use strict";n();cn=require("@reduxjs/toolkit");Dt();R();W();sn={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},ln=(0,cn.createSlice)({name:"loginInfoSlice",initialState:sn,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(L,()=>sn),e.addCase(ve,(t,r)=>{t.loginMethod=r.payload.loginMethod,be(we())})}}),{setLoginMethod:Tc,setWalletConnectLogin:yc,setLedgerLogin:hc,setTokenLogin:xc,setTokenLoginSignature:Sc,setWalletLogin:wc,invalidateLoginSession:pn}=ln.actions,un=ln.reducer});var dn,mn,_t,Mt=y(()=>{"use strict";n();dn=!1,mn=(e=!0)=>{dn=e},_t=(e,t=0)=>{dn||setTimeout(()=>{window.location.href=e},t)}});var gn=y(()=>{"use strict";n();Mt()});function Ot(e){return e[Math.floor(Math.random()*e.length)]}var fn=y(()=>{"use strict";n()});var Tn=y(()=>{"use strict";n();Lt()});var yn=y(()=>{"use strict";n();gn();fn();Tn()});var hn,xn,Bt,Ui,Sn,Ut,Mc,wn,Be=y(()=>{"use strict";n();hn=require("@reduxjs/toolkit"),xn=S(require("lodash.omit"));yn();Bt={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Ui={network:Bt,chainID:"-1"},Sn=(0,hn.createSlice)({name:"appConfig",initialState:Ui,reducers:{initializeNetworkConfig:(e,t)=>{let r=Ot(t.payload.walletConnectBridgeAddresses),o=Ot(t.payload.walletConnectV2RelayAddresses),i=(0,xn.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=v(h(h({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:o})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:Ut,setChainID:Mc}=Sn.actions,wn=Sn.reducer});var Vt,bn,vn,Ue,$t,An,Ht,Wc,Gt,In,zc,qc,jc,Kc,Yc,Zc,En,Wt=y(()=>{"use strict";n();Vt=require("@elrondnetwork/erdjs"),bn=require("@reduxjs/toolkit"),vn=require("redux-persist");I();Se();de();W();Ue={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:ge},$t={address:"",websocketEvent:null,accounts:{"":Ue},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},An=(0,bn.createSlice)({name:"accountInfoSlice",initialState:$t,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new Vt.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Ue},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(L,()=>(Y.local.removeItem(H.loginExpiresAt),$t)),e.addCase(ve,(t,r)=>{let{address:o}=r.payload;t.address=o,t.publicKey=new Vt.Address(o).hex()}),e.addCase(vn.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:o}=r.payload,{address:i,shard:p,accounts:l,publicKey:m}=o;t.address=i,t.shard=p;let d=l&&i in l;t.accounts=d?l:$t.accounts,t.publicKey=m})}}),{setAccount:Ht,setAddress:Wc,setAccountNonce:Gt,setAccountShard:In,setLedgerAccount:zc,updateLedgerAccount:qc,setWalletConnectAccount:jc,setIsAccountLoading:Kc,setAccountLoadingError:Yc,setWebsocketEvent:Zc}=An.actions,En=An.reducer});function kn(e){return e!=null&&(Ki(e)||Ji(e))}function $e(e){return e!=null&&(Yi(e)||Qi(e))}function Ve(e){return e!=null&&(Zi(e)||ea(e))}function Dn(e){return e!=null&&Xi(e)}function Ki(e){return e!=null&&Vi.includes(e)}function Yi(e){return e!=null&&Hi.includes(e)}function Zi(e){return e!=null&&Gi.includes(e)}function Xi(e){return e!=null&&Wi.includes(e)}function Ji(e){return e!=null&&zi.includes(e)}function Qi(e){return e!=null&&qi.includes(e)}function ea(e){return e!=null&&ji.includes(e)}var Vi,Hi,Gi,Wi,zi,qi,ji,qt=y(()=>{"use strict";n();R();Vi=["sent"],Hi=["success"],Gi=["fail","cancelled","timedOut"],Wi=["timedOut"],zi=["pending"],qi=["success"],ji=["fail","invalid"]});var Ln,Nn,Ie,ta,Pn,il,al,sl,cl,ll,pl,ul,dl,ml,gl,He,Ge=y(()=>{"use strict";n();Ln=require("@reduxjs/toolkit"),Nn=require("redux-persist");R();qt();W();Ie={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},ta={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Pn=(0,Ln.createSlice)({name:"transactionsSlice",initialState:Ie,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,g;let{sessionId:r,transactions:o,errorMessage:i,status:p,redirectRoute:l}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||ta;e.signedTransactions[r]={transactions:o,status:p,errorMessage:i,redirectRoute:l,customTransactionInformation:m},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===r&&(e.transactionsToSign=Ie.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=h(h({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:o,errorMessage:i,transactions:p}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=o,i!=null&&(e.signedTransactions[r].errorMessage=i),p!=null&&(e.signedTransactions[r].transactions=p))},updateSignedTransactionStatus:(e,t)=>{var m,d,g,x,T,E;let{sessionId:r,status:o,errorMessage:i,transactionHash:p}=t.payload,l=(d=(m=e.signedTransactions)==null?void 0:m[r])==null?void 0:d.transactions;if(l!=null){e.signedTransactions[r].transactions=l.map(O=>O.hash===p?v(h({},O),{status:o,errorMessage:i}):O);let D=(x=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:x.every(O=>$e(O.status)),P=(E=(T=e.signedTransactions[r])==null?void 0:T.transactions)==null?void 0:E.every(O=>Ve(O.status));D&&(e.signedTransactions[r].status="success"),P&&(e.signedTransactions[r].status="fail")}},setTransactionsToSign:(e,t)=>{e.transactionsToSign=t.payload;let{sessionId:r,customTransactionInformation:o}=t.payload;e.customTransactionInformationForSessionId[r]=o,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=Ie.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Ie.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(L,()=>Ie),e.addCase(Nn.REHYDRATE,(t,r)=>{var l;if(t.signTransactionsCancelMessage=null,!((l=r.payload)!=null&&l.transactions))return;let{signedTransactions:o,customTransactionInformationForSessionId:i}=r.payload.transactions,p=Object.entries(o).reduce((m,[d,g])=>{let x=new Date(d),T=new Date;return T.setHours(T.getHours()+5),T-x>0||(m[d]=g),m},{});i!=null&&(t.customTransactionInformationForSessionId=i),o!=null&&(t.signedTransactions=p)})}}),{updateSignedTransactionStatus:il,updateSignedTransactions:al,setTransactionsToSign:sl,clearAllTransactionsToSign:cl,clearAllSignedTransactions:ll,clearSignedTransaction:pl,clearTransactionToSign:ul,setSignTransactionsError:dl,setSignTransactionsCancelMessage:ml,moveTransactionsToSignedState:gl}=Pn.actions,He=Pn.reducer});var Cn,Kt,Yt,Zt,ra,jt,Rn,hl,xl,Sl,We,ze=y(()=>{"use strict";n();Cn=require("@reduxjs/toolkit");W();Kt="Transaction failed",Yt="Transaction successful",Zt="Processing transaction",ra="Transaction submitted",jt={},Rn=(0,Cn.createSlice)({name:"transactionsInfo",initialState:jt,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:o}=t.payload;r!=null&&(e[r]={errorMessage:(o==null?void 0:o.errorMessage)||Kt,successMessage:(o==null?void 0:o.successMessage)||Yt,processingMessage:(o==null?void 0:o.processingMessage)||Zt,submittedMessage:(o==null?void 0:o.submittedMessage)||ra,transactionDuration:o==null?void 0:o.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>jt},extraReducers:e=>{e.addCase(L,()=>jt)}}),{clearTransactionsInfo:hl,setTransactionsDisplayInfo:xl,clearTransactionsInfoForSessionId:Sl}=Rn.actions,We=Rn.reducer});var _n,Fn,Mn,Al,Il,El,kl,On,Xt=y(()=>{"use strict";n();_n=require("@reduxjs/toolkit");W();Fn={},Mn=(0,_n.createSlice)({name:"modalsSlice",initialState:Fn,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(L,()=>Fn)}}),{setTxSubmittedModal:Al,setNotificationModal:Il,clearTxSubmittedModal:El,clearNotificationModal:kl}=Mn.actions,On=Mn.reducer});var Un,$n,Bn,Vn,_l,Ml,Ol,Bl,Ul,$l,qe,je=y(()=>{"use strict";n();Un=require("@reduxjs/toolkit"),$n=require("redux-persist");Nt();G();At();W();Bn={customToasts:[],transactionToasts:[],failTransactionToast:null},Vn=(0,Un.createSlice)({name:"toastsSlice",initialState:Bn,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(v(h({},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:Me(),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=v(h({},t.payload),{toastId:nn})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(L,()=>Bn),e.addCase($n.REHYDRATE,(t,r)=>{var i,p;let o=(p=(i=r.customToasts)==null?void 0:i.filter(l=>!("component"in l)))!=null?p:[];t.customToasts=o})}}),{addCustomToast:_l,removeCustomToast:Ml,addTransactionToast:Ol,removeTransactionToast:Bl,addFailTransactionToast:Ul,removeFailTransactionToast:$l}=Vn.actions,qe=Vn.reducer});var Z=y(()=>{"use strict";n();Ft();Be();Wt();Ge();ze();Xt();je()});var er=y(()=>{"use strict";n()});var to,eo,ro,Su,wu,bu,vu,Au,Iu,no,oo=y(()=>{"use strict";n();to=require("@reduxjs/toolkit");W();eo={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},ro=(0,to.createSlice)({name:"dappModalsSlice",initialState:eo,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=h({},t.payload)}},extraReducers:e=>{e.addCase(L,()=>eo)}}),{setDappModalVisibility:Su,setDappModalHeaderVisibility:wu,setDappModalFooterVisibility:bu,setDappModalHeaderText:vu,setDappModalFooterText:Au,setDappModalConfig:Iu}=ro.actions,no=ro.reducer});var io,ga,fa,Te,et=y(()=>{"use strict";n();io=require("@reduxjs/toolkit");er();Wt();oo();Ft();Xt();Be();je();ze();Ge();ga={["account"]:En,["networkConfig"]:wn,["loginInfo"]:un,["modals"]:On,["dappModal"]:no,["toasts"]:qe,["transactions"]:He,["transactionsInfo"]:We},fa=(e={})=>(0,io.combineReducers)(h(h({},ga),e)),Te=fa});var co={};te(co,{default:()=>ba});function tr(e,t=[]){return{key:e,version:1,storage:so.default,blacklist:t}}var ce,ao,so,Ta,ya,ha,xa,Sa,wa,ba,lo=y(()=>{"use strict";n();ce=require("redux-persist"),ao=S(require("redux-persist/lib/storage")),so=S(require("redux-persist/lib/storage/session"));et();Z();je();ze();Ge();er();Ta={2:e=>v(h({},e),{networkConfig:Bt})};ya=tr("dapp-core-transactionsInfo"),ha=tr("dapp-core-transactions",["transactionsToSign"]),xa=tr("dapp-core-toasts"),Sa={key:"dapp-core-store",version:2,storage:ao.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,ce.createMigrate)(Ta,{debug:!1})},wa={["toasts"]:(0,ce.persistReducer)(xa,qe),["transactions"]:(0,ce.persistReducer)(ha,He),["transactionsInfo"]:(0,ce.persistReducer)(ya,We)},ba=(0,ce.persistReducer)(Sa,Te(wa))});var po={};te(po,{default:()=>va});var va,uo=y(()=>{"use strict";n();et();va=Te()});var mo={};te(mo,{default:()=>Ia});var M,Aa,Ia,go=y(()=>{"use strict";n();M=require("redux-persist"),Aa=[M.FLUSH,M.REHYDRATE,M.PAUSE,M.PERSIST,M.PURGE,M.REGISTER],Ia=Aa});var yo={};te(yo,{default:()=>To});function To(e){return(0,fo.persistStore)(e)}var fo,ho=y(()=>{"use strict";n();fo=require("redux-persist")});var fs={};te(fs,{AppInitializer:()=>gs});module.exports=xe(fs);n();var z=S(require("react")),jo=require("@elrondnetwork/erdjs/out");n();n();n();var es=S(require("axios"));n();n();Z();n();var Hn=S(require("lodash.isequal")),Ke=require("reselect"),f=(0,Ke.createSelectorCreator)(Ke.defaultMemoize,Hn.default);var X=e=>e.account,ae=f(X,e=>e.address),Ye=f(X,ae,(e,t)=>t in e.accounts?e.accounts[t]:Ue),Gn=f(X,Ye,(e,t)=>{let i=e,{accounts:r}=i,o=Ne(i,["accounts"]);return v(h({},o),{account:t})}),Ql=f(Ye,e=>e.balance),na=f(Ye,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),Wn=f(X,e=>e.shard),ep=f(X,e=>e.ledgerAccount),tp=f(X,e=>e.walletConnectAccount),rp=f(X,e=>e.isAccountLoading),np=f(X,e=>e.accountLoadingError),op=f(X,e=>e.websocketEvent);n();var se=e=>e.networkConfig,sp=f(se,e=>e.chainID),cp=f(se,e=>e.network.walletConnectBridgeAddress),lp=f(se,e=>e.network.walletConnectV2RelayAddress),pp=f(se,e=>e.network.walletConnectV2ProjectId),up=f(se,e=>e.network.walletConnectDeepLink),Ze=f(se,e=>e.network),Xe=f(Ze,e=>e.apiAddress),zn=f(Ze,e=>e.explorerAddress),dp=f(Ze,e=>e.egldLabel);n();R();var fe=e=>e.loginInfo,yp=f(fe,e=>e.loginMethod),Je=f(fe,ae,(e,t)=>e.loginMethod!=""&&Boolean(t)),hp=f(fe,e=>e.walletConnectLogin),xp=f(fe,e=>e.ledgerLogin),qn=f(fe,e=>e.walletLogin),jn=f(fe,e=>e.isLoginSessionInvalid);n();n();var F=require("@elrondnetwork/erdjs");I();n();function Jt(e){try{return a.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function Qt(e){var i,p,l;let{data:t}=e,r=Jt(t!=null?t:"")?F.TransactionPayload.fromEncoded(t):new F.TransactionPayload(t),o=new F.Transaction(h({value:e.value.valueOf(),data:r,nonce:e.nonce.valueOf(),receiver:new F.Address(e.receiver),sender:new F.Address(e.sender),gasLimit:(i=e.gasLimit.valueOf())!=null?i:Pt,gasPrice:(p=e.gasPrice.valueOf())!=null?p:Ct,chainID:e.chainID.valueOf(),version:new F.TransactionVersion((l=e.version)!=null?l:on)},e.options?{options:new F.TransactionOptions(e.options)}:{}));return o.applySignature({hex:()=>e.signature||""},new F.Address(e.sender)),o}n();qt();n();var ia=S(require("bignumber.js"));G();n();n();n();n();var sa=require("@elrondnetwork/erdjs"),ca=S(require("bignumber.js"));R();n();var Zn=require("@elrondnetwork/erdjs");function aa(e){try{let t=new Zn.Address(e);return Boolean(t.bech32())}catch(t){return!1}}function Ee(e){return(e==null?void 0:e.startsWith("erd"))&&e.length===62&&/^\w+$/.test(e)&&aa(e)}n();n();n();var pa=require("@elrondnetwork/erdjs/out");n();I();n();var Xn=require("@elrondnetwork/erdjs");G();n();n();n();n();R();n();n();var rr=require("@reduxjs/toolkit"),bo=require("react-redux/es/utils/Subscription");Z();n();var Jn=S(require("lodash.throttle"));I();Z();Dt();Se();de();var ua=[Oe],da=(0,Jn.default)(()=>{be(we())},5e3),Qn=e=>t=>r=>{var d;if(ua.includes(r.type))return t(r);let o=e.getState(),i=Y.local.getItem(H.loginExpiresAt);if(!((d=o==null?void 0:o.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(i==null)return be(we());let l=Date.now();return i-l<0?setTimeout(()=>b(void 0,null,function*(){console.log("session expired");try{e.dispatch(pn())}catch(g){console.error("error logging out",g)}}),1e3):(da(),t(r))};n();n();function Qe(){return typeof sessionStorage!="undefined"}var xo=Qe()?(lo(),xe(co)).default:(uo(),xe(po)).default,So=Qe()?(go(),xe(mo)).default:[],wo=Qe()?(ho(),xe(yo)).default:e=>e;et();var w=(0,rr.configureStore)({reducer:xo,middleware:e=>e({serializableCheck:{ignoredActions:[...So,Gt.type,Ht.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(Qn)}),vo=(0,bo.createSubscription)(w),Zu=wo(w),Xu=(0,rr.configureStore)({reducer:Te});n();n();n();n();n();n();var Ao="dapp/config";n();n();n();n();N();n();n();N();n();n();n();var Pa=S(require("bignumber.js"));I();n();var Na=require("@elrondnetwork/erdjs"),nr=S(require("bignumber.js"));I();n();var Da=S(require("bignumber.js"));n();nr.default.config({ROUNDING_MODE:nr.default.ROUND_FLOOR});n();n();n();I();n();n();n();n();I();n();I();n();var Ca=require("@elrondnetwork/erdjs");I();n();var nt=require("@elrondnetwork/erdjs"),Fa=require("@elrondnetwork/erdjs"),_a=require("@elrondnetwork/erdjs-network-providers");I();n();n();var Ra=S(require("bignumber.js"));I();n();I();n();n();n();n();n();I();n();N();var Oa=["reDelegateRewards","claimRewards","unBond"],Ba=["wrapEgld","unwrapEgld"],Ua=["unStake"],$a=["unDelegate"];n();n();n();I();n();var Ga=S(require("bignumber.js"));n();n();n();N();n();var Wa=S(require("bignumber.js"));n();n();n();n();N();n();n();n();var qa=S(require("anchorme"));n();I();n();var ja=S(require("bignumber.js"));n();G();n();n();R();n();R();n();n();n();N();n();N();n();var Ka=S(require("bignumber.js"));I();N();n();N();n();var Po=require("react");G();n();n();N();n();var Ya=require("@elrondnetwork/erdjs/out"),Za=S(require("bignumber.js"));N();n();N();n();n();R();var OT=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}