UNPKG

@sofaws/dapp-core

Version:

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

14 lines (13 loc) 45.1 kB
"use strict";var zr=Object.create;var X=Object.defineProperty,jr=Object.defineProperties,Zr=Object.getOwnPropertyDescriptor,Kr=Object.getOwnPropertyDescriptors,Yr=Object.getOwnPropertyNames,Ue=Object.getOwnPropertySymbols,Xr=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty,Qr=Object.prototype.propertyIsEnumerable;var Me=(r,e,t)=>e in r?X(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ge=(r,e)=>{for(var t in e||(e={}))$e.call(e,t)&&Me(r,t,e[t]);if(Ue)for(var t of Ue(e))Qr.call(e,t)&&Me(r,t,e[t]);return r},fe=(r,e)=>jr(r,Kr(e));var Jr=(r,e)=>()=>(r&&(e=r(r=0)),e);var te=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),et=(r,e)=>{for(var t in e)X(r,t,{get:e[t],enumerable:!0})},Ge=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Yr(e))!$e.call(r,i)&&i!==t&&X(r,i,{get:()=>e[i],enumerable:!(n=Zr(e,i))||n.enumerable});return r};var I=(r,e,t)=>(t=r!=null?zr(Xr(r)):{},Ge(e||!r||!r.__esModule?X(t,"default",{value:r,enumerable:!0}):t,r)),rt=r=>Ge(X({},"__esModule",{value:!0}),r);var He=te(ne=>{"use strict";s();ne.byteLength=nt;ne.toByteArray=ot;ne.fromByteArray=ct;var A=[],E=[],tt=typeof Uint8Array!="undefined"?Uint8Array:Array,he="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for($=0,Ve=he.length;$<Ve;++$)A[$]=he[$],E[he.charCodeAt($)]=$;var $,Ve;E["-".charCodeAt(0)]=62;E["_".charCodeAt(0)]=63;function qe(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function nt(r){var e=qe(r),t=e[0],n=e[1];return(t+n)*3/4-n}function it(r,e,t){return(e+t)*3/4-t}function ot(r){var e,t=qe(r),n=t[0],i=t[1],o=new tt(it(r,n,i)),a=0,l=i>0?n-4:n,p;for(p=0;p<l;p+=4)e=E[r.charCodeAt(p)]<<18|E[r.charCodeAt(p+1)]<<12|E[r.charCodeAt(p+2)]<<6|E[r.charCodeAt(p+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return i===2&&(e=E[r.charCodeAt(p)]<<2|E[r.charCodeAt(p+1)]>>4,o[a++]=e&255),i===1&&(e=E[r.charCodeAt(p)]<<10|E[r.charCodeAt(p+1)]<<4|E[r.charCodeAt(p+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function at(r){return A[r>>18&63]+A[r>>12&63]+A[r>>6&63]+A[r&63]}function st(r,e,t){for(var n,i=[],o=e;o<t;o+=3)n=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),i.push(at(n));return i.join("")}function ct(r){for(var e,t=r.length,n=t%3,i=[],o=16383,a=0,l=t-n;a<l;a+=o)i.push(st(r,a,a+o>l?l:a+o));return n===1?(e=r[t-1],i.push(A[e>>2]+A[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(A[e>>10]+A[e>>4&63]+A[e<<2&63]+"=")),i.join("")}});var We=te(ye=>{s();ye.read=function(r,e,t,n,i){var o,a,l=i*8-n-1,p=(1<<l)-1,g=p>>1,f=-7,h=t?i-1:0,y=t?-1:1,x=r[e+h];for(h+=y,o=x&(1<<-f)-1,x>>=-f,f+=l;f>0;o=o*256+r[e+h],h+=y,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=a*256+r[e+h],h+=y,f-=8);if(o===0)o=1-g;else{if(o===p)return a?NaN:(x?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-g}return(x?-1:1)*a*Math.pow(2,o-n)};ye.write=function(r,e,t,n,i,o){var a,l,p,g=o*8-i-1,f=(1<<g)-1,h=f>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=n?0:o-1,b=n?1:-1,k=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+h>=1?e+=y/p:e+=y*Math.pow(2,1-h),e*p>=2&&(a++,p/=2),a+h>=f?(l=0,a=f):a+h>=1?(l=(e*p-1)*Math.pow(2,i),a=a+h):(l=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;r[t+x]=l&255,x+=b,l/=256,i-=8);for(a=a<<i|l,g+=i;g>0;r[t+x]=a&255,x+=b,a/=256,g-=8);r[t+x-b]|=k*128}});var ir=te(z=>{"use strict";s();var xe=He(),W=We(),ze=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;z.Buffer=c;z.SlowBuffer=gt;z.INSPECT_MAX_BYTES=50;var ie=2147483647;z.kMaxLength=ie;c.TYPED_ARRAY_SUPPORT=lt();!c.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 lt(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch(t){return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(!!c.isBuffer(this))return this.buffer}});Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(!!c.isBuffer(this))return this.byteOffset}});function L(r){if(r>ie)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,c.prototype),e}function c(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ve(r)}return Ke(r,e,t)}c.poolSize=8192;function Ke(r,e,t){if(typeof r=="string")return pt(r,e);if(ArrayBuffer.isView(r))return dt(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(N(r,ArrayBuffer)||r&&N(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(N(r,SharedArrayBuffer)||r&&N(r.buffer,SharedArrayBuffer)))return we(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return c.from(n,e,t);var i=mt(r);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return c.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}c.from=function(r,e,t){return Ke(r,e,t)};Object.setPrototypeOf(c.prototype,Uint8Array.prototype);Object.setPrototypeOf(c,Uint8Array);function Ye(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function ut(r,e,t){return Ye(r),r<=0?L(r):e!==void 0?typeof t=="string"?L(r).fill(e,t):L(r).fill(e):L(r)}c.alloc=function(r,e,t){return ut(r,e,t)};function ve(r){return Ye(r),L(r<0?0:ke(r)|0)}c.allocUnsafe=function(r){return ve(r)};c.allocUnsafeSlow=function(r){return ve(r)};function pt(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=Xe(r,e)|0,n=L(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}function Te(r){for(var e=r.length<0?0:ke(r.length)|0,t=L(e),n=0;n<e;n+=1)t[n]=r[n]&255;return t}function dt(r){if(N(r,Uint8Array)){var e=new Uint8Array(r);return we(e.buffer,e.byteOffset,e.byteLength)}return Te(r)}function we(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&t===void 0?n=new Uint8Array(r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf(n,c.prototype),n}function mt(r){if(c.isBuffer(r)){var e=ke(r.length)|0,t=L(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||Ee(r.length)?L(0):Te(r);if(r.type==="Buffer"&&Array.isArray(r.data))return Te(r.data)}function ke(r){if(r>=ie)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ie.toString(16)+" bytes");return r|0}function gt(r){return+r!=r&&(r=0),c.alloc(+r)}c.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==c.prototype};c.compare=function(e,t){if(N(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,i=t.length,o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==t[o]){n=e[o],i=t[o];break}return n<i?-1:i<n?1:0};c.isEncoding=function(e){switch(String(e).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}};c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return c.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=c.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(N(a,Uint8Array))o+a.length>i.length?c.from(a).copy(i,o):Uint8Array.prototype.set.call(i,a,o);else if(c.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function Xe(r,e){if(c.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||N(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return be(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return nr(r).length;default:if(i)return n?-1:be(r).length;e=(""+e).toLowerCase(),i=!0}}c.byteLength=Xe;function ft(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return St(this,e,t);case"utf8":case"utf-8":return Je(this,e,t);case"ascii":return kt(this,e,t);case"latin1":case"binary":return Et(this,e,t);case"base64":return bt(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return It(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}c.prototype._isBuffer=!0;function G(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}c.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)G(this,t,t+1);return this};c.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)G(this,t,t+3),G(this,t+1,t+2);return this};c.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)G(this,t,t+7),G(this,t+1,t+6),G(this,t+2,t+5),G(this,t+3,t+4);return this};c.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?Je(this,0,e):ft.apply(this,arguments)};c.prototype.toLocaleString=c.prototype.toString;c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:c.compare(this,e)===0};c.prototype.inspect=function(){var e="",t=z.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"};ze&&(c.prototype[ze]=c.prototype.inspect);c.prototype.compare=function(e,t,n,i,o){if(N(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var a=o-i,l=n-t,p=Math.min(a,l),g=this.slice(i,o),f=e.slice(t,n),h=0;h<p;++h)if(g[h]!==f[h]){a=g[h],l=f[h];break}return a<l?-1:l<a?1:0};function Qe(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Ee(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=c.from(e,n)),c.isBuffer(e))return e.length===0?-1:je(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):je(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function je(r,e,t,n,i){var o=1,a=r.length,l=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;o=2,a/=2,l/=2,t/=2}function p(x,b){return o===1?x[b]:x.readUInt16BE(b*o)}var g;if(i){var f=-1;for(g=t;g<a;g++)if(p(r,g)===p(e,f===-1?0:g-f)){if(f===-1&&(f=g),g-f+1===l)return f*o}else f!==-1&&(g-=g-f),f=-1}else for(t+l>a&&(t=a-l),g=t;g>=0;g--){for(var h=!0,y=0;y<l;y++)if(p(r,g+y)!==p(e,y)){h=!1;break}if(h)return g}return-1}c.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1};c.prototype.indexOf=function(e,t,n){return Qe(this,e,t,n,!0)};c.prototype.lastIndexOf=function(e,t,n){return Qe(this,e,t,n,!1)};function ht(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var l=parseInt(e.substr(a*2,2),16);if(Ee(l))return a;r[t+a]=l}return a}function yt(r,e,t,n){return oe(be(e,r.length-t),r,t,n)}function xt(r,e,t,n){return oe(Dt(e),r,t,n)}function Tt(r,e,t,n){return oe(nr(e),r,t,n)}function wt(r,e,t,n){return oe(_t(e,r.length-t),r,t,n)}c.prototype.write=function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return ht(this,e,t,n);case"utf8":case"utf-8":return yt(this,e,t,n);case"ascii":case"latin1":case"binary":return xt(this,e,t,n);case"base64":return Tt(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wt(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function bt(r,e,t){return e===0&&t===r.length?xe.fromByteArray(r):xe.fromByteArray(r.slice(e,t))}function Je(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var o=r[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(i+l<=t){var p,g,f,h;switch(l){case 1:o<128&&(a=o);break;case 2:p=r[i+1],(p&192)===128&&(h=(o&31)<<6|p&63,h>127&&(a=h));break;case 3:p=r[i+1],g=r[i+2],(p&192)===128&&(g&192)===128&&(h=(o&15)<<12|(p&63)<<6|g&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:p=r[i+1],g=r[i+2],f=r[i+3],(p&192)===128&&(g&192)===128&&(f&192)===128&&(h=(o&15)<<18|(p&63)<<12|(g&63)<<6|f&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=l}return vt(n)}var Ze=4096;function vt(r){var e=r.length;if(e<=Ze)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=Ze));return t}function kt(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}function Et(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function St(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",o=e;o<t;++o)i+=Rt[r[o]];return i}function It(r,e,t){for(var n=r.slice(e,t),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}c.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i=this.subarray(e,t);return Object.setPrototypeOf(i,c.prototype),i};function w(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||w(e,t,this.length);for(var i=this[e],o=1,a=0;++a<t&&(o*=256);)i+=this[e+a]*o;return i};c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||w(e,t,this.length);for(var i=this[e+--t],o=1;t>0&&(o*=256);)i+=this[e+--t]*o;return i};c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e=e>>>0,t||w(e,1,this.length),this[e]};c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||w(e,2,this.length),this[e]|this[e+1]<<8};c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||w(e,2,this.length),this[e]<<8|this[e+1]};c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||w(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};c.prototype.readIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||w(e,t,this.length);for(var i=this[e],o=1,a=0;++a<t&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i};c.prototype.readIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||w(e,t,this.length);for(var i=t,o=1,a=this[e+--i];i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*t)),a};c.prototype.readInt8=function(e,t){return e=e>>>0,t||w(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};c.prototype.readInt16LE=function(e,t){e=e>>>0,t||w(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};c.prototype.readInt16BE=function(e,t){e=e>>>0,t||w(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};c.prototype.readInt32LE=function(e,t){return e=e>>>0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};c.prototype.readInt32BE=function(e,t){return e=e>>>0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};c.prototype.readFloatLE=function(e,t){return e=e>>>0,t||w(e,4,this.length),W.read(this,e,!0,23,4)};c.prototype.readFloatBE=function(e,t){return e=e>>>0,t||w(e,4,this.length),W.read(this,e,!1,23,4)};c.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||w(e,8,this.length),W.read(this,e,!0,52,8)};c.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||w(e,8,this.length),W.read(this,e,!1,52,8)};function v(r,e,t,n,i,o){if(!c.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;v(this,e,t,n,o,0)}var a=1,l=0;for(this[t]=e&255;++l<n&&(a*=256);)this[t+l]=e/a&255;return t+n};c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;v(this,e,t,n,o,0)}var a=n-1,l=1;for(this[t+a]=e&255;--a>=0&&(l*=256);)this[t+a]=e/l&255;return t+n};c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t=t>>>0,n||v(this,e,t,1,255,0),this[t]=e&255,t+1};c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||v(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||v(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||v(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||v(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};c.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t>>>0,!i){var o=Math.pow(2,8*n-1);v(this,e,t,n,o-1,-o)}var a=0,l=1,p=0;for(this[t]=e&255;++a<n&&(l*=256);)e<0&&p===0&&this[t+a-1]!==0&&(p=1),this[t+a]=(e/l>>0)-p&255;return t+n};c.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t>>>0,!i){var o=Math.pow(2,8*n-1);v(this,e,t,n,o-1,-o)}var a=n-1,l=1,p=0;for(this[t+a]=e&255;--a>=0&&(l*=256);)e<0&&p===0&&this[t+a+1]!==0&&(p=1),this[t+a]=(e/l>>0)-p&255;return t+n};c.prototype.writeInt8=function(e,t,n){return e=+e,t=t>>>0,n||v(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};c.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||v(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};c.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||v(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};c.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||v(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};c.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||v(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function er(r,e,t,n,i,o){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function rr(r,e,t,n,i){return e=+e,t=t>>>0,i||er(r,e,t,4,34028234663852886e22,-34028234663852886e22),W.write(r,e,t,n,23,4),t+4}c.prototype.writeFloatLE=function(e,t,n){return rr(this,e,t,!0,n)};c.prototype.writeFloatBE=function(e,t,n){return rr(this,e,t,!1,n)};function tr(r,e,t,n,i){return e=+e,t=t>>>0,i||er(r,e,t,8,17976931348623157e292,-17976931348623157e292),W.write(r,e,t,n,52,8),t+8}c.prototype.writeDoubleLE=function(e,t,n){return tr(this,e,t,!0,n)};c.prototype.writeDoubleBE=function(e,t,n){return tr(this,e,t,!1,n)};c.prototype.copy=function(e,t,n,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),t),o};c.prototype.fill=function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){var o=e.charCodeAt(0);(i==="utf8"&&o<128||i==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var a;if(typeof e=="number")for(a=t;a<n;++a)this[a]=e;else{var l=c.isBuffer(e)?e:c.from(e,i),p=l.length;if(p===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<n-t;++a)this[a+t]=l[a%p]}return this};var At=/[^+/0-9A-Za-z-_]/g;function Nt(r){if(r=r.split("=")[0],r=r.trim().replace(At,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function be(r,e){e=e||1/0;for(var t,n=r.length,i=null,o=[],a=0;a<n;++a){if(t=r.charCodeAt(a),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&o.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;o.push(t)}else if(t<2048){if((e-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function Dt(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function _t(r,e){for(var t,n,i,o=[],a=0;a<r.length&&!((e-=2)<0);++a)t=r.charCodeAt(a),n=t>>8,i=t%256,o.push(i),o.push(n);return o}function nr(r){return xe.toByteArray(Nt(r))}function oe(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function N(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function Ee(r){return r!==r}var Rt=function(){for(var r="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var n=t*16,i=0;i<16;++i)e[n+i]=r[t]+r[i];return e}()});var lr=te((wn,cr)=>{s();var T=cr.exports={},D,_;function Se(){throw new Error("setTimeout has not been defined")}function Ie(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?D=setTimeout:D=Se}catch(r){D=Se}try{typeof clearTimeout=="function"?_=clearTimeout:_=Ie}catch(r){_=Ie}})();function or(r){if(D===setTimeout)return setTimeout(r,0);if((D===Se||!D)&&setTimeout)return D=setTimeout,setTimeout(r,0);try{return D(r,0)}catch(e){try{return D.call(null,r,0)}catch(t){return D.call(this,r,0)}}}function Lt(r){if(_===clearTimeout)return clearTimeout(r);if((_===Ie||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(r);try{return _(r)}catch(e){try{return _.call(null,r)}catch(t){return _.call(this,r)}}}var F=[],j=!1,V,ae=-1;function Ft(){!j||!V||(j=!1,V.length?F=V.concat(F):ae=-1,F.length&&ar())}function ar(){if(!j){var r=or(Ft);j=!0;for(var e=F.length;e;){for(V=F,F=[];++ae<e;)V&&V[ae].run();ae=-1,e=F.length}V=null,j=!1,Lt(r)}}T.nextTick=function(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];F.push(new sr(r,e)),F.length===1&&!j&&or(ar)};function sr(r,e){this.fun=r,this.array=e}sr.prototype.run=function(){this.fun.apply(null,this.array)};T.title="browser";T.browser=!0;T.env={};T.argv=[];T.version="";T.versions={};function C(){}T.on=C;T.addListener=C;T.once=C;T.off=C;T.removeListener=C;T.removeAllListeners=C;T.emit=C;T.prependListener=C;T.prependOnceListener=C;T.listeners=function(r){return[]};T.binding=function(r){throw new Error("process.binding is not supported")};T.cwd=function(){return"/"};T.chdir=function(r){throw new Error("process.chdir is not supported")};T.umask=function(){return 0}});var u,d,bn,s=Jr(()=>{u=I(ir()),d=I(lr()),bn=function(r){function e(){var n=this||self;return delete r.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return e();r.defineProperty(r.prototype,"__magic__",{configurable:!0,get:e});var t=__magic__;return t}(Object)});var gn={};et(gn,{getEventListDataHexValue:()=>Ct,getEventListHighlight:()=>Ot,getOperationDirection:()=>Pt,getOperationList:()=>Vr,getScResultsDecodedData:()=>Ut,getScResultsHighlight:()=>Mt,getScamFlag:()=>$t,getShardText:()=>Gt,getTransactionActionNftText:()=>zt,getTransactionActionTokenText:()=>jt,getTransactionFee:()=>Kt,getTransactionLinkWithLabel:()=>Yt,getTransactionMessages:()=>Qt,getTransactionStatus:()=>en,getTransactionStatusText:()=>rn,getTrimmedHash:()=>tn,getVisibleOperations:()=>nn,transactionActionUnwrapper:()=>on,useDataDecode:()=>un,useDataDecodeMethod:()=>pn,useGetOperationList:()=>mn});module.exports=rt(gn);s();s();var Ct=r=>u.Buffer.from(String(r==null?void 0:r.data),"base64").toString("hex");s();var Ot=(r,e)=>{var l;let{hash:t}=window.location,n=t.split("/"),i=n[0]?n[0].replace("#",""):"",o=(l=n[1])!=null?l:0;return i===e&&r.order===Number(o)};s();s();var Ae=(n=>(n.nft="nft",n.esdt="esdt",n.egld="egld",n))(Ae||{});var P=(i=>(i.raw="raw",i.text="text",i.decimal="decimal",i.smart="smart",i))(P||{});var Pt=({operation:r,address:e})=>{let t=e===r.sender,n=e===r.receiver,i=t&&n,o=!i,a="";switch(!0){case t:a="Out";break;case n:a="In";break;case i:a="Self";break;case o:a="Internal";break}return{direction:a}};s();s();s();function se(r){for(let e=0;e<r.length;e++)if(r.charCodeAt(e)>127)return!1;return!0}function Ne(r){let e=r;try{let t=u.Buffer.from(r,"hex").toString();se(t)&&t.length>1&&(e=t)}catch(t){}return e}var Ut=r=>{let e=u.Buffer.from(r,"base64").toString().split("@");return e.length>=2&&(e[0].length>0?e[0]=Ne(e[0]):e[1]=Ne(e[1])),e.join("@")};s();var Mt=r=>{let{hash:e}=window.location;return e.substring(0,e.indexOf("/")>0?e.indexOf("/"):e.length).replace("#","")===r};s();var ce=I(require("anchorme")),De=r=>r.toLocaleLowerCase().replace(/[^\x00-\x7F]/g,""),$t=(r,e)=>{if(e){let t=`[Message hidden due to suspicious content - ${e.info}]`;if(r.length>1e3)return{output:t,stringWithLinks:r,found:!0};let n=De(r.normalize("NFKC")),i=ce.default.list(n),o=[];if(i.length>0){let a=r;i.forEach((l,p)=>{let{string:g}=l,f="",h="",y=g;for(let x=0;x<a.length;x++){let b=a.slice(x),[k]=ce.default.list(De(b));k&&g===k.string&&(f=a.substring(0,x))}for(let x=r.length;x>0;x--){let b=a.slice(0,x),[k]=ce.default.list(De(b));k&&g===k.string&&(h=a.substring(x))}o.push(f),o.push(y),a=h,p===i.length-1&&o.push(h)})}else o.push(r);return{output:t,stringWithLinks:o.join(""),found:!0}}else return{output:r,stringWithLinks:"",found:!1}};s();s();s();s();s();s();s();s();s();s();s();var _e={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:ur,egldLabel:Zn}=_e["devnet"],{chainId:pr,egldLabel:Kn}=_e["testnet"],{chainId:dr,egldLabel:Yn}=_e["mainnet"];var Xn={["devnet"]:ur,["testnet"]:pr,["mainnet"]:dr},Qn={[ur]:"devnet",[pr]:"testnet",[dr]:"mainnet"};s();s();s();var R=18,Q=4;var mr=4294967295,gr=4294967280;var fr="refundedGas";var Z="0";var Gt=r=>{let e=r;typeof e=="string"&&e.includes("Shard")&&(e=e.replace("Shard","").replace(" ",""));let t=mr.toString()===String(e).toString()||String(e)==="metachain",n=gr.toString()===String(e).toString();return t?"Metachain":n?"All Shards":`Shard ${e}`};s();s();s();s();s();var yr=require("@elrondnetwork/erdjs"),U=I(require("bignumber.js"));s();var hr=I(require("bignumber.js")),Re=(r,e=!0)=>{let t=String(r);if(!t.match(/^[-]?\d+$/))return!1;let n=new hr.default(t),i=e?0:-1;return n.toString(10)===t&&n.comparedTo(0)>=i};s();function O(r){return{if:function(e){return e?{then:t=>t instanceof Function?O(t(r)):O(t)}:{then:()=>O(r)}},then:e=>e instanceof Function?O(e(r)):O(e),valueOf:function(){return r}}}U.default.config({ROUNDING_MODE:U.default.ROUND_FLOOR});function q({input:r,decimals:e=R,digits:t=Q,showLastNonZeroDecimal:n=!0,showIsLessThanDecimalsLabel:i=!1,addCommas:o=!1}){if(!Re(r,!1))throw new Error("Invalid input");let a=new U.default(r).isNegative(),l=r;return a&&(l=r.substring(1)),O(l).then(()=>yr.TokenPayment.fungibleFromBigInteger("",l,e).toRationalNumber()).then(p=>{let g=new U.default(p);if(g.isZero())return Z;let f=g.toString(10),[h,y]=f.split("."),x=new U.default(y||0),b=O(0).if(Boolean(y&&n)).then(()=>Math.max(y.length,t)).if(x.isZero()&&!n).then(0).if(Boolean(y&&!n)).then(()=>Math.min(y.length,t)).valueOf(),k=y&&t>=1&&t<=y.length&&x.isGreaterThan(0)&&new U.default(y.substring(0,t)).isZero(),qr=g.toFormat(b);return O(f).if(o).then(qr).if(Boolean(k)).then(J=>{let Y=new U.default(h).isZero(),[S,ee]=J.split("."),re=new Array(t-1).fill(0),Hr=[...re,0].join(""),Wr=[...re,1].join("");return Y?i?`<${S}.${Wr}`:n?`${S}.${ee}`:S:`${S}.${Hr}`}).if(Boolean(!k&&y)).then(J=>{let[Y]=J.split("."),S=y.substring(0,b);if(n){let ee=t-S.length;if(ee>0){let re=Array(ee).fill(0).join("");return S=`${S}${re}`,`${Y}.${S}`}return J}return S?`${Y}.${S}`:Y}).valueOf()}).if(a).then(p=>`-${p}`).valueOf()}s();s();var Vt=require("@elrondnetwork/erdjs");s();var le=require("@elrondnetwork/erdjs"),Ht=require("@elrondnetwork/erdjs"),Wt=require("@elrondnetwork/erdjs-network-providers");s();s();var qt=I(require("bignumber.js"));s();s();s();s();s();s();s();var M="accounts",H="transactions";var K="tokens",xr="blocks";var Tr="nodes",wr="identities",br="collections",Le="nfts",Fe="providers",Ce="sc-results",vr="contracts",kr="logs",Er="code",Sr="locked-accounts",Ir="roles";var ue={shard:r=>`/${xr}?shard=${r}`,receiverShard:r=>`/${H}?receivershard=${r}`,senderShard:r=>`/${H}?sendershard=${r}`,transactionDetails:r=>`/${H}/${r}`,transactionDetailsScResults:r=>`/${H}/${r}/${Ce}`,transactionDetailsLogs:r=>`/${H}/${r}/${kr}`,nodeDetails:r=>`/${Tr}/${r}`,accountDetails:r=>`/${M}/${r}`,accountDetailsContractCode:r=>`/${M}/${r}/${Er}`,accountDetailsTokens:r=>`/${M}/${r}/${K}`,accountDetailsNfts:r=>`/${M}/${r}/${Le}`,accountDetailsScResults:r=>`/${M}/${r}/${Ce}`,accountDetailsContracts:r=>`/${M}/${r}/${vr}`,identityDetails:r=>`/${wr}/${r}`,tokenDetails:r=>`/${K}/${r}`,tokenDetailsAccounts:r=>`/${K}/${r}/${M}`,tokenDetailsLockedAccounts:r=>`/${K}/${r}/${Sr}`,tokenDetailsRoles:r=>`/${K}/${r}/${Ir}`,collectionDetails:r=>`/${br}/${r}`,nftDetails:r=>`/${Le}/${r}`,providerDetails:r=>`/${Fe}/${r}`,providerDetailsTransactions:r=>`/${Fe}/${r}/${H}`};function zt({token:r,noValue:e,showLastNonZeroDecimal:t}){var g;let n=!e&&r.value&&r.type!=="NonFungibleESDT",i=r.decimals!=null,o="";r.type==="NonFungibleESDT"&&(o="NFT"),r.type==="SemiFungibleESDT"&&(o="SFT"),r.type==="MetaESDT"&&(o="Meta-ESDT");let a="";n&&i&&(a=i?q({input:r.value,decimals:r.decimals,digits:2,showLastNonZeroDecimal:t}):Number(r.value).toLocaleString("en"));let l=ue.nftDetails(String(r.identifier)),p=r.ticker===r.collection&&(g=r.identifier)!=null?g:r.ticker;return{badgeText:o,tokenFormattedAmount:n?a:null,tokenExplorerLink:l,tokenLinkText:p,token:r,noValue:e,showLastNonZeroDecimal:t}}s();function jt({token:r,noValue:e,showLastNonZeroDecimal:t}){var l;let n=Boolean(!e&&r.value),i=n?q({input:r.value,decimals:(l=r.decimals)!=null?l:R,digits:2,showLastNonZeroDecimal:t,addCommas:!0}):null,o=ue.tokenDetails(String(r.token)),a=r.ticker;return{tokenExplorerLink:o,tokenFormattedAmount:i,showFormattedAmount:n,tokenLinkText:a,token:r,showLastNonZeroDecimal:t}}s();var Oe=I(require("bignumber.js")),Zt=r=>{let e=new Oe.default(r.gasPrice),t=new Oe.default(r.gasUsed);return e.times(t).toString()};function Kt(r){return r.fee?r.fee:r.gasUsed===void 0?null:Zt(r)}s();var Yt=({transaction:r,direction:e})=>{var p;let t=e==="Internal",n=r.sender;if(t)return{link:(p=r.links.senderLink)!=null?p:"",label:"Smart Contract transaction",address:n};let i=e==="Out",o=i?r.links.receiverLink:r.links.senderLink,a="";return e==="Self"&&r.receiverAssets?a=r.receiverAssets.name:(n=i?r.receiver:r.sender,a=i?"To:":"From:"),{label:a,address:n,link:o!=null?o:""}};s();s();function Ar(r){var e,t;return(t=(e=r==null?void 0:r.operations)==null?void 0:e.map(n=>n.message).filter(n=>Boolean(n)))!=null?t:[]}s();var Nr=I(require("bignumber.js"));var Xt=r=>{var e,t;if(!((e=r.receipt)!=null&&e.value))return"";if(((t=r.receipt)==null?void 0:t.data)===fr){let n=q({input:r.receipt.value,decimals:R,digits:Q,showLastNonZeroDecimal:!0});return new Nr.default(n).times(r.gasPrice).times(100).toFixed()}return r.receipt.value};function Dr(r){var i;let e=(i=r.receipt)==null?void 0:i.data;if(!e)return"";let t=Xt(r),n=t?`: ${t}`:"";return`${e}${n}`}s();function Be(r){var e,t;return(t=(e=r==null?void 0:r.results)==null?void 0:e.map(n=>n.returnMessage).filter(n=>Boolean(n)))!=null?t:[]}function Qt(r){return Array.from(new Set([...Be(r),...Ar(r),Dr(r)])).filter(t=>Boolean(t))}s();function en(r){let e=a=>r.status.toLowerCase()===a.toLowerCase(),t=e("fail")||e("reward-reverted"),n=e("success"),i=e("not executed")||e("invalid"),o=e("pending")||r.pendingResults;return{failed:t,success:n,invalid:i,pending:o}}s();var rn=r=>{switch(!0){case r.pendingResults:return"Pending (Smart Contract Execution)";case r.status==="reward-reverted":return"fail";default:return r.status.toString()}};s();var tn=(r,e=4)=>`${r.substring(0,Math.floor(r.length/e))}...${r.substring(r.length-Math.ceil(r.length/e))}`;s();var nn=r=>{var t,n;return(n=(t=r==null?void 0:r.operations)==null?void 0:t.filter(i=>Object.values(Ae).includes(i.type)))!=null?n:[]};s();s();s();var Rr=r=>{var e,t;switch(r.name){case"transfer":return["Transfer",{token:(e=r.arguments)==null?void 0:e.transfers},"to",{address:(t=r.arguments)==null?void 0:t.receiver}];default:return[]}};s();var Lr=I(require("bignumber.js"));var Fr=r=>{var e,t,n,i,o,a,l,p,g,f,h,y;switch(r.name){case"claimLockedAssets":return["Claim locked assets"];case"enterFarm":case"enterFarmProxy":return["Enter farm with",{token:(e=r.arguments)==null?void 0:e.transfers}];case"enterFarmAndLockRewards":case"enterFarmAndLockRewardsProxy":return["Enter farm and lock rewards with",{token:(t=r.arguments)==null?void 0:t.transfers}];case"exitFarm":case"exitFarmProxy":return["Exit farm with",{token:(n=r.arguments)==null?void 0:n.transfers}];case"claimRewards":case"claimRewardsProxy":return["Claim rewards",{token:(i=r.arguments)==null?void 0:i.transfers}];case"compoundRewards":case"compoundRewardsProxy":return["Reinvest rewards",{token:(o=r.arguments)==null?void 0:o.transfers}];case"swapTokensFixedInput":case"swap":return r.description?[r.description]:[];case"swapTokensFixedOutput":return r.description?[r.description]:[];case"addLiquidity":case"addLiquidityProxy":return["Added liquidity for",{token:[(a=r.arguments)==null?void 0:a.transfers[0]]},"and",{token:[(l=r.arguments)==null?void 0:l.transfers[1]]}];case"removeLiquidity":case"removeLiquidityProxy":return["Removed liquidity with ",{token:(p=r.arguments)==null?void 0:p.transfers}];case"mergeLockedAssetTokens":let x=Z;if((g=r.arguments)!=null&&g.transfers){let b=r.arguments.transfers.map(({value:k})=>k);x=Lr.default.sum.apply(null,b).toString(10)}return[`Merge ${(f=r.arguments)==null?void 0:f.transfers.length}`,{tokenNoLink:[(h=r.arguments)==null?void 0:h.transfers[0]]},"positions into a single",{tokenNoLink:[(y=r.arguments)==null?void 0:y.transfers[0]]},"position of value",{value:x}];case"wrapEgld":case"unwrapEgld":default:return r.description?[r.description]:[]}};s();var Cr=r=>{var e,t,n,i,o,a,l,p,g,f,h,y;switch(r.name){case"delegate":case"stake":return["Delegate",{egldValue:(e=r.arguments)==null?void 0:e.value},"to staking provider",{providerName:(t=r.arguments)==null?void 0:t.providerName,providerAvatar:(n=r.arguments)==null?void 0:n.providerAvatar}];case"unDelegate":return["Undelegate",{egldValue:(i=r.arguments)==null?void 0:i.value},"from staking provider",{providerName:(o=r.arguments)==null?void 0:o.providerName,providerAvatar:(a=r.arguments)==null?void 0:a.providerAvatar}];case"claimRewards":return["Claim rewards from staking provider",{providerName:(l=r.arguments)==null?void 0:l.providerName,providerAvatar:(p=r.arguments)==null?void 0:p.providerAvatar}];case"reDelegateRewards":return["Redelegate rewards from staking provider",{providerName:(g=r.arguments)==null?void 0:g.providerName,providerAvatar:(f=r.arguments)==null?void 0:f.providerAvatar}];case"withdraw":return["Withdraw from staking provider",{providerName:(h=r.arguments)==null?void 0:h.providerName,providerAvatar:(y=r.arguments)==null?void 0:y.providerAvatar}];default:return[]}};var on=r=>{if(!r.arguments)return r.description?[r.description]:[r.name];switch(r.category){case"esdtNft":return Rr(r);case"mex":return Fr(r);case"stake":return Cr(r);default:return r.description?[r.description]:[]}};s();var de=require("react");s();s();s();var Pr=require("@elrondnetwork/erdjs/out"),Pe=I(require("bignumber.js"));s();var Or=require("@elrondnetwork/erdjs");function an(r){try{let e=new Or.Address(r);return Boolean(e.bech32())}catch(e){return!1}}function Br(r){return(r==null?void 0:r.startsWith("erd"))&&r.length===62&&/^\w+$/.test(r)&&an(r)}var B=(r,e,t)=>{switch(e){case"text":try{return u.Buffer.from(String(r),"hex").toString("utf8")}catch(i){}return r;case"decimal":return new Pe.default(r,16).toString(10);case"smart":try{let i=Pr.Address.fromHex(r).toString();if(Br(i))return i}catch(i){}try{let i=u.Buffer.from(String(r),"hex").toString("utf8");return se(i)||t&&[...t.esdts,...t.nfts].some(l=>i.includes(l))?i:new Pe.default(r,16).toString(10)}catch(i){}return r;case"raw":default:return r}};s();s();var sn=r=>r.toLowerCase().match(/[0-9a-f]/g),cn=r=>r.length%2===0,Ur=r=>{let e=[];return r&&!sn(r)&&e.push(`Invalid Hex characters on argument @${r}`),r&&!cn(r)&&e.push(`Odd number of Hex characters on argument @${r}`),e};s();var pe=({parts:r,decodedParts:e,identifier:t})=>{let n=[...e];if(r[0]==="ESDTNFTTransfer"&&r[2]&&(n[2]=B(r[2],"decimal")),t==="ESDTNFTTransfer"&&r[1]){let i=u.Buffer.from(String(r[1]),"base64");n[1]=B(i.toString("hex"),"decimal")}return n};var Mr=({parts:r,decodeMethod:e,identifier:t})=>{let n=[],i=r.map((a,l)=>{if(r.length>=2&&(l===0&&a.length<64||l===1&&!r[0]))return/[^a-z0-9]/gi.test(a)?B(a,e):a;{let p=Ur(a);return p.length&&(n=p),B(a,e)}});return{displayValue:(e==="smart"?pe({parts:r,decodedParts:i,identifier:t}):i).join("@"),validationWarnings:n}};var $r=({input:r,decodeMethod:e,identifier:t})=>{let n={displayValue:"",validationWarnings:[]};if(!(r.includes("@")||r.includes(` `)))return n.displayValue=B(r,e),n;if(r.includes("@")){let o=r.split("@");n=Mr({parts:o,decodeMethod:e,identifier:t})}if(r.includes(` `)){let o=r.split(` `),a=o.map(p=>{let g=u.Buffer.from(String(p),"base64");return e==="raw"?p:B(g.toString("hex"),e)}),l=e==="smart"?pe({parts:o,decodedParts:a,identifier:t}):a;n.displayValue=l.join(` `)}return n};var ln=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}],un=({value:r,initialDecodeMethod:e,setDecodeMethod:t,identifier:n})=>{let[i,o]=(0,de.useState)(e&&Object.values(P).includes(e)?e:"raw"),{displayValue:a,validationWarnings:l}=$r({input:r,decodeMethod:i,identifier:n});return(0,de.useEffect)(()=>{t&&t(i)},[i]),{displayValue:a,validationWarnings:l,setActiveKey:o,decodeOptions:ln}};s();var me=require("react");var pn=()=>{let{hash:r,pathname:e}=window.location,t=r.replace("#",""),n=t&&Object.values(P).includes(t)?t:"raw",[i,o]=(0,me.useState)(t);return(0,me.useEffect)(()=>{i&&i!=="raw"&&window.history.replaceState({},document==null?void 0:document.title,`${e}#${i}`)},[i,e]),{initialDecodeMethod:n,decodeMethod:i,setDecodeMethod:o}};s();var Gr=require("react");var dn=["create","localMint","ESDTLocalMint","addQuantity","burn","localBurn","ESDTLocalBurn","wipe","writeLog","signalError"];function Vr({operations:r,transaction:e,isExpanded:t=!1,listLength:n=25}){let i=r.filter(f=>!dn.includes(f.action)&&(f.sender===e.sender||f.receiver===e.sender)),o=i.length>0?i:r,a=o.length>n?o.slice(0,n):o,l=o.length>n?o.slice(n,o.length):[],p=t?i.length>0?"Show in/out operations":"Show fewer operations":"Show all operations",g=a.length!==r.length||l.length>0;return{displayedOperations:t?r:a,toggleButtonText:p,showToggleButton:g}}function mn(r){let[e,t]=(0,Gr.useState)(!1),n=()=>{t(l=>!l)},{displayedOperations:i,showToggleButton:o,toggleButtonText:a}=Vr(fe(ge({},r),{isExpanded:e}));return{isExpanded:e,displayedOperations:i,showToggleButton:o,toggleButtonText:a,onToggleButtonClick:n}}0&&(module.exports={getEventListDataHexValue,getEventListHighlight,getOperationDirection,getOperationList,getScResultsDecodedData,getScResultsHighlight,getScamFlag,getShardText,getTransactionActionNftText,getTransactionActionTokenText,getTransactionFee,getTransactionLinkWithLabel,getTransactionMessages,getTransactionStatus,getTransactionStatusText,getTrimmedHash,getVisibleOperations,transactionActionUnwrapper,useDataDecode,useDataDecodeMethod,useGetOperationList}); /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <https://feross.org> * @license MIT */ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ //# sourceMappingURL=index.js.map