@0xmonaco/core 0.0.0-develop-20260323152825 → 0.0.0-develop-20260412233650

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 (130) hide show
  1. package/README.md +4 -7
  2. package/dist/api/applications/api.d.ts +0 -1
  3. package/dist/api/applications/api.js +0 -1
  4. package/dist/api/applications/index.d.ts +0 -1
  5. package/dist/api/applications/index.js +0 -1
  6. package/dist/api/auth/api.d.ts +9 -9
  7. package/dist/api/auth/api.js +9 -12
  8. package/dist/api/auth/index.d.ts +0 -1
  9. package/dist/api/auth/index.js +0 -1
  10. package/dist/api/base.d.ts +0 -1
  11. package/dist/api/base.js +0 -1
  12. package/dist/api/fees/api.d.ts +2 -1
  13. package/dist/api/fees/api.js +8 -1
  14. package/dist/api/fees/index.d.ts +0 -1
  15. package/dist/api/fees/index.js +0 -1
  16. package/dist/api/index.d.ts +0 -1
  17. package/dist/api/index.js +0 -1
  18. package/dist/api/market/api.d.ts +0 -1
  19. package/dist/api/market/api.js +0 -1
  20. package/dist/api/market/index.d.ts +0 -1
  21. package/dist/api/market/index.js +0 -1
  22. package/dist/api/orderbook/api.d.ts +0 -1
  23. package/dist/api/orderbook/api.js +0 -1
  24. package/dist/api/orderbook/index.d.ts +0 -1
  25. package/dist/api/orderbook/index.js +0 -1
  26. package/dist/api/profile/api.d.ts +26 -2
  27. package/dist/api/profile/api.js +47 -4
  28. package/dist/api/profile/index.d.ts +0 -1
  29. package/dist/api/profile/index.js +0 -1
  30. package/dist/api/trades/api.d.ts +0 -1
  31. package/dist/api/trades/api.js +0 -1
  32. package/dist/api/trades/index.d.ts +0 -1
  33. package/dist/api/trades/index.js +0 -1
  34. package/dist/api/trading/api.d.ts +0 -1
  35. package/dist/api/trading/api.js +0 -1
  36. package/dist/api/trading/index.d.ts +0 -1
  37. package/dist/api/trading/index.js +0 -1
  38. package/dist/api/vault/api.d.ts +0 -1
  39. package/dist/api/vault/api.js +0 -1
  40. package/dist/api/vault/index.d.ts +0 -1
  41. package/dist/api/vault/index.js +0 -1
  42. package/dist/api/websocket/index.d.ts +0 -1
  43. package/dist/api/websocket/index.js +0 -1
  44. package/dist/api/websocket/types.d.ts +0 -1
  45. package/dist/api/websocket/types.js +0 -1
  46. package/dist/api/websocket/utils.d.ts +0 -1
  47. package/dist/api/websocket/utils.js +0 -1
  48. package/dist/api/websocket/websocket.d.ts +0 -1
  49. package/dist/api/websocket/websocket.js +0 -1
  50. package/dist/errors/errors.d.ts +0 -1
  51. package/dist/errors/errors.js +0 -1
  52. package/dist/errors/index.d.ts +0 -1
  53. package/dist/errors/index.js +0 -1
  54. package/dist/index.d.ts +0 -1
  55. package/dist/index.js +0 -1
  56. package/dist/networks/index.d.ts +0 -1
  57. package/dist/networks/index.js +0 -1
  58. package/dist/networks/networks.d.ts +0 -1
  59. package/dist/networks/networks.js +0 -1
  60. package/dist/sdk.d.ts +4 -5
  61. package/dist/sdk.js +5 -6
  62. package/dist/utils/index.d.ts +0 -1
  63. package/dist/utils/index.js +0 -1
  64. package/dist/utils/magnitude.d.ts +0 -1
  65. package/dist/utils/magnitude.js +0 -1
  66. package/package.json +3 -3
  67. package/dist/api/applications/api.d.ts.map +0 -1
  68. package/dist/api/applications/api.js.map +0 -1
  69. package/dist/api/applications/index.d.ts.map +0 -1
  70. package/dist/api/applications/index.js.map +0 -1
  71. package/dist/api/auth/api.d.ts.map +0 -1
  72. package/dist/api/auth/api.js.map +0 -1
  73. package/dist/api/auth/index.d.ts.map +0 -1
  74. package/dist/api/auth/index.js.map +0 -1
  75. package/dist/api/base.d.ts.map +0 -1
  76. package/dist/api/base.js.map +0 -1
  77. package/dist/api/fees/api.d.ts.map +0 -1
  78. package/dist/api/fees/api.js.map +0 -1
  79. package/dist/api/fees/index.d.ts.map +0 -1
  80. package/dist/api/fees/index.js.map +0 -1
  81. package/dist/api/index.d.ts.map +0 -1
  82. package/dist/api/index.js.map +0 -1
  83. package/dist/api/market/api.d.ts.map +0 -1
  84. package/dist/api/market/api.js.map +0 -1
  85. package/dist/api/market/index.d.ts.map +0 -1
  86. package/dist/api/market/index.js.map +0 -1
  87. package/dist/api/orderbook/api.d.ts.map +0 -1
  88. package/dist/api/orderbook/api.js.map +0 -1
  89. package/dist/api/orderbook/index.d.ts.map +0 -1
  90. package/dist/api/orderbook/index.js.map +0 -1
  91. package/dist/api/profile/api.d.ts.map +0 -1
  92. package/dist/api/profile/api.js.map +0 -1
  93. package/dist/api/profile/index.d.ts.map +0 -1
  94. package/dist/api/profile/index.js.map +0 -1
  95. package/dist/api/trades/api.d.ts.map +0 -1
  96. package/dist/api/trades/api.js.map +0 -1
  97. package/dist/api/trades/index.d.ts.map +0 -1
  98. package/dist/api/trades/index.js.map +0 -1
  99. package/dist/api/trading/api.d.ts.map +0 -1
  100. package/dist/api/trading/api.js.map +0 -1
  101. package/dist/api/trading/index.d.ts.map +0 -1
  102. package/dist/api/trading/index.js.map +0 -1
  103. package/dist/api/vault/api.d.ts.map +0 -1
  104. package/dist/api/vault/api.js.map +0 -1
  105. package/dist/api/vault/index.d.ts.map +0 -1
  106. package/dist/api/vault/index.js.map +0 -1
  107. package/dist/api/websocket/index.d.ts.map +0 -1
  108. package/dist/api/websocket/index.js.map +0 -1
  109. package/dist/api/websocket/types.d.ts.map +0 -1
  110. package/dist/api/websocket/types.js.map +0 -1
  111. package/dist/api/websocket/utils.d.ts.map +0 -1
  112. package/dist/api/websocket/utils.js.map +0 -1
  113. package/dist/api/websocket/websocket.d.ts.map +0 -1
  114. package/dist/api/websocket/websocket.js.map +0 -1
  115. package/dist/errors/errors.d.ts.map +0 -1
  116. package/dist/errors/errors.js.map +0 -1
  117. package/dist/errors/index.d.ts.map +0 -1
  118. package/dist/errors/index.js.map +0 -1
  119. package/dist/index.d.ts.map +0 -1
  120. package/dist/index.js.map +0 -1
  121. package/dist/networks/index.d.ts.map +0 -1
  122. package/dist/networks/index.js.map +0 -1
  123. package/dist/networks/networks.d.ts.map +0 -1
  124. package/dist/networks/networks.js.map +0 -1
  125. package/dist/sdk.d.ts.map +0 -1
  126. package/dist/sdk.js.map +0 -1
  127. package/dist/utils/index.d.ts.map +0 -1
  128. package/dist/utils/index.js.map +0 -1
  129. package/dist/utils/magnitude.d.ts.map +0 -1
  130. package/dist/utils/magnitude.js.map +0 -1
package/README.md CHANGED
@@ -125,7 +125,7 @@ async function authExample() {
125
125
  console.log("Authenticated:", authState.user);
126
126
  console.log("Tokens:", {
127
127
  accessToken: authState.accessToken,
128
- refreshToken: authState.refreshToken, // Use this for revokeToken()
128
+ refreshToken: authState.refreshToken,
129
129
  });
130
130
 
131
131
  // Authenticated WebSocket channels are now connected - start receiving real-time updates
@@ -141,8 +141,7 @@ async function authExample() {
141
141
  await monaco.logout();
142
142
 
143
143
  // Or manually revoke the token
144
- // ✅ CORRECT: Use authState.refreshToken
145
- await monaco.auth.revokeToken(authState.refreshToken);
144
+ await monaco.auth.revokeToken();
146
145
  }
147
146
 
148
147
  // Market Data
@@ -277,11 +276,9 @@ interface AuthState {
277
276
  }
278
277
  ```
279
278
 
280
- **⚠️ Important:** The authentication response contains `refreshToken`, NOT `revokeToken`.
281
-
282
279
  ```typescript
283
- // CORRECT: Revoke using refreshToken
284
- await sdk.auth.revokeToken(authState.refreshToken);
280
+ // Revoke the current session's token
281
+ await sdk.auth.revokeToken();
285
282
 
286
283
  // 💡 TIP: Use the built-in logout method
287
284
  await sdk.logout(); // Automatically calls revokeToken internally
@@ -41,4 +41,3 @@ export declare class ApplicationsAPIImpl extends BaseAPI implements Applications
41
41
  */
42
42
  getApplicationConfig(): Promise<ApplicationConfigResponse>;
43
43
  }
44
- //# sourceMappingURL=api.d.ts.map
@@ -51,4 +51,3 @@ export class ApplicationsAPIImpl extends BaseAPI {
51
51
  };
52
52
  }
53
53
  }
54
- //# sourceMappingURL=api.js.map
@@ -2,4 +2,3 @@
2
2
  * Applications API Module
3
3
  */
4
4
  export { ApplicationsAPIImpl } from "./api";
5
- //# sourceMappingURL=index.d.ts.map
@@ -2,4 +2,3 @@
2
2
  * Applications API Module
3
3
  */
4
4
  export { ApplicationsAPIImpl } from "./api";
5
- //# sourceMappingURL=index.js.map
@@ -182,14 +182,15 @@ export declare class AuthAPIImpl extends BaseAPI implements AuthAPI {
182
182
  */
183
183
  refreshToken(refreshToken: string): Promise<TokenRefreshResponse>;
184
184
  /**
185
- * Revokes a refresh token.
185
+ * Revokes the current session's refresh token.
186
186
  *
187
- * Invalidates a refresh token, preventing it from being used to obtain
188
- * new access tokens. This is useful for logout functionality or when
189
- * a token has been compromised.
187
+ * Invalidates the refresh token associated with the current access token,
188
+ * preventing it from being used to obtain new access tokens. This is useful
189
+ * for logout functionality or when a token has been compromised.
190
+ *
191
+ * The server identifies the token to revoke from the access token in the
192
+ * Authorization header — no request body is needed.
190
193
  *
191
- * **Important:** Pass the `refreshToken` from the authentication response.
192
- * @param refreshToken - The refresh token to revoke (from authResult.refreshToken)
193
194
  * @returns Promise resolving when the token is revoked
194
195
  * @throws {APIError} When token revocation fails
195
196
  *
@@ -197,10 +198,9 @@ export declare class AuthAPIImpl extends BaseAPI implements AuthAPI {
197
198
  * ```typescript
198
199
  * // After authentication
199
200
  * const authResult = await authAPI.authenticate(clientId);
200
- * await authAPI.revokeToken(authResult.refreshToken);
201
+ * await authAPI.revokeToken();
201
202
  * console.log("Token revoked successfully");
202
203
  * ```
203
204
  */
204
- revokeToken(refreshToken: string): Promise<void>;
205
+ revokeToken(): Promise<void>;
205
206
  }
206
- //# sourceMappingURL=api.d.ts.map
@@ -277,14 +277,15 @@ export class AuthAPIImpl extends BaseAPI {
277
277
  };
278
278
  }
279
279
  /**
280
- * Revokes a refresh token.
280
+ * Revokes the current session's refresh token.
281
281
  *
282
- * Invalidates a refresh token, preventing it from being used to obtain
283
- * new access tokens. This is useful for logout functionality or when
284
- * a token has been compromised.
282
+ * Invalidates the refresh token associated with the current access token,
283
+ * preventing it from being used to obtain new access tokens. This is useful
284
+ * for logout functionality or when a token has been compromised.
285
+ *
286
+ * The server identifies the token to revoke from the access token in the
287
+ * Authorization header — no request body is needed.
285
288
  *
286
- * **Important:** Pass the `refreshToken` from the authentication response.
287
- * @param refreshToken - The refresh token to revoke (from authResult.refreshToken)
288
289
  * @returns Promise resolving when the token is revoked
289
290
  * @throws {APIError} When token revocation fails
290
291
  *
@@ -292,17 +293,13 @@ export class AuthAPIImpl extends BaseAPI {
292
293
  * ```typescript
293
294
  * // After authentication
294
295
  * const authResult = await authAPI.authenticate(clientId);
295
- * await authAPI.revokeToken(authResult.refreshToken);
296
+ * await authAPI.revokeToken();
296
297
  * console.log("Token revoked successfully");
297
298
  * ```
298
299
  */
299
- async revokeToken(refreshToken) {
300
+ async revokeToken() {
300
301
  await this.makeAuthenticatedRequest("/api/v1/auth/revoke", {
301
302
  method: "POST",
302
- body: JSON.stringify({
303
- refresh_token: refreshToken,
304
- }),
305
303
  });
306
304
  }
307
305
  }
308
- //# sourceMappingURL=api.js.map
@@ -2,4 +2,3 @@
2
2
  * Auth API Module
3
3
  */
4
4
  export { AuthAPIImpl } from "./api";
5
- //# sourceMappingURL=index.d.ts.map
@@ -2,4 +2,3 @@
2
2
  * Auth API Module
3
3
  */
4
4
  export { AuthAPIImpl } from "./api";
5
- //# sourceMappingURL=index.js.map
@@ -121,4 +121,3 @@ export declare abstract class BaseAPI {
121
121
  */
122
122
  protected makePublicRequest<T>(endpoint: string, options?: RequestInit): Promise<T>;
123
123
  }
124
- //# sourceMappingURL=base.d.ts.map
package/dist/api/base.js CHANGED
@@ -284,4 +284,3 @@ export class BaseAPI {
284
284
  }, requestBody);
285
285
  }
286
286
  }
287
- //# sourceMappingURL=base.js.map
@@ -35,6 +35,8 @@ export declare class FeesAPIImpl extends BaseAPI implements FeesAPI {
35
35
  * @param params.side - The order side ("BUY" or "SELL")
36
36
  * @param params.price - The price per unit as string
37
37
  * @param params.quantity - The quantity to trade as string
38
+ * @param params.order_type - Order type: "LIMIT" (default) or "MARKET"
39
+ * @param params.slippage_tolerance_bps - Slippage tolerance in bps (0–1000, MARKET only, default 500)
38
40
  * @returns Promise resolving to SimulateFeeResponse with fee breakdown
39
41
  *
40
42
  * @example
@@ -68,4 +70,3 @@ export declare class FeesAPIImpl extends BaseAPI implements FeesAPI {
68
70
  */
69
71
  simulateFees(params: SimulateFeeParams): Promise<SimulateFeeResponse>;
70
72
  }
71
- //# sourceMappingURL=api.d.ts.map
@@ -35,6 +35,8 @@ export class FeesAPIImpl extends BaseAPI {
35
35
  * @param params.side - The order side ("BUY" or "SELL")
36
36
  * @param params.price - The price per unit as string
37
37
  * @param params.quantity - The quantity to trade as string
38
+ * @param params.order_type - Order type: "LIMIT" (default) or "MARKET"
39
+ * @param params.slippage_tolerance_bps - Slippage tolerance in bps (0–1000, MARKET only, default 500)
38
40
  * @returns Promise resolving to SimulateFeeResponse with fee breakdown
39
41
  *
40
42
  * @example
@@ -74,10 +76,15 @@ export class FeesAPIImpl extends BaseAPI {
74
76
  searchParams.append("side", validatedParams.side);
75
77
  searchParams.append("price", validatedParams.price);
76
78
  searchParams.append("quantity", validatedParams.quantity);
79
+ if (validatedParams.order_type !== undefined) {
80
+ searchParams.append("order_type", validatedParams.order_type);
81
+ }
82
+ if (validatedParams.slippage_tolerance_bps !== undefined) {
83
+ searchParams.append("slippage_tolerance_bps", String(validatedParams.slippage_tolerance_bps));
84
+ }
77
85
  const endpoint = `/api/v1/fees/simulate?${searchParams.toString()}`;
78
86
  return await this.makeAuthenticatedRequest(endpoint, {
79
87
  method: "GET",
80
88
  });
81
89
  }
82
90
  }
83
- //# sourceMappingURL=api.js.map
@@ -4,4 +4,3 @@
4
4
  * Exports fees API implementation.
5
5
  */
6
6
  export { FeesAPIImpl } from "./api";
7
- //# sourceMappingURL=index.d.ts.map
@@ -4,4 +4,3 @@
4
4
  * Exports fees API implementation.
5
5
  */
6
6
  export { FeesAPIImpl } from "./api";
7
- //# sourceMappingURL=index.js.map
@@ -13,4 +13,3 @@ export * from "./trades";
13
13
  export * from "./trading";
14
14
  export * from "./vault";
15
15
  export * from "./websocket";
16
- //# sourceMappingURL=index.d.ts.map
package/dist/api/index.js CHANGED
@@ -13,4 +13,3 @@ export * from "./trades";
13
13
  export * from "./trading";
14
14
  export * from "./vault";
15
15
  export * from "./websocket";
16
- //# sourceMappingURL=index.js.map
@@ -11,4 +11,3 @@ export declare class MarketAPIImpl extends BaseAPI implements MarketAPI {
11
11
  getCandlesticks(tradingPairId: string, interval: Interval, params?: GetCandlesticksParams): Promise<Candlestick[]>;
12
12
  getMarketMetadata(tradingPairId: string): Promise<MarketMetadata>;
13
13
  }
14
- //# sourceMappingURL=api.d.ts.map
@@ -67,4 +67,3 @@ export class MarketAPIImpl extends BaseAPI {
67
67
  return await this.makePublicRequest(url);
68
68
  }
69
69
  }
70
- //# sourceMappingURL=api.js.map
@@ -1,2 +1 @@
1
1
  export { MarketAPIImpl } from "./api";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { MarketAPIImpl } from "./api";
2
- //# sourceMappingURL=index.js.map
@@ -13,4 +13,3 @@ export interface GetOrderbookOptions {
13
13
  export declare class OrderbookAPIImpl extends BaseAPI {
14
14
  getOrderbook(tradingPairId: string, options?: GetOrderbookOptions): Promise<OrderbookEvent>;
15
15
  }
16
- //# sourceMappingURL=api.d.ts.map
@@ -35,4 +35,3 @@ export class OrderbookAPIImpl extends BaseAPI {
35
35
  };
36
36
  }
37
37
  }
38
- //# sourceMappingURL=api.js.map
@@ -1,2 +1 @@
1
1
  export { type GetOrderbookOptions, OrderbookAPIImpl } from "./api";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { OrderbookAPIImpl } from "./api";
2
- //# sourceMappingURL=index.js.map
@@ -17,7 +17,7 @@
17
17
  * console.log(`User: ${profile.username} (${profile.address})`);
18
18
  * ```
19
19
  */
20
- import type { AccountBalance, GetPaginatedUserMovementsResponse, GetUserBalancesParams, GetUserBalancesResponse, GetUserMovementsParams, PortfolioChartResponse, PortfolioMetric, PortfolioPeriod, PortfolioStats, ProfileAPI, UserProfile } from "@0xmonaco/types";
20
+ import type { AccountBalance, GetPaginatedUserMovementsResponse, GetUserBalancesParams, GetUserBalancesResponse, GetUserMovementsParams, GetUserTradesParams, GetUserTradesResponse, PortfolioChartResponse, PortfolioMetric, PortfolioPeriod, PortfolioStats, ProfileAPI, UserProfile } from "@0xmonaco/types";
21
21
  import { BaseAPI } from "../base";
22
22
  export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
23
23
  /**
@@ -163,5 +163,29 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
163
163
  * ```
164
164
  */
165
165
  getPortfolioChart(period: PortfolioPeriod, metric: PortfolioMetric): Promise<PortfolioChartResponse>;
166
+ /**
167
+ * Get the current user's trade history with pagination.
168
+ *
169
+ * Fetches the user's executed trades from the /api/v1/accounts/trades endpoint.
170
+ * Requires a valid access token to be set.
171
+ *
172
+ * @param params - Optional query parameters for pagination and filtering
173
+ * @param params.page - Page number (starts from 1, default: 1)
174
+ * @param params.limit - Number of items per page (default: 20, max: 100)
175
+ * @param params.trading_pair_id - Filter by trading pair ID (UUID)
176
+ * @returns Promise resolving to paginated trades response
177
+ * @throws {ValidationError} When the provided params fail client-side validation
178
+ * @throws {APIError} When the request fails or user is not authenticated
179
+ *
180
+ * @example
181
+ * ```typescript
182
+ * // Get first page of trades
183
+ * const trades = await profileAPI.getUserTrades();
184
+ * console.log(`Total trades: ${trades.total_count}`);
185
+ *
186
+ * // Filter by trading pair
187
+ * const pairTrades = await profileAPI.getUserTrades({ trading_pair_id: "550e8400-e29b-41d4-a716-446655440000" });
188
+ * ```
189
+ */
190
+ getUserTrades(params?: GetUserTradesParams): Promise<GetUserTradesResponse>;
166
191
  }
167
- //# sourceMappingURL=api.d.ts.map
@@ -17,7 +17,7 @@
17
17
  * console.log(`User: ${profile.username} (${profile.address})`);
18
18
  * ```
19
19
  */
20
- import { GetUserMovementsSchema, validate } from "@0xmonaco/types";
20
+ import { GetUserMovementsSchema, GetUserTradesSchema, validate } from "@0xmonaco/types";
21
21
  import { APIError } from "../../errors";
22
22
  import { BaseAPI } from "../base";
23
23
  export class ProfileAPIImpl extends BaseAPI {
@@ -188,7 +188,8 @@ export class ProfileAPIImpl extends BaseAPI {
188
188
  * ```
189
189
  */
190
190
  async getPortfolioStats(period) {
191
- return await this.makeAuthenticatedRequest(`/api/v1/accounts/me/portfolio?period=${period}`);
191
+ const searchParams = new URLSearchParams({ period });
192
+ return await this.makeAuthenticatedRequest(`/api/v1/accounts/me/portfolio?${searchParams}`);
192
193
  }
193
194
  /**
194
195
  * Get the current user's portfolio chart time series for a given period and metric.
@@ -210,7 +211,49 @@ export class ProfileAPIImpl extends BaseAPI {
210
211
  * ```
211
212
  */
212
213
  async getPortfolioChart(period, metric) {
213
- return await this.makeAuthenticatedRequest(`/api/v1/accounts/me/portfolio/chart?period=${period}&metric=${metric}`);
214
+ const searchParams = new URLSearchParams({ period, metric });
215
+ return await this.makeAuthenticatedRequest(`/api/v1/accounts/me/portfolio/chart?${searchParams}`);
216
+ }
217
+ /**
218
+ * Get the current user's trade history with pagination.
219
+ *
220
+ * Fetches the user's executed trades from the /api/v1/accounts/trades endpoint.
221
+ * Requires a valid access token to be set.
222
+ *
223
+ * @param params - Optional query parameters for pagination and filtering
224
+ * @param params.page - Page number (starts from 1, default: 1)
225
+ * @param params.limit - Number of items per page (default: 20, max: 100)
226
+ * @param params.trading_pair_id - Filter by trading pair ID (UUID)
227
+ * @returns Promise resolving to paginated trades response
228
+ * @throws {ValidationError} When the provided params fail client-side validation
229
+ * @throws {APIError} When the request fails or user is not authenticated
230
+ *
231
+ * @example
232
+ * ```typescript
233
+ * // Get first page of trades
234
+ * const trades = await profileAPI.getUserTrades();
235
+ * console.log(`Total trades: ${trades.total_count}`);
236
+ *
237
+ * // Filter by trading pair
238
+ * const pairTrades = await profileAPI.getUserTrades({ trading_pair_id: "550e8400-e29b-41d4-a716-446655440000" });
239
+ * ```
240
+ */
241
+ async getUserTrades(params) {
242
+ if (params) {
243
+ validate(GetUserTradesSchema, params);
244
+ }
245
+ const searchParams = new URLSearchParams();
246
+ if (params?.page !== undefined) {
247
+ searchParams.append("page", params.page.toString());
248
+ }
249
+ if (params?.limit !== undefined) {
250
+ searchParams.append("limit", params.limit.toString());
251
+ }
252
+ if (params?.trading_pair_id !== undefined) {
253
+ searchParams.append("trading_pair_id", params.trading_pair_id);
254
+ }
255
+ const queryString = searchParams.toString();
256
+ const url = queryString ? `/api/v1/accounts/trades?${queryString}` : "/api/v1/accounts/trades";
257
+ return await this.makeAuthenticatedRequest(url);
214
258
  }
215
259
  }
216
- //# sourceMappingURL=api.js.map
@@ -4,4 +4,3 @@
4
4
  * Exports the ProfileAPI implementation for user profile operations.
5
5
  */
6
6
  export * from "./api";
7
- //# sourceMappingURL=index.d.ts.map
@@ -4,4 +4,3 @@
4
4
  * Exports the ProfileAPI implementation for user profile operations.
5
5
  */
6
6
  export * from "./api";
7
- //# sourceMappingURL=index.js.map
@@ -42,4 +42,3 @@ export declare class TradesAPIImpl extends BaseAPI {
42
42
  getTrades(tradingPairId: string, options?: GetTradesOptions): Promise<TradeEvent[]>;
43
43
  }
44
44
  export {};
45
- //# sourceMappingURL=api.d.ts.map
@@ -40,4 +40,3 @@ export class TradesAPIImpl extends BaseAPI {
40
40
  return response.data.trades.map(parseRawTradeEvent);
41
41
  }
42
42
  }
43
- //# sourceMappingURL=api.js.map
@@ -1,2 +1 @@
1
1
  export * from "./api";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export * from "./api";
2
- //# sourceMappingURL=index.js.map
@@ -284,4 +284,3 @@ export declare class TradingAPIImpl extends BaseAPI implements TradingAPI {
284
284
  */
285
285
  getOrder(orderId: string): Promise<GetOrderResponse>;
286
286
  }
287
- //# sourceMappingURL=api.d.ts.map
@@ -418,4 +418,3 @@ export class TradingAPIImpl extends BaseAPI {
418
418
  });
419
419
  }
420
420
  }
421
- //# sourceMappingURL=api.js.map
@@ -2,4 +2,3 @@
2
2
  * Trading API Module
3
3
  */
4
4
  export { TradingAPIImpl } from "./api";
5
- //# sourceMappingURL=index.d.ts.map
@@ -2,4 +2,3 @@
2
2
  * Trading API Module
3
3
  */
4
4
  export { TradingAPIImpl } from "./api";
5
- //# sourceMappingURL=index.js.map
@@ -255,4 +255,3 @@ export declare class VaultAPIImpl extends BaseAPI implements VaultAPI {
255
255
  private getWithdrawSignature;
256
256
  private waitForTransaction;
257
257
  }
258
- //# sourceMappingURL=api.d.ts.map
@@ -492,4 +492,3 @@ export class VaultAPIImpl extends BaseAPI {
492
492
  }
493
493
  }
494
494
  }
495
- //# sourceMappingURL=api.js.map
@@ -2,4 +2,3 @@
2
2
  * Vault API Module
3
3
  */
4
4
  export { VaultAPIImpl } from "./api";
5
- //# sourceMappingURL=index.d.ts.map
@@ -2,4 +2,3 @@
2
2
  * Vault API Module
3
3
  */
4
4
  export { VaultAPIImpl } from "./api";
5
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,3 @@
1
1
  export * from "./types";
2
2
  export * from "./utils";
3
3
  export * from "./websocket";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export * from "./types";
2
2
  export * from "./utils";
3
3
  export * from "./websocket";
4
- //# sourceMappingURL=index.js.map
@@ -37,4 +37,3 @@ export interface MonacoWebSocket {
37
37
  /** Subscribe to user balance events (requires authentication) */
38
38
  balances: (handler: MessageHandler<UserBalanceEvent>) => () => void;
39
39
  }
40
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.js.map
@@ -6,4 +6,3 @@ export declare function toCamelCase(str: string): string;
6
6
  * Recursively convert object keys from snake_case to camelCase
7
7
  */
8
8
  export declare function keysToCamelCase<T>(obj: unknown): T;
9
- //# sourceMappingURL=utils.d.ts.map
@@ -20,4 +20,3 @@ export function keysToCamelCase(obj) {
20
20
  }
21
21
  return result;
22
22
  }
23
- //# sourceMappingURL=utils.js.map
@@ -3,4 +3,3 @@ import type { MonacoWebSocket, MonacoWebSocketOptions } from "./types";
3
3
  * Create a Monaco WebSocket client
4
4
  */
5
5
  export declare function createMonacoWebSocket(baseUrl: string, options?: MonacoWebSocketOptions): MonacoWebSocket;
6
- //# sourceMappingURL=websocket.d.ts.map
@@ -418,4 +418,3 @@ export function createMonacoWebSocket(baseUrl, options = {}) {
418
418
  balances: subscribeBalances,
419
419
  };
420
420
  }
421
- //# sourceMappingURL=websocket.js.map
@@ -379,4 +379,3 @@ export declare class ContractError extends MonacoCoreError {
379
379
  });
380
380
  toJSON(): Record<string, unknown>;
381
381
  }
382
- //# sourceMappingURL=errors.d.ts.map
@@ -813,4 +813,3 @@ function getContractErrorSuggestion(revertReason) {
813
813
  }
814
814
  return undefined;
815
815
  }
816
- //# sourceMappingURL=errors.js.map
@@ -1,2 +1 @@
1
1
  export * from "./errors";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export * from "./errors";
2
- //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -3,4 +3,3 @@ export { APIError, ContractError, InvalidConfigError, InvalidStateError, MonacoC
3
3
  export { resolveApiUrl, resolveWsUrl } from "./networks";
4
4
  export { createMonacoSDK, MonacoSDKImpl as MonacoSDK } from "./sdk";
5
5
  export { ALL_MAGNITUDES, calculateValidMagnitudes, MAX_BUCKETS_ALLOWED, MIN_BUCKETS_ALLOWED, } from "./utils";
6
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -3,4 +3,3 @@ export { APIError, ContractError, InvalidConfigError, InvalidStateError, MonacoC
3
3
  export { resolveApiUrl, resolveWsUrl } from "./networks";
4
4
  export { createMonacoSDK, MonacoSDKImpl as MonacoSDK } from "./sdk";
5
5
  export { ALL_MAGNITUDES, calculateValidMagnitudes, MAX_BUCKETS_ALLOWED, MIN_BUCKETS_ALLOWED, } from "./utils";
6
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  export * from "./networks";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export * from "./networks";
2
- //# sourceMappingURL=index.js.map
@@ -19,4 +19,3 @@ export declare function resolveApiUrl(network: Network): string;
19
19
  * @returns The resolved WebSocket URL
20
20
  */
21
21
  export declare function resolveWsUrl(network: Network): string;
22
- //# sourceMappingURL=networks.d.ts.map
@@ -44,4 +44,3 @@ export function resolveApiUrl(network) {
44
44
  export function resolveWsUrl(network) {
45
45
  return DEFAULT_WS_URLS[network];
46
46
  }
47
- //# sourceMappingURL=networks.js.map
package/dist/sdk.d.ts CHANGED
@@ -31,8 +31,8 @@ export declare class MonacoSDKImpl implements MonacoSDK {
31
31
  * - `expiresAt`: When the access token expires
32
32
  * - `user`: User information
33
33
  *
34
- * Note: There is NO separate `revokeToken` property. Use `authState.refreshToken`
35
- * when calling `auth.revokeToken()` or just call `sdk.logout()`.
34
+ * Note: Use `sdk.logout()` to revoke the token and clean up, or call
35
+ * `sdk.auth.revokeToken()` directly to just revoke.
36
36
  *
37
37
  * @param clientId - The client ID for authentication
38
38
  * @param options - Optional configuration
@@ -50,7 +50,7 @@ export declare class MonacoSDKImpl implements MonacoSDK {
50
50
  * await sdk.ws.connect();
51
51
  *
52
52
  * // Later, to revoke:
53
- * await sdk.auth.revokeToken(authState.refreshToken); // ✅
53
+ * await sdk.auth.revokeToken(); // ✅
54
54
  * // Or revoke and disconnect WebSocket:
55
55
  * await sdk.logout(); // ✅ Calls revokeToken internally and disconnects WebSocket
56
56
  * ```
@@ -76,7 +76,7 @@ export declare class MonacoSDKImpl implements MonacoSDK {
76
76
  *
77
77
  * This method revokes the refresh token (if available), disconnects all authenticated
78
78
  * WebSocket channels, and clears the local auth state.
79
- * It internally calls `auth.revokeToken(refreshToken)` to invalidate the token on the server.
79
+ * It internally calls `auth.revokeToken()` to invalidate the token on the server.
80
80
  *
81
81
  * @example
82
82
  * ```typescript
@@ -130,4 +130,3 @@ export declare class MonacoSDKImpl implements MonacoSDK {
130
130
  * @returns Monaco SDK instance
131
131
  */
132
132
  export declare function createMonacoSDK(config: SDKConfig): MonacoSDK;
133
- //# sourceMappingURL=sdk.d.ts.map