@0xmonaco/types 1.0.69 → 1.0.72

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.
Files changed (38) hide show
  1. package/dist/auth/index.d.ts +4 -2
  2. package/dist/auth/responses.d.ts +3 -1
  3. package/dist/copy-trading/index.d.ts +143 -0
  4. package/dist/copy-trading/index.js +8 -0
  5. package/dist/copy-trading/responses.d.ts +416 -0
  6. package/dist/copy-trading/responses.js +317 -0
  7. package/dist/delegated-agents/index.d.ts +9 -0
  8. package/dist/fees/index.d.ts +3 -0
  9. package/dist/fees/responses.js +4 -4
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.js +1 -0
  12. package/dist/margin-accounts/index.d.ts +18 -0
  13. package/dist/portfolio/index.d.ts +12 -0
  14. package/dist/profile/index.d.ts +30 -40
  15. package/dist/sdk/index.d.ts +3 -0
  16. package/dist/trading/responses.d.ts +3 -46
  17. package/dist/validation/copy-trading.d.ts +124 -0
  18. package/dist/validation/copy-trading.js +156 -0
  19. package/dist/validation/index.d.ts +1 -0
  20. package/dist/validation/index.js +1 -0
  21. package/dist/validation/positions.d.ts +1 -1
  22. package/dist/validation/profile.d.ts +1 -1
  23. package/dist/validation/profile.js +8 -16
  24. package/dist/validation/trading.d.ts +4 -5
  25. package/dist/validation/trading.js +25 -50
  26. package/dist/websocket/client.d.ts +9 -1
  27. package/dist/websocket/events/copy-events.d.ts +133 -0
  28. package/dist/websocket/events/copy-events.js +17 -0
  29. package/dist/websocket/events/index.d.ts +1 -0
  30. package/dist/websocket/events/index.js +1 -0
  31. package/dist/websocket/events/orders-events.d.ts +51 -0
  32. package/dist/websocket/events/position-events.d.ts +14 -10
  33. package/dist/websocket/events/twap-order-events.d.ts +7 -0
  34. package/dist/websocket/snapshots.d.ts +24 -2
  35. package/dist/wire/operations.d.ts +1 -1
  36. package/dist/wire/operations.js +16 -0
  37. package/dist/wire/schema.d.ts +2218 -325
  38. package/package.json +2 -2
@@ -0,0 +1,317 @@
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
+ });
269
+ /**
270
+ * One follow's copy positions closing: a batch acknowledgement, sent once the
271
+ * batch is durably logged. The closes are reduce-only and immediate-or-cancel;
272
+ * each one's fills arrive on the order, position and copy channels. Not a
273
+ * flatten guarantee: `positionsNotClosed` counts what a thin or halted market
274
+ * left open.
275
+ */
276
+ export const CloseFollowPositionsResponseSchema = z.object({
277
+ /** The follow's id. */
278
+ followId: z.string(),
279
+ /** Close orders placed (each may fill in part). */
280
+ closeOrdersPlaced: z.number(),
281
+ /** Copy positions still open after the batch (for example a thin or halted market). */
282
+ positionsNotClosed: z.number(),
283
+ });
284
+ /** A follow whose close could not run. */
285
+ export const FollowCloseFailureSchema = z.object({
286
+ /** The follow's id. */
287
+ followId: z.string(),
288
+ /** Why the close could not run, as a fixed sentence; retry the close. */
289
+ reason: z.string(),
290
+ });
291
+ /** Result of closing all your copy positions. */
292
+ export const CloseAllCopyPositionsResponseSchema = z.object({
293
+ /**
294
+ * Every live follow whose stop is not in progress and whose close ran,
295
+ * including one with nothing to close (0 orders placed, 0 positions not closed).
296
+ */
297
+ follows: z.array(CloseFollowPositionsResponseSchema),
298
+ /** Follows whose stop is in progress: their stop closes their positions. */
299
+ stoppingFollowIds: z.array(z.string()),
300
+ /** Follows whose close could not run; the other follows still closed. */
301
+ failedFollows: z.array(FollowCloseFailureSchema),
302
+ });
303
+ /** Result of adding margin to one of your copy positions. */
304
+ export const AddFollowPositionMarginResponseSchema = z.object({
305
+ /** The follow's id. */
306
+ followId: z.string(),
307
+ /** Trading pair of the copy position. */
308
+ tradingPairId: z.string(),
309
+ /** The copy position's isolated risk bucket. */
310
+ riskBucketId: z.string(),
311
+ /** The copy position's id. */
312
+ positionId: z.string(),
313
+ /** The copy position's margin after the add, in quote units. */
314
+ positionMargin: z.string(),
315
+ /** What the copy account can still put into this position after the add, in quote units. */
316
+ copyAccountAvailable: z.string(),
317
+ });
@@ -4,14 +4,21 @@ export type DelegatedAgentAction = "CREATE_ORDER" | "CANCEL_ORDER" | "REPLACE_OR
4
4
  export interface UpsertDelegatedAgentRequest {
5
5
  agentAddress: string;
6
6
  name?: string;
7
+ /** Delegation expiry (ISO 8601); ends reads, trading, and session refresh. */
7
8
  expiresAt?: string;
9
+ /** Required. An empty list permits no actions. */
8
10
  allowedActions: DelegatedAgentAction[];
11
+ /** Required. A matching market OR account permits an order; both scopes empty deny all orders. */
9
12
  allowedTradingPairIds: string[];
13
+ /** Additional account scope. Omit or send [] for market-only scope, not access to every account. */
10
14
  allowedMarginAccountIds?: string[];
15
+ /** Omit or send [] for unrestricted order types. */
11
16
  allowedOrderTypes?: Array<"LIMIT" | "MARKET">;
17
+ /** Omit or send [] for unrestricted time in force. */
12
18
  allowedTimeInForce?: Array<"GTC" | "IOC" | "FOK">;
13
19
  maxLeverage?: string;
14
20
  maxOrderNotional?: string;
21
+ /** @deprecated Unsupported: setting this field causes the server to reject the request. */
15
22
  maxOpenOrders?: number;
16
23
  }
17
24
  export interface DelegatedAgent {
@@ -29,6 +36,7 @@ export interface DelegatedAgent {
29
36
  allowedTimeInForce?: string[];
30
37
  maxLeverage?: string;
31
38
  maxOrderNotional?: string;
39
+ /** @deprecated Legacy data only; no concurrent open-order cap is enforced. */
32
40
  maxOpenOrders?: number;
33
41
  }
34
42
  export interface ListDelegatedAgentsResponse {
@@ -54,6 +62,7 @@ export interface CreateDelegatedSessionRequest {
54
62
  sessionPublicKey: string;
55
63
  }
56
64
  export interface CreateDelegatedSessionResponse {
65
+ /** Unix seconds; bounded by delegation expiry. Revocation may end access sooner. */
57
66
  expiresAt: number;
58
67
  delegationId: string;
59
68
  ownerUserId: string;
@@ -41,6 +41,9 @@ export interface FeesAPI extends BaseAPI {
41
41
  * spot/perp breakdown), the volume still needed to reach the next tier, and the
42
42
  * requested pair's six-row fee schedule (threshold plus maker/taker bps).
43
43
  *
44
+ * The tier and volumes are wallet-wide: the caller's wallet total across every
45
+ * application it trades through, so they read the same from any application.
46
+ *
44
47
  * @param params - Parameters for the lookup
45
48
  * @param params.tradingPairId - Trading pair whose fee schedule to return
46
49
  * @returns Promise resolving to the caller's tier and the pair's schedule
@@ -126,13 +126,13 @@ export const FeeTierScheduleRowSchema = z.object({
126
126
  * Zod schema for the "my fee tier" response
127
127
  */
128
128
  export const GetMyFeeTierResponseSchema = z.object({
129
- /** Caller's resolved tier (1–6) from stored weighted 14-day volume */
129
+ /** Caller's resolved tier (1–6) from their wallet's stored weighted 14-day volume */
130
130
  currentTierLevel: z.number().int(),
131
- /** Caller's weighted 14-day volume (perp + 2.5× spot) */
131
+ /** Caller's weighted 14-day volume (perp + 2.5× spot), summed across every application the wallet trades through */
132
132
  weightedVolume14d: z.string(),
133
- /** Caller's rolling 14-day spot volume */
133
+ /** Caller's rolling 14-day spot volume, summed across every application the wallet trades through */
134
134
  spotVolume14d: z.string(),
135
- /** Caller's rolling 14-day perp volume */
135
+ /** Caller's rolling 14-day perp volume, summed across every application the wallet trades through */
136
136
  perpVolume14d: z.string(),
137
137
  /** Additional weighted volume needed to reach the next tier; absent at tier 6 */
138
138
  volumeToNextTier: z.string().nullable().optional(),
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from "./applications";
9
9
  export * from "./auth";
10
10
  export * from "./buildercodes";
11
11
  export * from "./contracts";
12
+ export * from "./copy-trading";
12
13
  export * from "./delegated-agents";
13
14
  export * from "./faucet";
14
15
  export * from "./fees";
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ export * from "./applications";
10
10
  export * from "./auth";
11
11
  export * from "./buildercodes";
12
12
  export * from "./contracts";
13
+ export * from "./copy-trading";
13
14
  export * from "./delegated-agents";
14
15
  export * from "./faucet";
15
16
  export * from "./fees";
@@ -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
@@ -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
- /** Page number (starts from 1) */
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
- /** Total number of movements in PostgreSQL */
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
- /** Total number of pages */
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
- /** Page number (starts from 1) */
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
- /** Total number of matching records */
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
- /** Total number of pages */
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 100 in page-number mode, up to 1000 when `pageToken` is present)
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.
@@ -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 */