@0xmonaco/types 0.8.5 → 0.8.7-develop.0f12336
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/README.md +5 -3
- package/dist/api/index.d.ts +13 -5
- package/dist/api/index.js +1 -1
- package/dist/applications/index.d.ts +47 -5
- package/dist/applications/index.js +2 -1
- package/dist/applications/requests.d.ts +78 -0
- package/dist/applications/requests.js +7 -0
- package/dist/applications/responses.d.ts +213 -2
- package/dist/applications/responses.js +3 -1
- package/dist/auth/index.d.ts +29 -31
- package/dist/auth/index.js +2 -2
- package/dist/auth/responses.d.ts +25 -21
- package/dist/contracts/balances.d.ts +1 -1
- package/dist/delegated-agents/index.d.ts +35 -18
- package/dist/faucet/index.d.ts +54 -0
- package/dist/faucet/index.js +10 -0
- 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/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/margin-accounts/index.d.ts +91 -55
- package/dist/market/index.d.ts +214 -94
- package/dist/positions/index.d.ts +67 -44
- package/dist/profile/index.d.ts +157 -67
- package/dist/sdk/index.d.ts +43 -5
- package/dist/sub-accounts/index.d.ts +146 -0
- package/dist/sub-accounts/index.js +9 -0
- package/dist/trading/index.d.ts +8 -8
- package/dist/trading/orders.d.ts +20 -20
- package/dist/trading/responses.d.ts +82 -101
- package/dist/validation/margin-accounts.d.ts +53 -13
- package/dist/validation/margin-accounts.js +38 -14
- package/dist/validation/market.d.ts +1 -1
- package/dist/validation/market.js +1 -1
- package/dist/validation/positions.d.ts +11 -7
- package/dist/validation/positions.js +10 -6
- package/dist/validation/profile.d.ts +13 -6
- package/dist/validation/profile.js +13 -6
- package/dist/validation/trading.d.ts +17 -42
- package/dist/validation/trading.js +51 -42
- package/dist/validation/vault.d.ts +8 -0
- package/dist/validation/vault.js +3 -0
- package/dist/vault/index.d.ts +46 -13
- package/dist/vault/responses.d.ts +50 -12
- package/dist/websocket/events/balance-events.d.ts +2 -1
- package/dist/websocket/events/movement-events.d.ts +2 -1
- package/dist/whitelist/index.d.ts +44 -0
- package/dist/whitelist/index.js +10 -0
- package/dist/wire/assert.d.ts +54 -0
- package/dist/wire/assert.js +0 -0
- package/dist/wire/audit.d.ts +47 -0
- package/dist/wire/audit.js +43 -0
- package/dist/wire/coverage.d.ts +1 -0
- package/dist/wire/coverage.js +0 -0
- package/dist/wire/index.d.ts +21 -0
- package/dist/wire/index.js +2 -0
- package/dist/wire/operations.d.ts +15 -0
- package/dist/wire/operations.js +101 -0
- package/dist/wire/schema.d.ts +8930 -0
- package/dist/wire/schema.js +4 -0
- package/dist/withdrawals/index.d.ts +114 -0
- package/dist/withdrawals/index.js +0 -0
- package/package.json +6 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sub-Accounts Types
|
|
3
|
+
*
|
|
4
|
+
* Types for managing sub-accounts and their per-asset spending limits. All
|
|
5
|
+
* endpoints are session-authenticated; the limit mutations additionally
|
|
6
|
+
* require the caller to be a master account with the `ManageSubAccounts`
|
|
7
|
+
* permission (enforced server-side). Wire shapes are snake_case; optional
|
|
8
|
+
* fields are `null` rather than omitted.
|
|
9
|
+
*/
|
package/dist/trading/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { BaseAPI } from "../api/index";
|
|
7
7
|
import type { OrderSide, PositionSide, TimeInForce, TradingMode } from "./orders";
|
|
8
|
-
import type { BatchCancelOrdersResponse, BatchCreateOrderParams, BatchCreateOrdersResponse, BatchReplaceOrderParams, BatchReplaceOrdersResponse, CancelConditionalOrderResponse, CancelOrderResponse,
|
|
8
|
+
import type { BatchCancelOrdersResponse, BatchCreateOrderParams, BatchCreateOrdersResponse, BatchReplaceOrderParams, BatchReplaceOrdersResponse, CancelConditionalOrderResponse, CancelOrderResponse, CreateOrderResponse, GetOrderResponse, GetPaginatedOrdersParams, GetPaginatedOrdersResponse, ListConditionalOrdersParams, ListConditionalOrdersResponse, ParentTpSlLegParams, ReplaceOrderResponse } from "./responses";
|
|
9
9
|
/**
|
|
10
10
|
* Trading API interface.
|
|
11
11
|
* Provides methods for placing and managing orders.
|
|
@@ -29,6 +29,8 @@ export interface TradingAPI extends BaseAPI {
|
|
|
29
29
|
expirationDate?: string;
|
|
30
30
|
timeInForce?: TimeInForce;
|
|
31
31
|
marginAccountId?: string;
|
|
32
|
+
riskBucketId?: string;
|
|
33
|
+
riskBucketCollateral?: string;
|
|
32
34
|
strategyKey?: string;
|
|
33
35
|
positionSide?: PositionSide;
|
|
34
36
|
leverage?: string;
|
|
@@ -50,6 +52,8 @@ export interface TradingAPI extends BaseAPI {
|
|
|
50
52
|
tradingMode?: TradingMode;
|
|
51
53
|
slippageTolerance?: number;
|
|
52
54
|
marginAccountId?: string;
|
|
55
|
+
riskBucketId?: string;
|
|
56
|
+
riskBucketCollateral?: string;
|
|
53
57
|
strategyKey?: string;
|
|
54
58
|
positionSide?: PositionSide;
|
|
55
59
|
leverage?: string;
|
|
@@ -63,10 +67,6 @@ export interface TradingAPI extends BaseAPI {
|
|
|
63
67
|
* @returns Promise resolving to the cancellation result
|
|
64
68
|
*/
|
|
65
69
|
cancelOrder(orderId: string): Promise<CancelOrderResponse>;
|
|
66
|
-
/**
|
|
67
|
-
* Creates a standalone conditional TP/SL order.
|
|
68
|
-
*/
|
|
69
|
-
createConditionalOrder(params: CreateConditionalOrderParams): Promise<CreateConditionalOrderResponse>;
|
|
70
70
|
/**
|
|
71
71
|
* Cancels an active conditional TP/SL order.
|
|
72
72
|
*/
|
|
@@ -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>;
|
|
@@ -135,4 +135,4 @@ export interface TradingAPI extends BaseAPI {
|
|
|
135
135
|
}
|
|
136
136
|
export type { ConditionalOrderConditionType, ConditionalOrderState, ConditionalOrderTriggerSource, Order, OrderRole, OrderSide, OrderStatus, OrderType, PositionSide, TimeInForce, TradingMode, } from "./orders";
|
|
137
137
|
export { ORDER_STATUS_VALUES } from "./orders";
|
|
138
|
-
export type { BatchCancelError, BatchCancelOrdersResponse, BatchCancelResult, BatchCreateOrderParams, BatchCreateOrdersResponse, BatchCreateResult, BatchError, BatchReplaceOrderParams, BatchReplaceOrdersResponse, BatchReplaceResult, CancelConditionalOrderResponse, CancelOrderResponse, ConditionalOrder,
|
|
138
|
+
export type { BatchCancelError, BatchCancelOrdersResponse, BatchCancelResult, BatchCreateOrderParams, BatchCreateOrdersResponse, BatchCreateResult, BatchError, BatchReplaceOrderParams, BatchReplaceOrdersResponse, BatchReplaceResult, CancelConditionalOrderResponse, CancelOrderResponse, ConditionalOrder, CreateOrderResponse, GetOrderResponse, GetPaginatedOrdersParams, GetPaginatedOrdersResponse, ListConditionalOrdersParams, ListConditionalOrdersResponse, MatchResult, ParentTpSlLegParams, ReplaceOrderResponse, UpdatedFields, } from "./responses";
|
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,30 +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
|
-
|
|
77
|
-
/** Resolved
|
|
78
|
-
|
|
76
|
+
marginAccountId?: string;
|
|
77
|
+
/** Resolved isolated risk bucket ID for risk-bucket-scoped margin orders */
|
|
78
|
+
riskBucketId?: string;
|
|
79
|
+
/** Client strategy key carried for compatibility */
|
|
80
|
+
strategyKey?: string;
|
|
79
81
|
/** Delegated agent ID when submitted through a delegated session */
|
|
80
|
-
|
|
82
|
+
delegationId?: string;
|
|
81
83
|
/** Conditional order ID for an attached take-profit leg */
|
|
82
|
-
|
|
84
|
+
takeProfitOrderId?: string;
|
|
83
85
|
/** Conditional order ID for an attached stop-loss leg */
|
|
84
|
-
|
|
86
|
+
stopLossOrderId?: string;
|
|
85
87
|
}
|
|
86
88
|
/**
|
|
87
89
|
* Response from cancelling an order.
|
|
88
90
|
*/
|
|
89
91
|
export interface CancelOrderResponse {
|
|
90
92
|
/** Order identifier */
|
|
91
|
-
|
|
93
|
+
orderId: string;
|
|
92
94
|
/** Cancellation status */
|
|
93
95
|
status: "SUCCESS" | "FAILED";
|
|
94
96
|
/** Optional response message */
|
|
@@ -99,17 +101,17 @@ export interface CancelOrderResponse {
|
|
|
99
101
|
*/
|
|
100
102
|
export interface ReplaceOrderResponse {
|
|
101
103
|
/** New order identifier (after replacement) */
|
|
102
|
-
|
|
104
|
+
orderId: string;
|
|
103
105
|
/** Replace operation status */
|
|
104
106
|
status: "SUCCESS" | "FAILED";
|
|
105
107
|
/** Operation message */
|
|
106
108
|
message: string;
|
|
107
109
|
/** Fields that were updated */
|
|
108
|
-
|
|
110
|
+
updatedFields: UpdatedFields;
|
|
109
111
|
/** Original order identifier that was replaced */
|
|
110
|
-
|
|
112
|
+
originalOrderId?: string;
|
|
111
113
|
/** Match result information for the new order */
|
|
112
|
-
|
|
114
|
+
matchResult?: MatchResult;
|
|
113
115
|
}
|
|
114
116
|
/**
|
|
115
117
|
* Fields that were updated in the replace operation
|
|
@@ -127,21 +129,21 @@ export interface GetPaginatedOrdersParams {
|
|
|
127
129
|
/** Filter by order status */
|
|
128
130
|
status?: OrderStatus;
|
|
129
131
|
/** Filter by trading pair UUID */
|
|
130
|
-
|
|
132
|
+
tradingPairId?: string;
|
|
131
133
|
/** Filter by trading mode */
|
|
132
|
-
|
|
134
|
+
tradingMode?: TradingMode;
|
|
133
135
|
/** Filter by margin account UUID */
|
|
134
|
-
|
|
136
|
+
marginAccountId?: string;
|
|
135
137
|
/** Page number for pagination (default: 1) */
|
|
136
138
|
page?: number;
|
|
137
139
|
/** Number of orders per page (default: 10, max: 100) */
|
|
138
|
-
|
|
140
|
+
pageSize?: number;
|
|
139
141
|
}
|
|
140
142
|
/**
|
|
141
143
|
* Response from getting paginated orders
|
|
142
144
|
*/
|
|
143
145
|
export interface GetPaginatedOrdersResponse {
|
|
144
|
-
/** Latest orders from
|
|
146
|
+
/** Latest orders from the live engine cache (real-time, instant updates).
|
|
145
147
|
* These are the most recently created/updated orders that may not yet be in PostgreSQL.
|
|
146
148
|
* Only populated on page 1.
|
|
147
149
|
*/
|
|
@@ -153,9 +155,9 @@ export interface GetPaginatedOrdersResponse {
|
|
|
153
155
|
/** Current page number */
|
|
154
156
|
page: number;
|
|
155
157
|
/** Number of orders per page */
|
|
156
|
-
|
|
158
|
+
pageSize: number;
|
|
157
159
|
/** Total number of pages */
|
|
158
|
-
|
|
160
|
+
totalPages: number;
|
|
159
161
|
}
|
|
160
162
|
/**
|
|
161
163
|
* Response from getting a single order by ID
|
|
@@ -180,9 +182,9 @@ export interface BatchCancelError {
|
|
|
180
182
|
*/
|
|
181
183
|
export interface BatchCancelResult {
|
|
182
184
|
/** Order identifier */
|
|
183
|
-
|
|
185
|
+
orderId: string;
|
|
184
186
|
/** Timestamp when the order was canceled (ISO 8601 format) */
|
|
185
|
-
|
|
187
|
+
cancelledAt?: string;
|
|
186
188
|
/** Error details if the cancellation failed */
|
|
187
189
|
error?: BatchCancelError;
|
|
188
190
|
}
|
|
@@ -191,11 +193,11 @@ export interface BatchCancelResult {
|
|
|
191
193
|
*/
|
|
192
194
|
export interface BatchCancelOrdersResponse {
|
|
193
195
|
/** Total number of orders requested to cancel */
|
|
194
|
-
|
|
196
|
+
totalRequested: number;
|
|
195
197
|
/** Total number of orders successfully canceled */
|
|
196
|
-
|
|
198
|
+
totalCancelled: number;
|
|
197
199
|
/** Total number of orders that failed to cancel */
|
|
198
|
-
|
|
200
|
+
totalFailed: number;
|
|
199
201
|
/** Individual results for each order */
|
|
200
202
|
results: BatchCancelResult[];
|
|
201
203
|
}
|
|
@@ -213,9 +215,9 @@ export interface BatchError {
|
|
|
213
215
|
*/
|
|
214
216
|
export interface BatchCreateResult {
|
|
215
217
|
/** Order identifier (empty string if creation failed before ID assignment) */
|
|
216
|
-
|
|
218
|
+
orderId: string;
|
|
217
219
|
/** Match result information if the order was processed */
|
|
218
|
-
|
|
220
|
+
matchResult?: MatchResult;
|
|
219
221
|
/** Error details if the creation failed */
|
|
220
222
|
error?: BatchError;
|
|
221
223
|
}
|
|
@@ -224,11 +226,11 @@ export interface BatchCreateResult {
|
|
|
224
226
|
*/
|
|
225
227
|
export interface BatchCreateOrdersResponse {
|
|
226
228
|
/** Total number of orders requested to create */
|
|
227
|
-
|
|
229
|
+
totalRequested: number;
|
|
228
230
|
/** Total number of orders successfully created */
|
|
229
|
-
|
|
231
|
+
totalSucceeded: number;
|
|
230
232
|
/** Total number of orders that failed to create */
|
|
231
|
-
|
|
233
|
+
totalFailed: number;
|
|
232
234
|
/** Individual results for each order */
|
|
233
235
|
results: BatchCreateResult[];
|
|
234
236
|
}
|
|
@@ -237,13 +239,13 @@ export interface BatchCreateOrdersResponse {
|
|
|
237
239
|
*/
|
|
238
240
|
export interface BatchReplaceResult {
|
|
239
241
|
/** Original order identifier */
|
|
240
|
-
|
|
242
|
+
originalOrderId: string;
|
|
241
243
|
/** New order identifier (if successful) */
|
|
242
|
-
|
|
244
|
+
newOrderId?: string;
|
|
243
245
|
/** Fields that were updated (if successful) */
|
|
244
|
-
|
|
246
|
+
updatedFields?: UpdatedFields;
|
|
245
247
|
/** Match result information if the new order was processed */
|
|
246
|
-
|
|
248
|
+
matchResult?: MatchResult;
|
|
247
249
|
/** Error details if the replacement failed */
|
|
248
250
|
error?: BatchError;
|
|
249
251
|
}
|
|
@@ -252,11 +254,11 @@ export interface BatchReplaceResult {
|
|
|
252
254
|
*/
|
|
253
255
|
export interface BatchReplaceOrdersResponse {
|
|
254
256
|
/** Total number of orders requested to replace */
|
|
255
|
-
|
|
257
|
+
totalRequested: number;
|
|
256
258
|
/** Total number of orders successfully replaced */
|
|
257
|
-
|
|
259
|
+
totalSucceeded: number;
|
|
258
260
|
/** Total number of orders that failed to replace */
|
|
259
|
-
|
|
261
|
+
totalFailed: number;
|
|
260
262
|
/** Individual results for each order */
|
|
261
263
|
results: BatchReplaceResult[];
|
|
262
264
|
}
|
|
@@ -286,7 +288,11 @@ export interface BatchCreateOrderParams {
|
|
|
286
288
|
timeInForce?: Extract<TimeInForce, "GTC" | "IOC" | "FOK">;
|
|
287
289
|
/** Margin account UUID for margin/perp orders */
|
|
288
290
|
marginAccountId?: string;
|
|
289
|
-
/**
|
|
291
|
+
/** Existing isolated risk bucket UUID for risk-bucket-scoped margin orders */
|
|
292
|
+
riskBucketId?: string;
|
|
293
|
+
/** Collateral to allocate into a new isolated risk bucket */
|
|
294
|
+
riskBucketCollateral?: string;
|
|
295
|
+
/** Client strategy key carried for compatibility */
|
|
290
296
|
strategyKey?: string;
|
|
291
297
|
/** Position side for margin/perp orders */
|
|
292
298
|
positionSide?: PositionSide;
|
|
@@ -308,75 +314,50 @@ export interface BatchReplaceOrderParams {
|
|
|
308
314
|
/** For sub-accounts: use master's balance (optional) */
|
|
309
315
|
useMasterBalance?: boolean;
|
|
310
316
|
}
|
|
311
|
-
/**
|
|
312
|
-
* Parameters for creating a standalone conditional TP/SL order.
|
|
313
|
-
*/
|
|
314
|
-
export interface CreateConditionalOrderParams {
|
|
315
|
-
tradingPairId: string;
|
|
316
|
-
marginAccountId: string;
|
|
317
|
-
conditionType: ConditionalOrderConditionType;
|
|
318
|
-
triggerPrice: string;
|
|
319
|
-
triggerSource?: ConditionalOrderTriggerSource;
|
|
320
|
-
side: OrderSide;
|
|
321
|
-
positionSide: Exclude<PositionSide, "NONE">;
|
|
322
|
-
orderType: OrderType;
|
|
323
|
-
limitPrice?: string;
|
|
324
|
-
quantity?: string;
|
|
325
|
-
reduceOnly?: boolean;
|
|
326
|
-
timeInForce?: Extract<TimeInForce, "GTC" | "IOC">;
|
|
327
|
-
slippageToleranceBps?: number;
|
|
328
|
-
expiresAt?: string;
|
|
329
|
-
}
|
|
330
|
-
export interface CreateConditionalOrderResponse {
|
|
331
|
-
conditional_order_id: string;
|
|
332
|
-
status: "SUCCESS" | "FAILED";
|
|
333
|
-
message: string;
|
|
334
|
-
state: ConditionalOrderState;
|
|
335
|
-
}
|
|
336
317
|
export interface CancelConditionalOrderResponse {
|
|
337
|
-
|
|
318
|
+
conditionalOrderId: string;
|
|
338
319
|
status: "SUCCESS" | "FAILED";
|
|
339
320
|
message: string;
|
|
340
321
|
}
|
|
341
322
|
export interface ListConditionalOrdersParams {
|
|
342
|
-
|
|
343
|
-
|
|
323
|
+
marginAccountId?: string;
|
|
324
|
+
tradingPairId?: string;
|
|
344
325
|
state?: ConditionalOrderState;
|
|
345
326
|
page?: number;
|
|
346
|
-
|
|
327
|
+
pageSize?: number;
|
|
347
328
|
}
|
|
348
329
|
export interface ConditionalOrder {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
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;
|
|
359
340
|
side: OrderSide;
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
341
|
+
positionSide: PositionSide;
|
|
342
|
+
orderType: OrderType;
|
|
343
|
+
limitPrice?: string;
|
|
363
344
|
quantity?: string;
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
345
|
+
slippageToleranceBps?: number;
|
|
346
|
+
reduceOnly: boolean;
|
|
347
|
+
timeInForce?: TimeInForce;
|
|
367
348
|
state: ConditionalOrderState;
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
349
|
+
triggeredOrderId?: string;
|
|
350
|
+
triggeredAt?: string;
|
|
351
|
+
activatedAt?: string;
|
|
352
|
+
cancelledAt?: string;
|
|
353
|
+
expiresAt?: string;
|
|
354
|
+
failureReason?: string;
|
|
355
|
+
createdAt: string;
|
|
356
|
+
updatedAt: string;
|
|
376
357
|
}
|
|
377
358
|
export interface ListConditionalOrdersResponse {
|
|
378
359
|
orders: ConditionalOrder[];
|
|
379
360
|
total: number;
|
|
380
361
|
page: number;
|
|
381
|
-
|
|
362
|
+
pageSize: number;
|
|
382
363
|
}
|
|
@@ -4,17 +4,17 @@
|
|
|
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>;
|
|
11
|
-
export declare const CreateMarginAccountSchema: z.ZodOptional<z.ZodObject<{
|
|
12
|
-
label: z.ZodOptional<z.ZodString>;
|
|
13
|
-
collateralAsset: z.ZodOptional<z.ZodString>;
|
|
14
|
-
}, z.core.$strip>>;
|
|
15
11
|
export declare const GetMarginAccountSummarySchema: z.ZodObject<{
|
|
16
12
|
marginAccountId: z.ZodUUID;
|
|
13
|
+
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
17
14
|
}, z.core.$strip>;
|
|
15
|
+
export declare const GetParentMarginAccountSummarySchema: z.ZodOptional<z.ZodObject<{
|
|
16
|
+
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
18
|
export declare const GetAvailableCollateralSchema: z.ZodOptional<z.ZodObject<{
|
|
19
19
|
asset: z.ZodOptional<z.ZodString>;
|
|
20
20
|
}, z.core.$strip>>;
|
|
@@ -23,9 +23,17 @@ export declare const TransferCollateralSchema: z.ZodObject<{
|
|
|
23
23
|
request: z.ZodObject<{
|
|
24
24
|
asset: z.ZodString;
|
|
25
25
|
amount: z.ZodString;
|
|
26
|
+
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
27
|
+
strategyKey: z.ZodOptional<z.ZodString>;
|
|
26
28
|
}, z.core.$strip>;
|
|
27
29
|
}, z.core.$strip>;
|
|
28
|
-
export declare const
|
|
30
|
+
export declare const TransferCollateralToParentMarginAccountSchema: z.ZodObject<{
|
|
31
|
+
request: z.ZodObject<{
|
|
32
|
+
asset: z.ZodString;
|
|
33
|
+
amount: z.ZodString;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export declare const TransferCollateralToRiskBucketSchema: z.ZodObject<{
|
|
29
37
|
request: z.ZodObject<{
|
|
30
38
|
asset: z.ZodString;
|
|
31
39
|
amount: z.ZodString;
|
|
@@ -33,17 +41,27 @@ export declare const TransferCollateralToAutoMarginAccountSchema: z.ZodObject<{
|
|
|
33
41
|
strategyKey: z.ZodOptional<z.ZodString>;
|
|
34
42
|
}, z.core.$strip>;
|
|
35
43
|
}, z.core.$strip>;
|
|
44
|
+
export declare const TransferCollateralFromParentMarginAccountSchema: z.ZodObject<{
|
|
45
|
+
request: z.ZodObject<{
|
|
46
|
+
asset: z.ZodString;
|
|
47
|
+
amount: z.ZodString;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
}, z.core.$strip>;
|
|
36
50
|
export declare const GetMarginAccountMovementsSchema: z.ZodObject<{
|
|
37
51
|
page: z.ZodOptional<z.ZodNumber>;
|
|
38
|
-
|
|
52
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
39
53
|
marginAccountId: z.ZodUUID;
|
|
40
|
-
|
|
54
|
+
movementType: z.ZodOptional<z.ZodString>;
|
|
41
55
|
}, z.core.$strip>;
|
|
56
|
+
export declare const GetParentMarginAccountMovementsSchema: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
movementType: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$strip>>;
|
|
42
61
|
export declare const SimulateOrderRiskSchema: z.ZodObject<{
|
|
43
62
|
marginAccountId: z.ZodUUID;
|
|
44
63
|
request: z.ZodObject<{
|
|
45
64
|
tradingPairId: z.ZodUUID;
|
|
46
|
-
strategyKey: z.ZodOptional<z.ZodString>;
|
|
47
65
|
side: z.ZodEnum<{
|
|
48
66
|
BUY: "BUY";
|
|
49
67
|
SELL: "SELL";
|
|
@@ -61,12 +79,11 @@ export declare const SimulateOrderRiskSchema: z.ZodObject<{
|
|
|
61
79
|
quantity: z.ZodString;
|
|
62
80
|
leverage: z.ZodString;
|
|
63
81
|
reduceOnly: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
-
}, z.core.$
|
|
82
|
+
}, z.core.$strict>;
|
|
65
83
|
}, z.core.$strip>;
|
|
66
|
-
export declare const
|
|
84
|
+
export declare const SimulateParentMarginOrderRiskSchema: z.ZodObject<{
|
|
67
85
|
request: z.ZodObject<{
|
|
68
86
|
tradingPairId: z.ZodUUID;
|
|
69
|
-
strategyKey: z.ZodOptional<z.ZodString>;
|
|
70
87
|
side: z.ZodEnum<{
|
|
71
88
|
BUY: "BUY";
|
|
72
89
|
SELL: "SELL";
|
|
@@ -84,5 +101,28 @@ export declare const SimulateAutoMarginOrderRiskSchema: z.ZodObject<{
|
|
|
84
101
|
quantity: z.ZodString;
|
|
85
102
|
leverage: z.ZodString;
|
|
86
103
|
reduceOnly: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
-
}, z.core.$
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
export declare const SimulateRiskBucketOrderRiskSchema: z.ZodObject<{
|
|
107
|
+
request: z.ZodObject<{
|
|
108
|
+
side: z.ZodEnum<{
|
|
109
|
+
BUY: "BUY";
|
|
110
|
+
SELL: "SELL";
|
|
111
|
+
}>;
|
|
112
|
+
positionSide: z.ZodEnum<{
|
|
113
|
+
LONG: "LONG";
|
|
114
|
+
SHORT: "SHORT";
|
|
115
|
+
NONE: "NONE";
|
|
116
|
+
}>;
|
|
117
|
+
orderType: z.ZodEnum<{
|
|
118
|
+
LIMIT: "LIMIT";
|
|
119
|
+
MARKET: "MARKET";
|
|
120
|
+
}>;
|
|
121
|
+
price: z.ZodOptional<z.ZodString>;
|
|
122
|
+
quantity: z.ZodString;
|
|
123
|
+
leverage: z.ZodString;
|
|
124
|
+
reduceOnly: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
tradingPairId: z.ZodUUID;
|
|
126
|
+
strategyKey: z.ZodOptional<z.ZodString>;
|
|
127
|
+
}, z.core.$strict>;
|
|
88
128
|
}, z.core.$strip>;
|