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