@0xmonaco/types 1.0.81 → 1.0.82

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.
@@ -22,7 +22,7 @@ export interface AuthAPI extends BaseAPI {
22
22
  * 4. Verifies the signature, registering the session public key
23
23
  *
24
24
  * @param clientId - Client ID of the application
25
- * @param referralCode - Optional PitPass TraderCode (wallet address) of the referrer.
25
+ * @param referralCode - Optional TraderCode (wallet address) of the referrer.
26
26
  * Passed through to the verify call so a first-time sign-up records the referral
27
27
  * relationship. Has no effect when the user already exists.
28
28
  * @returns Promise resolving to the authentication state (including the session keypair)
@@ -71,7 +71,7 @@ export interface AuthAPI extends BaseAPI {
71
71
  * @param nonce - Nonce from the challenge response
72
72
  * @param clientId - Client ID of the application
73
73
  * @param session - The locally-generated session keypair (hex-encoded)
74
- * @param referralCode - Optional PitPass TraderCode (wallet address) of the referrer;
74
+ * @param referralCode - Optional TraderCode (wallet address) of the referrer;
75
75
  * recorded at first sign-up only.
76
76
  * @returns Promise resolving to the authentication state
77
77
  */
@@ -155,7 +155,7 @@ export declare const UpsertLeadTraderResponseSchema: z.ZodObject<{
155
155
  export declare const FollowerSchema: z.ZodObject<{
156
156
  walletAddress: z.ZodString;
157
157
  display: z.ZodString;
158
- status: z.ZodType<CopyRelationshipStatus | (string & {}), unknown, z.core.$ZodTypeInternals<CopyRelationshipStatus | (string & {}), unknown>>;
158
+ status: z.ZodType<(string & {}) | CopyRelationshipStatus, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyRelationshipStatus, unknown>>;
159
159
  allocation: z.ZodString;
160
160
  startedAt: z.ZodString;
161
161
  }, z.core.$strip>;
@@ -164,7 +164,7 @@ export declare const ListMyFollowersResponseSchema: z.ZodObject<{
164
164
  followers: z.ZodArray<z.ZodObject<{
165
165
  walletAddress: z.ZodString;
166
166
  display: z.ZodString;
167
- status: z.ZodType<CopyRelationshipStatus | (string & {}), unknown, z.core.$ZodTypeInternals<CopyRelationshipStatus | (string & {}), unknown>>;
167
+ status: z.ZodType<(string & {}) | CopyRelationshipStatus, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyRelationshipStatus, unknown>>;
168
168
  allocation: z.ZodString;
169
169
  startedAt: z.ZodString;
170
170
  }, z.core.$strip>>;
@@ -231,11 +231,11 @@ export declare const FollowSchema: z.ZodObject<{
231
231
  handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
232
232
  display: z.ZodString;
233
233
  }, z.core.$strip>;
234
- status: z.ZodType<CopyRelationshipStatus | (string & {}), unknown, z.core.$ZodTypeInternals<CopyRelationshipStatus | (string & {}), unknown>>;
235
- marginModePolicy: z.ZodType<CopyMarginModePolicy | (string & {}), unknown, z.core.$ZodTypeInternals<CopyMarginModePolicy | (string & {}), unknown>>;
236
- sizingMode: z.ZodType<CopySizingMode | (string & {}), unknown, z.core.$ZodTypeInternals<CopySizingMode | (string & {}), unknown>>;
234
+ status: z.ZodType<(string & {}) | CopyRelationshipStatus, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyRelationshipStatus, unknown>>;
235
+ marginModePolicy: z.ZodType<(string & {}) | CopyMarginModePolicy, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyMarginModePolicy, unknown>>;
236
+ sizingMode: z.ZodType<(string & {}) | CopySizingMode, unknown, z.core.$ZodTypeInternals<(string & {}) | CopySizingMode, unknown>>;
237
237
  sizingParam: z.ZodOptional<z.ZodNullable<z.ZodString>>;
238
- leverageMode: z.ZodType<CopyLeverageMode | (string & {}), unknown, z.core.$ZodTypeInternals<CopyLeverageMode | (string & {}), unknown>>;
238
+ leverageMode: z.ZodType<(string & {}) | CopyLeverageMode, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyLeverageMode, unknown>>;
239
239
  fixedLeverage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
240
240
  allocation: z.ZodString;
241
241
  slPct: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -245,7 +245,7 @@ export declare const FollowSchema: z.ZodObject<{
245
245
  copyRiskBucketId: z.ZodString;
246
246
  startedAt: z.ZodString;
247
247
  stoppedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
248
- stopReason: z.ZodOptional<z.ZodNullable<z.ZodType<CopyStopReason | (string & {}), unknown, z.core.$ZodTypeInternals<CopyStopReason | (string & {}), unknown>>>>;
248
+ stopReason: z.ZodOptional<z.ZodNullable<z.ZodType<(string & {}) | CopyStopReason, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyStopReason, unknown>>>>;
249
249
  }, z.core.$strip>;
250
250
  /** A page of your follows. */
251
251
  export declare const ListMyFollowsResponseSchema: z.ZodObject<{
@@ -256,11 +256,11 @@ export declare const ListMyFollowsResponseSchema: z.ZodObject<{
256
256
  handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
257
257
  display: z.ZodString;
258
258
  }, z.core.$strip>;
259
- status: z.ZodType<CopyRelationshipStatus | (string & {}), unknown, z.core.$ZodTypeInternals<CopyRelationshipStatus | (string & {}), unknown>>;
260
- marginModePolicy: z.ZodType<CopyMarginModePolicy | (string & {}), unknown, z.core.$ZodTypeInternals<CopyMarginModePolicy | (string & {}), unknown>>;
261
- sizingMode: z.ZodType<CopySizingMode | (string & {}), unknown, z.core.$ZodTypeInternals<CopySizingMode | (string & {}), unknown>>;
259
+ status: z.ZodType<(string & {}) | CopyRelationshipStatus, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyRelationshipStatus, unknown>>;
260
+ marginModePolicy: z.ZodType<(string & {}) | CopyMarginModePolicy, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyMarginModePolicy, unknown>>;
261
+ sizingMode: z.ZodType<(string & {}) | CopySizingMode, unknown, z.core.$ZodTypeInternals<(string & {}) | CopySizingMode, unknown>>;
262
262
  sizingParam: z.ZodOptional<z.ZodNullable<z.ZodString>>;
263
- leverageMode: z.ZodType<CopyLeverageMode | (string & {}), unknown, z.core.$ZodTypeInternals<CopyLeverageMode | (string & {}), unknown>>;
263
+ leverageMode: z.ZodType<(string & {}) | CopyLeverageMode, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyLeverageMode, unknown>>;
264
264
  fixedLeverage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
265
265
  allocation: z.ZodString;
266
266
  slPct: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -270,14 +270,14 @@ export declare const ListMyFollowsResponseSchema: z.ZodObject<{
270
270
  copyRiskBucketId: z.ZodString;
271
271
  startedAt: z.ZodString;
272
272
  stoppedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
273
- stopReason: z.ZodOptional<z.ZodNullable<z.ZodType<CopyStopReason | (string & {}), unknown, z.core.$ZodTypeInternals<CopyStopReason | (string & {}), unknown>>>>;
273
+ stopReason: z.ZodOptional<z.ZodNullable<z.ZodType<(string & {}) | CopyStopReason, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyStopReason, unknown>>>>;
274
274
  }, z.core.$strip>>;
275
275
  nextPageToken: z.ZodString;
276
276
  }, z.core.$strip>;
277
277
  /** A leader fill one of your follows did not mirror. */
278
278
  export declare const CopySkipSchema: z.ZodObject<{
279
279
  tradingPairId: z.ZodString;
280
- reason: z.ZodType<CopySkipReason | (string & {}), unknown, z.core.$ZodTypeInternals<CopySkipReason | (string & {}), unknown>>;
280
+ reason: z.ZodType<(string & {}) | CopySkipReason, unknown, z.core.$ZodTypeInternals<(string & {}) | CopySkipReason, unknown>>;
281
281
  requestedQuantity: z.ZodString;
282
282
  skippedAt: z.ZodString;
283
283
  }, z.core.$strip>;
@@ -290,11 +290,11 @@ export declare const GetFollowResponseSchema: z.ZodObject<{
290
290
  handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
291
291
  display: z.ZodString;
292
292
  }, z.core.$strip>;
293
- status: z.ZodType<CopyRelationshipStatus | (string & {}), unknown, z.core.$ZodTypeInternals<CopyRelationshipStatus | (string & {}), unknown>>;
294
- marginModePolicy: z.ZodType<CopyMarginModePolicy | (string & {}), unknown, z.core.$ZodTypeInternals<CopyMarginModePolicy | (string & {}), unknown>>;
295
- sizingMode: z.ZodType<CopySizingMode | (string & {}), unknown, z.core.$ZodTypeInternals<CopySizingMode | (string & {}), unknown>>;
293
+ status: z.ZodType<(string & {}) | CopyRelationshipStatus, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyRelationshipStatus, unknown>>;
294
+ marginModePolicy: z.ZodType<(string & {}) | CopyMarginModePolicy, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyMarginModePolicy, unknown>>;
295
+ sizingMode: z.ZodType<(string & {}) | CopySizingMode, unknown, z.core.$ZodTypeInternals<(string & {}) | CopySizingMode, unknown>>;
296
296
  sizingParam: z.ZodOptional<z.ZodNullable<z.ZodString>>;
297
- leverageMode: z.ZodType<CopyLeverageMode | (string & {}), unknown, z.core.$ZodTypeInternals<CopyLeverageMode | (string & {}), unknown>>;
297
+ leverageMode: z.ZodType<(string & {}) | CopyLeverageMode, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyLeverageMode, unknown>>;
298
298
  fixedLeverage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
299
299
  allocation: z.ZodString;
300
300
  slPct: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -304,11 +304,11 @@ export declare const GetFollowResponseSchema: z.ZodObject<{
304
304
  copyRiskBucketId: z.ZodString;
305
305
  startedAt: z.ZodString;
306
306
  stoppedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
307
- stopReason: z.ZodOptional<z.ZodNullable<z.ZodType<CopyStopReason | (string & {}), unknown, z.core.$ZodTypeInternals<CopyStopReason | (string & {}), unknown>>>>;
307
+ stopReason: z.ZodOptional<z.ZodNullable<z.ZodType<(string & {}) | CopyStopReason, unknown, z.core.$ZodTypeInternals<(string & {}) | CopyStopReason, unknown>>>>;
308
308
  }, z.core.$strip>;
309
309
  recentSkips: z.ZodArray<z.ZodObject<{
310
310
  tradingPairId: z.ZodString;
311
- reason: z.ZodType<CopySkipReason | (string & {}), unknown, z.core.$ZodTypeInternals<CopySkipReason | (string & {}), unknown>>;
311
+ reason: z.ZodType<(string & {}) | CopySkipReason, unknown, z.core.$ZodTypeInternals<(string & {}) | CopySkipReason, unknown>>;
312
312
  requestedQuantity: z.ZodString;
313
313
  skippedAt: z.ZodString;
314
314
  }, z.core.$strip>>;
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ export * from "./pulse";
24
24
  export * from "./sdk";
25
25
  export * from "./sub-accounts";
26
26
  export * from "./sweeper";
27
+ export * from "./tradercodes";
27
28
  export * from "./trading";
28
29
  export * from "./validation";
29
30
  export * from "./vault";
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ export * from "./pulse";
25
25
  export * from "./sdk";
26
26
  export * from "./sub-accounts";
27
27
  export * from "./sweeper";
28
+ export * from "./tradercodes";
28
29
  export * from "./trading";
29
30
  export * from "./validation";
30
31
  export * from "./vault";
@@ -197,7 +197,7 @@ export interface ScreenerSnapshotPoint {
197
197
  quoteVolume: string;
198
198
  /** Percent price change (close - open) / open * 100 for the day */
199
199
  priceChangePercent: string;
200
- /** Daily average of the valued completed-UTC-minute open interest notionals; null for spot or when fewer than 95% of the day's 1440 minutes (1368) are valued */
200
+ /** Daily average of the valued completed-UTC-minute gross open-interest notionals; null for spot or when fewer than 95% of the day's 1440 minutes (1368) are valued */
201
201
  openInterestNotionalAvg: string | null;
202
202
  }
203
203
  /**
@@ -248,13 +248,13 @@ export interface ScreenerItem {
248
248
  */
249
249
  lastFundingTime: string | null;
250
250
  /**
251
- * Open interest in base-asset units (e.g. BTC); null for spot pairs, "0" for
252
- * a margin pair with no open positions
251
+ * Gross open interest (longs plus shorts) in base-asset units (e.g. BTC);
252
+ * null for spot pairs, "0" for a margin pair with no open positions
253
253
  */
254
254
  openInterestBase: string | null;
255
255
  /**
256
- * Open interest notional in quote units (openInterestBase × latest trade
257
- * price); null for spot pairs. Valued at the pair's latest trade price (a
256
+ * Gross open-interest notional (longs plus shorts) in quote units
257
+ * (openInterestBase × latest trade price); null for spot pairs. Valued at the pair's latest trade price (a
258
258
  * snapshot); the mark-accurate notional lives on getPerpMarketSummary /
259
259
  * getOpenInterest
260
260
  */
@@ -265,6 +265,14 @@ export interface ScreenerItem {
265
265
  openInterestNotionalAvg24h: string | null;
266
266
  /** Average of the valued completed-UTC-minute gross open-interest notionals over the last 10080 minutes; null for spot or when fewer than 95% of them (9576) are valued */
267
267
  openInterestNotionalAvg7d: string | null;
268
+ /**
269
+ * Estimated rate for the in-progress funding window (decimal fraction per
270
+ * window), the same value as `getFundingState().estimatedNextFundingRate`.
271
+ * A window that ends with too few accepted samples settles at the previous
272
+ * settled rate (0 if none has settled), so the settled rate can differ.
273
+ * Null for spot pairs and margin pairs whose current window has no samples yet
274
+ */
275
+ estimatedNextFundingRate: string | null;
268
276
  }
269
277
  /**
270
278
  * Paginated screener response, sorted by quoteVolume24h desc (nulls last)
@@ -424,11 +432,11 @@ export interface PerpMarketSummary {
424
432
  quoteVolume24h?: string;
425
433
  priceChange24h?: string;
426
434
  priceChangePercent24h?: string;
427
- /** Open interest in base-asset units (legacy alias of openInterestBase) */
435
+ /** Gross open interest (longs plus shorts) in base-asset units (legacy alias of openInterestBase) */
428
436
  openInterest: string;
429
- /** Open interest in base-asset units (e.g. BTC) */
437
+ /** Gross open interest (longs plus shorts) in base-asset units (e.g. BTC) */
430
438
  openInterestBase?: string;
431
- /** Open interest notional in quote units (openInterestBase × mark price, falling back to the last trade price when no mark is available) */
439
+ /** Gross open-interest notional (longs plus shorts) in quote units (openInterestBase × mark price, falling back to the last trade price when no mark is available) */
432
440
  openInterestNotional?: string;
433
441
  currentFundingRate?: string;
434
442
  estimatedNextFundingRate?: string;
@@ -583,8 +591,11 @@ export interface ListAllFundingHistoryResponse {
583
591
  }
584
592
  export interface OpenInterest {
585
593
  tradingPairId: string;
594
+ /** Gross open interest (longs plus shorts) in base-asset units (legacy alias of openInterestBase) */
586
595
  openInterest?: string;
596
+ /** Gross open interest (longs plus shorts) in base-asset units */
587
597
  openInterestBase: string;
598
+ /** Gross open-interest notional (longs plus shorts) in quote units (openInterestBase × mark price, falling back to the last trade price when no mark is available) */
588
599
  openInterestNotional: string;
589
600
  updatedAt: string;
590
601
  }
@@ -1,142 +1,14 @@
1
1
  /**
2
- * TraderCodes Types (`sdk.pitpass`)
2
+ * Deprecated PitPass names for the TraderCodes API (`sdk.pitpass`).
3
3
  *
4
- * Types for the TraderCodes API: code lookup, rewards balance, and transfer.
4
+ * PitPass is the umbrella over TraderCodes and BuilderCodes; this surface only
5
+ * ever covered TraderCodes. Use `TraderCodesAPI` (`sdk.tradercodes`) instead.
6
+ * Every other type this module used to export is exported unchanged from
7
+ * `@0xmonaco/types` by the TraderCodes module.
5
8
  */
6
- import type { BaseAPI } from "../api";
7
- import type { GetMyReferralDownlineParams, GetMyReferralDownlineResponse, GetMyReferralPositionResponse, GetMyReferralTreeParams, GetMyReferralTreeResponse, GetRewardsBalanceResponse, TraderCodeAvailabilityResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse } from "./responses";
9
+ import type { TraderCodesAPI } from "../tradercodes";
8
10
  /**
9
- * TraderCodes API interface (`sdk.pitpass`).
10
- *
11
- * Provides methods for reading your wallet-derived TraderCode, looking up a
12
- * referral code at sign-up, reading your accrued rewards balance, and
13
- * transferring rewards into a tradeable balance.
11
+ * @deprecated Use {@link TraderCodesAPI} (`sdk.tradercodes`). Removed after at
12
+ * least two SDK releases.
14
13
  */
15
- export interface PitpassAPI extends BaseAPI {
16
- /**
17
- * Return the authenticated caller's TraderCode.
18
- *
19
- * Never 404s — every signed-in wallet has a derivable code. Ensures the
20
- * backing row so referrals attributed to this wallet have a code to link.
21
- * The response carries both the permanent wallet-derived `code` and the
22
- * custom-handle fields (`customCode`, `isCustom`, `display`).
23
- *
24
- * @returns Promise resolving to the caller's TraderCode identity and its creation timestamp
25
- */
26
- getMyTraderCode(): Promise<TraderCodeResponse>;
27
- /**
28
- * Claim or edit the authenticated caller's custom (vanity) TraderCode handle.
29
- *
30
- * The handle is stored exactly as entered (case preserved); uniqueness is
31
- * enforced case-insensitively by the server. The client validates the handle
32
- * (letter-first `[A-Za-z0-9_]`, length 5–20) before sending. The server is
33
- * the authoritative gate: it returns 409 when the handle is taken, 422 with a
34
- * reason on validation failure, 429 when the per-hour edit limit is hit, and
35
- * 403 when the feature is disabled.
36
- *
37
- * @param code - The custom handle to claim or edit to, exactly as entered
38
- * @returns Promise resolving to the caller's updated TraderCode identity
39
- */
40
- setTraderCode(code: string): Promise<TraderCodeResponse>;
41
- /**
42
- * Clear the caller's custom TraderCode handle, reverting to the
43
- * wallet-derived default. The freed handle enters a cooldown before anyone
44
- * else can claim it.
45
- *
46
- * @returns Promise resolving to the caller's TraderCode identity after the revert
47
- */
48
- clearTraderCode(): Promise<TraderCodeResponse>;
49
- /**
50
- * Public, unauthenticated advisory check of whether a custom TraderCode
51
- * handle is available (as-you-type UX).
52
- *
53
- * Advisory only — the authoritative gate is the atomic claim in
54
- * {@link setTraderCode}, so a positive result here is not a reservation.
55
- * Returns `available` plus, when unavailable, a `reason` code.
56
- *
57
- * @param code - The custom handle to check
58
- * @returns Promise resolving to availability and, when unavailable, the reason
59
- */
60
- checkTraderCodeAvailability(code: string): Promise<TraderCodeAvailabilityResponse>;
61
- /**
62
- * Public, unauthenticated lookup of a TraderCode.
63
- *
64
- * Used to validate a referral code at sign-up. The code is a wallet address
65
- * (the `Monaco - <address>` display form is also accepted). Returns the
66
- * normalized code when it resolves to a known wallet, or throws a 404 when
67
- * the code does not resolve to any user.
68
- *
69
- * @param code - The TraderCode (wallet address or `Monaco - <address>` form) to look up
70
- * @returns Promise resolving to the normalized TraderCode
71
- */
72
- getTraderCodeInfo(code: string): Promise<TraderCodeInfoResponse>;
73
- /**
74
- * Return the caller's current TraderCodes rewards-bucket balances.
75
- *
76
- * Rewards accumulate here as referred users trade. Call
77
- * {@link transferRewards} to move them into a tradeable balance.
78
- * Returns an empty `balances` array when no rewards have been earned yet.
79
- *
80
- * @returns Promise resolving to the list of per-token reward balances
81
- */
82
- getRewardsBalance(): Promise<GetRewardsBalanceResponse>;
83
- /**
84
- * Transfer earned TraderCodes rewards into a trading balance.
85
- *
86
- * Moves the specified amount of a reward token from the caller's rewards
87
- * bucket into their trading balance under the authenticated application.
88
- * Ledger-only — no on-chain transaction, immediately tradeable.
89
- *
90
- * @param params - Token address and raw-unit amount to transfer
91
- * @returns Promise resolving to the post-transfer rewards and trading balances
92
- */
93
- transferRewards(params: TransferRewardsParams): Promise<TransferRewardsResponse>;
94
- /**
95
- * Read your own referral position: your referral chain upward (`upline`, L1
96
- * then L2 and onward, as many levels as your trades on this client
97
- * application pay), your direct referrer, total earned, and most recent
98
- * reward rows.
99
- *
100
- * Self-scoped — the server derives your identity from the session, so you can
101
- * only ever read your own chain. `referrer` is the empty string when you were
102
- * not referred (use it to gate the "already referred" UX). Every other user is
103
- * identified by their public wallet address (with a `display` handle-or-wallet
104
- * variant), never an internal id.
105
- *
106
- * @returns Promise resolving to your upline, referrer, total earned, and recent rewards
107
- */
108
- getMyReferralPosition(): Promise<GetMyReferralPositionResponse>;
109
- /**
110
- * Read your own downline: one page of who you earn from and how much
111
- * (earnings by source across every reward level, largest first), your L1
112
- * direct-referee roster (including referees who have not traded yet), and a
113
- * per-level earnings summary that covers every level and source on every
114
- * page. Without `pageSize` / `pageToken` you get the first page (100 rows),
115
- * not every row: follow `nextPageToken` until it is empty.
116
- *
117
- * Self-scoped and read-only. Every source and referee is a public wallet
118
- * address plus a `display` handle-or-wallet variant, never an internal id.
119
- *
120
- * @param params - Optional `pageSize` (1-500, default 100) and `pageToken`
121
- * @returns Promise resolving to the earnings page, the direct-referee roster, a summary, and the next page token
122
- */
123
- getMyReferralDownline(params?: GetMyReferralDownlineParams): Promise<GetMyReferralDownlineResponse>;
124
- /**
125
- * Read one level of your own referral tree: the wallets `parent` directly
126
- * referred (yourself when `parent` is omitted), a page at a time, newest
127
- * first. Expand a node by calling again with `parent` set to its wallet;
128
- * nodes with `refereeCount > 0` are expandable, down to the deepest level
129
- * any client application rewards (at most 10). Your direct referees (L1)
130
- * are always listed.
131
- *
132
- * Self-scoped: `parent` must be you or one of your own referees above that
133
- * deepest level — any other wallet is a 404. Each wallet appears once, under the referrer that
134
- * earns from it.
135
- *
136
- * @param params - Optional `parent` wallet, `pageSize` (1-200), and `pageToken`
137
- * @returns Promise resolving to the page of nodes and the next page token
138
- */
139
- getMyReferralTree(params?: GetMyReferralTreeParams): Promise<GetMyReferralTreeResponse>;
140
- }
141
- export type { GetMyReferralDownlineParams, GetMyReferralDownlineResponse, GetMyReferralPositionResponse, GetMyReferralTreeParams, GetMyReferralTreeResponse, GetRewardsBalanceResponse, LevelEarnings, ReferralDirectReferee, ReferralEarningsSource, ReferralEarningsSummary, ReferralRewardEntry, ReferralTreeNode, ReferralUplineEntry, RewardsBalanceEntry, SetTraderCodeParams, TraderCodeAvailabilityReason, TraderCodeAvailabilityResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse, } from "./responses";
142
- export { GetMyReferralDownlineParamsSchema, GetMyReferralDownlineResponseSchema, GetMyReferralPositionResponseSchema, GetMyReferralTreeParamsSchema, GetMyReferralTreeResponseSchema, GetRewardsBalanceResponseSchema, LevelEarningsSchema, ReferralDirectRefereeSchema, ReferralEarningsSourceSchema, ReferralEarningsSummarySchema, ReferralRewardEntrySchema, ReferralTreeNodeSchema, ReferralUplineEntrySchema, RewardsBalanceEntrySchema, SetTraderCodeParamsSchema, TraderCodeAvailabilityReasonSchema, TraderCodeAvailabilityResponseSchema, TraderCodeInfoResponseSchema, TraderCodeResponseSchema, TransferRewardsParamsSchema, TransferRewardsResponseSchema, } from "./responses";
14
+ export type PitpassAPI = TraderCodesAPI;
@@ -1,6 +1,8 @@
1
1
  /**
2
- * TraderCodes Types (`sdk.pitpass`)
2
+ * Deprecated PitPass names for the TraderCodes API (`sdk.pitpass`).
3
3
  *
4
- * Types for the TraderCodes API: code lookup, rewards balance, and transfer.
4
+ * PitPass is the umbrella over TraderCodes and BuilderCodes; this surface only
5
+ * ever covered TraderCodes. Use `TraderCodesAPI` (`sdk.tradercodes`) instead.
6
+ * Every other type this module used to export is exported unchanged from
7
+ * `@0xmonaco/types` by the TraderCodes module.
5
8
  */
6
- export { GetMyReferralDownlineParamsSchema, GetMyReferralDownlineResponseSchema, GetMyReferralPositionResponseSchema, GetMyReferralTreeParamsSchema, GetMyReferralTreeResponseSchema, GetRewardsBalanceResponseSchema, LevelEarningsSchema, ReferralDirectRefereeSchema, ReferralEarningsSourceSchema, ReferralEarningsSummarySchema, ReferralRewardEntrySchema, ReferralTreeNodeSchema, ReferralUplineEntrySchema, RewardsBalanceEntrySchema, SetTraderCodeParamsSchema, TraderCodeAvailabilityReasonSchema, TraderCodeAvailabilityResponseSchema, TraderCodeInfoResponseSchema, TraderCodeResponseSchema, TransferRewardsParamsSchema, TransferRewardsResponseSchema, } from "./responses";
@@ -281,7 +281,16 @@ export interface ClosePositionResponse {
281
281
  submittedQuantity: string;
282
282
  }
283
283
  export interface BatchCloseAllRequest {
284
+ /** Close only the open positions on this trading pair. Cannot be combined with `tradingPairIds`. */
284
285
  tradingPairId?: string;
286
+ /**
287
+ * Close only the open positions on one of these trading pairs (1 to 256 UUIDs), in one
288
+ * request. Cannot be combined with `tradingPairId`. The SDK rejects an empty array: on the
289
+ * wire an empty set is no pair filter, which would close every open position.
290
+ */
291
+ tradingPairIds?: string[];
292
+ /** Close only the open positions on this side. Applies on top of the pair filter. */
293
+ side?: "LONG" | "SHORT";
285
294
  slippageToleranceBps?: number;
286
295
  }
287
296
  export interface BatchCloseError {
@@ -311,22 +311,17 @@ export interface GetUserTradesParams {
311
311
  /** Filter by trading pair ID (UUID) */
312
312
  tradingPairId?: string;
313
313
  /**
314
- * Pagination cursor with three distinct states:
315
- * - Omitted (`undefined`): the SDK starts a cursor walk (it sends
316
- * `pageToken=""`) unless the deprecated `page` param was passed, in
317
- * which case the request uses legacy page-number pagination, limited to
318
- * recent history once the archive window is enabled.
319
- * - Empty string (`""`): start a cursor walk with no prior position, from
320
- * the newest row (this endpoint always sorts newest-first).
314
+ * Pagination cursor:
315
+ * - Omitted or empty string (`""`): start a cursor walk from the newest row
316
+ * (this endpoint always sorts newest-first). The SDK sends `pageToken=""`.
321
317
  * - Non-empty: an opaque cursor from a previous response's
322
318
  * `nextPageToken`; results resume immediately after that position.
323
319
  *
324
- * In either cursor-walk state (empty or non-empty), `page` is ignored, the
325
- * response omits exact totals (`total`/`totalPages`/`page` are 0), and
326
- * results cover full trade history — hot and archived rows merged —
327
- * unlike page-number mode, which only ever sees recent history. Clients
328
- * that need complete trade history must use the cursor form (pass `""` to
329
- * start, then follow `nextPageToken`) rather than `page`.
320
+ * Every walk covers full trade history, hot and archived rows merged. There
321
+ * is no page-number mode: a `page` param is rejected with a
322
+ * `ValidationError` before the request is sent (the REST endpoint itself
323
+ * answers `400`). An unfiltered response carries a bounded `total` (see
324
+ * `totalCapped`); one filtered by `tradingPairId` carries none.
330
325
  */
331
326
  pageToken?: string;
332
327
  }
@@ -339,20 +334,40 @@ export interface GetUserTradesResponse {
339
334
  /** Items per page */
340
335
  pageSize: number;
341
336
  /**
342
- * Cursor for the next page. Empty on every page-number (legacy) response —
343
- * page-number mode never mints a token, full page or not, since resuming
344
- * from a legacy-minted position could silently strand archived history
345
- * newer than wherever that page happened to end.
346
- *
347
- * To walk full history, start a cursor-mode request with `pageToken`
348
- * present but empty (`""`); from then on the token is present whenever
349
- * that page returned any rows (AIP-158 "maybe more" semantics), not only
350
- * when the page is exactly full. Empty only when a cursor-mode page
351
- * returned zero rows, which is the sole proof the walk is exhausted. The
352
- * two modes never bridge — page-number pagination is deprecated for deep
353
- * history.
337
+ * Cursor for the next page. Present whenever the page returned any rows
338
+ * (AIP-158 "maybe more" semantics), not only when the page is exactly full.
339
+ * Empty only when a page returned zero rows, which is the sole proof the
340
+ * walk is exhausted, so keep following it until then.
354
341
  */
355
342
  nextPageToken: string;
343
+ /**
344
+ * Number of trades a full walk returns: every trade the user was maker or
345
+ * taker on, hot and archived, with a self-trade counted once. Bounded by the
346
+ * server count ceiling (10,000) — see `totalCapped`; when `totalCapped` is
347
+ * `true` this is a lower bound. Present on every page of an unfiltered walk
348
+ * whose count finished in its server time budget. Absent when
349
+ * `tradingPairId` filters the request (counting one pair would read the
350
+ * user's whole trade history), when the count ran out of time, and from
351
+ * servers older than this field: treat absent as unknown, not zero. The
352
+ * count reads a replica, so for a moment it can disagree with a walk: a
353
+ * trade executed moments ago can be on the page before it is counted, and
354
+ * one being archived can be counted while a walk skips it.
355
+ */
356
+ total?: number;
357
+ /**
358
+ * Number of pages at this `pageSize`, from the same bounded count as
359
+ * `total`. A lower bound when `totalCapped` is `true`. Absent exactly when
360
+ * `total` is.
361
+ */
362
+ totalPages?: number;
363
+ /**
364
+ * `true` when MORE than the server ceiling of trades matched, so the count
365
+ * stopped at the ceiling and `total`/`totalPages` are a lower bound (more
366
+ * than `total` trades exist). `false` when `total` is the exact count —
367
+ * including exactly the ceiling — and when `total` is absent. Absent from
368
+ * servers older than this field.
369
+ */
370
+ totalCapped?: boolean;
356
371
  }
357
372
  /**
358
373
  * Direction of a funding payment from the user's perspective.
@@ -16,6 +16,7 @@ import type { ProfileAPI } from "../profile";
16
16
  import type { PulseAPI } from "../pulse";
17
17
  import type { SubAccountsAPI } from "../sub-accounts";
18
18
  import type { SweeperAPI } from "../sweeper";
19
+ import type { TraderCodesAPI } from "../tradercodes";
19
20
  import type { TradingAPI, TradingMode } from "../trading";
20
21
  import type { VaultAPI } from "../vault";
21
22
  import type { MonacoWebSocket, MonacoWebSocketConfig, OrderbookEvent, OrderbookQuotationMode, TradeEvent } from "../websocket";
@@ -113,6 +114,13 @@ export interface MonacoSDK {
113
114
  /** Sub-account management API */
114
115
  subAccounts: SubAccountsAPI;
115
116
  /** TraderCodes referral and rewards API */
117
+ tradercodes: TraderCodesAPI;
118
+ /**
119
+ * TraderCodes referral and rewards API under its original name: the same
120
+ * instance as {@link tradercodes}.
121
+ *
122
+ * @deprecated Use `tradercodes`. Removed after at least two SDK releases.
123
+ */
116
124
  pitpass: PitpassAPI;
117
125
  /** BuilderCodes frontend revenue-share payout API */
118
126
  buildercodes: BuildercodesAPI;