UNPKG

@sofaws/dapp-core

Version:

A library to hold the main logic for a dapp on the Elrond Network

1 lines 55.1 kB
"use strict";var mi=Object.create;var Ce=Object.defineProperty,gi=Object.defineProperties,fi=Object.getOwnPropertyDescriptor,Ti=Object.getOwnPropertyDescriptors,yi=Object.getOwnPropertyNames,$e=Object.getOwnPropertySymbols,hi=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty,Lr=Object.prototype.propertyIsEnumerable;var kr=(e,t,r)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t)=>{for(var r in t||(t={}))wt.call(t,r)&&kr(e,r,t[r]);if($e)for(var r of $e(t))Lr.call(t,r)&&kr(e,r,t[r]);return e},I=(e,t)=>gi(e,Ti(t));var Ve=(e,t)=>{var r={};for(var o in e)wt.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&$e)for(var o of $e(e))t.indexOf(o)<0&&Lr.call(e,o)&&(r[o]=e[o]);return r};var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var He=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ne=(e,t)=>{for(var r in t)Ce(e,r,{get:t[r],enumerable:!0})},Dr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of yi(t))!wt.call(e,c)&&c!==r&&Ce(e,c,{get:()=>t[c],enumerable:!(o=fi(t,c))||o.enumerable});return e};var x=(e,t,r)=>(r=e!=null?mi(hi(e)):{},Dr(t||!e||!e.__esModule?Ce(r,"default",{value:e,enumerable:!0}):r,e)),Ne=e=>Dr(Ce({},"__esModule",{value:!0}),e);var w=(e,t,r)=>new Promise((o,c)=>{var l=d=>{try{m(r.next(d))}catch(f){c(f)}},p=d=>{try{m(r.throw(d))}catch(f){c(f)}},m=d=>d.done?o(d.value):Promise.resolve(d.value).then(l,p);m((r=r.apply(e,t)).next())});var Nr=He(je=>{"use strict";n();je.byteLength=xi;je.toByteArray=vi;je.fromByteArray=Ai;var $=[],B=[],Si=typeof Uint8Array!="undefined"?Uint8Array:Array,vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(oe=0,Pr=vt.length;oe<Pr;++oe)$[oe]=vt[oe],B[vt.charCodeAt(oe)]=oe;var oe,Pr;B["-".charCodeAt(0)]=62;B["_".charCodeAt(0)]=63;function Cr(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var o=r===t?0:4-r%4;return[r,o]}function xi(e){var t=Cr(e),r=t[0],o=t[1];return(r+o)*3/4-o}function wi(e,t,r){return(t+r)*3/4-r}function vi(e){var t,r=Cr(e),o=r[0],c=r[1],l=new Si(wi(e,o,c)),p=0,m=c>0?o-4:o,d;for(d=0;d<m;d+=4)t=B[e.charCodeAt(d)]<<18|B[e.charCodeAt(d+1)]<<12|B[e.charCodeAt(d+2)]<<6|B[e.charCodeAt(d+3)],l[p++]=t>>16&255,l[p++]=t>>8&255,l[p++]=t&255;return c===2&&(t=B[e.charCodeAt(d)]<<2|B[e.charCodeAt(d+1)]>>4,l[p++]=t&255),c===1&&(t=B[e.charCodeAt(d)]<<10|B[e.charCodeAt(d+1)]<<4|B[e.charCodeAt(d+2)]>>2,l[p++]=t>>8&255,l[p++]=t&255),l}function bi(e){return $[e>>18&63]+$[e>>12&63]+$[e>>6&63]+$[e&63]}function Ii(e,t,r){for(var o,c=[],l=t;l<r;l+=3)o=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),c.push(bi(o));return c.join("")}function Ai(e){for(var t,r=e.length,o=r%3,c=[],l=16383,p=0,m=r-o;p<m;p+=l)c.push(Ii(e,p,p+l>m?m:p+l));return o===1?(t=e[r-1],c.push($[t>>2]+$[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],c.push($[t>>10]+$[t>>4&63]+$[t<<2&63]+"=")),c.join("")}});var Rr=He(bt=>{n();bt.read=function(e,t,r,o,c){var l,p,m=c*8-o-1,d=(1<<m)-1,f=d>>1,S=-7,h=r?c-1:0,P=r?-1:1,C=e[t+h];for(h+=P,l=C&(1<<-S)-1,C>>=-S,S+=m;S>0;l=l*256+e[t+h],h+=P,S-=8);for(p=l&(1<<-S)-1,l>>=-S,S+=o;S>0;p=p*256+e[t+h],h+=P,S-=8);if(l===0)l=1-f;else{if(l===d)return p?NaN:(C?-1:1)*(1/0);p=p+Math.pow(2,o),l=l-f}return(C?-1:1)*p*Math.pow(2,l-o)};bt.write=function(e,t,r,o,c,l){var p,m,d,f=l*8-c-1,S=(1<<f)-1,h=S>>1,P=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=o?0:l-1,Q=o?1:-1,z=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,p=S):(p=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-p))<1&&(p--,d*=2),p+h>=1?t+=P/d:t+=P*Math.pow(2,1-h),t*d>=2&&(p++,d/=2),p+h>=S?(m=0,p=S):p+h>=1?(m=(t*d-1)*Math.pow(2,c),p=p+h):(m=t*Math.pow(2,h-1)*Math.pow(2,c),p=0));c>=8;e[r+C]=m&255,C+=Q,m/=256,c-=8);for(p=p<<c|m,f+=c;f>0;e[r+C]=p&255,C+=Q,p/=256,f-=8);e[r+C-Q]|=z*128}});var zr=He(ge=>{"use strict";n();var It=Nr(),me=Rr(),Mr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ge.Buffer=u;ge.SlowBuffer=Ci;ge.INSPECT_MAX_BYTES=50;var ze=2147483647;ge.kMaxLength=ze;u.TYPED_ARRAY_SUPPORT=Ei();!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 Ei(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(r){return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function q(e){if(e>ze)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 Lt(e)}return _r(e,t,r)}u.poolSize=8192;function _r(e,t,r){if(typeof e=="string")return Li(e,t);if(ArrayBuffer.isView(e))return Di(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(V(e,ArrayBuffer)||e&&V(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(V(e,SharedArrayBuffer)||e&&V(e.buffer,SharedArrayBuffer)))return Et(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(o!=null&&o!==e)return u.from(o,t,r);var c=Pi(e);if(c)return c;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 _r(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function Ur(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 ki(e,t,r){return Ur(e),e<=0?q(e):t!==void 0?typeof r=="string"?q(e).fill(t,r):q(e).fill(t):q(e)}u.alloc=function(e,t,r){return ki(e,t,r)};function Lt(e){return Ur(e),q(e<0?0:Dt(e)|0)}u.allocUnsafe=function(e){return Lt(e)};u.allocUnsafeSlow=function(e){return Lt(e)};function Li(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=Br(e,t)|0,o=q(r),c=o.write(e,t);return c!==r&&(o=o.slice(0,c)),o}function At(e){for(var t=e.length<0?0:Dt(e.length)|0,r=q(t),o=0;o<t;o+=1)r[o]=e[o]&255;return r}function Di(e){if(V(e,Uint8Array)){var t=new Uint8Array(e);return Et(t.buffer,t.byteOffset,t.byteLength)}return At(e)}function Et(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var o;return t===void 0&&r===void 0?o=new Uint8Array(e):r===void 0?o=new Uint8Array(e,t):o=new Uint8Array(e,t,r),Object.setPrototypeOf(o,u.prototype),o}function Pi(e){if(u.isBuffer(e)){var t=Dt(e.length)|0,r=q(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||Pt(e.length)?q(0):At(e);if(e.type==="Buffer"&&Array.isArray(e.data))return At(e.data)}function Dt(e){if(e>=ze)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ze.toString(16)+" bytes");return e|0}function Ci(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(V(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),V(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(t)||!u.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var o=t.length,c=r.length,l=0,p=Math.min(o,c);l<p;++l)if(t[l]!==r[l]){o=t[l],c=r[l];break}return o<c?-1:c<o?1:0};u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return u.alloc(0);var o;if(r===void 0)for(r=0,o=0;o<t.length;++o)r+=t[o].length;var c=u.allocUnsafe(r),l=0;for(o=0;o<t.length;++o){var p=t[o];if(V(p,Uint8Array))l+p.length>c.length?u.from(p).copy(c,l):Uint8Array.prototype.set.call(c,p,l);else if(u.isBuffer(p))p.copy(c,l);else throw new TypeError('"list" argument must be an Array of Buffers');l+=p.length}return c};function Br(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||V(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,o=arguments.length>2&&arguments[2]===!0;if(!o&&r===0)return 0;for(var c=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return kt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return jr(e).length;default:if(c)return o?-1:kt(e).length;t=(""+t).toLowerCase(),c=!0}}u.byteLength=Br;function Ni(e,t,r){var o=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return $i(this,t,r);case"utf8":case"utf-8":return Gr(this,t,r);case"ascii":return Wi(this,t,r);case"latin1":case"binary":return Gi(this,t,r);case"base64":return Ui(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Vi(this,t,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}u.prototype._isBuffer=!0;function ie(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}u.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)ie(this,r,r+1);return this};u.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)ie(this,r,r+3),ie(this,r+1,r+2);return this};u.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)ie(this,r,r+7),ie(this,r+1,r+6),ie(this,r+2,r+5),ie(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?Gr(this,0,t):Ni.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=ge.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Mr&&(u.prototype[Mr]=u.prototype.inspect);u.prototype.compare=function(t,r,o,c,l){if(V(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),o===void 0&&(o=t?t.length:0),c===void 0&&(c=0),l===void 0&&(l=this.length),r<0||o>t.length||c<0||l>this.length)throw new RangeError("out of range index");if(c>=l&&r>=o)return 0;if(c>=l)return-1;if(r>=o)return 1;if(r>>>=0,o>>>=0,c>>>=0,l>>>=0,this===t)return 0;for(var p=l-c,m=o-r,d=Math.min(p,m),f=this.slice(c,l),S=t.slice(r,o),h=0;h<d;++h)if(f[h]!==S[h]){p=f[h],m=S[h];break}return p<m?-1:m<p?1:0};function Wr(e,t,r,o,c){if(e.length===0)return-1;if(typeof r=="string"?(o=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Pt(r)&&(r=c?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(c)return-1;r=e.length-1}else if(r<0)if(c)r=0;else return-1;if(typeof t=="string"&&(t=u.from(t,o)),u.isBuffer(t))return t.length===0?-1:Or(e,t,r,o,c);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?c?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Or(e,[t],r,o,c);throw new TypeError("val must be string, number or Buffer")}function Or(e,t,r,o,c){var l=1,p=e.length,m=t.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(e.length<2||t.length<2)return-1;l=2,p/=2,m/=2,r/=2}function d(C,Q){return l===1?C[Q]:C.readUInt16BE(Q*l)}var f;if(c){var S=-1;for(f=r;f<p;f++)if(d(e,f)===d(t,S===-1?0:f-S)){if(S===-1&&(S=f),f-S+1===m)return S*l}else S!==-1&&(f-=f-S),S=-1}else for(r+m>p&&(r=p-m),f=r;f>=0;f--){for(var h=!0,P=0;P<m;P++)if(d(e,f+P)!==d(t,P)){h=!1;break}if(h)return f}return-1}u.prototype.includes=function(t,r,o){return this.indexOf(t,r,o)!==-1};u.prototype.indexOf=function(t,r,o){return Wr(this,t,r,o,!0)};u.prototype.lastIndexOf=function(t,r,o){return Wr(this,t,r,o,!1)};function Ri(e,t,r,o){r=Number(r)||0;var c=e.length-r;o?(o=Number(o),o>c&&(o=c)):o=c;var l=t.length;o>l/2&&(o=l/2);for(var p=0;p<o;++p){var m=parseInt(t.substr(p*2,2),16);if(Pt(m))return p;e[r+p]=m}return p}function Mi(e,t,r,o){return qe(kt(t,e.length-r),e,r,o)}function Oi(e,t,r,o){return qe(zi(t),e,r,o)}function Fi(e,t,r,o){return qe(jr(t),e,r,o)}function _i(e,t,r,o){return qe(qi(t,e.length-r),e,r,o)}u.prototype.write=function(t,r,o,c){if(r===void 0)c="utf8",o=this.length,r=0;else if(o===void 0&&typeof r=="string")c=r,o=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(o)?(o=o>>>0,c===void 0&&(c="utf8")):(c=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),t.length>0&&(o<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");for(var p=!1;;)switch(c){case"hex":return Ri(this,t,r,o);case"utf8":case"utf-8":return Mi(this,t,r,o);case"ascii":case"latin1":case"binary":return Oi(this,t,r,o);case"base64":return Fi(this,t,r,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _i(this,t,r,o);default:if(p)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),p=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ui(e,t,r){return t===0&&r===e.length?It.fromByteArray(e):It.fromByteArray(e.slice(t,r))}function Gr(e,t,r){r=Math.min(e.length,r);for(var o=[],c=t;c<r;){var l=e[c],p=null,m=l>239?4:l>223?3:l>191?2:1;if(c+m<=r){var d,f,S,h;switch(m){case 1:l<128&&(p=l);break;case 2:d=e[c+1],(d&192)===128&&(h=(l&31)<<6|d&63,h>127&&(p=h));break;case 3:d=e[c+1],f=e[c+2],(d&192)===128&&(f&192)===128&&(h=(l&15)<<12|(d&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(p=h));break;case 4:d=e[c+1],f=e[c+2],S=e[c+3],(d&192)===128&&(f&192)===128&&(S&192)===128&&(h=(l&15)<<18|(d&63)<<12|(f&63)<<6|S&63,h>65535&&h<1114112&&(p=h))}}p===null?(p=65533,m=1):p>65535&&(p-=65536,o.push(p>>>10&1023|55296),p=56320|p&1023),o.push(p),c+=m}return Bi(o)}var Fr=4096;function Bi(e){var t=e.length;if(t<=Fr)return String.fromCharCode.apply(String,e);for(var r="",o=0;o<t;)r+=String.fromCharCode.apply(String,e.slice(o,o+=Fr));return r}function Wi(e,t,r){var o="";r=Math.min(e.length,r);for(var c=t;c<r;++c)o+=String.fromCharCode(e[c]&127);return o}function Gi(e,t,r){var o="";r=Math.min(e.length,r);for(var c=t;c<r;++c)o+=String.fromCharCode(e[c]);return o}function $i(e,t,r){var o=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>o)&&(r=o);for(var c="",l=t;l<r;++l)c+=Ki[e[l]];return c}function Vi(e,t,r){for(var o=e.slice(t,r),c="",l=0;l<o.length-1;l+=2)c+=String.fromCharCode(o[l]+o[l+1]*256);return c}u.prototype.slice=function(t,r){var o=this.length;t=~~t,r=r===void 0?o:~~r,t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),r<0?(r+=o,r<0&&(r=0)):r>o&&(r=o),r<t&&(r=t);var c=this.subarray(t,r);return Object.setPrototypeOf(c,u.prototype),c};function D(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||D(t,r,this.length);for(var c=this[t],l=1,p=0;++p<r&&(l*=256);)c+=this[t+p]*l;return c};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||D(t,r,this.length);for(var c=this[t+--r],l=1;r>0&&(l*=256);)c+=this[t+--r]*l;return c};u.prototype.readUint8=u.prototype.readUInt8=function(t,r){return t=t>>>0,r||D(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||D(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||D(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||D(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||D(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||D(t,r,this.length);for(var c=this[t],l=1,p=0;++p<r&&(l*=256);)c+=this[t+p]*l;return l*=128,c>=l&&(c-=Math.pow(2,8*r)),c};u.prototype.readIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||D(t,r,this.length);for(var c=r,l=1,p=this[t+--c];c>0&&(l*=256);)p+=this[t+--c]*l;return l*=128,p>=l&&(p-=Math.pow(2,8*r)),p};u.prototype.readInt8=function(t,r){return t=t>>>0,r||D(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||D(t,2,this.length);var o=this[t]|this[t+1]<<8;return o&32768?o|4294901760:o};u.prototype.readInt16BE=function(t,r){t=t>>>0,r||D(t,2,this.length);var o=this[t+1]|this[t]<<8;return o&32768?o|4294901760:o};u.prototype.readInt32LE=function(t,r){return t=t>>>0,r||D(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||D(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||D(t,4,this.length),me.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||D(t,4,this.length),me.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||D(t,8,this.length),me.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||D(t,8,this.length),me.read(this,t,!1,52,8)};function M(e,t,r,o,c,l){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>c||t<l)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,r,o,c){if(t=+t,r=r>>>0,o=o>>>0,!c){var l=Math.pow(2,8*o)-1;M(this,t,r,o,l,0)}var p=1,m=0;for(this[r]=t&255;++m<o&&(p*=256);)this[r+m]=t/p&255;return r+o};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,r,o,c){if(t=+t,r=r>>>0,o=o>>>0,!c){var l=Math.pow(2,8*o)-1;M(this,t,r,o,l,0)}var p=o-1,m=1;for(this[r+p]=t&255;--p>=0&&(m*=256);)this[r+p]=t/m&255;return r+o};u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,o){return t=+t,r=r>>>0,o||M(this,t,r,1,255,0),this[r]=t&255,r+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||M(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,r,o){return t=+t,r=r>>>0,o||M(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,r,o){return t=+t,r=r>>>0,o||M(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,r,o){return t=+t,r=r>>>0,o||M(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};u.prototype.writeIntLE=function(t,r,o,c){if(t=+t,r=r>>>0,!c){var l=Math.pow(2,8*o-1);M(this,t,r,o,l-1,-l)}var p=0,m=1,d=0;for(this[r]=t&255;++p<o&&(m*=256);)t<0&&d===0&&this[r+p-1]!==0&&(d=1),this[r+p]=(t/m>>0)-d&255;return r+o};u.prototype.writeIntBE=function(t,r,o,c){if(t=+t,r=r>>>0,!c){var l=Math.pow(2,8*o-1);M(this,t,r,o,l-1,-l)}var p=o-1,m=1,d=0;for(this[r+p]=t&255;--p>=0&&(m*=256);)t<0&&d===0&&this[r+p+1]!==0&&(d=1),this[r+p]=(t/m>>0)-d&255;return r+o};u.prototype.writeInt8=function(t,r,o){return t=+t,r=r>>>0,o||M(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};u.prototype.writeInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||M(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeInt16BE=function(t,r,o){return t=+t,r=r>>>0,o||M(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeInt32LE=function(t,r,o){return t=+t,r=r>>>0,o||M(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};u.prototype.writeInt32BE=function(t,r,o){return t=+t,r=r>>>0,o||M(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 $r(e,t,r,o,c,l){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Vr(e,t,r,o,c){return t=+t,r=r>>>0,c||$r(e,t,r,4,34028234663852886e22,-34028234663852886e22),me.write(e,t,r,o,23,4),r+4}u.prototype.writeFloatLE=function(t,r,o){return Vr(this,t,r,!0,o)};u.prototype.writeFloatBE=function(t,r,o){return Vr(this,t,r,!1,o)};function Hr(e,t,r,o,c){return t=+t,r=r>>>0,c||$r(e,t,r,8,17976931348623157e292,-17976931348623157e292),me.write(e,t,r,o,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,o){return Hr(this,t,r,!0,o)};u.prototype.writeDoubleBE=function(t,r,o){return Hr(this,t,r,!1,o)};u.prototype.copy=function(t,r,o,c){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(o||(o=0),!c&&c!==0&&(c=this.length),r>=t.length&&(r=t.length),r||(r=0),c>0&&c<o&&(c=o),c===o||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),t.length-r<c-o&&(c=t.length-r+o);var l=c-o;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,o,c):Uint8Array.prototype.set.call(t,this.subarray(o,c),r),l};u.prototype.fill=function(t,r,o,c){if(typeof t=="string"){if(typeof r=="string"?(c=r,r=0,o=this.length):typeof o=="string"&&(c=o,o=this.length),c!==void 0&&typeof c!="string")throw new TypeError("encoding must be a string");if(typeof c=="string"&&!u.isEncoding(c))throw new TypeError("Unknown encoding: "+c);if(t.length===1){var l=t.charCodeAt(0);(c==="utf8"&&l<128||c==="latin1")&&(t=l)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<o)throw new RangeError("Out of range index");if(o<=r)return this;r=r>>>0,o=o===void 0?this.length:o>>>0,t||(t=0);var p;if(typeof t=="number")for(p=r;p<o;++p)this[p]=t;else{var m=u.isBuffer(t)?t:u.from(t,c),d=m.length;if(d===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(p=0;p<o-r;++p)this[p+r]=m[p%d]}return this};var Hi=/[^+/0-9A-Za-z-_]/g;function ji(e){if(e=e.split("=")[0],e=e.trim().replace(Hi,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function kt(e,t){t=t||1/0;for(var r,o=e.length,c=null,l=[],p=0;p<o;++p){if(r=e.charCodeAt(p),r>55295&&r<57344){if(!c){if(r>56319){(t-=3)>-1&&l.push(239,191,189);continue}else if(p+1===o){(t-=3)>-1&&l.push(239,191,189);continue}c=r;continue}if(r<56320){(t-=3)>-1&&l.push(239,191,189),c=r;continue}r=(c-55296<<10|r-56320)+65536}else c&&(t-=3)>-1&&l.push(239,191,189);if(c=null,r<128){if((t-=1)<0)break;l.push(r)}else if(r<2048){if((t-=2)<0)break;l.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;l.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=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 zi(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function qi(e,t){for(var r,o,c,l=[],p=0;p<e.length&&!((t-=2)<0);++p)r=e.charCodeAt(p),o=r>>8,c=r%256,l.push(c),l.push(o);return l}function jr(e){return It.toByteArray(ji(e))}function qe(e,t,r,o){for(var c=0;c<o&&!(c+r>=t.length||c>=e.length);++c)t[c+r]=e[c];return c}function V(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 Ki=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=r*16,c=0;c<16;++c)t[o+c]=e[r]+e[c];return t}()});var Xr=He((zc,Zr)=>{n();var L=Zr.exports={},H,j;function Ct(){throw new Error("setTimeout has not been defined")}function Nt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?H=setTimeout:H=Ct}catch(e){H=Ct}try{typeof clearTimeout=="function"?j=clearTimeout:j=Nt}catch(e){j=Nt}})();function qr(e){if(H===setTimeout)return setTimeout(e,0);if((H===Ct||!H)&&setTimeout)return H=setTimeout,setTimeout(e,0);try{return H(e,0)}catch(t){try{return H.call(null,e,0)}catch(r){return H.call(this,e,0)}}}function Yi(e){if(j===clearTimeout)return clearTimeout(e);if((j===Nt||!j)&&clearTimeout)return j=clearTimeout,clearTimeout(e);try{return j(e)}catch(t){try{return j.call(null,e)}catch(r){return j.call(this,e)}}}var K=[],fe=!1,se,Ke=-1;function Zi(){!fe||!se||(fe=!1,se.length?K=se.concat(K):Ke=-1,K.length&&Kr())}function Kr(){if(!fe){var e=qr(Zi);fe=!0;for(var t=K.length;t;){for(se=K,K=[];++Ke<t;)se&&se[Ke].run();Ke=-1,t=K.length}se=null,fe=!1,Yi(e)}}L.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];K.push(new Yr(e,t)),K.length===1&&!fe&&qr(Kr)};function Yr(e,t){this.fun=e,this.array=t}Yr.prototype.run=function(){this.fun.apply(null,this.array)};L.title="browser";L.browser=!0;L.env={};L.argv=[];L.version="";L.versions={};function Y(){}L.on=Y;L.addListener=Y;L.once=Y;L.off=Y;L.removeListener=Y;L.removeAllListeners=Y;L.emit=Y;L.prependListener=Y;L.prependOnceListener=Y;L.listeners=function(e){return[]};L.binding=function(e){throw new Error("process.binding is not supported")};L.cwd=function(){return"/"};L.chdir=function(e){throw new Error("process.chdir is not supported")};L.umask=function(){return 0}});var i,s,qc,n=y(()=>{i=x(zr()),s=x(Xr()),qc=function(e){function t(){var o=this||self;return delete e.prototype.__magic__,o}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var r=__magic__;return r}(Object)});var Ye,Rt=y(()=>{"use strict";n();Ye=()=>Date.now()/1e3});var Jr=y(()=>{"use strict";n()});var Qr=y(()=>{"use strict";n()});var Mt=y(()=>{"use strict";n();Rt();Jr();Qr()});var Ft={};ne(Ft,{getItem:()=>Ji,localStorageKeys:()=>ee,removeItem:()=>Qi,setItem:()=>Xi});var ee,Ot,Xi,Ji,Qi,Te=y(()=>{"use strict";n();Mt();ee={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Ot=typeof localStorage!="undefined",Xi=({key:e,data:t,expires:r})=>{!Ot||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Ji=e=>{if(!Ot)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:Ye()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},Qi=e=>{!Ot||localStorage.removeItem(String(e))}});var _t={};ne(_t,{clear:()=>nn,getItem:()=>tn,removeItem:()=>rn,setItem:()=>en,storage:()=>es});var en,tn,rn,nn,es,on=y(()=>{"use strict";n();en=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},tn=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},rn=e=>sessionStorage.removeItem(String(e)),nn=()=>sessionStorage.clear(),es={setItem:en,getItem:tn,removeItem:rn,clear:nn}});var ae,ye=y(()=>{"use strict";n();Te();on();ae={session:_t,local:Ft}});function Re(){return new Date().setHours(new Date().getHours()+24)}function Me(e){ae.local.setItem({key:ee.loginExpiresAt,data:e,expires:e})}var Ut=y(()=>{"use strict";n();ye();Te()});var k=y(()=>{"use strict";n()});var he=y(()=>{"use strict";n()});var sn=y(()=>{"use strict";n()});var N=y(()=>{"use strict";n()});var an=y(()=>{"use strict";n()});var cn=y(()=>{"use strict";n()});var ln=y(()=>{"use strict";n()});var pn=y(()=>{"use strict";n()});var _=y(()=>{"use strict";n();sn();N();k();an();cn();ln();pn()});var Bt,un,wl,dn,vl,mn,bl,Il,Al,gn=y(()=>{"use strict";n();_();Bt={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:un,egldLabel:wl}=Bt["devnet"],{chainId:dn,egldLabel:vl}=Bt["testnet"],{chainId:mn,egldLabel:bl}=Bt["mainnet"],Il={["devnet"]:un,["testnet"]:dn,["mainnet"]:mn},Al={[un]:"devnet",[dn]:"testnet",[mn]:"mainnet"}});var Wt=y(()=>{"use strict";n()});var fn=y(()=>{"use strict";n()});var Ze,Gt=y(()=>{"use strict";n();Ze="transaction-status-toast-id"});var Oe,Xe,Tn,Je,yn,Se,A=y(()=>{"use strict";n();he();gn();Wt();fn();Gt();Oe=5e4,Xe=1e9,Tn=1,Je="logout",yn="login",Se="0"});var $t,R,Z,O=y(()=>{"use strict";n();$t=require("@reduxjs/toolkit");A();R=(0,$t.createAction)(Je),Z=(0,$t.createAction)(yn,e=>({payload:e}))});var Sn,hn,xn,Vl,wn,ts,Fe,vn,rs,bn,In,Vt=y(()=>{"use strict";n();Sn=require("@reduxjs/toolkit");Ut();k();O();hn={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},xn=(0,Sn.createSlice)({name:"loginInfoSlice",initialState:hn,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(R,()=>hn),e.addCase(Z,(t,r)=>{t.loginMethod=r.payload.loginMethod,Me(Re())})}}),{setLoginMethod:Vl,setWalletConnectLogin:wn,setLedgerLogin:ts,setTokenLogin:Fe,setTokenLoginSignature:vn,setWalletLogin:rs,invalidateLoginSession:bn}=xn.actions,In=xn.reducer});var _e=y(()=>{"use strict";n()});var En=y(()=>{"use strict";n();_e()});function Ht(e){return e[Math.floor(Math.random()*e.length)]}var kn=y(()=>{"use strict";n()});var jt=y(()=>{"use strict";n();Wt()});var xe=y(()=>{"use strict";n();En();kn();jt()});var Ln,Dn,zt,ns,Pn,op,ip,Cn,qt=y(()=>{"use strict";n();Ln=require("@reduxjs/toolkit"),Dn=x(require("lodash.omit"));xe();zt={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},ns={network:zt,chainID:"-1"},Pn=(0,Ln.createSlice)({name:"appConfig",initialState:ns,reducers:{initializeNetworkConfig:(e,t)=>{let r=Ht(t.payload.walletConnectBridgeAddresses),o=Ht(t.payload.walletConnectV2RelayAddresses),c=(0,Dn.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=I(T(T({},e.network),c),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:o})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:op,setChainID:ip}=Pn.actions,Cn=Pn.reducer});var Yt,Nn,Rn,Qe,Kt,Mn,Zt,mp,Xt,gp,os,is,fp,Tp,yp,ss,On,Jt=y(()=>{"use strict";n();Yt=require("@elrondnetwork/erdjs"),Nn=require("@reduxjs/toolkit"),Rn=require("redux-persist");A();ye();Te();O();Qe={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Se},Kt={address:"",websocketEvent:null,accounts:{"":Qe},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Mn=(0,Nn.createSlice)({name:"accountInfoSlice",initialState:Kt,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new Yt.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Qe},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(R,()=>(ae.local.removeItem(ee.loginExpiresAt),Kt)),e.addCase(Z,(t,r)=>{let{address:o}=r.payload;t.address=o,t.publicKey=new Yt.Address(o).hex()}),e.addCase(Rn.REHYDRATE,(t,r)=>{var f;if(!((f=r.payload)!=null&&f.account))return;let{account:o}=r.payload,{address:c,shard:l,accounts:p,publicKey:m}=o;t.address=c,t.shard=l;let d=p&&c in p;t.accounts=d?p:Kt.accounts,t.publicKey=m})}}),{setAccount:Zt,setAddress:mp,setAccountNonce:Xt,setAccountShard:gp,setLedgerAccount:os,updateLedgerAccount:is,setWalletConnectAccount:fp,setIsAccountLoading:Tp,setAccountLoadingError:yp,setWebsocketEvent:ss}=Mn.actions,On=Mn.reducer});function we(e){return e!=null&&(gs(e)||hs(e))}function ve(e){return e!=null&&(fs(e)||Ss(e))}function be(e){return e!=null&&(Ts(e)||xs(e))}function Qt(e){return e!=null&&ys(e)}function gs(e){return e!=null&&as.includes(e)}function fs(e){return e!=null&&cs.includes(e)}function Ts(e){return e!=null&&ls.includes(e)}function ys(e){return e!=null&&ps.includes(e)}function hs(e){return e!=null&&us.includes(e)}function Ss(e){return e!=null&&ds.includes(e)}function xs(e){return e!=null&&ms.includes(e)}var as,cs,ls,ps,us,ds,ms,Ie=y(()=>{"use strict";n();k();as=["sent"],cs=["success"],ls=["fail","cancelled","timedOut"],ps=["timedOut"],us=["pending"],ds=["success"],ms=["fail","invalid"]});var Fn,_n,Be,ws,Un,Bn,Wn,vs,et,bs,Is,Ep,As,tt,er,rt,nt=y(()=>{"use strict";n();Fn=require("@reduxjs/toolkit"),_n=require("redux-persist");k();Ie();O();Be={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},ws={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Un=(0,Fn.createSlice)({name:"transactionsSlice",initialState:Be,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,f;let{sessionId:r,transactions:o,errorMessage:c,status:l,redirectRoute:p}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||ws;e.signedTransactions[r]={transactions:o,status:l,errorMessage:c,redirectRoute:p,customTransactionInformation:m},((f=e==null?void 0:e.transactionsToSign)==null?void 0:f.sessionId)===r&&(e.transactionsToSign=Be.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=T(T({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:o,errorMessage:c,transactions:l}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=o,c!=null&&(e.signedTransactions[r].errorMessage=c),l!=null&&(e.signedTransactions[r].transactions=l))},updateSignedTransactionStatus:(e,t)=>{var m,d,f,S,h,P;let{sessionId:r,status:o,errorMessage:c,transactionHash:l}=t.payload,p=(d=(m=e.signedTransactions)==null?void 0:m[r])==null?void 0:d.transactions;if(p!=null){e.signedTransactions[r].transactions=p.map(z=>z.hash===l?I(T({},z),{status:o,errorMessage:c}):z);let C=(S=(f=e.signedTransactions[r])==null?void 0:f.transactions)==null?void 0:S.every(z=>ve(z.status)),Q=(P=(h=e.signedTransactions[r])==null?void 0:h.transactions)==null?void 0:P.every(z=>be(z.status));C&&(e.signedTransactions[r].status="success"),Q&&(e.signedTransactions[r].status="fail")}},setTransactionsToSign:(e,t)=>{e.transactionsToSign=t.payload;let{sessionId:r,customTransactionInformation:o}=t.payload;e.customTransactionInformationForSessionId[r]=o,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=Be.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Be.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(R,()=>Be),e.addCase(_n.REHYDRATE,(t,r)=>{var p;if(t.signTransactionsCancelMessage=null,!((p=r.payload)!=null&&p.transactions))return;let{signedTransactions:o,customTransactionInformationForSessionId:c}=r.payload.transactions,l=Object.entries(o).reduce((m,[d,f])=>{let S=new Date(d),h=new Date;return h.setHours(h.getHours()+5),h-S>0||(m[d]=f),m},{});c!=null&&(t.customTransactionInformationForSessionId=c),o!=null&&(t.signedTransactions=l)})}}),{updateSignedTransactionStatus:Bn,updateSignedTransactions:Wn,setTransactionsToSign:vs,clearAllTransactionsToSign:et,clearAllSignedTransactions:bs,clearSignedTransaction:Is,clearTransactionToSign:Ep,setSignTransactionsError:As,setSignTransactionsCancelMessage:tt,moveTransactionsToSignedState:er}=Un.actions,rt=Un.reducer});var Gn,rr,nr,or,Es,tr,$n,Pp,ks,ir,ot,it=y(()=>{"use strict";n();Gn=require("@reduxjs/toolkit");O();rr="Transaction failed",nr="Transaction successful",or="Processing transaction",Es="Transaction submitted",tr={},$n=(0,Gn.createSlice)({name:"transactionsInfo",initialState:tr,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:o}=t.payload;r!=null&&(e[r]={errorMessage:(o==null?void 0:o.errorMessage)||rr,successMessage:(o==null?void 0:o.successMessage)||nr,processingMessage:(o==null?void 0:o.processingMessage)||or,submittedMessage:(o==null?void 0:o.submittedMessage)||Es,transactionDuration:o==null?void 0:o.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>tr},extraReducers:e=>{e.addCase(R,()=>tr)}}),{clearTransactionsInfo:Pp,setTransactionsDisplayInfo:ks,clearTransactionsInfoForSessionId:ir}=$n.actions,ot=$n.reducer});var Hn,Vn,jn,Mp,Ls,Op,Ds,zn,sr=y(()=>{"use strict";n();Hn=require("@reduxjs/toolkit");O();Vn={},jn=(0,Hn.createSlice)({name:"modalsSlice",initialState:Vn,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(R,()=>Vn)}}),{setTxSubmittedModal:Mp,setNotificationModal:Ls,clearTxSubmittedModal:Op,clearNotificationModal:Ds}=jn.actions,zn=jn.reducer});var Kn,Yn,qn,Zn,Ps,ar,Vp,Hp,jp,zp,st,at=y(()=>{"use strict";n();Kn=require("@reduxjs/toolkit"),Yn=require("redux-persist");Gt();_();Rt();O();qn={customToasts:[],transactionToasts:[],failTransactionToast:null},Zn=(0,Kn.createSlice)({name:"toastsSlice",initialState:qn,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(I(T({},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:Ye(),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=I(T({},t.payload),{toastId:Ze})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(R,()=>qn),e.addCase(Yn.REHYDRATE,(t,r)=>{var c,l;let o=(l=(c=r.customToasts)==null?void 0:c.filter(p=>!("component"in p)))!=null?l:[];t.customToasts=o})}}),{addCustomToast:Ps,removeCustomToast:ar,addTransactionToast:Vp,removeTransactionToast:Hp,addFailTransactionToast:jp,removeFailTransactionToast:zp}=Zn.actions,st=Zn.reducer});var E=y(()=>{"use strict";n();Vt();qt();Jt();nt();it();sr();at()});var cr=y(()=>{"use strict";n()});var eo,Qn,to,lr,du,mu,gu,fu,ro,no,pr=y(()=>{"use strict";n();eo=require("@reduxjs/toolkit");O();Qn={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},to=(0,eo.createSlice)({name:"dappModalsSlice",initialState:Qn,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=T({},t.payload)}},extraReducers:e=>{e.addCase(R,()=>Qn)}}),{setDappModalVisibility:lr,setDappModalHeaderVisibility:du,setDappModalFooterVisibility:mu,setDappModalHeaderText:gu,setDappModalFooterText:fu,setDappModalConfig:ro}=to.actions,no=to.reducer});var oo,Ms,Os,Ae,lt=y(()=>{"use strict";n();oo=require("@reduxjs/toolkit");cr();Jt();pr();Vt();sr();qt();at();it();nt();Ms={["account"]:On,["networkConfig"]:Cn,["loginInfo"]:In,["modals"]:zn,["dappModal"]:no,["toasts"]:st,["transactions"]:rt,["transactionsInfo"]:ot},Os=(e={})=>(0,oo.combineReducers)(T(T({},Ms),e)),Ae=Os});var ao={};ne(ao,{default:()=>$s});function ur(e,t=[]){return{key:e,version:1,storage:so.default,blacklist:t}}var le,io,so,Fs,_s,Us,Bs,Ws,Gs,$s,co=y(()=>{"use strict";n();le=require("redux-persist"),io=x(require("redux-persist/lib/storage")),so=x(require("redux-persist/lib/storage/session"));lt();E();at();it();nt();cr();Fs={2:e=>I(T({},e),{networkConfig:zt})};_s=ur("dapp-core-transactionsInfo"),Us=ur("dapp-core-transactions",["transactionsToSign"]),Bs=ur("dapp-core-toasts"),Ws={key:"dapp-core-store",version:2,storage:io.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,le.createMigrate)(Fs,{debug:!1})},Gs={["toasts"]:(0,le.persistReducer)(Bs,st),["transactions"]:(0,le.persistReducer)(Us,rt),["transactionsInfo"]:(0,le.persistReducer)(_s,ot)},$s=(0,le.persistReducer)(Ws,Ae(Gs))});var lo={};ne(lo,{default:()=>Vs});var Vs,po=y(()=>{"use strict";n();lt();Vs=Ae()});var uo={};ne(uo,{default:()=>js});var G,Hs,js,mo=y(()=>{"use strict";n();G=require("redux-persist"),Hs=[G.FLUSH,G.REHYDRATE,G.PAUSE,G.PERSIST,G.PURGE,G.REGISTER],js=Hs});var To={};ne(To,{default:()=>fo});function fo(e){return(0,go.persistStore)(e)}var go,yo=y(()=>{"use strict";n();go=require("redux-persist")});var Gc={};ne(Gc,{useDappModal:()=>Wc});module.exports=Ne(Gc);n();var Pe=require("react");n();n();n();var bo=require("react"),Ee=require("react-redux");n();var dr=require("@reduxjs/toolkit"),wo=require("react-redux/es/utils/Subscription");E();n();var Xn=x(require("lodash.throttle"));A();E();Ut();ye();Te();var Cs=[Je],Ns=(0,Xn.default)(()=>{Me(Re())},5e3),Jn=e=>t=>r=>{var d;if(Cs.includes(r.type))return t(r);let o=e.getState(),c=ae.local.getItem(ee.loginExpiresAt);if(!((d=o==null?void 0:o.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(c==null)return Me(Re());let p=Date.now();return c-p<0?setTimeout(()=>w(void 0,null,function*(){console.log("session expired");try{e.dispatch(bn())}catch(f){console.error("error logging out",f)}}),1e3):(Ns(),t(r))};n();n();function ct(){return typeof sessionStorage!="undefined"}var ho=ct()?(co(),Ne(ao)).default:(po(),Ne(lo)).default,So=ct()?(mo(),Ne(uo)).default:[],xo=ct()?(yo(),Ne(To)).default:e=>e;lt();var v=(0,dr.configureStore)({reducer:ho,middleware:e=>e({serializableCheck:{ignoredActions:[...So,Xt.type,Zt.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(Jn)}),vo=(0,wo.createSubscription)(v),Wu=xo(v),Gu=(0,dr.configureStore)({reducer:Ae});var zs={store:v,subscription:vo},mr=(0,bo.createContext)(zs),ju=(0,Ee.createStoreHook)(mr),F=(0,Ee.createDispatchHook)(mr),b=(0,Ee.createSelectorHook)(mr);n();n();E();n();var Io=x(require("lodash.isequal")),pt=require("reselect"),g=(0,pt.createSelectorCreator)(pt.defaultMemoize,Io.default);var X=e=>e.account,ke=g(X,e=>e.address),We=g(X,ke,(e,t)=>t in e.accounts?e.accounts[t]:Qe),qs=g(X,We,(e,t)=>{let c=e,{accounts:r}=c,o=Ve(c,["accounts"]);return I(T({},o),{account:t})}),Ks=g(We,e=>e.balance),Ys=g(We,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),Zu=g(X,e=>e.shard),Zs=g(X,e=>e.ledgerAccount),Xu=g(X,e=>e.walletConnectAccount),Ju=g(X,e=>e.isAccountLoading),Qu=g(X,e=>e.accountLoadingError),Ao=g(X,e=>e.websocketEvent);n();var te=e=>e.networkConfig,ut=g(te,e=>e.chainID),Xs=g(te,e=>e.network.walletConnectBridgeAddress),Js=g(te,e=>e.network.walletConnectV2RelayAddress),Qs=g(te,e=>e.network.walletConnectV2ProjectId),Eo=g(te,e=>e.network.walletConnectDeepLink),pe=g(te,e=>e.network),ko=g(pe,e=>e.apiAddress),Lo=g(pe,e=>e.explorerAddress),Do=g(pe,e=>e.egldLabel);n();k();var ue=e=>e.loginInfo,sd=g(ue,e=>e.loginMethod),dt=g(ue,ke,(e,t)=>e.loginMethod!=""&&Boolean(t)),ad=g(ue,e=>e.walletConnectLogin),cd=g(ue,e=>e.ledgerLogin),ea=g(ue,e=>e.walletLogin),ld=g(ue,e=>e.isLoginSessionInvalid);n();n();var U=require("@elrondnetwork/erdjs");A();n();function gr(e){try{return i.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function mt(e){var c,l,p;let{data:t}=e,r=gr(t!=null?t:"")?U.TransactionPayload.fromEncoded(t):new U.TransactionPayload(t),o=new U.Transaction(T({value:e.value.valueOf(),data:r,nonce:e.nonce.valueOf(),receiver:new U.Address(e.receiver),sender:new U.Address(e.sender),gasLimit:(c=e.gasLimit.valueOf())!=null?c:Oe,gasPrice:(l=e.gasPrice.valueOf())!=null?l:Xe,chainID:e.chainID.valueOf(),version:new U.TransactionVersion((p=e.version)!=null?p:Tn)},e.options?{options:new U.TransactionOptions(e.options)}:{}));return o.applySignature({hex:()=>e.signature||""},new U.Address(e.sender)),o}n();Ie();n();var ra=x(require("bignumber.js"));_();n();n();n();n();var oa=require("@elrondnetwork/erdjs"),ia=x(require("bignumber.js"));k();n();var na=require("@elrondnetwork/erdjs");n();n();n();var aa=require("@elrondnetwork/erdjs/out");n();A();n();var No=require("@elrondnetwork/erdjs");_();n();n();n();n();k();n();n();n();n();n();n();n();n();n();n();n();N();n();n();N();n();n();n();var fa=x(require("bignumber.js"));A();n();var ga=require("@elrondnetwork/erdjs"),Tr=x(require("bignumber.js"));A();n();var da=x(require("bignumber.js"));n();Tr.default.config({ROUNDING_MODE:Tr.default.ROUND_FLOOR});n();n();n();A();n();n();n();n();A();n();A();n();var Ta=require("@elrondnetwork/erdjs");A();n();var Tt=require("@elrondnetwork/erdjs"),Sa=require("@elrondnetwork/erdjs"),xa=require("@elrondnetwork/erdjs-network-providers");A();n();n();var ya=x(require("bignumber.js"));A();n();A();n();n();n();n();n();A();n();N();var va=["reDelegateRewards","claimRewards","unBond"],ba=["wrapEgld","unwrapEgld"],Ia=["unStake"],Aa=["unDelegate"];n();n();n();A();n();var Da=x(require("bignumber.js"));n();n();n();N();n();var Pa=x(require("bignumber.js"));n();n();n();n();N();n();n();n();var Ra=x(require("anchorme"));n();A();n();var Ma=x(require("bignumber.js"));n();_();n();n();k();n();k();n();n();n();N();n();N();n();var Oa=x(require("bignumber.js"));A();N();n();N();n();var Bo=require("react");_();n();n();N();n();var Fa=require("@elrondnetwork/erdjs/out"),_a=x(require("bignumber.js"));N();n();N();n();n();k();var Ry=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];n();var Wo=require("react");_();n();var Ba=require("react");N();var Wy=["create","localMint","ESDTLocalMint","addQuantity","burn","localBurn","ESDTLocalBurn","wipe","writeLog","signalError"