@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 55.9 kB
JavaScript
"use strict";var _o=Object.create;var ge=Object.defineProperty,Mo=Object.defineProperties,Oo=Object.getOwnPropertyDescriptor,Bo=Object.getOwnPropertyDescriptors,Uo=Object.getOwnPropertyNames,Ae=Object.getOwnPropertySymbols,$o=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable;var Jt=(e,t,r)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))tt.call(t,r)&&Jt(e,r,t[r]);if(Ae)for(var r of Ae(t))Qt.call(t,r)&&Jt(e,r,t[r]);return e},w=(e,t)=>Mo(e,Bo(t));var er=e=>typeof e=="symbol"?e:e+"",ve=(e,t)=>{var r={};for(var n in e)tt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ae)for(var n of Ae(e))t.indexOf(n)<0&&Qt.call(e,n)&&(r[n]=e[n]);return r};var T=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ie=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Z=(e,t)=>{for(var r in t)ge(e,r,{get:t[r],enumerable:!0})},tr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Uo(t))!tt.call(e,i)&&i!==r&&ge(e,i,{get:()=>t[i],enumerable:!(n=Oo(t,i))||n.enumerable});return e};var S=(e,t,r)=>(r=e!=null?_o($o(e)):{},tr(t||!e||!e.__esModule?ge(r,"default",{value:e,enumerable:!0}):r,e)),fe=e=>tr(ge({},"__esModule",{value:!0}),e);var I=(e,t,r)=>new Promise((n,i)=>{var p=d=>{try{m(r.next(d))}catch(g){i(g)}},l=d=>{try{m(r.throw(d))}catch(g){i(g)}},m=d=>d.done?n(d.value):Promise.resolve(d.value).then(p,l);m((r=r.apply(e,t)).next())});var or=Ie(ke=>{"use strict";o();ke.byteLength=Go;ke.toByteArray=Wo;ke.fromByteArray=zo;var M=[],R=[],Vo=typeof Uint8Array!="undefined"?Uint8Array:Array,rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(X=0,rr=rt.length;X<rr;++X)M[X]=rt[X],R[rt.charCodeAt(X)]=X;var X,rr;R["-".charCodeAt(0)]=62;R["_".charCodeAt(0)]=63;function nr(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function Go(e){var t=nr(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Ho(e,t,r){return(t+r)*3/4-r}function Wo(e){var t,r=nr(e),n=r[0],i=r[1],p=new Vo(Ho(e,n,i)),l=0,m=i>0?n-4:n,d;for(d=0;d<m;d+=4)t=R[e.charCodeAt(d)]<<18|R[e.charCodeAt(d+1)]<<12|R[e.charCodeAt(d+2)]<<6|R[e.charCodeAt(d+3)],p[l++]=t>>16&255,p[l++]=t>>8&255,p[l++]=t&255;return i===2&&(t=R[e.charCodeAt(d)]<<2|R[e.charCodeAt(d+1)]>>4,p[l++]=t&255),i===1&&(t=R[e.charCodeAt(d)]<<10|R[e.charCodeAt(d+1)]<<4|R[e.charCodeAt(d+2)]>>2,p[l++]=t>>8&255,p[l++]=t&255),p}function qo(e){return M[e>>18&63]+M[e>>12&63]+M[e>>6&63]+M[e&63]}function jo(e,t,r){for(var n,i=[],p=t;p<r;p+=3)n=(e[p]<<16&16711680)+(e[p+1]<<8&65280)+(e[p+2]&255),i.push(qo(n));return i.join("")}function zo(e){for(var t,r=e.length,n=r%3,i=[],p=16383,l=0,m=r-n;l<m;l+=p)i.push(jo(e,l,l+p>m?m:l+p));return n===1?(t=e[r-1],i.push(M[t>>2]+M[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(M[t>>10]+M[t>>4&63]+M[t<<2&63]+"=")),i.join("")}});var ir=Ie(nt=>{o();nt.read=function(e,t,r,n,i){var p,l,m=i*8-n-1,d=(1<<m)-1,g=d>>1,h=-7,y=r?i-1:0,k=r?-1:1,E=e[t+y];for(y+=k,p=E&(1<<-h)-1,E>>=-h,h+=m;h>0;p=p*256+e[t+y],y+=k,h-=8);for(l=p&(1<<-h)-1,p>>=-h,h+=n;h>0;l=l*256+e[t+y],y+=k,h-=8);if(p===0)p=1-g;else{if(p===d)return l?NaN:(E?-1:1)*(1/0);l=l+Math.pow(2,n),p=p-g}return(E?-1:1)*l*Math.pow(2,p-n)};nt.write=function(e,t,r,n,i,p){var l,m,d,g=p*8-i-1,h=(1<<g)-1,y=h>>1,k=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:p-1,q=n?1:-1,$=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=h):(l=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-l))<1&&(l--,d*=2),l+y>=1?t+=k/d:t+=k*Math.pow(2,1-y),t*d>=2&&(l++,d/=2),l+y>=h?(m=0,l=h):l+y>=1?(m=(t*d-1)*Math.pow(2,i),l=l+y):(m=t*Math.pow(2,y-1)*Math.pow(2,i),l=0));i>=8;e[r+E]=m&255,E+=q,m/=256,i-=8);for(l=l<<i|m,g+=i;g>0;e[r+E]=l&255,E+=q,l/=256,g-=8);e[r+E-q]|=$*128}});var hr=Ie(oe=>{"use strict";o();var ot=or(),ne=ir(),ar=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;oe.Buffer=u;oe.SlowBuffer=Qo;oe.INSPECT_MAX_BYTES=50;var Ee=2147483647;oe.kMaxLength=Ee;u.TYPED_ARRAY_SUPPORT=Ko();!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 Ko(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(r){return!1}}Object.defineProperty(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 V(e){if(e>Ee)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 ct(e)}return lr(e,t,r)}u.poolSize=8192;function lr(e,t,r){if(typeof e=="string")return Zo(e,t);if(ArrayBuffer.isView(e))return Xo(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(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(O(e,SharedArrayBuffer)||e&&O(e.buffer,SharedArrayBuffer)))return at(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return u.from(n,t,r);var i=Jo(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 lr(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function pr(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 Yo(e,t,r){return pr(e),e<=0?V(e):t!==void 0?typeof r=="string"?V(e).fill(t,r):V(e).fill(t):V(e)}u.alloc=function(e,t,r){return Yo(e,t,r)};function ct(e){return pr(e),V(e<0?0:lt(e)|0)}u.allocUnsafe=function(e){return ct(e)};u.allocUnsafeSlow=function(e){return ct(e)};function Zo(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=ur(e,t)|0,n=V(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function it(e){for(var t=e.length<0?0:lt(e.length)|0,r=V(t),n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Xo(e){if(O(e,Uint8Array)){var t=new Uint8Array(e);return at(t.buffer,t.byteOffset,t.byteLength)}return it(e)}function at(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function Jo(e){if(u.isBuffer(e)){var t=lt(e.length)|0,r=V(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||pt(e.length)?V(0):it(e);if(e.type==="Buffer"&&Array.isArray(e.data))return it(e.data)}function lt(e){if(e>=Ee)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ee.toString(16)+" bytes");return e|0}function Qo(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(O(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),O(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 n=t.length,i=r.length,p=0,l=Math.min(n,i);p<l;++p)if(t[p]!==r[p]){n=t[p],i=r[p];break}return n<i?-1:i<n?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 n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=u.allocUnsafe(r),p=0;for(n=0;n<t.length;++n){var l=t[n];if(O(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 ur(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return st(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return yr(e).length;default:if(i)return n?-1:st(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=ur;function ei(e,t,r){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return pi(this,t,r);case"utf8":case"utf-8":return mr(this,t,r);case"ascii":return ci(this,t,r);case"latin1":case"binary":return li(this,t,r);case"base64":return ai(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ui(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function J(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}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)J(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)J(this,r,r+3),J(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)J(this,r,r+7),J(this,r+1,r+6),J(this,r+2,r+5),J(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?mr(this,0,t):ei.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=oe.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};ar&&(u.prototype[ar]=u.prototype.inspect);u.prototype.compare=function(t,r,n,i,p){if(O(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),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),p===void 0&&(p=this.length),r<0||n>t.length||i<0||p>this.length)throw new RangeError("out of range index");if(i>=p&&r>=n)return 0;if(i>=p)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,p>>>=0,this===t)return 0;for(var l=p-i,m=n-r,d=Math.min(l,m),g=this.slice(i,p),h=t.slice(r,n),y=0;y<d;++y)if(g[y]!==h[y]){l=g[y],m=h[y];break}return l<m?-1:m<l?1:0};function dr(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,pt(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,n)),u.isBuffer(t))return t.length===0?-1:sr(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):sr(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function sr(e,t,r,n,i){var p=1,l=e.length,m=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;p=2,l/=2,m/=2,r/=2}function d(E,q){return p===1?E[q]:E.readUInt16BE(q*p)}var g;if(i){var h=-1;for(g=r;g<l;g++)if(d(e,g)===d(t,h===-1?0:g-h)){if(h===-1&&(h=g),g-h+1===m)return h*p}else h!==-1&&(g-=g-h),h=-1}else for(r+m>l&&(r=l-m),g=r;g>=0;g--){for(var y=!0,k=0;k<m;k++)if(d(e,g+k)!==d(t,k)){y=!1;break}if(y)return g}return-1}u.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};u.prototype.indexOf=function(t,r,n){return dr(this,t,r,n,!0)};u.prototype.lastIndexOf=function(t,r,n){return dr(this,t,r,n,!1)};function ti(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var p=t.length;n>p/2&&(n=p/2);for(var l=0;l<n;++l){var m=parseInt(t.substr(l*2,2),16);if(pt(m))return l;e[r+l]=m}return l}function ri(e,t,r,n){return De(st(t,e.length-r),e,r,n)}function ni(e,t,r,n){return De(gi(t),e,r,n)}function oi(e,t,r,n){return De(yr(t),e,r,n)}function ii(e,t,r,n){return De(fi(t,e.length-r),e,r,n)}u.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var p=this.length-r;if((n===void 0||n>p)&&(n=p),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var l=!1;;)switch(i){case"hex":return ti(this,t,r,n);case"utf8":case"utf-8":return ri(this,t,r,n);case"ascii":case"latin1":case"binary":return ni(this,t,r,n);case"base64":return oi(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ii(this,t,r,n);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 ai(e,t,r){return t===0&&r===e.length?ot.fromByteArray(e):ot.fromByteArray(e.slice(t,r))}function mr(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var p=e[i],l=null,m=p>239?4:p>223?3:p>191?2:1;if(i+m<=r){var d,g,h,y;switch(m){case 1:p<128&&(l=p);break;case 2:d=e[i+1],(d&192)===128&&(y=(p&31)<<6|d&63,y>127&&(l=y));break;case 3:d=e[i+1],g=e[i+2],(d&192)===128&&(g&192)===128&&(y=(p&15)<<12|(d&63)<<6|g&63,y>2047&&(y<55296||y>57343)&&(l=y));break;case 4:d=e[i+1],g=e[i+2],h=e[i+3],(d&192)===128&&(g&192)===128&&(h&192)===128&&(y=(p&15)<<18|(d&63)<<12|(g&63)<<6|h&63,y>65535&&y<1114112&&(l=y))}}l===null?(l=65533,m=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|l&1023),n.push(l),i+=m}return si(n)}var cr=4096;function si(e){var t=e.length;if(t<=cr)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=cr));return r}function ci(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function li(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function pi(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",p=t;p<r;++p)i+=Ti[e[p]];return i}function ui(e,t,r){for(var n=e.slice(t,r),i="",p=0;p<n.length-1;p+=2)i+=String.fromCharCode(n[p]+n[p+1]*256);return i}u.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);var i=this.subarray(t,r);return Object.setPrototypeOf(i,u.prototype),i};function v(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,n){t=t>>>0,r=r>>>0,n||v(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,n){t=t>>>0,r=r>>>0,n||v(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||v(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||v(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||v(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||v(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||v(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||v(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,n){t=t>>>0,r=r>>>0,n||v(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||v(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||v(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(t,r){t=t>>>0,r||v(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(t,r){return t=t>>>0,r||v(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||v(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||v(t,4,this.length),ne.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||v(t,4,this.length),ne.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||v(t,8,this.length),ne.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||v(t,8,this.length),ne.read(this,t,!1,52,8)};function L(e,t,r,n,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+n>e.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var p=Math.pow(2,8*n)-1;L(this,t,r,n,p,0)}var l=1,m=0;for(this[r]=t&255;++m<n&&(l*=256);)this[r+m]=t/l&255;return r+n};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var p=Math.pow(2,8*n)-1;L(this,t,r,n,p,0)}var l=n-1,m=1;for(this[r+l]=t&255;--l>=0&&(m*=256);)this[r+l]=t/m&255;return r+n};u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,1,255,0),this[r]=t&255,r+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};u.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var p=Math.pow(2,8*n-1);L(this,t,r,n,p-1,-p)}var l=0,m=1,d=0;for(this[r]=t&255;++l<n&&(m*=256);)t<0&&d===0&&this[r+l-1]!==0&&(d=1),this[r+l]=(t/m>>0)-d&255;return r+n};u.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var p=Math.pow(2,8*n-1);L(this,t,r,n,p-1,-p)}var l=n-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+n};u.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};u.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};u.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||L(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function gr(e,t,r,n,i,p){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function fr(e,t,r,n,i){return t=+t,r=r>>>0,i||gr(e,t,r,4,34028234663852886e22,-34028234663852886e22),ne.write(e,t,r,n,23,4),r+4}u.prototype.writeFloatLE=function(t,r,n){return fr(this,t,r,!0,n)};u.prototype.writeFloatBE=function(t,r,n){return fr(this,t,r,!1,n)};function Tr(e,t,r,n,i){return t=+t,r=r>>>0,i||gr(e,t,r,8,17976931348623157e292,-17976931348623157e292),ne.write(e,t,r,n,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,n){return Tr(this,t,r,!0,n)};u.prototype.writeDoubleBE=function(t,r,n){return Tr(this,t,r,!1,n)};u.prototype.copy=function(t,r,n,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var p=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),p};u.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!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<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var l;if(typeof t=="number")for(l=r;l<n;++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<n-r;++l)this[l+r]=m[l%d]}return this};var di=/[^+/0-9A-Za-z-_]/g;function mi(e){if(e=e.split("=")[0],e=e.trim().replace(di,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function st(e,t){t=t||1/0;for(var r,n=e.length,i=null,p=[],l=0;l<n;++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===n){(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 gi(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function fi(e,t){for(var r,n,i,p=[],l=0;l<e.length&&!((t-=2)<0);++l)r=e.charCodeAt(l),n=r>>8,i=r%256,p.push(i),p.push(n);return p}function yr(e){return ot.toByteArray(mi(e))}function De(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function O(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function pt(e){return e!==e}var Ti=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=r*16,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()});var Ar=Ie((rs,br)=>{o();var b=br.exports={},B,U;function ut(){throw new Error("setTimeout has not been defined")}function dt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?B=setTimeout:B=ut}catch(e){B=ut}try{typeof clearTimeout=="function"?U=clearTimeout:U=dt}catch(e){U=dt}})();function xr(e){if(B===setTimeout)return setTimeout(e,0);if((B===ut||!B)&&setTimeout)return B=setTimeout,setTimeout(e,0);try{return B(e,0)}catch(t){try{return B.call(null,e,0)}catch(r){return B.call(this,e,0)}}}function yi(e){if(U===clearTimeout)return clearTimeout(e);if((U===dt||!U)&&clearTimeout)return U=clearTimeout,clearTimeout(e);try{return U(e)}catch(t){try{return U.call(null,e)}catch(r){return U.call(this,e)}}}var G=[],ie=!1,Q,Le=-1;function hi(){!ie||!Q||(ie=!1,Q.length?G=Q.concat(G):Le=-1,G.length&&Sr())}function Sr(){if(!ie){var e=xr(hi);ie=!0;for(var t=G.length;t;){for(Q=G,G=[];++Le<t;)Q&&Q[Le].run();Le=-1,t=G.length}Q=null,ie=!1,yi(e)}}b.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];G.push(new wr(e,t)),G.length===1&&!ie&&xr(Sr)};function wr(e,t){this.fun=e,this.array=t}wr.prototype.run=function(){this.fun.apply(null,this.array)};b.title="browser";b.browser=!0;b.env={};b.argv=[];b.version="";b.versions={};function H(){}b.on=H;b.addListener=H;b.once=H;b.off=H;b.removeListener=H;b.removeAllListeners=H;b.emit=H;b.prependListener=H;b.prependOnceListener=H;b.listeners=function(e){return[]};b.binding=function(e){throw new Error("process.binding is not supported")};b.cwd=function(){return"/"};b.chdir=function(e){throw new Error("process.chdir is not supported")};b.umask=function(){return 0}});var a,s,ns,o=T(()=>{a=S(hr()),s=S(Ar()),ns=function(e){function t(){var n=this||self;return delete e.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var r=__magic__;return r}(Object)});var Ne,mt=T(()=>{"use strict";o();Ne=()=>Date.now()/1e3});var vr=T(()=>{"use strict";o()});var Ir=T(()=>{"use strict";o()});var kr=T(()=>{"use strict";o();mt();vr();Ir()});var ft={};Z(ft,{getItem:()=>Si,localStorageKeys:()=>ee,removeItem:()=>wi,setItem:()=>xi});var ee,gt,xi,Si,wi,Te=T(()=>{"use strict";o();kr();ee={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},gt=typeof localStorage!="undefined",xi=({key:e,data:t,expires:r})=>{!gt||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Si=e=>{if(!gt)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:Ne()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},wi=e=>{!gt||localStorage.removeItem(String(e))}});var Tt={};Z(Tt,{clear:()=>Nr,getItem:()=>Dr,removeItem:()=>Lr,setItem:()=>Er,storage:()=>bi});var Er,Dr,Lr,Nr,bi,Cr=T(()=>{"use strict";o();Er=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Dr=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},Lr=e=>sessionStorage.removeItem(String(e)),Nr=()=>sessionStorage.clear(),bi={setItem:Er,getItem:Dr,removeItem:Lr,clear:Nr}});var ae,Ce=T(()=>{"use strict";o();Te();Cr();ae={session:Tt,local:ft}});function ye(){return new Date().setHours(new Date().getHours()+24)}function he(e){ae.local.setItem({key:ee.loginExpiresAt,data:e,expires:e})}var yt=T(()=>{"use strict";o();Ce();Te()});var _=T(()=>{"use strict";o()});var Rr=T(()=>{"use strict";o()});var Pr=T(()=>{"use strict";o()});var D=T(()=>{"use strict";o()});var Fr=T(()=>{"use strict";o()});var _r=T(()=>{"use strict";o()});var Mr=T(()=>{"use strict";o()});var Or=T(()=>{"use strict";o()});var j=T(()=>{"use strict";o();Pr();D();_();Fr();_r();Mr();Or()});var te,Br,Cs,Ur,Rs,$r,Ps,Fs,Vr,xe=T(()=>{"use strict";o();j();te={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:Br,egldLabel:Cs}=te["devnet"],{chainId:Ur,egldLabel:Rs}=te["testnet"],{chainId:$r,egldLabel:Ps}=te["mainnet"],Fs={["devnet"]:Br,["testnet"]:Ur,["mainnet"]:$r},Vr={[Br]:"devnet",[Ur]:"testnet",[$r]:"mainnet"}});var ht=T(()=>{"use strict";o()});var Gr=T(()=>{"use strict";o()});var Hr,xt=T(()=>{"use strict";o();Hr="transaction-status-toast-id"});var St,wt,Wr,Re,qr,se,A=T(()=>{"use strict";o();Rr();xe();ht();Gr();xt();St=5e4,wt=1e9,Wr=1,Re="logout",qr="login",se="0"});var bt,N,Pe,z=T(()=>{"use strict";o();bt=require("@reduxjs/toolkit");A();N=(0,bt.createAction)(Re),Pe=(0,bt.createAction)(qr,e=>({payload:e}))});var zr,jr,Kr,Js,Qs,ec,tc,rc,nc,Yr,Zr,At=T(()=>{"use strict";o();zr=require("@reduxjs/toolkit");yt();_();z();jr={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},Kr=(0,zr.createSlice)({name:"loginInfoSlice",initialState:jr,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(N,()=>jr),e.addCase(Pe,(t,r)=>{t.loginMethod=r.payload.loginMethod,he(ye())})}}),{setLoginMethod:Js,setWalletConnectLogin:Qs,setLedgerLogin:ec,setTokenLogin:tc,setTokenLoginSignature:rc,setWalletLogin:nc,invalidateLoginSession:Yr}=Kr.actions,Zr=Kr.reducer});var Xr=T(()=>{"use strict";o()});var Jr=T(()=>{"use strict";o();Xr()});function vt(e){return e[Math.floor(Math.random()*e.length)]}var Qr=T(()=>{"use strict";o()});var en=T(()=>{"use strict";o();ht()});var tn=T(()=>{"use strict";o();Jr();Qr();en()});var rn,nn,It,vi,on,xc,Sc,an,kt=T(()=>{"use strict";o();rn=require("@reduxjs/toolkit"),nn=S(require("lodash.omit"));tn();It={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},vi={network:It,chainID:"-1"},on=(0,rn.createSlice)({name:"appConfig",initialState:vi,reducers:{initializeNetworkConfig:(e,t)=>{let r=vt(t.payload.walletConnectBridgeAddresses),n=vt(t.payload.walletConnectV2RelayAddresses),i=(0,nn.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=w(x(x({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:n})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:xc,setChainID:Sc}=on.actions,an=on.reducer});var Dt,sn,cn,Fe,Et,ln,pn,Dc,un,Lc,Nc,Cc,Rc,Pc,Fc,_c,dn,Lt=T(()=>{"use strict";o();Dt=require("@elrondnetwork/erdjs"),sn=require("@reduxjs/toolkit"),cn=require("redux-persist");A();Ce();Te();z();Fe={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:se},Et={address:"",websocketEvent:null,accounts:{"":Fe},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},ln=(0,sn.createSlice)({name:"accountInfoSlice",initialState:Et,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new Dt.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Fe},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(N,()=>(ae.local.removeItem(ee.loginExpiresAt),Et)),e.addCase(Pe,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new Dt.Address(n).hex()}),e.addCase(cn.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:i,shard:p,accounts:l,publicKey:m}=n;t.address=i,t.shard=p;let d=l&&i in l;t.accounts=d?l:Et.accounts,t.publicKey=m})}}),{setAccount:pn,setAddress:Dc,setAccountNonce:un,setAccountShard:Lc,setLedgerAccount:Nc,updateLedgerAccount:Cc,setWalletConnectAccount:Rc,setIsAccountLoading:Pc,setAccountLoadingError:Fc,setWebsocketEvent:_c}=ln.actions,dn=ln.reducer});function mn(e){return e!=null&&(Pi(e)||Oi(e))}function _e(e){return e!=null&&(Fi(e)||Bi(e))}function Me(e){return e!=null&&(_i(e)||Ui(e))}function gn(e){return e!=null&&Mi(e)}function Pi(e){return e!=null&&ki.includes(e)}function Fi(e){return e!=null&&Ei.includes(e)}function _i(e){return e!=null&&Di.includes(e)}function Mi(e){return e!=null&&Li.includes(e)}function Oi(e){return e!=null&&Ni.includes(e)}function Bi(e){return e!=null&&Ci.includes(e)}function Ui(e){return e!=null&&Ri.includes(e)}var ki,Ei,Di,Li,Ni,Ci,Ri,Ct=T(()=>{"use strict";o();_();ki=["sent"],Ei=["success"],Di=["fail","cancelled","timedOut"],Li=["timedOut"],Ni=["pending"],Ci=["success"],Ri=["fail","invalid"]});var fn,Tn,Se,$i,yn,Wc,qc,jc,zc,Kc,Yc,Zc,Xc,Jc,Qc,Oe,Be=T(()=>{"use strict";o();fn=require("@reduxjs/toolkit"),Tn=require("redux-persist");_();Ct();z();Se={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},$i={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},yn=(0,fn.createSlice)({name:"transactionsSlice",initialState:Se,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,g;let{sessionId:r,transactions:n,errorMessage:i,status:p,redirectRoute:l}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||$i;e.signedTransactions[r]={transactions:n,status:p,errorMessage:i,redirectRoute:l,customTransactionInformation:m},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===r&&(e.transactionsToSign=Se.transactionsToSign)},clearSignedTransaction:(e,t)=>{e.signedTransactions[t.payload]&&delete e.signedTransactions[t.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,t)=>{e.signedTransactions=x(x({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:n,errorMessage:i,transactions:p}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=n,i!=null&&(e.signedTransactions[r].errorMessage=i),p!=null&&(e.signedTransactions[r].transactions=p))},updateSignedTransactionStatus:(e,t)=>{var m,d,g,h,y,k;let{sessionId:r,status:n,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($=>$.hash===p?w(x({},$),{status:n,errorMessage:i}):$);let E=(h=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:h.every($=>_e($.status)),q=(k=(y=e.signedTransactions[r])==null?void 0:y.transactions)==null?void 0:k.every($=>Me($.status));E&&(e.signedTransactions[r].status="success"),q&&(e.signedTransactions[r].status="fail")}},setTransactionsToSign:(e,t)=>{e.transactionsToSign=t.payload;let{sessionId:r,customTransactionInformation:n}=t.payload;e.customTransactionInformationForSessionId[r]=n,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=Se.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Se.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(N,()=>Se),e.addCase(Tn.REHYDRATE,(t,r)=>{var l;if(t.signTransactionsCancelMessage=null,!((l=r.payload)!=null&&l.transactions))return;let{signedTransactions:n,customTransactionInformationForSessionId:i}=r.payload.transactions,p=Object.entries(n).reduce((m,[d,g])=>{let h=new Date(d),y=new Date;return y.setHours(y.getHours()+5),y-h>0||(m[d]=g),m},{});i!=null&&(t.customTransactionInformationForSessionId=i),n!=null&&(t.signedTransactions=p)})}}),{updateSignedTransactionStatus:Wc,updateSignedTransactions:qc,setTransactionsToSign:jc,clearAllTransactionsToSign:zc,clearAllSignedTransactions:Kc,clearSignedTransaction:Yc,clearTransactionToSign:Zc,setSignTransactionsError:Xc,setSignTransactionsCancelMessage:Jc,moveTransactionsToSignedState:Qc}=yn.actions,Oe=yn.reducer});var hn,Pt,Ft,_t,Vi,Rt,xn,nl,ol,il,Ue,$e=T(()=>{"use strict";o();hn=require("@reduxjs/toolkit");z();Pt="Transaction failed",Ft="Transaction successful",_t="Processing transaction",Vi="Transaction submitted",Rt={},xn=(0,hn.createSlice)({name:"transactionsInfo",initialState:Rt,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||Pt,successMessage:(n==null?void 0:n.successMessage)||Ft,processingMessage:(n==null?void 0:n.processingMessage)||_t,submittedMessage:(n==null?void 0:n.submittedMessage)||Vi,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>Rt},extraReducers:e=>{e.addCase(N,()=>Rt)}}),{clearTransactionsInfo:nl,setTransactionsDisplayInfo:ol,clearTransactionsInfoForSessionId:il}=xn.actions,Ue=xn.reducer});var wn,Sn,bn,ll,pl,ul,dl,An,Mt=T(()=>{"use strict";o();wn=require("@reduxjs/toolkit");z();Sn={},bn=(0,wn.createSlice)({name:"modalsSlice",initialState:Sn,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(N,()=>Sn)}}),{setTxSubmittedModal:ll,setNotificationModal:pl,clearTxSubmittedModal:ul,clearNotificationModal:dl}=bn.actions,An=bn.reducer});var In,kn,vn,En,Sl,wl,bl,Al,vl,Il,Ve,Ge=T(()=>{"use strict";o();In=require("@reduxjs/toolkit"),kn=require("redux-persist");xt();j();mt();z();vn={customToasts:[],transactionToasts:[],failTransactionToast:null},En=(0,In.createSlice)({name:"toastsSlice",initialState:vn,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(w(x({},t.payload),{type:"custom",toastId:t.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,t)=>{e.customToasts=e.customToasts.filter(r=>r.toastId!==t.payload)},addTransactionToast:(e,t)=>{e.transactionToasts.push({type:"transaction",startTimestamp:Ne(),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=w(x({},t.payload),{toastId:Hr})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(N,()=>vn),e.addCase(kn.REHYDRATE,(t,r)=>{var i,p;let n=(p=(i=r.customToasts)==null?void 0:i.filter(l=>!("component"in l)))!=null?p:[];t.customToasts=n})}}),{addCustomToast:Sl,removeCustomToast:wl,addTransactionToast:bl,removeTransactionToast:Al,addFailTransactionToast:vl,removeFailTransactionToast:Il}=En.actions,Ve=En.reducer});var ce=T(()=>{"use strict";o();At();kt();Lt();Be();$e();Mt();Ge()});var Vt=T(()=>{"use strict";o()});var On,Mn,Bn,uu,du,mu,gu,fu,Tu,Un,$n=T(()=>{"use strict";o();On=require("@reduxjs/toolkit");z();Mn={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Bn=(0,On.createSlice)({name:"dappModalsSlice",initialState:Mn,reducers:{setDappModalVisibility:(e,t)=>{e.visible=t.payload},setDappModalHeaderVisibility:(e,t)=>{e.modal.showHeader=t.payload},setDappModalFooterVisibility:(e,t)=>{e.modal.showFooter=t.payload},setDappModalHeaderText:(e,t)=>{e.modal.headerText=t.payload},setDappModalFooterText:(e,t)=>{e.modal.footerText=t.payload},setDappModalConfig:(e,t)=>{e.modal=x({},t.payload)}},extraReducers:e=>{e.addCase(N,()=>Mn)}}),{setDappModalVisibility:uu,setDappModalHeaderVisibility:du,setDappModalFooterVisibility:mu,setDappModalHeaderText:gu,setDappModalFooterText:fu,setDappModalConfig:Tu}=Bn.actions,Un=Bn.reducer});var Vn,Ji,Qi,pe,je=T(()=>{"use strict";o();Vn=require("@reduxjs/toolkit");Vt();Lt();$n();At();Mt();kt();Ge();$e();Be();Ji={["account"]:dn,["networkConfig"]:an,["loginInfo"]:Zr,["modals"]:An,["dappModal"]:Un,["toasts"]:Ve,["transactions"]:Oe,["transactionsInfo"]:Ue},Qi=(e={})=>(0,Vn.combineReducers)(x(x({},Ji),e)),pe=Qi});var Wn={};Z(Wn,{default:()=>aa});function Gt(e,t=[]){return{key:e,version:1,storage:Hn.default,blacklist:t}}var re,Gn,Hn,ea,ta,ra,na,oa,ia,aa,qn=T(()=>{"use strict";o();re=require("redux-persist"),Gn=S(require("redux-persist/lib/storage")),Hn=S(require("redux-persist/lib/storage/session"));je();ce();Ge();$e();Be();Vt();ea={2:e=>w(x({},e),{networkConfig:It})};ta=Gt("dapp-core-transactionsInfo"),ra=Gt("dapp-core-transactions",["transactionsToSign"]),na=Gt("dapp-core-toasts"),oa={key:"dapp-core-store",version:2,storage:Gn.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,re.createMigrate)(ea,{debug:!1})},ia={["toasts"]:(0,re.persistReducer)(na,Ve),["transactions"]:(0,re.persistReducer)(ra,Oe),["transactionsInfo"]:(0,re.persistReducer)(ta,Ue)},aa=(0,re.persistReducer)(oa,pe(ia))});var jn={};Z(jn,{default:()=>sa});var sa,zn=T(()=>{"use strict";o();je();sa=pe()});var Kn={};Z(Kn,{default:()=>la});var P,ca,la,Yn=T(()=>{"use strict";o();P=require("redux-persist"),ca=[P.FLUSH,P.REHYDRATE,P.PAUSE,P.PERSIST,P.PURGE,P.REGISTER],la=ca});var Jn={};Z(Jn,{default:()=>Xn});function Xn(e){return(0,Zn.persistStore)(e)}var Zn,Qn=T(()=>{"use strict";o();Zn=require("redux-persist")});var Xa={};Z(Xa,{ACCOUNTS_ENDPOINT:()=>ue,ADDRESS_ENDPOINT:()=>pa,BLOCKS_ENDPOINT:()=>io,CODE_ENDPOINT:()=>fo,COLLECTIONS_ENDPOINT:()=>co,CONFIG_ENDPOINT:()=>Wt,CONTRACTS_ENDPOINT:()=>mo,IDENTITIES_ENDPOINT:()=>so,LOCKED_ACCOUNTS_ENDPOINT:()=>To,LOGS_ENDPOINT:()=>go,MINIBLOCKS_ENDPOINT:()=>da,NETWORK_CONFIG_ENDPOINT:()=>qt,NFTS_ENDPOINT:()=>lo,NODES_ENDPOINT:()=>ao,PROVIDERS_ENDPOINT:()=>po,ROLES_ENDPOINT:()=>yo,SC_RESULTS_ENDPOINT:()=>uo,TOKENS_ENDPOINT:()=>oo,TRANSACTIONS_COUNT_ENDPOINT:()=>jt,TRANSACTIONS_ENDPOINT:()=>de,TRANSFERS_ENDPOINT:()=>ua,getAccountFromApi:()=>ja,getApiAddressForChainId:()=>Ya,getEnvironmentForChainId:()=>Xt,getNetworkConfigFromApi:()=>Ka,getScamAddressData:()=>Za,getServerConfiguration:()=>Zt,getServerConfigurationForEnvironment:()=>za,getTransaction:()=>qa,getTransactions:()=>Ha,getTransactionsByHashes:()=>Ga,getTransactionsCount:()=>Wa,sendSignedTransactions:()=>Va});module.exports=fe(Xa);o();o();o();var ko=S(require("axios"));o();o();ce();o();var Dn=S(require("lodash.isequal")),He=require("reselect"),f=(0,He.createSelectorCreator)(He.defaultMemoize,Dn.default);var W=e=>e.account,Ot=f(W,e=>e.address),Bt=f(W,Ot,(e,t)=>t in e.accounts?e.accounts[t]:Fe),Bl=f(W,Bt,(e,t)=>{let i=e,{accounts:r}=i,n=ve(i,["accounts"]);return w(x({},n),{account:t})}),Ul=f(Bt,e=>e.balance),$l=f(Bt,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),Vl=f(W,e=>e.shard),Gl=f(W,e=>e.ledgerAccount),Hl=f(W,e=>e.walletConnectAccount),Wl=f(W,e=>e.isAccountLoading),ql=f(W,e=>e.accountLoadingError),jl=f(W,e=>e.websocketEvent);o();var K=e=>e.networkConfig,Yl=f(K,e=>e.chainID),Zl=f(K,e=>e.network.walletConnectBridgeAddress),Xl=f(K,e=>e.network.walletConnectV2RelayAddress),Jl=f(K,e=>e.network.walletConnectV2ProjectId),Ql=f(K,e=>e.network.walletConnectDeepLink),we=f(K,e=>e.network),We=f(we,e=>e.apiAddress),Ln=f(we,e=>e.explorerAddress),ep=f(we,e=>e.egldLabel);o();_();var le=e=>e.loginInfo,ip=f(le,e=>e.loginMethod),ap=f(le,Ot,(e,t)=>e.loginMethod!=""&&Boolean(t)),sp=f(le,e=>e.walletConnectLogin),cp=f(le,e=>e.ledgerLogin),lp=f(le,e=>e.walletLogin),pp=f(le,e=>e.isLoginSessionInvalid);o();o();var C=require("@elrondnetwork/erdjs");A();o();function Ut(e){try{return a.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function $t(e){var i,p,l;let{data:t}=e,r=Ut(t!=null?t:"")?C.TransactionPayload.fromEncoded(t):new C.TransactionPayload(t),n=new C.Transaction(x({value:e.value.valueOf(),data:r,nonce:e.nonce.valueOf(),receiver:new C.Address(e.receiver),sender:new C.Address(e.sender),gasLimit:(i=e.gasLimit.valueOf())!=null?i:St,gasPrice:(p=e.gasPrice.valueOf())!=null?p:wt,chainID:e.chainID.valueOf(),version:new C.TransactionVersion((l=e.version)!=null?l:Wr)},e.options?{options:new C.TransactionOptions(e.options)}:{}));return n.applySignature({hex:()=>e.signature||""},new C.Address(e.sender)),n}o();Ct();o();var Hi=S(require("bignumber.js"));j();o();o();o();o();var qi=require("@elrondnetwork/erdjs"),ji=S(require("bignumber.js"));_();o();var Wi=require("@elrondnetwork/erdjs");o();o();o();var Ki=require("@elrondnetwork/erdjs/out");o();A();o();var Pn=require("@elrondnetwork/erdjs");j();o();o();o();o();_();o();o();var Ht=require("@reduxjs/toolkit"),no=require("react-redux/es/utils/Subscription");ce();o();var Fn=S(require("lodash.throttle"));A();ce();yt();Ce();Te();var Yi=[Re],Zi=(0,Fn.default)(()=>{he(ye())},5e3),_n=e=>t=>r=>{var d;if(Yi.includes(r.type))return t(r);let n=e.getState(),i=ae.local.getItem(ee.loginExpiresAt);if(!((d=n==null?void 0:n.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(i==null)return he(ye());let l=Date.now();return i-l<0?setTimeout(()=>I(void 0,null,function*(){console.log("session expired");try{e.dispatch(Yr())}catch(g){console.error("error logging out",g)}}),1e3):(Zi(),t(r))};o();o();function qe(){return typeof sessionStorage!="undefined"}var eo=qe()?(qn(),fe(Wn)).default:(zn(),fe(jn)).default,to=qe()?(Yn(),fe(Kn)).default:[],ro=qe()?(Qn(),fe(Jn)).default:e=>e;je();var F=(0,Ht.configureStore)({reducer:eo,middleware:e=>e({serializableCheck:{ignoredActions:[...to,un.type,pn.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(_n)}),Vu=(0,no.createSubscription)(F),Gu=ro(F),Hu=(0,Ht.configureStore)({reducer:pe});o();o();o();o();o();o();var Wt="dapp/config",qt="network/config",pa="address",ue="accounts",de="transactions",ua="transfers",jt="transactions/count",oo="tokens",io="blocks",da="miniblocks",ao="nodes",so="identities",co="collections",lo="nfts",po="providers",uo="sc-results",mo="contracts",go="logs",fo="code",To="locked-accounts",yo="roles";o();o();o();o();D();o();o();D();o();o();o();var ha=S(require("bignumber.js"));A();o();var ya=require("@elrondnetwork/erdjs"),zt=S(require("bignumber.js"));A();o();var fa=S(require("bignumber.js"));o();zt.default.config({ROUNDING_MODE:zt.default.ROUND_FLOOR});o();o();o();A();o();o();o();o();A();o();A();o();var xa=require("@elrondnetwork/erdjs");A();o();var Ye=require("@elrondnetwork/erdjs"),wa=require("@elrondnetwork/erdjs"),ba=require("@elrondnetwork/erdjs-network-providers");A()