@0xmonaco/types 1.0.67 → 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.
Files changed (42) hide show
  1. package/dist/buildercodes/index.d.ts +4 -4
  2. package/dist/buildercodes/index.js +1 -1
  3. package/dist/buildercodes/responses.d.ts +45 -1
  4. package/dist/buildercodes/responses.js +25 -1
  5. package/dist/copy-trading/index.d.ts +95 -0
  6. package/dist/copy-trading/index.js +8 -0
  7. package/dist/copy-trading/responses.d.ts +373 -0
  8. package/dist/copy-trading/responses.js +268 -0
  9. package/dist/delegated-agents/index.d.ts +7 -0
  10. package/dist/faucet/index.d.ts +3 -2
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.js +1 -0
  13. package/dist/margin-accounts/index.d.ts +18 -0
  14. package/dist/portfolio/index.d.ts +12 -0
  15. package/dist/positions/index.d.ts +8 -2
  16. package/dist/profile/index.d.ts +44 -41
  17. package/dist/sdk/index.d.ts +4 -1
  18. package/dist/trading/orders.d.ts +6 -0
  19. package/dist/trading/responses.d.ts +10 -57
  20. package/dist/validation/copy-trading.d.ts +113 -0
  21. package/dist/validation/copy-trading.js +141 -0
  22. package/dist/validation/index.d.ts +1 -0
  23. package/dist/validation/index.js +1 -0
  24. package/dist/validation/positions.d.ts +1 -1
  25. package/dist/validation/profile.d.ts +1 -1
  26. package/dist/validation/profile.js +8 -16
  27. package/dist/validation/trading.d.ts +4 -5
  28. package/dist/validation/trading.js +25 -50
  29. package/dist/websocket/client.d.ts +9 -1
  30. package/dist/websocket/events/conditional-order-events.d.ts +34 -14
  31. package/dist/websocket/events/copy-events.d.ts +133 -0
  32. package/dist/websocket/events/copy-events.js +17 -0
  33. package/dist/websocket/events/index.d.ts +1 -0
  34. package/dist/websocket/events/index.js +1 -0
  35. package/dist/websocket/events/orders-events.d.ts +125 -18
  36. package/dist/websocket/snapshots.d.ts +32 -3
  37. package/dist/whitelist/index.d.ts +5 -16
  38. package/dist/whitelist/index.js +2 -8
  39. package/dist/wire/operations.d.ts +1 -1
  40. package/dist/wire/operations.js +13 -0
  41. package/dist/wire/schema.d.ts +1851 -320
  42. 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 {
@@ -117,8 +117,9 @@ export interface FaucetAPI extends BaseAPI {
117
117
  * Fetches the authenticated wallet's faucet quota and recent requests.
118
118
  *
119
119
  * Read-only: remaining requests in the rolling 24h window, when the next
120
- * request becomes available, and the 5 most recent requests. Wallet-scoped
121
- * across apps, matching mint enforcement.
120
+ * request becomes available, and the 5 most recent requests. Scoped to the
121
+ * wallet on this app (each app has its own quota), matching mint
122
+ * enforcement.
122
123
  *
123
124
  * @returns Promise resolving to the quota and recent-request history
124
125
  */
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
@@ -66,11 +66,16 @@ export interface Position {
66
66
  /**
67
67
  * Lifetime realized PnL net of trading fees and funding. Terminal rows
68
68
  * only; absent when the position's reducing executions are unavailable.
69
+ * Deducts whole-life `cumFees` once. Also absent until its final close is
70
+ * recorded in the PnL sample and fee history is complete; poll again while
71
+ * pending. With no sample, remains absent for 28 days after close, then
72
+ * falls back to closing-execution net without unavailable opening fees.
69
73
  */
70
74
  netRealizedPnl?: string;
71
75
  /**
72
76
  * Lifetime realized return on the total allocated initial margin, as a
73
- * percentage. Terminal rows only; absent when unavailable.
77
+ * percentage. Terminal rows only; absent when unavailable, including under
78
+ * the same conditions as `netRealizedPnl`.
74
79
  */
75
80
  realizedRoe?: string;
76
81
  /**
@@ -101,7 +106,8 @@ export interface Position {
101
106
  * terminal rows alike. Null when the opening-fill fees are unavailable —
102
107
  * before the position's first PnL sample flushes, after its samples age out
103
108
  * of PnL retention, or for positions predating the PnL service — rather than
104
- * an understated partial.
109
+ * an understated partial. On a terminal row it is also null until the
110
+ * final close is recorded in its PnL sample, or while fee data is incomplete.
105
111
  */
106
112
  cumFees?: string;
107
113
  /**
@@ -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
  /**
@@ -235,8 +246,21 @@ export interface UserTrade {
235
246
  quoteVolume: string;
236
247
  /** Side of the trade */
237
248
  side: OrderSide;
238
- /** Fee paid for this trade (as string to preserve precision) */
249
+ /**
250
+ * Total fee paid for this trade (as string to preserve precision). For a
251
+ * taker this is Monaco's taker fee plus the frontend's builder fee; for a
252
+ * maker it is the maker fee (negative for a rebate). Equals
253
+ * `monacoFee + builderFee`.
254
+ */
239
255
  fee: string;
256
+ /** Monaco's component of `fee`. Absent from servers older than this field. */
257
+ monacoFee?: string;
258
+ /**
259
+ * The frontend's builder fee component of `fee`. Always `"0"` for a maker:
260
+ * builder fees are charged to takers only. Absent from servers older than
261
+ * this field.
262
+ */
263
+ builderFee?: string;
240
264
  /** Timestamp when the trade was executed (ISO string) */
241
265
  executedAt: string;
242
266
  }
@@ -244,15 +268,7 @@ export interface UserTrade {
244
268
  * Query parameters for getting user trades
245
269
  */
246
270
  export interface GetUserTradesParams {
247
- /**
248
- * Page number for legacy offset pagination (starts from 1).
249
- *
250
- * @deprecated Use cursor pagination (`pageToken`) instead. Passing `page`
251
- * selects legacy page-number mode, which only ever sees recent (hot)
252
- * history; omitting both `page` and `pageToken` now drives cursor mode.
253
- */
254
- page?: number;
255
- /** 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) */
256
272
  pageSize?: number;
257
273
  /** Filter by trading pair ID (UUID) */
258
274
  tradingPairId?: string;
@@ -282,32 +298,8 @@ export interface GetUserTradesParams {
282
298
  export interface GetUserTradesResponse {
283
299
  /** List of user trades */
284
300
  trades: UserTrade[];
285
- /**
286
- * Current page number.
287
- *
288
- * @deprecated Only populated by legacy page-number (offset) responses; 0 in
289
- * cursor mode. Use `pageToken`/`nextPageToken` pagination instead.
290
- */
291
- page: number;
292
301
  /** Items per page */
293
302
  pageSize: number;
294
- /**
295
- * Total matching trades. In page-number mode it is exact up to
296
- * `pageSize` × 10,000 rows and saturates there, so a wallet with more history
297
- * than legacy mode can page through reads the cap, not its lifetime total.
298
- *
299
- * @deprecated Only populated by legacy page-number (offset) responses; 0 in
300
- * cursor mode, which has no exact total. Walk `nextPageToken` instead.
301
- */
302
- total: number;
303
- /**
304
- * Total pages at this `pageSize`. Exact up to 10,000 in page-number mode and
305
- * saturates there, the last page legacy mode can reach.
306
- *
307
- * @deprecated Only populated by legacy page-number (offset) responses; 0 in
308
- * cursor mode, which has no exact total. Walk `nextPageToken` instead.
309
- */
310
- totalPages: number;
311
303
  /**
312
304
  * Cursor for the next page. Empty on every page-number (legacy) response —
313
305
  * page-number mode never mints a token, full page or not, since resuming
@@ -359,7 +351,10 @@ export interface FundingPayment {
359
351
  * Query parameters for listing funding payments.
360
352
  */
361
353
  export interface ListFundingPaymentsParams {
362
- /** 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
+ */
363
358
  page?: number;
364
359
  /** Number of items per page (max 100) */
365
360
  pageSize?: number;
@@ -380,9 +375,17 @@ export interface ListFundingPaymentsResponse {
380
375
  page: number;
381
376
  /** Items per page */
382
377
  pageSize: number;
383
- /** 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
+ */
384
384
  total: number;
385
- /** 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
+ */
386
389
  totalPages: number;
387
390
  }
388
391
  /**
@@ -596,7 +599,7 @@ export interface ProfileAPI extends BaseAPI {
596
599
  *
597
600
  * @param params - Optional query parameters for pagination and filtering
598
601
  * @param params.page - Page number (starts from 1)
599
- * @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)
600
603
  * @param params.tradingPairId - Filter by trading pair ID (UUID)
601
604
  * @returns Promise resolving to paginated trades response
602
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,12 +116,14 @@ 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 */
121
124
  sweeper: SweeperAPI;
122
125
  managedMarkets: ManagedMarketsAPI;
123
- /** Public whitelist (waitlist) submission API */
126
+ /** @deprecated Public whitelist applications are closed; submissions return HTTP 403. */
124
127
  whitelist: WhitelistAPI;
125
128
  /** Profile operations API */
126
129
  profile: ProfileAPI;
@@ -125,6 +125,12 @@ export interface Order {
125
125
  * close means unknown, not "placed by hand". Wire: `conditionalOrderId`.
126
126
  */
127
127
  conditionalOrderId?: string;
128
+ /**
129
+ * Present only on a TWAP child order: the TWAP parent that placed it. The
130
+ * same id the `orders` WebSocket frames and snapshot rows carry for the
131
+ * child. Wire: `parentOrderId`.
132
+ */
133
+ parentOrderId?: string;
128
134
  /**
129
135
  * Opaque, compare-only revision counter for this order's state: a strictly
130
136
  * higher value is strictly newer state for that order, and equal values