@0xmonaco/types 0.8.14 → 0.8.16
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 +98 -90
- 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 +941 -821
- package/dist/withdrawals/index.d.ts +58 -5
- package/package.json +2 -2
|
@@ -3,37 +3,37 @@ import type { OrderType, PositionSide, TimeInForce } from "../trading";
|
|
|
3
3
|
export type PositionStatus = "OPEN" | "CLOSED" | "LIQUIDATING";
|
|
4
4
|
export type ClosePositionType = "MARKET" | "LIMIT" | "IOC";
|
|
5
5
|
export interface Position {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
positionId: string;
|
|
7
|
+
marginAccountId: string;
|
|
8
|
+
riskBucketId?: string;
|
|
9
|
+
tradingPairId: string;
|
|
10
10
|
side: PositionSide;
|
|
11
11
|
size: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
entryPrice: string;
|
|
13
|
+
markPrice: string;
|
|
14
|
+
indexPrice?: string;
|
|
15
|
+
unrealizedPnl: string;
|
|
16
|
+
realizedPnl: string;
|
|
17
|
+
isolatedMargin: string;
|
|
18
18
|
leverage?: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
maintenanceMarginRequired: string;
|
|
20
|
+
initialMarginRequired?: string;
|
|
21
|
+
liquidationPrice: string;
|
|
22
22
|
status: PositionStatus;
|
|
23
|
-
|
|
23
|
+
updatedAt: string;
|
|
24
24
|
}
|
|
25
25
|
export interface ListPositionsParams {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
marginAccountId?: string;
|
|
27
|
+
tradingPairId?: string;
|
|
28
28
|
status?: PositionStatus;
|
|
29
29
|
page?: number;
|
|
30
|
-
|
|
30
|
+
pageSize?: number;
|
|
31
31
|
}
|
|
32
32
|
export interface ListPositionsResponse {
|
|
33
33
|
positions: Position[];
|
|
34
34
|
total: number;
|
|
35
35
|
page: number;
|
|
36
|
-
|
|
36
|
+
pageSize: number;
|
|
37
37
|
}
|
|
38
38
|
export type GetPositionResponse = Position;
|
|
39
39
|
export interface ClosePositionRequest {
|
|
@@ -43,10 +43,10 @@ export interface ClosePositionRequest {
|
|
|
43
43
|
quantity?: string;
|
|
44
44
|
}
|
|
45
45
|
export interface ClosePositionResponse {
|
|
46
|
-
|
|
46
|
+
closeOrderId: string;
|
|
47
47
|
status: string;
|
|
48
48
|
message: string;
|
|
49
|
-
|
|
49
|
+
submittedQuantity: string;
|
|
50
50
|
}
|
|
51
51
|
export interface BatchCloseAllRequest {
|
|
52
52
|
tradingPairId?: string;
|
|
@@ -57,28 +57,28 @@ export interface BatchCloseError {
|
|
|
57
57
|
message: string;
|
|
58
58
|
}
|
|
59
59
|
export interface BatchCloseResult {
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
positionId: string;
|
|
61
|
+
closeOrderId?: string;
|
|
62
62
|
status?: string;
|
|
63
|
-
|
|
63
|
+
submittedQuantity?: string;
|
|
64
64
|
error?: BatchCloseError;
|
|
65
65
|
}
|
|
66
66
|
export interface BatchCloseAllResponse {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
totalRequested: number;
|
|
68
|
+
totalClosed: number;
|
|
69
|
+
totalFailed: number;
|
|
70
70
|
results: BatchCloseResult[];
|
|
71
71
|
}
|
|
72
72
|
export interface PositionRisk {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
positionId: string;
|
|
74
|
+
markPrice: string;
|
|
75
|
+
indexPrice?: string;
|
|
76
|
+
unrealizedPnl: string;
|
|
77
|
+
liquidationPrice: string;
|
|
78
|
+
marginRatio: string;
|
|
79
|
+
maintenanceMarginRequired: string;
|
|
80
|
+
initialMarginRequired?: string;
|
|
81
|
+
updatedAt: string;
|
|
82
82
|
}
|
|
83
83
|
export interface AddPositionMarginRequest {
|
|
84
84
|
amount: string;
|
|
@@ -88,9 +88,9 @@ export interface ReducePositionMarginRequest {
|
|
|
88
88
|
amount: string;
|
|
89
89
|
}
|
|
90
90
|
export interface PositionMarginResponse {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
positionId: string;
|
|
92
|
+
marginAccountId: string;
|
|
93
|
+
newIsolatedMargin: string;
|
|
94
94
|
status: string;
|
|
95
95
|
message: string;
|
|
96
96
|
}
|
|
@@ -108,35 +108,35 @@ export interface AttachPositionTpSlRequest {
|
|
|
108
108
|
stopLoss?: TpSlLeg;
|
|
109
109
|
}
|
|
110
110
|
export interface AttachPositionTpSlResponse {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
positionId: string;
|
|
112
|
+
takeProfitOrderId?: string;
|
|
113
|
+
stopLossOrderId?: string;
|
|
114
114
|
status: "SUCCESS" | "FAILED";
|
|
115
115
|
message: string;
|
|
116
116
|
}
|
|
117
117
|
export interface ListPositionHistoryParams {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
positionId?: string;
|
|
119
|
+
marginAccountId?: string;
|
|
120
|
+
tradingPairId?: string;
|
|
121
121
|
page?: number;
|
|
122
|
-
|
|
122
|
+
pageSize?: number;
|
|
123
123
|
}
|
|
124
124
|
export interface PositionHistoryEvent {
|
|
125
125
|
event_id: string;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
positionId?: string;
|
|
127
|
+
marginAccountId?: string;
|
|
128
|
+
tradingPairId?: string;
|
|
129
|
+
eventType: string;
|
|
130
130
|
quantity?: string;
|
|
131
131
|
price?: string;
|
|
132
|
-
|
|
132
|
+
realizedPnl?: string;
|
|
133
133
|
timestamp: string;
|
|
134
134
|
}
|
|
135
135
|
export interface ListPositionHistoryResponse {
|
|
136
136
|
events: PositionHistoryEvent[];
|
|
137
137
|
total: number;
|
|
138
138
|
page: number;
|
|
139
|
-
|
|
139
|
+
pageSize: number;
|
|
140
140
|
}
|
|
141
141
|
export interface PositionsAPI extends BaseAPI {
|
|
142
142
|
listPositions(params?: ListPositionsParams): Promise<ListPositionsResponse>;
|
package/dist/profile/index.d.ts
CHANGED
|
@@ -36,13 +36,13 @@ export interface LedgerMovement {
|
|
|
36
36
|
/** Movement unique identifier */
|
|
37
37
|
id: string;
|
|
38
38
|
/** Type of entry (Credit, Debit) */
|
|
39
|
-
|
|
39
|
+
entryType: string;
|
|
40
40
|
/** Type of transaction (Deposit, Withdrawal, Trade, etc.) */
|
|
41
|
-
|
|
41
|
+
transactionType: string;
|
|
42
42
|
/** Transaction amount (normalized, human-readable) */
|
|
43
43
|
amount: string;
|
|
44
44
|
/** Transaction amount in raw format (wei) */
|
|
45
|
-
|
|
45
|
+
amountRaw: string;
|
|
46
46
|
/** Token contract address */
|
|
47
47
|
token: Address;
|
|
48
48
|
/** Token symbol */
|
|
@@ -50,39 +50,39 @@ export interface LedgerMovement {
|
|
|
50
50
|
/** Token decimals */
|
|
51
51
|
decimals: number;
|
|
52
52
|
/** Balance before this transaction (normalized) */
|
|
53
|
-
|
|
53
|
+
balanceBefore: string | null;
|
|
54
54
|
/** Balance before in raw format (wei) */
|
|
55
|
-
|
|
55
|
+
balanceBeforeRaw: string | null;
|
|
56
56
|
/** Balance after this transaction (normalized) */
|
|
57
|
-
|
|
57
|
+
balanceAfter: string | null;
|
|
58
58
|
/** Balance after in raw format (wei) */
|
|
59
|
-
|
|
59
|
+
balanceAfterRaw: string | null;
|
|
60
60
|
/** Locked balance before transaction (normalized) */
|
|
61
|
-
|
|
61
|
+
lockedBefore: string | null;
|
|
62
62
|
/** Locked balance before in raw format (wei) */
|
|
63
|
-
|
|
63
|
+
lockedBeforeRaw: string | null;
|
|
64
64
|
/** Locked balance after transaction (normalized) */
|
|
65
|
-
|
|
65
|
+
lockedAfter: string | null;
|
|
66
66
|
/** Locked balance after in raw format (wei) */
|
|
67
|
-
|
|
67
|
+
lockedAfterRaw: string | null;
|
|
68
68
|
/** Reference identifier for related operations */
|
|
69
|
-
|
|
69
|
+
referenceId: string | null;
|
|
70
70
|
/** Reference type */
|
|
71
|
-
|
|
71
|
+
referenceType: string | null;
|
|
72
72
|
/** Human readable description */
|
|
73
73
|
description: string | null;
|
|
74
74
|
/** Blockchain transaction hash */
|
|
75
|
-
|
|
75
|
+
txHash: string | null;
|
|
76
76
|
/** Blockchain block number */
|
|
77
|
-
|
|
77
|
+
blockNumber: number | null;
|
|
78
78
|
/** Transaction timestamp */
|
|
79
|
-
|
|
79
|
+
createdAt: string | null;
|
|
80
80
|
/** Asset UUID this movement affects */
|
|
81
|
-
|
|
81
|
+
assetId?: string | null;
|
|
82
82
|
/** User UUID who owns this movement */
|
|
83
|
-
|
|
83
|
+
userId?: string | null;
|
|
84
84
|
/** Balance UUID this movement affects */
|
|
85
|
-
|
|
85
|
+
balanceId?: string | null;
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
88
|
* Ledger entry type for filtering movements.
|
|
@@ -101,13 +101,13 @@ export interface GetUserMovementsParams {
|
|
|
101
101
|
/** Page number (starts from 1) */
|
|
102
102
|
page?: number;
|
|
103
103
|
/** Number of items per page (max 100) */
|
|
104
|
-
|
|
104
|
+
pageSize?: number;
|
|
105
105
|
/** Filter by entry type (CREDIT, DEBIT, LOCK, UNLOCK, FEE) */
|
|
106
|
-
|
|
106
|
+
entryType?: LedgerEntryType;
|
|
107
107
|
/** Filter by transaction type (DEPOSIT, WITHDRAWAL, TRADE, FEE, FUNDING, LIQUIDATION, INTEREST, REWARD) */
|
|
108
|
-
|
|
108
|
+
transactionType?: TransactionType;
|
|
109
109
|
/** Filter by asset ID (UUID) */
|
|
110
|
-
|
|
110
|
+
assetId?: string;
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Query parameters for getting user balances
|
|
@@ -116,7 +116,7 @@ export interface GetUserBalancesParams {
|
|
|
116
116
|
/** Page number (starts from 1) */
|
|
117
117
|
page?: number;
|
|
118
118
|
/** Number of items per page (max 100) */
|
|
119
|
-
|
|
119
|
+
pageSize?: number;
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
122
|
* Response from getting user movements
|
|
@@ -133,11 +133,11 @@ export interface GetPaginatedUserMovementsResponse {
|
|
|
133
133
|
/** Current page number */
|
|
134
134
|
page: number;
|
|
135
135
|
/** Items per page */
|
|
136
|
-
|
|
136
|
+
pageSize: number;
|
|
137
137
|
/** Total number of movements in PostgreSQL */
|
|
138
138
|
total: number;
|
|
139
139
|
/** Total number of pages */
|
|
140
|
-
|
|
140
|
+
totalPages: number;
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
143
|
* Response from getting user balances
|
|
@@ -148,11 +148,11 @@ export interface GetUserBalancesResponse {
|
|
|
148
148
|
/** Total number of balances */
|
|
149
149
|
total: number;
|
|
150
150
|
/** Items per page */
|
|
151
|
-
|
|
151
|
+
pageSize: number;
|
|
152
152
|
/** Current page number */
|
|
153
153
|
page: number;
|
|
154
154
|
/** Total number of pages */
|
|
155
|
-
|
|
155
|
+
totalPages: number;
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
158
|
* Order information for recent orders.
|
|
@@ -166,7 +166,7 @@ export interface ProfileOrder {
|
|
|
166
166
|
/** Order side */
|
|
167
167
|
side: OrderSide;
|
|
168
168
|
/** Order type */
|
|
169
|
-
|
|
169
|
+
orderType: OrderType;
|
|
170
170
|
/** Order price (null for market orders) */
|
|
171
171
|
price: string | null;
|
|
172
172
|
/** Order quantity */
|
|
@@ -174,11 +174,11 @@ export interface ProfileOrder {
|
|
|
174
174
|
/** Order status */
|
|
175
175
|
status: OrderStatus;
|
|
176
176
|
/** Time in force */
|
|
177
|
-
|
|
177
|
+
timeInForce?: TimeInForce;
|
|
178
178
|
/** Order creation timestamp (ISO string) */
|
|
179
|
-
|
|
179
|
+
createdAt: string;
|
|
180
180
|
/** Order last update timestamp (ISO string) */
|
|
181
|
-
|
|
181
|
+
updatedAt?: string;
|
|
182
182
|
}
|
|
183
183
|
/**
|
|
184
184
|
* Account balance for a specific token.
|
|
@@ -186,7 +186,7 @@ export interface ProfileOrder {
|
|
|
186
186
|
*/
|
|
187
187
|
export interface AccountBalance {
|
|
188
188
|
/** Asset ID (UUID for API calls) */
|
|
189
|
-
|
|
189
|
+
assetId: string;
|
|
190
190
|
/** Token address */
|
|
191
191
|
token: Address;
|
|
192
192
|
/** Token symbol */
|
|
@@ -194,38 +194,38 @@ export interface AccountBalance {
|
|
|
194
194
|
/** Decimal places for the token */
|
|
195
195
|
decimals: number;
|
|
196
196
|
/** Available balance for trading (normalized) */
|
|
197
|
-
|
|
197
|
+
availableBalance: string;
|
|
198
198
|
/** Locked balance (in orders or pending operations, normalized) */
|
|
199
|
-
|
|
199
|
+
lockedBalance: string;
|
|
200
200
|
/** Total balance (available + locked, normalized) */
|
|
201
|
-
|
|
201
|
+
totalBalance: string;
|
|
202
202
|
/** Available balance in raw format (wei) */
|
|
203
|
-
|
|
203
|
+
availableBalanceRaw: string;
|
|
204
204
|
/** Locked balance in raw format (wei) */
|
|
205
|
-
|
|
205
|
+
lockedBalanceRaw: string;
|
|
206
206
|
/** Total balance (available + locked) in raw format (wei) */
|
|
207
|
-
|
|
207
|
+
totalBalanceRaw: string;
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
210
210
|
* A single user trade execution.
|
|
211
211
|
*/
|
|
212
212
|
export interface UserTrade {
|
|
213
213
|
/** Trade unique identifier */
|
|
214
|
-
|
|
214
|
+
tradeId: string;
|
|
215
215
|
/** Trading pair identifier (UUID) */
|
|
216
|
-
|
|
216
|
+
tradingPairId: string;
|
|
217
217
|
/** Execution price (as string to preserve precision) */
|
|
218
218
|
price: string;
|
|
219
219
|
/** Executed quantity (as string to preserve precision) */
|
|
220
220
|
quantity: string;
|
|
221
221
|
/** Quote volume (price * quantity, as string to preserve precision) */
|
|
222
|
-
|
|
222
|
+
quoteVolume: string;
|
|
223
223
|
/** Side of the trade */
|
|
224
224
|
side: OrderSide;
|
|
225
225
|
/** Fee paid for this trade (as string to preserve precision) */
|
|
226
226
|
fee: string;
|
|
227
227
|
/** Timestamp when the trade was executed (ISO string) */
|
|
228
|
-
|
|
228
|
+
executedAt: string;
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
231
231
|
* Query parameters for getting user trades
|
|
@@ -234,9 +234,9 @@ export interface GetUserTradesParams {
|
|
|
234
234
|
/** Page number (starts from 1) */
|
|
235
235
|
page?: number;
|
|
236
236
|
/** Number of items per page (max 100) */
|
|
237
|
-
|
|
237
|
+
pageSize?: number;
|
|
238
238
|
/** Filter by trading pair ID (UUID) */
|
|
239
|
-
|
|
239
|
+
tradingPairId?: string;
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
242
242
|
* Response from getting user trades
|
|
@@ -247,11 +247,11 @@ export interface GetUserTradesResponse {
|
|
|
247
247
|
/** Current page number */
|
|
248
248
|
page: number;
|
|
249
249
|
/** Items per page */
|
|
250
|
-
|
|
250
|
+
pageSize: number;
|
|
251
251
|
/** Total number of trades */
|
|
252
252
|
total: number;
|
|
253
253
|
/** Total number of pages */
|
|
254
|
-
|
|
254
|
+
totalPages: number;
|
|
255
255
|
}
|
|
256
256
|
/**
|
|
257
257
|
* Direction of a funding payment from the user's perspective.
|
|
@@ -264,25 +264,25 @@ export interface FundingPayment {
|
|
|
264
264
|
/** Funding payment unique identifier (UUID) */
|
|
265
265
|
id: string;
|
|
266
266
|
/** Margin position identifier (UUID) */
|
|
267
|
-
|
|
267
|
+
positionId: string;
|
|
268
268
|
/** Margin account identifier (UUID) */
|
|
269
|
-
|
|
269
|
+
marginAccountId: string;
|
|
270
270
|
/** Trading pair identifier (UUID) */
|
|
271
|
-
|
|
271
|
+
tradingPairId: string;
|
|
272
272
|
/** Funding rate applied for the epoch (as string to preserve precision) */
|
|
273
|
-
|
|
273
|
+
fundingRate: string;
|
|
274
274
|
/** Absolute position size at settlement (as string to preserve precision) */
|
|
275
|
-
|
|
275
|
+
positionSize: string;
|
|
276
276
|
/** Signed funding amount; positive means paid, negative means received (as string) */
|
|
277
|
-
|
|
277
|
+
paymentAmount: string;
|
|
278
278
|
/** Funding direction for the user */
|
|
279
279
|
direction: FundingDirection;
|
|
280
280
|
/** Funding window start timestamp (ISO 8601), if known */
|
|
281
|
-
|
|
281
|
+
periodStart?: string;
|
|
282
282
|
/** Funding window end timestamp (ISO 8601), if known */
|
|
283
|
-
|
|
283
|
+
periodEnd?: string;
|
|
284
284
|
/** Funding payment creation timestamp (ISO 8601), if known */
|
|
285
|
-
|
|
285
|
+
createdAt?: string;
|
|
286
286
|
}
|
|
287
287
|
/**
|
|
288
288
|
* Query parameters for listing funding payments.
|
|
@@ -291,13 +291,13 @@ export interface ListFundingPaymentsParams {
|
|
|
291
291
|
/** Page number (starts from 1) */
|
|
292
292
|
page?: number;
|
|
293
293
|
/** Number of items per page (max 100) */
|
|
294
|
-
|
|
294
|
+
pageSize?: number;
|
|
295
295
|
/** Filter by trading pair ID (UUID) */
|
|
296
|
-
|
|
296
|
+
tradingPairId?: string;
|
|
297
297
|
/** Filter by margin position ID (UUID) */
|
|
298
|
-
|
|
298
|
+
positionId?: string;
|
|
299
299
|
/** Filter by margin account ID (UUID) */
|
|
300
|
-
|
|
300
|
+
marginAccountId?: string;
|
|
301
301
|
}
|
|
302
302
|
/**
|
|
303
303
|
* Response from listing funding payments.
|
|
@@ -308,11 +308,11 @@ export interface ListFundingPaymentsResponse {
|
|
|
308
308
|
/** Current page number */
|
|
309
309
|
page: number;
|
|
310
310
|
/** Items per page */
|
|
311
|
-
|
|
311
|
+
pageSize: number;
|
|
312
312
|
/** Total number of matching records */
|
|
313
313
|
total: number;
|
|
314
314
|
/** Total number of pages */
|
|
315
|
-
|
|
315
|
+
totalPages: number;
|
|
316
316
|
}
|
|
317
317
|
/**
|
|
318
318
|
* Time period for portfolio stats and chart queries.
|
|
@@ -348,22 +348,30 @@ export interface PortfolioChartResponse {
|
|
|
348
348
|
* Returned by the /api/v1/accounts/me/portfolio endpoint.
|
|
349
349
|
*/
|
|
350
350
|
export interface PortfolioStats {
|
|
351
|
-
/**
|
|
351
|
+
/**
|
|
352
|
+
* Realized PnL over the period on an average-cost basis: gains/losses are
|
|
353
|
+
* booked only when a position is reduced or closed, net of fees, across spot
|
|
354
|
+
* and perps (including funding). Excludes unrealized PnL on open positions.
|
|
355
|
+
*/
|
|
352
356
|
pnl: string;
|
|
353
|
-
/** Total trading volume (sum of
|
|
357
|
+
/** Total trading volume (sum of quoteVolume from trades) */
|
|
354
358
|
volume: string;
|
|
355
|
-
/** Maximum peak-to-trough drawdown on running PnL */
|
|
356
|
-
|
|
359
|
+
/** Maximum peak-to-trough drawdown on running PnL. Null when there are no closed trades in the period. */
|
|
360
|
+
maxDrawdown: string | null;
|
|
357
361
|
/** Total number of orders placed */
|
|
358
|
-
|
|
362
|
+
totalOrders: number;
|
|
359
363
|
/** Total number of trades executed */
|
|
360
|
-
|
|
364
|
+
totalTrades: number;
|
|
361
365
|
/** Total fees paid */
|
|
362
|
-
|
|
363
|
-
/** Ratio of profitable trades to total trades */
|
|
364
|
-
|
|
365
|
-
/** Total equity in USDC terms (
|
|
366
|
-
|
|
366
|
+
feesPaid: string;
|
|
367
|
+
/** Ratio of profitable trades to total trades. Null when there are no closed trades in the period. */
|
|
368
|
+
winLossRatio: number | null;
|
|
369
|
+
/** Total equity in USDC terms (spot balances plus perps account equity) */
|
|
370
|
+
totalEquity: string;
|
|
371
|
+
/** Spot account equity in USDC terms */
|
|
372
|
+
spotEquity: string;
|
|
373
|
+
/** Perpetuals (margin) account equity in USDC terms */
|
|
374
|
+
perpsEquity: string;
|
|
367
375
|
}
|
|
368
376
|
/**
|
|
369
377
|
* User profile information returned by the /api/v1/accounts/me endpoint.
|
|
@@ -376,19 +384,19 @@ export interface UserProfile {
|
|
|
376
384
|
/** Username of the user (can be null) */
|
|
377
385
|
username: string | null;
|
|
378
386
|
/** Account type (e.g., "master") */
|
|
379
|
-
|
|
387
|
+
accountType: string;
|
|
380
388
|
/** Whether the user can withdraw funds */
|
|
381
|
-
|
|
389
|
+
canWithdraw: boolean;
|
|
382
390
|
/** Taker fee rate in basis points */
|
|
383
|
-
|
|
391
|
+
takerFeeBps: number;
|
|
384
392
|
/** Maker fee rate in basis points */
|
|
385
|
-
|
|
393
|
+
makerFeeBps: number;
|
|
386
394
|
/** Account creation timestamp (ISO string) */
|
|
387
|
-
|
|
395
|
+
createdAt: string;
|
|
388
396
|
/** Additional taker fee in basis points contributed by the application (if any) */
|
|
389
|
-
|
|
397
|
+
applicationTakerFeeBps?: number;
|
|
390
398
|
/** Additional maker fee in basis points contributed by the application (if any) */
|
|
391
|
-
|
|
399
|
+
applicationMakerFeeBps?: number;
|
|
392
400
|
}
|
|
393
401
|
/**
|
|
394
402
|
* Profile API interface.
|
|
@@ -413,9 +421,9 @@ export interface ProfileAPI extends BaseAPI {
|
|
|
413
421
|
* @param params - Optional query parameters for pagination and filtering
|
|
414
422
|
* @param params.page - Page number (starts from 1)
|
|
415
423
|
* @param params.limit - Number of items per page (max 100)
|
|
416
|
-
* @param params.
|
|
417
|
-
* @param params.
|
|
418
|
-
* @param params.
|
|
424
|
+
* @param params.entryType - Filter by entry type (CREDIT, DEBIT, LOCK, UNLOCK, FEE)
|
|
425
|
+
* @param params.transactionType - Filter by transaction type (DEPOSIT, WITHDRAWAL, TRADE, FEE, FUNDING, LIQUIDATION, INTEREST, REWARD)
|
|
426
|
+
* @param params.assetId - Filter by asset ID (UUID)
|
|
419
427
|
* @returns Promise resolving to paginated movements response
|
|
420
428
|
*/
|
|
421
429
|
getPaginatedUserMovements(params?: GetUserMovementsParams): Promise<GetPaginatedUserMovementsResponse>;
|
|
@@ -434,7 +442,7 @@ export interface ProfileAPI extends BaseAPI {
|
|
|
434
442
|
/**
|
|
435
443
|
* Get the current user's balance for a specific asset.
|
|
436
444
|
*
|
|
437
|
-
* Fetches the user's balance for a specific asset from the /api/v1/accounts/balances/{
|
|
445
|
+
* Fetches the user's balance for a specific asset from the /api/v1/accounts/balances/{assetId} endpoint.
|
|
438
446
|
* Requires a valid access token to be set. If no balance exists for a valid asset, returns zero balances.
|
|
439
447
|
*
|
|
440
448
|
* @param assetId - The asset identifier (UUID)
|
|
@@ -471,9 +479,9 @@ export interface ProfileAPI extends BaseAPI {
|
|
|
471
479
|
* @param params - Optional query parameters for pagination and filtering
|
|
472
480
|
* @param params.page - Page number (starts from 1)
|
|
473
481
|
* @param params.limit - Number of items per page (max 100)
|
|
474
|
-
* @param params.
|
|
482
|
+
* @param params.tradingPairId - Filter by trading pair ID (UUID)
|
|
475
483
|
* @returns Promise resolving to paginated trades response
|
|
476
|
-
* @throws ValidationError If pagination params (page/limit) are invalid or
|
|
484
|
+
* @throws ValidationError If pagination params (page/limit) are invalid or tradingPairId is not a valid UUID; this may occur before any network request.
|
|
477
485
|
*/
|
|
478
486
|
getUserTrades(params?: GetUserTradesParams): Promise<GetUserTradesResponse>;
|
|
479
487
|
/**
|
|
@@ -484,10 +492,10 @@ export interface ProfileAPI extends BaseAPI {
|
|
|
484
492
|
*
|
|
485
493
|
* @param params - Optional query parameters for pagination and filtering
|
|
486
494
|
* @param params.page - Page number (starts from 1)
|
|
487
|
-
* @param params.
|
|
488
|
-
* @param params.
|
|
489
|
-
* @param params.
|
|
490
|
-
* @param params.
|
|
495
|
+
* @param params.pageSize - Number of items per page (max 100)
|
|
496
|
+
* @param params.tradingPairId - Filter by trading pair ID (UUID)
|
|
497
|
+
* @param params.positionId - Filter by margin position ID (UUID)
|
|
498
|
+
* @param params.marginAccountId - Filter by margin account ID (UUID)
|
|
491
499
|
* @returns Promise resolving to paginated funding payments response
|
|
492
500
|
* @throws ValidationError If pagination params or a UUID filter are invalid; this may occur before any network request.
|
|
493
501
|
*/
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -106,7 +106,7 @@ export interface MonacoSDK {
|
|
|
106
106
|
/** Page number (starts from 1, default: 1) */
|
|
107
107
|
page?: number;
|
|
108
108
|
/** Maximum number of records to return (default: 25, max: 100) */
|
|
109
|
-
|
|
109
|
+
pageSize?: number;
|
|
110
110
|
}) => Promise<TradeEvent[]>;
|
|
111
111
|
};
|
|
112
112
|
/** WebSocket client for real-time data (orders, orderbook, ohlcv) */
|