---
title: "Hyperliquid JavaScript & TypeScript SDK for Node.js | Siebly"
description: "Hyperliquid JavaScript and TypeScript SDK with Info and Exchange clients, Spot and perpetual orders, WebSockets, Testnet, proxies, and examples."
canonical: "https://siebly.io/sdk/hyperliquid/javascript"
---

# Hyperliquid JavaScript SDK

Use @siebly/hyperliquid-api to read Hyperliquid market data, manage orders, and consume streams from Node.js. JavaScript and TypeScript use the same clients; request and response types are included.

- [Make a first request](#quickstart)
- [Full tutorial](/sdk/hyperliquid/javascript/tutorial)
- [Endpoint reference](#endpoint-reference)

- [npm: @siebly/hyperliquid-api](https://www.npmjs.com/package/@siebly/hyperliquid-api)
- [GitHub repository](https://github.com/sieblyio/hyperliquid-api)
- [README](https://github.com/sieblyio/hyperliquid-api#readme)
- [Hyperliquid examples](/examples/Hyperliquid)
- [View release feed](/releases/sdk/hyperliquid-api)

## Choose a client

- [RestClient](/sdk/hyperliquid/javascript/tutorial): Market data, account state, orders, transfers, staking, vaults, subaccounts, HIP-3, and other Info and Exchange operations
- [WebsocketClient](/sdk/hyperliquid/javascript/tutorial): Public market data and address-scoped account subscriptions
- [WebsocketAPIClient](/sdk/hyperliquid/javascript/tutorial): Awaitable Info and signed Exchange requests over the WebSocket POST protocol

## Integration Profile

**REST API:** Use the Hyperliquid SDK for Info queries, account state, asset resolution, and signed Exchange actions across perpetual and Spot markets.

**WebSockets:** Use WebsocketClient for public and address-scoped subscriptions, or WebsocketAPIClient for awaitable Info and signed Exchange requests over WebSocket.

**Reliability:** Keep network, asset, account address, signer, and transport explicit; inspect every Exchange response status and rebuild account state after a stream gap.

<a id="quickstart"></a>

## Make a first public request

In a Node.js project, install the package once. The REST and WebSocket API examples below use `.mjs` files so Node.js can run their imports directly.

```sh
npm install @siebly/hyperliquid-api
```

### REST API

Read public BTC perpetual data with `RestClient`. These public requests require no credentials.

Save the code as `rest-public.mjs` and run:

```sh
node rest-public.mjs
```

```javascript
import { RestClient } from '@siebly/hyperliquid-api';

const client = new RestClient();

async function main() {
  try {
    const status = await client.getExchangeStatus();
    console.log('Exchange status:', status);
  } catch (error) {
    console.error('Exchange-status request failed:', error);
  }

  try {
    const mids = await client.getAllMids();
    console.log('BTC midpoint:', mids.BTC);
  } catch (error) {
    console.error('Midpoint request failed:', error);
  }

  try {
    const metadata = await client.getPerpMetadata();
    const btc = metadata.universe.find((asset) => asset.name === 'BTC');
    console.log('BTC perpetual metadata:', btc);
  } catch (error) {
    console.error('Perpetual metadata request failed:', error);
  }

  try {
    const orderBook = await client.getOrderBook({
      coin: 'BTC',
    });
    console.log('Best bid:', orderBook?.levels[0][0]);
    console.log('Best ask:', orderBook?.levels[1][0]);
  } catch (error) {
    console.error('Order-book request failed:', error);
  }

  try {
    const candles = await client.getCandles({
      coin: 'BTC',
      interval: '1h',
      startTime: Date.now() - 24 * 60 * 60 * 1000,
    });
    console.log('Latest hourly candle:', candles.at(-1));
  } catch (error) {
    console.error('Candle request failed:', error);
  }

  try {
    const trades = await client.getRecentTrades({
      coin: 'BTC',
    });
    console.log('Most recent trade:', trades[0]);
  } catch (error) {
    console.error('Recent-trade request failed:', error);
  }
}

main();
```

### Expected response

Market values change on each run. These are the fields to check in the logged output.

| Field | Expected result |
| --- | --- |
| BTC midpoint / metadata | A decimal-string midpoint and a perpetual asset object from `universe`. |
| Best bid / Best ask | Objects with decimal-string `px` and `sz`, plus order count `n`. |
| Latest hourly candle / Most recent trade | A candle object with millisecond `t` and `T`, OHLC and volume strings; a trade with `coin`, `px`, `sz`, and `side`. |

[View the source example](https://github.com/sieblyio/hyperliquid-api/blob/main/docs/HYPERLIQUID_SDK_QUICKSTART_GUIDE.md)

- [More REST examples](https://github.com/sieblyio/hyperliquid-api/blob/main/examples/Rest/rest-public.ts)

### WebSocket Streams

```typescript
import { DefaultLogger, WebsocketClient } from '@siebly/hyperliquid-api';

// or
// import { DefaultLogger, WebsocketClient } from '@siebly/hyperliquid-api';

/**
 * Public market-data subscriptions.
 *
 * Listen for data with on('message') and acknowledgements with on('response').
 * Every event includes the connection's wsKey.
 *
 * npx tsx examples/Websocket/ws-public.ts
 */
const logger = {
  ...DefaultLogger,
  // Uncomment to log connection lifecycle events:
  trace: (...params: unknown[]) => console.log(new Date(), 'trace', ...params),
};

const wsClient = new WebsocketClient(
  {
    // testnet: true,
  },
  logger,
);

wsClient.on('open', (data) => {
  console.log('ws connection opened:', data.wsKey);
});

wsClient.on('reconnecting', ({ wsKey }) => {
  console.log('ws automatically reconnecting.... ', wsKey);
});

wsClient.on('reconnected', (data) => {
  console.log('ws has reconnected ', data?.wsKey);
});

wsClient.on('exception', ({ event, data, wsKey }) => {
  console.error('ws exception:', wsKey, event ?? data);
});

wsClient.on('close', ({ wsKey }) => {
  console.log('ws closed:', wsKey);
});

wsClient.on('response', (event) => {
  console.log('ws response:', event.wsKey, event.channel, event.data);
});

wsClient.on('message', (event) => {
  switch (event.channel) {
    case 'allMids':
      console.log('allMids BTC:', event.data.mids.BTC);
      break;
    case 'l2Book':
      console.log(
        'Order book:',
        event.wsKey,
        event.data.coin,
        event.data.levels,
      );
      break;
    case 'trades':
      console.log('Trades:', event.wsKey, event.data);
      break;
    default:
      console.log(
        `Market update (unhandled in switch case: "${event.channel}"):`,
        event.wsKey,
        event.channel,
        event.data,
      );
  }
});

async function main() {
  try {
    await wsClient.subscribe([
      { type: 'allMids' },
      { type: 'l2Book', coin: 'ETH' },
      { type: 'trades', coin: 'BTC' },
      { type: 'candle', coin: 'ETH', interval: '1m' },
      { type: 'bbo', coin: 'ETH' },
      { type: 'activeAssetCtx', coin: 'BTC' },
      // Native Spot universe names pass through without metadata requests.
      { type: 'trades', coin: 'PURR/USDC' },
    ]);

    // For a readable alias, resolve it explicitly before subscribing:
    // const coin = await wsClient.nameToCoin('HYPE/USDC');
    // await wsClient.subscribe({ type: 'trades', coin });
  } catch (error) {
    console.error('subscribe failed:', error);
  }
}

main();
```

[View the source example](https://github.com/sieblyio/hyperliquid-api/blob/main/examples/Websocket/ws-public.ts)

### WebSocket API

Read public midpoints through the WebSocket API without a signer. The result maps asset names to decimal-string prices. Close the connection after the request finishes.

Save the code as `ws-api-public.mjs` and run:

```sh
node ws-api-public.mjs
```

```javascript
import { WebsocketAPIClient } from '@siebly/hyperliquid-api';

const wsApi = new WebsocketAPIClient();

try {
  const mids = await wsApi.getAllMids();
  console.log('BTC midpoint:', mids.BTC);
} finally {
  wsApi.getWSClient().closeAll();
}
```

[View the source example](https://github.com/sieblyio/hyperliquid-api/blob/main/examples/Websocket/WS-API/ws-api-client.ts)

## Endpoint Reference

[View the endpoint map source](https://github.com/sieblyio/hyperliquid-api/blob/main/docs/endpointFunctionList.md)

### Endpoint maps

<p align="center">
  <a href="https://www.npmjs.com/package/@siebly/hyperliquid-api">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://github.com/sieblyio/hyperliquid-api/blob/main/docs/images/logoDarkMode2.svg?raw=true#gh-dark-mode-only">
      <img alt="SDK Logo" src="https://github.com/sieblyio/hyperliquid-api/blob/main/docs/images/logoBrightMode2.svg?raw=true#gh-light-mode-only">
    </picture>
  </a>
</p>

Each REST client is a JavaScript class, which provides functions individually mapped to each endpoint available in the exchange's API offering.

The following table shows all methods available in each REST client, whether the method requires authentication (automatically handled if a private key or signer is provided), as well as the exact endpoint each method is connected to.

Hyperliquid exposes two HTTP paths: `POST /info` and `POST /exchange`. The value in parentheses is the request `type` field from the official docs (for example `allMids`, `order`, `usdSend`). Search this table for that type name to find the SDK function.

This can be used to easily find which method to call, once you have [found which endpoint you're looking to use](https://github.com/sieblyio/awesome-crypto-examples/wiki/How-to-find-SDK-functions-that-match-API-docs-endpoint).

All REST clients are in the [src](https://github.com/sieblyio/hyperliquid-api/tree/main/src) folder. For usage examples, make sure to check the [examples](https://github.com/sieblyio/hyperliquid-api/tree/main/examples) folder.

List of clients:

- [RestClient](#restclientts)

If anything is missing or wrong, please open an issue or let us know in our [Node.js Traders](https://t.me/nodetraders) telegram group!

#### How to use table

Table consists of 4 parts:

- Function name
- AUTH
- HTTP Method
- Endpoint

**Function name** is the name of the function that can be called through the SDK. Check examples folder in the repo for more help on how to use them!

**AUTH** is a boolean value that indicates if the function requires authentication - which means you need to pass your private key or a signer to the SDK. Public Info calls work with `new RestClient()`. Account Info, L1 actions, and user-signed actions need credentials.

**HTTP Method** shows HTTP method that the function uses to call the endpoint. Hyperliquid uses POST for both Info and Exchange.

**Endpoint** is the path plus Hyperliquid `type`. Best way to find exact function you need is to search for the official `type` (or `/info` / `/exchange`) in this table and find corresponding function name.

### RestClient.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in [RestClient.ts](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts).

WebsocketAPIClient extends RestClient and exposes the same methods over Hyperliquid's WebSocket POST protocol (`info` / `action`).

| Function                                                                                                          | AUTH | HTTP Method | Endpoint                                             |
| ----------------------------------------------------------------------------------------------------------------- | :--: | :---------: | ---------------------------------------------------- |
| [getAllMids()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L200)                      |      |     POST    | `/info (allMids)`                                    |
| [getActiveAssetData()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L208)              |  🔐  |     POST    | `/info (activeAssetData)`                            |
| [getAllBorrowLendReserveStates()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L219)   |      |     POST    | `/info (allBorrowLendReserveStates)`                 |
| [getAllPerpMetadata()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L229)              |      |     POST    | `/info (allPerpMetas)`                               |
| [getApprovedBuilders()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L236)             |  🔐  |     POST    | `/info (approvedBuilders)`                           |
| [getBorrowLendReserveState()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L243)       |      |     POST    | `/info (borrowLendReserveState)`                     |
| [getUserBorrowLendState()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L254)          |  🔐  |     POST    | `/info (borrowLendUserState)`                        |
| [getCandles()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L266)                      |      |     POST    | `/info (candleSnapshot)`                             |
| [getPerpAccountSummary()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L279)           |  🔐  |     POST    | `/info (clearinghouseState)`                         |
| [getStakingDelegations()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L288)           |  🔐  |     POST    | `/info (delegations)`                                |
| [getStakingHistory()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L299)               |  🔐  |     POST    | `/info (delegatorHistory)`                           |
| [getStakingRewards()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L310)               |  🔐  |     POST    | `/info (delegatorRewards)`                           |
| [getStakingSummary()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L317)               |  🔐  |     POST    | `/info (delegatorSummary)`                           |
| [getExchangeStatus()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L321)               |      |     POST    | `/info (exchangeStatus)`                             |
| [getExtraAgents()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L325)                  |  🔐  |     POST    | `/info (extraAgents)`                                |
| [getFrontendOpenOrders()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L334)           |  🔐  |     POST    | `/info (frontendOpenOrders)`                         |
| [getFundingHistory()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L343)               |      |     POST    | `/info (fundingHistory)`                             |
| [getGossipPriorityAuctionStatus()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L352)  |      |     POST    | `/info (gossipPriorityAuctionStatus)`                |
| [getGossipRootIps()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L356)                |      |     POST    | `/info (gossipRootIps)`                              |
| [getOrderHistory()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L365)                 |  🔐  |     POST    | `/info (historicalOrders)`                           |
| [getVipStatus()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L369)                    |  🔐  |     POST    | `/info (isVip)`                                      |
| [getOrderBook()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L379)                    |      |     POST    | `/info (l2Book)`                                     |
| [getLeadingVaults()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L388)                |  🔐  |     POST    | `/info (leadingVaults)`                              |
| [getLegalStatus()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L392)                  |  🔐  |     POST    | `/info (legalCheck)`                                 |
| [getLiquidatablePositions()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L396)        |      |     POST    | `/info (liquidatable)`                               |
| [getMarginTable()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L400)                  |      |     POST    | `/info (marginTable)`                                |
| [getMaxBuilderFee()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L409)                |  🔐  |     POST    | `/info (maxBuilderFee)`                              |
| [getMaxMarketOrderNotionals()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L413)      |      |     POST    | `/info (maxMarketOrderNtls)`                         |
| [getPerpMetadata()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L422)                 |      |     POST    | `/info (meta)`                                       |
| [getPerpAssetContexts()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L433)            |      |     POST    | `/info (metaAndAssetCtxs)`                           |
| [getOpenOrders()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L445)                   |  🔐  |     POST    | `/info (openOrders)`                                 |
| [getOrderStatus()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L455)                  |  🔐  |     POST    | `/info (orderStatus)`                                |
| [getOutcomeMetadata()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L462)              |      |     POST    | `/info (outcomeMeta)`                                |
| [getOutcomeDeployerLimits()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L471)        |      |     POST    | `/info (outcomeDeployerLimits)`                      |
| [getPerpAnnotation()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L482)               |      |     POST    | `/info (perpAnnotation)`                             |
| [getPerpCategories()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L491)               |      |     POST    | `/info (perpCategories)`                             |
| [getConcisePerpAnnotations()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L500)       |      |     POST    | `/info (perpConciseAnnotations)`                     |
| [getPerpDeployAuctionStatus()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L507)      |      |     POST    | `/info (perpDeployAuctionStatus)`                    |
| [getPerpDexLimits()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L516)                |      |     POST    | `/info (perpDexLimits)`                              |
| [getPerpDexStatus()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L525)                |      |     POST    | `/info (perpDexStatus)`                              |
| [getPerpDexs()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L535)                     |      |     POST    | `/info (perpDexs)`                                   |
| [getPerpsAtOpenInterestCap()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L544)       |      |     POST    | `/info (perpsAtOpenInterestCap)`                     |
| [getPortfolio()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L554)                    |  🔐  |     POST    | `/info (portfolio)`                                  |
| [getPreTransferCheck()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L558)             |      |     POST    | `/info (preTransferCheck)`                           |
| [getPredictedFundingRates()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L571)        |      |     POST    | `/info (predictedFundings)`                          |
| [getRecentTrades()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L575)                 |      |     POST    | `/info (recentTrades)`                               |
| [getReferralInfo()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L586)                 |  🔐  |     POST    | `/info (referral)`                                   |
| [getSettledOutcome()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L595)               |      |     POST    | `/info (settledOutcome)`                             |
| [getBalances()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L601)                     |  🔐  |     POST    | `/info (clearinghouseState, spotClearinghouseState)` |
| [getSpotBalances()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L622)                 |  🔐  |     POST    | `/info (spotClearinghouseState)`                     |
| [getSpotDeployAuctionStatus()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L629)      |  🔐  |     POST    | `/info (spotDeployState)`                            |
| [getSpotMetadata()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L638)                 |      |     POST    | `/info (spotMeta)`                                   |
| [getSpotAssetContexts()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L648)            |      |     POST    | `/info (spotMetaAndAssetCtxs)`                       |
| [getSpotPairDeployAuctionStatus()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L655)  |      |     POST    | `/info (spotPairDeployAuctionStatus)`                |
| [getSubAccounts()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L664)                  |  🔐  |     POST    | `/info (subAccounts)`                                |
| [getSubAccountsWithAllDexStates()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L668)  |  🔐  |     POST    | `/info (subAccounts2)`                               |
| [getTokenDetails()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L680)                 |      |     POST    | `/info (tokenDetails)`                               |
| [getTwapHistory()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L684)                  |  🔐  |     POST    | `/info (twapHistory)`                                |
| [getUserAbstraction()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L691)              |  🔐  |     POST    | `/info (userAbstraction)`                            |
| [getUserBorrowLendInterest()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L695)       |  🔐  |     POST    | `/info (userBorrowLendInterest)`                     |
| [getUserDexAbstraction()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L704)           |  🔐  |     POST    | `/info (userDexAbstraction)`                         |
| [getUserFees()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L711)                     |  🔐  |     POST    | `/info (userFees)`                                   |
| [getUserFills()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L721)                    |  🔐  |     POST    | `/info (userFills)`                                  |
| [getUserFillsByTime()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L731)              |  🔐  |     POST    | `/info (userFillsByTime)`                            |
| [getUserFundingHistory()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L740)           |  🔐  |     POST    | `/info (userFunding)`                                |
| [getUserNonFundingLedgerUpdates()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L753)  |  🔐  |     POST    | `/info (userNonFundingLedgerUpdates)`                |
| [getUserRateLimit()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L765)                |  🔐  |     POST    | `/info (userRateLimit)`                              |
| [getUserRole()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L775)                     |      |     POST    | `/info (userRole)`                                   |
| [getMultiSigSigners()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L779)              |  🔐  |     POST    | `/info (userToMultiSigSigners)`                      |
| [getUserTwapSliceFills()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L790)           |  🔐  |     POST    | `/info (userTwapSliceFills)`                         |
| [getUserTwapSliceFillsByTime()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L794)     |  🔐  |     POST    | `/info (userTwapSliceFillsByTime)`                   |
| [getUserVaultDeposits()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L803)            |  🔐  |     POST    | `/info (userVaultEquities)`                          |
| [getValidatorL1Votes()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L809)             |      |     POST    | `/info (validatorL1Votes)`                           |
| [getValidatorSummaries()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L813)           |      |     POST    | `/info (validatorSummaries)`                         |
| [getVaultDetails()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L823)                 |      |     POST    | `/info (vaultDetails)`                               |
| [getVaultSummaries()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L829)               |      |     POST    | `/info (vaultSummaries)`                             |
| [getWebData2()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L833)                     |  🔐  |     POST    | `/info (webData2)`                                   |
| [getAlignedQuoteTokenStatus()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L838)      |      |     POST    | `/info (alignedQuoteTokenInfo)`                      |
| [submitOrder()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L850)                     |  🔐  |     POST    | `/exchange (order)`                                  |
| [submitMarketOrder()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L866)               |  🔐  |     POST    | `/exchange (order)`                                  |
| [submitMarketClose()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L921)               |  🔐  |     POST    | `/exchange (order)`                                  |
| [submitLimitOrder()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L965)                |  🔐  |     POST    | `/exchange (order)`                                  |
| [modifyOrder()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1007)                    |  🔐  |     POST    | `/exchange (modify)`                                 |
| [modifyOrders()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1023)                   |  🔐  |     POST    | `/exchange (batchModify)`                            |
| [cancelOrders()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1042)                   |  🔐  |     POST    | `/exchange (cancel)`                                 |
| [cancelOrdersByClientOrderId()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1060)    |  🔐  |     POST    | `/exchange (cancelByCloid)`                          |
| [updateLeverage()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1076)                 |  🔐  |     POST    | `/exchange (updateLeverage)`                         |
| [updateIsolatedMargin()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1096)           |  🔐  |     POST    | `/exchange (updateIsolatedMargin)`                   |
| [setIsolatedMarginLeverage()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1108)      |  🔐  |     POST    | `/exchange (topUpIsolatedOnlyMargin)`                |
| [submitTwapOrder()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1124)                |  🔐  |     POST    | `/exchange (twapOrder)`                              |
| [cancelTwapOrder()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1136)                |  🔐  |     POST    | `/exchange (twapCancel)`                             |
| [submitTrailingStop()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1150)             |  🔐  |     POST    | `/exchange (trailingStop)`                           |
| [setCancelAllAfter()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1163)              |  🔐  |     POST    | `/exchange (scheduleCancel)`                         |
| [setReferrer()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1170)                    |  🔐  |     POST    | `/exchange (setReferrer)`                            |
| [registerReferrer()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1176)               |  🔐  |     POST    | `/exchange (registerReferrer)`                       |
| [approveApiWallet()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1214)               |  🔐  |     POST    | `/exchange (approveAgent)`                           |
| [sendUsd()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1234)                        |  🔐  |     POST    | `/exchange (usdSend)`                                |
| [sendSpotAsset()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1251)                  |  🔐  |     POST    | `/exchange (spotSend)`                               |
| [withdrawUsd()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1266)                    |  🔐  |     POST    | `/exchange (withdraw3)`                              |
| [transferUsdBetweenSpotAndPerp()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1283)  |  🔐  |     POST    | `/exchange (usdClassTransfer)`                       |
| [sendAsset()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1301)                      |  🔐  |     POST    | `/exchange (sendAsset)`                              |
| [sendToEvmWithData()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1322)              |  🔐  |     POST    | `/exchange (sendToEvmWithData)`                      |
| [sendAssetFromApiWallet()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1339)         |  🔐  |     POST    | `/exchange (agentSendAsset)`                         |
| [depositIntoStaking()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1360)             |  🔐  |     POST    | `/exchange (cDeposit)`                               |
| [withdrawFromStaking()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1377)            |  🔐  |     POST    | `/exchange (cWithdraw)`                              |
| [delegateOrUndelegateStake()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1394)      |  🔐  |     POST    | `/exchange (tokenDelegate)`                          |
| [convertToMultiSigUser()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1406)          |  🔐  |     POST    | `/exchange (convertToMultiSigUser)`                  |
| [linkStakingAccount()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1429)             |  🔐  |     POST    | `/exchange (linkStakingUser)`                        |
| [disableStakingTradingLink()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1441)      |  🔐  |     POST    | `/exchange (stakingLinkDisableTradingUser)`          |
| [setUserPortfolioMargin()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1453)         |  🔐  |     POST    | `/exchange (userPortfolioMargin)`                    |
| [setUserAbstraction()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1470)             |  🔐  |     POST    | `/exchange (userSetAbstraction)`                     |
| [setUserDexAbstraction()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1487)          |  🔐  |     POST    | `/exchange (userDexAbstraction)`                     |
| [enableApiWalletDexAbstraction()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1504)  |  🔐  |     POST    | `/exchange (agentEnableDexAbstraction)`              |
| [setApiWalletAbstraction()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1515)        |  🔐  |     POST    | `/exchange (agentSetAbstraction)`                    |
| [executeBorrowLendOperation()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1522)     |  🔐  |     POST    | `/exchange (borrowLend)`                             |
| [claimRewards()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1543)                   |  🔐  |     POST    | `/exchange (claimRewards)`                           |
| [createSubAccount()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1547)               |  🔐  |     POST    | `/exchange (createSubAccount)`                       |
| [createVault()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1554)                    |  🔐  |     POST    | `/exchange (createVault)`                            |
| [setEvmBigBlocks()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1561)                |  🔐  |     POST    | `/exchange (evmUserModify)`                          |
| [finalizeEvmContract()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1568)            |  🔐  |     POST    | `/exchange (finalizeEvmContract)`                    |
| [submitGossipPriorityBid()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1581)        |  🔐  |     POST    | `/exchange (gossipPriorityBid)`                      |
| [transferHip3LiquidatorFunds()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1594)    |  🔐  |     POST    | `/exchange (hip3LiquidatorTransfer)`                 |
| [invalidateNonce()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1604)                |  🔐  |     POST    | `/exchange (noop)`                                   |
| [deployPerp()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1608)                     |  🔐  |     POST    | `/exchange (perpDeploy)`                             |
| [deploySpot()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1615)                     |  🔐  |     POST    | `/exchange (spotDeploy)`                             |
| [reserveAdditionalActions()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1627)       |  🔐  |     POST    | `/exchange (reserveRequestWeight)`                   |
| [setDisplayName()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1634)                 |  🔐  |     POST    | `/exchange (setDisplayName)`                         |
| [setSpotDusting()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1641)                 |  🔐  |     POST    | `/exchange (spotUser)`                               |
| [renameSubAccount()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1648)               |  🔐  |     POST    | `/exchange (subAccountModify)`                       |
| [transferSpotToOrFromSubAccount()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1655) |  🔐  |     POST    | `/exchange (subAccountSpotTransfer)`                 |
| [transferUsdToOrFromSubAccount()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1666)  |  🔐  |     POST    | `/exchange (subAccountTransfer)`                     |
| [transferVaultFunds()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1676)             |  🔐  |     POST    | `/exchange (vaultTransfer)`                          |
| [distributeVaultFunds()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1683)           |  🔐  |     POST    | `/exchange (vaultDistribute)`                        |
| [modifyVault()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1690)                    |  🔐  |     POST    | `/exchange (vaultModify)`                            |
| [updateValidatorL1Stream()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1714)        |  🔐  |     POST    | `/exchange (validatorL1Stream)`                      |
| [submitSignerAction()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1725)             |  🔐  |     POST    | `/exchange (CSignerAction)`                          |
| [submitValidatorAction()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1732)          |  🔐  |     POST    | `/exchange (CValidatorAction)`                       |
| [authorizeAqav2Role()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1745)             |  🔐  |     POST    | `/exchange (authorizeAqav2Role)`                     |
| [submitUserOutcome()](https://github.com/sieblyio/hyperliquid-api/blob/main/src/RestClient.ts#L1760)              |  🔐  |     POST    | `/exchange (userOutcome)`                            |

## Hyperliquid JavaScript FAQ

### What does the Hyperliquid JavaScript SDK cover?

Hyperliquid supports Spot, Futures, WebSockets, and WebSocket API workflows. The JavaScript guide covers the main REST and WebSocket integration patterns.

### How do I authenticate private Hyperliquid API calls in JavaScript?

The public REST example above needs no credentials. For private calls, follow the authentication setup for @siebly/hyperliquid-api in the full tutorial, including the credentials or signer required by your exchange.

- [Hyperliquid authentication and setup](/sdk/hyperliquid/javascript/tutorial)

### Does the Hyperliquid JavaScript SDK help with WebSocket connection management?

Yes. Use the SDK WebSocket client for subscriptions, reconnect handling, and stream lifecycle management instead of building raw socket flows yourself.

### When should I use the Hyperliquid WebSocket API instead of REST?

Use REST for standard request and response workflows such as account queries and order management. Use the WebSocket API flow when you want persistent low-latency interactions over a connected session.

## Machine Resources

- [AI prompt framework](/ai)
- [LLM discovery](/llms.txt)
- [SDK catalog](/.well-known/siebly-sdk-catalog.json)
- [Agent skill](/.well-known/agent-skills/siebly-crypto-exchange-api/SKILL.md)
