@0xarchive/sdk 0.4.0 → 0.4.2
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 +29 -2
- package/dist/index.d.mts +76 -7
- package/dist/index.d.ts +76 -7
- package/dist/index.js +33 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Official TypeScript/JavaScript SDK for [0xarchive](https://0xarchive.io) - Histo
|
|
|
4
4
|
|
|
5
5
|
Supports multiple exchanges:
|
|
6
6
|
- **Hyperliquid** - Perpetuals data from April 2023
|
|
7
|
-
- **Lighter.xyz** - Perpetuals data
|
|
7
|
+
- **Lighter.xyz** - Perpetuals data (August 2025+ for fills, Jan 2026+ for OB, OI, Funding Rate)
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -108,13 +108,39 @@ while (result.nextCursor) {
|
|
|
108
108
|
### Instruments
|
|
109
109
|
|
|
110
110
|
```typescript
|
|
111
|
-
// List all trading instruments
|
|
111
|
+
// List all trading instruments (Hyperliquid)
|
|
112
112
|
const instruments = await client.hyperliquid.instruments.list();
|
|
113
113
|
|
|
114
114
|
// Get specific instrument details
|
|
115
115
|
const btc = await client.hyperliquid.instruments.get('BTC');
|
|
116
|
+
console.log(`BTC size decimals: ${btc.szDecimals}`);
|
|
116
117
|
```
|
|
117
118
|
|
|
119
|
+
#### Lighter.xyz Instruments
|
|
120
|
+
|
|
121
|
+
Lighter instruments have a different schema with additional fields for fees, market IDs, and minimum order amounts:
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
// List Lighter instruments (returns LighterInstrument, not Instrument)
|
|
125
|
+
const lighterInstruments = await client.lighter.instruments.list();
|
|
126
|
+
|
|
127
|
+
// Get specific Lighter instrument
|
|
128
|
+
const eth = await client.lighter.instruments.get('ETH');
|
|
129
|
+
console.log(`ETH taker fee: ${eth.takerFee}`);
|
|
130
|
+
console.log(`ETH maker fee: ${eth.makerFee}`);
|
|
131
|
+
console.log(`ETH market ID: ${eth.marketId}`);
|
|
132
|
+
console.log(`ETH min base amount: ${eth.minBaseAmount}`);
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Key differences:**
|
|
136
|
+
| Field | Hyperliquid (`Instrument`) | Lighter (`LighterInstrument`) |
|
|
137
|
+
|-------|---------------------------|------------------------------|
|
|
138
|
+
| Symbol | `name` | `symbol` |
|
|
139
|
+
| Size decimals | `szDecimals` | `sizeDecimals` |
|
|
140
|
+
| Fee info | Not available | `takerFee`, `makerFee`, `liquidationFee` |
|
|
141
|
+
| Market ID | Not available | `marketId` |
|
|
142
|
+
| Min amounts | Not available | `minBaseAmount`, `minQuoteAmount` |
|
|
143
|
+
|
|
118
144
|
### Funding Rates
|
|
119
145
|
|
|
120
146
|
```typescript
|
|
@@ -350,6 +376,7 @@ import type {
|
|
|
350
376
|
PriceLevel,
|
|
351
377
|
Trade,
|
|
352
378
|
Instrument,
|
|
379
|
+
LighterInstrument,
|
|
353
380
|
FundingRate,
|
|
354
381
|
OpenInterest,
|
|
355
382
|
CursorResponse,
|
package/dist/index.d.mts
CHANGED
|
@@ -148,7 +148,7 @@ interface CursorResponse<T> {
|
|
|
148
148
|
/** Instrument type */
|
|
149
149
|
type InstrumentType = 'perp' | 'spot';
|
|
150
150
|
/**
|
|
151
|
-
* Trading instrument metadata
|
|
151
|
+
* Trading instrument metadata (Hyperliquid)
|
|
152
152
|
*/
|
|
153
153
|
interface Instrument {
|
|
154
154
|
/** Instrument symbol (e.g., BTC) */
|
|
@@ -164,6 +164,40 @@ interface Instrument {
|
|
|
164
164
|
/** Whether the instrument is currently tradeable */
|
|
165
165
|
isActive: boolean;
|
|
166
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Trading instrument metadata (Lighter.xyz)
|
|
169
|
+
*
|
|
170
|
+
* Lighter instruments have a different schema than Hyperliquid with more
|
|
171
|
+
* detailed market configuration including fees and minimum amounts.
|
|
172
|
+
*/
|
|
173
|
+
interface LighterInstrument {
|
|
174
|
+
/** Instrument symbol (e.g., BTC, ETH) */
|
|
175
|
+
symbol: string;
|
|
176
|
+
/** Unique market identifier */
|
|
177
|
+
marketId: number;
|
|
178
|
+
/** Market type (e.g., 'perp') */
|
|
179
|
+
marketType: string;
|
|
180
|
+
/** Market status (e.g., 'active') */
|
|
181
|
+
status: string;
|
|
182
|
+
/** Taker fee rate (e.g., 0.0005 = 0.05%) */
|
|
183
|
+
takerFee: number;
|
|
184
|
+
/** Maker fee rate (e.g., 0.0002 = 0.02%) */
|
|
185
|
+
makerFee: number;
|
|
186
|
+
/** Liquidation fee rate */
|
|
187
|
+
liquidationFee: number;
|
|
188
|
+
/** Minimum order size in base currency */
|
|
189
|
+
minBaseAmount: number;
|
|
190
|
+
/** Minimum order size in quote currency */
|
|
191
|
+
minQuoteAmount: number;
|
|
192
|
+
/** Size decimal precision */
|
|
193
|
+
sizeDecimals: number;
|
|
194
|
+
/** Price decimal precision */
|
|
195
|
+
priceDecimals: number;
|
|
196
|
+
/** Quote currency decimal precision */
|
|
197
|
+
quoteDecimals: number;
|
|
198
|
+
/** Whether the instrument is currently tradeable */
|
|
199
|
+
isActive: boolean;
|
|
200
|
+
}
|
|
167
201
|
/**
|
|
168
202
|
* Funding rate record
|
|
169
203
|
*/
|
|
@@ -628,6 +662,40 @@ declare class InstrumentsResource {
|
|
|
628
662
|
*/
|
|
629
663
|
get(coin: string): Promise<Instrument>;
|
|
630
664
|
}
|
|
665
|
+
/**
|
|
666
|
+
* Lighter.xyz Instruments API resource
|
|
667
|
+
*
|
|
668
|
+
* Lighter instruments have a different schema than Hyperliquid with more
|
|
669
|
+
* detailed market configuration including fees and minimum amounts.
|
|
670
|
+
*
|
|
671
|
+
* @example
|
|
672
|
+
* ```typescript
|
|
673
|
+
* // List all Lighter instruments
|
|
674
|
+
* const instruments = await client.lighter.instruments.list();
|
|
675
|
+
*
|
|
676
|
+
* // Get specific instrument
|
|
677
|
+
* const btc = await client.lighter.instruments.get('BTC');
|
|
678
|
+
* console.log(`Taker fee: ${btc.takerFee}`);
|
|
679
|
+
* ```
|
|
680
|
+
*/
|
|
681
|
+
declare class LighterInstrumentsResource {
|
|
682
|
+
private http;
|
|
683
|
+
private basePath;
|
|
684
|
+
constructor(http: HttpClient, basePath?: string);
|
|
685
|
+
/**
|
|
686
|
+
* List all available Lighter trading instruments
|
|
687
|
+
*
|
|
688
|
+
* @returns Array of Lighter instruments with full market configuration
|
|
689
|
+
*/
|
|
690
|
+
list(): Promise<LighterInstrument[]>;
|
|
691
|
+
/**
|
|
692
|
+
* Get a specific Lighter instrument by coin symbol
|
|
693
|
+
*
|
|
694
|
+
* @param coin - The coin symbol (e.g., 'BTC', 'ETH')
|
|
695
|
+
* @returns Lighter instrument details with full market configuration
|
|
696
|
+
*/
|
|
697
|
+
get(coin: string): Promise<LighterInstrument>;
|
|
698
|
+
}
|
|
631
699
|
|
|
632
700
|
/**
|
|
633
701
|
* Funding rates API resource
|
|
@@ -766,18 +834,19 @@ declare class HyperliquidClient {
|
|
|
766
834
|
* Lighter.xyz exchange client
|
|
767
835
|
*
|
|
768
836
|
* Access Lighter.xyz market data through the 0xarchive API.
|
|
769
|
-
* Lighter orderbooks are reconstructed from checkpoint + delta data.
|
|
770
837
|
*
|
|
771
838
|
* @example
|
|
772
839
|
* ```typescript
|
|
773
840
|
* const client = new OxArchive({ apiKey: '...' });
|
|
774
841
|
* const orderbook = await client.lighter.orderbook.get('BTC');
|
|
775
842
|
* const trades = await client.lighter.trades.list('ETH', { start, end });
|
|
843
|
+
* const instruments = await client.lighter.instruments.list();
|
|
844
|
+
* console.log(`ETH taker fee: ${instruments[0].takerFee}`);
|
|
776
845
|
* ```
|
|
777
846
|
*/
|
|
778
847
|
declare class LighterClient {
|
|
779
848
|
/**
|
|
780
|
-
* Order book data (
|
|
849
|
+
* Order book data (L2 snapshots)
|
|
781
850
|
*/
|
|
782
851
|
readonly orderbook: OrderBookResource;
|
|
783
852
|
/**
|
|
@@ -785,9 +854,9 @@ declare class LighterClient {
|
|
|
785
854
|
*/
|
|
786
855
|
readonly trades: TradesResource;
|
|
787
856
|
/**
|
|
788
|
-
* Trading instruments metadata
|
|
857
|
+
* Trading instruments metadata (returns LighterInstrument with fees, min amounts, etc.)
|
|
789
858
|
*/
|
|
790
|
-
readonly instruments:
|
|
859
|
+
readonly instruments: LighterInstrumentsResource;
|
|
791
860
|
/**
|
|
792
861
|
* Funding rates
|
|
793
862
|
*/
|
|
@@ -843,7 +912,7 @@ declare class OxArchive {
|
|
|
843
912
|
*/
|
|
844
913
|
readonly hyperliquid: HyperliquidClient;
|
|
845
914
|
/**
|
|
846
|
-
* Lighter.xyz exchange data (
|
|
915
|
+
* Lighter.xyz exchange data (August 2025+)
|
|
847
916
|
*/
|
|
848
917
|
readonly lighter: LighterClient;
|
|
849
918
|
/**
|
|
@@ -2684,4 +2753,4 @@ type ValidatedFundingRate = z.infer<typeof FundingRateSchema>;
|
|
|
2684
2753
|
type ValidatedOpenInterest = z.infer<typeof OpenInterestSchema>;
|
|
2685
2754
|
type ValidatedWsServerMessage = z.infer<typeof WsServerMessageSchema>;
|
|
2686
2755
|
|
|
2687
|
-
export { type ApiError, type ApiMeta, ApiMetaSchema, type ApiResponse, ApiResponseSchema, type ClientOptions, type CursorResponse, type FundingRate, FundingRateArrayResponseSchema, FundingRateResponseSchema, FundingRateSchema, type GetOrderBookParams, type GetTradesCursorParams, HyperliquidClient, type Instrument, InstrumentArrayResponseSchema, InstrumentResponseSchema, InstrumentSchema, type InstrumentType, InstrumentTypeSchema, LighterClient, type OpenInterest, OpenInterestArrayResponseSchema, OpenInterestResponseSchema, OpenInterestSchema, type OrderBook, OrderBookArrayResponseSchema, type OrderBookHistoryParams, OrderBookResponseSchema, OrderBookSchema, OxArchive, OxArchiveError, OxArchiveWs, type PriceLevel, PriceLevelSchema, type Timestamp, type TimestampedRecord, TimestampedRecordSchema, type Trade, TradeArrayResponseSchema, type TradeDirection, TradeDirectionSchema, TradeSchema, type TradeSide, TradeSideSchema, type ValidatedApiMeta, type ValidatedFundingRate, type ValidatedInstrument, type ValidatedOpenInterest, type ValidatedOrderBook, type ValidatedPriceLevel, type ValidatedTrade, type ValidatedWsServerMessage, type WsChannel, WsChannelSchema, type WsClientMessage, type WsConnectionState, WsConnectionStateSchema, type WsData, WsDataSchema, type WsError, WsErrorSchema, type WsEventHandlers, type WsHistoricalBatch, WsHistoricalBatchSchema, type WsHistoricalData, WsHistoricalDataSchema, type WsOptions, type WsPing, type WsPong, WsPongSchema, type WsReplay, type WsReplayCompleted, WsReplayCompletedSchema, type WsReplayPause, type WsReplayPaused, WsReplayPausedSchema, type WsReplayResume, type WsReplayResumed, WsReplayResumedSchema, type WsReplaySeek, type WsReplayStarted, WsReplayStartedSchema, type WsReplayStop, type WsReplayStopped, WsReplayStoppedSchema, type WsServerMessage, WsServerMessageSchema, type WsStream, type WsStreamCompleted, WsStreamCompletedSchema, type WsStreamProgress, WsStreamProgressSchema, type WsStreamStarted, WsStreamStartedSchema, type WsStreamStop, type WsStreamStopped, WsStreamStoppedSchema, type WsSubscribe, type WsSubscribed, WsSubscribedSchema, type WsUnsubscribe, type WsUnsubscribed, WsUnsubscribedSchema, OxArchive as default };
|
|
2756
|
+
export { type ApiError, type ApiMeta, ApiMetaSchema, type ApiResponse, ApiResponseSchema, type ClientOptions, type CursorResponse, type FundingRate, FundingRateArrayResponseSchema, FundingRateResponseSchema, FundingRateSchema, type GetOrderBookParams, type GetTradesCursorParams, HyperliquidClient, type Instrument, InstrumentArrayResponseSchema, InstrumentResponseSchema, InstrumentSchema, type InstrumentType, InstrumentTypeSchema, LighterClient, type LighterInstrument, type OpenInterest, OpenInterestArrayResponseSchema, OpenInterestResponseSchema, OpenInterestSchema, type OrderBook, OrderBookArrayResponseSchema, type OrderBookHistoryParams, OrderBookResponseSchema, OrderBookSchema, OxArchive, OxArchiveError, OxArchiveWs, type PriceLevel, PriceLevelSchema, type Timestamp, type TimestampedRecord, TimestampedRecordSchema, type Trade, TradeArrayResponseSchema, type TradeDirection, TradeDirectionSchema, TradeSchema, type TradeSide, TradeSideSchema, type ValidatedApiMeta, type ValidatedFundingRate, type ValidatedInstrument, type ValidatedOpenInterest, type ValidatedOrderBook, type ValidatedPriceLevel, type ValidatedTrade, type ValidatedWsServerMessage, type WsChannel, WsChannelSchema, type WsClientMessage, type WsConnectionState, WsConnectionStateSchema, type WsData, WsDataSchema, type WsError, WsErrorSchema, type WsEventHandlers, type WsHistoricalBatch, WsHistoricalBatchSchema, type WsHistoricalData, WsHistoricalDataSchema, type WsOptions, type WsPing, type WsPong, WsPongSchema, type WsReplay, type WsReplayCompleted, WsReplayCompletedSchema, type WsReplayPause, type WsReplayPaused, WsReplayPausedSchema, type WsReplayResume, type WsReplayResumed, WsReplayResumedSchema, type WsReplaySeek, type WsReplayStarted, WsReplayStartedSchema, type WsReplayStop, type WsReplayStopped, WsReplayStoppedSchema, type WsServerMessage, WsServerMessageSchema, type WsStream, type WsStreamCompleted, WsStreamCompletedSchema, type WsStreamProgress, WsStreamProgressSchema, type WsStreamStarted, WsStreamStartedSchema, type WsStreamStop, type WsStreamStopped, WsStreamStoppedSchema, type WsSubscribe, type WsSubscribed, WsSubscribedSchema, type WsUnsubscribe, type WsUnsubscribed, WsUnsubscribedSchema, OxArchive as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -148,7 +148,7 @@ interface CursorResponse<T> {
|
|
|
148
148
|
/** Instrument type */
|
|
149
149
|
type InstrumentType = 'perp' | 'spot';
|
|
150
150
|
/**
|
|
151
|
-
* Trading instrument metadata
|
|
151
|
+
* Trading instrument metadata (Hyperliquid)
|
|
152
152
|
*/
|
|
153
153
|
interface Instrument {
|
|
154
154
|
/** Instrument symbol (e.g., BTC) */
|
|
@@ -164,6 +164,40 @@ interface Instrument {
|
|
|
164
164
|
/** Whether the instrument is currently tradeable */
|
|
165
165
|
isActive: boolean;
|
|
166
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Trading instrument metadata (Lighter.xyz)
|
|
169
|
+
*
|
|
170
|
+
* Lighter instruments have a different schema than Hyperliquid with more
|
|
171
|
+
* detailed market configuration including fees and minimum amounts.
|
|
172
|
+
*/
|
|
173
|
+
interface LighterInstrument {
|
|
174
|
+
/** Instrument symbol (e.g., BTC, ETH) */
|
|
175
|
+
symbol: string;
|
|
176
|
+
/** Unique market identifier */
|
|
177
|
+
marketId: number;
|
|
178
|
+
/** Market type (e.g., 'perp') */
|
|
179
|
+
marketType: string;
|
|
180
|
+
/** Market status (e.g., 'active') */
|
|
181
|
+
status: string;
|
|
182
|
+
/** Taker fee rate (e.g., 0.0005 = 0.05%) */
|
|
183
|
+
takerFee: number;
|
|
184
|
+
/** Maker fee rate (e.g., 0.0002 = 0.02%) */
|
|
185
|
+
makerFee: number;
|
|
186
|
+
/** Liquidation fee rate */
|
|
187
|
+
liquidationFee: number;
|
|
188
|
+
/** Minimum order size in base currency */
|
|
189
|
+
minBaseAmount: number;
|
|
190
|
+
/** Minimum order size in quote currency */
|
|
191
|
+
minQuoteAmount: number;
|
|
192
|
+
/** Size decimal precision */
|
|
193
|
+
sizeDecimals: number;
|
|
194
|
+
/** Price decimal precision */
|
|
195
|
+
priceDecimals: number;
|
|
196
|
+
/** Quote currency decimal precision */
|
|
197
|
+
quoteDecimals: number;
|
|
198
|
+
/** Whether the instrument is currently tradeable */
|
|
199
|
+
isActive: boolean;
|
|
200
|
+
}
|
|
167
201
|
/**
|
|
168
202
|
* Funding rate record
|
|
169
203
|
*/
|
|
@@ -628,6 +662,40 @@ declare class InstrumentsResource {
|
|
|
628
662
|
*/
|
|
629
663
|
get(coin: string): Promise<Instrument>;
|
|
630
664
|
}
|
|
665
|
+
/**
|
|
666
|
+
* Lighter.xyz Instruments API resource
|
|
667
|
+
*
|
|
668
|
+
* Lighter instruments have a different schema than Hyperliquid with more
|
|
669
|
+
* detailed market configuration including fees and minimum amounts.
|
|
670
|
+
*
|
|
671
|
+
* @example
|
|
672
|
+
* ```typescript
|
|
673
|
+
* // List all Lighter instruments
|
|
674
|
+
* const instruments = await client.lighter.instruments.list();
|
|
675
|
+
*
|
|
676
|
+
* // Get specific instrument
|
|
677
|
+
* const btc = await client.lighter.instruments.get('BTC');
|
|
678
|
+
* console.log(`Taker fee: ${btc.takerFee}`);
|
|
679
|
+
* ```
|
|
680
|
+
*/
|
|
681
|
+
declare class LighterInstrumentsResource {
|
|
682
|
+
private http;
|
|
683
|
+
private basePath;
|
|
684
|
+
constructor(http: HttpClient, basePath?: string);
|
|
685
|
+
/**
|
|
686
|
+
* List all available Lighter trading instruments
|
|
687
|
+
*
|
|
688
|
+
* @returns Array of Lighter instruments with full market configuration
|
|
689
|
+
*/
|
|
690
|
+
list(): Promise<LighterInstrument[]>;
|
|
691
|
+
/**
|
|
692
|
+
* Get a specific Lighter instrument by coin symbol
|
|
693
|
+
*
|
|
694
|
+
* @param coin - The coin symbol (e.g., 'BTC', 'ETH')
|
|
695
|
+
* @returns Lighter instrument details with full market configuration
|
|
696
|
+
*/
|
|
697
|
+
get(coin: string): Promise<LighterInstrument>;
|
|
698
|
+
}
|
|
631
699
|
|
|
632
700
|
/**
|
|
633
701
|
* Funding rates API resource
|
|
@@ -766,18 +834,19 @@ declare class HyperliquidClient {
|
|
|
766
834
|
* Lighter.xyz exchange client
|
|
767
835
|
*
|
|
768
836
|
* Access Lighter.xyz market data through the 0xarchive API.
|
|
769
|
-
* Lighter orderbooks are reconstructed from checkpoint + delta data.
|
|
770
837
|
*
|
|
771
838
|
* @example
|
|
772
839
|
* ```typescript
|
|
773
840
|
* const client = new OxArchive({ apiKey: '...' });
|
|
774
841
|
* const orderbook = await client.lighter.orderbook.get('BTC');
|
|
775
842
|
* const trades = await client.lighter.trades.list('ETH', { start, end });
|
|
843
|
+
* const instruments = await client.lighter.instruments.list();
|
|
844
|
+
* console.log(`ETH taker fee: ${instruments[0].takerFee}`);
|
|
776
845
|
* ```
|
|
777
846
|
*/
|
|
778
847
|
declare class LighterClient {
|
|
779
848
|
/**
|
|
780
|
-
* Order book data (
|
|
849
|
+
* Order book data (L2 snapshots)
|
|
781
850
|
*/
|
|
782
851
|
readonly orderbook: OrderBookResource;
|
|
783
852
|
/**
|
|
@@ -785,9 +854,9 @@ declare class LighterClient {
|
|
|
785
854
|
*/
|
|
786
855
|
readonly trades: TradesResource;
|
|
787
856
|
/**
|
|
788
|
-
* Trading instruments metadata
|
|
857
|
+
* Trading instruments metadata (returns LighterInstrument with fees, min amounts, etc.)
|
|
789
858
|
*/
|
|
790
|
-
readonly instruments:
|
|
859
|
+
readonly instruments: LighterInstrumentsResource;
|
|
791
860
|
/**
|
|
792
861
|
* Funding rates
|
|
793
862
|
*/
|
|
@@ -843,7 +912,7 @@ declare class OxArchive {
|
|
|
843
912
|
*/
|
|
844
913
|
readonly hyperliquid: HyperliquidClient;
|
|
845
914
|
/**
|
|
846
|
-
* Lighter.xyz exchange data (
|
|
915
|
+
* Lighter.xyz exchange data (August 2025+)
|
|
847
916
|
*/
|
|
848
917
|
readonly lighter: LighterClient;
|
|
849
918
|
/**
|
|
@@ -2684,4 +2753,4 @@ type ValidatedFundingRate = z.infer<typeof FundingRateSchema>;
|
|
|
2684
2753
|
type ValidatedOpenInterest = z.infer<typeof OpenInterestSchema>;
|
|
2685
2754
|
type ValidatedWsServerMessage = z.infer<typeof WsServerMessageSchema>;
|
|
2686
2755
|
|
|
2687
|
-
export { type ApiError, type ApiMeta, ApiMetaSchema, type ApiResponse, ApiResponseSchema, type ClientOptions, type CursorResponse, type FundingRate, FundingRateArrayResponseSchema, FundingRateResponseSchema, FundingRateSchema, type GetOrderBookParams, type GetTradesCursorParams, HyperliquidClient, type Instrument, InstrumentArrayResponseSchema, InstrumentResponseSchema, InstrumentSchema, type InstrumentType, InstrumentTypeSchema, LighterClient, type OpenInterest, OpenInterestArrayResponseSchema, OpenInterestResponseSchema, OpenInterestSchema, type OrderBook, OrderBookArrayResponseSchema, type OrderBookHistoryParams, OrderBookResponseSchema, OrderBookSchema, OxArchive, OxArchiveError, OxArchiveWs, type PriceLevel, PriceLevelSchema, type Timestamp, type TimestampedRecord, TimestampedRecordSchema, type Trade, TradeArrayResponseSchema, type TradeDirection, TradeDirectionSchema, TradeSchema, type TradeSide, TradeSideSchema, type ValidatedApiMeta, type ValidatedFundingRate, type ValidatedInstrument, type ValidatedOpenInterest, type ValidatedOrderBook, type ValidatedPriceLevel, type ValidatedTrade, type ValidatedWsServerMessage, type WsChannel, WsChannelSchema, type WsClientMessage, type WsConnectionState, WsConnectionStateSchema, type WsData, WsDataSchema, type WsError, WsErrorSchema, type WsEventHandlers, type WsHistoricalBatch, WsHistoricalBatchSchema, type WsHistoricalData, WsHistoricalDataSchema, type WsOptions, type WsPing, type WsPong, WsPongSchema, type WsReplay, type WsReplayCompleted, WsReplayCompletedSchema, type WsReplayPause, type WsReplayPaused, WsReplayPausedSchema, type WsReplayResume, type WsReplayResumed, WsReplayResumedSchema, type WsReplaySeek, type WsReplayStarted, WsReplayStartedSchema, type WsReplayStop, type WsReplayStopped, WsReplayStoppedSchema, type WsServerMessage, WsServerMessageSchema, type WsStream, type WsStreamCompleted, WsStreamCompletedSchema, type WsStreamProgress, WsStreamProgressSchema, type WsStreamStarted, WsStreamStartedSchema, type WsStreamStop, type WsStreamStopped, WsStreamStoppedSchema, type WsSubscribe, type WsSubscribed, WsSubscribedSchema, type WsUnsubscribe, type WsUnsubscribed, WsUnsubscribedSchema, OxArchive as default };
|
|
2756
|
+
export { type ApiError, type ApiMeta, ApiMetaSchema, type ApiResponse, ApiResponseSchema, type ClientOptions, type CursorResponse, type FundingRate, FundingRateArrayResponseSchema, FundingRateResponseSchema, FundingRateSchema, type GetOrderBookParams, type GetTradesCursorParams, HyperliquidClient, type Instrument, InstrumentArrayResponseSchema, InstrumentResponseSchema, InstrumentSchema, type InstrumentType, InstrumentTypeSchema, LighterClient, type LighterInstrument, type OpenInterest, OpenInterestArrayResponseSchema, OpenInterestResponseSchema, OpenInterestSchema, type OrderBook, OrderBookArrayResponseSchema, type OrderBookHistoryParams, OrderBookResponseSchema, OrderBookSchema, OxArchive, OxArchiveError, OxArchiveWs, type PriceLevel, PriceLevelSchema, type Timestamp, type TimestampedRecord, TimestampedRecordSchema, type Trade, TradeArrayResponseSchema, type TradeDirection, TradeDirectionSchema, TradeSchema, type TradeSide, TradeSideSchema, type ValidatedApiMeta, type ValidatedFundingRate, type ValidatedInstrument, type ValidatedOpenInterest, type ValidatedOrderBook, type ValidatedPriceLevel, type ValidatedTrade, type ValidatedWsServerMessage, type WsChannel, WsChannelSchema, type WsClientMessage, type WsConnectionState, WsConnectionStateSchema, type WsData, WsDataSchema, type WsError, WsErrorSchema, type WsEventHandlers, type WsHistoricalBatch, WsHistoricalBatchSchema, type WsHistoricalData, WsHistoricalDataSchema, type WsOptions, type WsPing, type WsPong, WsPongSchema, type WsReplay, type WsReplayCompleted, WsReplayCompletedSchema, type WsReplayPause, type WsReplayPaused, WsReplayPausedSchema, type WsReplayResume, type WsReplayResumed, WsReplayResumedSchema, type WsReplaySeek, type WsReplayStarted, WsReplayStartedSchema, type WsReplayStop, type WsReplayStopped, WsReplayStoppedSchema, type WsServerMessage, WsServerMessageSchema, type WsStream, type WsStreamCompleted, WsStreamCompletedSchema, type WsStreamProgress, WsStreamProgressSchema, type WsStreamStarted, WsStreamStartedSchema, type WsStreamStop, type WsStreamStopped, WsStreamStoppedSchema, type WsSubscribe, type WsSubscribed, WsSubscribedSchema, type WsUnsubscribe, type WsUnsubscribed, WsUnsubscribedSchema, OxArchive as default };
|
package/dist/index.js
CHANGED
|
@@ -537,6 +537,35 @@ var InstrumentsResource = class {
|
|
|
537
537
|
return response.data;
|
|
538
538
|
}
|
|
539
539
|
};
|
|
540
|
+
var LighterInstrumentsResource = class {
|
|
541
|
+
constructor(http, basePath = "/v1/lighter") {
|
|
542
|
+
this.http = http;
|
|
543
|
+
this.basePath = basePath;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* List all available Lighter trading instruments
|
|
547
|
+
*
|
|
548
|
+
* @returns Array of Lighter instruments with full market configuration
|
|
549
|
+
*/
|
|
550
|
+
async list() {
|
|
551
|
+
const response = await this.http.get(
|
|
552
|
+
`${this.basePath}/instruments`
|
|
553
|
+
);
|
|
554
|
+
return response.data;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Get a specific Lighter instrument by coin symbol
|
|
558
|
+
*
|
|
559
|
+
* @param coin - The coin symbol (e.g., 'BTC', 'ETH')
|
|
560
|
+
* @returns Lighter instrument details with full market configuration
|
|
561
|
+
*/
|
|
562
|
+
async get(coin) {
|
|
563
|
+
const response = await this.http.get(
|
|
564
|
+
`${this.basePath}/instruments/${coin.toUpperCase()}`
|
|
565
|
+
);
|
|
566
|
+
return response.data;
|
|
567
|
+
}
|
|
568
|
+
};
|
|
540
569
|
|
|
541
570
|
// src/resources/funding.ts
|
|
542
571
|
var FundingResource = class {
|
|
@@ -651,7 +680,7 @@ var HyperliquidClient = class {
|
|
|
651
680
|
};
|
|
652
681
|
var LighterClient = class {
|
|
653
682
|
/**
|
|
654
|
-
* Order book data (
|
|
683
|
+
* Order book data (L2 snapshots)
|
|
655
684
|
*/
|
|
656
685
|
orderbook;
|
|
657
686
|
/**
|
|
@@ -659,7 +688,7 @@ var LighterClient = class {
|
|
|
659
688
|
*/
|
|
660
689
|
trades;
|
|
661
690
|
/**
|
|
662
|
-
* Trading instruments metadata
|
|
691
|
+
* Trading instruments metadata (returns LighterInstrument with fees, min amounts, etc.)
|
|
663
692
|
*/
|
|
664
693
|
instruments;
|
|
665
694
|
/**
|
|
@@ -674,7 +703,7 @@ var LighterClient = class {
|
|
|
674
703
|
const basePath = "/v1/lighter";
|
|
675
704
|
this.orderbook = new OrderBookResource(http, basePath);
|
|
676
705
|
this.trades = new TradesResource(http, basePath);
|
|
677
|
-
this.instruments = new
|
|
706
|
+
this.instruments = new LighterInstrumentsResource(http, basePath);
|
|
678
707
|
this.funding = new FundingResource(http, basePath);
|
|
679
708
|
this.openInterest = new OpenInterestResource(http, basePath);
|
|
680
709
|
}
|
|
@@ -690,7 +719,7 @@ var OxArchive = class {
|
|
|
690
719
|
*/
|
|
691
720
|
hyperliquid;
|
|
692
721
|
/**
|
|
693
|
-
* Lighter.xyz exchange data (
|
|
722
|
+
* Lighter.xyz exchange data (August 2025+)
|
|
694
723
|
*/
|
|
695
724
|
lighter;
|
|
696
725
|
/**
|