@0xmonaco/core 1.0.73 → 1.0.75

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.
@@ -75,15 +75,15 @@ export declare const perpRoutes: {
75
75
  readonly listFundingHistory: (tradingPairId: string, params?: {
76
76
  startTime?: string;
77
77
  endTime?: string;
78
- page?: number;
79
78
  pageSize?: number;
79
+ pageToken?: string;
80
80
  orderBy?: string;
81
81
  }) => string;
82
82
  readonly listAllFundingHistory: (params?: {
83
83
  startTime?: string;
84
84
  endTime?: string;
85
- page?: number;
86
85
  pageSize?: number;
86
+ pageToken?: string;
87
87
  orderBy?: string;
88
88
  }) => string;
89
89
  readonly getOpenInterest: (tradingPairId: string) => string;
@@ -119,8 +119,9 @@ export declare const perpRoutes: {
119
119
  };
120
120
  readonly applications: {
121
121
  readonly orders: (params?: {
122
- page?: number;
122
+ clientId?: string;
123
123
  pageSize?: number;
124
+ pageToken?: string;
124
125
  status?: string;
125
126
  userId?: string;
126
127
  tradingPairId?: string;
@@ -128,27 +129,31 @@ export declare const perpRoutes: {
128
129
  orderType?: string;
129
130
  }) => string;
130
131
  readonly users: (params?: {
131
- page?: number;
132
+ clientId?: string;
132
133
  pageSize?: number;
134
+ pageToken?: string;
133
135
  isActive?: boolean;
134
136
  accountType?: string;
135
137
  address?: string;
136
138
  }) => string;
137
139
  readonly movements: (params?: {
138
- page?: number;
140
+ clientId?: string;
139
141
  pageSize?: number;
142
+ pageToken?: string;
140
143
  userId?: string;
141
144
  transactionType?: string;
142
145
  entryType?: string;
143
146
  assetId?: string;
144
147
  }) => string;
145
148
  readonly balances: (params?: {
146
- page?: number;
149
+ clientId?: string;
147
150
  pageSize?: number;
151
+ pageToken?: string;
148
152
  userId?: string;
149
153
  assetId?: string;
150
154
  }) => string;
151
155
  readonly stats: (params?: {
156
+ clientId?: string;
152
157
  since?: string;
153
158
  }) => string;
154
159
  };
@@ -174,8 +179,8 @@ export declare const perpRoutes: {
174
179
  marginAccountId?: string;
175
180
  tradingPairId?: string;
176
181
  status?: string;
177
- page?: number;
178
182
  pageSize?: number;
183
+ pageToken?: string;
179
184
  }) => string;
180
185
  readonly get: (positionId: string) => string;
181
186
  readonly close: (positionId: string) => string;
@@ -186,8 +191,8 @@ export declare const perpRoutes: {
186
191
  positionId?: string;
187
192
  marginAccountId?: string;
188
193
  tradingPairId?: string;
189
- page?: number;
190
194
  pageSize?: number;
195
+ pageToken?: string;
191
196
  reductionOnly?: boolean;
192
197
  }) => string;
193
198
  readonly pnlHistory: (positionId: string, params: {
@@ -198,8 +203,8 @@ export declare const perpRoutes: {
198
203
  };
199
204
  readonly marginAccounts: {
200
205
  readonly list: (params?: {
201
- page?: number;
202
206
  pageSize?: number;
207
+ pageToken?: string;
203
208
  state?: string;
204
209
  tradingPairId?: string;
205
210
  }) => string;
@@ -219,17 +224,23 @@ export declare const perpRoutes: {
219
224
  readonly transferOutParent: () => string;
220
225
  readonly movements: (marginAccountId: string, params?: {
221
226
  movementType?: string;
222
- page?: number;
223
227
  pageSize?: number;
228
+ pageToken?: string;
224
229
  }) => string;
225
230
  readonly parentMovements: (params?: {
226
231
  movementType?: string;
227
- page?: number;
228
232
  pageSize?: number;
233
+ pageToken?: string;
229
234
  }) => string;
230
235
  readonly simulateParentMarginOrderRisk: () => string;
231
236
  readonly simulateOrderRisk: (marginAccountId: string) => string;
232
237
  readonly simulateRiskBucketOrderRisk: () => string;
238
+ readonly createSubAccount: () => string;
239
+ readonly closeSubAccount: (marginAccountId: string) => string;
240
+ readonly subAccountTransferIn: (marginAccountId: string) => string;
241
+ readonly subAccountTransferOut: (marginAccountId: string) => string;
242
+ readonly pnl: (marginAccountId: string) => string;
243
+ readonly transferCollateral: () => string;
233
244
  };
234
245
  readonly streams: {
235
246
  readonly orderbook: () => string;
@@ -119,6 +119,12 @@ export const perpRoutes = {
119
119
  simulateParentMarginOrderRisk: () => `${API_V1}/margin/parent-margin-account/simulate-order-risk`,
120
120
  simulateOrderRisk: (marginAccountId) => `${API_V1}/margin/accounts/${encodeSegment(marginAccountId)}/simulate-order-risk`,
121
121
  simulateRiskBucketOrderRisk: () => `${API_V1}/margin/risk-buckets/simulate-order-risk`,
122
+ createSubAccount: () => `${API_V1}/margin/sub-accounts`,
123
+ closeSubAccount: (marginAccountId) => `${API_V1}/margin/sub-accounts/${encodeSegment(marginAccountId)}/close`,
124
+ subAccountTransferIn: (marginAccountId) => `${API_V1}/margin/sub-accounts/${encodeSegment(marginAccountId)}/collateral/transfer-in`,
125
+ subAccountTransferOut: (marginAccountId) => `${API_V1}/margin/sub-accounts/${encodeSegment(marginAccountId)}/collateral/transfer-out`,
126
+ pnl: (marginAccountId) => `${API_V1}/margin/accounts/${encodeSegment(marginAccountId)}/pnl`,
127
+ transferCollateral: () => `${API_V1}/margin/collateral/transfer`,
122
128
  },
123
129
  streams: {
124
130
  orderbook: () => `${API_V1}/streaming/orderbook`,
@@ -33,7 +33,7 @@
33
33
  * console.log(`Rewards remaining: ${result.rewardsBalance}`);
34
34
  * ```
35
35
  */
36
- import type { GetMyReferralDownlineResponse, GetMyReferralPositionResponse, GetRewardsBalanceResponse, PitpassAPI, TraderCodeAvailabilityResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse } from "@0xmonaco/types";
36
+ import type { GetMyReferralDownlineParams, GetMyReferralDownlineResponse, GetMyReferralPositionResponse, GetMyReferralTreeParams, GetMyReferralTreeResponse, GetRewardsBalanceResponse, PitpassAPI, TraderCodeAvailabilityResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse } from "@0xmonaco/types";
37
37
  import { BaseAPI } from "../base";
38
38
  export declare class PitpassAPIImpl extends BaseAPI implements PitpassAPI {
39
39
  /**
@@ -77,15 +77,26 @@ export declare class PitpassAPIImpl extends BaseAPI implements PitpassAPI {
77
77
  */
78
78
  transferRewards(params: TransferRewardsParams): Promise<TransferRewardsResponse>;
79
79
  /**
80
- * Read the caller's own referral position: their L1 referrer, total earned,
81
- * and recent rewards. Self-scoped — no id is sent, so it can only ever return
82
- * your own chain. `referrer` is "" when you were not referred.
80
+ * Read the caller's own referral position: their upline (L1, L2, ...), their
81
+ * L1 referrer, total earned, and recent rewards. Self-scoped — no id is sent,
82
+ * so it can only ever return your own chain. `referrer` is "" and `upline` is
83
+ * empty when you were not referred.
83
84
  */
84
85
  getMyReferralPosition(): Promise<GetMyReferralPositionResponse>;
85
86
  /**
86
- * Read the caller's own downline: earnings by source across L1/L2/L3, the L1
87
- * direct-referee roster (including referees who haven't traded), and a
88
- * per-level earnings summary. Self-scoped, read-only.
87
+ * Read the caller's own downline: one page of earnings by source across
88
+ * every reward level (largest first), the L1 direct-referee roster
89
+ * (including referees who haven't traded), and a per-level earnings summary
90
+ * covering every level and source. Without paging params the server returns
91
+ * the first page (100 rows); follow `nextPageToken` until it is empty.
92
+ * Self-scoped, read-only.
89
93
  */
90
- getMyReferralDownline(): Promise<GetMyReferralDownlineResponse>;
94
+ getMyReferralDownline(params?: GetMyReferralDownlineParams): Promise<GetMyReferralDownlineResponse>;
95
+ /**
96
+ * Read one level of the caller's own referral tree: the wallets `parent`
97
+ * directly referred (the caller when omitted), a page at a time, newest
98
+ * first. `parent` must be the caller or one of their own referees above the
99
+ * deepest rewarded level; any other wallet is a 404.
100
+ */
101
+ getMyReferralTree(params?: GetMyReferralTreeParams): Promise<GetMyReferralTreeResponse>;
91
102
  }
@@ -33,7 +33,7 @@
33
33
  * console.log(`Rewards remaining: ${result.rewardsBalance}`);
34
34
  * ```
35
35
  */
36
- import { SetTraderCodeParamsSchema, TransferRewardsParamsSchema, validate } from "@0xmonaco/types";
36
+ import { GetMyReferralDownlineParamsSchema, GetMyReferralTreeParamsSchema, SetTraderCodeParamsSchema, TransferRewardsParamsSchema, validate, } from "@0xmonaco/types";
37
37
  import { BaseAPI } from "../base";
38
38
  export class PitpassAPIImpl extends BaseAPI {
39
39
  /**
@@ -109,9 +109,10 @@ export class PitpassAPIImpl extends BaseAPI {
109
109
  });
110
110
  }
111
111
  /**
112
- * Read the caller's own referral position: their L1 referrer, total earned,
113
- * and recent rewards. Self-scoped — no id is sent, so it can only ever return
114
- * your own chain. `referrer` is "" when you were not referred.
112
+ * Read the caller's own referral position: their upline (L1, L2, ...), their
113
+ * L1 referrer, total earned, and recent rewards. Self-scoped — no id is sent,
114
+ * so it can only ever return your own chain. `referrer` is "" and `upline` is
115
+ * empty when you were not referred.
115
116
  */
116
117
  async getMyReferralPosition() {
117
118
  return await this.makeAuthenticatedRequest("/api/v1/pitpass/referrals/me", {
@@ -119,13 +120,50 @@ export class PitpassAPIImpl extends BaseAPI {
119
120
  });
120
121
  }
121
122
  /**
122
- * Read the caller's own downline: earnings by source across L1/L2/L3, the L1
123
- * direct-referee roster (including referees who haven't traded), and a
124
- * per-level earnings summary. Self-scoped, read-only.
123
+ * Read the caller's own downline: one page of earnings by source across
124
+ * every reward level (largest first), the L1 direct-referee roster
125
+ * (including referees who haven't traded), and a per-level earnings summary
126
+ * covering every level and source. Without paging params the server returns
127
+ * the first page (100 rows); follow `nextPageToken` until it is empty.
128
+ * Self-scoped, read-only.
125
129
  */
126
- async getMyReferralDownline() {
127
- return await this.makeAuthenticatedRequest("/api/v1/pitpass/referrals/me/downline", {
128
- method: "GET",
129
- });
130
+ async getMyReferralDownline(params) {
131
+ if (params) {
132
+ validate(GetMyReferralDownlineParamsSchema, params);
133
+ }
134
+ const searchParams = new URLSearchParams();
135
+ if (params?.pageSize !== undefined) {
136
+ searchParams.append("pageSize", params.pageSize.toString());
137
+ }
138
+ if (params?.pageToken !== undefined) {
139
+ searchParams.append("pageToken", params.pageToken);
140
+ }
141
+ const query = searchParams.toString();
142
+ const path = query ? `/api/v1/pitpass/referrals/me/downline?${query}` : "/api/v1/pitpass/referrals/me/downline";
143
+ return await this.makeAuthenticatedRequest(path, { method: "GET" });
144
+ }
145
+ /**
146
+ * Read one level of the caller's own referral tree: the wallets `parent`
147
+ * directly referred (the caller when omitted), a page at a time, newest
148
+ * first. `parent` must be the caller or one of their own referees above the
149
+ * deepest rewarded level; any other wallet is a 404.
150
+ */
151
+ async getMyReferralTree(params) {
152
+ if (params) {
153
+ validate(GetMyReferralTreeParamsSchema, params);
154
+ }
155
+ const searchParams = new URLSearchParams();
156
+ if (params?.parent !== undefined) {
157
+ searchParams.append("parent", params.parent);
158
+ }
159
+ if (params?.pageSize !== undefined) {
160
+ searchParams.append("pageSize", params.pageSize.toString());
161
+ }
162
+ if (params?.pageToken !== undefined) {
163
+ searchParams.append("pageToken", params.pageToken);
164
+ }
165
+ const query = searchParams.toString();
166
+ const path = query ? `/api/v1/pitpass/referrals/me/tree?${query}` : "/api/v1/pitpass/referrals/me/tree";
167
+ return await this.makeAuthenticatedRequest(path, { method: "GET" });
130
168
  }
131
169
  }
@@ -1,9 +1,9 @@
1
- import type { PortfolioAPI, PortfolioAssets, PortfolioMargin, PortfolioPerformance, PortfolioPeriodParams, PortfolioRealizedPnl, PortfolioSummary } from "@0xmonaco/types";
1
+ import type { PortfolioAPI, PortfolioAssets, PortfolioMargin, PortfolioMarginParams, PortfolioPerformance, PortfolioPeriodParams, PortfolioRealizedPnl, PortfolioSummary } from "@0xmonaco/types";
2
2
  import { BaseAPI } from "../base";
3
3
  export declare class PortfolioAPIImpl extends BaseAPI implements PortfolioAPI {
4
4
  getSummary(params?: PortfolioPeriodParams): Promise<PortfolioSummary>;
5
5
  getPerformance(params?: PortfolioPeriodParams): Promise<PortfolioPerformance>;
6
6
  getRealizedPnl(params?: PortfolioPeriodParams): Promise<PortfolioRealizedPnl>;
7
7
  getAssets(params?: PortfolioPeriodParams): Promise<PortfolioAssets>;
8
- getMargin(): Promise<PortfolioMargin>;
8
+ getMargin(params?: PortfolioMarginParams): Promise<PortfolioMargin>;
9
9
  }
@@ -19,7 +19,16 @@ export class PortfolioAPIImpl extends BaseAPI {
19
19
  async getAssets(params) {
20
20
  return await this.makeAuthenticatedRequest(withPeriod(`${BASE_PATH}/assets`, params));
21
21
  }
22
- async getMargin() {
23
- return await this.makeAuthenticatedRequest(`${BASE_PATH}/margin`);
22
+ async getMargin(params) {
23
+ const query = new URLSearchParams();
24
+ if (params?.marginAccountId) {
25
+ query.set("marginAccountId", params.marginAccountId);
26
+ }
27
+ if (params?.includeAccounts !== undefined) {
28
+ query.set("includeAccounts", String(params.includeAccounts));
29
+ }
30
+ const search = query.toString();
31
+ const suffix = search ? `?${search}` : "";
32
+ return await this.makeAuthenticatedRequest(`${BASE_PATH}/margin${suffix}`);
24
33
  }
25
34
  }
@@ -2,10 +2,19 @@ import type { AttachPositionTpSlRequest, AttachPositionTpSlResponse, BatchCloseA
2
2
  import { BaseAPI } from "../base";
3
3
  export declare class PositionsAPIImpl extends BaseAPI implements PositionsAPI {
4
4
  /**
5
- * List the caller's positions with page-number pagination. The response
6
- * `total` is bounded by the listing's pagination reach: exact up to
7
- * `pageSize` x 10,000 rows and saturating there, so a `page` above 10,000 is
8
- * rejected rather than served past the last page `total` can report.
5
+ * List the caller's positions, cursor paged (0XM-2788): omit `pageToken` or
6
+ * pass `""` to start, then follow `nextPageToken` until it comes back
7
+ * empty. There is no `page` — sending one is a `400`.
8
+ *
9
+ * `total` is bounded by the server count ceiling; `totalCapped` is `true`
10
+ * when more than that matched, so it is a lower bound. Do not drive a
11
+ * paging loop off it — follow `nextPageToken`.
12
+ *
13
+ * Order depends on the filter: `status: "OPEN"` is served from the engine's
14
+ * live view in `(marginAccountId, tradingPairId, positionId)` order, every
15
+ * other filter from persisted rows newest-opened first. The two are
16
+ * separate cursor spaces, so a token is only valid in the one that minted
17
+ * it.
9
18
  */
10
19
  listPositions(params?: ListPositionsParams): Promise<ListPositionsResponse>;
11
20
  getPosition(positionId: string): Promise<GetPositionResponse>;
@@ -14,10 +23,13 @@ export declare class PositionsAPIImpl extends BaseAPI implements PositionsAPI {
14
23
  getPositionRisk(positionId: string): Promise<PositionRisk>;
15
24
  attachPositionTpSl(positionId: string, request: AttachPositionTpSlRequest): Promise<AttachPositionTpSlResponse>;
16
25
  /**
17
- * List the caller's position-history events with page-number pagination. The
18
- * response `total` is bounded by the listing's pagination reach: exact up to
19
- * `pageSize` x 10,000 rows and saturating there, so a `page` above 10,000 is
20
- * rejected rather than served past the last page `total` can report.
26
+ * List the caller's position-history events, cursor paged (0XM-2788): omit
27
+ * `pageToken` or pass `""` to start, then follow `nextPageToken` until it
28
+ * comes back empty. There is no `page` — sending one is a `400`.
29
+ *
30
+ * The response carries no item count: this listing spans the hot table and
31
+ * the archive, so counting behind a filter would walk the caller's whole
32
+ * lifetime prefix on every page.
21
33
  */
22
34
  listPositionHistory(params?: ListPositionHistoryParams): Promise<ListPositionHistoryResponse>;
23
35
  getPositionPnlHistory(positionId: string, params: GetPositionPnlHistoryParams): Promise<GetPositionPnlHistoryResponse>;
@@ -3,10 +3,19 @@ import { BaseAPI } from "../base";
3
3
  import { perpRoutes } from "../perp";
4
4
  export class PositionsAPIImpl extends BaseAPI {
5
5
  /**
6
- * List the caller's positions with page-number pagination. The response
7
- * `total` is bounded by the listing's pagination reach: exact up to
8
- * `pageSize` x 10,000 rows and saturating there, so a `page` above 10,000 is
9
- * rejected rather than served past the last page `total` can report.
6
+ * List the caller's positions, cursor paged (0XM-2788): omit `pageToken` or
7
+ * pass `""` to start, then follow `nextPageToken` until it comes back
8
+ * empty. There is no `page` — sending one is a `400`.
9
+ *
10
+ * `total` is bounded by the server count ceiling; `totalCapped` is `true`
11
+ * when more than that matched, so it is a lower bound. Do not drive a
12
+ * paging loop off it — follow `nextPageToken`.
13
+ *
14
+ * Order depends on the filter: `status: "OPEN"` is served from the engine's
15
+ * live view in `(marginAccountId, tradingPairId, positionId)` order, every
16
+ * other filter from persisted rows newest-opened first. The two are
17
+ * separate cursor spaces, so a token is only valid in the one that minted
18
+ * it.
10
19
  */
11
20
  async listPositions(params) {
12
21
  if (params) {
@@ -90,10 +99,13 @@ export class PositionsAPIImpl extends BaseAPI {
90
99
  });
91
100
  }
92
101
  /**
93
- * List the caller's position-history events with page-number pagination. The
94
- * response `total` is bounded by the listing's pagination reach: exact up to
95
- * `pageSize` x 10,000 rows and saturating there, so a `page` above 10,000 is
96
- * rejected rather than served past the last page `total` can report.
102
+ * List the caller's position-history events, cursor paged (0XM-2788): omit
103
+ * `pageToken` or pass `""` to start, then follow `nextPageToken` until it
104
+ * comes back empty. There is no `page` — sending one is a `400`.
105
+ *
106
+ * The response carries no item count: this listing spans the hot table and
107
+ * the archive, so counting behind a filter would walk the caller's whole
108
+ * lifetime prefix on every page.
97
109
  */
98
110
  async listPositionHistory(params) {
99
111
  if (params) {
@@ -50,14 +50,19 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
50
50
  * Fetches the user's transaction history from the /api/v1/accounts/movements endpoint.
51
51
  * Requires a valid access token to be set.
52
52
  *
53
- * The response `total` and `totalPages` are bounded by the listing's pagination reach:
54
- * exact up to `pageSize` x 10,000 rows (10,000 pages) and saturating there, so a user
55
- * with more matching movements than the listing can page through reads the cap, not
56
- * their lifetime total. A `page` above 10,000 is rejected.
53
+ * Cursor paged (0XM-2788/0XM-2820): omit `pageToken` or pass `""` to start,
54
+ * then follow `nextPageToken` from each response until it comes back empty.
55
+ * There is no `page` — sending one is a `400`.
56
+ *
57
+ * The response `total` and `totalPages` are bounded by the server count
58
+ * ceiling; `totalCapped` is `true` when more than that matched, so `total`
59
+ * is a lower bound. Do not drive a paging loop off `total`: a user past the
60
+ * ceiling would stop early. Follow `nextPageToken`.
57
61
  *
58
62
  * @param params - Optional query parameters for pagination and filtering
59
- * @param params.page - Page number (starts from 1, default: 1, at most 10,000)
60
- * @param params.limit - Number of items per page (default: 20, max: 100)
63
+ * @param params.pageToken - Cursor from a previous response's `nextPageToken`
64
+ * @param params.pageSize - Number of items per page (default: 20, max: 1000)
65
+ * @param params.orderBy - Sort direction for `createdAt` (default: `"DESC"`)
61
66
  * @param params.entryType - Filter by entry type (CREDIT, DEBIT, LOCK, UNLOCK, FEE)
62
67
  * @param params.transactionType - Filter by transaction type (DEPOSIT, WITHDRAWAL, TRADE, FEE, FUNDING, LIQUIDATION, INTEREST, REWARD)
63
68
  * @param params.assetId - Filter by asset ID (UUID)
@@ -70,9 +75,14 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
70
75
  * const movements = await profileAPI.getPaginatedUserMovements();
71
76
  * console.log(`Total movements: ${movements.total}`);
72
77
  *
73
- * // Get second page with custom pageSize
74
- * const page2 = await profileAPI.getPaginatedUserMovements({ page: 2, pageSize: 50 });
75
- * console.log(`Page ${page2.page} of ${page2.totalPages}`);
78
+ * // Walk every page
79
+ * let pageToken = "";
80
+ * for (;;) {
81
+ * const page = await profileAPI.getPaginatedUserMovements({ pageToken, pageSize: 50 });
82
+ * console.log(page.movements.length);
83
+ * if (page.nextPageToken === "") break;
84
+ * pageToken = page.nextPageToken;
85
+ * }
76
86
  *
77
87
  * // Filter by entry type and transaction type
78
88
  * const deposits = await profileAPI.getPaginatedUserMovements({ entryType: "CREDIT", transactionType: "DEPOSIT" });
@@ -88,9 +98,13 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
88
98
  * Fetches the user's token balances from the /api/v1/accounts/balances endpoint.
89
99
  * Requires a valid access token to be set.
90
100
  *
101
+ * Cursor paged (0XM-2788/0XM-2821): omit `pageToken` or pass `""` to start,
102
+ * then follow `nextPageToken` until it comes back empty. There is no `page`
103
+ * — sending one is a `400`.
104
+ *
91
105
  * @param params - Optional query parameters for pagination
92
- * @param params.page - Page number (starts from 1, default: 1)
93
- * @param params.pageSize - Number of items per page (default: 20, max: 100)
106
+ * @param params.pageToken - Cursor from a previous response's `nextPageToken`
107
+ * @param params.pageSize - Number of items per page (default: 20, max: 1000)
94
108
  * @returns Promise resolving to paginated balances response
95
109
  * @throws {APIError} When the request fails or user is not authenticated
96
110
  *
@@ -103,9 +117,14 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
103
117
  * console.log(`${balance.symbol}: ${balance.availableBalance}`);
104
118
  * });
105
119
  *
106
- * // Get page 2 with 50 items per page
107
- * const nextBalances = await profileAPI.getUserBalances({ page: 2, pageSize: 50 });
108
- * console.log(`Returned ${nextBalances.balances.length} balances`);
120
+ * // Walk every page
121
+ * let pageToken = "";
122
+ * for (;;) {
123
+ * const page = await profileAPI.getUserBalances({ pageToken, pageSize: 50 });
124
+ * console.log(page.balances.length);
125
+ * if (page.nextPageToken === "") break;
126
+ * pageToken = page.nextPageToken;
127
+ * }
109
128
  * ```
110
129
  */
111
130
  getUserBalances(params?: GetUserBalancesParams): Promise<GetUserBalancesResponse>;
@@ -233,12 +252,21 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
233
252
  * Fetches funding payments from the /api/v1/accounts/funding-payments endpoint.
234
253
  * Requires a valid access token to be set.
235
254
  *
236
- * The response `total` and `totalPages` are bounded by the listing's pagination reach:
237
- * exact up to `pageSize` x 10,000 rows (10,000 pages) and saturating there, so a user
238
- * with more matching payments than the listing can page through reads the cap, not
239
- * their lifetime total. A `page` above 10,000 is rejected.
255
+ * Cursor paged (0XM-2788/0XM-2818): omit `pageToken` or pass `""` to start,
256
+ * then follow `nextPageToken` from each response until it comes back empty.
257
+ * There is no `page` — sending one is a `400`.
258
+ *
259
+ * The response `total` and `totalPages` are bounded by the server count
260
+ * ceiling; `totalCapped` is `true` when more than that matched, so `total`
261
+ * is a lower bound. Do not drive a paging loop off `total`: a user past the
262
+ * ceiling would stop early. Follow `nextPageToken`.
240
263
  *
241
264
  * @param params - Optional query parameters for pagination and filtering
265
+ * @param params.pageToken - Cursor from a previous response's `nextPageToken`
266
+ * @param params.pageSize - Number of items per page (default: 20, max: 1000)
267
+ * @param params.tradingPairId - Filter by trading pair ID (UUID)
268
+ * @param params.positionId - Filter by margin position ID (UUID)
269
+ * @param params.marginAccountId - Filter by margin account ID (UUID)
242
270
  * @returns Promise resolving to paginated funding payments response
243
271
  * @throws {APIError} When the request fails or user is not authenticated
244
272
  *
@@ -246,6 +274,15 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
246
274
  * ```typescript
247
275
  * const funding = await profileAPI.listFundingPayments({ tradingPairId: "550e8400-e29b-41d4-a716-446655440000" });
248
276
  * console.log(`Total funding payments: ${funding.total}`);
277
+ *
278
+ * // Walk every page
279
+ * let pageToken = "";
280
+ * for (;;) {
281
+ * const page = await profileAPI.listFundingPayments({ pageToken, pageSize: 100 });
282
+ * console.log(page.records.length);
283
+ * if (page.nextPageToken === "") break;
284
+ * pageToken = page.nextPageToken;
285
+ * }
249
286
  * ```
250
287
  */
251
288
  listFundingPayments(params?: ListFundingPaymentsParams): Promise<ListFundingPaymentsResponse>;