@ultrade/shared 1.0.28 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/constants/index.js +1 -1
- package/dist/browser/enums/index.js +1 -1
- package/dist/browser/helpers/codex/common.helper.js +1 -1
- package/dist/browser/helpers/codex/index.js +2 -2
- package/dist/browser/helpers/codex/mbr.helper.js +1 -1
- package/dist/browser/helpers/codex/mna.helper.js +1 -1
- package/dist/browser/helpers/codex/order.helper.js +1 -1
- package/dist/browser/helpers/codex/setGlobal.helper.js +1 -1
- package/dist/browser/helpers/codex/transfer.helper.js +2 -2
- package/dist/browser/helpers/codex/txn.helper.js +1 -1
- package/dist/browser/helpers/codex.helper.js +6 -6
- package/dist/browser/helpers/eth.helper.js +1 -1
- package/dist/browser/helpers/order.helper.js +1 -1
- package/dist/enums/db/relayer.enum.d.ts +0 -1
- package/dist/helpers/codex.helper.d.ts +0 -1
- package/dist/interfaces/algostreamer/index.d.ts +1 -2
- package/dist/node/common/index.js +1 -1
- package/dist/node/constants/index.js +1 -1
- package/dist/node/enums/index.js +1 -1
- package/dist/node/helpers/atomic.helper.js +1 -1
- package/dist/node/helpers/codex.helper.js +5 -5
- package/dist/node/helpers/pair.helper.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function gr(){throw new Error("setTimeout has not been defined")}function hr(){throw new Error("clearTimeout has not been defined")}var B=gr,P=hr;typeof globalThis.setTimeout=="function"&&(B=setTimeout);typeof globalThis.clearTimeout=="function"&&(P=clearTimeout);function xr(t){if(B===setTimeout)return setTimeout(t,0);if((B===gr||!B)&&setTimeout)return B=setTimeout,setTimeout(t,0);try{return B(t,0)}catch{try{return B.call(null,t,0)}catch{return B.call(this,t,0)}}}function pe(t){if(P===clearTimeout)return clearTimeout(t);if((P===hr||!P)&&clearTimeout)return P=clearTimeout,clearTimeout(t);try{return P(t)}catch{try{return P.call(null,t)}catch{return P.call(this,t)}}}var C=[],F=!1,k,W=-1;function le(){!F||!k||(F=!1,k.length?C=k.concat(C):W=-1,C.length&&Er())}function Er(){if(!F){var t=xr(le);F=!0;for(var r=C.length;r;){for(k=C,C=[];++W<r;)k&&k[W].run();W=-1,r=C.length}k=null,F=!1,pe(t)}}function me(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];C.push(new br(t,r)),C.length===1&&!F&&xr(Er)}function br(t,r){this.fun=t,this.array=r}br.prototype.run=function(){this.fun.apply(null,this.array)};var de="browser",fe="browser",ge=!0,he={},xe=[],Ee="",be={},Ae={},Te={};function U(){}var _e=U,ye=U,Ie=U,Re=U,we=U,Ne=U,Se=U;function Ce(t){throw new Error("process.binding is not supported")}function Oe(){return"/"}function De(t){throw new Error("process.chdir is not supported")}function Be(){return 0}var v=globalThis.performance||{},Pe=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function ke(t){var r=Pe.call(v)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Ue=new Date;function Le(){var t=new Date,r=t-Ue;return r/1e3}var p={nextTick:me,title:de,browser:ge,env:he,argv:xe,version:Ee,versions:be,on:_e,addListener:ye,once:Ie,off:Re,removeListener:we,removeAllListeners:Ne,emit:Se,binding:Ce,cwd:Oe,chdir:De,umask:Be,hrtime:ke,platform:fe,release:Ae,config:Te,uptime:Le},fr={};Object.keys(fr).forEach(t=>{let r=t.split("."),e=p;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=fr[t]:e=e[o]||(e[o]={})}});var R=[],y=[],Me=typeof Uint8Array<"u"?Uint8Array:Array,or=!1;function yr(){or=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],y[t.charCodeAt(r)]=r;y[45]=62,y[95]=63}function ve(t){or||yr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Me(c*3/4-i),n=i>0?c-4:c;var l=0;for(r=0,e=0;r<n;r+=4,e+=3)o=y[t.charCodeAt(r)]<<18|y[t.charCodeAt(r+1)]<<12|y[t.charCodeAt(r+2)]<<6|y[t.charCodeAt(r+3)],a[l++]=o>>16&255,a[l++]=o>>8&255,a[l++]=o&255;return i===2?(o=y[t.charCodeAt(r)]<<2|y[t.charCodeAt(r+1)]>>4,a[l++]=o&255):i===1&&(o=y[t.charCodeAt(r)]<<10|y[t.charCodeAt(r+1)]<<4|y[t.charCodeAt(r+2)]>>2,a[l++]=o>>8&255,a[l++]=o&255),a}function Fe(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Ye(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(Fe(n));return o.join("")}function Ar(t){or||yr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,l=e-n;c<l;c+=a)i.push(Ye(t,c,c+a>l?l:c+a));return n===1?(r=t[e-1],o+=R[r>>2],o+=R[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=R[r>>10],o+=R[r>>4&63],o+=R[r<<2&63],o+="="),i.push(o),i.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function K(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function O(t,r){if(K()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(t===null&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ir(this,t)}return Ir(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Ir(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Ke(t,r,e,n):typeof r=="string"?We(t,r,e):He(t,r)}s.from=function(t,r,e){return Ir(null,t,r,e)};s.kMaxLength=K();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Rr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ge(t,r,e,n){return Rr(r),r<=0?O(t,r):e!==void 0?typeof n=="string"?O(t,r).fill(e,n):O(t,r).fill(e):O(t,r)}s.alloc=function(t,r,e){return Ge(null,t,r,e)};function ir(t,r){if(Rr(r),t=O(t,r<0?0:ar(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return ir(null,t)};s.allocUnsafeSlow=function(t){return ir(null,t)};function We(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=wr(r,e)|0;t=O(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function nr(t,r){var e=r.length<0?0:ar(r.length)|0;t=O(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Ke(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=nr(t,r),t}function He(t,r){if(w(r)){var e=ar(r.length)|0;return t=O(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ut(r.length)?O(t,0):nr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return nr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ar(t){if(t>=K())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K().toString(16)+" bytes");return t|0}s.isBuffer=pt;function w(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!w(r)||!w(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<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,e){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(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=s.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!w(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function wr(t,r){if(w(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Pr(t).length;default:if(n)return H(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=wr;function Ve(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return et(this,r,e);case"utf8":case"utf-8":return Cr(this,r,e);case"ascii":return Ze(this,r,e);case"latin1":case"binary":return rt(this,r,e);case"base64":return je(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function L(t,r,e){var n=t[r];t[r]=t[e],t[e]=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 e=0;e<r;e+=2)L(this,e,e+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 e=0;e<r;e+=4)L(this,e,e+3),L(this,e+1,e+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 e=0;e<r;e+=8)L(this,e,e+7),L(this,e+1,e+6),L(this,e+2,e+5),L(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Cr(this,0,r):Ve.apply(this,arguments)};s.prototype.equals=function(r){if(!w(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.compare=function(r,e,n,o,i){if(!w(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,l=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<l;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function Nr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),w(r))return r.length===0?-1:Tr(t,r,e,n,o);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Tr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Tr(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function l(g,_){return i===1?g[_]:g.readUInt16BE(_*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(l(t,d)===l(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var m=!0,h=0;h<c;h++)if(l(t,d+h)!==l(r,h)){m=!1;break}if(m)return d}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return Nr(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return Nr(this,r,e,n,!1)};function $e(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function Xe(t,r,e,n){return X(H(r,t.length-e),t,e,n)}function Sr(t,r,e,n){return X(st(r),t,e,n)}function ze(t,r,e,n){return Sr(t,r,e,n)}function qe(t,r,e,n){return X(Pr(r),t,e,n)}function Je(t,r,e,n){return X(ct(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return $e(this,r,e,n);case"utf8":case"utf-8":return Xe(this,r,e,n);case"ascii":return Sr(this,r,e,n);case"latin1":case"binary":return ze(this,r,e,n);case"base64":return qe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Je(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function je(t,r,e){return r===0&&e===t.length?Ar(t):Ar(t.slice(r,e))}function Cr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var l,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:l=t[o+1],(l&192)===128&&(m=(i&31)<<6|l&63,m>127&&(a=m));break;case 3:l=t[o+1],d=t[o+2],(l&192)===128&&(d&192)===128&&(m=(i&15)<<12|(l&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:l=t[o+1],d=t[o+2],f=t[o+3],(l&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(l&63)<<12|(d&63)<<6|f&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return Qe(n)}var _r=4096;function Qe(t){var r=t.length;if(r<=_r)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=_r));return e}function Ze(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function rt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function et(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=at(t[i]);return o}function tt(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=s.prototype;else{var i=e-r;o=new s(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function E(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};s.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUInt32BE=function(r,e){return e||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return e||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return e||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),z(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),z(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),z(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),z(this,r,!1,52,8)};function A(t,r,e,n,o,i){if(!w(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function V(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):V(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):V(this,r,e,!1),e+2};function $(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):$(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):$(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=0,c=1,l=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&l===0&&this[e+a-1]!==0&&(l=1),this[e+a]=(r/c>>0)-l&255;return e+n};s.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=n-1,c=1,l=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&l===0&&this[e+a+1]!==0&&(l=1),this[e+a]=(r/c>>0)-l&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):V(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):V(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):$(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):$(this,r,e,!1),e+4};function Or(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Dr(t,r,e,n,o){return o||Or(t,r,e,4,34028234663852886e22,-34028234663852886e22),Ur(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return Dr(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return Dr(this,r,e,!1,n)};function Br(t,r,e,n,o){return o||Or(t,r,e,8,17976931348623157e292,-17976931348623157e292),Ur(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Br(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Br(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};s.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=w(r)?r:H(new s(r,o).toString()),l=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%l]}return this};var nt=/[^+\/0-9A-Za-z-_]/g;function ot(t){if(t=it(t).replace(nt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function it(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function at(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function st(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ct(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function Pr(t){return ve(ot(t))}function X(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function ut(t){return t!==t}function pt(t){return t!=null&&(!!t._isBuffer||kr(t)||lt(t))}function kr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function lt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&kr(t.slice(0,0))}function z(t,r,e,n,o){var i,a,c=o*8-n-1,l=(1<<c)-1,d=l>>1,f=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+m],m+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+m],m+=h,f-=8);if(i===0)i=1-d;else{if(i===l)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function Ur(t,r,e,n,o,i){var a,c,l,d=i*8-o-1,f=(1<<d)-1,m=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,_=n?1:-1,tr=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*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+m>=1?r+=h/l:r+=h*Math.pow(2,1-m),r*l>=2&&(a++,l/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*l-1)*Math.pow(2,o),a=a+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=_,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=_,a/=256,d-=8);t[e+g-_]|=tr*128}import*as x from"ethereumjs-util";import Vp from"algosdk";import*as pn from"bs58";import $o from"algosdk";import Sn,{decodeAddress as Cn,encodeAddress as On}from"algosdk";var N=[],I=[],mt=typeof Uint8Array<"u"?Uint8Array:Array,cr=!1;function Fr(){cr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)N[r]=t[r],I[t.charCodeAt(r)]=r;I[45]=62,I[95]=63}function dt(t){cr||Fr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new mt(c*3/4-i),n=i>0?c-4:c;var l=0;for(r=0,e=0;r<n;r+=4,e+=3)o=I[t.charCodeAt(r)]<<18|I[t.charCodeAt(r+1)]<<12|I[t.charCodeAt(r+2)]<<6|I[t.charCodeAt(r+3)],a[l++]=o>>16&255,a[l++]=o>>8&255,a[l++]=o&255;return i===2?(o=I[t.charCodeAt(r)]<<2|I[t.charCodeAt(r+1)]>>4,a[l++]=o&255):i===1&&(o=I[t.charCodeAt(r)]<<10|I[t.charCodeAt(r+1)]<<4|I[t.charCodeAt(r+2)]>>2,a[l++]=o>>8&255,a[l++]=o&255),a}function ft(t){return N[t>>18&63]+N[t>>12&63]+N[t>>6&63]+N[t&63]}function gt(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(ft(n));return o.join("")}function Lr(t){cr||Fr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,l=e-n;c<l;c+=a)i.push(gt(t,c,c+a>l?l:c+a));return n===1?(r=t[e-1],o+=N[r>>2],o+=N[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=N[r>>10],o+=N[r>>4&63],o+=N[r<<2&63],o+="="),i.push(o),i.join("")}function j(t,r,e,n,o){var i,a,c=o*8-n-1,l=(1<<c)-1,d=l>>1,f=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+m],m+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+m],m+=h,f-=8);if(i===0)i=1-d;else{if(i===l)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function Yr(t,r,e,n,o,i){var a,c,l,d=i*8-o-1,f=(1<<d)-1,m=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,_=n?1:-1,tr=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*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+m>=1?r+=h/l:r+=h*Math.pow(2,1-m),r*l>=2&&(a++,l/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*l-1)*Math.pow(2,o),a=a+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=_,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=_,a/=256,d-=8);t[e+g-_]|=tr*128}var ht={}.toString,Gr=Array.isArray||function(t){return ht.call(t)=="[object Array]"};var xt=50;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var yn=q();function q(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function D(t,r){if(q()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ur(this,t)}return Wr(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Wr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?At(t,r,e,n):typeof r=="string"?bt(t,r,e):Tt(t,r)}u.from=function(t,r,e){return Wr(null,t,r,e)};u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);function Kr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Et(t,r,e,n){return Kr(r),r<=0?D(t,r):e!==void 0?typeof n=="string"?D(t,r).fill(e,n):D(t,r).fill(e):D(t,r)}u.alloc=function(t,r,e){return Et(null,t,r,e)};function ur(t,r){if(Kr(r),t=D(t,r<0?0:pr(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return ur(null,t)};u.allocUnsafeSlow=function(t){return ur(null,t)};function bt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Hr(r,e)|0;t=D(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function sr(t,r){var e=r.length<0?0:pr(r.length)|0;t=D(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function At(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=sr(t,r),t}function Tt(t,r){if(S(r)){var e=pr(r.length)|0;return t=D(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Yt(r.length)?D(t,0):sr(t,r);if(r.type==="Buffer"&&Gr(r.data))return sr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function pr(t){if(t>=q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+q().toString(16)+" bytes");return t|0}u.isBuffer=Gt;function S(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};u.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}};u.concat=function(r,e){if(!Gr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=u.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!S(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Hr(t,r){if(S(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return jr(t).length;default:if(n)return J(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=Hr;function _t(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Bt(this,r,e);case"utf8":case"utf-8":return Xr(this,r,e);case"ascii":return Ot(this,r,e);case"latin1":case"binary":return Dt(this,r,e);case"base64":return St(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.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 e=0;e<r;e+=2)M(this,e,e+1);return this};u.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 e=0;e<r;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};u.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 e=0;e<r;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Xr(this,0,r):_t.apply(this,arguments)};u.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",e=xt;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};u.prototype.compare=function(r,e,n,o,i){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,l=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<l;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function Vr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),S(r))return r.length===0?-1:Mr(t,r,e,n,o);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Mr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Mr(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function l(g,_){return i===1?g[_]:g.readUInt16BE(_*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(l(t,d)===l(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var m=!0,h=0;h<c;h++)if(l(t,d+h)!==l(r,h)){m=!1;break}if(m)return d}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return Vr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return Vr(this,r,e,n,!1)};function yt(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function It(t,r,e,n){return rr(J(r,t.length-e),t,e,n)}function $r(t,r,e,n){return rr(vt(r),t,e,n)}function Rt(t,r,e,n){return $r(t,r,e,n)}function wt(t,r,e,n){return rr(jr(r),t,e,n)}function Nt(t,r,e,n){return rr(Ft(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return yt(this,r,e,n);case"utf8":case"utf-8":return It(this,r,e,n);case"ascii":return $r(this,r,e,n);case"latin1":case"binary":return Rt(this,r,e,n);case"base64":return wt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function St(t,r,e){return r===0&&e===t.length?Lr(t):Lr(t.slice(r,e))}function Xr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var l,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:l=t[o+1],(l&192)===128&&(m=(i&31)<<6|l&63,m>127&&(a=m));break;case 3:l=t[o+1],d=t[o+2],(l&192)===128&&(d&192)===128&&(m=(i&15)<<12|(l&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:l=t[o+1],d=t[o+2],f=t[o+3],(l&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(l&63)<<12|(d&63)<<6|f&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return Ct(n)}var vr=4096;function Ct(t){var r=t.length;if(r<=vr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=vr));return e}function Ot(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Dt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function Bt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=Mt(t[i]);return o}function Pt(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(u.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=u.prototype;else{var i=e-r;o=new u(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function b(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};u.prototype.readUInt8=function(r,e){return e||b(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||b(r,4,this.length),j(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),j(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),j(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),j(this,r,!1,52,8)};function T(t,r,e,n,o,i){if(!S(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function Q(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):Q(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):Q(this,r,e,!1),e+2};function Z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):Z(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Z(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=0,c=1,l=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&l===0&&this[e+a-1]!==0&&(l=1),this[e+a]=(r/c>>0)-l&255;return e+n};u.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=n-1,c=1,l=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&l===0&&this[e+a+1]!==0&&(l=1),this[e+a]=(r/c>>0)-l&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):Q(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):Q(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Z(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Z(this,r,e,!1),e+4};function zr(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function qr(t,r,e,n,o){return o||zr(t,r,e,4),Yr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return qr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return qr(this,r,e,!1,n)};function Jr(t,r,e,n,o){return o||zr(t,r,e,8),Yr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return Jr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return Jr(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};u.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!u.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=S(r)?r:J(new u(r,o).toString()),l=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%l]}return this};var kt=/[^+\/0-9A-Za-z-_]/g;function Ut(t){if(t=Lt(t).replace(kt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Lt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Mt(t){return t<16?"0"+t.toString(16):t.toString(16)}function J(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function vt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Ft(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function jr(t){return dt(Ut(t))}function rr(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function Yt(t){return t!==t}function Gt(t){return t!=null&&(!!t._isBuffer||Qr(t)||Wt(t))}function Qr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Wt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Qr(t.slice(0,0))}import{encodeAddress as Kt,decodeAddress as Ln}from"algosdk";function lr(t){return new Uint8Array(u.from(t))}import Ht from"bignumber.js";Ht.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var to=`{"theme1":{"value":"${p.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${p.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${p.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var re={V1_1:"v1_1",V2:"v2"},ao={[re.V1_1]:{testnet:62368684,mainnet:552635992},[re.V2]:{testnet:148607e3,mainnet:1002541853}};import Np from"algosdk";import*as an from"bs58";import xi from"algosdk";import wi from"algosdk";import au from"algosdk";var Wi={SMALLESTUNIT:p.env.SMALLEST_UNIT},Ki={SMALLEST_UNITS:p.env.SMALLEST_UNIT};var zi=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var ea=p.env.REACT_APP_API_URL,ta=p.env.REACT_APP_SOCKET_URL,na=p.env.REACT_APP_ALGO_SERVER,oa=p.env.REACT_APP_ALGO_SERVER_PORT||"",ia=p.env.REACT_APP_ALGOD_TOKEN||"",aa=p.env.REACT_APP_DISPENSER_LINK,sa=p.env.REACT_APP_FRONTEND_LINK||"",ca=p.env.REACT_APP_ALGO_EXPLORER_LINK,ua=p.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,pa=(p.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",la=p.env.REACT_APP_USERBACK_ACCESS_TOKEN,ma=(p.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var da=.001*10**6,fa=.002*10**6;var ga=p.env.REACT_APP_MASTER_APP_ID||"406",ha=p.env.REACT_APP_AGG_APP_ID||"408",xa=Number(p.env.REACT_APP_CODEX_APP_ID||"467960617");var Jt=p.env.REACT_APP_ALGO_NETWORK||"";var Ea=Jt.toLowerCase()==="mainnet"?"mainnet":"testnet";var ee=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(ee||{}),te=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(te||{}),Rs={...ee,...te};var Hc={1:"canFollowAccounts",4:"canLikeTweets",2:"canCreateTweets",3:"canCreateTweets"};import gu from"algosdk";import Nu from"algosdk";import Hu from"algosdk";var ln=(t,r)=>r===8?"MX":r===1?"":`Ethereum Signed Message:
|
|
1
|
+
function gr(){throw new Error("setTimeout has not been defined")}function hr(){throw new Error("clearTimeout has not been defined")}var B=gr,P=hr;typeof globalThis.setTimeout=="function"&&(B=setTimeout);typeof globalThis.clearTimeout=="function"&&(P=clearTimeout);function xr(t){if(B===setTimeout)return setTimeout(t,0);if((B===gr||!B)&&setTimeout)return B=setTimeout,setTimeout(t,0);try{return B(t,0)}catch{try{return B.call(null,t,0)}catch{return B.call(this,t,0)}}}function pe(t){if(P===clearTimeout)return clearTimeout(t);if((P===hr||!P)&&clearTimeout)return P=clearTimeout,clearTimeout(t);try{return P(t)}catch{try{return P.call(null,t)}catch{return P.call(this,t)}}}var O=[],F=!1,k,W=-1;function le(){!F||!k||(F=!1,k.length?O=k.concat(O):W=-1,O.length&&Er())}function Er(){if(!F){var t=xr(le);F=!0;for(var r=O.length;r;){for(k=O,O=[];++W<r;)k&&k[W].run();W=-1,r=O.length}k=null,F=!1,pe(t)}}function me(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];O.push(new br(t,r)),O.length===1&&!F&&xr(Er)}function br(t,r){this.fun=t,this.array=r}br.prototype.run=function(){this.fun.apply(null,this.array)};var de="browser",fe="browser",ge=!0,he={},xe=[],Ee="",be={},Ae={},Te={};function U(){}var _e=U,ye=U,Ie=U,Re=U,we=U,Ne=U,Se=U;function Oe(t){throw new Error("process.binding is not supported")}function Ce(){return"/"}function De(t){throw new Error("process.chdir is not supported")}function Be(){return 0}var v=globalThis.performance||{},Pe=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function ke(t){var r=Pe.call(v)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Ue=new Date;function Le(){var t=new Date,r=t-Ue;return r/1e3}var p={nextTick:me,title:de,browser:ge,env:he,argv:xe,version:Ee,versions:be,on:_e,addListener:ye,once:Ie,off:Re,removeListener:we,removeAllListeners:Ne,emit:Se,binding:Oe,cwd:Ce,chdir:De,umask:Be,hrtime:ke,platform:fe,release:Ae,config:Te,uptime:Le},fr={};Object.keys(fr).forEach(t=>{let r=t.split("."),e=p;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=fr[t]:e=e[o]||(e[o]={})}});var R=[],y=[],Me=typeof Uint8Array<"u"?Uint8Array:Array,or=!1;function yr(){or=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],y[t.charCodeAt(r)]=r;y[45]=62,y[95]=63}function ve(t){or||yr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Me(c*3/4-i),n=i>0?c-4:c;var l=0;for(r=0,e=0;r<n;r+=4,e+=3)o=y[t.charCodeAt(r)]<<18|y[t.charCodeAt(r+1)]<<12|y[t.charCodeAt(r+2)]<<6|y[t.charCodeAt(r+3)],a[l++]=o>>16&255,a[l++]=o>>8&255,a[l++]=o&255;return i===2?(o=y[t.charCodeAt(r)]<<2|y[t.charCodeAt(r+1)]>>4,a[l++]=o&255):i===1&&(o=y[t.charCodeAt(r)]<<10|y[t.charCodeAt(r+1)]<<4|y[t.charCodeAt(r+2)]>>2,a[l++]=o>>8&255,a[l++]=o&255),a}function Fe(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Ye(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(Fe(n));return o.join("")}function Ar(t){or||yr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,l=e-n;c<l;c+=a)i.push(Ye(t,c,c+a>l?l:c+a));return n===1?(r=t[e-1],o+=R[r>>2],o+=R[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=R[r>>10],o+=R[r>>4&63],o+=R[r<<2&63],o+="="),i.push(o),i.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function K(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(t,r){if(K()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(t===null&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ir(this,t)}return Ir(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Ir(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Ke(t,r,e,n):typeof r=="string"?We(t,r,e):He(t,r)}s.from=function(t,r,e){return Ir(null,t,r,e)};s.kMaxLength=K();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Rr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ge(t,r,e,n){return Rr(r),r<=0?C(t,r):e!==void 0?typeof n=="string"?C(t,r).fill(e,n):C(t,r).fill(e):C(t,r)}s.alloc=function(t,r,e){return Ge(null,t,r,e)};function ir(t,r){if(Rr(r),t=C(t,r<0?0:ar(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return ir(null,t)};s.allocUnsafeSlow=function(t){return ir(null,t)};function We(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=wr(r,e)|0;t=C(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function nr(t,r){var e=r.length<0?0:ar(r.length)|0;t=C(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Ke(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=nr(t,r),t}function He(t,r){if(w(r)){var e=ar(r.length)|0;return t=C(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ut(r.length)?C(t,0):nr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return nr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ar(t){if(t>=K())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K().toString(16)+" bytes");return t|0}s.isBuffer=pt;function w(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!w(r)||!w(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<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,e){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(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=s.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!w(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function wr(t,r){if(w(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Pr(t).length;default:if(n)return H(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=wr;function Ve(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return et(this,r,e);case"utf8":case"utf-8":return Or(this,r,e);case"ascii":return Ze(this,r,e);case"latin1":case"binary":return rt(this,r,e);case"base64":return je(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function L(t,r,e){var n=t[r];t[r]=t[e],t[e]=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 e=0;e<r;e+=2)L(this,e,e+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 e=0;e<r;e+=4)L(this,e,e+3),L(this,e+1,e+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 e=0;e<r;e+=8)L(this,e,e+7),L(this,e+1,e+6),L(this,e+2,e+5),L(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Or(this,0,r):Ve.apply(this,arguments)};s.prototype.equals=function(r){if(!w(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.compare=function(r,e,n,o,i){if(!w(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,l=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<l;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function Nr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),w(r))return r.length===0?-1:Tr(t,r,e,n,o);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Tr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Tr(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function l(g,_){return i===1?g[_]:g.readUInt16BE(_*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(l(t,d)===l(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var m=!0,h=0;h<c;h++)if(l(t,d+h)!==l(r,h)){m=!1;break}if(m)return d}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return Nr(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return Nr(this,r,e,n,!1)};function $e(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function Xe(t,r,e,n){return X(H(r,t.length-e),t,e,n)}function Sr(t,r,e,n){return X(st(r),t,e,n)}function ze(t,r,e,n){return Sr(t,r,e,n)}function qe(t,r,e,n){return X(Pr(r),t,e,n)}function Je(t,r,e,n){return X(ct(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return $e(this,r,e,n);case"utf8":case"utf-8":return Xe(this,r,e,n);case"ascii":return Sr(this,r,e,n);case"latin1":case"binary":return ze(this,r,e,n);case"base64":return qe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Je(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function je(t,r,e){return r===0&&e===t.length?Ar(t):Ar(t.slice(r,e))}function Or(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var l,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:l=t[o+1],(l&192)===128&&(m=(i&31)<<6|l&63,m>127&&(a=m));break;case 3:l=t[o+1],d=t[o+2],(l&192)===128&&(d&192)===128&&(m=(i&15)<<12|(l&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:l=t[o+1],d=t[o+2],f=t[o+3],(l&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(l&63)<<12|(d&63)<<6|f&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return Qe(n)}var _r=4096;function Qe(t){var r=t.length;if(r<=_r)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=_r));return e}function Ze(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function rt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function et(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=at(t[i]);return o}function tt(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=s.prototype;else{var i=e-r;o=new s(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function E(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};s.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUInt32BE=function(r,e){return e||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return e||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return e||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),z(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),z(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),z(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),z(this,r,!1,52,8)};function A(t,r,e,n,o,i){if(!w(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function V(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):V(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):V(this,r,e,!1),e+2};function $(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):$(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):$(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=0,c=1,l=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&l===0&&this[e+a-1]!==0&&(l=1),this[e+a]=(r/c>>0)-l&255;return e+n};s.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=n-1,c=1,l=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&l===0&&this[e+a+1]!==0&&(l=1),this[e+a]=(r/c>>0)-l&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):V(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):V(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):$(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):$(this,r,e,!1),e+4};function Cr(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Dr(t,r,e,n,o){return o||Cr(t,r,e,4,34028234663852886e22,-34028234663852886e22),Ur(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return Dr(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return Dr(this,r,e,!1,n)};function Br(t,r,e,n,o){return o||Cr(t,r,e,8,17976931348623157e292,-17976931348623157e292),Ur(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Br(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Br(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};s.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=w(r)?r:H(new s(r,o).toString()),l=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%l]}return this};var nt=/[^+\/0-9A-Za-z-_]/g;function ot(t){if(t=it(t).replace(nt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function it(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function at(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function st(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ct(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function Pr(t){return ve(ot(t))}function X(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function ut(t){return t!==t}function pt(t){return t!=null&&(!!t._isBuffer||kr(t)||lt(t))}function kr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function lt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&kr(t.slice(0,0))}function z(t,r,e,n,o){var i,a,c=o*8-n-1,l=(1<<c)-1,d=l>>1,f=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+m],m+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+m],m+=h,f-=8);if(i===0)i=1-d;else{if(i===l)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function Ur(t,r,e,n,o,i){var a,c,l,d=i*8-o-1,f=(1<<d)-1,m=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,_=n?1:-1,tr=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*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+m>=1?r+=h/l:r+=h*Math.pow(2,1-m),r*l>=2&&(a++,l/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*l-1)*Math.pow(2,o),a=a+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=_,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=_,a/=256,d-=8);t[e+g-_]|=tr*128}import*as x from"ethereumjs-util";import Vp from"algosdk";import*as pn from"bs58";import $o from"algosdk";import Sn,{decodeAddress as On,encodeAddress as Cn}from"algosdk";var N=[],I=[],mt=typeof Uint8Array<"u"?Uint8Array:Array,cr=!1;function Fr(){cr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)N[r]=t[r],I[t.charCodeAt(r)]=r;I[45]=62,I[95]=63}function dt(t){cr||Fr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new mt(c*3/4-i),n=i>0?c-4:c;var l=0;for(r=0,e=0;r<n;r+=4,e+=3)o=I[t.charCodeAt(r)]<<18|I[t.charCodeAt(r+1)]<<12|I[t.charCodeAt(r+2)]<<6|I[t.charCodeAt(r+3)],a[l++]=o>>16&255,a[l++]=o>>8&255,a[l++]=o&255;return i===2?(o=I[t.charCodeAt(r)]<<2|I[t.charCodeAt(r+1)]>>4,a[l++]=o&255):i===1&&(o=I[t.charCodeAt(r)]<<10|I[t.charCodeAt(r+1)]<<4|I[t.charCodeAt(r+2)]>>2,a[l++]=o>>8&255,a[l++]=o&255),a}function ft(t){return N[t>>18&63]+N[t>>12&63]+N[t>>6&63]+N[t&63]}function gt(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(ft(n));return o.join("")}function Lr(t){cr||Fr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,l=e-n;c<l;c+=a)i.push(gt(t,c,c+a>l?l:c+a));return n===1?(r=t[e-1],o+=N[r>>2],o+=N[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=N[r>>10],o+=N[r>>4&63],o+=N[r<<2&63],o+="="),i.push(o),i.join("")}function j(t,r,e,n,o){var i,a,c=o*8-n-1,l=(1<<c)-1,d=l>>1,f=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+m],m+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+m],m+=h,f-=8);if(i===0)i=1-d;else{if(i===l)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function Yr(t,r,e,n,o,i){var a,c,l,d=i*8-o-1,f=(1<<d)-1,m=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,_=n?1:-1,tr=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*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+m>=1?r+=h/l:r+=h*Math.pow(2,1-m),r*l>=2&&(a++,l/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*l-1)*Math.pow(2,o),a=a+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=_,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=_,a/=256,d-=8);t[e+g-_]|=tr*128}var ht={}.toString,Gr=Array.isArray||function(t){return ht.call(t)=="[object Array]"};var xt=50;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var yn=q();function q(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function D(t,r){if(q()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ur(this,t)}return Wr(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Wr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?At(t,r,e,n):typeof r=="string"?bt(t,r,e):Tt(t,r)}u.from=function(t,r,e){return Wr(null,t,r,e)};u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);function Kr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Et(t,r,e,n){return Kr(r),r<=0?D(t,r):e!==void 0?typeof n=="string"?D(t,r).fill(e,n):D(t,r).fill(e):D(t,r)}u.alloc=function(t,r,e){return Et(null,t,r,e)};function ur(t,r){if(Kr(r),t=D(t,r<0?0:pr(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return ur(null,t)};u.allocUnsafeSlow=function(t){return ur(null,t)};function bt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Hr(r,e)|0;t=D(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function sr(t,r){var e=r.length<0?0:pr(r.length)|0;t=D(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function At(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=sr(t,r),t}function Tt(t,r){if(S(r)){var e=pr(r.length)|0;return t=D(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Yt(r.length)?D(t,0):sr(t,r);if(r.type==="Buffer"&&Gr(r.data))return sr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function pr(t){if(t>=q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+q().toString(16)+" bytes");return t|0}u.isBuffer=Gt;function S(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};u.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}};u.concat=function(r,e){if(!Gr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=u.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!S(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Hr(t,r){if(S(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return jr(t).length;default:if(n)return J(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=Hr;function _t(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Bt(this,r,e);case"utf8":case"utf-8":return Xr(this,r,e);case"ascii":return Ct(this,r,e);case"latin1":case"binary":return Dt(this,r,e);case"base64":return St(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.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 e=0;e<r;e+=2)M(this,e,e+1);return this};u.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 e=0;e<r;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};u.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 e=0;e<r;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Xr(this,0,r):_t.apply(this,arguments)};u.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",e=xt;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};u.prototype.compare=function(r,e,n,o,i){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,l=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<l;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function Vr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),S(r))return r.length===0?-1:Mr(t,r,e,n,o);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Mr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Mr(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function l(g,_){return i===1?g[_]:g.readUInt16BE(_*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(l(t,d)===l(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var m=!0,h=0;h<c;h++)if(l(t,d+h)!==l(r,h)){m=!1;break}if(m)return d}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return Vr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return Vr(this,r,e,n,!1)};function yt(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function It(t,r,e,n){return rr(J(r,t.length-e),t,e,n)}function $r(t,r,e,n){return rr(vt(r),t,e,n)}function Rt(t,r,e,n){return $r(t,r,e,n)}function wt(t,r,e,n){return rr(jr(r),t,e,n)}function Nt(t,r,e,n){return rr(Ft(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return yt(this,r,e,n);case"utf8":case"utf-8":return It(this,r,e,n);case"ascii":return $r(this,r,e,n);case"latin1":case"binary":return Rt(this,r,e,n);case"base64":return wt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function St(t,r,e){return r===0&&e===t.length?Lr(t):Lr(t.slice(r,e))}function Xr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var l,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:l=t[o+1],(l&192)===128&&(m=(i&31)<<6|l&63,m>127&&(a=m));break;case 3:l=t[o+1],d=t[o+2],(l&192)===128&&(d&192)===128&&(m=(i&15)<<12|(l&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:l=t[o+1],d=t[o+2],f=t[o+3],(l&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(l&63)<<12|(d&63)<<6|f&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return Ot(n)}var vr=4096;function Ot(t){var r=t.length;if(r<=vr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=vr));return e}function Ct(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Dt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function Bt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=Mt(t[i]);return o}function Pt(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(u.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=u.prototype;else{var i=e-r;o=new u(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function b(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};u.prototype.readUInt8=function(r,e){return e||b(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||b(r,4,this.length),j(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),j(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),j(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),j(this,r,!1,52,8)};function T(t,r,e,n,o,i){if(!S(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function Q(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):Q(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):Q(this,r,e,!1),e+2};function Z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):Z(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Z(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=0,c=1,l=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&l===0&&this[e+a-1]!==0&&(l=1),this[e+a]=(r/c>>0)-l&255;return e+n};u.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=n-1,c=1,l=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&l===0&&this[e+a+1]!==0&&(l=1),this[e+a]=(r/c>>0)-l&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):Q(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):Q(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Z(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Z(this,r,e,!1),e+4};function zr(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function qr(t,r,e,n,o){return o||zr(t,r,e,4),Yr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return qr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return qr(this,r,e,!1,n)};function Jr(t,r,e,n,o){return o||zr(t,r,e,8),Yr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return Jr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return Jr(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};u.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!u.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=S(r)?r:J(new u(r,o).toString()),l=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%l]}return this};var kt=/[^+\/0-9A-Za-z-_]/g;function Ut(t){if(t=Lt(t).replace(kt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Lt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Mt(t){return t<16?"0"+t.toString(16):t.toString(16)}function J(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function vt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Ft(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function jr(t){return dt(Ut(t))}function rr(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function Yt(t){return t!==t}function Gt(t){return t!=null&&(!!t._isBuffer||Qr(t)||Wt(t))}function Qr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Wt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Qr(t.slice(0,0))}import{encodeAddress as Kt,decodeAddress as Ln}from"algosdk";function lr(t){return new Uint8Array(u.from(t))}import Ht from"bignumber.js";Ht.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var to=`{"theme1":{"value":"${p.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${p.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${p.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var re={V1_1:"v1_1",V2:"v2"},ao={[re.V1_1]:{testnet:62368684,mainnet:552635992},[re.V2]:{testnet:148607e3,mainnet:1002541853}};import Np from"algosdk";import*as an from"bs58";import xi from"algosdk";import wi from"algosdk";import au from"algosdk";var Wi={SMALLESTUNIT:p.env.SMALLEST_UNIT},Ki={SMALLEST_UNITS:p.env.SMALLEST_UNIT};var zi=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var ea=p.env.REACT_APP_API_URL,ta=p.env.REACT_APP_SOCKET_URL,na=p.env.REACT_APP_ALGO_SERVER,oa=p.env.REACT_APP_ALGO_SERVER_PORT||"",ia=p.env.REACT_APP_ALGOD_TOKEN||"",aa=p.env.REACT_APP_DISPENSER_LINK,sa=p.env.REACT_APP_FRONTEND_LINK||"",ca=p.env.REACT_APP_ALGO_EXPLORER_LINK,ua=p.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,pa=(p.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",la=p.env.REACT_APP_USERBACK_ACCESS_TOKEN,ma=(p.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var da=.001*10**6,fa=.002*10**6;var ga=p.env.REACT_APP_MASTER_APP_ID||"406",ha=p.env.REACT_APP_AGG_APP_ID||"408",xa=Number(p.env.REACT_APP_CODEX_APP_ID||"467960617");var Jt=p.env.REACT_APP_ALGO_NETWORK||"";var Ea=Jt.toLowerCase()==="mainnet"?"mainnet":"testnet";var ee=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(ee||{}),te=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(te||{}),Rs={...ee,...te};var Hc={1:"canFollowAccounts",4:"canLikeTweets",2:"canCreateTweets",3:"canCreateTweets"};import gu from"algosdk";import Nu from"algosdk";import Hu from"algosdk";var ln=(t,r)=>r===8?"MX":r===1?"":`Ethereum Signed Message:
|
|
2
2
|
${t.length}`,se=(t,r,e)=>{let n=s.from(t,r);return s.concat([lr(ln(n,e)),n])},ce=t=>{switch(t){case"ALGORAND":return 8;case"SOLANA":return 1;case"EVM":return 5;default:return 5}};function sn(t){let r=x.fromSigned(s.from(t));return BigInt(r.toString())}function dn(t){return x.toUnsigned(new x.BN(String(t)))}function cn(t){let r=dn(t);if(r.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(x.setLengthLeft(r,32))}var un=t=>{if(t.length!==32)throw new Error("Invalid address bytes. The address buffer length is not equel 32");let r=s.from(t).toString("hex");if(r.slice(0,24)!=="000000000000000000000000")throw console.log("normalizedAddress",r),new Error("Invalid normalized address");let e="0x"+r.slice(-40);if(!gn(e))throw new Error("Invalid hex address");return e},mn=t=>new Uint8Array(x.setLengthLeft(dr(t),32)),dr=t=>s.from(fn(t),"hex"),fn=t=>t.startsWith("0x")?t.slice(2):t,gn=t=>x.isValidAddress(t),ue=(t,r)=>{let e=x.keccak256(t),{r:n,s:o,v:i}=x.fromRpcSig(r);return x.ecrecover(e,i,n,o)},rl=(t,r,e,n)=>hn(se(e,n,ce("EVM")),t,r),hn=(t,r,e)=>{let n=ue(t,r);return x.bufferToHex(x.publicToAddress(n)).toLowerCase()===e.toLowerCase()},ie=t=>new Uint8Array(x.keccak256(s.from(t)));export{sn as decode32Bytes,mn as decodeAndNormalizeAddress,dr as decodeHexString,cn as encode32Bytes,un as encodeAddress,dn as encodeBigNumber,gn as isAddress,ie as keccak256,ue as recoverPublicKey,fn as unpadHexPrefix,hn as verifyMessage,rl as verifySignature};
|
|
3
3
|
/*!
|
|
4
4
|
* The buffer module from node.js, for the browser.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function K(){throw new Error("setTimeout has not been defined")}function z(){throw new Error("clearTimeout has not been defined")}var N=K,C=z;typeof globalThis.setTimeout=="function"&&(N=setTimeout);typeof globalThis.clearTimeout=="function"&&(C=clearTimeout);function J(t){if(N===setTimeout)return setTimeout(t,0);if((N===K||!N)&&setTimeout)return N=setTimeout,setTimeout(t,0);try{return N(t,0)}catch{try{return N.call(null,t,0)}catch{return N.call(this,t,0)}}}function Ar(t){if(C===clearTimeout)return clearTimeout(t);if((C===z||!C)&&clearTimeout)return C=clearTimeout,clearTimeout(t);try{return C(t)}catch{try{return C.call(null,t)}catch{return C.call(this,t)}}}var w=[],y=!1,O,U=-1;function xr(){!y||!O||(y=!1,O.length?w=O.concat(w):U=-1,w.length&&X())}function X(){if(!y){var t=J(xr);y=!0;for(var r=w.length;r;){for(O=w,w=[];++U<r;)O&&O[U].run();U=-1,r=w.length}O=null,y=!1,Ar(t)}}function Tr(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];w.push(new q(t,r)),w.length===1&&!y&&J(X)}function q(t,r){this.fun=t,this.array=r}q.prototype.run=function(){this.fun.apply(null,this.array)};var Ir="browser",wr="browser",Rr=!0,Nr={},Cr=[],Or="",dr={},Dr={},br={};function d(){}var Lr=d,yr=d,vr=d,gr=d,Ur=d,Pr=d,Br=d;function Fr(t){throw new Error("process.binding is not supported")}function kr(){return"/"}function Yr(t){throw new Error("process.chdir is not supported")}function Gr(){return 0}var L=globalThis.performance||{},Mr=L.now||L.mozNow||L.msNow||L.oNow||L.webkitNow||function(){return new Date().getTime()};function Sr(t){var r=Mr.call(L)*.001,e=Math.floor(r),i=Math.floor(r%1*1e9);return t&&(e=e-t[0],i=i-t[1],i<0&&(e--,i+=1e9)),[e,i]}var Wr=new Date;function Hr(){var t=new Date,r=t-Wr;return r/1e3}var f={nextTick:Tr,title:Ir,browser:Rr,env:Nr,argv:Cr,version:Or,versions:dr,on:Lr,addListener:yr,once:vr,off:gr,removeListener:Ur,removeAllListeners:Pr,emit:Br,binding:Fr,cwd:kr,chdir:Yr,umask:Gr,hrtime:Sr,platform:wr,release:Dr,config:br,uptime:Hr},V={};Object.keys(V).forEach(t=>{let r=t.split("."),e=f;for(let i=0;i<r.length;i++){let n=r[i];i===r.length-1?e[n]=V[t]:e=e[n]||(e[n]={})}});var T=[],A=[],Vr=typeof Uint8Array<"u"?Uint8Array:Array,S=!1;function j(){S=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)T[r]=t[r],A[t.charCodeAt(r)]=r;A[45]=62,A[95]=63}function Kr(t){S||j();var r,e,i,n,o,p,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[c-2]==="="?2:t[c-1]==="="?1:0,p=new Vr(c*3/4-o),i=o>0?c-4:c;var h=0;for(r=0,e=0;r<i;r+=4,e+=3)n=A[t.charCodeAt(r)]<<18|A[t.charCodeAt(r+1)]<<12|A[t.charCodeAt(r+2)]<<6|A[t.charCodeAt(r+3)],p[h++]=n>>16&255,p[h++]=n>>8&255,p[h++]=n&255;return o===2?(n=A[t.charCodeAt(r)]<<2|A[t.charCodeAt(r+1)]>>4,p[h++]=n&255):o===1&&(n=A[t.charCodeAt(r)]<<10|A[t.charCodeAt(r+1)]<<4|A[t.charCodeAt(r+2)]>>2,p[h++]=n>>8&255,p[h++]=n&255),p}function zr(t){return T[t>>18&63]+T[t>>12&63]+T[t>>6&63]+T[t&63]}function Jr(t,r,e){for(var i,n=[],o=r;o<e;o+=3)i=(t[o]<<16)+(t[o+1]<<8)+t[o+2],n.push(zr(i));return n.join("")}function Q(t){S||j();for(var r,e=t.length,i=e%3,n="",o=[],p=16383,c=0,h=e-i;c<h;c+=p)o.push(Jr(t,c,c+p>h?h:c+p));return i===1?(r=t[e-1],n+=T[r>>2],n+=T[r<<4&63],n+="=="):i===2&&(r=(t[e-2]<<8)+t[e-1],n+=T[r>>10],n+=T[r>>4&63],n+=T[r<<2&63],n+="="),o.push(n),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(t,r){if(P()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=a.prototype):(t===null&&(t=new a(r)),t.length=r),t}function a(t,r,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return W(this,t)}return rr(this,t,r,e)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function rr(t,r,e,i){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Qr(t,r,e,i):typeof r=="string"?qr(t,r,e):Zr(t,r)}a.from=function(t,r,e){return rr(null,t,r,e)};a.kMaxLength=P();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function er(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Xr(t,r,e,i){return er(r),r<=0?R(t,r):e!==void 0?typeof i=="string"?R(t,r).fill(e,i):R(t,r).fill(e):R(t,r)}a.alloc=function(t,r,e){return Xr(null,t,r,e)};function W(t,r){if(er(r),t=R(t,r<0?0:H(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}a.allocUnsafe=function(t){return W(null,t)};a.allocUnsafeSlow=function(t){return W(null,t)};function qr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var i=tr(r,e)|0;t=R(t,i);var n=t.write(r,e);return n!==i&&(t=t.slice(0,n)),t}function M(t,r){var e=r.length<0?0:H(r.length)|0;t=R(t,e);for(var i=0;i<e;i+=1)t[i]=r[i]&255;return t}function Qr(t,r,e,i){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(i||0))throw new RangeError("'length' is out of bounds");return e===void 0&&i===void 0?r=new Uint8Array(r):i===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,i),a.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=a.prototype):t=M(t,r),t}function Zr(t,r){if(I(r)){var e=H(r.length)|0;return t=R(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||_e(r.length)?R(t,0):M(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return M(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function H(t){if(t>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return t|0}a.isBuffer=Ae;function I(t){return!!(t!=null&&t._isBuffer)}a.compare=function(r,e){if(!I(r)||!I(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var i=r.length,n=e.length,o=0,p=Math.min(i,n);o<p;++o)if(r[o]!==e[o]){i=r[o],n=e[o];break}return i<n?-1:n<i?1:0};a.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}};a.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var i;if(e===void 0)for(e=0,i=0;i<r.length;++i)e+=r[i].length;var n=a.allocUnsafe(e),o=0;for(i=0;i<r.length;++i){var p=r[i];if(!I(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(n,o),o+=p.length}return n};function tr(t,r){if(I(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return hr(t).length;default:if(i)return B(t).length;r=(""+r).toLowerCase(),i=!0}}a.byteLength=tr;function $r(t,r,e){var i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return ce(this,r,e);case"utf8":case"utf-8":return or(this,r,e);case"ascii":return pe(this,r,e);case"latin1":case"binary":return ae(this,r,e);case"base64":return ne(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return he(this,r,e);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function D(t,r,e){var i=t[r];t[r]=t[e],t[e]=i}a.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 e=0;e<r;e+=2)D(this,e,e+1);return this};a.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 e=0;e<r;e+=4)D(this,e,e+3),D(this,e+1,e+2);return this};a.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 e=0;e<r;e+=8)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};a.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):$r.apply(this,arguments)};a.prototype.equals=function(r){if(!I(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,e,i,n,o){if(!I(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),e<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=i)return 0;if(n>=o)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var p=o-n,c=i-e,h=Math.min(p,c),u=this.slice(n,o),l=r.slice(e,i),s=0;s<h;++s)if(u[s]!==l[s]){p=u[s],c=l[s];break}return p<c?-1:c<p?1:0};function ir(t,r,e,i,n){if(t.length===0)return-1;if(typeof e=="string"?(i=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=n?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(n)return-1;e=t.length-1}else if(e<0)if(n)e=0;else return-1;if(typeof r=="string"&&(r=a.from(r,i)),I(r))return r.length===0?-1:Z(t,r,e,i,n);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Z(t,[r],e,i,n);throw new TypeError("val must be string, number or Buffer")}function Z(t,r,e,i,n){var o=1,p=t.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,p/=2,c/=2,e/=2}function h(_,b){return o===1?_[b]:_.readUInt16BE(b*o)}var u;if(n){var l=-1;for(u=e;u<p;u++)if(h(t,u)===h(r,l===-1?0:u-l)){if(l===-1&&(l=u),u-l+1===c)return l*o}else l!==-1&&(u-=u-l),l=-1}else for(e+c>p&&(e=p-c),u=e;u>=0;u--){for(var s=!0,x=0;x<c;x++)if(h(t,u+x)!==h(r,x)){s=!1;break}if(s)return u}return-1}a.prototype.includes=function(r,e,i){return this.indexOf(r,e,i)!==-1};a.prototype.indexOf=function(r,e,i){return ir(this,r,e,i,!0)};a.prototype.lastIndexOf=function(r,e,i){return ir(this,r,e,i,!1)};function jr(t,r,e,i){e=Number(e)||0;var n=t.length-e;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var p=0;p<i;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;t[e+p]=c}return p}function re(t,r,e,i){return Y(B(r,t.length-e),t,e,i)}function nr(t,r,e,i){return Y(Ee(r),t,e,i)}function ee(t,r,e,i){return nr(t,r,e,i)}function te(t,r,e,i){return Y(hr(r),t,e,i)}function ie(t,r,e,i){return Y(me(r,t.length-e),t,e,i)}a.prototype.write=function(r,e,i,n){if(e===void 0)n="utf8",i=this.length,e=0;else if(i===void 0&&typeof e=="string")n=e,i=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return jr(this,r,e,i);case"utf8":case"utf-8":return re(this,r,e,i);case"ascii":return nr(this,r,e,i);case"latin1":case"binary":return ee(this,r,e,i);case"base64":return te(this,r,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,r,e,i);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ne(t,r,e){return r===0&&e===t.length?Q(t):Q(t.slice(r,e))}function or(t,r,e){e=Math.min(t.length,e);for(var i=[],n=r;n<e;){var o=t[n],p=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=e){var h,u,l,s;switch(c){case 1:o<128&&(p=o);break;case 2:h=t[n+1],(h&192)===128&&(s=(o&31)<<6|h&63,s>127&&(p=s));break;case 3:h=t[n+1],u=t[n+2],(h&192)===128&&(u&192)===128&&(s=(o&15)<<12|(h&63)<<6|u&63,s>2047&&(s<55296||s>57343)&&(p=s));break;case 4:h=t[n+1],u=t[n+2],l=t[n+3],(h&192)===128&&(u&192)===128&&(l&192)===128&&(s=(o&15)<<18|(h&63)<<12|(u&63)<<6|l&63,s>65535&&s<1114112&&(p=s))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|p&1023),i.push(p),n+=c}return oe(i)}var $=4096;function oe(t){var r=t.length;if(r<=$)return String.fromCharCode.apply(String,t);for(var e="",i=0;i<r;)e+=String.fromCharCode.apply(String,t.slice(i,i+=$));return e}function pe(t,r,e){var i="";e=Math.min(t.length,e);for(var n=r;n<e;++n)i+=String.fromCharCode(t[n]&127);return i}function ae(t,r,e){var i="";e=Math.min(t.length,e);for(var n=r;n<e;++n)i+=String.fromCharCode(t[n]);return i}function ce(t,r,e){var i=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>i)&&(e=i);for(var n="",o=r;o<e;++o)n+=le(t[o]);return n}function he(t,r,e){for(var i=t.slice(r,e),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(r,e){var i=this.length;r=~~r,e=e===void 0?i:~~e,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),e<r&&(e=r);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(r,e),n.__proto__=a.prototype;else{var o=e-r;n=new a(o,void 0);for(var p=0;p<o;++p)n[p]=this[p+r]}return n};function E(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=this[r],o=1,p=0;++p<e&&(o*=256);)n+=this[r+p]*o;return n};a.prototype.readUIntBE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=this[r+--e],o=1;e>0&&(o*=256);)n+=this[r+--e]*o;return n};a.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUInt32LE=function(r,e){return e||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUInt32BE=function(r,e){return e||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=this[r],o=1,p=0;++p<e&&(o*=256);)n+=this[r+p]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n};a.prototype.readIntBE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=e,o=1,p=this[r+--n];n>0&&(o*=256);)p+=this[r+--n]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*e)),p};a.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(r,e){return e||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,e){return e||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),G(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),G(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),G(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),G(this,r,!1,52,8)};function m(t,r,e,i,n,o){if(!I(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(e+i>t.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(r,e,i,n){if(r=+r,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;m(this,r,e,i,o,0)}var p=1,c=0;for(this[e]=r&255;++c<i&&(p*=256);)this[e+c]=r/p&255;return e+i};a.prototype.writeUIntBE=function(r,e,i,n){if(r=+r,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;m(this,r,e,i,o,0)}var p=i-1,c=1;for(this[e+p]=r&255;--p>=0&&(c*=256);)this[e+p]=r/c&255;return e+i};a.prototype.writeUInt8=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function F(t,r,e,i){r<0&&(r=65535+r+1);for(var n=0,o=Math.min(t.length-e,2);n<o;++n)t[e+n]=(r&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}a.prototype.writeUInt16LE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};a.prototype.writeUInt16BE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};function k(t,r,e,i){r<0&&(r=4294967295+r+1);for(var n=0,o=Math.min(t.length-e,4);n<o;++n)t[e+n]=r>>>(i?n:3-n)*8&255}a.prototype.writeUInt32LE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):k(this,r,e,!0),e+4};a.prototype.writeUInt32BE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):k(this,r,e,!1),e+4};a.prototype.writeIntLE=function(r,e,i,n){if(r=+r,e=e|0,!n){var o=Math.pow(2,8*i-1);m(this,r,e,i,o-1,-o)}var p=0,c=1,h=0;for(this[e]=r&255;++p<i&&(c*=256);)r<0&&h===0&&this[e+p-1]!==0&&(h=1),this[e+p]=(r/c>>0)-h&255;return e+i};a.prototype.writeIntBE=function(r,e,i,n){if(r=+r,e=e|0,!n){var o=Math.pow(2,8*i-1);m(this,r,e,i,o-1,-o)}var p=i-1,c=1,h=0;for(this[e+p]=r&255;--p>=0&&(c*=256);)r<0&&h===0&&this[e+p+1]!==0&&(h=1),this[e+p]=(r/c>>0)-h&255;return e+i};a.prototype.writeInt8=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};a.prototype.writeInt16LE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};a.prototype.writeInt16BE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};a.prototype.writeInt32LE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):k(this,r,e,!0),e+4};a.prototype.writeInt32BE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):k(this,r,e,!1),e+4};function pr(t,r,e,i,n,o){if(e+i>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ar(t,r,e,i,n){return n||pr(t,r,e,4,34028234663852886e22,-34028234663852886e22),fr(t,r,e,i,23,4),e+4}a.prototype.writeFloatLE=function(r,e,i){return ar(this,r,e,!0,i)};a.prototype.writeFloatBE=function(r,e,i){return ar(this,r,e,!1,i)};function cr(t,r,e,i,n){return n||pr(t,r,e,8,17976931348623157e292,-17976931348623157e292),fr(t,r,e,i,52,8),e+8}a.prototype.writeDoubleLE=function(r,e,i){return cr(this,r,e,!0,i)};a.prototype.writeDoubleBE=function(r,e,i){return cr(this,r,e,!1,i)};a.prototype.copy=function(r,e,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),e>=r.length&&(e=r.length),e||(e=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-e<n-i&&(n=r.length-e+i);var o=n-i,p;if(this===r&&i<e&&e<n)for(p=o-1;p>=0;--p)r[p+e]=this[p+i];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+e]=this[p+i];else Uint8Array.prototype.set.call(r,this.subarray(i,i+o),e);return o};a.prototype.fill=function(r,e,i,n){if(typeof r=="string"){if(typeof e=="string"?(n=e,e=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;e=e>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<i;++p)this[p]=r;else{var c=I(r)?r:B(new a(r,n).toString()),h=c.length;for(p=0;p<i-e;++p)this[p+e]=c[p%h]}return this};var se=/[^+\/0-9A-Za-z-_]/g;function fe(t){if(t=ue(t).replace(se,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ue(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function le(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,r){r=r||1/0;for(var e,i=t.length,n=null,o=[],p=0;p<i;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!n){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),n=e;continue}e=(n-55296<<10|e-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Ee(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function me(t,r){for(var e,i,n,o=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),i=e>>8,n=e%256,o.push(n),o.push(i);return o}function hr(t){return Kr(fe(t))}function Y(t,r,e,i){for(var n=0;n<i&&!(n+e>=r.length||n>=t.length);++n)r[n+e]=t[n];return n}function _e(t){return t!==t}function Ae(t){return t!=null&&(!!t._isBuffer||sr(t)||xe(t))}function sr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function xe(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&sr(t.slice(0,0))}function G(t,r,e,i,n){var o,p,c=n*8-i-1,h=(1<<c)-1,u=h>>1,l=-7,s=e?n-1:0,x=e?-1:1,_=t[r+s];for(s+=x,o=_&(1<<-l)-1,_>>=-l,l+=c;l>0;o=o*256+t[r+s],s+=x,l-=8);for(p=o&(1<<-l)-1,o>>=-l,l+=i;l>0;p=p*256+t[r+s],s+=x,l-=8);if(o===0)o=1-u;else{if(o===h)return p?NaN:(_?-1:1)*(1/0);p=p+Math.pow(2,i),o=o-u}return(_?-1:1)*p*Math.pow(2,o-i)}function fr(t,r,e,i,n,o){var p,c,h,u=o*8-n-1,l=(1<<u)-1,s=l>>1,x=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=i?0:o-1,b=i?1:-1,_r=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=l):(p=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-p))<1&&(p--,h*=2),p+s>=1?r+=x/h:r+=x*Math.pow(2,1-s),r*h>=2&&(p++,h/=2),p+s>=l?(c=0,p=l):p+s>=1?(c=(r*h-1)*Math.pow(2,n),p=p+s):(c=r*Math.pow(2,s-1)*Math.pow(2,n),p=0));n>=8;t[e+_]=c&255,_+=b,c/=256,n-=8);for(p=p<<n|c,u+=n;u>0;t[e+_]=p&255,_+=b,p/=256,u-=8);t[e+_-b]|=_r*128}var ur=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(ur||{}),v=ur;var lr=(n=>(n[n.Limit=0]="Limit",n[n.IOC=1]="IOC",n[n.POST=2]="POST",n[n.Market=3]="Market",n))(lr||{}),g=lr;var Er=(n=>(n.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",n.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",n.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",n.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",n))(Er||{}),mr=(i=>(i.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",i.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",i.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",i))(mr||{}),bt={...Er,...mr};function Ki(t){switch(t){case"B":return v.Buy;case"S":return v.Sell;default:throw new Error("Unknown order side short type: "+t)}}function zi(t){switch(t){case v.Buy:return"B";case v.Sell:return"S";default:throw new Error("Unknown order side type: "+t)}}function Ji(t){switch(t){case"I":return g.IOC;case"P":return g.POST;case"M":return g.Market;default:return g.Limit}}function Xi(t){switch(t){case"B":return"BUY";case"S":return"SELL";default:throw new Error("Unknown order side short type: "+t)}}function qi(t){switch(t){case"I":return"IOC";case"P":return"POST";case"M":return"Market";default:return"Limit"}}export{Ki as mapOrderSideFromShort,Xi as mapOrderSideFromShortToLong,zi as mapOrderSideToShort,Ji as mapOrderTypeShort,qi as mapOrderTypeShortToLong};
|
|
1
|
+
function K(){throw new Error("setTimeout has not been defined")}function z(){throw new Error("clearTimeout has not been defined")}var N=K,C=z;typeof globalThis.setTimeout=="function"&&(N=setTimeout);typeof globalThis.clearTimeout=="function"&&(C=clearTimeout);function J(t){if(N===setTimeout)return setTimeout(t,0);if((N===K||!N)&&setTimeout)return N=setTimeout,setTimeout(t,0);try{return N(t,0)}catch{try{return N.call(null,t,0)}catch{return N.call(this,t,0)}}}function Ar(t){if(C===clearTimeout)return clearTimeout(t);if((C===z||!C)&&clearTimeout)return C=clearTimeout,clearTimeout(t);try{return C(t)}catch{try{return C.call(null,t)}catch{return C.call(this,t)}}}var w=[],y=!1,O,U=-1;function xr(){!y||!O||(y=!1,O.length?w=O.concat(w):U=-1,w.length&&X())}function X(){if(!y){var t=J(xr);y=!0;for(var r=w.length;r;){for(O=w,w=[];++U<r;)O&&O[U].run();U=-1,r=w.length}O=null,y=!1,Ar(t)}}function Tr(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];w.push(new q(t,r)),w.length===1&&!y&&J(X)}function q(t,r){this.fun=t,this.array=r}q.prototype.run=function(){this.fun.apply(null,this.array)};var Ir="browser",wr="browser",Rr=!0,Nr={},Cr=[],Or="",dr={},Dr={},br={};function d(){}var Lr=d,yr=d,vr=d,gr=d,Ur=d,Pr=d,Br=d;function Fr(t){throw new Error("process.binding is not supported")}function kr(){return"/"}function Yr(t){throw new Error("process.chdir is not supported")}function Gr(){return 0}var L=globalThis.performance||{},Mr=L.now||L.mozNow||L.msNow||L.oNow||L.webkitNow||function(){return new Date().getTime()};function Sr(t){var r=Mr.call(L)*.001,e=Math.floor(r),i=Math.floor(r%1*1e9);return t&&(e=e-t[0],i=i-t[1],i<0&&(e--,i+=1e9)),[e,i]}var Wr=new Date;function Hr(){var t=new Date,r=t-Wr;return r/1e3}var s={nextTick:Tr,title:Ir,browser:Rr,env:Nr,argv:Cr,version:Or,versions:dr,on:Lr,addListener:yr,once:vr,off:gr,removeListener:Ur,removeAllListeners:Pr,emit:Br,binding:Fr,cwd:kr,chdir:Yr,umask:Gr,hrtime:Sr,platform:wr,release:Dr,config:br,uptime:Hr},V={};Object.keys(V).forEach(t=>{let r=t.split("."),e=s;for(let i=0;i<r.length;i++){let n=r[i];i===r.length-1?e[n]=V[t]:e=e[n]||(e[n]={})}});var T=[],A=[],Vr=typeof Uint8Array<"u"?Uint8Array:Array,S=!1;function j(){S=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)T[r]=t[r],A[t.charCodeAt(r)]=r;A[45]=62,A[95]=63}function Kr(t){S||j();var r,e,i,n,o,p,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[c-2]==="="?2:t[c-1]==="="?1:0,p=new Vr(c*3/4-o),i=o>0?c-4:c;var h=0;for(r=0,e=0;r<i;r+=4,e+=3)n=A[t.charCodeAt(r)]<<18|A[t.charCodeAt(r+1)]<<12|A[t.charCodeAt(r+2)]<<6|A[t.charCodeAt(r+3)],p[h++]=n>>16&255,p[h++]=n>>8&255,p[h++]=n&255;return o===2?(n=A[t.charCodeAt(r)]<<2|A[t.charCodeAt(r+1)]>>4,p[h++]=n&255):o===1&&(n=A[t.charCodeAt(r)]<<10|A[t.charCodeAt(r+1)]<<4|A[t.charCodeAt(r+2)]>>2,p[h++]=n>>8&255,p[h++]=n&255),p}function zr(t){return T[t>>18&63]+T[t>>12&63]+T[t>>6&63]+T[t&63]}function Jr(t,r,e){for(var i,n=[],o=r;o<e;o+=3)i=(t[o]<<16)+(t[o+1]<<8)+t[o+2],n.push(zr(i));return n.join("")}function Q(t){S||j();for(var r,e=t.length,i=e%3,n="",o=[],p=16383,c=0,h=e-i;c<h;c+=p)o.push(Jr(t,c,c+p>h?h:c+p));return i===1?(r=t[e-1],n+=T[r>>2],n+=T[r<<4&63],n+="=="):i===2&&(r=(t[e-2]<<8)+t[e-1],n+=T[r>>10],n+=T[r>>4&63],n+=T[r<<2&63],n+="="),o.push(n),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(t,r){if(P()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=a.prototype):(t===null&&(t=new a(r)),t.length=r),t}function a(t,r,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return W(this,t)}return rr(this,t,r,e)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function rr(t,r,e,i){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Qr(t,r,e,i):typeof r=="string"?qr(t,r,e):Zr(t,r)}a.from=function(t,r,e){return rr(null,t,r,e)};a.kMaxLength=P();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function er(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Xr(t,r,e,i){return er(r),r<=0?R(t,r):e!==void 0?typeof i=="string"?R(t,r).fill(e,i):R(t,r).fill(e):R(t,r)}a.alloc=function(t,r,e){return Xr(null,t,r,e)};function W(t,r){if(er(r),t=R(t,r<0?0:H(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}a.allocUnsafe=function(t){return W(null,t)};a.allocUnsafeSlow=function(t){return W(null,t)};function qr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var i=tr(r,e)|0;t=R(t,i);var n=t.write(r,e);return n!==i&&(t=t.slice(0,n)),t}function M(t,r){var e=r.length<0?0:H(r.length)|0;t=R(t,e);for(var i=0;i<e;i+=1)t[i]=r[i]&255;return t}function Qr(t,r,e,i){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(i||0))throw new RangeError("'length' is out of bounds");return e===void 0&&i===void 0?r=new Uint8Array(r):i===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,i),a.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=a.prototype):t=M(t,r),t}function Zr(t,r){if(I(r)){var e=H(r.length)|0;return t=R(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||_e(r.length)?R(t,0):M(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return M(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function H(t){if(t>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return t|0}a.isBuffer=Ae;function I(t){return!!(t!=null&&t._isBuffer)}a.compare=function(r,e){if(!I(r)||!I(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var i=r.length,n=e.length,o=0,p=Math.min(i,n);o<p;++o)if(r[o]!==e[o]){i=r[o],n=e[o];break}return i<n?-1:n<i?1:0};a.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}};a.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var i;if(e===void 0)for(e=0,i=0;i<r.length;++i)e+=r[i].length;var n=a.allocUnsafe(e),o=0;for(i=0;i<r.length;++i){var p=r[i];if(!I(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(n,o),o+=p.length}return n};function tr(t,r){if(I(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return hr(t).length;default:if(i)return B(t).length;r=(""+r).toLowerCase(),i=!0}}a.byteLength=tr;function $r(t,r,e){var i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return ce(this,r,e);case"utf8":case"utf-8":return or(this,r,e);case"ascii":return pe(this,r,e);case"latin1":case"binary":return ae(this,r,e);case"base64":return ne(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return he(this,r,e);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function D(t,r,e){var i=t[r];t[r]=t[e],t[e]=i}a.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 e=0;e<r;e+=2)D(this,e,e+1);return this};a.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 e=0;e<r;e+=4)D(this,e,e+3),D(this,e+1,e+2);return this};a.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 e=0;e<r;e+=8)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};a.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):$r.apply(this,arguments)};a.prototype.equals=function(r){if(!I(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,e,i,n,o){if(!I(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),e<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=i)return 0;if(n>=o)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var p=o-n,c=i-e,h=Math.min(p,c),u=this.slice(n,o),l=r.slice(e,i),f=0;f<h;++f)if(u[f]!==l[f]){p=u[f],c=l[f];break}return p<c?-1:c<p?1:0};function ir(t,r,e,i,n){if(t.length===0)return-1;if(typeof e=="string"?(i=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=n?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(n)return-1;e=t.length-1}else if(e<0)if(n)e=0;else return-1;if(typeof r=="string"&&(r=a.from(r,i)),I(r))return r.length===0?-1:Z(t,r,e,i,n);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Z(t,[r],e,i,n);throw new TypeError("val must be string, number or Buffer")}function Z(t,r,e,i,n){var o=1,p=t.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,p/=2,c/=2,e/=2}function h(_,b){return o===1?_[b]:_.readUInt16BE(b*o)}var u;if(n){var l=-1;for(u=e;u<p;u++)if(h(t,u)===h(r,l===-1?0:u-l)){if(l===-1&&(l=u),u-l+1===c)return l*o}else l!==-1&&(u-=u-l),l=-1}else for(e+c>p&&(e=p-c),u=e;u>=0;u--){for(var f=!0,x=0;x<c;x++)if(h(t,u+x)!==h(r,x)){f=!1;break}if(f)return u}return-1}a.prototype.includes=function(r,e,i){return this.indexOf(r,e,i)!==-1};a.prototype.indexOf=function(r,e,i){return ir(this,r,e,i,!0)};a.prototype.lastIndexOf=function(r,e,i){return ir(this,r,e,i,!1)};function jr(t,r,e,i){e=Number(e)||0;var n=t.length-e;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var p=0;p<i;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;t[e+p]=c}return p}function re(t,r,e,i){return Y(B(r,t.length-e),t,e,i)}function nr(t,r,e,i){return Y(Ee(r),t,e,i)}function ee(t,r,e,i){return nr(t,r,e,i)}function te(t,r,e,i){return Y(hr(r),t,e,i)}function ie(t,r,e,i){return Y(me(r,t.length-e),t,e,i)}a.prototype.write=function(r,e,i,n){if(e===void 0)n="utf8",i=this.length,e=0;else if(i===void 0&&typeof e=="string")n=e,i=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return jr(this,r,e,i);case"utf8":case"utf-8":return re(this,r,e,i);case"ascii":return nr(this,r,e,i);case"latin1":case"binary":return ee(this,r,e,i);case"base64":return te(this,r,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,r,e,i);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ne(t,r,e){return r===0&&e===t.length?Q(t):Q(t.slice(r,e))}function or(t,r,e){e=Math.min(t.length,e);for(var i=[],n=r;n<e;){var o=t[n],p=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=e){var h,u,l,f;switch(c){case 1:o<128&&(p=o);break;case 2:h=t[n+1],(h&192)===128&&(f=(o&31)<<6|h&63,f>127&&(p=f));break;case 3:h=t[n+1],u=t[n+2],(h&192)===128&&(u&192)===128&&(f=(o&15)<<12|(h&63)<<6|u&63,f>2047&&(f<55296||f>57343)&&(p=f));break;case 4:h=t[n+1],u=t[n+2],l=t[n+3],(h&192)===128&&(u&192)===128&&(l&192)===128&&(f=(o&15)<<18|(h&63)<<12|(u&63)<<6|l&63,f>65535&&f<1114112&&(p=f))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|p&1023),i.push(p),n+=c}return oe(i)}var $=4096;function oe(t){var r=t.length;if(r<=$)return String.fromCharCode.apply(String,t);for(var e="",i=0;i<r;)e+=String.fromCharCode.apply(String,t.slice(i,i+=$));return e}function pe(t,r,e){var i="";e=Math.min(t.length,e);for(var n=r;n<e;++n)i+=String.fromCharCode(t[n]&127);return i}function ae(t,r,e){var i="";e=Math.min(t.length,e);for(var n=r;n<e;++n)i+=String.fromCharCode(t[n]);return i}function ce(t,r,e){var i=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>i)&&(e=i);for(var n="",o=r;o<e;++o)n+=le(t[o]);return n}function he(t,r,e){for(var i=t.slice(r,e),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(r,e){var i=this.length;r=~~r,e=e===void 0?i:~~e,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),e<r&&(e=r);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(r,e),n.__proto__=a.prototype;else{var o=e-r;n=new a(o,void 0);for(var p=0;p<o;++p)n[p]=this[p+r]}return n};function E(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=this[r],o=1,p=0;++p<e&&(o*=256);)n+=this[r+p]*o;return n};a.prototype.readUIntBE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=this[r+--e],o=1;e>0&&(o*=256);)n+=this[r+--e]*o;return n};a.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUInt32LE=function(r,e){return e||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUInt32BE=function(r,e){return e||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=this[r],o=1,p=0;++p<e&&(o*=256);)n+=this[r+p]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n};a.prototype.readIntBE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=e,o=1,p=this[r+--n];n>0&&(o*=256);)p+=this[r+--n]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*e)),p};a.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(r,e){return e||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,e){return e||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),G(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),G(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),G(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),G(this,r,!1,52,8)};function m(t,r,e,i,n,o){if(!I(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(e+i>t.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(r,e,i,n){if(r=+r,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;m(this,r,e,i,o,0)}var p=1,c=0;for(this[e]=r&255;++c<i&&(p*=256);)this[e+c]=r/p&255;return e+i};a.prototype.writeUIntBE=function(r,e,i,n){if(r=+r,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;m(this,r,e,i,o,0)}var p=i-1,c=1;for(this[e+p]=r&255;--p>=0&&(c*=256);)this[e+p]=r/c&255;return e+i};a.prototype.writeUInt8=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function F(t,r,e,i){r<0&&(r=65535+r+1);for(var n=0,o=Math.min(t.length-e,2);n<o;++n)t[e+n]=(r&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}a.prototype.writeUInt16LE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};a.prototype.writeUInt16BE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};function k(t,r,e,i){r<0&&(r=4294967295+r+1);for(var n=0,o=Math.min(t.length-e,4);n<o;++n)t[e+n]=r>>>(i?n:3-n)*8&255}a.prototype.writeUInt32LE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):k(this,r,e,!0),e+4};a.prototype.writeUInt32BE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):k(this,r,e,!1),e+4};a.prototype.writeIntLE=function(r,e,i,n){if(r=+r,e=e|0,!n){var o=Math.pow(2,8*i-1);m(this,r,e,i,o-1,-o)}var p=0,c=1,h=0;for(this[e]=r&255;++p<i&&(c*=256);)r<0&&h===0&&this[e+p-1]!==0&&(h=1),this[e+p]=(r/c>>0)-h&255;return e+i};a.prototype.writeIntBE=function(r,e,i,n){if(r=+r,e=e|0,!n){var o=Math.pow(2,8*i-1);m(this,r,e,i,o-1,-o)}var p=i-1,c=1,h=0;for(this[e+p]=r&255;--p>=0&&(c*=256);)r<0&&h===0&&this[e+p+1]!==0&&(h=1),this[e+p]=(r/c>>0)-h&255;return e+i};a.prototype.writeInt8=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};a.prototype.writeInt16LE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};a.prototype.writeInt16BE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};a.prototype.writeInt32LE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):k(this,r,e,!0),e+4};a.prototype.writeInt32BE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):k(this,r,e,!1),e+4};function pr(t,r,e,i,n,o){if(e+i>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ar(t,r,e,i,n){return n||pr(t,r,e,4,34028234663852886e22,-34028234663852886e22),sr(t,r,e,i,23,4),e+4}a.prototype.writeFloatLE=function(r,e,i){return ar(this,r,e,!0,i)};a.prototype.writeFloatBE=function(r,e,i){return ar(this,r,e,!1,i)};function cr(t,r,e,i,n){return n||pr(t,r,e,8,17976931348623157e292,-17976931348623157e292),sr(t,r,e,i,52,8),e+8}a.prototype.writeDoubleLE=function(r,e,i){return cr(this,r,e,!0,i)};a.prototype.writeDoubleBE=function(r,e,i){return cr(this,r,e,!1,i)};a.prototype.copy=function(r,e,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),e>=r.length&&(e=r.length),e||(e=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-e<n-i&&(n=r.length-e+i);var o=n-i,p;if(this===r&&i<e&&e<n)for(p=o-1;p>=0;--p)r[p+e]=this[p+i];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+e]=this[p+i];else Uint8Array.prototype.set.call(r,this.subarray(i,i+o),e);return o};a.prototype.fill=function(r,e,i,n){if(typeof r=="string"){if(typeof e=="string"?(n=e,e=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;e=e>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<i;++p)this[p]=r;else{var c=I(r)?r:B(new a(r,n).toString()),h=c.length;for(p=0;p<i-e;++p)this[p+e]=c[p%h]}return this};var fe=/[^+\/0-9A-Za-z-_]/g;function se(t){if(t=ue(t).replace(fe,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ue(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function le(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,r){r=r||1/0;for(var e,i=t.length,n=null,o=[],p=0;p<i;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!n){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),n=e;continue}e=(n-55296<<10|e-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Ee(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function me(t,r){for(var e,i,n,o=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),i=e>>8,n=e%256,o.push(n),o.push(i);return o}function hr(t){return Kr(se(t))}function Y(t,r,e,i){for(var n=0;n<i&&!(n+e>=r.length||n>=t.length);++n)r[n+e]=t[n];return n}function _e(t){return t!==t}function Ae(t){return t!=null&&(!!t._isBuffer||fr(t)||xe(t))}function fr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function xe(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&fr(t.slice(0,0))}function G(t,r,e,i,n){var o,p,c=n*8-i-1,h=(1<<c)-1,u=h>>1,l=-7,f=e?n-1:0,x=e?-1:1,_=t[r+f];for(f+=x,o=_&(1<<-l)-1,_>>=-l,l+=c;l>0;o=o*256+t[r+f],f+=x,l-=8);for(p=o&(1<<-l)-1,o>>=-l,l+=i;l>0;p=p*256+t[r+f],f+=x,l-=8);if(o===0)o=1-u;else{if(o===h)return p?NaN:(_?-1:1)*(1/0);p=p+Math.pow(2,i),o=o-u}return(_?-1:1)*p*Math.pow(2,o-i)}function sr(t,r,e,i,n,o){var p,c,h,u=o*8-n-1,l=(1<<u)-1,f=l>>1,x=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=i?0:o-1,b=i?1:-1,_r=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=l):(p=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-p))<1&&(p--,h*=2),p+f>=1?r+=x/h:r+=x*Math.pow(2,1-f),r*h>=2&&(p++,h/=2),p+f>=l?(c=0,p=l):p+f>=1?(c=(r*h-1)*Math.pow(2,n),p=p+f):(c=r*Math.pow(2,f-1)*Math.pow(2,n),p=0));n>=8;t[e+_]=c&255,_+=b,c/=256,n-=8);for(p=p<<n|c,u+=n;u>0;t[e+_]=p&255,_+=b,p/=256,u-=8);t[e+_-b]|=_r*128}var ur=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(ur||{}),v=ur;var lr=(n=>(n[n.Limit=0]="Limit",n[n.IOC=1]="IOC",n[n.POST=2]="POST",n[n.Market=3]="Market",n))(lr||{}),g=lr;var Er=(n=>(n.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",n.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",n.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",n.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",n))(Er||{}),mr=(i=>(i.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",i.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",i.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",i))(mr||{}),bt={...Er,...mr};function Ki(t){switch(t){case"B":return v.Buy;case"S":return v.Sell;default:throw new Error("Unknown order side short type: "+t)}}function zi(t){switch(t){case v.Buy:return"B";case v.Sell:return"S";default:throw new Error("Unknown order side type: "+t)}}function Ji(t){switch(t){case"I":return g.IOC;case"P":return g.POST;case"M":return g.Market;default:return g.Limit}}function Xi(t){switch(t){case"B":return"BUY";case"S":return"SELL";default:throw new Error("Unknown order side short type: "+t)}}function qi(t){switch(t){case"I":return"IOC";case"P":return"POST";case"M":return"Market";default:return"Limit"}}export{Ki as mapOrderSideFromShort,Xi as mapOrderSideFromShortToLong,zi as mapOrderSideToShort,Ji as mapOrderTypeShort,qi as mapOrderTypeShortToLong};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
@@ -104,4 +104,3 @@ export declare const makeSetCompanyFeeTxn: (algoClient: algosdk.Algodv2, { fee,
|
|
|
104
104
|
export declare const makeUpdateTokenInfoTxns: (appId: number, superId: number, sender: string, params: algosdk.SuggestedParams, balances: Record<string, number>, token: PairTokenInfo) => algosdk.Transaction[];
|
|
105
105
|
export declare const makeUpdatePairInfoTxn: (appId: number, superId: number, sender: string, params: algosdk.SuggestedParams, baseToken: PairToken, priceToken: PairToken, minSize: string, minPriceIncrement: string, minSizeIncrement: string) => algosdk.Transaction;
|
|
106
106
|
export declare const getUpgradeImpMsg: (chainId: number, implementationAddress: string) => Uint8Array<ArrayBufferLike>;
|
|
107
|
-
export declare const getSetCCTPContractsMsg: (chainId: number, tokenMessengerAddress: string, messageTransmitterAddress: string) => Uint8Array<ArrayBufferLike>;
|
|
@@ -8,7 +8,6 @@ interface ICodexBalanceLog {
|
|
|
8
8
|
export interface ICodexDepositLog extends ICodexBalanceLog {
|
|
9
9
|
sender: string;
|
|
10
10
|
senderChainID: string;
|
|
11
|
-
fee?: string;
|
|
12
11
|
}
|
|
13
12
|
export interface ICodexWithdrawal extends ICodexBalanceLog {
|
|
14
13
|
destAddr: string;
|
|
@@ -42,7 +41,7 @@ export interface StreamerVaa {
|
|
|
42
41
|
tokenAddr: string;
|
|
43
42
|
tokenChainID: string;
|
|
44
43
|
sequence: string;
|
|
45
|
-
vaaType: 'withdraw' | 'deposit'
|
|
44
|
+
vaaType: 'withdraw' | 'deposit';
|
|
46
45
|
txnId: string;
|
|
47
46
|
fee: string;
|
|
48
47
|
msgHash?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var B=Object.create;var m=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var W=(e,t)=>{for(var r in t)m(e,r,{get:t[r],enumerable:!0})},x=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of M(t))!V.call(e,p)&&p!==r&&m(e,p,{get:()=>t[p],enumerable:!(o=v(t,p))||o.enumerable});return e};var K=(e,t,r)=>(r=e!=null?B(H(e)):{},x(t||!e||!e.__esModule?m(r,"default",{value:e,enumerable:!0}):r,e)),Y=e=>x(m({},"__esModule",{value:!0}),e);var be={};W(be,{Operations:()=>F,absolute:()=>Q,assert:()=>J,bn_operation:()=>s,ceil:()=>$,changes24H:()=>ce,convertFromBaseUnits:()=>se,convertToBaseUnits:()=>ae,cutEvent:()=>de,divide:()=>b,equal:()=>I,equalIgnoreCase:()=>N,floor:()=>ee,getDomains:()=>Ee,getGlobalPointSystemId:()=>j,getRandomInt:()=>le,greaterThan:()=>E,greaterThanOrEqual:()=>oe,isMaker:()=>G,lessThan:()=>ne,lessThanOrEqual:()=>pe,listDateFormat:()=>me,mapToCodexAssetDto:()=>X,mapToCodexBalanceDto:()=>q,mapToOrderTradeDto:()=>
|
|
1
|
+
var B=Object.create;var m=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var W=(e,t)=>{for(var r in t)m(e,r,{get:t[r],enumerable:!0})},x=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of M(t))!V.call(e,p)&&p!==r&&m(e,p,{get:()=>t[p],enumerable:!(o=v(t,p))||o.enumerable});return e};var K=(e,t,r)=>(r=e!=null?B(H(e)):{},x(t||!e||!e.__esModule?m(r,"default",{value:e,enumerable:!0}):r,e)),Y=e=>x(m({},"__esModule",{value:!0}),e);var be={};W(be,{Operations:()=>F,absolute:()=>Q,assert:()=>J,bn_operation:()=>s,ceil:()=>$,changes24H:()=>ce,convertFromBaseUnits:()=>se,convertToBaseUnits:()=>ae,cutEvent:()=>de,divide:()=>b,equal:()=>I,equalIgnoreCase:()=>N,floor:()=>ee,getDomains:()=>Ee,getGlobalPointSystemId:()=>j,getRandomInt:()=>le,greaterThan:()=>E,greaterThanOrEqual:()=>oe,isMaker:()=>G,lessThan:()=>ne,lessThanOrEqual:()=>pe,listDateFormat:()=>me,mapToCodexAssetDto:()=>X,mapToCodexBalanceDto:()=>q,mapToOrderTradeDto:()=>he,mapToUserTradeDto:()=>ue,maskingString:()=>A,minus:()=>h,mod:()=>w,modZero:()=>ie,multiply:()=>l,plus:()=>u,removeField:()=>T,round:()=>te,roundNumber:()=>_,toFixed:()=>Z,toUsd:()=>re});module.exports=Y(be);function X(e,t){return{id:e.id,address:e.address,chainId:e.chainId,name:e.name,unitName:e.unitName,decimals:e.decimals,isGas:e.isGas,img:e.img,cmcLink:e.cmcLink,isArchived:t?t(e):!1}}function q(e){return{hash:e.hash,loginAddress:e.loginAddress,loginChainId:e.loginChainId,tokenId:e.token?.id,tokenAddress:e.tokenId,tokenChainId:e.tokenChainId,amount:e.amount,lockedAmount:e.lockedAmount}}var L=(r=>(r[r.Buy=0]="Buy",r[r.Sell=1]="Sell",r))(L||{}),a=L;var D=(p=>(p.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",p.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",p.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",p.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",p))(D||{}),R=(o=>(o.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",o.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",o.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",o))(R||{}),ve={...D,...R};function g(e){switch(e){case a.Buy:return"B";case a.Sell:return"S";default:throw new Error("Unknown order side type: "+e)}}var J=(e,t)=>{if(!e)throw new Error(`Assertion error: ${t}`)};var j=()=>1;var n=K(require("bignumber.js"));n.default.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var F=(i=>(i.MINUS="-",i.PLUS="+",i.MULTIPLY="*",i.DIVIDE="/",i.GREATER_THAN_OR_EQUAL=">=",i.GREATER_THAN=">",i.LESS_THAN_OR_EQUAL="<=",i.LESS_THAN="<",i.EQUAL="==",i.MOD="mod",i))(F||{});function Q(e){return new n.default(e).abs().toString()}function $(e){let r=new n.default(String(e)).integerValue(n.default.ROUND_CEIL).toString();return I(e,r)||console.log("Ceil value",{value:e,res:r}),r}function Z(e,t,r=!1){let o=new n.default(String(e)),p;if(r){let c=o.toFixed(),O=c.indexOf(".");if(O>=0){let k=c.slice(O+1),C=0;for(let i of k)if(i==="0")C++;else break;let S=C+1;p=o.toFixed(S,n.default.ROUND_UP)}else p=o.toFixed(0)}else p=o.toFixed(t);return console.log("Fixed value",{value:e,res:p}),p}function ee(e){let r=new n.default(String(e)).integerValue(n.default.ROUND_FLOOR).toString();return console.log("Floor value",{value:e,res:r}),r}function te(e){let r=new n.default(String(e)).integerValue(n.default.ROUND_HALF_UP).toString();return console.log("Round value",{value:e,res:r}),r}function u(e,t){return s(e,t,"+")}function h(e,t){return s(e,t,"-")}function l(e,t){return s(e,t,"*")}function re(e,t){return l(e,t||0)}function b(e,t){return s(e,t,"/")}function oe(e,t){return!!s(e,t,">=")}function E(e,t){return!!s(e,t,">")}function pe(e,t){return!!s(e,t,"<=")}function ne(e,t){return!!s(e,t,"<")}function I(e,t){return!!s(e,t,"==")}function w(e,t){return s(e,t,"mod")}function ie(e,t){return I(w(e,t),0)}function s(e,t,r){switch(e=new n.default(String(e)),t=new n.default(String(t)),r.toLowerCase()){case"-":return e.minus(t).toString();case"+":return e.plus(t).toString();case"*":case"x":return e.multipliedBy(t).toString();case"\xF7":case"/":return e.dividedBy(t).toString();case">=":return e.isGreaterThanOrEqualTo(t);case">":return e.isGreaterThan(t);case"<=":return e.isLessThanOrEqualTo(t);case"<":return e.isLessThan(t);case"==":return e.isEqualTo(t);case"mod":return e.modulo(t);default:break}}function f(e){if(e.toString().includes("e")){let t=e.toString().split("e");return[parseFloat(t[0]),parseFloat(t[1])]}return[e,0]}function P(e,t){return e+(t<0?`e${t}`:`e+${t}`)}function _({decimalPlaces:e=0},t){if(e>0){let[r,o]=f(t),[p,c]=f(Math.round(Number(P(r,o+e))));return Number(P(p,c-e))}return Math.round(t)}function se(e,t){let r=Number(e);return _({decimalPlaces:r},Math.pow(10,-r)*Number(t))}function ae(e,t){let r=Math.pow(10,Number(e))*Number(t);return _({decimalPlaces:0},r)}var ce=(e,t)=>E(t,0)&&E(e,0)?l(b(h(e,t),t),100):"0";var me=e=>{let t=new Date(e),r=t.toLocaleDateString("default",{year:"numeric",month:"numeric",day:"numeric"}),o=t.toLocaleTimeString("en-US",{hour12:!0,hour:"2-digit",minute:"2-digit"});return r+" "+o},N=(e,t)=>String(e).toLowerCase()===String(t).toLowerCase();function le(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}function Ee(e){let t=[],r=e.split(".");for(let o=0;o<r.length-1;o++)t.push(r.slice(o).join("."));return t}function de(e){let t=e.headers&&d({Authorization:e.headers.Authorization?.substring(0,200),"CloudFront-Viewer-Country":e.headers["CloudFront-Viewer-Country"],Host:e.headers.Host,origin:e.headers.origin,Referer:e.headers.Referer,"User-Agent":e.headers["User-Agent"],"wl-domain":e.headers["wl-domain"],"X-API-Key":A(e.headers["X-API-Key"]),"X-Forwarded-For":e.headers["X-Forwarded-For"],"X-Forwarded-Port":e.headers["X-Forwarded-Port"],"X-Forwarded-Proto":e.headers["X-Forwarded-Proto"],"X-Trading-Key":e.headers["X-Trading-Key"],"X-Wallet-Address":e.headers["X-Wallet-Address"],"X-Wallet-Token":e.headers["X-Wallet-Token"],accessToken:A(e.headers.accessToken),companyId:e.headers.companyId,seasonId:e.headers.seasonId}),r=e.requestContext&&d({identity:e.requestContext.identity&&d({userAgent:e.requestContext.identity.userAgent,sourceIp:e.requestContext.identity.sourceIp}),domainName:e.requestContext.domainName});return d({manage:e.manage,path:e.path,httpMethod:e.httpMethod,headers:t,requestContext:r})}function A(e){if(!e?.length)return e;let t=Math.round(e.length/3),r=t,o=e.length-t;return e.substring(0,r)+"*".repeat(t)+e.substring(o)}function T(e,t){return Array.isArray(e)?e.map(r=>T(r,t)):typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e).filter(([r])=>r!==t).map(([r,o])=>[r,T(o,t)])):e}function d(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function ue(e,t,r){let o=e.buyOrder&&e.sellOrder?e.buyOrderId>e.sellOrderId?e.buyOrder:e.sellOrder:e.buyOrder||e.sellOrder;return{pairId:e.pairId,orderId:o?.id,orderSide:o&&g(o.side),...y(t,r),...U(e,o)}}function he(e,t,r,o,p){return{id:e.id,pairId:e.pairId,pair:r||e.pair?.pairKey,...y(o,p),amount:e.amount,price:e.price,total:e.total,filledAmount:e.filledAmount,filledTotal:e.filledTotal,avgPrice:e.excutedPrice,status:e.status,side:e.side,type:e.type,userId:e.userId,createdAt:e.createdAt?.getTime(),completedAt:e.completedAt?.getTime()||null,updatedAt:e.updatedAt?.getTime(),trades:t&&t.map(c=>U(c,e))}}function y(e,t){return{baseTokenId:e?.id,baseTokenDecimal:e?.decimals,quoteTokenId:t?.id,quoteTokenDecimal:t?.decimals}}function U(e,t){return{tradeId:e.tradeId,status:e.txStatus,amount:e.amount,total:e.total,price:e.price,fee:t&&e.tradeFees.filter(r=>N(r.address,t.userId)).reduce((r,o)=>u(r,o.fee),"0"),createdAt:e.createdAt?.getTime(),updatedAt:e.updatedAt?.getTime(),isBuyer:t&&t.side===a.Buy,isMaker:t&&G(t.side,e.tradeSide)}}function G(e,t){return e===a.Buy&&t===a.Sell||e===a.Sell&&t===a.Buy}0&&(module.exports={Operations,absolute,assert,bn_operation,ceil,changes24H,convertFromBaseUnits,convertToBaseUnits,cutEvent,divide,equal,equalIgnoreCase,floor,getDomains,getGlobalPointSystemId,getRandomInt,greaterThan,greaterThanOrEqual,isMaker,lessThan,lessThanOrEqual,listDateFormat,mapToCodexAssetDto,mapToCodexBalanceDto,mapToOrderTradeDto,mapToUserTradeDto,maskingString,minus,mod,modZero,multiply,plus,removeField,round,roundNumber,toFixed,toUsd});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var l=(t
|
|
1
|
+
var p=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var l=(r,t)=>{for(var a in t)p(r,a,{get:t[a],enumerable:!0})},A=(r,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of T(t))!b.call(r,e)&&e!==a&&p(r,e,{get:()=>t[e],enumerable:!(o=i(t,e))||o.enumerable});return r};var m=r=>A(p({},"__esModule",{value:!0}),r);var pe={};l(pe,{AGG_APP_ID:()=>q,ALGOD_TOKEN:()=>v,ALGO_EXPLORER_ASSETS_URL:()=>M,ALGO_EXPLORER_LINK:()=>k,ALGO_NETWORK:()=>_,ALGO_SERVER:()=>P,ALGO_SERVER_PORT:()=>S,API_HOST:()=>g,APP_CLOSEOUT_FEE:()=>H,BIGNUMBER:()=>I,BOOLEAN_SETTINGS:()=>C,CALCULATIONS:()=>O,CCTP_UNIFIED_ASSETS:()=>R,CODEX_APP_ID:()=>z,DAY_MILLISECONDS:()=>_e,DEFAULT_AGG_FEE:()=>j,DEFAULT_FEE_SHARE:()=>be,DEFAULT_ORDER_EXPIRATION_DAYS:()=>le,DISPENSER_LINK:()=>y,EXCHANGE_NAME:()=>W,EXPIRE_DAYS:()=>ne,EXT_ORDER_TYPES:()=>G,FACTOR_PRICE_DECIMAL:()=>ce,FEE_SCALE:()=>ie,FRONTEND_FEE_SCALE:()=>Te,FRONTEND_LINK:()=>E,GASLIMIT:()=>ee,GLOWL_DECIMAL:()=>U,IS_DEV:()=>$,JSON_ARRAY_SETTINGS:()=>D,MARKET_TRADES_SIZE:()=>B,MASTER_APP_ID:()=>X,MAX_TOKEN_DECIMAL:()=>de,MIN_ORDER_EXPIRATION_MINS:()=>Ae,NETWORK:()=>n,ORDER_BOOK_BUFFER:()=>Y,ORDER_BOOK_SIZE:()=>w,ORDER_DATA_BYTES_LENGTH:()=>me,ORDER_MSG_VERSION:()=>Re,PLATFORM_FEE:()=>J,POINTS_MAX_VALUE:()=>ae,PeraChainId:()=>te,PointSystemSettingsIds:()=>h,REACT_APP_REQUIRE_ACCESS_CODE:()=>f,RESPONSES:()=>d,RES_MSG:()=>N,SERVER:()=>u,SHARE_DATA_LENGTH:()=>Ne,SOCKET_URL:()=>x,THEMES:()=>V,ULTRADE_ID:()=>Q,USERBACK_ACCESS_TOKEN:()=>F,WITHDRAW_DATA_BYTES_LENGTH:()=>Ie,WITHDRAW_FEE:()=>K,ZERO_TIMER:()=>Z,messageForSigning:()=>L,sanitizeRegex:()=>re,twitterActionToPermissionMap:()=>oe});module.exports=m(pe);var _e=864e5,ne=30;var ce=18,ie=1e5,Te=1e3,be=9e4,le=30,Ae=60,me=328,Re=1,de=18,Ne=36,Ie=248;var R={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var d={SUCCESS:200,CREATED:201,ACCEPTED:202,NOCONTENT:204,BADREQUEST:400,FORBIDDEN:403,NOTFOUND:404,TIMEOUT:408,TOOMANYREQ:429,INTERNALSERVER:500,BADGATEWAYS:502,SERVICEUNAVILABLE:503,GATEWAYTIMEOUT:504},N={INSERT:"Data has been saved successfully.",ERROR:"Some error has been occured. Please try again.",SUCCESS:"Your request is executed successfully!",REQUIRED:"coin_type or price param is required",CAPTCHATEXTNOTFOUND:"Captcha text not found.",CAPTCHA_VERIFICATION_FAILED:"Captcha is not verified.",NOTEMPTY:"coin_type or price should not be empty",PAIR_LIST:"Pair list",PAIR_STATUS:"Pair status has been changed",ACTIVE_USERS:"Active Users",SETTINGS_NOT_FOUND:"No settings found in DB.",TRADE_IS_HALT:"Trading is disabled.",KYC_REQUIRED:"KYC is required for this action.",EMAIL_NOT_VERIFIED:"Your email is not verified.Please verify first.",NOT_BETA_USER:"Trade only works for beta user.",WRONG_PAIR_KEY:"Pair key not found.",PAIRDISABLED:"Temporarily order placement has been disabled for this pair. Please try again later.",BALANCE_NOT_SUFFICIENT:"You have insufficient balance.",MIN_TRADE_NOT_MATCHED:"Minimum trade limit does not matched.",ORDER_PLACED_SUCCESSFULLY:"Order has been placed successfully.",ORDER_NOT_FOUND:"Sorry this order id does not found.",ORDER_ALREADY_MATCHED:"Order already matched.",ORDER_ALREADY_CANCELED:"Order already cancelled.",ORDER_CANCELED_SUCCESSFULLY:"order successfully cancelled",ORDER_LIST:"Order list fetched successfully.",ORDER_EXIT:"Successfully exited from the position.",PAIRERR:"please provide pair param",ORDERSIDE:"side param is required",ORDERTYPE:"type param is required",ORDERIDREQ:"order_id param is required",ORDERDETAIL:"order detail",COMMODITYORICE:"commodity price",COMMODITYSPOT:"commodity spot updated",TOKEN_INSERTED:"ERC token has been added",PARAMREQ:"Parameter missing",EXIST:"Token Already Exist",BREACHEDTOKENS:"List of breached tokens",API_EXPOSE:{TOKEN_NOT_FOUND:"Token not found, Please get token and set to header.",ERROR:"Something went wrong, Please try again later"},LIMITED_UNITS:"ONLY {{units}} units are available. You can place your order with this amount",UNITS_UNAVAIL:"Amount unavailable",ORDER:{ERROR:"An error has been occured",UNITS_UNAVAIL:"Amount unavailable",LIMITED_UNITS:"ONLY {{units}} units are available. You can place your order with this amount",PLACED:"Order has been placed",NOPARAMS:"empty body params",ORDER_NOT_FOUND:"Sorry this order id not found.",ORDER_ALREADY_MATCHED:"Order already matched.",ORDER_ALREADY_CANCELED:"Order already cancelled.",ORDER_CANCELED_SUCCESSFULLY:"Order cancelled successfully"},DOMAIN_NOT_FOUND:"domain not found"},I={SMALLESTUNIT:process.env.SMALLEST_UNIT},O={SMALLEST_UNITS:process.env.SMALLEST_UNIT},u={AVAILABLE_ASSETS_PER_USER:1,AVAILABLE_ASSETS_PER_IP:3};var Ce=`{"theme1":{"value":"${process.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${process.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${process.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var h=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"],C=["obdex","kycTradeRequirementEnabled","newTab","reportButtons"],D=["geoblock","pinnedPairs","customMenuItems","chartInt"];var L=r=>`By signing this message, you confirm that the wallet is a trusted one ${r}; Data: `;var g=process.env.REACT_APP_API_URL,x=process.env.REACT_APP_SOCKET_URL,P=process.env.REACT_APP_ALGO_SERVER,S=process.env.REACT_APP_ALGO_SERVER_PORT||"",v=process.env.REACT_APP_ALGOD_TOKEN||"",y=process.env.REACT_APP_DISPENSER_LINK,E=process.env.REACT_APP_FRONTEND_LINK||"",k=process.env.REACT_APP_ALGO_EXPLORER_LINK,M=process.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,f=(process.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",F=process.env.REACT_APP_USERBACK_ACCESS_TOKEN,G=(process.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true",U=4,w=100,Y=50,B=50,K=.001*10**6,H=.002*10**6,W="Ultrade",V=["theme1","theme2","theme3"],X=process.env.REACT_APP_MASTER_APP_ID||"406",q=process.env.REACT_APP_AGG_APP_ID||"408",z=Number(process.env.REACT_APP_CODEX_APP_ID||"467960617"),J=3e3,_=process.env.REACT_APP_ALGO_NETWORK||"",j=.3,Q=1,$=E==="https://dev.ultradedev.net",Z="00:00",ee=1e6,n=_.toLowerCase()==="mainnet"?"mainnet":"testnet",re=/[^\p{L}\p{N} .,!?:@$%()_-]/gui,te=n==="mainnet"?416001:416002;var s=(e=>(e.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",e.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",e.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",e.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",e))(s||{}),c=(o=>(o.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",o.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",o.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",o))(c||{}),je={...s,...c};var oe={1:"canFollowAccounts",4:"canLikeTweets",2:"canCreateTweets",3:"canCreateTweets"},ae=99999999;0&&(module.exports={AGG_APP_ID,ALGOD_TOKEN,ALGO_EXPLORER_ASSETS_URL,ALGO_EXPLORER_LINK,ALGO_NETWORK,ALGO_SERVER,ALGO_SERVER_PORT,API_HOST,APP_CLOSEOUT_FEE,BIGNUMBER,BOOLEAN_SETTINGS,CALCULATIONS,CCTP_UNIFIED_ASSETS,CODEX_APP_ID,DAY_MILLISECONDS,DEFAULT_AGG_FEE,DEFAULT_FEE_SHARE,DEFAULT_ORDER_EXPIRATION_DAYS,DISPENSER_LINK,EXCHANGE_NAME,EXPIRE_DAYS,EXT_ORDER_TYPES,FACTOR_PRICE_DECIMAL,FEE_SCALE,FRONTEND_FEE_SCALE,FRONTEND_LINK,GASLIMIT,GLOWL_DECIMAL,IS_DEV,JSON_ARRAY_SETTINGS,MARKET_TRADES_SIZE,MASTER_APP_ID,MAX_TOKEN_DECIMAL,MIN_ORDER_EXPIRATION_MINS,NETWORK,ORDER_BOOK_BUFFER,ORDER_BOOK_SIZE,ORDER_DATA_BYTES_LENGTH,ORDER_MSG_VERSION,PLATFORM_FEE,POINTS_MAX_VALUE,PeraChainId,PointSystemSettingsIds,REACT_APP_REQUIRE_ACCESS_CODE,RESPONSES,RES_MSG,SERVER,SHARE_DATA_LENGTH,SOCKET_URL,THEMES,ULTRADE_ID,USERBACK_ACCESS_TOKEN,WITHDRAW_DATA_BYTES_LENGTH,WITHDRAW_FEE,ZERO_TIMER,messageForSigning,sanitizeRegex,twitterActionToPermissionMap});
|