@0xmonaco/types 0.7.5 → 0.7.7

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 (81) hide show
  1. package/package.json +2 -2
  2. package/dist/api/index.d.ts +0 -18
  3. package/dist/api/index.js +0 -6
  4. package/dist/applications/index.d.ts +0 -23
  5. package/dist/applications/index.js +0 -5
  6. package/dist/applications/responses.d.ts +0 -22
  7. package/dist/applications/responses.js +0 -5
  8. package/dist/auth/index.d.ts +0 -81
  9. package/dist/auth/index.js +0 -6
  10. package/dist/auth/responses.d.ts +0 -67
  11. package/dist/auth/responses.js +0 -5
  12. package/dist/contracts/balances.d.ts +0 -43
  13. package/dist/contracts/balances.js +0 -5
  14. package/dist/contracts/index.d.ts +0 -27
  15. package/dist/contracts/index.js +0 -5
  16. package/dist/fees/index.d.ts +0 -39
  17. package/dist/fees/index.js +0 -6
  18. package/dist/fees/responses.d.ts +0 -54
  19. package/dist/fees/responses.js +0 -86
  20. package/dist/index.d.ts +0 -20
  21. package/dist/index.js +0 -21
  22. package/dist/margin-accounts/index.d.ts +0 -110
  23. package/dist/margin-accounts/index.js +0 -0
  24. package/dist/market/index.d.ts +0 -312
  25. package/dist/market/index.js +0 -5
  26. package/dist/positions/index.d.ts +0 -128
  27. package/dist/positions/index.js +0 -0
  28. package/dist/profile/index.d.ts +0 -405
  29. package/dist/profile/index.js +0 -5
  30. package/dist/sdk/index.d.ts +0 -131
  31. package/dist/sdk/index.js +0 -0
  32. package/dist/sdk/network.d.ts +0 -25
  33. package/dist/sdk/network.js +0 -5
  34. package/dist/trading/index.d.ts +0 -132
  35. package/dist/trading/index.js +0 -6
  36. package/dist/trading/orders.d.ts +0 -137
  37. package/dist/trading/orders.js +0 -9
  38. package/dist/trading/responses.d.ts +0 -347
  39. package/dist/trading/responses.js +0 -5
  40. package/dist/validation/common.d.ts +0 -179
  41. package/dist/validation/common.js +0 -199
  42. package/dist/validation/index.d.ts +0 -22
  43. package/dist/validation/index.js +0 -24
  44. package/dist/validation/margin-accounts.d.ts +0 -55
  45. package/dist/validation/margin-accounts.js +0 -59
  46. package/dist/validation/market.d.ts +0 -214
  47. package/dist/validation/market.js +0 -225
  48. package/dist/validation/positions.d.ts +0 -89
  49. package/dist/validation/positions.js +0 -93
  50. package/dist/validation/profile.d.ts +0 -69
  51. package/dist/validation/profile.js +0 -44
  52. package/dist/validation/trading.d.ts +0 -350
  53. package/dist/validation/trading.js +0 -313
  54. package/dist/validation/vault.d.ts +0 -66
  55. package/dist/validation/vault.js +0 -79
  56. package/dist/vault/index.d.ts +0 -84
  57. package/dist/vault/index.js +0 -5
  58. package/dist/vault/responses.d.ts +0 -51
  59. package/dist/vault/responses.js +0 -5
  60. package/dist/websocket/base.d.ts +0 -31
  61. package/dist/websocket/base.js +0 -5
  62. package/dist/websocket/clients/orderbook-client.d.ts +0 -14
  63. package/dist/websocket/clients/orderbook-client.js +0 -3
  64. package/dist/websocket/events/balance-events.d.ts +0 -48
  65. package/dist/websocket/events/balance-events.js +0 -6
  66. package/dist/websocket/events/conditional-order-events.d.ts +0 -33
  67. package/dist/websocket/events/conditional-order-events.js +0 -0
  68. package/dist/websocket/events/index.d.ts +0 -7
  69. package/dist/websocket/events/index.js +0 -7
  70. package/dist/websocket/events/movement-events.d.ts +0 -64
  71. package/dist/websocket/events/movement-events.js +0 -6
  72. package/dist/websocket/events/ohlcv-events.d.ts +0 -31
  73. package/dist/websocket/events/ohlcv-events.js +0 -5
  74. package/dist/websocket/events/orderbook-events.d.ts +0 -72
  75. package/dist/websocket/events/orderbook-events.js +0 -5
  76. package/dist/websocket/events/orders-events.d.ts +0 -284
  77. package/dist/websocket/events/orders-events.js +0 -0
  78. package/dist/websocket/events/trade-events.d.ts +0 -34
  79. package/dist/websocket/events/trade-events.js +0 -5
  80. package/dist/websocket/index.d.ts +0 -8
  81. package/dist/websocket/index.js +0 -8
@@ -1,44 +0,0 @@
1
- /**
2
- * Profile API Validation Schemas
3
- *
4
- * Zod schemas for validating profile API inputs before making requests.
5
- * Provides clear, actionable error messages for invalid parameters.
6
- */
7
- import { z } from "zod";
8
- import { UUIDSchema } from "./trading.js";
9
- /**
10
- * Ledger entry type validation
11
- */
12
- export const LedgerEntryTypeSchema = z.enum(["CREDIT", "DEBIT", "LOCK", "UNLOCK", "FEE"], {
13
- message: 'Entry type must be "CREDIT", "DEBIT", "LOCK", "UNLOCK", or "FEE"',
14
- });
15
- /**
16
- * Transaction type validation
17
- */
18
- export const TransactionTypeSchema = z.enum(["DEPOSIT", "WITHDRAWAL", "TRADE", "FEE", "FUNDING", "LIQUIDATION", "INTEREST", "REWARD"], {
19
- message: 'Transaction type must be "DEPOSIT", "WITHDRAWAL", "TRADE", "FEE", "FUNDING", "LIQUIDATION", "INTEREST", or "REWARD"',
20
- });
21
- /**
22
- * Get User Movements validation schema
23
- *
24
- * Validates parameters for fetching paginated user movements.
25
- * All fields are optional — an empty object or undefined is valid.
26
- */
27
- export const GetUserMovementsSchema = z.object({
28
- page: z.number().int("Page must be an integer").min(1, "Page must be at least 1").optional(),
29
- page_size: z.number().int("Page size must be an integer").min(1, "Page size must be at least 1").max(100, "Page size cannot exceed 100").optional(),
30
- entry_type: LedgerEntryTypeSchema.optional(),
31
- transaction_type: TransactionTypeSchema.optional(),
32
- asset_id: UUIDSchema.optional(),
33
- });
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
- page_size: z.number().int("Page size must be an integer").min(1, "Page size must be at least 1").max(100, "Page size cannot exceed 100").optional(),
43
- trading_pair_id: UUIDSchema.optional(),
44
- });
@@ -1,350 +0,0 @@
1
- /**
2
- * Trading API Validation Schemas
3
- *
4
- * Zod schemas for validating trading API inputs before making requests.
5
- * Provides clear, actionable error messages for invalid parameters.
6
- */
7
- import { z } from "zod";
8
- /**
9
- * Order side validation
10
- */
11
- export declare const OrderSideSchema: z.ZodEnum<{
12
- BUY: "BUY";
13
- SELL: "SELL";
14
- }>;
15
- /**
16
- * Trading mode validation
17
- */
18
- export declare const TradingModeSchema: z.ZodEnum<{
19
- SPOT: "SPOT";
20
- MARGIN: "MARGIN";
21
- }>;
22
- /**
23
- * Position side validation
24
- */
25
- export declare const PositionSideSchema: z.ZodEnum<{
26
- LONG: "LONG";
27
- SHORT: "SHORT";
28
- NONE: "NONE";
29
- }>;
30
- /**
31
- * Time in force validation
32
- */
33
- export declare const TimeInForceSchema: z.ZodEnum<{
34
- GTC: "GTC";
35
- IOC: "IOC";
36
- FOK: "FOK";
37
- }>;
38
- export declare const ConditionalTimeInForceSchema: z.ZodEnum<{
39
- GTC: "GTC";
40
- IOC: "IOC";
41
- }>;
42
- /**
43
- * Positive decimal string validation (for quantities and prices)
44
- */
45
- export declare const PositiveDecimalStringSchema: z.ZodString;
46
- /**
47
- * UUID validation
48
- */
49
- export declare const UUIDSchema: z.ZodUUID;
50
- /**
51
- * ISO 8601 date string validation
52
- */
53
- export declare const ISO8601DateSchema: z.ZodISODateTime;
54
- /**
55
- * Slippage tolerance validation (0 to 1, where 0.01 = 1%)
56
- */
57
- export declare const SlippageToleranceSchema: z.ZodOptional<z.ZodNumber>;
58
- /**
59
- * Place Limit Order validation schema
60
- */
61
- export declare const PlaceLimitOrderSchema: z.ZodObject<{
62
- tradingPairId: z.ZodUUID;
63
- side: z.ZodEnum<{
64
- BUY: "BUY";
65
- SELL: "SELL";
66
- }>;
67
- quantity: z.ZodString;
68
- price: z.ZodString;
69
- options: z.ZodOptional<z.ZodObject<{
70
- tradingMode: z.ZodOptional<z.ZodEnum<{
71
- SPOT: "SPOT";
72
- MARGIN: "MARGIN";
73
- }>>;
74
- useMasterBalance: z.ZodOptional<z.ZodBoolean>;
75
- expirationDate: z.ZodOptional<z.ZodISODateTime>;
76
- timeInForce: z.ZodOptional<z.ZodEnum<{
77
- GTC: "GTC";
78
- IOC: "IOC";
79
- FOK: "FOK";
80
- }>>;
81
- marginAccountId: z.ZodOptional<z.ZodUUID>;
82
- positionSide: z.ZodOptional<z.ZodEnum<{
83
- LONG: "LONG";
84
- SHORT: "SHORT";
85
- NONE: "NONE";
86
- }>>;
87
- leverage: z.ZodOptional<z.ZodString>;
88
- reduceOnly: z.ZodOptional<z.ZodBoolean>;
89
- }, z.core.$strip>>;
90
- }, z.core.$strip>;
91
- /**
92
- * Place Market Order validation schema
93
- */
94
- export declare const PlaceMarketOrderSchema: z.ZodObject<{
95
- tradingPairId: z.ZodUUID;
96
- side: z.ZodEnum<{
97
- BUY: "BUY";
98
- SELL: "SELL";
99
- }>;
100
- quantity: z.ZodString;
101
- options: z.ZodOptional<z.ZodObject<{
102
- tradingMode: z.ZodOptional<z.ZodEnum<{
103
- SPOT: "SPOT";
104
- MARGIN: "MARGIN";
105
- }>>;
106
- slippageTolerance: z.ZodOptional<z.ZodNumber>;
107
- marginAccountId: z.ZodOptional<z.ZodUUID>;
108
- positionSide: z.ZodOptional<z.ZodEnum<{
109
- LONG: "LONG";
110
- SHORT: "SHORT";
111
- NONE: "NONE";
112
- }>>;
113
- leverage: z.ZodOptional<z.ZodString>;
114
- reduceOnly: z.ZodOptional<z.ZodBoolean>;
115
- }, z.core.$strip>>;
116
- }, z.core.$strip>;
117
- /**
118
- * Cancel Order validation schema
119
- */
120
- export declare const CancelOrderSchema: z.ZodObject<{
121
- orderId: z.ZodUUID;
122
- }, z.core.$strip>;
123
- /**
124
- * Replace Order validation schema
125
- *
126
- * Validates parameters for replacing an existing order.
127
- * Matches the replaceOrder method signature which accepts:
128
- * - orderId: string (UUID)
129
- * - newOrder: { price?: string, quantity?: string, useMasterBalance?: boolean }
130
- */
131
- export declare const ReplaceOrderSchema: z.ZodObject<{
132
- orderId: z.ZodUUID;
133
- newOrder: z.ZodObject<{
134
- price: z.ZodOptional<z.ZodString>;
135
- quantity: z.ZodOptional<z.ZodString>;
136
- useMasterBalance: z.ZodOptional<z.ZodBoolean>;
137
- }, z.core.$strip>;
138
- }, z.core.$strip>;
139
- /**
140
- * Get Paginated Orders validation schema
141
- *
142
- * Validates parameters for fetching paginated orders.
143
- * Matches the getPaginatedOrders method signature which accepts:
144
- * - status: OrderStatus (optional filter)
145
- * - trading_pair_id: trading pair UUID (optional filter)
146
- * - page: number (default: 1)
147
- * - page_size: number (default: 10, max: 100)
148
- */
149
- export declare const GetPaginatedOrdersSchema: z.ZodObject<{
150
- status: z.ZodOptional<z.ZodEnum<{
151
- SUBMITTED: "SUBMITTED";
152
- PARTIALLY_FILLED: "PARTIALLY_FILLED";
153
- FILLED: "FILLED";
154
- SETTLED_ON_CHAIN: "SETTLED_ON_CHAIN";
155
- SETTLED: "SETTLED";
156
- CANCELLED: "CANCELLED";
157
- REJECTED: "REJECTED";
158
- EXPIRED: "EXPIRED";
159
- }>>;
160
- trading_pair_id: z.ZodOptional<z.ZodUUID>;
161
- trading_mode: z.ZodOptional<z.ZodEnum<{
162
- SPOT: "SPOT";
163
- MARGIN: "MARGIN";
164
- }>>;
165
- margin_account_id: z.ZodOptional<z.ZodUUID>;
166
- page: z.ZodOptional<z.ZodNumber>;
167
- page_size: z.ZodOptional<z.ZodNumber>;
168
- }, z.core.$strip>;
169
- /**
170
- * Order type validation
171
- */
172
- export declare const OrderTypeSchema: z.ZodEnum<{
173
- LIMIT: "LIMIT";
174
- MARKET: "MARKET";
175
- }>;
176
- export declare const ConditionalOrderConditionTypeSchema: z.ZodEnum<{
177
- STOP_LOSS: "STOP_LOSS";
178
- TAKE_PROFIT: "TAKE_PROFIT";
179
- }>;
180
- export declare const ConditionalOrderTriggerSourceSchema: z.ZodEnum<{
181
- MARK_PRICE: "MARK_PRICE";
182
- }>;
183
- export declare const ConditionalOrderStateSchema: z.ZodEnum<{
184
- CANCELLED: "CANCELLED";
185
- EXPIRED: "EXPIRED";
186
- ACTIVE: "ACTIVE";
187
- TRIGGERING: "TRIGGERING";
188
- TRIGGERED: "TRIGGERED";
189
- FAILED: "FAILED";
190
- }>;
191
- export declare const ClosePositionSideSchema: z.ZodEnum<{
192
- LONG: "LONG";
193
- SHORT: "SHORT";
194
- }>;
195
- export declare const SlippageToleranceBpsSchema: z.ZodNumber;
196
- export declare const CreateConditionalOrderSchema: z.ZodObject<{
197
- tradingPairId: z.ZodUUID;
198
- marginAccountId: z.ZodUUID;
199
- conditionType: z.ZodEnum<{
200
- STOP_LOSS: "STOP_LOSS";
201
- TAKE_PROFIT: "TAKE_PROFIT";
202
- }>;
203
- triggerPrice: z.ZodString;
204
- triggerSource: z.ZodOptional<z.ZodEnum<{
205
- MARK_PRICE: "MARK_PRICE";
206
- }>>;
207
- side: z.ZodEnum<{
208
- BUY: "BUY";
209
- SELL: "SELL";
210
- }>;
211
- positionSide: z.ZodEnum<{
212
- LONG: "LONG";
213
- SHORT: "SHORT";
214
- }>;
215
- orderType: z.ZodEnum<{
216
- LIMIT: "LIMIT";
217
- MARKET: "MARKET";
218
- }>;
219
- limitPrice: z.ZodOptional<z.ZodString>;
220
- quantity: z.ZodOptional<z.ZodString>;
221
- reduceOnly: z.ZodOptional<z.ZodBoolean>;
222
- timeInForce: z.ZodOptional<z.ZodEnum<{
223
- GTC: "GTC";
224
- IOC: "IOC";
225
- }>>;
226
- slippageToleranceBps: z.ZodOptional<z.ZodNumber>;
227
- expiresAt: z.ZodOptional<z.ZodISODateTime>;
228
- }, z.core.$strip>;
229
- export declare const CancelConditionalOrderSchema: z.ZodObject<{
230
- conditionalOrderId: z.ZodUUID;
231
- }, z.core.$strip>;
232
- export declare const ListConditionalOrdersSchema: z.ZodObject<{
233
- margin_account_id: z.ZodOptional<z.ZodUUID>;
234
- trading_pair_id: z.ZodOptional<z.ZodUUID>;
235
- state: z.ZodOptional<z.ZodEnum<{
236
- CANCELLED: "CANCELLED";
237
- EXPIRED: "EXPIRED";
238
- ACTIVE: "ACTIVE";
239
- TRIGGERING: "TRIGGERING";
240
- TRIGGERED: "TRIGGERED";
241
- FAILED: "FAILED";
242
- }>>;
243
- page: z.ZodOptional<z.ZodNumber>;
244
- page_size: z.ZodOptional<z.ZodNumber>;
245
- }, z.core.$strip>;
246
- /**
247
- * Single batch create order item validation schema
248
- *
249
- * Validates each order in a batch create request.
250
- * - LIMIT orders require a price
251
- * - MARKET orders must not have a price
252
- */
253
- export declare const BatchCreateOrderItemSchema: z.ZodObject<{
254
- tradingPairId: z.ZodUUID;
255
- orderType: z.ZodEnum<{
256
- LIMIT: "LIMIT";
257
- MARKET: "MARKET";
258
- }>;
259
- side: z.ZodEnum<{
260
- BUY: "BUY";
261
- SELL: "SELL";
262
- }>;
263
- price: z.ZodOptional<z.ZodString>;
264
- quantity: z.ZodString;
265
- tradingMode: z.ZodOptional<z.ZodEnum<{
266
- SPOT: "SPOT";
267
- MARGIN: "MARGIN";
268
- }>>;
269
- slippageTolerance: z.ZodOptional<z.ZodNumber>;
270
- useMasterBalance: z.ZodOptional<z.ZodBoolean>;
271
- expirationDate: z.ZodOptional<z.ZodISODateTime>;
272
- timeInForce: z.ZodOptional<z.ZodEnum<{
273
- GTC: "GTC";
274
- IOC: "IOC";
275
- FOK: "FOK";
276
- }>>;
277
- marginAccountId: z.ZodOptional<z.ZodUUID>;
278
- positionSide: z.ZodOptional<z.ZodEnum<{
279
- LONG: "LONG";
280
- SHORT: "SHORT";
281
- NONE: "NONE";
282
- }>>;
283
- leverage: z.ZodOptional<z.ZodString>;
284
- reduceOnly: z.ZodOptional<z.ZodBoolean>;
285
- }, z.core.$strip>;
286
- /**
287
- * Batch Create Orders validation schema
288
- *
289
- * Validates the full array of orders for a batch create request.
290
- */
291
- export declare const BatchCreateOrdersSchema: z.ZodObject<{
292
- orders: z.ZodArray<z.ZodObject<{
293
- tradingPairId: z.ZodUUID;
294
- orderType: z.ZodEnum<{
295
- LIMIT: "LIMIT";
296
- MARKET: "MARKET";
297
- }>;
298
- side: z.ZodEnum<{
299
- BUY: "BUY";
300
- SELL: "SELL";
301
- }>;
302
- price: z.ZodOptional<z.ZodString>;
303
- quantity: z.ZodString;
304
- tradingMode: z.ZodOptional<z.ZodEnum<{
305
- SPOT: "SPOT";
306
- MARGIN: "MARGIN";
307
- }>>;
308
- slippageTolerance: z.ZodOptional<z.ZodNumber>;
309
- useMasterBalance: z.ZodOptional<z.ZodBoolean>;
310
- expirationDate: z.ZodOptional<z.ZodISODateTime>;
311
- timeInForce: z.ZodOptional<z.ZodEnum<{
312
- GTC: "GTC";
313
- IOC: "IOC";
314
- FOK: "FOK";
315
- }>>;
316
- marginAccountId: z.ZodOptional<z.ZodUUID>;
317
- positionSide: z.ZodOptional<z.ZodEnum<{
318
- LONG: "LONG";
319
- SHORT: "SHORT";
320
- NONE: "NONE";
321
- }>>;
322
- leverage: z.ZodOptional<z.ZodString>;
323
- reduceOnly: z.ZodOptional<z.ZodBoolean>;
324
- }, z.core.$strip>>;
325
- }, z.core.$strip>;
326
- /**
327
- * Single batch replace order item validation schema
328
- *
329
- * Validates each order in a batch replace request.
330
- * At least one of price or quantity must be provided.
331
- */
332
- export declare const BatchReplaceOrderItemSchema: z.ZodObject<{
333
- orderId: z.ZodUUID;
334
- price: z.ZodOptional<z.ZodString>;
335
- quantity: z.ZodOptional<z.ZodString>;
336
- useMasterBalance: z.ZodOptional<z.ZodBoolean>;
337
- }, z.core.$strip>;
338
- /**
339
- * Batch Replace Orders validation schema
340
- *
341
- * Validates the full array of orders for a batch replace request.
342
- */
343
- export declare const BatchReplaceOrdersSchema: z.ZodObject<{
344
- orders: z.ZodArray<z.ZodObject<{
345
- orderId: z.ZodUUID;
346
- price: z.ZodOptional<z.ZodString>;
347
- quantity: z.ZodOptional<z.ZodString>;
348
- useMasterBalance: z.ZodOptional<z.ZodBoolean>;
349
- }, z.core.$strip>>;
350
- }, z.core.$strip>;