@0xarchive/sdk 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/index.d.mts +10 -6
- package/dist/index.d.ts +10 -6
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -132,9 +132,6 @@ const history = await client.lighter.orderbook.history('BTC', {
|
|
|
132
132
|
The trades API uses cursor-based pagination for efficient retrieval of large datasets.
|
|
133
133
|
|
|
134
134
|
```typescript
|
|
135
|
-
// Get recent trades
|
|
136
|
-
const recent = await client.hyperliquid.trades.recent('BTC', 100);
|
|
137
|
-
|
|
138
135
|
// Get trade history with cursor-based pagination
|
|
139
136
|
let result = await client.hyperliquid.trades.list('BTC', {
|
|
140
137
|
start: Date.now() - 86400000,
|
|
@@ -153,6 +150,9 @@ while (result.nextCursor) {
|
|
|
153
150
|
});
|
|
154
151
|
allTrades.push(...result.data);
|
|
155
152
|
}
|
|
153
|
+
|
|
154
|
+
// Get recent trades (Lighter only - has real-time data)
|
|
155
|
+
const recent = await client.lighter.trades.recent('BTC', 100);
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
### Instruments
|
package/dist/index.d.mts
CHANGED
|
@@ -684,11 +684,8 @@ declare class OrderBookResource {
|
|
|
684
684
|
*
|
|
685
685
|
* @example
|
|
686
686
|
* ```typescript
|
|
687
|
-
* // Get recent trades
|
|
688
|
-
* const trades = await client.trades.recent('BTC');
|
|
689
|
-
*
|
|
690
687
|
* // Get trade history with cursor-based pagination (recommended)
|
|
691
|
-
* let result = await client.trades.list('BTC', {
|
|
688
|
+
* let result = await client.hyperliquid.trades.list('BTC', {
|
|
692
689
|
* start: Date.now() - 86400000,
|
|
693
690
|
* end: Date.now(),
|
|
694
691
|
* limit: 1000
|
|
@@ -697,7 +694,7 @@ declare class OrderBookResource {
|
|
|
697
694
|
* // Get all pages
|
|
698
695
|
* const allTrades = [...result.data];
|
|
699
696
|
* while (result.nextCursor) {
|
|
700
|
-
* result = await client.trades.list('BTC', {
|
|
697
|
+
* result = await client.hyperliquid.trades.list('BTC', {
|
|
701
698
|
* start: Date.now() - 86400000,
|
|
702
699
|
* end: Date.now(),
|
|
703
700
|
* cursor: result.nextCursor,
|
|
@@ -705,6 +702,9 @@ declare class OrderBookResource {
|
|
|
705
702
|
* });
|
|
706
703
|
* allTrades.push(...result.data);
|
|
707
704
|
* }
|
|
705
|
+
*
|
|
706
|
+
* // Get recent trades (Lighter only - has real-time data)
|
|
707
|
+
* const recent = await client.lighter.trades.recent('BTC');
|
|
708
708
|
* ```
|
|
709
709
|
*/
|
|
710
710
|
declare class TradesResource {
|
|
@@ -743,7 +743,11 @@ declare class TradesResource {
|
|
|
743
743
|
*/
|
|
744
744
|
list(coin: string, params: GetTradesCursorParams): Promise<CursorResponse<Trade[]>>;
|
|
745
745
|
/**
|
|
746
|
-
* Get most recent trades for a coin
|
|
746
|
+
* Get most recent trades for a coin.
|
|
747
|
+
*
|
|
748
|
+
* Note: This method is only available for Lighter (client.lighter.trades.recent())
|
|
749
|
+
* which has real-time data ingestion. Hyperliquid uses hourly backfill so this
|
|
750
|
+
* endpoint is not available for Hyperliquid.
|
|
747
751
|
*
|
|
748
752
|
* @param coin - The coin symbol (e.g., 'BTC', 'ETH')
|
|
749
753
|
* @param limit - Number of trades to return (default: 100)
|
package/dist/index.d.ts
CHANGED
|
@@ -684,11 +684,8 @@ declare class OrderBookResource {
|
|
|
684
684
|
*
|
|
685
685
|
* @example
|
|
686
686
|
* ```typescript
|
|
687
|
-
* // Get recent trades
|
|
688
|
-
* const trades = await client.trades.recent('BTC');
|
|
689
|
-
*
|
|
690
687
|
* // Get trade history with cursor-based pagination (recommended)
|
|
691
|
-
* let result = await client.trades.list('BTC', {
|
|
688
|
+
* let result = await client.hyperliquid.trades.list('BTC', {
|
|
692
689
|
* start: Date.now() - 86400000,
|
|
693
690
|
* end: Date.now(),
|
|
694
691
|
* limit: 1000
|
|
@@ -697,7 +694,7 @@ declare class OrderBookResource {
|
|
|
697
694
|
* // Get all pages
|
|
698
695
|
* const allTrades = [...result.data];
|
|
699
696
|
* while (result.nextCursor) {
|
|
700
|
-
* result = await client.trades.list('BTC', {
|
|
697
|
+
* result = await client.hyperliquid.trades.list('BTC', {
|
|
701
698
|
* start: Date.now() - 86400000,
|
|
702
699
|
* end: Date.now(),
|
|
703
700
|
* cursor: result.nextCursor,
|
|
@@ -705,6 +702,9 @@ declare class OrderBookResource {
|
|
|
705
702
|
* });
|
|
706
703
|
* allTrades.push(...result.data);
|
|
707
704
|
* }
|
|
705
|
+
*
|
|
706
|
+
* // Get recent trades (Lighter only - has real-time data)
|
|
707
|
+
* const recent = await client.lighter.trades.recent('BTC');
|
|
708
708
|
* ```
|
|
709
709
|
*/
|
|
710
710
|
declare class TradesResource {
|
|
@@ -743,7 +743,11 @@ declare class TradesResource {
|
|
|
743
743
|
*/
|
|
744
744
|
list(coin: string, params: GetTradesCursorParams): Promise<CursorResponse<Trade[]>>;
|
|
745
745
|
/**
|
|
746
|
-
* Get most recent trades for a coin
|
|
746
|
+
* Get most recent trades for a coin.
|
|
747
|
+
*
|
|
748
|
+
* Note: This method is only available for Lighter (client.lighter.trades.recent())
|
|
749
|
+
* which has real-time data ingestion. Hyperliquid uses hourly backfill so this
|
|
750
|
+
* endpoint is not available for Hyperliquid.
|
|
747
751
|
*
|
|
748
752
|
* @param coin - The coin symbol (e.g., 'BTC', 'ETH')
|
|
749
753
|
* @param limit - Number of trades to return (default: 100)
|
package/dist/index.js
CHANGED
|
@@ -521,7 +521,11 @@ var TradesResource = class {
|
|
|
521
521
|
};
|
|
522
522
|
}
|
|
523
523
|
/**
|
|
524
|
-
* Get most recent trades for a coin
|
|
524
|
+
* Get most recent trades for a coin.
|
|
525
|
+
*
|
|
526
|
+
* Note: This method is only available for Lighter (client.lighter.trades.recent())
|
|
527
|
+
* which has real-time data ingestion. Hyperliquid uses hourly backfill so this
|
|
528
|
+
* endpoint is not available for Hyperliquid.
|
|
525
529
|
*
|
|
526
530
|
* @param coin - The coin symbol (e.g., 'BTC', 'ETH')
|
|
527
531
|
* @param limit - Number of trades to return (default: 100)
|