UNPKG

@sofaws/dapp-core

Version:

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

10 lines (9 loc) 38.3 kB
"use strict";var Be=Object.create;var ae=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var Me=Object.getOwnPropertyNames;var Pe=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var Ge=(t,e)=>()=>(t&&(e=t(t=0)),e);var P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Oe=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Me(e))!qe.call(t,a)&&a!==r&&ae(t,a,{get:()=>e[a],enumerable:!(n=Ue(e,a))||n.enumerable});return t};var W=(t,e,r)=>(r=t!=null?Be(Pe(t)):{},Oe(e||!t||!t.__esModule?ae(r,"default",{value:t,enumerable:!0}):r,t));var se=P(q=>{"use strict";u();q.byteLength=je;q.toByteArray=Xe;q.fromByteArray=Ke;var E=[],T=[],ze=typeof Uint8Array!="undefined"?Uint8Array:Array,X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(D=0,ie=X.length;D<ie;++D)E[D]=X[D],T[X.charCodeAt(D)]=D;var D,ie;T["-".charCodeAt(0)]=62;T["_".charCodeAt(0)]=63;function oe(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function je(t){var e=oe(t),r=e[0],n=e[1];return(r+n)*3/4-n}function We(t,e,r){return(e+r)*3/4-r}function Xe(t){var e,r=oe(t),n=r[0],a=r[1],i=new ze(We(t,n,a)),o=0,c=a>0?n-4:n,l;for(l=0;l<c;l+=4)e=T[t.charCodeAt(l)]<<18|T[t.charCodeAt(l+1)]<<12|T[t.charCodeAt(l+2)]<<6|T[t.charCodeAt(l+3)],i[o++]=e>>16&255,i[o++]=e>>8&255,i[o++]=e&255;return a===2&&(e=T[t.charCodeAt(l)]<<2|T[t.charCodeAt(l+1)]>>4,i[o++]=e&255),a===1&&(e=T[t.charCodeAt(l)]<<10|T[t.charCodeAt(l+1)]<<4|T[t.charCodeAt(l+2)]>>2,i[o++]=e>>8&255,i[o++]=e&255),i}function He(t){return E[t>>18&63]+E[t>>12&63]+E[t>>6&63]+E[t&63]}function Ve(t,e,r){for(var n,a=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),a.push(He(n));return a.join("")}function Ke(t){for(var e,r=t.length,n=r%3,a=[],i=16383,o=0,c=r-n;o<c;o+=i)a.push(Ve(t,o,o+i>c?c:o+i));return n===1?(e=t[r-1],a.push(E[e>>2]+E[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],a.push(E[e>>10]+E[e>>4&63]+E[e<<2&63]+"=")),a.join("")}});var ce=P(H=>{u();H.read=function(t,e,r,n,a){var i,o,c=a*8-n-1,l=(1<<c)-1,d=l>>1,m=-7,p=r?a-1:0,x=r?-1:1,b=t[e+p];for(p+=x,i=b&(1<<-m)-1,b>>=-m,m+=c;m>0;i=i*256+t[e+p],p+=x,m-=8);for(o=i&(1<<-m)-1,i>>=-m,m+=n;m>0;o=o*256+t[e+p],p+=x,m-=8);if(i===0)i=1-d;else{if(i===l)return o?NaN:(b?-1:1)*(1/0);o=o+Math.pow(2,n),i=i-d}return(b?-1:1)*o*Math.pow(2,i-n)};H.write=function(t,e,r,n,a,i){var o,c,l,d=i*8-a-1,m=(1<<d)-1,p=m>>1,x=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:i-1,S=n?1:-1,j=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,o=m):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+p>=1?e+=x/l:e+=x*Math.pow(2,1-p),e*l>=2&&(o++,l/=2),o+p>=m?(c=0,o=m):o+p>=1?(c=(e*l-1)*Math.pow(2,a),o=o+p):(c=e*Math.pow(2,p-1)*Math.pow(2,a),o=0));a>=8;t[r+b]=c&255,b+=S,c/=256,a-=8);for(o=o<<a|c,d+=a;d>0;t[r+b]=o&255,b+=S,o/=256,d-=8);t[r+b-S]|=j*128}});var be=P(U=>{"use strict";u();var V=se(),B=ce(),le=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;U.Buffer=s;U.SlowBuffer=er;U.INSPECT_MAX_BYTES=50;var G=2147483647;U.kMaxLength=G;s.TYPED_ARRAY_SUPPORT=Ye();!s.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 Ye(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(r){return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.buffer}});Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.byteOffset}});function _(t){if(t>G)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Z(t)}return de(t,e,r)}s.poolSize=8192;function de(t,e,r){if(typeof t=="string")return Ze(t,e);if(ArrayBuffer.isView(t))return Je(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(A(t,ArrayBuffer)||t&&A(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(A(t,SharedArrayBuffer)||t&&A(t.buffer,SharedArrayBuffer)))return Y(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return s.from(n,e,r);var a=$e(t);if(a)return a;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return s.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s.from=function(t,e,r){return de(t,e,r)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function me(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Qe(t,e,r){return me(t),t<=0?_(t):e!==void 0?typeof r=="string"?_(t).fill(e,r):_(t).fill(e):_(t)}s.alloc=function(t,e,r){return Qe(t,e,r)};function Z(t){return me(t),_(t<0?0:J(t)|0)}s.allocUnsafe=function(t){return Z(t)};s.allocUnsafeSlow=function(t){return Z(t)};function Ze(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=ge(t,e)|0,n=_(r),a=n.write(t,e);return a!==r&&(n=n.slice(0,a)),n}function K(t){for(var e=t.length<0?0:J(t.length)|0,r=_(e),n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Je(t){if(A(t,Uint8Array)){var e=new Uint8Array(t);return Y(e.buffer,e.byteOffset,e.byteLength)}return K(t)}function Y(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,s.prototype),n}function $e(t){if(s.isBuffer(t)){var e=J(t.length)|0,r=_(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||$(t.length)?_(0):K(t);if(t.type==="Buffer"&&Array.isArray(t.data))return K(t.data)}function J(t){if(t>=G)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+G.toString(16)+" bytes");return t|0}function er(t){return+t!=t&&(t=0),s.alloc(+t)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype};s.compare=function(e,r){if(A(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),A(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(e)||!s.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var n=e.length,a=r.length,i=0,o=Math.min(n,a);i<o;++i)if(e[i]!==r[i]){n=e[i],a=r[i];break}return n<a?-1:a<n?1:0};s.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}};s.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return s.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var a=s.allocUnsafe(r),i=0;for(n=0;n<e.length;++n){var o=e[n];if(A(o,Uint8Array))i+o.length>a.length?s.from(o).copy(a,i):Uint8Array.prototype.set.call(a,o,i);else if(s.isBuffer(o))o.copy(a,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return a};function ge(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||A(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ve(t).length;default:if(a)return n?-1:Q(t).length;e=(""+e).toLowerCase(),a=!0}}s.byteLength=ge;function rr(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return pr(this,e,r);case"utf8":case"utf-8":return he(this,e,r);case"ascii":return lr(this,e,r);case"latin1":case"binary":return ur(this,e,r);case"base64":return sr(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dr(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function N(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}s.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 r=0;r<e;r+=2)N(this,r,r+1);return this};s.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 r=0;r<e;r+=4)N(this,r,r+3),N(this,r+1,r+2);return this};s.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 r=0;r<e;r+=8)N(this,r,r+7),N(this,r+1,r+6),N(this,r+2,r+5),N(this,r+3,r+4);return this};s.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?he(this,0,e):rr.apply(this,arguments)};s.prototype.toLocaleString=s.prototype.toString;s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:s.compare(this,e)===0};s.prototype.inspect=function(){var e="",r=U.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};le&&(s.prototype[le]=s.prototype.inspect);s.prototype.compare=function(e,r,n,a,i){if(A(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),a===void 0&&(a=0),i===void 0&&(i=this.length),r<0||n>e.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&r>=n)return 0;if(a>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,a>>>=0,i>>>=0,this===e)return 0;for(var o=i-a,c=n-r,l=Math.min(o,c),d=this.slice(a,i),m=e.slice(r,n),p=0;p<l;++p)if(d[p]!==m[p]){o=d[p],c=m[p];break}return o<c?-1:c<o?1:0};function fe(t,e,r,n,a){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,$(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0)if(a)r=0;else return-1;if(typeof e=="string"&&(e=s.from(e,n)),s.isBuffer(e))return e.length===0?-1:ue(t,e,r,n,a);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):ue(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function ue(t,e,r,n,a){var i=1,o=t.length,c=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,o/=2,c/=2,r/=2}function l(b,S){return i===1?b[S]:b.readUInt16BE(S*i)}var d;if(a){var m=-1;for(d=r;d<o;d++)if(l(t,d)===l(e,m===-1?0:d-m)){if(m===-1&&(m=d),d-m+1===c)return m*i}else m!==-1&&(d-=d-m),m=-1}else for(r+c>o&&(r=o-c),d=r;d>=0;d--){for(var p=!0,x=0;x<c;x++)if(l(t,d+x)!==l(e,x)){p=!1;break}if(p)return d}return-1}s.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};s.prototype.indexOf=function(e,r,n){return fe(this,e,r,n,!0)};s.prototype.lastIndexOf=function(e,r,n){return fe(this,e,r,n,!1)};function tr(t,e,r,n){r=Number(r)||0;var a=t.length-r;n?(n=Number(n),n>a&&(n=a)):n=a;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var c=parseInt(e.substr(o*2,2),16);if($(c))return o;t[r+o]=c}return o}function nr(t,e,r,n){return O(Q(e,t.length-r),t,r,n)}function ar(t,e,r,n){return O(fr(e),t,r,n)}function ir(t,e,r,n){return O(ve(e),t,r,n)}function or(t,e,r,n){return O(hr(e,t.length-r),t,r,n)}s.prototype.write=function(e,r,n,a){if(r===void 0)a="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")a=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,a===void 0&&(a="utf8")):(a=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var o=!1;;)switch(a){case"hex":return tr(this,e,r,n);case"utf8":case"utf-8":return nr(this,e,r,n);case"ascii":case"latin1":case"binary":return ar(this,e,r,n);case"base64":return ir(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return or(this,e,r,n);default:if(o)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),o=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function sr(t,e,r){return e===0&&r===t.length?V.fromByteArray(t):V.fromByteArray(t.slice(e,r))}function he(t,e,r){r=Math.min(t.length,r);for(var n=[],a=e;a<r;){var i=t[a],o=null,c=i>239?4:i>223?3:i>191?2:1;if(a+c<=r){var l,d,m,p;switch(c){case 1:i<128&&(o=i);break;case 2:l=t[a+1],(l&192)===128&&(p=(i&31)<<6|l&63,p>127&&(o=p));break;case 3:l=t[a+1],d=t[a+2],(l&192)===128&&(d&192)===128&&(p=(i&15)<<12|(l&63)<<6|d&63,p>2047&&(p<55296||p>57343)&&(o=p));break;case 4:l=t[a+1],d=t[a+2],m=t[a+3],(l&192)===128&&(d&192)===128&&(m&192)===128&&(p=(i&15)<<18|(l&63)<<12|(d&63)<<6|m&63,p>65535&&p<1114112&&(o=p))}}o===null?(o=65533,c=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),a+=c}return cr(n)}var pe=4096;function cr(t){var e=t.length;if(e<=pe)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=pe));return r}function lr(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;a<r;++a)n+=String.fromCharCode(t[a]&127);return n}function ur(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;a<r;++a)n+=String.fromCharCode(t[a]);return n}function pr(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var a="",i=e;i<r;++i)a+=yr[t[i]];return a}function dr(t,e,r){for(var n=t.slice(e,r),a="",i=0;i<n.length-1;i+=2)a+=String.fromCharCode(n[i]+n[i+1]*256);return a}s.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var a=this.subarray(e,r);return Object.setPrototypeOf(a,s.prototype),a};function w(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||w(e,r,this.length);for(var a=this[e],i=1,o=0;++o<r&&(i*=256);)a+=this[e+o]*i;return a};s.prototype.readUintBE=s.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||w(e,r,this.length);for(var a=this[e+--r],i=1;r>0&&(i*=256);)a+=this[e+--r]*i;return a};s.prototype.readUint8=s.prototype.readUInt8=function(e,r){return e=e>>>0,r||w(e,1,this.length),this[e]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||w(e,2,this.length),this[e]|this[e+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||w(e,2,this.length),this[e]<<8|this[e+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||w(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};s.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||w(e,r,this.length);for(var a=this[e],i=1,o=0;++o<r&&(i*=256);)a+=this[e+o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*r)),a};s.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||w(e,r,this.length);for(var a=r,i=1,o=this[e+--a];a>0&&(i*=256);)o+=this[e+--a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*r)),o};s.prototype.readInt8=function(e,r){return e=e>>>0,r||w(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};s.prototype.readInt16LE=function(e,r){e=e>>>0,r||w(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(e,r){e=e>>>0,r||w(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(e,r){return e=e>>>0,r||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};s.prototype.readInt32BE=function(e,r){return e=e>>>0,r||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};s.prototype.readFloatLE=function(e,r){return e=e>>>0,r||w(e,4,this.length),B.read(this,e,!0,23,4)};s.prototype.readFloatBE=function(e,r){return e=e>>>0,r||w(e,4,this.length),B.read(this,e,!1,23,4)};s.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||w(e,8,this.length),B.read(this,e,!0,52,8)};s.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||w(e,8,this.length),B.read(this,e,!1,52,8)};function k(t,e,r,n,a,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,r,n,a){if(e=+e,r=r>>>0,n=n>>>0,!a){var i=Math.pow(2,8*n)-1;k(this,e,r,n,i,0)}var o=1,c=0;for(this[r]=e&255;++c<n&&(o*=256);)this[r+c]=e/o&255;return r+n};s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,r,n,a){if(e=+e,r=r>>>0,n=n>>>0,!a){var i=Math.pow(2,8*n)-1;k(this,e,r,n,i,0)}var o=n-1,c=1;for(this[r+o]=e&255;--o>=0&&(c*=256);)this[r+o]=e/c&255;return r+n};s.prototype.writeUint8=s.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,1,255,0),this[r]=e&255,r+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};s.prototype.writeIntLE=function(e,r,n,a){if(e=+e,r=r>>>0,!a){var i=Math.pow(2,8*n-1);k(this,e,r,n,i-1,-i)}var o=0,c=1,l=0;for(this[r]=e&255;++o<n&&(c*=256);)e<0&&l===0&&this[r+o-1]!==0&&(l=1),this[r+o]=(e/c>>0)-l&255;return r+n};s.prototype.writeIntBE=function(e,r,n,a){if(e=+e,r=r>>>0,!a){var i=Math.pow(2,8*n-1);k(this,e,r,n,i-1,-i)}var o=n-1,c=1,l=0;for(this[r+o]=e&255;--o>=0&&(c*=256);)e<0&&l===0&&this[r+o+1]!==0&&(l=1),this[r+o]=(e/c>>0)-l&255;return r+n};s.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};s.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};s.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};s.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};s.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function ye(t,e,r,n,a,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function we(t,e,r,n,a){return e=+e,r=r>>>0,a||ye(t,e,r,4,34028234663852886e22,-34028234663852886e22),B.write(t,e,r,n,23,4),r+4}s.prototype.writeFloatLE=function(e,r,n){return we(this,e,r,!0,n)};s.prototype.writeFloatBE=function(e,r,n){return we(this,e,r,!1,n)};function xe(t,e,r,n,a){return e=+e,r=r>>>0,a||ye(t,e,r,8,17976931348623157e292,-17976931348623157e292),B.write(t,e,r,n,52,8),r+8}s.prototype.writeDoubleLE=function(e,r,n){return xe(this,e,r,!0,n)};s.prototype.writeDoubleBE=function(e,r,n){return xe(this,e,r,!1,n)};s.prototype.copy=function(e,r,n,a){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!a&&a!==0&&(a=this.length),r>=e.length&&(r=e.length),r||(r=0),a>0&&a<n&&(a=n),a===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=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),e.length-r<a-n&&(a=e.length-r+n);var i=a-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,a):Uint8Array.prototype.set.call(e,this.subarray(n,a),r),i};s.prototype.fill=function(e,r,n,a){if(typeof e=="string"){if(typeof r=="string"?(a=r,r=0,n=this.length):typeof n=="string"&&(a=n,n=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!s.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(e.length===1){var i=e.charCodeAt(0);(a==="utf8"&&i<128||a==="latin1")&&(e=i)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(typeof e=="number")for(o=r;o<n;++o)this[o]=e;else{var c=s.isBuffer(e)?e:s.from(e,a),l=c.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=c[o%l]}return this};var mr=/[^+/0-9A-Za-z-_]/g;function gr(t){if(t=t.split("=")[0],t=t.trim().replace(mr,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Q(t,e){e=e||1/0;for(var r,n=t.length,a=null,i=[],o=0;o<n;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function fr(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function hr(t,e){for(var r,n,a,i=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,a=r%256,i.push(a),i.push(n);return i}function ve(t){return V.toByteArray(gr(t))}function O(t,e,r,n){for(var a=0;a<n&&!(a+r>=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function A(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function $(t){return t!==t}var yr=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=r*16,a=0;a<16;++a)e[n+a]=t[r]+t[a];return e}()});var Re=P((Er,Ae)=>{u();var y=Ae.exports={},R,L;function ee(){throw new Error("setTimeout has not been defined")}function re(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?R=setTimeout:R=ee}catch(t){R=ee}try{typeof clearTimeout=="function"?L=clearTimeout:L=re}catch(t){L=re}})();function ke(t){if(R===setTimeout)return setTimeout(t,0);if((R===ee||!R)&&setTimeout)return R=setTimeout,setTimeout(t,0);try{return R(t,0)}catch(e){try{return R.call(null,t,0)}catch(r){return R.call(this,t,0)}}}function wr(t){if(L===clearTimeout)return clearTimeout(t);if((L===re||!L)&&clearTimeout)return L=clearTimeout,clearTimeout(t);try{return L(t)}catch(e){try{return L.call(null,t)}catch(r){return L.call(this,t)}}}var I=[],M=!1,C,z=-1;function xr(){!M||!C||(M=!1,C.length?I=C.concat(I):z=-1,I.length&&Te())}function Te(){if(!M){var t=ke(xr);M=!0;for(var e=I.length;e;){for(C=I,I=[];++z<e;)C&&C[z].run();z=-1,e=I.length}C=null,M=!1,wr(t)}}y.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];I.push(new Ee(t,e)),I.length===1&&!M&&ke(Te)};function Ee(t,e){this.fun=t,this.array=e}Ee.prototype.run=function(){this.fun.apply(null,this.array)};y.title="browser";y.browser=!0;y.env={};y.argv=[];y.version="";y.versions={};function F(){}y.on=F;y.addListener=F;y.once=F;y.off=F;y.removeListener=F;y.removeAllListeners=F;y.emit=F;y.prependListener=F;y.prependOnceListener=F;y.listeners=function(t){return[]};y.binding=function(t){throw new Error("process.binding is not supported")};y.cwd=function(){return"/"};y.chdir=function(t){throw new Error("process.chdir is not supported")};y.umask=function(){return 0}});var g,f,Ar,u=Ge(()=>{g=W(be()),f=W(Re()),Ar=function(t){function e(){var n=this||self;return delete t.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return e();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:e});var r=__magic__;return r}(Object)});u();u();u();u();var Le=t=>{var e,r;switch(t.name){case"transfer":return["Transfer",{token:(e=t.arguments)==null?void 0:e.transfers},"to",{address:(r=t.arguments)==null?void 0:r.receiver}];default:return[]}};u();var De=W(require("bignumber.js"));u();u();u();u();u();u();u();u();u();u();var ne={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:_e,egldLabel:Xr}=ne["devnet"],{chainId:Ie,egldLabel:Hr}=ne["testnet"],{chainId:Fe,egldLabel:Vr}=ne["mainnet"];var Kr={["devnet"]:_e,["testnet"]:Ie,["mainnet"]:Fe},Yr={[_e]:"devnet",[Ie]:"testnet",[Fe]:"mainnet"};u();u();u();var Se="0";var Ne=t=>{var e,r,n,a,i,o,c,l,d,m,p,x;switch(t.name){case"claimLockedAssets":return["Claim locked assets"];case"enterFarm":case"enterFarmProxy":return["Enter farm with",{token:(e=t.arguments)==null?void 0:e.transfers}];case"enterFarmAndLockRewards":case"enterFarmAndLockRewardsProxy":return["Enter farm and lock rewards with",{token:(r=t.arguments)==null?void 0:r.transfers}];case"exitFarm":case"exitFarmProxy":return["Exit farm with",{token:(n=t.arguments)==null?void 0:n.transfers}];case"claimRewards":case"claimRewardsProxy":return["Claim rewards",{token:(a=t.arguments)==null?void 0:a.transfers}];case"compoundRewards":case"compoundRewardsProxy":return["Reinvest rewards",{token:(i=t.arguments)==null?void 0:i.transfers}];case"swapTokensFixedInput":case"swap":return t.description?[t.description]:[];case"swapTokensFixedOutput":return t.description?[t.description]:[];case"addLiquidity":case"addLiquidityProxy":return["Added liquidity for",{token:[(o=t.arguments)==null?void 0:o.transfers[0]]},"and",{token:[(c=t.arguments)==null?void 0:c.transfers[1]]}];case"removeLiquidity":case"removeLiquidityProxy":return["Removed liquidity with ",{token:(l=t.arguments)==null?void 0:l.transfers}];case"mergeLockedAssetTokens":let b=Se;if((d=t.arguments)!=null&&d.transfers){let S=t.arguments.transfers.map(({value:j})=>j);b=De.default.sum.apply(null,S).toString(10)}return[`Merge ${(m=t.arguments)==null?void 0:m.transfers.length}`,{tokenNoLink:[(p=t.arguments)==null?void 0:p.transfers[0]]},"positions into a single",{tokenNoLink:[(x=t.arguments)==null?void 0:x.transfers[0]]},"position of value",{value:b}];case"wrapEgld":case"unwrapEgld":default:return t.description?[t.description]:[]}};u();var Ce=t=>{var e,r,n,a,i,o,c,l,d,m,p,x;switch(t.name){case"delegate":case"stake":return["Delegate",{egldValue:(e=t.arguments)==null?void 0:e.value},"to staking provider",{providerName:(r=t.arguments)==null?void 0:r.providerName,providerAvatar:(n=t.arguments)==null?void 0:n.providerAvatar}];case"unDelegate":return["Undelegate",{egldValue:(a=t.arguments)==null?void 0:a.value},"from staking provider",{providerName:(i=t.arguments)==null?void 0:i.providerName,providerAvatar:(o=t.arguments)==null?void 0:o.providerAvatar}];case"claimRewards":return["Claim rewards from staking provider",{providerName:(c=t.arguments)==null?void 0:c.providerName,providerAvatar:(l=t.arguments)==null?void 0:l.providerAvatar}];case"reDelegateRewards":return["Redelegate rewards from staking provider",{providerName:(d=t.arguments)==null?void 0:d.providerName,providerAvatar:(m=t.arguments)==null?void 0:m.providerAvatar}];case"withdraw":return["Withdraw from staking provider",{providerName:(p=t.arguments)==null?void 0:p.providerName,providerAvatar:(x=t.arguments)==null?void 0:x.providerAvatar}];default:return[]}};var v=t=>{if(!t.arguments)return t.description?[t.description]:[t.name];switch(t.category){case"esdtNft":return Le(t);case"mex":return Ne(t);case"stake":return Ce(t);default:return t.description?[t.description]:[]}};describe("Tx Description unwrapper tests",()=>{test("Token Transfer",()=>{let{action:t}={action:{category:"esdtNft",name:"transfer",description:"Transfer 2950.00 USDC-c76f1f to erd1wh9c0sjr2xn8hzf02lwwcr4jk2s84tat9ud2kaq6zr7xzpvl9l5q8awmex",arguments:{transfers:[{collection:"USDC-c76f1f",identifier:"USDC-c76f1f",ticker:"USDC",name:"WrappedUSDC",value:"2950000000"}],receiver:"erd1wh9c0sjr2xn8hzf02lwwcr4jk2s84tat9ud2kaq6zr7xzpvl9l5q8awmex"}}};expect(v(t)).toEqual(["Transfer",{token:t.arguments.transfers},"to",{address:t.arguments.receiver}])}),test("NFT Transfer",()=>{let{action:t}={action:{category:"esdtNft",name:"transfer",description:"Transfer NFT ARTCRAFT-322c6e-11 to erd1wh9c0sjr2xn8hzf02lwwcr4jk2s84tat9ud2kaq6zr7xzpvl9l5q8awmex",arguments:{transfers:[{type:"NonFungibleESDT",collection:"ARTCRAFT-322c6e",identifier:"ARTCRAFT-322c6e-11",ticker:"ARTCRAFT-322c6e",name:"Hope",value:"1"}],receiver:"erd1wh9c0sjr2xn8hzf02lwwcr4jk2s84tat9ud2kaq6zr7xzpvl9l5q8awmex"}}};expect(v(t)).toEqual(["Transfer",{token:t.arguments.transfers},"to",{address:t.arguments.receiver}])}),test("MetaESDT Transfer",()=>{let{action:t}={action:{category:"esdtNft",name:"transfer",description:"Transfer 1.537276176898979513 LKFARM (LKFARM-9d1ea8-126c17) to erd1wh9c0sjr2xn8hzf02lwwcr4jk2s84tat9ud2kaq6zr7xzpvl9l5q8awmex",arguments:{transfers:[{type:"MetaESDT",collection:"LKFARM-9d1ea8",identifier:"LKFARM-9d1ea8-126c17",ticker:"LKFARM",name:"LockedLPStaked",value:"1537276176898979513",decimals:18}],receiver:"erd1wh9c0sjr2xn8hzf02lwwcr4jk2s84tat9ud2kaq6zr7xzpvl9l5q8awmex"}}};expect(v(t)).toEqual(["Transfer",{token:t.arguments.transfers},"to",{address:t.arguments.receiver}])}),test("stake",()=>{var e,r;let{action:t}={action:{category:"stake",name:"delegate",description:"Delegate 14.167802221131358682 EGLD to staking provider ARC Stake",arguments:{value:"14167802221131358682",providerName:"ARC Stake"}}};expect(v(t)).toEqual(["Delegate",{egldValue:(e=t.arguments)==null?void 0:e.value},"to staking provider",{providerName:(r=t.arguments)==null?void 0:r.providerName}])}),test("stake unDelegate",()=>{var e,r;let{action:t}={action:{category:"stake",name:"unDelegate",description:"Undelegate 5 eGLD from staking provider ARC Stake",arguments:{value:"5000000000000000000",providerName:"ARC Stake"}}};expect(v(t)).toEqual(["Undelegate",{egldValue:(e=t.arguments)==null?void 0:e.value},"from staking provider",{providerName:(r=t.arguments)==null?void 0:r.providerName}])}),test("stake claimRewards",()=>{var e;let{action:t}={action:{category:"stake",name:"claimRewards",description:"Claim rewards from staking provider ARC Stake",arguments:{providerName:"ARC Stake"}}};expect(v(t)).toEqual(["Claim rewards from staking provider",{providerName:(e=t.arguments)==null?void 0:e.providerName}])}),test("stake reDelegateRewards",()=>{var e;let{action:t}={action:{category:"stake",name:"reDelegateRewards",description:"Redelegate rewards from staking provider ARC Stake",arguments:{providerName:"ARC Stake"}}};expect(v(t)).toEqual(["Redelegate rewards from staking provider",{providerName:(e=t.arguments)==null?void 0:e.providerName}])}),test("stake withdraw",()=>{var e;let{action:t}={action:{category:"stake",name:"withdraw",description:"Withdraw from staking provider ARC Stake",arguments:{providerName:"ARC Stake"}}};expect(v(t)).toEqual(["Withdraw from staking provider",{providerName:(e=t.arguments)==null?void 0:e.providerName}])}),test("Enter farm",()=>{let{action:t}={action:{category:"mex",name:"enterFarm",description:"Enter farm with 20 LKMEX",arguments:{transfers:[{type:"MetaESDT",name:"LockedMEX",collection:"LKMEX-aab910",identifier:"LKMEX-aab910-04",ticker:"LKMEX",decimals:18,value:"20000000000000000000"}]}}};expect(v(t)).toEqual(["Enter farm with",{token:t.arguments.transfers}])}),test("Enter farm and lock rewards",()=>{let{action:t}={action:{category:"mex",name:"enterFarmAndLockRewards",description:"Enter farm and lock rewards with 61.229451140721546841 EGLDMEX",arguments:{transfers:[{name:"EGLDMEXLP",collection:"EGLDMEX-0be9e5",identifier:"EGLDMEX-0be9e5",ticker:"EGLDMEX",value:"61229451140721546841"}]}}};expect(v(t)).toEqual(["Enter farm and lock rewards with",{token:t.arguments.transfers}])}),test("Exit farm",()=>{let{action:t}={action:{category:"mex",name:"exitFarm",description:"Exit farm with 1358392.837361997848576 LKFARM",arguments:{transfers:[{type:"MetaESDT",name:"LockedLPStaked",collection:"LKFARM-9d1ea8",identifier:"LKFARM-9d1ea8-7ff1",ticker:"LKFARM",decimals:18,value:"1358392837361997848576000"}]}}};expect(v(t)).toEqual(["Exit farm with",{token:t.arguments.transfers}])}),test("Claim rewards",()=>{let{action:t}={action:{category:"mex",name:"claimRewards",description:"Claim rewards 8.113902227485916134 LKFARM",arguments:{transfers:[{type:"MetaESDT",name:"LockedLPStaked",collection:"LKFARM-9d1ea8",identifier:"LKFARM-9d1ea8-016711",ticker:"LKFARM",decimals:18,value:"8113902227485916134"}]}}};expect(v(t)).toEqual(["Claim rewards",{token:t.arguments.transfers}])}),test("Compound rewards",()=>{let{action:t}={action:{category:"mex",name:"compoundRewards",description:"Reinvest rewards 20 LKFARM",arguments:{transfers:[{type:"MetaESDT",name:"LockedLPStaked",collection:"LKFARM-9d1ea8",identifier:"LKFARM-9d1ea8-01ee91",ticker:"LKFARM",decimals:18,value:"20000000000000000000"}]}}};expect(v(t)).toEqual(["Reinvest rewards",{token:t.arguments.transfers}])}),test("Swap tokens",()=>{let{action:t}={action:{category:"mex",name:"swap",description:"Swap 1 WEGLD for a minimum of 281066.754391919467235791 MEX",arguments:{token1:{name:"WrappedEGLD",collection:"WEGLD-bd4d79",identifier:"WEGLD-bd4d79",ticker:"WEGLD",value:"1000000000000000000"},token2:{name:"MEX",collection:"MEX-455c57",identifier:"MEX-455c57",ticker:"MEX",value:"281066754391919467235791"}}}};expect(v(t)).toEqual([t.description])}),test("Add liquidity",()=>{let{action:t}={action:{category:"mex",name:"addLiquidity",description:"Added liquidity for 0.309893556225986569 WEGLD and 88246.97734239037166522 MEX",arguments:{transfers:[{name:"WrappedEGLD",collection:"WEGLD-bd4d79",identifier:"WEGLD-bd4d79",ticker:"WEGLD",value:"309893556225986569"},{name:"MEX",collection:"MEX-455c57",identifier:"MEX-455c57",ticker:"MEX",value:"88246977342390371665220"}]}}};expect(v(t)).toEqual(["Added liquidity for",{token:[t.arguments.transfers[0]]},"and",{token:[t.arguments.transfers[1]]}])}),test("Remove liquidity",()=>{let{action:t}={action:{category:"mex",name:"removeLiquidity",description:"Removed liquidity 0.297 EGLDMEX",arguments:{transfers:{name:"EGLDMEXLP",collection:"EGLDMEX-0be9e5",identifier:"EGLDMEX-0be9e5",ticker:"EGLDMEX",value:"297000000000000000"}}}};expect(v(t)).toEqual(["Removed liquidity with ",{token:t.arguments.transfers}])})}); /*! * 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=transactionActionUnwrapper.test.js.map