@@ -15,6 +15,7 @@ import {
1515 mapNuanzeNewsResponse ,
1616 mapNuanzeOpenPositionsResponse ,
1717 mapNuanzePlatformSummaryResponse ,
18+ mapNuanzeSubaccountLeaderboardResponse ,
1819 mapNuanzeWalletPnlResponse ,
1920 mapNuanzeWalletPnlSeriesResponse ,
2021 mapNuanzeWalletPositionsResponse ,
@@ -52,6 +53,8 @@ import {
5253 GetNuanzeOpenPositionsResponse ,
5354 GetNuanzePlatformSummaryParams ,
5455 GetNuanzePlatformSummaryResponse ,
56+ GetNuanzeSubaccountLeaderboardParams ,
57+ GetNuanzeSubaccountLeaderboardResponse ,
5558 GetNuanzeWalletPnlParams ,
5659 GetNuanzeWalletPnlResponse ,
5760 GetNuanzeWalletPnlSeriesParams ,
@@ -80,6 +83,7 @@ import {
8083 NuanzeServerNewsResponse ,
8184 NuanzeServerOpenPositionsResponse ,
8285 NuanzeServerPlatformSummaryResponse ,
86+ NuanzeServerSubaccountLeaderboardResponse ,
8387 NuanzeServerWalletPnlResponse ,
8488 NuanzeServerWalletPnlSeriesResponse ,
8589 NuanzeServerWalletPositionsResponse ,
@@ -106,8 +110,8 @@ export interface NuanzeClientOpts {
106110 * linked signer. It also sends no `x-nado-client-type` header: Nuanze is a public API that does not
107111 * attribute traffic per client, and its `Access-Control-Allow-Headers` does not list the header, so
108112 * sending it would fail CORS preflight in the browser. Most operations are GET;
109- * {@link NuanzeClient.getFollowedLeaderboard} is a non-mutating POST whose body carries a followed
110- * set larger than a query string can reliably hold .
113+ * {@link NuanzeClient.getFollowedLeaderboard} is a non-mutating POST whose body identifies the
114+ * username whose follow graph should be ranked .
111115 */
112116export class NuanzeClient {
113117 readonly opts : NuanzeClientOpts ;
@@ -213,6 +217,25 @@ export class NuanzeClient {
213217 ) ;
214218 }
215219
220+ /**
221+ * Gets the global public leaderboard of username-claimed subaccounts. Results are sorted by
222+ * equity-basis account PnL descending with nulls last. `globalRank` is independent of the active
223+ * privacy and trading filters. Pagination uses a filter-bound opaque cursor.
224+ *
225+ * @throws {NuanzeServerFailureError } With `BAD_REQUEST`, `INVALID_CURSOR`, or
226+ * `CURSOR_FILTER_MISMATCH` when filters or the cursor are invalid.
227+ */
228+ async getSubaccountLeaderboard (
229+ params : GetNuanzeSubaccountLeaderboardParams = { } ,
230+ ) : Promise < GetNuanzeSubaccountLeaderboardResponse > {
231+ return mapNuanzeSubaccountLeaderboardResponse (
232+ await this . getJson < NuanzeServerSubaccountLeaderboardResponse > (
233+ '/leaderboard/subaccounts' ,
234+ params ,
235+ ) ,
236+ ) ;
237+ }
238+
216239 /**
217240 * Gets platform activity summary from five-minute aggregates.
218241 *
@@ -230,14 +253,12 @@ export class NuanzeClient {
230253 }
231254
232255 /**
233- * Gets leaderboard stats for a set of followed subaccounts. POST rather than GET so the body can
234- * carry up to 300 `subaccountHex` values. The response preserves request order. Subaccounts with
235- * no data in the window are backfilled with `pnl: null`, `globalRank: null`, zero counts, and an
236- * empty `productIds`. The response is not cached.
256+ * Gets leaderboard stats for the subaccounts a username actively follows, capped at 300 and
257+ * sorted by PnL descending with nulls last. Subaccounts with no PnL in the window are included by
258+ * default with null PnL/rank, zero counts, and no products. The response is not cached.
237259 *
238- * @throws {NuanzeServerFailureError } With `INVALID_SUBACCOUNT` if a hex is not 32-byte
239- * 0x-prefixed, and `BAD_REQUEST` if the set is empty, exceeds 300, or `timeframe` is not a
240- * documented value.
260+ * @throws {NuanzeServerFailureError } With `BAD_REQUEST` when params are invalid, or
261+ * `USERNAME_NOT_FOUND` when the supplied username has no claimed identity.
241262 */
242263 async getFollowedLeaderboard (
243264 params : GetNuanzeFollowedLeaderboardParams ,
0 commit comments