UNPKG

@sofaws/dapp-core

Version:

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

1 lines 213 kB
"use strict";var wa=Object.create;var we=Object.defineProperty,qa=Object.defineProperties,ka=Object.getOwnPropertyDescriptor,va=Object.getOwnPropertyDescriptors,Sa=Object.getOwnPropertyNames,Me=Object.getOwnPropertySymbols,Aa=Object.getPrototypeOf,ln=Object.prototype.hasOwnProperty,No=Object.prototype.propertyIsEnumerable;var Ao=(e,n,o)=>n in e?we(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,x=(e,n)=>{for(var o in n||(n={}))ln.call(n,o)&&Ao(e,o,n[o]);if(Me)for(var o of Me(n))No.call(n,o)&&Ao(e,o,n[o]);return e},T=(e,n)=>qa(e,va(n));var me=(e,n)=>{var o={};for(var t in e)ln.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(e!=null&&Me)for(var t of Me(e))n.indexOf(t)<0&&No.call(e,t)&&(o[t]=e[t]);return o};var h=(e,n)=>()=>(e&&(n=e(e=0)),n);var Ie=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),_e=(e,n)=>{for(var o in n)we(e,o,{get:n[o],enumerable:!0})},Eo=(e,n,o,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Sa(n))!ln.call(e,a)&&a!==o&&we(e,a,{get:()=>n[a],enumerable:!(t=ka(n,a))||t.enumerable});return e};var y=(e,n,o)=>(o=e!=null?wa(Aa(e)):{},Eo(n||!e||!e.__esModule?we(o,"default",{value:e,enumerable:!0}):o,e)),Le=e=>Eo(we({},"__esModule",{value:!0}),e);var Do=(e,n,o)=>new Promise((t,a)=>{var c=d=>{try{l(o.next(d))}catch(g){a(g)}},i=d=>{try{l(o.throw(d))}catch(g){a(g)}},l=d=>d.done?t(d.value):Promise.resolve(d.value).then(c,i);l((o=o.apply(e,n)).next())});var Lo=Ie(Re=>{"use strict";r();Re.byteLength=Ea;Re.toByteArray=Ma;Re.fromByteArray=Ra;var j=[],C=[],Na=typeof Uint8Array!="undefined"?Uint8Array:Array,gn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(oe=0,Mo=gn.length;oe<Mo;++oe)j[oe]=gn[oe],C[gn.charCodeAt(oe)]=oe;var oe,Mo;C["-".charCodeAt(0)]=62;C["_".charCodeAt(0)]=63;function Io(e){var n=e.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.indexOf("=");o===-1&&(o=n);var t=o===n?0:4-o%4;return[o,t]}function Ea(e){var n=Io(e),o=n[0],t=n[1];return(o+t)*3/4-t}function Da(e,n,o){return(n+o)*3/4-o}function Ma(e){var n,o=Io(e),t=o[0],a=o[1],c=new Na(Da(e,t,a)),i=0,l=a>0?t-4:t,d;for(d=0;d<l;d+=4)n=C[e.charCodeAt(d)]<<18|C[e.charCodeAt(d+1)]<<12|C[e.charCodeAt(d+2)]<<6|C[e.charCodeAt(d+3)],c[i++]=n>>16&255,c[i++]=n>>8&255,c[i++]=n&255;return a===2&&(n=C[e.charCodeAt(d)]<<2|C[e.charCodeAt(d+1)]>>4,c[i++]=n&255),a===1&&(n=C[e.charCodeAt(d)]<<10|C[e.charCodeAt(d+1)]<<4|C[e.charCodeAt(d+2)]>>2,c[i++]=n>>8&255,c[i++]=n&255),c}function Ia(e){return j[e>>18&63]+j[e>>12&63]+j[e>>6&63]+j[e&63]}function La(e,n,o){for(var t,a=[],c=n;c<o;c+=3)t=(e[c]<<16&16711680)+(e[c+1]<<8&65280)+(e[c+2]&255),a.push(Ia(t));return a.join("")}function Ra(e){for(var n,o=e.length,t=o%3,a=[],c=16383,i=0,l=o-t;i<l;i+=c)a.push(La(e,i,i+c>l?l:i+c));return t===1?(n=e[o-1],a.push(j[n>>2]+j[n<<4&63]+"==")):t===2&&(n=(e[o-2]<<8)+e[o-1],a.push(j[n>>10]+j[n>>4&63]+j[n<<2&63]+"=")),a.join("")}});var Ro=Ie(fn=>{r();fn.read=function(e,n,o,t,a){var c,i,l=a*8-t-1,d=(1<<l)-1,g=d>>1,b=-7,u=o?a-1:0,k=o?-1:1,S=e[n+u];for(u+=k,c=S&(1<<-b)-1,S>>=-b,b+=l;b>0;c=c*256+e[n+u],u+=k,b-=8);for(i=c&(1<<-b)-1,c>>=-b,b+=t;b>0;i=i*256+e[n+u],u+=k,b-=8);if(c===0)c=1-g;else{if(c===d)return i?NaN:(S?-1:1)*(1/0);i=i+Math.pow(2,t),c=c-g}return(S?-1:1)*i*Math.pow(2,c-t)};fn.write=function(e,n,o,t,a,c){var i,l,d,g=c*8-a-1,b=(1<<g)-1,u=b>>1,k=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=t?0:c-1,L=t?1:-1,R=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(l=isNaN(n)?1:0,i=b):(i=Math.floor(Math.log(n)/Math.LN2),n*(d=Math.pow(2,-i))<1&&(i--,d*=2),i+u>=1?n+=k/d:n+=k*Math.pow(2,1-u),n*d>=2&&(i++,d/=2),i+u>=b?(l=0,i=b):i+u>=1?(l=(n*d-1)*Math.pow(2,a),i=i+u):(l=n*Math.pow(2,u-1)*Math.pow(2,a),i=0));a>=8;e[o+S]=l&255,S+=L,l/=256,a-=8);for(i=i<<a|l,g+=a;g>0;e[o+S]=i&255,S+=L,i/=256,g-=8);e[o+S-L]|=R*128}});var Zo=Ie(le=>{"use strict";r();var un=Lo(),de=Ro(),Co=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;le.Buffer=_;le.SlowBuffer=Ua;le.INSPECT_MAX_BYTES=50;var Ce=2147483647;le.kMaxLength=Ce;_.TYPED_ARRAY_SUPPORT=Ca();!_.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 Ca(){try{var e=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(e,n),e.foo()===42}catch(o){return!1}}Object.defineProperty(_.prototype,"parent",{enumerable:!0,get:function(){if(!!_.isBuffer(this))return this.buffer}});Object.defineProperty(_.prototype,"offset",{enumerable:!0,get:function(){if(!!_.isBuffer(this))return this.byteOffset}});function B(e){if(e>Ce)throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=new Uint8Array(e);return Object.setPrototypeOf(n,_.prototype),n}function _(e,n,o){if(typeof e=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return yn(e)}return jo(e,n,o)}_.poolSize=8192;function jo(e,n,o){if(typeof e=="string")return Fa(e,n);if(ArrayBuffer.isView(e))return ja(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(z(e,ArrayBuffer)||e&&z(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(z(e,SharedArrayBuffer)||e&&z(e.buffer,SharedArrayBuffer)))return bn(e,n,o);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var t=e.valueOf&&e.valueOf();if(t!=null&&t!==e)return _.from(t,n,o);var a=za(e);if(a)return a;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return _.from(e[Symbol.toPrimitive]("string"),n,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}_.from=function(e,n,o){return jo(e,n,o)};Object.setPrototypeOf(_.prototype,Uint8Array.prototype);Object.setPrototypeOf(_,Uint8Array);function zo(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 Pa(e,n,o){return zo(e),e<=0?B(e):n!==void 0?typeof o=="string"?B(e).fill(n,o):B(e).fill(n):B(e)}_.alloc=function(e,n,o){return Pa(e,n,o)};function yn(e){return zo(e),B(e<0?0:Tn(e)|0)}_.allocUnsafe=function(e){return yn(e)};_.allocUnsafeSlow=function(e){return yn(e)};function Fa(e,n){if((typeof n!="string"||n==="")&&(n="utf8"),!_.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=Uo(e,n)|0,t=B(o),a=t.write(e,n);return a!==o&&(t=t.slice(0,a)),t}function hn(e){for(var n=e.length<0?0:Tn(e.length)|0,o=B(n),t=0;t<n;t+=1)o[t]=e[t]&255;return o}function ja(e){if(z(e,Uint8Array)){var n=new Uint8Array(e);return bn(n.buffer,n.byteOffset,n.byteLength)}return hn(e)}function bn(e,n,o){if(n<0||e.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<n+(o||0))throw new RangeError('"length" is outside of buffer bounds');var t;return n===void 0&&o===void 0?t=new Uint8Array(e):o===void 0?t=new Uint8Array(e,n):t=new Uint8Array(e,n,o),Object.setPrototypeOf(t,_.prototype),t}function za(e){if(_.isBuffer(e)){var n=Tn(e.length)|0,o=B(n);return o.length===0||e.copy(o,0,0,n),o}if(e.length!==void 0)return typeof e.length!="number"||wn(e.length)?B(0):hn(e);if(e.type==="Buffer"&&Array.isArray(e.data))return hn(e.data)}function Tn(e){if(e>=Ce)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ce.toString(16)+" bytes");return e|0}function Ua(e){return+e!=e&&(e=0),_.alloc(+e)}_.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==_.prototype};_.compare=function(n,o){if(z(n,Uint8Array)&&(n=_.from(n,n.offset,n.byteLength)),z(o,Uint8Array)&&(o=_.from(o,o.offset,o.byteLength)),!_.isBuffer(n)||!_.isBuffer(o))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===o)return 0;for(var t=n.length,a=o.length,c=0,i=Math.min(t,a);c<i;++c)if(n[c]!==o[c]){t=n[c],a=o[c];break}return t<a?-1:a<t?1:0};_.isEncoding=function(n){switch(String(n).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}};_.concat=function(n,o){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return _.alloc(0);var t;if(o===void 0)for(o=0,t=0;t<n.length;++t)o+=n[t].length;var a=_.allocUnsafe(o),c=0;for(t=0;t<n.length;++t){var i=n[t];if(z(i,Uint8Array))c+i.length>a.length?_.from(i).copy(a,c):Uint8Array.prototype.set.call(a,i,c);else if(_.isBuffer(i))i.copy(a,c);else throw new TypeError('"list" argument must be an Array of Buffers');c+=i.length}return a};function Uo(e,n){if(_.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(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 o=e.length,t=arguments.length>2&&arguments[2]===!0;if(!t&&o===0)return 0;for(var a=!1;;)switch(n){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":return xn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o*2;case"hex":return o>>>1;case"base64":return Ho(e).length;default:if(a)return t?-1:xn(e).length;n=(""+n).toLowerCase(),a=!0}}_.byteLength=Uo;function Oa(e,n,o){var t=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((o===void 0||o>this.length)&&(o=this.length),o<=0)||(o>>>=0,n>>>=0,o<=n))return"";for(e||(e="utf8");;)switch(e){case"hex":return Xa(this,n,o);case"utf8":case"utf-8":return Bo(this,n,o);case"ascii":return $a(this,n,o);case"latin1":case"binary":return Qa(this,n,o);case"base64":return Za(this,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ka(this,n,o);default:if(t)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),t=!0}}_.prototype._isBuffer=!0;function te(e,n,o){var t=e[n];e[n]=e[o],e[o]=t}_.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var o=0;o<n;o+=2)te(this,o,o+1);return this};_.prototype.swap32=function(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var o=0;o<n;o+=4)te(this,o,o+3),te(this,o+1,o+2);return this};_.prototype.swap64=function(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var o=0;o<n;o+=8)te(this,o,o+7),te(this,o+1,o+6),te(this,o+2,o+5),te(this,o+3,o+4);return this};_.prototype.toString=function(){var n=this.length;return n===0?"":arguments.length===0?Bo(this,0,n):Oa.apply(this,arguments)};_.prototype.toLocaleString=_.prototype.toString;_.prototype.equals=function(n){if(!_.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:_.compare(this,n)===0};_.prototype.inspect=function(){var n="",o=le.INSPECT_MAX_BYTES;return n=this.toString("hex",0,o).replace(/(.{2})/g,"$1 ").trim(),this.length>o&&(n+=" ... "),"<Buffer "+n+">"};Co&&(_.prototype[Co]=_.prototype.inspect);_.prototype.compare=function(n,o,t,a,c){if(z(n,Uint8Array)&&(n=_.from(n,n.offset,n.byteLength)),!_.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(o===void 0&&(o=0),t===void 0&&(t=n?n.length:0),a===void 0&&(a=0),c===void 0&&(c=this.length),o<0||t>n.length||a<0||c>this.length)throw new RangeError("out of range index");if(a>=c&&o>=t)return 0;if(a>=c)return-1;if(o>=t)return 1;if(o>>>=0,t>>>=0,a>>>=0,c>>>=0,this===n)return 0;for(var i=c-a,l=t-o,d=Math.min(i,l),g=this.slice(a,c),b=n.slice(o,t),u=0;u<d;++u)if(g[u]!==b[u]){i=g[u],l=b[u];break}return i<l?-1:l<i?1:0};function Oo(e,n,o,t,a){if(e.length===0)return-1;if(typeof o=="string"?(t=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,wn(o)&&(o=a?0:e.length-1),o<0&&(o=e.length+o),o>=e.length){if(a)return-1;o=e.length-1}else if(o<0)if(a)o=0;else return-1;if(typeof n=="string"&&(n=_.from(n,t)),_.isBuffer(n))return n.length===0?-1:Po(e,n,o,t,a);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e,n,o):Uint8Array.prototype.lastIndexOf.call(e,n,o):Po(e,[n],o,t,a);throw new TypeError("val must be string, number or Buffer")}function Po(e,n,o,t,a){var c=1,i=e.length,l=n.length;if(t!==void 0&&(t=String(t).toLowerCase(),t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le")){if(e.length<2||n.length<2)return-1;c=2,i/=2,l/=2,o/=2}function d(S,L){return c===1?S[L]:S.readUInt16BE(L*c)}var g;if(a){var b=-1;for(g=o;g<i;g++)if(d(e,g)===d(n,b===-1?0:g-b)){if(b===-1&&(b=g),g-b+1===l)return b*c}else b!==-1&&(g-=g-b),b=-1}else for(o+l>i&&(o=i-l),g=o;g>=0;g--){for(var u=!0,k=0;k<l;k++)if(d(e,g+k)!==d(n,k)){u=!1;break}if(u)return g}return-1}_.prototype.includes=function(n,o,t){return this.indexOf(n,o,t)!==-1};_.prototype.indexOf=function(n,o,t){return Oo(this,n,o,t,!0)};_.prototype.lastIndexOf=function(n,o,t){return Oo(this,n,o,t,!1)};function Ba(e,n,o,t){o=Number(o)||0;var a=e.length-o;t?(t=Number(t),t>a&&(t=a)):t=a;var c=n.length;t>c/2&&(t=c/2);for(var i=0;i<t;++i){var l=parseInt(n.substr(i*2,2),16);if(wn(l))return i;e[o+i]=l}return i}function Ga(e,n,o,t){return Pe(xn(n,e.length-o),e,o,t)}function Va(e,n,o,t){return Pe(ni(n),e,o,t)}function Wa(e,n,o,t){return Pe(Ho(n),e,o,t)}function Ha(e,n,o,t){return Pe(oi(n,e.length-o),e,o,t)}_.prototype.write=function(n,o,t,a){if(o===void 0)a="utf8",t=this.length,o=0;else if(t===void 0&&typeof o=="string")a=o,t=this.length,o=0;else if(isFinite(o))o=o>>>0,isFinite(t)?(t=t>>>0,a===void 0&&(a="utf8")):(a=t,t=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var c=this.length-o;if((t===void 0||t>c)&&(t=c),n.length>0&&(t<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return Ba(this,n,o,t);case"utf8":case"utf-8":return Ga(this,n,o,t);case"ascii":case"latin1":case"binary":return Va(this,n,o,t);case"base64":return Wa(this,n,o,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ha(this,n,o,t);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}};_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Za(e,n,o){return n===0&&o===e.length?un.fromByteArray(e):un.fromByteArray(e.slice(n,o))}function Bo(e,n,o){o=Math.min(e.length,o);for(var t=[],a=n;a<o;){var c=e[a],i=null,l=c>239?4:c>223?3:c>191?2:1;if(a+l<=o){var d,g,b,u;switch(l){case 1:c<128&&(i=c);break;case 2:d=e[a+1],(d&192)===128&&(u=(c&31)<<6|d&63,u>127&&(i=u));break;case 3:d=e[a+1],g=e[a+2],(d&192)===128&&(g&192)===128&&(u=(c&15)<<12|(d&63)<<6|g&63,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:d=e[a+1],g=e[a+2],b=e[a+3],(d&192)===128&&(g&192)===128&&(b&192)===128&&(u=(c&15)<<18|(d&63)<<12|(g&63)<<6|b&63,u>65535&&u<1114112&&(i=u))}}i===null?(i=65533,l=1):i>65535&&(i-=65536,t.push(i>>>10&1023|55296),i=56320|i&1023),t.push(i),a+=l}return Ya(t)}var Fo=4096;function Ya(e){var n=e.length;if(n<=Fo)return String.fromCharCode.apply(String,e);for(var o="",t=0;t<n;)o+=String.fromCharCode.apply(String,e.slice(t,t+=Fo));return o}function $a(e,n,o){var t="";o=Math.min(e.length,o);for(var a=n;a<o;++a)t+=String.fromCharCode(e[a]&127);return t}function Qa(e,n,o){var t="";o=Math.min(e.length,o);for(var a=n;a<o;++a)t+=String.fromCharCode(e[a]);return t}function Xa(e,n,o){var t=e.length;(!n||n<0)&&(n=0),(!o||o<0||o>t)&&(o=t);for(var a="",c=n;c<o;++c)a+=ti[e[c]];return a}function Ka(e,n,o){for(var t=e.slice(n,o),a="",c=0;c<t.length-1;c+=2)a+=String.fromCharCode(t[c]+t[c+1]*256);return a}_.prototype.slice=function(n,o){var t=this.length;n=~~n,o=o===void 0?t:~~o,n<0?(n+=t,n<0&&(n=0)):n>t&&(n=t),o<0?(o+=t,o<0&&(o=0)):o>t&&(o=t),o<n&&(o=n);var a=this.subarray(n,o);return Object.setPrototypeOf(a,_.prototype),a};function A(e,n,o){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+n>o)throw new RangeError("Trying to access beyond buffer length")}_.prototype.readUintLE=_.prototype.readUIntLE=function(n,o,t){n=n>>>0,o=o>>>0,t||A(n,o,this.length);for(var a=this[n],c=1,i=0;++i<o&&(c*=256);)a+=this[n+i]*c;return a};_.prototype.readUintBE=_.prototype.readUIntBE=function(n,o,t){n=n>>>0,o=o>>>0,t||A(n,o,this.length);for(var a=this[n+--o],c=1;o>0&&(c*=256);)a+=this[n+--o]*c;return a};_.prototype.readUint8=_.prototype.readUInt8=function(n,o){return n=n>>>0,o||A(n,1,this.length),this[n]};_.prototype.readUint16LE=_.prototype.readUInt16LE=function(n,o){return n=n>>>0,o||A(n,2,this.length),this[n]|this[n+1]<<8};_.prototype.readUint16BE=_.prototype.readUInt16BE=function(n,o){return n=n>>>0,o||A(n,2,this.length),this[n]<<8|this[n+1]};_.prototype.readUint32LE=_.prototype.readUInt32LE=function(n,o){return n=n>>>0,o||A(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216};_.prototype.readUint32BE=_.prototype.readUInt32BE=function(n,o){return n=n>>>0,o||A(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])};_.prototype.readIntLE=function(n,o,t){n=n>>>0,o=o>>>0,t||A(n,o,this.length);for(var a=this[n],c=1,i=0;++i<o&&(c*=256);)a+=this[n+i]*c;return c*=128,a>=c&&(a-=Math.pow(2,8*o)),a};_.prototype.readIntBE=function(n,o,t){n=n>>>0,o=o>>>0,t||A(n,o,this.length);for(var a=o,c=1,i=this[n+--a];a>0&&(c*=256);)i+=this[n+--a]*c;return c*=128,i>=c&&(i-=Math.pow(2,8*o)),i};_.prototype.readInt8=function(n,o){return n=n>>>0,o||A(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]};_.prototype.readInt16LE=function(n,o){n=n>>>0,o||A(n,2,this.length);var t=this[n]|this[n+1]<<8;return t&32768?t|4294901760:t};_.prototype.readInt16BE=function(n,o){n=n>>>0,o||A(n,2,this.length);var t=this[n+1]|this[n]<<8;return t&32768?t|4294901760:t};_.prototype.readInt32LE=function(n,o){return n=n>>>0,o||A(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24};_.prototype.readInt32BE=function(n,o){return n=n>>>0,o||A(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]};_.prototype.readFloatLE=function(n,o){return n=n>>>0,o||A(n,4,this.length),de.read(this,n,!0,23,4)};_.prototype.readFloatBE=function(n,o){return n=n>>>0,o||A(n,4,this.length),de.read(this,n,!1,23,4)};_.prototype.readDoubleLE=function(n,o){return n=n>>>0,o||A(n,8,this.length),de.read(this,n,!0,52,8)};_.prototype.readDoubleBE=function(n,o){return n=n>>>0,o||A(n,8,this.length),de.read(this,n,!1,52,8)};function D(e,n,o,t,a,c){if(!_.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>a||n<c)throw new RangeError('"value" argument is out of bounds');if(o+t>e.length)throw new RangeError("Index out of range")}_.prototype.writeUintLE=_.prototype.writeUIntLE=function(n,o,t,a){if(n=+n,o=o>>>0,t=t>>>0,!a){var c=Math.pow(2,8*t)-1;D(this,n,o,t,c,0)}var i=1,l=0;for(this[o]=n&255;++l<t&&(i*=256);)this[o+l]=n/i&255;return o+t};_.prototype.writeUintBE=_.prototype.writeUIntBE=function(n,o,t,a){if(n=+n,o=o>>>0,t=t>>>0,!a){var c=Math.pow(2,8*t)-1;D(this,n,o,t,c,0)}var i=t-1,l=1;for(this[o+i]=n&255;--i>=0&&(l*=256);)this[o+i]=n/l&255;return o+t};_.prototype.writeUint8=_.prototype.writeUInt8=function(n,o,t){return n=+n,o=o>>>0,t||D(this,n,o,1,255,0),this[o]=n&255,o+1};_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(n,o,t){return n=+n,o=o>>>0,t||D(this,n,o,2,65535,0),this[o]=n&255,this[o+1]=n>>>8,o+2};_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(n,o,t){return n=+n,o=o>>>0,t||D(this,n,o,2,65535,0),this[o]=n>>>8,this[o+1]=n&255,o+2};_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(n,o,t){return n=+n,o=o>>>0,t||D(this,n,o,4,4294967295,0),this[o+3]=n>>>24,this[o+2]=n>>>16,this[o+1]=n>>>8,this[o]=n&255,o+4};_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(n,o,t){return n=+n,o=o>>>0,t||D(this,n,o,4,4294967295,0),this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255,o+4};_.prototype.writeIntLE=function(n,o,t,a){if(n=+n,o=o>>>0,!a){var c=Math.pow(2,8*t-1);D(this,n,o,t,c-1,-c)}var i=0,l=1,d=0;for(this[o]=n&255;++i<t&&(l*=256);)n<0&&d===0&&this[o+i-1]!==0&&(d=1),this[o+i]=(n/l>>0)-d&255;return o+t};_.prototype.writeIntBE=function(n,o,t,a){if(n=+n,o=o>>>0,!a){var c=Math.pow(2,8*t-1);D(this,n,o,t,c-1,-c)}var i=t-1,l=1,d=0;for(this[o+i]=n&255;--i>=0&&(l*=256);)n<0&&d===0&&this[o+i+1]!==0&&(d=1),this[o+i]=(n/l>>0)-d&255;return o+t};_.prototype.writeInt8=function(n,o,t){return n=+n,o=o>>>0,t||D(this,n,o,1,127,-128),n<0&&(n=255+n+1),this[o]=n&255,o+1};_.prototype.writeInt16LE=function(n,o,t){return n=+n,o=o>>>0,t||D(this,n,o,2,32767,-32768),this[o]=n&255,this[o+1]=n>>>8,o+2};_.prototype.writeInt16BE=function(n,o,t){return n=+n,o=o>>>0,t||D(this,n,o,2,32767,-32768),this[o]=n>>>8,this[o+1]=n&255,o+2};_.prototype.writeInt32LE=function(n,o,t){return n=+n,o=o>>>0,t||D(this,n,o,4,2147483647,-2147483648),this[o]=n&255,this[o+1]=n>>>8,this[o+2]=n>>>16,this[o+3]=n>>>24,o+4};_.prototype.writeInt32BE=function(n,o,t){return n=+n,o=o>>>0,t||D(this,n,o,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255,o+4};function Go(e,n,o,t,a,c){if(o+t>e.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function Vo(e,n,o,t,a){return n=+n,o=o>>>0,a||Go(e,n,o,4,34028234663852886e22,-34028234663852886e22),de.write(e,n,o,t,23,4),o+4}_.prototype.writeFloatLE=function(n,o,t){return Vo(this,n,o,!0,t)};_.prototype.writeFloatBE=function(n,o,t){return Vo(this,n,o,!1,t)};function Wo(e,n,o,t,a){return n=+n,o=o>>>0,a||Go(e,n,o,8,17976931348623157e292,-17976931348623157e292),de.write(e,n,o,t,52,8),o+8}_.prototype.writeDoubleLE=function(n,o,t){return Wo(this,n,o,!0,t)};_.prototype.writeDoubleBE=function(n,o,t){return Wo(this,n,o,!1,t)};_.prototype.copy=function(n,o,t,a){if(!_.isBuffer(n))throw new TypeError("argument should be a Buffer");if(t||(t=0),!a&&a!==0&&(a=this.length),o>=n.length&&(o=n.length),o||(o=0),a>0&&a<t&&(a=t),a===t||n.length===0||this.length===0)return 0;if(o<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),n.length-o<a-t&&(a=n.length-o+t);var c=a-t;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(o,t,a):Uint8Array.prototype.set.call(n,this.subarray(t,a),o),c};_.prototype.fill=function(n,o,t,a){if(typeof n=="string"){if(typeof o=="string"?(a=o,o=0,t=this.length):typeof t=="string"&&(a=t,t=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!_.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(n.length===1){var c=n.charCodeAt(0);(a==="utf8"&&c<128||a==="latin1")&&(n=c)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(o<0||this.length<o||this.length<t)throw new RangeError("Out of range index");if(t<=o)return this;o=o>>>0,t=t===void 0?this.length:t>>>0,n||(n=0);var i;if(typeof n=="number")for(i=o;i<t;++i)this[i]=n;else{var l=_.isBuffer(n)?n:_.from(n,a),d=l.length;if(d===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(i=0;i<t-o;++i)this[i+o]=l[i%d]}return this};var Ja=/[^+/0-9A-Za-z-_]/g;function ei(e){if(e=e.split("=")[0],e=e.trim().replace(Ja,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function xn(e,n){n=n||1/0;for(var o,t=e.length,a=null,c=[],i=0;i<t;++i){if(o=e.charCodeAt(i),o>55295&&o<57344){if(!a){if(o>56319){(n-=3)>-1&&c.push(239,191,189);continue}else if(i+1===t){(n-=3)>-1&&c.push(239,191,189);continue}a=o;continue}if(o<56320){(n-=3)>-1&&c.push(239,191,189),a=o;continue}o=(a-55296<<10|o-56320)+65536}else a&&(n-=3)>-1&&c.push(239,191,189);if(a=null,o<128){if((n-=1)<0)break;c.push(o)}else if(o<2048){if((n-=2)<0)break;c.push(o>>6|192,o&63|128)}else if(o<65536){if((n-=3)<0)break;c.push(o>>12|224,o>>6&63|128,o&63|128)}else if(o<1114112){if((n-=4)<0)break;c.push(o>>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else throw new Error("Invalid code point")}return c}function ni(e){for(var n=[],o=0;o<e.length;++o)n.push(e.charCodeAt(o)&255);return n}function oi(e,n){for(var o,t,a,c=[],i=0;i<e.length&&!((n-=2)<0);++i)o=e.charCodeAt(i),t=o>>8,a=o%256,c.push(a),c.push(t);return c}function Ho(e){return un.toByteArray(ei(e))}function Pe(e,n,o,t){for(var a=0;a<t&&!(a+o>=n.length||a>=e.length);++a)n[a+o]=e[a];return a}function z(e,n){return e instanceof n||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===n.name}function wn(e){return e!==e}var ti=function(){for(var e="0123456789abcdef",n=new Array(256),o=0;o<16;++o)for(var t=o*16,a=0;a<16;++a)n[t+a]=e[o]+e[a];return n}()});var Ko=Ie((Fc,Xo)=>{r();var w=Xo.exports={},U,O;function qn(){throw new Error("setTimeout has not been defined")}function kn(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?U=setTimeout:U=qn}catch(e){U=qn}try{typeof clearTimeout=="function"?O=clearTimeout:O=kn}catch(e){O=kn}})();function Yo(e){if(U===setTimeout)return setTimeout(e,0);if((U===qn||!U)&&setTimeout)return U=setTimeout,setTimeout(e,0);try{return U(e,0)}catch(n){try{return U.call(null,e,0)}catch(o){return U.call(this,e,0)}}}function ri(e){if(O===clearTimeout)return clearTimeout(e);if((O===kn||!O)&&clearTimeout)return O=clearTimeout,clearTimeout(e);try{return O(e)}catch(n){try{return O.call(null,e)}catch(o){return O.call(this,e)}}}var G=[],ge=!1,re,Fe=-1;function ai(){!ge||!re||(ge=!1,re.length?G=re.concat(G):Fe=-1,G.length&&$o())}function $o(){if(!ge){var e=Yo(ai);ge=!0;for(var n=G.length;n;){for(re=G,G=[];++Fe<n;)re&&re[Fe].run();Fe=-1,n=G.length}re=null,ge=!1,ri(e)}}w.nextTick=function(e){var n=new Array(arguments.length-1);if(arguments.length>1)for(var o=1;o<arguments.length;o++)n[o-1]=arguments[o];G.push(new Qo(e,n)),G.length===1&&!ge&&Yo($o)};function Qo(e,n){this.fun=e,this.array=n}Qo.prototype.run=function(){this.fun.apply(null,this.array)};w.title="browser";w.browser=!0;w.env={};w.argv=[];w.version="";w.versions={};function V(){}w.on=V;w.addListener=V;w.once=V;w.off=V;w.removeListener=V;w.removeAllListeners=V;w.emit=V;w.prependListener=V;w.prependOnceListener=V;w.listeners=function(e){return[]};w.binding=function(e){throw new Error("process.binding is not supported")};w.cwd=function(){return"/"};w.chdir=function(e){throw new Error("process.chdir is not supported")};w.umask=function(){return 0}});var p,s,jc,r=h(()=>{p=y(Zo()),s=y(Ko()),jc=function(e){function n(){var t=this||self;return delete e.prototype.__magic__,t}if(typeof globalThis=="object")return globalThis;if(this)return n();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:n});var o=__magic__;return o}(Object)});var N=h(()=>{"use strict";r()});var je,vn=h(()=>{"use strict";r();je=()=>Date.now()/1e3});var Jo=h(()=>{"use strict";r()});var et=h(()=>{"use strict";r()});var nt=h(()=>{"use strict";r();vn();Jo();et()});var An={};_e(An,{getItem:()=>ci,localStorageKeys:()=>ae,removeItem:()=>pi,setItem:()=>ii});var ae,Sn,ii,ci,pi,qe=h(()=>{"use strict";r();nt();ae={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Sn=typeof localStorage!="undefined",ii=({key:e,data:n,expires:o})=>{!Sn||localStorage.setItem(String(e),JSON.stringify({expires:o,data:n}))},ci=e=>{if(!Sn)return;let n=localStorage.getItem(String(e));if(!n)return null;let o=JSON.parse(n);return!o||!o.hasOwnProperty("expires")||!o.hasOwnProperty("data")?null:je()>=o.expires?(localStorage.removeItem(String(e)),null):o.data},pi=e=>{!Sn||localStorage.removeItem(String(e))}});var Nn={};_e(Nn,{clear:()=>at,getItem:()=>tt,removeItem:()=>rt,setItem:()=>ot,storage:()=>si});var ot,tt,rt,at,si,ct=h(()=>{"use strict";r();ot=({key:e,data:n,expires:o})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:o,data:n}))},tt=e=>{let n=sessionStorage.getItem(String(e));if(!n)return null;let o=JSON.parse(n);return!o||!o.hasOwnProperty("expires")||!o.hasOwnProperty("data")?null:Date.now()>=o.expires?(sessionStorage.removeItem(String(e)),null):o.data},rt=e=>sessionStorage.removeItem(String(e)),at=()=>sessionStorage.clear(),si={setItem:ot,getItem:tt,removeItem:rt,clear:at}});var fe,ze=h(()=>{"use strict";r();qe();ct();fe={session:Nn,local:An}});function ke(){return new Date().setHours(new Date().getHours()+24)}function ve(e){fe.local.setItem({key:ae.loginExpiresAt,data:e,expires:e})}var En=h(()=>{"use strict";r();ze();qe()});var F=h(()=>{"use strict";r()});var pt=h(()=>{"use strict";r()});var st=h(()=>{"use strict";r()});var mt=h(()=>{"use strict";r()});var _t=h(()=>{"use strict";r()});var dt=h(()=>{"use strict";r()});var lt=h(()=>{"use strict";r()});var H=h(()=>{"use strict";r();st();N();F();mt();_t();dt();lt()});var Se,gt,dp,ft,lp,ut,gp,fp,up,ht=h(()=>{"use strict";r();H();Se={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:gt,egldLabel:dp}=Se["devnet"],{chainId:ft,egldLabel:lp}=Se["testnet"],{chainId:ut,egldLabel:gp}=Se["mainnet"],fp={["devnet"]:gt,["testnet"]:ft,["mainnet"]:ut},up={[gt]:"devnet",[ft]:"testnet",[ut]:"mainnet"}});var Dn=h(()=>{"use strict";r()});var bt=h(()=>{"use strict";r()});var xt,Mn=h(()=>{"use strict";r();xt="transaction-status-toast-id"});var In,Ln,yt,Ue,Tt,ue,v=h(()=>{"use strict";r();pt();ht();Dn();bt();Mn();In=5e4,Ln=1e9,yt=1,Ue="logout",Tt="login",ue="0"});var Rn,M,Oe,Z=h(()=>{"use strict";r();Rn=require("@reduxjs/toolkit");v();M=(0,Rn.createAction)(Ue),Oe=(0,Rn.createAction)(Tt,e=>({payload:e}))});var qt,wt,kt,Rp,Cp,Pp,Fp,jp,zp,vt,St,Cn=h(()=>{"use strict";r();qt=require("@reduxjs/toolkit");En();F();Z();wt={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},kt=(0,qt.createSlice)({name:"loginInfoSlice",initialState:wt,reducers:{setLoginMethod:(e,n)=>{e.loginMethod=n.payload},setTokenLogin:(e,n)=>{e.tokenLogin=n.payload},setTokenLoginSignature:(e,n)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=n.payload)},setWalletLogin:(e,n)=>{e.walletLogin=n.payload},setWalletConnectLogin:(e,n)=>{e.walletConnectLogin=n.payload},setLedgerLogin:(e,n)=>{e.ledgerLogin=n.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0}},extraReducers:e=>{e.addCase(M,()=>wt),e.addCase(Oe,(n,o)=>{n.loginMethod=o.payload.loginMethod,ve(ke())})}}),{setLoginMethod:Rp,setWalletConnectLogin:Cp,setLedgerLogin:Pp,setTokenLogin:Fp,setTokenLoginSignature:jp,setWalletLogin:zp,invalidateLoginSession:vt}=kt.actions,St=kt.reducer});var At=h(()=>{"use strict";r()});var Nt=h(()=>{"use strict";r();At()});function Pn(e){return e[Math.floor(Math.random()*e.length)]}var Et=h(()=>{"use strict";r()});var Dt=h(()=>{"use strict";r();Dn()});var Mt=h(()=>{"use strict";r();Nt();Et();Dt()});var It,Lt,Fn,_i,Rt,ns,os,Ct,jn=h(()=>{"use strict";r();It=require("@reduxjs/toolkit"),Lt=y(require("lodash.omit"));Mt();Fn={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},_i={network:Fn,chainID:"-1"},Rt=(0,It.createSlice)({name:"appConfig",initialState:_i,reducers:{initializeNetworkConfig:(e,n)=>{let o=Pn(n.payload.walletConnectBridgeAddresses),t=Pn(n.payload.walletConnectV2RelayAddresses),a=(0,Lt.default)(n.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=T(x(x({},e.network),a),{walletConnectBridgeAddress:o,walletConnectV2RelayAddress:t})},setChainID:(e,n)=>{e.chainID=n.payload}}}),{initializeNetworkConfig:ns,setChainID:os}=Rt.actions,Ct=Rt.reducer});var Un,Pt,Ft,Be,zn,jt,zt,ms,Ut,_s,ds,ls,gs,fs,us,hs,Ot,On=h(()=>{"use strict";r();Un=require("@elrondnetwork/erdjs"),Pt=require("@reduxjs/toolkit"),Ft=require("redux-persist");v();ze();qe();Z();Be={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:ue},zn={address:"",websocketEvent:null,accounts:{"":Be},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},jt=(0,Pt.createSlice)({name:"accountInfoSlice",initialState:zn,reducers:{setAddress:(e,n)=>{let o=n.payload;e.address=o,e.publicKey=new Un.Address(o).hex()},setAccount:(e,n)=>{let o=e.address===n.payload.address;e.accounts={[e.address]:o?n.payload:Be},e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,n)=>{let{address:o}=e;e.accounts[o].nonce=n.payload},setAccountShard:(e,n)=>{e.shard=n.payload},setLedgerAccount:(e,n)=>{e.ledgerAccount=n.payload},updateLedgerAccount:(e,n)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=n.payload.index,e.ledgerAccount.address=n.payload.address)},setWalletConnectAccount:(e,n)=>{e.walletConnectAccount=n.payload},setIsAccountLoading:(e,n)=>{e.isAccountLoading=n.payload,e.accountLoadingError=null},setAccountLoadingError:(e,n)=>{e.accountLoadingError=n.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,n)=>{e.websocketEvent={timestamp:Date.now(),message:n.payload}}},extraReducers:e=>{e.addCase(M,()=>(fe.local.removeItem(ae.loginExpiresAt),zn)),e.addCase(Oe,(n,o)=>{let{address:t}=o.payload;n.address=t,n.publicKey=new Un.Address(t).hex()}),e.addCase(Ft.REHYDRATE,(n,o)=>{var g;if(!((g=o.payload)!=null&&g.account))return;let{account:t}=o.payload,{address:a,shard:c,accounts:i,publicKey:l}=t;n.address=a,n.shard=c;let d=i&&a in i;n.accounts=d?i:zn.accounts,n.publicKey=l})}}),{setAccount:zt,setAddress:ms,setAccountNonce:Ut,setAccountShard:_s,setLedgerAccount:ds,updateLedgerAccount:ls,setWalletConnectAccount:gs,setIsAccountLoading:fs,setAccountLoadingError:us,setWebsocketEvent:hs}=jt.actions,Ot=jt.reducer});function Bt(e){return e!=null&&(yi(e)||ki(e))}function Ge(e){return e!=null&&(Ti(e)||vi(e))}function Ve(e){return e!=null&&(wi(e)||Si(e))}function Gt(e){return e!=null&&qi(e)}function yi(e){return e!=null&&li.includes(e)}function Ti(e){return e!=null&&gi.includes(e)}function wi(e){return e!=null&&fi.includes(e)}function qi(e){return e!=null&&ui.includes(e)}function ki(e){return e!=null&&hi.includes(e)}function vi(e){return e!=null&&bi.includes(e)}function Si(e){return e!=null&&xi.includes(e)}var li,gi,fi,ui,hi,bi,xi,Gn=h(()=>{"use strict";r();F();li=["sent"],gi=["success"],fi=["fail","cancelled","timedOut"],ui=["timedOut"],hi=["pending"],bi=["success"],xi=["fail","invalid"]});var Vt,Wt,Ae,Ai,Ht,Ss,As,Ns,Es,Ds,Ms,Is,Ls,Rs,Cs,We,He=h(()=>{"use strict";r();Vt=require("@reduxjs/toolkit"),Wt=require("redux-persist");F();Gn();Z();Ae={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Ai={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Ht=(0,Vt.createSlice)({name:"transactionsSlice",initialState:Ae,reducers:{moveTransactionsToSignedState:(e,n)=>{var d,g;let{sessionId:o,transactions:t,errorMessage:a,status:c,redirectRoute:i}=n.payload,l=((d=e.customTransactionInformationForSessionId)==null?void 0:d[o])||Ai;e.signedTransactions[o]={transactions:t,status:c,errorMessage:a,redirectRoute:i,customTransactionInformation:l},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===o&&(e.transactionsToSign=Ae.transactionsToSign)},clearSignedTransaction:(e,n)=>{e.signedTransactions[n.payload]&&delete e.signedTransactions[n.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,n)=>{e.signedTransactions=x(x({},e.signedTransactions),n.payload)},updateSignedTransactions:(e,n)=>{let{sessionId:o,status:t,errorMessage:a,transactions:c}=n.payload;e.signedTransactions[o]!=null&&(e.signedTransactions[o].status=t,a!=null&&(e.signedTransactions[o].errorMessage=a),c!=null&&(e.signedTransactions[o].transactions=c))},updateSignedTransactionStatus:(e,n)=>{var l,d,g,b,u,k;let{sessionId:o,status:t,errorMessage:a,transactionHash:c}=n.payload,i=(d=(l=e.signedTransactions)==null?void 0:l[o])==null?void 0:d.transactions;if(i!=null){e.signedTransactions[o].transactions=i.map(R=>R.hash===c?T(x({},R),{status:t,errorMessage:a}):R);let S=(b=(g=e.signedTransactions[o])==null?void 0:g.transactions)==null?void 0:b.every(R=>Ge(R.status)),L=(k=(u=e.signedTransactions[o])==null?void 0:u.transactions)==null?void 0:k.every(R=>Ve(R.status));S&&(e.signedTransactions[o].status="success"),L&&(e.signedTransactions[o].status="fail")}},setTransactionsToSign:(e,n)=>{e.transactionsToSign=n.payload;let{sessionId:o,customTransactionInformation:t}=n.payload;e.customTransactionInformationForSessionId[o]=t,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=Ae.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Ae.signedTransactions},setSignTransactionsError:(e,n)=>{e.signTransactionsError=n.payload},setSignTransactionsCancelMessage:(e,n)=>{e.signTransactionsCancelMessage=n.payload}},extraReducers:e=>{e.addCase(M,()=>Ae),e.addCase(Wt.REHYDRATE,(n,o)=>{var i;if(n.signTransactionsCancelMessage=null,!((i=o.payload)!=null&&i.transactions))return;let{signedTransactions:t,customTransactionInformationForSessionId:a}=o.payload.transactions,c=Object.entries(t).reduce((l,[d,g])=>{let b=new Date(d),u=new Date;return u.setHours(u.getHours()+5),u-b>0||(l[d]=g),l},{});a!=null&&(n.customTransactionInformationForSessionId=a),t!=null&&(n.signedTransactions=c)})}}),{updateSignedTransactionStatus:Ss,updateSignedTransactions:As,setTransactionsToSign:Ns,clearAllTransactionsToSign:Es,clearAllSignedTransactions:Ds,clearSignedTransaction:Ms,clearTransactionToSign:Is,setSignTransactionsError:Ls,setSignTransactionsCancelMessage:Rs,moveTransactionsToSignedState:Cs}=Ht.actions,We=Ht.reducer});var Zt,Wn,Hn,Zn,Ni,Vn,Yt,zs,Us,Os,Ze,Ye=h(()=>{"use strict";r();Zt=require("@reduxjs/toolkit");Z();Wn="Transaction failed",Hn="Transaction successful",Zn="Processing transaction",Ni="Transaction submitted",Vn={},Yt=(0,Zt.createSlice)({name:"transactionsInfo",initialState:Vn,reducers:{setTransactionsDisplayInfo(e,n){let{sessionId:o,transactionsDisplayInfo:t}=n.payload;o!=null&&(e[o]={errorMessage:(t==null?void 0:t.errorMessage)||Wn,successMessage:(t==null?void 0:t.successMessage)||Hn,processingMessage:(t==null?void 0:t.processingMessage)||Zn,submittedMessage:(t==null?void 0:t.submittedMessage)||Ni,transactionDuration:t==null?void 0:t.transactionDuration})},clearTransactionsInfoForSessionId(e,n){n.payload!=null&&delete e[n.payload]},clearTransactionsInfo:()=>Vn},extraReducers:e=>{e.addCase(M,()=>Vn)}}),{clearTransactionsInfo:zs,setTransactionsDisplayInfo:Us,clearTransactionsInfoForSessionId:Os}=Yt.actions,Ze=Yt.reducer});var Qt,$t,Xt,Ws,Hs,Zs,Ys,Kt,Yn=h(()=>{"use strict";r();Qt=require("@reduxjs/toolkit");Z();$t={},Xt=(0,Qt.createSlice)({name:"modalsSlice",initialState:$t,reducers:{setTxSubmittedModal:(e,n)=>{e.txSubmittedModal=n.payload},setNotificationModal:(e,n)=>{e.notificationModal=n.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(M,()=>$t)}}),{setTxSubmittedModal:Ws,setNotificationModal:Hs,clearTxSubmittedModal:Zs,clearNotificationModal:Ys}=Xt.actions,Kt=Xt.reducer});var er,nr,Jt,or,om,tm,rm,am,im,cm,$e,Qe=h(()=>{"use strict";r();er=require("@reduxjs/toolkit"),nr=require("redux-persist");Mn();H();vn();Z();Jt={customToasts:[],transactionToasts:[],failTransactionToast:null},or=(0,er.createSlice)({name:"toastsSlice",initialState:Jt,reducers:{addCustomToast:(e,n)=>{e.customToasts.push(T(x({},n.payload),{type:"custom",toastId:n.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,n)=>{e.customToasts=e.customToasts.filter(o=>o.toastId!==n.payload)},addTransactionToast:(e,n)=>{e.transactionToasts.push({type:"transaction",startTimestamp:je(),toastId:n.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,n)=>{e.transactionToasts=e.transactionToasts.filter(o=>o.toastId!==n.payload)},addFailTransactionToast:(e,n)=>{e.failTransactionToast=T(x({},n.payload),{toastId:xt})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(M,()=>Jt),e.addCase(nr.REHYDRATE,(n,o)=>{var a,c;let t=(c=(a=o.customToasts)==null?void 0:a.filter(i=>!("component"in i)))!=null?c:[];n.customToasts=t})}}),{addCustomToast:om,removeCustomToast:tm,addTransactionToast:rm,removeTransactionToast:am,addFailTransactionToast:im,removeFailTransactionToast:cm}=or.actions,$e=or.reducer});var he=h(()=>{"use strict";r();Cn();jn();On();He();Ye();Yn();Qe()});var $n=h(()=>{"use strict";r()});var ir,ar,cr,Am,Nm,Em,Dm,Mm,Im,pr,sr=h(()=>{"use strict";r();ir=require("@reduxjs/toolkit");Z();ar={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},cr=(0,ir.createSlice)({name:"dappModalsSlice",initialState:ar,reducers:{setDappModalVisibility:(e,n)=>{e.visible=n.payload},setDappModalHeaderVisibility:(e,n)=>{e.modal.showHeader=n.payload},setDappModalFooterVisibility:(e,n)=>{e.modal.showFooter=n.payload},setDappModalHeaderText:(e,n)=>{e.modal.headerText=n.payload},setDappModalFooterText:(e,n)=>{e.modal.footerText=n.payload},setDappModalConfig:(e,n)=>{e.modal=x({},n.payload)}},extraReducers:e=>{e.addCase(M,()=>ar)}}),{setDappModalVisibility:Am,setDappModalHeaderVisibility:Nm,setDappModalFooterVisibility:Em,setDappModalHeaderText:Dm,setDappModalFooterText:Mm,setDappModalConfig:Im}=cr.actions,pr=cr.reducer});var mr,Ii,Li,be,Ke=h(()=>{"use strict";r();mr=require("@reduxjs/toolkit");$n();On();sr();Cn();Yn();jn();Qe();Ye();He();Ii={["account"]:Ot,["networkConfig"]:Ct,["loginInfo"]:St,["modals"]:Kt,["dappModal"]:pr,["toasts"]:$e,["transactions"]:We,["transactionsInfo"]:Ze},Li=(e={})=>(0,mr.combineReducers)(x(x({},Ii),e)),be=Li});var lr={};_e(lr,{default:()=>Ui});function Qn(e,n=[]){return{key:e,version:1,storage:dr.default,blacklist:n}}var ie,_r,dr,Ri,Ci,Pi,Fi,ji,zi,Ui,gr=h(()=>{"use strict";r();ie=require("redux-persist"),_r=y(require("redux-persist/lib/storage")),dr=y(require("redux-persist/lib/storage/session"));Ke();he();Qe();Ye();He();$n();Ri={2:e=>T(x({},e),{networkConfig:Fn})};Ci=Qn("dapp-core-transactionsInfo"),Pi=Qn("dapp-core-transactions",["transactionsToSign"]),Fi=Qn("dapp-core-toasts"),ji={key:"dapp-core-store",version:2,storage:_r.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,ie.createMigrate)(Ri,{debug:!1})},zi={["toasts"]:(0,ie.persistReducer)(Fi,$e),["transactions"]:(0,ie.persistReducer)(Pi,We),["transactionsInfo"]:(0,ie.persistReducer)(Ci,Ze)},Ui=(0,ie.persistReducer)(ji,be(zi))});var fr={};_e(fr,{default:()=>Oi});var Oi,ur=h(()=>{"use strict";r();Ke();Oi=be()});var hr={};_e(hr,{default:()=>Gi});var P,Bi,Gi,br=h(()=>{"use strict";r();P=require("redux-persist"),Bi=[P.FLUSH,P.REHYDRATE,P.PAUSE,P.PERSIST,P.PURGE,P.REGISTER],Gi=Bi});var Tr={};_e(Tr,{default:()=>yr});function yr(e){return(0,xr.persistStore)(e)}var xr,wr=h(()=>{"use strict";r();xr=require("redux-persist")});r();var vo=y(require("react")),So=require("@testing-library/react");r();var ne=y(require("react")),dn=y(require("classnames"));N();r();r();var xo=y(require("react")),na=require("@fortawesome/free-solid-svg-icons"),oa=require("@fortawesome/react-fontawesome"),ta=y(require("classnames"));r();r();var Nr=require("react"),ye=require("react-redux");r();var Xn=require("@reduxjs/toolkit"),Sr=require("react-redux/es/utils/Subscription");he();r();var tr=y(require("lodash.throttle"));v();he();En();ze();qe();var Ei=[Ue],Di=(0,tr.default)(()=>{ve(ke())},5e3),rr=e=>n=>o=>{var d;if(Ei.includes(o.type))return n(o);let t=e.getState(),a=fe.local.getItem(ae.loginExpiresAt);if(!((d=t==null?void 0:t.loginInfo)==null?void 0:d.isLoggedIn))return n(o);if(a==null)return ve(ke());let i=Date.now();return a-i<0?setTimeout(()=>Do(void 0,null,function*(){console.log("session expired");try{e.dispatch(vt())}catch(g){console.error("error logging out",g)}}),1e3):(Di(),n(o))};r();r();function Xe(){return typeof sessionStorage!="undefined"}var qr=Xe()?(gr(),Le(lr)).default:(ur(),Le(fr)).default,kr=Xe()?(br(),Le(hr)).default:[],vr=Xe()?(wr(),Le(Tr)).default:e=>e;Ke();var xe=(0,Xn.configureStore)({reducer:qr,middleware:e=>e({serializableCheck:{ignoredActions:[...kr,Ut.type,zt.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(rr)}),Ar=(0,Sr.createSubscription)(xe),t_=vr(xe),r_=(0,Xn.configureStore)({reducer:be});var Vi={store:xe,subscription:Ar},Kn=(0,Nr.createContext)(Vi),p_=(0,ye.createStoreHook)(Kn),s_=(0,ye.createDispatchHook)(Kn),Er=(0,ye.createSelectorHook)(Kn);r();r();he();r();var Dr=y(require("lodash.isequal")),Je=require("reselect"),f=(0,Je.createSelectorCreator)(Je.defaultMemoize,Dr.default);var W=e=>e.account,Jn=f(W,e=>e.address),eo=f(W,Jn,(e,n)=>n in e.accounts?e.accounts[n]:Be),g_=f(W,eo,(e,n)=>{let a=e,{accounts:o}=a,t=me(a,["accounts"]);return T(x({},t),{account:n})}),f_=f(eo,e=>e.balance),u_=f(eo,e=>{var n;return((n=e==null?void 0:e.nonce)==null?void 0:n.valueOf())||0}),h_=f(W,e=>e.shard),b_=f(W,e=>e.ledgerAccount),x_=f(W,e=>e.walletConnectAccount),y_=f(W,e=>e.isAccountLoading),T_=f(W,e=>e.accountLoadingError),w_=f(W,e=>e.websocketEvent);r();var Y=e=>e.networkConfig,v_=f(Y,e=>e.chainID),S_=f(Y,e=>e.network.walletConnectBridgeAddress),A_=f(Y,e=>e.network.walletConnectV2RelayAddress),N_=f(Y,e=>e.network.walletConnectV2ProjectId),E_=f(Y,e=>e.network.walletConnectDeepLink),no=f(Y,e=>e.network),D_=f(no,e=>e.apiAddress),Mr=f(no,e=>e.explorerAddress),M_=f(no,e=>e.egldLabel);r();F();var Te=e=>e.loginInfo,P_=f(Te,e=>e.loginMethod),F_=f(Te,Jn,(e,n)=>e.loginMethod!=""&&Boolean(n)),j_=f(Te,e=>e.walletConnectLogin),z_=f(Te,e=>e.ledgerLogin),U_=f(Te,e=>e.walletLogin),O_=f(Te,e=>e.isLoginSessionInvalid);r();r();var I=require("@elrondnetwork/erdjs");v();r();function en(e){try{return p.Buffer.from(e,"base64").toString()===atob(e)}catch(n){return!1}}function oo(e){var a,c,i;let{data:n}=e,o=en(n!=null?n:"")?I.TransactionPayload.fromEncoded(n):new I.TransactionPayload(n),t=new I.Transaction(x({value:e.value.valueOf(),data:o,nonce:e.nonce.valueOf(),receiver:new I.Address(e.receiver),sender:new I.Address(e.sender),gasLimit:(a=e.gasLimit.valueOf())!=null?a:In,gasPrice:(c=e.gasPrice.valueOf())!=null?c:Ln,chainID:e.chainID.valueOf(),version:new I.TransactionVersion((i=e.version)!=null?i:yt)},e.options?{options:new I.TransactionOptions(e.options)}:{}));return t.applySignature({hex:()=>e.signature||""},new I.Address(e.sender)),t}r();Gn();r();var Wi=y(require("bignumber.js"));H();r();r();function to(e){for(let n=0;n<e.length;n++)if(e.charCodeAt(n)>127)return!1;return!0}function nn(e){let n=e;try{let o=p.Buffer.from(e,"hex").toString();to(o)&&o.length>1&&(n=o)}catch(o){}return n}r();r();var ao=require("@elrondnetwork/erdjs"),io=y(require("bignumber.js"));F();r();var Lr=require("@elrondnetwork/erdjs");function Hi(e){try{let n=new Lr.Address(e);return Boolean(n.bech32())}catch(n){return!1}}function $(e){return(e==null?void 0:e.startsWith("erd"))&&e.length===62&&/^\w+$/.test(e)&&Hi(e)}var ro={tokenId:"",amount:""},Zi=e=>e.split("@").map((c,i)=>[2,3].includes(i)?c:nn(c));function Rr(e){if(!e)return ro;let n=e.startsWith("ESDTTransfer"),o=e.startsWith("ESDTNFTTransfer")&&e.includes("@");if(n){let[,t,a]=e.split("@");try{let c=p.Buffer.from(t,"hex").toString("ascii");if(!c)return ro;let i=new io.default("0x"+a.replace("0x","")).toString(10);return{tokenId:c,amount:i}}catch(c){console.error("Error getting token from transaction data",c)}}if(o)try{let[,t,a,c,i]=Zi(e);if([t,a,c,i].every(l=>Boolean(l))&&$(new ao.Address(i).bech32()))return{tokenId:`${t}-${a}`,amount:new io.default(c,16).toString(10),collection:t,nonce:a,receiver:new ao.Address(i).bech32()}}catch(t){}return ro}r();r();r();var $i=require("@elrondnetwork/erdjs/out");r();v();r();var Ne=require("@elrondnetwork/erdjs");H();var Qi=["ESDTNFTTransfer","ESDTNFTBurn","ESDTNFTAddQuantity","ESDTNFTCreate","MultiESDTNFTTransfer","ESDTTransfer","ESDTBurn","ESDTLocalMint","ESDTLocalBurn","ESDTWipe","ESDTFreeze"];function Ee(e,n,o=""){if(!$(e))return!1;if(new Ne.Addr