@dhedge/trading-widget 2.0.2 → 2.0.4
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/README.md +79 -78
- package/core-kit/abi/index.d.ts +1 -1
- package/core-kit/abi/synthetix-v3/ierc-7412.d.ts +12 -0
- package/core-kit/abi/synthetix-v3/index.d.ts +0 -1
- package/core-kit/const/default-data.d.ts +1 -1
- package/core-kit/const/tokens/arbitrum.d.ts +2 -0
- package/core-kit/const/tokens/base.d.ts +2 -0
- package/core-kit/const/tokens/optimism.d.ts +2 -0
- package/core-kit/const/tokens/polygon.d.ts +1 -0
- package/core-kit/hooks/trading/index.d.ts +1 -0
- package/core-kit/hooks/trading/synthetix-v3/use-available-withdraw-liquidity.d.ts +47 -0
- package/core-kit/hooks/trading/synthetix-v3/use-oracles-update-transaction-data.d.ts +10 -2
- package/core-kit/hooks/trading/synthetix-v3/use-withdraw-liquidity.d.ts +5 -0
- package/core-kit/types/pool.types.d.ts +1 -0
- package/core-kit/types/synthetix-v3.types.d.ts +8 -2
- package/core-kit/types/web3.types.d.ts +1 -1
- package/core-kit/utils/formatter.d.ts +1 -1
- package/core-kit/utils/synthetix-v3/eip-7412.d.ts +21 -10
- package/core-kit/utils/synthetix-v3/parse-error.d.ts +1 -1
- package/core-kit/utils/synthetix-v3/pyth-adapter.d.ts +10 -9
- package/{index-12329f48.js → index-6f9f1263.js} +9580 -9406
- package/index-fcb38d25.cjs +207 -0
- package/index.cjs +1 -1
- package/index.d.ts +3 -3
- package/index.js +206 -199
- package/package.json +1 -1
- package/{pyth-adapter-6c8739a2.cjs → pyth-adapter-919fe86e.cjs} +6 -6
- package/{pyth-adapter-f139cf42.js → pyth-adapter-9c02b4f7.js} +53 -40
- package/trading-widget/components/withdraw/button/valid-withdraw-button/valid-withdraw-button.hooks.d.ts +3 -0
- package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +1 -0
- package/core-kit/abi/synthetix-v3/ierc-2771-context.d.ts +0 -15
- package/core-kit/utils/synthetix-v3/multicall-forwarder-batcher.d.ts +0 -8
- package/index-e8439723.cjs +0 -207
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var nn=Object.defineProperty;var on=(e,t,i)=>t in e?nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var I=(e,t,i)=>(on(e,typeof t!="symbol"?t+"":t,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fe=require("./index-
|
|
1
|
+
"use strict";var nn=Object.defineProperty;var on=(e,t,i)=>t in e?nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var I=(e,t,i)=>(on(e,typeof t!="symbol"?t+"":t,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fe=require("./index-fcb38d25.cjs"),Pe=require("viem");require("react");require("wagmi");require("@tanstack/react-query");var br={},ze={};ze.byteLength=cn;ze.toByteArray=fn;ze.fromByteArray=hn;var ee=[],K=[],sn=typeof Uint8Array<"u"?Uint8Array:Array,ct="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var be=0,an=ct.length;be<an;++be)ee[be]=ct[be],K[ct.charCodeAt(be)]=be;K["-".charCodeAt(0)]=62;K["_".charCodeAt(0)]=63;function wr(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");i===-1&&(i=t);var o=i===t?0:4-i%4;return[i,o]}function cn(e){var t=wr(e),i=t[0],o=t[1];return(i+o)*3/4-o}function un(e,t,i){return(t+i)*3/4-i}function fn(e){var t,i=wr(e),o=i[0],c=i[1],l=new sn(un(e,o,c)),f=0,u=c>0?o-4:o,E;for(E=0;E<u;E+=4)t=K[e.charCodeAt(E)]<<18|K[e.charCodeAt(E+1)]<<12|K[e.charCodeAt(E+2)]<<6|K[e.charCodeAt(E+3)],l[f++]=t>>16&255,l[f++]=t>>8&255,l[f++]=t&255;return c===2&&(t=K[e.charCodeAt(E)]<<2|K[e.charCodeAt(E+1)]>>4,l[f++]=t&255),c===1&&(t=K[e.charCodeAt(E)]<<10|K[e.charCodeAt(E+1)]<<4|K[e.charCodeAt(E+2)]>>2,l[f++]=t>>8&255,l[f++]=t&255),l}function ln(e){return ee[e>>18&63]+ee[e>>12&63]+ee[e>>6&63]+ee[e&63]}function pn(e,t,i){for(var o,c=[],l=t;l<i;l+=3)o=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),c.push(ln(o));return c.join("")}function hn(e){for(var t,i=e.length,o=i%3,c=[],l=16383,f=0,u=i-o;f<u;f+=l)c.push(pn(e,f,f+l>u?u:f+l));return o===1?(t=e[i-1],c.push(ee[t>>2]+ee[t<<4&63]+"==")):o===2&&(t=(e[i-2]<<8)+e[i-1],c.push(ee[t>>10]+ee[t>>4&63]+ee[t<<2&63]+"=")),c.join("")}var It={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */It.read=function(e,t,i,o,c){var l,f,u=c*8-o-1,E=(1<<u)-1,g=E>>1,b=-7,d=i?c-1:0,B=i?-1:1,S=e[t+d];for(d+=B,l=S&(1<<-b)-1,S>>=-b,b+=u;b>0;l=l*256+e[t+d],d+=B,b-=8);for(f=l&(1<<-b)-1,l>>=-b,b+=o;b>0;f=f*256+e[t+d],d+=B,b-=8);if(l===0)l=1-g;else{if(l===E)return f?NaN:(S?-1:1)*(1/0);f=f+Math.pow(2,o),l=l-g}return(S?-1:1)*f*Math.pow(2,l-o)};It.write=function(e,t,i,o,c,l){var f,u,E,g=l*8-c-1,b=(1<<g)-1,d=b>>1,B=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=o?0:l-1,C=o?1:-1,F=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,f=b):(f=Math.floor(Math.log(t)/Math.LN2),t*(E=Math.pow(2,-f))<1&&(f--,E*=2),f+d>=1?t+=B/E:t+=B*Math.pow(2,1-d),t*E>=2&&(f++,E/=2),f+d>=b?(u=0,f=b):f+d>=1?(u=(t*E-1)*Math.pow(2,c),f=f+d):(u=t*Math.pow(2,d-1)*Math.pow(2,c),f=0));c>=8;e[i+S]=u&255,S+=C,u/=256,c-=8);for(f=f<<c|u,g+=c;g>0;e[i+S]=f&255,S+=C,f/=256,g-=8);e[i+S-C]|=F*128};/*!
|
|
2
2
|
* The buffer module from node.js, for the browser.
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
5
|
* @license MIT
|
|
6
|
-
*/(function(e){const t=ze,i=It,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=J,e.INSPECT_MAX_BYTES=50;const c=2147483647;e.kMaxLength=c,u.TYPED_ARRAY_SUPPORT=l(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const s=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(s,r),s.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function f(s){if(s>c)throw new RangeError('The value "'+s+'" is invalid for option "size"');const r=new Uint8Array(s);return Object.setPrototypeOf(r,u.prototype),r}function u(s,r,n){if(typeof s=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(s)}return E(s,r,n)}u.poolSize=8192;function E(s,r,n){if(typeof s=="string")return B(s,r);if(ArrayBuffer.isView(s))return C(s);if(s==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s);if(Q(s,ArrayBuffer)||s&&Q(s.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Q(s,SharedArrayBuffer)||s&&Q(s.buffer,SharedArrayBuffer)))return F(s,r,n);if(typeof s=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const a=s.valueOf&&s.valueOf();if(a!=null&&a!==s)return u.from(a,r,n);const p=D(s);if(p)return p;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof s[Symbol.toPrimitive]=="function")return u.from(s[Symbol.toPrimitive]("string"),r,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s)}u.from=function(s,r,n){return E(s,r,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function g(s){if(typeof s!="number")throw new TypeError('"size" argument must be of type number');if(s<0)throw new RangeError('The value "'+s+'" is invalid for option "size"')}function b(s,r,n){return g(s),s<=0?f(s):r!==void 0?typeof n=="string"?f(s).fill(r,n):f(s).fill(r):f(s)}u.alloc=function(s,r,n){return b(s,r,n)};function d(s){return g(s),f(s<0?0:N(s)|0)}u.allocUnsafe=function(s){return d(s)},u.allocUnsafeSlow=function(s){return d(s)};function B(s,r){if((typeof r!="string"||r==="")&&(r="utf8"),!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);const n=L(s,r)|0;let a=f(n);const p=a.write(s,r);return p!==n&&(a=a.slice(0,p)),a}function S(s){const r=s.length<0?0:N(s.length)|0,n=f(r);for(let a=0;a<r;a+=1)n[a]=s[a]&255;return n}function C(s){if(Q(s,Uint8Array)){const r=new Uint8Array(s);return F(r.buffer,r.byteOffset,r.byteLength)}return S(s)}function F(s,r,n){if(r<0||s.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<r+(n||0))throw new RangeError('"length" is outside of buffer bounds');let a;return r===void 0&&n===void 0?a=new Uint8Array(s):n===void 0?a=new Uint8Array(s,r):a=new Uint8Array(s,r,n),Object.setPrototypeOf(a,u.prototype),a}function D(s){if(u.isBuffer(s)){const r=N(s.length)|0,n=f(r);return n.length===0||s.copy(n,0,0,r),n}if(s.length!==void 0)return typeof s.length!="number"||at(s.length)?f(0):S(s);if(s.type==="Buffer"&&Array.isArray(s.data))return S(s.data)}function N(s){if(s>=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return s|0}function J(s){return+s!=s&&(s=0),u.alloc(+s)}u.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==u.prototype},u.compare=function(r,n){if(Q(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),Q(n,Uint8Array)&&(n=u.from(n,n.offset,n.byteLength)),!u.isBuffer(r)||!u.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===n)return 0;let a=r.length,p=n.length;for(let h=0,m=Math.min(a,p);h<m;++h)if(r[h]!==n[h]){a=r[h],p=n[h];break}return a<p?-1:p<a?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,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);let a;if(n===void 0)for(n=0,a=0;a<r.length;++a)n+=r[a].length;const p=u.allocUnsafe(n);let h=0;for(a=0;a<r.length;++a){let m=r[a];if(Q(m,Uint8Array))h+m.length>p.length?(u.isBuffer(m)||(m=u.from(m)),m.copy(p,h)):Uint8Array.prototype.set.call(p,m,h);else if(u.isBuffer(m))m.copy(p,h);else throw new TypeError('"list" argument must be an Array of Buffers');h+=m.length}return p};function L(s,r){if(u.isBuffer(s))return s.length;if(ArrayBuffer.isView(s)||Q(s,ArrayBuffer))return s.byteLength;if(typeof s!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof s);const n=s.length,a=arguments.length>2&&arguments[2]===!0;if(!a&&n===0)return 0;let p=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return st(s).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Vt(s).length;default:if(p)return a?-1:st(s).length;r=(""+r).toLowerCase(),p=!0}}u.byteLength=L;function le(s,r,n){let a=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(s||(s="utf8");;)switch(s){case"hex":return _(this,r,n);case"utf8":case"utf-8":return Be(this,r,n);case"ascii":return Te(this,r,n);case"latin1":case"binary":return Se(this,r,n);case"base64":return ot(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,r,n);default:if(a)throw new TypeError("Unknown encoding: "+s);s=(s+"").toLowerCase(),a=!0}}u.prototype._isBuffer=!0;function G(s,r,n){const a=s[r];s[r]=s[n],s[n]=a}u.prototype.swap16=function(){const r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let n=0;n<r;n+=2)G(this,n,n+1);return this},u.prototype.swap32=function(){const r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let n=0;n<r;n+=4)G(this,n,n+3),G(this,n+1,n+2);return this},u.prototype.swap64=function(){const r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let n=0;n<r;n+=8)G(this,n,n+7),G(this,n+1,n+6),G(this,n+2,n+5),G(this,n+3,n+4);return this},u.prototype.toString=function(){const r=this.length;return r===0?"":arguments.length===0?Be(this,0,r):le.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(r){if(!u.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0},u.prototype.inspect=function(){let r="";const n=e.INSPECT_MAX_BYTES;return r=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(r+=" ... "),"<Buffer "+r+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(r,n,a,p,h){if(Q(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(n===void 0&&(n=0),a===void 0&&(a=r?r.length:0),p===void 0&&(p=0),h===void 0&&(h=this.length),n<0||a>r.length||p<0||h>this.length)throw new RangeError("out of range index");if(p>=h&&n>=a)return 0;if(p>=h)return-1;if(n>=a)return 1;if(n>>>=0,a>>>=0,p>>>=0,h>>>=0,this===r)return 0;let m=h-p,O=a-n;const j=Math.min(m,O),k=this.slice(p,h),M=r.slice(n,a);for(let v=0;v<j;++v)if(k[v]!==M[v]){m=k[v],O=M[v];break}return m<O?-1:O<m?1:0};function X(s,r,n,a,p){if(s.length===0)return-1;if(typeof n=="string"?(a=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,at(n)&&(n=p?0:s.length-1),n<0&&(n=s.length+n),n>=s.length){if(p)return-1;n=s.length-1}else if(n<0)if(p)n=0;else return-1;if(typeof r=="string"&&(r=u.from(r,a)),u.isBuffer(r))return r.length===0?-1:de(s,r,n,a,p);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?p?Uint8Array.prototype.indexOf.call(s,r,n):Uint8Array.prototype.lastIndexOf.call(s,r,n):de(s,[r],n,a,p);throw new TypeError("val must be string, number or Buffer")}function de(s,r,n,a,p){let h=1,m=s.length,O=r.length;if(a!==void 0&&(a=String(a).toLowerCase(),a==="ucs2"||a==="ucs-2"||a==="utf16le"||a==="utf-16le")){if(s.length<2||r.length<2)return-1;h=2,m/=2,O/=2,n/=2}function j(M,v){return h===1?M[v]:M.readUInt16BE(v*h)}let k;if(p){let M=-1;for(k=n;k<m;k++)if(j(s,k)===j(r,M===-1?0:k-M)){if(M===-1&&(M=k),k-M+1===O)return M*h}else M!==-1&&(k-=k-M),M=-1}else for(n+O>m&&(n=m-O),k=n;k>=0;k--){let M=!0;for(let v=0;v<O;v++)if(j(s,k+v)!==j(r,v)){M=!1;break}if(M)return k}return-1}u.prototype.includes=function(r,n,a){return this.indexOf(r,n,a)!==-1},u.prototype.indexOf=function(r,n,a){return X(this,r,n,a,!0)},u.prototype.lastIndexOf=function(r,n,a){return X(this,r,n,a,!1)};function Fe(s,r,n,a){n=Number(n)||0;const p=s.length-n;a?(a=Number(a),a>p&&(a=p)):a=p;const h=r.length;a>h/2&&(a=h/2);let m;for(m=0;m<a;++m){const O=parseInt(r.substr(m*2,2),16);if(at(O))return m;s[n+m]=O}return m}function me(s,r,n,a){return Me(st(r,s.length-n),s,n,a)}function ae(s,r,n,a){return Me(Qr(r),s,n,a)}function Le(s,r,n,a){return Me(Vt(r),s,n,a)}function ye(s,r,n,a){return Me(en(r,s.length-n),s,n,a)}u.prototype.write=function(r,n,a,p){if(n===void 0)p="utf8",a=this.length,n=0;else if(a===void 0&&typeof n=="string")p=n,a=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(a)?(a=a>>>0,p===void 0&&(p="utf8")):(p=a,a=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const h=this.length-n;if((a===void 0||a>h)&&(a=h),r.length>0&&(a<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");p||(p="utf8");let m=!1;for(;;)switch(p){case"hex":return Fe(this,r,n,a);case"utf8":case"utf-8":return me(this,r,n,a);case"ascii":case"latin1":case"binary":return ae(this,r,n,a);case"base64":return Le(this,r,n,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,r,n,a);default:if(m)throw new TypeError("Unknown encoding: "+p);p=(""+p).toLowerCase(),m=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ot(s,r,n){return r===0&&n===s.length?t.fromByteArray(s):t.fromByteArray(s.slice(r,n))}function Be(s,r,n){n=Math.min(s.length,n);const a=[];let p=r;for(;p<n;){const h=s[p];let m=null,O=h>239?4:h>223?3:h>191?2:1;if(p+O<=n){let j,k,M,v;switch(O){case 1:h<128&&(m=h);break;case 2:j=s[p+1],(j&192)===128&&(v=(h&31)<<6|j&63,v>127&&(m=v));break;case 3:j=s[p+1],k=s[p+2],(j&192)===128&&(k&192)===128&&(v=(h&15)<<12|(j&63)<<6|k&63,v>2047&&(v<55296||v>57343)&&(m=v));break;case 4:j=s[p+1],k=s[p+2],M=s[p+3],(j&192)===128&&(k&192)===128&&(M&192)===128&&(v=(h&15)<<18|(j&63)<<12|(k&63)<<6|M&63,v>65535&&v<1114112&&(m=v))}}m===null?(m=65533,O=1):m>65535&&(m-=65536,a.push(m>>>10&1023|55296),m=56320|m&1023),a.push(m),p+=O}return Re(a)}const je=4096;function Re(s){const r=s.length;if(r<=je)return String.fromCharCode.apply(String,s);let n="",a=0;for(;a<r;)n+=String.fromCharCode.apply(String,s.slice(a,a+=je));return n}function Te(s,r,n){let a="";n=Math.min(s.length,n);for(let p=r;p<n;++p)a+=String.fromCharCode(s[p]&127);return a}function Se(s,r,n){let a="";n=Math.min(s.length,n);for(let p=r;p<n;++p)a+=String.fromCharCode(s[p]);return a}function _(s,r,n){const a=s.length;(!r||r<0)&&(r=0),(!n||n<0||n>a)&&(n=a);let p="";for(let h=r;h<n;++h)p+=tn[s[h]];return p}function x(s,r,n){const a=s.slice(r,n);let p="";for(let h=0;h<a.length-1;h+=2)p+=String.fromCharCode(a[h]+a[h+1]*256);return p}u.prototype.slice=function(r,n){const a=this.length;r=~~r,n=n===void 0?a:~~n,r<0?(r+=a,r<0&&(r=0)):r>a&&(r=a),n<0?(n+=a,n<0&&(n=0)):n>a&&(n=a),n<r&&(n=r);const p=this.subarray(r,n);return Object.setPrototypeOf(p,u.prototype),p};function w(s,r,n){if(s%1!==0||s<0)throw new RangeError("offset is not uint");if(s+r>n)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(r,n,a){r=r>>>0,n=n>>>0,a||w(r,n,this.length);let p=this[r],h=1,m=0;for(;++m<n&&(h*=256);)p+=this[r+m]*h;return p},u.prototype.readUintBE=u.prototype.readUIntBE=function(r,n,a){r=r>>>0,n=n>>>0,a||w(r,n,this.length);let p=this[r+--n],h=1;for(;n>0&&(h*=256);)p+=this[r+--n]*h;return p},u.prototype.readUint8=u.prototype.readUInt8=function(r,n){return r=r>>>0,n||w(r,1,this.length),this[r]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(r,n){return r=r>>>0,n||w(r,2,this.length),this[r]|this[r+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(r,n){return r=r>>>0,n||w(r,2,this.length),this[r]<<8|this[r+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(r,n){return r=r>>>0,n||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(r,n){return r=r>>>0,n||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},u.prototype.readBigUInt64LE=ce(function(r){r=r>>>0,Ee(r,"offset");const n=this[r],a=this[r+7];(n===void 0||a===void 0)&&De(r,this.length-8);const p=n+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,h=this[++r]+this[++r]*2**8+this[++r]*2**16+a*2**24;return BigInt(p)+(BigInt(h)<<BigInt(32))}),u.prototype.readBigUInt64BE=ce(function(r){r=r>>>0,Ee(r,"offset");const n=this[r],a=this[r+7];(n===void 0||a===void 0)&&De(r,this.length-8);const p=n*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],h=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+a;return(BigInt(p)<<BigInt(32))+BigInt(h)}),u.prototype.readIntLE=function(r,n,a){r=r>>>0,n=n>>>0,a||w(r,n,this.length);let p=this[r],h=1,m=0;for(;++m<n&&(h*=256);)p+=this[r+m]*h;return h*=128,p>=h&&(p-=Math.pow(2,8*n)),p},u.prototype.readIntBE=function(r,n,a){r=r>>>0,n=n>>>0,a||w(r,n,this.length);let p=n,h=1,m=this[r+--p];for(;p>0&&(h*=256);)m+=this[r+--p]*h;return h*=128,m>=h&&(m-=Math.pow(2,8*n)),m},u.prototype.readInt8=function(r,n){return r=r>>>0,n||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},u.prototype.readInt16LE=function(r,n){r=r>>>0,n||w(r,2,this.length);const a=this[r]|this[r+1]<<8;return a&32768?a|4294901760:a},u.prototype.readInt16BE=function(r,n){r=r>>>0,n||w(r,2,this.length);const a=this[r+1]|this[r]<<8;return a&32768?a|4294901760:a},u.prototype.readInt32LE=function(r,n){return r=r>>>0,n||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},u.prototype.readInt32BE=function(r,n){return r=r>>>0,n||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},u.prototype.readBigInt64LE=ce(function(r){r=r>>>0,Ee(r,"offset");const n=this[r],a=this[r+7];(n===void 0||a===void 0)&&De(r,this.length-8);const p=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(a<<24);return(BigInt(p)<<BigInt(32))+BigInt(n+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24)}),u.prototype.readBigInt64BE=ce(function(r){r=r>>>0,Ee(r,"offset");const n=this[r],a=this[r+7];(n===void 0||a===void 0)&&De(r,this.length-8);const p=(n<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(p)<<BigInt(32))+BigInt(this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+a)}),u.prototype.readFloatLE=function(r,n){return r=r>>>0,n||w(r,4,this.length),i.read(this,r,!0,23,4)},u.prototype.readFloatBE=function(r,n){return r=r>>>0,n||w(r,4,this.length),i.read(this,r,!1,23,4)},u.prototype.readDoubleLE=function(r,n){return r=r>>>0,n||w(r,8,this.length),i.read(this,r,!0,52,8)},u.prototype.readDoubleBE=function(r,n){return r=r>>>0,n||w(r,8,this.length),i.read(this,r,!1,52,8)};function A(s,r,n,a,p,h){if(!u.isBuffer(s))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>p||r<h)throw new RangeError('"value" argument is out of bounds');if(n+a>s.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(r,n,a,p){if(r=+r,n=n>>>0,a=a>>>0,!p){const O=Math.pow(2,8*a)-1;A(this,r,n,a,O,0)}let h=1,m=0;for(this[n]=r&255;++m<a&&(h*=256);)this[n+m]=r/h&255;return n+a},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(r,n,a,p){if(r=+r,n=n>>>0,a=a>>>0,!p){const O=Math.pow(2,8*a)-1;A(this,r,n,a,O,0)}let h=a-1,m=1;for(this[n+h]=r&255;--h>=0&&(m*=256);)this[n+h]=r/m&255;return n+a},u.prototype.writeUint8=u.prototype.writeUInt8=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,1,255,0),this[n]=r&255,n+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,2,65535,0),this[n]=r&255,this[n+1]=r>>>8,n+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,2,65535,0),this[n]=r>>>8,this[n+1]=r&255,n+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,4,4294967295,0),this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255,n+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,4,4294967295,0),this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255,n+4};function T(s,r,n,a,p){Gt(r,a,p,s,n,7);let h=Number(r&BigInt(4294967295));s[n++]=h,h=h>>8,s[n++]=h,h=h>>8,s[n++]=h,h=h>>8,s[n++]=h;let m=Number(r>>BigInt(32)&BigInt(4294967295));return s[n++]=m,m=m>>8,s[n++]=m,m=m>>8,s[n++]=m,m=m>>8,s[n++]=m,n}function R(s,r,n,a,p){Gt(r,a,p,s,n,7);let h=Number(r&BigInt(4294967295));s[n+7]=h,h=h>>8,s[n+6]=h,h=h>>8,s[n+5]=h,h=h>>8,s[n+4]=h;let m=Number(r>>BigInt(32)&BigInt(4294967295));return s[n+3]=m,m=m>>8,s[n+2]=m,m=m>>8,s[n+1]=m,m=m>>8,s[n]=m,n+8}u.prototype.writeBigUInt64LE=ce(function(r,n=0){return T(this,r,n,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=ce(function(r,n=0){return R(this,r,n,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(r,n,a,p){if(r=+r,n=n>>>0,!p){const j=Math.pow(2,8*a-1);A(this,r,n,a,j-1,-j)}let h=0,m=1,O=0;for(this[n]=r&255;++h<a&&(m*=256);)r<0&&O===0&&this[n+h-1]!==0&&(O=1),this[n+h]=(r/m>>0)-O&255;return n+a},u.prototype.writeIntBE=function(r,n,a,p){if(r=+r,n=n>>>0,!p){const j=Math.pow(2,8*a-1);A(this,r,n,a,j-1,-j)}let h=a-1,m=1,O=0;for(this[n+h]=r&255;--h>=0&&(m*=256);)r<0&&O===0&&this[n+h+1]!==0&&(O=1),this[n+h]=(r/m>>0)-O&255;return n+a},u.prototype.writeInt8=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,1,127,-128),r<0&&(r=255+r+1),this[n]=r&255,n+1},u.prototype.writeInt16LE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,2,32767,-32768),this[n]=r&255,this[n+1]=r>>>8,n+2},u.prototype.writeInt16BE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,2,32767,-32768),this[n]=r>>>8,this[n+1]=r&255,n+2},u.prototype.writeInt32LE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,4,2147483647,-2147483648),this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24,n+4},u.prototype.writeInt32BE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255,n+4},u.prototype.writeBigInt64LE=ce(function(r,n=0){return T(this,r,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=ce(function(r,n=0){return R(this,r,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function U(s,r,n,a,p,h){if(n+a>s.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function $(s,r,n,a,p){return r=+r,n=n>>>0,p||U(s,r,n,4),i.write(s,r,n,a,23,4),n+4}u.prototype.writeFloatLE=function(r,n,a){return $(this,r,n,!0,a)},u.prototype.writeFloatBE=function(r,n,a){return $(this,r,n,!1,a)};function W(s,r,n,a,p){return r=+r,n=n>>>0,p||U(s,r,n,8),i.write(s,r,n,a,52,8),n+8}u.prototype.writeDoubleLE=function(r,n,a){return W(this,r,n,!0,a)},u.prototype.writeDoubleBE=function(r,n,a){return W(this,r,n,!1,a)},u.prototype.copy=function(r,n,a,p){if(!u.isBuffer(r))throw new TypeError("argument should be a Buffer");if(a||(a=0),!p&&p!==0&&(p=this.length),n>=r.length&&(n=r.length),n||(n=0),p>0&&p<a&&(p=a),p===a||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(a<0||a>=this.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("sourceEnd out of bounds");p>this.length&&(p=this.length),r.length-n<p-a&&(p=r.length-n+a);const h=p-a;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,a,p):Uint8Array.prototype.set.call(r,this.subarray(a,p),n),h},u.prototype.fill=function(r,n,a,p){if(typeof r=="string"){if(typeof n=="string"?(p=n,n=0,a=this.length):typeof a=="string"&&(p=a,a=this.length),p!==void 0&&typeof p!="string")throw new TypeError("encoding must be a string");if(typeof p=="string"&&!u.isEncoding(p))throw new TypeError("Unknown encoding: "+p);if(r.length===1){const m=r.charCodeAt(0);(p==="utf8"&&m<128||p==="latin1")&&(r=m)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(n<0||this.length<n||this.length<a)throw new RangeError("Out of range index");if(a<=n)return this;n=n>>>0,a=a===void 0?this.length:a>>>0,r||(r=0);let h;if(typeof r=="number")for(h=n;h<a;++h)this[h]=r;else{const m=u.isBuffer(r)?r:u.from(r,p),O=m.length;if(O===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(h=0;h<a-n;++h)this[h+n]=m[h%O]}return this};const H={};function V(s,r,n){H[s]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${s}]`,this.stack,delete this.name}get code(){return s}set code(p){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:p,writable:!0})}toString(){return`${this.name} [${s}]: ${this.message}`}}}V("ERR_BUFFER_OUT_OF_BOUNDS",function(s){return s?`${s} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),V("ERR_INVALID_ARG_TYPE",function(s,r){return`The "${s}" argument must be of type number. Received type ${typeof r}`},TypeError),V("ERR_OUT_OF_RANGE",function(s,r,n){let a=`The value of "${s}" is out of range.`,p=n;return Number.isInteger(n)&&Math.abs(n)>2**32?p=Z(String(n)):typeof n=="bigint"&&(p=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(p=Z(p)),p+="n"),a+=` It must be ${r}. Received ${p}`,a},RangeError);function Z(s){let r="",n=s.length;const a=s[0]==="-"?1:0;for(;n>=a+4;n-=3)r=`_${s.slice(n-3,n)}${r}`;return`${s.slice(0,n)}${r}`}function Yr(s,r,n){Ee(r,"offset"),(s[r]===void 0||s[r+n]===void 0)&&De(r,s.length-(n+1))}function Gt(s,r,n,a,p,h){if(s>n||s<r){const m=typeof r=="bigint"?"n":"";let O;throw h>3?r===0||r===BigInt(0)?O=`>= 0${m} and < 2${m} ** ${(h+1)*8}${m}`:O=`>= -(2${m} ** ${(h+1)*8-1}${m}) and < 2 ** ${(h+1)*8-1}${m}`:O=`>= ${r}${m} and <= ${n}${m}`,new H.ERR_OUT_OF_RANGE("value",O,s)}Yr(a,p,h)}function Ee(s,r){if(typeof s!="number")throw new H.ERR_INVALID_ARG_TYPE(r,"number",s)}function De(s,r,n){throw Math.floor(s)!==s?(Ee(s,n),new H.ERR_OUT_OF_RANGE(n||"offset","an integer",s)):r<0?new H.ERR_BUFFER_OUT_OF_BOUNDS:new H.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${r}`,s)}const Xr=/[^+/0-9A-Za-z-_]/g;function Zr(s){if(s=s.split("=")[0],s=s.trim().replace(Xr,""),s.length<2)return"";for(;s.length%4!==0;)s=s+"=";return s}function st(s,r){r=r||1/0;let n;const a=s.length;let p=null;const h=[];for(let m=0;m<a;++m){if(n=s.charCodeAt(m),n>55295&&n<57344){if(!p){if(n>56319){(r-=3)>-1&&h.push(239,191,189);continue}else if(m+1===a){(r-=3)>-1&&h.push(239,191,189);continue}p=n;continue}if(n<56320){(r-=3)>-1&&h.push(239,191,189),p=n;continue}n=(p-55296<<10|n-56320)+65536}else p&&(r-=3)>-1&&h.push(239,191,189);if(p=null,n<128){if((r-=1)<0)break;h.push(n)}else if(n<2048){if((r-=2)<0)break;h.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;h.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;h.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return h}function Qr(s){const r=[];for(let n=0;n<s.length;++n)r.push(s.charCodeAt(n)&255);return r}function en(s,r){let n,a,p;const h=[];for(let m=0;m<s.length&&!((r-=2)<0);++m)n=s.charCodeAt(m),a=n>>8,p=n%256,h.push(p),h.push(a);return h}function Vt(s){return t.toByteArray(Zr(s))}function Me(s,r,n,a){let p;for(p=0;p<a&&!(p+n>=r.length||p>=s.length);++p)r[p+n]=s[p];return p}function Q(s,r){return s instanceof r||s!=null&&s.constructor!=null&&s.constructor.name!=null&&s.constructor.name===r.name}function at(s){return s!==s}const tn=function(){const s="0123456789abcdef",r=new Array(256);for(let n=0;n<16;++n){const a=n*16;for(let p=0;p<16;++p)r[a+p]=s[n]+s[p]}return r}();function ce(s){return typeof BigInt>"u"?rn:s}function rn(){throw new Error("BigInt not supported")}})(br);var xr={},Ge={},vt={},Ve={},oe={},Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.Convert=void 0;class dn{static toPriceFeed(t){return ut(t,ie("PriceFeed"))}static priceFeedToJson(t){return ft(t,ie("PriceFeed"))}static toPrice(t){return ut(t,ie("Price"))}static priceToJson(t){return ft(t,ie("Price"))}static toPriceFeedMetadata(t){return ut(t,ie("PriceFeedMetadata"))}static priceFeedMetadataToJson(t){return ft(t,ie("PriceFeedMetadata"))}}Ke.Convert=dn;function ne(e,t,i=""){throw Error(i?`Invalid value for key "${i}". Expected type ${JSON.stringify(e)} but got ${JSON.stringify(t)}`:`Invalid value ${JSON.stringify(t)} for type ${JSON.stringify(e)}`)}function mn(e){if(e.jsonToJS===void 0){const t={};e.props.forEach(i=>t[i.json]={key:i.js,typ:i.typ}),e.jsonToJS=t}return e.jsonToJS}function yn(e){if(e.jsToJSON===void 0){const t={};e.props.forEach(i=>t[i.js]={key:i.json,typ:i.typ}),e.jsToJSON=t}return e.jsToJSON}function xe(e,t,i,o=""){function c(b,d){return typeof b==typeof d?d:ne(b,d,o)}function l(b,d){const B=b.length;for(let S=0;S<B;S++){const C=b[S];try{return xe(d,C,i)}catch{}}return ne(b,d)}function f(b,d){return b.indexOf(d)!==-1?d:ne(b,d)}function u(b,d){return Array.isArray(d)?d.map(B=>xe(B,b,i)):ne("array",d)}function E(b){if(b===null)return null;const d=new Date(b);return isNaN(d.valueOf())?ne("Date",b):d}function g(b,d,B){if(B===null||typeof B!="object"||Array.isArray(B))return ne("object",B);const S={};return Object.getOwnPropertyNames(b).forEach(C=>{const F=b[C],D=Object.prototype.hasOwnProperty.call(B,C)?B[C]:void 0;S[F.key]=xe(D,F.typ,i,F.key)}),Object.getOwnPropertyNames(B).forEach(C=>{Object.prototype.hasOwnProperty.call(b,C)||(S[C]=xe(B[C],d,i,C))}),S}if(t==="any")return e;if(t===null)return e===null?e:ne(t,e);if(t===!1)return ne(t,e);for(;typeof t=="object"&&t.ref!==void 0;)t=En[t.ref];return Array.isArray(t)?f(t,e):typeof t=="object"?t.hasOwnProperty("unionMembers")?l(t.unionMembers,e):t.hasOwnProperty("arrayItems")?u(t.arrayItems,e):t.hasOwnProperty("props")?g(i(t),t.additional,e):ne(t,e):t===Date&&typeof e!="number"?E(e):c(t,e)}function ut(e,t){return xe(e,t,mn)}function ft(e,t){return xe(e,t,yn)}function pe(...e){return{unionMembers:e}}function lt(e,t){return{props:e,additional:t}}function ie(e){return{ref:e}}const En={PriceFeed:lt([{json:"ema_price",js:"ema_price",typ:ie("Price")},{json:"id",js:"id",typ:""},{json:"metadata",js:"metadata",typ:pe(void 0,ie("PriceFeedMetadata"))},{json:"price",js:"price",typ:ie("Price")},{json:"vaa",js:"vaa",typ:pe(void 0,"")}],"any"),Price:lt([{json:"conf",js:"conf",typ:""},{json:"expo",js:"expo",typ:0},{json:"price",js:"price",typ:""},{json:"publish_time",js:"publish_time",typ:0}],"any"),PriceFeedMetadata:lt([{json:"attestation_time",js:"attestation_time",typ:pe(void 0,0)},{json:"emitter_chain",js:"emitter_chain",typ:0},{json:"prev_publish_time",js:"prev_publish_time",typ:pe(void 0,0)},{json:"price_service_receive_time",js:"price_service_receive_time",typ:pe(void 0,0)},{json:"sequence_number",js:"sequence_number",typ:pe(void 0,0)},{json:"slot",js:"slot",typ:pe(void 0,0)}],"any")};Object.defineProperty(oe,"__esModule",{value:!0});oe.PriceFeed=oe.PriceFeedMetadata=oe.Price=void 0;const ge=Ke;class Ie{constructor(t){I(this,"conf");I(this,"expo");I(this,"price");I(this,"publishTime");this.conf=t.conf,this.expo=t.expo,this.price=t.price,this.publishTime=t.publishTime}getPriceAsNumberUnchecked(){return Number(this.price)*10**this.expo}getConfAsNumberUnchecked(){return Number(this.conf)*10**this.expo}static fromJson(t){const i=ge.Convert.toPrice(t);return new Ie({conf:i.conf,expo:i.expo,price:i.price,publishTime:i.publish_time})}toJson(){const t={conf:this.conf,expo:this.expo,price:this.price,publish_time:this.publishTime};return ge.Convert.priceToJson(t)}}oe.Price=Ie;class Ye{constructor(t){I(this,"attestationTime");I(this,"emitterChain");I(this,"priceServiceReceiveTime");I(this,"sequenceNumber");I(this,"slot");I(this,"prevPublishTime");this.attestationTime=t.attestationTime,this.emitterChain=t.emitterChain,this.priceServiceReceiveTime=t.receiveTime,this.sequenceNumber=t.sequenceNumber,this.slot=t.slot,this.prevPublishTime=t.prevPublishTime}static fromJson(t){if(t===void 0)return;const i=ge.Convert.toPriceFeedMetadata(t);return new Ye({attestationTime:i.attestation_time,emitterChain:i.emitter_chain,receiveTime:i.price_service_receive_time,sequenceNumber:i.sequence_number,slot:i.slot,prevPublishTime:i.prev_publish_time})}toJson(){const t={attestation_time:this.attestationTime,emitter_chain:this.emitterChain,price_service_receive_time:this.priceServiceReceiveTime,sequence_number:this.sequenceNumber,slot:this.slot,prev_publish_time:this.prevPublishTime};return ge.Convert.priceFeedMetadataToJson(t)}}oe.PriceFeedMetadata=Ye;class Nt{constructor(t){I(this,"emaPrice");I(this,"id");I(this,"metadata");I(this,"vaa");I(this,"price");this.emaPrice=t.emaPrice,this.id=t.id,this.metadata=t.metadata,this.vaa=t.vaa,this.price=t.price}static fromJson(t){const i=ge.Convert.toPriceFeed(t);return new Nt({emaPrice:Ie.fromJson(i.ema_price),id:i.id,metadata:Ye.fromJson(i.metadata),vaa:i.vaa,price:Ie.fromJson(i.price)})}toJson(){var i;const t={ema_price:this.emaPrice.toJson(),id:this.id,metadata:(i=this.metadata)==null?void 0:i.toJson(),price:this.price.toJson()};return ge.Convert.priceFeedToJson(t)}getPriceUnchecked(){return this.price}getEmaPriceUnchecked(){return this.emaPrice}getPriceNoOlderThan(t){const i=this.getPriceUnchecked(),o=Math.floor(Date.now()/1e3);if(!(Math.abs(o-i.publishTime)>t))return i}getEmaPriceNoOlderThan(t){const i=this.getEmaPriceUnchecked(),o=Math.floor(Date.now()/1e3);if(!(Math.abs(o-i.publishTime)>t))return i}getMetadata(){return this.metadata}getVAA(){return this.vaa}}oe.PriceFeed=Nt;function gr(e,t){return function(){return e.apply(t,arguments)}}const{toString:bn}=Object.prototype,{getPrototypeOf:Ut}=Object,Xe=(e=>t=>{const i=bn.call(t);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),re=e=>(e=e.toLowerCase(),t=>Xe(t)===e),Ze=e=>t=>typeof t===e,{isArray:Ae}=Array,ve=Ze("undefined");function wn(e){return e!==null&&!ve(e)&&e.constructor!==null&&!ve(e.constructor)&&Y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const _r=re("ArrayBuffer");function xn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&_r(e.buffer),t}const gn=Ze("string"),Y=Ze("function"),Cr=Ze("number"),Qe=e=>e!==null&&typeof e=="object",_n=e=>e===!0||e===!1,qe=e=>{if(Xe(e)!=="object")return!1;const t=Ut(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Cn=re("Date"),An=re("File"),Fn=re("Blob"),Bn=re("FileList"),Rn=e=>Qe(e)&&Y(e.pipe),Tn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Y(e.append)&&((t=Xe(e))==="formdata"||t==="object"&&Y(e.toString)&&e.toString()==="[object FormData]"))},Sn=re("URLSearchParams"),Dn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ne(e,t,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let o,c;if(typeof e!="object"&&(e=[e]),Ae(e))for(o=0,c=e.length;o<c;o++)t.call(null,e[o],o,e);else{const l=i?Object.getOwnPropertyNames(e):Object.keys(e),f=l.length;let u;for(o=0;o<f;o++)u=l[o],t.call(null,e[u],u,e)}}function Ar(e,t){t=t.toLowerCase();const i=Object.keys(e);let o=i.length,c;for(;o-- >0;)if(c=i[o],t===c.toLowerCase())return c;return null}const Fr=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:fe.commonjsGlobal)(),Br=e=>!ve(e)&&e!==Fr;function Rt(){const{caseless:e}=Br(this)&&this||{},t={},i=(o,c)=>{const l=e&&Ar(t,c)||c;qe(t[l])&&qe(o)?t[l]=Rt(t[l],o):qe(o)?t[l]=Rt({},o):Ae(o)?t[l]=o.slice():t[l]=o};for(let o=0,c=arguments.length;o<c;o++)arguments[o]&&Ne(arguments[o],i);return t}const On=(e,t,i,{allOwnKeys:o}={})=>(Ne(t,(c,l)=>{i&&Y(c)?e[l]=gr(c,i):e[l]=c},{allOwnKeys:o}),e),Pn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),In=(e,t,i,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),i&&Object.assign(e.prototype,i)},vn=(e,t,i,o)=>{let c,l,f;const u={};if(t=t||{},e==null)return t;do{for(c=Object.getOwnPropertyNames(e),l=c.length;l-- >0;)f=c[l],(!o||o(f,e,t))&&!u[f]&&(t[f]=e[f],u[f]=!0);e=i!==!1&&Ut(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t},Nn=(e,t,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=t.length;const o=e.indexOf(t,i);return o!==-1&&o===i},Un=e=>{if(!e)return null;if(Ae(e))return e;let t=e.length;if(!Cr(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},kn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ut(Uint8Array)),Ln=(e,t)=>{const o=(e&&e[Symbol.iterator]).call(e);let c;for(;(c=o.next())&&!c.done;){const l=c.value;t.call(e,l[0],l[1])}},jn=(e,t)=>{let i;const o=[];for(;(i=e.exec(t))!==null;)o.push(i);return o},Mn=re("HTMLFormElement"),qn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,o,c){return o.toUpperCase()+c}),Kt=(({hasOwnProperty:e})=>(t,i)=>e.call(t,i))(Object.prototype),$n=re("RegExp"),Rr=(e,t)=>{const i=Object.getOwnPropertyDescriptors(e),o={};Ne(i,(c,l)=>{let f;(f=t(c,l,e))!==!1&&(o[l]=f||c)}),Object.defineProperties(e,o)},Wn=e=>{Rr(e,(t,i)=>{if(Y(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const o=e[i];if(Y(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Jn=(e,t)=>{const i={},o=c=>{c.forEach(l=>{i[l]=!0})};return Ae(e)?o(e):o(String(e).split(t)),i},Hn=()=>{},zn=(e,t)=>(e=+e,Number.isFinite(e)?e:t),pt="abcdefghijklmnopqrstuvwxyz",Yt="0123456789",Tr={DIGIT:Yt,ALPHA:pt,ALPHA_DIGIT:pt+pt.toUpperCase()+Yt},Gn=(e=16,t=Tr.ALPHA_DIGIT)=>{let i="";const{length:o}=t;for(;e--;)i+=t[Math.random()*o|0];return i};function Vn(e){return!!(e&&Y(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Kn=e=>{const t=new Array(10),i=(o,c)=>{if(Qe(o)){if(t.indexOf(o)>=0)return;if(!("toJSON"in o)){t[c]=o;const l=Ae(o)?[]:{};return Ne(o,(f,u)=>{const E=i(f,c+1);!ve(E)&&(l[u]=E)}),t[c]=void 0,l}}return o};return i(e,0)},Yn=re("AsyncFunction"),Xn=e=>e&&(Qe(e)||Y(e))&&Y(e.then)&&Y(e.catch);var y={isArray:Ae,isArrayBuffer:_r,isBuffer:wn,isFormData:Tn,isArrayBufferView:xn,isString:gn,isNumber:Cr,isBoolean:_n,isObject:Qe,isPlainObject:qe,isUndefined:ve,isDate:Cn,isFile:An,isBlob:Fn,isRegExp:$n,isFunction:Y,isStream:Rn,isURLSearchParams:Sn,isTypedArray:kn,isFileList:Bn,forEach:Ne,merge:Rt,extend:On,trim:Dn,stripBOM:Pn,inherits:In,toFlatObject:vn,kindOf:Xe,kindOfTest:re,endsWith:Nn,toArray:Un,forEachEntry:Ln,matchAll:jn,isHTMLForm:Mn,hasOwnProperty:Kt,hasOwnProp:Kt,reduceDescriptors:Rr,freezeMethods:Wn,toObjectSet:Jn,toCamelCase:qn,noop:Hn,toFiniteNumber:zn,findKey:Ar,global:Fr,isContextDefined:Br,ALPHABET:Tr,generateString:Gn,isSpecCompliantForm:Vn,toJSONObject:Kn,isAsyncFn:Yn,isThenable:Xn};function P(e,t,i,o,c){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),o&&(this.request=o),c&&(this.response=c)}y.inherits(P,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:y.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Sr=P.prototype,Dr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Dr[e]={value:e}});Object.defineProperties(P,Dr);Object.defineProperty(Sr,"isAxiosError",{value:!0});P.from=(e,t,i,o,c,l)=>{const f=Object.create(Sr);return y.toFlatObject(e,f,function(E){return E!==Error.prototype},u=>u!=="isAxiosError"),P.call(f,e.message,t,i,o,c),f.cause=e,f.name=e.name,l&&Object.assign(f,l),f};var Zn=null;function Tt(e){return y.isPlainObject(e)||y.isArray(e)}function Or(e){return y.endsWith(e,"[]")?e.slice(0,-2):e}function Xt(e,t,i){return e?e.concat(t).map(function(c,l){return c=Or(c),!i&&l?"["+c+"]":c}).join(i?".":""):t}function Qn(e){return y.isArray(e)&&!e.some(Tt)}const ei=y.toFlatObject(y,{},null,function(t){return/^is[A-Z]/.test(t)});function et(e,t,i){if(!y.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,i=y.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(F,D){return!y.isUndefined(D[F])});const o=i.metaTokens,c=i.visitor||b,l=i.dots,f=i.indexes,E=(i.Blob||typeof Blob<"u"&&Blob)&&y.isSpecCompliantForm(t);if(!y.isFunction(c))throw new TypeError("visitor must be a function");function g(C){if(C===null)return"";if(y.isDate(C))return C.toISOString();if(!E&&y.isBlob(C))throw new P("Blob is not supported. Use a Buffer instead.");return y.isArrayBuffer(C)||y.isTypedArray(C)?E&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function b(C,F,D){let N=C;if(C&&!D&&typeof C=="object"){if(y.endsWith(F,"{}"))F=o?F:F.slice(0,-2),C=JSON.stringify(C);else if(y.isArray(C)&&Qn(C)||(y.isFileList(C)||y.endsWith(F,"[]"))&&(N=y.toArray(C)))return F=Or(F),N.forEach(function(L,le){!(y.isUndefined(L)||L===null)&&t.append(f===!0?Xt([F],le,l):f===null?F:F+"[]",g(L))}),!1}return Tt(C)?!0:(t.append(Xt(D,F,l),g(C)),!1)}const d=[],B=Object.assign(ei,{defaultVisitor:b,convertValue:g,isVisitable:Tt});function S(C,F){if(!y.isUndefined(C)){if(d.indexOf(C)!==-1)throw Error("Circular reference detected in "+F.join("."));d.push(C),y.forEach(C,function(N,J){(!(y.isUndefined(N)||N===null)&&c.call(t,N,y.isString(J)?J.trim():J,F,B))===!0&&S(N,F?F.concat(J):[J])}),d.pop()}}if(!y.isObject(e))throw new TypeError("data must be an object");return S(e),t}function Zt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function kt(e,t){this._pairs=[],e&&et(e,this,t)}const Pr=kt.prototype;Pr.append=function(t,i){this._pairs.push([t,i])};Pr.toString=function(t){const i=t?function(o){return t.call(this,o,Zt)}:Zt;return this._pairs.map(function(c){return i(c[0])+"="+i(c[1])},"").join("&")};function ti(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ir(e,t,i){if(!t)return e;const o=i&&i.encode||ti,c=i&&i.serialize;let l;if(c?l=c(t,i):l=y.isURLSearchParams(t)?t.toString():new kt(t,i).toString(o),l){const f=e.indexOf("#");f!==-1&&(e=e.slice(0,f)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class ri{constructor(){this.handlers=[]}use(t,i,o){return this.handlers.push({fulfilled:t,rejected:i,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){y.forEach(this.handlers,function(o){o!==null&&t(o)})}}var Qt=ri,vr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ni=typeof URLSearchParams<"u"?URLSearchParams:kt,ii=typeof FormData<"u"?FormData:null,oi=typeof Blob<"u"?Blob:null,si={isBrowser:!0,classes:{URLSearchParams:ni,FormData:ii,Blob:oi},protocols:["http","https","file","blob","url","data"]};const Nr=typeof window<"u"&&typeof document<"u",ai=(e=>Nr&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),ci=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")();var ui=Object.freeze({__proto__:null,hasBrowserEnv:Nr,hasStandardBrowserWebWorkerEnv:ci,hasStandardBrowserEnv:ai}),te={...ui,...si};function fi(e,t){return et(e,new te.classes.URLSearchParams,Object.assign({visitor:function(i,o,c,l){return te.isNode&&y.isBuffer(i)?(this.append(o,i.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)}},t))}function li(e){return y.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function pi(e){const t={},i=Object.keys(e);let o;const c=i.length;let l;for(o=0;o<c;o++)l=i[o],t[l]=e[l];return t}function Ur(e){function t(i,o,c,l){let f=i[l++];if(f==="__proto__")return!0;const u=Number.isFinite(+f),E=l>=i.length;return f=!f&&y.isArray(c)?c.length:f,E?(y.hasOwnProp(c,f)?c[f]=[c[f],o]:c[f]=o,!u):((!c[f]||!y.isObject(c[f]))&&(c[f]=[]),t(i,o,c[f],l)&&y.isArray(c[f])&&(c[f]=pi(c[f])),!u)}if(y.isFormData(e)&&y.isFunction(e.entries)){const i={};return y.forEachEntry(e,(o,c)=>{t(li(o),c,i,0)}),i}return null}function hi(e,t,i){if(y.isString(e))try{return(t||JSON.parse)(e),y.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(i||JSON.stringify)(e)}const Lt={transitional:vr,adapter:["xhr","http"],transformRequest:[function(t,i){const o=i.getContentType()||"",c=o.indexOf("application/json")>-1,l=y.isObject(t);if(l&&y.isHTMLForm(t)&&(t=new FormData(t)),y.isFormData(t))return c?JSON.stringify(Ur(t)):t;if(y.isArrayBuffer(t)||y.isBuffer(t)||y.isStream(t)||y.isFile(t)||y.isBlob(t))return t;if(y.isArrayBufferView(t))return t.buffer;if(y.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(l){if(o.indexOf("application/x-www-form-urlencoded")>-1)return fi(t,this.formSerializer).toString();if((u=y.isFileList(t))||o.indexOf("multipart/form-data")>-1){const E=this.env&&this.env.FormData;return et(u?{"files[]":t}:t,E&&new E,this.formSerializer)}}return l||c?(i.setContentType("application/json",!1),hi(t)):t}],transformResponse:[function(t){const i=this.transitional||Lt.transitional,o=i&&i.forcedJSONParsing,c=this.responseType==="json";if(t&&y.isString(t)&&(o&&!this.responseType||c)){const f=!(i&&i.silentJSONParsing)&&c;try{return JSON.parse(t)}catch(u){if(f)throw u.name==="SyntaxError"?P.from(u,P.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:te.classes.FormData,Blob:te.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};y.forEach(["delete","get","head","post","put","patch"],e=>{Lt.headers[e]={}});var jt=Lt;const di=y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var mi=e=>{const t={};let i,o,c;return e&&e.split(`
|
|
7
|
-
`).forEach(function(f){c=f.indexOf(":"),i=f.substring(0,c).trim().toLowerCase(),o=f.substring(c+1).trim(),!(!i||t[i]&&di[i])&&(i==="set-cookie"?t[i]?t[i].push(o):t[i]=[o]:t[i]=t[i]?t[i]+", "+o:o)}),t};const er=Symbol("internals");function
|
|
8
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...i){const o=new this(t);return i.forEach(c=>o.set(c)),o}static accessor(t){const o=(this[er]=this[er]={accessors:{}}).accessors,c=this.prototype;function l(f){const u=
|
|
6
|
+
*/(function(e){const t=ze,i=It,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=J,e.INSPECT_MAX_BYTES=50;const c=2147483647;e.kMaxLength=c,u.TYPED_ARRAY_SUPPORT=l(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const s=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(s,r),s.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function f(s){if(s>c)throw new RangeError('The value "'+s+'" is invalid for option "size"');const r=new Uint8Array(s);return Object.setPrototypeOf(r,u.prototype),r}function u(s,r,n){if(typeof s=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(s)}return E(s,r,n)}u.poolSize=8192;function E(s,r,n){if(typeof s=="string")return B(s,r);if(ArrayBuffer.isView(s))return C(s);if(s==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s);if(Q(s,ArrayBuffer)||s&&Q(s.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Q(s,SharedArrayBuffer)||s&&Q(s.buffer,SharedArrayBuffer)))return F(s,r,n);if(typeof s=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const a=s.valueOf&&s.valueOf();if(a!=null&&a!==s)return u.from(a,r,n);const p=D(s);if(p)return p;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof s[Symbol.toPrimitive]=="function")return u.from(s[Symbol.toPrimitive]("string"),r,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s)}u.from=function(s,r,n){return E(s,r,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function g(s){if(typeof s!="number")throw new TypeError('"size" argument must be of type number');if(s<0)throw new RangeError('The value "'+s+'" is invalid for option "size"')}function b(s,r,n){return g(s),s<=0?f(s):r!==void 0?typeof n=="string"?f(s).fill(r,n):f(s).fill(r):f(s)}u.alloc=function(s,r,n){return b(s,r,n)};function d(s){return g(s),f(s<0?0:N(s)|0)}u.allocUnsafe=function(s){return d(s)},u.allocUnsafeSlow=function(s){return d(s)};function B(s,r){if((typeof r!="string"||r==="")&&(r="utf8"),!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);const n=L(s,r)|0;let a=f(n);const p=a.write(s,r);return p!==n&&(a=a.slice(0,p)),a}function S(s){const r=s.length<0?0:N(s.length)|0,n=f(r);for(let a=0;a<r;a+=1)n[a]=s[a]&255;return n}function C(s){if(Q(s,Uint8Array)){const r=new Uint8Array(s);return F(r.buffer,r.byteOffset,r.byteLength)}return S(s)}function F(s,r,n){if(r<0||s.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<r+(n||0))throw new RangeError('"length" is outside of buffer bounds');let a;return r===void 0&&n===void 0?a=new Uint8Array(s):n===void 0?a=new Uint8Array(s,r):a=new Uint8Array(s,r,n),Object.setPrototypeOf(a,u.prototype),a}function D(s){if(u.isBuffer(s)){const r=N(s.length)|0,n=f(r);return n.length===0||s.copy(n,0,0,r),n}if(s.length!==void 0)return typeof s.length!="number"||at(s.length)?f(0):S(s);if(s.type==="Buffer"&&Array.isArray(s.data))return S(s.data)}function N(s){if(s>=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return s|0}function J(s){return+s!=s&&(s=0),u.alloc(+s)}u.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==u.prototype},u.compare=function(r,n){if(Q(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),Q(n,Uint8Array)&&(n=u.from(n,n.offset,n.byteLength)),!u.isBuffer(r)||!u.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===n)return 0;let a=r.length,p=n.length;for(let h=0,m=Math.min(a,p);h<m;++h)if(r[h]!==n[h]){a=r[h],p=n[h];break}return a<p?-1:p<a?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,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);let a;if(n===void 0)for(n=0,a=0;a<r.length;++a)n+=r[a].length;const p=u.allocUnsafe(n);let h=0;for(a=0;a<r.length;++a){let m=r[a];if(Q(m,Uint8Array))h+m.length>p.length?(u.isBuffer(m)||(m=u.from(m)),m.copy(p,h)):Uint8Array.prototype.set.call(p,m,h);else if(u.isBuffer(m))m.copy(p,h);else throw new TypeError('"list" argument must be an Array of Buffers');h+=m.length}return p};function L(s,r){if(u.isBuffer(s))return s.length;if(ArrayBuffer.isView(s)||Q(s,ArrayBuffer))return s.byteLength;if(typeof s!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof s);const n=s.length,a=arguments.length>2&&arguments[2]===!0;if(!a&&n===0)return 0;let p=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return st(s).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Vt(s).length;default:if(p)return a?-1:st(s).length;r=(""+r).toLowerCase(),p=!0}}u.byteLength=L;function le(s,r,n){let a=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(s||(s="utf8");;)switch(s){case"hex":return _(this,r,n);case"utf8":case"utf-8":return Be(this,r,n);case"ascii":return Te(this,r,n);case"latin1":case"binary":return Se(this,r,n);case"base64":return ot(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,r,n);default:if(a)throw new TypeError("Unknown encoding: "+s);s=(s+"").toLowerCase(),a=!0}}u.prototype._isBuffer=!0;function G(s,r,n){const a=s[r];s[r]=s[n],s[n]=a}u.prototype.swap16=function(){const r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let n=0;n<r;n+=2)G(this,n,n+1);return this},u.prototype.swap32=function(){const r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let n=0;n<r;n+=4)G(this,n,n+3),G(this,n+1,n+2);return this},u.prototype.swap64=function(){const r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let n=0;n<r;n+=8)G(this,n,n+7),G(this,n+1,n+6),G(this,n+2,n+5),G(this,n+3,n+4);return this},u.prototype.toString=function(){const r=this.length;return r===0?"":arguments.length===0?Be(this,0,r):le.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(r){if(!u.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0},u.prototype.inspect=function(){let r="";const n=e.INSPECT_MAX_BYTES;return r=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(r+=" ... "),"<Buffer "+r+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(r,n,a,p,h){if(Q(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(n===void 0&&(n=0),a===void 0&&(a=r?r.length:0),p===void 0&&(p=0),h===void 0&&(h=this.length),n<0||a>r.length||p<0||h>this.length)throw new RangeError("out of range index");if(p>=h&&n>=a)return 0;if(p>=h)return-1;if(n>=a)return 1;if(n>>>=0,a>>>=0,p>>>=0,h>>>=0,this===r)return 0;let m=h-p,P=a-n;const j=Math.min(m,P),k=this.slice(p,h),M=r.slice(n,a);for(let v=0;v<j;++v)if(k[v]!==M[v]){m=k[v],P=M[v];break}return m<P?-1:P<m?1:0};function X(s,r,n,a,p){if(s.length===0)return-1;if(typeof n=="string"?(a=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,at(n)&&(n=p?0:s.length-1),n<0&&(n=s.length+n),n>=s.length){if(p)return-1;n=s.length-1}else if(n<0)if(p)n=0;else return-1;if(typeof r=="string"&&(r=u.from(r,a)),u.isBuffer(r))return r.length===0?-1:de(s,r,n,a,p);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?p?Uint8Array.prototype.indexOf.call(s,r,n):Uint8Array.prototype.lastIndexOf.call(s,r,n):de(s,[r],n,a,p);throw new TypeError("val must be string, number or Buffer")}function de(s,r,n,a,p){let h=1,m=s.length,P=r.length;if(a!==void 0&&(a=String(a).toLowerCase(),a==="ucs2"||a==="ucs-2"||a==="utf16le"||a==="utf-16le")){if(s.length<2||r.length<2)return-1;h=2,m/=2,P/=2,n/=2}function j(M,v){return h===1?M[v]:M.readUInt16BE(v*h)}let k;if(p){let M=-1;for(k=n;k<m;k++)if(j(s,k)===j(r,M===-1?0:k-M)){if(M===-1&&(M=k),k-M+1===P)return M*h}else M!==-1&&(k-=k-M),M=-1}else for(n+P>m&&(n=m-P),k=n;k>=0;k--){let M=!0;for(let v=0;v<P;v++)if(j(s,k+v)!==j(r,v)){M=!1;break}if(M)return k}return-1}u.prototype.includes=function(r,n,a){return this.indexOf(r,n,a)!==-1},u.prototype.indexOf=function(r,n,a){return X(this,r,n,a,!0)},u.prototype.lastIndexOf=function(r,n,a){return X(this,r,n,a,!1)};function Fe(s,r,n,a){n=Number(n)||0;const p=s.length-n;a?(a=Number(a),a>p&&(a=p)):a=p;const h=r.length;a>h/2&&(a=h/2);let m;for(m=0;m<a;++m){const P=parseInt(r.substr(m*2,2),16);if(at(P))return m;s[n+m]=P}return m}function me(s,r,n,a){return Me(st(r,s.length-n),s,n,a)}function ae(s,r,n,a){return Me(Qr(r),s,n,a)}function Le(s,r,n,a){return Me(Vt(r),s,n,a)}function ye(s,r,n,a){return Me(en(r,s.length-n),s,n,a)}u.prototype.write=function(r,n,a,p){if(n===void 0)p="utf8",a=this.length,n=0;else if(a===void 0&&typeof n=="string")p=n,a=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(a)?(a=a>>>0,p===void 0&&(p="utf8")):(p=a,a=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const h=this.length-n;if((a===void 0||a>h)&&(a=h),r.length>0&&(a<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");p||(p="utf8");let m=!1;for(;;)switch(p){case"hex":return Fe(this,r,n,a);case"utf8":case"utf-8":return me(this,r,n,a);case"ascii":case"latin1":case"binary":return ae(this,r,n,a);case"base64":return Le(this,r,n,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,r,n,a);default:if(m)throw new TypeError("Unknown encoding: "+p);p=(""+p).toLowerCase(),m=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ot(s,r,n){return r===0&&n===s.length?t.fromByteArray(s):t.fromByteArray(s.slice(r,n))}function Be(s,r,n){n=Math.min(s.length,n);const a=[];let p=r;for(;p<n;){const h=s[p];let m=null,P=h>239?4:h>223?3:h>191?2:1;if(p+P<=n){let j,k,M,v;switch(P){case 1:h<128&&(m=h);break;case 2:j=s[p+1],(j&192)===128&&(v=(h&31)<<6|j&63,v>127&&(m=v));break;case 3:j=s[p+1],k=s[p+2],(j&192)===128&&(k&192)===128&&(v=(h&15)<<12|(j&63)<<6|k&63,v>2047&&(v<55296||v>57343)&&(m=v));break;case 4:j=s[p+1],k=s[p+2],M=s[p+3],(j&192)===128&&(k&192)===128&&(M&192)===128&&(v=(h&15)<<18|(j&63)<<12|(k&63)<<6|M&63,v>65535&&v<1114112&&(m=v))}}m===null?(m=65533,P=1):m>65535&&(m-=65536,a.push(m>>>10&1023|55296),m=56320|m&1023),a.push(m),p+=P}return Re(a)}const je=4096;function Re(s){const r=s.length;if(r<=je)return String.fromCharCode.apply(String,s);let n="",a=0;for(;a<r;)n+=String.fromCharCode.apply(String,s.slice(a,a+=je));return n}function Te(s,r,n){let a="";n=Math.min(s.length,n);for(let p=r;p<n;++p)a+=String.fromCharCode(s[p]&127);return a}function Se(s,r,n){let a="";n=Math.min(s.length,n);for(let p=r;p<n;++p)a+=String.fromCharCode(s[p]);return a}function _(s,r,n){const a=s.length;(!r||r<0)&&(r=0),(!n||n<0||n>a)&&(n=a);let p="";for(let h=r;h<n;++h)p+=tn[s[h]];return p}function x(s,r,n){const a=s.slice(r,n);let p="";for(let h=0;h<a.length-1;h+=2)p+=String.fromCharCode(a[h]+a[h+1]*256);return p}u.prototype.slice=function(r,n){const a=this.length;r=~~r,n=n===void 0?a:~~n,r<0?(r+=a,r<0&&(r=0)):r>a&&(r=a),n<0?(n+=a,n<0&&(n=0)):n>a&&(n=a),n<r&&(n=r);const p=this.subarray(r,n);return Object.setPrototypeOf(p,u.prototype),p};function w(s,r,n){if(s%1!==0||s<0)throw new RangeError("offset is not uint");if(s+r>n)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(r,n,a){r=r>>>0,n=n>>>0,a||w(r,n,this.length);let p=this[r],h=1,m=0;for(;++m<n&&(h*=256);)p+=this[r+m]*h;return p},u.prototype.readUintBE=u.prototype.readUIntBE=function(r,n,a){r=r>>>0,n=n>>>0,a||w(r,n,this.length);let p=this[r+--n],h=1;for(;n>0&&(h*=256);)p+=this[r+--n]*h;return p},u.prototype.readUint8=u.prototype.readUInt8=function(r,n){return r=r>>>0,n||w(r,1,this.length),this[r]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(r,n){return r=r>>>0,n||w(r,2,this.length),this[r]|this[r+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(r,n){return r=r>>>0,n||w(r,2,this.length),this[r]<<8|this[r+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(r,n){return r=r>>>0,n||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(r,n){return r=r>>>0,n||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},u.prototype.readBigUInt64LE=ce(function(r){r=r>>>0,Ee(r,"offset");const n=this[r],a=this[r+7];(n===void 0||a===void 0)&&De(r,this.length-8);const p=n+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,h=this[++r]+this[++r]*2**8+this[++r]*2**16+a*2**24;return BigInt(p)+(BigInt(h)<<BigInt(32))}),u.prototype.readBigUInt64BE=ce(function(r){r=r>>>0,Ee(r,"offset");const n=this[r],a=this[r+7];(n===void 0||a===void 0)&&De(r,this.length-8);const p=n*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],h=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+a;return(BigInt(p)<<BigInt(32))+BigInt(h)}),u.prototype.readIntLE=function(r,n,a){r=r>>>0,n=n>>>0,a||w(r,n,this.length);let p=this[r],h=1,m=0;for(;++m<n&&(h*=256);)p+=this[r+m]*h;return h*=128,p>=h&&(p-=Math.pow(2,8*n)),p},u.prototype.readIntBE=function(r,n,a){r=r>>>0,n=n>>>0,a||w(r,n,this.length);let p=n,h=1,m=this[r+--p];for(;p>0&&(h*=256);)m+=this[r+--p]*h;return h*=128,m>=h&&(m-=Math.pow(2,8*n)),m},u.prototype.readInt8=function(r,n){return r=r>>>0,n||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},u.prototype.readInt16LE=function(r,n){r=r>>>0,n||w(r,2,this.length);const a=this[r]|this[r+1]<<8;return a&32768?a|4294901760:a},u.prototype.readInt16BE=function(r,n){r=r>>>0,n||w(r,2,this.length);const a=this[r+1]|this[r]<<8;return a&32768?a|4294901760:a},u.prototype.readInt32LE=function(r,n){return r=r>>>0,n||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},u.prototype.readInt32BE=function(r,n){return r=r>>>0,n||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},u.prototype.readBigInt64LE=ce(function(r){r=r>>>0,Ee(r,"offset");const n=this[r],a=this[r+7];(n===void 0||a===void 0)&&De(r,this.length-8);const p=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(a<<24);return(BigInt(p)<<BigInt(32))+BigInt(n+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24)}),u.prototype.readBigInt64BE=ce(function(r){r=r>>>0,Ee(r,"offset");const n=this[r],a=this[r+7];(n===void 0||a===void 0)&&De(r,this.length-8);const p=(n<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(p)<<BigInt(32))+BigInt(this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+a)}),u.prototype.readFloatLE=function(r,n){return r=r>>>0,n||w(r,4,this.length),i.read(this,r,!0,23,4)},u.prototype.readFloatBE=function(r,n){return r=r>>>0,n||w(r,4,this.length),i.read(this,r,!1,23,4)},u.prototype.readDoubleLE=function(r,n){return r=r>>>0,n||w(r,8,this.length),i.read(this,r,!0,52,8)},u.prototype.readDoubleBE=function(r,n){return r=r>>>0,n||w(r,8,this.length),i.read(this,r,!1,52,8)};function A(s,r,n,a,p,h){if(!u.isBuffer(s))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>p||r<h)throw new RangeError('"value" argument is out of bounds');if(n+a>s.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(r,n,a,p){if(r=+r,n=n>>>0,a=a>>>0,!p){const P=Math.pow(2,8*a)-1;A(this,r,n,a,P,0)}let h=1,m=0;for(this[n]=r&255;++m<a&&(h*=256);)this[n+m]=r/h&255;return n+a},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(r,n,a,p){if(r=+r,n=n>>>0,a=a>>>0,!p){const P=Math.pow(2,8*a)-1;A(this,r,n,a,P,0)}let h=a-1,m=1;for(this[n+h]=r&255;--h>=0&&(m*=256);)this[n+h]=r/m&255;return n+a},u.prototype.writeUint8=u.prototype.writeUInt8=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,1,255,0),this[n]=r&255,n+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,2,65535,0),this[n]=r&255,this[n+1]=r>>>8,n+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,2,65535,0),this[n]=r>>>8,this[n+1]=r&255,n+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,4,4294967295,0),this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255,n+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,4,4294967295,0),this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255,n+4};function T(s,r,n,a,p){Gt(r,a,p,s,n,7);let h=Number(r&BigInt(4294967295));s[n++]=h,h=h>>8,s[n++]=h,h=h>>8,s[n++]=h,h=h>>8,s[n++]=h;let m=Number(r>>BigInt(32)&BigInt(4294967295));return s[n++]=m,m=m>>8,s[n++]=m,m=m>>8,s[n++]=m,m=m>>8,s[n++]=m,n}function R(s,r,n,a,p){Gt(r,a,p,s,n,7);let h=Number(r&BigInt(4294967295));s[n+7]=h,h=h>>8,s[n+6]=h,h=h>>8,s[n+5]=h,h=h>>8,s[n+4]=h;let m=Number(r>>BigInt(32)&BigInt(4294967295));return s[n+3]=m,m=m>>8,s[n+2]=m,m=m>>8,s[n+1]=m,m=m>>8,s[n]=m,n+8}u.prototype.writeBigUInt64LE=ce(function(r,n=0){return T(this,r,n,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=ce(function(r,n=0){return R(this,r,n,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(r,n,a,p){if(r=+r,n=n>>>0,!p){const j=Math.pow(2,8*a-1);A(this,r,n,a,j-1,-j)}let h=0,m=1,P=0;for(this[n]=r&255;++h<a&&(m*=256);)r<0&&P===0&&this[n+h-1]!==0&&(P=1),this[n+h]=(r/m>>0)-P&255;return n+a},u.prototype.writeIntBE=function(r,n,a,p){if(r=+r,n=n>>>0,!p){const j=Math.pow(2,8*a-1);A(this,r,n,a,j-1,-j)}let h=a-1,m=1,P=0;for(this[n+h]=r&255;--h>=0&&(m*=256);)r<0&&P===0&&this[n+h+1]!==0&&(P=1),this[n+h]=(r/m>>0)-P&255;return n+a},u.prototype.writeInt8=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,1,127,-128),r<0&&(r=255+r+1),this[n]=r&255,n+1},u.prototype.writeInt16LE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,2,32767,-32768),this[n]=r&255,this[n+1]=r>>>8,n+2},u.prototype.writeInt16BE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,2,32767,-32768),this[n]=r>>>8,this[n+1]=r&255,n+2},u.prototype.writeInt32LE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,4,2147483647,-2147483648),this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24,n+4},u.prototype.writeInt32BE=function(r,n,a){return r=+r,n=n>>>0,a||A(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255,n+4},u.prototype.writeBigInt64LE=ce(function(r,n=0){return T(this,r,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=ce(function(r,n=0){return R(this,r,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function U(s,r,n,a,p,h){if(n+a>s.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function $(s,r,n,a,p){return r=+r,n=n>>>0,p||U(s,r,n,4),i.write(s,r,n,a,23,4),n+4}u.prototype.writeFloatLE=function(r,n,a){return $(this,r,n,!0,a)},u.prototype.writeFloatBE=function(r,n,a){return $(this,r,n,!1,a)};function W(s,r,n,a,p){return r=+r,n=n>>>0,p||U(s,r,n,8),i.write(s,r,n,a,52,8),n+8}u.prototype.writeDoubleLE=function(r,n,a){return W(this,r,n,!0,a)},u.prototype.writeDoubleBE=function(r,n,a){return W(this,r,n,!1,a)},u.prototype.copy=function(r,n,a,p){if(!u.isBuffer(r))throw new TypeError("argument should be a Buffer");if(a||(a=0),!p&&p!==0&&(p=this.length),n>=r.length&&(n=r.length),n||(n=0),p>0&&p<a&&(p=a),p===a||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(a<0||a>=this.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("sourceEnd out of bounds");p>this.length&&(p=this.length),r.length-n<p-a&&(p=r.length-n+a);const h=p-a;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,a,p):Uint8Array.prototype.set.call(r,this.subarray(a,p),n),h},u.prototype.fill=function(r,n,a,p){if(typeof r=="string"){if(typeof n=="string"?(p=n,n=0,a=this.length):typeof a=="string"&&(p=a,a=this.length),p!==void 0&&typeof p!="string")throw new TypeError("encoding must be a string");if(typeof p=="string"&&!u.isEncoding(p))throw new TypeError("Unknown encoding: "+p);if(r.length===1){const m=r.charCodeAt(0);(p==="utf8"&&m<128||p==="latin1")&&(r=m)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(n<0||this.length<n||this.length<a)throw new RangeError("Out of range index");if(a<=n)return this;n=n>>>0,a=a===void 0?this.length:a>>>0,r||(r=0);let h;if(typeof r=="number")for(h=n;h<a;++h)this[h]=r;else{const m=u.isBuffer(r)?r:u.from(r,p),P=m.length;if(P===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(h=0;h<a-n;++h)this[h+n]=m[h%P]}return this};const H={};function V(s,r,n){H[s]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${s}]`,this.stack,delete this.name}get code(){return s}set code(p){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:p,writable:!0})}toString(){return`${this.name} [${s}]: ${this.message}`}}}V("ERR_BUFFER_OUT_OF_BOUNDS",function(s){return s?`${s} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),V("ERR_INVALID_ARG_TYPE",function(s,r){return`The "${s}" argument must be of type number. Received type ${typeof r}`},TypeError),V("ERR_OUT_OF_RANGE",function(s,r,n){let a=`The value of "${s}" is out of range.`,p=n;return Number.isInteger(n)&&Math.abs(n)>2**32?p=Z(String(n)):typeof n=="bigint"&&(p=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(p=Z(p)),p+="n"),a+=` It must be ${r}. Received ${p}`,a},RangeError);function Z(s){let r="",n=s.length;const a=s[0]==="-"?1:0;for(;n>=a+4;n-=3)r=`_${s.slice(n-3,n)}${r}`;return`${s.slice(0,n)}${r}`}function Yr(s,r,n){Ee(r,"offset"),(s[r]===void 0||s[r+n]===void 0)&&De(r,s.length-(n+1))}function Gt(s,r,n,a,p,h){if(s>n||s<r){const m=typeof r=="bigint"?"n":"";let P;throw h>3?r===0||r===BigInt(0)?P=`>= 0${m} and < 2${m} ** ${(h+1)*8}${m}`:P=`>= -(2${m} ** ${(h+1)*8-1}${m}) and < 2 ** ${(h+1)*8-1}${m}`:P=`>= ${r}${m} and <= ${n}${m}`,new H.ERR_OUT_OF_RANGE("value",P,s)}Yr(a,p,h)}function Ee(s,r){if(typeof s!="number")throw new H.ERR_INVALID_ARG_TYPE(r,"number",s)}function De(s,r,n){throw Math.floor(s)!==s?(Ee(s,n),new H.ERR_OUT_OF_RANGE(n||"offset","an integer",s)):r<0?new H.ERR_BUFFER_OUT_OF_BOUNDS:new H.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${r}`,s)}const Xr=/[^+/0-9A-Za-z-_]/g;function Zr(s){if(s=s.split("=")[0],s=s.trim().replace(Xr,""),s.length<2)return"";for(;s.length%4!==0;)s=s+"=";return s}function st(s,r){r=r||1/0;let n;const a=s.length;let p=null;const h=[];for(let m=0;m<a;++m){if(n=s.charCodeAt(m),n>55295&&n<57344){if(!p){if(n>56319){(r-=3)>-1&&h.push(239,191,189);continue}else if(m+1===a){(r-=3)>-1&&h.push(239,191,189);continue}p=n;continue}if(n<56320){(r-=3)>-1&&h.push(239,191,189),p=n;continue}n=(p-55296<<10|n-56320)+65536}else p&&(r-=3)>-1&&h.push(239,191,189);if(p=null,n<128){if((r-=1)<0)break;h.push(n)}else if(n<2048){if((r-=2)<0)break;h.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;h.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;h.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return h}function Qr(s){const r=[];for(let n=0;n<s.length;++n)r.push(s.charCodeAt(n)&255);return r}function en(s,r){let n,a,p;const h=[];for(let m=0;m<s.length&&!((r-=2)<0);++m)n=s.charCodeAt(m),a=n>>8,p=n%256,h.push(p),h.push(a);return h}function Vt(s){return t.toByteArray(Zr(s))}function Me(s,r,n,a){let p;for(p=0;p<a&&!(p+n>=r.length||p>=s.length);++p)r[p+n]=s[p];return p}function Q(s,r){return s instanceof r||s!=null&&s.constructor!=null&&s.constructor.name!=null&&s.constructor.name===r.name}function at(s){return s!==s}const tn=function(){const s="0123456789abcdef",r=new Array(256);for(let n=0;n<16;++n){const a=n*16;for(let p=0;p<16;++p)r[a+p]=s[n]+s[p]}return r}();function ce(s){return typeof BigInt>"u"?rn:s}function rn(){throw new Error("BigInt not supported")}})(br);var xr={},Ge={},vt={},Ve={},oe={},Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.Convert=void 0;class dn{static toPriceFeed(t){return ut(t,ie("PriceFeed"))}static priceFeedToJson(t){return ft(t,ie("PriceFeed"))}static toPrice(t){return ut(t,ie("Price"))}static priceToJson(t){return ft(t,ie("Price"))}static toPriceFeedMetadata(t){return ut(t,ie("PriceFeedMetadata"))}static priceFeedMetadataToJson(t){return ft(t,ie("PriceFeedMetadata"))}}Ke.Convert=dn;function ne(e,t,i=""){throw Error(i?`Invalid value for key "${i}". Expected type ${JSON.stringify(e)} but got ${JSON.stringify(t)}`:`Invalid value ${JSON.stringify(t)} for type ${JSON.stringify(e)}`)}function mn(e){if(e.jsonToJS===void 0){const t={};e.props.forEach(i=>t[i.json]={key:i.js,typ:i.typ}),e.jsonToJS=t}return e.jsonToJS}function yn(e){if(e.jsToJSON===void 0){const t={};e.props.forEach(i=>t[i.js]={key:i.json,typ:i.typ}),e.jsToJSON=t}return e.jsToJSON}function xe(e,t,i,o=""){function c(b,d){return typeof b==typeof d?d:ne(b,d,o)}function l(b,d){const B=b.length;for(let S=0;S<B;S++){const C=b[S];try{return xe(d,C,i)}catch{}}return ne(b,d)}function f(b,d){return b.indexOf(d)!==-1?d:ne(b,d)}function u(b,d){return Array.isArray(d)?d.map(B=>xe(B,b,i)):ne("array",d)}function E(b){if(b===null)return null;const d=new Date(b);return isNaN(d.valueOf())?ne("Date",b):d}function g(b,d,B){if(B===null||typeof B!="object"||Array.isArray(B))return ne("object",B);const S={};return Object.getOwnPropertyNames(b).forEach(C=>{const F=b[C],D=Object.prototype.hasOwnProperty.call(B,C)?B[C]:void 0;S[F.key]=xe(D,F.typ,i,F.key)}),Object.getOwnPropertyNames(B).forEach(C=>{Object.prototype.hasOwnProperty.call(b,C)||(S[C]=xe(B[C],d,i,C))}),S}if(t==="any")return e;if(t===null)return e===null?e:ne(t,e);if(t===!1)return ne(t,e);for(;typeof t=="object"&&t.ref!==void 0;)t=En[t.ref];return Array.isArray(t)?f(t,e):typeof t=="object"?t.hasOwnProperty("unionMembers")?l(t.unionMembers,e):t.hasOwnProperty("arrayItems")?u(t.arrayItems,e):t.hasOwnProperty("props")?g(i(t),t.additional,e):ne(t,e):t===Date&&typeof e!="number"?E(e):c(t,e)}function ut(e,t){return xe(e,t,mn)}function ft(e,t){return xe(e,t,yn)}function pe(...e){return{unionMembers:e}}function lt(e,t){return{props:e,additional:t}}function ie(e){return{ref:e}}const En={PriceFeed:lt([{json:"ema_price",js:"ema_price",typ:ie("Price")},{json:"id",js:"id",typ:""},{json:"metadata",js:"metadata",typ:pe(void 0,ie("PriceFeedMetadata"))},{json:"price",js:"price",typ:ie("Price")},{json:"vaa",js:"vaa",typ:pe(void 0,"")}],"any"),Price:lt([{json:"conf",js:"conf",typ:""},{json:"expo",js:"expo",typ:0},{json:"price",js:"price",typ:""},{json:"publish_time",js:"publish_time",typ:0}],"any"),PriceFeedMetadata:lt([{json:"attestation_time",js:"attestation_time",typ:pe(void 0,0)},{json:"emitter_chain",js:"emitter_chain",typ:0},{json:"prev_publish_time",js:"prev_publish_time",typ:pe(void 0,0)},{json:"price_service_receive_time",js:"price_service_receive_time",typ:pe(void 0,0)},{json:"sequence_number",js:"sequence_number",typ:pe(void 0,0)},{json:"slot",js:"slot",typ:pe(void 0,0)}],"any")};Object.defineProperty(oe,"__esModule",{value:!0});oe.PriceFeed=oe.PriceFeedMetadata=oe.Price=void 0;const ge=Ke;class Ie{constructor(t){I(this,"conf");I(this,"expo");I(this,"price");I(this,"publishTime");this.conf=t.conf,this.expo=t.expo,this.price=t.price,this.publishTime=t.publishTime}getPriceAsNumberUnchecked(){return Number(this.price)*10**this.expo}getConfAsNumberUnchecked(){return Number(this.conf)*10**this.expo}static fromJson(t){const i=ge.Convert.toPrice(t);return new Ie({conf:i.conf,expo:i.expo,price:i.price,publishTime:i.publish_time})}toJson(){const t={conf:this.conf,expo:this.expo,price:this.price,publish_time:this.publishTime};return ge.Convert.priceToJson(t)}}oe.Price=Ie;class Ye{constructor(t){I(this,"attestationTime");I(this,"emitterChain");I(this,"priceServiceReceiveTime");I(this,"sequenceNumber");I(this,"slot");I(this,"prevPublishTime");this.attestationTime=t.attestationTime,this.emitterChain=t.emitterChain,this.priceServiceReceiveTime=t.receiveTime,this.sequenceNumber=t.sequenceNumber,this.slot=t.slot,this.prevPublishTime=t.prevPublishTime}static fromJson(t){if(t===void 0)return;const i=ge.Convert.toPriceFeedMetadata(t);return new Ye({attestationTime:i.attestation_time,emitterChain:i.emitter_chain,receiveTime:i.price_service_receive_time,sequenceNumber:i.sequence_number,slot:i.slot,prevPublishTime:i.prev_publish_time})}toJson(){const t={attestation_time:this.attestationTime,emitter_chain:this.emitterChain,price_service_receive_time:this.priceServiceReceiveTime,sequence_number:this.sequenceNumber,slot:this.slot,prev_publish_time:this.prevPublishTime};return ge.Convert.priceFeedMetadataToJson(t)}}oe.PriceFeedMetadata=Ye;class Nt{constructor(t){I(this,"emaPrice");I(this,"id");I(this,"metadata");I(this,"vaa");I(this,"price");this.emaPrice=t.emaPrice,this.id=t.id,this.metadata=t.metadata,this.vaa=t.vaa,this.price=t.price}static fromJson(t){const i=ge.Convert.toPriceFeed(t);return new Nt({emaPrice:Ie.fromJson(i.ema_price),id:i.id,metadata:Ye.fromJson(i.metadata),vaa:i.vaa,price:Ie.fromJson(i.price)})}toJson(){var i;const t={ema_price:this.emaPrice.toJson(),id:this.id,metadata:(i=this.metadata)==null?void 0:i.toJson(),price:this.price.toJson()};return ge.Convert.priceFeedToJson(t)}getPriceUnchecked(){return this.price}getEmaPriceUnchecked(){return this.emaPrice}getPriceNoOlderThan(t){const i=this.getPriceUnchecked(),o=Math.floor(Date.now()/1e3);if(!(Math.abs(o-i.publishTime)>t))return i}getEmaPriceNoOlderThan(t){const i=this.getEmaPriceUnchecked(),o=Math.floor(Date.now()/1e3);if(!(Math.abs(o-i.publishTime)>t))return i}getMetadata(){return this.metadata}getVAA(){return this.vaa}}oe.PriceFeed=Nt;function gr(e,t){return function(){return e.apply(t,arguments)}}const{toString:bn}=Object.prototype,{getPrototypeOf:Ut}=Object,Xe=(e=>t=>{const i=bn.call(t);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),re=e=>(e=e.toLowerCase(),t=>Xe(t)===e),Ze=e=>t=>typeof t===e,{isArray:Ae}=Array,ve=Ze("undefined");function wn(e){return e!==null&&!ve(e)&&e.constructor!==null&&!ve(e.constructor)&&Y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const _r=re("ArrayBuffer");function xn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&_r(e.buffer),t}const gn=Ze("string"),Y=Ze("function"),Cr=Ze("number"),Qe=e=>e!==null&&typeof e=="object",_n=e=>e===!0||e===!1,qe=e=>{if(Xe(e)!=="object")return!1;const t=Ut(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Cn=re("Date"),An=re("File"),Fn=re("Blob"),Bn=re("FileList"),Rn=e=>Qe(e)&&Y(e.pipe),Tn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Y(e.append)&&((t=Xe(e))==="formdata"||t==="object"&&Y(e.toString)&&e.toString()==="[object FormData]"))},Sn=re("URLSearchParams"),Dn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ne(e,t,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let o,c;if(typeof e!="object"&&(e=[e]),Ae(e))for(o=0,c=e.length;o<c;o++)t.call(null,e[o],o,e);else{const l=i?Object.getOwnPropertyNames(e):Object.keys(e),f=l.length;let u;for(o=0;o<f;o++)u=l[o],t.call(null,e[u],u,e)}}function Ar(e,t){t=t.toLowerCase();const i=Object.keys(e);let o=i.length,c;for(;o-- >0;)if(c=i[o],t===c.toLowerCase())return c;return null}const Fr=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:fe.commonjsGlobal)(),Br=e=>!ve(e)&&e!==Fr;function Rt(){const{caseless:e}=Br(this)&&this||{},t={},i=(o,c)=>{const l=e&&Ar(t,c)||c;qe(t[l])&&qe(o)?t[l]=Rt(t[l],o):qe(o)?t[l]=Rt({},o):Ae(o)?t[l]=o.slice():t[l]=o};for(let o=0,c=arguments.length;o<c;o++)arguments[o]&&Ne(arguments[o],i);return t}const Pn=(e,t,i,{allOwnKeys:o}={})=>(Ne(t,(c,l)=>{i&&Y(c)?e[l]=gr(c,i):e[l]=c},{allOwnKeys:o}),e),On=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),In=(e,t,i,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),i&&Object.assign(e.prototype,i)},vn=(e,t,i,o)=>{let c,l,f;const u={};if(t=t||{},e==null)return t;do{for(c=Object.getOwnPropertyNames(e),l=c.length;l-- >0;)f=c[l],(!o||o(f,e,t))&&!u[f]&&(t[f]=e[f],u[f]=!0);e=i!==!1&&Ut(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype);return t},Nn=(e,t,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=t.length;const o=e.indexOf(t,i);return o!==-1&&o===i},Un=e=>{if(!e)return null;if(Ae(e))return e;let t=e.length;if(!Cr(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},kn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ut(Uint8Array)),Ln=(e,t)=>{const o=(e&&e[Symbol.iterator]).call(e);let c;for(;(c=o.next())&&!c.done;){const l=c.value;t.call(e,l[0],l[1])}},jn=(e,t)=>{let i;const o=[];for(;(i=e.exec(t))!==null;)o.push(i);return o},Mn=re("HTMLFormElement"),qn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,o,c){return o.toUpperCase()+c}),Kt=(({hasOwnProperty:e})=>(t,i)=>e.call(t,i))(Object.prototype),$n=re("RegExp"),Rr=(e,t)=>{const i=Object.getOwnPropertyDescriptors(e),o={};Ne(i,(c,l)=>{let f;(f=t(c,l,e))!==!1&&(o[l]=f||c)}),Object.defineProperties(e,o)},Wn=e=>{Rr(e,(t,i)=>{if(Y(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const o=e[i];if(Y(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Jn=(e,t)=>{const i={},o=c=>{c.forEach(l=>{i[l]=!0})};return Ae(e)?o(e):o(String(e).split(t)),i},Hn=()=>{},zn=(e,t)=>(e=+e,Number.isFinite(e)?e:t),pt="abcdefghijklmnopqrstuvwxyz",Yt="0123456789",Tr={DIGIT:Yt,ALPHA:pt,ALPHA_DIGIT:pt+pt.toUpperCase()+Yt},Gn=(e=16,t=Tr.ALPHA_DIGIT)=>{let i="";const{length:o}=t;for(;e--;)i+=t[Math.random()*o|0];return i};function Vn(e){return!!(e&&Y(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Kn=e=>{const t=new Array(10),i=(o,c)=>{if(Qe(o)){if(t.indexOf(o)>=0)return;if(!("toJSON"in o)){t[c]=o;const l=Ae(o)?[]:{};return Ne(o,(f,u)=>{const E=i(f,c+1);!ve(E)&&(l[u]=E)}),t[c]=void 0,l}}return o};return i(e,0)},Yn=re("AsyncFunction"),Xn=e=>e&&(Qe(e)||Y(e))&&Y(e.then)&&Y(e.catch);var y={isArray:Ae,isArrayBuffer:_r,isBuffer:wn,isFormData:Tn,isArrayBufferView:xn,isString:gn,isNumber:Cr,isBoolean:_n,isObject:Qe,isPlainObject:qe,isUndefined:ve,isDate:Cn,isFile:An,isBlob:Fn,isRegExp:$n,isFunction:Y,isStream:Rn,isURLSearchParams:Sn,isTypedArray:kn,isFileList:Bn,forEach:Ne,merge:Rt,extend:Pn,trim:Dn,stripBOM:On,inherits:In,toFlatObject:vn,kindOf:Xe,kindOfTest:re,endsWith:Nn,toArray:Un,forEachEntry:Ln,matchAll:jn,isHTMLForm:Mn,hasOwnProperty:Kt,hasOwnProp:Kt,reduceDescriptors:Rr,freezeMethods:Wn,toObjectSet:Jn,toCamelCase:qn,noop:Hn,toFiniteNumber:zn,findKey:Ar,global:Fr,isContextDefined:Br,ALPHABET:Tr,generateString:Gn,isSpecCompliantForm:Vn,toJSONObject:Kn,isAsyncFn:Yn,isThenable:Xn};function O(e,t,i,o,c){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),o&&(this.request=o),c&&(this.response=c)}y.inherits(O,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:y.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Sr=O.prototype,Dr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Dr[e]={value:e}});Object.defineProperties(O,Dr);Object.defineProperty(Sr,"isAxiosError",{value:!0});O.from=(e,t,i,o,c,l)=>{const f=Object.create(Sr);return y.toFlatObject(e,f,function(E){return E!==Error.prototype},u=>u!=="isAxiosError"),O.call(f,e.message,t,i,o,c),f.cause=e,f.name=e.name,l&&Object.assign(f,l),f};var Zn=null;function Tt(e){return y.isPlainObject(e)||y.isArray(e)}function Pr(e){return y.endsWith(e,"[]")?e.slice(0,-2):e}function Xt(e,t,i){return e?e.concat(t).map(function(c,l){return c=Pr(c),!i&&l?"["+c+"]":c}).join(i?".":""):t}function Qn(e){return y.isArray(e)&&!e.some(Tt)}const ei=y.toFlatObject(y,{},null,function(t){return/^is[A-Z]/.test(t)});function et(e,t,i){if(!y.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,i=y.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(F,D){return!y.isUndefined(D[F])});const o=i.metaTokens,c=i.visitor||b,l=i.dots,f=i.indexes,E=(i.Blob||typeof Blob<"u"&&Blob)&&y.isSpecCompliantForm(t);if(!y.isFunction(c))throw new TypeError("visitor must be a function");function g(C){if(C===null)return"";if(y.isDate(C))return C.toISOString();if(!E&&y.isBlob(C))throw new O("Blob is not supported. Use a Buffer instead.");return y.isArrayBuffer(C)||y.isTypedArray(C)?E&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function b(C,F,D){let N=C;if(C&&!D&&typeof C=="object"){if(y.endsWith(F,"{}"))F=o?F:F.slice(0,-2),C=JSON.stringify(C);else if(y.isArray(C)&&Qn(C)||(y.isFileList(C)||y.endsWith(F,"[]"))&&(N=y.toArray(C)))return F=Pr(F),N.forEach(function(L,le){!(y.isUndefined(L)||L===null)&&t.append(f===!0?Xt([F],le,l):f===null?F:F+"[]",g(L))}),!1}return Tt(C)?!0:(t.append(Xt(D,F,l),g(C)),!1)}const d=[],B=Object.assign(ei,{defaultVisitor:b,convertValue:g,isVisitable:Tt});function S(C,F){if(!y.isUndefined(C)){if(d.indexOf(C)!==-1)throw Error("Circular reference detected in "+F.join("."));d.push(C),y.forEach(C,function(N,J){(!(y.isUndefined(N)||N===null)&&c.call(t,N,y.isString(J)?J.trim():J,F,B))===!0&&S(N,F?F.concat(J):[J])}),d.pop()}}if(!y.isObject(e))throw new TypeError("data must be an object");return S(e),t}function Zt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function kt(e,t){this._pairs=[],e&&et(e,this,t)}const Or=kt.prototype;Or.append=function(t,i){this._pairs.push([t,i])};Or.toString=function(t){const i=t?function(o){return t.call(this,o,Zt)}:Zt;return this._pairs.map(function(c){return i(c[0])+"="+i(c[1])},"").join("&")};function ti(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ir(e,t,i){if(!t)return e;const o=i&&i.encode||ti,c=i&&i.serialize;let l;if(c?l=c(t,i):l=y.isURLSearchParams(t)?t.toString():new kt(t,i).toString(o),l){const f=e.indexOf("#");f!==-1&&(e=e.slice(0,f)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class ri{constructor(){this.handlers=[]}use(t,i,o){return this.handlers.push({fulfilled:t,rejected:i,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){y.forEach(this.handlers,function(o){o!==null&&t(o)})}}var Qt=ri,vr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ni=typeof URLSearchParams<"u"?URLSearchParams:kt,ii=typeof FormData<"u"?FormData:null,oi=typeof Blob<"u"?Blob:null,si={isBrowser:!0,classes:{URLSearchParams:ni,FormData:ii,Blob:oi},protocols:["http","https","file","blob","url","data"]};const Nr=typeof window<"u"&&typeof document<"u",ai=(e=>Nr&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),ci=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")();var ui=Object.freeze({__proto__:null,hasBrowserEnv:Nr,hasStandardBrowserWebWorkerEnv:ci,hasStandardBrowserEnv:ai}),te={...ui,...si};function fi(e,t){return et(e,new te.classes.URLSearchParams,Object.assign({visitor:function(i,o,c,l){return te.isNode&&y.isBuffer(i)?(this.append(o,i.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)}},t))}function li(e){return y.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function pi(e){const t={},i=Object.keys(e);let o;const c=i.length;let l;for(o=0;o<c;o++)l=i[o],t[l]=e[l];return t}function Ur(e){function t(i,o,c,l){let f=i[l++];if(f==="__proto__")return!0;const u=Number.isFinite(+f),E=l>=i.length;return f=!f&&y.isArray(c)?c.length:f,E?(y.hasOwnProp(c,f)?c[f]=[c[f],o]:c[f]=o,!u):((!c[f]||!y.isObject(c[f]))&&(c[f]=[]),t(i,o,c[f],l)&&y.isArray(c[f])&&(c[f]=pi(c[f])),!u)}if(y.isFormData(e)&&y.isFunction(e.entries)){const i={};return y.forEachEntry(e,(o,c)=>{t(li(o),c,i,0)}),i}return null}function hi(e,t,i){if(y.isString(e))try{return(t||JSON.parse)(e),y.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(i||JSON.stringify)(e)}const Lt={transitional:vr,adapter:["xhr","http"],transformRequest:[function(t,i){const o=i.getContentType()||"",c=o.indexOf("application/json")>-1,l=y.isObject(t);if(l&&y.isHTMLForm(t)&&(t=new FormData(t)),y.isFormData(t))return c?JSON.stringify(Ur(t)):t;if(y.isArrayBuffer(t)||y.isBuffer(t)||y.isStream(t)||y.isFile(t)||y.isBlob(t))return t;if(y.isArrayBufferView(t))return t.buffer;if(y.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(l){if(o.indexOf("application/x-www-form-urlencoded")>-1)return fi(t,this.formSerializer).toString();if((u=y.isFileList(t))||o.indexOf("multipart/form-data")>-1){const E=this.env&&this.env.FormData;return et(u?{"files[]":t}:t,E&&new E,this.formSerializer)}}return l||c?(i.setContentType("application/json",!1),hi(t)):t}],transformResponse:[function(t){const i=this.transitional||Lt.transitional,o=i&&i.forcedJSONParsing,c=this.responseType==="json";if(t&&y.isString(t)&&(o&&!this.responseType||c)){const f=!(i&&i.silentJSONParsing)&&c;try{return JSON.parse(t)}catch(u){if(f)throw u.name==="SyntaxError"?O.from(u,O.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:te.classes.FormData,Blob:te.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};y.forEach(["delete","get","head","post","put","patch"],e=>{Lt.headers[e]={}});var jt=Lt;const di=y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var mi=e=>{const t={};let i,o,c;return e&&e.split(`
|
|
7
|
+
`).forEach(function(f){c=f.indexOf(":"),i=f.substring(0,c).trim().toLowerCase(),o=f.substring(c+1).trim(),!(!i||t[i]&&di[i])&&(i==="set-cookie"?t[i]?t[i].push(o):t[i]=[o]:t[i]=t[i]?t[i]+", "+o:o)}),t};const er=Symbol("internals");function Oe(e){return e&&String(e).trim().toLowerCase()}function $e(e){return e===!1||e==null?e:y.isArray(e)?e.map($e):String(e)}function yi(e){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=i.exec(e);)t[o[1]]=o[2];return t}const Ei=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ht(e,t,i,o,c){if(y.isFunction(o))return o.call(this,t,i);if(c&&(t=i),!!y.isString(t)){if(y.isString(o))return t.indexOf(o)!==-1;if(y.isRegExp(o))return o.test(t)}}function bi(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,i,o)=>i.toUpperCase()+o)}function wi(e,t){const i=y.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+i,{value:function(c,l,f){return this[o].call(this,t,c,l,f)},configurable:!0})})}class tt{constructor(t){t&&this.set(t)}set(t,i,o){const c=this;function l(u,E,g){const b=Oe(E);if(!b)throw new Error("header name must be a non-empty string");const d=y.findKey(c,b);(!d||c[d]===void 0||g===!0||g===void 0&&c[d]!==!1)&&(c[d||E]=$e(u))}const f=(u,E)=>y.forEach(u,(g,b)=>l(g,b,E));return y.isPlainObject(t)||t instanceof this.constructor?f(t,i):y.isString(t)&&(t=t.trim())&&!Ei(t)?f(mi(t),i):t!=null&&l(i,t,o),this}get(t,i){if(t=Oe(t),t){const o=y.findKey(this,t);if(o){const c=this[o];if(!i)return c;if(i===!0)return yi(c);if(y.isFunction(i))return i.call(this,c,o);if(y.isRegExp(i))return i.exec(c);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,i){if(t=Oe(t),t){const o=y.findKey(this,t);return!!(o&&this[o]!==void 0&&(!i||ht(this,this[o],o,i)))}return!1}delete(t,i){const o=this;let c=!1;function l(f){if(f=Oe(f),f){const u=y.findKey(o,f);u&&(!i||ht(o,o[u],u,i))&&(delete o[u],c=!0)}}return y.isArray(t)?t.forEach(l):l(t),c}clear(t){const i=Object.keys(this);let o=i.length,c=!1;for(;o--;){const l=i[o];(!t||ht(this,this[l],l,t,!0))&&(delete this[l],c=!0)}return c}normalize(t){const i=this,o={};return y.forEach(this,(c,l)=>{const f=y.findKey(o,l);if(f){i[f]=$e(c),delete i[l];return}const u=t?bi(l):String(l).trim();u!==l&&delete i[l],i[u]=$e(c),o[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const i=Object.create(null);return y.forEach(this,(o,c)=>{o!=null&&o!==!1&&(i[c]=t&&y.isArray(o)?o.join(", "):o)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,i])=>t+": "+i).join(`
|
|
8
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...i){const o=new this(t);return i.forEach(c=>o.set(c)),o}static accessor(t){const o=(this[er]=this[er]={accessors:{}}).accessors,c=this.prototype;function l(f){const u=Oe(f);o[u]||(wi(c,f),o[u]=!0)}return y.isArray(t)?t.forEach(l):l(t),this}}tt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);y.reduceDescriptors(tt.prototype,({value:e},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[i]=o}}});y.freezeMethods(tt);var se=tt;function dt(e,t){const i=this||jt,o=t||i,c=se.from(o.headers);let l=o.data;return y.forEach(e,function(u){l=u.call(i,l,c.normalize(),t?t.status:void 0)}),c.normalize(),l}function kr(e){return!!(e&&e.__CANCEL__)}function Ue(e,t,i){O.call(this,e??"canceled",O.ERR_CANCELED,t,i),this.name="CanceledError"}y.inherits(Ue,O,{__CANCEL__:!0});function xi(e,t,i){const o=i.config.validateStatus;!i.status||!o||o(i.status)?e(i):t(new O("Request failed with status code "+i.status,[O.ERR_BAD_REQUEST,O.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}var gi=te.hasStandardBrowserEnv?{write(e,t,i,o,c,l){const f=[e+"="+encodeURIComponent(t)];y.isNumber(i)&&f.push("expires="+new Date(i).toGMTString()),y.isString(o)&&f.push("path="+o),y.isString(c)&&f.push("domain="+c),l===!0&&f.push("secure"),document.cookie=f.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function _i(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ci(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Lr(e,t){return e&&!_i(t)?Ci(e,t):t}var Ai=te.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");let o;function c(l){let f=l;return t&&(i.setAttribute("href",f),f=i.href),i.setAttribute("href",f),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return o=c(window.location.href),function(f){const u=y.isString(f)?c(f):f;return u.protocol===o.protocol&&u.host===o.host}}():function(){return function(){return!0}}();function Fi(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Bi(e,t){e=e||10;const i=new Array(e),o=new Array(e);let c=0,l=0,f;return t=t!==void 0?t:1e3,function(E){const g=Date.now(),b=o[l];f||(f=g),i[c]=E,o[c]=g;let d=l,B=0;for(;d!==c;)B+=i[d++],d=d%e;if(c=(c+1)%e,c===l&&(l=(l+1)%e),g-f<t)return;const S=b&&g-b;return S?Math.round(B*1e3/S):void 0}}function tr(e,t){let i=0;const o=Bi(50,250);return c=>{const l=c.loaded,f=c.lengthComputable?c.total:void 0,u=l-i,E=o(u),g=l<=f;i=l;const b={loaded:l,total:f,progress:f?l/f:void 0,bytes:u,rate:E||void 0,estimated:E&&f&&g?(f-l)/E:void 0,event:c};b[t?"download":"upload"]=!0,e(b)}}const Ri=typeof XMLHttpRequest<"u";var Ti=Ri&&function(e){return new Promise(function(i,o){let c=e.data;const l=se.from(e.headers).normalize();let{responseType:f,withXSRFToken:u}=e,E;function g(){e.cancelToken&&e.cancelToken.unsubscribe(E),e.signal&&e.signal.removeEventListener("abort",E)}let b;if(y.isFormData(c)){if(te.hasStandardBrowserEnv||te.hasStandardBrowserWebWorkerEnv)l.setContentType(!1);else if((b=l.getContentType())!==!1){const[F,...D]=b?b.split(";").map(N=>N.trim()).filter(Boolean):[];l.setContentType([F||"multipart/form-data",...D].join("; "))}}let d=new XMLHttpRequest;if(e.auth){const F=e.auth.username||"",D=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";l.set("Authorization","Basic "+btoa(F+":"+D))}const B=Lr(e.baseURL,e.url);d.open(e.method.toUpperCase(),Ir(B,e.params,e.paramsSerializer),!0),d.timeout=e.timeout;function S(){if(!d)return;const F=se.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),N={data:!f||f==="text"||f==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:F,config:e,request:d};xi(function(L){i(L),g()},function(L){o(L),g()},N),d=null}if("onloadend"in d?d.onloadend=S:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(S)},d.onabort=function(){d&&(o(new O("Request aborted",O.ECONNABORTED,e,d)),d=null)},d.onerror=function(){o(new O("Network Error",O.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let D=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const N=e.transitional||vr;e.timeoutErrorMessage&&(D=e.timeoutErrorMessage),o(new O(D,N.clarifyTimeoutError?O.ETIMEDOUT:O.ECONNABORTED,e,d)),d=null},te.hasStandardBrowserEnv&&(u&&y.isFunction(u)&&(u=u(e)),u||u!==!1&&Ai(B))){const F=e.xsrfHeaderName&&e.xsrfCookieName&&gi.read(e.xsrfCookieName);F&&l.set(e.xsrfHeaderName,F)}c===void 0&&l.setContentType(null),"setRequestHeader"in d&&y.forEach(l.toJSON(),function(D,N){d.setRequestHeader(N,D)}),y.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),f&&f!=="json"&&(d.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&d.addEventListener("progress",tr(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",tr(e.onUploadProgress)),(e.cancelToken||e.signal)&&(E=F=>{d&&(o(!F||F.type?new Ue(null,e,d):F),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(E),e.signal&&(e.signal.aborted?E():e.signal.addEventListener("abort",E)));const C=Fi(B);if(C&&te.protocols.indexOf(C)===-1){o(new O("Unsupported protocol "+C+":",O.ERR_BAD_REQUEST,e));return}d.send(c||null)})};const St={http:Zn,xhr:Ti};y.forEach(St,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const rr=e=>`- ${e}`,Si=e=>y.isFunction(e)||e===null||e===!1;var jr={getAdapter:e=>{e=y.isArray(e)?e:[e];const{length:t}=e;let i,o;const c={};for(let l=0;l<t;l++){i=e[l];let f;if(o=i,!Si(i)&&(o=St[(f=String(i)).toLowerCase()],o===void 0))throw new O(`Unknown adapter '${f}'`);if(o)break;c[f||"#"+l]=o}if(!o){const l=Object.entries(c).map(([u,E])=>`adapter ${u} `+(E===!1?"is not supported by the environment":"is not available in the build"));let f=t?l.length>1?`since :
|
|
9
9
|
`+l.map(rr).join(`
|
|
10
|
-
`):" "+rr(l[0]):"as no adapter specified";throw new
|
|
11
|
-
`+l):o.stack=l}throw o}}_request(t,i){typeof t=="string"?(i=i||{},i.url=t):i=t||{},i=_e(this.defaults,i);const{transitional:o,paramsSerializer:c,headers:l}=i;o!==void 0&&Dt.assertOptions(o,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean)},!1),c!=null&&(y.isFunction(c)?i.paramsSerializer={serialize:c}:Dt.assertOptions(c,{encode:ue.function,serialize:ue.function},!0)),i.method=(i.method||this.defaults.method||"get").toLowerCase();let f=l&&y.merge(l.common,l[i.method]);l&&y.forEach(["delete","get","head","post","put","patch","common"],C=>{delete l[C]}),i.headers=se.concat(f,l);const u=[];let E=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(i)===!1||(E=E&&F.synchronous,u.unshift(F.fulfilled,F.rejected))});const g=[];this.interceptors.response.forEach(function(F){g.push(F.fulfilled,F.rejected)});let b,d=0,B;if(!E){const C=[nr.bind(this),void 0];for(C.unshift.apply(C,u),C.push.apply(C,g),B=C.length,b=Promise.resolve(i);d<B;)b=b.then(C[d++],C[d++]);return b}B=u.length;let S=i;for(d=0;d<B;){const C=u[d++],F=u[d++];try{S=C(S)}catch(D){F.call(this,D);break}}try{b=nr.call(this,S)}catch(C){return Promise.reject(C)}for(d=0,B=g.length;d<B;)b=b.then(g[d++],g[d++]);return b}getUri(t){t=_e(this.defaults,t);const i=Lr(t.baseURL,t.url);return Ir(i,t.params,t.paramsSerializer)}}y.forEach(["delete","get","head","options"],function(t){Je.prototype[t]=function(i,o){return this.request(_e(o||{},{method:t,url:i,data:(o||{}).data}))}});y.forEach(["post","put","patch"],function(t){function i(o){return function(l,f,u){return this.request(_e(u||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:l,data:f}))}}Je.prototype[t]=i(),Je.prototype[t+"Form"]=i(!0)});var We=Je;class qt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(l){i=l});const o=this;this.promise.then(c=>{if(!o._listeners)return;let l=o._listeners.length;for(;l-- >0;)o._listeners[l](c);o._listeners=null}),this.promise.then=c=>{let l;const f=new Promise(u=>{o.subscribe(u),l=u}).then(c);return f.cancel=function(){o.unsubscribe(l)},f},t(function(l,f,u){o.reason||(o.reason=new Ue(l,f,u),i(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const i=this._listeners.indexOf(t);i!==-1&&this._listeners.splice(i,1)}static source(){let t;return{token:new qt(function(c){t=c}),cancel:t}}}var Oi=qt;function Pi(e){return function(i){return e.apply(null,i)}}function Ii(e){return y.isObject(e)&&e.isAxiosError===!0}const Ot={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ot).forEach(([e,t])=>{Ot[t]=e});var vi=Ot;function qr(e){const t=new We(e),i=gr(We.prototype.request,t);return y.extend(i,We.prototype,t,{allOwnKeys:!0}),y.extend(i,t,null,{allOwnKeys:!0}),i.create=function(c){return qr(_e(e,c))},i}const q=qr(jt);q.Axios=We;q.CanceledError=Ue;q.CancelToken=Oi;q.isCancel=kr;q.VERSION=Mr;q.toFormData=et;q.AxiosError=P;q.Cancel=q.CanceledError;q.all=function(t){return Promise.all(t)};q.spread=Pi;q.isAxiosError=Ii;q.mergeConfig=_e;q.AxiosHeaders=se;q.formToJSON=e=>Ur(y.isHTMLForm(e)?new FormData(e):e);q.getAdapter=jr.getAdapter;q.HttpStatusCode=vi;q.default=q;var Ni=q,$t={exports:{}},z={},$r={exports:{}};(function(e){function t(i){return i&&i.__esModule?i:{default:i}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})($r);var Ui=$r.exports,yt={exports:{}},Et={exports:{}},sr;function rt(){return sr||(sr=1,function(e){function t(i){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},e.exports.__esModule=!0,e.exports.default=e.exports,t(i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Et)),Et.exports}var ar;function ki(){return ar||(ar=1,function(e){var t=rt().default;function i(){e.exports=i=function(){return c},e.exports.__esModule=!0,e.exports.default=e.exports;var o,c={},l=Object.prototype,f=l.hasOwnProperty,u=Object.defineProperty||function(_,x,w){_[x]=w.value},E=typeof Symbol=="function"?Symbol:{},g=E.iterator||"@@iterator",b=E.asyncIterator||"@@asyncIterator",d=E.toStringTag||"@@toStringTag";function B(_,x,w){return Object.defineProperty(_,x,{value:w,enumerable:!0,configurable:!0,writable:!0}),_[x]}try{B({},"")}catch{B=function(w,A,T){return w[A]=T}}function S(_,x,w,A){var T=x&&x.prototype instanceof le?x:le,R=Object.create(T.prototype),U=new Te(A||[]);return u(R,"_invoke",{value:ot(_,w,U)}),R}function C(_,x,w){try{return{type:"normal",arg:_.call(x,w)}}catch(A){return{type:"throw",arg:A}}}c.wrap=S;var F="suspendedStart",D="suspendedYield",N="executing",J="completed",L={};function le(){}function G(){}function X(){}var de={};B(de,g,function(){return this});var Fe=Object.getPrototypeOf,me=Fe&&Fe(Fe(Se([])));me&&me!==l&&f.call(me,g)&&(de=me);var ae=X.prototype=le.prototype=Object.create(de);function Le(_){["next","throw","return"].forEach(function(x){B(_,x,function(w){return this._invoke(x,w)})})}function ye(_,x){function w(T,R,U,$){var W=C(_[T],_,R);if(W.type!=="throw"){var H=W.arg,V=H.value;return V&&t(V)=="object"&&f.call(V,"__await")?x.resolve(V.__await).then(function(Z){w("next",Z,U,$)},function(Z){w("throw",Z,U,$)}):x.resolve(V).then(function(Z){H.value=Z,U(H)},function(Z){return w("throw",Z,U,$)})}$(W.arg)}var A;u(this,"_invoke",{value:function(R,U){function $(){return new x(function(W,H){w(R,U,W,H)})}return A=A?A.then($,$):$()}})}function ot(_,x,w){var A=F;return function(T,R){if(A===N)throw new Error("Generator is already running");if(A===J){if(T==="throw")throw R;return{value:o,done:!0}}for(w.method=T,w.arg=R;;){var U=w.delegate;if(U){var $=Be(U,w);if($){if($===L)continue;return $}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(A===F)throw A=J,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);A=N;var W=C(_,x,w);if(W.type==="normal"){if(A=w.done?J:D,W.arg===L)continue;return{value:W.arg,done:w.done}}W.type==="throw"&&(A=J,w.method="throw",w.arg=W.arg)}}}function Be(_,x){var w=x.method,A=_.iterator[w];if(A===o)return x.delegate=null,w==="throw"&&_.iterator.return&&(x.method="return",x.arg=o,Be(_,x),x.method==="throw")||w!=="return"&&(x.method="throw",x.arg=new TypeError("The iterator does not provide a '"+w+"' method")),L;var T=C(A,_.iterator,x.arg);if(T.type==="throw")return x.method="throw",x.arg=T.arg,x.delegate=null,L;var R=T.arg;return R?R.done?(x[_.resultName]=R.value,x.next=_.nextLoc,x.method!=="return"&&(x.method="next",x.arg=o),x.delegate=null,L):R:(x.method="throw",x.arg=new TypeError("iterator result is not an object"),x.delegate=null,L)}function je(_){var x={tryLoc:_[0]};1 in _&&(x.catchLoc=_[1]),2 in _&&(x.finallyLoc=_[2],x.afterLoc=_[3]),this.tryEntries.push(x)}function Re(_){var x=_.completion||{};x.type="normal",delete x.arg,_.completion=x}function Te(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(je,this),this.reset(!0)}function Se(_){if(_||_===""){var x=_[g];if(x)return x.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var w=-1,A=function T(){for(;++w<_.length;)if(f.call(_,w))return T.value=_[w],T.done=!1,T;return T.value=o,T.done=!0,T};return A.next=A}}throw new TypeError(t(_)+" is not iterable")}return G.prototype=X,u(ae,"constructor",{value:X,configurable:!0}),u(X,"constructor",{value:G,configurable:!0}),G.displayName=B(X,d,"GeneratorFunction"),c.isGeneratorFunction=function(_){var x=typeof _=="function"&&_.constructor;return!!x&&(x===G||(x.displayName||x.name)==="GeneratorFunction")},c.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,X):(_.__proto__=X,B(_,d,"GeneratorFunction")),_.prototype=Object.create(ae),_},c.awrap=function(_){return{__await:_}},Le(ye.prototype),B(ye.prototype,b,function(){return this}),c.AsyncIterator=ye,c.async=function(_,x,w,A,T){T===void 0&&(T=Promise);var R=new ye(S(_,x,w,A),T);return c.isGeneratorFunction(x)?R:R.next().then(function(U){return U.done?U.value:R.next()})},Le(ae),B(ae,d,"Generator"),B(ae,g,function(){return this}),B(ae,"toString",function(){return"[object Generator]"}),c.keys=function(_){var x=Object(_),w=[];for(var A in x)w.push(A);return w.reverse(),function T(){for(;w.length;){var R=w.pop();if(R in x)return T.value=R,T.done=!1,T}return T.done=!0,T}},c.values=Se,Te.prototype={constructor:Te,reset:function(x){if(this.prev=0,this.next=0,this.sent=this._sent=o,this.done=!1,this.delegate=null,this.method="next",this.arg=o,this.tryEntries.forEach(Re),!x)for(var w in this)w.charAt(0)==="t"&&f.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=o)},stop:function(){this.done=!0;var x=this.tryEntries[0].completion;if(x.type==="throw")throw x.arg;return this.rval},dispatchException:function(x){if(this.done)throw x;var w=this;function A(H,V){return U.type="throw",U.arg=x,w.next=H,V&&(w.method="next",w.arg=o),!!V}for(var T=this.tryEntries.length-1;T>=0;--T){var R=this.tryEntries[T],U=R.completion;if(R.tryLoc==="root")return A("end");if(R.tryLoc<=this.prev){var $=f.call(R,"catchLoc"),W=f.call(R,"finallyLoc");if($&&W){if(this.prev<R.catchLoc)return A(R.catchLoc,!0);if(this.prev<R.finallyLoc)return A(R.finallyLoc)}else if($){if(this.prev<R.catchLoc)return A(R.catchLoc,!0)}else{if(!W)throw new Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return A(R.finallyLoc)}}}},abrupt:function(x,w){for(var A=this.tryEntries.length-1;A>=0;--A){var T=this.tryEntries[A];if(T.tryLoc<=this.prev&&f.call(T,"finallyLoc")&&this.prev<T.finallyLoc){var R=T;break}}R&&(x==="break"||x==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var U=R?R.completion:{};return U.type=x,U.arg=w,R?(this.method="next",this.next=R.finallyLoc,L):this.complete(U)},complete:function(x,w){if(x.type==="throw")throw x.arg;return x.type==="break"||x.type==="continue"?this.next=x.arg:x.type==="return"?(this.rval=this.arg=x.arg,this.method="return",this.next="end"):x.type==="normal"&&w&&(this.next=w),L},finish:function(x){for(var w=this.tryEntries.length-1;w>=0;--w){var A=this.tryEntries[w];if(A.finallyLoc===x)return this.complete(A.completion,A.afterLoc),Re(A),L}},catch:function(x){for(var w=this.tryEntries.length-1;w>=0;--w){var A=this.tryEntries[w];if(A.tryLoc===x){var T=A.completion;if(T.type==="throw"){var R=T.arg;Re(A)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(x,w,A){return this.delegate={iterator:Se(x),resultName:w,nextLoc:A},this.method==="next"&&(this.arg=o),L}},c}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}(yt)),yt.exports}var bt,cr;function Li(){if(cr)return bt;cr=1;var e=ki()();bt=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return bt}var wt={exports:{}},ur;function ji(){return ur||(ur=1,function(e){function t(o,c,l,f,u,E,g){try{var b=o[E](g),d=b.value}catch(B){l(B);return}b.done?c(d):Promise.resolve(d).then(f,u)}function i(o){return function(){var c=this,l=arguments;return new Promise(function(f,u){var E=o.apply(c,l);function g(d){t(E,f,u,g,b,"next",d)}function b(d){t(E,f,u,g,b,"throw",d)}g(void 0)})}}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}(wt)),wt.exports}var xt={exports:{}},gt={exports:{}},_t={exports:{}},fr;function Mi(){return fr||(fr=1,function(e){var t=rt().default;function i(o,c){if(t(o)!="object"||!o)return o;var l=o[Symbol.toPrimitive];if(l!==void 0){var f=l.call(o,c||"default");if(t(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(o)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}(_t)),_t.exports}var lr;function qi(){return lr||(lr=1,function(e){var t=rt().default,i=Mi();function o(c){var l=i(c,"string");return t(l)=="symbol"?l:String(l)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}(gt)),gt.exports}var pr;function $i(){return pr||(pr=1,function(e){var t=qi();function i(o,c,l){return c=t(c),c in o?Object.defineProperty(o,c,{value:l,enumerable:!0,configurable:!0,writable:!0}):o[c]=l,o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}(xt)),xt.exports}var Ct,hr;function Wi(){if(hr)return Ct;hr=1;const e=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);return Ct=t=>!e.has(t&&t.code),Ct}var ke=Ui;Object.defineProperty(z,"__esModule",{value:!0});z.isNetworkError=Jt;z.isRetryableError=nt;z.isSafeRequestError=Hr;z.isIdempotentRequestError=Ht;z.isNetworkOrIdempotentRequestError=zt;z.exponentialDelay=zr;z.default=he;z.DEFAULT_OPTIONS=z.namespace=void 0;var He=ke(Li()),Ji=ke(rt()),Wr=ke(ji()),Hi=ke($i()),zi=ke(Wi());function dr(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),i.push.apply(i,o)}return i}function At(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?dr(Object(i),!0).forEach(function(o){(0,Hi.default)(e,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dr(Object(i)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(i,o))})}return e}var Wt="axios-retry";z.namespace=Wt;function Jt(e){var t=["ERR_CANCELED","ECONNABORTED"];return!e.response&&!!e.code&&!t.includes(e.code)&&(0,zi.default)(e)}var Jr=["get","head","options"],Gi=Jr.concat(["put","delete"]);function nt(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status>=500&&e.response.status<=599)}function Hr(e){return e.config?nt(e)&&Jr.indexOf(e.config.method)!==-1:!1}function Ht(e){return e.config?nt(e)&&Gi.indexOf(e.config.method)!==-1:!1}function zt(e){return Jt(e)||Ht(e)}function Vi(){return 0}function zr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:100,i=Math.pow(2,e)*t,o=i*.2*Math.random();return i+o}var Gr={retries:3,retryCondition:zt,retryDelay:Vi,shouldResetTimeout:!1,onRetry:function(){}};z.DEFAULT_OPTIONS=Gr;function Ki(e,t){return At(At(At({},Gr),t),e[Wt])}function mr(e,t){var i=Ki(e,t);return i.retryCount=i.retryCount||0,e[Wt]=i,i}function Yi(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}function Xi(e,t){return Pt.apply(this,arguments)}function Pt(){return Pt=(0,Wr.default)(He.default.mark(function e(t,i){var o,c,l,f;return He.default.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(o=t.retries,c=t.retryCondition,l=t.retryCount<o&&c(i),(0,Ji.default)(l)!=="object"){E.next=13;break}return E.prev=3,E.next=6,l;case 6:return f=E.sent,E.abrupt("return",f!==!1);case 10:return E.prev=10,E.t0=E.catch(3),E.abrupt("return",!1);case 13:return E.abrupt("return",l);case 14:case"end":return E.stop()}},e,null,[[3,10]])})),Pt.apply(this,arguments)}function he(e,t){var i=e.interceptors.request.use(function(c){var l=mr(c,t);return l.lastRequestTime=Date.now(),c}),o=e.interceptors.response.use(null,function(){var c=(0,Wr.default)(He.default.mark(function l(f){var u,E,g,b,d,B,S,C;return He.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(u=f.config,u){D.next=3;break}return D.abrupt("return",Promise.reject(f));case 3:return E=mr(u,t),D.next=6,Xi(E,f);case 6:if(!D.sent){D.next=21;break}if(E.retryCount+=1,g=E.retryDelay,b=E.shouldResetTimeout,d=E.onRetry,B=g(E.retryCount,f),Yi(e,u),!(!b&&u.timeout&&E.lastRequestTime)){D.next=17;break}if(S=Date.now()-E.lastRequestTime,C=u.timeout-S-B,!(C<=0)){D.next=16;break}return D.abrupt("return",Promise.reject(f));case 16:u.timeout=C;case 17:return u.transformRequest=[function(N){return N}],D.next=20,d(E.retryCount,f,u);case 20:return D.abrupt("return",new Promise(function(N){return setTimeout(function(){return N(e(u))},B)}));case 21:return D.abrupt("return",Promise.reject(f));case 22:case"end":return D.stop()}},l)}));return function(l){return c.apply(this,arguments)}}());return{requestInterceptorId:i,responseInterceptorId:o}}he.isNetworkError=Jt;he.isSafeRequestError=Hr;he.isIdempotentRequestError=Ht;he.isNetworkOrIdempotentRequestError=zt;he.exponentialDelay=zr;he.isRetryableError=nt;const Vr=z.default;$t.exports=Vr;$t.exports.default=Vr;var Zi=$t.exports,it={},we=null;typeof WebSocket<"u"?we=WebSocket:typeof MozWebSocket<"u"?we=MozWebSocket:typeof fe.commonjsGlobal<"u"?we=fe.commonjsGlobal.WebSocket||fe.commonjsGlobal.MozWebSocket:typeof window<"u"?we=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(we=self.WebSocket||self.MozWebSocket);var Qi=we,eo=fe.commonjsGlobal&&fe.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(it,"__esModule",{value:!0});it.ResilientWebSocket=void 0;const to=eo(Qi),ro=3e4+3e3;class no{constructor(t,i){I(this,"endpoint");I(this,"wsClient");I(this,"wsUserClosed");I(this,"wsFailedAttempts");I(this,"pingTimeout");I(this,"logger");I(this,"onError");I(this,"onMessage");I(this,"onReconnect");this.endpoint=t,this.logger=i,this.wsFailedAttempts=0,this.onError=o=>{var c;(c=this.logger)==null||c.error(o)},this.wsUserClosed=!0,this.onMessage=()=>{},this.onReconnect=()=>{}}async send(t){var i,o,c;(i=this.logger)==null||i.info(`Sending ${t}`),await this.waitForMaybeReadyWebSocket(),this.wsClient===void 0?(o=this.logger)==null||o.error("Couldn't connect to the websocket server. Error callback is called."):(c=this.wsClient)==null||c.send(t)}async startWebSocket(){var t;this.wsClient===void 0&&((t=this.logger)==null||t.info("Creating Web Socket client"),this.wsClient=new to.default(this.endpoint),this.wsUserClosed=!1,this.wsClient.onopen=()=>{this.wsFailedAttempts=0,this.wsClient.on!==void 0&&this.heartbeat()},this.wsClient.onerror=i=>{this.onError(i.error)},this.wsClient.onmessage=i=>{this.onMessage(i.data)},this.wsClient.onclose=async()=>{var i,o;if(this.pingTimeout!==void 0&&clearInterval(this.pingTimeout),this.wsUserClosed===!1){this.wsFailedAttempts+=1,this.wsClient=void 0;const c=io(this.wsFailedAttempts);(i=this.logger)==null||i.error(`Connection closed unexpectedly or because of timeout. Reconnecting after ${c}ms.`),await yr(c),this.restartUnexpectedClosedWebsocket()}else(o=this.logger)==null||o.info("The connection has been closed successfully.")},this.wsClient.on!==void 0&&this.wsClient.on("ping",this.heartbeat.bind(this)))}heartbeat(){var t;(t=this.logger)==null||t.info("Heartbeat"),this.pingTimeout!==void 0&&clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var i,o;(i=this.logger)==null||i.warn("Connection timed out. Reconnecting..."),(o=this.wsClient)==null||o.terminate(),this.restartUnexpectedClosedWebsocket()},ro)}async waitForMaybeReadyWebSocket(){let t=0;for(;this.wsClient!==void 0&&this.wsClient.readyState!==this.wsClient.OPEN;)if(t>5e3){this.wsClient.close();return}else t+=10,await yr(10)}async restartUnexpectedClosedWebsocket(){var t;if(this.wsUserClosed!==!0){if(await this.startWebSocket(),await this.waitForMaybeReadyWebSocket(),this.wsClient===void 0){(t=this.logger)==null||t.error("Couldn't reconnect to websocket. Error callback is called.");return}this.onReconnect()}}closeWebSocket(){if(this.wsClient!==void 0){const t=this.wsClient;this.wsClient=void 0,t.close()}this.wsUserClosed=!0}}it.ResilientWebSocket=no;async function yr(e){return new Promise(t=>setTimeout(t,e))}function io(e){return 2**e*100}var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.removeLeading0xIfExists=Ce.makeWebsocketUrl=void 0;function oo(e){const t=new URL("ws",e),i=t.protocol==="https:";return t.protocol=i?"wss:":"ws:",t.toString()}Ce.makeWebsocketUrl=oo;function so(e){return e.startsWith("0x")?e.substring(2):e}Ce.removeLeading0xIfExists=so;var Kr=fe.commonjsGlobal&&fe.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.PriceServiceConnection=void 0;const Ft=oe,ao=Kr(Ni),Er=Kr(Zi),co=it,Bt=Ce;class uo{constructor(t,i){I(this,"httpClient");I(this,"priceFeedCallbacks");I(this,"wsClient");I(this,"wsEndpoint");I(this,"logger");I(this,"priceFeedRequestConfig");I(this,"onWsError");var o,c,l;this.httpClient=ao.default.create({baseURL:t,timeout:(i==null?void 0:i.timeout)||5e3}),(0,Er.default)(this.httpClient,{retries:(i==null?void 0:i.httpRetries)||3,retryDelay:Er.default.exponentialDelay}),this.priceFeedRequestConfig={binary:(o=i==null?void 0:i.priceFeedRequestConfig)==null?void 0:o.binary,verbose:((c=i==null?void 0:i.priceFeedRequestConfig)==null?void 0:c.verbose)??(i==null?void 0:i.verbose),allowOutOfOrder:(l=i==null?void 0:i.priceFeedRequestConfig)==null?void 0:l.allowOutOfOrder},this.priceFeedCallbacks=new Map,this.logger=(i==null?void 0:i.logger)||{trace:()=>{},debug:()=>{},info:()=>{},warn:console.warn,error:console.error},this.onWsError=f=>{this.logger.error(f),typeof process<"u"&&typeof process.exit=="function"?(this.logger.error("Halting the process due to the websocket error"),process.exit(1)):this.logger.error("Cannot halt process. Please handle the websocket error.")},this.wsEndpoint=(0,Bt.makeWebsocketUrl)(t)}async getLatestPriceFeeds(t){return t.length===0?[]:(await this.httpClient.get("/api/latest_price_feeds",{params:{ids:t,verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary}})).data.map(c=>Ft.PriceFeed.fromJson(c))}async getLatestVaas(t){return(await this.httpClient.get("/api/latest_vaas",{params:{ids:t}})).data}async getVaa(t,i){const o=await this.httpClient.get("/api/get_vaa",{params:{id:t,publish_time:i}});return[o.data.vaa,o.data.publishTime]}async getPriceFeed(t,i){const o=await this.httpClient.get("/api/get_price_feed",{params:{id:t,publish_time:i,verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary}});return Ft.PriceFeed.fromJson(o.data)}async getPriceFeedIds(){return(await this.httpClient.get("/api/price_feed_ids")).data}async subscribePriceFeedUpdates(t,i){var l;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(f=>(0,Bt.removeLeading0xIfExists)(f));const o=[];for(const f of t)this.priceFeedCallbacks.has(f)||(this.priceFeedCallbacks.set(f,new Set),o.push(f)),this.priceFeedCallbacks.get(f).add(i);const c={ids:o,type:"subscribe",verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary,allow_out_of_order:this.priceFeedRequestConfig.allowOutOfOrder};await((l=this.wsClient)==null?void 0:l.send(JSON.stringify(c)))}async unsubscribePriceFeedUpdates(t,i){var l;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(f=>(0,Bt.removeLeading0xIfExists)(f));const o=[];for(const f of t)if(this.priceFeedCallbacks.has(f)){let u=!1;i===void 0?(this.priceFeedCallbacks.delete(f),u=!0):(this.priceFeedCallbacks.get(f).delete(i),this.priceFeedCallbacks.get(f).size===0&&(this.priceFeedCallbacks.delete(f),u=!0)),u&&o.push(f)}const c={ids:o,type:"unsubscribe"};await((l=this.wsClient)==null?void 0:l.send(JSON.stringify(c))),this.priceFeedCallbacks.size===0&&this.closeWebSocket()}async startWebSocket(){if(this.wsEndpoint===void 0)throw new Error("Websocket endpoint is undefined.");this.wsClient=new co.ResilientWebSocket(this.wsEndpoint,this.logger),this.wsClient.onError=this.onWsError,this.wsClient.onReconnect=()=>{var t;if(this.priceFeedCallbacks.size>0){const i={ids:Array.from(this.priceFeedCallbacks.keys()),type:"subscribe",verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary,allow_out_of_order:this.priceFeedRequestConfig.allowOutOfOrder};this.logger.info("Resubscribing to existing price feeds."),(t=this.wsClient)==null||t.send(JSON.stringify(i))}},this.wsClient.onMessage=t=>{this.logger.info(`Received message ${t.toString()}`);let i;try{i=JSON.parse(t.toString())}catch(o){this.logger.error(`Error parsing message ${t.toString()} as JSON.`),this.logger.error(o),this.onWsError(o);return}if(i.type==="response")i.status==="error"&&(this.logger.error(`Error response from the websocket server ${i.error}.`),this.onWsError(new Error(i.error)));else if(i.type==="price_update"){let o;try{o=Ft.PriceFeed.fromJson(i.price_feed)}catch(c){this.logger.error(`Error parsing price feeds from message ${t.toString()}.`),this.logger.error(c),this.onWsError(c);return}if(this.priceFeedCallbacks.has(o.id))for(const c of this.priceFeedCallbacks.get(o.id))c(o)}else this.logger.warn(`Ignoring unsupported server response ${t.toString()}.`)},await this.wsClient.startWebSocket()}closeWebSocket(){var t;(t=this.wsClient)==null||t.closeWebSocket(),this.wsClient=void 0,this.priceFeedCallbacks.clear()}}Ve.PriceServiceConnection=uo;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Price=e.PriceFeed=e.PriceFeedMetadata=e.PriceServiceConnection=void 0;var t=Ve;Object.defineProperty(e,"PriceServiceConnection",{enumerable:!0,get:function(){return t.PriceServiceConnection}});var i=oe;Object.defineProperty(e,"PriceFeedMetadata",{enumerable:!0,get:function(){return i.PriceFeedMetadata}}),Object.defineProperty(e,"PriceFeed",{enumerable:!0,get:function(){return i.PriceFeed}}),Object.defineProperty(e,"Price",{enumerable:!0,get:function(){return i.Price}})})(vt);Object.defineProperty(Ge,"__esModule",{value:!0});Ge.EvmPriceServiceConnection=void 0;const fo=vt,lo=br;class po extends fo.PriceServiceConnection{async getPriceFeedsUpdateData(t){return(await this.getLatestVaas(t)).map(o=>"0x"+lo.Buffer.from(o,"base64").toString("hex"))}}Ge.EvmPriceServiceConnection=po;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CONTRACT_ADDR=e.PriceFeed=e.Price=e.EvmPriceServiceConnection=void 0;var t=Ge;Object.defineProperty(e,"EvmPriceServiceConnection",{enumerable:!0,get:function(){return t.EvmPriceServiceConnection}});var i=vt;Object.defineProperty(e,"Price",{enumerable:!0,get:function(){return i.Price}}),Object.defineProperty(e,"PriceFeed",{enumerable:!0,get:function(){return i.PriceFeed}}),e.CONTRACT_ADDR={arbitrum:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",astar_zkevm:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",aurora:"0xF89C7b475821EC3fDC2dC8099032c05c6c0c9AB9",avalanche:"0x4305FB66699C3B2702D4d05CF36551390A4c69C6",blast:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",bnb:"0x4D7E825f80bDf85e913E0DD2A2D54927e9dE1594",base:"0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a",boba:"0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",bttc:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",canto:"0x98046Bd286715D3B0BC227Dd7a956b83D8978603",celo:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",chiliz:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",conflux_espace:"0xe9d69CdD6Fe41e7B621B4A688C5D1a68cB5c8ADc",core_dao:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",cronos:"0xE0d0e68297772Dd5a1f1D99897c581E2082dbA5B",eos:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",evmos:"0x354bF866A4B006C9AF9d9e06d9364217A8616E12",ethereum:"0x4305FB66699C3B2702D4d05CF36551390A4c69C6",fantom:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",filecoin:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",gnosis:"0x2880aB155794e7179c9eE2e38200202908C17B43",hedera:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",horizen_eon:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",injective_inevm:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",kava:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",lightlink:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",linea:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",manta:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",mantle:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",merlin:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",meter:"0xbFe3f445653f2136b2FD1e6DdDb5676392E3AF16",mode:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",neon:"0x7f2dB085eFC3560AFF33865dD727225d91B4f9A5",optimism:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",polygon:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",polygon_zkevm:"0xC5E56d6b40F3e3B5fbfa266bCd35C37426537c65",ronin:"0x2880aB155794e7179c9eE2e38200202908C17B43",scroll:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",shimmer:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",viction:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",wemix:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",zetachain:"0x2880aB155794e7179c9eE2e38200202908C17B43",zkfair:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",zksync_era:"0xf087c864AEccFb6A2Bf1Af6A0382B0d0f6c5D834",arbitrum_sepolia:"0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",astar_zkevm_testnet:"0x8D254a21b3C86D32F7179855531CE99164721933",aurora_testnet:"0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",bnb_testnet:"0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",base_sepolia:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",berachain_testnet:"0x8D254a21b3C86D32F7179855531CE99164721933",blast_s2_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",boba_goerli:"0x8D254a21b3C86D32F7179855531CE99164721933",bttc_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",cant_testnet:"0x26DD80569a8B23768A1d80869Ed7339e07595E85",celo_alfajores:"0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",chiado:"0x98046Bd286715D3B0BC227Dd7a956b83D8978603",chiliz_testnet:"0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",conflux_espace_testnet:"0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",core_dao_testnet:"0x8D254a21b3C86D32F7179855531CE99164721933",cronos_testnet:"0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",dela_deperp_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",eos_testnet:"0x0708325268dF9F66270F1401206434524814508b",evmos_testnet:"0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",fantom_sonic_testnet:"0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",fantom_testnet:"0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",filecoin_calibration:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",fuji:"0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",hedera_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",idex_xchain_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",injective_inevm_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",kcc_testnet:"0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",kava_testnet:"0xfA25E653b44586dBbe27eE9d252192F0e4956683",lightlink_pegasus_testnet:"0x5D289Ad1CE59fCC25b6892e7A303dfFf3a9f7167",linea_goerli:"0xdF21D137Aadc95588205586636710ca2890538d5",manta_testnet:"0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c",manta_sepolia:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",mantle_sepolia:"0x98046Bd286715D3B0BC227Dd7a956b83D8978603",merlin_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",meter_testnet:"0x5a71C07a0588074443545eE0c08fb0375564c3E4",mode_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",movement_evm_devnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",mumbai:"0xFC6bd9F9f0c6481c6Af3A7Eb46b296A5B85ed379",neon_devnet:"0x0708325268dF9F66270F1401206434524814508b",optimism_goerli:"0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",optimism_sepolia:"0x0708325268dF9F66270F1401206434524814508b",polygon_zkevm_testnet:"0xFf255f800044225f54Af4510332Aa3D67CC77635",saigon:"0xEbe57e8045F2F230872523bbff7374986E45C486",sei_evm_devnet:"0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",scroll_sepolia:"0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c",sepolia:"0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",shimmer_testnet:"0x8D254a21b3C86D32F7179855531CE99164721933",viction_testnet:"0x5D289Ad1CE59fCC25b6892e7A303dfFf3a9f7167",wemix_testnet:"0x26DD80569a8B23768A1d80869Ed7339e07595E85",zetachain_testnet:"0x0708325268dF9F66270F1401206434524814508b",zkfair_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",zksync_era_goerli:"0x8739d5024B5143278E2b15Bd9e7C26f6CEc658F1",zksync_era_sepolia:"0x056f829183Ec806A78c26C98961678c24faB71af",horizen_gobi_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729"}})(xr);class ho{constructor(t){this.connection=new xr.EvmPriceServiceConnection(t)}getOracleId(){return"PYTH"}async fetchOffchainData(t,i,o){const[c]=Oe.decodeAbiParameters([{name:"updateType",type:"uint8"}],o);if(c===1){const[l,f,u]=Oe.decodeAbiParameters([{name:"updateType",type:"uint8"},{name:"stalenessTolerance",type:"uint64"},{name:"priceIds",type:"bytes32[]"}],o),E=f,g=await this.connection.getPriceFeedsUpdateData(u);return Oe.encodeAbiParameters([{type:"uint8",name:"updateType"},{type:"uint64",name:"stalenessTolerance"},{type:"bytes32[]",name:"priceIds"},{type:"bytes[]",name:"updateData"}],[l,E,u,g])}else if(c===2){const[l,f,u]=Oe.decodeAbiParameters([{name:"updateType",type:"uint8"},{name:"requestedTime",type:"uint64"},{name:"priceIds",type:"bytes32"}],o),[E]=await this.connection.getVaa(u,Number(f.toString())),g="0x"+Buffer.from(E,"base64").toString("hex");return Oe.encodeAbiParameters([{type:"uint8",name:"updateType"},{type:"uint64",name:"timestamp"},{type:"bytes32[]",name:"priceIds"},{type:"bytes[]",name:"updateData"}],[l,f,[u],[g]])}else throw new Error(`update type ${c} not supported`)}}exports.PythAdapter=ho;
|
|
10
|
+
`):" "+rr(l[0]):"as no adapter specified";throw new O("There is no suitable adapter to dispatch the request "+f,"ERR_NOT_SUPPORT")}return o},adapters:St};function mt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ue(null,e)}function nr(e){return mt(e),e.headers=se.from(e.headers),e.data=dt.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),jr.getAdapter(e.adapter||jt.adapter)(e).then(function(o){return mt(e),o.data=dt.call(e,e.transformResponse,o),o.headers=se.from(o.headers),o},function(o){return kr(o)||(mt(e),o&&o.response&&(o.response.data=dt.call(e,e.transformResponse,o.response),o.response.headers=se.from(o.response.headers))),Promise.reject(o)})}const ir=e=>e instanceof se?e.toJSON():e;function _e(e,t){t=t||{};const i={};function o(g,b,d){return y.isPlainObject(g)&&y.isPlainObject(b)?y.merge.call({caseless:d},g,b):y.isPlainObject(b)?y.merge({},b):y.isArray(b)?b.slice():b}function c(g,b,d){if(y.isUndefined(b)){if(!y.isUndefined(g))return o(void 0,g,d)}else return o(g,b,d)}function l(g,b){if(!y.isUndefined(b))return o(void 0,b)}function f(g,b){if(y.isUndefined(b)){if(!y.isUndefined(g))return o(void 0,g)}else return o(void 0,b)}function u(g,b,d){if(d in t)return o(g,b);if(d in e)return o(void 0,g)}const E={url:l,method:l,data:l,baseURL:f,transformRequest:f,transformResponse:f,paramsSerializer:f,timeout:f,timeoutMessage:f,withCredentials:f,withXSRFToken:f,adapter:f,responseType:f,xsrfCookieName:f,xsrfHeaderName:f,onUploadProgress:f,onDownloadProgress:f,decompress:f,maxContentLength:f,maxBodyLength:f,beforeRedirect:f,transport:f,httpAgent:f,httpsAgent:f,cancelToken:f,socketPath:f,responseEncoding:f,validateStatus:u,headers:(g,b)=>c(ir(g),ir(b),!0)};return y.forEach(Object.keys(Object.assign({},e,t)),function(b){const d=E[b]||c,B=d(e[b],t[b],b);y.isUndefined(B)&&d!==u||(i[b]=B)}),i}const Mr="1.6.7",Mt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Mt[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const or={};Mt.transitional=function(t,i,o){function c(l,f){return"[Axios v"+Mr+"] Transitional option '"+l+"'"+f+(o?". "+o:"")}return(l,f,u)=>{if(t===!1)throw new O(c(f," has been removed"+(i?" in "+i:"")),O.ERR_DEPRECATED);return i&&!or[f]&&(or[f]=!0,console.warn(c(f," has been deprecated since v"+i+" and will be removed in the near future"))),t?t(l,f,u):!0}};function Di(e,t,i){if(typeof e!="object")throw new O("options must be an object",O.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let c=o.length;for(;c-- >0;){const l=o[c],f=t[l];if(f){const u=e[l],E=u===void 0||f(u,l,e);if(E!==!0)throw new O("option "+l+" must be "+E,O.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new O("Unknown option "+l,O.ERR_BAD_OPTION)}}var Dt={assertOptions:Di,validators:Mt};const ue=Dt.validators;class Je{constructor(t){this.defaults=t,this.interceptors={request:new Qt,response:new Qt}}async request(t,i){try{return await this._request(t,i)}catch(o){if(o instanceof Error){let c;Error.captureStackTrace?Error.captureStackTrace(c={}):c=new Error;const l=c.stack?c.stack.replace(/^.+\n/,""):"";o.stack?l&&!String(o.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(o.stack+=`
|
|
11
|
+
`+l):o.stack=l}throw o}}_request(t,i){typeof t=="string"?(i=i||{},i.url=t):i=t||{},i=_e(this.defaults,i);const{transitional:o,paramsSerializer:c,headers:l}=i;o!==void 0&&Dt.assertOptions(o,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean)},!1),c!=null&&(y.isFunction(c)?i.paramsSerializer={serialize:c}:Dt.assertOptions(c,{encode:ue.function,serialize:ue.function},!0)),i.method=(i.method||this.defaults.method||"get").toLowerCase();let f=l&&y.merge(l.common,l[i.method]);l&&y.forEach(["delete","get","head","post","put","patch","common"],C=>{delete l[C]}),i.headers=se.concat(f,l);const u=[];let E=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(i)===!1||(E=E&&F.synchronous,u.unshift(F.fulfilled,F.rejected))});const g=[];this.interceptors.response.forEach(function(F){g.push(F.fulfilled,F.rejected)});let b,d=0,B;if(!E){const C=[nr.bind(this),void 0];for(C.unshift.apply(C,u),C.push.apply(C,g),B=C.length,b=Promise.resolve(i);d<B;)b=b.then(C[d++],C[d++]);return b}B=u.length;let S=i;for(d=0;d<B;){const C=u[d++],F=u[d++];try{S=C(S)}catch(D){F.call(this,D);break}}try{b=nr.call(this,S)}catch(C){return Promise.reject(C)}for(d=0,B=g.length;d<B;)b=b.then(g[d++],g[d++]);return b}getUri(t){t=_e(this.defaults,t);const i=Lr(t.baseURL,t.url);return Ir(i,t.params,t.paramsSerializer)}}y.forEach(["delete","get","head","options"],function(t){Je.prototype[t]=function(i,o){return this.request(_e(o||{},{method:t,url:i,data:(o||{}).data}))}});y.forEach(["post","put","patch"],function(t){function i(o){return function(l,f,u){return this.request(_e(u||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:l,data:f}))}}Je.prototype[t]=i(),Je.prototype[t+"Form"]=i(!0)});var We=Je;class qt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(l){i=l});const o=this;this.promise.then(c=>{if(!o._listeners)return;let l=o._listeners.length;for(;l-- >0;)o._listeners[l](c);o._listeners=null}),this.promise.then=c=>{let l;const f=new Promise(u=>{o.subscribe(u),l=u}).then(c);return f.cancel=function(){o.unsubscribe(l)},f},t(function(l,f,u){o.reason||(o.reason=new Ue(l,f,u),i(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const i=this._listeners.indexOf(t);i!==-1&&this._listeners.splice(i,1)}static source(){let t;return{token:new qt(function(c){t=c}),cancel:t}}}var Pi=qt;function Oi(e){return function(i){return e.apply(null,i)}}function Ii(e){return y.isObject(e)&&e.isAxiosError===!0}const Pt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pt).forEach(([e,t])=>{Pt[t]=e});var vi=Pt;function qr(e){const t=new We(e),i=gr(We.prototype.request,t);return y.extend(i,We.prototype,t,{allOwnKeys:!0}),y.extend(i,t,null,{allOwnKeys:!0}),i.create=function(c){return qr(_e(e,c))},i}const q=qr(jt);q.Axios=We;q.CanceledError=Ue;q.CancelToken=Pi;q.isCancel=kr;q.VERSION=Mr;q.toFormData=et;q.AxiosError=O;q.Cancel=q.CanceledError;q.all=function(t){return Promise.all(t)};q.spread=Oi;q.isAxiosError=Ii;q.mergeConfig=_e;q.AxiosHeaders=se;q.formToJSON=e=>Ur(y.isHTMLForm(e)?new FormData(e):e);q.getAdapter=jr.getAdapter;q.HttpStatusCode=vi;q.default=q;var Ni=q,$t={exports:{}},z={},$r={exports:{}};(function(e){function t(i){return i&&i.__esModule?i:{default:i}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})($r);var Ui=$r.exports,yt={exports:{}},Et={exports:{}},sr;function rt(){return sr||(sr=1,function(e){function t(i){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},e.exports.__esModule=!0,e.exports.default=e.exports,t(i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Et)),Et.exports}var ar;function ki(){return ar||(ar=1,function(e){var t=rt().default;function i(){e.exports=i=function(){return c},e.exports.__esModule=!0,e.exports.default=e.exports;var o,c={},l=Object.prototype,f=l.hasOwnProperty,u=Object.defineProperty||function(_,x,w){_[x]=w.value},E=typeof Symbol=="function"?Symbol:{},g=E.iterator||"@@iterator",b=E.asyncIterator||"@@asyncIterator",d=E.toStringTag||"@@toStringTag";function B(_,x,w){return Object.defineProperty(_,x,{value:w,enumerable:!0,configurable:!0,writable:!0}),_[x]}try{B({},"")}catch{B=function(w,A,T){return w[A]=T}}function S(_,x,w,A){var T=x&&x.prototype instanceof le?x:le,R=Object.create(T.prototype),U=new Te(A||[]);return u(R,"_invoke",{value:ot(_,w,U)}),R}function C(_,x,w){try{return{type:"normal",arg:_.call(x,w)}}catch(A){return{type:"throw",arg:A}}}c.wrap=S;var F="suspendedStart",D="suspendedYield",N="executing",J="completed",L={};function le(){}function G(){}function X(){}var de={};B(de,g,function(){return this});var Fe=Object.getPrototypeOf,me=Fe&&Fe(Fe(Se([])));me&&me!==l&&f.call(me,g)&&(de=me);var ae=X.prototype=le.prototype=Object.create(de);function Le(_){["next","throw","return"].forEach(function(x){B(_,x,function(w){return this._invoke(x,w)})})}function ye(_,x){function w(T,R,U,$){var W=C(_[T],_,R);if(W.type!=="throw"){var H=W.arg,V=H.value;return V&&t(V)=="object"&&f.call(V,"__await")?x.resolve(V.__await).then(function(Z){w("next",Z,U,$)},function(Z){w("throw",Z,U,$)}):x.resolve(V).then(function(Z){H.value=Z,U(H)},function(Z){return w("throw",Z,U,$)})}$(W.arg)}var A;u(this,"_invoke",{value:function(R,U){function $(){return new x(function(W,H){w(R,U,W,H)})}return A=A?A.then($,$):$()}})}function ot(_,x,w){var A=F;return function(T,R){if(A===N)throw new Error("Generator is already running");if(A===J){if(T==="throw")throw R;return{value:o,done:!0}}for(w.method=T,w.arg=R;;){var U=w.delegate;if(U){var $=Be(U,w);if($){if($===L)continue;return $}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(A===F)throw A=J,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);A=N;var W=C(_,x,w);if(W.type==="normal"){if(A=w.done?J:D,W.arg===L)continue;return{value:W.arg,done:w.done}}W.type==="throw"&&(A=J,w.method="throw",w.arg=W.arg)}}}function Be(_,x){var w=x.method,A=_.iterator[w];if(A===o)return x.delegate=null,w==="throw"&&_.iterator.return&&(x.method="return",x.arg=o,Be(_,x),x.method==="throw")||w!=="return"&&(x.method="throw",x.arg=new TypeError("The iterator does not provide a '"+w+"' method")),L;var T=C(A,_.iterator,x.arg);if(T.type==="throw")return x.method="throw",x.arg=T.arg,x.delegate=null,L;var R=T.arg;return R?R.done?(x[_.resultName]=R.value,x.next=_.nextLoc,x.method!=="return"&&(x.method="next",x.arg=o),x.delegate=null,L):R:(x.method="throw",x.arg=new TypeError("iterator result is not an object"),x.delegate=null,L)}function je(_){var x={tryLoc:_[0]};1 in _&&(x.catchLoc=_[1]),2 in _&&(x.finallyLoc=_[2],x.afterLoc=_[3]),this.tryEntries.push(x)}function Re(_){var x=_.completion||{};x.type="normal",delete x.arg,_.completion=x}function Te(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(je,this),this.reset(!0)}function Se(_){if(_||_===""){var x=_[g];if(x)return x.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var w=-1,A=function T(){for(;++w<_.length;)if(f.call(_,w))return T.value=_[w],T.done=!1,T;return T.value=o,T.done=!0,T};return A.next=A}}throw new TypeError(t(_)+" is not iterable")}return G.prototype=X,u(ae,"constructor",{value:X,configurable:!0}),u(X,"constructor",{value:G,configurable:!0}),G.displayName=B(X,d,"GeneratorFunction"),c.isGeneratorFunction=function(_){var x=typeof _=="function"&&_.constructor;return!!x&&(x===G||(x.displayName||x.name)==="GeneratorFunction")},c.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,X):(_.__proto__=X,B(_,d,"GeneratorFunction")),_.prototype=Object.create(ae),_},c.awrap=function(_){return{__await:_}},Le(ye.prototype),B(ye.prototype,b,function(){return this}),c.AsyncIterator=ye,c.async=function(_,x,w,A,T){T===void 0&&(T=Promise);var R=new ye(S(_,x,w,A),T);return c.isGeneratorFunction(x)?R:R.next().then(function(U){return U.done?U.value:R.next()})},Le(ae),B(ae,d,"Generator"),B(ae,g,function(){return this}),B(ae,"toString",function(){return"[object Generator]"}),c.keys=function(_){var x=Object(_),w=[];for(var A in x)w.push(A);return w.reverse(),function T(){for(;w.length;){var R=w.pop();if(R in x)return T.value=R,T.done=!1,T}return T.done=!0,T}},c.values=Se,Te.prototype={constructor:Te,reset:function(x){if(this.prev=0,this.next=0,this.sent=this._sent=o,this.done=!1,this.delegate=null,this.method="next",this.arg=o,this.tryEntries.forEach(Re),!x)for(var w in this)w.charAt(0)==="t"&&f.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=o)},stop:function(){this.done=!0;var x=this.tryEntries[0].completion;if(x.type==="throw")throw x.arg;return this.rval},dispatchException:function(x){if(this.done)throw x;var w=this;function A(H,V){return U.type="throw",U.arg=x,w.next=H,V&&(w.method="next",w.arg=o),!!V}for(var T=this.tryEntries.length-1;T>=0;--T){var R=this.tryEntries[T],U=R.completion;if(R.tryLoc==="root")return A("end");if(R.tryLoc<=this.prev){var $=f.call(R,"catchLoc"),W=f.call(R,"finallyLoc");if($&&W){if(this.prev<R.catchLoc)return A(R.catchLoc,!0);if(this.prev<R.finallyLoc)return A(R.finallyLoc)}else if($){if(this.prev<R.catchLoc)return A(R.catchLoc,!0)}else{if(!W)throw new Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return A(R.finallyLoc)}}}},abrupt:function(x,w){for(var A=this.tryEntries.length-1;A>=0;--A){var T=this.tryEntries[A];if(T.tryLoc<=this.prev&&f.call(T,"finallyLoc")&&this.prev<T.finallyLoc){var R=T;break}}R&&(x==="break"||x==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var U=R?R.completion:{};return U.type=x,U.arg=w,R?(this.method="next",this.next=R.finallyLoc,L):this.complete(U)},complete:function(x,w){if(x.type==="throw")throw x.arg;return x.type==="break"||x.type==="continue"?this.next=x.arg:x.type==="return"?(this.rval=this.arg=x.arg,this.method="return",this.next="end"):x.type==="normal"&&w&&(this.next=w),L},finish:function(x){for(var w=this.tryEntries.length-1;w>=0;--w){var A=this.tryEntries[w];if(A.finallyLoc===x)return this.complete(A.completion,A.afterLoc),Re(A),L}},catch:function(x){for(var w=this.tryEntries.length-1;w>=0;--w){var A=this.tryEntries[w];if(A.tryLoc===x){var T=A.completion;if(T.type==="throw"){var R=T.arg;Re(A)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(x,w,A){return this.delegate={iterator:Se(x),resultName:w,nextLoc:A},this.method==="next"&&(this.arg=o),L}},c}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}(yt)),yt.exports}var bt,cr;function Li(){if(cr)return bt;cr=1;var e=ki()();bt=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return bt}var wt={exports:{}},ur;function ji(){return ur||(ur=1,function(e){function t(o,c,l,f,u,E,g){try{var b=o[E](g),d=b.value}catch(B){l(B);return}b.done?c(d):Promise.resolve(d).then(f,u)}function i(o){return function(){var c=this,l=arguments;return new Promise(function(f,u){var E=o.apply(c,l);function g(d){t(E,f,u,g,b,"next",d)}function b(d){t(E,f,u,g,b,"throw",d)}g(void 0)})}}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}(wt)),wt.exports}var xt={exports:{}},gt={exports:{}},_t={exports:{}},fr;function Mi(){return fr||(fr=1,function(e){var t=rt().default;function i(o,c){if(t(o)!="object"||!o)return o;var l=o[Symbol.toPrimitive];if(l!==void 0){var f=l.call(o,c||"default");if(t(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(o)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}(_t)),_t.exports}var lr;function qi(){return lr||(lr=1,function(e){var t=rt().default,i=Mi();function o(c){var l=i(c,"string");return t(l)=="symbol"?l:String(l)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}(gt)),gt.exports}var pr;function $i(){return pr||(pr=1,function(e){var t=qi();function i(o,c,l){return c=t(c),c in o?Object.defineProperty(o,c,{value:l,enumerable:!0,configurable:!0,writable:!0}):o[c]=l,o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}(xt)),xt.exports}var Ct,hr;function Wi(){if(hr)return Ct;hr=1;const e=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);return Ct=t=>!e.has(t&&t.code),Ct}var ke=Ui;Object.defineProperty(z,"__esModule",{value:!0});z.isNetworkError=Jt;z.isRetryableError=nt;z.isSafeRequestError=Hr;z.isIdempotentRequestError=Ht;z.isNetworkOrIdempotentRequestError=zt;z.exponentialDelay=zr;z.default=he;z.DEFAULT_OPTIONS=z.namespace=void 0;var He=ke(Li()),Ji=ke(rt()),Wr=ke(ji()),Hi=ke($i()),zi=ke(Wi());function dr(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),i.push.apply(i,o)}return i}function At(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?dr(Object(i),!0).forEach(function(o){(0,Hi.default)(e,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dr(Object(i)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(i,o))})}return e}var Wt="axios-retry";z.namespace=Wt;function Jt(e){var t=["ERR_CANCELED","ECONNABORTED"];return!e.response&&!!e.code&&!t.includes(e.code)&&(0,zi.default)(e)}var Jr=["get","head","options"],Gi=Jr.concat(["put","delete"]);function nt(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status>=500&&e.response.status<=599)}function Hr(e){return e.config?nt(e)&&Jr.indexOf(e.config.method)!==-1:!1}function Ht(e){return e.config?nt(e)&&Gi.indexOf(e.config.method)!==-1:!1}function zt(e){return Jt(e)||Ht(e)}function Vi(){return 0}function zr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:100,i=Math.pow(2,e)*t,o=i*.2*Math.random();return i+o}var Gr={retries:3,retryCondition:zt,retryDelay:Vi,shouldResetTimeout:!1,onRetry:function(){}};z.DEFAULT_OPTIONS=Gr;function Ki(e,t){return At(At(At({},Gr),t),e[Wt])}function mr(e,t){var i=Ki(e,t);return i.retryCount=i.retryCount||0,e[Wt]=i,i}function Yi(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}function Xi(e,t){return Ot.apply(this,arguments)}function Ot(){return Ot=(0,Wr.default)(He.default.mark(function e(t,i){var o,c,l,f;return He.default.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(o=t.retries,c=t.retryCondition,l=t.retryCount<o&&c(i),(0,Ji.default)(l)!=="object"){E.next=13;break}return E.prev=3,E.next=6,l;case 6:return f=E.sent,E.abrupt("return",f!==!1);case 10:return E.prev=10,E.t0=E.catch(3),E.abrupt("return",!1);case 13:return E.abrupt("return",l);case 14:case"end":return E.stop()}},e,null,[[3,10]])})),Ot.apply(this,arguments)}function he(e,t){var i=e.interceptors.request.use(function(c){var l=mr(c,t);return l.lastRequestTime=Date.now(),c}),o=e.interceptors.response.use(null,function(){var c=(0,Wr.default)(He.default.mark(function l(f){var u,E,g,b,d,B,S,C;return He.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(u=f.config,u){D.next=3;break}return D.abrupt("return",Promise.reject(f));case 3:return E=mr(u,t),D.next=6,Xi(E,f);case 6:if(!D.sent){D.next=21;break}if(E.retryCount+=1,g=E.retryDelay,b=E.shouldResetTimeout,d=E.onRetry,B=g(E.retryCount,f),Yi(e,u),!(!b&&u.timeout&&E.lastRequestTime)){D.next=17;break}if(S=Date.now()-E.lastRequestTime,C=u.timeout-S-B,!(C<=0)){D.next=16;break}return D.abrupt("return",Promise.reject(f));case 16:u.timeout=C;case 17:return u.transformRequest=[function(N){return N}],D.next=20,d(E.retryCount,f,u);case 20:return D.abrupt("return",new Promise(function(N){return setTimeout(function(){return N(e(u))},B)}));case 21:return D.abrupt("return",Promise.reject(f));case 22:case"end":return D.stop()}},l)}));return function(l){return c.apply(this,arguments)}}());return{requestInterceptorId:i,responseInterceptorId:o}}he.isNetworkError=Jt;he.isSafeRequestError=Hr;he.isIdempotentRequestError=Ht;he.isNetworkOrIdempotentRequestError=zt;he.exponentialDelay=zr;he.isRetryableError=nt;const Vr=z.default;$t.exports=Vr;$t.exports.default=Vr;var Zi=$t.exports,it={},we=null;typeof WebSocket<"u"?we=WebSocket:typeof MozWebSocket<"u"?we=MozWebSocket:typeof fe.commonjsGlobal<"u"?we=fe.commonjsGlobal.WebSocket||fe.commonjsGlobal.MozWebSocket:typeof window<"u"?we=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(we=self.WebSocket||self.MozWebSocket);var Qi=we,eo=fe.commonjsGlobal&&fe.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(it,"__esModule",{value:!0});it.ResilientWebSocket=void 0;const to=eo(Qi),ro=3e4+3e3;class no{constructor(t,i){I(this,"endpoint");I(this,"wsClient");I(this,"wsUserClosed");I(this,"wsFailedAttempts");I(this,"pingTimeout");I(this,"logger");I(this,"onError");I(this,"onMessage");I(this,"onReconnect");this.endpoint=t,this.logger=i,this.wsFailedAttempts=0,this.onError=o=>{var c;(c=this.logger)==null||c.error(o)},this.wsUserClosed=!0,this.onMessage=()=>{},this.onReconnect=()=>{}}async send(t){var i,o,c;(i=this.logger)==null||i.info(`Sending ${t}`),await this.waitForMaybeReadyWebSocket(),this.wsClient===void 0?(o=this.logger)==null||o.error("Couldn't connect to the websocket server. Error callback is called."):(c=this.wsClient)==null||c.send(t)}async startWebSocket(){var t;this.wsClient===void 0&&((t=this.logger)==null||t.info("Creating Web Socket client"),this.wsClient=new to.default(this.endpoint),this.wsUserClosed=!1,this.wsClient.onopen=()=>{this.wsFailedAttempts=0,this.wsClient.on!==void 0&&this.heartbeat()},this.wsClient.onerror=i=>{this.onError(i.error)},this.wsClient.onmessage=i=>{this.onMessage(i.data)},this.wsClient.onclose=async()=>{var i,o;if(this.pingTimeout!==void 0&&clearInterval(this.pingTimeout),this.wsUserClosed===!1){this.wsFailedAttempts+=1,this.wsClient=void 0;const c=io(this.wsFailedAttempts);(i=this.logger)==null||i.error(`Connection closed unexpectedly or because of timeout. Reconnecting after ${c}ms.`),await yr(c),this.restartUnexpectedClosedWebsocket()}else(o=this.logger)==null||o.info("The connection has been closed successfully.")},this.wsClient.on!==void 0&&this.wsClient.on("ping",this.heartbeat.bind(this)))}heartbeat(){var t;(t=this.logger)==null||t.info("Heartbeat"),this.pingTimeout!==void 0&&clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var i,o;(i=this.logger)==null||i.warn("Connection timed out. Reconnecting..."),(o=this.wsClient)==null||o.terminate(),this.restartUnexpectedClosedWebsocket()},ro)}async waitForMaybeReadyWebSocket(){let t=0;for(;this.wsClient!==void 0&&this.wsClient.readyState!==this.wsClient.OPEN;)if(t>5e3){this.wsClient.close();return}else t+=10,await yr(10)}async restartUnexpectedClosedWebsocket(){var t;if(this.wsUserClosed!==!0){if(await this.startWebSocket(),await this.waitForMaybeReadyWebSocket(),this.wsClient===void 0){(t=this.logger)==null||t.error("Couldn't reconnect to websocket. Error callback is called.");return}this.onReconnect()}}closeWebSocket(){if(this.wsClient!==void 0){const t=this.wsClient;this.wsClient=void 0,t.close()}this.wsUserClosed=!0}}it.ResilientWebSocket=no;async function yr(e){return new Promise(t=>setTimeout(t,e))}function io(e){return 2**e*100}var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.removeLeading0xIfExists=Ce.makeWebsocketUrl=void 0;function oo(e){const t=new URL("ws",e),i=t.protocol==="https:";return t.protocol=i?"wss:":"ws:",t.toString()}Ce.makeWebsocketUrl=oo;function so(e){return e.startsWith("0x")?e.substring(2):e}Ce.removeLeading0xIfExists=so;var Kr=fe.commonjsGlobal&&fe.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.PriceServiceConnection=void 0;const Ft=oe,ao=Kr(Ni),Er=Kr(Zi),co=it,Bt=Ce;class uo{constructor(t,i){I(this,"httpClient");I(this,"priceFeedCallbacks");I(this,"wsClient");I(this,"wsEndpoint");I(this,"logger");I(this,"priceFeedRequestConfig");I(this,"onWsError");var o,c,l;this.httpClient=ao.default.create({baseURL:t,timeout:(i==null?void 0:i.timeout)||5e3}),(0,Er.default)(this.httpClient,{retries:(i==null?void 0:i.httpRetries)||3,retryDelay:Er.default.exponentialDelay}),this.priceFeedRequestConfig={binary:(o=i==null?void 0:i.priceFeedRequestConfig)==null?void 0:o.binary,verbose:((c=i==null?void 0:i.priceFeedRequestConfig)==null?void 0:c.verbose)??(i==null?void 0:i.verbose),allowOutOfOrder:(l=i==null?void 0:i.priceFeedRequestConfig)==null?void 0:l.allowOutOfOrder},this.priceFeedCallbacks=new Map,this.logger=(i==null?void 0:i.logger)||{trace:()=>{},debug:()=>{},info:()=>{},warn:console.warn,error:console.error},this.onWsError=f=>{this.logger.error(f),typeof process<"u"&&typeof process.exit=="function"?(this.logger.error("Halting the process due to the websocket error"),process.exit(1)):this.logger.error("Cannot halt process. Please handle the websocket error.")},this.wsEndpoint=(0,Bt.makeWebsocketUrl)(t)}async getLatestPriceFeeds(t){return t.length===0?[]:(await this.httpClient.get("/api/latest_price_feeds",{params:{ids:t,verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary}})).data.map(c=>Ft.PriceFeed.fromJson(c))}async getLatestVaas(t){return(await this.httpClient.get("/api/latest_vaas",{params:{ids:t}})).data}async getVaa(t,i){const o=await this.httpClient.get("/api/get_vaa",{params:{id:t,publish_time:i}});return[o.data.vaa,o.data.publishTime]}async getPriceFeed(t,i){const o=await this.httpClient.get("/api/get_price_feed",{params:{id:t,publish_time:i,verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary}});return Ft.PriceFeed.fromJson(o.data)}async getPriceFeedIds(){return(await this.httpClient.get("/api/price_feed_ids")).data}async subscribePriceFeedUpdates(t,i){var l;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(f=>(0,Bt.removeLeading0xIfExists)(f));const o=[];for(const f of t)this.priceFeedCallbacks.has(f)||(this.priceFeedCallbacks.set(f,new Set),o.push(f)),this.priceFeedCallbacks.get(f).add(i);const c={ids:o,type:"subscribe",verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary,allow_out_of_order:this.priceFeedRequestConfig.allowOutOfOrder};await((l=this.wsClient)==null?void 0:l.send(JSON.stringify(c)))}async unsubscribePriceFeedUpdates(t,i){var l;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(f=>(0,Bt.removeLeading0xIfExists)(f));const o=[];for(const f of t)if(this.priceFeedCallbacks.has(f)){let u=!1;i===void 0?(this.priceFeedCallbacks.delete(f),u=!0):(this.priceFeedCallbacks.get(f).delete(i),this.priceFeedCallbacks.get(f).size===0&&(this.priceFeedCallbacks.delete(f),u=!0)),u&&o.push(f)}const c={ids:o,type:"unsubscribe"};await((l=this.wsClient)==null?void 0:l.send(JSON.stringify(c))),this.priceFeedCallbacks.size===0&&this.closeWebSocket()}async startWebSocket(){if(this.wsEndpoint===void 0)throw new Error("Websocket endpoint is undefined.");this.wsClient=new co.ResilientWebSocket(this.wsEndpoint,this.logger),this.wsClient.onError=this.onWsError,this.wsClient.onReconnect=()=>{var t;if(this.priceFeedCallbacks.size>0){const i={ids:Array.from(this.priceFeedCallbacks.keys()),type:"subscribe",verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary,allow_out_of_order:this.priceFeedRequestConfig.allowOutOfOrder};this.logger.info("Resubscribing to existing price feeds."),(t=this.wsClient)==null||t.send(JSON.stringify(i))}},this.wsClient.onMessage=t=>{this.logger.info(`Received message ${t.toString()}`);let i;try{i=JSON.parse(t.toString())}catch(o){this.logger.error(`Error parsing message ${t.toString()} as JSON.`),this.logger.error(o),this.onWsError(o);return}if(i.type==="response")i.status==="error"&&(this.logger.error(`Error response from the websocket server ${i.error}.`),this.onWsError(new Error(i.error)));else if(i.type==="price_update"){let o;try{o=Ft.PriceFeed.fromJson(i.price_feed)}catch(c){this.logger.error(`Error parsing price feeds from message ${t.toString()}.`),this.logger.error(c),this.onWsError(c);return}if(this.priceFeedCallbacks.has(o.id))for(const c of this.priceFeedCallbacks.get(o.id))c(o)}else this.logger.warn(`Ignoring unsupported server response ${t.toString()}.`)},await this.wsClient.startWebSocket()}closeWebSocket(){var t;(t=this.wsClient)==null||t.closeWebSocket(),this.wsClient=void 0,this.priceFeedCallbacks.clear()}}Ve.PriceServiceConnection=uo;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Price=e.PriceFeed=e.PriceFeedMetadata=e.PriceServiceConnection=void 0;var t=Ve;Object.defineProperty(e,"PriceServiceConnection",{enumerable:!0,get:function(){return t.PriceServiceConnection}});var i=oe;Object.defineProperty(e,"PriceFeedMetadata",{enumerable:!0,get:function(){return i.PriceFeedMetadata}}),Object.defineProperty(e,"PriceFeed",{enumerable:!0,get:function(){return i.PriceFeed}}),Object.defineProperty(e,"Price",{enumerable:!0,get:function(){return i.Price}})})(vt);Object.defineProperty(Ge,"__esModule",{value:!0});Ge.EvmPriceServiceConnection=void 0;const fo=vt,lo=br;class po extends fo.PriceServiceConnection{async getPriceFeedsUpdateData(t){return(await this.getLatestVaas(t)).map(o=>"0x"+lo.Buffer.from(o,"base64").toString("hex"))}}Ge.EvmPriceServiceConnection=po;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CONTRACT_ADDR=e.PriceFeed=e.Price=e.EvmPriceServiceConnection=void 0;var t=Ge;Object.defineProperty(e,"EvmPriceServiceConnection",{enumerable:!0,get:function(){return t.EvmPriceServiceConnection}});var i=vt;Object.defineProperty(e,"Price",{enumerable:!0,get:function(){return i.Price}}),Object.defineProperty(e,"PriceFeed",{enumerable:!0,get:function(){return i.PriceFeed}}),e.CONTRACT_ADDR={arbitrum:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",astar_zkevm:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",aurora:"0xF89C7b475821EC3fDC2dC8099032c05c6c0c9AB9",avalanche:"0x4305FB66699C3B2702D4d05CF36551390A4c69C6",blast:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",bnb:"0x4D7E825f80bDf85e913E0DD2A2D54927e9dE1594",base:"0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a",boba:"0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",bttc:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",canto:"0x98046Bd286715D3B0BC227Dd7a956b83D8978603",celo:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",chiliz:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",conflux_espace:"0xe9d69CdD6Fe41e7B621B4A688C5D1a68cB5c8ADc",core_dao:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",cronos:"0xE0d0e68297772Dd5a1f1D99897c581E2082dbA5B",eos:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",evmos:"0x354bF866A4B006C9AF9d9e06d9364217A8616E12",ethereum:"0x4305FB66699C3B2702D4d05CF36551390A4c69C6",fantom:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",filecoin:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",gnosis:"0x2880aB155794e7179c9eE2e38200202908C17B43",hedera:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",horizen_eon:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",injective_inevm:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",kava:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",lightlink:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",linea:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",manta:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",mantle:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",merlin:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",meter:"0xbFe3f445653f2136b2FD1e6DdDb5676392E3AF16",mode:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",neon:"0x7f2dB085eFC3560AFF33865dD727225d91B4f9A5",optimism:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",polygon:"0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",polygon_zkevm:"0xC5E56d6b40F3e3B5fbfa266bCd35C37426537c65",ronin:"0x2880aB155794e7179c9eE2e38200202908C17B43",scroll:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",shimmer:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",viction:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",wemix:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",zetachain:"0x2880aB155794e7179c9eE2e38200202908C17B43",zkfair:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",zksync_era:"0xf087c864AEccFb6A2Bf1Af6A0382B0d0f6c5D834",arbitrum_sepolia:"0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",astar_zkevm_testnet:"0x8D254a21b3C86D32F7179855531CE99164721933",aurora_testnet:"0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",bnb_testnet:"0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",base_sepolia:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",berachain_testnet:"0x8D254a21b3C86D32F7179855531CE99164721933",blast_s2_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",boba_goerli:"0x8D254a21b3C86D32F7179855531CE99164721933",bttc_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",cant_testnet:"0x26DD80569a8B23768A1d80869Ed7339e07595E85",celo_alfajores:"0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",chiado:"0x98046Bd286715D3B0BC227Dd7a956b83D8978603",chiliz_testnet:"0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",conflux_espace_testnet:"0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",core_dao_testnet:"0x8D254a21b3C86D32F7179855531CE99164721933",cronos_testnet:"0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",dela_deperp_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",eos_testnet:"0x0708325268dF9F66270F1401206434524814508b",evmos_testnet:"0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",fantom_sonic_testnet:"0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",fantom_testnet:"0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",filecoin_calibration:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",fuji:"0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",hedera_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",idex_xchain_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",injective_inevm_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",kcc_testnet:"0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",kava_testnet:"0xfA25E653b44586dBbe27eE9d252192F0e4956683",lightlink_pegasus_testnet:"0x5D289Ad1CE59fCC25b6892e7A303dfFf3a9f7167",linea_goerli:"0xdF21D137Aadc95588205586636710ca2890538d5",manta_testnet:"0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c",manta_sepolia:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",mantle_sepolia:"0x98046Bd286715D3B0BC227Dd7a956b83D8978603",merlin_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",meter_testnet:"0x5a71C07a0588074443545eE0c08fb0375564c3E4",mode_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",movement_evm_devnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",mumbai:"0xFC6bd9F9f0c6481c6Af3A7Eb46b296A5B85ed379",neon_devnet:"0x0708325268dF9F66270F1401206434524814508b",optimism_goerli:"0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",optimism_sepolia:"0x0708325268dF9F66270F1401206434524814508b",polygon_zkevm_testnet:"0xFf255f800044225f54Af4510332Aa3D67CC77635",saigon:"0xEbe57e8045F2F230872523bbff7374986E45C486",sei_evm_devnet:"0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",scroll_sepolia:"0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c",sepolia:"0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",shimmer_testnet:"0x8D254a21b3C86D32F7179855531CE99164721933",viction_testnet:"0x5D289Ad1CE59fCC25b6892e7A303dfFf3a9f7167",wemix_testnet:"0x26DD80569a8B23768A1d80869Ed7339e07595E85",zetachain_testnet:"0x0708325268dF9F66270F1401206434524814508b",zkfair_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",zksync_era_goerli:"0x8739d5024B5143278E2b15Bd9e7C26f6CEc658F1",zksync_era_sepolia:"0x056f829183Ec806A78c26C98961678c24faB71af",horizen_gobi_testnet:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729"}})(xr);class ho{constructor(t){this.connection=new xr.EvmPriceServiceConnection(t)}getOracleId(){return"PYTH"}async fetchOffchainData(t,i,o){const c=[];let l=BigInt(86400),f=BigInt(0);const u=[];for(const E of o??[]){const[g]=Pe.decodeAbiParameters([{name:"updateType",type:"uint8"}],E.query);if(g===1){const[,b,d]=Pe.decodeAbiParameters([{name:"updateType",type:"uint8"},{name:"stalenessTolerance",type:"uint64"},{name:"priceIds",type:"bytes32[]"}],E.query);c.push(...d),l=b<l?b:l,f=f+(E.fee??BigInt(1))}else if(g===2){const[,b,d]=Pe.decodeAbiParameters([{name:"updateType",type:"uint8"},{name:"requestedTime",type:"uint64"},{name:"priceIds",type:"bytes32"}],E.query),[B]=await this.connection.getVaa(d,Number(b.toString())),S="0x"+Buffer.from(B,"base64").toString("hex");u.push({arg:Pe.encodeAbiParameters([{type:"uint8",name:"updateType"},{type:"uint64",name:"timestamp"},{type:"bytes32[]",name:"priceIds"},{type:"bytes[]",name:"updateData"}],[2,b,[d],[S]]),fee:E.fee??BigInt(1)})}else throw new Error(`update type ${g} not supported`)}if(c.length>0){const E=await this.connection.getPriceFeedsUpdateData(c);return[{arg:Pe.encodeAbiParameters([{type:"uint8",name:"updateType"},{type:"uint64",name:"stalenessTolerance"},{type:"bytes32[]",name:"priceIds"},{type:"bytes[]",name:"updateData"}],[1,l,c,E]),fee:f},...u]}else return u}}exports.PythAdapter=ho;
|