@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
86 lines (85 loc) • 34.5 kB
JavaScript
"use strict";var Ir=Object.create;var N=Object.defineProperty;var Cr=Object.getOwnPropertyDescriptor;var Sr=Object.getOwnPropertyNames;var Mr=Object.getPrototypeOf,Lr=Object.prototype.hasOwnProperty;var Dr=(e,r)=>()=>(e&&(r=e(e=0)),r);var $=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Rr=(e,r)=>{for(var t in r)N(e,t,{get:r[t],enumerable:!0})},nr=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Sr(r))!Lr.call(e,i)&&i!==t&&N(e,i,{get:()=>r[i],enumerable:!(n=Cr(r,i))||n.enumerable});return e};var X=(e,r,t)=>(t=e!=null?Ir(Mr(e)):{},nr(r||!e||!e.__esModule?N(t,"default",{value:e,enumerable:!0}):t,e)),kr=e=>nr(N({},"__esModule",{value:!0}),e);var ar=$(H=>{"use strict";_();H.byteLength=$r;H.toByteArray=Wr;H.fromByteArray=zr;var b=[],d=[],Nr=typeof Uint8Array!="undefined"?Uint8Array:Array,J="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(S=0,ir=J.length;S<ir;++S)b[S]=J[S],d[J.charCodeAt(S)]=S;var S,ir;d["-".charCodeAt(0)]=62;d["_".charCodeAt(0)]=63;function or(e){var r=e.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var n=t===r?0:4-t%4;return[t,n]}function $r(e){var r=or(e),t=r[0],n=r[1];return(t+n)*3/4-n}function Hr(e,r,t){return(r+t)*3/4-t}function Wr(e){var r,t=or(e),n=t[0],i=t[1],o=new Nr(Hr(e,n,i)),a=0,c=i>0?n-4:n,p;for(p=0;p<c;p+=4)r=d[e.charCodeAt(p)]<<18|d[e.charCodeAt(p+1)]<<12|d[e.charCodeAt(p+2)]<<6|d[e.charCodeAt(p+3)],o[a++]=r>>16&255,o[a++]=r>>8&255,o[a++]=r&255;return i===2&&(r=d[e.charCodeAt(p)]<<2|d[e.charCodeAt(p+1)]>>4,o[a++]=r&255),i===1&&(r=d[e.charCodeAt(p)]<<10|d[e.charCodeAt(p+1)]<<4|d[e.charCodeAt(p+2)]>>2,o[a++]=r>>8&255,o[a++]=r&255),o}function Yr(e){return b[e>>18&63]+b[e>>12&63]+b[e>>6&63]+b[e&63]}function qr(e,r,t){for(var n,i=[],o=r;o<t;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(Yr(n));return i.join("")}function zr(e){for(var r,t=e.length,n=t%3,i=[],o=16383,a=0,c=t-n;a<c;a+=o)i.push(qr(e,a,a+o>c?c:a+o));return n===1?(r=e[t-1],i.push(b[r>>2]+b[r<<4&63]+"==")):n===2&&(r=(e[t-2]<<8)+e[t-1],i.push(b[r>>10]+b[r>>4&63]+b[r<<2&63]+"=")),i.join("")}});var sr=$(O=>{_();O.read=function(e,r,t,n,i){var o,a,c=i*8-n-1,p=(1<<c)-1,u=p>>1,f=-7,l=t?i-1:0,y=t?-1:1,w=e[r+l];for(l+=y,o=w&(1<<-f)-1,w>>=-f,f+=c;f>0;o=o*256+e[r+l],l+=y,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=a*256+e[r+l],l+=y,f-=8);if(o===0)o=1-u;else{if(o===p)return a?NaN:(w?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-u}return(w?-1:1)*a*Math.pow(2,o-n)};O.write=function(e,r,t,n,i,o){var a,c,p,u=o*8-i-1,f=(1<<u)-1,l=f>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=n?0:o-1,I=n?1:-1,G=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+l>=1?r+=y/p:r+=y*Math.pow(2,1-l),r*p>=2&&(a++,p/=2),a+l>=f?(c=0,a=f):a+l>=1?(c=(r*p-1)*Math.pow(2,i),a=a+l):(c=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[t+w]=c&255,w+=I,c/=256,i-=8);for(a=a<<i|c,u+=i;u>0;e[t+w]=a&255,w+=I,a/=256,u-=8);e[t+w-I]|=G*128}});var br=$(R=>{"use strict";_();var Q=ar(),D=sr(),cr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;R.Buffer=s;R.SlowBuffer=Vr;R.INSPECT_MAX_BYTES=50;var W=2147483647;R.kMaxLength=W;s.TYPED_ARRAY_SUPPORT=Gr();!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 Gr(){try{var e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch(t){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 v(e){if(e>W)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return Object.setPrototypeOf(r,s.prototype),r}function s(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return P(e)}return ur(e,r,t)}s.poolSize=8192;function ur(e,r,t){if(typeof e=="string")return Jr(e,r);if(ArrayBuffer.isView(e))return Or(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(T(e,ArrayBuffer)||e&&T(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(T(e,SharedArrayBuffer)||e&&T(e.buffer,SharedArrayBuffer)))return K(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return s.from(n,r,t);var i=Qr(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return s.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}s.from=function(e,r,t){return ur(e,r,t)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function fr(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 Xr(e,r,t){return fr(e),e<=0?v(e):r!==void 0?typeof t=="string"?v(e).fill(r,t):v(e).fill(r):v(e)}s.alloc=function(e,r,t){return Xr(e,r,t)};function P(e){return fr(e),v(e<0?0:j(e)|0)}s.allocUnsafe=function(e){return P(e)};s.allocUnsafeSlow=function(e){return P(e)};function Jr(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var t=hr(e,r)|0,n=v(t),i=n.write(e,r);return i!==t&&(n=n.slice(0,i)),n}function V(e){for(var r=e.length<0?0:j(e.length)|0,t=v(r),n=0;n<r;n+=1)t[n]=e[n]&255;return t}function Or(e){if(T(e,Uint8Array)){var r=new Uint8Array(e);return K(r.buffer,r.byteOffset,r.byteLength)}return V(e)}function K(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return r===void 0&&t===void 0?n=new Uint8Array(e):t===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,t),Object.setPrototypeOf(n,s.prototype),n}function Qr(e){if(s.isBuffer(e)){var r=j(e.length)|0,t=v(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||rr(e.length)?v(0):V(e);if(e.type==="Buffer"&&Array.isArray(e.data))return V(e.data)}function j(e){if(e>=W)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+W.toString(16)+" bytes");return e|0}function Vr(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==s.prototype};s.compare=function(r,t){if(T(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),T(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(r)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;for(var n=r.length,i=t.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==t[o]){n=r[o],i=t[o];break}return n<i?-1:i<n?1:0};s.isEncoding=function(r){switch(String(r).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(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<r.length;++n)t+=r[n].length;var i=s.allocUnsafe(t),o=0;for(n=0;n<r.length;++n){var a=r[n];if(T(a,Uint8Array))o+a.length>i.length?s.from(a).copy(i,o):Uint8Array.prototype.set.call(i,a,o);else if(s.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function hr(e,r){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||T(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 t=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return dr(e).length;default:if(i)return n?-1:Z(e).length;r=(""+r).toLowerCase(),i=!0}}s.byteLength=hr;function Kr(e,r,t){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return at(this,r,t);case"utf8":case"utf-8":return mr(this,r,t);case"ascii":return it(this,r,t);case"latin1":case"binary":return ot(this,r,t);case"base64":return et(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return st(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function M(e,r,t){var n=e[r];e[r]=e[t],e[t]=n}s.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)M(this,t,t+1);return this};s.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)M(this,t,t+3),M(this,t+1,t+2);return this};s.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)M(this,t,t+7),M(this,t+1,t+6),M(this,t+2,t+5),M(this,t+3,t+4);return this};s.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?mr(this,0,r):Kr.apply(this,arguments)};s.prototype.toLocaleString=s.prototype.toString;s.prototype.equals=function(r){if(!s.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.inspect=function(){var r="",t=R.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};cr&&(s.prototype[cr]=s.prototype.inspect);s.prototype.compare=function(r,t,n,i,o){if(T(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),t<0||n>r.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===r)return 0;for(var a=o-i,c=n-t,p=Math.min(a,c),u=this.slice(i,o),f=r.slice(t,n),l=0;l<p;++l)if(u[l]!==f[l]){a=u[l],c=f[l];break}return a<c?-1:c<a?1:0};function _r(e,r,t,n,i){if(e.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,rr(t)&&(t=i?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(i)return-1;t=e.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),s.isBuffer(r))return r.length===0?-1:pr(e,r,t,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):pr(e,[r],t,n,i);throw new TypeError("val must be string, number or Buffer")}function pr(e,r,t,n,i){var o=1,a=e.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,a/=2,c/=2,t/=2}function p(w,I){return o===1?w[I]:w.readUInt16BE(I*o)}var u;if(i){var f=-1;for(u=t;u<a;u++)if(p(e,u)===p(r,f===-1?0:u-f)){if(f===-1&&(f=u),u-f+1===c)return f*o}else f!==-1&&(u-=u-f),f=-1}else for(t+c>a&&(t=a-c),u=t;u>=0;u--){for(var l=!0,y=0;y<c;y++)if(p(e,u+y)!==p(r,y)){l=!1;break}if(l)return u}return-1}s.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1};s.prototype.indexOf=function(r,t,n){return _r(this,r,t,n,!0)};s.prototype.lastIndexOf=function(r,t,n){return _r(this,r,t,n,!1)};function Zr(e,r,t,n){t=Number(t)||0;var i=e.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(rr(c))return a;e[t+a]=c}return a}function Pr(e,r,t,n){return Y(Z(r,e.length-t),e,t,n)}function jr(e,r,t,n){return Y(lt(r),e,t,n)}function rt(e,r,t,n){return Y(dr(r),e,t,n)}function tt(e,r,t,n){return Y(ut(r,e.length-t),e,t,n)}s.prototype.write=function(r,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),r.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 Zr(this,r,t,n);case"utf8":case"utf-8":return Pr(this,r,t,n);case"ascii":case"latin1":case"binary":return jr(this,r,t,n);case"base64":return rt(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tt(this,r,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function et(e,r,t){return r===0&&t===e.length?Q.fromByteArray(e):Q.fromByteArray(e.slice(r,t))}function mr(e,r,t){t=Math.min(e.length,t);for(var n=[],i=r;i<t;){var o=e[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=t){var p,u,f,l;switch(c){case 1:o<128&&(a=o);break;case 2:p=e[i+1],(p&192)===128&&(l=(o&31)<<6|p&63,l>127&&(a=l));break;case 3:p=e[i+1],u=e[i+2],(p&192)===128&&(u&192)===128&&(l=(o&15)<<12|(p&63)<<6|u&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:p=e[i+1],u=e[i+2],f=e[i+3],(p&192)===128&&(u&192)===128&&(f&192)===128&&(l=(o&15)<<18|(p&63)<<12|(u&63)<<6|f&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=c}return nt(n)}var lr=4096;function nt(e){var r=e.length;if(r<=lr)return String.fromCharCode.apply(String,e);for(var t="",n=0;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=lr));return t}function it(e,r,t){var n="";t=Math.min(e.length,t);for(var i=r;i<t;++i)n+=String.fromCharCode(e[i]&127);return n}function ot(e,r,t){var n="";t=Math.min(e.length,t);for(var i=r;i<t;++i)n+=String.fromCharCode(e[i]);return n}function at(e,r,t){var n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);for(var i="",o=r;o<t;++o)i+=ft[e[o]];return i}function st(e,r,t){for(var n=e.slice(r,t),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}s.prototype.slice=function(r,t){var n=this.length;r=~~r,t=t===void 0?n:~~t,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<r&&(t=r);var i=this.subarray(r,t);return Object.setPrototypeOf(i,s.prototype),i};function m(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||m(r,t,this.length);for(var i=this[r],o=1,a=0;++a<t&&(o*=256);)i+=this[r+a]*o;return i};s.prototype.readUintBE=s.prototype.readUIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||m(r,t,this.length);for(var i=this[r+--t],o=1;t>0&&(o*=256);)i+=this[r+--t]*o;return i};s.prototype.readUint8=s.prototype.readUInt8=function(r,t){return r=r>>>0,t||m(r,1,this.length),this[r]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||m(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||m(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||m(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUint32BE=s.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||m(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||m(r,t,this.length);for(var i=this[r],o=1,a=0;++a<t&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i};s.prototype.readIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||m(r,t,this.length);for(var i=t,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*t)),a};s.prototype.readInt8=function(r,t){return r=r>>>0,t||m(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,t){r=r>>>0,t||m(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,t){r=r>>>0,t||m(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,t){return r=r>>>0,t||m(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,t){return r=r>>>0,t||m(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,t){return r=r>>>0,t||m(r,4,this.length),D.read(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,t){return r=r>>>0,t||m(r,4,this.length),D.read(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||m(r,8,this.length),D.read(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||m(r,8,this.length),D.read(this,r,!1,52,8)};function x(e,r,t,n,i,o){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;x(this,r,t,n,o,0)}var a=1,c=0;for(this[t]=r&255;++c<n&&(a*=256);)this[t+c]=r/a&255;return t+n};s.prototype.writeUintBE=s.prototype.writeUIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;x(this,r,t,n,o,0)}var a=n-1,c=1;for(this[t+a]=r&255;--a>=0&&(c*=256);)this[t+a]=r/c&255;return t+n};s.prototype.writeUint8=s.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,1,255,0),this[t]=r&255,t+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};s.prototype.writeIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){var o=Math.pow(2,8*n-1);x(this,r,t,n,o-1,-o)}var a=0,c=1,p=0;for(this[t]=r&255;++a<n&&(c*=256);)r<0&&p===0&&this[t+a-1]!==0&&(p=1),this[t+a]=(r/c>>0)-p&255;return t+n};s.prototype.writeIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){var o=Math.pow(2,8*n-1);x(this,r,t,n,o-1,-o)}var a=n-1,c=1,p=0;for(this[t+a]=r&255;--a>=0&&(c*=256);)r<0&&p===0&&this[t+a+1]!==0&&(p=1),this[t+a]=(r/c>>0)-p&255;return t+n};s.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};s.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};s.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};s.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};s.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function yr(e,r,t,n,i,o){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function wr(e,r,t,n,i){return r=+r,t=t>>>0,i||yr(e,r,t,4,34028234663852886e22,-34028234663852886e22),D.write(e,r,t,n,23,4),t+4}s.prototype.writeFloatLE=function(r,t,n){return wr(this,r,t,!0,n)};s.prototype.writeFloatBE=function(r,t,n){return wr(this,r,t,!1,n)};function xr(e,r,t,n,i){return r=+r,t=t>>>0,i||yr(e,r,t,8,17976931348623157e292,-17976931348623157e292),D.write(e,r,t,n,52,8),t+8}s.prototype.writeDoubleLE=function(r,t,n){return xr(this,r,t,!0,n)};s.prototype.writeDoubleBE=function(r,t,n){return xr(this,r,t,!1,n)};s.prototype.copy=function(r,t,n,i){if(!s.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=r.length&&(t=r.length),t||(t=0),i>0&&i<n&&(i=n),i===n||r.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),r.length-t<i-n&&(i=r.length-t+n);var o=i-n;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(r,this.subarray(n,i),t),o};s.prototype.fill=function(r,t,n,i){if(typeof r=="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"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){var o=r.charCodeAt(0);(i==="utf8"&&o<128||i==="latin1")&&(r=o)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));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,r||(r=0);var a;if(typeof r=="number")for(a=t;a<n;++a)this[a]=r;else{var c=s.isBuffer(r)?r:s.from(r,i),p=c.length;if(p===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(a=0;a<n-t;++a)this[a+t]=c[a%p]}return this};var ct=/[^+/0-9A-Za-z-_]/g;function pt(e){if(e=e.split("=")[0],e=e.trim().replace(ct,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Z(e,r){r=r||1/0;for(var t,n=e.length,i=null,o=[],a=0;a<n;++a){if(t=e.charCodeAt(a),t>55295&&t<57344){if(!i){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=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 lt(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function ut(e,r){for(var t,n,i,o=[],a=0;a<e.length&&!((r-=2)<0);++a)t=e.charCodeAt(a),n=t>>8,i=t%256,o.push(i),o.push(n);return o}function dr(e){return Q.toByteArray(pt(e))}function Y(e,r,t,n){for(var i=0;i<n&&!(i+t>=r.length||i>=e.length);++i)r[i+t]=e[i];return i}function T(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function rr(e){return e!==e}var ft=function(){for(var e="0123456789abcdef",r=new Array(256),t=0;t<16;++t)for(var n=t*16,i=0;i<16;++i)r[n+i]=e[t]+e[i];return r}()});var Ar=$((vt,Fr)=>{_();var h=Fr.exports={},g,E;function tr(){throw new Error("setTimeout has not been defined")}function er(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?g=setTimeout:g=tr}catch(e){g=tr}try{typeof clearTimeout=="function"?E=clearTimeout:E=er}catch(e){E=er}})();function Tr(e){if(g===setTimeout)return setTimeout(e,0);if((g===tr||!g)&&setTimeout)return g=setTimeout,setTimeout(e,0);try{return g(e,0)}catch(r){try{return g.call(null,e,0)}catch(t){return g.call(this,e,0)}}}function ht(e){if(E===clearTimeout)return clearTimeout(e);if((E===er||!E)&&clearTimeout)return E=clearTimeout,clearTimeout(e);try{return E(e)}catch(r){try{return E.call(null,e)}catch(t){return E.call(this,e)}}}var B=[],k=!1,L,q=-1;function _t(){!k||!L||(k=!1,L.length?B=L.concat(B):q=-1,B.length&&gr())}function gr(){if(!k){var e=Tr(_t);k=!0;for(var r=B.length;r;){for(L=B,B=[];++q<r;)L&&L[q].run();q=-1,r=B.length}L=null,k=!1,ht(e)}}h.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];B.push(new Er(e,r)),B.length===1&&!k&&Tr(gr)};function Er(e,r){this.fun=e,this.array=r}Er.prototype.run=function(){this.fun.apply(null,this.array)};h.title="browser";h.browser=!0;h.env={};h.argv=[];h.version="";h.versions={};function U(){}h.on=U;h.addListener=U;h.once=U;h.off=U;h.removeListener=U;h.removeAllListeners=U;h.emit=U;h.prependListener=U;h.prependOnceListener=U;h.listeners=function(e){return[]};h.binding=function(e){throw new Error("process.binding is not supported")};h.cwd=function(){return"/"};h.chdir=function(e){throw new Error("process.chdir is not supported")};h.umask=function(){return 0}});var F,A,Bt,_=Dr(()=>{F=X(br()),A=X(Ar()),Bt=function(e){function r(){var n=this||self;return delete e.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return r();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:r});var t=__magic__;return t}(Object)});var bt={};Rr(bt,{TimeAgo:()=>dt});module.exports=kr(bt);_();_();var z=X(require("react"));_();function mt(e){let r=Math.floor(e/864e5),t=e%(24*60*60*1e3),n=Math.floor(t/(60*60*1e3)),i=t%(60*60*1e3),o=Math.floor(i/(60*1e3)),a=i%(60*1e3),c=Math.floor(a/1e3),p=c+" sec",u=o+" min",f=n+" hr",l=r+" day";if(c>1&&(p=c+" sec"),o>1&&(u=o+" min"),n>1&&(f=n+" hrs"),r>1&&(l=r+" days"),r>=1)return l+" "+f;if(n>=1){let y=o===0?"":" "+u;return f+y}if(o>=1){let y=c===0?"":" "+p;return u+y}return p}function yt(e){let r=e.split(" ");return r.length>1?`${r[0]} ${r[1]}`:e}function wt(e){let t=new Date().getTime()-e;return Math.max(t,0)}function vr(e,r=!0){let t=wt(e),n=mt(t);return r?yt(n):n}_();function Br({value:e,noSeconds:r,utc:t}){let n=new Date(e*1e3),[,i]=n.toLocaleString("en-US",{hour:"numeric",hour12:!0}).split(" "),o=n.toUTCString(),[,a]=o.split(","),[c,p,u,f]=a.trim().split(" "),[l,y,w]=f.split(":"),I=`:${w}`,G=`${l}:${y}${r?"":I}`;return`${p} ${c}, ${u} ${G} ${i}${t?" UTC":""}`}_();var xt=`.dapp-core-component__transactionsTable-styles__transactions-table {
border: none;
box-shadow: 0 0.75rem 1.875rem 0 rgba(90, 97, 105, 0.05);
border-radius: 0.75rem;
color: #000;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__transactions-table-header {
border-bottom: none !important;
border-radius: 0.75rem !important;
padding: 1.75rem 2rem;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__transactions-table-header h6 {
margin-bottom: 0;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper {
overflow-x: auto;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table {
white-space: nowrap;
max-height: 500px;
width: 100%;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table tr {
border-top: 1px solid #e2e2e2;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table th {
white-space: nowrap;
padding: 0.75rem !important;
background-color: #fbfbfb;
border: 0;
vertical-align: middle;
font-weight: 400;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table th:first-child {
padding-left: 2rem !important;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table td {
white-space: nowrap;
width: 0.1%;
white-space: nowrap;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table td:first-child {
padding-left: 1.25rem !important;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table .dapp-core-component__transactionsTable-styles__transaction-cell {
padding: 0;
margin: 0.75rem;
font-variant-numeric: slashed-zero;
color: #000;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table .dapp-core-component__transactionsTable-styles__transaction-cell a {
color: #1f43f4 !important;
font-weight: 500;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table .dapp-core-component__transactionsTable-styles__transaction-cell-margin {
margin-left: 0;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table .dapp-core-component__transactionsTable-styles__transaction-cell-margin [class*=left] span,
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table .dapp-core-component__transactionsTable-styles__transaction-cell-margin [class*=right] span {
font-size: 1rem;
color: #1f43f4 !important;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table .dapp-core-component__transactionsTable-styles__transaction-cell-margin [class*=ellipsis] {
color: #1f43f4 !important;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table .dapp-core-component__transactionsTable-styles__transaction-cell-overflow {
max-width: 9rem;
overflow: hidden;
text-overflow: ellipsis;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table .dapp-core-component__transactionsTable-styles__transaction-cell-link {
position: relative;
text-decoration: none;
}
.dapp-core-component__transactionsTable-styles__transactions-table .dapp-core-component__transactionsTable-styles__table-wrapper .dapp-core-component__transactionsTable-styles__table .dapp-core-component__transactionsTable-styles__transaction-cell-font-small {
font-size: 0.75rem;
}`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(xt));var Ur={"transactions-table":"dapp-core-component__transactionsTable-styles__transactions-table",transactionsTable:"dapp-core-component__transactionsTable-styles__transactions-table","transactions-table-header":"dapp-core-component__transactionsTable-styles__transactions-table-header",transactionsTableHeader:"dapp-core-component__transactionsTable-styles__transactions-table-header","table-wrapper":"dapp-core-component__transactionsTable-styles__table-wrapper",tableWrapper:"dapp-core-component__transactionsTable-styles__table-wrapper",table:"dapp-core-component__transactionsTable-styles__table","transaction-cell":"dapp-core-component__transactionsTable-styles__transaction-cell",transactionCell:"dapp-core-component__transactionsTable-styles__transaction-cell","transaction-cell-margin":"dapp-core-component__transactionsTable-styles__transaction-cell-margin",transactionCellMargin:"dapp-core-component__transactionsTable-styles__transaction-cell-margin","transaction-cell-overflow":"dapp-core-component__transactionsTable-styles__transaction-cell-overflow",transactionCellOverflow:"dapp-core-component__transactionsTable-styles__transaction-cell-overflow","transaction-cell-link":"dapp-core-component__transactionsTable-styles__transaction-cell-link",transactionCellLink:"dapp-core-component__transactionsTable-styles__transaction-cell-link","transaction-cell-font-small":"dapp-core-component__transactionsTable-styles__transaction-cell-font-small",transactionCellFontSmall:"dapp-core-component__transactionsTable-styles__transaction-cell-font-small"};var dt=({value:e,short:r=!1,tooltip:t=!1})=>{let n=vr(e*1e3,r),i=t?z.default.createElement("span",{title:Br({value:e,noSeconds:!1,utc:!0}),"data-testid":`timeAgo-${e}`},n):z.default.createElement("span",{"data-testid":`timeAgo-${e}`},n);return z.default.createElement("span",{className:Ur.transactionCell},i)};0&&(module.exports={TimeAgo});
/*!
* 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