@0xmonaco/types 0.8.11 → 0.8.15

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.
Files changed (40) hide show
  1. package/dist/applications/requests.d.ts +15 -15
  2. package/dist/applications/responses.d.ts +57 -56
  3. package/dist/auth/responses.d.ts +2 -1
  4. package/dist/contracts/balances.d.ts +1 -1
  5. package/dist/delegated-agents/index.d.ts +22 -21
  6. package/dist/faucet/index.d.ts +4 -4
  7. package/dist/fees/index.d.ts +4 -4
  8. package/dist/fees/responses.d.ts +17 -17
  9. package/dist/fees/responses.js +20 -20
  10. package/dist/margin-accounts/index.d.ts +78 -46
  11. package/dist/market/index.d.ts +132 -129
  12. package/dist/positions/index.d.ts +67 -45
  13. package/dist/profile/index.d.ts +92 -89
  14. package/dist/sdk/index.d.ts +3 -3
  15. package/dist/sub-accounts/index.d.ts +22 -21
  16. package/dist/trading/index.d.ts +6 -6
  17. package/dist/trading/orders.d.ts +20 -20
  18. package/dist/trading/responses.d.ts +79 -79
  19. package/dist/validation/margin-accounts.d.ts +47 -5
  20. package/dist/validation/margin-accounts.js +34 -8
  21. package/dist/validation/market.d.ts +1 -1
  22. package/dist/validation/market.js +1 -1
  23. package/dist/validation/positions.d.ts +11 -7
  24. package/dist/validation/positions.js +10 -6
  25. package/dist/validation/profile.d.ts +10 -10
  26. package/dist/validation/profile.js +10 -10
  27. package/dist/validation/trading.d.ts +17 -17
  28. package/dist/validation/trading.js +36 -36
  29. package/dist/validation/vault.d.ts +4 -0
  30. package/dist/validation/vault.js +1 -0
  31. package/dist/vault/index.d.ts +33 -12
  32. package/dist/vault/responses.d.ts +50 -12
  33. package/dist/websocket/events/balance-events.d.ts +2 -1
  34. package/dist/websocket/events/movement-events.d.ts +2 -1
  35. package/dist/whitelist/index.d.ts +4 -4
  36. package/dist/wire/operations.d.ts +1 -1
  37. package/dist/wire/operations.js +9 -2
  38. package/dist/wire/schema.d.ts +1323 -853
  39. package/dist/withdrawals/index.d.ts +83 -12
  40. package/package.json +2 -2
@@ -1,26 +1,26 @@
1
1
  import type { BaseAPI } from "../api";
2
2
  import type { OrderSide, OrderType, PositionSide } from "../trading";
3
3
  export interface MarginAccountSummary {
4
- margin_account_id: string;
4
+ marginAccountId: string;
5
5
  label?: string;
6
- margin_bucket_id?: string;
7
- margin_mode?: "ISOLATED" | "CROSS";
8
- trading_pair_id?: string;
9
- strategy_key?: string;
10
- account_state: string;
6
+ riskBucketId?: string;
7
+ marginMode?: "ISOLATED" | "CROSS";
8
+ tradingPairId?: string;
9
+ strategyKey?: string;
10
+ accountState: string;
11
11
  equity: string;
12
- initial_margin_required: string;
13
- maintenance_margin_required: string;
14
- free_collateral: string;
15
- withdrawable_collateral: string;
16
- total_position_notional: string;
17
- unrealized_pnl: string;
18
- realized_pnl: string;
19
- updated_at: string;
12
+ initialMarginRequired: string;
13
+ maintenanceMarginRequired: string;
14
+ freeCollateral: string;
15
+ withdrawableCollateral: string;
16
+ totalPositionNotional: string;
17
+ unrealizedPnl: string;
18
+ realizedPnl: string;
19
+ updatedAt: string;
20
20
  }
21
21
  export interface ListMarginAccountsParams {
22
22
  page?: number;
23
- page_size?: number;
23
+ pageSize?: number;
24
24
  state?: string;
25
25
  tradingPairId?: string;
26
26
  }
@@ -28,7 +28,7 @@ export interface ListMarginAccountsResponse {
28
28
  accounts: MarginAccountSummary[];
29
29
  total: number;
30
30
  page: number;
31
- page_size: number;
31
+ pageSize: number;
32
32
  }
33
33
  export interface GetMarginAccountSummaryParams {
34
34
  tradingPairId?: string;
@@ -38,16 +38,16 @@ export interface GetAvailableCollateralParams {
38
38
  }
39
39
  export interface GetAvailableCollateralResponse {
40
40
  asset: string;
41
- wallet_available: string;
42
- wallet_locked: string;
43
- margin_transferable?: string;
41
+ walletAvailable: string;
42
+ walletLocked: string;
43
+ marginTransferable?: string;
44
44
  /**
45
45
  * Free collateral held in the user's parent margin account for this asset
46
46
  * (equity minus initial margin required) — collateral already inside margin
47
47
  * and available to open new positions or transfer back out. Absent when the
48
48
  * user has no margin account yet.
49
49
  */
50
- margin_available_collateral?: string;
50
+ marginAvailableCollateral?: string;
51
51
  }
52
52
  export interface TransferCollateralRequest {
53
53
  asset: string;
@@ -55,39 +55,47 @@ export interface TransferCollateralRequest {
55
55
  tradingPairId?: string;
56
56
  strategyKey?: string;
57
57
  }
58
- export interface TransferCollateralToAutoMarginAccountRequest extends TransferCollateralRequest {
58
+ export interface TransferCollateralToParentMarginAccountRequest {
59
+ asset: string;
60
+ amount: string;
61
+ }
62
+ export interface TransferCollateralToRiskBucketRequest extends TransferCollateralToParentMarginAccountRequest {
59
63
  tradingPairId: string;
60
64
  strategyKey?: string;
61
65
  }
66
+ export interface TransferCollateralFromParentMarginAccountRequest {
67
+ asset: string;
68
+ amount: string;
69
+ }
62
70
  export interface TransferCollateralResponse {
63
- movement_id: string;
64
- margin_account_id: string;
65
- strategy_key?: string;
71
+ movementId: string;
72
+ marginAccountId: string;
73
+ strategyKey?: string;
66
74
  asset: string;
67
75
  amount: string;
68
76
  status: string;
69
- new_equity: string;
70
- new_total_collateral_value: string;
71
- new_withdrawable_collateral: string;
77
+ newEquity: string;
78
+ newTotalCollateralValue: string;
79
+ newWithdrawableCollateral: string;
72
80
  }
73
81
  export interface GetMarginAccountMovementsParams {
74
- movement_type?: string;
82
+ movementType?: string;
75
83
  page?: number;
76
- page_size?: number;
84
+ pageSize?: number;
77
85
  }
78
86
  export interface MarginAccountMovement {
79
- movement_id: string;
80
- margin_account_id: string;
81
- movement_type: string;
87
+ movementId: string;
88
+ marginAccountId: string;
89
+ movementType: string;
82
90
  asset: string;
83
91
  amount: string;
84
- created_at: string;
92
+ createdAt: string;
85
93
  }
86
94
  export interface GetMarginAccountMovementsResponse {
87
95
  movements: MarginAccountMovement[];
88
96
  total: number;
89
97
  page: number;
90
- page_size: number;
98
+ pageSize: number;
91
99
  }
92
100
  export interface SimulateOrderRiskRequest {
93
101
  tradingPairId: string;
@@ -99,29 +107,53 @@ export interface SimulateOrderRiskRequest {
99
107
  leverage: string;
100
108
  reduceOnly?: boolean;
101
109
  }
102
- export interface SimulateAutoMarginOrderRiskRequest extends SimulateOrderRiskRequest {
110
+ export interface SimulateRiskBucketOrderRiskRequest extends SimulateOrderRiskRequest {
103
111
  strategyKey?: string;
104
112
  }
105
113
  export interface SimulateOrderRiskResponse {
106
114
  accepted: boolean;
107
- reject_reason?: string;
108
- margin_account_id: string;
109
- strategy_key?: string;
110
- equity_after: string;
111
- initial_margin_required_after: string;
112
- maintenance_margin_required_after: string;
113
- free_collateral_after: string;
114
- estimated_fee?: string;
115
- estimated_liquidation_price?: string;
115
+ rejectReason?: string;
116
+ marginAccountId: string;
117
+ strategyKey?: string;
118
+ equityAfter: string;
119
+ initialMarginRequiredAfter: string;
120
+ maintenanceMarginRequiredAfter: string;
121
+ freeCollateralAfter: string;
122
+ estimatedFee?: string;
123
+ estimatedLiquidationPrice?: string;
116
124
  }
117
125
  export interface MarginAccountsAPI extends BaseAPI {
118
126
  listMarginAccounts(params?: ListMarginAccountsParams): Promise<ListMarginAccountsResponse>;
127
+ getParentMarginAccountSummary(params?: GetMarginAccountSummaryParams): Promise<MarginAccountSummary>;
128
+ /**
129
+ * @deprecated Prefer getParentMarginAccountSummary(). Parent margin account ids
130
+ * are auto-resolved for the authenticated wallet/application scope.
131
+ */
119
132
  getMarginAccountSummary(marginAccountId: string, params?: GetMarginAccountSummaryParams): Promise<MarginAccountSummary>;
120
133
  getAvailableCollateral(params?: GetAvailableCollateralParams): Promise<GetAvailableCollateralResponse>;
134
+ /**
135
+ * @deprecated Prefer transferCollateralToParentMarginAccount() or
136
+ * transferCollateralToRiskBucket().
137
+ */
121
138
  transferCollateralToMarginAccount(marginAccountId: string, request: TransferCollateralRequest): Promise<TransferCollateralResponse>;
122
- transferCollateralToAutoMarginAccount(request: TransferCollateralToAutoMarginAccountRequest): Promise<TransferCollateralResponse>;
139
+ transferCollateralToParentMarginAccount(request: TransferCollateralToParentMarginAccountRequest): Promise<TransferCollateralResponse>;
140
+ transferCollateralToRiskBucket(request: TransferCollateralToRiskBucketRequest): Promise<TransferCollateralResponse>;
141
+ /**
142
+ * @deprecated Prefer transferCollateralFromParentMarginAccount().
143
+ */
123
144
  transferCollateralFromMarginAccount(marginAccountId: string, request: TransferCollateralRequest): Promise<TransferCollateralResponse>;
145
+ transferCollateralFromParentMarginAccount(request: TransferCollateralFromParentMarginAccountRequest): Promise<TransferCollateralResponse>;
146
+ getParentMarginAccountMovements(params?: GetMarginAccountMovementsParams): Promise<GetMarginAccountMovementsResponse>;
147
+ /**
148
+ * @deprecated Prefer getParentMarginAccountMovements(). Parent margin account ids
149
+ * are auto-resolved for the authenticated wallet/application scope.
150
+ */
124
151
  getMarginAccountMovements(marginAccountId: string, params?: GetMarginAccountMovementsParams): Promise<GetMarginAccountMovementsResponse>;
152
+ simulateParentMarginOrderRisk(request: SimulateOrderRiskRequest): Promise<SimulateOrderRiskResponse>;
153
+ /**
154
+ * @deprecated Prefer simulateParentMarginOrderRisk(). Parent margin account ids
155
+ * are auto-resolved for the authenticated wallet/application scope.
156
+ */
125
157
  simulateOrderRisk(marginAccountId: string, request: SimulateOrderRiskRequest): Promise<SimulateOrderRiskResponse>;
126
- simulateAutoMarginOrderRisk(request: SimulateAutoMarginOrderRiskRequest): Promise<SimulateOrderRiskResponse>;
158
+ simulateRiskBucketOrderRisk(request: SimulateRiskBucketOrderRiskRequest): Promise<SimulateOrderRiskResponse>;
127
159
  }
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * Types for market data operations including trading pair metadata and OHLCV data.
5
5
  */
6
+ import type { Address } from "viem";
6
7
  import type { BaseAPI } from "../api";
8
+ import type { TradingMode } from "../trading";
7
9
  /**
8
10
  * Trading pair metadata
9
11
  */
@@ -13,45 +15,45 @@ export interface TradingPair {
13
15
  /** Trading pair symbol e.g. BTC/USDC */
14
16
  symbol: string;
15
17
  /** Base token symbol */
16
- base_token: string;
18
+ baseToken: string;
17
19
  /** Quote token symbol */
18
- quote_token: string;
20
+ quoteToken: string;
19
21
  /** Base asset ID (UUID) */
20
- base_asset_id: string;
22
+ baseAssetId: string;
21
23
  /** Quote asset ID (UUID) */
22
- quote_asset_id: string;
24
+ quoteAssetId: string;
23
25
  /** Base token contract address */
24
- base_token_contract: string;
26
+ baseTokenContract: Address;
25
27
  /** Quote token contract address */
26
- quote_token_contract: string;
28
+ quoteTokenContract: Address;
27
29
  /** Base token decimals */
28
- base_decimals: number;
30
+ baseDecimals: number;
29
31
  /** Base token icon URL */
30
- base_icon_url: string;
32
+ baseIconUrl: string;
31
33
  /** Quote token decimals */
32
- quote_decimals: number;
34
+ quoteDecimals: number;
33
35
  /** Quote token icon URL */
34
- quote_icon_url: string;
35
- /** Market type (e.g. SPOT) */
36
- market_type: string;
37
- /** Asset-class category: crypto, equities, or commodities */
36
+ quoteIconUrl: string;
37
+ /** Market type (SPOT or MARGIN) */
38
+ marketType: TradingMode;
39
+ /** Asset-class category: crypto, equities, commodities, or fx */
38
40
  category: string;
39
41
  /** Whether the market is active */
40
- is_active: boolean;
42
+ isActive: boolean;
41
43
  /** Maker fee in basis points */
42
- maker_fee_bps: number;
44
+ makerFeeBps: number;
43
45
  /** Taker fee in basis points */
44
- taker_fee_bps: number;
46
+ takerFeeBps: number;
45
47
  /** Minimum order size */
46
- min_order_size: string;
48
+ minOrderSize: string;
47
49
  /** Maximum order size */
48
- max_order_size: string;
50
+ maxOrderSize: string;
49
51
  /** Tick size for price increments */
50
- tick_size: string;
52
+ tickSize: string;
51
53
  /** Minimum supported leverage for margin markets (optional, margin only) */
52
- min_leverage?: string | null;
54
+ minLeverage?: string | null;
53
55
  /** Maximum supported leverage for margin markets (optional, margin only) */
54
- max_leverage?: string | null;
56
+ maxLeverage?: string | null;
55
57
  }
56
58
  /**
57
59
  * OHLCV candlestick data point (matches API response format)
@@ -119,33 +121,33 @@ export interface GetTradingPairsParams {
119
121
  /** Page number (starts from 1) */
120
122
  page?: number;
121
123
  /** Number of items per page (max 100) */
122
- page_size?: number;
124
+ pageSize?: number;
123
125
  /** Filter by market type (SPOT, MARGIN) */
124
- market_type?: string;
126
+ marketType?: TradingMode;
125
127
  /** Filter by base token symbol */
126
- base_token?: string;
128
+ baseToken?: string;
127
129
  /** Filter by quote token symbol */
128
- quote_token?: string;
130
+ quoteToken?: string;
129
131
  /** Filter by active status */
130
- is_active?: boolean;
131
- /** Filter by asset-class category (crypto, equities, commodities) */
132
+ isActive?: boolean;
133
+ /** Filter by asset-class category (crypto, equities, commodities, fx) */
132
134
  category?: string;
133
135
  }
134
136
  /**
135
137
  * Response for listing trading pairs with pagination
136
138
  */
137
139
  export interface GetTradingPairsResponse {
138
- trading_pairs: TradingPair[];
140
+ tradingPairs: TradingPair[];
139
141
  page: number;
140
- page_size: number;
142
+ pageSize: number;
141
143
  total: number;
142
- total_pages: number;
144
+ totalPages: number;
143
145
  }
144
146
  /**
145
147
  * Response for a single trading pair
146
148
  */
147
149
  export interface GetTradingPairResponse {
148
- trading_pair: TradingPair;
150
+ tradingPair: TradingPair;
149
151
  }
150
152
  /**
151
153
  * Query parameters for the market screener
@@ -154,12 +156,12 @@ export interface GetScreenerParams {
154
156
  /** Page number (min 1, default 1) */
155
157
  page?: number;
156
158
  /** Items per page (min 1, max 100, default 50) */
157
- page_size?: number;
159
+ pageSize?: number;
158
160
  /** Filter by market type: SPOT or MARGIN */
159
- market_type?: string;
161
+ marketType?: TradingMode;
160
162
  /** Filter by active status */
161
- is_active?: boolean;
162
- /** Filter by asset-class category (crypto, equities, commodities) */
163
+ isActive?: boolean;
164
+ /** Filter by asset-class category (crypto, equities, commodities, fx) */
163
165
  category?: string;
164
166
  }
165
167
  /**
@@ -167,58 +169,58 @@ export interface GetScreenerParams {
167
169
  */
168
170
  export interface ScreenerSnapshotPoint {
169
171
  /** UTC day boundary (ms since epoch, as string) */
170
- bucket_start: string;
172
+ bucketStart: string;
171
173
  /** Quote-token volume for the day */
172
- quote_volume: string;
174
+ quoteVolume: string;
173
175
  /** Percent price change (close - open) / open * 100 for the day */
174
- price_change_percent: string;
176
+ priceChangePercent: string;
175
177
  }
176
178
  /**
177
179
  * Per-pair screener row. Window fields are null when there is insufficient history.
178
180
  */
179
181
  export interface ScreenerItem {
180
182
  /** Trading pair UUID */
181
- trading_pair_id: string;
183
+ tradingPairId: string;
182
184
  /** Trading pair symbol (e.g. "BTC/USDC") */
183
185
  symbol: string;
184
186
  /** Base token icon URL */
185
- base_icon_url: string;
187
+ baseIconUrl: string;
186
188
  /** Quote token icon URL */
187
- quote_icon_url: string;
189
+ quoteIconUrl: string;
188
190
  /** Most recent close price (null if no trades yet) */
189
- last_price: string | null;
191
+ lastPrice: string | null;
190
192
  /** Timestamp of the last candle (ms since epoch, as string; null if no trades yet) */
191
- last_price_timestamp: string | null;
193
+ lastPriceTimestamp: string | null;
192
194
  /** Quote-token volume in the last 1 hour (null if <1h history) */
193
- quote_volume_1h: string | null;
195
+ quoteVolume1h: string | null;
194
196
  /** Quote-token volume in the last 24 hours (null if <24h history) */
195
- quote_volume_24h: string | null;
197
+ quoteVolume24h: string | null;
196
198
  /** Quote-token volume in the last 7 days (null if <7d history) */
197
- quote_volume_7d: string | null;
199
+ quoteVolume7d: string | null;
198
200
  /** Percent price change over the last 1 hour (null if <1h history) */
199
- price_change_percent_1h: string | null;
201
+ priceChangePercent1h: string | null;
200
202
  /** Percent price change over the last 24 hours (null if <24h history) */
201
- price_change_percent_24h: string | null;
203
+ priceChangePercent24h: string | null;
202
204
  /** Percent price change over the last 7 days (null if <7d history) */
203
- price_change_percent_7d: string | null;
205
+ priceChangePercent7d: string | null;
204
206
  /** Up to 7 UTC-day buckets (oldest first); empty when <1 day of history */
205
- snapshot_7d: ScreenerSnapshotPoint[];
206
- /** Asset-class category: crypto, equities, or commodities */
207
+ snapshot7d: ScreenerSnapshotPoint[];
208
+ /** Asset-class category: crypto, equities, commodities, or fx */
207
209
  category: string;
208
210
  /** Life-to-date cumulative quote-token volume since inception ("0" if no trades yet) */
209
- total_quote_volume_ltd: string;
211
+ totalQuoteVolumeLtd: string;
210
212
  /** Life-to-date cumulative number of trades since inception (0 if no trades yet) */
211
- total_trade_count_ltd: number;
213
+ totalTradeCountLtd: number;
212
214
  }
213
215
  /**
214
- * Paginated screener response, sorted by quote_volume_24h desc (nulls last)
216
+ * Paginated screener response, sorted by quoteVolume24h desc (nulls last)
215
217
  */
216
218
  export interface GetScreenerResponse {
217
219
  items: ScreenerItem[];
218
220
  page: number;
219
- page_size: number;
221
+ pageSize: number;
220
222
  total: number;
221
- total_pages: number;
223
+ totalPages: number;
222
224
  }
223
225
  /**
224
226
  * API response wrapper for single trading pair
@@ -233,132 +235,131 @@ export interface MarketMetadata {
233
235
  /** Trading pair symbol (e.g., "BTC/USDC") */
234
236
  symbol: string;
235
237
  /** Base token icon URL */
236
- base_icon_url: string;
238
+ baseIconUrl: string;
237
239
  /** Quote token icon URL */
238
- quote_icon_url: string;
240
+ quoteIconUrl: string;
239
241
  /** Current price (8 decimal precision, null if no trades yet) */
240
- last_price: string | null;
242
+ lastPrice: string | null;
241
243
  /** Unix timestamp (ms) of latest price (null if no trades yet) */
242
- last_price_timestamp: number | null;
244
+ lastPriceTimestamp: number | null;
243
245
  /** 24h high price (null if <24h data) */
244
- high_24h: string | null;
246
+ high24h: string | null;
245
247
  /** 24h low price (null if <24h data) */
246
- low_24h: string | null;
248
+ low24h: string | null;
247
249
  /** 24h volume in base asset (null if <24h data) */
248
- volume_24h: string | null;
250
+ volume24h: string | null;
249
251
  /** Absolute price change in 24h (null if <24h data) */
250
- price_change_24h: string | null;
252
+ priceChange24h: string | null;
251
253
  /** Percentage price change in 24h (2 decimals, null if <24h data) */
252
- price_change_percent_24h: string | null;
254
+ priceChangePercent24h: string | null;
253
255
  /** Unix timestamp (ms) when market started trading (null if not available) */
254
- market_initialization_timestamp: number | null;
256
+ marketInitializationTimestamp: number | null;
255
257
  /** Life-to-date cumulative base-token volume since inception ("0" if no trades yet) */
256
- total_base_volume_ltd: string;
258
+ totalBaseVolumeLtd: string;
257
259
  /** Life-to-date cumulative quote-token volume since inception ("0" if no trades yet) */
258
- total_quote_volume_ltd: string;
260
+ totalQuoteVolumeLtd: string;
259
261
  /** Life-to-date cumulative number of trades since inception (0 if no trades yet) */
260
- total_trade_count_ltd: number;
262
+ totalTradeCountLtd: number;
261
263
  }
262
264
  /**
263
265
  * Exchange-wide life-to-date cumulative statistics across all trading pairs.
264
266
  */
265
267
  export interface MarketStats {
266
268
  /** Life-to-date cumulative quote-token (notional) volume summed across all pairs */
267
- total_quote_volume_ltd: string;
269
+ totalQuoteVolumeLtd: string;
268
270
  /** Life-to-date cumulative number of trades summed across all pairs */
269
- total_trade_count_ltd: number;
271
+ totalTradeCountLtd: number;
270
272
  }
271
273
  export interface RiskTier {
272
274
  notional_floor: string;
273
275
  notional_cap?: string;
274
- initial_margin_ratio: string;
275
- maintenance_margin_ratio: string;
276
- max_leverage: string;
276
+ initialMarginRatio: string;
277
+ maintenanceMarginRatio: string;
278
+ maxLeverage: string;
277
279
  }
278
280
  export interface PerpMarketConfig {
279
- trading_pair_id: string;
281
+ tradingPairId: string;
280
282
  symbol: string;
281
- min_leverage: string;
282
- max_leverage: string;
283
- initial_margin_ratio: string;
284
- maintenance_margin_ratio: string;
285
- funding_interval_seconds: number;
286
- liquidation_fee_bps?: string;
287
- risk_tiers: RiskTier[];
288
- updated_at: string;
283
+ minLeverage: string;
284
+ maxLeverage: string;
285
+ initialMarginRatio: string;
286
+ maintenanceMarginRatio: string;
287
+ fundingIntervalSeconds: number;
288
+ liquidationFeeBps?: string;
289
+ riskTiers: RiskTier[];
290
+ updatedAt: string;
289
291
  }
290
292
  export interface PerpMarketSummary {
291
- trading_pair_id: string;
293
+ tradingPairId: string;
292
294
  symbol: string;
293
- last_price: string;
294
- mark_price: string;
295
- index_price: string;
296
- high_24h?: string;
297
- low_24h?: string;
298
- volume_24h?: string;
299
- price_change_24h?: string;
300
- price_change_percent_24h?: string;
301
- open_interest: string;
302
- current_funding_rate?: string;
303
- estimated_next_funding_rate?: string;
304
- next_funding_time?: string;
305
- market_status: string;
306
- market_regime: string;
307
- updated_at: string;
295
+ lastPrice: string;
296
+ markPrice: string;
297
+ indexPrice: string;
298
+ high24h?: string;
299
+ low24h?: string;
300
+ volume24h?: string;
301
+ priceChange24h?: string;
302
+ priceChangePercent24h?: string;
303
+ openInterest: string;
304
+ currentFundingRate?: string;
305
+ estimatedNextFundingRate?: string;
306
+ nextFundingTime?: string;
307
+ marketStatus: string;
308
+ marketRegime: string;
309
+ updatedAt: string;
308
310
  }
309
311
  export interface MarkPrice {
310
- trading_pair_id: string;
311
- mark_price: string;
312
- oracle_provider: string;
313
- oracle_epoch?: string;
314
- updated_at: string;
312
+ tradingPairId: string;
313
+ markPrice: string;
314
+ oracleProvider: string;
315
+ oracleEpoch?: string;
316
+ updatedAt: string;
315
317
  regime: string;
316
318
  }
317
319
  export interface IndexComponent {
318
320
  provider: string;
319
321
  price: string;
320
322
  weight?: string;
321
- updated_at?: string;
323
+ updatedAt?: string;
322
324
  }
323
325
  export interface IndexPrice {
324
- trading_pair_id: string;
325
- index_price: string;
326
+ tradingPairId: string;
327
+ indexPrice: string;
326
328
  components: IndexComponent[];
327
- updated_at: string;
329
+ updatedAt: string;
328
330
  }
329
331
  export interface FundingState {
330
- trading_pair_id: string;
331
- current_funding_rate: string;
332
- estimated_next_funding_rate?: string;
333
- next_funding_time: string;
334
- funding_interval_seconds: number;
335
- last_funding_time?: string;
336
- updated_at: string;
332
+ tradingPairId: string;
333
+ currentFundingRate: string;
334
+ estimatedNextFundingRate?: string;
335
+ nextFundingTime: string;
336
+ fundingIntervalSeconds: number;
337
+ lastFundingTime?: string;
338
+ updatedAt: string;
337
339
  }
338
340
  export interface FundingRecord {
339
- trading_pair_id: string;
340
- funding_rate: string;
341
- funding_time: string;
342
- cumulative_funding_per_unit?: string;
341
+ tradingPairId: string;
342
+ fundingRate: string;
343
+ cumulativeFundingPerUnit?: string;
343
344
  }
344
345
  export interface ListFundingHistoryParams {
345
- start_time?: string;
346
- end_time?: string;
346
+ startTime?: string;
347
+ endTime?: string;
347
348
  page?: number;
348
- page_size?: number;
349
+ pageSize?: number;
349
350
  }
350
351
  export interface ListFundingHistoryResponse {
351
352
  records: FundingRecord[];
352
353
  total: number;
353
354
  page: number;
354
- page_size: number;
355
+ pageSize: number;
355
356
  }
356
357
  export interface OpenInterest {
357
- trading_pair_id: string;
358
- open_interest?: string;
359
- open_interest_base: string;
360
- open_interest_notional: string;
361
- updated_at: string;
358
+ tradingPairId: string;
359
+ openInterest?: string;
360
+ openInterestBase: string;
361
+ openInterestNotional: string;
362
+ updatedAt: string;
362
363
  }
363
364
  /**
364
365
  * Market API interface.
@@ -381,9 +382,11 @@ export interface MarketAPI extends BaseAPI {
381
382
  /**
382
383
  * Fetch metadata for a single trading pair by its symbol (e.g. BTC-USDC).
383
384
  * @param symbol - Trading pair symbol
385
+ * @param marketType - Optional market type filter (e.g. "SPOT", "MARGIN") to
386
+ * disambiguate a symbol that exists in more than one market
384
387
  * @returns Promise resolving to trading pair or undefined if not found
385
388
  */
386
- getTradingPairBySymbol(symbol: string): Promise<TradingPair | undefined>;
389
+ getTradingPairBySymbol(symbol: string, marketType?: TradingMode): Promise<TradingPair | undefined>;
387
390
  /**
388
391
  * Fetch the paginated market screener: per-pair price/volume/change windows
389
392
  * (1h, 24h, 7d) plus a 7-day daily snapshot, sorted by 24h quote volume.