@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 223 kB
JavaScript
"use strict";var ai=Object.create;var Ue=Object.defineProperty,ii=Object.defineProperties,ci=Object.getOwnPropertyDescriptor,pi=Object.getOwnPropertyDescriptors,si=Object.getOwnPropertyNames,oo=Object.getOwnPropertySymbols,mi=Object.getPrototypeOf,Fo=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable;var Wn=(e,o,n)=>o in e?Ue(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,y=(e,o)=>{for(var n in o||(o={}))Fo.call(o,n)&&Wn(e,n,o[n]);if(oo)for(var n of oo(o))Hn.call(o,n)&&Wn(e,n,o[n]);return e},q=(e,o)=>ii(e,pi(o));var we=(e,o)=>{var n={};for(var t in e)Fo.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&oo)for(var t of oo(e))o.indexOf(t)<0&&Hn.call(e,t)&&(n[t]=e[t]);return n};var b=(e,o)=>()=>(e&&(o=e(e=0)),o);var no=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),qe=(e,o)=>{for(var n in o)Ue(e,n,{get:o[n],enumerable:!0})},Zn=(e,o,n,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of si(o))!Fo.call(e,a)&&a!==n&&Ue(e,a,{get:()=>o[a],enumerable:!(t=ci(o,a))||t.enumerable});return e};var T=(e,o,n)=>(n=e!=null?ai(mi(e)):{},Zn(o||!e||!e.__esModule?Ue(n,"default",{value:e,enumerable:!0}):n,e)),to=e=>Zn(Ue({},"__esModule",{value:!0}),e);var Yn=(e,o,n)=>new Promise((t,a)=>{var i=_=>{try{l(n.next(_))}catch(g){a(g)}},c=_=>{try{l(n.throw(_))}catch(g){a(g)}},l=_=>_.done?t(_.value):Promise.resolve(_.value).then(i,c);l((n=n.apply(e,o)).next())});var Xn=no(ro=>{"use strict";r();ro.byteLength=_i;ro.toByteArray=gi;ro.fromByteArray=hi;var G=[],j=[],di=typeof Uint8Array!="undefined"?Uint8Array:Array,Po="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(me=0,$n=Po.length;me<$n;++me)G[me]=Po[me],j[Po.charCodeAt(me)]=me;var me,$n;j["-".charCodeAt(0)]=62;j["_".charCodeAt(0)]=63;function Qn(e){var o=e.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=o);var t=n===o?0:4-n%4;return[n,t]}function _i(e){var o=Qn(e),n=o[0],t=o[1];return(n+t)*3/4-t}function li(e,o,n){return(o+n)*3/4-n}function gi(e){var o,n=Qn(e),t=n[0],a=n[1],i=new di(li(e,t,a)),c=0,l=a>0?t-4:t,_;for(_=0;_<l;_+=4)o=j[e.charCodeAt(_)]<<18|j[e.charCodeAt(_+1)]<<12|j[e.charCodeAt(_+2)]<<6|j[e.charCodeAt(_+3)],i[c++]=o>>16&255,i[c++]=o>>8&255,i[c++]=o&255;return a===2&&(o=j[e.charCodeAt(_)]<<2|j[e.charCodeAt(_+1)]>>4,i[c++]=o&255),a===1&&(o=j[e.charCodeAt(_)]<<10|j[e.charCodeAt(_+1)]<<4|j[e.charCodeAt(_+2)]>>2,i[c++]=o>>8&255,i[c++]=o&255),i}function fi(e){return G[e>>18&63]+G[e>>12&63]+G[e>>6&63]+G[e&63]}function ui(e,o,n){for(var t,a=[],i=o;i<n;i+=3)t=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),a.push(fi(t));return a.join("")}function hi(e){for(var o,n=e.length,t=n%3,a=[],i=16383,c=0,l=n-t;c<l;c+=i)a.push(ui(e,c,c+i>l?l:c+i));return t===1?(o=e[n-1],a.push(G[o>>2]+G[o<<4&63]+"==")):t===2&&(o=(e[n-2]<<8)+e[n-1],a.push(G[o>>10]+G[o>>4&63]+G[o<<2&63]+"=")),a.join("")}});var Kn=no(zo=>{r();zo.read=function(e,o,n,t,a){var i,c,l=a*8-t-1,_=(1<<l)-1,g=_>>1,h=-7,u=n?a-1:0,w=n?-1:1,k=e[o+u];for(u+=w,i=k&(1<<-h)-1,k>>=-h,h+=l;h>0;i=i*256+e[o+u],u+=w,h-=8);for(c=i&(1<<-h)-1,i>>=-h,h+=t;h>0;c=c*256+e[o+u],u+=w,h-=8);if(i===0)i=1-g;else{if(i===_)return c?NaN:(k?-1:1)*(1/0);c=c+Math.pow(2,t),i=i-g}return(k?-1:1)*c*Math.pow(2,i-t)};zo.write=function(e,o,n,t,a,i){var c,l,_,g=i*8-a-1,h=(1<<g)-1,u=h>>1,w=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=t?0:i-1,M=t?1:-1,D=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(l=isNaN(o)?1:0,c=h):(c=Math.floor(Math.log(o)/Math.LN2),o*(_=Math.pow(2,-c))<1&&(c--,_*=2),c+u>=1?o+=w/_:o+=w*Math.pow(2,1-u),o*_>=2&&(c++,_/=2),c+u>=h?(l=0,c=h):c+u>=1?(l=(o*_-1)*Math.pow(2,a),c=c+u):(l=o*Math.pow(2,u-1)*Math.pow(2,a),c=0));a>=8;e[n+k]=l&255,k+=M,l/=256,a-=8);for(c=c<<a|l,g+=a;g>0;e[n+k]=c&255,k+=M,c/=256,g-=8);e[n+k-M]|=D*128}});var _t=no(ve=>{"use strict";r();var jo=Xn(),ke=Kn(),Jn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ve.Buffer=d;ve.SlowBuffer=qi;ve.INSPECT_MAX_BYTES=50;var ao=2147483647;ve.kMaxLength=ao;d.TYPED_ARRAY_SUPPORT=xi();!d.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 xi(){try{var e=new Uint8Array(1),o={foo:function(){return 42}};return Object.setPrototypeOf(o,Uint8Array.prototype),Object.setPrototypeOf(e,o),e.foo()===42}catch(n){return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(!!d.isBuffer(this))return this.buffer}});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(!!d.isBuffer(this))return this.byteOffset}});function Y(e){if(e>ao)throw new RangeError('The value "'+e+'" is invalid for option "size"');var o=new Uint8Array(e);return Object.setPrototypeOf(o,d.prototype),o}function d(e,o,n){if(typeof e=="number"){if(typeof o=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Vo(e)}return nt(e,o,n)}d.poolSize=8192;function nt(e,o,n){if(typeof e=="string")return yi(e,o);if(ArrayBuffer.isView(e))return Ti(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(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return Bo(e,o,n);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 d.from(t,o,n);var a=wi(e);if(a)return a;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return d.from(e[Symbol.toPrimitive]("string"),o,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}d.from=function(e,o,n){return nt(e,o,n)};Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function tt(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 bi(e,o,n){return tt(e),e<=0?Y(e):o!==void 0?typeof n=="string"?Y(e).fill(o,n):Y(e).fill(o):Y(e)}d.alloc=function(e,o,n){return bi(e,o,n)};function Vo(e){return tt(e),Y(e<0?0:Go(e)|0)}d.allocUnsafe=function(e){return Vo(e)};d.allocUnsafeSlow=function(e){return Vo(e)};function yi(e,o){if((typeof o!="string"||o==="")&&(o="utf8"),!d.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n=rt(e,o)|0,t=Y(n),a=t.write(e,o);return a!==n&&(t=t.slice(0,a)),t}function Uo(e){for(var o=e.length<0?0:Go(e.length)|0,n=Y(o),t=0;t<o;t+=1)n[t]=e[t]&255;return n}function Ti(e){if(W(e,Uint8Array)){var o=new Uint8Array(e);return Bo(o.buffer,o.byteOffset,o.byteLength)}return Uo(e)}function Bo(e,o,n){if(o<0||e.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<o+(n||0))throw new RangeError('"length" is outside of buffer bounds');var t;return o===void 0&&n===void 0?t=new Uint8Array(e):n===void 0?t=new Uint8Array(e,o):t=new Uint8Array(e,o,n),Object.setPrototypeOf(t,d.prototype),t}function wi(e){if(d.isBuffer(e)){var o=Go(e.length)|0,n=Y(o);return n.length===0||e.copy(n,0,0,o),n}if(e.length!==void 0)return typeof e.length!="number"||Wo(e.length)?Y(0):Uo(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Uo(e.data)}function Go(e){if(e>=ao)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ao.toString(16)+" bytes");return e|0}function qi(e){return+e!=e&&(e=0),d.alloc(+e)}d.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==d.prototype};d.compare=function(o,n){if(W(o,Uint8Array)&&(o=d.from(o,o.offset,o.byteLength)),W(n,Uint8Array)&&(n=d.from(n,n.offset,n.byteLength)),!d.isBuffer(o)||!d.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(o===n)return 0;for(var t=o.length,a=n.length,i=0,c=Math.min(t,a);i<c;++i)if(o[i]!==n[i]){t=o[i],a=n[i];break}return t<a?-1:a<t?1:0};d.isEncoding=function(o){switch(String(o).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}};d.concat=function(o,n){if(!Array.isArray(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return d.alloc(0);var t;if(n===void 0)for(n=0,t=0;t<o.length;++t)n+=o[t].length;var a=d.allocUnsafe(n),i=0;for(t=0;t<o.length;++t){var c=o[t];if(W(c,Uint8Array))i+c.length>a.length?d.from(c).copy(a,i):Uint8Array.prototype.set.call(a,c,i);else if(d.isBuffer(c))c.copy(a,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=c.length}return a};function rt(e,o){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(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 n=e.length,t=arguments.length>2&&arguments[2]===!0;if(!t&&n===0)return 0;for(var a=!1;;)switch(o){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Oo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return dt(e).length;default:if(a)return t?-1:Oo(e).length;o=(""+o).toLowerCase(),a=!0}}d.byteLength=rt;function ki(e,o,n){var t=!1;if((o===void 0||o<0)&&(o=0),o>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,o>>>=0,n<=o))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ci(this,o,n);case"utf8":case"utf-8":return ct(this,o,n);case"ascii":return Li(this,o,n);case"latin1":case"binary":return Ii(this,o,n);case"base64":return Di(this,o,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ri(this,o,n);default:if(t)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),t=!0}}d.prototype._isBuffer=!0;function de(e,o,n){var t=e[o];e[o]=e[n],e[n]=t}d.prototype.swap16=function(){var o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<o;n+=2)de(this,n,n+1);return this};d.prototype.swap32=function(){var o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<o;n+=4)de(this,n,n+3),de(this,n+1,n+2);return this};d.prototype.swap64=function(){var o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<o;n+=8)de(this,n,n+7),de(this,n+1,n+6),de(this,n+2,n+5),de(this,n+3,n+4);return this};d.prototype.toString=function(){var o=this.length;return o===0?"":arguments.length===0?ct(this,0,o):ki.apply(this,arguments)};d.prototype.toLocaleString=d.prototype.toString;d.prototype.equals=function(o){if(!d.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:d.compare(this,o)===0};d.prototype.inspect=function(){var o="",n=ve.INSPECT_MAX_BYTES;return o=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(o+=" ... "),"<Buffer "+o+">"};Jn&&(d.prototype[Jn]=d.prototype.inspect);d.prototype.compare=function(o,n,t,a,i){if(W(o,Uint8Array)&&(o=d.from(o,o.offset,o.byteLength)),!d.isBuffer(o))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof o);if(n===void 0&&(n=0),t===void 0&&(t=o?o.length:0),a===void 0&&(a=0),i===void 0&&(i=this.length),n<0||t>o.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&n>=t)return 0;if(a>=i)return-1;if(n>=t)return 1;if(n>>>=0,t>>>=0,a>>>=0,i>>>=0,this===o)return 0;for(var c=i-a,l=t-n,_=Math.min(c,l),g=this.slice(a,i),h=o.slice(n,t),u=0;u<_;++u)if(g[u]!==h[u]){c=g[u],l=h[u];break}return c<l?-1:l<c?1:0};function at(e,o,n,t,a){if(e.length===0)return-1;if(typeof n=="string"?(t=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Wo(n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0)if(a)n=0;else return-1;if(typeof o=="string"&&(o=d.from(o,t)),d.isBuffer(o))return o.length===0?-1:et(e,o,n,t,a);if(typeof o=="number")return o=o&255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e,o,n):Uint8Array.prototype.lastIndexOf.call(e,o,n):et(e,[o],n,t,a);throw new TypeError("val must be string, number or Buffer")}function et(e,o,n,t,a){var i=1,c=e.length,l=o.length;if(t!==void 0&&(t=String(t).toLowerCase(),t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le")){if(e.length<2||o.length<2)return-1;i=2,c/=2,l/=2,n/=2}function _(k,M){return i===1?k[M]:k.readUInt16BE(M*i)}var g;if(a){var h=-1;for(g=n;g<c;g++)if(_(e,g)===_(o,h===-1?0:g-h)){if(h===-1&&(h=g),g-h+1===l)return h*i}else h!==-1&&(g-=g-h),h=-1}else for(n+l>c&&(n=c-l),g=n;g>=0;g--){for(var u=!0,w=0;w<l;w++)if(_(e,g+w)!==_(o,w)){u=!1;break}if(u)return g}return-1}d.prototype.includes=function(o,n,t){return this.indexOf(o,n,t)!==-1};d.prototype.indexOf=function(o,n,t){return at(this,o,n,t,!0)};d.prototype.lastIndexOf=function(o,n,t){return at(this,o,n,t,!1)};function vi(e,o,n,t){n=Number(n)||0;var a=e.length-n;t?(t=Number(t),t>a&&(t=a)):t=a;var i=o.length;t>i/2&&(t=i/2);for(var c=0;c<t;++c){var l=parseInt(o.substr(c*2,2),16);if(Wo(l))return c;e[n+c]=l}return c}function Si(e,o,n,t){return io(Oo(o,e.length-n),e,n,t)}function Ai(e,o,n,t){return io(zi(o),e,n,t)}function Ni(e,o,n,t){return io(dt(o),e,n,t)}function Ei(e,o,n,t){return io(ji(o,e.length-n),e,n,t)}d.prototype.write=function(o,n,t,a){if(n===void 0)a="utf8",t=this.length,n=0;else if(t===void 0&&typeof n=="string")a=n,t=this.length,n=0;else if(isFinite(n))n=n>>>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 i=this.length-n;if((t===void 0||t>i)&&(t=i),o.length>0&&(t<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var c=!1;;)switch(a){case"hex":return vi(this,o,n,t);case"utf8":case"utf-8":return Si(this,o,n,t);case"ascii":case"latin1":case"binary":return Ai(this,o,n,t);case"base64":return Ni(this,o,n,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ei(this,o,n,t);default:if(c)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),c=!0}};d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Di(e,o,n){return o===0&&n===e.length?jo.fromByteArray(e):jo.fromByteArray(e.slice(o,n))}function ct(e,o,n){n=Math.min(e.length,n);for(var t=[],a=o;a<n;){var i=e[a],c=null,l=i>239?4:i>223?3:i>191?2:1;if(a+l<=n){var _,g,h,u;switch(l){case 1:i<128&&(c=i);break;case 2:_=e[a+1],(_&192)===128&&(u=(i&31)<<6|_&63,u>127&&(c=u));break;case 3:_=e[a+1],g=e[a+2],(_&192)===128&&(g&192)===128&&(u=(i&15)<<12|(_&63)<<6|g&63,u>2047&&(u<55296||u>57343)&&(c=u));break;case 4:_=e[a+1],g=e[a+2],h=e[a+3],(_&192)===128&&(g&192)===128&&(h&192)===128&&(u=(i&15)<<18|(_&63)<<12|(g&63)<<6|h&63,u>65535&&u<1114112&&(c=u))}}c===null?(c=65533,l=1):c>65535&&(c-=65536,t.push(c>>>10&1023|55296),c=56320|c&1023),t.push(c),a+=l}return Mi(t)}var ot=4096;function Mi(e){var o=e.length;if(o<=ot)return String.fromCharCode.apply(String,e);for(var n="",t=0;t<o;)n+=String.fromCharCode.apply(String,e.slice(t,t+=ot));return n}function Li(e,o,n){var t="";n=Math.min(e.length,n);for(var a=o;a<n;++a)t+=String.fromCharCode(e[a]&127);return t}function Ii(e,o,n){var t="";n=Math.min(e.length,n);for(var a=o;a<n;++a)t+=String.fromCharCode(e[a]);return t}function Ci(e,o,n){var t=e.length;(!o||o<0)&&(o=0),(!n||n<0||n>t)&&(n=t);for(var a="",i=o;i<n;++i)a+=Ui[e[i]];return a}function Ri(e,o,n){for(var t=e.slice(o,n),a="",i=0;i<t.length-1;i+=2)a+=String.fromCharCode(t[i]+t[i+1]*256);return a}d.prototype.slice=function(o,n){var t=this.length;o=~~o,n=n===void 0?t:~~n,o<0?(o+=t,o<0&&(o=0)):o>t&&(o=t),n<0?(n+=t,n<0&&(n=0)):n>t&&(n=t),n<o&&(n=o);var a=this.subarray(o,n);return Object.setPrototypeOf(a,d.prototype),a};function E(e,o,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+o>n)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(o,n,t){o=o>>>0,n=n>>>0,t||E(o,n,this.length);for(var a=this[o],i=1,c=0;++c<n&&(i*=256);)a+=this[o+c]*i;return a};d.prototype.readUintBE=d.prototype.readUIntBE=function(o,n,t){o=o>>>0,n=n>>>0,t||E(o,n,this.length);for(var a=this[o+--n],i=1;n>0&&(i*=256);)a+=this[o+--n]*i;return a};d.prototype.readUint8=d.prototype.readUInt8=function(o,n){return o=o>>>0,n||E(o,1,this.length),this[o]};d.prototype.readUint16LE=d.prototype.readUInt16LE=function(o,n){return o=o>>>0,n||E(o,2,this.length),this[o]|this[o+1]<<8};d.prototype.readUint16BE=d.prototype.readUInt16BE=function(o,n){return o=o>>>0,n||E(o,2,this.length),this[o]<<8|this[o+1]};d.prototype.readUint32LE=d.prototype.readUInt32LE=function(o,n){return o=o>>>0,n||E(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216};d.prototype.readUint32BE=d.prototype.readUInt32BE=function(o,n){return o=o>>>0,n||E(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])};d.prototype.readIntLE=function(o,n,t){o=o>>>0,n=n>>>0,t||E(o,n,this.length);for(var a=this[o],i=1,c=0;++c<n&&(i*=256);)a+=this[o+c]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*n)),a};d.prototype.readIntBE=function(o,n,t){o=o>>>0,n=n>>>0,t||E(o,n,this.length);for(var a=n,i=1,c=this[o+--a];a>0&&(i*=256);)c+=this[o+--a]*i;return i*=128,c>=i&&(c-=Math.pow(2,8*n)),c};d.prototype.readInt8=function(o,n){return o=o>>>0,n||E(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]};d.prototype.readInt16LE=function(o,n){o=o>>>0,n||E(o,2,this.length);var t=this[o]|this[o+1]<<8;return t&32768?t|4294901760:t};d.prototype.readInt16BE=function(o,n){o=o>>>0,n||E(o,2,this.length);var t=this[o+1]|this[o]<<8;return t&32768?t|4294901760:t};d.prototype.readInt32LE=function(o,n){return o=o>>>0,n||E(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24};d.prototype.readInt32BE=function(o,n){return o=o>>>0,n||E(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]};d.prototype.readFloatLE=function(o,n){return o=o>>>0,n||E(o,4,this.length),ke.read(this,o,!0,23,4)};d.prototype.readFloatBE=function(o,n){return o=o>>>0,n||E(o,4,this.length),ke.read(this,o,!1,23,4)};d.prototype.readDoubleLE=function(o,n){return o=o>>>0,n||E(o,8,this.length),ke.read(this,o,!0,52,8)};d.prototype.readDoubleBE=function(o,n){return o=o>>>0,n||E(o,8,this.length),ke.read(this,o,!1,52,8)};function R(e,o,n,t,a,i){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>a||o<i)throw new RangeError('"value" argument is out of bounds');if(n+t>e.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(o,n,t,a){if(o=+o,n=n>>>0,t=t>>>0,!a){var i=Math.pow(2,8*t)-1;R(this,o,n,t,i,0)}var c=1,l=0;for(this[n]=o&255;++l<t&&(c*=256);)this[n+l]=o/c&255;return n+t};d.prototype.writeUintBE=d.prototype.writeUIntBE=function(o,n,t,a){if(o=+o,n=n>>>0,t=t>>>0,!a){var i=Math.pow(2,8*t)-1;R(this,o,n,t,i,0)}var c=t-1,l=1;for(this[n+c]=o&255;--c>=0&&(l*=256);)this[n+c]=o/l&255;return n+t};d.prototype.writeUint8=d.prototype.writeUInt8=function(o,n,t){return o=+o,n=n>>>0,t||R(this,o,n,1,255,0),this[n]=o&255,n+1};d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(o,n,t){return o=+o,n=n>>>0,t||R(this,o,n,2,65535,0),this[n]=o&255,this[n+1]=o>>>8,n+2};d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(o,n,t){return o=+o,n=n>>>0,t||R(this,o,n,2,65535,0),this[n]=o>>>8,this[n+1]=o&255,n+2};d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(o,n,t){return o=+o,n=n>>>0,t||R(this,o,n,4,4294967295,0),this[n+3]=o>>>24,this[n+2]=o>>>16,this[n+1]=o>>>8,this[n]=o&255,n+4};d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(o,n,t){return o=+o,n=n>>>0,t||R(this,o,n,4,4294967295,0),this[n]=o>>>24,this[n+1]=o>>>16,this[n+2]=o>>>8,this[n+3]=o&255,n+4};d.prototype.writeIntLE=function(o,n,t,a){if(o=+o,n=n>>>0,!a){var i=Math.pow(2,8*t-1);R(this,o,n,t,i-1,-i)}var c=0,l=1,_=0;for(this[n]=o&255;++c<t&&(l*=256);)o<0&&_===0&&this[n+c-1]!==0&&(_=1),this[n+c]=(o/l>>0)-_&255;return n+t};d.prototype.writeIntBE=function(o,n,t,a){if(o=+o,n=n>>>0,!a){var i=Math.pow(2,8*t-1);R(this,o,n,t,i-1,-i)}var c=t-1,l=1,_=0;for(this[n+c]=o&255;--c>=0&&(l*=256);)o<0&&_===0&&this[n+c+1]!==0&&(_=1),this[n+c]=(o/l>>0)-_&255;return n+t};d.prototype.writeInt8=function(o,n,t){return o=+o,n=n>>>0,t||R(this,o,n,1,127,-128),o<0&&(o=255+o+1),this[n]=o&255,n+1};d.prototype.writeInt16LE=function(o,n,t){return o=+o,n=n>>>0,t||R(this,o,n,2,32767,-32768),this[n]=o&255,this[n+1]=o>>>8,n+2};d.prototype.writeInt16BE=function(o,n,t){return o=+o,n=n>>>0,t||R(this,o,n,2,32767,-32768),this[n]=o>>>8,this[n+1]=o&255,n+2};d.prototype.writeInt32LE=function(o,n,t){return o=+o,n=n>>>0,t||R(this,o,n,4,2147483647,-2147483648),this[n]=o&255,this[n+1]=o>>>8,this[n+2]=o>>>16,this[n+3]=o>>>24,n+4};d.prototype.writeInt32BE=function(o,n,t){return o=+o,n=n>>>0,t||R(this,o,n,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),this[n]=o>>>24,this[n+1]=o>>>16,this[n+2]=o>>>8,this[n+3]=o&255,n+4};function pt(e,o,n,t,a,i){if(n+t>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function st(e,o,n,t,a){return o=+o,n=n>>>0,a||pt(e,o,n,4,34028234663852886e22,-34028234663852886e22),ke.write(e,o,n,t,23,4),n+4}d.prototype.writeFloatLE=function(o,n,t){return st(this,o,n,!0,t)};d.prototype.writeFloatBE=function(o,n,t){return st(this,o,n,!1,t)};function mt(e,o,n,t,a){return o=+o,n=n>>>0,a||pt(e,o,n,8,17976931348623157e292,-17976931348623157e292),ke.write(e,o,n,t,52,8),n+8}d.prototype.writeDoubleLE=function(o,n,t){return mt(this,o,n,!0,t)};d.prototype.writeDoubleBE=function(o,n,t){return mt(this,o,n,!1,t)};d.prototype.copy=function(o,n,t,a){if(!d.isBuffer(o))throw new TypeError("argument should be a Buffer");if(t||(t=0),!a&&a!==0&&(a=this.length),n>=o.length&&(n=o.length),n||(n=0),a>0&&a<t&&(a=t),a===t||o.length===0||this.length===0)return 0;if(n<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),o.length-n<a-t&&(a=o.length-n+t);var i=a-t;return this===o&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,t,a):Uint8Array.prototype.set.call(o,this.subarray(t,a),n),i};d.prototype.fill=function(o,n,t,a){if(typeof o=="string"){if(typeof n=="string"?(a=n,n=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"&&!d.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(o.length===1){var i=o.charCodeAt(0);(a==="utf8"&&i<128||a==="latin1")&&(o=i)}}else typeof o=="number"?o=o&255:typeof o=="boolean"&&(o=Number(o));if(n<0||this.length<n||this.length<t)throw new RangeError("Out of range index");if(t<=n)return this;n=n>>>0,t=t===void 0?this.length:t>>>0,o||(o=0);var c;if(typeof o=="number")for(c=n;c<t;++c)this[c]=o;else{var l=d.isBuffer(o)?o:d.from(o,a),_=l.length;if(_===0)throw new TypeError('The value "'+o+'" is invalid for argument "value"');for(c=0;c<t-n;++c)this[c+n]=l[c%_]}return this};var Fi=/[^+/0-9A-Za-z-_]/g;function Pi(e){if(e=e.split("=")[0],e=e.trim().replace(Fi,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Oo(e,o){o=o||1/0;for(var n,t=e.length,a=null,i=[],c=0;c<t;++c){if(n=e.charCodeAt(c),n>55295&&n<57344){if(!a){if(n>56319){(o-=3)>-1&&i.push(239,191,189);continue}else if(c+1===t){(o-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(o-=3)>-1&&i.push(239,191,189),a=n;continue}n=(a-55296<<10|n-56320)+65536}else a&&(o-=3)>-1&&i.push(239,191,189);if(a=null,n<128){if((o-=1)<0)break;i.push(n)}else if(n<2048){if((o-=2)<0)break;i.push(n>>6|192,n&63|128)}else if(n<65536){if((o-=3)<0)break;i.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((o-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return i}function zi(e){for(var o=[],n=0;n<e.length;++n)o.push(e.charCodeAt(n)&255);return o}function ji(e,o){for(var n,t,a,i=[],c=0;c<e.length&&!((o-=2)<0);++c)n=e.charCodeAt(c),t=n>>8,a=n%256,i.push(a),i.push(t);return i}function dt(e){return jo.toByteArray(Pi(e))}function io(e,o,n,t){for(var a=0;a<t&&!(a+n>=o.length||a>=e.length);++a)o[a+n]=e[a];return a}function W(e,o){return e instanceof o||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===o.name}function Wo(e){return e!==e}var Ui=function(){for(var e="0123456789abcdef",o=new Array(256),n=0;n<16;++n)for(var t=n*16,a=0;a<16;++a)o[t+a]=e[n]+e[a];return o}()});var ht=no((Tp,ut)=>{r();var A=ut.exports={},H,Z;function Ho(){throw new Error("setTimeout has not been defined")}function Zo(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?H=setTimeout:H=Ho}catch(e){H=Ho}try{typeof clearTimeout=="function"?Z=clearTimeout:Z=Zo}catch(e){Z=Zo}})();function lt(e){if(H===setTimeout)return setTimeout(e,0);if((H===Ho||!H)&&setTimeout)return H=setTimeout,setTimeout(e,0);try{return H(e,0)}catch(o){try{return H.call(null,e,0)}catch(n){return H.call(this,e,0)}}}function Bi(e){if(Z===clearTimeout)return clearTimeout(e);if((Z===Zo||!Z)&&clearTimeout)return Z=clearTimeout,clearTimeout(e);try{return Z(e)}catch(o){try{return Z.call(null,e)}catch(n){return Z.call(this,e)}}}var $=[],Se=!1,_e,co=-1;function Oi(){!Se||!_e||(Se=!1,_e.length?$=_e.concat($):co=-1,$.length&>())}function gt(){if(!Se){var e=lt(Oi);Se=!0;for(var o=$.length;o;){for(_e=$,$=[];++co<o;)_e&&_e[co].run();co=-1,o=$.length}_e=null,Se=!1,Bi(e)}}A.nextTick=function(e){var o=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)o[n-1]=arguments[n];$.push(new ft(e,o)),$.length===1&&!Se&<(gt)};function ft(e,o){this.fun=e,this.array=o}ft.prototype.run=function(){this.fun.apply(null,this.array)};A.title="browser";A.browser=!0;A.env={};A.argv=[];A.version="";A.versions={};function Q(){}A.on=Q;A.addListener=Q;A.once=Q;A.off=Q;A.removeListener=Q;A.removeAllListeners=Q;A.emit=Q;A.prependListener=Q;A.prependOnceListener=Q;A.listeners=function(e){return[]};A.binding=function(e){throw new Error("process.binding is not supported")};A.cwd=function(){return"/"};A.chdir=function(e){throw new Error("process.chdir is not supported")};A.umask=function(){return 0}});var p,s,wp,r=b(()=>{p=T(_t()),s=T(ht()),wp=function(e){function o(){var t=this||self;return delete e.prototype.__magic__,t}if(typeof globalThis=="object")return globalThis;if(this)return o();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:o});var n=__magic__;return n}(Object)});var xt=b(()=>{"use strict";r()});var bt=b(()=>{"use strict";r()});var L=b(()=>{"use strict";r()});var O=b(()=>{"use strict";r()});var yt=b(()=>{"use strict";r()});var Tt=b(()=>{"use strict";r()});var wt=b(()=>{"use strict";r()});var qt=b(()=>{"use strict";r()});var te=b(()=>{"use strict";r();bt();L();O();yt();Tt();wt();qt()});var Be,kt,zp,vt,jp,St,At,Up,Bp,Nt=b(()=>{"use strict";r();te();Be={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:kt,egldLabel:zp}=Be["devnet"],{chainId:vt,egldLabel:jp}=Be["testnet"],{chainId:St,egldLabel:At}=Be["mainnet"],Up={["devnet"]:kt,["testnet"]:vt,["mainnet"]:St},Bp={[kt]:"devnet",[vt]:"testnet",[St]:"mainnet"}});var Yo=b(()=>{"use strict";r()});var Et=b(()=>{"use strict";r()});var Dt,$o=b(()=>{"use strict";r();Dt="transaction-status-toast-id"});var Qo,Xo,I,Ae,Mt,po,Lt,V,S=b(()=>{"use strict";r();xt();Nt();Yo();Et();$o();Qo=5e4,Xo=1e9,I=18,Ae=4,Mt=1,po="logout",Lt="login",V="0"});var uo,mn=b(()=>{"use strict";r();uo=()=>Date.now()/1e3});var pr=b(()=>{"use strict";r()});var sr=b(()=>{"use strict";r()});var mr=b(()=>{"use strict";r();mn();pr();sr()});var _n={};qe(_n,{getItem:()=>dc,localStorageKeys:()=>fe,removeItem:()=>_c,setItem:()=>mc});var fe,dn,mc,dc,_c,We=b(()=>{"use strict";r();mr();fe={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},dn=typeof localStorage!="undefined",mc=({key:e,data:o,expires:n})=>{!dn||localStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},dc=e=>{if(!dn)return;let o=localStorage.getItem(String(e));if(!o)return null;let n=JSON.parse(o);return!n||!n.hasOwnProperty("expires")||!n.hasOwnProperty("data")?null:uo()>=n.expires?(localStorage.removeItem(String(e)),null):n.data},_c=e=>{!dn||localStorage.removeItem(String(e))}});var ln={};qe(ln,{clear:()=>gr,getItem:()=>_r,removeItem:()=>lr,setItem:()=>dr,storage:()=>lc});var dr,_r,lr,gr,lc,fr=b(()=>{"use strict";r();dr=({key:e,data:o,expires:n})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:n,data:o}))},_r=e=>{let o=sessionStorage.getItem(String(e));if(!o)return null;let n=JSON.parse(o);return!n||!n.hasOwnProperty("expires")||!n.hasOwnProperty("data")?null:Date.now()>=n.expires?(sessionStorage.removeItem(String(e)),null):n.data},lr=e=>sessionStorage.removeItem(String(e)),gr=()=>sessionStorage.clear(),lc={setItem:dr,getItem:_r,removeItem:lr,clear:gr}});var De,ho=b(()=>{"use strict";r();We();fr();De={session:ln,local:_n}});function He(){return new Date().setHours(new Date().getHours()+24)}function Ze(e){De.local.setItem({key:fe.loginExpiresAt,data:e,expires:e})}var gn=b(()=>{"use strict";r();ho();We()});var fn,F,xo,ce=b(()=>{"use strict";r();fn=require("@reduxjs/toolkit");S();F=(0,fn.createAction)(po),xo=(0,fn.createAction)(Lt,e=>({payload:e}))});var hr,ur,xr,z_,j_,U_,B_,O_,V_,br,yr,un=b(()=>{"use strict";r();hr=require("@reduxjs/toolkit");gn();O();ce();ur={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},xr=(0,hr.createSlice)({name:"loginInfoSlice",initialState:ur,reducers:{setLoginMethod:(e,o)=>{e.loginMethod=o.payload},setTokenLogin:(e,o)=>{e.tokenLogin=o.payload},setTokenLoginSignature:(e,o)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=o.payload)},setWalletLogin:(e,o)=>{e.walletLogin=o.payload},setWalletConnectLogin:(e,o)=>{e.walletConnectLogin=o.payload},setLedgerLogin:(e,o)=>{e.ledgerLogin=o.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0}},extraReducers:e=>{e.addCase(F,()=>ur),e.addCase(xo,(o,n)=>{o.loginMethod=n.payload.loginMethod,Ze(He())})}}),{setLoginMethod:z_,setWalletConnectLogin:j_,setLedgerLogin:U_,setTokenLogin:B_,setTokenLoginSignature:O_,setWalletLogin:V_,invalidateLoginSession:br}=xr.actions,yr=xr.reducer});var Tr=b(()=>{"use strict";r()});var wr=b(()=>{"use strict";r();Tr()});function hn(e){return e[Math.floor(Math.random()*e.length)]}var qr=b(()=>{"use strict";r()});var kr=b(()=>{"use strict";r();Yo()});var vr=b(()=>{"use strict";r();wr();qr();kr()});var Sr,Ar,xn,fc,Nr,al,il,Er,bn=b(()=>{"use strict";r();Sr=require("@reduxjs/toolkit"),Ar=T(require("lodash.omit"));vr();xn={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},fc={network:xn,chainID:"-1"},Nr=(0,Sr.createSlice)({name:"appConfig",initialState:fc,reducers:{initializeNetworkConfig:(e,o)=>{let n=hn(o.payload.walletConnectBridgeAddresses),t=hn(o.payload.walletConnectV2RelayAddresses),a=(0,Ar.default)(o.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=q(y(y({},e.network),a),{walletConnectBridgeAddress:n,walletConnectV2RelayAddress:t})},setChainID:(e,o)=>{e.chainID=o.payload}}}),{initializeNetworkConfig:al,setChainID:il}=Nr.actions,Er=Nr.reducer});var Tn,Dr,Mr,bo,yn,Lr,Ir,gl,Cr,fl,ul,hl,xl,bl,yl,Tl,Rr,wn=b(()=>{"use strict";r();Tn=require("@elrondnetwork/erdjs"),Dr=require("@reduxjs/toolkit"),Mr=require("redux-persist");S();ho();We();ce();bo={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:V},yn={address:"",websocketEvent:null,accounts:{"":bo},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},Lr=(0,Dr.createSlice)({name:"accountInfoSlice",initialState:yn,reducers:{setAddress:(e,o)=>{let n=o.payload;e.address=n,e.publicKey=new Tn.Address(n).hex()},setAccount:(e,o)=>{let n=e.address===o.payload.address;e.accounts={[e.address]:n?o.payload:bo},e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,o)=>{let{address:n}=e;e.accounts[n].nonce=o.payload},setAccountShard:(e,o)=>{e.shard=o.payload},setLedgerAccount:(e,o)=>{e.ledgerAccount=o.payload},updateLedgerAccount:(e,o)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=o.payload.index,e.ledgerAccount.address=o.payload.address)},setWalletConnectAccount:(e,o)=>{e.walletConnectAccount=o.payload},setIsAccountLoading:(e,o)=>{e.isAccountLoading=o.payload,e.accountLoadingError=null},setAccountLoadingError:(e,o)=>{e.accountLoadingError=o.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,o)=>{e.websocketEvent={timestamp:Date.now(),message:o.payload}}},extraReducers:e=>{e.addCase(F,()=>(De.local.removeItem(fe.loginExpiresAt),yn)),e.addCase(xo,(o,n)=>{let{address:t}=n.payload;o.address=t,o.publicKey=new Tn.Address(t).hex()}),e.addCase(Mr.REHYDRATE,(o,n)=>{var g;if(!((g=n.payload)!=null&&g.account))return;let{account:t}=n.payload,{address:a,shard:i,accounts:c,publicKey:l}=t;o.address=a,o.shard=i;let _=c&&a in c;o.accounts=_?c:yn.accounts,o.publicKey=l})}}),{setAccount:Ir,setAddress:gl,setAccountNonce:Cr,setAccountShard:fl,setLedgerAccount:ul,updateLedgerAccount:hl,setWalletConnectAccount:xl,setIsAccountLoading:bl,setAccountLoadingError:yl,setWebsocketEvent:Tl}=Lr.actions,Rr=Lr.reducer});function Fr(e){return e!=null&&(kc(e)||Nc(e))}function yo(e){return e!=null&&(vc(e)||Ec(e))}function To(e){return e!=null&&(Sc(e)||Dc(e))}function Pr(e){return e!=null&&Ac(e)}function kc(e){return e!=null&&hc.includes(e)}function vc(e){return e!=null&&xc.includes(e)}function Sc(e){return e!=null&&bc.includes(e)}function Ac(e){return e!=null&&yc.includes(e)}function Nc(e){return e!=null&&Tc.includes(e)}function Ec(e){return e!=null&&wc.includes(e)}function Dc(e){return e!=null&&qc.includes(e)}var hc,xc,bc,yc,Tc,wc,qc,kn=b(()=>{"use strict";r();O();hc=["sent"],xc=["success"],bc=["fail","cancelled","timedOut"],yc=["timedOut"],Tc=["pending"],wc=["success"],qc=["fail","invalid"]});var zr,jr,Ye,Mc,Ur,Dl,Ml,Ll,Il,Cl,Rl,Fl,Pl,zl,jl,wo,qo=b(()=>{"use strict";r();zr=require("@reduxjs/toolkit"),jr=require("redux-persist");O();kn();ce();Ye={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Mc={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Ur=(0,zr.createSlice)({name:"transactionsSlice",initialState:Ye,reducers:{moveTransactionsToSignedState:(e,o)=>{var _,g;let{sessionId:n,transactions:t,errorMessage:a,status:i,redirectRoute:c}=o.payload,l=((_=e.customTransactionInformationForSessionId)==null?void 0:_[n])||Mc;e.signedTransactions[n]={transactions:t,status:i,errorMessage:a,redirectRoute:c,customTransactionInformation:l},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===n&&(e.transactionsToSign=Ye.transactionsToSign)},clearSignedTransaction:(e,o)=>{e.signedTransactions[o.payload]&&delete e.signedTransactions[o.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,o)=>{e.signedTransactions=y(y({},e.signedTransactions),o.payload)},updateSignedTransactions:(e,o)=>{let{sessionId:n,status:t,errorMessage:a,transactions:i}=o.payload;e.signedTransactions[n]!=null&&(e.signedTransactions[n].status=t,a!=null&&(e.signedTransactions[n].errorMessage=a),i!=null&&(e.signedTransactions[n].transactions=i))},updateSignedTransactionStatus:(e,o)=>{var l,_,g,h,u,w;let{sessionId:n,status:t,errorMessage:a,transactionHash:i}=o.payload,c=(_=(l=e.signedTransactions)==null?void 0:l[n])==null?void 0:_.transactions;if(c!=null){e.signedTransactions[n].transactions=c.map(D=>D.hash===i?q(y({},D),{status:t,errorMessage:a}):D);let k=(h=(g=e.signedTransactions[n])==null?void 0:g.transactions)==null?void 0:h.every(D=>yo(D.status)),M=(w=(u=e.signedTransactions[n])==null?void 0:u.transactions)==null?void 0:w.every(D=>To(D.status));k&&(e.signedTransactions[n].status="success"),M&&(e.signedTransactions[n].status="fail")}},setTransactionsToSign:(e,o)=>{e.transactionsToSign=o.payload;let{sessionId:n,customTransactionInformation:t}=o.payload;e.customTransactionInformationForSessionId[n]=t,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=Ye.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=Ye.signedTransactions},setSignTransactionsError:(e,o)=>{e.signTransactionsError=o.payload},setSignTransactionsCancelMessage:(e,o)=>{e.signTransactionsCancelMessage=o.payload}},extraReducers:e=>{e.addCase(F,()=>Ye),e.addCase(jr.REHYDRATE,(o,n)=>{var c;if(o.signTransactionsCancelMessage=null,!((c=n.payload)!=null&&c.transactions))return;let{signedTransactions:t,customTransactionInformationForSessionId:a}=n.payload.transactions,i=Object.entries(t).reduce((l,[_,g])=>{let h=new Date(_),u=new Date;return u.setHours(u.getHours()+5),u-h>0||(l[_]=g),l},{});a!=null&&(o.customTransactionInformationForSessionId=a),t!=null&&(o.signedTransactions=i)})}}),{updateSignedTransactionStatus:Dl,updateSignedTransactions:Ml,setTransactionsToSign:Ll,clearAllTransactionsToSign:Il,clearAllSignedTransactions:Cl,clearSignedTransaction:Rl,clearTransactionToSign:Fl,setSignTransactionsError:Pl,setSignTransactionsCancelMessage:zl,moveTransactionsToSignedState:jl}=Ur.actions,wo=Ur.reducer});var Br,Sn,An,Nn,Lc,vn,Or,Vl,Gl,Wl,ko,vo=b(()=>{"use strict";r();Br=require("@reduxjs/toolkit");ce();Sn="Transaction failed",An="Transaction successful",Nn="Processing transaction",Lc="Transaction submitted",vn={},Or=(0,Br.createSlice)({name:"transactionsInfo",initialState:vn,reducers:{setTransactionsDisplayInfo(e,o){let{sessionId:n,transactionsDisplayInfo:t}=o.payload;n!=null&&(e[n]={errorMessage:(t==null?void 0:t.errorMessage)||Sn,successMessage:(t==null?void 0:t.successMessage)||An,processingMessage:(t==null?void 0:t.processingMessage)||Nn,submittedMessage:(t==null?void 0:t.submittedMessage)||Lc,transactionDuration:t==null?void 0:t.transactionDuration})},clearTransactionsInfoForSessionId(e,o){o.payload!=null&&delete e[o.payload]},clearTransactionsInfo:()=>vn},extraReducers:e=>{e.addCase(F,()=>vn)}}),{clearTransactionsInfo:Vl,setTransactionsDisplayInfo:Gl,clearTransactionsInfoForSessionId:Wl}=Or.actions,ko=Or.reducer});var Gr,Vr,Wr,$l,Ql,Xl,Kl,Hr,En=b(()=>{"use strict";r();Gr=require("@reduxjs/toolkit");ce();Vr={},Wr=(0,Gr.createSlice)({name:"modalsSlice",initialState:Vr,reducers:{setTxSubmittedModal:(e,o)=>{e.txSubmittedModal=o.payload},setNotificationModal:(e,o)=>{e.notificationModal=o.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(F,()=>Vr)}}),{setTxSubmittedModal:$l,setNotificationModal:Ql,clearTxSubmittedModal:Xl,clearNotificationModal:Kl}=Wr.actions,Hr=Wr.reducer});var Yr,$r,Zr,Qr,ig,cg,pg,sg,mg,dg,So,Ao=b(()=>{"use strict";r();Yr=require("@reduxjs/toolkit"),$r=require("redux-persist");$o();te();mn();ce();Zr={customToasts:[],transactionToasts:[],failTransactionToast:null},Qr=(0,Yr.createSlice)({name:"toastsSlice",initialState:Zr,reducers:{addCustomToast:(e,o)=>{e.customToasts.push(q(y({},o.payload),{type:"custom",toastId:o.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,o)=>{e.customToasts=e.customToasts.filter(n=>n.toastId!==o.payload)},addTransactionToast:(e,o)=>{e.transactionToasts.push({type:"transaction",startTimestamp:uo(),toastId:o.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,o)=>{e.transactionToasts=e.transactionToasts.filter(n=>n.toastId!==o.payload)},addFailTransactionToast:(e,o)=>{e.failTransactionToast=q(y({},o.payload),{toastId:Dt})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(F,()=>Zr),e.addCase($r.REHYDRATE,(o,n)=>{var a,i;let t=(i=(a=n.customToasts)==null?void 0:a.filter(c=>!("component"in c)))!=null?i:[];o.customToasts=t})}}),{addCustomToast:ig,removeCustomToast:cg,addTransactionToast:pg,removeTransactionToast:sg,addFailTransactionToast:mg,removeFailTransactionToast:dg}=Qr.actions,So=Qr.reducer});var Me=b(()=>{"use strict";r();un();bn();wn();qo();vo();En();Ao()});var Dn=b(()=>{"use strict";r()});var ea,Jr,oa,Mg,Lg,Ig,Cg,Rg,Fg,na,ta=b(()=>{"use strict";r();ea=require("@reduxjs/toolkit");ce();Jr={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},oa=(0,ea.createSlice)({name:"dappModalsSlice",initialState:Jr,reducers:{setDappModalVisibility:(e,o)=>{e.visible=o.payload},setDappModalHeaderVisibility:(e,o)=>{e.modal.showHeader=o.payload},setDappModalFooterVisibility:(e,o)=>{e.modal.showFooter=o.payload},setDappModalHeaderText:(e,o)=>{e.modal.headerText=o.payload},setDappModalFooterText:(e,o)=>{e.modal.footerText=o.payload},setDappModalConfig:(e,o)=>{e.modal=y({},o.payload)}},extraReducers:e=>{e.addCase(F,()=>Jr)}}),{setDappModalVisibility:Mg,setDappModalHeaderVisibility:Lg,setDappModalFooterVisibility:Ig,setDappModalHeaderText:Cg,setDappModalFooterText:Rg,setDappModalConfig:Fg}=oa.actions,na=oa.reducer});var ra,Fc,Pc,Le,Eo=b(()=>{"use strict";r();ra=require("@reduxjs/toolkit");Dn();wn();ta();un();En();bn();Ao();vo();qo();Fc={["account"]:Rr,["networkConfig"]:Er,["loginInfo"]:yr,["modals"]:Hr,["dappModal"]:na,["toasts"]:So,["transactions"]:wo,["transactionsInfo"]:ko},Pc=(e={})=>(0,ra.combineReducers)(y(y({},Fc),e)),Le=Pc});var ca={};qe(ca,{default:()=>Gc});function Mn(e,o=[]){return{key:e,version:1,storage:ia.default,blacklist:o}}var ue,aa,ia,zc,jc,Uc,Bc,Oc,Vc,Gc,pa=b(()=>{"use strict";r();ue=require("redux-persist"),aa=T(require("redux-persist/lib/storage")),ia=T(require("redux-persist/lib/storage/session"));Eo();Me();Ao();vo();qo();Dn();zc={2:e=>q(y({},e),{networkConfig:xn})};jc=Mn("dapp-core-transactionsInfo"),Uc=Mn("dapp-core-transactions",["transactionsToSign"]),Bc=Mn("dapp-core-toasts"),Oc={key:"dapp-core-store",version:2,storage:aa.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,ue.createMigrate)(zc,{debug:!1})},Vc={["toasts"]:(0,ue.persistReducer)(Bc,So),["transactions"]:(0,ue.persistReducer)(Uc,wo),["transactionsInfo"]:(0,ue.persistReducer)(jc,ko)},Gc=(0,ue.persistReducer)(Oc,Le(Vc))});var sa={};qe(sa,{default:()=>Wc});var Wc,ma=b(()=>{"use strict";r();Eo();Wc=Le()});var da={};qe(da,{default:()=>Zc});var U,Hc,Zc,_a=b(()=>{"use strict";r();U=require("redux-persist"),Hc=[U.FLUSH,U.REHYDRATE,U.PAUSE,U.PERSIST,U.PURGE,U.REGISTER],Zc=Hc});var fa={};qe(fa,{default:()=>ga});function ga(e){return(0,la.persistStore)(e)}var la,ua=b(()=>{"use strict";r();la=require("redux-persist")});r();var ei=T(require("react")),oi=require("@testing-library/react");r();S();r();r();var Oe=require("@elrondnetwork/erdjs");te();r();var It=require("@elrondnetwork/erdjs");function Vi(e){try{let o=new It.Address(e);return Boolean(o.bech32())}catch(o){return!1}}function le(e){return(e==null?void 0:e.startsWith("erd"))&&e.length===62&&/^\w+$/.test(e)&&Vi(e)}r();function so(e){try{return p.Buffer.from(e,"base64").toString()===atob(e)}catch(o){return!1}}var Gi=["ESDTNFTTransfer","ESDTNFTBurn","ESDTNFTAddQuantity","ESDTNFTCreate","MultiESDTNFTTransfer","ESDTTransfer","ESDTBurn","ESDTLocalMint","ESDTLocalBurn","ESDTWipe","ESDTFreeze"];function Ve(e,o,n=""){if(!le(e))return!1;if(new Oe.Address(e).isContractAddress())return!0;let i=Ct({receiver:e,data:n});return i?new Oe.Address(i).isContractAddress()||Zi(e,o,n):!1}var Wi=e=>e.toLowerCase().match(/[0-9a-f]/g),Hi=e=>e.length%2===0;function Zi(e,o,n){let t=n==null?void 0:n.split("@");if(t==null)return!1;let[a,...i]=t,c=o!=null&&e!=null&&e===o,l=Gi.includes(a),_=i.every(g=>Wi(g)&&Hi(g));return c&&l&&_}function Ct({receiver:e,data:o}){try{if(!o)return e;let n=so(o)?Oe.TransactionPayload.fromEncoded(o).toString():o,t=Yi(n),a=n.split("@");return t>-1?a[t]:e}catch(n){console.log(n);return}}function Yi(e){return e.includes("MultiESDTNFTTransfer")?1:e.includes("ESDTNFTTransfer")?4:-1}r();var en=require("@elrondnetwork/erdjs"),on=T(require("bignumber.js"));O();r();r();function Ko(e){for(let o=0;o<e.length;o++)if(e.charCodeAt(o)>127)return!1;return!0}function mo(e){let o=e;try{let n=p.Buffer.from(e,"hex").toString();Ko(n)&&n.length>1&&(o=n)}catch(n){}return o}var Jo={tokenId:"",amount:""},$i=e=>e.split("@").map((i,c)=>[2,3].includes(c)?i:mo(i));function Ft(e){if(!e)return Jo;let o=e.startsWith("ESDTTransfer"),n=e.startsWith("ESDTNFTTransfer")&&e.includes("@");if(o){let[,t,a]=e.split("@");try{let i=p.Buffer.from(t,"hex").toString("ascii");if(!i)return Jo;let c=new on.default("0x"+a.replace("0x","")).toString(10);return{tokenId:i,amount:c}}catch(i){console.error("Error getting token from transaction data",i)}}if(n)try{let[,t,a,i,c]=$i(e);if([t,a,i,c].every(l=>Boolean(l))&&le(new en.Address(c).bech32()))return{tokenId:`${t}-${a}`,amount:new on.default(i,16).toString(10),collection:t,nonce:a,receiver:new en.Address(c).bech32()}}catch(t){}return Jo}r();r();r();var re="accounts",ge="transactions";var Ne="tokens",Pt="blocks";var zt="nodes",jt="identities",Ut="collections",nn="nfts",tn="providers",rn="sc-results",Bt="contracts",Ot="logs",Vt="code",Gt="locked-accounts",Wt="roles";var C={shard:e=>`/${Pt}?shard=${e}`,receiverShard:e=>`/${ge}?receivershard=${e}`,senderShard:e=>`/${ge}?sendershard=${e}`,transactionDetails:e=>`/${ge}/${e}`,transactionDetailsScResults:e=>`/${ge}/${e}/${rn}`,transactionDetailsLogs:e=>`/${ge}/${e}/${Ot}`,nodeDetails:e=>`/${zt}/${e}`,accountDetails:e=>`/${re}/${e}`,accountDetailsContractCode:e=>`/${re}/${e}/${Vt}`,accountDetailsTokens:e=>`/${re}/${e}/${Ne}`,accountDetailsNfts:e=>`/${re}/${e}/${nn}`,accountDetailsScResults:e=>`/${re}/${e}/${rn}`,accountDetailsContracts:e=>`/${re}/${e}/${Bt}`,identityDetails:e=>`/${jt}/${e}`,tokenDetails:e=>`/${Ne}/${e}`,tokenDetailsAccounts:e=>`/${Ne}/${e}/${re}`,tokenDetailsLockedAccounts:e=>`/${Ne}/${e}/${Gt}`,tokenDetailsRoles:e=>`/${Ne}/${e}/${Wt}`,collectionDetails:e=>`/${Ut}/${e}`,nftDetails:e=>`/${nn}/${e}`,providerDetails:e=>`/${tn}/${e}`,providerDetailsTransactions:e=>`/${tn}/${e}/${ge}`};r();var an=e=>{var o,n,t,a;if(e.action){let i=[(o=e.action.arguments)==null?void 0:o.token,(n=e.action.arguments)==null?void 0:n.token1,(t=e.action.arguments)==null?void 0:t.token2,(a=e.action.arguments)==null?void 0:a.transfers].filter(l=>l!=null);return[].concat(...i)}return[]};r();r();function _o(e){var n,t;let o=e.receiver;return(t=(n=e.action)==null?void 0:n.arguments)!=null&&t.receiver&&(o=e.action.arguments.receiver),o}function Ht(e){let o=_o(e);return e.receiver===o?e.receiverAssets:void 0}r();L();var Zt=e=>{var t,a,i,c,l,_;let o="Transaction";return((t=e.action)==null?void 0:t.name)&&((a=e.action)==null?void 0:a.category)&&(((i=e.action)==null?void 0:i.category)==="esdtNft"&&((c=e.action)==null?void 0:c.name)==="transfer"?o="Transaction":e.action&&(o=e.action.name),(_=(l=e.action)==null?void 0:l.arguments)!=null&&_.functionName&&(o=e.action.arguments.functionName)),o};r();var Yt=!1;function Xi(e){Yt||(console.error(e),Yt=!0)}function ae({explorerAddress:e,to:o}){try{return new URL(o).href}catch(n){return o.startsWith("/")||(Xi(`Link not prepended by / : ${o}`),o=`/${o}`),e?`${e}${o}`:o}}r();L();function Qt(e,o,n){let t=e===o.sender,a=e===n,i=t&&a,c=(o==null?void 0:o.type)==="SmartContractResult";switch(!0){case c:return"Internal";case i:return"Self";case a:return"In";case t:default:return"Out"}}r();r();r();var Ki=T(require("bignumber.js"));S();r();var Kt=require("@elrondnetwork/erdjs"),ie=T(require("bignumber.js"));S();r();var Xt=T(require("bignumber.js")),Ge=(e,o=!0)=>{let n=String(e);if(!n.match(/^[-]?\d+$/))return!1;let t=new Xt.default(n),a=o?0:-1;return t.toString(10)===n&&t.comparedTo(0)>=a};r(