UNPKG

@sofaws/dapp-core

Version:

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

1 lines 54.5 kB
"use strict";var Co=Object.create;var fe=Object.defineProperty,Ro=Object.defineProperties,Fo=Object.getOwnPropertyDescriptor,_o=Object.getOwnPropertyDescriptors,Mo=Object.getOwnPropertyNames,ke=Object.getOwnPropertySymbols,Oo=Object.getPrototypeOf,it=Object.prototype.hasOwnProperty,ir=Object.prototype.propertyIsEnumerable;var or=(e,t,r)=>t in e?fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))it.call(t,r)&&or(e,r,t[r]);if(ke)for(var r of ke(t))ir.call(t,r)&&or(e,r,t[r]);return e},v=(e,t)=>Ro(e,_o(t));var ar=(e,t)=>{var r={};for(var o in e)it.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&ke)for(var o of ke(e))t.indexOf(o)<0&&ir.call(e,o)&&(r[o]=e[o]);return r};var T=(e,t)=>()=>(e&&(t=e(e=0)),t);var Le=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ee=(e,t)=>{for(var r in t)fe(e,r,{get:t[r],enumerable:!0})},sr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Mo(t))!it.call(e,i)&&i!==r&&fe(e,i,{get:()=>t[i],enumerable:!(o=Fo(t,i))||o.enumerable});return e};var w=(e,t,r)=>(r=e!=null?Co(Oo(e)):{},sr(t||!e||!e.__esModule?fe(r,"default",{value:e,enumerable:!0}):r,e)),Te=e=>sr(fe({},"__esModule",{value:!0}),e);var _=(e,t,r)=>new Promise((o,i)=>{var p=d=>{try{m(r.next(d))}catch(g){i(g)}},l=d=>{try{m(r.throw(d))}catch(g){i(g)}},m=d=>d.done?o(d.value):Promise.resolve(d.value).then(p,l);m((r=r.apply(e,t)).next())});var pr=Le(De=>{"use strict";n();De.byteLength=Uo;De.toByteArray=Vo;De.fromByteArray=Go;var M=[],R=[],Bo=typeof Uint8Array!="undefined"?Uint8Array:Array,at="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(te=0,cr=at.length;te<cr;++te)M[te]=at[te],R[at.charCodeAt(te)]=te;var te,cr;R["-".charCodeAt(0)]=62;R["_".charCodeAt(0)]=63;function lr(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 Uo(e){var t=lr(e),r=t[0],o=t[1];return(r+o)*3/4-o}function $o(e,t,r){return(t+r)*3/4-r}function Vo(e){var t,r=lr(e),o=r[0],i=r[1],p=new Bo($o(e,o,i)),l=0,m=i>0?o-4:o,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 Ho(e){return M[e>>18&63]+M[e>>12&63]+M[e>>6&63]+M[e&63]}function Wo(e,t,r){for(var o,i=[],p=t;p<r;p+=3)o=(e[p]<<16&16711680)+(e[p+1]<<8&65280)+(e[p+2]&255),i.push(Ho(o));return i.join("")}function Go(e){for(var t,r=e.length,o=r%3,i=[],p=16383,l=0,m=r-o;l<m;l+=p)i.push(Wo(e,l,l+p>m?m:l+p));return o===1?(t=e[r-1],i.push(M[t>>2]+M[t<<4&63]+"==")):o===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 ur=Le(st=>{n();st.read=function(e,t,r,o,i){var p,l,m=i*8-o-1,d=(1<<m)-1,g=d>>1,h=-7,y=r?i-1:0,k=r?-1:1,L=e[t+y];for(y+=k,p=L&(1<<-h)-1,L>>=-h,h+=m;h>0;p=p*256+e[t+y],y+=k,h-=8);for(l=p&(1<<-h)-1,p>>=-h,h+=o;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:(L?-1:1)*(1/0);l=l+Math.pow(2,o),p=p-g}return(L?-1:1)*l*Math.pow(2,p-o)};st.write=function(e,t,r,o,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,L=o?0:p-1,X=o?1:-1,W=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+L]=m&255,L+=X,m/=256,i-=8);for(l=l<<i|m,g+=i;g>0;e[r+L]=l&255,L+=X,l/=256,g-=8);e[r+L-X]|=W*128}});var Ar=Le(ae=>{"use strict";n();var ct=pr(),ie=ur(),dr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ae.Buffer=u;ae.SlowBuffer=Zo;ae.INSPECT_MAX_BYTES=50;var Ne=2147483647;ae.kMaxLength=Ne;u.TYPED_ARRAY_SUPPORT=qo();!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 qo(){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 G(e){if(e>Ne)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 dt(e)}return fr(e,t,r)}u.poolSize=8192;function fr(e,t,r){if(typeof e=="string")return jo(e,t);if(ArrayBuffer.isView(e))return Ko(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 pt(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(o!=null&&o!==e)return u.from(o,t,r);var i=Yo(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 fr(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function Tr(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 zo(e,t,r){return Tr(e),e<=0?G(e):t!==void 0?typeof r=="string"?G(e).fill(t,r):G(e).fill(t):G(e)}u.alloc=function(e,t,r){return zo(e,t,r)};function dt(e){return Tr(e),G(e<0?0:mt(e)|0)}u.allocUnsafe=function(e){return dt(e)};u.allocUnsafeSlow=function(e){return dt(e)};function jo(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=yr(e,t)|0,o=G(r),i=o.write(e,t);return i!==r&&(o=o.slice(0,i)),o}function lt(e){for(var t=e.length<0?0:mt(e.length)|0,r=G(t),o=0;o<t;o+=1)r[o]=e[o]&255;return r}function Ko(e){if(O(e,Uint8Array)){var t=new Uint8Array(e);return pt(t.buffer,t.byteOffset,t.byteLength)}return lt(e)}function pt(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 Yo(e){if(u.isBuffer(e)){var t=mt(e.length)|0,r=G(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||gt(e.length)?G(0):lt(e);if(e.type==="Buffer"&&Array.isArray(e.data))return lt(e.data)}function mt(e){if(e>=Ne)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ne.toString(16)+" bytes");return e|0}function Zo(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 o=t.length,i=r.length,p=0,l=Math.min(o,i);p<l;++p)if(t[p]!==r[p]){o=t[p],i=r[p];break}return o<i?-1:i<o?1:0};u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return u.alloc(0);var o;if(r===void 0)for(r=0,o=0;o<t.length;++o)r+=t[o].length;var i=u.allocUnsafe(r),p=0;for(o=0;o<t.length;++o){var l=t[o];if(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 yr(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,o=arguments.length>2&&arguments[2]===!0;if(!o&&r===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return ut(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return vr(e).length;default:if(i)return o?-1:ut(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=yr;function Xo(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 si(this,t,r);case"utf8":case"utf-8":return xr(this,t,r);case"ascii":return ii(this,t,r);case"latin1":case"binary":return ai(this,t,r);case"base64":return ni(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ci(this,t,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}u.prototype._isBuffer=!0;function re(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)re(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)re(this,r,r+3),re(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)re(this,r,r+7),re(this,r+1,r+6),re(this,r+2,r+5),re(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?xr(this,0,t):Xo.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=ae.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};dr&&(u.prototype[dr]=u.prototype.inspect);u.prototype.compare=function(t,r,o,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),o===void 0&&(o=t?t.length:0),i===void 0&&(i=0),p===void 0&&(p=this.length),r<0||o>t.length||i<0||p>this.length)throw new RangeError("out of range index");if(i>=p&&r>=o)return 0;if(i>=p)return-1;if(r>=o)return 1;if(r>>>=0,o>>>=0,i>>>=0,p>>>=0,this===t)return 0;for(var l=p-i,m=o-r,d=Math.min(l,m),g=this.slice(i,p),h=t.slice(r,o),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 hr(e,t,r,o,i){if(e.length===0)return-1;if(typeof r=="string"?(o=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,gt(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=u.from(t,o)),u.isBuffer(t))return t.length===0?-1:mr(e,t,r,o,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):mr(e,[t],r,o,i);throw new TypeError("val must be string, number or Buffer")}function mr(e,t,r,o,i){var p=1,l=e.length,m=t.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(e.length<2||t.length<2)return-1;p=2,l/=2,m/=2,r/=2}function d(L,X){return p===1?L[X]:L.readUInt16BE(X*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,o){return this.indexOf(t,r,o)!==-1};u.prototype.indexOf=function(t,r,o){return hr(this,t,r,o,!0)};u.prototype.lastIndexOf=function(t,r,o){return hr(this,t,r,o,!1)};function Jo(e,t,r,o){r=Number(r)||0;var i=e.length-r;o?(o=Number(o),o>i&&(o=i)):o=i;var p=t.length;o>p/2&&(o=p/2);for(var l=0;l<o;++l){var m=parseInt(t.substr(l*2,2),16);if(gt(m))return l;e[r+l]=m}return l}function Qo(e,t,r,o){return Pe(ut(t,e.length-r),e,r,o)}function ei(e,t,r,o){return Pe(ui(t),e,r,o)}function ti(e,t,r,o){return Pe(vr(t),e,r,o)}function ri(e,t,r,o){return Pe(di(t,e.length-r),e,r,o)}u.prototype.write=function(t,r,o,i){if(r===void 0)i="utf8",o=this.length,r=0;else if(o===void 0&&typeof r=="string")i=r,o=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(o)?(o=o>>>0,i===void 0&&(i="utf8")):(i=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var p=this.length-r;if((o===void 0||o>p)&&(o=p),t.length>0&&(o<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var l=!1;;)switch(i){case"hex":return Jo(this,t,r,o);case"utf8":case"utf-8":return Qo(this,t,r,o);case"ascii":case"latin1":case"binary":return ei(this,t,r,o);case"base64":return ti(this,t,r,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ri(this,t,r,o);default:if(l)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),l=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ni(e,t,r){return t===0&&r===e.length?ct.fromByteArray(e):ct.fromByteArray(e.slice(t,r))}function xr(e,t,r){r=Math.min(e.length,r);for(var o=[],i=t;i<r;){var p=e[i],l=null,m=p>239?4:p>223?3:p>191?2:1;if(i+m<=r){var d,g,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,o.push(l>>>10&1023|55296),l=56320|l&1023),o.push(l),i+=m}return oi(o)}var gr=4096;function oi(e){var t=e.length;if(t<=gr)return String.fromCharCode.apply(String,e);for(var r="",o=0;o<t;)r+=String.fromCharCode.apply(String,e.slice(o,o+=gr));return r}function ii(e,t,r){var o="";r=Math.min(e.length,r);for(var i=t;i<r;++i)o+=String.fromCharCode(e[i]&127);return o}function ai(e,t,r){var o="";r=Math.min(e.length,r);for(var i=t;i<r;++i)o+=String.fromCharCode(e[i]);return o}function si(e,t,r){var o=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>o)&&(r=o);for(var i="",p=t;p<r;++p)i+=mi[e[p]];return i}function ci(e,t,r){for(var o=e.slice(t,r),i="",p=0;p<o.length-1;p+=2)i+=String.fromCharCode(o[p]+o[p+1]*256);return i}u.prototype.slice=function(t,r){var o=this.length;t=~~t,r=r===void 0?o:~~r,t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),r<0?(r+=o,r<0&&(r=0)):r>o&&(r=o),r<t&&(r=t);var i=this.subarray(t,r);return Object.setPrototypeOf(i,u.prototype),i};function A(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||A(t,r,this.length);for(var i=this[t],p=1,l=0;++l<r&&(p*=256);)i+=this[t+l]*p;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||A(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||A(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||A(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||A(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||A(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||A(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||A(t,r,this.length);for(var i=this[t],p=1,l=0;++l<r&&(p*=256);)i+=this[t+l]*p;return p*=128,i>=p&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||A(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||A(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||A(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||A(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||A(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||A(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||A(t,4,this.length),ie.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||A(t,4,this.length),ie.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||A(t,8,this.length),ie.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||A(t,8,this.length),ie.read(this,t,!1,52,8)};function N(e,t,r,o,i,p){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<p)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,r,o,i){if(t=+t,r=r>>>0,o=o>>>0,!i){var p=Math.pow(2,8*o)-1;N(this,t,r,o,p,0)}var l=1,m=0;for(this[r]=t&255;++m<o&&(l*=256);)this[r+m]=t/l&255;return r+o};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,r,o,i){if(t=+t,r=r>>>0,o=o>>>0,!i){var p=Math.pow(2,8*o)-1;N(this,t,r,o,p,0)}var l=o-1,m=1;for(this[r+l]=t&255;--l>=0&&(m*=256);)this[r+l]=t/m&255;return r+o};u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,o){return t=+t,r=r>>>0,o||N(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||N(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||N(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||N(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||N(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};u.prototype.writeIntLE=function(t,r,o,i){if(t=+t,r=r>>>0,!i){var p=Math.pow(2,8*o-1);N(this,t,r,o,p-1,-p)}var l=0,m=1,d=0;for(this[r]=t&255;++l<o&&(m*=256);)t<0&&d===0&&this[r+l-1]!==0&&(d=1),this[r+l]=(t/m>>0)-d&255;return r+o};u.prototype.writeIntBE=function(t,r,o,i){if(t=+t,r=r>>>0,!i){var p=Math.pow(2,8*o-1);N(this,t,r,o,p-1,-p)}var l=o-1,m=1,d=0;for(this[r+l]=t&255;--l>=0&&(m*=256);)t<0&&d===0&&this[r+l+1]!==0&&(d=1),this[r+l]=(t/m>>0)-d&255;return r+o};u.prototype.writeInt8=function(t,r,o){return t=+t,r=r>>>0,o||N(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||N(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||N(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||N(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||N(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 Sr(e,t,r,o,i,p){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function wr(e,t,r,o,i){return t=+t,r=r>>>0,i||Sr(e,t,r,4,34028234663852886e22,-34028234663852886e22),ie.write(e,t,r,o,23,4),r+4}u.prototype.writeFloatLE=function(t,r,o){return wr(this,t,r,!0,o)};u.prototype.writeFloatBE=function(t,r,o){return wr(this,t,r,!1,o)};function br(e,t,r,o,i){return t=+t,r=r>>>0,i||Sr(e,t,r,8,17976931348623157e292,-17976931348623157e292),ie.write(e,t,r,o,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,o){return br(this,t,r,!0,o)};u.prototype.writeDoubleBE=function(t,r,o){return br(this,t,r,!1,o)};u.prototype.copy=function(t,r,o,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(o||(o=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<o&&(i=o),i===o||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-o&&(i=t.length-r+o);var p=i-o;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,o,i):Uint8Array.prototype.set.call(t,this.subarray(o,i),r),p};u.prototype.fill=function(t,r,o,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,o=this.length):typeof o=="string"&&(i=o,o=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var p=t.charCodeAt(0);(i==="utf8"&&p<128||i==="latin1")&&(t=p)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<o)throw new RangeError("Out of range index");if(o<=r)return this;r=r>>>0,o=o===void 0?this.length:o>>>0,t||(t=0);var l;if(typeof t=="number")for(l=r;l<o;++l)this[l]=t;else{var m=u.isBuffer(t)?t:u.from(t,i),d=m.length;if(d===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(l=0;l<o-r;++l)this[l+r]=m[l%d]}return this};var li=/[^+/0-9A-Za-z-_]/g;function pi(e){if(e=e.split("=")[0],e=e.trim().replace(li,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function ut(e,t){t=t||1/0;for(var r,o=e.length,i=null,p=[],l=0;l<o;++l){if(r=e.charCodeAt(l),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&p.push(239,191,189);continue}else if(l+1===o){(t-=3)>-1&&p.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&p.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&p.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;p.push(r)}else if(r<2048){if((t-=2)<0)break;p.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;p.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;p.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return p}function ui(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function di(e,t){for(var r,o,i,p=[],l=0;l<e.length&&!((t-=2)<0);++l)r=e.charCodeAt(l),o=r>>8,i=r%256,p.push(i),p.push(o);return p}function vr(e){return ct.toByteArray(pi(e))}function Pe(e,t,r,o){for(var i=0;i<o&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function O(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function gt(e){return e!==e}var mi=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=r*16,i=0;i<16;++i)t[o+i]=e[r]+e[i];return t}()});var Dr=Le((Za,Lr)=>{n();var S=Lr.exports={},B,U;function ft(){throw new Error("setTimeout has not been defined")}function Tt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?B=setTimeout:B=ft}catch(e){B=ft}try{typeof clearTimeout=="function"?U=clearTimeout:U=Tt}catch(e){U=Tt}})();function Ir(e){if(B===setTimeout)return setTimeout(e,0);if((B===ft||!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 gi(e){if(U===clearTimeout)return clearTimeout(e);if((U===Tt||!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 q=[],se=!1,ne,Ce=-1;function fi(){!se||!ne||(se=!1,ne.length?q=ne.concat(q):Ce=-1,q.length&&Er())}function Er(){if(!se){var e=Ir(fi);se=!0;for(var t=q.length;t;){for(ne=q,q=[];++Ce<t;)ne&&ne[Ce].run();Ce=-1,t=q.length}ne=null,se=!1,gi(e)}}S.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];q.push(new kr(e,t)),q.length===1&&!se&&Ir(Er)};function kr(e,t){this.fun=e,this.array=t}kr.prototype.run=function(){this.fun.apply(null,this.array)};S.title="browser";S.browser=!0;S.env={};S.argv=[];S.version="";S.versions={};function z(){}S.on=z;S.addListener=z;S.once=z;S.off=z;S.removeListener=z;S.removeAllListeners=z;S.emit=z;S.prependListener=z;S.prependOnceListener=z;S.listeners=function(e){return[]};S.binding=function(e){throw new Error("process.binding is not supported")};S.cwd=function(){return"/"};S.chdir=function(e){throw new Error("process.chdir is not supported")};S.umask=function(){return 0}});var a,s,Xa,n=T(()=>{a=w(Ar()),s=w(Dr()),Xa=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 Fe,yt=T(()=>{"use strict";n();Fe=()=>Date.now()/1e3});var Pr=T(()=>{"use strict";n()});var Cr=T(()=>{"use strict";n()});var Rr=T(()=>{"use strict";n();yt();Pr();Cr()});var xt={};ee(xt,{getItem:()=>yi,localStorageKeys:()=>$,removeItem:()=>hi,setItem:()=>Ti});var $,ht,Ti,yi,hi,ce=T(()=>{"use strict";n();Rr();$={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},ht=typeof localStorage!="undefined",Ti=({key:e,data:t,expires:r})=>{!ht||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},yi=e=>{if(!ht)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:Fe()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},hi=e=>{!ht||localStorage.removeItem(String(e))}});var St={};ee(St,{clear:()=>Or,getItem:()=>_r,removeItem:()=>Mr,setItem:()=>Fr,storage:()=>xi});var Fr,_r,Mr,Or,xi,Br=T(()=>{"use strict";n();Fr=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},_r=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},Mr=e=>sessionStorage.removeItem(String(e)),Or=()=>sessionStorage.clear(),xi={setItem:Fr,getItem:_r,removeItem:Mr,clear:Or}});var j,ye=T(()=>{"use strict";n();ce();Br();j={session:St,local:xt}});function he(){return new Date().setHours(new Date().getHours()+24)}function xe(e){j.local.setItem({key:$.loginExpiresAt,data:e,expires:e})}var wt=T(()=>{"use strict";n();ye();ce()});var P=T(()=>{"use strict";n()});var Ur=T(()=>{"use strict";n()});var $r=T(()=>{"use strict";n()});var D=T(()=>{"use strict";n()});var Vr=T(()=>{"use strict";n()});var Hr=T(()=>{"use strict";n()});var Wr=T(()=>{"use strict";n()});var Gr=T(()=>{"use strict";n()});var V=T(()=>{"use strict";n();$r();D();P();Vr();Hr();Wr();Gr()});var bt,qr,Es,zr,ks,jr,Ls,Ds,Ns,Kr=T(()=>{"use strict";n();V();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:qr,egldLabel:Es}=bt["devnet"],{chainId:zr,egldLabel:ks}=bt["testnet"],{chainId:jr,egldLabel:Ls}=bt["mainnet"],Ds={["devnet"]:qr,["testnet"]:zr,["mainnet"]:jr},Ns={[qr]:"devnet",[zr]:"testnet",[jr]:"mainnet"}});var vt=T(()=>{"use strict";n()});var Yr=T(()=>{"use strict";n()});var Zr,At=T(()=>{"use strict";n();Zr="transaction-status-toast-id"});var It,Et,Xr,_e,Jr,le,b=T(()=>{"use strict";n();Ur();Kr();vt();Yr();At();It=5e4,Et=1e9,Xr=1,_e="logout",Jr="login",le="0"});var kt,E,Se,H=T(()=>{"use strict";n();kt=require("@reduxjs/toolkit");b();E=(0,kt.createAction)(_e),Se=(0,kt.createAction)(Jr,e=>({payload:e}))});var en,Qr,tn,Ks,Ys,Zs,Xs,Js,Qs,rn,nn,Lt=T(()=>{"use strict";n();en=require("@reduxjs/toolkit");wt();P();H();Qr={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},tn=(0,en.createSlice)({name:"loginInfoSlice",initialState:Qr,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(E,()=>Qr),e.addCase(Se,(t,r)=>{t.loginMethod=r.payload.loginMethod,xe(he())})}}),{setLoginMethod:Ks,setWalletConnectLogin:Ys,setLedgerLogin:Zs,setTokenLogin:Xs,setTokenLoginSignature:Js,setWalletLogin:Qs,invalidateLoginSession:rn}=tn.actions,nn=tn.reducer});var on,an,Dt,Nt=T(()=>{"use strict";n();on=!1,an=(e=!0)=>{on=e},Dt=(e,t=0)=>{on||setTimeout(()=>{window.location.href=e},t)}});var sn=T(()=>{"use strict";n();Nt()});function Pt(e){return e[Math.floor(Math.random()*e.length)]}var cn=T(()=>{"use strict";n()});var ln=T(()=>{"use strict";n();vt()});var pn=T(()=>{"use strict";n();sn();cn();ln()});var un,dn,Ct,Si,mn,gc,fc,gn,Rt=T(()=>{"use strict";n();un=require("@reduxjs/toolkit"),dn=w(require("lodash.omit"));pn();Ct={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Si={network:Ct,chainID:"-1"},mn=(0,un.createSlice)({name:"appConfig",initialState:Si,reducers:{initializeNetworkConfig:(e,t)=>{let r=Pt(t.payload.walletConnectBridgeAddresses),o=Pt(t.payload.walletConnectV2RelayAddresses),i=(0,dn.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=v(x(x({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:o})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:gc,setChainID:fc}=mn.actions,gn=mn.reducer});var _t,fn,Tn,Me,Ft,yn,Mt,vc,Ot,Ac,Ic,Ec,kc,Lc,Dc,Nc,hn,Bt=T(()=>{"use strict";n();_t=require("@elrondnetwork/erdjs"),fn=require("@reduxjs/toolkit"),Tn=require("redux-persist");b();ye();ce();H();Me={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:le},Ft={address:"",websocketEvent:null,accounts:{"":Me},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},yn=(0,fn.createSlice)({name:"accountInfoSlice",initialState:Ft,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new _t.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Me},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(E,()=>(j.local.removeItem($.loginExpiresAt),Ft)),e.addCase(Se,(t,r)=>{let{address:o}=r.payload;t.address=o,t.publicKey=new _t.Address(o).hex()}),e.addCase(Tn.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:o}=r.payload,{address:i,shard:p,accounts:l,publicKey:m}=o;t.address=i,t.shard=p;let d=l&&i in l;t.accounts=d?l:Ft.accounts,t.publicKey=m})}}),{setAccount:Mt,setAddress:vc,setAccountNonce:Ot,setAccountShard:Ac,setLedgerAccount:Ic,updateLedgerAccount:Ec,setWalletConnectAccount:kc,setIsAccountLoading:Lc,setAccountLoadingError:Dc,setWebsocketEvent:Nc}=yn.actions,hn=yn.reducer});function xn(e){return e!=null&&(Di(e)||Ri(e))}function Oe(e){return e!=null&&(Ni(e)||Fi(e))}function Be(e){return e!=null&&(Pi(e)||_i(e))}function Sn(e){return e!=null&&Ci(e)}function Di(e){return e!=null&&bi.includes(e)}function Ni(e){return e!=null&&vi.includes(e)}function Pi(e){return e!=null&&Ai.includes(e)}function Ci(e){return e!=null&&Ii.includes(e)}function Ri(e){return e!=null&&Ei.includes(e)}function Fi(e){return e!=null&&ki.includes(e)}function _i(e){return e!=null&&Li.includes(e)}var bi,vi,Ai,Ii,Ei,ki,Li,$t=T(()=>{"use strict";n();P();bi=["sent"],vi=["success"],Ai=["fail","cancelled","timedOut"],Ii=["timedOut"],Ei=["pending"],ki=["success"],Li=["fail","invalid"]});var wn,bn,be,Mi,vn,Uc,$c,Vc,Hc,Wc,Gc,qc,zc,jc,Kc,Ue,$e=T(()=>{"use strict";n();wn=require("@reduxjs/toolkit"),bn=require("redux-persist");P();$t();H();be={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Mi={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},vn=(0,wn.createSlice)({name:"transactionsSlice",initialState:be,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,g;let{sessionId:r,transactions:o,errorMessage:i,status:p,redirectRoute:l}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||Mi;e.signedTransactions[r]={transactions:o,status:p,errorMessage:i,redirectRoute:l,customTransactionInformation:m},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===r&&(e.transactionsToSign=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=x(x({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:o,errorMessage:i,transactions:p}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=o,i!=null&&(e.signedTransactions[r].errorMessage=i),p!=null&&(e.signedTransactions[r].transactions=p))},updateSignedTransactionStatus:(e,t)=>{var m,d,g,h,y,k;let{sessionId:r,status:o,errorMessage:i,transactionHash:p}=t.payload,l=(d=(m=e.signedTransactions)==null?void 0:m[r])==null?void 0:d.transactions;if(l!=null){e.signedTransactions[r].transactions=l.map(W=>W.hash===p?v(x({},W),{status:o,errorMessage:i}):W);let L=(h=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:h.every(W=>Oe(W.status)),X=(k=(y=e.signedTransactions[r])==null?void 0:y.transactions)==null?void 0:k.every(W=>Be(W.status));L&&(e.signedTransactions[r].status="success"),X&&(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(E,()=>be),e.addCase(bn.REHYDRATE,(t,r)=>{var l;if(t.signTransactionsCancelMessage=null,!((l=r.payload)!=null&&l.transactions))return;let{signedTransactions:o,customTransactionInformationForSessionId:i}=r.payload.transactions,p=Object.entries(o).reduce((m,[d,g])=>{let 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),o!=null&&(t.signedTransactions=p)})}}),{updateSignedTransactionStatus:Uc,updateSignedTransactions:$c,setTransactionsToSign:Vc,clearAllTransactionsToSign:Hc,clearAllSignedTransactions:Wc,clearSignedTransaction:Gc,clearTransactionToSign:qc,setSignTransactionsError:zc,setSignTransactionsCancelMessage:jc,moveTransactionsToSignedState:Kc}=vn.actions,Ue=vn.reducer});var An,Ht,Wt,Gt,Oi,Vt,In,Jc,Qc,el,Ve,He=T(()=>{"use strict";n();An=require("@reduxjs/toolkit");H();Ht="Transaction failed",Wt="Transaction successful",Gt="Processing transaction",Oi="Transaction submitted",Vt={},In=(0,An.createSlice)({name:"transactionsInfo",initialState:Vt,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:o}=t.payload;r!=null&&(e[r]={errorMessage:(o==null?void 0:o.errorMessage)||Ht,successMessage:(o==null?void 0:o.successMessage)||Wt,processingMessage:(o==null?void 0:o.processingMessage)||Gt,submittedMessage:(o==null?void 0:o.submittedMessage)||Oi,transactionDuration:o==null?void 0:o.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>Vt},extraReducers:e=>{e.addCase(E,()=>Vt)}}),{clearTransactionsInfo:Jc,setTransactionsDisplayInfo:Qc,clearTransactionsInfoForSessionId:el}=In.actions,Ve=In.reducer});var kn,En,Ln,ol,il,al,sl,Dn,qt=T(()=>{"use strict";n();kn=require("@reduxjs/toolkit");H();En={},Ln=(0,kn.createSlice)({name:"modalsSlice",initialState:En,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(E,()=>En)}}),{setTxSubmittedModal:ol,setNotificationModal:il,clearTxSubmittedModal:al,clearNotificationModal:sl}=Ln.actions,Dn=Ln.reducer});var Pn,Cn,Nn,Rn,fl,Tl,yl,hl,xl,Sl,We,Ge=T(()=>{"use strict";n();Pn=require("@reduxjs/toolkit"),Cn=require("redux-persist");At();V();yt();H();Nn={customToasts:[],transactionToasts:[],failTransactionToast:null},Rn=(0,Pn.createSlice)({name:"toastsSlice",initialState:Nn,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(v(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:Fe(),toastId:t.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,t)=>{e.transactionToasts=e.transactionToasts.filter(r=>r.toastId!==t.payload)},addFailTransactionToast:(e,t)=>{e.failTransactionToast=v(x({},t.payload),{toastId:Zr})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(E,()=>Nn),e.addCase(Cn.REHYDRATE,(t,r)=>{var i,p;let o=(p=(i=r.customToasts)==null?void 0:i.filter(l=>!("component"in l)))!=null?p:[];t.customToasts=o})}}),{addCustomToast:fl,removeCustomToast:Tl,addTransactionToast:yl,removeTransactionToast:hl,addFailTransactionToast:xl,removeFailTransactionToast:Sl}=Rn.actions,We=Rn.reducer});var J=T(()=>{"use strict";n();Lt();Rt();Bt();$e();He();qt();Ge()});var zt=T(()=>{"use strict";n()});var On,Mn,Bn,$l,Vl,Hl,Wl,Gl,ql,Un,$n=T(()=>{"use strict";n();On=require("@reduxjs/toolkit");H();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(E,()=>Mn)}}),{setDappModalVisibility:$l,setDappModalHeaderVisibility:Vl,setDappModalFooterVisibility:Hl,setDappModalHeaderText:Wl,setDappModalFooterText:Gl,setDappModalConfig:ql}=Bn.actions,Un=Bn.reducer});var Vn,Vi,Hi,pe,ze=T(()=>{"use strict";n();Vn=require("@reduxjs/toolkit");zt();Bt();$n();Lt();qt();Rt();Ge();He();$e();Vi={["account"]:hn,["networkConfig"]:gn,["loginInfo"]:nn,["modals"]:Dn,["dappModal"]:Un,["toasts"]:We,["transactions"]:Ue,["transactionsInfo"]:Ve},Hi=(e={})=>(0,Vn.combineReducers)(x(x({},Vi),e)),pe=Hi});var Gn={};ee(Gn,{default:()=>Yi});function jt(e,t=[]){return{key:e,version:1,storage:Wn.default,blacklist:t}}var oe,Hn,Wn,Wi,Gi,qi,zi,ji,Ki,Yi,qn=T(()=>{"use strict";n();oe=require("redux-persist"),Hn=w(require("redux-persist/lib/storage")),Wn=w(require("redux-persist/lib/storage/session"));ze();J();Ge();He();$e();zt();Wi={2:e=>v(x({},e),{networkConfig:Ct})};Gi=jt("dapp-core-transactionsInfo"),qi=jt("dapp-core-transactions",["transactionsToSign"]),zi=jt("dapp-core-toasts"),ji={key:"dapp-core-store",version:2,storage:Hn.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,oe.createMigrate)(Wi,{debug:!1})},Ki={["toasts"]:(0,oe.persistReducer)(zi,We),["transactions"]:(0,oe.persistReducer)(qi,Ue),["transactionsInfo"]:(0,oe.persistReducer)(Gi,Ve)},Yi=(0,oe.persistReducer)(ji,pe(Ki))});var zn={};ee(zn,{default:()=>Zi});var Zi,jn=T(()=>{"use strict";n();ze();Zi=pe()});var Kn={};ee(Kn,{default:()=>Ji});var F,Xi,Ji,Yn=T(()=>{"use strict";n();F=require("redux-persist"),Xi=[F.FLUSH,F.REHYDRATE,F.PAUSE,F.PERSIST,F.PURGE,F.REGISTER],Ji=Xi});var Jn={};ee(Jn,{default:()=>Xn});function Xn(e){return(0,Zn.persistStore)(e)}var Zn,Qn=T(()=>{"use strict";n();Zn=require("redux-persist")});var qa={};ee(qa,{useIdleTimer:()=>Ga});module.exports=Te(qa);n();var Po=require("react-idle-timer");n();var Re=require("react"),Nr=e=>{let t=(0,Re.useRef)(e);return(0,Re.useEffect)(()=>{t.current=e},[e]),t};n();n();var io=require("react"),ue=require("react-redux");n();var Kt=require("@reduxjs/toolkit"),no=require("react-redux/es/utils/Subscription");J();n();var Fn=w(require("lodash.throttle"));b();J();wt();ye();ce();var Bi=[_e],Ui=(0,Fn.default)(()=>{xe(he())},5e3),_n=e=>t=>r=>{var d;if(Bi.includes(r.type))return t(r);let o=e.getState(),i=j.local.getItem($.loginExpiresAt);if(!((d=o==null?void 0:o.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(i==null)return xe(he());let l=Date.now();return i-l<0?setTimeout(()=>_(void 0,null,function*(){console.log("session expired");try{e.dispatch(rn())}catch(g){console.error("error logging out",g)}}),1e3):(Ui(),t(r))};n();n();function qe(){return typeof sessionStorage!="undefined"}var eo=qe()?(qn(),Te(Gn)).default:(jn(),Te(zn)).default,to=qe()?(Yn(),Te(Kn)).default:[],ro=qe()?(Qn(),Te(Jn)).default:e=>e;ze();var I=(0,Kt.configureStore)({reducer:eo,middleware:e=>e({serializableCheck:{ignoredActions:[...to,Ot.type,Mt.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(_n)}),oo=(0,no.createSubscription)(I),Tp=ro(I),yp=(0,Kt.configureStore)({reducer:pe});var Qi={store:I,subscription:oo},Yt=(0,io.createContext)(Qi),wp=(0,ue.createStoreHook)(Yt),bp=(0,ue.createDispatchHook)(Yt),ao=(0,ue.createSelectorHook)(Yt);n();n();J();n();var so=w(require("lodash.isequal")),je=require("reselect"),f=(0,je.createSelectorCreator)(je.defaultMemoize,so.default);var K=e=>e.account,ve=f(K,e=>e.address),Ke=f(K,ve,(e,t)=>t in e.accounts?e.accounts[t]:Me),kp=f(K,Ke,(e,t)=>{let i=e,{accounts:r}=i,o=ar(i,["accounts"]);return v(x({},o),{account:t})}),Lp=f(Ke,e=>e.balance),ea=f(Ke,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),Dp=f(K,e=>e.shard),Np=f(K,e=>e.ledgerAccount),Pp=f(K,e=>e.walletConnectAccount),Cp=f(K,e=>e.isAccountLoading),Rp=f(K,e=>e.accountLoadingError),Fp=f(K,e=>e.websocketEvent);n();var de=e=>e.networkConfig,Op=f(de,e=>e.chainID),Bp=f(de,e=>e.network.walletConnectBridgeAddress),Up=f(de,e=>e.network.walletConnectV2RelayAddress),$p=f(de,e=>e.network.walletConnectV2ProjectId),Vp=f(de,e=>e.network.walletConnectDeepLink),Zt=f(de,e=>e.network),ta=f(Zt,e=>e.apiAddress),co=f(Zt,e=>e.explorerAddress),Hp=f(Zt,e=>e.egldLabel);n();P();var me=e=>e.loginInfo,jp=f(me,e=>e.loginMethod),ge=f(me,ve,(e,t)=>e.loginMethod!=""&&Boolean(t)),Kp=f(me,e=>e.walletConnectLogin),Yp=f(me,e=>e.ledgerLogin),lo=f(me,e=>e.walletLogin),Zp=f(me,e=>e.isLoginSessionInvalid);n();n();var C=require("@elrondnetwork/erdjs");b();n();function Xt(e){try{return a.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function Jt(e){var i,p,l;let{data:t}=e,r=Xt(t!=null?t:"")?C.TransactionPayload.fromEncoded(t):new C.TransactionPayload(t),o=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:It,gasPrice:(p=e.gasPrice.valueOf())!=null?p:Et,chainID:e.chainID.valueOf(),version:new C.TransactionVersion((l=e.version)!=null?l:Xr)},e.options?{options:new C.TransactionOptions(e.options)}:{}));return o.applySignature({hex:()=>e.signature||""},new C.Address(e.sender)),o}n();$t();n();var na=w(require("bignumber.js"));V();n();n();n();n();var ia=require("@elrondnetwork/erdjs"),aa=w(require("bignumber.js"));P();n();var mo=require("@elrondnetwork/erdjs");function oa(e){try{let t=new mo.Address(e);return Boolean(t.bech32())}catch(t){return!1}}function Ae(e){return(e==null?void 0:e.startsWith("erd"))&&e.length===62&&/^\w+$/.test(e)&&oa(e)}n();n();n();var ca=require("@elrondnetwork/erdjs/out");n();b();n();var go=require("@elrondnetwork/erdjs");V();n();n();n();n();P();n();n();n();n();n();n();n();n();n();n();n();D();n();n();D();n();n();n();var fa=w(require("bignumber.js"));b();n();var ga=require("@elrondnetwork/erdjs"),Qt=w(require("bignumber.js"));b();n();var da=w(require("bignumber.js"));n();Qt.default.config({ROUNDING_MODE:Qt.default.ROUND_FLOOR});n();n();n();b();n();n();n();n();b();n();b();n();var Ta=require("@elrondnetwork/erdjs");b();n();var Xe=require("@elrondnetwork/erdjs"),ha=require("@elrondnetwork/erdjs"),xa=require("@elrondnetwork/erdjs-network-providers");b();n();n();var ya=w(require("bignumber.js"));b();n();b();n();n();n();n();n();b();n();D();var wa=["reDelegateRewards","claimRewards","unBond"],ba=["wrapEgld","unwrapEgld"],va=["unStake"],Aa=["unDelegate"];n();n();n();b();n();var ka=w(require("bignumber.js"));n();n();n();D();n();var La=w(require("bignumber.js"));n();n();n();n();D();n();n();n();var Na=w(require("anchorme"));n();b();n();var Pa=w(require("bignumber.js"));n();V();n();n();P();n();P();n();n();n();D();n();D();n();var Ca=w(require("bignumber.js"));b();D();n();D();n();var xo=require("react");V();n();n();D();n();var Ra=require("@elrondn