UNPKG

@sofaws/dapp-core

Version:

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

1 lines 67 kB
"use strict";var Vi=Object.create;var rt=Object.defineProperty,$i=Object.defineProperties,Wi=Object.getOwnPropertyDescriptor,Hi=Object.getOwnPropertyDescriptors,Gi=Object.getOwnPropertyNames,dt=Object.getOwnPropertySymbols,zi=Object.getPrototypeOf,Xt=Object.prototype.hasOwnProperty,rn=Object.prototype.propertyIsEnumerable;var tn=(e,t,r)=>t in e?rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t)=>{for(var r in t||(t={}))Xt.call(t,r)&&tn(e,r,t[r]);if(dt)for(var r of dt(t))rn.call(t,r)&&tn(e,r,t[r]);return e},k=(e,t)=>$i(e,Hi(t));var mt=(e,t)=>{var r={};for(var o in e)Xt.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&dt)for(var o of dt(e))t.indexOf(o)<0&&rn.call(e,o)&&(r[o]=e[o]);return r};var x=(e,t)=>()=>(e&&(t=e(e=0)),t);var gt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ne=(e,t)=>{for(var r in t)rt(e,r,{get:t[r],enumerable:!0})},nn=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gi(t))!Xt.call(e,i)&&i!==r&&rt(e,i,{get:()=>t[i],enumerable:!(o=Wi(t,i))||o.enumerable});return e};var N=(e,t,r)=>(r=e!=null?Vi(zi(e)):{},nn(t||!e||!e.__esModule?rt(r,"default",{value:e,enumerable:!0}):r,e)),nt=e=>nn(rt({},"__esModule",{value:!0}),e);var I=(e,t,r)=>new Promise((o,i)=>{var p=d=>{try{m(r.next(d))}catch(T){i(T)}},l=d=>{try{m(r.throw(d))}catch(T){i(T)}},m=d=>d.done?o(d.value):Promise.resolve(d.value).then(p,l);m((r=r.apply(e,t)).next())});var sn=gt(ft=>{"use strict";n();ft.byteLength=ji;ft.toByteArray=Yi;ft.fromByteArray=Ji;var ie=[],ee=[],qi=typeof Uint8Array!="undefined"?Uint8Array:Array,Jt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Re=0,on=Jt.length;Re<on;++Re)ie[Re]=Jt[Re],ee[Jt.charCodeAt(Re)]=Re;var Re,on;ee["-".charCodeAt(0)]=62;ee["_".charCodeAt(0)]=63;function an(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 ji(e){var t=an(e),r=t[0],o=t[1];return(r+o)*3/4-o}function Ki(e,t,r){return(t+r)*3/4-r}function Yi(e){var t,r=an(e),o=r[0],i=r[1],p=new qi(Ki(e,o,i)),l=0,m=i>0?o-4:o,d;for(d=0;d<m;d+=4)t=ee[e.charCodeAt(d)]<<18|ee[e.charCodeAt(d+1)]<<12|ee[e.charCodeAt(d+2)]<<6|ee[e.charCodeAt(d+3)],p[l++]=t>>16&255,p[l++]=t>>8&255,p[l++]=t&255;return i===2&&(t=ee[e.charCodeAt(d)]<<2|ee[e.charCodeAt(d+1)]>>4,p[l++]=t&255),i===1&&(t=ee[e.charCodeAt(d)]<<10|ee[e.charCodeAt(d+1)]<<4|ee[e.charCodeAt(d+2)]>>2,p[l++]=t>>8&255,p[l++]=t&255),p}function Zi(e){return ie[e>>18&63]+ie[e>>12&63]+ie[e>>6&63]+ie[e&63]}function Xi(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(Zi(o));return i.join("")}function Ji(e){for(var t,r=e.length,o=r%3,i=[],p=16383,l=0,m=r-o;l<m;l+=p)i.push(Xi(e,l,l+p>m?m:l+p));return o===1?(t=e[r-1],i.push(ie[t>>2]+ie[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],i.push(ie[t>>10]+ie[t>>4&63]+ie[t<<2&63]+"=")),i.join("")}});var cn=gt(Qt=>{n();Qt.read=function(e,t,r,o,i){var p,l,m=i*8-o-1,d=(1<<m)-1,T=d>>1,g=-7,f=r?i-1:0,b=r?-1:1,S=e[t+f];for(f+=b,p=S&(1<<-g)-1,S>>=-g,g+=m;g>0;p=p*256+e[t+f],f+=b,g-=8);for(l=p&(1<<-g)-1,p>>=-g,g+=o;g>0;l=l*256+e[t+f],f+=b,g-=8);if(p===0)p=1-T;else{if(p===d)return l?NaN:(S?-1:1)*(1/0);l=l+Math.pow(2,o),p=p-T}return(S?-1:1)*l*Math.pow(2,p-o)};Qt.write=function(e,t,r,o,i,p){var l,m,d,T=p*8-i-1,g=(1<<T)-1,f=g>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=o?0:p-1,D=o?1:-1,C=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,l=g):(l=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-l))<1&&(l--,d*=2),l+f>=1?t+=b/d:t+=b*Math.pow(2,1-f),t*d>=2&&(l++,d/=2),l+f>=g?(m=0,l=g):l+f>=1?(m=(t*d-1)*Math.pow(2,i),l=l+f):(m=t*Math.pow(2,f-1)*Math.pow(2,i),l=0));i>=8;e[r+S]=m&255,S+=D,m/=256,i-=8);for(l=l<<i|m,T+=i;T>0;e[r+S]=l&255,S+=D,l/=256,T-=8);e[r+S-D]|=C*128}});var wn=gt(Be=>{"use strict";n();var er=sn(),Ue=cn(),ln=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Be.Buffer=u;Be.SlowBuffer=oa;Be.INSPECT_MAX_BYTES=50;var Tt=2147483647;Be.kMaxLength=Tt;u.TYPED_ARRAY_SUPPORT=Qi();!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 Qi(){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 ge(e){if(e>Tt)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 or(e)}return dn(e,t,r)}u.poolSize=8192;function dn(e,t,r){if(typeof e=="string")return ta(e,t);if(ArrayBuffer.isView(e))return ra(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(ae(e,ArrayBuffer)||e&&ae(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(ae(e,SharedArrayBuffer)||e&&ae(e.buffer,SharedArrayBuffer)))return rr(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=na(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 dn(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function mn(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 ea(e,t,r){return mn(e),e<=0?ge(e):t!==void 0?typeof r=="string"?ge(e).fill(t,r):ge(e).fill(t):ge(e)}u.alloc=function(e,t,r){return ea(e,t,r)};function or(e){return mn(e),ge(e<0?0:ir(e)|0)}u.allocUnsafe=function(e){return or(e)};u.allocUnsafeSlow=function(e){return or(e)};function ta(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=gn(e,t)|0,o=ge(r),i=o.write(e,t);return i!==r&&(o=o.slice(0,i)),o}function tr(e){for(var t=e.length<0?0:ir(e.length)|0,r=ge(t),o=0;o<t;o+=1)r[o]=e[o]&255;return r}function ra(e){if(ae(e,Uint8Array)){var t=new Uint8Array(e);return rr(t.buffer,t.byteOffset,t.byteLength)}return tr(e)}function rr(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 na(e){if(u.isBuffer(e)){var t=ir(e.length)|0,r=ge(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||ar(e.length)?ge(0):tr(e);if(e.type==="Buffer"&&Array.isArray(e.data))return tr(e.data)}function ir(e){if(e>=Tt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Tt.toString(16)+" bytes");return e|0}function oa(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(ae(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),ae(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(ae(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 gn(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ae(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 nr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Sn(e).length;default:if(i)return o?-1:nr(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=gn;function ia(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 fa(this,t,r);case"utf8":case"utf-8":return Tn(this,t,r);case"ascii":return ma(this,t,r);case"latin1":case"binary":return ga(this,t,r);case"base64":return ua(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ta(this,t,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}u.prototype._isBuffer=!0;function Me(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)Me(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)Me(this,r,r+3),Me(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)Me(this,r,r+7),Me(this,r+1,r+6),Me(this,r+2,r+5),Me(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?Tn(this,0,t):ia.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=Be.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};ln&&(u.prototype[ln]=u.prototype.inspect);u.prototype.compare=function(t,r,o,i,p){if(ae(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),T=this.slice(i,p),g=t.slice(r,o),f=0;f<d;++f)if(T[f]!==g[f]){l=T[f],m=g[f];break}return l<m?-1:m<l?1:0};function fn(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,ar(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:pn(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):pn(e,[t],r,o,i);throw new TypeError("val must be string, number or Buffer")}function pn(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(S,D){return p===1?S[D]:S.readUInt16BE(D*p)}var T;if(i){var g=-1;for(T=r;T<l;T++)if(d(e,T)===d(t,g===-1?0:T-g)){if(g===-1&&(g=T),T-g+1===m)return g*p}else g!==-1&&(T-=T-g),g=-1}else for(r+m>l&&(r=l-m),T=r;T>=0;T--){for(var f=!0,b=0;b<m;b++)if(d(e,T+b)!==d(t,b)){f=!1;break}if(f)return T}return-1}u.prototype.includes=function(t,r,o){return this.indexOf(t,r,o)!==-1};u.prototype.indexOf=function(t,r,o){return fn(this,t,r,o,!0)};u.prototype.lastIndexOf=function(t,r,o){return fn(this,t,r,o,!1)};function aa(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(ar(m))return l;e[r+l]=m}return l}function sa(e,t,r,o){return yt(nr(t,e.length-r),e,r,o)}function ca(e,t,r,o){return yt(xa(t),e,r,o)}function la(e,t,r,o){return yt(Sn(t),e,r,o)}function pa(e,t,r,o){return yt(Sa(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 aa(this,t,r,o);case"utf8":case"utf-8":return sa(this,t,r,o);case"ascii":case"latin1":case"binary":return ca(this,t,r,o);case"base64":return la(this,t,r,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pa(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 ua(e,t,r){return t===0&&r===e.length?er.fromByteArray(e):er.fromByteArray(e.slice(t,r))}function Tn(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,T,g,f;switch(m){case 1:p<128&&(l=p);break;case 2:d=e[i+1],(d&192)===128&&(f=(p&31)<<6|d&63,f>127&&(l=f));break;case 3:d=e[i+1],T=e[i+2],(d&192)===128&&(T&192)===128&&(f=(p&15)<<12|(d&63)<<6|T&63,f>2047&&(f<55296||f>57343)&&(l=f));break;case 4:d=e[i+1],T=e[i+2],g=e[i+3],(d&192)===128&&(T&192)===128&&(g&192)===128&&(f=(p&15)<<18|(d&63)<<12|(T&63)<<6|g&63,f>65535&&f<1114112&&(l=f))}}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 da(o)}var un=4096;function da(e){var t=e.length;if(t<=un)return String.fromCharCode.apply(String,e);for(var r="",o=0;o<t;)r+=String.fromCharCode.apply(String,e.slice(o,o+=un));return r}function ma(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 ga(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 fa(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+=wa[e[p]];return i}function Ta(e,t,r){for(var o=e.slice(t,r),i="",p=0;p<o.length-1;p+=2)i+=String.fromCharCode(o[p]+o[p+1]*256);return i}u.prototype.slice=function(t,r){var o=this.length;t=~~t,r=r===void 0?o:~~r,t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),r<0?(r+=o,r<0&&(r=0)):r>o&&(r=o),r<t&&(r=t);var i=this.subarray(t,r);return Object.setPrototypeOf(i,u.prototype),i};function _(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||_(t,r,this.length);for(var i=this[t],p=1,l=0;++l<r&&(p*=256);)i+=this[t+l]*p;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||_(t,r,this.length);for(var i=this[t+--r],p=1;r>0&&(p*=256);)i+=this[t+--r]*p;return i};u.prototype.readUint8=u.prototype.readUInt8=function(t,r){return t=t>>>0,r||_(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||_(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||_(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||_(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||_(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||_(t,r,this.length);for(var i=this[t],p=1,l=0;++l<r&&(p*=256);)i+=this[t+l]*p;return p*=128,i>=p&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||_(t,r,this.length);for(var i=r,p=1,l=this[t+--i];i>0&&(p*=256);)l+=this[t+--i]*p;return p*=128,l>=p&&(l-=Math.pow(2,8*r)),l};u.prototype.readInt8=function(t,r){return t=t>>>0,r||_(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||_(t,2,this.length);var o=this[t]|this[t+1]<<8;return o&32768?o|4294901760:o};u.prototype.readInt16BE=function(t,r){t=t>>>0,r||_(t,2,this.length);var o=this[t+1]|this[t]<<8;return o&32768?o|4294901760:o};u.prototype.readInt32LE=function(t,r){return t=t>>>0,r||_(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};u.prototype.readInt32BE=function(t,r){return t=t>>>0,r||_(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};u.prototype.readFloatLE=function(t,r){return t=t>>>0,r||_(t,4,this.length),Ue.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||_(t,4,this.length),Ue.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||_(t,8,this.length),Ue.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||_(t,8,this.length),Ue.read(this,t,!1,52,8)};function G(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;G(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;G(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||G(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||G(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||G(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||G(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||G(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);G(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);G(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||G(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||G(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||G(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||G(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||G(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 yn(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 hn(e,t,r,o,i){return t=+t,r=r>>>0,i||yn(e,t,r,4,34028234663852886e22,-34028234663852886e22),Ue.write(e,t,r,o,23,4),r+4}u.prototype.writeFloatLE=function(t,r,o){return hn(this,t,r,!0,o)};u.prototype.writeFloatBE=function(t,r,o){return hn(this,t,r,!1,o)};function xn(e,t,r,o,i){return t=+t,r=r>>>0,i||yn(e,t,r,8,17976931348623157e292,-17976931348623157e292),Ue.write(e,t,r,o,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,o){return xn(this,t,r,!0,o)};u.prototype.writeDoubleBE=function(t,r,o){return xn(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 ya=/[^+/0-9A-Za-z-_]/g;function ha(e){if(e=e.split("=")[0],e=e.trim().replace(ya,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function nr(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 xa(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Sa(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 Sn(e){return er.toByteArray(ha(e))}function yt(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 ae(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function ar(e){return e!==e}var wa=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 En=gt((dc,In)=>{n();var M=In.exports={},se,ce;function sr(){throw new Error("setTimeout has not been defined")}function cr(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?se=setTimeout:se=sr}catch(e){se=sr}try{typeof clearTimeout=="function"?ce=clearTimeout:ce=cr}catch(e){ce=cr}})();function vn(e){if(se===setTimeout)return setTimeout(e,0);if((se===sr||!se)&&setTimeout)return se=setTimeout,setTimeout(e,0);try{return se(e,0)}catch(t){try{return se.call(null,e,0)}catch(r){return se.call(this,e,0)}}}function va(e){if(ce===clearTimeout)return clearTimeout(e);if((ce===cr||!ce)&&clearTimeout)return ce=clearTimeout,clearTimeout(e);try{return ce(e)}catch(t){try{return ce.call(null,e)}catch(r){return ce.call(this,e)}}}var fe=[],Ve=!1,Fe,ht=-1;function ba(){!Ve||!Fe||(Ve=!1,Fe.length?fe=Fe.concat(fe):ht=-1,fe.length&&bn())}function bn(){if(!Ve){var e=vn(ba);Ve=!0;for(var t=fe.length;t;){for(Fe=fe,fe=[];++ht<t;)Fe&&Fe[ht].run();ht=-1,t=fe.length}Fe=null,Ve=!1,va(e)}}M.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];fe.push(new An(e,t)),fe.length===1&&!Ve&&vn(bn)};function An(e,t){this.fun=e,this.array=t}An.prototype.run=function(){this.fun.apply(null,this.array)};M.title="browser";M.browser=!0;M.env={};M.argv=[];M.version="";M.versions={};function Te(){}M.on=Te;M.addListener=Te;M.once=Te;M.off=Te;M.removeListener=Te;M.removeAllListeners=Te;M.emit=Te;M.prependListener=Te;M.prependOnceListener=Te;M.listeners=function(e){return[]};M.binding=function(e){throw new Error("process.binding is not supported")};M.cwd=function(){return"/"};M.chdir=function(e){throw new Error("process.chdir is not supported")};M.umask=function(){return 0}});var a,s,mc,n=x(()=>{a=N(wn()),s=N(En()),mc=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 $e,ot=x(()=>{"use strict";n();$e="Action not allowed. User is logged in. Call logout() first"});var Ln=x(()=>{"use strict";n()});var W=x(()=>{"use strict";n()});var U=x(()=>{"use strict";n()});var kn=x(()=>{"use strict";n()});var Dn=x(()=>{"use strict";n()});var Cn=x(()=>{"use strict";n()});var Pn=x(()=>{"use strict";n()});var le=x(()=>{"use strict";n();Ln();W();U();kn();Dn();Cn();Pn()});var lr,Nn,Dc,Rn,Cc,Mn,Pc,Nc,Rc,Fn=x(()=>{"use strict";n();le();lr={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:Nn,egldLabel:Dc}=lr["devnet"],{chainId:Rn,egldLabel:Cc}=lr["testnet"],{chainId:Mn,egldLabel:Pc}=lr["mainnet"],Nc={["devnet"]:Nn,["testnet"]:Rn,["mainnet"]:Mn},Rc={[Nn]:"devnet",[Rn]:"testnet",[Mn]:"mainnet"}});var pr,ur=x(()=>{"use strict";n();pr={36864:{code:"codeSuccess",message:"Success"},27013:{code:"ERR_USER_DENIED",message:"Rejected by user"},27904:{code:"ERR_UNKNOWN_INSTRUCTION",message:"Unknown instruction"},28160:{code:"ERR_WRONG_CLA",message:"Wrong CLA"},28161:{code:"ERR_INVALID_ARGUMENTS",message:"Invalid arguments"},28162:{code:"ERR_INVALID_MESSAGE",message:"Invalid message"},28163:{code:"ERR_INVALID_P1",message:"Invalid P1"},28164:{code:"ERR_MESSAGE_TOO_LONG",message:"Message too long"},28165:{code:"ERR_RECEIVER_TOO_LONG",message:"Receiver too long"},28166:{code:"ERR_AMOUNT_TOO_LONG",message:"Amount too long"},28167:{code:"ERR_CONTRACT_DATA_DISABLED",message:"Contract data disabled in app options"},28168:{code:"ERR_MESSAGE_INCOMPLETE",message:"Message incomplete"},28176:{code:"ERR_SIGNATURE_FAILED",message:"Signature failed"},28169:{code:"ERR_WRONG_TX_VERSION",message:"Wrong TX version"},28170:{code:"ERR_NONCE_TOO_LONG",message:"Nonce too long"},28171:{code:"ERR_INVALID_AMOUNT",message:"Invalid amount"},28172:{code:"ERR_INVALID_FEE",message:"Invalid fee"},28173:{code:"ERR_PRETTY_FAILED",message:"Pretty failed"},28174:{code:"ERR_DATA_TOO_LONG",message:"Data too long"},28175:{code:"ERR_WRONG_TX_OPTIONS",message:"Invalid transaction options"},28177:{code:"ERR_SIGN_TX_DEPRECATED",message:"Regular transaction signing is deprecated in this version. Use hash signing."}}});var On=x(()=>{"use strict";n()});var _n,dr=x(()=>{"use strict";n();_n="transaction-status-toast-id"});var mr,gr,Un,Bn,xt,Vn,We,F=x(()=>{"use strict";n();ot();Fn();ur();On();dr();mr=5e4,gr=1e9,Un=1,Bn=1,xt="logout",Vn="login",We="0"});var yr,$,z,q=x(()=>{"use strict";n();yr=require("@reduxjs/toolkit");F();$=(0,yr.createAction)(xt),z=(0,yr.createAction)(Vn,e=>({payload:e}))});var vt,hr=x(()=>{"use strict";n();vt=()=>Date.now()/1e3});var qn=x(()=>{"use strict";n()});var jn=x(()=>{"use strict";n()});var xr=x(()=>{"use strict";n();hr();qn();jn()});var wr={};Ne(wr,{getItem:()=>Ea,localStorageKeys:()=>pe,removeItem:()=>La,setItem:()=>Ia});var pe,Sr,Ia,Ea,La,Ge=x(()=>{"use strict";n();xr();pe={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Sr=typeof localStorage!="undefined",Ia=({key:e,data:t,expires:r})=>{!Sr||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Ea=e=>{if(!Sr)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:vt()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},La=e=>{!Sr||localStorage.removeItem(String(e))}});var vr={};Ne(vr,{clear:()=>Xn,getItem:()=>Yn,removeItem:()=>Zn,setItem:()=>Kn,storage:()=>ka});var Kn,Yn,Zn,Xn,ka,Jn=x(()=>{"use strict";n();Kn=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Yn=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},Zn=e=>sessionStorage.removeItem(String(e)),Xn=()=>sessionStorage.clear(),ka={setItem:Kn,getItem:Yn,removeItem:Zn,clear:Xn}});var Se,ze=x(()=>{"use strict";n();Ge();Jn();Se={session:vr,local:wr}});function it(){return new Date().setHours(new Date().getHours()+24)}function at(e){Se.local.setItem({key:pe.loginExpiresAt,data:e,expires:e})}var br=x(()=>{"use strict";n();ze();Ge()});var eo,Qn,to,fl,qe,ro,ne,bt,no,oo,io,Ar=x(()=>{"use strict";n();eo=require("@reduxjs/toolkit");br();U();q();Qn={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},to=(0,eo.createSlice)({name:"loginInfoSlice",initialState:Qn,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($,()=>Qn),e.addCase(z,(t,r)=>{t.loginMethod=r.payload.loginMethod,at(it())})}}),{setLoginMethod:fl,setWalletConnectLogin:qe,setLedgerLogin:ro,setTokenLogin:ne,setTokenLoginSignature:bt,setWalletLogin:no,invalidateLoginSession:oo}=to.actions,io=to.reducer});var ao,so,At,It=x(()=>{"use strict";n();ao=!1,so=(e=!0)=>{ao=e},At=(e,t=0)=>{ao||setTimeout(()=>{window.location.href=e},t)}});function we({callbackRoute:e,onLoginRedirect:t,options:r}){let o=Boolean(e),i=typeof t=="function",p=i?0:Da;o&&e!=null&&setTimeout(()=>{if(i)return t(e,r);window.location.pathname.includes(e)||At(e)},p)}var Da,co=x(()=>{"use strict";n();It();Da=200});function Ir(e){return e[Math.floor(Math.random()*e.length)]}var lo=x(()=>{"use strict";n()});function st(e){let t=null;if((e==null?void 0:e.statusCode)in pr){let r=e==null?void 0:e.statusCode,{message:o}=pr[r];t=Na.includes(r)?po:o}return{errorMessage:t,defaultErrorMessage:po}}var po,Ca,Pa,Na,uo=x(()=>{"use strict";n();ur();po="Check if Elrond app is open on Ledger",Ca=28161,Pa=28160,Na=[Ca,Pa]});var je=x(()=>{"use strict";n();co();lo();uo()});var mo,go,Er,Ra,fo,Dl,Cl,To,Lr=x(()=>{"use strict";n();mo=require("@reduxjs/toolkit"),go=N(require("lodash.omit"));je();Er={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Ra={network:Er,chainID:"-1"},fo=(0,mo.createSlice)({name:"appConfig",initialState:Ra,reducers:{initializeNetworkConfig:(e,t)=>{let r=Ir(t.payload.walletConnectBridgeAddresses),o=Ir(t.payload.walletConnectV2RelayAddresses),i=(0,go.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=k(v(v({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:o})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:Dl,setChainID:Cl}=fo.actions,To=fo.reducer});var Dr,yo,ho,Et,kr,xo,Cr,Ul,Pr,Bl,Nr,So,Vl,$l,Wl,Hl,wo,Rr=x(()=>{"use strict";n();Dr=require("@elrondnetwork/erdjs"),yo=require("@reduxjs/toolkit"),ho=require("redux-persist");F();ze();Ge();q();Et={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:We},kr={address:"",websocketEvent:null,accounts:{"":Et},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},xo=(0,yo.createSlice)({name:"accountInfoSlice",initialState:kr,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new Dr.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Et},e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,t)=>{let{address:r}=e;e.accounts[r].nonce=t.payload},setAccountShard:(e,t)=>{e.shard=t.payload},setLedgerAccount:(e,t)=>{e.ledgerAccount=t.payload},updateLedgerAccount:(e,t)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=t.payload.index,e.ledgerAccount.address=t.payload.address)},setWalletConnectAccount:(e,t)=>{e.walletConnectAccount=t.payload},setIsAccountLoading:(e,t)=>{e.isAccountLoading=t.payload,e.accountLoadingError=null},setAccountLoadingError:(e,t)=>{e.accountLoadingError=t.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,t)=>{e.websocketEvent={timestamp:Date.now(),message:t.payload}}},extraReducers:e=>{e.addCase($,()=>(Se.local.removeItem(pe.loginExpiresAt),kr)),e.addCase(z,(t,r)=>{let{address:o}=r.payload;t.address=o,t.publicKey=new Dr.Address(o).hex()}),e.addCase(ho.REHYDRATE,(t,r)=>{var T;if(!((T=r.payload)!=null&&T.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:kr.accounts,t.publicKey=m})}}),{setAccount:Cr,setAddress:Ul,setAccountNonce:Pr,setAccountShard:Bl,setLedgerAccount:Nr,updateLedgerAccount:So,setWalletConnectAccount:Vl,setIsAccountLoading:$l,setAccountLoadingError:Wl,setWebsocketEvent:Hl}=xo.actions,wo=xo.reducer});function vo(e){return e!=null&&(Wa(e)||qa(e))}function Lt(e){return e!=null&&(Ha(e)||ja(e))}function kt(e){return e!=null&&(Ga(e)||Ka(e))}function bo(e){return e!=null&&za(e)}function Wa(e){return e!=null&&Fa.includes(e)}function Ha(e){return e!=null&&Oa.includes(e)}function Ga(e){return e!=null&&_a.includes(e)}function za(e){return e!=null&&Ua.includes(e)}function qa(e){return e!=null&&Ba.includes(e)}function ja(e){return e!=null&&Va.includes(e)}function Ka(e){return e!=null&&$a.includes(e)}var Fa,Oa,_a,Ua,Ba,Va,$a,Fr=x(()=>{"use strict";n();U();Fa=["sent"],Oa=["success"],_a=["fail","cancelled","timedOut"],Ua=["timedOut"],Ba=["pending"],Va=["success"],$a=["fail","invalid"]});var Ao,Io,ct,Ya,Eo,Jl,Ql,ep,tp,rp,np,op,ip,ap,sp,Dt,Ct=x(()=>{"use strict";n();Ao=require("@reduxjs/toolkit"),Io=require("redux-persist");U();Fr();q();ct={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Ya={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Eo=(0,Ao.createSlice)({name:"transactionsSlice",initialState:ct,reducers:{moveTransactionsToSignedState:(e,t)=>{var d,T;let{sessionId:r,transactions:o,errorMessage:i,status:p,redirectRoute:l}=t.payload,m=((d=e.customTransactionInformationForSessionId)==null?void 0:d[r])||Ya;e.signedTransactions[r]={transactions:o,status:p,errorMessage:i,redirectRoute:l,customTransactionInformation:m},((T=e==null?void 0:e.transactionsToSign)==null?void 0:T.sessionId)===r&&(e.transactionsToSign=ct.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=v(v({},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,T,g,f,b;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(C=>C.hash===p?k(v({},C),{status:o,errorMessage:i}):C);let S=(g=(T=e.signedTransactions[r])==null?void 0:T.transactions)==null?void 0:g.every(C=>Lt(C.status)),D=(b=(f=e.signedTransactions[r])==null?void 0:f.transactions)==null?void 0:b.every(C=>kt(C.status));S&&(e.signedTransactions[r].status="success"),D&&(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=ct.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=ct.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase($,()=>ct),e.addCase(Io.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,T])=>{let g=new Date(d),f=new Date;return f.setHours(f.getHours()+5),f-g>0||(m[d]=T),m},{});i!=null&&(t.customTransactionInformationForSessionId=i),o!=null&&(t.signedTransactions=p)})}}),{updateSignedTransactionStatus:Jl,updateSignedTransactions:Ql,setTransactionsToSign:ep,clearAllTransactionsToSign:tp,clearAllSignedTransactions:rp,clearSignedTransaction:np,clearTransactionToSign:op,setSignTransactionsError:ip,setSignTransactionsCancelMessage:ap,moveTransactionsToSignedState:sp}=Eo.actions,Dt=Eo.reducer});var Lo,_r,Ur,Br,Za,Or,ko,up,dp,mp,Pt,Nt=x(()=>{"use strict";n();Lo=require("@reduxjs/toolkit");q();_r="Transaction failed",Ur="Transaction successful",Br="Processing transaction",Za="Transaction submitted",Or={},ko=(0,Lo.createSlice)({name:"transactionsInfo",initialState:Or,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:o}=t.payload;r!=null&&(e[r]={errorMessage:(o==null?void 0:o.errorMessage)||_r,successMessage:(o==null?void 0:o.successMessage)||Ur,processingMessage:(o==null?void 0:o.processingMessage)||Br,submittedMessage:(o==null?void 0:o.submittedMessage)||Za,transactionDuration:o==null?void 0:o.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>Or},extraReducers:e=>{e.addCase($,()=>Or)}}),{clearTransactionsInfo:up,setTransactionsDisplayInfo:dp,clearTransactionsInfoForSessionId:mp}=ko.actions,Pt=ko.reducer});var Co,Do,Po,yp,hp,xp,Sp,No,Vr=x(()=>{"use strict";n();Co=require("@reduxjs/toolkit");q();Do={},Po=(0,Co.createSlice)({name:"modalsSlice",initialState:Do,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($,()=>Do)}}),{setTxSubmittedModal:yp,setNotificationModal:hp,clearTxSubmittedModal:xp,clearNotificationModal:Sp}=Po.actions,No=Po.reducer});var Mo,Fo,Ro,Oo,Xa,Ja,kp,Dp,Cp,Pp,Rt,Mt=x(()=>{"use strict";n();Mo=require("@reduxjs/toolkit"),Fo=require("redux-persist");dr();le();hr();q();Ro={customToasts:[],transactionToasts:[],failTransactionToast:null},Oo=(0,Mo.createSlice)({name:"toastsSlice",initialState:Ro,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(k(v({},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:vt(),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=k(v({},t.payload),{toastId:_n})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase($,()=>Ro),e.addCase(Fo.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:Xa,removeCustomToast:Ja,addTransactionToast:kp,removeTransactionToast:Dp,addFailTransactionToast:Cp,removeFailTransactionToast:Pp}=Oo.actions,Rt=Oo.reducer});var j=x(()=>{"use strict";n();Ar();Lr();Rr();Ct();Nt();Vr();Mt()});var $r=x(()=>{"use strict";n()});var Vo,Bo,$o,Xp,Jp,Qp,eu,tu,ru,Wo,Ho=x(()=>{"use strict";n();Vo=require("@reduxjs/toolkit");q();Bo={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},$o=(0,Vo.createSlice)({name:"dappModalsSlice",initialState:Bo,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=v({},t.payload)}},extraReducers:e=>{e.addCase($,()=>Bo)}}),{setDappModalVisibility:Xp,setDappModalHeaderVisibility:Jp,setDappModalFooterVisibility:Qp,setDappModalHeaderText:eu,setDappModalFooterText:tu,setDappModalConfig:ru}=$o.actions,Wo=$o.reducer});var Go,rs,ns,Ke,Ot=x(()=>{"use strict";n();Go=require("@reduxjs/toolkit");$r();Rr();Ho();Ar();Vr();Lr();Mt();Nt();Ct();rs={["account"]:wo,["networkConfig"]:To,["loginInfo"]:io,["modals"]:No,["dappModal"]:Wo,["toasts"]:Rt,["transactions"]:Dt,["transactionsInfo"]:Pt},ns=(e={})=>(0,Go.combineReducers)(v(v({},rs),e)),Ke=ns});var jo={};Ne(jo,{default:()=>ps});function Wr(e,t=[]){return{key:e,version:1,storage:qo.default,blacklist:t}}var Oe,zo,qo,os,is,as,ss,cs,ls,ps,Ko=x(()=>{"use strict";n();Oe=require("redux-persist"),zo=N(require("redux-persist/lib/storage")),qo=N(require("redux-persist/lib/storage/session"));Ot();j();Mt();Nt();Ct();$r();os={2:e=>k(v({},e),{networkConfig:Er})};is=Wr("dapp-core-transactionsInfo"),as=Wr("dapp-core-transactions",["transactionsToSign"]),ss=Wr("dapp-core-toasts"),cs={key:"dapp-core-store",version:2,storage:zo.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,Oe.createMigrate)(os,{debug:!1})},ls={["toasts"]:(0,Oe.persistReducer)(ss,Rt),["transactions"]:(0,Oe.persistReducer)(as,Dt),["transactionsInfo"]:(0,Oe.persistReducer)(is,Pt)},ps=(0,Oe.persistReducer)(cs,Ke(ls))});var Yo={};Ne(Yo,{default:()=>us});var us,Zo=x(()=>{"use strict";n();Ot();us=Ke()});var Xo={};Ne(Xo,{default:()=>ms});var te,ds,ms,Jo=x(()=>{"use strict";n();te=require("redux-persist"),ds=[te.FLUSH,te.REHYDRATE,te.PAUSE,te.PERSIST,te.PURGE,te.REGISTER],ms=ds});var ti={};Ne(ti,{default:()=>ei});function ei(e){return(0,Qo.persistStore)(e)}var Qo,ri=x(()=>{"use strict";n();Qo=require("redux-persist")});var ac={};Ne(ac,{useExtensionLogin:()=>Di,useLedgerLogin:()=>Ri,useWalletConnectLogin:()=>Oi,useWalletConnectV2Login:()=>Ui,useWebWalletLogin:()=>Ni});module.exports=nt(ac);n();n();var Xr=require("react"),ki=require("@elrondnetwork/erdjs-extension-provider");ot();n();n();var $n=require("@elrondnetwork/erdjs-extension-provider"),Wn=require("@elrondnetwork/erdjs-hw-provider"),wt=require("@elrondnetwork/erdjs-wallet-connect-provider"),fr=require("@elrondnetwork/erdjs-web-wallet-provider");F();U();var Aa="/dapp/init",He=e=>{switch(e==null?void 0:e.constructor){case fr.WalletProvider:return"wallet";case wt.WalletConnectProvider:return"walletconnect";case wt.WalletConnectV2Provider:return"walletconnectv2";case Wn.HWProvider:return"ledger";case $n.ExtensionProvider:return"extension";case St:return"";default:return"extra"}},Hn=e=>new fr.WalletProvider(`${e}${Aa}`),Gn=e=>I(void 0,null,function*(){if(!e.isInitialized())throw new Error("Unable to get version. Provider not initialized");let t=e.hwApp,{contractData:r,version:o}=yield t.getAppConfiguration();return{version:o,dataEnabled:r===Bn}}),ye=e=>`Unable to perform ${e}, Provider not initialized`,St=class{init(){return Promise.resolve(!1)}login(t){throw new Error(ye(`login with options: ${t}`))}logout(t){throw new Error(ye(`logout with options: ${t}`))}getAddress(){throw new Error(ye("getAddress"))}isInitialized(){return!1}isConnected(){return Promise.resolve(!1)}sendTransaction(t,r){throw new Error(ye(`sendTransaction with transactions: ${t} options: ${r}`))}signTransaction(t,r){throw new Error(ye(`signTransaction with transactions: ${t} options: ${r}`))}signTransactions(t,r){throw new Error(ye(`signTransactions with transactions: ${t} options: ${r}`))}signMessage(t,r){throw new Error(ye(`signTransactions with ${t} and options ${r}`))}sendCustomMessage({method:t,params:r}){throw new Error(ye(`sendCustomMessage with method: ${t} params: ${r}`))}sendCustomRequest(t){throw new Error(ye(`sendSessionEvent with options: ${t}`))}ping(){return Promise.resolve(!1)}},Tr=new St;var zn=Tr;function xe(e){zn=e}function Y(){return zn||Tr}q();n();var ci=require("react"),Ye=require("react-redux");n();var Hr=require("@reduxjs/toolkit"),ai=require("react-redux/es/utils/Subscription");j();n();var _o=N(require("lodash.throttle"));F();j();br();ze();Ge();var Qa=[xt],es=(0,_o.default)(()=>{at(it())},5e3),Uo=e=>t=>r=>{var d;if(Qa.includes(r.type))return t(r);let o=e.getState(),i=Se.local.getItem(pe.loginExpiresAt);if(!((d=o==null?void 0:o.loginInfo)==null?void 0:d.isLoggedIn))return t(r);if(i==null)return at(it());let l=Date.now();return i-l<0?setTimeout(()=>I(void 0,null,function*(){console.log("session expired");try{e.dispatch(oo())}catch(T){console.error("error logging out",T)}}),1e3):(es(),t(r))};n();n();function Ft(){return typeof sessionStorage!="undefined"}var ni=Ft()?(Ko(),nt(jo)).default:(Zo(),nt(Yo)).default,oi=Ft()?(Jo(),nt(Xo)).default:[],ii=Ft()?(ri(),nt(ti)).default:e=>e;Ot();var R=(0,Hr.configureStore)({red