@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 64.3 kB
JavaScript
"use strict";var Yi=Object.create;var rt=Object.defineProperty,Zi=Object.defineProperties,Xi=Object.getOwnPropertyDescriptor,Ji=Object.getOwnPropertyDescriptors,Qi=Object.getOwnPropertyNames,ft=Object.getOwnPropertySymbols,ea=Object.getPrototypeOf,Jt=Object.prototype.hasOwnProperty,en=Object.prototype.propertyIsEnumerable;var Qr=(e,t,r)=>t in e?rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w=(e,t)=>{for(var r in t||(t={}))Jt.call(t,r)&&Qr(e,r,t[r]);if(ft)for(var r of ft(t))en.call(t,r)&&Qr(e,r,t[r]);return e},L=(e,t)=>Zi(e,Ji(t));var nt=(e,t)=>{var r={};for(var o in e)Jt.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&ft)for(var o of ft(e))t.indexOf(o)<0&&en.call(e,o)&&(r[o]=e[o]);return r};var h=(e,t)=>()=>(e&&(t=e(e=0)),t);var Tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),be=(e,t)=>{for(var r in t)rt(e,r,{get:t[r],enumerable:!0})},tn=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Qi(t))!Jt.call(e,i)&&i!==r&&rt(e,i,{get:()=>t[i],enumerable:!(o=Xi(t,i))||o.enumerable});return e};var b=(e,t,r)=>(r=e!=null?Yi(ea(e)):{},tn(t||!e||!e.__esModule?rt(r,"default",{value:e,enumerable:!0}):r,e)),ot=e=>tn(rt({},"__esModule",{value:!0}),e);var S=(e,t,r)=>new Promise((o,i)=>{var p=d=>{try{m(r.next(d))}catch(f){i(f)}},l=d=>{try{m(r.throw(d))}catch(f){i(f)}},m=d=>d.done?o(d.value):Promise.resolve(d.value).then(p,l);m((r=r.apply(e,t)).next())});var on=Tt(yt=>{"use strict";n();yt.byteLength=ra;yt.toByteArray=oa;yt.fromByteArray=sa;var re=[],J=[],ta=typeof Uint8Array!="undefined"?Uint8Array:Array,Qt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ae=0,rn=Qt.length;Ae<rn;++Ae)re[Ae]=Qt[Ae],J[Qt.charCodeAt(Ae)]=Ae;var Ae,rn;J["-".charCodeAt(0)]=62;J["_".charCodeAt(0)]=63;function nn(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 ra(e){var t=nn(e),r=t[0],o=t[1];return(r+o)*3/4-o}function na(e,t,r){return(t+r)*3/4-r}function oa(e){var t,r=nn(e),o=r[0],i=r[1],p=new ta(na(e,o,i)),l=0,m=i>0?o-4:o,d;for(d=0;d<m;d+=4)t=J[e.charCodeAt(d)]<<18|J[e.charCodeAt(d+1)]<<12|J[e.charCodeAt(d+2)]<<6|J[e.charCodeAt(d+3)],p[l++]=t>>16&255,p[l++]=t>>8&255,p[l++]=t&255;return i===2&&(t=J[e.charCodeAt(d)]<<2|J[e.charCodeAt(d+1)]>>4,p[l++]=t&255),i===1&&(t=J[e.charCodeAt(d)]<<10|J[e.charCodeAt(d+1)]<<4|J[e.charCodeAt(d+2)]>>2,p[l++]=t>>8&255,p[l++]=t&255),p}function ia(e){return re[e>>18&63]+re[e>>12&63]+re[e>>6&63]+re[e&63]}function aa(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(ia(o));return i.join("")}function sa(e){for(var t,r=e.length,o=r%3,i=[],p=16383,l=0,m=r-o;l<m;l+=p)i.push(aa(e,l,l+p>m?m:l+p));return o===1?(t=e[r-1],i.push(re[t>>2]+re[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],i.push(re[t>>10]+re[t>>4&63]+re[t<<2&63]+"=")),i.join("")}});var an=Tt(er=>{n();er.read=function(e,t,r,o,i){var p,l,m=i*8-o-1,d=(1<<m)-1,f=d>>1,g=-7,T=r?i-1:0,I=r?-1:1,v=e[t+T];for(T+=I,p=v&(1<<-g)-1,v>>=-g,g+=m;g>0;p=p*256+e[t+T],T+=I,g-=8);for(l=p&(1<<-g)-1,p>>=-g,g+=o;g>0;l=l*256+e[t+T],T+=I,g-=8);if(p===0)p=1-f;else{if(p===d)return l?NaN:(v?-1:1)*(1/0);l=l+Math.pow(2,o),p=p-f}return(v?-1:1)*l*Math.pow(2,p-o)};er.write=function(e,t,r,o,i,p){var l,m,d,f=p*8-i-1,g=(1<<f)-1,T=g>>1,I=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=o?0:p-1,U=o?1:-1,M=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=g):(l=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-l))<1&&(l--,d*=2),l+T>=1?t+=I/d:t+=I*Math.pow(2,1-T),t*d>=2&&(l++,d/=2),l+T>=g?(m=0,l=g):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+v]=m&255,v+=U,m/=256,i-=8);for(l=l<<i|m,f+=i;f>0;e[r+v]=l&255,v+=U,l/=256,f-=8);e[r+v-U]|=M*128}});var xn=Tt(Ue=>{"use strict";n();var tr=on(),Oe=an(),sn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ue.Buffer=u;Ue.SlowBuffer=ma;Ue.INSPECT_MAX_BYTES=50;var ht=2147483647;Ue.kMaxLength=ht;u.TYPED_ARRAY_SUPPORT=ca();!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 ca(){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 le(e){if(e>ht)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 ir(e)}return pn(e,t,r)}u.poolSize=8192;function pn(e,t,r){if(typeof e=="string")return pa(e,t);if(ArrayBuffer.isView(e))return ua(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(ne(e,ArrayBuffer)||e&&ne(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(ne(e,SharedArrayBuffer)||e&&ne(e.buffer,SharedArrayBuffer)))return nr(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=da(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 pn(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function un(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 la(e,t,r){return un(e),e<=0?le(e):t!==void 0?typeof r=="string"?le(e).fill(t,r):le(e).fill(t):le(e)}u.alloc=function(e,t,r){return la(e,t,r)};function ir(e){return un(e),le(e<0?0:ar(e)|0)}u.allocUnsafe=function(e){return ir(e)};u.allocUnsafeSlow=function(e){return ir(e)};function pa(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=dn(e,t)|0,o=le(r),i=o.write(e,t);return i!==r&&(o=o.slice(0,i)),o}function rr(e){for(var t=e.length<0?0:ar(e.length)|0,r=le(t),o=0;o<t;o+=1)r[o]=e[o]&255;return r}function ua(e){if(ne(e,Uint8Array)){var t=new Uint8Array(e);return nr(t.buffer,t.byteOffset,t.byteLength)}return rr(e)}function nr(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 da(e){if(u.isBuffer(e)){var t=ar(e.length)|0,r=le(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||sr(e.length)?le(0):rr(e);if(e.type==="Buffer"&&Array.isArray(e.data))return rr(e.data)}function ar(e){if(e>=ht)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ht.toString(16)+" bytes");return e|0}function ma(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(ne(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),ne(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(ne(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 dn(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ne(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 or(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return hn(e).length;default:if(i)return o?-1:or(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=dn;function ga(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 Aa(this,t,r);case"utf8":case"utf-8":return gn(this,t,r);case"ascii":return va(this,t,r);case"latin1":case"binary":return ba(this,t,r);case"base64":return Sa(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ia(this,t,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}u.prototype._isBuffer=!0;function Ie(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)Ie(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)Ie(this,r,r+3),Ie(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)Ie(this,r,r+7),Ie(this,r+1,r+6),Ie(this,r+2,r+5),Ie(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?gn(this,0,t):ga.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=Ue.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};sn&&(u.prototype[sn]=u.prototype.inspect);u.prototype.compare=function(t,r,o,i,p){if(ne(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),f=this.slice(i,p),g=t.slice(r,o),T=0;T<d;++T)if(f[T]!==g[T]){l=f[T],m=g[T];break}return l<m?-1:m<l?1:0};function mn(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,sr(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:cn(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):cn(e,[t],r,o,i);throw new TypeError("val must be string, number or Buffer")}function cn(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(v,U){return p===1?v[U]:v.readUInt16BE(U*p)}var f;if(i){var g=-1;for(f=r;f<l;f++)if(d(e,f)===d(t,g===-1?0:f-g)){if(g===-1&&(g=f),f-g+1===m)return g*p}else g!==-1&&(f-=f-g),g=-1}else for(r+m>l&&(r=l-m),f=r;f>=0;f--){for(var T=!0,I=0;I<m;I++)if(d(e,f+I)!==d(t,I)){T=!1;break}if(T)return f}return-1}u.prototype.includes=function(t,r,o){return this.indexOf(t,r,o)!==-1};u.prototype.indexOf=function(t,r,o){return mn(this,t,r,o,!0)};u.prototype.lastIndexOf=function(t,r,o){return mn(this,t,r,o,!1)};function fa(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(sr(m))return l;e[r+l]=m}return l}function Ta(e,t,r,o){return xt(or(t,e.length-r),e,r,o)}function ya(e,t,r,o){return xt(La(t),e,r,o)}function ha(e,t,r,o){return xt(hn(t),e,r,o)}function xa(e,t,r,o){return xt(Ca(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 fa(this,t,r,o);case"utf8":case"utf-8":return Ta(this,t,r,o);case"ascii":case"latin1":case"binary":return ya(this,t,r,o);case"base64":return ha(this,t,r,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xa(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 Sa(e,t,r){return t===0&&r===e.length?tr.fromByteArray(e):tr.fromByteArray(e.slice(t,r))}function gn(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,f,g,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],f=e[i+2],(d&192)===128&&(f&192)===128&&(T=(p&15)<<12|(d&63)<<6|f&63,T>2047&&(T<55296||T>57343)&&(l=T));break;case 4:d=e[i+1],f=e[i+2],g=e[i+3],(d&192)===128&&(f&192)===128&&(g&192)===128&&(T=(p&15)<<18|(d&63)<<12|(f&63)<<6|g&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 wa(o)}var ln=4096;function wa(e){var t=e.length;if(t<=ln)return String.fromCharCode.apply(String,e);for(var r="",o=0;o<t;)r+=String.fromCharCode.apply(String,e.slice(o,o+=ln));return r}function va(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 ba(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 Aa(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+=Da[e[p]];return i}function Ia(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 _(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||_(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||_(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||_(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||_(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||_(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||_(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||_(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||_(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||_(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||_(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||_(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||_(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||_(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||_(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||_(t,4,this.length),Oe.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||_(t,4,this.length),Oe.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||_(t,8,this.length),Oe.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||_(t,8,this.length),Oe.read(this,t,!1,52,8)};function z(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;z(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;z(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||z(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||z(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||z(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||z(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||z(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);z(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);z(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||z(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||z(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||z(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||z(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||z(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 fn(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 Tn(e,t,r,o,i){return t=+t,r=r>>>0,i||fn(e,t,r,4,34028234663852886e22,-34028234663852886e22),Oe.write(e,t,r,o,23,4),r+4}u.prototype.writeFloatLE=function(t,r,o){return Tn(this,t,r,!0,o)};u.prototype.writeFloatBE=function(t,r,o){return Tn(this,t,r,!1,o)};function yn(e,t,r,o,i){return t=+t,r=r>>>0,i||fn(e,t,r,8,17976931348623157e292,-17976931348623157e292),Oe.write(e,t,r,o,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,o){return yn(this,t,r,!0,o)};u.prototype.writeDoubleBE=function(t,r,o){return yn(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 Ea=/[^+/0-9A-Za-z-_]/g;function ka(e){if(e=e.split("=")[0],e=e.trim().replace(Ea,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function or(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 La(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Ca(e,t){for(var r,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 hn(e){return tr.toByteArray(ka(e))}function xt(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 ne(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function sr(e){return e!==e}var Da=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 An=Tt((yc,bn)=>{n();var D=bn.exports={},oe,ie;function cr(){throw new Error("setTimeout has not been defined")}function lr(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?oe=setTimeout:oe=cr}catch(e){oe=cr}try{typeof clearTimeout=="function"?ie=clearTimeout:ie=lr}catch(e){ie=lr}})();function Sn(e){if(oe===setTimeout)return setTimeout(e,0);if((oe===cr||!oe)&&setTimeout)return oe=setTimeout,setTimeout(e,0);try{return oe(e,0)}catch(t){try{return oe.call(null,e,0)}catch(r){return oe.call(this,e,0)}}}function Pa(e){if(ie===clearTimeout)return clearTimeout(e);if((ie===lr||!ie)&&clearTimeout)return ie=clearTimeout,clearTimeout(e);try{return ie(e)}catch(t){try{return ie.call(null,e)}catch(r){return ie.call(this,e)}}}var pe=[],Be=!1,Ee,St=-1;function Na(){!Be||!Ee||(Be=!1,Ee.length?pe=Ee.concat(pe):St=-1,pe.length&&wn())}function wn(){if(!Be){var e=Sn(Na);Be=!0;for(var t=pe.length;t;){for(Ee=pe,pe=[];++St<t;)Ee&&Ee[St].run();St=-1,t=pe.length}Ee=null,Be=!1,Pa(e)}}D.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];pe.push(new vn(e,t)),pe.length===1&&!Be&&Sn(wn)};function vn(e,t){this.fun=e,this.array=t}vn.prototype.run=function(){this.fun.apply(null,this.array)};D.title="browser";D.browser=!0;D.env={};D.argv=[];D.version="";D.versions={};function ue(){}D.on=ue;D.addListener=ue;D.once=ue;D.off=ue;D.removeListener=ue;D.removeAllListeners=ue;D.emit=ue;D.prependListener=ue;D.prependOnceListener=ue;D.listeners=function(e){return[]};D.binding=function(e){throw new Error("process.binding is not supported")};D.cwd=function(){return"/"};D.chdir=function(e){throw new Error("process.chdir is not supported")};D.umask=function(){return 0}});var a,s,hc,n=h(()=>{a=b(xn()),s=b(An()),hc=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 wt,pr=h(()=>{"use strict";n();wt=()=>Date.now()/1e3});var In=h(()=>{"use strict";n()});var En=h(()=>{"use strict";n()});var kn=h(()=>{"use strict";n();pr();In();En()});var dr={};be(dr,{getItem:()=>Fa,localStorageKeys:()=>ae,removeItem:()=>_a,setItem:()=>Ra});var ae,ur,Ra,Fa,_a,$e=h(()=>{"use strict";n();kn();ae={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},ur=typeof localStorage!="undefined",Ra=({key:e,data:t,expires:r})=>{!ur||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Fa=e=>{if(!ur)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:wt()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},_a=e=>{!ur||localStorage.removeItem(String(e))}});var mr={};be(mr,{clear:()=>Pn,getItem:()=>Cn,removeItem:()=>Dn,setItem:()=>Ln,storage:()=>Ma});var Ln,Cn,Dn,Pn,Ma,Nn=h(()=>{"use strict";n();Ln=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Cn=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},Dn=e=>sessionStorage.removeItem(String(e)),Pn=()=>sessionStorage.clear(),Ma={setItem:Ln,getItem:Cn,removeItem:Dn,clear:Pn}});var de,it=h(()=>{"use strict";n();$e();Nn();de={session:mr,local:dr}});function at(){return new Date().setHours(new Date().getHours()+24)}function st(e){de.local.setItem({key:ae.loginExpiresAt,data:e,expires:e})}var gr=h(()=>{"use strict";n();it();$e()});var W=h(()=>{"use strict";n()});var Rn=h(()=>{"use strict";n()});var Fn=h(()=>{"use strict";n()});var q=h(()=>{"use strict";n()});var _n=h(()=>{"use strict";n()});var Mn=h(()=>{"use strict";n()});var On=h(()=>{"use strict";n()});var Un=h(()=>{"use strict";n()});var se=h(()=>{"use strict";n();Fn();q();W();_n();Mn();On();Un()});var ct,Bn,jc,$n,zc,Vn,Kc,Yc,Oa,lt=h(()=>{"use strict";n();se();ct={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:Bn,egldLabel:jc}=ct["devnet"],{chainId:$n,egldLabel:zc}=ct["testnet"],{chainId:Vn,egldLabel:Kc}=ct["mainnet"],Yc={["devnet"]:Bn,["testnet"]:$n,["mainnet"]:Vn},Oa={[Bn]:"devnet",[$n]:"testnet",[Vn]:"mainnet"}});var fr=h(()=>{"use strict";n()});var Wn=h(()=>{"use strict";n()});var Hn,Tr=h(()=>{"use strict";n();Hn="transaction-status-toast-id"});var yr,hr,Gn,qn,vt,jn,Ve,N=h(()=>{"use strict";n();Rn();lt();fr();Wn();Tr();yr=5e4,hr=1e9,Gn=1,qn=1,vt="logout",jn="login",Ve="0"});var xr,H,ee,Y=h(()=>{"use strict";n();xr=require("@reduxjs/toolkit");N();H=(0,xr.createAction)(vt),ee=(0,xr.createAction)(jn,e=>({payload:e}))});var Kn,zn,Yn,ml,We,gl,pt,He,Zn,Xn,Jn,Sr=h(()=>{"use strict";n();Kn=require("@reduxjs/toolkit");gr();W();Y();zn={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Yn=(0,Kn.createSlice)({name:"loginInfoSlice",initialState:zn,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(H,()=>zn),e.addCase(ee,(t,r)=>{t.loginMethod=r.payload.loginMethod,st(at())})}}),{setLoginMethod:ml,setWalletConnectLogin:We,setLedgerLogin:gl,setTokenLogin:pt,setTokenLoginSignature:He,setWalletLogin:Zn,invalidateLoginSession:Xn}=Yn.actions,Jn=Yn.reducer});var Qn,eo,bt,wr=h(()=>{"use strict";n();Qn=!1,eo=(e=!0)=>{Qn=e},bt=(e,t=0)=>{Qn||setTimeout(()=>{window.location.href=e},t)}});function At({callbackRoute:e,onLoginRedirect:t,options:r}){let o=Boolean(e),i=typeof t=="function",p=i?0:Ua;o&&e!=null&&setTimeout(()=>{if(i)return t(e,r);window.location.pathname.includes(e)||bt(e)},p)}var Ua,to=h(()=>{"use strict";n();wr();Ua=200});function vr(e){return e[Math.floor(Math.random()*e.length)]}var ro=h(()=>{"use strict";n()});var no=h(()=>{"use strict";n();fr()});var It=h(()=>{"use strict";n();to();ro();no()});var oo,io,br,Ba,ao,Cl,so,co,Ar=h(()=>{"use strict";n();oo=require("@reduxjs/toolkit"),io=b(require("lodash.omit"));It();br={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Ba={network:br,chainID:"-1"},ao=(0,oo.createSlice)({name:"appConfig",initialState:Ba,reducers:{initializeNetworkConfig:(e,t)=>{let r=vr(t.payload.walletConnectBridgeAddresses),o=vr(t.payload.walletConnectV2RelayAddresses),i=(0,io.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=L(w(w({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:o})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:Cl,setChainID:so}=ao.actions,co=ao.reducer});var Er,lo,po,Et,Ir,uo,Ge,Ol,kr,Ul,mo,Bl,$l,Lr,go,Vl,fo,Cr=h(()=>{"use strict";n();Er=require("@elrondnetwork/erdjs"),lo=require("@reduxjs/toolkit"),po=require("redux-persist");N();it();$e();Y();Et={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Ve},Ir={address:"",websocketEvent:null,accounts:{"":Et},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},uo=(0,lo.createSlice)({name:"accountInfoSlice",initialState:Ir,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new Er.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Et},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(H,()=>(de.local.removeItem(ae.loginExpiresAt),Ir)),e.addCase(ee,(t,r)=>{let{address:o}=r.payload;t.address=o,t.publicKey=new Er.Address(o).hex()}),e.addCase(po.REHYDRATE,(t,r)=>{var f;if(!((f=r.payload)!=null&&f.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:Ir.accounts,t.publicKey=m})}}),{setAccount:Ge,setAddress:Ol,setAccountNonce:kr,setAccountShard:Ul,setLedgerAccount:mo,updateLedgerAccount:Bl,setWalletConnectAccount:$l,setIsAccountLoading:Lr,setAccountLoadingError:go,setWebsocketEvent:Vl}=uo.actions,fo=uo.reducer});function To(e){return e!=null&&(Ka(e)||Ja(e))}function kt(e){return e!=null&&(Ya(e)||Qa(e))}function Lt(e){return e!=null&&(Za(e)||es(e))}function yo(e){return e!=null&&Xa(e)}function Ka(e){return e!=null&&Va.includes(e)}function Ya(e){return e!=null&&Wa.includes(e)}function Za(e){return e!=null&&Ha.includes(e)}function Xa(e){return e!=null&&Ga.includes(e)}function Ja(e){return e!=null&&qa.includes(e)}function Qa(e){return e!=null&&ja.includes(e)}function es(e){return e!=null&&za.includes(e)}var Va,Wa,Ha,Ga,qa,ja,za,Pr=h(()=>{"use strict";n();W();Va=["sent"],Wa=["success"],Ha=["fail","cancelled","timedOut"],Ga=["timedOut"],qa=["pending"],ja=["success"],za=["fail","invalid"]});var ho,xo,ut,ts,So,Zl,Xl,Jl,Ql,ep,tp,rp,np,op,ip,Ct,Dt=h(()=>{"use strict";n();ho=require("@reduxjs/toolkit"),xo=require("redux-persist");W();Pr();Y();ut={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},ts={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},So=(0,ho.createSlice)({name:"transactionsSlice",initialState:ut,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,f;let{sessionId:r,transactions:o,errorMessage:i,status:p,redirectRoute:l}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||ts;e.signedTransactions[r]={transactions:o,status:p,errorMessage:i,redirectRoute:l,customTransactionInformation:m},((f=e==null?void 0:e.transactionsToSign)==null?void 0:f.sessionId)===r&&(e.transactionsToSign=ut.transactionsToSign)},clearSignedTransaction:(e,t)=>{e.signedTransactions[t.payload]&&delete e.signedTransactions[t.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,t)=>{e.signedTransactions=w(w({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status: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,f,g,T,I;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(M=>M.hash===p?L(w({},M),{status:o,errorMessage:i}):M);let v=(g=(f=e.signedTransactions[r])==null?void 0:f.transactions)==null?void 0:g.every(M=>kt(M.status)),U=(I=(T=e.signedTransactions[r])==null?void 0:T.transactions)==null?void 0:I.every(M=>Lt(M.status));v&&(e.signedTransactions[r].status="success"),U&&(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=ut.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=ut.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(H,()=>ut),e.addCase(xo.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,f])=>{let g=new Date(d),T=new Date;return T.setHours(T.getHours()+5),T-g>0||(m[d]=f),m},{});i!=null&&(t.customTransactionInformationForSessionId=i),o!=null&&(t.signedTransactions=p)})}}),{updateSignedTransactionStatus:Zl,updateSignedTransactions:Xl,setTransactionsToSign:Jl,clearAllTransactionsToSign:Ql,clearAllSignedTransactions:ep,clearSignedTransaction:tp,clearTransactionToSign:rp,setSignTransactionsError:np,setSignTransactionsCancelMessage:op,moveTransactionsToSignedState:ip}=So.actions,Ct=So.reducer});var wo,Rr,Fr,_r,rs,Nr,vo,lp,pp,up,Pt,Nt=h(()=>{"use strict";n();wo=require("@reduxjs/toolkit");Y();Rr="Transaction failed",Fr="Transaction successful",_r="Processing transaction",rs="Transaction submitted",Nr={},vo=(0,wo.createSlice)({name:"transactionsInfo",initialState:Nr,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:o}=t.payload;r!=null&&(e[r]={errorMessage:(o==null?void 0:o.errorMessage)||Rr,successMessage:(o==null?void 0:o.successMessage)||Fr,processingMessage:(o==null?void 0:o.processingMessage)||_r,submittedMessage:(o==null?void 0:o.submittedMessage)||rs,transactionDuration:o==null?void 0:o.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>Nr},extraReducers:e=>{e.addCase(H,()=>Nr)}}),{clearTransactionsInfo:lp,setTransactionsDisplayInfo:pp,clearTransactionsInfoForSessionId:up}=vo.actions,Pt=vo.reducer});var Ao,bo,Io,fp,Tp,yp,hp,Eo,Mr=h(()=>{"use strict";n();Ao=require("@reduxjs/toolkit");Y();bo={},Io=(0,Ao.createSlice)({name:"modalsSlice",initialState:bo,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(H,()=>bo)}}),{setTxSubmittedModal:fp,setNotificationModal:Tp,clearTxSubmittedModal:yp,clearNotificationModal:hp}=Io.actions,Eo=Io.reducer});var Lo,Co,ko,Do,Ep,kp,Lp,Cp,Dp,Pp,Rt,Ft=h(()=>{"use strict";n();Lo=require("@reduxjs/toolkit"),Co=require("redux-persist");Tr();se();pr();Y();ko={customToasts:[],transactionToasts:[],failTransactionToast:null},Do=(0,Lo.createSlice)({name:"toastsSlice",initialState:ko,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(L(w({},t.payload),{type:"custom",toastId:t.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,t)=>{e.customToasts=e.customToasts.filter(r=>r.toastId!==t.payload)},addTransactionToast:(e,t)=>{e.transactionToasts.push({type:"transaction",startTimestamp:wt(),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=L(w({},t.payload),{toastId:Hn})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(H,()=>ko),e.addCase(Co.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:Ep,removeCustomToast:kp,addTransactionToast:Lp,removeTransactionToast:Cp,addFailTransactionToast:Dp,removeFailTransactionToast:Pp}=Do.actions,Rt=Do.reducer});var te=h(()=>{"use strict";n();Sr();Ar();Cr();Dt();Nt();Mr();Ft()});var $r=h(()=>{"use strict";n()});var Yo,Ko,Zo,id,ad,sd,cd,ld,pd,Xo,Jo=h(()=>{"use strict";n();Yo=require("@reduxjs/toolkit");Y();Ko={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Zo=(0,Yo.createSlice)({name:"dappModalsSlice",initialState:Ko,reducers:{setDappModalVisibility:(e,t)=>{e.visible=t.payload},setDappModalHeaderVisibility:(e,t)=>{e.modal.showHeader=t.payload},setDappModalFooterVisibility:(e,t)=>{e.modal.showFooter=t.payload},setDappModalHeaderText:(e,t)=>{e.modal.headerText=t.payload},setDappModalFooterText:(e,t)=>{e.modal.footerText=t.payload},setDappModalConfig:(e,t)=>{e.modal=w({},t.payload)}},extraReducers:e=>{e.addCase(H,()=>Ko)}}),{setDappModalVisibility:id,setDappModalHeaderVisibility:ad,setDappModalFooterVisibility:sd,setDappModalHeaderText:cd,setDappModalFooterText:ld,setDappModalConfig:pd}=Zo.actions,Xo=Zo.reducer});var Qo,ms,gs,Ke,$t=h(()=>{"use strict";n();Qo=require("@reduxjs/toolkit");$r();Cr();Jo();Sr();Mr();Ar();Ft();Nt();Dt();ms={["account"]:fo,["networkConfig"]:co,["loginInfo"]:Jn,["modals"]:Eo,["dappModal"]:Xo,["toasts"]:Rt,["transactions"]:Ct,["transactionsInfo"]:Pt},gs=(e={})=>(0,Qo.combineReducers)(w(w({},ms),e)),Ke=gs});var ri={};be(ri,{default:()=>ws});function Vr(e,t=[]){return{key:e,version:1,storage:ti.default,blacklist:t}}var Ce,ei,ti,fs,Ts,ys,hs,xs,Ss,ws,ni=h(()=>{"use strict";n();Ce=require("redux-persist"),ei=b(require("redux-persist/lib/storage")),ti=b(require("redux-persist/lib/storage/session"));$t();te();Ft();Nt();Dt();$r();fs={2:e=>L(w({},e),{networkConfig:br})};Ts=Vr("dapp-core-transactionsInfo"),ys=Vr("dapp-core-transactions",["transactionsToSign"]),hs=Vr("dapp-core-toasts"),xs={key:"dapp-core-store",version:2,storage:ei.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,Ce.createMigrate)(fs,{debug:!1})},Ss={["toasts"]:(0,Ce.persistReducer)(hs,Rt),["transactions"]:(0,Ce.persistReducer)(ys,Ct),["transactionsInfo"]:(0,Ce.persistReducer)(Ts,Pt)},ws=(0,Ce.persistReducer)(xs,Ke(Ss))});var oi={};be(oi,{default:()=>vs});var vs,ii=h(()=>{"use strict";n();$t();vs=Ke()});var ai={};be(ai,{default:()=>As});var Q,bs,As,si=h(()=>{"use strict";n();Q=require("redux-persist"),bs=[Q.FLUSH,Q.REHYDRATE,Q.PAUSE,Q.PERSIST,Q.PURGE,Q.REGISTER],As=bs});var pi={};be(pi,{default:()=>li});function li(e){return(0,ci.persistStore)(e)}var ci,ui=h(()=>{"use strict";n();ci=require("redux-persist")});var uc={};be(uc,{ProviderInitializer:()=>pc});module.exports=ot(uc);n();var Re=require("react"),ji=require("@elrondnetwork/erdjs-extension-provider"),zi=require("@elrondnetwork/erdjs-hw-provider");n();n();n();var Qs=b(require("axios"));n();n();te();n();var Po=b(require("lodash.isequal")),_t=require("reselect"),y=(0,_t.createSelectorCreator)(_t.defaultMemoize,Po.default);var me=e=>e.account,ke=y(me,e=>e.address),Mt=y(me,ke,(e,t)=>t in e.accounts?e.accounts[t]:Et),Gp=y(me,Mt,(e,t)=>{let i=e,{accounts:r}=i,o=nt(i,["accounts"]);return L(w({},o),{account:t})}),qp=y(Mt,e=>e.balance),No=y(Mt,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),jp=y(me,e=>e.shard),Ro=y(me,e=>e.ledgerAccount),zp=y(me,e=>e.walletConnectAccount),Kp=y(me,e=>e.isAccountLoading),Yp=y(me,e=>e.accountLoadingError),Zp=y(me,e=>e.websocketEvent);n();var Le=e=>e.networkConfig,Fo=y(Le,e=>e.chainID),_o=y(Le,e=>e.network.walletConnectBridgeAddress),Mo=y(Le,e=>e.network.walletConnectV2RelayAddress),Oo=y(Le,e=>e.network.walletConnectV2ProjectId),Ot=y(Le,e=>e.network.walletConnectDeepLink),qe=y(Le,e=>e.network),Or=y(qe,e=>e.apiAddress),Uo=y(qe,e=>e.explorerAddress),Qp=y(qe,e=>e.egldLabel);n();W();var je=e=>e.loginInfo,Bo=y(je,e=>e.loginMethod),ze=y(je,ke,(e,t)=>e.loginMethod!=""&&Boolean(t)),$o=y(je,e=>e.walletConnectLogin),Vo=y(je,e=>e.ledgerLogin),Ut=y(je,e=>e.walletLogin),ou=y(je,e=>e.isLoginSessionInvalid);n();n();var Z=require("@elrondnetwork/erdjs");N();n();function Ur(e){try{return a.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function Br(e){var i,p,l;let{data:t}=e,r=Ur(t!=null?t:"")?Z.TransactionPayload.fromEncoded(t):new Z.TransactionPayload(t),o=new Z.Transaction(w({value:e.value.valueOf(),data:r,nonce:e.nonce.valueOf(),receiver:new Z.Address(e.receiver),sender:new Z.Address(e.sender),gasLimit:(i=e.gasLimit.valueOf())!=null?i:yr,gasPrice:(p=e.gasPrice.valueOf())!=null?p:hr,chainID:e.chainID.valueOf(),version:new Z.TransactionVersion((l=e.version)!=null?l:Gn)},e.options?{options:new Z.TransactionOptions(e.options)}:{}));return o.applySignature({hex:()=>e.signature||""},new Z.Address(e.sender)),o}n();Pr();n();var os=b(require("bignumber.js"));se();n();n();n();n();var as=require("@elrondnetwork/erdjs"),ss=b(require("bignumber.js"));W();n();var Go=require("@elrondnetwork/erdjs");function is(e){try{let t=new Go.Address(e);return Boolean(t.bech32())}catch(t){return!1}}function dt(e){return(e==null?void 0:e.startsWith("erd"))&&e.length===62&&/^\w+$/.test(e)&&is(e)}n();n();n();var ls=require("@elrondnetwork/erdjs/out");n();N();n();var qo=require("@elrondnetwork/erdjs");se();n();n();n();n();W();n();n();var Wr=require("@reduxjs/toolkit"),fi=require("react-redux/es/utils/Subscription");te();n();var jo=b(require("lodash.throttle"));N();te();gr();it();$e();var ps=[vt],us=(0,jo.default)(()=>{st(at())},5e3),zo=e=>t=>r=>{var d;if(ps.includes(r.type))return t(r);let o=e.getState(),i=de.local.getItem(ae.loginExpiresAt);if(!((d=o==null?void 0:o.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(i==null)return st(at());let l=Date.now();return i-l<0?setTimeout(()=>S(void 0,null,function*(){console.log("session expired");try{e.dispatch(Xn())}catch(f){console.error("error logging out",f)}}),1e3):(us(),t(r))};n();n();function Bt(){return typeof sessionStorage!="undefined"}var di=Bt()?(ni(),ot(ri)).default:(ii(),ot(oi)).default,mi=Bt()?(si(),ot(ai)).default:[],gi=Bt()?(ui(),ot(pi)).default:e=>e;$t();var C=(0,Wr.configureStore)({reducer:di,middleware:e=>e({serializableCheck:{ignoredActions:[...mi,kr.type,Ge.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(zo)}),Ti=(0,fi.createSubscription)(C),_d=gi(C),Md=(0,Wr.configureStore)({reducer:Ke});n();n();n();n();n();n();var yi="network/config";var Vt="accounts";n();n();n();n();q();n();n();q();n();n();n();var Ds=b(require("bignumber.js"));N();n();var Cs=require("@elrondnetwork/erdjs"),Hr=b(require("bignumber.js"));N();n();var ks=b(require("bignumber.js"));n();Hr.default.config({ROUNDING_MODE:Hr.default.ROUND_FLOOR});n();n();n();N();n();n();n();n();N();n();N();n();var Ps=require("@elrondnetwork/erdjs");N();n();var Gt=require("@elrondnetwork/erdjs"),Rs=require("@elrondnetwork/erdjs"),Fs=require("@elrondnetwork/erdjs-network-providers");N();n();n();var Ns=b(require("bignumber.js"));N();n();N();n();n();n();n();n();N();n();q();var Ms=["reDelegateRewards","claimRewards","unBond"],Os=["wrapEgld","unwrapEgld"],Us=["unStake"],Bs=["unDelegate"];n();n();n();N();n();var Ws=b(require("bignumber.js"));n();n();n();q();n();var Hs=b(require("bignumber.js"));n();n();n();n();q();n();n();n();var qs=b(require("anchorme"));n();N();n();var js=b(require("bignumber.js