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