hyperliquid
Version:
SDK for Hyperliquid API
6 lines • 509 kB
JavaScript
"use strict";var HyperliquidSDK=(()=>{var Gl=Object.defineProperty;var Zb=Object.getOwnPropertyDescriptor;var Xb=Object.getOwnPropertyNames;var $b=Object.prototype.hasOwnProperty;var dp=n=>{throw TypeError(n)};var ey=(n,e,t)=>e in n?Gl(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var zl=(n,e)=>{for(var t in e)Gl(n,t,{get:e[t],enumerable:!0})},ty=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Xb(e))!$b.call(n,s)&&s!==t&&Gl(n,s,{get:()=>e[s],enumerable:!(r=Zb(e,s))||r.enumerable});return n};var ry=n=>ty(Gl({},"__esModule",{value:!0}),n);var h=(n,e,t)=>ey(n,typeof e!="symbol"?e+"":e,t),ud=(n,e,t)=>e.has(n)||dp("Cannot "+t);var f=(n,e,t)=>(ud(n,e,"read from private field"),t?t.call(n):e.get(n)),w=(n,e,t)=>e.has(n)?dp("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),p=(n,e,t,r)=>(ud(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),R=(n,e,t)=>(ud(n,e,"access private method"),t);var en=(n,e,t,r)=>({set _(s){p(n,e,s,t)},get _(){return f(n,e,r)}});var R3={};zl(R3,{Hyperliquid:()=>fc,utils:()=>v3});var mo={PRODUCTION:"https://api.hyperliquid.xyz",TESTNET:"https://api.hyperliquid-testnet.xyz"},fd={PRODUCTION:"wss://api.hyperliquid.xyz/ws",TESTNET:"wss://api.hyperliquid-testnet.xyz/ws"},ne={ARBITRUM_MAINNET:"0xa4b1",ARBITRUM_TESTNET:"0x66eee"},xo={INFO:"/info",EXCHANGE:"/exchange"};var hp="PLACEHOLDER";var Kl=class{constructor(e,t,r){this.httpApi=e;this.symbolConversion=t;h(this,"parent");this.parent=r}async getAllMids(e=!1){let t=await this.httpApi.makeRequest({type:"allMids"});if(e)return t;{let r={};for(let[s,i]of Object.entries(t)){let o=await this.symbolConversion.convertSymbol(s),a=parseFloat(i);r[o]=a}return r}}async getUserOpenOrders(e,t=!1){await this.parent.ensureInitialized();let r=await this.httpApi.makeRequest({type:"openOrders",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async getFrontendOpenOrders(e,t=!1){let r=await this.httpApi.makeRequest({type:"frontendOpenOrders",user:e},20);return t?r:await this.symbolConversion.convertResponse(r)}async getUserFills(e,t=!1){let r=await this.httpApi.makeRequest({type:"userFills",user:e},20);return t?r:await this.symbolConversion.convertResponse(r)}async getUserFillsByTime(e,t,r,s=!1){let i={user:e,startTime:Math.round(t),type:"userFillsByTime"};r&&(i.endTime=Math.round(r));let o=await this.httpApi.makeRequest(i,20);return s?o:await this.symbolConversion.convertResponse(o)}async getUserRateLimit(e,t=!1){let r=await this.httpApi.makeRequest({type:"userRateLimit",user:e},20);return t?r:await this.symbolConversion.convertResponse(r)}async getOrderStatus(e,t,r=!1){let s=await this.httpApi.makeRequest({type:"orderStatus",user:e,oid:t});return r?s:await this.symbolConversion.convertResponse(s)}async getL2Book(e,t=!1,r=5,s){let i=await this.httpApi.makeRequest({type:"l2Book",coin:await this.symbolConversion.convertSymbol(e,"reverse"),nSigFigs:r,mantissa:s});return t?i:await this.symbolConversion.convertResponse(i)}async getCandleSnapshot(e,t,r,s,i=!1){let o=await this.httpApi.makeRequest({type:"candleSnapshot",req:{coin:await this.symbolConversion.convertSymbol(e,"reverse"),interval:t,startTime:r,endTime:s}});return i?o:await this.symbolConversion.convertResponse(o,["s"])}async getMaxBuilderFee(e,t,r=!1){let s=await this.httpApi.makeRequest({type:"maxBuilderFee",user:e,builder:t});return r?s:this.symbolConversion.convertToNumber(s)}async getHistoricalOrders(e,t=!1){let r=await this.httpApi.makeRequest({type:"historicalOrders",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async getUserTwapSliceFills(e,t=!1){let r=await this.httpApi.makeRequest({type:"userTwapSliceFills",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async getSubAccounts(e,t=!1){let r=await this.httpApi.makeRequest({type:"subAccounts",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async getVaultDetails(e,t,r=!1){let s={type:"vaultDetails",vaultAddress:e};t&&(s.user=t);let i=await this.httpApi.makeRequest(s);return r?i:await this.symbolConversion.convertResponse(i)}async getUserVaultEquities(e,t=!1){let r=await this.httpApi.makeRequest({type:"userVaultEquities",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async getUserRole(e,t=!1){let r=await this.httpApi.makeRequest({type:"userRole",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async getDelegations(e,t=!1){let r=await this.httpApi.makeRequest({type:"delegations",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async getDelegatorSummary(e,t=!1){let r=await this.httpApi.makeRequest({type:"delegatorSummary",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async getDelegatorHistory(e,t=!1){let r=await this.httpApi.makeRequest({type:"delegatorHistory",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async getDelegatorRewards(e,t=!1){let r=await this.httpApi.makeRequest({type:"delegatorRewards",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async validatorSummaries(e=!1){let t=await this.httpApi.makeRequest({type:"validatorSummaries"});return e?t:await this.symbolConversion.convertResponse(t)}async vaultSummaries(e=!1){let t=await this.httpApi.makeRequest({type:"vaultSummaries"});return e?t:await this.symbolConversion.convertResponse(t)}async userFees(e,t=!1){let r=await this.httpApi.makeRequest({type:"userFees",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async portfolio(e,t=!1){let r=await this.httpApi.makeRequest({type:"portfolio",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async preTransferCheck(e,t,r=!1){let s=await this.httpApi.makeRequest({type:"preTransferCheck",user:e,source:t});return r?s:await this.symbolConversion.convertResponse(s)}async referral(e,t=!1){let r=await this.httpApi.makeRequest({type:"referral",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async extraAgents(e,t=!1){let r=await this.httpApi.makeRequest({type:"extraAgents",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async isVip(e,t=!1){let r=await this.httpApi.makeRequest({type:"isVip",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async legalCheck(e,t=!1){let r=await this.httpApi.makeRequest({type:"legalCheck",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async userTwapSliceFillsByTime(e,t,r,s,i=!1){let o={type:"userTwapSliceFillsByTime",user:e,startTime:t};r!==void 0&&(o.endTime=r),s!==void 0&&(o.aggregateByTime=s);let a=await this.httpApi.makeRequest(o);return i?a:await this.symbolConversion.convertResponse(a)}async twapHistory(e,t=!1){let r=await this.httpApi.makeRequest({type:"twapHistory",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async userToMultiSigSigners(e,t=!1){let r=await this.httpApi.makeRequest({type:"userToMultiSigSigners",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async getBuilderFeeApproval(e,t,r=!1){let s=await this.httpApi.makeRequest({type:"builderFeeApproval",user:e,builderAddress:t});return r?s:await this.symbolConversion.convertResponse(s)}async getUserOrderHistory(e,t,r,s=!1){let i={type:"userOrderHistory",user:e,startTime:Math.round(t)};r!==void 0&&(i.endTime=Math.round(r));let o=await this.httpApi.makeRequest(i,20);return s?o:await this.symbolConversion.convertResponse(o)}};var Wl=class{constructor(e,t){h(this,"httpApi");h(this,"symbolConversion");this.httpApi=e,this.symbolConversion=t}async getSpotMeta(e=!1){let t=await this.httpApi.makeRequest({type:"spotMeta"});return e?t:await this.symbolConversion.convertResponse(t,["name","coin","symbol"],"SPOT")}async getSpotClearinghouseState(e,t=!1){let r=await this.httpApi.makeRequest({type:"spotClearinghouseState",user:e});return t?r:await this.symbolConversion.convertResponse(r,["name","coin","symbol"],"SPOT")}async getSpotMetaAndAssetCtxs(e=!1){let t=await this.httpApi.makeRequest({type:"spotMetaAndAssetCtxs"});return e?t:await this.symbolConversion.convertResponse(t)}async getTokenDetails(e,t=!1){let r=await this.httpApi.makeRequest({type:"tokenDetails",tokenId:e},20);return t?r:await this.symbolConversion.convertResponse(r)}async getSpotDeployState(e,t=!1){let r=await this.httpApi.makeRequest({type:"spotDeployState",user:e},20);return t?r:await this.symbolConversion.convertResponse(r)}};var ql=class{constructor(e,t,r){h(this,"httpApi");h(this,"symbolConversion");h(this,"parent");this.httpApi=e,this.symbolConversion=t,this.parent=r}async getMeta(e=!1){let t=await this.httpApi.makeRequest({type:"meta"});return e?t:await this.symbolConversion.convertResponse(t,["name","coin","symbol"],"PERP")}async getMetaAndAssetCtxs(e=!1){let t=await this.httpApi.makeRequest({type:"metaAndAssetCtxs"});return e?t:await this.symbolConversion.convertResponse(t,["name","coin","symbol"],"PERP")}async getClearinghouseState(e,t=!1){let r=await this.httpApi.makeRequest({type:"clearinghouseState",user:e});return t?r:await this.symbolConversion.convertResponse(r)}async getUserFunding(e,t,r,s=!1){let i=await this.httpApi.makeRequest({type:"userFunding",user:e,startTime:t,endTime:r},20);return s?i:await this.symbolConversion.convertResponse(i)}async getUserNonFundingLedgerUpdates(e,t,r,s=!1){let i=await this.httpApi.makeRequest({type:"userNonFundingLedgerUpdates",user:e,startTime:t,endTime:r},20);return s?i:await this.symbolConversion.convertResponse(i)}async getFundingHistory(e,t,r,s=!1){await this.parent.ensureInitialized();let i=await this.httpApi.makeRequest({type:"fundingHistory",coin:await this.symbolConversion.convertSymbol(e,"reverse"),startTime:t,endTime:r},20);return s?i:await this.symbolConversion.convertResponse(i)}async getPredictedFundings(e=!1){let t=await this.httpApi.makeRequest({type:"predictedFundings"},20);return e?t:await this.symbolConversion.convertResponse(t)}async getPerpsAtOpenInterestCap(e=!1){let t=await this.httpApi.makeRequest({type:"perpsAtOpenInterestCap"});return e?t:await Promise.all(t.map(s=>this.symbolConversion.convertSymbol(s,"","PERP")))}};function hc(n,e){return function(){return n.apply(e,arguments)}}var{toString:ny}=Object.prototype,{getPrototypeOf:hd}=Object,{iterator:Ql,toStringTag:mp}=Symbol,jl=(n=>e=>{let t=ny.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Zt=n=>(n=n.toLowerCase(),e=>jl(e)===n),Yl=n=>e=>typeof e===n,{isArray:go}=Array,pc=Yl("undefined");function sy(n){return n!==null&&!pc(n)&&n.constructor!==null&&!pc(n.constructor)&&pt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}var xp=Zt("ArrayBuffer");function iy(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&xp(n.buffer),e}var oy=Yl("string"),pt=Yl("function"),gp=Yl("number"),Zl=n=>n!==null&&typeof n=="object",ay=n=>n===!0||n===!1,Jl=n=>{if(jl(n)!=="object")return!1;let e=hd(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(mp in n)&&!(Ql in n)},cy=Zt("Date"),ly=Zt("File"),uy=Zt("Blob"),fy=Zt("FileList"),dy=n=>Zl(n)&&pt(n.pipe),hy=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||pt(n.append)&&((e=jl(n))==="formdata"||e==="object"&&pt(n.toString)&&n.toString()==="[object FormData]"))},py=Zt("URLSearchParams"),[my,xy,gy,by]=["ReadableStream","Request","Response","Headers"].map(Zt),yy=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mc(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let r,s;if(typeof n!="object"&&(n=[n]),go(n))for(r=0,s=n.length;r<s;r++)e.call(null,n[r],r,n);else{let i=t?Object.getOwnPropertyNames(n):Object.keys(n),o=i.length,a;for(r=0;r<o;r++)a=i[r],e.call(null,n[a],a,n)}}function bp(n,e){e=e.toLowerCase();let t=Object.keys(n),r=t.length,s;for(;r-- >0;)if(s=t[r],e===s.toLowerCase())return s;return null}var Gs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,yp=n=>!pc(n)&&n!==Gs;function dd(){let{caseless:n}=yp(this)&&this||{},e={},t=(r,s)=>{let i=n&&bp(e,s)||s;Jl(e[i])&&Jl(r)?e[i]=dd(e[i],r):Jl(r)?e[i]=dd({},r):go(r)?e[i]=r.slice():e[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&mc(arguments[r],t);return e}var wy=(n,e,t,{allOwnKeys:r}={})=>(mc(e,(s,i)=>{t&&pt(s)?n[i]=hc(s,t):n[i]=s},{allOwnKeys:r}),n),Ay=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Ey=(n,e,t,r)=>{n.prototype=Object.create(e.prototype,r),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},Sy=(n,e,t,r)=>{let s,i,o,a={};if(e=e||{},n==null)return e;do{for(s=Object.getOwnPropertyNames(n),i=s.length;i-- >0;)o=s[i],(!r||r(o,n,e))&&!a[o]&&(e[o]=n[o],a[o]=!0);n=t!==!1&&hd(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},Ty=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;let r=n.indexOf(e,t);return r!==-1&&r===t},vy=n=>{if(!n)return null;if(go(n))return n;let e=n.length;if(!gp(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},Ry=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&hd(Uint8Array)),Py=(n,e)=>{let r=(n&&n[Ql]).call(n),s;for(;(s=r.next())&&!s.done;){let i=s.value;e.call(n,i[0],i[1])}},Ny=(n,e)=>{let t,r=[];for(;(t=n.exec(e))!==null;)r.push(t);return r},Cy=Zt("HTMLFormElement"),Iy=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,s){return r.toUpperCase()+s}),pp=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),ky=Zt("RegExp"),wp=(n,e)=>{let t=Object.getOwnPropertyDescriptors(n),r={};mc(t,(s,i)=>{let o;(o=e(s,i,n))!==!1&&(r[i]=o||s)}),Object.defineProperties(n,r)},Oy=n=>{wp(n,(e,t)=>{if(pt(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let r=n[t];if(pt(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},By=(n,e)=>{let t={},r=s=>{s.forEach(i=>{t[i]=!0})};return go(n)?r(n):r(String(n).split(e)),t},Uy=()=>{},Dy=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e;function Fy(n){return!!(n&&pt(n.append)&&n[mp]==="FormData"&&n[Ql])}var My=n=>{let e=new Array(10),t=(r,s)=>{if(Zl(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[s]=r;let i=go(r)?[]:{};return mc(r,(o,a)=>{let c=t(o,s+1);!pc(c)&&(i[a]=c)}),e[s]=void 0,i}}return r};return t(n,0)},Ly=Zt("AsyncFunction"),_y=n=>n&&(Zl(n)||pt(n))&&pt(n.then)&&pt(n.catch),Ap=((n,e)=>n?setImmediate:e?((t,r)=>(Gs.addEventListener("message",({source:s,data:i})=>{s===Gs&&i===t&&r.length&&r.shift()()},!1),s=>{r.push(s),Gs.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",pt(Gs.postMessage)),Hy=typeof queueMicrotask<"u"?queueMicrotask.bind(Gs):typeof process<"u"&&process.nextTick||Ap,Gy=n=>n!=null&&pt(n[Ql]),T={isArray:go,isArrayBuffer:xp,isBuffer:sy,isFormData:hy,isArrayBufferView:iy,isString:oy,isNumber:gp,isBoolean:ay,isObject:Zl,isPlainObject:Jl,isReadableStream:my,isRequest:xy,isResponse:gy,isHeaders:by,isUndefined:pc,isDate:cy,isFile:ly,isBlob:uy,isRegExp:ky,isFunction:pt,isStream:dy,isURLSearchParams:py,isTypedArray:Ry,isFileList:fy,forEach:mc,merge:dd,extend:wy,trim:yy,stripBOM:Ay,inherits:Ey,toFlatObject:Sy,kindOf:jl,kindOfTest:Zt,endsWith:Ty,toArray:vy,forEachEntry:Py,matchAll:Ny,isHTMLForm:Cy,hasOwnProperty:pp,hasOwnProp:pp,reduceDescriptors:wp,freezeMethods:Oy,toObjectSet:By,toCamelCase:Iy,noop:Uy,toFiniteNumber:Dy,findKey:bp,global:Gs,isContextDefined:yp,isSpecCompliantForm:Fy,toJSONObject:My,isAsyncFn:Ly,isThenable:_y,setImmediate:Ap,asap:Hy,isIterable:Gy};function bo(n,e,t,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}T.inherits(bo,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:T.toJSONObject(this.config),code:this.code,status:this.status}}});var Ep=bo.prototype,Sp={};["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(n=>{Sp[n]={value:n}});Object.defineProperties(bo,Sp);Object.defineProperty(Ep,"isAxiosError",{value:!0});bo.from=(n,e,t,r,s,i)=>{let o=Object.create(Ep);return T.toFlatObject(n,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),bo.call(o,n.message,e,t,r,s),o.cause=n,o.name=n.name,i&&Object.assign(o,i),o};var V=bo;var Xl=null;function pd(n){return T.isPlainObject(n)||T.isArray(n)}function vp(n){return T.endsWith(n,"[]")?n.slice(0,-2):n}function Tp(n,e,t){return n?n.concat(e).map(function(s,i){return s=vp(s),!t&&i?"["+s+"]":s}).join(t?".":""):e}function zy(n){return T.isArray(n)&&!n.some(pd)}var Vy=T.toFlatObject(T,{},null,function(e){return/^is[A-Z]/.test(e)});function Ky(n,e,t){if(!T.isObject(n))throw new TypeError("target must be an object");e=e||new(Xl||FormData),t=T.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,A){return!T.isUndefined(A[b])});let r=t.metaTokens,s=t.visitor||u,i=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(e);if(!T.isFunction(s))throw new TypeError("visitor must be a function");function l(y){if(y===null)return"";if(T.isDate(y))return y.toISOString();if(T.isBoolean(y))return y.toString();if(!c&&T.isBlob(y))throw new V("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(y)||T.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function u(y,b,A){let S=y;if(y&&!A&&typeof y=="object"){if(T.endsWith(b,"{}"))b=r?b:b.slice(0,-2),y=JSON.stringify(y);else if(T.isArray(y)&&zy(y)||(T.isFileList(y)||T.endsWith(b,"[]"))&&(S=T.toArray(y)))return b=vp(b),S.forEach(function(N,D){!(T.isUndefined(N)||N===null)&&e.append(o===!0?Tp([b],D,i):o===null?b:b+"[]",l(N))}),!1}return pd(y)?!0:(e.append(Tp(A,b,i),l(y)),!1)}let d=[],x=Object.assign(Vy,{defaultVisitor:u,convertValue:l,isVisitable:pd});function g(y,b){if(!T.isUndefined(y)){if(d.indexOf(y)!==-1)throw Error("Circular reference detected in "+b.join("."));d.push(y),T.forEach(y,function(S,C){(!(T.isUndefined(S)||S===null)&&s.call(e,S,T.isString(C)?C.trim():C,b,x))===!0&&g(S,b?b.concat(C):[C])}),d.pop()}}if(!T.isObject(n))throw new TypeError("data must be an object");return g(n),e}var Gn=Ky;function Rp(n){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Pp(n,e){this._pairs=[],n&&Gn(n,this,e)}var Np=Pp.prototype;Np.append=function(e,t){this._pairs.push([e,t])};Np.toString=function(e){let t=e?function(r){return e.call(this,r,Rp)}:Rp;return this._pairs.map(function(s){return t(s[0])+"="+t(s[1])},"").join("&")};var $l=Pp;function Wy(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function xc(n,e,t){if(!e)return n;let r=t&&t.encode||Wy;T.isFunction(t)&&(t={serialize:t});let s=t&&t.serialize,i;if(s?i=s(e,t):i=T.isURLSearchParams(e)?e.toString():new $l(e,t).toString(r),i){let o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n}var md=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){T.forEach(this.handlers,function(r){r!==null&&e(r)})}},xd=md;var eu={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Cp=typeof URLSearchParams<"u"?URLSearchParams:$l;var Ip=typeof FormData<"u"?FormData:null;var kp=typeof Blob<"u"?Blob:null;var Op={isBrowser:!0,classes:{URLSearchParams:Cp,FormData:Ip,Blob:kp},protocols:["http","https","file","blob","url","data"]};var yd={};zl(yd,{hasBrowserEnv:()=>bd,hasStandardBrowserEnv:()=>qy,hasStandardBrowserWebWorkerEnv:()=>Jy,navigator:()=>gd,origin:()=>Qy});var bd=typeof window<"u"&&typeof document<"u",gd=typeof navigator=="object"&&navigator||void 0,qy=bd&&(!gd||["ReactNative","NativeScript","NS"].indexOf(gd.product)<0),Jy=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Qy=bd&&window.location.href||"http://localhost";var Te={...yd,...Op};function wd(n,e){return Gn(n,new Te.classes.URLSearchParams,Object.assign({visitor:function(t,r,s,i){return Te.isNode&&T.isBuffer(t)?(this.append(r,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function jy(n){return T.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Yy(n){let e={},t=Object.keys(n),r,s=t.length,i;for(r=0;r<s;r++)i=t[r],e[i]=n[i];return e}function Zy(n){function e(t,r,s,i){let o=t[i++];if(o==="__proto__")return!0;let a=Number.isFinite(+o),c=i>=t.length;return o=!o&&T.isArray(s)?s.length:o,c?(T.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!a):((!s[o]||!T.isObject(s[o]))&&(s[o]=[]),e(t,r,s[o],i)&&T.isArray(s[o])&&(s[o]=Yy(s[o])),!a)}if(T.isFormData(n)&&T.isFunction(n.entries)){let t={};return T.forEachEntry(n,(r,s)=>{e(jy(r),s,t,0)}),t}return null}var tu=Zy;function Xy(n,e,t){if(T.isString(n))try{return(e||JSON.parse)(n),T.trim(n)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(n)}var Ad={transitional:eu,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r=t.getContentType()||"",s=r.indexOf("application/json")>-1,i=T.isObject(e);if(i&&T.isHTMLForm(e)&&(e=new FormData(e)),T.isFormData(e))return s?JSON.stringify(tu(e)):e;if(T.isArrayBuffer(e)||T.isBuffer(e)||T.isStream(e)||T.isFile(e)||T.isBlob(e)||T.isReadableStream(e))return e;if(T.isArrayBufferView(e))return e.buffer;if(T.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return wd(e,this.formSerializer).toString();if((a=T.isFileList(e))||r.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return Gn(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||s?(t.setContentType("application/json",!1),Xy(e)):e}],transformResponse:[function(e){let t=this.transitional||Ad.transitional,r=t&&t.forcedJSONParsing,s=this.responseType==="json";if(T.isResponse(e)||T.isReadableStream(e))return e;if(e&&T.isString(e)&&(r&&!this.responseType||s)){let o=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?V.from(a,V.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Te.classes.FormData,Blob:Te.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],n=>{Ad.headers[n]={}});var yo=Ad;var $y=T.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"]),Bp=n=>{let e={},t,r,s;return n&&n.split(`
`).forEach(function(o){s=o.indexOf(":"),t=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!t||e[t]&&$y[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)}),e};var Up=Symbol("internals");function gc(n){return n&&String(n).trim().toLowerCase()}function ru(n){return n===!1||n==null?n:T.isArray(n)?n.map(ru):String(n)}function ew(n){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=t.exec(n);)e[r[1]]=r[2];return e}var tw=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Ed(n,e,t,r,s){if(T.isFunction(r))return r.call(this,e,t);if(s&&(e=t),!!T.isString(e)){if(T.isString(r))return e.indexOf(r)!==-1;if(T.isRegExp(r))return r.test(e)}}function rw(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function nw(n,e){let t=T.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(n,r+t,{value:function(s,i,o){return this[r].call(this,e,s,i,o)},configurable:!0})})}var wo=class{constructor(e){e&&this.set(e)}set(e,t,r){let s=this;function i(a,c,l){let u=gc(c);if(!u)throw new Error("header name must be a non-empty string");let d=T.findKey(s,u);(!d||s[d]===void 0||l===!0||l===void 0&&s[d]!==!1)&&(s[d||c]=ru(a))}let o=(a,c)=>T.forEach(a,(l,u)=>i(l,u,c));if(T.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(T.isString(e)&&(e=e.trim())&&!tw(e))o(Bp(e),t);else if(T.isObject(e)&&T.isIterable(e)){let a={},c,l;for(let u of e){if(!T.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[l=u[0]]=(c=a[l])?T.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}o(a,t)}else e!=null&&i(t,e,r);return this}get(e,t){if(e=gc(e),e){let r=T.findKey(this,e);if(r){let s=this[r];if(!t)return s;if(t===!0)return ew(s);if(T.isFunction(t))return t.call(this,s,r);if(T.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=gc(e),e){let r=T.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||Ed(this,this[r],r,t)))}return!1}delete(e,t){let r=this,s=!1;function i(o){if(o=gc(o),o){let a=T.findKey(r,o);a&&(!t||Ed(r,r[a],a,t))&&(delete r[a],s=!0)}}return T.isArray(e)?e.forEach(i):i(e),s}clear(e){let t=Object.keys(this),r=t.length,s=!1;for(;r--;){let i=t[r];(!e||Ed(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){let t=this,r={};return T.forEach(this,(s,i)=>{let o=T.findKey(r,i);if(o){t[o]=ru(s),delete t[i];return}let a=e?rw(i):String(i).trim();a!==i&&delete t[i],t[a]=ru(s),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return T.forEach(this,(r,s)=>{r!=null&&r!==!1&&(t[s]=e&&T.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let r=new this(e);return t.forEach(s=>r.set(s)),r}static accessor(e){let r=(this[Up]=this[Up]={accessors:{}}).accessors,s=this.prototype;function i(o){let a=gc(o);r[a]||(nw(s,o),r[a]=!0)}return T.isArray(e)?e.forEach(i):i(e),this}};wo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);T.reduceDescriptors(wo.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(r){this[t]=r}}});T.freezeMethods(wo);var Fe=wo;function bc(n,e){let t=this||yo,r=e||t,s=Fe.from(r.headers),i=r.data;return T.forEach(n,function(a){i=a.call(t,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function yc(n){return!!(n&&n.__CANCEL__)}function Dp(n,e,t){V.call(this,n??"canceled",V.ERR_CANCELED,e,t),this.name="CanceledError"}T.inherits(Dp,V,{__CANCEL__:!0});var kr=Dp;function wc(n,e,t){let r=t.config.validateStatus;!t.status||!r||r(t.status)?n(t):e(new V("Request failed with status code "+t.status,[V.ERR_BAD_REQUEST,V.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Sd(n){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function sw(n,e){n=n||10;let t=new Array(n),r=new Array(n),s=0,i=0,o;return e=e!==void 0?e:1e3,function(c){let l=Date.now(),u=r[i];o||(o=l),t[s]=c,r[s]=l;let d=i,x=0;for(;d!==s;)x+=t[d++],d=d%n;if(s=(s+1)%n,s===i&&(i=(i+1)%n),l-o<e)return;let g=u&&l-u;return g?Math.round(x*1e3/g):void 0}}var Fp=sw;function iw(n,e){let t=0,r=1e3/e,s,i,o=(l,u=Date.now())=>{t=u,s=null,i&&(clearTimeout(i),i=null),n.apply(null,l)};return[(...l)=>{let u=Date.now(),d=u-t;d>=r?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},r-d)))},()=>s&&o(s)]}var Mp=iw;var Ao=(n,e,t=3)=>{let r=0,s=Fp(50,250);return Mp(i=>{let o=i.loaded,a=i.lengthComputable?i.total:void 0,c=o-r,l=s(c),u=o<=a;r=o;let d={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-o)/l:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(d)},t)},Td=(n,e)=>{let t=n!=null;return[r=>e[0]({lengthComputable:t,total:n,loaded:r}),e[1]]},vd=n=>(...e)=>T.asap(()=>n(...e));var Lp=Te.hasStandardBrowserEnv?((n,e)=>t=>(t=new URL(t,Te.origin),n.protocol===t.protocol&&n.host===t.host&&(e||n.port===t.port)))(new URL(Te.origin),Te.navigator&&/(msie|trident)/i.test(Te.navigator.userAgent)):()=>!0;var _p=Te.hasStandardBrowserEnv?{write(n,e,t,r,s,i){let o=[n+"="+encodeURIComponent(e)];T.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),T.isString(r)&&o.push("path="+r),T.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){let e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Rd(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function Pd(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function Ac(n,e,t){let r=!Rd(e);return n&&(r||t==!1)?Pd(n,e):e}var Hp=n=>n instanceof Fe?{...n}:n;function Xt(n,e){e=e||{};let t={};function r(l,u,d,x){return T.isPlainObject(l)&&T.isPlainObject(u)?T.merge.call({caseless:x},l,u):T.isPlainObject(u)?T.merge({},u):T.isArray(u)?u.slice():u}function s(l,u,d,x){if(T.isUndefined(u)){if(!T.isUndefined(l))return r(void 0,l,d,x)}else return r(l,u,d,x)}function i(l,u){if(!T.isUndefined(u))return r(void 0,u)}function o(l,u){if(T.isUndefined(u)){if(!T.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,d){if(d in e)return r(l,u);if(d in n)return r(void 0,l)}let c={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(l,u,d)=>s(Hp(l),Hp(u),d,!0)};return T.forEach(Object.keys(Object.assign({},n,e)),function(u){let d=c[u]||s,x=d(n[u],e[u],u);T.isUndefined(x)&&d!==a||(t[u]=x)}),t}var nu=n=>{let e=Xt({},n),{data:t,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:a}=e;e.headers=o=Fe.from(o),e.url=xc(Ac(e.baseURL,e.url,e.allowAbsoluteUrls),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(T.isFormData(t)){if(Te.hasStandardBrowserEnv||Te.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){let[l,...u]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...u].join("; "))}}if(Te.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(e)),r||r!==!1&&Lp(e.url))){let l=s&&i&&_p.read(i);l&&o.set(s,l)}return e};var ow=typeof XMLHttpRequest<"u",Gp=ow&&function(n){return new Promise(function(t,r){let s=nu(n),i=s.data,o=Fe.from(s.headers).normalize(),{responseType:a,onUploadProgress:c,onDownloadProgress:l}=s,u,d,x,g,y;function b(){g&&g(),y&&y(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let A=new XMLHttpRequest;A.open(s.method.toUpperCase(),s.url,!0),A.timeout=s.timeout;function S(){if(!A)return;let N=Fe.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),k={data:!a||a==="text"||a==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:N,config:n,request:A};wc(function(L){t(L),b()},function(L){r(L),b()},k),A=null}"onloadend"in A?A.onloadend=S:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.indexOf("file:")===0)||setTimeout(S)},A.onabort=function(){A&&(r(new V("Request aborted",V.ECONNABORTED,n,A)),A=null)},A.onerror=function(){r(new V("Network Error",V.ERR_NETWORK,n,A)),A=null},A.ontimeout=function(){let D=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded",k=s.transitional||eu;s.timeoutErrorMessage&&(D=s.timeoutErrorMessage),r(new V(D,k.clarifyTimeoutError?V.ETIMEDOUT:V.ECONNABORTED,n,A)),A=null},i===void 0&&o.setContentType(null),"setRequestHeader"in A&&T.forEach(o.toJSON(),function(D,k){A.setRequestHeader(k,D)}),T.isUndefined(s.withCredentials)||(A.withCredentials=!!s.withCredentials),a&&a!=="json"&&(A.responseType=s.responseType),l&&([x,y]=Ao(l,!0),A.addEventListener("progress",x)),c&&A.upload&&([d,g]=Ao(c),A.upload.addEventListener("progress",d),A.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(u=N=>{A&&(r(!N||N.type?new kr(null,n,A):N),A.abort(),A=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));let C=Sd(s.url);if(C&&Te.protocols.indexOf(C)===-1){r(new V("Unsupported protocol "+C+":",V.ERR_BAD_REQUEST,n));return}A.send(i||null)})};var aw=(n,e)=>{let{length:t}=n=n?n.filter(Boolean):[];if(e||t){let r=new AbortController,s,i=function(l){if(!s){s=!0,a();let u=l instanceof Error?l:this.reason;r.abort(u instanceof V?u:new kr(u instanceof Error?u.message:u))}},o=e&&setTimeout(()=>{o=null,i(new V(`timeout ${e} of ms exceeded`,V.ETIMEDOUT))},e),a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),n=null)};n.forEach(l=>l.addEventListener("abort",i));let{signal:c}=r;return c.unsubscribe=()=>T.asap(a),c}},zp=aw;var cw=function*(n,e){let t=n.byteLength;if(!e||t<e){yield n;return}let r=0,s;for(;r<t;)s=r+e,yield n.slice(r,s),r=s},lw=async function*(n,e){for await(let t of uw(n))yield*cw(t,e)},uw=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}let e=n.getReader();try{for(;;){let{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}},Nd=(n,e,t,r)=>{let s=lw(n,e),i=0,o,a=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{let{done:l,value:u}=await s.next();if(l){a(),c.close();return}let d=u.byteLength;if(t){let x=i+=d;t(x)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),s.return()}},{highWaterMark:2})};var iu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Kp=iu&&typeof ReadableStream=="function",fw=iu&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Wp=(n,...e)=>{try{return!!n(...e)}catch{return!1}},dw=Kp&&Wp(()=>{let n=!1,e=new Request(Te.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),Vp=64*1024,Cd=Kp&&Wp(()=>T.isReadableStream(new Response("").body)),su={stream:Cd&&(n=>n.body)};iu&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!su[e]&&(su[e]=T.isFunction(n[e])?t=>t[e]():(t,r)=>{throw new V(`Response type '${e}' is not supported`,V.ERR_NOT_SUPPORT,r)})})})(new Response);var hw=async n=>{if(n==null)return 0;if(T.isBlob(n))return n.size;if(T.isSpecCompliantForm(n))return(await new Request(Te.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(T.isArrayBufferView(n)||T.isArrayBuffer(n))return n.byteLength;if(T.isURLSearchParams(n)&&(n=n+""),T.isString(n))return(await fw(n)).byteLength},pw=async(n,e)=>{let t=T.toFiniteNumber(n.getContentLength());return t??hw(e)},qp=iu&&(async n=>{let{url:e,method:t,data:r,signal:s,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:x}=nu(n);l=l?(l+"").toLowerCase():"text";let g=zp([s,i&&i.toAbortSignal()],o),y,b=g&&g.unsubscribe&&(()=>{g.unsubscribe()}),A;try{if(c&&dw&&t!=="get"&&t!=="head"&&(A=await pw(u,r))!==0){let k=new Request(e,{method:"POST",body:r,duplex:"half"}),U;if(T.isFormData(r)&&(U=k.headers.get("content-type"))&&u.setContentType(U),k.body){let[L,F]=Td(A,Ao(vd(c)));r=Nd(k.body,Vp,L,F)}}T.isString(d)||(d=d?"include":"omit");let S="credentials"in Request.prototype;y=new Request(e,{...x,signal:g,method:t.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:S?d:void 0});let C=await fetch(y,x),N=Cd&&(l==="stream"||l==="response");if(Cd&&(a||N&&b)){let k={};["status","statusText","headers"].forEach(q=>{k[q]=C[q]});let U=T.toFiniteNumber(C.headers.get("content-length")),[L,F]=a&&Td(U,Ao(vd(a),!0))||[];C=new Response(Nd(C.body,Vp,L,()=>{F&&F(),b&&b()}),k)}l=l||"text";let D=await su[T.findKey(su,l)||"text"](C,n);return!N&&b&&b(),await new Promise((k,U)=>{wc(k,U,{data:D,headers:Fe.from(C.headers),status:C.status,statusText:C.statusText,config:n,request:y})})}catch(S){throw b&&b(),S&&S.name==="TypeError"&&/Load failed|fetch/i.test(S.message)?Object.assign(new V("Network Error",V.ERR_NETWORK,n,y),{cause:S.cause||S}):V.from(S,S&&S.code,n,y)}});var Id={http:Xl,xhr:Gp,fetch:qp};T.forEach(Id,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});var Jp=n=>`- ${n}`,mw=n=>T.isFunction(n)||n===null||n===!1,ou={getAdapter:n=>{n=T.isArray(n)?n:[n];let{length:e}=n,t,r,s={};for(let i=0;i<e;i++){t=n[i];let o;if(r=t,!mw(t)&&(r=Id[(o=String(t)).toLowerCase()],r===void 0))throw new V(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+i]=r}if(!r){let i=Object.entries(s).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build")),o=e?i.length>1?`since :
`+i.map(Jp).join(`
`):" "+Jp(i[0]):"as no adapter specified";throw new V("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Id};function kd(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new kr(null,n)}function au(n){return kd(n),n.headers=Fe.from(n.headers),n.data=bc.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),ou.getAdapter(n.adapter||yo.adapter)(n).then(function(r){return kd(n),r.data=bc.call(n,n.transformResponse,r),r.headers=Fe.from(r.headers),r},function(r){return yc(r)||(kd(n),r&&r.response&&(r.response.data=bc.call(n,n.transformResponse,r.response),r.response.headers=Fe.from(r.response.headers))),Promise.reject(r)})}var cu="1.10.0";var lu={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{lu[n]=function(r){return typeof r===n||"a"+(e<1?"n ":" ")+n}});var Qp={};lu.transitional=function(e,t,r){function s(i,o){return"[Axios v"+cu+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,a)=>{if(e===!1)throw new V(s(o," has been removed"+(t?" in "+t:"")),V.ERR_DEPRECATED);return t&&!Qp[o]&&(Qp[o]=!0,console.warn(s(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,a):!0}};lu.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function xw(n,e,t){if(typeof n!="object")throw new V("options must be an object",V.ERR_BAD_OPTION_VALUE);let r=Object.keys(n),s=r.length;for(;s-- >0;){let i=r[s],o=e[i];if(o){let a=n[i],c=a===void 0||o(a,i,n);if(c!==!0)throw new V("option "+i+" must be "+c,V.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new V("Unknown option "+i,V.ERR_BAD_OPTION)}}var Ec={assertOptions:xw,validators:lu};var Or=Ec.validators,Eo=class{constructor(e){this.defaults=e||{},this.interceptors={request:new xd,response:new xd}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;let i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+i):r.stack=i}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Xt(this.defaults,t);let{transitional:r,paramsSerializer:s,headers:i}=t;r!==void 0&&Ec.assertOptions(r,{silentJSONParsing:Or.transitional(Or.boolean),forcedJSONParsing:Or.transitional(Or.boolean),clarifyTimeoutError:Or.transitional(Or.boolean)},!1),s!=null&&(T.isFunction(s)?t.paramsSerializer={serialize:s}:Ec.assertOptions(s,{encode:Or.function,serialize:Or.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Ec.assertOptions(t,{baseUrl:Or.spelling("baseURL"),withXsrfToken:Or.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&T.merge(i.common,i[t.method]);i&&T.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),t.headers=Fe.concat(o,i);let a=[],c=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(t)===!1||(c=c&&b.synchronous,a.unshift(b.fulfilled,b.rejected))});let l=[];this.interceptors.response.forEach(function(b){l.push(b.fulfilled,b.rejected)});let u,d=0,x;if(!c){let y=[au.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,l),x=y.length,u=Promise.resolve(t);d<x;)u=u.then(y[d++],y[d++]);return u}x=a.length;let g=t;for(d=0;d<x;){let y=a[d++],b=a[d++];try{g=y(g)}catch(A){b.call(this,A);break}}try{u=au.call(this,g)}catch(y){return Promise.reject(y)}for(d=0,x=l.length;d<x;)u=u.then(l[d++],l[d++]);return u}getUri(e){e=Xt(this.defaults,e);let t=Ac(e.baseURL,e.url,e.allowAbsoluteUrls);return xc(t,e.params,e.paramsSerializer)}};T.forEach(["delete","get","head","options"],function(e){Eo.prototype[e]=function(t,r){return this.request(Xt(r||{},{method:e,url:t,data:(r||{}).data}))}});T.forEach(["post","put","patch"],function(e){function t(r){return function(i,o,a){return this.request(Xt(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Eo.prototype[e]=t(),Eo.prototype[e+"Form"]=t(!0)});var Sc=Eo;var Od=class n{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});let r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i,o=new Promise(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},e(function(i,o,a){r.reason||(r.reason=new kr(i,o,a),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=r=>{e.abort(r)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new n(function(s){e=s}),cancel:e}}},jp=Od;function Bd(n){return function(t){return n.apply(null,t)}}function Ud(n){return T.isObject(n)&&n.isAxiosError===!0}var Dd={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(Dd).forEach(([n,e])=>{Dd[e]=n});var Yp=Dd;function Zp(n){let e=new Sc(n),t=hc(Sc.prototype.request,e);return T.extend(t,Sc.prototype,e,{allOwnKeys:!0}),T.extend(t,e,null,{allOwnKeys:!0}),t.create=function(s){return Zp(Xt(n,s))},t}var Ue=Zp(yo);Ue.Axios=Sc;Ue.CanceledError=kr;Ue.CancelToken=jp;Ue.isCancel=yc;Ue.VERSION=cu;Ue.toFormData=Gn;Ue.AxiosError=V;Ue.Cancel=Ue.CanceledError;Ue.all=function(e){return Promise.all(e)};Ue.spread=Bd;Ue.isAxiosError=Ud;Ue.mergeConfig=Xt;Ue.AxiosHeaders=Fe;Ue.formToJSON=n=>tu(T.isHTMLForm(n)?new FormData(n):n);Ue.getAdapter=ou.getAdapter;Ue.HttpStatusCode=Yp;Ue.default=Ue;var uu=Ue;var{Axios:D6,AxiosError:F6,CanceledError:M6,isCancel:L6,CancelToken:_6,VERSION:H6,all:G6,Cancel:z6,isAxiosError:V6,spread:K6,toFormData:W6,AxiosHeaders:q6,HttpStatusCode:J6,formToJSON:Q6,getAdapter:j6,mergeConfig:Y6}=uu;var Tc=class extends Error{constructor(t,r){super(r);this.code=t;this.name="HyperliquidAPIError"}},fu=class extends Error{constructor(e){super(e),this.name="AuthenticationError"}};function Xp(n){if(n.response){let e=n.response.data&&n.response.data.code?n.response.data.code:n.response.status||"UNKNOWN_ERROR",t=n.response.data?n.response.data.message||(typeof n.response.data=="string"?n.response.data:"An unknown error occurred"):"An unknown error occurred";throw new Tc(e,t)}else throw n.request?new Tc("NETWORK_ERROR","No response received from the server"):new Tc("REQUEST_SETUP_ERROR",n.message||"Unknown error occurred")}var zn=class{constructor(e,t="/",r){h(this,"client");h(this,"endpoint");h(this,"rateLimiter");this.endpoint=t,this.client=uu.create({baseURL:e,headers:{"Content-Type":"application/json"}}),this.rateLimiter=r}async makeRequest(e,t=2,r=this.endpoint){try{await this.rateLimiter.waitForToken(t);let s=await this.client.post(r,e);if(s.data===null||s.data===void 0)throw new Error("Received null or undefined response data");return s.data}catch(s){Xp(s)}}};var du=class{constructor(e,t,r,s){h(this,"spot");h(this,"perpetuals");h(this,"httpApi");h(this,"generalAPI");h(this,"symbolConversion");h(this,"parent");this.httpApi=new zn(e,xo.INFO,t),this.symbolConversion=r,this.parent=s,this.generalAPI=new Kl(this.httpApi,this.symbolConversion,this.parent),this.spot=new Wl(this.httpApi,this.symbolConversion),this.perpetuals=new ql(this.httpApi,this.symbolConversion,this.parent)}async getAssetIndex(e){return await this.parent.ensureInitialized(),await this.symbolConversion.getAssetIndex(e)}async getInternalName(e){return await this.parent.ensureInitialized(),await this.symbolConversion.convertSymbol(e)}async getAllAssets(){return await this.parent.ensureInitialized(),await this.symbolConversion.getAllAssets()}async getAllMids(e=!1){return await this.parent.ensureInitialized(),this.generalAPI.getAllMids(e)}async getUserOpenOrders(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.getUserOpenOrders(e,t)}async getFrontendOpenOrders(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.getFrontendOpenOrders(e,t)}async getUserFills(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.getUserFills(e,t)}async getUserFillsByTime(e,t,r,s=!1){return await this.parent.ensureInitialized(),this.generalAPI.getUserFillsByTime(e,t,r,s)}async getUserRateLimit(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.getUserRateLimit(e,t)}async getOrderStatus(e,t,r=!1){return await this.parent.ensureInitialized(),this.generalAPI.getOrderStatus(e,t,r)}async getL2Book(e,t=!1,r=5,s){return await this.parent.ensureInitialized(),this.generalAPI.getL2Book(e,t,r,s)}async getCandleSnapshot(e,t,r,s,i=!1){return await this.parent.ensureInitialized(),this.generalAPI.getCandleSnapshot(e,t,r,s,i)}async getMaxBuilderFee(e,t,r=!1){return await this.parent.ensureInitialized(),this.generalAPI.getMaxBuilderFee(e,t,r)}async getHistoricalOrders(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.getHistoricalOrders(e,t)}async getUserTwapSliceFills(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.getUserTwapSliceFills(e,t)}async getSubAccounts(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.getSubAccounts(e,t)}async getVaultDetails(e,t,r=!1){return await this.parent.ensureInitialized(),this.generalAPI.getVaultDetails(e,t,r)}async getUserVaultEquities(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.getUserVaultEquities(e,t)}async getUserRole(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.getUserRole(e,t)}async getDelegations(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.getDelegations(e,t)}async getDelegatorSummary(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.getDelegatorSummary(e,t)}async getDelegatorHistory(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.getDelegatorHistory(e,t)}async getDelegatorRewards(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.getDelegatorRewards(e,t)}async validatorSummaries(e=!1){return await this.parent.ensureInitialized(),this.generalAPI.validatorSummaries(e)}async vaultSummaries(e=!1){return await this.parent.ensureInitialized(),this.generalAPI.vaultSummaries(e)}async userFees(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.userFees(e,t)}async portfolio(e,t=!1){return await this.parent.ensureInitialized(),this.generalAPI.portfolio(e,t)}async preTransferCheck(e,t,r=!1){return await this.parent.ensureInitialized(),this.generalAPI.preTransferCheck(e,t,r)}async referral(e,t=!1){return await