@0xmonaco/core 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.
@@ -3,11 +3,11 @@ export declare const perpRoutes: {
3
3
  readonly create: () => string;
4
4
  readonly list: (params?: {
5
5
  page?: number;
6
- page_size?: number;
6
+ pageSize?: number;
7
7
  status?: string;
8
- trading_pair?: string;
9
- trading_mode?: string;
10
- margin_account_id?: string;
8
+ tradingPair?: string;
9
+ tradingMode?: string;
10
+ marginAccountId?: string;
11
11
  }) => string;
12
12
  readonly get: (orderId: string) => string;
13
13
  readonly replace: (orderId: string) => string;
@@ -18,11 +18,11 @@ export declare const perpRoutes: {
18
18
  readonly batchCreate: () => string;
19
19
  readonly batchReplace: () => string;
20
20
  readonly listConditional: (params?: {
21
- margin_account_id?: string;
22
- trading_pair_id?: string;
21
+ marginAccountId?: string;
22
+ tradingPairId?: string;
23
23
  state?: string;
24
24
  page?: number;
25
- page_size?: number;
25
+ pageSize?: number;
26
26
  }) => string;
27
27
  readonly cancelConditional: (conditionalOrderId: string) => string;
28
28
  };
@@ -35,20 +35,24 @@ export declare const perpRoutes: {
35
35
  readonly withdrawals: {
36
36
  readonly initiate: () => string;
37
37
  readonly byIndex: (withdrawalIndex: number) => string;
38
+ readonly list: (params?: {
39
+ page?: number;
40
+ pageSize?: number;
41
+ }) => string;
38
42
  };
39
43
  readonly market: {
40
44
  readonly listTradingPairs: (params?: {
41
45
  page?: number;
42
46
  limit?: number;
43
- market_type?: string;
44
- base_token?: string;
45
- quote_token?: string;
46
- is_active?: boolean;
47
+ marketType?: string;
48
+ baseToken?: string;
49
+ quoteToken?: string;
50
+ isActive?: boolean;
47
51
  }) => string;
48
52
  readonly getTradingPair: (tradingPairId: string) => string;
49
53
  readonly getCandles: (tradingPairId: string, interval: string, params?: {
50
- start_time?: number;
51
- end_time?: number;
54
+ startTime?: number;
55
+ endTime?: number;
52
56
  limit?: number;
53
57
  }) => string;
54
58
  readonly getMarketMetadata: (tradingPairId: string) => string;
@@ -58,17 +62,17 @@ export declare const perpRoutes: {
58
62
  readonly getIndexPrice: (tradingPairId: string) => string;
59
63
  readonly getFundingState: (tradingPairId: string) => string;
60
64
  readonly listFundingHistory: (tradingPairId: string, params?: {
61
- start_time?: string;
62
- end_time?: string;
65
+ startTime?: string;
66
+ endTime?: string;
63
67
  page?: number;
64
- page_size?: number;
68
+ pageSize?: number;
65
69
  }) => string;
66
70
  readonly getOpenInterest: (tradingPairId: string) => string;
67
71
  readonly getScreener: (params?: {
68
72
  page?: number;
69
- page_size?: number;
70
- market_type?: string;
71
- is_active?: boolean;
73
+ pageSize?: number;
74
+ marketType?: string;
75
+ isActive?: boolean;
72
76
  category?: string;
73
77
  }) => string;
74
78
  readonly getMarketStats: () => string;
@@ -76,7 +80,7 @@ export declare const perpRoutes: {
76
80
  readonly orderbook: {
77
81
  readonly get: (tradingPairId: string, params?: {
78
82
  levels?: number;
79
- trading_mode?: string;
83
+ tradingMode?: string;
80
84
  magnitude?: string | number;
81
85
  denomination?: string;
82
86
  }) => string;
@@ -88,42 +92,42 @@ export declare const perpRoutes: {
88
92
  }) => string;
89
93
  readonly byId: (tradeId: string) => string;
90
94
  readonly user: (params?: {
91
- margin_account_id?: string;
92
- trading_pair_id?: string;
95
+ marginAccountId?: string;
96
+ tradingPairId?: string;
93
97
  page?: number;
94
- page_size?: number;
98
+ pageSize?: number;
95
99
  }) => string;
96
100
  };
97
101
  readonly applications: {
98
102
  readonly orders: (params?: {
99
103
  page?: number;
100
- page_size?: number;
104
+ pageSize?: number;
101
105
  status?: string;
102
- user_id?: string;
103
- trading_pair_id?: string;
106
+ userId?: string;
107
+ tradingPairId?: string;
104
108
  side?: string;
105
- order_type?: string;
109
+ orderType?: string;
106
110
  }) => string;
107
111
  readonly users: (params?: {
108
112
  page?: number;
109
- page_size?: number;
110
- is_active?: boolean;
111
- account_type?: string;
113
+ pageSize?: number;
114
+ isActive?: boolean;
115
+ accountType?: string;
112
116
  address?: string;
113
117
  }) => string;
114
118
  readonly movements: (params?: {
115
119
  page?: number;
116
- page_size?: number;
117
- user_id?: string;
118
- transaction_type?: string;
119
- entry_type?: string;
120
- asset_id?: string;
120
+ pageSize?: number;
121
+ userId?: string;
122
+ transactionType?: string;
123
+ entryType?: string;
124
+ assetId?: string;
121
125
  }) => string;
122
126
  readonly balances: (params?: {
123
127
  page?: number;
124
- page_size?: number;
125
- user_id?: string;
126
- asset_id?: string;
128
+ pageSize?: number;
129
+ userId?: string;
130
+ assetId?: string;
127
131
  }) => string;
128
132
  readonly stats: (params?: {
129
133
  since?: string;
@@ -143,11 +147,11 @@ export declare const perpRoutes: {
143
147
  };
144
148
  readonly positions: {
145
149
  readonly list: (params?: {
146
- margin_account_id?: string;
147
- trading_pair_id?: string;
150
+ marginAccountId?: string;
151
+ tradingPairId?: string;
148
152
  status?: string;
149
153
  page?: number;
150
- page_size?: number;
154
+ pageSize?: number;
151
155
  }) => string;
152
156
  readonly get: (positionId: string) => string;
153
157
  readonly close: (positionId: string) => string;
@@ -157,25 +161,25 @@ export declare const perpRoutes: {
157
161
  readonly reduceMargin: (positionId: string) => string;
158
162
  readonly attachTpSl: (positionId: string) => string;
159
163
  readonly history: (params?: {
160
- position_id?: string;
161
- margin_account_id?: string;
162
- trading_pair_id?: string;
164
+ positionId?: string;
165
+ marginAccountId?: string;
166
+ tradingPairId?: string;
163
167
  page?: number;
164
- page_size?: number;
168
+ pageSize?: number;
165
169
  }) => string;
166
170
  };
167
171
  readonly marginAccounts: {
168
172
  readonly list: (params?: {
169
173
  page?: number;
170
- page_size?: number;
174
+ pageSize?: number;
171
175
  state?: string;
172
- trading_pair_id?: string;
176
+ tradingPairId?: string;
173
177
  }) => string;
174
178
  readonly parentSummary: (params?: {
175
- trading_pair_id?: string;
179
+ tradingPairId?: string;
176
180
  }) => string;
177
181
  readonly summary: (marginAccountId: string, params?: {
178
- trading_pair_id?: string;
182
+ tradingPairId?: string;
179
183
  }) => string;
180
184
  readonly availableCollateral: (params?: {
181
185
  asset?: string;
@@ -186,14 +190,14 @@ export declare const perpRoutes: {
186
190
  readonly transferOut: (marginAccountId: string) => string;
187
191
  readonly transferOutParent: () => string;
188
192
  readonly movements: (marginAccountId: string, params?: {
189
- movement_type?: string;
193
+ movementType?: string;
190
194
  page?: number;
191
- page_size?: number;
195
+ pageSize?: number;
192
196
  }) => string;
193
197
  readonly parentMovements: (params?: {
194
- movement_type?: string;
198
+ movementType?: string;
195
199
  page?: number;
196
- page_size?: number;
200
+ pageSize?: number;
197
201
  }) => string;
198
202
  readonly simulateParentMarginOrderRisk: () => string;
199
203
  readonly simulateOrderRisk: (marginAccountId: string) => string;
@@ -38,6 +38,7 @@ export const perpRoutes = {
38
38
  withdrawals: {
39
39
  initiate: () => `${API_V1}/withdrawals`,
40
40
  byIndex: (withdrawalIndex) => `${API_V1}/withdrawals/${encodeSegment(String(withdrawalIndex))}`,
41
+ list: (params) => withQuery(`${API_V1}/withdrawals`, params),
41
42
  },
42
43
  market: {
43
44
  listTradingPairs: (params) => withQuery(`${API_V1}/market/pairs`, params),
@@ -17,9 +17,9 @@ export class PositionsAPIImpl extends BaseAPI {
17
17
  return await this.makeAuthenticatedRequest(perpRoutes.positions.close(positionId), {
18
18
  method: "POST",
19
19
  body: JSON.stringify({
20
- close_type: request.closeType,
21
- limit_price: request.limitPrice,
22
- slippage_tolerance_bps: request.slippageToleranceBps,
20
+ closeType: request.closeType,
21
+ limitPrice: request.limitPrice,
22
+ slippageToleranceBps: request.slippageToleranceBps,
23
23
  quantity: request.quantity,
24
24
  }),
25
25
  });
@@ -31,8 +31,8 @@ export class PositionsAPIImpl extends BaseAPI {
31
31
  return await this.makeAuthenticatedRequest(perpRoutes.positions.batchCloseAll(), {
32
32
  method: "POST",
33
33
  body: JSON.stringify({
34
- trading_pair_id: request?.tradingPairId,
35
- slippage_tolerance_bps: request?.slippageToleranceBps,
34
+ tradingPairId: request?.tradingPairId,
35
+ slippageToleranceBps: request?.slippageToleranceBps,
36
36
  }),
37
37
  });
38
38
  }
@@ -64,26 +64,26 @@ export class PositionsAPIImpl extends BaseAPI {
64
64
  return await this.makeAuthenticatedRequest(perpRoutes.positions.attachTpSl(positionId), {
65
65
  method: "POST",
66
66
  body: JSON.stringify({
67
- take_profit: request.takeProfit
67
+ takeProfit: request.takeProfit
68
68
  ? {
69
- trigger_price: request.takeProfit.triggerPrice,
70
- order_type: request.takeProfit.orderType,
71
- limit_price: request.takeProfit.limitPrice,
69
+ triggerPrice: request.takeProfit.triggerPrice,
70
+ orderType: request.takeProfit.orderType,
71
+ limitPrice: request.takeProfit.limitPrice,
72
72
  quantity: request.takeProfit.quantity,
73
- time_in_force: request.takeProfit.timeInForce,
74
- slippage_tolerance_bps: request.takeProfit.slippageToleranceBps,
75
- expires_at: request.takeProfit.expiresAt,
73
+ timeInForce: request.takeProfit.timeInForce,
74
+ slippageToleranceBps: request.takeProfit.slippageToleranceBps,
75
+ expiresAt: request.takeProfit.expiresAt,
76
76
  }
77
77
  : undefined,
78
- stop_loss: request.stopLoss
78
+ stopLoss: request.stopLoss
79
79
  ? {
80
- trigger_price: request.stopLoss.triggerPrice,
81
- order_type: request.stopLoss.orderType,
82
- limit_price: request.stopLoss.limitPrice,
80
+ triggerPrice: request.stopLoss.triggerPrice,
81
+ orderType: request.stopLoss.orderType,
82
+ limitPrice: request.stopLoss.limitPrice,
83
83
  quantity: request.stopLoss.quantity,
84
- time_in_force: request.stopLoss.timeInForce,
85
- slippage_tolerance_bps: request.stopLoss.slippageToleranceBps,
86
- expires_at: request.stopLoss.expiresAt,
84
+ timeInForce: request.stopLoss.timeInForce,
85
+ slippageToleranceBps: request.stopLoss.slippageToleranceBps,
86
+ expiresAt: request.stopLoss.expiresAt,
87
87
  }
88
88
  : undefined,
89
89
  }),
@@ -39,8 +39,8 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
39
39
  * console.log(`User ID: ${profile.id}`);
40
40
  * console.log(`Address: ${profile.address}`);
41
41
  * console.log(`Username: ${profile.username}`);
42
- * console.log(`Account type: ${profile.account_type}`);
43
- * console.log(`Can withdraw: ${profile.can_withdraw}`);
42
+ * console.log(`Account type: ${profile.accountType}`);
43
+ * console.log(`Can withdraw: ${profile.canWithdraw}`);
44
44
  * ```
45
45
  */
46
46
  getProfile(): Promise<UserProfile>;
@@ -53,27 +53,27 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
53
53
  * @param params - Optional query parameters for pagination and filtering
54
54
  * @param params.page - Page number (starts from 1, default: 1)
55
55
  * @param params.limit - Number of items per page (default: 20, max: 100)
56
- * @param params.entry_type - Filter by entry type (CREDIT, DEBIT, LOCK, UNLOCK, FEE)
57
- * @param params.transaction_type - Filter by transaction type (DEPOSIT, WITHDRAWAL, TRADE, FEE, FUNDING, LIQUIDATION, INTEREST, REWARD)
58
- * @param params.asset_id - Filter by asset ID (UUID)
56
+ * @param params.entryType - Filter by entry type (CREDIT, DEBIT, LOCK, UNLOCK, FEE)
57
+ * @param params.transactionType - Filter by transaction type (DEPOSIT, WITHDRAWAL, TRADE, FEE, FUNDING, LIQUIDATION, INTEREST, REWARD)
58
+ * @param params.assetId - Filter by asset ID (UUID)
59
59
  * @returns Promise resolving to paginated movements response
60
60
  * @throws {APIError} When the request fails or user is not authenticated
61
61
  *
62
62
  * @example
63
63
  * ```typescript
64
- * // Get first page with default page_size (20)
64
+ * // Get first page with default pageSize (20)
65
65
  * const movements = await profileAPI.getPaginatedUserMovements();
66
66
  * console.log(`Total movements: ${movements.total}`);
67
67
  *
68
- * // Get second page with custom page_size
69
- * const page2 = await profileAPI.getPaginatedUserMovements({ page: 2, page_size: 50 });
70
- * console.log(`Page ${page2.page} of ${page2.total_pages}`);
68
+ * // Get second page with custom pageSize
69
+ * const page2 = await profileAPI.getPaginatedUserMovements({ page: 2, pageSize: 50 });
70
+ * console.log(`Page ${page2.page} of ${page2.totalPages}`);
71
71
  *
72
72
  * // Filter by entry type and transaction type
73
- * const deposits = await profileAPI.getPaginatedUserMovements({ entry_type: "CREDIT", transaction_type: "DEPOSIT" });
73
+ * const deposits = await profileAPI.getPaginatedUserMovements({ entryType: "CREDIT", transactionType: "DEPOSIT" });
74
74
  *
75
75
  * // Filter by asset
76
- * const usdcMovements = await profileAPI.getPaginatedUserMovements({ asset_id: "550e8400-e29b-41d4-a716-446655440000" });
76
+ * const usdcMovements = await profileAPI.getPaginatedUserMovements({ assetId: "550e8400-e29b-41d4-a716-446655440000" });
77
77
  * ```
78
78
  */
79
79
  getPaginatedUserMovements(params?: GetUserMovementsParams): Promise<GetPaginatedUserMovementsResponse>;
@@ -85,7 +85,7 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
85
85
  *
86
86
  * @param params - Optional query parameters for pagination
87
87
  * @param params.page - Page number (starts from 1, default: 1)
88
- * @param params.page_size - Number of items per page (default: 20, max: 100)
88
+ * @param params.pageSize - Number of items per page (default: 20, max: 100)
89
89
  * @returns Promise resolving to paginated balances response
90
90
  * @throws {APIError} When the request fails or user is not authenticated
91
91
  *
@@ -95,11 +95,11 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
95
95
  * const balances = await profileAPI.getUserBalances();
96
96
  * console.log(`Total balances: ${balances.total}`);
97
97
  * balances.balances.forEach(balance => {
98
- * console.log(`${balance.symbol}: ${balance.available_balance}`);
98
+ * console.log(`${balance.symbol}: ${balance.availableBalance}`);
99
99
  * });
100
100
  *
101
101
  * // Get page 2 with 50 items per page
102
- * const nextBalances = await profileAPI.getUserBalances({ page: 2, page_size: 50 });
102
+ * const nextBalances = await profileAPI.getUserBalances({ page: 2, pageSize: 50 });
103
103
  * console.log(`Returned ${nextBalances.balances.length} balances`);
104
104
  * ```
105
105
  */
@@ -107,7 +107,7 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
107
107
  /**
108
108
  * Get the current user's balance for a specific asset.
109
109
  *
110
- * Fetches the user's balance for a specific asset from the /api/v1/accounts/balances/{asset_id} endpoint.
110
+ * Fetches the user's balance for a specific asset from the /api/v1/accounts/balances/{assetId} endpoint.
111
111
  * Requires a valid access token to be set. If no balance exists for a valid asset, returns zero balances.
112
112
  *
113
113
  * @param assetId - The asset identifier (UUID)
@@ -118,9 +118,9 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
118
118
  * ```typescript
119
119
  * // Get balance for a specific asset
120
120
  * const balance = await profileAPI.getUserBalanceByAssetId('123e4567-e89b-12d3-a456-426614174000');
121
- * console.log(`${balance.symbol}: ${balance.available_balance}`);
122
- * console.log(`Locked: ${balance.locked_balance}`);
123
- * console.log(`Total: ${balance.total_balance}`);
121
+ * console.log(`${balance.symbol}: ${balance.availableBalance}`);
122
+ * console.log(`Locked: ${balance.lockedBalance}`);
123
+ * console.log(`Total: ${balance.totalBalance}`);
124
124
  * ```
125
125
  */
126
126
  getUserBalanceByAssetId(assetId: string): Promise<AccountBalance>;
@@ -139,7 +139,7 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
139
139
  * const stats = await profileAPI.getPortfolioStats("30d");
140
140
  * console.log(`PnL: ${stats.pnl}`);
141
141
  * console.log(`Volume: ${stats.volume}`);
142
- * console.log(`Total equity: ${stats.total_equity}`);
142
+ * console.log(`Total equity: ${stats.totalEquity}`);
143
143
  * ```
144
144
  */
145
145
  getPortfolioStats(period: PortfolioPeriod): Promise<PortfolioStats>;
@@ -171,8 +171,8 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
171
171
  *
172
172
  * @param params - Optional query parameters for pagination and filtering
173
173
  * @param params.page - Page number (starts from 1, default: 1)
174
- * @param params.page_size - Number of items per page (default: 20, max: 100)
175
- * @param params.trading_pair_id - Filter by trading pair ID (UUID)
174
+ * @param params.pageSize - Number of items per page (default: 20, max: 100)
175
+ * @param params.tradingPairId - Filter by trading pair ID (UUID)
176
176
  * @returns Promise resolving to paginated trades response
177
177
  * @throws {ValidationError} When the provided params fail client-side validation
178
178
  * @throws {APIError} When the request fails or user is not authenticated
@@ -184,7 +184,7 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
184
184
  * console.log(`Total trades: ${trades.total}`);
185
185
  *
186
186
  * // Filter by trading pair
187
- * const pairTrades = await profileAPI.getUserTrades({ trading_pair_id: "550e8400-e29b-41d4-a716-446655440000" });
187
+ * const pairTrades = await profileAPI.getUserTrades({ tradingPairId: "550e8400-e29b-41d4-a716-446655440000" });
188
188
  * ```
189
189
  */
190
190
  getUserTrades(params?: GetUserTradesParams): Promise<GetUserTradesResponse>;
@@ -200,7 +200,7 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
200
200
  *
201
201
  * @example
202
202
  * ```typescript
203
- * const funding = await profileAPI.listFundingPayments({ trading_pair_id: "550e8400-e29b-41d4-a716-446655440000" });
203
+ * const funding = await profileAPI.listFundingPayments({ tradingPairId: "550e8400-e29b-41d4-a716-446655440000" });
204
204
  * console.log(`Total funding payments: ${funding.total}`);
205
205
  * ```
206
206
  */
@@ -40,8 +40,8 @@ export class ProfileAPIImpl extends BaseAPI {
40
40
  * console.log(`User ID: ${profile.id}`);
41
41
  * console.log(`Address: ${profile.address}`);
42
42
  * console.log(`Username: ${profile.username}`);
43
- * console.log(`Account type: ${profile.account_type}`);
44
- * console.log(`Can withdraw: ${profile.can_withdraw}`);
43
+ * console.log(`Account type: ${profile.accountType}`);
44
+ * console.log(`Can withdraw: ${profile.canWithdraw}`);
45
45
  * ```
46
46
  */
47
47
  async getProfile() {
@@ -56,27 +56,27 @@ export class ProfileAPIImpl extends BaseAPI {
56
56
  * @param params - Optional query parameters for pagination and filtering
57
57
  * @param params.page - Page number (starts from 1, default: 1)
58
58
  * @param params.limit - Number of items per page (default: 20, max: 100)
59
- * @param params.entry_type - Filter by entry type (CREDIT, DEBIT, LOCK, UNLOCK, FEE)
60
- * @param params.transaction_type - Filter by transaction type (DEPOSIT, WITHDRAWAL, TRADE, FEE, FUNDING, LIQUIDATION, INTEREST, REWARD)
61
- * @param params.asset_id - Filter by asset ID (UUID)
59
+ * @param params.entryType - Filter by entry type (CREDIT, DEBIT, LOCK, UNLOCK, FEE)
60
+ * @param params.transactionType - Filter by transaction type (DEPOSIT, WITHDRAWAL, TRADE, FEE, FUNDING, LIQUIDATION, INTEREST, REWARD)
61
+ * @param params.assetId - Filter by asset ID (UUID)
62
62
  * @returns Promise resolving to paginated movements response
63
63
  * @throws {APIError} When the request fails or user is not authenticated
64
64
  *
65
65
  * @example
66
66
  * ```typescript
67
- * // Get first page with default page_size (20)
67
+ * // Get first page with default pageSize (20)
68
68
  * const movements = await profileAPI.getPaginatedUserMovements();
69
69
  * console.log(`Total movements: ${movements.total}`);
70
70
  *
71
- * // Get second page with custom page_size
72
- * const page2 = await profileAPI.getPaginatedUserMovements({ page: 2, page_size: 50 });
73
- * console.log(`Page ${page2.page} of ${page2.total_pages}`);
71
+ * // Get second page with custom pageSize
72
+ * const page2 = await profileAPI.getPaginatedUserMovements({ page: 2, pageSize: 50 });
73
+ * console.log(`Page ${page2.page} of ${page2.totalPages}`);
74
74
  *
75
75
  * // Filter by entry type and transaction type
76
- * const deposits = await profileAPI.getPaginatedUserMovements({ entry_type: "CREDIT", transaction_type: "DEPOSIT" });
76
+ * const deposits = await profileAPI.getPaginatedUserMovements({ entryType: "CREDIT", transactionType: "DEPOSIT" });
77
77
  *
78
78
  * // Filter by asset
79
- * const usdcMovements = await profileAPI.getPaginatedUserMovements({ asset_id: "550e8400-e29b-41d4-a716-446655440000" });
79
+ * const usdcMovements = await profileAPI.getPaginatedUserMovements({ assetId: "550e8400-e29b-41d4-a716-446655440000" });
80
80
  * ```
81
81
  */
82
82
  async getPaginatedUserMovements(params) {
@@ -87,17 +87,17 @@ export class ProfileAPIImpl extends BaseAPI {
87
87
  if (params?.page !== undefined) {
88
88
  searchParams.append("page", params.page.toString());
89
89
  }
90
- if (params?.page_size !== undefined) {
91
- searchParams.append("page_size", params.page_size.toString());
90
+ if (params?.pageSize !== undefined) {
91
+ searchParams.append("pageSize", params.pageSize.toString());
92
92
  }
93
- if (params?.entry_type !== undefined) {
94
- searchParams.append("entry_type", params.entry_type);
93
+ if (params?.entryType !== undefined) {
94
+ searchParams.append("entryType", params.entryType);
95
95
  }
96
- if (params?.transaction_type !== undefined) {
97
- searchParams.append("transaction_type", params.transaction_type);
96
+ if (params?.transactionType !== undefined) {
97
+ searchParams.append("transactionType", params.transactionType);
98
98
  }
99
- if (params?.asset_id !== undefined) {
100
- searchParams.append("asset_id", params.asset_id);
99
+ if (params?.assetId !== undefined) {
100
+ searchParams.append("assetId", params.assetId);
101
101
  }
102
102
  const queryString = searchParams.toString();
103
103
  const url = queryString ? `/api/v1/accounts/movements?${queryString}` : "/api/v1/accounts/movements";
@@ -111,7 +111,7 @@ export class ProfileAPIImpl extends BaseAPI {
111
111
  *
112
112
  * @param params - Optional query parameters for pagination
113
113
  * @param params.page - Page number (starts from 1, default: 1)
114
- * @param params.page_size - Number of items per page (default: 20, max: 100)
114
+ * @param params.pageSize - Number of items per page (default: 20, max: 100)
115
115
  * @returns Promise resolving to paginated balances response
116
116
  * @throws {APIError} When the request fails or user is not authenticated
117
117
  *
@@ -121,11 +121,11 @@ export class ProfileAPIImpl extends BaseAPI {
121
121
  * const balances = await profileAPI.getUserBalances();
122
122
  * console.log(`Total balances: ${balances.total}`);
123
123
  * balances.balances.forEach(balance => {
124
- * console.log(`${balance.symbol}: ${balance.available_balance}`);
124
+ * console.log(`${balance.symbol}: ${balance.availableBalance}`);
125
125
  * });
126
126
  *
127
127
  * // Get page 2 with 50 items per page
128
- * const nextBalances = await profileAPI.getUserBalances({ page: 2, page_size: 50 });
128
+ * const nextBalances = await profileAPI.getUserBalances({ page: 2, pageSize: 50 });
129
129
  * console.log(`Returned ${nextBalances.balances.length} balances`);
130
130
  * ```
131
131
  */
@@ -134,8 +134,8 @@ export class ProfileAPIImpl extends BaseAPI {
134
134
  if (params?.page !== undefined) {
135
135
  searchParams.append("page", params.page.toString());
136
136
  }
137
- if (params?.page_size !== undefined) {
138
- searchParams.append("page_size", params.page_size.toString());
137
+ if (params?.pageSize !== undefined) {
138
+ searchParams.append("pageSize", params.pageSize.toString());
139
139
  }
140
140
  const queryString = searchParams.toString();
141
141
  const url = queryString ? `/api/v1/accounts/balances?${queryString}` : "/api/v1/accounts/balances";
@@ -144,7 +144,7 @@ export class ProfileAPIImpl extends BaseAPI {
144
144
  /**
145
145
  * Get the current user's balance for a specific asset.
146
146
  *
147
- * Fetches the user's balance for a specific asset from the /api/v1/accounts/balances/{asset_id} endpoint.
147
+ * Fetches the user's balance for a specific asset from the /api/v1/accounts/balances/{assetId} endpoint.
148
148
  * Requires a valid access token to be set. If no balance exists for a valid asset, returns zero balances.
149
149
  *
150
150
  * @param assetId - The asset identifier (UUID)
@@ -155,15 +155,15 @@ export class ProfileAPIImpl extends BaseAPI {
155
155
  * ```typescript
156
156
  * // Get balance for a specific asset
157
157
  * const balance = await profileAPI.getUserBalanceByAssetId('123e4567-e89b-12d3-a456-426614174000');
158
- * console.log(`${balance.symbol}: ${balance.available_balance}`);
159
- * console.log(`Locked: ${balance.locked_balance}`);
160
- * console.log(`Total: ${balance.total_balance}`);
158
+ * console.log(`${balance.symbol}: ${balance.availableBalance}`);
159
+ * console.log(`Locked: ${balance.lockedBalance}`);
160
+ * console.log(`Total: ${balance.totalBalance}`);
161
161
  * ```
162
162
  */
163
163
  async getUserBalanceByAssetId(assetId) {
164
164
  if (!assetId || assetId.trim() === "") {
165
165
  throw new APIError("assetId is required and cannot be empty", {
166
- endpoint: "/api/v1/accounts/balances/{asset_id}",
166
+ endpoint: "/api/v1/accounts/balances/{assetId}",
167
167
  });
168
168
  }
169
169
  const url = `/api/v1/accounts/balances/${assetId}`;
@@ -184,7 +184,7 @@ export class ProfileAPIImpl extends BaseAPI {
184
184
  * const stats = await profileAPI.getPortfolioStats("30d");
185
185
  * console.log(`PnL: ${stats.pnl}`);
186
186
  * console.log(`Volume: ${stats.volume}`);
187
- * console.log(`Total equity: ${stats.total_equity}`);
187
+ * console.log(`Total equity: ${stats.totalEquity}`);
188
188
  * ```
189
189
  */
190
190
  async getPortfolioStats(period) {
@@ -222,8 +222,8 @@ export class ProfileAPIImpl extends BaseAPI {
222
222
  *
223
223
  * @param params - Optional query parameters for pagination and filtering
224
224
  * @param params.page - Page number (starts from 1, default: 1)
225
- * @param params.page_size - Number of items per page (default: 20, max: 100)
226
- * @param params.trading_pair_id - Filter by trading pair ID (UUID)
225
+ * @param params.pageSize - Number of items per page (default: 20, max: 100)
226
+ * @param params.tradingPairId - Filter by trading pair ID (UUID)
227
227
  * @returns Promise resolving to paginated trades response
228
228
  * @throws {ValidationError} When the provided params fail client-side validation
229
229
  * @throws {APIError} When the request fails or user is not authenticated
@@ -235,7 +235,7 @@ export class ProfileAPIImpl extends BaseAPI {
235
235
  * console.log(`Total trades: ${trades.total}`);
236
236
  *
237
237
  * // Filter by trading pair
238
- * const pairTrades = await profileAPI.getUserTrades({ trading_pair_id: "550e8400-e29b-41d4-a716-446655440000" });
238
+ * const pairTrades = await profileAPI.getUserTrades({ tradingPairId: "550e8400-e29b-41d4-a716-446655440000" });
239
239
  * ```
240
240
  */
241
241
  async getUserTrades(params) {
@@ -246,11 +246,11 @@ export class ProfileAPIImpl extends BaseAPI {
246
246
  if (params?.page !== undefined) {
247
247
  searchParams.append("page", params.page.toString());
248
248
  }
249
- if (params?.page_size !== undefined) {
250
- searchParams.append("page_size", params.page_size.toString());
249
+ if (params?.pageSize !== undefined) {
250
+ searchParams.append("pageSize", params.pageSize.toString());
251
251
  }
252
- if (params?.trading_pair_id !== undefined) {
253
- searchParams.append("trading_pair_id", params.trading_pair_id);
252
+ if (params?.tradingPairId !== undefined) {
253
+ searchParams.append("tradingPairId", params.tradingPairId);
254
254
  }
255
255
  const queryString = searchParams.toString();
256
256
  const url = queryString ? `/api/v1/accounts/trades?${queryString}` : "/api/v1/accounts/trades";
@@ -268,7 +268,7 @@ export class ProfileAPIImpl extends BaseAPI {
268
268
  *
269
269
  * @example
270
270
  * ```typescript
271
- * const funding = await profileAPI.listFundingPayments({ trading_pair_id: "550e8400-e29b-41d4-a716-446655440000" });
271
+ * const funding = await profileAPI.listFundingPayments({ tradingPairId: "550e8400-e29b-41d4-a716-446655440000" });
272
272
  * console.log(`Total funding payments: ${funding.total}`);
273
273
  * ```
274
274
  */
@@ -280,17 +280,17 @@ export class ProfileAPIImpl extends BaseAPI {
280
280
  if (params?.page !== undefined) {
281
281
  searchParams.append("page", params.page.toString());
282
282
  }
283
- if (params?.page_size !== undefined) {
284
- searchParams.append("page_size", params.page_size.toString());
283
+ if (params?.pageSize !== undefined) {
284
+ searchParams.append("pageSize", params.pageSize.toString());
285
285
  }
286
- if (params?.trading_pair_id !== undefined) {
287
- searchParams.append("trading_pair_id", params.trading_pair_id);
286
+ if (params?.tradingPairId !== undefined) {
287
+ searchParams.append("tradingPairId", params.tradingPairId);
288
288
  }
289
- if (params?.position_id !== undefined) {
290
- searchParams.append("position_id", params.position_id);
289
+ if (params?.positionId !== undefined) {
290
+ searchParams.append("positionId", params.positionId);
291
291
  }
292
- if (params?.margin_account_id !== undefined) {
293
- searchParams.append("margin_account_id", params.margin_account_id);
292
+ if (params?.marginAccountId !== undefined) {
293
+ searchParams.append("marginAccountId", params.marginAccountId);
294
294
  }
295
295
  const queryString = searchParams.toString();
296
296
  const url = queryString ? `/api/v1/accounts/funding-payments?${queryString}` : "/api/v1/accounts/funding-payments";
@@ -9,8 +9,8 @@
9
9
  *
10
10
  * @example
11
11
  * ```typescript
12
- * const { sub_accounts } = await sdk.subAccounts.list();
13
- * await sdk.subAccounts.createLimit({ sub_account_id, asset_id, max_amount: "1000.00" });
12
+ * const { subAccounts } = await sdk.subAccounts.list();
13
+ * await sdk.subAccounts.createLimit({ subAccountId, assetId, maxAmount: "1000.00" });
14
14
  * ```
15
15
  */
16
16
  import type { CreateSubAccountLimitRequest, CreateSubAccountLimitResponse, GetSubAccountLimitsResponse, ListSubAccountsResponse, SubAccountsAPI, UpdateSubAccountLimitBody, UpdateSubAccountLimitResponse } from "@0xmonaco/types";