@0xmonaco/types 0.8.14 → 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.
@@ -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
- risk_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;
@@ -68,34 +68,34 @@ export interface TransferCollateralFromParentMarginAccountRequest {
68
68
  amount: string;
69
69
  }
70
70
  export interface TransferCollateralResponse {
71
- movement_id: string;
72
- margin_account_id: string;
73
- strategy_key?: string;
71
+ movementId: string;
72
+ marginAccountId: string;
73
+ strategyKey?: string;
74
74
  asset: string;
75
75
  amount: string;
76
76
  status: string;
77
- new_equity: string;
78
- new_total_collateral_value: string;
79
- new_withdrawable_collateral: string;
77
+ newEquity: string;
78
+ newTotalCollateralValue: string;
79
+ newWithdrawableCollateral: string;
80
80
  }
81
81
  export interface GetMarginAccountMovementsParams {
82
- movement_type?: string;
82
+ movementType?: string;
83
83
  page?: number;
84
- page_size?: number;
84
+ pageSize?: number;
85
85
  }
86
86
  export interface MarginAccountMovement {
87
- movement_id: string;
88
- margin_account_id: string;
89
- movement_type: string;
87
+ movementId: string;
88
+ marginAccountId: string;
89
+ movementType: string;
90
90
  asset: string;
91
91
  amount: string;
92
- created_at: string;
92
+ createdAt: string;
93
93
  }
94
94
  export interface GetMarginAccountMovementsResponse {
95
95
  movements: MarginAccountMovement[];
96
96
  total: number;
97
97
  page: number;
98
- page_size: number;
98
+ pageSize: number;
99
99
  }
100
100
  export interface SimulateOrderRiskRequest {
101
101
  tradingPairId: string;
@@ -112,15 +112,15 @@ export interface SimulateRiskBucketOrderRiskRequest extends SimulateOrderRiskReq
112
112
  }
113
113
  export interface SimulateOrderRiskResponse {
114
114
  accepted: boolean;
115
- reject_reason?: string;
116
- margin_account_id: string;
117
- strategy_key?: string;
118
- equity_after: string;
119
- initial_margin_required_after: string;
120
- maintenance_margin_required_after: string;
121
- free_collateral_after: string;
122
- estimated_fee?: string;
123
- 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;
124
124
  }
125
125
  export interface MarginAccountsAPI extends BaseAPI {
126
126
  listMarginAccounts(params?: ListMarginAccountsParams): Promise<ListMarginAccountsResponse>;
@@ -15,45 +15,45 @@ export interface TradingPair {
15
15
  /** Trading pair symbol e.g. BTC/USDC */
16
16
  symbol: string;
17
17
  /** Base token symbol */
18
- base_token: string;
18
+ baseToken: string;
19
19
  /** Quote token symbol */
20
- quote_token: string;
20
+ quoteToken: string;
21
21
  /** Base asset ID (UUID) */
22
- base_asset_id: string;
22
+ baseAssetId: string;
23
23
  /** Quote asset ID (UUID) */
24
- quote_asset_id: string;
24
+ quoteAssetId: string;
25
25
  /** Base token contract address */
26
- base_token_contract: Address;
26
+ baseTokenContract: Address;
27
27
  /** Quote token contract address */
28
- quote_token_contract: Address;
28
+ quoteTokenContract: Address;
29
29
  /** Base token decimals */
30
- base_decimals: number;
30
+ baseDecimals: number;
31
31
  /** Base token icon URL */
32
- base_icon_url: string;
32
+ baseIconUrl: string;
33
33
  /** Quote token decimals */
34
- quote_decimals: number;
34
+ quoteDecimals: number;
35
35
  /** Quote token icon URL */
36
- quote_icon_url: string;
36
+ quoteIconUrl: string;
37
37
  /** Market type (SPOT or MARGIN) */
38
- market_type: TradingMode;
38
+ marketType: TradingMode;
39
39
  /** Asset-class category: crypto, equities, commodities, or fx */
40
40
  category: string;
41
41
  /** Whether the market is active */
42
- is_active: boolean;
42
+ isActive: boolean;
43
43
  /** Maker fee in basis points */
44
- maker_fee_bps: number;
44
+ makerFeeBps: number;
45
45
  /** Taker fee in basis points */
46
- taker_fee_bps: number;
46
+ takerFeeBps: number;
47
47
  /** Minimum order size */
48
- min_order_size: string;
48
+ minOrderSize: string;
49
49
  /** Maximum order size */
50
- max_order_size: string;
50
+ maxOrderSize: string;
51
51
  /** Tick size for price increments */
52
- tick_size: string;
52
+ tickSize: string;
53
53
  /** Minimum supported leverage for margin markets (optional, margin only) */
54
- min_leverage?: string | null;
54
+ minLeverage?: string | null;
55
55
  /** Maximum supported leverage for margin markets (optional, margin only) */
56
- max_leverage?: string | null;
56
+ maxLeverage?: string | null;
57
57
  }
58
58
  /**
59
59
  * OHLCV candlestick data point (matches API response format)
@@ -121,15 +121,15 @@ export interface GetTradingPairsParams {
121
121
  /** Page number (starts from 1) */
122
122
  page?: number;
123
123
  /** Number of items per page (max 100) */
124
- page_size?: number;
124
+ pageSize?: number;
125
125
  /** Filter by market type (SPOT, MARGIN) */
126
- market_type?: TradingMode;
126
+ marketType?: TradingMode;
127
127
  /** Filter by base token symbol */
128
- base_token?: string;
128
+ baseToken?: string;
129
129
  /** Filter by quote token symbol */
130
- quote_token?: string;
130
+ quoteToken?: string;
131
131
  /** Filter by active status */
132
- is_active?: boolean;
132
+ isActive?: boolean;
133
133
  /** Filter by asset-class category (crypto, equities, commodities, fx) */
134
134
  category?: string;
135
135
  }
@@ -137,17 +137,17 @@ export interface GetTradingPairsParams {
137
137
  * Response for listing trading pairs with pagination
138
138
  */
139
139
  export interface GetTradingPairsResponse {
140
- trading_pairs: TradingPair[];
140
+ tradingPairs: TradingPair[];
141
141
  page: number;
142
- page_size: number;
142
+ pageSize: number;
143
143
  total: number;
144
- total_pages: number;
144
+ totalPages: number;
145
145
  }
146
146
  /**
147
147
  * Response for a single trading pair
148
148
  */
149
149
  export interface GetTradingPairResponse {
150
- trading_pair: TradingPair;
150
+ tradingPair: TradingPair;
151
151
  }
152
152
  /**
153
153
  * Query parameters for the market screener
@@ -156,11 +156,11 @@ export interface GetScreenerParams {
156
156
  /** Page number (min 1, default 1) */
157
157
  page?: number;
158
158
  /** Items per page (min 1, max 100, default 50) */
159
- page_size?: number;
159
+ pageSize?: number;
160
160
  /** Filter by market type: SPOT or MARGIN */
161
- market_type?: TradingMode;
161
+ marketType?: TradingMode;
162
162
  /** Filter by active status */
163
- is_active?: boolean;
163
+ isActive?: boolean;
164
164
  /** Filter by asset-class category (crypto, equities, commodities, fx) */
165
165
  category?: string;
166
166
  }
@@ -169,58 +169,58 @@ export interface GetScreenerParams {
169
169
  */
170
170
  export interface ScreenerSnapshotPoint {
171
171
  /** UTC day boundary (ms since epoch, as string) */
172
- bucket_start: string;
172
+ bucketStart: string;
173
173
  /** Quote-token volume for the day */
174
- quote_volume: string;
174
+ quoteVolume: string;
175
175
  /** Percent price change (close - open) / open * 100 for the day */
176
- price_change_percent: string;
176
+ priceChangePercent: string;
177
177
  }
178
178
  /**
179
179
  * Per-pair screener row. Window fields are null when there is insufficient history.
180
180
  */
181
181
  export interface ScreenerItem {
182
182
  /** Trading pair UUID */
183
- trading_pair_id: string;
183
+ tradingPairId: string;
184
184
  /** Trading pair symbol (e.g. "BTC/USDC") */
185
185
  symbol: string;
186
186
  /** Base token icon URL */
187
- base_icon_url: string;
187
+ baseIconUrl: string;
188
188
  /** Quote token icon URL */
189
- quote_icon_url: string;
189
+ quoteIconUrl: string;
190
190
  /** Most recent close price (null if no trades yet) */
191
- last_price: string | null;
191
+ lastPrice: string | null;
192
192
  /** Timestamp of the last candle (ms since epoch, as string; null if no trades yet) */
193
- last_price_timestamp: string | null;
193
+ lastPriceTimestamp: string | null;
194
194
  /** Quote-token volume in the last 1 hour (null if <1h history) */
195
- quote_volume_1h: string | null;
195
+ quoteVolume1h: string | null;
196
196
  /** Quote-token volume in the last 24 hours (null if <24h history) */
197
- quote_volume_24h: string | null;
197
+ quoteVolume24h: string | null;
198
198
  /** Quote-token volume in the last 7 days (null if <7d history) */
199
- quote_volume_7d: string | null;
199
+ quoteVolume7d: string | null;
200
200
  /** Percent price change over the last 1 hour (null if <1h history) */
201
- price_change_percent_1h: string | null;
201
+ priceChangePercent1h: string | null;
202
202
  /** Percent price change over the last 24 hours (null if <24h history) */
203
- price_change_percent_24h: string | null;
203
+ priceChangePercent24h: string | null;
204
204
  /** Percent price change over the last 7 days (null if <7d history) */
205
- price_change_percent_7d: string | null;
205
+ priceChangePercent7d: string | null;
206
206
  /** Up to 7 UTC-day buckets (oldest first); empty when <1 day of history */
207
- snapshot_7d: ScreenerSnapshotPoint[];
207
+ snapshot7d: ScreenerSnapshotPoint[];
208
208
  /** Asset-class category: crypto, equities, commodities, or fx */
209
209
  category: string;
210
210
  /** Life-to-date cumulative quote-token volume since inception ("0" if no trades yet) */
211
- total_quote_volume_ltd: string;
211
+ totalQuoteVolumeLtd: string;
212
212
  /** Life-to-date cumulative number of trades since inception (0 if no trades yet) */
213
- total_trade_count_ltd: number;
213
+ totalTradeCountLtd: number;
214
214
  }
215
215
  /**
216
- * Paginated screener response, sorted by quote_volume_24h desc (nulls last)
216
+ * Paginated screener response, sorted by quoteVolume24h desc (nulls last)
217
217
  */
218
218
  export interface GetScreenerResponse {
219
219
  items: ScreenerItem[];
220
220
  page: number;
221
- page_size: number;
221
+ pageSize: number;
222
222
  total: number;
223
- total_pages: number;
223
+ totalPages: number;
224
224
  }
225
225
  /**
226
226
  * API response wrapper for single trading pair
@@ -235,132 +235,131 @@ export interface MarketMetadata {
235
235
  /** Trading pair symbol (e.g., "BTC/USDC") */
236
236
  symbol: string;
237
237
  /** Base token icon URL */
238
- base_icon_url: string;
238
+ baseIconUrl: string;
239
239
  /** Quote token icon URL */
240
- quote_icon_url: string;
240
+ quoteIconUrl: string;
241
241
  /** Current price (8 decimal precision, null if no trades yet) */
242
- last_price: string | null;
242
+ lastPrice: string | null;
243
243
  /** Unix timestamp (ms) of latest price (null if no trades yet) */
244
- last_price_timestamp: number | null;
244
+ lastPriceTimestamp: number | null;
245
245
  /** 24h high price (null if <24h data) */
246
- high_24h: string | null;
246
+ high24h: string | null;
247
247
  /** 24h low price (null if <24h data) */
248
- low_24h: string | null;
248
+ low24h: string | null;
249
249
  /** 24h volume in base asset (null if <24h data) */
250
- volume_24h: string | null;
250
+ volume24h: string | null;
251
251
  /** Absolute price change in 24h (null if <24h data) */
252
- price_change_24h: string | null;
252
+ priceChange24h: string | null;
253
253
  /** Percentage price change in 24h (2 decimals, null if <24h data) */
254
- price_change_percent_24h: string | null;
254
+ priceChangePercent24h: string | null;
255
255
  /** Unix timestamp (ms) when market started trading (null if not available) */
256
- market_initialization_timestamp: number | null;
256
+ marketInitializationTimestamp: number | null;
257
257
  /** Life-to-date cumulative base-token volume since inception ("0" if no trades yet) */
258
- total_base_volume_ltd: string;
258
+ totalBaseVolumeLtd: string;
259
259
  /** Life-to-date cumulative quote-token volume since inception ("0" if no trades yet) */
260
- total_quote_volume_ltd: string;
260
+ totalQuoteVolumeLtd: string;
261
261
  /** Life-to-date cumulative number of trades since inception (0 if no trades yet) */
262
- total_trade_count_ltd: number;
262
+ totalTradeCountLtd: number;
263
263
  }
264
264
  /**
265
265
  * Exchange-wide life-to-date cumulative statistics across all trading pairs.
266
266
  */
267
267
  export interface MarketStats {
268
268
  /** Life-to-date cumulative quote-token (notional) volume summed across all pairs */
269
- total_quote_volume_ltd: string;
269
+ totalQuoteVolumeLtd: string;
270
270
  /** Life-to-date cumulative number of trades summed across all pairs */
271
- total_trade_count_ltd: number;
271
+ totalTradeCountLtd: number;
272
272
  }
273
273
  export interface RiskTier {
274
274
  notional_floor: string;
275
275
  notional_cap?: string;
276
- initial_margin_ratio: string;
277
- maintenance_margin_ratio: string;
278
- max_leverage: string;
276
+ initialMarginRatio: string;
277
+ maintenanceMarginRatio: string;
278
+ maxLeverage: string;
279
279
  }
280
280
  export interface PerpMarketConfig {
281
- trading_pair_id: string;
281
+ tradingPairId: string;
282
282
  symbol: string;
283
- min_leverage: string;
284
- max_leverage: string;
285
- initial_margin_ratio: string;
286
- maintenance_margin_ratio: string;
287
- funding_interval_seconds: number;
288
- liquidation_fee_bps?: string;
289
- risk_tiers: RiskTier[];
290
- 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;
291
291
  }
292
292
  export interface PerpMarketSummary {
293
- trading_pair_id: string;
293
+ tradingPairId: string;
294
294
  symbol: string;
295
- last_price: string;
296
- mark_price: string;
297
- index_price: string;
298
- high_24h?: string;
299
- low_24h?: string;
300
- volume_24h?: string;
301
- price_change_24h?: string;
302
- price_change_percent_24h?: string;
303
- open_interest: string;
304
- current_funding_rate?: string;
305
- estimated_next_funding_rate?: string;
306
- next_funding_time?: string;
307
- market_status: string;
308
- market_regime: string;
309
- 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;
310
310
  }
311
311
  export interface MarkPrice {
312
- trading_pair_id: string;
313
- mark_price: string;
314
- oracle_provider: string;
315
- oracle_epoch?: string;
316
- updated_at: string;
312
+ tradingPairId: string;
313
+ markPrice: string;
314
+ oracleProvider: string;
315
+ oracleEpoch?: string;
316
+ updatedAt: string;
317
317
  regime: string;
318
318
  }
319
319
  export interface IndexComponent {
320
320
  provider: string;
321
321
  price: string;
322
322
  weight?: string;
323
- updated_at?: string;
323
+ updatedAt?: string;
324
324
  }
325
325
  export interface IndexPrice {
326
- trading_pair_id: string;
327
- index_price: string;
326
+ tradingPairId: string;
327
+ indexPrice: string;
328
328
  components: IndexComponent[];
329
- updated_at: string;
329
+ updatedAt: string;
330
330
  }
331
331
  export interface FundingState {
332
- trading_pair_id: string;
333
- current_funding_rate: string;
334
- estimated_next_funding_rate?: string;
335
- next_funding_time: string;
336
- funding_interval_seconds: number;
337
- last_funding_time?: string;
338
- updated_at: string;
332
+ tradingPairId: string;
333
+ currentFundingRate: string;
334
+ estimatedNextFundingRate?: string;
335
+ nextFundingTime: string;
336
+ fundingIntervalSeconds: number;
337
+ lastFundingTime?: string;
338
+ updatedAt: string;
339
339
  }
340
340
  export interface FundingRecord {
341
- trading_pair_id: string;
342
- funding_rate: string;
343
- funding_time: string;
344
- cumulative_funding_per_unit?: string;
341
+ tradingPairId: string;
342
+ fundingRate: string;
343
+ cumulativeFundingPerUnit?: string;
345
344
  }
346
345
  export interface ListFundingHistoryParams {
347
- start_time?: string;
348
- end_time?: string;
346
+ startTime?: string;
347
+ endTime?: string;
349
348
  page?: number;
350
- page_size?: number;
349
+ pageSize?: number;
351
350
  }
352
351
  export interface ListFundingHistoryResponse {
353
352
  records: FundingRecord[];
354
353
  total: number;
355
354
  page: number;
356
- page_size: number;
355
+ pageSize: number;
357
356
  }
358
357
  export interface OpenInterest {
359
- trading_pair_id: string;
360
- open_interest?: string;
361
- open_interest_base: string;
362
- open_interest_notional: string;
363
- updated_at: string;
358
+ tradingPairId: string;
359
+ openInterest?: string;
360
+ openInterestBase: string;
361
+ openInterestNotional: string;
362
+ updatedAt: string;
364
363
  }
365
364
  /**
366
365
  * Market API interface.