@0xmonaco/types 0.8.14 → 0.8.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/applications/requests.d.ts +15 -15
- package/dist/applications/responses.d.ts +52 -52
- package/dist/delegated-agents/index.d.ts +21 -21
- package/dist/faucet/index.d.ts +4 -4
- package/dist/fees/index.d.ts +4 -4
- package/dist/fees/responses.d.ts +17 -17
- package/dist/fees/responses.js +20 -20
- package/dist/margin-accounts/index.d.ts +42 -42
- package/dist/market/index.d.ts +122 -123
- package/dist/positions/index.d.ts +51 -51
- package/dist/profile/index.d.ts +86 -86
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sub-accounts/index.d.ts +19 -19
- package/dist/trading/index.d.ts +2 -2
- package/dist/trading/orders.d.ts +20 -20
- package/dist/trading/responses.d.ts +74 -74
- package/dist/validation/margin-accounts.d.ts +5 -5
- package/dist/validation/margin-accounts.js +3 -3
- package/dist/validation/market.d.ts +1 -1
- package/dist/validation/market.js +1 -1
- package/dist/validation/positions.d.ts +7 -7
- package/dist/validation/positions.js +6 -6
- package/dist/validation/profile.d.ts +10 -10
- package/dist/validation/profile.js +10 -10
- package/dist/validation/trading.d.ts +9 -9
- package/dist/validation/trading.js +9 -9
- package/dist/whitelist/index.d.ts +4 -4
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +1 -0
- package/dist/wire/schema.d.ts +940 -820
- package/dist/withdrawals/index.d.ts +58 -5
- package/package.json +2 -2
package/dist/trading/index.d.ts
CHANGED
|
@@ -120,9 +120,9 @@ export interface TradingAPI extends BaseAPI {
|
|
|
120
120
|
* Gets paginated orders based on query parameters.
|
|
121
121
|
* @param params - Query parameters for filtering orders
|
|
122
122
|
* @param params.status - Filter by order status (optional)
|
|
123
|
-
* @param params.
|
|
123
|
+
* @param params.tradingPairId - Filter by trading pair UUID (optional)
|
|
124
124
|
* @param params.page - Page number for pagination (optional)
|
|
125
|
-
* @param params.
|
|
125
|
+
* @param params.pageSize - Number of orders per page (optional)
|
|
126
126
|
* @returns Promise resolving to the paginated orders result
|
|
127
127
|
*/
|
|
128
128
|
getPaginatedOrders(params?: GetPaginatedOrdersParams): Promise<GetPaginatedOrdersResponse>;
|
package/dist/trading/orders.d.ts
CHANGED
|
@@ -16,18 +16,18 @@
|
|
|
16
16
|
* @example
|
|
17
17
|
* To calculate remaining quantity:
|
|
18
18
|
* ```typescript
|
|
19
|
-
* const remaining = parseFloat(order.quantity) - parseFloat(order.
|
|
19
|
+
* const remaining = parseFloat(order.quantity) - parseFloat(order.filledQuantity);
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export interface Order {
|
|
23
23
|
/** Order identifier (UUID) */
|
|
24
24
|
id: string;
|
|
25
25
|
/** Trading pair ID (UUID format, e.g., "456e7890-e12b-12d3-a456-426614174000") */
|
|
26
|
-
|
|
26
|
+
tradingPairId: string;
|
|
27
27
|
/** Order side (BUY or SELL) */
|
|
28
28
|
side: OrderSide;
|
|
29
29
|
/** Order type - see OrderType for all supported types */
|
|
30
|
-
|
|
30
|
+
orderType: OrderType;
|
|
31
31
|
/** Order status - see OrderStatus for lifecycle details */
|
|
32
32
|
status: OrderStatus;
|
|
33
33
|
/** Order price - null for market orders, required for limit orders */
|
|
@@ -35,41 +35,41 @@ export interface Order {
|
|
|
35
35
|
/** Order quantity (base currency amount) */
|
|
36
36
|
quantity: string;
|
|
37
37
|
/** Filled quantity (base currency amount, "0" if unfilled) */
|
|
38
|
-
|
|
38
|
+
filledQuantity: string;
|
|
39
39
|
/** Average fill price - only populated after order has fills */
|
|
40
|
-
|
|
40
|
+
averageFillPrice?: string;
|
|
41
41
|
/** Trading mode (SPOT or MARGIN) */
|
|
42
|
-
|
|
42
|
+
tradingMode: TradingMode;
|
|
43
43
|
/** Time in force - GTC, IOC, FOK, or GTD */
|
|
44
|
-
|
|
44
|
+
timeInForce?: TimeInForce;
|
|
45
45
|
/** Order creation timestamp (ISO 8601) */
|
|
46
|
-
|
|
46
|
+
createdAt: string;
|
|
47
47
|
/** Order last update timestamp (ISO 8601) */
|
|
48
|
-
|
|
48
|
+
updatedAt?: string;
|
|
49
49
|
/** Optional expiration date for GTD orders (ISO 8601, max 1 year) */
|
|
50
|
-
|
|
50
|
+
expirationDate?: string;
|
|
51
51
|
/** Application taker fee in basis points (e.g., "100" = 1%) - populated after fills */
|
|
52
|
-
|
|
52
|
+
applicationTakerFee?: string;
|
|
53
53
|
/** Monaco protocol taker fee in basis points - populated after fills */
|
|
54
|
-
|
|
54
|
+
monacoTakerFee?: string;
|
|
55
55
|
/** Monaco protocol maker rebate in basis points - populated after fills */
|
|
56
|
-
|
|
56
|
+
monacoMakerRebate?: string;
|
|
57
57
|
/** Total taker fees paid in quote currency - populated after fills */
|
|
58
|
-
|
|
58
|
+
totalTakerFees?: string;
|
|
59
59
|
/** Total payment for taker including fees in quote currency - populated after fills */
|
|
60
|
-
|
|
60
|
+
takerTotalPayment?: string;
|
|
61
61
|
/** Total receipt for maker after rebates in quote currency - populated after fills */
|
|
62
|
-
|
|
62
|
+
makerTotalReceipt?: string;
|
|
63
63
|
/** Margin account ID for margin/perp orders */
|
|
64
|
-
|
|
64
|
+
marginAccountId?: string;
|
|
65
65
|
/** Position side for margin/perp orders */
|
|
66
|
-
|
|
66
|
+
positionSide?: PositionSide;
|
|
67
67
|
/** Leverage used for margin/perp orders */
|
|
68
68
|
leverage?: string;
|
|
69
69
|
/** Whether the order can only reduce existing exposure */
|
|
70
|
-
|
|
70
|
+
reduceOnly?: boolean;
|
|
71
71
|
/** Position ID linked to the order, when available */
|
|
72
|
-
|
|
72
|
+
positionId?: string;
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Role of the creator or order
|
|
@@ -15,25 +15,25 @@ import type { ConditionalOrderConditionType, ConditionalOrderState, ConditionalO
|
|
|
15
15
|
*/
|
|
16
16
|
export interface MatchResult {
|
|
17
17
|
/** Number of trades executed during matching */
|
|
18
|
-
|
|
18
|
+
tradesCount: number;
|
|
19
19
|
/** Total quantity filled across all trades (in base currency) */
|
|
20
|
-
|
|
20
|
+
totalFilled: string;
|
|
21
21
|
/** Remaining unfilled quantity after immediate matches (in base currency) */
|
|
22
|
-
|
|
22
|
+
remainingQuantity: string;
|
|
23
23
|
/** Average fill price across all trades (null if no fills occurred) */
|
|
24
|
-
|
|
24
|
+
averageFillPrice: string | null;
|
|
25
25
|
/** Final order status after matching (e.g., FILLED, PARTIALLY_FILLED, etc.) */
|
|
26
26
|
status: OrderStatus;
|
|
27
27
|
/** Actual slippage experienced in basis points (positive = worse price, null if no fills) */
|
|
28
|
-
|
|
28
|
+
actualSlippageBps: number | null;
|
|
29
29
|
/** Maximum slippage allowed when order was submitted in basis points (null if not set) */
|
|
30
|
-
|
|
30
|
+
maxSlippageBps: number | null;
|
|
31
31
|
/** Price range across executed trades (null if no fills) */
|
|
32
|
-
|
|
32
|
+
executionPriceRange: {
|
|
33
33
|
/** Best (most favorable) execution price achieved */
|
|
34
|
-
|
|
34
|
+
bestPrice: string;
|
|
35
35
|
/** Worst (least favorable) execution price achieved */
|
|
36
|
-
|
|
36
|
+
worstPrice: string;
|
|
37
37
|
} | null;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
@@ -65,32 +65,32 @@ export interface ParentTpSlLegParams {
|
|
|
65
65
|
*/
|
|
66
66
|
export interface CreateOrderResponse {
|
|
67
67
|
/** Created order identifier (UUID) */
|
|
68
|
-
|
|
68
|
+
orderId: string;
|
|
69
69
|
/** Operation status (SUCCESS or FAILED) */
|
|
70
70
|
status: "SUCCESS" | "FAILED";
|
|
71
71
|
/** Operation message describing the result (e.g., "Order processed with 2 trades") */
|
|
72
72
|
message: string;
|
|
73
73
|
/** Match result information if order was processed by matching engine */
|
|
74
|
-
|
|
74
|
+
matchResult?: MatchResult;
|
|
75
75
|
/** Resolved margin account ID for margin/perp orders */
|
|
76
|
-
|
|
76
|
+
marginAccountId?: string;
|
|
77
77
|
/** Resolved isolated risk bucket ID for risk-bucket-scoped margin orders */
|
|
78
|
-
|
|
78
|
+
riskBucketId?: string;
|
|
79
79
|
/** Client strategy key carried for compatibility */
|
|
80
|
-
|
|
80
|
+
strategyKey?: string;
|
|
81
81
|
/** Delegated agent ID when submitted through a delegated session */
|
|
82
|
-
|
|
82
|
+
delegationId?: string;
|
|
83
83
|
/** Conditional order ID for an attached take-profit leg */
|
|
84
|
-
|
|
84
|
+
takeProfitOrderId?: string;
|
|
85
85
|
/** Conditional order ID for an attached stop-loss leg */
|
|
86
|
-
|
|
86
|
+
stopLossOrderId?: string;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* Response from cancelling an order.
|
|
90
90
|
*/
|
|
91
91
|
export interface CancelOrderResponse {
|
|
92
92
|
/** Order identifier */
|
|
93
|
-
|
|
93
|
+
orderId: string;
|
|
94
94
|
/** Cancellation status */
|
|
95
95
|
status: "SUCCESS" | "FAILED";
|
|
96
96
|
/** Optional response message */
|
|
@@ -101,17 +101,17 @@ export interface CancelOrderResponse {
|
|
|
101
101
|
*/
|
|
102
102
|
export interface ReplaceOrderResponse {
|
|
103
103
|
/** New order identifier (after replacement) */
|
|
104
|
-
|
|
104
|
+
orderId: string;
|
|
105
105
|
/** Replace operation status */
|
|
106
106
|
status: "SUCCESS" | "FAILED";
|
|
107
107
|
/** Operation message */
|
|
108
108
|
message: string;
|
|
109
109
|
/** Fields that were updated */
|
|
110
|
-
|
|
110
|
+
updatedFields: UpdatedFields;
|
|
111
111
|
/** Original order identifier that was replaced */
|
|
112
|
-
|
|
112
|
+
originalOrderId?: string;
|
|
113
113
|
/** Match result information for the new order */
|
|
114
|
-
|
|
114
|
+
matchResult?: MatchResult;
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
117
|
* Fields that were updated in the replace operation
|
|
@@ -129,15 +129,15 @@ export interface GetPaginatedOrdersParams {
|
|
|
129
129
|
/** Filter by order status */
|
|
130
130
|
status?: OrderStatus;
|
|
131
131
|
/** Filter by trading pair UUID */
|
|
132
|
-
|
|
132
|
+
tradingPairId?: string;
|
|
133
133
|
/** Filter by trading mode */
|
|
134
|
-
|
|
134
|
+
tradingMode?: TradingMode;
|
|
135
135
|
/** Filter by margin account UUID */
|
|
136
|
-
|
|
136
|
+
marginAccountId?: string;
|
|
137
137
|
/** Page number for pagination (default: 1) */
|
|
138
138
|
page?: number;
|
|
139
139
|
/** Number of orders per page (default: 10, max: 100) */
|
|
140
|
-
|
|
140
|
+
pageSize?: number;
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
143
|
* Response from getting paginated orders
|
|
@@ -155,9 +155,9 @@ export interface GetPaginatedOrdersResponse {
|
|
|
155
155
|
/** Current page number */
|
|
156
156
|
page: number;
|
|
157
157
|
/** Number of orders per page */
|
|
158
|
-
|
|
158
|
+
pageSize: number;
|
|
159
159
|
/** Total number of pages */
|
|
160
|
-
|
|
160
|
+
totalPages: number;
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
163
|
* Response from getting a single order by ID
|
|
@@ -182,9 +182,9 @@ export interface BatchCancelError {
|
|
|
182
182
|
*/
|
|
183
183
|
export interface BatchCancelResult {
|
|
184
184
|
/** Order identifier */
|
|
185
|
-
|
|
185
|
+
orderId: string;
|
|
186
186
|
/** Timestamp when the order was canceled (ISO 8601 format) */
|
|
187
|
-
|
|
187
|
+
cancelledAt?: string;
|
|
188
188
|
/** Error details if the cancellation failed */
|
|
189
189
|
error?: BatchCancelError;
|
|
190
190
|
}
|
|
@@ -193,11 +193,11 @@ export interface BatchCancelResult {
|
|
|
193
193
|
*/
|
|
194
194
|
export interface BatchCancelOrdersResponse {
|
|
195
195
|
/** Total number of orders requested to cancel */
|
|
196
|
-
|
|
196
|
+
totalRequested: number;
|
|
197
197
|
/** Total number of orders successfully canceled */
|
|
198
|
-
|
|
198
|
+
totalCancelled: number;
|
|
199
199
|
/** Total number of orders that failed to cancel */
|
|
200
|
-
|
|
200
|
+
totalFailed: number;
|
|
201
201
|
/** Individual results for each order */
|
|
202
202
|
results: BatchCancelResult[];
|
|
203
203
|
}
|
|
@@ -215,9 +215,9 @@ export interface BatchError {
|
|
|
215
215
|
*/
|
|
216
216
|
export interface BatchCreateResult {
|
|
217
217
|
/** Order identifier (empty string if creation failed before ID assignment) */
|
|
218
|
-
|
|
218
|
+
orderId: string;
|
|
219
219
|
/** Match result information if the order was processed */
|
|
220
|
-
|
|
220
|
+
matchResult?: MatchResult;
|
|
221
221
|
/** Error details if the creation failed */
|
|
222
222
|
error?: BatchError;
|
|
223
223
|
}
|
|
@@ -226,11 +226,11 @@ export interface BatchCreateResult {
|
|
|
226
226
|
*/
|
|
227
227
|
export interface BatchCreateOrdersResponse {
|
|
228
228
|
/** Total number of orders requested to create */
|
|
229
|
-
|
|
229
|
+
totalRequested: number;
|
|
230
230
|
/** Total number of orders successfully created */
|
|
231
|
-
|
|
231
|
+
totalSucceeded: number;
|
|
232
232
|
/** Total number of orders that failed to create */
|
|
233
|
-
|
|
233
|
+
totalFailed: number;
|
|
234
234
|
/** Individual results for each order */
|
|
235
235
|
results: BatchCreateResult[];
|
|
236
236
|
}
|
|
@@ -239,13 +239,13 @@ export interface BatchCreateOrdersResponse {
|
|
|
239
239
|
*/
|
|
240
240
|
export interface BatchReplaceResult {
|
|
241
241
|
/** Original order identifier */
|
|
242
|
-
|
|
242
|
+
originalOrderId: string;
|
|
243
243
|
/** New order identifier (if successful) */
|
|
244
|
-
|
|
244
|
+
newOrderId?: string;
|
|
245
245
|
/** Fields that were updated (if successful) */
|
|
246
|
-
|
|
246
|
+
updatedFields?: UpdatedFields;
|
|
247
247
|
/** Match result information if the new order was processed */
|
|
248
|
-
|
|
248
|
+
matchResult?: MatchResult;
|
|
249
249
|
/** Error details if the replacement failed */
|
|
250
250
|
error?: BatchError;
|
|
251
251
|
}
|
|
@@ -254,11 +254,11 @@ export interface BatchReplaceResult {
|
|
|
254
254
|
*/
|
|
255
255
|
export interface BatchReplaceOrdersResponse {
|
|
256
256
|
/** Total number of orders requested to replace */
|
|
257
|
-
|
|
257
|
+
totalRequested: number;
|
|
258
258
|
/** Total number of orders successfully replaced */
|
|
259
|
-
|
|
259
|
+
totalSucceeded: number;
|
|
260
260
|
/** Total number of orders that failed to replace */
|
|
261
|
-
|
|
261
|
+
totalFailed: number;
|
|
262
262
|
/** Individual results for each order */
|
|
263
263
|
results: BatchReplaceResult[];
|
|
264
264
|
}
|
|
@@ -315,49 +315,49 @@ export interface BatchReplaceOrderParams {
|
|
|
315
315
|
useMasterBalance?: boolean;
|
|
316
316
|
}
|
|
317
317
|
export interface CancelConditionalOrderResponse {
|
|
318
|
-
|
|
318
|
+
conditionalOrderId: string;
|
|
319
319
|
status: "SUCCESS" | "FAILED";
|
|
320
320
|
message: string;
|
|
321
321
|
}
|
|
322
322
|
export interface ListConditionalOrdersParams {
|
|
323
|
-
|
|
324
|
-
|
|
323
|
+
marginAccountId?: string;
|
|
324
|
+
tradingPairId?: string;
|
|
325
325
|
state?: ConditionalOrderState;
|
|
326
326
|
page?: number;
|
|
327
|
-
|
|
327
|
+
pageSize?: number;
|
|
328
328
|
}
|
|
329
329
|
export interface ConditionalOrder {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
330
|
+
conditionalOrderId: string;
|
|
331
|
+
tradingPairId: string;
|
|
332
|
+
marginAccountId: string;
|
|
333
|
+
positionId?: string;
|
|
334
|
+
parentOrderId?: string;
|
|
335
|
+
associationType?: "POSITION" | "PARENT_ORDER";
|
|
336
|
+
linkedGroupId?: string;
|
|
337
|
+
conditionType: ConditionalOrderConditionType;
|
|
338
|
+
triggerSource: ConditionalOrderTriggerSource;
|
|
339
|
+
triggerPrice: string;
|
|
340
340
|
side: OrderSide;
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
341
|
+
positionSide: PositionSide;
|
|
342
|
+
orderType: OrderType;
|
|
343
|
+
limitPrice?: string;
|
|
344
344
|
quantity?: string;
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
345
|
+
slippageToleranceBps?: number;
|
|
346
|
+
reduceOnly: boolean;
|
|
347
|
+
timeInForce?: TimeInForce;
|
|
348
348
|
state: ConditionalOrderState;
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
349
|
+
triggeredOrderId?: string;
|
|
350
|
+
triggeredAt?: string;
|
|
351
|
+
activatedAt?: string;
|
|
352
|
+
cancelledAt?: string;
|
|
353
|
+
expiresAt?: string;
|
|
354
|
+
failureReason?: string;
|
|
355
|
+
createdAt: string;
|
|
356
|
+
updatedAt: string;
|
|
357
357
|
}
|
|
358
358
|
export interface ListConditionalOrdersResponse {
|
|
359
359
|
orders: ConditionalOrder[];
|
|
360
360
|
total: number;
|
|
361
361
|
page: number;
|
|
362
|
-
|
|
362
|
+
pageSize: number;
|
|
363
363
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
export declare const ListMarginAccountsSchema: z.ZodObject<{
|
|
6
6
|
page: z.ZodOptional<z.ZodNumber>;
|
|
7
|
-
|
|
7
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
state: z.ZodOptional<z.ZodString>;
|
|
9
9
|
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
10
10
|
}, z.core.$strip>;
|
|
@@ -49,14 +49,14 @@ export declare const TransferCollateralFromParentMarginAccountSchema: z.ZodObjec
|
|
|
49
49
|
}, z.core.$strip>;
|
|
50
50
|
export declare const GetMarginAccountMovementsSchema: z.ZodObject<{
|
|
51
51
|
page: z.ZodOptional<z.ZodNumber>;
|
|
52
|
-
|
|
52
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
53
53
|
marginAccountId: z.ZodUUID;
|
|
54
|
-
|
|
54
|
+
movementType: z.ZodOptional<z.ZodString>;
|
|
55
55
|
}, z.core.$strip>;
|
|
56
56
|
export declare const GetParentMarginAccountMovementsSchema: z.ZodOptional<z.ZodObject<{
|
|
57
57
|
page: z.ZodOptional<z.ZodNumber>;
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
movementType: z.ZodOptional<z.ZodString>;
|
|
60
60
|
}, z.core.$strip>>;
|
|
61
61
|
export declare const SimulateOrderRiskSchema: z.ZodObject<{
|
|
62
62
|
marginAccountId: z.ZodUUID;
|
|
@@ -5,7 +5,7 @@ import { z } from "zod";
|
|
|
5
5
|
import { OrderSideSchema, OrderTypeSchema, PositionSideSchema, PositiveDecimalStringSchema, UUIDSchema } from "./trading";
|
|
6
6
|
const PaginationSchema = z.object({
|
|
7
7
|
page: z.number().int().min(1, "Page must be at least 1").optional(),
|
|
8
|
-
|
|
8
|
+
pageSize: z.number().int().min(1, "Page size must be at least 1").max(100, "Page size cannot exceed 100").optional(),
|
|
9
9
|
});
|
|
10
10
|
export const ListMarginAccountsSchema = PaginationSchema.extend({
|
|
11
11
|
state: z.string().trim().min(1, "State cannot be empty").optional(),
|
|
@@ -54,10 +54,10 @@ export const TransferCollateralFromParentMarginAccountSchema = z.object({
|
|
|
54
54
|
});
|
|
55
55
|
export const GetMarginAccountMovementsSchema = PaginationSchema.extend({
|
|
56
56
|
marginAccountId: UUIDSchema,
|
|
57
|
-
|
|
57
|
+
movementType: z.string().trim().min(1, "Movement type cannot be empty").optional(),
|
|
58
58
|
});
|
|
59
59
|
export const GetParentMarginAccountMovementsSchema = PaginationSchema.extend({
|
|
60
|
-
|
|
60
|
+
movementType: z.string().trim().min(1, "Movement type cannot be empty").optional(),
|
|
61
61
|
}).optional();
|
|
62
62
|
const BaseSimulateOrderRiskRequestSchema = z.object({
|
|
63
63
|
tradingPairId: UUIDSchema,
|
|
@@ -203,7 +203,7 @@ export declare const GetTradingPairSchema: z.ZodObject<{
|
|
|
203
203
|
*/
|
|
204
204
|
export declare const SearchTradingPairsSchema: z.ZodObject<{
|
|
205
205
|
query: z.ZodOptional<z.ZodString>;
|
|
206
|
-
|
|
206
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
207
207
|
page: z.ZodOptional<z.ZodNumber>;
|
|
208
208
|
}, z.core.$strip>;
|
|
209
209
|
/**
|
|
@@ -214,7 +214,7 @@ export const GetTradingPairSchema = z.object({
|
|
|
214
214
|
*/
|
|
215
215
|
export const SearchTradingPairsSchema = z.object({
|
|
216
216
|
query: z.string().min(1, "Search query cannot be empty").optional(),
|
|
217
|
-
|
|
217
|
+
pageSize: z.number().int().min(1).max(100).optional(),
|
|
218
218
|
page: z.number().int().min(1).optional(),
|
|
219
219
|
});
|
|
220
220
|
/**
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
export declare const ListPositionsSchema: z.ZodObject<{
|
|
6
6
|
page: z.ZodOptional<z.ZodNumber>;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
marginAccountId: z.ZodOptional<z.ZodUUID>;
|
|
9
|
+
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
10
10
|
status: z.ZodOptional<z.ZodEnum<{
|
|
11
11
|
OPEN: "OPEN";
|
|
12
12
|
CLOSED: "CLOSED";
|
|
@@ -86,8 +86,8 @@ export declare const AttachPositionTpSlSchema: z.ZodObject<{
|
|
|
86
86
|
}, z.core.$strip>;
|
|
87
87
|
export declare const ListPositionHistorySchema: z.ZodObject<{
|
|
88
88
|
page: z.ZodOptional<z.ZodNumber>;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
positionId: z.ZodOptional<z.ZodUUID>;
|
|
91
|
+
marginAccountId: z.ZodOptional<z.ZodUUID>;
|
|
92
|
+
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
93
93
|
}, z.core.$strip>;
|
|
@@ -5,7 +5,7 @@ import { z } from "zod";
|
|
|
5
5
|
import { ConditionalTimeInForceSchema, ISO8601DateSchema, OrderTypeSchema, PositiveDecimalStringSchema, SlippageToleranceBpsSchema, UUIDSchema, } from "./trading";
|
|
6
6
|
const PaginationSchema = z.object({
|
|
7
7
|
page: z.number().int().min(1, "Page must be at least 1").optional(),
|
|
8
|
-
|
|
8
|
+
pageSize: z.number().int().min(1, "Page size must be at least 1").max(100, "Page size cannot exceed 100").optional(),
|
|
9
9
|
});
|
|
10
10
|
const PositionStatusSchema = z.enum(["OPEN", "CLOSED", "LIQUIDATING"], {
|
|
11
11
|
message: 'Position status must be "OPEN", "CLOSED", or "LIQUIDATING"',
|
|
@@ -17,8 +17,8 @@ const PositionIdSchema = z.object({
|
|
|
17
17
|
positionId: UUIDSchema,
|
|
18
18
|
});
|
|
19
19
|
export const ListPositionsSchema = PaginationSchema.extend({
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
marginAccountId: UUIDSchema.optional(),
|
|
21
|
+
tradingPairId: UUIDSchema.optional(),
|
|
22
22
|
status: PositionStatusSchema.optional(),
|
|
23
23
|
});
|
|
24
24
|
export const GetPositionSchema = PositionIdSchema;
|
|
@@ -91,7 +91,7 @@ export const AttachPositionTpSlSchema = PositionIdSchema.extend({
|
|
|
91
91
|
}),
|
|
92
92
|
});
|
|
93
93
|
export const ListPositionHistorySchema = PaginationSchema.extend({
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
positionId: UUIDSchema.optional(),
|
|
95
|
+
marginAccountId: UUIDSchema.optional(),
|
|
96
|
+
tradingPairId: UUIDSchema.optional(),
|
|
97
97
|
});
|
|
@@ -36,15 +36,15 @@ export declare const TransactionTypeSchema: z.ZodEnum<{
|
|
|
36
36
|
*/
|
|
37
37
|
export declare const GetUserMovementsSchema: z.ZodObject<{
|
|
38
38
|
page: z.ZodOptional<z.ZodNumber>;
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
entryType: z.ZodOptional<z.ZodEnum<{
|
|
41
41
|
CREDIT: "CREDIT";
|
|
42
42
|
DEBIT: "DEBIT";
|
|
43
43
|
LOCK: "LOCK";
|
|
44
44
|
UNLOCK: "UNLOCK";
|
|
45
45
|
FEE: "FEE";
|
|
46
46
|
}>>;
|
|
47
|
-
|
|
47
|
+
transactionType: z.ZodOptional<z.ZodEnum<{
|
|
48
48
|
FEE: "FEE";
|
|
49
49
|
DEPOSIT: "DEPOSIT";
|
|
50
50
|
WITHDRAWAL: "WITHDRAWAL";
|
|
@@ -54,7 +54,7 @@ export declare const GetUserMovementsSchema: z.ZodObject<{
|
|
|
54
54
|
INTEREST: "INTEREST";
|
|
55
55
|
REWARD: "REWARD";
|
|
56
56
|
}>>;
|
|
57
|
-
|
|
57
|
+
assetId: z.ZodOptional<z.ZodUUID>;
|
|
58
58
|
}, z.core.$strip>;
|
|
59
59
|
/**
|
|
60
60
|
* Get User Trades validation schema
|
|
@@ -64,13 +64,13 @@ export declare const GetUserMovementsSchema: z.ZodObject<{
|
|
|
64
64
|
*/
|
|
65
65
|
export declare const GetUserTradesSchema: z.ZodObject<{
|
|
66
66
|
page: z.ZodOptional<z.ZodNumber>;
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
69
69
|
}, z.core.$strip>;
|
|
70
70
|
export declare const ListFundingPaymentsSchema: z.ZodObject<{
|
|
71
71
|
page: z.ZodOptional<z.ZodNumber>;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
74
|
+
positionId: z.ZodOptional<z.ZodUUID>;
|
|
75
|
+
marginAccountId: z.ZodOptional<z.ZodUUID>;
|
|
76
76
|
}, z.core.$strip>;
|
|
@@ -26,10 +26,10 @@ export const TransactionTypeSchema = z.enum(["DEPOSIT", "WITHDRAWAL", "TRADE", "
|
|
|
26
26
|
*/
|
|
27
27
|
export const GetUserMovementsSchema = z.object({
|
|
28
28
|
page: z.number().int("Page must be an integer").min(1, "Page must be at least 1").optional(),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
pageSize: 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
|
+
entryType: LedgerEntryTypeSchema.optional(),
|
|
31
|
+
transactionType: TransactionTypeSchema.optional(),
|
|
32
|
+
assetId: UUIDSchema.optional(),
|
|
33
33
|
});
|
|
34
34
|
/**
|
|
35
35
|
* Get User Trades validation schema
|
|
@@ -39,13 +39,13 @@ export const GetUserMovementsSchema = z.object({
|
|
|
39
39
|
*/
|
|
40
40
|
export const GetUserTradesSchema = z.object({
|
|
41
41
|
page: z.number().int("Page must be an integer").min(1, "Page must be at least 1").optional(),
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
pageSize: 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
|
+
tradingPairId: UUIDSchema.optional(),
|
|
44
44
|
});
|
|
45
45
|
export const ListFundingPaymentsSchema = z.object({
|
|
46
46
|
page: z.number().int("Page must be an integer").min(1, "Page must be at least 1").optional(),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
pageSize: 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(),
|
|
48
|
+
tradingPairId: UUIDSchema.optional(),
|
|
49
|
+
positionId: UUIDSchema.optional(),
|
|
50
|
+
marginAccountId: UUIDSchema.optional(),
|
|
51
51
|
});
|
|
@@ -226,9 +226,9 @@ export declare const ReplaceOrderSchema: z.ZodObject<{
|
|
|
226
226
|
* Validates parameters for fetching paginated orders.
|
|
227
227
|
* Matches the getPaginatedOrders method signature which accepts:
|
|
228
228
|
* - status: OrderStatus (optional filter)
|
|
229
|
-
* -
|
|
229
|
+
* - tradingPairId: trading pair UUID (optional filter)
|
|
230
230
|
* - page: number (default: 1)
|
|
231
|
-
* -
|
|
231
|
+
* - pageSize: number (default: 10, max: 100)
|
|
232
232
|
*/
|
|
233
233
|
export declare const GetPaginatedOrdersSchema: z.ZodObject<{
|
|
234
234
|
status: z.ZodOptional<z.ZodEnum<{
|
|
@@ -241,14 +241,14 @@ export declare const GetPaginatedOrdersSchema: z.ZodObject<{
|
|
|
241
241
|
REJECTED: "REJECTED";
|
|
242
242
|
EXPIRED: "EXPIRED";
|
|
243
243
|
}>>;
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
245
|
+
tradingMode: z.ZodOptional<z.ZodEnum<{
|
|
246
246
|
SPOT: "SPOT";
|
|
247
247
|
MARGIN: "MARGIN";
|
|
248
248
|
}>>;
|
|
249
|
-
|
|
249
|
+
marginAccountId: z.ZodOptional<z.ZodUUID>;
|
|
250
250
|
page: z.ZodOptional<z.ZodNumber>;
|
|
251
|
-
|
|
251
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
252
252
|
}, z.core.$strip>;
|
|
253
253
|
export declare const ConditionalOrderConditionTypeSchema: z.ZodEnum<{
|
|
254
254
|
STOP_LOSS: "STOP_LOSS";
|
|
@@ -274,8 +274,8 @@ export declare const CancelConditionalOrderSchema: z.ZodObject<{
|
|
|
274
274
|
conditionalOrderId: z.ZodUUID;
|
|
275
275
|
}, z.core.$strip>;
|
|
276
276
|
export declare const ListConditionalOrdersSchema: z.ZodObject<{
|
|
277
|
-
|
|
278
|
-
|
|
277
|
+
marginAccountId: z.ZodOptional<z.ZodUUID>;
|
|
278
|
+
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
279
279
|
state: z.ZodOptional<z.ZodEnum<{
|
|
280
280
|
CANCELLED: "CANCELLED";
|
|
281
281
|
EXPIRED: "EXPIRED";
|
|
@@ -286,7 +286,7 @@ export declare const ListConditionalOrdersSchema: z.ZodObject<{
|
|
|
286
286
|
FAILED: "FAILED";
|
|
287
287
|
}>>;
|
|
288
288
|
page: z.ZodOptional<z.ZodNumber>;
|
|
289
|
-
|
|
289
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
290
290
|
}, z.core.$strip>;
|
|
291
291
|
/**
|
|
292
292
|
* Single batch create order item validation schema
|