@0xarchive/sdk 0.4.1 → 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 +28 -1
- package/dist/index.d.mts +74 -4
- package/dist/index.d.ts +74 -4
- package/dist/index.js +31 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -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
|
|
@@ -772,6 +840,8 @@ declare class HyperliquidClient {
|
|
|
772
840
|
* const client = new OxArchive({ apiKey: '...' });
|
|
773
841
|
* const orderbook = await client.lighter.orderbook.get('BTC');
|
|
774
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}`);
|
|
775
845
|
* ```
|
|
776
846
|
*/
|
|
777
847
|
declare class LighterClient {
|
|
@@ -784,9 +854,9 @@ declare class LighterClient {
|
|
|
784
854
|
*/
|
|
785
855
|
readonly trades: TradesResource;
|
|
786
856
|
/**
|
|
787
|
-
* Trading instruments metadata
|
|
857
|
+
* Trading instruments metadata (returns LighterInstrument with fees, min amounts, etc.)
|
|
788
858
|
*/
|
|
789
|
-
readonly instruments:
|
|
859
|
+
readonly instruments: LighterInstrumentsResource;
|
|
790
860
|
/**
|
|
791
861
|
* Funding rates
|
|
792
862
|
*/
|
|
@@ -2683,4 +2753,4 @@ type ValidatedFundingRate = z.infer<typeof FundingRateSchema>;
|
|
|
2683
2753
|
type ValidatedOpenInterest = z.infer<typeof OpenInterestSchema>;
|
|
2684
2754
|
type ValidatedWsServerMessage = z.infer<typeof WsServerMessageSchema>;
|
|
2685
2755
|
|
|
2686
|
-
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
|
|
@@ -772,6 +840,8 @@ declare class HyperliquidClient {
|
|
|
772
840
|
* const client = new OxArchive({ apiKey: '...' });
|
|
773
841
|
* const orderbook = await client.lighter.orderbook.get('BTC');
|
|
774
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}`);
|
|
775
845
|
* ```
|
|
776
846
|
*/
|
|
777
847
|
declare class LighterClient {
|
|
@@ -784,9 +854,9 @@ declare class LighterClient {
|
|
|
784
854
|
*/
|
|
785
855
|
readonly trades: TradesResource;
|
|
786
856
|
/**
|
|
787
|
-
* Trading instruments metadata
|
|
857
|
+
* Trading instruments metadata (returns LighterInstrument with fees, min amounts, etc.)
|
|
788
858
|
*/
|
|
789
|
-
readonly instruments:
|
|
859
|
+
readonly instruments: LighterInstrumentsResource;
|
|
790
860
|
/**
|
|
791
861
|
* Funding rates
|
|
792
862
|
*/
|
|
@@ -2683,4 +2753,4 @@ type ValidatedFundingRate = z.infer<typeof FundingRateSchema>;
|
|
|
2683
2753
|
type ValidatedOpenInterest = z.infer<typeof OpenInterestSchema>;
|
|
2684
2754
|
type ValidatedWsServerMessage = z.infer<typeof WsServerMessageSchema>;
|
|
2685
2755
|
|
|
2686
|
-
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 {
|
|
@@ -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
|
}
|