From 3bae1db68ae4b7dea77f404d20a689c06e187f55 Mon Sep 17 00:00:00 2001 From: "Tiago Siebler @ Siebly.io" Date: Wed, 4 Nov 2026 15:41:05 +0000 Subject: [PATCH 1/2] fix(v1.0.2): book example in readme --- .gitignore | 1 + README.md | 3 +-- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index d583d66..2449020 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ README_BEFORE_RELEASE.md examples/tstests /tmp/ localtest.sh +rest-ts.ts diff --git a/README.md b/README.md index 48777b7..5f8b668 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,6 @@ const mids = await client.getAllMids(); const book = await client.getOrderBook({ coin: 'BTC', nSigFigs: 5, - mantissa: 1, }); const perpSummary = await client.getPerpAccountSummary({ user: '0x1234567890123456789012345678901234567890', @@ -376,9 +375,9 @@ const book = { type: 'l2Book', coin: 'BTC', nSigFigs: 5, - mantissa: 1, fast: true, } as const; + const fills = { type: 'userFills', user: '0x1234567890123456789012345678901234567890', diff --git a/package-lock.json b/package-lock.json index d6e3f70..a411c56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@siebly/hyperliquid-api", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@siebly/hyperliquid-api", - "version": "1.0.1", + "version": "1.0.2", "license": "MIT", "dependencies": { "@msgpack/msgpack": "^3.1.2", diff --git a/package.json b/package.json index 08aa366..e68eded 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@siebly/hyperliquid-api", - "version": "1.0.1", + "version": "1.0.2", "description": "Professional JavaScript & Node.js SDK for Hyperliquid's REST APIs and WebSockets, built in TypeScript with strong end to end tests.", "scripts": { "clean": "node scripts/clean.mjs", From c502f2ee581260191d8bd5555a776b0735135377 Mon Sep 17 00:00:00 2001 From: "Tiago Siebler @ Siebly.io" Date: Wed, 4 Nov 2026 15:44:34 +0000 Subject: [PATCH 2/2] chore: readme examples --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5f8b668..daf0326 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ Node.js 22 or newer is supported. Request and response types are exported from the package root. Every documented Info and Exchange operation has a corresponding `RestClient` method. Public lookup methods use `get...` names based on the information they return instead of exposing Hyperliquid's internal request type names. See the [examples](./examples) directory for REST API, WebSocket, and WebSocket API samples. -Exchange methods share one response wrapper: `ExchangeResponse` for acknowledgements, or `ExchangeResponse` when the response contains data, such as `ExchangeResponse` for orders and `ExchangeResponse` for a new vault or subaccount address. Check `status === 'ok'` before reading `response.data`. Raw Exchange methods use `ExchangeResponse` because the response depends on the submitted action. The same types apply to `RestClient` and `WebsocketAPIClient`. +Exchange methods share one response wrapper: `ExchangeResponse` for acknowledgements, or `ExchangeResponse` when the response contains data, such as `ExchangeResponse` for orders and `ExchangeResponse` for a new vault or subaccount address. For an order result, check `order.status === 'ok'` before reading `order.response.data`. Raw Exchange methods use `ExchangeResponse` because the response depends on the submitted action. The same types apply to `RestClient` and `WebsocketAPIClient`. ## Issues & Discussion @@ -187,7 +187,7 @@ console.log('Account:', balances.user); console.log('Spot:', balances.spot.balances); console.log('Perpetuals:', balances.perp.assetPositions); -const result = await client.submitOrder({ +const order = await client.submitOrder({ orders: [ { a: 'BTC', @@ -199,6 +199,8 @@ const result = await client.submitOrder({ }, ], }); + +if (order.status === 'ok') console.log(order.response.data); ``` We've added some convenient wrapper methods for common workflows: