@0xmonaco/types 0.5.8 → 0.6.0

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 (142) hide show
  1. package/README.md +1 -1
  2. package/dist/api/index.d.ts +0 -1
  3. package/dist/api/index.js +0 -1
  4. package/dist/applications/index.d.ts +0 -1
  5. package/dist/applications/index.js +0 -1
  6. package/dist/applications/responses.d.ts +0 -1
  7. package/dist/applications/responses.js +0 -1
  8. package/dist/auth/index.d.ts +0 -1
  9. package/dist/auth/index.js +0 -1
  10. package/dist/auth/responses.d.ts +0 -1
  11. package/dist/auth/responses.js +0 -1
  12. package/dist/contracts/balances.d.ts +0 -1
  13. package/dist/contracts/balances.js +0 -1
  14. package/dist/contracts/index.d.ts +0 -1
  15. package/dist/contracts/index.js +0 -1
  16. package/dist/fees/index.d.ts +0 -1
  17. package/dist/fees/index.js +0 -1
  18. package/dist/fees/responses.d.ts +0 -1
  19. package/dist/fees/responses.js +0 -1
  20. package/dist/index.d.ts +0 -1
  21. package/dist/index.js +0 -1
  22. package/dist/market/index.d.ts +0 -1
  23. package/dist/market/index.js +0 -1
  24. package/dist/profile/index.d.ts +137 -13
  25. package/dist/profile/index.js +0 -1
  26. package/dist/sdk/index.d.ts +0 -1
  27. package/dist/sdk/index.js +0 -1
  28. package/dist/sdk/network.d.ts +0 -1
  29. package/dist/sdk/network.js +0 -1
  30. package/dist/trading/index.d.ts +1 -1
  31. package/dist/trading/index.js +1 -1
  32. package/dist/trading/orders.d.ts +10 -5
  33. package/dist/trading/orders.js +4 -1
  34. package/dist/trading/responses.d.ts +0 -1
  35. package/dist/trading/responses.js +0 -1
  36. package/dist/validation/common.d.ts +0 -1
  37. package/dist/validation/common.js +0 -1
  38. package/dist/validation/index.d.ts +0 -1
  39. package/dist/validation/index.js +0 -1
  40. package/dist/validation/market.d.ts +0 -1
  41. package/dist/validation/market.js +0 -1
  42. package/dist/validation/profile.d.ts +11 -14
  43. package/dist/validation/profile.js +11 -8
  44. package/dist/validation/trading.d.ts +1 -1
  45. package/dist/validation/trading.js +2 -2
  46. package/dist/validation/vault.d.ts +0 -1
  47. package/dist/validation/vault.js +0 -1
  48. package/dist/vault/index.d.ts +0 -1
  49. package/dist/vault/index.js +0 -1
  50. package/dist/vault/responses.d.ts +0 -1
  51. package/dist/vault/responses.js +0 -1
  52. package/dist/websocket/base.d.ts +0 -1
  53. package/dist/websocket/base.js +0 -1
  54. package/dist/websocket/clients/orderbook-client.d.ts +0 -1
  55. package/dist/websocket/clients/orderbook-client.js +0 -1
  56. package/dist/websocket/events/balance-events.d.ts +0 -1
  57. package/dist/websocket/events/balance-events.js +0 -1
  58. package/dist/websocket/events/index.d.ts +0 -1
  59. package/dist/websocket/events/index.js +0 -1
  60. package/dist/websocket/events/movement-events.d.ts +0 -1
  61. package/dist/websocket/events/movement-events.js +0 -1
  62. package/dist/websocket/events/ohlcv-events.d.ts +0 -1
  63. package/dist/websocket/events/ohlcv-events.js +0 -1
  64. package/dist/websocket/events/orderbook-events.d.ts +0 -1
  65. package/dist/websocket/events/orderbook-events.js +0 -1
  66. package/dist/websocket/events/orders-events.d.ts +0 -1
  67. package/dist/websocket/events/orders-events.js +0 -1
  68. package/dist/websocket/events/trade-events.d.ts +0 -1
  69. package/dist/websocket/events/trade-events.js +0 -1
  70. package/dist/websocket/index.d.ts +0 -1
  71. package/dist/websocket/index.js +0 -1
  72. package/package.json +1 -1
  73. package/dist/api/index.d.ts.map +0 -1
  74. package/dist/api/index.js.map +0 -1
  75. package/dist/applications/index.d.ts.map +0 -1
  76. package/dist/applications/index.js.map +0 -1
  77. package/dist/applications/responses.d.ts.map +0 -1
  78. package/dist/applications/responses.js.map +0 -1
  79. package/dist/auth/index.d.ts.map +0 -1
  80. package/dist/auth/index.js.map +0 -1
  81. package/dist/auth/responses.d.ts.map +0 -1
  82. package/dist/auth/responses.js.map +0 -1
  83. package/dist/contracts/balances.d.ts.map +0 -1
  84. package/dist/contracts/balances.js.map +0 -1
  85. package/dist/contracts/index.d.ts.map +0 -1
  86. package/dist/contracts/index.js.map +0 -1
  87. package/dist/fees/index.d.ts.map +0 -1
  88. package/dist/fees/index.js.map +0 -1
  89. package/dist/fees/responses.d.ts.map +0 -1
  90. package/dist/fees/responses.js.map +0 -1
  91. package/dist/index.d.ts.map +0 -1
  92. package/dist/index.js.map +0 -1
  93. package/dist/market/index.d.ts.map +0 -1
  94. package/dist/market/index.js.map +0 -1
  95. package/dist/profile/index.d.ts.map +0 -1
  96. package/dist/profile/index.js.map +0 -1
  97. package/dist/sdk/index.d.ts.map +0 -1
  98. package/dist/sdk/index.js.map +0 -1
  99. package/dist/sdk/network.d.ts.map +0 -1
  100. package/dist/sdk/network.js.map +0 -1
  101. package/dist/trading/index.d.ts.map +0 -1
  102. package/dist/trading/index.js.map +0 -1
  103. package/dist/trading/orders.d.ts.map +0 -1
  104. package/dist/trading/orders.js.map +0 -1
  105. package/dist/trading/responses.d.ts.map +0 -1
  106. package/dist/trading/responses.js.map +0 -1
  107. package/dist/validation/common.d.ts.map +0 -1
  108. package/dist/validation/common.js.map +0 -1
  109. package/dist/validation/index.d.ts.map +0 -1
  110. package/dist/validation/index.js.map +0 -1
  111. package/dist/validation/market.d.ts.map +0 -1
  112. package/dist/validation/market.js.map +0 -1
  113. package/dist/validation/profile.d.ts.map +0 -1
  114. package/dist/validation/profile.js.map +0 -1
  115. package/dist/validation/trading.d.ts.map +0 -1
  116. package/dist/validation/trading.js.map +0 -1
  117. package/dist/validation/vault.d.ts.map +0 -1
  118. package/dist/validation/vault.js.map +0 -1
  119. package/dist/vault/index.d.ts.map +0 -1
  120. package/dist/vault/index.js.map +0 -1
  121. package/dist/vault/responses.d.ts.map +0 -1
  122. package/dist/vault/responses.js.map +0 -1
  123. package/dist/websocket/base.d.ts.map +0 -1
  124. package/dist/websocket/base.js.map +0 -1
  125. package/dist/websocket/clients/orderbook-client.d.ts.map +0 -1
  126. package/dist/websocket/clients/orderbook-client.js.map +0 -1
  127. package/dist/websocket/events/balance-events.d.ts.map +0 -1
  128. package/dist/websocket/events/balance-events.js.map +0 -1
  129. package/dist/websocket/events/index.d.ts.map +0 -1
  130. package/dist/websocket/events/index.js.map +0 -1
  131. package/dist/websocket/events/movement-events.d.ts.map +0 -1
  132. package/dist/websocket/events/movement-events.js.map +0 -1
  133. package/dist/websocket/events/ohlcv-events.d.ts.map +0 -1
  134. package/dist/websocket/events/ohlcv-events.js.map +0 -1
  135. package/dist/websocket/events/orderbook-events.d.ts.map +0 -1
  136. package/dist/websocket/events/orderbook-events.js.map +0 -1
  137. package/dist/websocket/events/orders-events.d.ts.map +0 -1
  138. package/dist/websocket/events/orders-events.js.map +0 -1
  139. package/dist/websocket/events/trade-events.d.ts.map +0 -1
  140. package/dist/websocket/events/trade-events.js.map +0 -1
  141. package/dist/websocket/index.d.ts.map +0 -1
  142. package/dist/websocket/index.js.map +0 -1
package/README.md CHANGED
@@ -169,7 +169,7 @@ interface TradingAPI extends BaseAPI {
169
169
  // Trading types
170
170
  type OrderSide = "BUY" | "SELL";
171
171
  type OrderType = "LIMIT" | "MARKET";
172
- type OrderStatus = "SUBMITTED" | "PARTIALLY_FILLED" | "FILLED" | "SETTLED" | "CANCELLED" | "REJECTED" | "EXPIRED";
172
+ type OrderStatus = "SUBMITTED" | "PARTIALLY_FILLED" | "FILLED" | "SETTLED_ON_CHAIN" | "SETTLED" | "CANCELLED" | "REJECTED" | "EXPIRED";
173
173
  type TradingMode = "SPOT";
174
174
  type TimeInForce = "GTC" | "IOC" | "FOK"; // GTC: Good Till Cancel, IOC: Immediate or Cancel, FOK: Fill or Kill
175
175
 
@@ -16,4 +16,3 @@ export interface BaseAPI {
16
16
  */
17
17
  setAccessToken(token: string): void;
18
18
  }
19
- //# sourceMappingURL=index.d.ts.map
package/dist/api/index.js CHANGED
@@ -4,4 +4,3 @@
4
4
  * Common interface that all API implementations should inherit from.
5
5
  * Provides standardized methods for token management and common functionality.
6
6
  */
7
- //# sourceMappingURL=index.js.map
@@ -21,4 +21,3 @@ export interface ApplicationsAPI extends BaseAPI {
21
21
  getApplicationConfig(): Promise<ApplicationConfigResponse>;
22
22
  }
23
23
  export type { ApplicationConfigResponse } from "./responses";
24
- //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,3 @@
3
3
  *
4
4
  * Types for application configuration operations.
5
5
  */
6
- //# sourceMappingURL=index.js.map
@@ -18,4 +18,3 @@ export interface ApplicationConfigResponse {
18
18
  /** Vault contract address */
19
19
  vaultContractAddress: string;
20
20
  }
21
- //# sourceMappingURL=responses.d.ts.map
@@ -3,4 +3,3 @@
3
3
  *
4
4
  * Response types for application configuration operations.
5
5
  */
6
- //# sourceMappingURL=responses.js.map
@@ -79,4 +79,3 @@ export interface AuthAPI extends BaseAPI {
79
79
  setWalletClient(walletClient: unknown): void;
80
80
  }
81
81
  export type { ApplicationInfo, AuthState, BackendAuthResponse, ChallengeResponse, TokenRefreshResponse, User, } from "./responses";
82
- //# sourceMappingURL=index.d.ts.map
@@ -4,4 +4,3 @@
4
4
  * Types for authentication operations including challenge creation,
5
5
  * signature verification, and backend authentication.
6
6
  */
7
- //# sourceMappingURL=index.js.map
@@ -65,4 +65,3 @@ export interface TokenRefreshResponse {
65
65
  /** Unix timestamp when the access token expires */
66
66
  expiresAt: number;
67
67
  }
68
- //# sourceMappingURL=responses.d.ts.map
@@ -3,4 +3,3 @@
3
3
  *
4
4
  * Response types for authentication operations.
5
5
  */
6
- //# sourceMappingURL=responses.js.map
@@ -41,4 +41,3 @@ export interface UserBalance {
41
41
  /** Total balance (available + locked) */
42
42
  total: bigint;
43
43
  }
44
- //# sourceMappingURL=balances.d.ts.map
@@ -3,4 +3,3 @@
3
3
  *
4
4
  * Types for contract balance management and token information.
5
5
  */
6
- //# sourceMappingURL=balances.js.map
@@ -25,4 +25,3 @@ export type ContractInstances = {
25
25
  vault: GetContractReturnType<typeof CONTRACT_ABIS.vault>;
26
26
  };
27
27
  export type { Token, UserBalance } from "./balances";
28
- //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,3 @@
3
3
  *
4
4
  * Types for contract addresses, instances, and contract-related operations.
5
5
  */
6
- //# sourceMappingURL=index.js.map
@@ -37,4 +37,3 @@ export interface FeesAPI extends BaseAPI {
37
37
  }
38
38
  export type { SimulateFeeParams, SimulateFeeResponse } from "./responses";
39
39
  export { SimulateFeeParamsSchema, SimulateFeeResponseSchema } from "./responses";
40
- //# sourceMappingURL=index.d.ts.map
@@ -4,4 +4,3 @@
4
4
  * Types for fees operations including fee simulation.
5
5
  */
6
6
  export { SimulateFeeParamsSchema, SimulateFeeResponseSchema } from "./responses";
7
- //# sourceMappingURL=index.js.map
@@ -44,4 +44,3 @@ export type SimulateFeeParams = z.infer<typeof SimulateFeeParamsSchema>;
44
44
  * @remarks Type is inferred from SimulateFeeResponseSchema
45
45
  */
46
46
  export type SimulateFeeResponse = z.infer<typeof SimulateFeeResponseSchema>;
47
- //# sourceMappingURL=responses.d.ts.map
@@ -59,4 +59,3 @@ export const SimulateFeeResponseSchema = z.object({
59
59
  /** Total taker fees (monaco + application) */
60
60
  total_taker_fees: z.string(),
61
61
  });
62
- //# sourceMappingURL=responses.js.map
package/dist/index.d.ts CHANGED
@@ -16,4 +16,3 @@ export * from "./trading";
16
16
  export * from "./validation";
17
17
  export * from "./vault";
18
18
  export * from "./websocket";
19
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -17,4 +17,3 @@ export * from "./trading";
17
17
  export * from "./validation";
18
18
  export * from "./vault";
19
19
  export * from "./websocket";
20
- //# sourceMappingURL=index.js.map
@@ -221,4 +221,3 @@ export interface MarketAPI extends BaseAPI {
221
221
  */
222
222
  getMarketMetadata(tradingPairId: string): Promise<MarketMetadata>;
223
223
  }
224
- //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,3 @@
3
3
  *
4
4
  * Types for market data operations including trading pair metadata and OHLCV data.
5
5
  */
6
- //# sourceMappingURL=index.js.map
@@ -87,13 +87,6 @@ export type LedgerEntryType = "CREDIT" | "DEBIT" | "LOCK" | "UNLOCK" | "FEE";
87
87
  * Describes the reason/source of the movement.
88
88
  */
89
89
  export type TransactionType = "DEPOSIT" | "WITHDRAWAL" | "TRADE" | "FEE" | "FUNDING" | "LIQUIDATION" | "INTEREST" | "REWARD";
90
- /**
91
- * Data source for movements queries.
92
- * - `hot_storage`: From Redis cache (real-time, fast) — default
93
- * - `cold_storage`: From PostgreSQL (historical, paginated)
94
- * - `both`: Combined from both sources
95
- */
96
- export type MovementsDataSource = "hot_storage" | "cold_storage" | "both";
97
90
  /**
98
91
  * Query parameters for getting user movements
99
92
  */
@@ -108,8 +101,6 @@ export interface GetUserMovementsParams {
108
101
  transaction_type?: TransactionType;
109
102
  /** Filter by asset ID (UUID) */
110
103
  asset_id?: string;
111
- /** Data source: "hot_storage" (fast, real-time), "cold_storage" (historical), or "both" (hybrid). Default: "hot_storage" */
112
- source?: MovementsDataSource;
113
104
  }
114
105
  /**
115
106
  * Query parameters for getting user balances
@@ -140,8 +131,6 @@ export interface GetPaginatedUserMovementsResponse {
140
131
  total_count: number;
141
132
  /** Total number of pages */
142
133
  total_pages: number;
143
- /** Data source used for this response */
144
- source?: MovementsDataSource;
145
134
  }
146
135
  /**
147
136
  * Response from getting user balances
@@ -206,6 +195,104 @@ export interface AccountBalance {
206
195
  /** Locked balance in raw format (wei) */
207
196
  locked_balance_raw: string;
208
197
  }
198
+ /**
199
+ * A single user trade execution.
200
+ */
201
+ export interface UserTrade {
202
+ /** Trade unique identifier */
203
+ trade_id: string;
204
+ /** Trading pair identifier (UUID) */
205
+ trading_pair_id: string;
206
+ /** Execution price (as string to preserve precision) */
207
+ price: string;
208
+ /** Executed quantity (as string to preserve precision) */
209
+ quantity: string;
210
+ /** Quote volume (price * quantity, as string to preserve precision) */
211
+ quote_volume: string;
212
+ /** Side of the trade */
213
+ side: OrderSide;
214
+ /** Fee paid for this trade (as string to preserve precision) */
215
+ fee: string;
216
+ /** Timestamp when the trade was executed (ISO string) */
217
+ executed_at: string;
218
+ }
219
+ /**
220
+ * Query parameters for getting user trades
221
+ */
222
+ export interface GetUserTradesParams {
223
+ /** Page number (starts from 1) */
224
+ page?: number;
225
+ /** Number of items per page (max 100) */
226
+ limit?: number;
227
+ /** Filter by trading pair ID (UUID) */
228
+ trading_pair_id?: string;
229
+ }
230
+ /**
231
+ * Response from getting user trades
232
+ */
233
+ export interface GetUserTradesResponse {
234
+ /** List of user trades */
235
+ trades: UserTrade[];
236
+ /** Current page number */
237
+ page: number;
238
+ /** Items per page */
239
+ limit: number;
240
+ /** Total number of trades */
241
+ total_count: number;
242
+ /** Total number of pages */
243
+ total_pages: number;
244
+ }
245
+ /**
246
+ * Time period for portfolio stats and chart queries.
247
+ */
248
+ export type PortfolioPeriod = "24h" | "7d" | "30d" | "all";
249
+ /**
250
+ * Metric for portfolio chart queries.
251
+ */
252
+ export type PortfolioMetric = "volume" | "pnl";
253
+ /**
254
+ * A single data point in a portfolio chart time series.
255
+ */
256
+ export interface PortfolioChartPoint {
257
+ /** ISO 8601 timestamp for the bucket */
258
+ timestamp: string;
259
+ /** Metric value for the bucket (as string to preserve precision) */
260
+ value: string;
261
+ }
262
+ /**
263
+ * Portfolio chart time series response.
264
+ * Returned by the /api/v1/accounts/me/portfolio/chart endpoint.
265
+ */
266
+ export interface PortfolioChartResponse {
267
+ /** The metric returned ("volume" | "pnl") */
268
+ metric: PortfolioMetric;
269
+ /** The period requested */
270
+ period: PortfolioPeriod;
271
+ /** Bucketed time series data points */
272
+ data: PortfolioChartPoint[];
273
+ }
274
+ /**
275
+ * Portfolio statistics for the authenticated user over a given period.
276
+ * Returned by the /api/v1/accounts/me/portfolio endpoint.
277
+ */
278
+ export interface PortfolioStats {
279
+ /** Realized profit and loss (sum of CREDIT minus DEBIT from TRADE ledger entries) */
280
+ pnl: string;
281
+ /** Total trading volume (sum of quote_volume from trades) */
282
+ volume: string;
283
+ /** Maximum peak-to-trough drawdown on running PnL */
284
+ max_drawdown: string;
285
+ /** Total number of orders placed */
286
+ total_orders: number;
287
+ /** Total number of trades executed */
288
+ total_trades: number;
289
+ /** Total fees paid */
290
+ fees_paid: string;
291
+ /** Ratio of profitable trades to total trades */
292
+ win_loss_ratio: string;
293
+ /** Total equity in USDC terms (sum of all spot balances) */
294
+ total_equity: string;
295
+ }
209
296
  /**
210
297
  * User profile information returned by the /api/v1/accounts/me endpoint.
211
298
  */
@@ -220,6 +307,10 @@ export interface UserProfile {
220
307
  account_type: string;
221
308
  /** Whether the user can withdraw funds */
222
309
  can_withdraw: boolean;
310
+ /** Taker fee rate in basis points */
311
+ taker_fee_bps: number;
312
+ /** Maker fee rate in basis points */
313
+ maker_fee_bps: number;
223
314
  /** Account creation timestamp (ISO string) */
224
315
  created_at: string;
225
316
  }
@@ -249,7 +340,6 @@ export interface ProfileAPI extends BaseAPI {
249
340
  * @param params.entry_type - Filter by entry type (CREDIT, DEBIT, LOCK, UNLOCK, FEE)
250
341
  * @param params.transaction_type - Filter by transaction type (DEPOSIT, WITHDRAWAL, TRADE, FEE, FUNDING, LIQUIDATION, INTEREST, REWARD)
251
342
  * @param params.asset_id - Filter by asset ID (UUID)
252
- * @param params.source - Data source: "hot_storage", "cold_storage", or "both" (default: "hot_storage")
253
343
  * @returns Promise resolving to paginated movements response
254
344
  */
255
345
  getPaginatedUserMovements(params?: GetUserMovementsParams): Promise<GetPaginatedUserMovementsResponse>;
@@ -275,5 +365,39 @@ export interface ProfileAPI extends BaseAPI {
275
365
  * @returns Promise resolving to the account balance for the asset
276
366
  */
277
367
  getUserBalanceByAssetId(assetId: string): Promise<AccountBalance>;
368
+ /**
369
+ * Get the current user's portfolio statistics for a given time period.
370
+ *
371
+ * Fetches aggregate stats from the /api/v1/accounts/me/portfolio endpoint.
372
+ * Requires a valid access token to be set.
373
+ *
374
+ * @param period - Time period to scope the stats ("24h" | "7d" | "30d" | "all")
375
+ * @returns Promise resolving to the user's portfolio statistics
376
+ */
377
+ getPortfolioStats(period: PortfolioPeriod): Promise<PortfolioStats>;
378
+ /**
379
+ * Get the current user's portfolio chart time series for a given period and metric.
380
+ *
381
+ * Fetches bucketed time series data from the /api/v1/accounts/me/portfolio/chart endpoint.
382
+ * Requires a valid access token to be set.
383
+ *
384
+ * @param period - Time period ("24h" | "7d" | "30d" | "all")
385
+ * @param metric - Metric to chart ("volume" | "pnl")
386
+ * @returns Promise resolving to the portfolio chart response
387
+ */
388
+ getPortfolioChart(period: PortfolioPeriod, metric: PortfolioMetric): Promise<PortfolioChartResponse>;
389
+ /**
390
+ * Get the current user's trade history with pagination.
391
+ *
392
+ * Fetches the user's executed trades from the /api/v1/accounts/trades endpoint.
393
+ * Requires a valid access token to be set.
394
+ *
395
+ * @param params - Optional query parameters for pagination and filtering
396
+ * @param params.page - Page number (starts from 1)
397
+ * @param params.limit - Number of items per page (max 100)
398
+ * @param params.trading_pair_id - Filter by trading pair ID (UUID)
399
+ * @returns Promise resolving to paginated trades response
400
+ * @throws ValidationError If pagination params (page/limit) are invalid or trading_pair_id is not a valid UUID; this may occur before any network request.
401
+ */
402
+ getUserTrades(params?: GetUserTradesParams): Promise<GetUserTradesResponse>;
278
403
  }
279
- //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,3 @@
3
3
  *
4
4
  * Types for user profile operations including fetching user profile data.
5
5
  */
6
- //# sourceMappingURL=index.js.map
@@ -122,4 +122,3 @@ export interface MonacoSDK {
122
122
  setAuthState(authState: AuthState): void;
123
123
  }
124
124
  export type { Network, NetworkEndpoints } from "./network";
125
- //# sourceMappingURL=index.d.ts.map
package/dist/sdk/index.js CHANGED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index.js.map
@@ -23,4 +23,3 @@ export interface NetworkEndpoints {
23
23
  rpcUrl: string;
24
24
  apiUrl: string;
25
25
  }
26
- //# sourceMappingURL=network.d.ts.map
@@ -3,4 +3,3 @@
3
3
  *
4
4
  * Network configuration and endpoint types for the Monaco SDK.
5
5
  */
6
- //# sourceMappingURL=network.js.map
@@ -108,5 +108,5 @@ export interface TradingAPI extends BaseAPI {
108
108
  getOrder(orderId: string): Promise<GetOrderResponse>;
109
109
  }
110
110
  export type { Order, OrderRole, OrderSide, OrderStatus, OrderType, TimeInForce, TradingMode, } from "./orders";
111
+ export { ORDER_STATUS_VALUES } from "./orders";
111
112
  export type { BatchCancelError, BatchCancelOrdersResponse, BatchCancelResult, BatchCreateOrderParams, BatchCreateOrdersResponse, BatchCreateResult, BatchError, BatchReplaceOrderParams, BatchReplaceOrdersResponse, BatchReplaceResult, CancelOrderResponse, CreateOrderResponse, GetOrderResponse, GetPaginatedOrdersParams, GetPaginatedOrdersResponse, MatchResult, ReplaceOrderResponse, UpdatedFields, } from "./responses";
112
- //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,4 @@
3
3
  *
4
4
  * Types for trading operations including order placement and management.
5
5
  */
6
- //# sourceMappingURL=index.js.map
6
+ export { ORDER_STATUS_VALUES } from "./orders";
@@ -8,7 +8,8 @@
8
8
  * This represents the complete order information as returned by the API.
9
9
  *
10
10
  * @remarks
11
- * Order lifecycle statuses: `SUBMITTED` → (`PARTIALLY_FILLED`) → `FILLED` → `SETTLED`
11
+ * Order lifecycle statuses: `SUBMITTED` → (`PARTIALLY_FILLED`) → `FILLED` → `SETTLED_ON_CHAIN`
12
+ * Legacy backends may still emit `SETTLED`.
12
13
  * Orders can transition to `CANCELLED`, `REJECTED`, or `EXPIRED` at various stages.
13
14
  * Fee fields are only populated after order fills occur.
14
15
  *
@@ -78,19 +79,24 @@ export type OrderSide = "BUY" | "SELL";
78
79
  * - TRAILING_STOP: Stop order that trails the market price
79
80
  */
80
81
  export type OrderType = "LIMIT" | "MARKET";
82
+ /**
83
+ * Source-of-truth order status values used by runtime validation schemas.
84
+ */
85
+ export declare const ORDER_STATUS_VALUES: readonly ["SUBMITTED", "PARTIALLY_FILLED", "FILLED", "SETTLED_ON_CHAIN", "SETTLED", "CANCELLED", "REJECTED", "EXPIRED"];
81
86
  /**
82
87
  * Order status for different order states
83
88
  *
84
89
  * Order lifecycle progression:
85
90
  * - SUBMITTED: Order submitted to the matching engine for processing
86
91
  * - PARTIALLY_FILLED: Order has been partially executed
87
- * - FILLED: Order has been completely executed
88
- * - SETTLED: Order has been settled on-chain
92
+ * - FILLED: Order has been completely executed (pre-commit)
93
+ * - SETTLED_ON_CHAIN: Order settlement has been finalized on-chain
94
+ * - SETTLED: Legacy settled status from older backend versions
89
95
  * - CANCELLED: Order was canceled by user or system
90
96
  * - REJECTED: Order was rejected due to validation failure
91
97
  * - EXPIRED: Order expired based on time constraints
92
98
  */
93
- export type OrderStatus = "SUBMITTED" | "PARTIALLY_FILLED" | "FILLED" | "SETTLED" | "CANCELLED" | "REJECTED" | "EXPIRED";
99
+ export type OrderStatus = (typeof ORDER_STATUS_VALUES)[number];
94
100
  /**
95
101
  * Trading mode
96
102
  */
@@ -103,4 +109,3 @@ export type TradingMode = "SPOT" | "MARGIN";
103
109
  * - GTD: Good Till Date - remains active until specified expiration date
104
110
  */
105
111
  export type TimeInForce = "GTC" | "IOC" | "FOK" | "GTD";
106
- //# sourceMappingURL=orders.d.ts.map
@@ -3,4 +3,7 @@
3
3
  *
4
4
  * Types for trading operations and order management.
5
5
  */
6
- //# sourceMappingURL=orders.js.map
6
+ /**
7
+ * Source-of-truth order status values used by runtime validation schemas.
8
+ */
9
+ export const ORDER_STATUS_VALUES = ["SUBMITTED", "PARTIALLY_FILLED", "FILLED", "SETTLED_ON_CHAIN", "SETTLED", "CANCELLED", "REJECTED", "EXPIRED"];
@@ -276,4 +276,3 @@ export interface BatchReplaceOrderParams {
276
276
  /** For sub-accounts: use master's balance (optional) */
277
277
  useMasterBalance?: boolean;
278
278
  }
279
- //# sourceMappingURL=responses.d.ts.map
@@ -3,4 +3,3 @@
3
3
  *
4
4
  * Response types for trading operations.
5
5
  */
6
- //# sourceMappingURL=responses.js.map
@@ -177,4 +177,3 @@ export declare class ValidationError extends Error {
177
177
  * ```
178
178
  */
179
179
  export declare function validate<T>(schema: z.ZodSchema<T>, data: unknown): T;
180
- //# sourceMappingURL=common.d.ts.map
@@ -197,4 +197,3 @@ export function validate(schema, data) {
197
197
  }
198
198
  return result.data;
199
199
  }
200
- //# sourceMappingURL=common.js.map
@@ -18,4 +18,3 @@ export * from "./market.js";
18
18
  export * from "./profile.js";
19
19
  export * from "./trading.js";
20
20
  export * from "./vault.js";
21
- //# sourceMappingURL=index.d.ts.map
@@ -20,4 +20,3 @@ export * from "./market.js";
20
20
  export * from "./profile.js";
21
21
  export * from "./trading.js";
22
22
  export * from "./vault.js";
23
- //# sourceMappingURL=index.js.map
@@ -212,4 +212,3 @@ export declare const SearchTradingPairsSchema: z.ZodObject<{
212
212
  export declare const GetMarketMetadataSchema: z.ZodObject<{
213
213
  tradingPairId: z.ZodUUID;
214
214
  }, z.core.$strip>;
215
- //# sourceMappingURL=market.d.ts.map
@@ -223,4 +223,3 @@ export const SearchTradingPairsSchema = z.object({
223
223
  export const GetMarketMetadataSchema = z.object({
224
224
  tradingPairId: UUIDSchema,
225
225
  });
226
- //# sourceMappingURL=market.js.map
@@ -28,14 +28,6 @@ export declare const TransactionTypeSchema: z.ZodEnum<{
28
28
  INTEREST: "INTEREST";
29
29
  REWARD: "REWARD";
30
30
  }>;
31
- /**
32
- * Movements data source validation
33
- */
34
- export declare const MovementsDataSourceSchema: z.ZodEnum<{
35
- hot_storage: "hot_storage";
36
- cold_storage: "cold_storage";
37
- both: "both";
38
- }>;
39
31
  /**
40
32
  * Get User Movements validation schema
41
33
  *
@@ -63,10 +55,15 @@ export declare const GetUserMovementsSchema: z.ZodObject<{
63
55
  REWARD: "REWARD";
64
56
  }>>;
65
57
  asset_id: z.ZodOptional<z.ZodUUID>;
66
- source: z.ZodOptional<z.ZodEnum<{
67
- hot_storage: "hot_storage";
68
- cold_storage: "cold_storage";
69
- both: "both";
70
- }>>;
71
58
  }, z.core.$strip>;
72
- //# sourceMappingURL=profile.d.ts.map
59
+ /**
60
+ * Get User Trades validation schema
61
+ *
62
+ * Validates parameters for fetching paginated user trades.
63
+ * All fields are optional — an empty object or undefined is valid.
64
+ */
65
+ export declare const GetUserTradesSchema: z.ZodObject<{
66
+ page: z.ZodOptional<z.ZodNumber>;
67
+ limit: z.ZodOptional<z.ZodNumber>;
68
+ trading_pair_id: z.ZodOptional<z.ZodUUID>;
69
+ }, z.core.$strip>;
@@ -18,12 +18,6 @@ export const LedgerEntryTypeSchema = z.enum(["CREDIT", "DEBIT", "LOCK", "UNLOCK"
18
18
  export const TransactionTypeSchema = z.enum(["DEPOSIT", "WITHDRAWAL", "TRADE", "FEE", "FUNDING", "LIQUIDATION", "INTEREST", "REWARD"], {
19
19
  message: 'Transaction type must be "DEPOSIT", "WITHDRAWAL", "TRADE", "FEE", "FUNDING", "LIQUIDATION", "INTEREST", or "REWARD"',
20
20
  });
21
- /**
22
- * Movements data source validation
23
- */
24
- export const MovementsDataSourceSchema = z.enum(["hot_storage", "cold_storage", "both"], {
25
- message: 'Data source must be "hot_storage", "cold_storage", or "both"',
26
- });
27
21
  /**
28
22
  * Get User Movements validation schema
29
23
  *
@@ -36,6 +30,15 @@ export const GetUserMovementsSchema = z.object({
36
30
  entry_type: LedgerEntryTypeSchema.optional(),
37
31
  transaction_type: TransactionTypeSchema.optional(),
38
32
  asset_id: UUIDSchema.optional(),
39
- source: MovementsDataSourceSchema.optional(),
40
33
  });
41
- //# sourceMappingURL=profile.js.map
34
+ /**
35
+ * Get User Trades validation schema
36
+ *
37
+ * Validates parameters for fetching paginated user trades.
38
+ * All fields are optional — an empty object or undefined is valid.
39
+ */
40
+ export const GetUserTradesSchema = z.object({
41
+ page: z.number().int("Page must be an integer").min(1, "Page must be at least 1").optional(),
42
+ limit: z.number().int("Limit must be an integer").min(1, "Limit must be at least 1").max(100, "Limit cannot exceed 100").optional(),
43
+ trading_pair_id: UUIDSchema.optional(),
44
+ });
@@ -123,6 +123,7 @@ export declare const GetPaginatedOrdersSchema: z.ZodObject<{
123
123
  SUBMITTED: "SUBMITTED";
124
124
  PARTIALLY_FILLED: "PARTIALLY_FILLED";
125
125
  FILLED: "FILLED";
126
+ SETTLED_ON_CHAIN: "SETTLED_ON_CHAIN";
126
127
  SETTLED: "SETTLED";
127
128
  CANCELLED: "CANCELLED";
128
129
  REJECTED: "REJECTED";
@@ -226,4 +227,3 @@ export declare const BatchReplaceOrdersSchema: z.ZodObject<{
226
227
  useMasterBalance: z.ZodOptional<z.ZodBoolean>;
227
228
  }, z.core.$strip>>;
228
229
  }, z.core.$strip>;
229
- //# sourceMappingURL=trading.d.ts.map
@@ -5,6 +5,7 @@
5
5
  * Provides clear, actionable error messages for invalid parameters.
6
6
  */
7
7
  import { z } from "zod";
8
+ import { ORDER_STATUS_VALUES } from "../trading/orders";
8
9
  /**
9
10
  * Order side validation
10
11
  */
@@ -118,7 +119,7 @@ export const ReplaceOrderSchema = z.object({
118
119
  * - page_size: number (default: 10, max: 100)
119
120
  */
120
121
  export const GetPaginatedOrdersSchema = z.object({
121
- status: z.enum(["SUBMITTED", "PARTIALLY_FILLED", "FILLED", "SETTLED", "CANCELLED", "REJECTED", "EXPIRED"]).optional(),
122
+ status: z.enum(ORDER_STATUS_VALUES).optional(),
122
123
  trading_pair: UUIDSchema.optional(),
123
124
  page: z.number().int().min(1, "Page must be at least 1").optional(),
124
125
  page_size: z.number().int().min(1, "Page size must be at least 1").max(100, "Page size cannot exceed 100").optional(),
@@ -189,4 +190,3 @@ export const BatchReplaceOrderItemSchema = z
189
190
  export const BatchReplaceOrdersSchema = z.object({
190
191
  orders: z.array(BatchReplaceOrderItemSchema).min(1, "At least one order is required"),
191
192
  });
192
- //# sourceMappingURL=trading.js.map
@@ -59,4 +59,3 @@ export declare const WithdrawSchema: z.ZodObject<{
59
59
  export declare const GetBalanceSchema: z.ZodObject<{
60
60
  assetId: z.ZodUUID;
61
61
  }, z.core.$strip>;
62
- //# sourceMappingURL=vault.d.ts.map
@@ -72,4 +72,3 @@ export const WithdrawSchema = z.object({
72
72
  export const GetBalanceSchema = z.object({
73
73
  assetId: UUIDSchema,
74
74
  });
75
- //# sourceMappingURL=vault.js.map
@@ -68,4 +68,3 @@ export interface VaultAPI extends BaseAPI {
68
68
  setWalletClient(walletClient: unknown): void;
69
69
  }
70
70
  export type { Balance, TransactionResult } from "./responses";
71
- //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,3 @@
3
3
  *
4
4
  * Types for vault operations including deposits, withdrawals, and balance management.
5
5
  */
6
- //# sourceMappingURL=index.js.map
@@ -31,4 +31,3 @@ export interface Balance {
31
31
  /** Token decimals */
32
32
  decimals: number;
33
33
  }
34
- //# sourceMappingURL=responses.d.ts.map
@@ -3,4 +3,3 @@
3
3
  *
4
4
  * Response types for vault operations.
5
5
  */
6
- //# sourceMappingURL=responses.js.map
@@ -29,4 +29,3 @@ export interface BaseErrorEvent {
29
29
  code?: string | number;
30
30
  details?: unknown;
31
31
  }
32
- //# sourceMappingURL=base.d.ts.map
@@ -3,4 +3,3 @@
3
3
  *
4
4
  * Types for the functional Monaco WebSocket client.
5
5
  */
6
- //# sourceMappingURL=base.js.map