@0xmonaco/types 1.0.69 → 1.0.70
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/copy-trading/index.d.ts +95 -0
- package/dist/copy-trading/index.js +8 -0
- package/dist/copy-trading/responses.d.ts +373 -0
- package/dist/copy-trading/responses.js +268 -0
- package/dist/delegated-agents/index.d.ts +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/margin-accounts/index.d.ts +18 -0
- package/dist/portfolio/index.d.ts +12 -0
- package/dist/profile/index.d.ts +30 -40
- package/dist/sdk/index.d.ts +3 -0
- package/dist/trading/responses.d.ts +3 -46
- package/dist/validation/copy-trading.d.ts +113 -0
- package/dist/validation/copy-trading.js +141 -0
- package/dist/validation/index.d.ts +1 -0
- package/dist/validation/index.js +1 -0
- package/dist/validation/positions.d.ts +1 -1
- package/dist/validation/profile.d.ts +1 -1
- package/dist/validation/profile.js +8 -16
- package/dist/validation/trading.d.ts +4 -5
- package/dist/validation/trading.js +25 -50
- package/dist/websocket/client.d.ts +9 -1
- package/dist/websocket/events/copy-events.d.ts +133 -0
- package/dist/websocket/events/copy-events.js +17 -0
- package/dist/websocket/events/index.d.ts +1 -0
- package/dist/websocket/events/index.js +1 -0
- package/dist/websocket/events/orders-events.d.ts +51 -0
- package/dist/websocket/snapshots.d.ts +24 -2
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +13 -0
- package/dist/wire/schema.d.ts +1658 -194
- package/package.json +2 -2
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy trading response types (0XM-2851).
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas for every copy trading REST/gRPC response, with the inferred
|
|
5
|
+
* TypeScript types. The REST API returns camelCase JSON; an optional field the
|
|
6
|
+
* server has no value for arrives as `null`, so optional fields are typed
|
|
7
|
+
* `T | null | undefined` (`.nullish()`).
|
|
8
|
+
*
|
|
9
|
+
* Leaders are only ever identified by their public wallet address and custom
|
|
10
|
+
* TraderCode handle, never by an internal id.
|
|
11
|
+
*
|
|
12
|
+
* Label fields (statuses, modes, reasons) are typed `Union | (string & {})`:
|
|
13
|
+
* the unions name the values the server sends today, and the schemas accept
|
|
14
|
+
* any string so a value added server-side later does not fail parsing.
|
|
15
|
+
*/
|
|
16
|
+
import { z } from "zod";
|
|
17
|
+
/** A string schema typed as a known-value union that still admits unknown values. */
|
|
18
|
+
function openUnion() {
|
|
19
|
+
return z.string();
|
|
20
|
+
}
|
|
21
|
+
/** A lead trader as the public sees them: wallet and handle, never an internal id. */
|
|
22
|
+
export const LeadTraderRefSchema = z.object({
|
|
23
|
+
/** The leader's wallet address (lowercase hex). */
|
|
24
|
+
walletAddress: z.string(),
|
|
25
|
+
/** The leader's custom TraderCode handle, when claimed. */
|
|
26
|
+
handle: z.string().nullish(),
|
|
27
|
+
/** The handle when claimed, else the wallet address. */
|
|
28
|
+
display: z.string(),
|
|
29
|
+
});
|
|
30
|
+
/** A lead trader's public profile. */
|
|
31
|
+
export const LeadTraderProfileSchema = z.object({
|
|
32
|
+
leader: LeadTraderRefSchema,
|
|
33
|
+
/** `ACTIVE` (accepting follows), `PAUSED` (existing follows keep mirroring, no new follows) or `SUSPENDED` (own profile only). */
|
|
34
|
+
status: openUnion(),
|
|
35
|
+
/** The leader's share of followers' realized profit, in basis points. */
|
|
36
|
+
shareBps: z.number(),
|
|
37
|
+
/** Free-text profile description; empty when none. */
|
|
38
|
+
bio: z.string(),
|
|
39
|
+
/** Minimum follow allocation in quote units, when above the platform floor. */
|
|
40
|
+
minAllocation: z.string().nullish(),
|
|
41
|
+
/** Registration time (RFC 3339). */
|
|
42
|
+
registeredAt: z.string(),
|
|
43
|
+
});
|
|
44
|
+
/** Live follows of a leader. */
|
|
45
|
+
export const LeadTraderFollowSummarySchema = z.object({
|
|
46
|
+
/** Live follows (`ACTIVE` or `CLOSE_ONLY`). */
|
|
47
|
+
followerCount: z.number(),
|
|
48
|
+
/** Collateral allocated by live follows, in quote units (AUM as allocated, not marked). */
|
|
49
|
+
allocated: z.string(),
|
|
50
|
+
/**
|
|
51
|
+
* Equity of live follows' copy accounts at the engine's marks, in quote
|
|
52
|
+
* units (AUM marked: collateral plus unrealized PnL of copy positions).
|
|
53
|
+
* Absent when it could not be read. Not trading PnL.
|
|
54
|
+
*/
|
|
55
|
+
aumEquity: z.string().nullish(),
|
|
56
|
+
});
|
|
57
|
+
/** A leader's trading stats over one window. */
|
|
58
|
+
export const LeadTraderStatsSchema = z.object({
|
|
59
|
+
/** `7d`, `30d`, `90d` or `all`. */
|
|
60
|
+
window: openUnion(),
|
|
61
|
+
/** Trading PnL over the window in quote units: realized plus unrealized, net of fees and funding. */
|
|
62
|
+
pnl: z.string(),
|
|
63
|
+
/** PnL as a percentage of the highest base balance over the window; absent when that base is not positive. */
|
|
64
|
+
roiPct: z.string().nullish(),
|
|
65
|
+
/** Largest peak-to-trough fall of cumulative PnL over the window, as a percentage of the highest base balance. */
|
|
66
|
+
maxDrawdownPct: z.string().nullish(),
|
|
67
|
+
/** Winning closes as a percentage of winning plus losing closes; absent when there were none. */
|
|
68
|
+
winRatePct: z.string().nullish(),
|
|
69
|
+
/** Closes over the window, break-even included. */
|
|
70
|
+
closedTrades: z.number(),
|
|
71
|
+
});
|
|
72
|
+
/** One lead trader: profile, follow summary and stats for every window (7d, 30d, 90d, all). */
|
|
73
|
+
export const GetLeadTraderResponseSchema = z.object({
|
|
74
|
+
profile: LeadTraderProfileSchema,
|
|
75
|
+
followSummary: LeadTraderFollowSummarySchema,
|
|
76
|
+
stats: z.array(LeadTraderStatsSchema),
|
|
77
|
+
});
|
|
78
|
+
/** One leaderboard row: stats for the requested window only. */
|
|
79
|
+
export const LeadTraderListingSchema = z.object({
|
|
80
|
+
profile: LeadTraderProfileSchema,
|
|
81
|
+
followSummary: LeadTraderFollowSummarySchema,
|
|
82
|
+
stats: LeadTraderStatsSchema,
|
|
83
|
+
});
|
|
84
|
+
/** A page of the public leaderboard. */
|
|
85
|
+
export const ListLeadTradersResponseSchema = z.object({
|
|
86
|
+
leaders: z.array(LeadTraderListingSchema),
|
|
87
|
+
/** Cursor for the next page; empty at the end. Pinned to the sort and window that produced it. */
|
|
88
|
+
nextPageToken: z.string(),
|
|
89
|
+
/** Time of the leaderboard snapshot these rows come from (RFC 3339). */
|
|
90
|
+
asOf: z.string(),
|
|
91
|
+
});
|
|
92
|
+
/** Result of registering as, or editing, a lead trader. */
|
|
93
|
+
export const UpsertLeadTraderResponseSchema = z.object({
|
|
94
|
+
/** True when this call registered you, false when it edited your profile. */
|
|
95
|
+
created: z.boolean(),
|
|
96
|
+
/** Your status after the call. */
|
|
97
|
+
status: openUnion(),
|
|
98
|
+
/** Your profit share after the call, in basis points. */
|
|
99
|
+
shareBps: z.number(),
|
|
100
|
+
});
|
|
101
|
+
/** One of your followers, as a leader sees them. */
|
|
102
|
+
export const FollowerSchema = z.object({
|
|
103
|
+
/** The follower's wallet address (lowercase hex). */
|
|
104
|
+
walletAddress: z.string(),
|
|
105
|
+
/** The follower's custom TraderCode handle when claimed, else the wallet address. */
|
|
106
|
+
display: z.string(),
|
|
107
|
+
/** `ACTIVE` or `CLOSE_ONLY`. */
|
|
108
|
+
status: openUnion(),
|
|
109
|
+
/** Collateral allocated to the follow, in quote units. */
|
|
110
|
+
allocation: z.string(),
|
|
111
|
+
/** When the follow started (RFC 3339). */
|
|
112
|
+
startedAt: z.string(),
|
|
113
|
+
});
|
|
114
|
+
/** A page of your followers. */
|
|
115
|
+
export const ListMyFollowersResponseSchema = z.object({
|
|
116
|
+
followers: z.array(FollowerSchema),
|
|
117
|
+
/** Cursor for the next page; empty at the end. */
|
|
118
|
+
nextPageToken: z.string(),
|
|
119
|
+
});
|
|
120
|
+
/** One reducing execution of a leader's position. */
|
|
121
|
+
export const ClosedTradeSchema = z.object({
|
|
122
|
+
tradingPairId: z.string(),
|
|
123
|
+
/** `LONG` or `SHORT`; empty on legacy rows. */
|
|
124
|
+
positionSide: z.string(),
|
|
125
|
+
/** `DECREASE`, `CLOSE`, `LIQUIDATE` or `ADL`. */
|
|
126
|
+
action: openUnion(),
|
|
127
|
+
/** Closed size in base units. */
|
|
128
|
+
size: z.string().nullish(),
|
|
129
|
+
/** Execution price. */
|
|
130
|
+
exitPrice: z.string().nullish(),
|
|
131
|
+
/** Average entry price of the position at the close. */
|
|
132
|
+
entryPrice: z.string().nullish(),
|
|
133
|
+
/** Gross realized PnL of the execution, in quote units. */
|
|
134
|
+
realizedPnl: z.string().nullish(),
|
|
135
|
+
/** Realized PnL net of the execution's fees and funding, in quote units. */
|
|
136
|
+
netRealizedPnl: z.string().nullish(),
|
|
137
|
+
/** Net realized PnL as a percentage of the initial margin released by the execution. */
|
|
138
|
+
realizedRoe: z.string().nullish(),
|
|
139
|
+
/** Execution time (RFC 3339). */
|
|
140
|
+
closedAt: z.string(),
|
|
141
|
+
});
|
|
142
|
+
/** A page of a leader's closed trades. */
|
|
143
|
+
export const ListLeadTraderClosedTradesResponseSchema = z.object({
|
|
144
|
+
closedTrades: z.array(ClosedTradeSchema),
|
|
145
|
+
/** Cursor for the next page; empty at the end. */
|
|
146
|
+
nextPageToken: z.string(),
|
|
147
|
+
});
|
|
148
|
+
/** One open position of a leader you follow. */
|
|
149
|
+
export const LeadTraderOpenPositionSchema = z.object({
|
|
150
|
+
tradingPairId: z.string(),
|
|
151
|
+
/** `LONG` or `SHORT`. */
|
|
152
|
+
side: z.string(),
|
|
153
|
+
/** Position size in base units. */
|
|
154
|
+
size: z.string(),
|
|
155
|
+
/** Average entry price. */
|
|
156
|
+
entryPrice: z.string(),
|
|
157
|
+
/** Current mark price. */
|
|
158
|
+
markPrice: z.string().nullish(),
|
|
159
|
+
/** Unrealized PnL at the mark, in quote units. */
|
|
160
|
+
unrealizedPnl: z.string().nullish(),
|
|
161
|
+
/** Position leverage. */
|
|
162
|
+
leverage: z.string().nullish(),
|
|
163
|
+
/** `CROSS` or `ISOLATED`. */
|
|
164
|
+
marginMode: z.string(),
|
|
165
|
+
});
|
|
166
|
+
/** A followed leader's open positions (current followers only). */
|
|
167
|
+
export const ListLeadTraderOpenPositionsResponseSchema = z.object({
|
|
168
|
+
positions: z.array(LeadTraderOpenPositionSchema),
|
|
169
|
+
});
|
|
170
|
+
/** One of your follows. */
|
|
171
|
+
export const FollowSchema = z.object({
|
|
172
|
+
/** The follow's id. */
|
|
173
|
+
followId: z.string(),
|
|
174
|
+
leader: LeadTraderRefSchema,
|
|
175
|
+
/** `ACTIVE`, `CLOSE_ONLY` (only reductions mirror) or `STOPPED`. */
|
|
176
|
+
status: openUnion(),
|
|
177
|
+
/** `FOLLOW`, `CROSS` or `ISOLATED`. */
|
|
178
|
+
marginModePolicy: openUnion(),
|
|
179
|
+
/** `PROPORTIONAL` or `FIXED_MARGIN`. */
|
|
180
|
+
sizingMode: openUnion(),
|
|
181
|
+
/** Margin per leader order for `FIXED_MARGIN`, in quote units. */
|
|
182
|
+
sizingParam: z.string().nullish(),
|
|
183
|
+
/** `FOLLOW` or `FIXED`. */
|
|
184
|
+
leverageMode: openUnion(),
|
|
185
|
+
/** Leverage for `FIXED`. */
|
|
186
|
+
fixedLeverage: z.string().nullish(),
|
|
187
|
+
/** Collateral allocated to the follow, in quote units. */
|
|
188
|
+
allocation: z.string(),
|
|
189
|
+
/** Copy stop-loss as a fraction of the allocation. */
|
|
190
|
+
slPct: z.string().nullish(),
|
|
191
|
+
/** Whether the follow copied the leader's open positions at creation. */
|
|
192
|
+
copyExisting: z.boolean(),
|
|
193
|
+
/** Markets mirrored; empty means every market the leader trades. */
|
|
194
|
+
tradingPairIds: z.array(z.string()),
|
|
195
|
+
/** Consecutive mirrors skipped for insufficient margin. */
|
|
196
|
+
consecutiveSkips: z.number(),
|
|
197
|
+
/** The copy account's cross risk bucket in your margin account. */
|
|
198
|
+
copyRiskBucketId: z.string(),
|
|
199
|
+
/** When the follow started (RFC 3339). */
|
|
200
|
+
startedAt: z.string(),
|
|
201
|
+
/** When the follow stopped (RFC 3339). */
|
|
202
|
+
stoppedAt: z.string().nullish(),
|
|
203
|
+
/** `FOLLOWER`, `STOP_LOSS`, `SKIP_LIMIT`, `ADMIN` or `LEADER_SUSPENDED`. */
|
|
204
|
+
stopReason: openUnion().nullish(),
|
|
205
|
+
});
|
|
206
|
+
/** A page of your follows. */
|
|
207
|
+
export const ListMyFollowsResponseSchema = z.object({
|
|
208
|
+
follows: z.array(FollowSchema),
|
|
209
|
+
/** Cursor for the next page; empty at the end. */
|
|
210
|
+
nextPageToken: z.string(),
|
|
211
|
+
});
|
|
212
|
+
/** A leader fill one of your follows did not mirror. */
|
|
213
|
+
export const CopySkipSchema = z.object({
|
|
214
|
+
/** Trading pair of the leader fill. */
|
|
215
|
+
tradingPairId: z.string(),
|
|
216
|
+
/** Why the mirror was skipped, e.g. `INSUFFICIENT_MARGIN`. */
|
|
217
|
+
reason: openUnion(),
|
|
218
|
+
/** The copy quantity that could not be placed, in base units. */
|
|
219
|
+
requestedQuantity: z.string(),
|
|
220
|
+
/** When the mirror was skipped (RFC 3339). */
|
|
221
|
+
skippedAt: z.string(),
|
|
222
|
+
});
|
|
223
|
+
/** One of your follows with its most recent skips (up to 100). */
|
|
224
|
+
export const GetFollowResponseSchema = z.object({
|
|
225
|
+
follow: FollowSchema,
|
|
226
|
+
recentSkips: z.array(CopySkipSchema),
|
|
227
|
+
/**
|
|
228
|
+
* The copy account's equity at the engine's marks, in quote units: its
|
|
229
|
+
* collateral plus the unrealized PnL of its positions. Absent when the
|
|
230
|
+
* engine could not be read. A balance, not trading PnL.
|
|
231
|
+
*/
|
|
232
|
+
copyAccountEquity: z.string().nullish(),
|
|
233
|
+
});
|
|
234
|
+
/** The open positions of the leader one of your follows copies. */
|
|
235
|
+
export const ListFollowLeaderPositionsResponseSchema = z.object({
|
|
236
|
+
positions: z.array(LeadTraderOpenPositionSchema),
|
|
237
|
+
});
|
|
238
|
+
/** Result of following a leader or editing a follow. */
|
|
239
|
+
export const UpsertFollowResponseSchema = z.object({
|
|
240
|
+
/** The follow's id. */
|
|
241
|
+
followId: z.string(),
|
|
242
|
+
/** The copy account: the cross risk bucket in your margin account that holds this follow's collateral and positions. */
|
|
243
|
+
copyRiskBucketId: z.string(),
|
|
244
|
+
/** True when this call created the follow, false when it edited one. */
|
|
245
|
+
created: z.boolean(),
|
|
246
|
+
});
|
|
247
|
+
/**
|
|
248
|
+
* What following with `copyExisting` would open, as totals only. The caller
|
|
249
|
+
* is never a follower of the leader, so the preview names no pair, side,
|
|
250
|
+
* size, mark or skip reason. Totals are rounded up to cents.
|
|
251
|
+
*/
|
|
252
|
+
export const PreviewFollowResponseSchema = z.object({
|
|
253
|
+
/** Estimated collateral the copied positions would reserve at placement, in quote units. */
|
|
254
|
+
estimatedMargin: z.string(),
|
|
255
|
+
/** Estimated taker fees of the copies, in quote units. */
|
|
256
|
+
estimatedFee: z.string(),
|
|
257
|
+
/** The leader's positions (in the copied markets) that would be copied. */
|
|
258
|
+
copiedPositions: z.number(),
|
|
259
|
+
/** The leader's positions (in the copied markets) that would not be copied. */
|
|
260
|
+
skippedPositions: z.number(),
|
|
261
|
+
/** More leader positions matched than one preview sizes (64); the totals and counts cover the first ones. */
|
|
262
|
+
truncated: z.boolean(),
|
|
263
|
+
});
|
|
264
|
+
/** Result of stopping a follow. */
|
|
265
|
+
export const StopFollowResponseSchema = z.object({
|
|
266
|
+
/** The stopped follow's id. */
|
|
267
|
+
followId: z.string(),
|
|
268
|
+
});
|
|
@@ -5,13 +5,19 @@ export interface UpsertDelegatedAgentRequest {
|
|
|
5
5
|
agentAddress: string;
|
|
6
6
|
name?: string;
|
|
7
7
|
expiresAt?: string;
|
|
8
|
+
/** Required. An empty list permits no actions. */
|
|
8
9
|
allowedActions: DelegatedAgentAction[];
|
|
10
|
+
/** Required. A matching market OR account permits an order; both scopes empty deny all orders. */
|
|
9
11
|
allowedTradingPairIds: string[];
|
|
12
|
+
/** Additional account scope. Omit or send [] for market-only scope, not access to every account. */
|
|
10
13
|
allowedMarginAccountIds?: string[];
|
|
14
|
+
/** Omit or send [] for unrestricted order types. */
|
|
11
15
|
allowedOrderTypes?: Array<"LIMIT" | "MARKET">;
|
|
16
|
+
/** Omit or send [] for unrestricted time in force. */
|
|
12
17
|
allowedTimeInForce?: Array<"GTC" | "IOC" | "FOK">;
|
|
13
18
|
maxLeverage?: string;
|
|
14
19
|
maxOrderNotional?: string;
|
|
20
|
+
/** @deprecated Unsupported: setting this field causes the server to reject the request. */
|
|
15
21
|
maxOpenOrders?: number;
|
|
16
22
|
}
|
|
17
23
|
export interface DelegatedAgent {
|
|
@@ -29,6 +35,7 @@ export interface DelegatedAgent {
|
|
|
29
35
|
allowedTimeInForce?: string[];
|
|
30
36
|
maxLeverage?: string;
|
|
31
37
|
maxOrderNotional?: string;
|
|
38
|
+
/** @deprecated Legacy data only; no concurrent open-order cap is enforced. */
|
|
32
39
|
maxOpenOrders?: number;
|
|
33
40
|
}
|
|
34
41
|
export interface ListDelegatedAgentsResponse {
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -30,6 +30,12 @@ export interface MarginAccountSummary {
|
|
|
30
30
|
withdrawableCollateral: string;
|
|
31
31
|
totalPositionNotional: string;
|
|
32
32
|
unrealizedPnl: string;
|
|
33
|
+
/**
|
|
34
|
+
* On a risk bucket row, the risk bucket's cash balance (realized closes,
|
|
35
|
+
* funding, and transfers between a copy account's risk buckets land here),
|
|
36
|
+
* not trading profit; trading PnL comes from position history and the
|
|
37
|
+
* portfolio PnL endpoints.
|
|
38
|
+
*/
|
|
33
39
|
realizedPnl: string;
|
|
34
40
|
updatedAt: string;
|
|
35
41
|
/**
|
|
@@ -68,6 +74,18 @@ export interface MarginAccountSummary {
|
|
|
68
74
|
* persisted-fallback reads.
|
|
69
75
|
*/
|
|
70
76
|
availableOrderCollateral?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Copy trading: present only on a copy risk bucket row (a follow's copy
|
|
79
|
+
* account — its cross risk bucket and any isolated children). The id of the
|
|
80
|
+
* follow that funds it, one of your own follows. Absent (the key is
|
|
81
|
+
* omitted, never null) on every other row.
|
|
82
|
+
*/
|
|
83
|
+
copyFollowId?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Copy trading: on a copy risk bucket row, the followed leader's custom
|
|
86
|
+
* TraderCode handle, when they still hold one. Absent otherwise.
|
|
87
|
+
*/
|
|
88
|
+
copyLeaderHandle?: string;
|
|
71
89
|
}
|
|
72
90
|
export interface ListMarginAccountsParams {
|
|
73
91
|
page?: number;
|
|
@@ -236,6 +236,18 @@ export interface PortfolioRiskBucket {
|
|
|
236
236
|
* over `riskBuckets`.
|
|
237
237
|
*/
|
|
238
238
|
marginMode: MarginMode;
|
|
239
|
+
/**
|
|
240
|
+
* Copy trading: present only on a copy risk bucket row (a follow's copy
|
|
241
|
+
* account — its cross risk bucket and any isolated children). The id of the
|
|
242
|
+
* follow that funds it, one of your own follows. Absent (the key is
|
|
243
|
+
* omitted, never null) on every other row.
|
|
244
|
+
*/
|
|
245
|
+
copyFollowId?: string;
|
|
246
|
+
/**
|
|
247
|
+
* Copy trading: on a copy risk bucket row, the followed leader's custom
|
|
248
|
+
* TraderCode handle, when they still hold one. Absent otherwise.
|
|
249
|
+
*/
|
|
250
|
+
copyLeaderHandle?: string;
|
|
239
251
|
/**
|
|
240
252
|
* The trading pair this bucket is scoped to. Present for `ISOLATED`
|
|
241
253
|
* buckets; absent (the key is omitted, never null) for `CROSS`, which spans
|
package/dist/profile/index.d.ts
CHANGED
|
@@ -98,7 +98,10 @@ export type TransactionType = "DEPOSIT" | "WITHDRAWAL" | "TRADE" | "FEE" | "FUND
|
|
|
98
98
|
* Query parameters for getting user movements
|
|
99
99
|
*/
|
|
100
100
|
export interface GetUserMovementsParams {
|
|
101
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Page number (starts from 1, at most 10,000 — the last page this listing
|
|
103
|
+
* counts towards; a larger page is rejected).
|
|
104
|
+
*/
|
|
102
105
|
page?: number;
|
|
103
106
|
/** Number of items per page (max 100) */
|
|
104
107
|
pageSize?: number;
|
|
@@ -128,9 +131,17 @@ export interface GetPaginatedUserMovementsResponse {
|
|
|
128
131
|
page: number;
|
|
129
132
|
/** Items per page */
|
|
130
133
|
pageSize: number;
|
|
131
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Matching movements. Exact up to 10,000 pages of the requested `pageSize`
|
|
136
|
+
* (`pageSize` x 10,000 rows) and saturates there, so a user with more
|
|
137
|
+
* matching movements than the listing can page through reads the cap, not
|
|
138
|
+
* their lifetime total.
|
|
139
|
+
*/
|
|
132
140
|
total: number;
|
|
133
|
-
/**
|
|
141
|
+
/**
|
|
142
|
+
* Number of pages at the requested `pageSize`. Exact up to 10,000 and
|
|
143
|
+
* saturates there, the last page this listing can reach.
|
|
144
|
+
*/
|
|
134
145
|
totalPages: number;
|
|
135
146
|
}
|
|
136
147
|
/**
|
|
@@ -257,15 +268,7 @@ export interface UserTrade {
|
|
|
257
268
|
* Query parameters for getting user trades
|
|
258
269
|
*/
|
|
259
270
|
export interface GetUserTradesParams {
|
|
260
|
-
/**
|
|
261
|
-
* Page number for legacy offset pagination (starts from 1).
|
|
262
|
-
*
|
|
263
|
-
* @deprecated Use cursor pagination (`pageToken`) instead. Passing `page`
|
|
264
|
-
* selects legacy page-number mode, which only ever sees recent (hot)
|
|
265
|
-
* history; omitting both `page` and `pageToken` now drives cursor mode.
|
|
266
|
-
*/
|
|
267
|
-
page?: number;
|
|
268
|
-
/** Number of items per page (max 100 in page-number mode, up to 1000 when `pageToken` is present) */
|
|
271
|
+
/** Number of items per page (max 1000) */
|
|
269
272
|
pageSize?: number;
|
|
270
273
|
/** Filter by trading pair ID (UUID) */
|
|
271
274
|
tradingPairId?: string;
|
|
@@ -295,32 +298,8 @@ export interface GetUserTradesParams {
|
|
|
295
298
|
export interface GetUserTradesResponse {
|
|
296
299
|
/** List of user trades */
|
|
297
300
|
trades: UserTrade[];
|
|
298
|
-
/**
|
|
299
|
-
* Current page number.
|
|
300
|
-
*
|
|
301
|
-
* @deprecated Only populated by legacy page-number (offset) responses; 0 in
|
|
302
|
-
* cursor mode. Use `pageToken`/`nextPageToken` pagination instead.
|
|
303
|
-
*/
|
|
304
|
-
page: number;
|
|
305
301
|
/** Items per page */
|
|
306
302
|
pageSize: number;
|
|
307
|
-
/**
|
|
308
|
-
* Total matching trades. In page-number mode it is exact up to
|
|
309
|
-
* `pageSize` × 10,000 rows and saturates there, so a wallet with more history
|
|
310
|
-
* than legacy mode can page through reads the cap, not its lifetime total.
|
|
311
|
-
*
|
|
312
|
-
* @deprecated Only populated by legacy page-number (offset) responses; 0 in
|
|
313
|
-
* cursor mode, which has no exact total. Walk `nextPageToken` instead.
|
|
314
|
-
*/
|
|
315
|
-
total: number;
|
|
316
|
-
/**
|
|
317
|
-
* Total pages at this `pageSize`. Exact up to 10,000 in page-number mode and
|
|
318
|
-
* saturates there, the last page legacy mode can reach.
|
|
319
|
-
*
|
|
320
|
-
* @deprecated Only populated by legacy page-number (offset) responses; 0 in
|
|
321
|
-
* cursor mode, which has no exact total. Walk `nextPageToken` instead.
|
|
322
|
-
*/
|
|
323
|
-
totalPages: number;
|
|
324
303
|
/**
|
|
325
304
|
* Cursor for the next page. Empty on every page-number (legacy) response —
|
|
326
305
|
* page-number mode never mints a token, full page or not, since resuming
|
|
@@ -372,7 +351,10 @@ export interface FundingPayment {
|
|
|
372
351
|
* Query parameters for listing funding payments.
|
|
373
352
|
*/
|
|
374
353
|
export interface ListFundingPaymentsParams {
|
|
375
|
-
/**
|
|
354
|
+
/**
|
|
355
|
+
* Page number (starts from 1, at most 10,000 — the last page this listing
|
|
356
|
+
* counts towards; a larger page is rejected).
|
|
357
|
+
*/
|
|
376
358
|
page?: number;
|
|
377
359
|
/** Number of items per page (max 100) */
|
|
378
360
|
pageSize?: number;
|
|
@@ -393,9 +375,17 @@ export interface ListFundingPaymentsResponse {
|
|
|
393
375
|
page: number;
|
|
394
376
|
/** Items per page */
|
|
395
377
|
pageSize: number;
|
|
396
|
-
/**
|
|
378
|
+
/**
|
|
379
|
+
* Matching funding payment records. Exact up to 10,000 pages of the
|
|
380
|
+
* requested `pageSize` (`pageSize` x 10,000 rows) and saturates there, so a
|
|
381
|
+
* user with more matching payments than the listing can page through reads
|
|
382
|
+
* the cap, not their lifetime total.
|
|
383
|
+
*/
|
|
397
384
|
total: number;
|
|
398
|
-
/**
|
|
385
|
+
/**
|
|
386
|
+
* Number of pages at the requested `pageSize`. Exact up to 10,000 and
|
|
387
|
+
* saturates there, the last page this listing can reach.
|
|
388
|
+
*/
|
|
399
389
|
totalPages: number;
|
|
400
390
|
}
|
|
401
391
|
/**
|
|
@@ -609,7 +599,7 @@ export interface ProfileAPI extends BaseAPI {
|
|
|
609
599
|
*
|
|
610
600
|
* @param params - Optional query parameters for pagination and filtering
|
|
611
601
|
* @param params.page - Page number (starts from 1)
|
|
612
|
-
* @param params.limit - Number of items per page (max
|
|
602
|
+
* @param params.limit - Number of items per page (max 1000)
|
|
613
603
|
* @param params.tradingPairId - Filter by trading pair ID (UUID)
|
|
614
604
|
* @returns Promise resolving to paginated trades response
|
|
615
605
|
* @throws ValidationError If pagination params (page/limit) are invalid or tradingPairId is not a valid UUID; this may occur before any network request.
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Address, PublicClient, TransactionReceipt, WalletClient } from "vi
|
|
|
2
2
|
import type { ApplicationsAPI } from "../applications";
|
|
3
3
|
import type { AuthAPI, AuthState } from "../auth/index";
|
|
4
4
|
import type { BuildercodesAPI } from "../buildercodes";
|
|
5
|
+
import type { CopyTradingAPI } from "../copy-trading";
|
|
5
6
|
import type { DelegatedAgentsAPI } from "../delegated-agents";
|
|
6
7
|
import type { FaucetAPI } from "../faucet";
|
|
7
8
|
import type { FeesAPI } from "../fees";
|
|
@@ -115,6 +116,8 @@ export interface MonacoSDK {
|
|
|
115
116
|
pitpass: PitpassAPI;
|
|
116
117
|
/** BuilderCodes frontend revenue-share payout API */
|
|
117
118
|
buildercodes: BuildercodesAPI;
|
|
119
|
+
/** Copy trading API: lead trader profiles and the leaderboard, and your follows */
|
|
120
|
+
copyTrading: CopyTradingAPI;
|
|
118
121
|
/** Testnet faucet API */
|
|
119
122
|
faucet: FaucetAPI;
|
|
120
123
|
/** Deposit-address registration (sweeper) API; requires a session */
|
|
@@ -187,15 +187,7 @@ export interface GetPaginatedOrdersParams {
|
|
|
187
187
|
tradingMode?: TradingMode;
|
|
188
188
|
/** Filter by margin account UUID */
|
|
189
189
|
marginAccountId?: string;
|
|
190
|
-
/**
|
|
191
|
-
* Page number for legacy offset pagination.
|
|
192
|
-
*
|
|
193
|
-
* @deprecated Use cursor pagination (`pageToken`) instead. Passing `page`
|
|
194
|
-
* selects legacy page-number mode, which only ever sees recent (hot)
|
|
195
|
-
* history; omitting both `page` and `pageToken` now drives cursor mode.
|
|
196
|
-
*/
|
|
197
|
-
page?: number;
|
|
198
|
-
/** Number of orders per page (default: 10; max 100 in page-number mode, up to 1000 when `pageToken` is present) */
|
|
190
|
+
/** Number of orders per page (default: 10; max 1000) */
|
|
199
191
|
pageSize?: number;
|
|
200
192
|
/**
|
|
201
193
|
* Pagination cursor with three distinct states:
|
|
@@ -230,13 +222,6 @@ export interface GetPaginatedOrdersResponse {
|
|
|
230
222
|
* `totalCapped` is `true` this is a lower bound (at least this many exist).
|
|
231
223
|
*/
|
|
232
224
|
total: number;
|
|
233
|
-
/**
|
|
234
|
-
* Current page number.
|
|
235
|
-
*
|
|
236
|
-
* @deprecated Only populated by legacy page-number (offset) responses; 0 in
|
|
237
|
-
* cursor mode. Use `pageToken`/`nextPageToken` pagination instead.
|
|
238
|
-
*/
|
|
239
|
-
page: number;
|
|
240
225
|
/** Number of orders per page */
|
|
241
226
|
pageSize: number;
|
|
242
227
|
/**
|
|
@@ -487,15 +472,7 @@ export interface ListConditionalOrdersParams {
|
|
|
487
472
|
marginAccountId?: string;
|
|
488
473
|
tradingPairId?: string;
|
|
489
474
|
state?: ConditionalOrderState;
|
|
490
|
-
/**
|
|
491
|
-
* Page number for legacy offset pagination.
|
|
492
|
-
*
|
|
493
|
-
* @deprecated Use cursor pagination (`pageToken`) instead. Passing `page`
|
|
494
|
-
* selects legacy page-number mode; omitting both `page` and `pageToken`
|
|
495
|
-
* drives cursor mode.
|
|
496
|
-
*/
|
|
497
|
-
page?: number;
|
|
498
|
-
/** Items per page (max 100 in page-number mode, up to 1000 when `pageToken` is present) */
|
|
475
|
+
/** Items per page (max 1000) */
|
|
499
476
|
pageSize?: number;
|
|
500
477
|
/**
|
|
501
478
|
* Pagination cursor with three distinct states:
|
|
@@ -644,12 +621,6 @@ export interface ListConditionalOrdersResponse {
|
|
|
644
621
|
* cursor (`pageToken`) mode, which runs no COUNT (AIP-158).
|
|
645
622
|
*/
|
|
646
623
|
total: number;
|
|
647
|
-
/**
|
|
648
|
-
* Current page number in legacy offset mode; `0` in cursor mode.
|
|
649
|
-
*
|
|
650
|
-
* @deprecated Use cursor pagination (`pageToken`/`nextPageToken`) instead.
|
|
651
|
-
*/
|
|
652
|
-
page: number;
|
|
653
624
|
pageSize: number;
|
|
654
625
|
/**
|
|
655
626
|
* Cursor for the next page, minted only while a further page exists (the read
|
|
@@ -914,15 +885,7 @@ export interface ListTwapOrdersParams {
|
|
|
914
885
|
state?: TwapOrderState;
|
|
915
886
|
/** Filter by trading pair UUID */
|
|
916
887
|
tradingPairId?: string;
|
|
917
|
-
/**
|
|
918
|
-
* Page number for legacy offset pagination.
|
|
919
|
-
*
|
|
920
|
-
* @deprecated Use cursor pagination (`pageToken`) instead. Passing `page`
|
|
921
|
-
* selects legacy page-number mode; omitting both `page` and `pageToken`
|
|
922
|
-
* drives cursor mode.
|
|
923
|
-
*/
|
|
924
|
-
page?: number;
|
|
925
|
-
/** Items per page (max 100 in page-number mode, up to 1000 when `pageToken` is present) */
|
|
888
|
+
/** Items per page (max 1000) */
|
|
926
889
|
pageSize?: number;
|
|
927
890
|
/**
|
|
928
891
|
* Pagination cursor with three distinct states:
|
|
@@ -953,12 +916,6 @@ export interface ListTwapOrdersResponse {
|
|
|
953
916
|
* which runs no COUNT (AIP-158).
|
|
954
917
|
*/
|
|
955
918
|
total: number;
|
|
956
|
-
/**
|
|
957
|
-
* Current page number in legacy offset mode; `0` in cursor mode.
|
|
958
|
-
*
|
|
959
|
-
* @deprecated Use cursor pagination (`pageToken`/`nextPageToken`) instead.
|
|
960
|
-
*/
|
|
961
|
-
page: number;
|
|
962
919
|
/** Items per page */
|
|
963
920
|
pageSize: number;
|
|
964
921
|
/**
|