@ultrade/shared 1.0.7 → 1.0.9
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/common/auth.helper.js +17 -0
- package/dist/browser/common/big-number.helper.js +11 -0
- package/dist/browser/common/index.js +17 -0
- package/dist/browser/common/mappers/codexAsset.mapper.js +11 -0
- package/dist/browser/common/mappers/codexBalance.mapper.js +11 -0
- package/dist/browser/common/mappers/index.js +11 -0
- package/dist/browser/common/mappers/trade.mapper.js +11 -0
- package/dist/browser/common/utils/assert.js +11 -0
- package/dist/browser/common/utils/decode.js +11 -0
- package/dist/browser/common/utils/index.js +11 -0
- package/dist/browser/common/utils/social.js +11 -0
- package/dist/browser/common/utils/stat.js +11 -0
- package/dist/browser/constants/index.js +11 -0
- package/dist/browser/enums/index.js +11 -0
- package/dist/browser/helpers/Encoding.js +17 -0
- package/dist/browser/helpers/algo.helper.js +17 -0
- package/dist/browser/helpers/assert.helper.js +11 -0
- package/dist/browser/helpers/atomic.helper.js +11 -0
- package/dist/browser/helpers/balance.helper.js +17 -0
- package/dist/browser/helpers/codex/common.helper.js +18 -0
- package/dist/browser/helpers/codex/index.js +18 -0
- package/dist/browser/helpers/codex/mbr.helper.js +17 -0
- package/dist/browser/helpers/codex/mna.helper.js +17 -0
- package/dist/browser/helpers/codex/order.helper.js +17 -0
- package/dist/browser/helpers/codex/setGlobal.helper.js +17 -0
- package/dist/browser/helpers/codex/transfer.helper.js +18 -0
- package/dist/browser/helpers/codex/txn.helper.js +17 -0
- package/dist/browser/helpers/codex.helper.js +24 -0
- package/dist/browser/helpers/eth.helper.js +18 -0
- package/dist/browser/helpers/index.js +11 -0
- package/dist/browser/helpers/interval.helpers.js +11 -0
- package/dist/browser/helpers/liquidity.helper.js +11 -0
- package/dist/browser/helpers/order.helper.js +11 -0
- package/dist/browser/helpers/pair.helper.js +11 -0
- package/dist/browser/helpers/pointSystem.helper.js +11 -0
- package/dist/browser/helpers/ticker.helpers.js +11 -0
- package/dist/browser/helpers/vaa.helper.js +11 -0
- package/dist/browser/helpers/withdraw.helper.js +18 -0
- package/dist/browser/interfaces/index.js +11 -0
- package/dist/browser/types/index.js +11 -0
- package/dist/node/common/auth.helper.js +1 -0
- package/dist/node/common/big-number.helper.js +1 -0
- package/dist/node/common/index.js +1 -0
- package/dist/node/common/mappers/codexAsset.mapper.js +1 -0
- package/dist/node/common/mappers/codexBalance.mapper.js +1 -0
- package/dist/node/common/mappers/index.js +1 -0
- package/dist/node/common/mappers/trade.mapper.js +1 -0
- package/dist/node/common/utils/assert.js +1 -0
- package/dist/node/common/utils/decode.js +1 -0
- package/dist/node/common/utils/index.js +1 -0
- package/dist/node/common/utils/social.js +1 -0
- package/dist/node/common/utils/stat.js +1 -0
- package/dist/node/constants/index.js +1 -0
- package/dist/node/enums/index.js +1 -0
- package/dist/node/helpers/Encoding.js +1 -0
- package/dist/node/helpers/algo.helper.js +1 -0
- package/dist/node/helpers/assert.helper.js +1 -0
- package/dist/node/helpers/atomic.helper.js +1 -0
- package/dist/node/helpers/balance.helper.js +1 -0
- package/dist/node/helpers/codex/common.helper.js +2 -0
- package/dist/node/helpers/codex/index.js +2 -0
- package/dist/node/helpers/codex/mbr.helper.js +1 -0
- package/dist/node/helpers/codex/mna.helper.js +1 -0
- package/dist/node/helpers/codex/order.helper.js +1 -0
- package/dist/node/helpers/codex/setGlobal.helper.js +1 -0
- package/dist/node/helpers/codex/transfer.helper.js +2 -0
- package/dist/node/helpers/codex/txn.helper.js +1 -0
- package/dist/node/helpers/codex.helper.js +8 -0
- package/dist/node/helpers/eth.helper.js +2 -0
- package/dist/node/helpers/index.js +1 -0
- package/dist/node/helpers/interval.helpers.js +1 -0
- package/dist/node/helpers/liquidity.helper.js +1 -0
- package/dist/node/helpers/order.helper.js +1 -0
- package/dist/node/helpers/pair.helper.js +1 -0
- package/dist/node/helpers/pointSystem.helper.js +1 -0
- package/dist/node/helpers/ticker.helpers.js +1 -0
- package/dist/node/helpers/vaa.helper.js +0 -0
- package/dist/node/helpers/withdraw.helper.js +2 -0
- package/dist/node/interfaces/index.js +1 -0
- package/dist/node/types/index.js +1 -0
- package/dist/src/helpers/codex/common.helper.d.ts +1 -1
- package/dist/src/helpers/vaa.helper.d.ts +0 -2
- package/package.json +25 -41
- package/dist/common/auth.helper.js +0 -1
- package/dist/common/big-number.helper.js +0 -1
- package/dist/common/index.js +0 -1
- package/dist/common/mappers/codexAsset.mapper.js +0 -1
- package/dist/common/mappers/codexBalance.mapper.js +0 -1
- package/dist/common/mappers/index.js +0 -1
- package/dist/common/mappers/trade.mapper.js +0 -1
- package/dist/common/utils/assert.js +0 -1
- package/dist/common/utils/decode.js +0 -1
- package/dist/common/utils/index.js +0 -1
- package/dist/common/utils/social.js +0 -1
- package/dist/common/utils/stat.js +0 -1
- package/dist/constants/index.js +0 -1
- package/dist/enums/index.js +0 -1
- package/dist/helpers/Encoding.js +0 -1
- package/dist/helpers/algo.helper.js +0 -1
- package/dist/helpers/assert.helper.js +0 -1
- package/dist/helpers/atomic.helper.js +0 -1
- package/dist/helpers/balance.helper.js +0 -1
- package/dist/helpers/codex/common.helper.js +0 -2
- package/dist/helpers/codex/index.js +0 -2
- package/dist/helpers/codex/mbr.helper.js +0 -1
- package/dist/helpers/codex/mna.helper.js +0 -1
- package/dist/helpers/codex/order.helper.js +0 -1
- package/dist/helpers/codex/setGlobal.helper.js +0 -1
- package/dist/helpers/codex/transfer.helper.js +0 -2
- package/dist/helpers/codex/txn.helper.js +0 -1
- package/dist/helpers/codex.helper.js +0 -8
- package/dist/helpers/eth.helper.js +0 -2
- package/dist/helpers/index.js +0 -1
- package/dist/helpers/interval.helpers.js +0 -1
- package/dist/helpers/liquidity.helper.js +0 -1
- package/dist/helpers/order.helper.js +0 -1
- package/dist/helpers/pair.helper.js +0 -1
- package/dist/helpers/pointSystem.helper.js +0 -1
- package/dist/helpers/ticker.helpers.js +0 -1
- package/dist/helpers/vaa.helper.js +0 -1
- package/dist/helpers/withdraw.helper.js +0 -2
- package/dist/interfaces/index.js +0 -1
- package/dist/types/index.js +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function Re(){throw new Error("setTimeout has not been defined")}function Oe(){throw new Error("clearTimeout has not been defined")}var U=Re,M=Oe;typeof globalThis.setTimeout=="function"&&(U=setTimeout);typeof globalThis.clearTimeout=="function"&&(M=clearTimeout);function ke(t){if(U===setTimeout)return setTimeout(t,0);if((U===Re||!U)&&setTimeout)return U=setTimeout,setTimeout(t,0);try{return U(t,0)}catch{try{return U.call(null,t,0)}catch{return U.call(this,t,0)}}}function Or(t){if(M===clearTimeout)return clearTimeout(t);if((M===Oe||!M)&&clearTimeout)return M=clearTimeout,clearTimeout(t);try{return M(t)}catch{try{return M.call(null,t)}catch{return M.call(this,t)}}}var O=[],H=!1,v,j=-1;function kr(){!H||!v||(H=!1,v.length?O=v.concat(O):j=-1,O.length&&Be())}function Be(){if(!H){var t=ke(kr);H=!0;for(var e=O.length;e;){for(v=O,O=[];++j<e;)v&&v[j].run();j=-1,e=O.length}v=null,H=!1,Or(t)}}function Br(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];O.push(new Pe(t,e)),O.length===1&&!H&&ke(Be)}function Pe(t,e){this.fun=t,this.array=e}Pe.prototype.run=function(){this.fun.apply(null,this.array)};var Pr="browser",Ur="browser",Mr=!0,Lr={},vr=[],Fr="",Wr={},Yr={},Kr={};function F(){}var Gr=F,Hr=F,Vr=F,$r=F,zr=F,qr=F,Xr=F;function Jr(t){throw new Error("process.binding is not supported")}function jr(){return"/"}function Qr(t){throw new Error("process.chdir is not supported")}function Zr(){return 0}var G=globalThis.performance||{},et=G.now||G.mozNow||G.msNow||G.oNow||G.webkitNow||function(){return new Date().getTime()};function rt(t){var e=et.call(G)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}var tt=new Date;function nt(){var t=new Date,e=t-tt;return e/1e3}var u={nextTick:Br,title:Pr,browser:Mr,env:Lr,argv:vr,version:Fr,versions:Wr,on:Gr,addListener:Hr,once:Vr,off:$r,removeListener:zr,removeAllListeners:qr,emit:Xr,binding:Jr,cwd:jr,chdir:Qr,umask:Zr,hrtime:rt,platform:Ur,release:Yr,config:Kr,uptime:nt},Ne={};Object.keys(Ne).forEach(t=>{let e=t.split("."),r=u;for(let n=0;n<e.length;n++){let i=e[n];n===e.length-1?r[i]=Ne[t]:r=r[i]||(r[i]={})}});var C=[],_=[],it=typeof Uint8Array<"u"?Uint8Array:Array,le=!1;function ve(){le=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)C[e]=t[e],_[t.charCodeAt(e)]=e;_[45]=62,_[95]=63}function ot(t){le||ve();var e,r,n,i,o,a,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,a=new it(c*3/4-o),n=o>0?c-4:c;var d=0;for(e=0,r=0;e<n;e+=4,r+=3)i=_[t.charCodeAt(e)]<<18|_[t.charCodeAt(e+1)]<<12|_[t.charCodeAt(e+2)]<<6|_[t.charCodeAt(e+3)],a[d++]=i>>16&255,a[d++]=i>>8&255,a[d++]=i&255;return o===2?(i=_[t.charCodeAt(e)]<<2|_[t.charCodeAt(e+1)]>>4,a[d++]=i&255):o===1&&(i=_[t.charCodeAt(e)]<<10|_[t.charCodeAt(e+1)]<<4|_[t.charCodeAt(e+2)]>>2,a[d++]=i>>8&255,a[d++]=i&255),a}function at(t){return C[t>>18&63]+C[t>>12&63]+C[t>>6&63]+C[t&63]}function st(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(at(n));return i.join("")}function Ue(t){le||ve();for(var e,r=t.length,n=r%3,i="",o=[],a=16383,c=0,d=r-n;c<d;c+=a)o.push(st(t,c,c+a>d?d:c+a));return n===1?(e=t[r-1],i+=C[e>>2],i+=C[e<<4&63],i+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],i+=C[e>>10],i+=C[e>>4&63],i+=C[e<<2&63],i+="="),o.push(i),o.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function Q(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function k(t,e){if(Q()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=s.prototype):(t===null&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return ge(this,t)}return Fe(this,t,e,r)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Fe(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?pt(t,e,r,n):typeof e=="string"?ut(t,e,r):dt(t,e)}s.from=function(t,e,r){return Fe(null,t,e,r)};s.kMaxLength=Q();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function We(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 ct(t,e,r,n){return We(e),e<=0?k(t,e):r!==void 0?typeof n=="string"?k(t,e).fill(r,n):k(t,e).fill(r):k(t,e)}s.alloc=function(t,e,r){return ct(null,t,e,r)};function ge(t,e){if(We(e),t=k(t,e<0?0:fe(e)|0),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}s.allocUnsafe=function(t){return ge(null,t)};s.allocUnsafeSlow=function(t){return ge(null,t)};function ut(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=Ye(e,r)|0;t=k(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function me(t,e){var r=e.length<0?0:fe(e.length)|0;t=k(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function pt(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),s.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=s.prototype):t=me(t,e),t}function dt(t,e){if(D(e)){var r=fe(e.length)|0;return t=k(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Rt(e.length)?k(t,0):me(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return me(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function fe(t){if(t>=Q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q().toString(16)+" bytes");return t|0}s.isBuffer=Ot;function D(t){return!!(t!=null&&t._isBuffer)}s.compare=function(e,r){if(!D(e)||!D(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return s.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=s.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!D(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function Ye(t,e){if(D(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 r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return qe(t).length;default:if(n)return Z(t).length;e=(""+e).toLowerCase(),n=!0}}s.byteLength=Ye;function mt(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Tt(this,e,r);case"utf8":case"utf-8":return He(this,e,r);case"ascii":return It(this,e,r);case"latin1":case"binary":return yt(this,e,r);case"base64":return xt(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Et(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function W(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}s.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)W(this,r,r+1);return this};s.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)W(this,r,r+3),W(this,r+1,r+2);return this};s.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)W(this,r,r+7),W(this,r+1,r+6),W(this,r+2,r+5),W(this,r+3,r+4);return this};s.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?He(this,0,e):mt.apply(this,arguments)};s.prototype.equals=function(e){if(!D(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:s.compare(this,e)===0};s.prototype.compare=function(e,r,n,i,o){if(!D(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var a=o-i,c=n-r,d=Math.min(a,c),l=this.slice(i,o),g=e.slice(r,n),m=0;m<d;++m)if(l[m]!==g[m]){a=l[m],c=g[m];break}return a<c?-1:c<a?1:0};function Ke(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=s.from(e,n)),D(e))return e.length===0?-1:Me(t,e,r,n,i);if(typeof e=="number")return e=e&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Me(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Me(t,e,r,n,i){var o=1,a=t.length,c=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,r/=2}function d(f,I){return o===1?f[I]:f.readUInt16BE(I*o)}var l;if(i){var g=-1;for(l=r;l<a;l++)if(d(t,l)===d(e,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===c)return g*o}else g!==-1&&(l-=l-g),g=-1}else for(r+c>a&&(r=a-c),l=r;l>=0;l--){for(var m=!0,b=0;b<c;b++)if(d(t,l+b)!==d(e,b)){m=!1;break}if(m)return l}return-1}s.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};s.prototype.indexOf=function(e,r,n){return Ke(this,e,r,n,!0)};s.prototype.lastIndexOf=function(e,r,n){return Ke(this,e,r,n,!1)};function lt(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(e.substr(a*2,2),16);if(isNaN(c))return a;t[r+a]=c}return a}function gt(t,e,r,n){return te(Z(e,t.length-r),t,r,n)}function Ge(t,e,r,n){return te(Dt(e),t,r,n)}function ft(t,e,r,n){return Ge(t,e,r,n)}function bt(t,e,r,n){return te(qe(e),t,r,n)}function ht(t,e,r,n){return te(Nt(e,t.length-r),t,r,n)}s.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return lt(this,e,r,n);case"utf8":case"utf-8":return gt(this,e,r,n);case"ascii":return Ge(this,e,r,n);case"latin1":case"binary":return ft(this,e,r,n);case"base64":return bt(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ht(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xt(t,e,r){return e===0&&r===t.length?Ue(t):Ue(t.slice(e,r))}function He(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=r){var d,l,g,m;switch(c){case 1:o<128&&(a=o);break;case 2:d=t[i+1],(d&192)===128&&(m=(o&31)<<6|d&63,m>127&&(a=m));break;case 3:d=t[i+1],l=t[i+2],(d&192)===128&&(l&192)===128&&(m=(o&15)<<12|(d&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:d=t[i+1],l=t[i+2],g=t[i+3],(d&192)===128&&(l&192)===128&&(g&192)===128&&(m=(o&15)<<18|(d&63)<<12|(l&63)<<6|g&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),i+=c}return At(n)}var Le=4096;function At(t){var e=t.length;if(e<=Le)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Le));return r}function It(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function yt(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function Tt(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=Ct(t[o]);return i}function Et(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}s.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i;if(s.TYPED_ARRAY_SUPPORT)i=this.subarray(e,r),i.__proto__=s.prototype;else{var o=r-e;i=new s(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+e]}return i};function h(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return i};s.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i};s.prototype.readUInt8=function(e,r){return r||h(e,1,this.length),this[e]};s.prototype.readUInt16LE=function(e,r){return r||h(e,2,this.length),this[e]|this[e+1]<<8};s.prototype.readUInt16BE=function(e,r){return r||h(e,2,this.length),this[e]<<8|this[e+1]};s.prototype.readUInt32LE=function(e,r){return r||h(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};s.prototype.readUInt32BE=function(e,r){return r||h(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};s.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};s.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var i=r,o=1,a=this[e+--i];i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};s.prototype.readInt8=function(e,r){return r||h(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};s.prototype.readInt16LE=function(e,r){r||h(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(e,r){r||h(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(e,r){return r||h(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};s.prototype.readInt32BE=function(e,r){return r||h(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};s.prototype.readFloatLE=function(e,r){return r||h(e,4,this.length),ne(this,e,!0,23,4)};s.prototype.readFloatBE=function(e,r){return r||h(e,4,this.length),ne(this,e,!1,23,4)};s.prototype.readDoubleLE=function(e,r){return r||h(e,8,this.length),ne(this,e,!0,52,8)};s.prototype.readDoubleBE=function(e,r){return r||h(e,8,this.length),ne(this,e,!1,52,8)};function y(t,e,r,n,i,o){if(!D(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;y(this,e,r,n,o,0)}var a=1,c=0;for(this[r]=e&255;++c<n&&(a*=256);)this[r+c]=e/a&255;return r+n};s.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;y(this,e,r,n,o,0)}var a=n-1,c=1;for(this[r+a]=e&255;--a>=0&&(c*=256);)this[r+a]=e/c&255;return r+n};s.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function ee(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}s.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ee(this,e,r,!0),r+2};s.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ee(this,e,r,!1),r+2};function re(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>(n?i:3-i)*8&255}s.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):re(this,e,r,!0),r+4};s.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):re(this,e,r,!1),r+4};s.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);y(this,e,r,n,o-1,-o)}var a=0,c=1,d=0;for(this[r]=e&255;++a<n&&(c*=256);)e<0&&d===0&&this[r+a-1]!==0&&(d=1),this[r+a]=(e/c>>0)-d&255;return r+n};s.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);y(this,e,r,n,o-1,-o)}var a=n-1,c=1,d=0;for(this[r+a]=e&255;--a>=0&&(c*=256);)e<0&&d===0&&this[r+a+1]!==0&&(d=1),this[r+a]=(e/c>>0)-d&255;return r+n};s.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};s.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ee(this,e,r,!0),r+2};s.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ee(this,e,r,!1),r+2};s.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):re(this,e,r,!0),r+4};s.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):re(this,e,r,!1),r+4};function Ve(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function $e(t,e,r,n,i){return i||Ve(t,e,r,4,34028234663852886e22,-34028234663852886e22),Je(t,e,r,n,23,4),r+4}s.prototype.writeFloatLE=function(e,r,n){return $e(this,e,r,!0,n)};s.prototype.writeFloatBE=function(e,r,n){return $e(this,e,r,!1,n)};function ze(t,e,r,n,i){return i||Ve(t,e,r,8,17976931348623157e292,-17976931348623157e292),Je(t,e,r,n,52,8),r+8}s.prototype.writeDoubleLE=function(e,r,n){return ze(this,e,r,!0,n)};s.prototype.writeDoubleBE=function(e,r,n){return ze(this,e,r,!1,n)};s.prototype.copy=function(e,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);var o=i-n,a;if(this===e&&n<r&&r<i)for(a=o-1;a>=0;--a)e[a+r]=this[a+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)e[a+r]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),r);return o};s.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var o=e.charCodeAt(0);o<256&&(e=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var c=D(e)?e:Z(new s(e,i).toString()),d=c.length;for(a=0;a<n-r;++a)this[a+r]=c[a%d]}return this};var _t=/[^+\/0-9A-Za-z-_]/g;function St(t){if(t=wt(t).replace(_t,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function wt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ct(t){return t<16?"0"+t.toString(16):t.toString(16)}function Z(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Dt(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Nt(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function qe(t){return ot(St(t))}function te(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Rt(t){return t!==t}function Ot(t){return t!=null&&(!!t._isBuffer||Xe(t)||kt(t))}function Xe(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function kt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Xe(t.slice(0,0))}function ne(t,e,r,n,i){var o,a,c=i*8-n-1,d=(1<<c)-1,l=d>>1,g=-7,m=r?i-1:0,b=r?-1:1,f=t[e+m];for(m+=b,o=f&(1<<-g)-1,f>>=-g,g+=c;g>0;o=o*256+t[e+m],m+=b,g-=8);for(a=o&(1<<-g)-1,o>>=-g,g+=n;g>0;a=a*256+t[e+m],m+=b,g-=8);if(o===0)o=1-l;else{if(o===d)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-l}return(f?-1:1)*a*Math.pow(2,o-n)}function Je(t,e,r,n,i,o){var a,c,d,l=o*8-i-1,g=(1<<l)-1,m=g>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,I=n?1:-1,X=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=g):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+m>=1?e+=b/d:e+=b*Math.pow(2,1-m),e*d>=2&&(a++,d/=2),a+m>=g?(c=0,a=g):a+m>=1?(c=(e*d-1)*Math.pow(2,i),a=a+m):(c=e*Math.pow(2,m-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=c&255,f+=I,c/=256,i-=8);for(a=a<<i|c,l+=i;l>0;t[r+f]=a&255,f+=I,a/=256,l-=8);t[r+f-I]|=X*128}import{PublicKey as q}from"@solana/web3.js";var V={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};import vu from"algosdk";import*as Dr from"bs58";import fn from"algosdk";import ti,{decodeAddress as ni,encodeAddress as ii}from"algosdk";var N=[],S=[],Bt=typeof Uint8Array<"u"?Uint8Array:Array,he=!1;function er(){he=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)N[e]=t[e],S[t.charCodeAt(e)]=e;S[45]=62,S[95]=63}function Pt(t){he||er();var e,r,n,i,o,a,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,a=new Bt(c*3/4-o),n=o>0?c-4:c;var d=0;for(e=0,r=0;e<n;e+=4,r+=3)i=S[t.charCodeAt(e)]<<18|S[t.charCodeAt(e+1)]<<12|S[t.charCodeAt(e+2)]<<6|S[t.charCodeAt(e+3)],a[d++]=i>>16&255,a[d++]=i>>8&255,a[d++]=i&255;return o===2?(i=S[t.charCodeAt(e)]<<2|S[t.charCodeAt(e+1)]>>4,a[d++]=i&255):o===1&&(i=S[t.charCodeAt(e)]<<10|S[t.charCodeAt(e+1)]<<4|S[t.charCodeAt(e+2)]>>2,a[d++]=i>>8&255,a[d++]=i&255),a}function Ut(t){return N[t>>18&63]+N[t>>12&63]+N[t>>6&63]+N[t&63]}function Mt(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Ut(n));return i.join("")}function je(t){he||er();for(var e,r=t.length,n=r%3,i="",o=[],a=16383,c=0,d=r-n;c<d;c+=a)o.push(Mt(t,c,c+a>d?d:c+a));return n===1?(e=t[r-1],i+=N[e>>2],i+=N[e<<4&63],i+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],i+=N[e>>10],i+=N[e>>4&63],i+=N[e<<2&63],i+="="),o.push(i),o.join("")}function ae(t,e,r,n,i){var o,a,c=i*8-n-1,d=(1<<c)-1,l=d>>1,g=-7,m=r?i-1:0,b=r?-1:1,f=t[e+m];for(m+=b,o=f&(1<<-g)-1,f>>=-g,g+=c;g>0;o=o*256+t[e+m],m+=b,g-=8);for(a=o&(1<<-g)-1,o>>=-g,g+=n;g>0;a=a*256+t[e+m],m+=b,g-=8);if(o===0)o=1-l;else{if(o===d)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-l}return(f?-1:1)*a*Math.pow(2,o-n)}function rr(t,e,r,n,i,o){var a,c,d,l=o*8-i-1,g=(1<<l)-1,m=g>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,I=n?1:-1,X=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=g):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+m>=1?e+=b/d:e+=b*Math.pow(2,1-m),e*d>=2&&(a++,d/=2),a+m>=g?(c=0,a=g):a+m>=1?(c=(e*d-1)*Math.pow(2,i),a=a+m):(c=e*Math.pow(2,m-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=c&255,f+=I,c/=256,i-=8);for(a=a<<i|c,l+=i;l>0;t[r+f]=a&255,f+=I,a/=256,l-=8);t[r+f-I]|=X*128}var Lt={}.toString,tr=Array.isArray||function(t){return Lt.call(t)=="[object Array]"};var vt=50;p.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var jn=ie();function ie(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(t,e){if(ie()<e)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=p.prototype):(t===null&&(t=new p(e)),t.length=e),t}function p(t,e,r){if(!p.TYPED_ARRAY_SUPPORT&&!(this instanceof p))return new p(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return xe(this,t)}return nr(this,t,e,r)}p.poolSize=8192;p._augment=function(t){return t.__proto__=p.prototype,t};function nr(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Yt(t,e,r,n):typeof e=="string"?Wt(t,e,r):Kt(t,e)}p.from=function(t,e,r){return nr(null,t,e,r)};p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array);function ir(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 Ft(t,e,r,n){return ir(e),e<=0?B(t,e):r!==void 0?typeof n=="string"?B(t,e).fill(r,n):B(t,e).fill(r):B(t,e)}p.alloc=function(t,e,r){return Ft(null,t,e,r)};function xe(t,e){if(ir(e),t=B(t,e<0?0:Ae(e)|0),!p.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}p.allocUnsafe=function(t){return xe(null,t)};p.allocUnsafeSlow=function(t){return xe(null,t)};function Wt(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!p.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=or(e,r)|0;t=B(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function be(t,e){var r=e.length<0?0:Ae(e.length)|0;t=B(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function Yt(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),p.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=p.prototype):t=be(t,e),t}function Kt(t,e){if(R(e)){var r=Ae(e.length)|0;return t=B(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||cn(e.length)?B(t,0):be(t,e);if(e.type==="Buffer"&&tr(e.data))return be(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ae(t){if(t>=ie())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ie().toString(16)+" bytes");return t|0}p.isBuffer=un;function R(t){return!!(t!=null&&t._isBuffer)}p.compare=function(e,r){if(!R(e)||!R(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};p.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};p.concat=function(e,r){if(!tr(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=p.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!R(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function or(t,e){if(R(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 r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return oe(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return mr(t).length;default:if(n)return oe(t).length;e=(""+e).toLowerCase(),n=!0}}p.byteLength=or;function Gt(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Zt(this,e,r);case"utf8":case"utf-8":return cr(this,e,r);case"ascii":return jt(this,e,r);case"latin1":case"binary":return Qt(this,e,r);case"base64":return Xt(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return en(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}p.prototype._isBuffer=!0;function Y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}p.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)Y(this,r,r+1);return this};p.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)Y(this,r,r+3),Y(this,r+1,r+2);return this};p.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)Y(this,r,r+7),Y(this,r+1,r+6),Y(this,r+2,r+5),Y(this,r+3,r+4);return this};p.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?cr(this,0,e):Gt.apply(this,arguments)};p.prototype.equals=function(e){if(!R(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0};p.prototype.inspect=function(){var e="",r=vt;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"};p.prototype.compare=function(e,r,n,i,o){if(!R(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var a=o-i,c=n-r,d=Math.min(a,c),l=this.slice(i,o),g=e.slice(r,n),m=0;m<d;++m)if(l[m]!==g[m]){a=l[m],c=g[m];break}return a<c?-1:c<a?1:0};function ar(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=p.from(e,n)),R(e))return e.length===0?-1:Qe(t,e,r,n,i);if(typeof e=="number")return e=e&255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Qe(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Qe(t,e,r,n,i){var o=1,a=t.length,c=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,r/=2}function d(f,I){return o===1?f[I]:f.readUInt16BE(I*o)}var l;if(i){var g=-1;for(l=r;l<a;l++)if(d(t,l)===d(e,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===c)return g*o}else g!==-1&&(l-=l-g),g=-1}else for(r+c>a&&(r=a-c),l=r;l>=0;l--){for(var m=!0,b=0;b<c;b++)if(d(t,l+b)!==d(e,b)){m=!1;break}if(m)return l}return-1}p.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};p.prototype.indexOf=function(e,r,n){return ar(this,e,r,n,!0)};p.prototype.lastIndexOf=function(e,r,n){return ar(this,e,r,n,!1)};function Ht(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(e.substr(a*2,2),16);if(isNaN(c))return a;t[r+a]=c}return a}function Vt(t,e,r,n){return ue(oe(e,t.length-r),t,r,n)}function sr(t,e,r,n){return ue(an(e),t,r,n)}function $t(t,e,r,n){return sr(t,e,r,n)}function zt(t,e,r,n){return ue(mr(e),t,r,n)}function qt(t,e,r,n){return ue(sn(e,t.length-r),t,r,n)}p.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return Ht(this,e,r,n);case"utf8":case"utf-8":return Vt(this,e,r,n);case"ascii":return sr(this,e,r,n);case"latin1":case"binary":return $t(this,e,r,n);case"base64":return zt(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qt(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Xt(t,e,r){return e===0&&r===t.length?je(t):je(t.slice(e,r))}function cr(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=r){var d,l,g,m;switch(c){case 1:o<128&&(a=o);break;case 2:d=t[i+1],(d&192)===128&&(m=(o&31)<<6|d&63,m>127&&(a=m));break;case 3:d=t[i+1],l=t[i+2],(d&192)===128&&(l&192)===128&&(m=(o&15)<<12|(d&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:d=t[i+1],l=t[i+2],g=t[i+3],(d&192)===128&&(l&192)===128&&(g&192)===128&&(m=(o&15)<<18|(d&63)<<12|(l&63)<<6|g&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),i+=c}return Jt(n)}var Ze=4096;function Jt(t){var e=t.length;if(e<=Ze)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Ze));return r}function jt(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function Qt(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function Zt(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=on(t[o]);return i}function en(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}p.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i;if(p.TYPED_ARRAY_SUPPORT)i=this.subarray(e,r),i.__proto__=p.prototype;else{var o=r-e;i=new p(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+e]}return i};function x(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return i};p.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i};p.prototype.readUInt8=function(e,r){return r||x(e,1,this.length),this[e]};p.prototype.readUInt16LE=function(e,r){return r||x(e,2,this.length),this[e]|this[e+1]<<8};p.prototype.readUInt16BE=function(e,r){return r||x(e,2,this.length),this[e]<<8|this[e+1]};p.prototype.readUInt32LE=function(e,r){return r||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};p.prototype.readUInt32BE=function(e,r){return r||x(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};p.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};p.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var i=r,o=1,a=this[e+--i];i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};p.prototype.readInt8=function(e,r){return r||x(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};p.prototype.readInt16LE=function(e,r){r||x(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};p.prototype.readInt16BE=function(e,r){r||x(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};p.prototype.readInt32LE=function(e,r){return r||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};p.prototype.readInt32BE=function(e,r){return r||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};p.prototype.readFloatLE=function(e,r){return r||x(e,4,this.length),ae(this,e,!0,23,4)};p.prototype.readFloatBE=function(e,r){return r||x(e,4,this.length),ae(this,e,!1,23,4)};p.prototype.readDoubleLE=function(e,r){return r||x(e,8,this.length),ae(this,e,!0,52,8)};p.prototype.readDoubleBE=function(e,r){return r||x(e,8,this.length),ae(this,e,!1,52,8)};function T(t,e,r,n,i,o){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}p.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;T(this,e,r,n,o,0)}var a=1,c=0;for(this[r]=e&255;++c<n&&(a*=256);)this[r+c]=e/a&255;return r+n};p.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;T(this,e,r,n,o,0)}var a=n-1,c=1;for(this[r+a]=e&255;--a>=0&&(c*=256);)this[r+a]=e/c&255;return r+n};p.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,1,255,0),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function se(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}p.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):se(this,e,r,!0),r+2};p.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):se(this,e,r,!1),r+2};function ce(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>(n?i:3-i)*8&255}p.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):ce(this,e,r,!0),r+4};p.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):ce(this,e,r,!1),r+4};p.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);T(this,e,r,n,o-1,-o)}var a=0,c=1,d=0;for(this[r]=e&255;++a<n&&(c*=256);)e<0&&d===0&&this[r+a-1]!==0&&(d=1),this[r+a]=(e/c>>0)-d&255;return r+n};p.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);T(this,e,r,n,o-1,-o)}var a=n-1,c=1,d=0;for(this[r+a]=e&255;--a>=0&&(c*=256);)e<0&&d===0&&this[r+a+1]!==0&&(d=1),this[r+a]=(e/c>>0)-d&255;return r+n};p.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};p.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):se(this,e,r,!0),r+2};p.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):se(this,e,r,!1),r+2};p.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):ce(this,e,r,!0),r+4};p.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):ce(this,e,r,!1),r+4};function ur(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function pr(t,e,r,n,i){return i||ur(t,e,r,4),rr(t,e,r,n,23,4),r+4}p.prototype.writeFloatLE=function(e,r,n){return pr(this,e,r,!0,n)};p.prototype.writeFloatBE=function(e,r,n){return pr(this,e,r,!1,n)};function dr(t,e,r,n,i){return i||ur(t,e,r,8),rr(t,e,r,n,52,8),r+8}p.prototype.writeDoubleLE=function(e,r,n){return dr(this,e,r,!0,n)};p.prototype.writeDoubleBE=function(e,r,n){return dr(this,e,r,!1,n)};p.prototype.copy=function(e,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);var o=i-n,a;if(this===e&&n<r&&r<i)for(a=o-1;a>=0;--a)e[a+r]=this[a+n];else if(o<1e3||!p.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)e[a+r]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),r);return o};p.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var o=e.charCodeAt(0);o<256&&(e=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!p.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var c=R(e)?e:oe(new p(e,i).toString()),d=c.length;for(a=0;a<n-r;++a)this[a+r]=c[a%d]}return this};var rn=/[^+\/0-9A-Za-z-_]/g;function tn(t){if(t=nn(t).replace(rn,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function nn(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function on(t){return t<16?"0"+t.toString(16):t.toString(16)}function oe(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function an(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function sn(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function mr(t){return Pt(tn(t))}function ue(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function cn(t){return t!==t}function un(t){return t!=null&&(!!t._isBuffer||lr(t)||pn(t))}function lr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function pn(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&lr(t.slice(0,0))}import{encodeAddress as dn,decodeAddress as pi}from"algosdk";function P(t){return t.reduce((e,r)=>Uint8Array.from([...e,...r]))}function Ie(t){return new Uint8Array(p.from(t))}function gr(t){return p.from(t).toString("utf-8")}function fr(t){return p.from(t).toString("base64")}function ye(t){return p.from(t,"base64")}import mn from"bignumber.js";mn.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var Ni=`{"theme1":{"value":"${u.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${u.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${u.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var br={V1_1:"v1_1",V2:"v2"},Bi={[br.V1_1]:{testnet:62368684,mainnet:552635992},[br.V2]:{testnet:148607e3,mainnet:1002541853}};var hr=t=>fn.decodeAddress(t.toUpperCase()).publicKey;import*as A from"ethereumjs-util";function Te(t){let e=A.fromSigned(s.from(t));return BigInt(e.toString())}function hn(t){return A.toUnsigned(new A.BN(String(t)))}function $(t){let e=hn(t);if(e.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(A.setLengthLeft(e,32))}var xr=t=>{if(t.length!==32)throw new Error("Invalid address bytes. The address buffer length is not equel 32");let e=s.from(t).toString("hex");if(e.slice(0,24)!=="000000000000000000000000")throw console.log("normalizedAddress",e),new Error("Invalid normalized address");let r="0x"+e.slice(-40);if(!An(r))throw new Error("Invalid hex address");return r},Ar=t=>new Uint8Array(A.setLengthLeft(pe(t),32)),pe=t=>s.from(xn(t),"hex"),xn=t=>t.startsWith("0x")?t.slice(2):t,An=t=>A.isValidAddress(t);var Ee=t=>new Uint8Array(A.keccak256(s.from(t)));import L from"algosdk";import*as we from"bs58";import ko from"algosdk";import Yo from"algosdk";import Ia from"algosdk";var jo={SMALLESTUNIT:u.env.SMALLEST_UNIT},Qo={SMALLEST_UNITS:u.env.SMALLEST_UNIT};var na=["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 Tr=t=>`By signing this message, you confirm that the wallet is a trusted one ${t}; Data: `;import Nc from"algosdk";var Er=(i=>(i.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",i.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",i.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",i.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",i))(Er||{}),_r=(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))(_r||{}),Ds={...Er,..._r};import Gc from"algosdk";var E=(t,e,r)=>{switch(e){case"8B":return L.encodeUint64(Number(t));case"32B":return $(t);case"str":return Ie(String(t));case"address":return K(String(t),r);case"token":return Cr(String(t),r);case"float":{var n=s.alloc(8);return n.writeDoubleBE(Number(t),0),new Uint8Array(n)}case"bool":return new Uint8Array(s.from(L.encodeUint64(Number(t))).subarray(-1));case"2B":return new Uint8Array(s.from(L.encodeUint64(Number(t))).subarray(-2));case"4B":return new Uint8Array(s.from(L.encodeUint64(Number(t))).subarray(-4));default:return s.from(t.toString())}},w=(t,e,r)=>{switch(e){case"8B":return L.decodeUint64(t,"safe");case"32B":return Te(t);case"str":return gr(t);case"address":return wr(t,r);case"token":return Dn(t,r);case"float":return s.from(t).readDoubleBE(0);case"bool":case"2B":return w(t,"8B");default:return s.from(t).toString()}};var wr=(t,e)=>e===8?L.encodeAddress(t):e===1?we.encode(t):xr(t),Dn=(t,e)=>{let r=s.from(t).toString("hex");return r.startsWith("0x")||(r="0x"+r),V[r]?r:e===8?String(Te(t)):e===1?we.encode(t):wr(t,e)};var Cr=(t,e)=>e===8?$(+t):V[t]?new Uint8Array(pe(String(t))):K(String(t),e);var Se=(t,e,r,n)=>{let i=K(t,e),o=L.encodeUint64(e),a=L.encodeUint64(n),c=Cr(r,n);return P([i,o,c,a])};var Ce=(t,e)=>P([Nn(t),Sr(e)]),Nn=t=>new Uint8Array(s.from(t+`
|
|
2
|
+
`,"utf-8")),Sr=t=>new Uint8Array(s.from(fr(t)));var de=t=>s.from(Ee(t)).toString("hex");var z=(t,e,r)=>{let n=s.from(t,e),i=n.subarray(n.length-r),o=s.from(i).toString();return ye(o)};var K=(t,e)=>e===8?hr(t):e===1?Dr.decode(t):Ar(t);var On=new q("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),kn=new q("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");function Bn(t,e,r=!1,n=On,i=kn){if(!r&&!q.isOnCurve(e.toBuffer()))throw new Error("TokenOwnerOffCurveError");let[o]=q.findProgramAddressSync([e.toBuffer(),n.toBuffer(),t.toBuffer()],i);return o}var Tm=(t,e,r)=>{let n=t==="MainNet"?"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU";if(Rr(e,r))return n},Em=u.env.ALGO_NETWORK==="MainNet"?"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",Rr=(t,e)=>V[t]&&e===1,Pn=(t,e="hex")=>z(t,e,248),_m=t=>de(Pn(t,"hex")),Sm=(t,e="hex")=>{let r=z(t,e,248),n=Number(w(r.subarray(32,40),"8B")),i=Number(w(r.subarray(104,112),"8B"));return{loginAddress:String(w(r.subarray(0,32),"address",n)),loginChainId:n,tokenIndex:String(w(r.subarray(40,72),"token",i)),tokenChainId:i,recipient:String(w(r.subarray(72,104),"address",i)),recipientChainId:i,tokenAmount:String(w(r.subarray(112,144),"32B")),isNative:!!w(r.subarray(144,145),"bool"),fee:Number(w(r.subarray(145,177),"32B")),random:Number(w(r.subarray(177,185),"8B"))}},wm=(t,e)=>{let{loginAddress:r,loginChainId:n,recipient:i,recipientChainId:o,tokenAmount:a,tokenIndex:c,isNative:d,fee:l,random:g,solanaUsdc:m}=t,b=K(i,o);if(Rr(String(c),o)){let X=new q(m),De=Bn(X,new q(i));console.log("associatedTokenAddress",De.toBase58()),b=K(De.toBase58(),o)}let f=Se(r,n,c,o),I=P([f.slice(0,72),b,E(o,"8B"),$(a),E(+d,"bool"),$(l),E(g,"8B")]);return Ce(e||JSON.stringify(t),I)},Un={EVM:5,ALGORAND:8,SOLANA:1},Cm=t=>{let e=[E(t.address,"address",Un[t.type]),E(t.name,"str"),E(t.type,"str"),E(t.description||"","str")],r=s.concat(e),n=Tr(t.address);return Ce(n,r)};export{kn as ASSOCIATED_TOKEN_PROGRAM_ID,Em as SOLANA_USDC,On as TOKEN_PROGRAM_ID,_m as calcWithdrawHash,Cm as createWithdrawalWalletMsg,Sm as decodeWithdrawMsg,Bn as getAssociatedTokenAddressSync,Tm as getSolanaUsdc,Pn as getWithdrawBytesFromMsg,Rr as isSolanaCctp,wm as makeWithdrawMsg};
|
|
3
|
+
/*!
|
|
4
|
+
* The buffer module from node.js, for the browser.
|
|
5
|
+
*
|
|
6
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
7
|
+
* @license MIT
|
|
8
|
+
*/
|
|
9
|
+
/*! Bundled license information:
|
|
10
|
+
|
|
11
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
12
|
+
(*!
|
|
13
|
+
* The buffer module from node.js, for the browser.
|
|
14
|
+
*
|
|
15
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
16
|
+
* @license MIT
|
|
17
|
+
*)
|
|
18
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function H(){throw new Error("setTimeout has not been defined")}function V(){throw new Error("clearTimeout has not been defined")}var _=H,E=V;typeof globalThis.setTimeout=="function"&&(_=setTimeout);typeof globalThis.clearTimeout=="function"&&(E=clearTimeout);function q(t){if(_===setTimeout)return setTimeout(t,0);if((_===H||!_)&&setTimeout)return _=setTimeout,setTimeout(t,0);try{return _(t,0)}catch{try{return _.call(null,t,0)}catch{return _.call(this,t,0)}}}function Ie(t){if(E===clearTimeout)return clearTimeout(t);if((E===V||!E)&&clearTimeout)return E=clearTimeout,clearTimeout(t);try{return E(t)}catch{try{return E.call(null,t)}catch{return E.call(this,t)}}}var y=[],O=!1,C,N=-1;function he(){!O||!C||(O=!1,C.length?y=C.concat(y):N=-1,y.length&&z())}function z(){if(!O){var t=q(he);O=!0;for(var e=y.length;e;){for(C=y,y=[];++N<e;)C&&C[N].run();N=-1,e=y.length}C=null,O=!1,Ie(t)}}function be(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];y.push(new J(t,e)),y.length===1&&!O&&q(z)}function J(t,e){this.fun=t,this.array=e}J.prototype.run=function(){this.fun.apply(null,this.array)};var xe="browser",Ae="browser",ye=!0,Te={},_e=[],Ee="",Ce={},De={},Se={};function D(){}var we=D,Re=D,Oe=D,Ne=D,ve=D,ke=D,Pe=D;function Le(t){throw new Error("process.binding is not supported")}function Me(){return"/"}function Ue(t){throw new Error("process.chdir is not supported")}function Be(){return 0}var R=globalThis.performance||{},We=R.now||R.mozNow||R.msNow||R.oNow||R.webkitNow||function(){return new Date().getTime()};function Fe(t){var e=We.call(R)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}var Ge=new Date;function Ye(){var t=new Date,e=t-Ge;return e/1e3}var p={nextTick:be,title:xe,browser:ye,env:Te,argv:_e,version:Ee,versions:Ce,on:we,addListener:Re,once:Oe,off:Ne,removeListener:ve,removeAllListeners:ke,emit:Pe,binding:Le,cwd:Me,chdir:Ue,umask:Be,hrtime:Fe,platform:Ae,release:De,config:Se,uptime:Ye},K={};Object.keys(K).forEach(t=>{let e=t.split("."),r=p;for(let n=0;n<e.length;n++){let i=e[n];n===e.length-1?r[i]=K[t]:r=r[i]||(r[i]={})}});var x=[],h=[],Ke=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function $(){W=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)x[e]=t[e],h[t.charCodeAt(e)]=e;h[45]=62,h[95]=63}function He(t){W||$();var e,r,n,i,o,s,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,s=new Ke(c*3/4-o),n=o>0?c-4:c;var u=0;for(e=0,r=0;e<n;e+=4,r+=3)i=h[t.charCodeAt(e)]<<18|h[t.charCodeAt(e+1)]<<12|h[t.charCodeAt(e+2)]<<6|h[t.charCodeAt(e+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=i&255;return o===2?(i=h[t.charCodeAt(e)]<<2|h[t.charCodeAt(e+1)]>>4,s[u++]=i&255):o===1&&(i=h[t.charCodeAt(e)]<<10|h[t.charCodeAt(e+1)]<<4|h[t.charCodeAt(e+2)]>>2,s[u++]=i>>8&255,s[u++]=i&255),s}function Ve(t){return x[t>>18&63]+x[t>>12&63]+x[t>>6&63]+x[t&63]}function qe(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Ve(n));return i.join("")}function X(t){W||$();for(var e,r=t.length,n=r%3,i="",o=[],s=16383,c=0,u=r-n;c<u;c+=s)o.push(qe(t,c,c+s>u?u:c+s));return n===1?(e=t[r-1],i+=x[e>>2],i+=x[e<<4&63],i+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],i+=x[e>>10],i+=x[e>>4&63],i+=x[e<<2&63],i+="="),o.push(i),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function v(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(t,e){if(v()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=a.prototype):(t===null&&(t=new a(e)),t.length=e),t}function a(t,e,r){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return F(this,t)}return j(this,t,e,r)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function j(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Xe(t,e,r,n):typeof e=="string"?Je(t,e,r):Qe(t,e)}a.from=function(t,e,r){return j(null,t,e,r)};a.kMaxLength=v();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function ee(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 ze(t,e,r,n){return ee(e),e<=0?T(t,e):r!==void 0?typeof n=="string"?T(t,e).fill(r,n):T(t,e).fill(r):T(t,e)}a.alloc=function(t,e,r){return ze(null,t,e,r)};function F(t,e){if(ee(e),t=T(t,e<0?0:G(e)|0),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}a.allocUnsafe=function(t){return F(null,t)};a.allocUnsafeSlow=function(t){return F(null,t)};function Je(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=re(e,r)|0;t=T(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function B(t,e){var r=e.length<0?0:G(e.length)|0;t=T(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function Xe(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),a.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=a.prototype):t=B(t,e),t}function Qe(t,e){if(A(e)){var r=G(e.length)|0;return t=T(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||gr(e.length)?T(t,0):B(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return B(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=v())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+v().toString(16)+" bytes");return t|0}a.isBuffer=Ir;function A(t){return!!(t!=null&&t._isBuffer)}a.compare=function(e,r){if(!A(e)||!A(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return a.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=a.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!A(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};function re(t,e){if(A(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 r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return pe(t).length;default:if(n)return k(t).length;e=(""+e).toLowerCase(),n=!0}}a.byteLength=re;function Ze(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return sr(this,e,r);case"utf8":case"utf-8":return ie(this,e,r);case"ascii":return ar(this,e,r);case"latin1":case"binary":return or(this,e,r);case"base64":return nr(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pr(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function S(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)S(this,r,r+1);return this};a.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)S(this,r,r+3),S(this,r+1,r+2);return this};a.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)S(this,r,r+7),S(this,r+1,r+6),S(this,r+2,r+5),S(this,r+3,r+4);return this};a.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?ie(this,0,e):Ze.apply(this,arguments)};a.prototype.equals=function(e){if(!A(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:a.compare(this,e)===0};a.prototype.compare=function(e,r,n,i,o){if(!A(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,c=n-r,u=Math.min(s,c),l=this.slice(i,o),d=e.slice(r,n),m=0;m<u;++m)if(l[m]!==d[m]){s=l[m],c=d[m];break}return s<c?-1:c<s?1:0};function te(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=a.from(e,n)),A(e))return e.length===0?-1:Q(t,e,r,n,i);if(typeof e=="number")return e=e&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Q(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Q(t,e,r,n,i){var o=1,s=t.length,c=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,c/=2,r/=2}function u(I,w){return o===1?I[w]:I.readUInt16BE(w*o)}var l;if(i){var d=-1;for(l=r;l<s;l++)if(u(t,l)===u(e,d===-1?0:l-d)){if(d===-1&&(d=l),l-d+1===c)return d*o}else d!==-1&&(l-=l-d),d=-1}else for(r+c>s&&(r=s-c),l=r;l>=0;l--){for(var m=!0,b=0;b<c;b++)if(u(t,l+b)!==u(e,b)){m=!1;break}if(m)return l}return-1}a.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};a.prototype.indexOf=function(e,r,n){return te(this,e,r,n,!0)};a.prototype.lastIndexOf=function(e,r,n){return te(this,e,r,n,!1)};function $e(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var c=parseInt(e.substr(s*2,2),16);if(isNaN(c))return s;t[r+s]=c}return s}function je(t,e,r,n){return M(k(e,t.length-r),t,r,n)}function ne(t,e,r,n){return M(lr(e),t,r,n)}function er(t,e,r,n){return ne(t,e,r,n)}function rr(t,e,r,n){return M(pe(e),t,r,n)}function tr(t,e,r,n){return M(fr(e,t.length-r),t,r,n)}a.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return $e(this,e,r,n);case"utf8":case"utf-8":return je(this,e,r,n);case"ascii":return ne(this,e,r,n);case"latin1":case"binary":return er(this,e,r,n);case"base64":return rr(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tr(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nr(t,e,r){return e===0&&r===t.length?X(t):X(t.slice(e,r))}function ie(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],s=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=r){var u,l,d,m;switch(c){case 1:o<128&&(s=o);break;case 2:u=t[i+1],(u&192)===128&&(m=(o&31)<<6|u&63,m>127&&(s=m));break;case 3:u=t[i+1],l=t[i+2],(u&192)===128&&(l&192)===128&&(m=(o&15)<<12|(u&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(s=m));break;case 4:u=t[i+1],l=t[i+2],d=t[i+3],(u&192)===128&&(l&192)===128&&(d&192)===128&&(m=(o&15)<<18|(u&63)<<12|(l&63)<<6|d&63,m>65535&&m<1114112&&(s=m))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=c}return ir(n)}var Z=4096;function ir(t){var e=t.length;if(e<=Z)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Z));return r}function ar(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function or(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function sr(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=mr(t[o]);return i}function pr(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}a.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(e,r),i.__proto__=a.prototype;else{var o=r-e;i=new a(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+e]}return i};function f(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||f(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return i};a.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||f(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i};a.prototype.readUInt8=function(e,r){return r||f(e,1,this.length),this[e]};a.prototype.readUInt16LE=function(e,r){return r||f(e,2,this.length),this[e]|this[e+1]<<8};a.prototype.readUInt16BE=function(e,r){return r||f(e,2,this.length),this[e]<<8|this[e+1]};a.prototype.readUInt32LE=function(e,r){return r||f(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};a.prototype.readUInt32BE=function(e,r){return r||f(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};a.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||f(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};a.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||f(e,r,this.length);for(var i=r,o=1,s=this[e+--i];i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};a.prototype.readInt8=function(e,r){return r||f(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};a.prototype.readInt16LE=function(e,r){r||f(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(e,r){r||f(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(e,r){return r||f(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};a.prototype.readInt32BE=function(e,r){return r||f(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};a.prototype.readFloatLE=function(e,r){return r||f(e,4,this.length),U(this,e,!0,23,4)};a.prototype.readFloatBE=function(e,r){return r||f(e,4,this.length),U(this,e,!1,23,4)};a.prototype.readDoubleLE=function(e,r){return r||f(e,8,this.length),U(this,e,!0,52,8)};a.prototype.readDoubleBE=function(e,r){return r||f(e,8,this.length),U(this,e,!1,52,8)};function g(t,e,r,n,i,o){if(!A(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;g(this,e,r,n,o,0)}var s=1,c=0;for(this[r]=e&255;++c<n&&(s*=256);)this[r+c]=e/s&255;return r+n};a.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;g(this,e,r,n,o,0)}var s=n-1,c=1;for(this[r+s]=e&255;--s>=0&&(c*=256);)this[r+s]=e/c&255;return r+n};a.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function P(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}a.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):P(this,e,r,!0),r+2};a.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):P(this,e,r,!1),r+2};function L(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>(n?i:3-i)*8&255}a.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):L(this,e,r,!0),r+4};a.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):L(this,e,r,!1),r+4};a.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);g(this,e,r,n,o-1,-o)}var s=0,c=1,u=0;for(this[r]=e&255;++s<n&&(c*=256);)e<0&&u===0&&this[r+s-1]!==0&&(u=1),this[r+s]=(e/c>>0)-u&255;return r+n};a.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);g(this,e,r,n,o-1,-o)}var s=n-1,c=1,u=0;for(this[r+s]=e&255;--s>=0&&(c*=256);)e<0&&u===0&&this[r+s+1]!==0&&(u=1),this[r+s]=(e/c>>0)-u&255;return r+n};a.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};a.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):P(this,e,r,!0),r+2};a.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):P(this,e,r,!1),r+2};a.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):L(this,e,r,!0),r+4};a.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):L(this,e,r,!1),r+4};function ae(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function oe(t,e,r,n,i){return i||ae(t,e,r,4,34028234663852886e22,-34028234663852886e22),ue(t,e,r,n,23,4),r+4}a.prototype.writeFloatLE=function(e,r,n){return oe(this,e,r,!0,n)};a.prototype.writeFloatBE=function(e,r,n){return oe(this,e,r,!1,n)};function se(t,e,r,n,i){return i||ae(t,e,r,8,17976931348623157e292,-17976931348623157e292),ue(t,e,r,n,52,8),r+8}a.prototype.writeDoubleLE=function(e,r,n){return se(this,e,r,!0,n)};a.prototype.writeDoubleBE=function(e,r,n){return se(this,e,r,!1,n)};a.prototype.copy=function(e,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);var o=i-n,s;if(this===e&&n<r&&r<i)for(s=o-1;s>=0;--s)e[s+r]=this[s+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)e[s+r]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),r);return o};a.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var o=e.charCodeAt(0);o<256&&(e=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s<n;++s)this[s]=e;else{var c=A(e)?e:k(new a(e,i).toString()),u=c.length;for(s=0;s<n-r;++s)this[s+r]=c[s%u]}return this};var cr=/[^+\/0-9A-Za-z-_]/g;function ur(t){if(t=dr(t).replace(cr,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function dr(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function mr(t){return t<16?"0"+t.toString(16):t.toString(16)}function k(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function lr(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function fr(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function pe(t){return He(ur(t))}function M(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function gr(t){return t!==t}function Ir(t){return t!=null&&(!!t._isBuffer||ce(t)||hr(t))}function ce(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function hr(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ce(t.slice(0,0))}function U(t,e,r,n,i){var o,s,c=i*8-n-1,u=(1<<c)-1,l=u>>1,d=-7,m=r?i-1:0,b=r?-1:1,I=t[e+m];for(m+=b,o=I&(1<<-d)-1,I>>=-d,d+=c;d>0;o=o*256+t[e+m],m+=b,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=s*256+t[e+m],m+=b,d-=8);if(o===0)o=1-l;else{if(o===u)return s?NaN:(I?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-l}return(I?-1:1)*s*Math.pow(2,o-n)}function ue(t,e,r,n,i,o){var s,c,u,l=o*8-i-1,d=(1<<l)-1,m=d>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=n?0:o-1,w=n?1:-1,ge=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+m>=1?e+=b/u:e+=b*Math.pow(2,1-m),e*u>=2&&(s++,u/=2),s+m>=d?(c=0,s=d):s+m>=1?(c=(e*u-1)*Math.pow(2,i),s=s+m):(c=e*Math.pow(2,m-1)*Math.pow(2,i),s=0));i>=8;t[r+I]=c&255,I+=w,c/=256,i-=8);for(s=s<<i|c,l+=i;l>0;t[r+I]=s&255,I+=w,s/=256,l-=8);t[r+I-w]|=ge*128}var Y=(r=>(r.User="User",r.Api="API",r))(Y||{});var de=(i=>(i.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",i.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",i.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",i.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",i))(de||{}),me=(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))(me||{}),Bt={...de,...me};var le=(n=>(n.SOLANA="SOLANA",n.ALGORAND="ALGORAND",n.EVM="EVM",n))(le||{});var br=(d=>(d.PERA="PERA",d.METAMASK="METAMASK",d.TRUST_WALLET="TRUST_WALLET",d.PHANTOM="PHANTOM",d.WALLET_CONNECT="WALLET_CONNECT",d.SOLANA_MOBILE="SOLANA_MOBILE",d.SOLFLARE="SOLFLARE",d.COINBASE="COINBASE",d.BACKPACK="BACKPACK",d.MOBILE="MOBILE",d))(br||{});var fe=class{};export{fe as ISetting,br as PROVIDERS,Y as TradingKeyType,le as WithdrawalWalletType};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function H(){throw new Error("setTimeout has not been defined")}function G(){throw new Error("clearTimeout has not been defined")}var A=H,R=G;typeof globalThis.setTimeout=="function"&&(A=setTimeout);typeof globalThis.clearTimeout=="function"&&(R=clearTimeout);function z(t){if(A===setTimeout)return setTimeout(t,0);if((A===H||!A)&&setTimeout)return A=setTimeout,setTimeout(t,0);try{return A(t,0)}catch{try{return A.call(null,t,0)}catch{return A.call(this,t,0)}}}function gr(t){if(R===clearTimeout)return clearTimeout(t);if((R===G||!R)&&clearTimeout)return R=clearTimeout,clearTimeout(t);try{return R(t)}catch{try{return R.call(null,t)}catch{return R.call(this,t)}}}var y=[],k=!1,I,C=-1;function dr(){!k||!I||(k=!1,I.length?y=I.concat(y):C=-1,y.length&&X())}function X(){if(!k){var t=z(dr);k=!0;for(var r=y.length;r;){for(I=y,y=[];++C<r;)I&&I[C].run();C=-1,r=y.length}I=null,k=!1,gr(t)}}function Er(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];y.push(new J(t,r)),y.length===1&&!k&&z(X)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var xr="browser",Tr="browser",_r=!0,yr={},wr=[],Ar="",Rr={},Ir={},vr={};function v(){}var Nr=v,Pr=v,Sr=v,kr=v,Cr=v,Dr=v,Br=v;function Or(t){throw new Error("process.binding is not supported")}function Mr(){return"/"}function Ur(t){throw new Error("process.chdir is not supported")}function Lr(){return 0}var S=globalThis.performance||{},Yr=S.now||S.mozNow||S.msNow||S.oNow||S.webkitNow||function(){return new Date().getTime()};function Fr(t){var r=Yr.call(S)*.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 Wr=new Date;function Kr(){var t=new Date,r=t-Wr;return r/1e3}var b={nextTick:Er,title:xr,browser:_r,env:yr,argv:wr,version:Ar,versions:Rr,on:Nr,addListener:Pr,once:Sr,off:kr,removeListener:Cr,removeAllListeners:Dr,emit:Br,binding:Or,cwd:Mr,chdir:Ur,umask:Lr,hrtime:Fr,platform:Tr,release:Ir,config:vr,uptime:Kr},V={};Object.keys(V).forEach(t=>{let r=t.split("."),e=b;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=V[t]:e=e[i]||(e[i]={})}});var T=[],E=[],Vr=typeof Uint8Array<"u"?Uint8Array:Array,F=!1;function Q(){F=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)T[r]=t[r],E[t.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Hr(t){F||Q();var r,e,n,i,a,o,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[s-2]==="="?2:t[s-1]==="="?1:0,o=new Vr(s*3/4-a),n=a>0?s-4:s;var l=0;for(r=0,e=0;r<n;r+=4,e+=3)i=E[t.charCodeAt(r)]<<18|E[t.charCodeAt(r+1)]<<12|E[t.charCodeAt(r+2)]<<6|E[t.charCodeAt(r+3)],o[l++]=i>>16&255,o[l++]=i>>8&255,o[l++]=i&255;return a===2?(i=E[t.charCodeAt(r)]<<2|E[t.charCodeAt(r+1)]>>4,o[l++]=i&255):a===1&&(i=E[t.charCodeAt(r)]<<10|E[t.charCodeAt(r+1)]<<4|E[t.charCodeAt(r+2)]>>2,o[l++]=i>>8&255,o[l++]=i&255),o}function Gr(t){return T[t>>18&63]+T[t>>12&63]+T[t>>6&63]+T[t&63]}function zr(t,r,e){for(var n,i=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(Gr(n));return i.join("")}function q(t){F||Q();for(var r,e=t.length,n=e%3,i="",a=[],o=16383,s=0,l=e-n;s<l;s+=o)a.push(zr(t,s,s+o>l?l:s+o));return n===1?(r=t[e-1],i+=T[r>>2],i+=T[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=T[r>>10],i+=T[r>>4&63],i+=T[r<<2&63],i+="="),a.push(i),a.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function D(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function w(t,r){if(D()<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 W(this,t)}return j(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function j(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?qr(t,r,e,n):typeof r=="string"?Jr(t,r,e):$r(t,r)}u.from=function(t,r,e){return j(null,t,r,e)};u.kMaxLength=D();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[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 Xr(t,r,e,n){return rr(r),r<=0?w(t,r):e!==void 0?typeof n=="string"?w(t,r).fill(e,n):w(t,r).fill(e):w(t,r)}u.alloc=function(t,r,e){return Xr(null,t,r,e)};function W(t,r){if(rr(r),t=w(t,r<0?0:K(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return W(null,t)};u.allocUnsafeSlow=function(t){return W(null,t)};function Jr(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=er(r,e)|0;t=w(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function Y(t,r){var e=r.length<0?0:K(r.length)|0;t=w(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function qr(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=Y(t,r),t}function $r(t,r){if(_(r)){var e=K(r.length)|0;return t=w(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"||be(r.length)?w(t,0):Y(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return Y(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function K(t){if(t>=D())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D().toString(16)+" bytes");return t|0}u.isBuffer=ge;function _(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!_(r)||!_(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,a=0,o=Math.min(n,i);a<o;++a)if(r[a]!==e[a]){n=r[a],i=e[a];break}return n<i?-1:i<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(!Array.isArray(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 i=u.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var o=r[n];if(!_(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function er(t,r){if(_(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 B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return sr(t).length;default:if(n)return B(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=er;function Zr(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 ue(this,r,e);case"utf8":case"utf-8":return ir(this,r,e);case"ascii":return ae(this,r,e);case"latin1":case"binary":return oe(this,r,e);case"base64":return ne(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function N(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)N(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)N(this,e,e+3),N(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)N(this,e,e+7),N(this,e+1,e+6),N(this,e+2,e+5),N(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ir(this,0,r):Zr.apply(this,arguments)};u.prototype.equals=function(r){if(!_(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,e,n,i,a){if(!_(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),e<0||n>r.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=n)return 0;if(i>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,a>>>=0,this===r)return 0;for(var o=a-i,s=n-e,l=Math.min(o,s),f=this.slice(i,a),m=r.slice(e,n),p=0;p<l;++p)if(f[p]!==m[p]){o=f[p],s=m[p];break}return o<s?-1:s<o?1:0};function tr(t,r,e,n,i){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=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),_(r))return r.length===0?-1:$(t,r,e,n,i);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):$(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function $(t,r,e,n,i){var a=1,o=t.length,s=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;a=2,o/=2,s/=2,e/=2}function l(d,P){return a===1?d[P]:d.readUInt16BE(P*a)}var f;if(i){var m=-1;for(f=e;f<o;f++)if(l(t,f)===l(r,m===-1?0:f-m)){if(m===-1&&(m=f),f-m+1===s)return m*a}else m!==-1&&(f-=f-m),m=-1}else for(e+s>o&&(e=o-s),f=e;f>=0;f--){for(var p=!0,x=0;x<s;x++)if(l(t,f+x)!==l(r,x)){p=!1;break}if(p)return f}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return tr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return tr(this,r,e,n,!1)};function Qr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(r.substr(o*2,2),16);if(isNaN(s))return o;t[e+o]=s}return o}function jr(t,r,e,n){return U(B(r,t.length-e),t,e,n)}function nr(t,r,e,n){return U(me(r),t,e,n)}function re(t,r,e,n){return nr(t,r,e,n)}function ee(t,r,e,n){return U(sr(r),t,e,n)}function te(t,r,e,n){return U(he(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Qr(this,r,e,n);case"utf8":case"utf-8":return jr(this,r,e,n);case"ascii":return nr(this,r,e,n);case"latin1":case"binary":return re(this,r,e,n);case"base64":return ee(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,r,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};u.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 ir(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=e){var l,f,m,p;switch(s){case 1:a<128&&(o=a);break;case 2:l=t[i+1],(l&192)===128&&(p=(a&31)<<6|l&63,p>127&&(o=p));break;case 3:l=t[i+1],f=t[i+2],(l&192)===128&&(f&192)===128&&(p=(a&15)<<12|(l&63)<<6|f&63,p>2047&&(p<55296||p>57343)&&(o=p));break;case 4:l=t[i+1],f=t[i+2],m=t[i+3],(l&192)===128&&(f&192)===128&&(m&192)===128&&(p=(a&15)<<18|(l&63)<<12|(f&63)<<6|m&63,p>65535&&p<1114112&&(o=p))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return ie(n)}var Z=4096;function ie(t){var r=t.length;if(r<=Z)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Z));return e}function ae(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function oe(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function ue(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",a=r;a<e;++a)i+=fe(t[a]);return i}function se(t,r,e){for(var n=t.slice(r,e),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}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 i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=u.prototype;else{var a=e-r;i=new u(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+r]}return i};function h(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||h(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var i=this[r+--e],a=1;e>0&&(a*=256);)i+=this[r+--e]*a;return i};u.prototype.readUInt8=function(r,e){return e||h(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||h(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||h(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||h(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||h(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||h(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var i=e,a=1,o=this[r+--i];i>0&&(a*=256);)o+=this[r+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};u.prototype.readInt8=function(r,e){return e||h(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||h(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||h(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||h(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||h(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||h(r,4,this.length),L(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||h(r,4,this.length),L(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||h(r,8,this.length),L(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||h(r,8,this.length),L(this,r,!1,52,8)};function g(t,r,e,n,i,a){if(!_(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<a)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,i){if(r=+r,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;g(this,r,e,n,a,0)}var o=1,s=0;for(this[e]=r&255;++s<n&&(o*=256);)this[e+s]=r/o&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;g(this,r,e,n,a,0)}var o=n-1,s=1;for(this[e+o]=r&255;--o>=0&&(s*=256);)this[e+o]=r/s&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function O(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,a=Math.min(t.length-e,2);i<a;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):O(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):O(this,r,e,!1),e+2};function M(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,a=Math.min(t.length-e,4);i<a;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||g(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):M(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||g(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):M(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);g(this,r,e,n,a-1,-a)}var o=0,s=1,l=0;for(this[e]=r&255;++o<n&&(s*=256);)r<0&&l===0&&this[e+o-1]!==0&&(l=1),this[e+o]=(r/s>>0)-l&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);g(this,r,e,n,a-1,-a)}var o=n-1,s=1,l=0;for(this[e+o]=r&255;--o>=0&&(s*=256);)r<0&&l===0&&this[e+o+1]!==0&&(l=1),this[e+o]=(r/s>>0)-l&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||g(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||g(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):O(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):O(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||g(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):M(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||g(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):M(this,r,e,!1),e+4};function ar(t,r,e,n,i,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function or(t,r,e,n,i){return i||ar(t,r,e,4,34028234663852886e22,-34028234663852886e22),lr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return or(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return or(this,r,e,!1,n)};function ur(t,r,e,n,i){return i||ar(t,r,e,8,17976931348623157e292,-17976931348623157e292),lr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return ur(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return ur(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var a=i-n,o;if(this===r&&n<e&&e<i)for(o=a-1;o>=0;--o)r[o+e]=this[o+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)r[o+e]=this[o+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};u.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}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 o;if(typeof r=="number")for(o=e;o<n;++o)this[o]=r;else{var s=_(r)?r:B(new u(r,i).toString()),l=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%l]}return this};var ce=/[^+\/0-9A-Za-z-_]/g;function le(t){if(t=pe(t).replace(ce,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function pe(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function fe(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,r){r=r||1/0;for(var e,n=t.length,i=null,a=[],o=0;o<n;++o){if(e=t.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(r-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&a.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function me(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function he(t,r){for(var e,n,i,a=[],o=0;o<t.length&&!((r-=2)<0);++o)e=t.charCodeAt(o),n=e>>8,i=e%256,a.push(i),a.push(n);return a}function sr(t){return Hr(le(t))}function U(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function be(t){return t!==t}function ge(t){return t!=null&&(!!t._isBuffer||cr(t)||de(t))}function cr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function de(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&cr(t.slice(0,0))}function L(t,r,e,n,i){var a,o,s=i*8-n-1,l=(1<<s)-1,f=l>>1,m=-7,p=e?i-1:0,x=e?-1:1,d=t[r+p];for(p+=x,a=d&(1<<-m)-1,d>>=-m,m+=s;m>0;a=a*256+t[r+p],p+=x,m-=8);for(o=a&(1<<-m)-1,a>>=-m,m+=n;m>0;o=o*256+t[r+p],p+=x,m-=8);if(a===0)a=1-f;else{if(a===l)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-f}return(d?-1:1)*o*Math.pow(2,a-n)}function lr(t,r,e,n,i,a){var o,s,l,f=a*8-i-1,m=(1<<f)-1,p=m>>1,x=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,P=n?1:-1,br=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,o=m):(o=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+p>=1?r+=x/l:r+=x*Math.pow(2,1-p),r*l>=2&&(o++,l/=2),o+p>=m?(s=0,o=m):o+p>=1?(s=(r*l-1)*Math.pow(2,i),o=o+p):(s=r*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;t[e+d]=s&255,d+=P,s/=256,i-=8);for(o=o<<i|s,f+=i;f>0;t[e+d]=o&255,d+=P,o/=256,f-=8);t[e+d-P]|=br*128}var Ee=(c=>(c.ENABLED="company.enabled",c.APP_TITLE="company.appTitle",c.DOMAIN="company.domain",c.LOGO="appearance.logo",c.AMM="product.amm",c.OBDEX="product.obdex",c.THEMES="appearance.themes",c.DIRECT_SETTLE="company.directSettlement",c.AMM_FEE="company.ammFee",c.FEE_SHARE="company.feeShare",c.MIN_FEE="company.minFee",c.MAKER_FEE="company.makerFee",c.TAKER_FEE="company.takerFee",c.GEOBLOCK="company.geoblock",c.EMBEDDED_APP_URL="company.embeddedAppUrl",c.PRODUCT_OBDEX="product.obdex",c.PRODUCT_AMM="product.amm",c.NEW_TAB="appearance.newTab",c.APPEARANCE_TARGET="appearance.target",c.CUSTOM_MENU_ITEMS="appearance.customMenuItems",c.REPORT_BUTTONS="appearance.reportButtons",c.APPEARANCE_CHART_TYPE="appearance.chartType",c.APPEARANCE_CHART_INT="appearance.chartInt",c.PINNED_PAIRS="markets.pinnedPairs",c.KYC_TRADE_REQUIREMENT_ENABLED="markets.kycTradeRequirementEnabled",c.AFFILIATE_DASHBOARD_VISIBILITY="product.affiliateDashboardVisibility",c.AFFILIATE_DASHBOARD_THRESHOLD="product.affiliateDashboardThreshold",c.AFFILIATE_DEFAULT_FEE_SHARE="product.affiliateDefaultFeeShare",c.AFFILIATE_POINTS_REWARD="product.affiliatePointsReward",c.POINT_SYSTEM_MODE="product.pointSystem",c.POINT_SYSTEM_TELEGRAM_API_TOKEN="point-system.telegramApiToken",c.POINT_SYSTEM_TELEGRAM_ENABLED="point-system.telegramEnabled",c.POINT_SYSTEM_TELEGRAM_GROUP_ID="point-system.telegramGroupId",c.POINT_SYSTEM_TELEGRAM_BOT_NAME="point-system.telegramBotName",c.POINT_SYSTEM_TELEGRAM_BOT_ID="point-system.telegramBotId",c.POINT_SYSTEM_TELEGRAM_GROUP_NAME="point-system.telegramGroupName",c.POINT_SYSTEM_TELEGRAM_WEBHOOK_TOKEN="point-system.telegramWebhookToken",c.POINT_SYSTEM_DISCORD_CLIENT_ID="point-system.discordClientId",c.POINT_SYSTEM_DISCORD_CLIENT_SECRET="point-system.discordClientSecret",c.POINT_SYSTEM_DISCORD_SERVER_ID="point-system.discordServerId",c.POINT_SYSTEM_DISCORD_ENABLED="point-system.discordEnabled",c.POINT_SYSTEM_TWITTER_CLIENT_ID="point-system.twitterClientId",c.POINT_SYSTEM_TWITTER_CLIENT_SECRET="point-system.twitterClientSecret",c.POINT_SYSTEM_TWITTER_BEARER_TOKEN="point-system.twitterBearerToken",c.POINT_SYSTEM_TWITTER_REFRESH_TOKEN="point-system.twitterRefreshToken",c.POINT_SYSTEM_TWITTER_ENABLED="point-system.twitterEnabled",c.POINT_SYSTEM_TWITTER_JOB_ENABLED="point-system.twitterJobEnabled",c.POINT_SYSTEM_TWITTER_HASHTAGS="point-system.twitterHashtags",c.POINT_SYSTEM_TWITTER_TWEET_EXP_TIME="point-system.twitterPostDefaultExpirationTime",c.POINT_SYSTEM_TWITTER_ACCOUNT_NAME="point-system.twitterAccountName",c.POINT_SYSTEM_TWITTER_ACCOUNT_ID="point-system.twitterAccountId",c.POINT_SYSTEM_TWITTER_WEBHOOK_TOKEN="point-system.twitterWebhookToken",c.POINT_SYSTEM_GUIDE_LINK="point-system.guideLink",c))(Ee||{}),xe=(n=>(n.DISABLED="disabled",n.ENABLED_FOR_ALL="enabled for all",n.ENABLED_FOR_AFFILIATES="enabled for affiliates",n))(xe||{}),Te=(o=>(o.API_TOKEN="apiToken",o.CLIENT_ID="clientId",o.CLIENT_SECRET="clientSecret",o.BEARER_TOKEN="bearerToken",o.REFRESH_TOKEN="refreshToken",o.ACCESS_TOKEN="accessToken",o))(Te||{}),Fe={"point-system.telegramApiToken":"apiToken","point-system.discordClientId":"clientId","point-system.discordClientSecret":"clientSecret","point-system.twitterClientSecret":"clientSecret","point-system.twitterClientId":"clientId","point-system.twitterBearerToken":"bearerToken","point-system.twitterRefreshToken":"refreshToken"},We=["primary-1","primary-2","main-background","primary-text","module-background","buy-text","buy-background","sell-text","sell-background","secondary-text","input-background-default","input-background-hover","input-background-disabled","input-border-default","module-border","button-disabled","button-border","input-border-active","active-element-default","hover-element-default","dropdown-shadow","button-text","pair-active-row"],Ke=`{"theme1":{"value":"${b.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${b.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${b.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`,Ve='{"theme1":{"name":"dark","active":true,"value":{"primary-1":"rgba(118, 63, 229, 1)","primary-2":"rgba(249, 132, 146, 1)","main-background":"rgba(1, 1, 1, 1)","primary-text":"rgba(255, 255, 255, 1)","module-background":"rgba(19, 23, 34, 1)","buy-text":"rgba(82, 164, 154, 1)","buy-background":"rgba(2, 199, 122, 0.25)","sell-text":"rgba(221, 94, 86, 1)","sell-background":"rgba(255, 59, 105, 0.25)","secondary-text":"rgba(127, 127, 127, 1)","input-background-default":"rgba(13, 15, 21, 1)","input-background-hover":"rgba(28, 33, 45, 1)","input-background-disabled":"rgba(25, 29, 41, 1)","input-border-default":"rgba(28, 33, 45, 1)","module-border":"rgba(28, 33, 45, 1)","button-disabled":"rgba(111, 113, 118, 1)","button-border":"rgba(255, 255, 255, 1)","input-border-active":"rgba(185, 163, 238, 1)","active-element-default":"rgba(230, 136, 150, 1)","hover-element-default":"rgba(185, 163, 238, 1)","dropdown-shadow":"rgba(154, 92, 253, 0.45)","button-text":"rgba(255, 255, 255, 1)","pair-active-row":"rgba(28, 33, 45, 1)"}},"theme2":{"name":"light","active":true,"value":{"primary-1":"rgba(118, 63, 229, 1)","primary-2":"rgba(249, 132, 146, 1)","main-background":"rgba(249, 248, 248, 1)","primary-text":"rgba(0, 0, 0, 1)","module-background":"rgba(255, 255, 255, 1)","buy-text":"rgba(0, 112, 98, 1)","buy-background":"rgba(0, 112, 98, 0.25)","sell-text":"rgba(195, 12, 1, 1)","sell-background":"rgba(255, 59, 105, 0.25)","secondary-text":"rgba(127, 127, 127, 1)","button-disabled":"rgba(203, 199, 199, 1)","input-background-default":"rgba(255, 255, 255, 1)","input-background-hover":"rgba(249, 248, 248, 1)","input-background-disabled":"rgba(249, 248, 248, 1)","input-border-default":"rgba(228, 225, 225, 1)","module-border":"rgba(228, 225, 225, 1)","button-border":"rgba(170, 167, 167, 1)","input-border-active":"rgba(0, 0, 0, 1)","active-element-default":"rgba(230, 136, 150, 1)","hover-element-default":"rgba(185, 163, 238, 1)","dropdown-shadow":"rgba(154, 92, 253, 0.45)","button-text":"rgba(255, 255, 255, 1)","pair-active-row":"rgb(249, 248, 248)"}},"theme3":{"name":"purple","active":true,"value":{"primary-1":"rgba(118, 63, 229, 1)","primary-2":"rgba(249, 132, 146, 1)","main-background":"rgba(255, 255, 255, 1)","primary-text":"rgba(0, 0, 0, 1)","secondary-text":"rgba(127, 127, 127, 1)","buy-text":"rgba(0, 112, 98, 1)","sell-text":"rgba(195, 12, 1, 1)","buy-background":"rgba(0, 112, 98, 0.25)","sell-background":"rgba(255, 59, 105, 0.25)","module-background":"rgba(254, 250, 255, 1)","module-border":"rgba(228, 225, 225, 1)","input-background-default":"rgba(255, 255, 255, 1)","input-background-hover":"rgba(249, 248, 248, 1)","input-background-disabled":"rgba(254, 250, 255, 1)","input-border-default":"rgba(228, 225, 225, 1)","input-border-active":"rgba(0, 0, 0, 1)","button-border":"rgba(170, 167, 167, 1)","button-disabled":"rgba(203, 199, 199, 1)","active-element-default":"rgba(230, 136, 150, 1)","hover-element-default":"rgba(185, 163, 238, 1)","dropdown-shadow":"rgba(154, 92, 253, 0.45)","button-text":"rgba(255, 255, 255, 1)","pair-active-row":"rgb(249, 248, 248)"}}}',_e=(n=>(n.theme1='{"name":"dark","id":"theme1","active":true, "chartColors":{"bullish_candle_color": "rgba(2, 199, 122, 0.25)","bearish_candle_color": "rgba(221, 94, 86, 1)","bullish_wick_color": "rgba(2, 199, 122, 0.25)","bearish_wick_color": "rgba(221, 94, 86, 1)","bullish_outline_color": "rgba(2, 199, 122, 0.25)","bearish_outline_color": "rgba(221, 94, 86, 1)","line_color": "rgba(41, 98, 255, 1)","chart_background": "rgba(19, 23, 34, 1)","chart_text": "rgba(127, 127, 127, 1)"}, "colors":{"primary-1":"rgba(118, 63, 229, 1)","primary-2":"rgba(249, 132, 146, 1)","main-background":"rgba(1, 1, 1, 1)","primary-text":"rgba(255, 255, 255, 1)","module-background":"rgba(19, 23, 34, 1)","buy-text":"rgba(82, 164, 154, 1)","buy-background":"rgba(2, 199, 122, 0.25)","sell-text":"rgba(221, 94, 86, 1)","sell-background":"rgba(255, 59, 105, 0.25)","secondary-text":"rgba(127, 127, 127, 1)","input-background-default":"rgba(13, 15, 21, 1)","input-background-hover":"rgba(28, 33, 45, 1)","input-background-disabled":"rgba(25, 29, 41, 1)","input-border-default":"rgba(28, 33, 45, 1)","module-border":"rgba(28, 33, 45, 1)","button-disabled":"rgba(111, 113, 118, 1)","button-border":"rgba(255, 255, 255, 1)","input-border-active":"rgba(185, 163, 238, 1)","active-element-default":"rgba(230, 136, 150, 1)","hover-element-default":"rgba(185, 163, 238, 1)","dropdown-shadow":"rgba(154, 92, 253, 0.45)","button-text":"rgba(255, 255, 255, 1)","pair-active-row":"rgba(28, 33, 45, 1)"}}',n.theme2='{"name":"light","id":"theme2","active":true, "chartColors":{"bullish_candle_color": "rgba(0, 112, 98, 1)","bearish_candle_color": "rgba(195, 12, 1, 1)","bullish_wick_color": "rgba(0, 112, 98, 1)","bearish_wick_color": "rgba(195, 12, 1, 1)","bullish_outline_color": "rgba(0, 112, 98, 1)","bearish_outline_color": "rgba(195, 12, 1, 1)","line_color": "rgba(41, 98, 255, 1)","chart_background": "rgba(255, 255, 255, 1)","chart_text": "rgba(127, 127, 127, 1)"}, "colors":{"primary-1":"rgba(118, 63, 229, 1)","primary-2":"rgba(249, 132, 146, 1)","main-background":"rgba(249, 248, 248, 1)","primary-text":"rgba(0, 0, 0, 1)","module-background":"rgba(255, 255, 255, 1)","buy-text":"rgba(0, 112, 98, 1)","buy-background":"rgba(0, 112, 98, 0.25)","sell-text":"rgba(195, 12, 1, 1)","sell-background":"rgba(255, 59, 105, 0.25)","secondary-text":"rgba(127, 127, 127, 1)","button-disabled":"rgba(203, 199, 199, 1)","input-background-default":"rgba(255, 255, 255, 1)","input-background-hover":"rgba(249, 248, 248, 1)","input-background-disabled":"rgba(249, 248, 248, 1)","input-border-default":"rgba(228, 225, 225, 1)","module-border":"rgba(228, 225, 225, 1)","button-border":"rgba(170, 167, 167, 1)","input-border-active":"rgba(0, 0, 0, 1)","active-element-default":"rgba(230, 136, 150, 1)","hover-element-default":"rgba(185, 163, 238, 1)","dropdown-shadow":"rgba(154, 92, 253, 0.45)","button-text":"rgba(255, 255, 255, 1)","pair-active-row":"rgb(249, 248, 248)"}}',n.theme3='{"name":"purple","id":"theme3","active":true, "chartColors":{"bullish_candle_color": "rgba(0, 112, 98, 1)","bearish_candle_color": "rgba(195, 12, 1, 1)","bullish_wick_color": "rgba(0, 112, 98, 1)","bearish_wick_color": "rgba(195, 12, 1, 1)","bullish_outline_color": "rgba(0, 112, 98, 1)","bearish_outline_color": "rgba(195, 12, 1, 1)","line_color": "rgba(41, 98, 255, 1)","chart_background": "rgba(254, 250, 255, 1)","chart_text": "rgba(127, 127, 127, 1)"}, "colors":{"primary-1":"rgba(118, 63, 229, 1)","primary-2":"rgba(249, 132, 146, 1)","main-background":"rgba(255, 255, 255, 1)","primary-text":"rgba(0, 0, 0, 1)","secondary-text":"rgba(127, 127, 127, 1)","buy-text":"rgba(0, 112, 98, 1)","sell-text":"rgba(195, 12, 1, 1)","buy-background":"rgba(0, 112, 98, 0.25)","sell-background":"rgba(255, 59, 105, 0.25)","module-background":"rgba(254, 250, 255, 1)","module-border":"rgba(228, 225, 225, 1)","input-background-default":"rgba(255, 255, 255, 1)","input-background-hover":"rgba(249, 248, 248, 1)","input-background-disabled":"rgba(254, 250, 255, 1)","input-border-default":"rgba(228, 225, 225, 1)","input-border-active":"rgba(0, 0, 0, 1)","button-border":"rgba(170, 167, 167, 1)","button-disabled":"rgba(203, 199, 199, 1)","active-element-default":"rgba(230, 136, 150, 1)","hover-element-default":"rgba(185, 163, 238, 1)","dropdown-shadow":"rgba(154, 92, 253, 0.45)","button-text":"rgba(255, 255, 255, 1)","pair-active-row":"rgb(249, 248, 248)"}}',n))(_e||{});var ye=(a=>(a.STABLE="stable",a.CPMM="constant_product",a.LEND="lending",a.NANO="nano",a.MVNANO="mvnano",a))(ye||{}),we=(a=>(a[a.ultrade=0]="ultrade",a[a.tinyman=1]="tinyman",a[a.pactfi=2]="pactfi",a[a.humble=3]="humble",a[a.algofi=4]="algofi",a))(we||{}),Ae=(a=>(a.ultrade="U",a.tinyman="T",a.pactfi="P",a.humble="H",a.algofi="A",a))(Ae||{}),Re=(a=>(a[a.ultrade=1]="ultrade",a[a.tinyman=2]="tinyman",a[a.pactfi=1]="pactfi",a[a.humble=1]="humble",a[a.algofi=2]="algofi",a))(Re||{}),pr={V1_1:"v1_1",V2:"v2"},Xe={[pr.V1_1]:{testnet:62368684,mainnet:552635992},[pr.V2]:{testnet:148607e3,mainnet:1002541853}},Ie=(e=>(e.ASSETS="assets.json",e.TOP_ASSETS="topAssets.json",e))(Ie||{});var ve=(i=>(i.last_7_days="last_7_days",i.last_30_days="last_30_days",i.last_90_days="last_90_days",i.last_year="last_year",i))(ve||{}),fr=class{constructor(){this.timeRange="last_30_days";this.sortBy="volume_usd";this.order="desc";this.limit=20;this.page=1}},mr=class{constructor(){this.timeRange="last_30_days";this.sortBy="volume_usd";this.order="desc";this.limit=20;this.page=1}},Ne=(i=>(i.volume="volume",i.fees="fees",i.orders="orders",i.dau="dau",i))(Ne||{}),hr=class{constructor(){this.type="volume";this.timeRange="last_7_days"}};var Pe=(a=>(a.PREPARING="provisioning",a.STOPPING="stopping",a.RUNNING="running",a.STOPPED="stopped",a.FAILED="failed",a))(Pe||{});export{xe as AffDashboardVisibilitySettingEnum,Ie as AmmBucketKeys,Ae as AmmChars,Re as AmmForeignResources,we as AmmIds,pr as CONTRACT_VERSION,hr as ChartQueryDto,Te as CredentialNameEnum,Pe as HummingbotInstanceStatus,fr as PairsQueryDto,ye as PoolType,Ee as SettingIds,ve as SmallTimeframeEnum,Ne as StatisticTypeQuery,mr as UsersQueryDto,Xe as VALIDATOR_APP_ID,Ke as defaultLogoSettingValue,Ve as defaultThemeSettingValue,_e as defaultThemesValue,We as requiredColors,Fe as settingIdToSecretType};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import i from"algosdk";import g,{decodeAddress as y,encodeAddress as l}from"algosdk";import{Buffer as a}from"buffer";import{encodeAddress as A,decodeAddress as m}from"algosdk";function o(e){return new Uint8Array(a.from(e))}function w(e){return o(e)}function c(e,n,r){return i.makePaymentTxnWithSuggestedParamsFromObject({from:e,to:e,amount:0,note:n&&new Uint8Array(Buffer.from(n,r)),suggestedParams:{fee:0,firstRound:1,lastRound:2,genesisHash:"SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=",genesisID:"testnet-v1.0"}})}function I(e,n,r,t){return u(c(e,n,r),t)}async function u(e,n){let r=i.encodeUnsignedTransaction(e),t=await n([r]),s=i.decodeSignedTransaction(t[0]);return new Uint8Array(s.sig)}export{w as encodeMessage,c as generateTxnForSign,I as signTxn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import i from"bignumber.js";i.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var d=(e=>(e.MINUS="-",e.PLUS="+",e.MULTIPLY="*",e.DIVIDE="/",e.GREATER_THAN_OR_EQUAL=">=",e.GREATER_THAN=">",e.LESS_THAN_OR_EQUAL="<=",e.LESS_THAN="<",e.EQUAL="==",e.MOD="mod",e))(d||{});function N(n){return new i(n).abs().toString()}function L(n){let t=new i(String(n)).integerValue(i.ROUND_CEIL).toString();return c(n,t)||console.log("Ceil value",{value:n,res:t}),t}function A(n,r,t=!1){let s=new i(String(n)),u;if(t){let g=s.toFixed(),b=g.indexOf(".");if(b>=0){let x=g.slice(b+1),a=0;for(let e of x)if(e==="0")a++;else break;let f=a+1;u=s.toFixed(f,i.ROUND_UP)}else u=s.toFixed(0)}else u=s.toFixed(r);return console.log("Fixed value",{value:n,res:u}),u}function _(n){let t=new i(String(n)).integerValue(i.ROUND_FLOOR).toString();return console.log("Floor value",{value:n,res:t}),t}function U(n){let t=new i(String(n)).integerValue(i.ROUND_HALF_UP).toString();return console.log("Round value",{value:n,res:t}),t}function O(n,r){return o(n,r,"+")}function R(n,r){return o(n,r,"-")}function E(n,r){return o(n,r,"*")}function h(n,r){return E(n,r||0)}function F(n,r){return o(n,r,"/")}function D(n,r){return!!o(n,r,">=")}function I(n,r){return!!o(n,r,">")}function P(n,r){return!!o(n,r,"<=")}function w(n,r){return!!o(n,r,"<")}function c(n,r){return!!o(n,r,"==")}function S(n,r){return o(n,r,"mod")}function M(n,r){return c(S(n,r),0)}function o(n,r,t){switch(n=new i(String(n)),r=new i(String(r)),t.toLowerCase()){case"-":return n.minus(r).toString();case"+":return n.plus(r).toString();case"*":case"x":return n.multipliedBy(r).toString();case"\xF7":case"/":return n.dividedBy(r).toString();case">=":return n.isGreaterThanOrEqualTo(r);case">":return n.isGreaterThan(r);case"<=":return n.isLessThanOrEqualTo(r);case"<":return n.isLessThan(r);case"==":return n.isEqualTo(r);case"mod":return n.modulo(r);default:break}}function l(n){if(n.toString().includes("e")){let r=n.toString().split("e");return[parseFloat(r[0]),parseFloat(r[1])]}return[n,0]}function m(n,r){return n+(r<0?`e${r}`:`e+${r}`)}function p({decimalPlaces:n=0},r){if(n>0){let[t,s]=l(r),[u,g]=l(Math.round(Number(m(t,s+n))));return Number(m(u,g-n))}return Math.round(r)}function B(n,r){let t=Number(n);return p({decimalPlaces:t},Math.pow(10,-t)*Number(r))}function H(n,r){let t=Math.pow(10,Number(n))*Number(r);return p({decimalPlaces:0},t)}export{d as Operations,N as absolute,o as bn_operation,L as ceil,B as convertFromBaseUnits,H as convertToBaseUnits,F as divide,c as equal,_ as floor,I as greaterThan,D as greaterThanOrEqual,w as lessThan,P as lessThanOrEqual,R as minus,S as mod,M as modZero,E as multiply,O as plus,U as round,p as roundNumber,A as toFixed,h as toUsd};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function v(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 V(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 h=(r=>(r[r.Buy=0]="Buy",r[r.Sell=1]="Sell",r))(h||{}),p=h;var b=(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))(b||{}),E=(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))(E||{}),ae={...b,...E};function I(e){switch(e){case p.Buy:return"B";case p.Sell:return"S";default:throw new Error("Unknown order side type: "+e)}}var qe=e=>{let t=new Date(e),r=t.toLocaleDateString("default",{year:"numeric",month:"numeric",day:"numeric"}),n=t.toLocaleTimeString("en-US",{hour12:!0,hour:"2-digit",minute:"2-digit"});return r+" "+n},f=(e,t)=>String(e).toLowerCase()===String(t).toLowerCase();function Xe(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}function je(e){let t=[],r=e.split(".");for(let n=0;n<r.length-1;n++)t.push(r.slice(n).join("."));return t}function Je(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":g(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:g(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 g(e){if(!e?.length)return e;let t=Math.round(e.length/3),r=t,n=e.length-t;return e.substring(0,r)+"*".repeat(t)+e.substring(n)}function A(e,t){return Array.isArray(e)?e.map(r=>A(r,t)):typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e).filter(([r])=>r!==t).map(([r,n])=>[r,A(n,t)])):e}function d(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}import s from"bignumber.js";s.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var w=(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))(w||{});function et(e){return new s(e).abs().toString()}function tt(e){let r=new s(String(e)).integerValue(s.ROUND_CEIL).toString();return O(e,r)||console.log("Ceil value",{value:e,res:r}),r}function rt(e,t,r=!1){let n=new s(String(e)),o;if(r){let c=n.toFixed(),u=c.indexOf(".");if(u>=0){let y=c.slice(u+1),m=0;for(let i of y)if(i==="0")m++;else break;let L=m+1;o=n.toFixed(L,s.ROUND_UP)}else o=n.toFixed(0)}else o=n.toFixed(t);return console.log("Fixed value",{value:e,res:o}),o}function nt(e){let r=new s(String(e)).integerValue(s.ROUND_FLOOR).toString();return console.log("Floor value",{value:e,res:r}),r}function ot(e){let r=new s(String(e)).integerValue(s.ROUND_HALF_UP).toString();return console.log("Round value",{value:e,res:r}),r}function _(e,t){return a(e,t,"+")}function it(e,t){return a(e,t,"-")}function U(e,t){return a(e,t,"*")}function st(e,t){return U(e,t||0)}function pt(e,t){return a(e,t,"/")}function at(e,t){return!!a(e,t,">=")}function ct(e,t){return!!a(e,t,">")}function dt(e,t){return!!a(e,t,"<=")}function lt(e,t){return!!a(e,t,"<")}function O(e,t){return!!a(e,t,"==")}function k(e,t){return a(e,t,"mod")}function ut(e,t){return O(k(e,t),0)}function a(e,t,r){switch(e=new s(String(e)),t=new s(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 x(e){if(e.toString().includes("e")){let t=e.toString().split("e");return[parseFloat(t[0]),parseFloat(t[1])]}return[e,0]}function T(e,t){return e+(t<0?`e${t}`:`e+${t}`)}function N({decimalPlaces:e=0},t){if(e>0){let[r,n]=x(t),[o,c]=x(Math.round(Number(T(r,n+e))));return Number(T(o,c-e))}return Math.round(t)}function mt(e,t){let r=Number(e);return N({decimalPlaces:r},Math.pow(10,-r)*Number(t))}function ht(e,t){let r=Math.pow(10,Number(e))*Number(t);return N({decimalPlaces:0},r)}function ft(e,t,r){let n=e.buyOrder&&e.sellOrder?e.buyOrderId>e.sellOrderId?e.buyOrder:e.sellOrder:e.buyOrder||e.sellOrder;return{pairId:e.pairId,orderId:n?.id,orderSide:n&&I(n.side),...C(t,r),...R(e,n)}}function xt(e,t,r,n,o){return{id:e.id,pairId:e.pairId,pair:r||e.pair?.pairKey,...C(n,o),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=>R(c,e))}}function C(e,t){return{baseTokenId:e?.id,baseTokenDecimal:e?.decimals,quoteTokenId:t?.id,quoteTokenDecimal:t?.decimals}}function R(e,t){return{tradeId:e.tradeId,status:e.txStatus,amount:e.amount,total:e.total,price:e.price,fee:t&&e.tradeFees.filter(r=>f(r.address,t.userId)).reduce((r,n)=>_(r,n.fee),"0"),createdAt:e.createdAt?.getTime(),updatedAt:e.updatedAt?.getTime(),isBuyer:t&&t.side===p.Buy,isMaker:t&&P(t.side,e.tradeSide)}}function P(e,t){return e===p.Buy&&t===p.Sell||e===p.Sell&&t===p.Buy}import l from"algosdk";import Dt,{decodeAddress as yt,encodeAddress as Lt}from"algosdk";import{Buffer as F}from"buffer";import{encodeAddress as kt,decodeAddress as Pt}from"algosdk";function D(e){return new Uint8Array(F.from(e))}function Gt(e){return D(e)}function B(e,t,r){return l.makePaymentTxnWithSuggestedParamsFromObject({from:e,to:e,amount:0,note:t&&new Uint8Array(Buffer.from(t,r)),suggestedParams:{fee:0,firstRound:1,lastRound:2,genesisHash:"SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=",genesisID:"testnet-v1.0"}})}function vt(e,t,r,n){return G(B(e,t,r),n)}async function G(e,t){let r=l.encodeUnsignedTransaction(e),n=await t([r]),o=l.decodeSignedTransaction(n[0]);return new Uint8Array(o.sig)}export{w as Operations,et as absolute,a as bn_operation,tt as ceil,mt as convertFromBaseUnits,ht as convertToBaseUnits,Je as cutEvent,pt as divide,Gt as encodeMessage,O as equal,f as equalIgnoreCase,nt as floor,B as generateTxnForSign,je as getDomains,Xe as getRandomInt,ct as greaterThan,at as greaterThanOrEqual,P as isMaker,lt as lessThan,dt as lessThanOrEqual,qe as listDateFormat,v as mapToCodexAssetDto,V as mapToCodexBalanceDto,xt as mapToOrderTradeDto,ft as mapToUserTradeDto,g as maskingString,it as minus,k as mod,ut as modZero,U as multiply,_ as plus,A as removeField,ot as round,N as roundNumber,vt as signTxn,rt as toFixed,st as toUsd};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(e,s){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:s?s(e):!1}}export{a as mapToCodexAssetDto};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(n){return{hash:n.hash,loginAddress:n.loginAddress,loginChainId:n.loginChainId,tokenId:n.token?.id,tokenAddress:n.tokenId,tokenChainId:n.tokenChainId,amount:n.amount,lockedAmount:n.lockedAmount}}export{e as mapToCodexBalanceDto};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _(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 g(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 s=(r=>(r[r.Buy=0]="Buy",r[r.Sell=1]="Sell",r))(s||{}),n=s;var a=(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))(a||{}),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||{}),H={...a,...c};function l(e){switch(e){case n.Buy:return"B";case n.Sell:return"S";default:throw new Error("Unknown order side type: "+e)}}var d=(e,t)=>String(e).toLowerCase()===String(t).toLowerCase();import i from"bignumber.js";i.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function m(e,t){return b(e,t,"+")}function b(e,t,r){switch(e=new i(String(e)),t=new i(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 ye(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&&l(o.side),...h(t,r),...u(e,o)}}function ke(e,t,r,o,p){return{id:e.id,pairId:e.pairId,pair:r||e.pair?.pairKey,...h(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(E=>u(E,e))}}function h(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=>d(r.address,t.userId)).reduce((r,o)=>m(r,o.fee),"0"),createdAt:e.createdAt?.getTime(),updatedAt:e.updatedAt?.getTime(),isBuyer:t&&t.side===n.Buy,isMaker:t&&A(t.side,e.tradeSide)}}function A(e,t){return e===n.Buy&&t===n.Sell||e===n.Sell&&t===n.Buy}export{A as isMaker,_ as mapToCodexAssetDto,g as mapToCodexBalanceDto,ke as mapToOrderTradeDto,ye as mapToUserTradeDto};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=(r=>(r[r.Buy=0]="Buy",r[r.Sell=1]="Sell",r))(s||{}),p=s;var a=(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))(a||{}),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||{}),v={...a,...c};function l(e){switch(e){case p.Buy:return"B";case p.Sell:return"S";default:throw new Error("Unknown order side type: "+e)}}var m=(e,t)=>String(e).toLowerCase()===String(t).toLowerCase();import i from"bignumber.js";i.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function d(e,t){return I(e,t,"+")}function I(e,t,r){switch(e=new i(String(e)),t=new i(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 we(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&&l(o.side),...E(t,r),...h(e,o)}}function Pe(e,t,r,o,n){return{id:e.id,pairId:e.pairId,pair:r||e.pair?.pairKey,...E(o,n),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(u=>h(u,e))}}function E(e,t){return{baseTokenId:e?.id,baseTokenDecimal:e?.decimals,quoteTokenId:t?.id,quoteTokenDecimal:t?.decimals}}function h(e,t){return{tradeId:e.tradeId,status:e.txStatus,amount:e.amount,total:e.total,price:e.price,fee:t&&e.tradeFees.filter(r=>m(r.address,t.userId)).reduce((r,o)=>d(r,o.fee),"0"),createdAt:e.createdAt?.getTime(),updatedAt:e.updatedAt?.getTime(),isBuyer:t&&t.side===p.Buy,isMaker:t&&_(t.side,e.tradeSide)}}function _(e,t){return e===p.Buy&&t===p.Sell||e===p.Sell&&t===p.Buy}export{_ as isMaker,Pe as mapToOrderTradeDto,we as mapToUserTradeDto};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=(r,o)=>{if(!r)throw new Error(`Assertion error: ${o}`)};export{e as assert};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a,{encodeAddress as u}from"algosdk";var c=28,l=t=>{let i=Buffer.from(t,"base64");return p(i,{priceCoin_locked:{type:"uint"},priceCoin_available:{type:"uint"},baseCoin_locked:{type:"uint"},baseCoin_available:{type:"uint"},companyId:{type:"uint"},WLFeeShare:{type:"uint"},WLCustomFee:{type:"uint"},slotMap:{type:"uint"}})};function p(t,i){let n=new Map,e=0;for(let[s,o]of Object.entries(i)){if(e>=t.length)throw new Error("Array index out of bounds");let r;switch(o.type){case"address":r=u(t.slice(e,e+32)),e+=32;break;case"bytes":r=t.slice(e,e+o.size),r=a.decodeUint64(r,"mixed"),e+=o.size;break;case"uint":r=a.decodeUint64(t.slice(e,e+8),"mixed"),e+=8;break;case"string":r=y(t.slice(e,e+o.size)),e+=o.size;break}n.set(s,r)}return Object.fromEntries(n)}function y(t){return Buffer.from(t).toString("utf-8")}var f=t=>{let i=Buffer.from(t,"base64"),n=[];for(let e=0;e<4;e++){let s=p(i.subarray(c*e,c*(e+1)),{orderID:{type:"uint"},side:{type:"string",size:1},price:{type:"uint"},amount:{type:"uint"},type:{type:"string",size:1},directSettle:{type:"string",size:1},storageSlot:{type:"bytes",size:1}});n.push(s)}return n};export{y as decodeString,l as getAccounInfoFormLocalStorage,f as printUnpackedLocalData,p as unpackData};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=e=>{let r=new Date(e),t=r.toLocaleDateString("default",{year:"numeric",month:"numeric",day:"numeric"}),n=r.toLocaleTimeString("en-US",{hour12:!0,hour:"2-digit",minute:"2-digit"});return t+" "+n},u=(e,r)=>String(e).toLowerCase()===String(r).toLowerCase();function h(e,r){return e=Math.ceil(e),r=Math.floor(r),Math.floor(Math.random()*(r-e+1))+e}function c(e){let r=[],t=e.split(".");for(let n=0;n<t.length-1;n++)r.push(t.slice(n).join("."));return r}function g(e){let r=e.headers&&o({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}),t=e.requestContext&&o({identity:e.requestContext.identity&&o({userAgent:e.requestContext.identity.userAgent,sourceIp:e.requestContext.identity.sourceIp}),domainName:e.requestContext.domainName});return o({manage:e.manage,path:e.path,httpMethod:e.httpMethod,headers:r,requestContext:t})}function a(e){if(!e?.length)return e;let r=Math.round(e.length/3),t=r,n=e.length-r;return e.substring(0,t)+"*".repeat(r)+e.substring(n)}function s(e,r){return Array.isArray(e)?e.map(t=>s(t,r)):typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e).filter(([t])=>t!==r).map(([t,n])=>[t,s(n,r)])):e}function o(e){return Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0))}export{g as cutEvent,u as equalIgnoreCase,c as getDomains,h as getRandomInt,d as listDateFormat,a as maskingString,s as removeField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=()=>1;export{t as getGlobalPointSystemId};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"bignumber.js";e.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function o(r,n){return t(r,n,"-")}function u(r,n){return t(r,n,"*")}function s(r,n){return t(r,n,"/")}function i(r,n){return!!t(r,n,">")}function t(r,n,g){switch(r=new e(String(r)),n=new e(String(n)),g.toLowerCase()){case"-":return r.minus(n).toString();case"+":return r.plus(n).toString();case"*":case"x":return r.multipliedBy(n).toString();case"\xF7":case"/":return r.dividedBy(n).toString();case">=":return r.isGreaterThanOrEqualTo(n);case">":return r.isGreaterThan(n);case"<=":return r.isLessThanOrEqualTo(n);case"<":return r.isLessThan(n);case"==":return r.isEqualTo(n);case"mod":return r.modulo(n);default:break}}var m=(r,n)=>i(n,0)&&i(r,0)?u(s(o(r,n),n),100):"0";export{m as changes24H};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=864e5,a=30;var o=18,n=1e5,E=1e3,i=9e4,b=30,T=60,_=328,l=1,d=18,c=36,u=248;var p={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var m={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},R={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"},A={SMALLESTUNIT:process.env.SMALLEST_UNIT},N={SMALLEST_UNITS:process.env.SMALLEST_UNIT},O={AVAILABLE_ASSETS_PER_USER:1,AVAILABLE_ASSETS_PER_IP:3};var S=`{"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 L=["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 P=e=>`By signing this message, you confirm that the wallet is a trusted one ${e}; Data: `;export{A as BIGNUMBER,N as CALCULATIONS,p as CCTP_UNIFIED_ASSETS,r as DAY_MILLISECONDS,i as DEFAULT_FEE_SHARE,b as DEFAULT_ORDER_EXPIRATION_DAYS,a as EXPIRE_DAYS,o as FACTOR_PRICE_DECIMAL,n as FEE_SCALE,E as FRONTEND_FEE_SCALE,d as MAX_TOKEN_DECIMAL,T as MIN_ORDER_EXPIRATION_MINS,_ as ORDER_DATA_BYTES_LENGTH,l as ORDER_MSG_VERSION,L as PointSystemSettingsIds,m as RESPONSES,R as RES_MSG,O as SERVER,c as SHARE_DATA_LENGTH,u as WITHDRAW_DATA_BYTES_LENGTH,P as messageForSigning};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var N=(s=>(s[s.Solana=1]="Solana",s[s.Algorand=8]="Algorand",s[s.Polygon=5]="Polygon",s[s.Bsc=4]="Bsc",s[s.Avalanche=6]="Avalanche",s[s.Arbitrum=23]="Arbitrum",s[s.Optimism=24]="Optimism",s[s.Base=30]="Base",s[s.Ethereum=2]="Ethereum",s[s.Sepolia=10002]="Sepolia",s[s.ArbitrumSepolia=10003]="ArbitrumSepolia",s[s.BaseSepolia=10004]="BaseSepolia",s[s.OptimismSepolia=10005]="OptimismSepolia",s[s.PolygonAmoy=10007]="PolygonAmoy",s))(N||{}),pp={1:"Solana",2:"Ethereum",5:"Polygon",4:"BNB Chain",6:"Avalanche",8:"Algorand",23:"Arbitrum",24:"Optimism",30:"Base",10002:"Ethereum Sepolia",10003:"Arbitrum Sepolia",10004:"Base Sepolia",10005:"Optimism Sepolia",10007:"Polygon Amoy"},tp={4:["","https://bsc-testnet.public.blastapi.io","https://bsc-testnet.blockpi.network/v1/rpc/private","https://bsc-testnet-rpc.publicnode.com","https://api.zan.top/bsc-testnet","https://data-seed-prebsc-2-s1.bnbchain.org:8545","https://data-seed-prebsc-2-s2.bnbchain.org:8545","https://data-seed-prebsc-2-s3.bnbchain.org:8545","https://data-seed-prebsc-1-s1.bnbchain.org:8545","https://data-seed-prebsc-1-s2.bnbchain.org:8545","https://data-seed-prebsc-1-s3.bnbchain.org:8545","https://endpoints.omniatech.io/v1/bsc/testnet/public"],6:["","https://rpc.ankr.com/avalanche_fuji","https://rpc.ankr.com/avalanche_fuji-c","https://api.avax-test.network/ext/bc/C/rpc","https://ava-testnet.public.blastapi.io/ext/bc/C/rpc","https://endpoints.omniatech.io/v1/avax/fuji/public","https://avalanche-fuji.blockpi.network/v1/rpc/private","https://avalanche-fuji-c-chain-rpc.publicnode.com","https://avalanche-fuji.blockpi.network/v1/rpc/private"],10002:["https://ethereum-sepolia-rpc.publicnode.com","https://sepolia.gateway.tenderly.co","https://eth-sepolia.public.blastapi.io","https://ethereum-sepolia.blockpi.network/v1/rpc/private","https://sepolia.drpc.org","https://endpoints.omniatech.io/v1/eth/sepolia/public","https://1rpc.io/sepolia","https://gateway.tenderly.co/public/sepolia","https://sepolia.gateway.tenderly.co","https://api.zan.top/eth-sepolia","https://ethereum-sepolia.rpc.subquery.network/public"],10003:["","https://arbitrum-sepolia.blockpi.network/v1/rpc/private ","https://arbitrum-sepolia.gateway.tenderly.co","https://endpoints.omniatech.io/v1/arbitrum/sepolia/public","https://api.zan.top/arb-sepolia","https://sepolia-rollup.arbitrum.io/rpc"],10004:["","https://sepolia.base.org","https://base-sepolia-rpc.publicnode.com","https://base-sepolia.gateway.tenderly.co","https://base-sepolia.blockpi.network/v1/rpc/private","https://node.histori.xyz/base-sepolia/8ry9f6t9dct1se2hlagxnd9n2a"],10005:["","https://optimism-sepolia.blockpi.network/v1/rpc/private","https://sepolia.optimism.io","https://api.zan.top/opt-sepolia","https://optimism-sepolia.gateway.tenderly.co","https://optimism-sepolia.drpc.org","https://endpoints.omniatech.io/v1/op/sepolia/public"],10007:["https://rpc-amoy.polygon.technology","https://polygon-amoy-bor-rpc.publicnode.com","https://rpc.ankr.com/polygon_amoy","https://polygon-amoy.drpc.org","https://api.zan.top/polygon-amoy","https://polygon-amoy.gateway.tenderly.co"]},op={2:["","https://eth.llamarpc.com","https://ethereum.blockpi.network/v1/rpc/public","https://eth-mainnet.nodereal.io/v1/1659dfb40aa24bbb8153a677b98064d7","https://uk.rpc.blxrbdn.com","https://singapore.rpc.blxrbdn.com","https://virginia.rpc.blxrbdn.com","https://eth-mainnet.public.blastapi.io","https://api.securerpc.com/v1","https://mainnet.gateway.tenderly.co","https://eth-pokt.nodies.app","https://eth.blockrazor.xyz","https://eth.merkle.io","https://gateway.tenderly.co/public/mainnet","https://eth.rpc.blxrbdn.com"],4:["","https://bsc.blockrazor.xyz","https://bscrpc.com","https://bsc-mainnet.public.blastapi.io","https://binance.llamarpc.com","https://go.getblock.io/cc778cdbdf5c4b028ec9456e0e6c0cf3","https://bsc-pokt.nodies.app","https://56.rpc.thirdweb.com","https://bsc.blockpi.network/v1/rpc/private","https://bsc.rpc.blxrbdn.com","https://bsc-dataseed.bnbchain.org","https://endpoints.omniatech.io/v1/bsc/mainnet/public","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed2.defibit.io","https://bsc-dataseed2.ninicoin.io","https://0.48.club","https://bsc-dataseed3.defibit.io"],5:["","https://polygon.llamarpc.com","https://polygon-rpc.com","https://rpc-mainnet.matic.quiknode.pro","https://endpoints.omniatech.io/v1/matic/mainnet/public","https://polygon-pokt.nodies.app","https://polygon-bor-rpc.publicnode.com","https://polygon.rpc.subquery.network/public","https://polygon-bor-rpc.publicnode.com","https://polygon.blockpi.network/v1/rpc/private","https://polygon.api.onfinality.io/public","https://polygon.lava.build","https://api.zan.top/polygon-mainnet","https://polygon.meowrpc.com"],6:["","https://avalanche-c-chain-rpc.publicnode.com","https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc","https://endpoints.omniatech.io/v1/avax/mainnet/public","https://avalanche-c-chain-rpc.publicnode.com","https://avalanche.blockpi.network/v1/rpc/private","https://avalanche.public-rpc.com","https://avalanche.drpc.org","https://avax.meowrpc.com","https://endpoints.omniatech.io/v1/avax/mainnet/public","https://api.avax.network/ext/bc/C/rpc","https://1rpc.io/avax/c","https://avax-pokt.nodies.app/ext/bc/C/rpc","https://endpoints.omniatech.io/v1/avax/mainnet/public","https://api.zan.top/avax-mainnet/ext/bc/C/rpc"],23:["","https://arbitrum.llamarpc.com","https://arbitrum.rpc.subquery.network/public","https://endpoints.omniatech.io/v1/arbitrum/one/public","https://arbitrum.meowrpc.com","https://arbitrum.gateway.tenderly.co","https://arbitrum-one.public.blastapi.io","https://arb1.lava.build","https://arbitrum-one.publicnode.com","https://arbitrum.blockpi.network/v1/rpc/public","https://arb-pokt.nodies.app","https://api.zan.top/arb-one","https://arb1.arbitrum.io/rpc","https://arbitrum.drpc.org","https://1rpc.io/arb"],24:["","https://optimism.llamarpc.com","https://op-pokt.nodies.app","https://optimism-mainnet.public.blastapi.io","https://optimism.blockpi.network/v1/rpc/public","https://endpoints.omniatech.io/v1/op/mainnet/public","https://optimism-rpc.publicnode.com","https://optimism.drpc.org","https://1rpc.io/op","https://optimism.gateway.tenderly.co","https://optimism.lava.build","https://optimism.rpc.subquery.network/public","https://mainnet.optimism.io","https://optimism-rpc.publicnode.com","https://gateway.tenderly.co/public/optimism"],30:["","https://base.llamarpc.com","https://base-mainnet.public.blastapi.io","https://base-rpc.publicnode.com","https://base.blockpi.network/v1/rpc/public","https://base.drpc.org","https://mainnet.base.org","https://base.api.onfinality.io/public","https://base-pokt.nodies.app","https://1rpc.io/base","https://developer-access-mainnet.base.org","https://endpoints.omniatech.io/v1/base/mainnet/public","https://base.rpc.subquery.network/public","https://base.api.onfinality.io/public","https://base.meowrpc.com","https://base.gateway.tenderly.co"]};var R=(t=>(t[t.Off=0]="Off",t[t.Full=1]="Full",t[t.Partial=2]="Partial",t[t.Scheduled=3]="Scheduled",t))(R||{});var T=(p=>(p[p.SELF_TRADE=1]="SELF_TRADE",p[p.FULL_FILLED=2]="FULL_FILLED",p[p.FULL_CANCELLED=3]="FULL_CANCELLED",p[p.PARTIALLY_CANCELLED=4]="PARTIALLY_CANCELLED",p[p.CREATED=5]="CREATED",p))(T||{});var C=(l=>(l.USERS_READ="users.read",l.FOLLOWS_READ="follows.read",l.FOLLOWS_WRITE="follows.write",l.TWEET_READ="tweet.read",l.TWEET_WRITE="tweet.write",l.OFFLINE_ACCESS="offline.access",l.LIKE_READ="like.read",l.LIKE_WRITE="like.write",l))(C||{});var h=(i=>(i.MFT_AUDIO_LINK="mft.audioLink",i.MFT_TITLE="mft.title",i.MODE_PRE_SALE="mode.preSale",i.MAKER_FEE="makerFee",i.TAKER_FEE="takerFee",i.VIEW_BASE_COIN_ICON_LINK="view.baseCoinIconLink",i.VIEW_BASE_COIN_MARKET_LINK="view.baseCoinMarketLink",i.VIEW_PRICE_COIN_ICON_LINK="view.priceCoinIconLink",i.VIEW_PRICE_COIN_MARKET_LINK="view.priceCoinMarketLink",i))(h||{}),O=h;var a=(c=>(c[c.Buy=0]="Buy",c[c.Sell=1]="Sell",c))(a||{}),n=a;var I=(p=>(p[p.Open=1]="Open",p[p.Canceled=2]="Canceled",p[p.Matched=3]="Matched",p[p.SelfMatched=4]="SelfMatched",p[p.Expired=5]="Expired",p))(I||{}),D=I;var _=(t=>(t[t.Limit=0]="Limit",t[t.IOC=1]="IOC",t[t.POST=2]="POST",t[t.Market=3]="Market",t))(_||{}),d=_;var m=(c=>(c.User="User",c.Api="API",c))(m||{});var L=(t=>(t.COMPANY="COMPANY",t.TWITTER="TWITTER",t.DISCORD="DISCORD",t.TELEGRAM="TELEGRAM",t))(L||{}),x=(E=>(E[E.TWITTER_FOLLOW=1]="TWITTER_FOLLOW",E[E.TWITTER_REPLY=2]="TWITTER_REPLY",E[E.TWITTER_RETWEET=3]="TWITTER_RETWEET",E[E.TWITTER_LIKE=4]="TWITTER_LIKE",E[E.COMPANY_FIRST_LOGIN=5]="COMPANY_FIRST_LOGIN",E[E.COMPANY_CONFIRM_EMAIL=6]="COMPANY_CONFIRM_EMAIL",E[E.COMPANY_DEPOSIT=7]="COMPANY_DEPOSIT",E[E.COMPANY_TRADE=8]="COMPANY_TRADE",E[E.TELEGRAM_JOIN_GROUP=9]="TELEGRAM_JOIN_GROUP",E[E.DISCORD_JOIN_SERVER=10]="DISCORD_JOIN_SERVER",E[E.AFFILIATE_POINTS_REWARD=11]="AFFILIATE_POINTS_REWARD",E))(x||{}),Ip=[1,9,10,6,5];var v=(t=>(t.CREATED="created",t.STARTED="started",t.PAUSED="paused",t.CLOSED="closed",t))(v||{}),G=(c=>(c.Post="POST",c.Comment="COMMENT",c))(G||{});var g=(e=>(e.INSTRUCTIONS="INSTRUCTIONS",e.TEXT_STYLE="TEXT_STYLE",e.TEXT_TONE="TEXT_TONE",e.REACTION_TYPE="REACTION_TYPE",e.COMMENT_LENGTH="COMMENT_LENGTH",e.CONTEXT="CONTEXT",e))(g||{});var P=(e=>(e[e.FEE_TIER_1=1]="FEE_TIER_1",e[e.FEE_TIER_2=2]="FEE_TIER_2",e[e.FEE_TIER_3=3]="FEE_TIER_3",e[e.FEE_TIER_4=4]="FEE_TIER_4",e[e.FEE_TIER_5=5]="FEE_TIER_5",e[e.FEE_TIER_6=6]="FEE_TIER_6",e))(P||{}),F=(c=>(c[c.Approve=1]="Approve",c[c.Reject=0]="Reject",c))(F||{}),w=(p=>(p.INITIATED="INITIATED",p.CREATED="CREATED",p.PROCESSING="PROCESSING",p.APPROVED="APPROVED",p.REJECTED="REJECTED",p))(w||{});var U=(p=>(p.INVITED_ACCOUNTS_COUNT="invitedAccountsCount",p.CREATED_AT="createdAt",p.FEE_SHARE="feeShare",p.ADDRESS="address",p.REFERRAL_TRADING_VOLUME="referralTradingVolume",p))(U||{});var f=(e=>(e.ACTIVE="ACTIVE",e.FAILED="FAILED",e.STARTING="STARTING",e.DRAINING="DRAINING",e.TERMINATING="TERMINATING",e.TERMINATED="TERMINATED",e))(f||{}),k=(p=>(p.MATCHING_ENGINE="me",p.ORDER_SERVICE="ors",p.API="api",p.SOCKET_SERVICE="ws",p.TRANSACTION_SERVICE="tns",p))(k||{}),u=(p=>(p.ACTIVE="ACTIVE",p.FAILED="FAILED",p.UNASSIGNED="UNASSIGNED",p.ASSIGNED="ASSIGNED",p.STARTING="STARTING",p))(u||{});var S=(t=>(t.Pending="pending",t.Completed="completed",t.Failed="failed",t.Received="received",t))(S||{}),M=(o=>(o.Deposit="deposit",o.Withdraw="withdraw",o.Rebalance="rebalance",o))(M||{}),V=(o=>(o.PENDING="pending",o.COMPLETED="completed",o.FAILED="failed",o))(V||{}),W=(p=>(p.USER_TO_TMC="user_to_tmc",p.TMC_TO_USER="tmc_to_user",p.RELAYER_TO_TMC="relayer_to_tmc",p.RELAYER_TO_CODEX="relayer_to_codex",p.RELAYER_TO_CIRCLE="relayer_to_circle",p))(W||{});var B=(o=>(o.Unconfirmed="UNCONFIRMED",o.Confirmed="CONFIRMED",o.Rejected="REJECTED",o))(B||{}),H=(o=>(o.RESUBMITTED="RESUBMITTED",o.PROCESSED="PROCESSED",o.REMATCHED="REMATCHED",o))(H||{});var Y=(t=>(t[t.FIRST=1]="FIRST",t[t.SECOND=2]="SECOND",t[t.THIRD=3]="THIRD",t[t.FOURTH=4]="FOURTH",t))(Y||{}),y=(r=>(r.REBATE_TIER="rebateTier",r.CREATED_AT="createdAt",r.NAME="name",r.TAKER_FEE="takerFee",r.ENABLED="enabled",r.ADDRESS="address",r.CHAIN="chainId",r))(y||{});var K=(c=>(c.ASCENDING="ASC",c.DESCENDING="DESC",c))(K||{});var b=(t=>(t.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",t.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",t.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",t.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",t))(b||{}),A=(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))(A||{}),Dp={...b,...A},z=(o=>(o.CRITICAL="CRITICAL",o.IMPORTANT="IMPORTANT",o.INFO="INFO",o))(z||{}),J=(c=>(c.UNREAD="UNREAD",c.READ="READ",c))(J||{}),j=(o=>(o.PENDING="PENDING",o.PROCESSED="PROCESSED",o.FAILED="FAILED",o))(j||{});var X=(e=>(e.STRING="string",e.BOOLEAN="boolean",e.INT="int",e.FLOAT="float",e.SINGLE_CHOICE="single-choice",e.MULTI_CHOICE="multi-choice",e))(X||{});var q=(r=>(r.VERSION="version",r.LAST_ALGO_BLOCK="last_algo_block",r.PRICES_PROVIDER_API_KEY="prices_provider_api_key",r.DEFAULT_API_DOMAIN="default_api_domain",r.NONCE_ACCOUNTS_SOLANA="nonce_accounts_solana",r.ARCHIVE_DATA_BATCH_SIZE="archive_data_batch_size",r.ARCHIVE_TASK_LOCK="archive_task_lock",r))(q||{});var $=(o=>(o.SUCCESS="success",o.FAILED="failed",o.PENDING="pending",o))($||{});var Z=(o=>(o.SOLANA="SOLANA",o.ALGORAND="ALGORAND",o.EVM="EVM",o))(Z||{});var Q=(p=>(p.CONNECTED="CONNECTED",p.CONNECTING="CONNECTING",p.DISCONNECTED="DISCONNECTED",p.DISCONNECTING="DISCONNECTING",p.PENDING="PENDING",p))(Q||{});export{A as AccountNotificationEnum,x as ActionEnum,L as ActionSource,M as ActionTypeEnum,U as AffiliateSortByEnum,O as AvailablePairSettings,V as CCTPStatus,pp as ChainNames,N as Chains,Dp as CombinedNotificationEnum,f as ComponentStatusType,k as ComponentType,P as FeeTier,b as GlobalNotificationEnum,op as HTTPSRPC_MAINNET,tp as HTTPSRPC_TESTNET,w as KYCAuthenticationStatus,F as LastLookAction,R as MaintenanceMode,Y as MarketMakerRebateTier,y as MarketMakerSortByEnum,Ip as NON_REPEATABLE_ACTIONS,T as Notification,z as NotificationPriorityEnum,J as NotificationStatusEnum,S as OperationStatusEnum,n as OrderSide,D as OrderStatus,d as OrderType,u as PairComponentStatusType,g as PromptTypeEnum,Q as RabbitConnectionStatus,j as ScheduledNotificationStatusEnum,v as SeasonStatusEnum,X as SettingTypeColumn,K as SortDirectionEnum,q as StateType,B as TradeStatus,H as TradeSubStatus,m as TradingKeyType,W as TransactionType,G as TweetType,C as TwitterAccessScopeEnum,$ as UpgradeStatus,Z as WithdrawalWalletType};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import g,{decodeAddress as l,encodeAddress as b}from"algosdk";import{Buffer as u}from"buffer";import{encodeAddress as F,decodeAddress as S}from"algosdk";function f(e){return e.reduce((n,t)=>Uint8Array.from([...n,...t]))}function U(e,n){let t=[];for(let[r,s]of Object.entries(n)){let i=e[r];if(i===void 0)throw new Error(`Key ${r} missing from value`);switch(s.type){case"address":if(i instanceof Uint8Array&&i.length==32){t.push(i);break}else if(typeof i=="string")t.push(l(i).publicKey);else throw new Error(`${r}: Expected address, got ${i}`);break;case"bytes":if(i instanceof Uint8Array)if(i.length==s.size){t.push(i);break}else throw new Error(`${r}: Bytes length is wrong, expected ${s.size}, got ${i.length}`);else throw new Error(`${r}: Expected bytes[${s.size}], got ${i}`);case"double":if(typeof i=="number"){let o=new ArrayBuffer(8);u.from(o).writeDoubleLE(i,0),t.push(new Uint8Array(o));break}else throw new Error(`${r}: Expected double, got ${i}`);case"number":case"uint":if(typeof i=="bigint"||typeof i=="number"){t.push(d(i));break}else throw new Error(`${r}: Expected uint or number, got ${i}`);case"string":if(typeof i=="string"){let o=a(i);if(o.length==s.size){t.push(o);break}else throw new Error(`${r}: Expected string length ${s.size}, got string length ${o.length}`)}else throw new Error(`${r}: Expected string length ${s.size}, got ${i}`)}}return f(t)}function w(e,n){let t=new Map,r=0;for(let[s,i]of Object.entries(n)){if(r>=e.length)throw new Error("Array index out of bounds");let o;switch(i.type){case"address":o=b(e.slice(r,r+32)),r+=32;break;case"bytes":o=e.slice(r,r+i.size),r+=i.size;break;case"double":o=u.from(e.slice(r,r+8)).readDoubleLE(0),r+=8;break;case"number":o=Number(c(e.slice(r,r+8))),r+=8;break;case"uint":o=c(e.slice(r,r+8)),r+=8;break;case"string":o=p(e.slice(r,r+i.size)),r+=i.size;break}t.set(s,o)}return Object.fromEntries(t)}function m(e){return e.map(n=>n instanceof Uint8Array?new Uint8Array(n):typeof n=="string"?a(n):(typeof n=="boolean"&&(n=BigInt(n?1:0)),typeof n=="number"&&(n=BigInt(n)),d(n)))}function a(e){return new Uint8Array(u.from(e))}function p(e){return u.from(e).toString("utf-8")}function I(e){let n=g.encodeUint64(e);return f([new Uint8Array(32-n.length),n])}function d(e){let n=u.alloc(8);for(let t=0;t<8;t++)n[7-t]=Number(BigInt(e)>>BigInt(t*8)&BigInt(255));return new Uint8Array(n)}function c(e){let n=BigInt(0);for(let t=0;t<8&&e?.length;t++)n=n<<BigInt(8)|BigInt(e[t]);return n}function k(e){return u.from(e).toString("base64")}function x(e){return u.from(e,"base64")}function $(e,n){return e.length===n.length&&e.reduce((t,r,s)=>t&&r===n[s],!0)}function y(e,n){let t=e["global-state-delta"].find(r=>r.key===n);if(t!==void 0)return t.value}function B(e,n){let t=y(e,n);if(t!==void 0)return BigInt(t.uint)}function E(e,n){let t=y(e,n);if(t!==void 0)return x(t.bytes)}function z(e){return Math.floor(e.getTime()/1e3)}function D(e){return new Date(e*1e3)}export{$ as compareArrays,f as concatArrays,S as decodeAddress,x as decodeBase64,p as decodeString,c as decodeUint64,I as encode32Bytes,F as encodeAddress,m as encodeArgArray,k as encodeBase64,a as encodeString,d as encodeUint64,D as fromUnix,E as getDeltaBytes,B as getDeltaUint,U as packData,z as toUnix,w as unpackData};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import u from"algosdk";import _,{decodeAddress as y,encodeAddress as x}from"algosdk";import{Buffer as s}from"buffer";import{encodeAddress as l,decodeAddress as I}from"algosdk";function b(r){return r.reduce((e,t)=>Uint8Array.from([...e,...t]))}function c(r){return r.map(e=>e instanceof Uint8Array?new Uint8Array(e):typeof e=="string"?d(e):(typeof e=="boolean"&&(e=BigInt(e?1:0)),typeof e=="number"&&(e=BigInt(e)),p(e)))}function d(r){return new Uint8Array(s.from(r))}function p(r){let e=s.alloc(8);for(let t=0;t<8;t++)e[7-t]=Number(BigInt(r)>>BigInt(t*8)&BigInt(255));return new Uint8Array(e)}function i(r){return s.from(r,"base64")}import T from"bignumber.js";T.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var C=`{"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 m={V1_1:"v1_1",V2:"v2"},B={[m.V1_1]:{testnet:62368684,mainnet:552635992},[m.V2]:{testnet:148607e3,mainnet:1002541853}};function g(r){return Object.keys(r).sort().reduce((e,t)=>({...e,[t]:r[t]}),{})}var ie=(r,e)=>e.map(n=>({appIndex:r,name:b(c(["WLP_",n]))}));function f(r){let e={};return r.forEach(t=>{let n=i(t.key).toString(),o=t.value,a=o.type;a==2&&(o=o.uint),a==1&&(o=i(o.bytes)),n=="gov"?e.gov=l(o):e[n]=o}),g(e)}var se=r=>{let e={0:r.amount},t=r.assets;for(let n=0;n<t.length;n++){let o=t[n]["asset-id"],a=t[n].amount;e[o]=a}return console.log(`Account ${r.address} balances`,JSON.stringify(e)),e},ue=async(r,e)=>{let t=await r.getApplicationByID(e).do();return f(t.params["global-state"])},be=async(r,e)=>{let{boxes:t}=await r.getApplicationBoxes(e).do();console.log("boxes",e,t.map(n=>n.name).filter(n=>n.length===32).map(n=>Buffer.from(n).toString("base64")))},ce=async(r,e,t)=>{try{let{value:n}=await r.getApplicationBoxByName(e,t).do();return n}catch(n){if(n.message.includes("box not found"))return console.log(`Box not found '${Buffer.from(t).toString("hex")}'`),null;throw n}},le=async(r,e=1)=>{let t=await r.getTransactionParams().do();return e>1&&(t.fee=u.ALGORAND_MIN_TX_FEE*e,t.flatFee=!0),{...t}},me=(r,e)=>Object.keys(r).includes(e.toString()),ge=r=>u.decodeAddress(r.toUpperCase()).publicKey,de=(r,e,t,n)=>u.verifyBytes(new Uint8Array(Buffer.from(t,n)),i(r),e);export{ie as createBoxes,ge as decodeAndNormalizeAddress,f as decodeStateArray,se as getAccountAssetBalances,be as getAppBoxes,ue as getAppGlobalState,ce as getBoxByName,le as getTxnParams,me as isAssetOptedIn,de as verifySignature};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import l from"bignumber.js";l.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function b(e,r){return s(e,r,"*")}function E(e,r){return!!s(e,r,">=")}function n(e,r){return!!s(e,r,">")}function a(e,r){return!!s(e,r,"==")}function g(e,r){return s(e,r,"mod")}function i(e,r){return a(g(e,r),0)}function s(e,r,o){switch(e=new l(String(e)),r=new l(String(r)),o.toLowerCase()){case"-":return e.minus(r).toString();case"+":return e.plus(r).toString();case"*":case"x":return e.multipliedBy(r).toString();case"\xF7":case"/":return e.dividedBy(r).toString();case">=":return e.isGreaterThanOrEqualTo(r);case">":return e.isGreaterThan(r);case"<=":return e.isLessThanOrEqualTo(r);case"<":return e.isLessThan(r);case"==":return e.isEqualTo(r);case"mod":return e.modulo(r);default:break}}var m=(e,r)=>String(e).toLowerCase()===String(r).toLowerCase();var x={SMALLESTUNIT:process.env.SMALLEST_UNIT},S={SMALLEST_UNITS:process.env.SMALLEST_UNIT};var y=`{"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 k=["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 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||{}),_=(c=>(c.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",c.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",c.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",c))(_||{}),ce={...d,..._};var rr=(e,r)=>{T("base",{address:String(e.baseTokenAddress),chainId:e.baseTokenChainId},r.baseAsset),T("price",{address:String(e.priceTokenAddress),chainId:e.priceTokenChainId},r.priceAsset),A(e,r)},T=(e,r,o)=>{t(Number(r.chainId)===Number(o.chainId),`Invalid ${e}TokenChainId, must be ${o.chainId}`),t(o.chainId===1&&String(r.address)===String(o.address)||o.chainId===8&&Number(r.address)===Number(o.address)||m(r.address,o.address),`Invalid ${e}TokenAddress, must be ${o.address}`)},tr=e=>{t(e.expiredTime>=Math.floor(Date.now()/1e3)+3600,"Expiration time shorter than 1 hour")},A=(e,r)=>{if(t(a(1,e.version),`Invalid order message version. Current is ${1}`),t(a(e.decimalPrice,0)||a(b(e.decimalPrice,10**18),e.price),"Invalid price or decimalPrice"),t(!isNaN(e.random),"Invalid random, must be a number"),t(e.random>0,"Invalid random, must be greater than 0"),t(e.random<=Number.MAX_SAFE_INTEGER,"Invalid random, must no more than 2^53-1"),t(e.expiredTime>=Math.floor(Date.now()/1e3),"Invalid expiration time"),t(["B","S"].includes(e.orderSide),"Invalid order side"),t(["L","P","I","M"].includes(e.orderType),"Invalid order type"),e.orderType==="M"&&e.orderSide==="S")t(a(e.price,0)&&n(e.amount,0),"Invalid market order amount or price"),t(i(e.amount,r.min_size_increment)&&E(e.amount,r.min_order_size),"Invalid market order amount");else{if(e.orderType==="M"&&e.orderSide==="B"&&a(e.amount,0))throw new Error("Buy murket order by total is not implemented yet");e.orderType==="M"&&e.orderSide==="B"&&n(e.amount,0)?t(n(e.price,0)&&i(e.amount,r.min_size_increment)&&E(e.amount,r.min_order_size),"Invalid buy market order by amount"):(t(n(e.price,0)&&n(e.amount,0),"Invalid order amount or price is zero"),t(i(e.amount,r.min_size_increment)&&E(e.amount,r.min_order_size)&&i(e.price,r.min_price_increment),"Invalid order amount or price"))}},t=(e,r)=>{if(!e)throw new Error(r)};export{A as assertOrder,rr as assertOrderData,tr as assertOrderExpirationAtCreationMoment};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"bignumber.js";t.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function o(e,r){return i(e,r,"*")}function a(e,r){return i(e,r,"/")}function i(e,r,E){switch(e=new t(String(e)),r=new t(String(r)),E.toLowerCase()){case"-":return e.minus(r).toString();case"+":return e.plus(r).toString();case"*":case"x":return e.multipliedBy(r).toString();case"\xF7":case"/":return e.dividedBy(r).toString();case">=":return e.isGreaterThanOrEqualTo(r);case">":return e.isGreaterThan(r);case"<=":return e.isLessThanOrEqualTo(r);case"<":return e.isLessThan(r);case"==":return e.isEqualTo(r);case"mod":return e.modulo(r);default:break}}var _={SMALLESTUNIT:process.env.SMALLEST_UNIT},d={SMALLEST_UNITS:process.env.SMALLEST_UNIT};var m=`{"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 N=["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 M=e=>o(e,10**18),k=(e,r)=>a(e,10**(18-r)),b=(e,r)=>a(e,10**r),v=e=>b(e,18);export{k as defactorPrice,M as factorPrice,b as toDecimal,v as toDecimalPrice};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"bignumber.js";f.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function T(e,r){return N(e,r,"*")}function i(e,r){return N(e,r,"/")}function N(e,r,n){switch(e=new f(String(e)),r=new f(String(r)),n.toLowerCase()){case"-":return e.minus(r).toString();case"+":return e.plus(r).toString();case"*":case"x":return e.multipliedBy(r).toString();case"\xF7":case"/":return e.dividedBy(r).toString();case">=":return e.isGreaterThanOrEqualTo(r);case">":return e.isGreaterThan(r);case"<=":return e.isLessThanOrEqualTo(r);case"<":return e.isLessThan(r);case"==":return e.isEqualTo(r);case"mod":return e.modulo(r);default:break}}var S=(n=>(n[n.Buy=0]="Buy",n[n.Sell=1]="Sell",n))(S||{}),c=S;var O=(t=>(t[t.Limit=0]="Limit",t[t.IOC=1]="IOC",t[t.POST=2]="POST",t[t.Market=3]="Market",t))(O||{}),u=O;var B=(t=>(t.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",t.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",t.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",t.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",t))(B||{}),C=(s=>(s.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",s.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",s.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",s))(C||{}),De={...B,...C};var A={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var fr={SMALLESTUNIT:process.env.SMALLEST_UNIT},Tr={SMALLEST_UNITS:process.env.SMALLEST_UNIT};var Er=`{"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 _r=["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 E=(e,r)=>i(e,10**(18-r)),D=(e,r)=>i(e,10**r);import K from"algosdk";import*as ae from"bs58";import Ot from"algosdk";import*as M from"bs58";import X from"algosdk";import vr,{decodeAddress as Fr,encodeAddress as Gr}from"algosdk";import{Buffer as Yr}from"buffer";import{encodeAddress as z,decodeAddress as Vr}from"algosdk";function a(e){return e.reduce((r,n)=>Uint8Array.from([...r,...n]))}var R={V1_1:"v1_1",V2:"v2"},Qr={[R.V1_1]:{testnet:62368684,mainnet:552635992},[R.V2]:{testnet:148607e3,mainnet:1002541853}};var k=e=>X.decodeAddress(e.toUpperCase()).publicKey;import*as o from"ethereumjs-util";function J(e){return o.toUnsigned(new o.BN(String(e)))}function P(e){let r=J(e);if(r.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(o.setLengthLeft(r,32))}var L=e=>new Uint8Array(o.setLengthLeft(m(e),32)),m=e=>Buffer.from(Q(e),"hex"),Q=e=>e.startsWith("0x")?e.slice(2):e;var y=e=>new Uint8Array(o.keccak256(Buffer.from(e)));var h=(e,r)=>r===8?k(e):r===1?M.decode(e):L(e);import Ut from"algosdk";import Yt from"algosdk";import jt from"algosdk";import tn from"algosdk";import fn from"algosdk";var ie=(e,r)=>r===8?P(+e):A[e]?new Uint8Array(m(String(e))):h(String(e),r);var Y=(e,r)=>{let n=G(e.address,e.chainId,r.address,r.chainId);return Buffer.from(y(n)).toString("hex")},G=(e,r,n,s)=>{let t=h(e,r),g=K.encodeUint64(r),d=K.encodeUint64(s),b=ie(n,s);return a([t,g,b,d])};var uo=(e,{userId:r,chainId:n,price:s,side:t,type:g,amount:d,total:b,id:_})=>{let{baseAsset:I,priceAsset:x}=e,W={address:r,chainId:n},H=t===c.Buy?x:I;return{action:"order",actionId:_,account:W,token:H,amount:t===c.Buy?g===u.Market?E(b,x.decimal):T(D(d,I.decimal),E(s,x.decimal)):d,ts:Date.now()}},mo=(e,r,n,s="0")=>({hash:Y(e,r),loginAddress:e.address,loginChainId:e.chainId,tokenId:r.address,tokenChainId:r.chainId,amount:n,lockedAmount:s});export{uo as mapToBalanceInfo,mo as mapToCodexBalance};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import Z from"algosdk";import*as E from"bs58";import Y from"algosdk";import ie,{decodeAddress as ce,encodeAddress as pe}from"algosdk";import{Buffer as I}from"buffer";import{encodeAddress as v,decodeAddress as le}from"algosdk";function a(e){return e.reduce((r,n)=>Uint8Array.from([...r,...n]))}function d(e){return new Uint8Array(I.from(e))}function m(e){return I.from(e,"base64")}import F from"bignumber.js";F.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var he=`{"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 N={V1_1:"v1_1",V2:"v2"},Ie={[N.V1_1]:{testnet:62368684,mainnet:552635992},[N.V2]:{testnet:148607e3,mainnet:1002541853}};var S=e=>Y.decodeAddress(e.toUpperCase()).publicKey;import*as o from"ethereumjs-util";function H(e){return o.toUnsigned(new o.BN(String(e)))}function x(e){let r=H(e);if(r.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(o.setLengthLeft(r,32))}var O=e=>new Uint8Array(o.setLengthLeft(u(e),32)),u=e=>Buffer.from(V(e),"hex"),V=e=>e.startsWith("0x")?e.slice(2):e;var B=(e,r)=>{let n=o.keccak256(e),{r:t,s,v:c}=o.fromRpcSig(r);return o.ecrecover(n,c,t,s)};var l=e=>new Uint8Array(o.keccak256(Buffer.from(e)));import g from"algosdk";import*as J from"bs58";import Qe from"algosdk";import sr from"algosdk";import Br from"algosdk";var T={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var lr={SMALLESTUNIT:process.env.SMALLEST_UNIT},gr={SMALLEST_UNITS:process.env.SMALLEST_UNIT};var fr=["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"];import Ft from"algosdk";var L=(s=>(s.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",s.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",s.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",s.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",s))(L||{}),U=(t=>(t.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",t.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",t.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",t))(U||{}),Zr={...L,...U};import en from"algosdk";var i=(e,r,n)=>{switch(r){case"8B":return g.encodeUint64(Number(e));case"32B":return x(e);case"str":return d(String(e));case"address":return b(String(e),n);case"token":return Q(String(e),n);case"float":{var t=Buffer.alloc(8);return t.writeDoubleBE(Number(e),0),new Uint8Array(t)}case"bool":return new Uint8Array(Buffer.from(g.encodeUint64(Number(e))).subarray(-1));case"2B":return new Uint8Array(Buffer.from(g.encodeUint64(Number(e))).subarray(-2));case"4B":return new Uint8Array(Buffer.from(g.encodeUint64(Number(e))).subarray(-4));default:return Buffer.from(e.toString())}};var Q=(e,r)=>r===8?x(+e):T[e]?new Uint8Array(u(String(e))):b(String(e),r);var D=e=>Buffer.from(l(e)).toString("hex"),k=(e,r)=>a([i(r,"str"),l(e)]),P=(e,r)=>a([i(r,"str"),Buffer.from(e,"hex")]),p=(e,r)=>{let n=Z.ABIMethod.fromSignature(e),t=n.getSelector(),s={},c=r.map((y,h)=>{let _=n.args[h].type.encode(y);return s[`txnArgs${h}`]=Array.apply([],Array.from(_)).join(", "),_});return[t,...c]},A=(e,r,n)=>{let t=Buffer.from(e,r),s=t.subarray(t.length-n),c=Buffer.from(s).toString();return m(c)},M=(e,r,n,t,s="hex")=>[f(e,s,t),ee(r,t),re(n,t,e,r,s)],ee=(e,r)=>r===8?m(e):r===1?E.decode(e):u(e),re=(e,r,n,t,s)=>r===8||r===1?b(e,r):B(f(n,s,r),t),te=(e,r)=>r===8?"MX":r===1?"":`Ethereum Signed Message:
|
|
2
|
+
${e.length}`,f=(e,r,n)=>{let t=Buffer.from(e,r);return Buffer.concat([d(te(t,n)),t])},$=e=>{switch(e){case"ALGORAND":return 8;case"SOLANA":return 1;case"EVM":return 5;default:return 5}},b=(e,r)=>r===8?S(e):r===1?E.decode(e):O(e),ne="CCTPUSDC",oe=65537;function se(){let e=Buffer.alloc(32,0);return Buffer.from(ne,"utf-8").copy(e),e}function Xn(){return{address:"0x"+se().toString("hex"),chainId:oe}}export{ee as decodeSignature,b as encodeAddress,D as generateHash,p as getAppArgs,k as getBoxKey,P as getBoxKeyFromHash,A as getDataBytesFromMsg,M as getMsgArgs,f as getPrefixedMessage,$ as getProviderChainId,re as getPublicKey,se as getUnifiedUSDC,Xn as getUnifiedUSDCToken,oe as unified_CCTP_ChainID,ne as unified_CCTP_token};
|