@nadohq/nuanze-client 0.41.0 → 0.42.0

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 (87) hide show
  1. package/README.md +2 -9
  2. package/dist/{NuanzeClient-BUjoXpWV.cjs → NuanzeClient-ILfa7B1C.cjs} +25 -28
  3. package/dist/NuanzeClient-ILfa7B1C.cjs.map +1 -0
  4. package/dist/NuanzeClient.cjs +1 -1
  5. package/dist/NuanzeClient.d.cts +19 -22
  6. package/dist/NuanzeClient.d.cts.map +1 -1
  7. package/dist/NuanzeClient.d.ts +19 -22
  8. package/dist/NuanzeClient.d.ts.map +1 -1
  9. package/dist/NuanzeClient.js +25 -28
  10. package/dist/NuanzeClient.js.map +1 -1
  11. package/dist/{NuanzeServerFailureError-DqWaKEMA.d.ts → NuanzeServerFailureError-C2iF5q-P.d.ts} +4 -4
  12. package/dist/{NuanzeServerFailureError-DqWaKEMA.d.ts.map → NuanzeServerFailureError-C2iF5q-P.d.ts.map} +1 -1
  13. package/dist/{NuanzeServerFailureError-B9EhXPyW.d.cts → NuanzeServerFailureError-CMeSnmPF.d.cts} +4 -4
  14. package/dist/{NuanzeServerFailureError-B9EhXPyW.d.cts.map → NuanzeServerFailureError-CMeSnmPF.d.cts.map} +1 -1
  15. package/dist/{clientModelTypes-A-D7ER-p.d.ts → clientModelTypes-DNPU1Q4B.d.ts} +48 -6
  16. package/dist/{clientModelTypes-A-D7ER-p.d.ts.map → clientModelTypes-DNPU1Q4B.d.ts.map} +1 -1
  17. package/dist/{clientModelTypes-BLPA-e3V.d.cts → clientModelTypes-YrD7pXq6.d.cts} +48 -6
  18. package/dist/{clientModelTypes-BLPA-e3V.d.cts.map → clientModelTypes-YrD7pXq6.d.cts.map} +1 -1
  19. package/dist/{clientTypes-Du2RLy4W.d.cts → clientTypes-COeQAlKN.d.cts} +51 -12
  20. package/dist/clientTypes-COeQAlKN.d.cts.map +1 -0
  21. package/dist/{clientTypes-DdpinbkS.d.ts → clientTypes-CpOcZ6ST.d.ts} +51 -12
  22. package/dist/clientTypes-CpOcZ6ST.d.ts.map +1 -0
  23. package/dist/dataMappers.cjs +40 -4
  24. package/dist/dataMappers.cjs.map +1 -1
  25. package/dist/dataMappers.d.cts +14 -6
  26. package/dist/dataMappers.d.cts.map +1 -1
  27. package/dist/dataMappers.d.ts +14 -6
  28. package/dist/dataMappers.d.ts.map +1 -1
  29. package/dist/dataMappers.js +38 -4
  30. package/dist/dataMappers.js.map +1 -1
  31. package/dist/index.cjs +3 -1
  32. package/dist/index.d.cts +8 -8
  33. package/dist/index.d.ts +8 -8
  34. package/dist/index.js +2 -2
  35. package/dist/{nuanzeErrorCodes-Dh6juim0.d.ts → nuanzeErrorCodes-DMoRcCHK.d.cts} +2 -2
  36. package/dist/{nuanzeErrorCodes-CWCTWh2k.d.cts.map → nuanzeErrorCodes-DMoRcCHK.d.cts.map} +1 -1
  37. package/dist/{nuanzeErrorCodes-CWCTWh2k.d.cts → nuanzeErrorCodes-DewKYqCe.d.ts} +2 -2
  38. package/dist/nuanzeErrorCodes-DewKYqCe.d.ts.map +1 -0
  39. package/dist/{serverModelTypes-D-vS_7uc.d.ts → serverModelTypes-BJzL4GkE.d.cts} +23 -3
  40. package/dist/serverModelTypes-BJzL4GkE.d.cts.map +1 -0
  41. package/dist/{serverModelTypes-DZDxdIzz.d.cts → serverModelTypes-Ch4IifDo.d.ts} +23 -3
  42. package/dist/serverModelTypes-Ch4IifDo.d.ts.map +1 -0
  43. package/dist/{serverQueryTypes-e7HWmE8t.d.ts → serverQueryTypes-BDI5rETc.d.ts} +17 -7
  44. package/dist/serverQueryTypes-BDI5rETc.d.ts.map +1 -0
  45. package/dist/{serverQueryTypes-BBIFZZ36.d.cts → serverQueryTypes-RBQQXK5Y.d.cts} +17 -7
  46. package/dist/serverQueryTypes-RBQQXK5Y.d.cts.map +1 -0
  47. package/dist/types/NuanzeServerFailureError.cjs.map +1 -1
  48. package/dist/types/NuanzeServerFailureError.d.cts +1 -1
  49. package/dist/types/NuanzeServerFailureError.d.ts +1 -1
  50. package/dist/types/NuanzeServerFailureError.js.map +1 -1
  51. package/dist/types/clientModelTypes.cjs.map +1 -1
  52. package/dist/types/clientModelTypes.d.cts +2 -2
  53. package/dist/types/clientModelTypes.d.ts +2 -2
  54. package/dist/types/clientModelTypes.js.map +1 -1
  55. package/dist/types/clientTypes.d.cts +2 -2
  56. package/dist/types/clientTypes.d.ts +2 -2
  57. package/dist/types/index.d.cts +7 -7
  58. package/dist/types/index.d.ts +7 -7
  59. package/dist/types/nuanzeErrorCodes.cjs +1 -1
  60. package/dist/types/nuanzeErrorCodes.cjs.map +1 -1
  61. package/dist/types/nuanzeErrorCodes.d.cts +1 -1
  62. package/dist/types/nuanzeErrorCodes.d.ts +1 -1
  63. package/dist/types/nuanzeErrorCodes.js +1 -1
  64. package/dist/types/nuanzeErrorCodes.js.map +1 -1
  65. package/dist/types/serverModelTypes.d.cts +2 -2
  66. package/dist/types/serverModelTypes.d.ts +2 -2
  67. package/dist/types/serverQueryTypes.cjs.map +1 -1
  68. package/dist/types/serverQueryTypes.d.cts +2 -2
  69. package/dist/types/serverQueryTypes.d.ts +2 -2
  70. package/dist/types/serverQueryTypes.js.map +1 -1
  71. package/package.json +3 -3
  72. package/src/NuanzeClient.ts +36 -29
  73. package/src/dataMappers.ts +46 -2
  74. package/src/types/NuanzeServerFailureError.ts +1 -1
  75. package/src/types/clientModelTypes.ts +47 -4
  76. package/src/types/clientTypes.ts +51 -9
  77. package/src/types/nuanzeErrorCodes.ts +1 -1
  78. package/src/types/serverModelTypes.ts +21 -0
  79. package/src/types/serverQueryTypes.ts +14 -2
  80. package/dist/NuanzeClient-BUjoXpWV.cjs.map +0 -1
  81. package/dist/clientTypes-DdpinbkS.d.ts.map +0 -1
  82. package/dist/clientTypes-Du2RLy4W.d.cts.map +0 -1
  83. package/dist/nuanzeErrorCodes-Dh6juim0.d.ts.map +0 -1
  84. package/dist/serverModelTypes-D-vS_7uc.d.ts.map +0 -1
  85. package/dist/serverModelTypes-DZDxdIzz.d.cts.map +0 -1
  86. package/dist/serverQueryTypes-BBIFZZ36.d.cts.map +0 -1
  87. package/dist/serverQueryTypes-e7HWmE8t.d.ts.map +0 -1
package/README.md CHANGED
@@ -29,14 +29,14 @@ Nuanze runs a single public deployment that serves mainnet data, so every entry
29
29
 
30
30
  ## API Surface
31
31
 
32
- Each method maps one-to-one onto a public operation. Most are GET; `getFollowedLeaderboard` is a
33
- non-mutating POST whose body carries the followed set:
32
+ Each method maps one-to-one onto a public GET operation:
34
33
 
35
34
  - `getNews`
36
35
  - `getMarkets`
37
36
  - `getMarketByTicker`
38
37
  - `getFundingRates`
39
38
  - `getLeaderboard`
39
+ - `getSubaccountLeaderboard`
40
40
  - `getPlatformSummary`
41
41
  - `getFollowedLeaderboard`
42
42
  - `getWalletSummary`
@@ -60,13 +60,6 @@ Decimal fields are mapped to `BigNumber`; timestamps stay UTC ISO 8601 strings,
60
60
  Failures arrive as `NuanzeServerFailureError`, carrying `errorCode` (comparable against
61
61
  `NUANZE_ERROR_CODES`), `httpStatus`, and the `requestId` to quote when reporting the failure.
62
62
 
63
- ## Rate Limits
64
-
65
- The API meters a weighted token bucket per client IP and reports its state in the `RateLimit-Limit`,
66
- `RateLimit-Remaining`, and `RateLimit-Reset` response headers. The client never retries, sleeps, or
67
- self-throttles; add an interceptor on `nuanze.axiosInstance` to observe the headers or to apply per-request
68
- timeouts and cancellation.
69
-
70
63
  ## License
71
64
 
72
65
  ISC
@@ -33,11 +33,7 @@ axios = __toESM(axios, 1);
33
33
  * Read-only and credential-free, so unlike the other service clients it takes no wallet client or
34
34
  * linked signer. It also sends no `x-nado-client-type` header: Nuanze is a public API that does not
35
35
  * attribute traffic per client, and its `Access-Control-Allow-Headers` does not list the header, so
36
- * sending it would fail CORS preflight in the browser. Most operations are GET;
37
- * {@link NuanzeClient.getFollowedLeaderboard} is a non-mutating POST whose body carries a followed
38
- * set larger than a query string can reliably hold. The API meters a weighted token bucket per
39
- * client IP and reports its state in the `RateLimit-Limit`, `RateLimit-Remaining`, and
40
- * `RateLimit-Reset` response headers; add an interceptor on {@link axiosInstance} to observe them.
36
+ * sending it would fail CORS preflight in the browser. All operations are GET.
41
37
  */
42
38
  var NuanzeClient = class {
43
39
  constructor(opts) {
@@ -94,7 +90,7 @@ var NuanzeClient = class {
94
90
  }
95
91
  /**
96
92
  * Gets the account PnL leaderboard. Equity-basis account PnL includes realized and unrealized
97
- * movement plus funding and is not realized PnL. All-time analytics cost five rate-limit units.
93
+ * movement plus funding and is not realized PnL.
98
94
  *
99
95
  * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid.
100
96
  */
@@ -102,6 +98,17 @@ var NuanzeClient = class {
102
98
  return require_dataMappers.mapNuanzeLeaderboardResponse(await this.getJson("/leaderboard", params));
103
99
  }
104
100
  /**
101
+ * Gets the global public leaderboard of username-claimed subaccounts. Results are sorted by
102
+ * equity-basis account PnL descending with nulls last. `globalRank` is independent of the active
103
+ * privacy and trading filters. Pagination uses a filter-bound opaque cursor.
104
+ *
105
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`, or
106
+ * `CURSOR_FILTER_MISMATCH` when filters or the cursor are invalid.
107
+ */
108
+ async getSubaccountLeaderboard(params = {}) {
109
+ return require_dataMappers.mapNuanzeSubaccountLeaderboardResponse(await this.getJson("/leaderboard/subaccounts", params));
110
+ }
111
+ /**
105
112
  * Gets platform activity summary from five-minute aggregates.
106
113
  *
107
114
  * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if the window is not a documented value.
@@ -110,17 +117,15 @@ var NuanzeClient = class {
110
117
  return require_dataMappers.mapNuanzePlatformSummaryResponse(await this.getJson("/platform/summary", params));
111
118
  }
112
119
  /**
113
- * Gets leaderboard stats for a set of followed subaccounts. POST rather than GET so the body can
114
- * carry up to 300 `subaccountHex` values. The response preserves request order. Subaccounts with
115
- * no data in the window are backfilled with `pnl: null`, `globalRank: null`, zero counts, and an
116
- * empty `productIds`. Costs five rate-limit units. The response is not cached.
120
+ * Gets a keyset-paginated leaderboard for every subaccount a username actively follows, sorted
121
+ * by PnL descending with nulls last. Subaccounts with no PnL in the window are included by
122
+ * default with null PnL/rank, zero counts, and no products.
117
123
  *
118
- * @throws {NuanzeServerFailureError} With `INVALID_SUBACCOUNT` if a hex is not 32-byte
119
- * 0x-prefixed, and `BAD_REQUEST` if the set is empty, exceeds 300, or `timeframe` is not a
120
- * documented value.
124
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when params are invalid, or
125
+ * `USERNAME_NOT_FOUND` when the supplied username has no claimed identity.
121
126
  */
122
127
  async getFollowedLeaderboard(params) {
123
- return require_dataMappers.mapNuanzeFollowedLeaderboardResponse(await this.postJson("/wallets/leaderboard", params));
128
+ return require_dataMappers.mapNuanzeFollowedLeaderboardResponse(await this.getJson("/wallets/leaderboard", params));
124
129
  }
125
130
  /**
126
131
  * Gets replica-backed wallet analytics. Without `subaccountName`, latest cumulative values are
@@ -241,7 +246,7 @@ var NuanzeClient = class {
241
246
  * Gets privacy-preserving aggregate positioning for an active perpetual. Cross and isolated legs
242
247
  * are summed within owner/subaccount/product before direction classification. Every cell requires
243
248
  * at least 20 distinct contributing owners. No identity, individual position, entry price, PnL,
244
- * margin, or leverage fields are returned. This operation costs five rate-limit units.
249
+ * margin, or leverage fields are returned.
245
250
  *
246
251
  * @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`, or
247
252
  * `BAD_REQUEST` on invalid input, and `MARKET_NOT_FOUND` when the ticker does not resolve to a
@@ -269,8 +274,7 @@ var NuanzeClient = class {
269
274
  * Lists current open perpetual position legs across every market by signed unrealized PnL.
270
275
  * Descending returns the largest gainers and ascending returns the largest losers. This is a
271
276
  * latest indexed snapshot with no timeframe. Legs below $10 absolute notional are excluded.
272
- * Each row includes market identity and its source snapshot timestamp. Costs five rate-limit
273
- * units.
277
+ * Each row includes market identity and its source snapshot timestamp.
274
278
  *
275
279
  * @throws {NuanzeServerFailureError} With `INVALID_CURSOR`, `CURSOR_FILTER_MISMATCH`, or
276
280
  * `BAD_REQUEST` when the query or cursor is invalid.
@@ -282,18 +286,11 @@ var NuanzeClient = class {
282
286
  * Performs a GET against `{baseUrl}{path}` and classifies the status before returning the body.
283
287
  */
284
288
  async getJson(path, params) {
285
- return this.requestJson("GET", path, { params });
286
- }
287
- /**
288
- * Performs a POST against `{baseUrl}{path}` with a JSON body and classifies the status before
289
- * returning the response. Used only for the non-mutating followed-leaderboard operation.
290
- */
291
- async postJson(path, data) {
292
- return this.requestJson("POST", path, { data });
289
+ return this.requestJson(path, { params });
293
290
  }
294
- async requestJson(method, path, config = {}) {
291
+ async requestJson(path, config = {}) {
295
292
  const response = await this.axiosInstance.request({
296
- method,
293
+ method: "GET",
297
294
  url: `${this.opts.url}${path}`,
298
295
  ...config
299
296
  });
@@ -324,4 +321,4 @@ Object.defineProperty(exports, "__toESM", {
324
321
  }
325
322
  });
326
323
 
327
- //# sourceMappingURL=NuanzeClient-BUjoXpWV.cjs.map
324
+ //# sourceMappingURL=NuanzeClient-ILfa7B1C.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NuanzeClient-ILfa7B1C.cjs","names":["mapNuanzeNewsResponse","mapNuanzeMarketsResponse","mapNuanzeMarketByTickerResponse","mapNuanzeFundingRatesResponse","mapNuanzeLeaderboardResponse","mapNuanzeSubaccountLeaderboardResponse","mapNuanzePlatformSummaryResponse","mapNuanzeFollowedLeaderboardResponse","mapNuanzeWalletSummaryResponse","mapNuanzeWalletPositionsResponse","mapNuanzeMarketTradesResponse","mapNuanzeMarketCandlesResponse","mapNuanzeWalletTradesResponse","mapNuanzeWalletPnlResponse","mapNuanzeWalletPnlSeriesResponse","mapNuanzeCollateralFlowsResponse","mapNuanzeCollateralFlowSummaryResponse","mapNuanzeCollateralFlowSeriesResponse","mapNuanzeMarketPositioningResponse","mapNuanzeMarketPositionsResponse","mapNuanzeOpenPositionsResponse","isNuanzeServerFailureResponse","NuanzeServerFailureError"],"sources":["../src/NuanzeClient.ts"],"sourcesContent":["import axios, { AxiosInstance, AxiosResponse } from 'axios';\nimport {\n mapNuanzeCollateralFlowSeriesResponse,\n mapNuanzeCollateralFlowSummaryResponse,\n mapNuanzeCollateralFlowsResponse,\n mapNuanzeFollowedLeaderboardResponse,\n mapNuanzeFundingRatesResponse,\n mapNuanzeLeaderboardResponse,\n mapNuanzeMarketByTickerResponse,\n mapNuanzeMarketCandlesResponse,\n mapNuanzeMarketPositioningResponse,\n mapNuanzeMarketPositionsResponse,\n mapNuanzeMarketTradesResponse,\n mapNuanzeMarketsResponse,\n mapNuanzeNewsResponse,\n mapNuanzeOpenPositionsResponse,\n mapNuanzePlatformSummaryResponse,\n mapNuanzeSubaccountLeaderboardResponse,\n mapNuanzeWalletPnlResponse,\n mapNuanzeWalletPnlSeriesResponse,\n mapNuanzeWalletPositionsResponse,\n mapNuanzeWalletSummaryResponse,\n mapNuanzeWalletTradesResponse,\n} from './dataMappers';\nimport {\n GetNuanzeCollateralFlowSeriesParams,\n GetNuanzeCollateralFlowSeriesResponse,\n GetNuanzeCollateralFlowSummaryParams,\n GetNuanzeCollateralFlowSummaryResponse,\n GetNuanzeCollateralFlowsParams,\n GetNuanzeCollateralFlowsResponse,\n GetNuanzeFollowedLeaderboardParams,\n GetNuanzeFollowedLeaderboardResponse,\n GetNuanzeFundingRatesParams,\n GetNuanzeFundingRatesResponse,\n GetNuanzeLeaderboardParams,\n GetNuanzeLeaderboardResponse,\n GetNuanzeMarketByTickerParams,\n GetNuanzeMarketByTickerResponse,\n GetNuanzeMarketCandlesParams,\n GetNuanzeMarketCandlesResponse,\n GetNuanzeMarketPositioningParams,\n GetNuanzeMarketPositioningResponse,\n GetNuanzeMarketPositionsParams,\n GetNuanzeMarketPositionsResponse,\n GetNuanzeMarketTradesParams,\n GetNuanzeMarketTradesResponse,\n GetNuanzeMarketsParams,\n GetNuanzeMarketsResponse,\n GetNuanzeNewsParams,\n GetNuanzeNewsResponse,\n GetNuanzeOpenPositionsParams,\n GetNuanzeOpenPositionsResponse,\n GetNuanzePlatformSummaryParams,\n GetNuanzePlatformSummaryResponse,\n GetNuanzeSubaccountLeaderboardParams,\n GetNuanzeSubaccountLeaderboardResponse,\n GetNuanzeWalletPnlParams,\n GetNuanzeWalletPnlResponse,\n GetNuanzeWalletPnlSeriesParams,\n GetNuanzeWalletPnlSeriesResponse,\n GetNuanzeWalletPositionsParams,\n GetNuanzeWalletPositionsResponse,\n GetNuanzeWalletSummaryParams,\n GetNuanzeWalletSummaryResponse,\n GetNuanzeWalletTradesParams,\n GetNuanzeWalletTradesResponse,\n} from './types/clientTypes';\nimport { NuanzeServerFailureError } from './types/NuanzeServerFailureError';\nimport { NuanzeServerMarketPositioningResponse } from './types/serverModelTypes';\nimport {\n NuanzeServerCollateralFlowSeriesResponse,\n NuanzeServerCollateralFlowSummaryResponse,\n NuanzeServerCollateralFlowsResponse,\n NuanzeServerFollowedLeaderboardResponse,\n NuanzeServerFundingRatesResponse,\n NuanzeServerLeaderboardResponse,\n NuanzeServerMarketByTickerResponse,\n NuanzeServerMarketCandlesResponse,\n NuanzeServerMarketPositionsResponse,\n NuanzeServerMarketTradesResponse,\n NuanzeServerMarketsResponse,\n NuanzeServerNewsResponse,\n NuanzeServerOpenPositionsResponse,\n NuanzeServerPlatformSummaryResponse,\n NuanzeServerSubaccountLeaderboardResponse,\n NuanzeServerWalletPnlResponse,\n NuanzeServerWalletPnlSeriesResponse,\n NuanzeServerWalletPositionsResponse,\n NuanzeServerWalletSummaryResponse,\n NuanzeServerWalletTradesResponse,\n isNuanzeServerFailureResponse,\n} from './types/serverQueryTypes';\n\n/**\n * Options for constructing a {@link NuanzeClient}.\n */\nexport interface NuanzeClientOpts {\n /**\n * Base URL of the Nuanze API, including the version segment, e.g. {@link NUANZE_CLIENT_ENDPOINTS}.\n */\n url: string;\n}\n\n/**\n * Client for the Nuanze public analytics API: markets, wallets, trades, candles, collateral flows,\n * and positioning.\n *\n * Read-only and credential-free, so unlike the other service clients it takes no wallet client or\n * linked signer. It also sends no `x-nado-client-type` header: Nuanze is a public API that does not\n * attribute traffic per client, and its `Access-Control-Allow-Headers` does not list the header, so\n * sending it would fail CORS preflight in the browser. All operations are GET.\n */\nexport class NuanzeClient {\n readonly opts: NuanzeClientOpts;\n readonly axiosInstance: AxiosInstance;\n\n constructor(opts: NuanzeClientOpts) {\n this.opts = opts;\n this.axiosInstance = axios.create({\n // Nuanze is public and answers every origin with `Access-Control-Allow-Origin: *`, which\n // browsers reject for credentialed requests.\n withCredentials: false,\n // We have custom logic to validate response status and create an appropriate error\n validateStatus: () => true,\n // Repeatable `productId` must serialize as `productId=1&productId=2` (OpenAPI explode).\n paramsSerializer: { indexes: null },\n });\n }\n\n /**\n * Lists published editorial stories, sorted by `publishedAt` descending then `id` descending.\n * The opaque cursor is exclusive and bound to normalized filters. Raw article ingestion, scoring,\n * queue, and newsdesk fields are excluded.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`, or\n * `CURSOR_FILTER_MISMATCH` when filters or the cursor are invalid.\n */\n async getNews(\n params: GetNuanzeNewsParams = {},\n ): Promise<GetNuanzeNewsResponse> {\n return mapNuanzeNewsResponse(\n await this.getJson<NuanzeServerNewsResponse>('/news', params),\n );\n }\n\n /**\n * Gets the active market universe, ordered by `productId` ascending. Never truncated, so `count`\n * always equals the length of `markets`. Market metadata refreshes about every five minutes and\n * prices about every minute.\n *\n * @throws {NuanzeServerFailureError} With error code `BAD_REQUEST` if a filter value is not a\n * documented venue or tradability state.\n */\n async getMarkets(\n params: GetNuanzeMarketsParams = {},\n ): Promise<GetNuanzeMarketsResponse> {\n return mapNuanzeMarketsResponse(\n await this.getJson<NuanzeServerMarketsResponse>('/markets', params),\n );\n }\n\n /**\n * Resolves a market by ticker. Lookup is case-insensitive and accepts canonical tickers or\n * legacy source symbols. An explicit unavailable venue returns `MARKET_NOT_FOUND`. With no\n * venue, `strictVenue=true` returns `AMBIGUOUS_MARKET` for multi-venue assets; otherwise the\n * primary venue is used.\n *\n * @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`, or\n * `BAD_REQUEST` on invalid selectors, and `MARKET_NOT_FOUND` when the ticker does not resolve.\n */\n async getMarketByTicker(\n params: GetNuanzeMarketByTickerParams,\n ): Promise<GetNuanzeMarketByTickerResponse> {\n const { ticker, ...query } = params;\n return mapNuanzeMarketByTickerResponse(\n await this.getJson<NuanzeServerMarketByTickerResponse>(\n `/markets/${encodeURIComponent(ticker)}`,\n query,\n ),\n );\n }\n\n /**\n * Lists the latest funding observation per active perpetual market, refreshed about every five\n * minutes.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid.\n */\n async getFundingRates(\n params: GetNuanzeFundingRatesParams = {},\n ): Promise<GetNuanzeFundingRatesResponse> {\n return mapNuanzeFundingRatesResponse(\n await this.getJson<NuanzeServerFundingRatesResponse>(\n '/funding/rates',\n params,\n ),\n );\n }\n\n /**\n * Gets the account PnL leaderboard. Equity-basis account PnL includes realized and unrealized\n * movement plus funding and is not realized PnL.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid.\n */\n async getLeaderboard(\n params: GetNuanzeLeaderboardParams = {},\n ): Promise<GetNuanzeLeaderboardResponse> {\n return mapNuanzeLeaderboardResponse(\n await this.getJson<NuanzeServerLeaderboardResponse>(\n '/leaderboard',\n params,\n ),\n );\n }\n\n /**\n * Gets the global public leaderboard of username-claimed subaccounts. Results are sorted by\n * equity-basis account PnL descending with nulls last. `globalRank` is independent of the active\n * privacy and trading filters. Pagination uses a filter-bound opaque cursor.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`, or\n * `CURSOR_FILTER_MISMATCH` when filters or the cursor are invalid.\n */\n async getSubaccountLeaderboard(\n params: GetNuanzeSubaccountLeaderboardParams = {},\n ): Promise<GetNuanzeSubaccountLeaderboardResponse> {\n return mapNuanzeSubaccountLeaderboardResponse(\n await this.getJson<NuanzeServerSubaccountLeaderboardResponse>(\n '/leaderboard/subaccounts',\n params,\n ),\n );\n }\n\n /**\n * Gets platform activity summary from five-minute aggregates.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if the window is not a documented value.\n */\n async getPlatformSummary(\n params: GetNuanzePlatformSummaryParams = {},\n ): Promise<GetNuanzePlatformSummaryResponse> {\n return mapNuanzePlatformSummaryResponse(\n await this.getJson<NuanzeServerPlatformSummaryResponse>(\n '/platform/summary',\n params,\n ),\n );\n }\n\n /**\n * Gets a keyset-paginated leaderboard for every subaccount a username actively follows, sorted\n * by PnL descending with nulls last. Subaccounts with no PnL in the window are included by\n * default with null PnL/rank, zero counts, and no products.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when params are invalid, or\n * `USERNAME_NOT_FOUND` when the supplied username has no claimed identity.\n */\n async getFollowedLeaderboard(\n params: GetNuanzeFollowedLeaderboardParams,\n ): Promise<GetNuanzeFollowedLeaderboardResponse> {\n return mapNuanzeFollowedLeaderboardResponse(\n await this.getJson<NuanzeServerFollowedLeaderboardResponse>(\n '/wallets/leaderboard',\n params,\n ),\n );\n }\n\n /**\n * Gets replica-backed wallet analytics. Without `subaccountName`, latest cumulative values are\n * selected per known subaccount and then summed. The response is a snapshot and does not claim\n * live health, withdrawable collateral, open-order, or signer state.\n *\n * @throws {NuanzeServerFailureError} With `INVALID_ADDRESS` or `BAD_REQUEST` on invalid input,\n * and `WALLET_NOT_FOUND` when the address has no wallet data.\n */\n async getWalletSummary(\n params: GetNuanzeWalletSummaryParams,\n ): Promise<GetNuanzeWalletSummaryResponse> {\n const { address, ...query } = params;\n return mapNuanzeWalletSummaryResponse(\n await this.getJson<NuanzeServerWalletSummaryResponse>(\n `/wallets/${encodeURIComponent(address)}`,\n query,\n ),\n );\n }\n\n /**\n * Lists at most 500 current replica position rows across all known subaccounts by default. Rows\n * remain per subaccount. Spot rows are excluded unless `includeSpot=true`. This is not an\n * execution-grade live feed.\n *\n * @throws {NuanzeServerFailureError} With `INVALID_ADDRESS` or `BAD_REQUEST` on invalid input,\n * and `WALLET_NOT_FOUND` when the address has no wallet data.\n */\n async getWalletPositions(\n params: GetNuanzeWalletPositionsParams,\n ): Promise<GetNuanzeWalletPositionsResponse> {\n const { address, ...query } = params;\n return mapNuanzeWalletPositionsResponse(\n await this.getJson<NuanzeServerWalletPositionsResponse>(\n `/wallets/${encodeURIComponent(address)}/positions`,\n query,\n ),\n );\n }\n\n /**\n * Lists market trades: one taker-side row per match, sorted by `matchedAt` then `id` descending.\n * The exclusive cursor is bound to operation and normalized filters. `from` is inclusive and\n * `to` exclusive. Wallet identity is absent.\n *\n * @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`,\n * `INVALID_CURSOR`, `CURSOR_FILTER_MISMATCH`, `RANGE_TOO_LARGE`, or `BAD_REQUEST` on invalid\n * input, and `MARKET_NOT_FOUND` when the ticker does not resolve.\n */\n async getMarketTrades(\n params: GetNuanzeMarketTradesParams,\n ): Promise<GetNuanzeMarketTradesResponse> {\n const { ticker, ...query } = params;\n return mapNuanzeMarketTradesResponse(\n await this.getJson<NuanzeServerMarketTradesResponse>(\n `/markets/${encodeURIComponent(ticker)}/trades`,\n query,\n ),\n );\n }\n\n /**\n * Lists market candles. Source storage is 1h; 4h and 1d are UTC-aligned rollups and missing bars\n * are not interpolated. The newest `limit` matching bars are selected and returned\n * oldest-to-newest, at most 750, with no pagination. A current bucket has `complete=false`.\n *\n * @throws {NuanzeServerFailureError} With `UNSUPPORTED_INTERVAL`, `RANGE_TOO_LARGE`,\n * `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`, or `BAD_REQUEST` on invalid input, and\n * `MARKET_NOT_FOUND` when the ticker does not resolve.\n */\n async getMarketCandles(\n params: GetNuanzeMarketCandlesParams,\n ): Promise<GetNuanzeMarketCandlesResponse> {\n const { ticker, ...query } = params;\n return mapNuanzeMarketCandlesResponse(\n await this.getJson<NuanzeServerMarketCandlesResponse>(\n `/markets/${encodeURIComponent(ticker)}/candles`,\n query,\n ),\n );\n }\n\n /**\n * Lists wallet-owned maker and taker execution rows, sorted by `matchedAt` then `id` descending.\n * The cursor is exclusive and filter-bound. `from` is inclusive and `to` exclusive.\n *\n * @throws {NuanzeServerFailureError} With `INVALID_ADDRESS`, `INVALID_CURSOR`,\n * `CURSOR_FILTER_MISMATCH`, `RANGE_TOO_LARGE`, or `BAD_REQUEST` on invalid input, and\n * `WALLET_NOT_FOUND` when the address has no wallet data.\n */\n async getWalletTrades(\n params: GetNuanzeWalletTradesParams,\n ): Promise<GetNuanzeWalletTradesResponse> {\n const { address, ...query } = params;\n return mapNuanzeWalletTradesResponse(\n await this.getJson<NuanzeServerWalletTradesResponse>(\n `/wallets/${encodeURIComponent(address)}/trades`,\n query,\n ),\n );\n }\n\n /**\n * Gets wallet account PnL. 24h is rolling and uses hourly snapshots with a daily fallback\n * baseline. Longer windows use daily snapshots; `all` starts at earliest coverage. PnL includes\n * realized and unrealized movement plus funding.\n *\n * @throws {NuanzeServerFailureError} With `INVALID_ADDRESS` or `BAD_REQUEST` on invalid input,\n * and `WALLET_NOT_FOUND` when the address has no wallet data.\n */\n async getWalletPnl(\n params: GetNuanzeWalletPnlParams,\n ): Promise<GetNuanzeWalletPnlResponse> {\n const { address, ...query } = params;\n return mapNuanzeWalletPnlResponse(\n await this.getJson<NuanzeServerWalletPnlResponse>(\n `/wallets/${encodeURIComponent(address)}/pnl`,\n query,\n ),\n );\n }\n\n /**\n * Gets a wallet account series of at most 1,000 deterministically sampled points ordered by\n * timestamp. Series contain a boundary anchor and a carried-forward request-time tip; synthetic\n * points are identified. Latest buckets may be provisional.\n *\n * @throws {NuanzeServerFailureError} With `INVALID_ADDRESS` or `BAD_REQUEST` on invalid input,\n * and `WALLET_NOT_FOUND` when the address has no wallet data.\n */\n async getWalletPnlSeries(\n params: GetNuanzeWalletPnlSeriesParams,\n ): Promise<GetNuanzeWalletPnlSeriesResponse> {\n const { address, ...query } = params;\n return mapNuanzeWalletPnlSeriesResponse(\n await this.getJson<NuanzeServerWalletPnlSeriesResponse>(\n `/wallets/${encodeURIComponent(address)}/pnl/series`,\n query,\n ),\n );\n }\n\n /**\n * Lists public collateral events, sorted by timestamp then `id` descending. Repeated `productId`\n * uses OR semantics. `minUsd` excludes unvalued events; without it unvalued events remain.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`, or\n * `CURSOR_FILTER_MISMATCH` when filters or the cursor are invalid.\n */\n async getCollateralFlows(\n params: GetNuanzeCollateralFlowsParams = {},\n ): Promise<GetNuanzeCollateralFlowsResponse> {\n return mapNuanzeCollateralFlowsResponse(\n await this.getJson<NuanzeServerCollateralFlowsResponse>('/flows', params),\n );\n }\n\n /**\n * Gets collateral flow aggregates: deposited, withdrawn, net, and gross, with valuation coverage\n * and a prior equal-window comparison. `all` has no prior window.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid.\n */\n async getCollateralFlowSummary(\n params: GetNuanzeCollateralFlowSummaryParams = {},\n ): Promise<GetNuanzeCollateralFlowSummaryResponse> {\n return mapNuanzeCollateralFlowSummaryResponse(\n await this.getJson<NuanzeServerCollateralFlowSummaryResponse>(\n '/flows/summary',\n params,\n ),\n );\n }\n\n /**\n * Gets collateral flow series of at most 1,000 UTC buckets. Allowed timeframe/bucket pairs are\n * 24h/hour, 7d/hour or day (default hour), 30d/day, and all/day.\n *\n * @throws {NuanzeServerFailureError} With `UNSUPPORTED_BUCKET` or `BAD_REQUEST` when the pair or\n * filters are invalid.\n */\n async getCollateralFlowSeries(\n params: GetNuanzeCollateralFlowSeriesParams = {},\n ): Promise<GetNuanzeCollateralFlowSeriesResponse> {\n return mapNuanzeCollateralFlowSeriesResponse(\n await this.getJson<NuanzeServerCollateralFlowSeriesResponse>(\n '/flows/series',\n params,\n ),\n );\n }\n\n /**\n * Gets privacy-preserving aggregate positioning for an active perpetual. Cross and isolated legs\n * are summed within owner/subaccount/product before direction classification. Every cell requires\n * at least 20 distinct contributing owners. No identity, individual position, entry price, PnL,\n * margin, or leverage fields are returned.\n *\n * @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`, or\n * `BAD_REQUEST` on invalid input, and `MARKET_NOT_FOUND` when the ticker does not resolve to a\n * perp.\n */\n async getMarketPositioning(\n params: GetNuanzeMarketPositioningParams,\n ): Promise<GetNuanzeMarketPositioningResponse> {\n const { ticker, ...query } = params;\n return mapNuanzeMarketPositioningResponse(\n await this.getJson<NuanzeServerMarketPositioningResponse>(\n `/markets/${encodeURIComponent(ticker)}/positioning`,\n query,\n ),\n );\n }\n\n /**\n * Lists open perpetual position legs for the resolved market. Results default to absolute\n * notional descending and can be ordered by signed unrealized PnL or absolute base amount in\n * either direction. Spot markets are not supported. Legs below $10 absolute notional are excluded.\n * Wallet addresses and signed exact base amounts are returned.\n *\n * @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`,\n * `INVALID_CURSOR`, `CURSOR_FILTER_MISMATCH`, or `BAD_REQUEST` on invalid input, and\n * `MARKET_NOT_FOUND` when the ticker does not resolve to a perp.\n */\n async getMarketPositions(\n params: GetNuanzeMarketPositionsParams,\n ): Promise<GetNuanzeMarketPositionsResponse> {\n const { ticker, ...query } = params;\n return mapNuanzeMarketPositionsResponse(\n await this.getJson<NuanzeServerMarketPositionsResponse>(\n `/markets/${encodeURIComponent(ticker)}/positions`,\n query,\n ),\n );\n }\n\n /**\n * Lists current open perpetual position legs across every market by signed unrealized PnL.\n * Descending returns the largest gainers and ascending returns the largest losers. This is a\n * latest indexed snapshot with no timeframe. Legs below $10 absolute notional are excluded.\n * Each row includes market identity and its source snapshot timestamp.\n *\n * @throws {NuanzeServerFailureError} With `INVALID_CURSOR`, `CURSOR_FILTER_MISMATCH`, or\n * `BAD_REQUEST` when the query or cursor is invalid.\n */\n async getOpenPositions(\n params: GetNuanzeOpenPositionsParams = {},\n ): Promise<GetNuanzeOpenPositionsResponse> {\n return mapNuanzeOpenPositionsResponse(\n await this.getJson<NuanzeServerOpenPositionsResponse>(\n '/positions',\n params,\n ),\n );\n }\n\n /**\n * Performs a GET against `{baseUrl}{path}` and classifies the status before returning the body.\n */\n private async getJson<T>(path: string, params?: object): Promise<T> {\n return this.requestJson<T>(path, { params });\n }\n\n private async requestJson<T>(\n path: string,\n config: { params?: object } = {},\n ): Promise<T> {\n const response = await this.axiosInstance.request<T>({\n method: 'GET',\n url: `${this.opts.url}${path}`,\n ...config,\n });\n this.checkResponseStatus(response);\n return response.data;\n }\n\n /**\n * Validates the HTTP status before interpreting the body. Nuanze maps every domain failure onto a\n * non-2xx status carrying a failure envelope, so anything else is a transport-level error.\n */\n private checkResponseStatus(response: AxiosResponse<unknown>) {\n if (response.status >= 200 && response.status < 300) {\n return;\n }\n if (isNuanzeServerFailureResponse(response.data)) {\n throw new NuanzeServerFailureError(response.data, response.status);\n }\n throw new Error(\n `Unexpected response from Nuanze: ${response.status} ${response.statusText}. Data: ${JSON.stringify(response.data)}`,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiHA,IAAa,eAAb,MAA0B;CAIxB,YAAY,MAAwB;EAClC,KAAK,OAAO;EACZ,KAAK,gBAAgB,MAAA,QAAM,OAAO;GAGhC,iBAAiB;GAEjB,sBAAsB;GAEtB,kBAAkB,EAAE,SAAS,KAAK;EACpC,CAAC;CACH;;;;;;;;;CAUA,MAAM,QACJ,SAA8B,CAAC,GACC;EAChC,OAAOA,oBAAAA,sBACL,MAAM,KAAK,QAAkC,SAAS,MAAM,CAC9D;CACF;;;;;;;;;CAUA,MAAM,WACJ,SAAiC,CAAC,GACC;EACnC,OAAOC,oBAAAA,yBACL,M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AAG,UAAU;EAC7B,OAAOC,oBAAAA,iCACL,MAAM,KAAK,QACT,YAAY,mBAAmB,MAAM,EAAE,aACvC,KACF,CACF;CACF;;;;;;;;;;CAWA,MAAM,iBACJ,SAAuC,CAAC,GACC;EACzC,OAAOC,oBAAAA,+BACL,MAAM,KAAK,QACT,cACA,MACF,CACF;CACF;;;;CAKA,MAAc,QAAW,MAAc,QAA6B;EAClE,OAAO,KAAK,YAAe,MAAM,EAAE,OAAO,CAAC;CAC7C;CAEA,MAAc,YACZ,MACA,SAA8B,CAAC,GACnB;EACZ,MAAM,WAAW,MAAM,KAAK,cAAc,QAAW;GACnD,QAAQ;GACR,KAAK,GAAG,KAAK,KAAK,MAAM;GACxB,GAAG;EACL,CAAC;EACD,KAAK,oBAAoB,QAAQ;EACjC,OAAO,SAAS;CAClB;;;;;CAMA,oBAA4B,UAAkC;EAC5D,IAAI,SAAS,UAAU,OAAO,SAAS,SAAS,KAC9C;EAEF,IAAIC,+BAAAA,8BAA8B,SAAS,IAAI,GAC7C,MAAM,IAAIC,uCAAAA,yBAAyB,SAAS,MAAM,SAAS,MAAM;EAEnE,MAAM,IAAI,MACR,oCAAoC,SAAS,OAAO,GAAG,SAAS,WAAW,UAAU,KAAK,UAAU,SAAS,IAAI,GACnH;CACF;AACF"}
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_NuanzeClient = require("./NuanzeClient-BUjoXpWV.cjs");
2
+ const require_NuanzeClient = require("./NuanzeClient-ILfa7B1C.cjs");
3
3
  require("./dataMappers.cjs");
4
4
  exports.NuanzeClient = require_NuanzeClient.NuanzeClient;
@@ -1,4 +1,4 @@
1
- import { A as GetNuanzePlatformSummaryResponse, B as GetNuanzeWalletTradesResponse, C as GetNuanzeMarketsParams, D as GetNuanzeOpenPositionsParams, E as GetNuanzeNewsResponse, F as GetNuanzeWalletPositionsParams, I as GetNuanzeWalletPositionsResponse, L as GetNuanzeWalletSummaryParams, M as GetNuanzeWalletPnlResponse, N as GetNuanzeWalletPnlSeriesParams, O as GetNuanzeOpenPositionsResponse, P as GetNuanzeWalletPnlSeriesResponse, R as GetNuanzeWalletSummaryResponse, S as GetNuanzeMarketTradesResponse, T as GetNuanzeNewsParams, _ as GetNuanzeMarketPositioningParams, a as GetNuanzeCollateralFlowsParams, b as GetNuanzeMarketPositionsResponse, c as GetNuanzeFollowedLeaderboardResponse, d as GetNuanzeLeaderboardParams, f as GetNuanzeLeaderboardResponse, g as GetNuanzeMarketCandlesResponse, h as GetNuanzeMarketCandlesParams, i as GetNuanzeCollateralFlowSummaryResponse, j as GetNuanzeWalletPnlParams, k as GetNuanzePlatformSummaryParams, l as GetNuanzeFundingRatesParams, m as GetNuanzeMarketByTickerResponse, n as GetNuanzeCollateralFlowSeriesResponse, o as GetNuanzeCollateralFlowsResponse, p as GetNuanzeMarketByTickerParams, r as GetNuanzeCollateralFlowSummaryParams, s as GetNuanzeFollowedLeaderboardParams, t as GetNuanzeCollateralFlowSeriesParams, u as GetNuanzeFundingRatesResponse, v as GetNuanzeMarketPositioningResponse, w as GetNuanzeMarketsResponse, x as GetNuanzeMarketTradesParams, y as GetNuanzeMarketPositionsParams, z as GetNuanzeWalletTradesParams } from "./clientTypes-Du2RLy4W.cjs";
1
+ import { A as GetNuanzePlatformSummaryResponse, B as GetNuanzeWalletSummaryResponse, C as GetNuanzeMarketsParams, D as GetNuanzeOpenPositionsParams, E as GetNuanzeNewsResponse, F as GetNuanzeWalletPnlSeriesParams, H as GetNuanzeWalletTradesResponse, I as GetNuanzeWalletPnlSeriesResponse, L as GetNuanzeWalletPositionsParams, M as GetNuanzeSubaccountLeaderboardResponse, N as GetNuanzeWalletPnlParams, O as GetNuanzeOpenPositionsResponse, P as GetNuanzeWalletPnlResponse, R as GetNuanzeWalletPositionsResponse, S as GetNuanzeMarketTradesResponse, T as GetNuanzeNewsParams, V as GetNuanzeWalletTradesParams, _ as GetNuanzeMarketPositioningParams, a as GetNuanzeCollateralFlowsParams, b as GetNuanzeMarketPositionsResponse, c as GetNuanzeFollowedLeaderboardResponse, d as GetNuanzeLeaderboardParams, f as GetNuanzeLeaderboardResponse, g as GetNuanzeMarketCandlesResponse, h as GetNuanzeMarketCandlesParams, i as GetNuanzeCollateralFlowSummaryResponse, j as GetNuanzeSubaccountLeaderboardParams, k as GetNuanzePlatformSummaryParams, l as GetNuanzeFundingRatesParams, m as GetNuanzeMarketByTickerResponse, n as GetNuanzeCollateralFlowSeriesResponse, o as GetNuanzeCollateralFlowsResponse, p as GetNuanzeMarketByTickerParams, r as GetNuanzeCollateralFlowSummaryParams, s as GetNuanzeFollowedLeaderboardParams, t as GetNuanzeCollateralFlowSeriesParams, u as GetNuanzeFundingRatesResponse, v as GetNuanzeMarketPositioningResponse, w as GetNuanzeMarketsResponse, x as GetNuanzeMarketTradesParams, y as GetNuanzeMarketPositionsParams, z as GetNuanzeWalletSummaryParams } from "./clientTypes-COeQAlKN.cjs";
2
2
  import { AxiosInstance } from "axios";
3
3
 
4
4
  //#region src/NuanzeClient.d.ts
@@ -18,11 +18,7 @@ interface NuanzeClientOpts {
18
18
  * Read-only and credential-free, so unlike the other service clients it takes no wallet client or
19
19
  * linked signer. It also sends no `x-nado-client-type` header: Nuanze is a public API that does not
20
20
  * attribute traffic per client, and its `Access-Control-Allow-Headers` does not list the header, so
21
- * sending it would fail CORS preflight in the browser. Most operations are GET;
22
- * {@link NuanzeClient.getFollowedLeaderboard} is a non-mutating POST whose body carries a followed
23
- * set larger than a query string can reliably hold. The API meters a weighted token bucket per
24
- * client IP and reports its state in the `RateLimit-Limit`, `RateLimit-Remaining`, and
25
- * `RateLimit-Reset` response headers; add an interceptor on {@link axiosInstance} to observe them.
21
+ * sending it would fail CORS preflight in the browser. All operations are GET.
26
22
  */
27
23
  declare class NuanzeClient {
28
24
  readonly opts: NuanzeClientOpts;
@@ -65,11 +61,20 @@ declare class NuanzeClient {
65
61
  getFundingRates(params?: GetNuanzeFundingRatesParams): Promise<GetNuanzeFundingRatesResponse>;
66
62
  /**
67
63
  * Gets the account PnL leaderboard. Equity-basis account PnL includes realized and unrealized
68
- * movement plus funding and is not realized PnL. All-time analytics cost five rate-limit units.
64
+ * movement plus funding and is not realized PnL.
69
65
  *
70
66
  * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid.
71
67
  */
72
68
  getLeaderboard(params?: GetNuanzeLeaderboardParams): Promise<GetNuanzeLeaderboardResponse>;
69
+ /**
70
+ * Gets the global public leaderboard of username-claimed subaccounts. Results are sorted by
71
+ * equity-basis account PnL descending with nulls last. `globalRank` is independent of the active
72
+ * privacy and trading filters. Pagination uses a filter-bound opaque cursor.
73
+ *
74
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`, or
75
+ * `CURSOR_FILTER_MISMATCH` when filters or the cursor are invalid.
76
+ */
77
+ getSubaccountLeaderboard(params?: GetNuanzeSubaccountLeaderboardParams): Promise<GetNuanzeSubaccountLeaderboardResponse>;
73
78
  /**
74
79
  * Gets platform activity summary from five-minute aggregates.
75
80
  *
@@ -77,14 +82,12 @@ declare class NuanzeClient {
77
82
  */
78
83
  getPlatformSummary(params?: GetNuanzePlatformSummaryParams): Promise<GetNuanzePlatformSummaryResponse>;
79
84
  /**
80
- * Gets leaderboard stats for a set of followed subaccounts. POST rather than GET so the body can
81
- * carry up to 300 `subaccountHex` values. The response preserves request order. Subaccounts with
82
- * no data in the window are backfilled with `pnl: null`, `globalRank: null`, zero counts, and an
83
- * empty `productIds`. Costs five rate-limit units. The response is not cached.
85
+ * Gets a keyset-paginated leaderboard for every subaccount a username actively follows, sorted
86
+ * by PnL descending with nulls last. Subaccounts with no PnL in the window are included by
87
+ * default with null PnL/rank, zero counts, and no products.
84
88
  *
85
- * @throws {NuanzeServerFailureError} With `INVALID_SUBACCOUNT` if a hex is not 32-byte
86
- * 0x-prefixed, and `BAD_REQUEST` if the set is empty, exceeds 300, or `timeframe` is not a
87
- * documented value.
89
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when params are invalid, or
90
+ * `USERNAME_NOT_FOUND` when the supplied username has no claimed identity.
88
91
  */
89
92
  getFollowedLeaderboard(params: GetNuanzeFollowedLeaderboardParams): Promise<GetNuanzeFollowedLeaderboardResponse>;
90
93
  /**
@@ -179,7 +182,7 @@ declare class NuanzeClient {
179
182
  * Gets privacy-preserving aggregate positioning for an active perpetual. Cross and isolated legs
180
183
  * are summed within owner/subaccount/product before direction classification. Every cell requires
181
184
  * at least 20 distinct contributing owners. No identity, individual position, entry price, PnL,
182
- * margin, or leverage fields are returned. This operation costs five rate-limit units.
185
+ * margin, or leverage fields are returned.
183
186
  *
184
187
  * @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`, or
185
188
  * `BAD_REQUEST` on invalid input, and `MARKET_NOT_FOUND` when the ticker does not resolve to a
@@ -201,8 +204,7 @@ declare class NuanzeClient {
201
204
  * Lists current open perpetual position legs across every market by signed unrealized PnL.
202
205
  * Descending returns the largest gainers and ascending returns the largest losers. This is a
203
206
  * latest indexed snapshot with no timeframe. Legs below $10 absolute notional are excluded.
204
- * Each row includes market identity and its source snapshot timestamp. Costs five rate-limit
205
- * units.
207
+ * Each row includes market identity and its source snapshot timestamp.
206
208
  *
207
209
  * @throws {NuanzeServerFailureError} With `INVALID_CURSOR`, `CURSOR_FILTER_MISMATCH`, or
208
210
  * `BAD_REQUEST` when the query or cursor is invalid.
@@ -212,11 +214,6 @@ declare class NuanzeClient {
212
214
  * Performs a GET against `{baseUrl}{path}` and classifies the status before returning the body.
213
215
  */
214
216
  private getJson;
215
- /**
216
- * Performs a POST against `{baseUrl}{path}` with a JSON body and classifies the status before
217
- * returning the response. Used only for the non-mutating followed-leaderboard operation.
218
- */
219
- private postJson;
220
217
  private requestJson;
221
218
  /**
222
219
  * Validates the HTTP status before interpreting the body. Nuanze maps every domain failure onto a
@@ -1 +1 @@
1
- {"version":3,"file":"NuanzeClient.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CT;;;;;;;AAkCyB;;;EAxDrB,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;;;;;;;;;;EAmBL,gBAAA,CACJ,MAAA,GAAQ,4BAAA,GACP,OAAA,CAAQ,8BAAA;;;;UAYG,OAAA;EAAA,QAIA,WAAA;;;;;UAiBN,mBAAA;AAAA"}
@@ -1,4 +1,4 @@
1
- import { A as GetNuanzePlatformSummaryResponse, B as GetNuanzeWalletTradesResponse, C as GetNuanzeMarketsParams, D as GetNuanzeOpenPositionsParams, E as GetNuanzeNewsResponse, F as GetNuanzeWalletPositionsParams, I as GetNuanzeWalletPositionsResponse, L as GetNuanzeWalletSummaryParams, M as GetNuanzeWalletPnlResponse, N as GetNuanzeWalletPnlSeriesParams, O as GetNuanzeOpenPositionsResponse, P as GetNuanzeWalletPnlSeriesResponse, R as GetNuanzeWalletSummaryResponse, S as GetNuanzeMarketTradesResponse, T as GetNuanzeNewsParams, _ as GetNuanzeMarketPositioningParams, a as GetNuanzeCollateralFlowsParams, b as GetNuanzeMarketPositionsResponse, c as GetNuanzeFollowedLeaderboardResponse, d as GetNuanzeLeaderboardParams, f as GetNuanzeLeaderboardResponse, g as GetNuanzeMarketCandlesResponse, h as GetNuanzeMarketCandlesParams, i as GetNuanzeCollateralFlowSummaryResponse, j as GetNuanzeWalletPnlParams, k as GetNuanzePlatformSummaryParams, l as GetNuanzeFundingRatesParams, m as GetNuanzeMarketByTickerResponse, n as GetNuanzeCollateralFlowSeriesResponse, o as GetNuanzeCollateralFlowsResponse, p as GetNuanzeMarketByTickerParams, r as GetNuanzeCollateralFlowSummaryParams, s as GetNuanzeFollowedLeaderboardParams, t as GetNuanzeCollateralFlowSeriesParams, u as GetNuanzeFundingRatesResponse, v as GetNuanzeMarketPositioningResponse, w as GetNuanzeMarketsResponse, x as GetNuanzeMarketTradesParams, y as GetNuanzeMarketPositionsParams, z as GetNuanzeWalletTradesParams } from "./clientTypes-DdpinbkS.js";
1
+ import { A as GetNuanzePlatformSummaryResponse, B as GetNuanzeWalletSummaryResponse, C as GetNuanzeMarketsParams, D as GetNuanzeOpenPositionsParams, E as GetNuanzeNewsResponse, F as GetNuanzeWalletPnlSeriesParams, H as GetNuanzeWalletTradesResponse, I as GetNuanzeWalletPnlSeriesResponse, L as GetNuanzeWalletPositionsParams, M as GetNuanzeSubaccountLeaderboardResponse, N as GetNuanzeWalletPnlParams, O as GetNuanzeOpenPositionsResponse, P as GetNuanzeWalletPnlResponse, R as GetNuanzeWalletPositionsResponse, S as GetNuanzeMarketTradesResponse, T as GetNuanzeNewsParams, V as GetNuanzeWalletTradesParams, _ as GetNuanzeMarketPositioningParams, a as GetNuanzeCollateralFlowsParams, b as GetNuanzeMarketPositionsResponse, c as GetNuanzeFollowedLeaderboardResponse, d as GetNuanzeLeaderboardParams, f as GetNuanzeLeaderboardResponse, g as GetNuanzeMarketCandlesResponse, h as GetNuanzeMarketCandlesParams, i as GetNuanzeCollateralFlowSummaryResponse, j as GetNuanzeSubaccountLeaderboardParams, k as GetNuanzePlatformSummaryParams, l as GetNuanzeFundingRatesParams, m as GetNuanzeMarketByTickerResponse, n as GetNuanzeCollateralFlowSeriesResponse, o as GetNuanzeCollateralFlowsResponse, p as GetNuanzeMarketByTickerParams, r as GetNuanzeCollateralFlowSummaryParams, s as GetNuanzeFollowedLeaderboardParams, t as GetNuanzeCollateralFlowSeriesParams, u as GetNuanzeFundingRatesResponse, v as GetNuanzeMarketPositioningResponse, w as GetNuanzeMarketsResponse, x as GetNuanzeMarketTradesParams, y as GetNuanzeMarketPositionsParams, z as GetNuanzeWalletSummaryParams } from "./clientTypes-CpOcZ6ST.js";
2
2
  import { AxiosInstance } from "axios";
3
3
 
4
4
  //#region src/NuanzeClient.d.ts
@@ -18,11 +18,7 @@ interface NuanzeClientOpts {
18
18
  * Read-only and credential-free, so unlike the other service clients it takes no wallet client or
19
19
  * linked signer. It also sends no `x-nado-client-type` header: Nuanze is a public API that does not
20
20
  * attribute traffic per client, and its `Access-Control-Allow-Headers` does not list the header, so
21
- * sending it would fail CORS preflight in the browser. Most operations are GET;
22
- * {@link NuanzeClient.getFollowedLeaderboard} is a non-mutating POST whose body carries a followed
23
- * set larger than a query string can reliably hold. The API meters a weighted token bucket per
24
- * client IP and reports its state in the `RateLimit-Limit`, `RateLimit-Remaining`, and
25
- * `RateLimit-Reset` response headers; add an interceptor on {@link axiosInstance} to observe them.
21
+ * sending it would fail CORS preflight in the browser. All operations are GET.
26
22
  */
27
23
  declare class NuanzeClient {
28
24
  readonly opts: NuanzeClientOpts;
@@ -65,11 +61,20 @@ declare class NuanzeClient {
65
61
  getFundingRates(params?: GetNuanzeFundingRatesParams): Promise<GetNuanzeFundingRatesResponse>;
66
62
  /**
67
63
  * Gets the account PnL leaderboard. Equity-basis account PnL includes realized and unrealized
68
- * movement plus funding and is not realized PnL. All-time analytics cost five rate-limit units.
64
+ * movement plus funding and is not realized PnL.
69
65
  *
70
66
  * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid.
71
67
  */
72
68
  getLeaderboard(params?: GetNuanzeLeaderboardParams): Promise<GetNuanzeLeaderboardResponse>;
69
+ /**
70
+ * Gets the global public leaderboard of username-claimed subaccounts. Results are sorted by
71
+ * equity-basis account PnL descending with nulls last. `globalRank` is independent of the active
72
+ * privacy and trading filters. Pagination uses a filter-bound opaque cursor.
73
+ *
74
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`, or
75
+ * `CURSOR_FILTER_MISMATCH` when filters or the cursor are invalid.
76
+ */
77
+ getSubaccountLeaderboard(params?: GetNuanzeSubaccountLeaderboardParams): Promise<GetNuanzeSubaccountLeaderboardResponse>;
73
78
  /**
74
79
  * Gets platform activity summary from five-minute aggregates.
75
80
  *
@@ -77,14 +82,12 @@ declare class NuanzeClient {
77
82
  */
78
83
  getPlatformSummary(params?: GetNuanzePlatformSummaryParams): Promise<GetNuanzePlatformSummaryResponse>;
79
84
  /**
80
- * Gets leaderboard stats for a set of followed subaccounts. POST rather than GET so the body can
81
- * carry up to 300 `subaccountHex` values. The response preserves request order. Subaccounts with
82
- * no data in the window are backfilled with `pnl: null`, `globalRank: null`, zero counts, and an
83
- * empty `productIds`. Costs five rate-limit units. The response is not cached.
85
+ * Gets a keyset-paginated leaderboard for every subaccount a username actively follows, sorted
86
+ * by PnL descending with nulls last. Subaccounts with no PnL in the window are included by
87
+ * default with null PnL/rank, zero counts, and no products.
84
88
  *
85
- * @throws {NuanzeServerFailureError} With `INVALID_SUBACCOUNT` if a hex is not 32-byte
86
- * 0x-prefixed, and `BAD_REQUEST` if the set is empty, exceeds 300, or `timeframe` is not a
87
- * documented value.
89
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when params are invalid, or
90
+ * `USERNAME_NOT_FOUND` when the supplied username has no claimed identity.
88
91
  */
89
92
  getFollowedLeaderboard(params: GetNuanzeFollowedLeaderboardParams): Promise<GetNuanzeFollowedLeaderboardResponse>;
90
93
  /**
@@ -179,7 +182,7 @@ declare class NuanzeClient {
179
182
  * Gets privacy-preserving aggregate positioning for an active perpetual. Cross and isolated legs
180
183
  * are summed within owner/subaccount/product before direction classification. Every cell requires
181
184
  * at least 20 distinct contributing owners. No identity, individual position, entry price, PnL,
182
- * margin, or leverage fields are returned. This operation costs five rate-limit units.
185
+ * margin, or leverage fields are returned.
183
186
  *
184
187
  * @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`, or
185
188
  * `BAD_REQUEST` on invalid input, and `MARKET_NOT_FOUND` when the ticker does not resolve to a
@@ -201,8 +204,7 @@ declare class NuanzeClient {
201
204
  * Lists current open perpetual position legs across every market by signed unrealized PnL.
202
205
  * Descending returns the largest gainers and ascending returns the largest losers. This is a
203
206
  * latest indexed snapshot with no timeframe. Legs below $10 absolute notional are excluded.
204
- * Each row includes market identity and its source snapshot timestamp. Costs five rate-limit
205
- * units.
207
+ * Each row includes market identity and its source snapshot timestamp.
206
208
  *
207
209
  * @throws {NuanzeServerFailureError} With `INVALID_CURSOR`, `CURSOR_FILTER_MISMATCH`, or
208
210
  * `BAD_REQUEST` when the query or cursor is invalid.
@@ -212,11 +214,6 @@ declare class NuanzeClient {
212
214
  * Performs a GET against `{baseUrl}{path}` and classifies the status before returning the body.
213
215
  */
214
216
  private getJson;
215
- /**
216
- * Performs a POST against `{baseUrl}{path}` with a JSON body and classifies the status before
217
- * returning the response. Used only for the non-mutating followed-leaderboard operation.
218
- */
219
- private postJson;
220
217
  private requestJson;
221
218
  /**
222
219
  * Validates the HTTP status before interpreting the body. Nuanze maps every domain failure onto a
@@ -1 +1 @@
1
- {"version":3,"file":"NuanzeClient.d.ts","names":[],"sources":["../src/src/NuanzeClient.ts"],"mappings":";;;;;;AA6FA;UAAiB,gBAAA;;;AAIZ;EAAH,GAAG;AAAA;;;;;;;;;;;;;;cAgBQ,YAAA;EAAA,SACF,IAAA,EAAM,gBAAA;EAAA,SACN,aAAA,EAAe,aAAA;cAEZ,IAAA,EAAM,gBAAA;EA2FP;;;;;;;;EAtEL,OAAA,CACJ,MAAA,GAAQ,mBAAA,GACP,OAAA,CAAQ,qBAAA;EA4HA;;;;;;;;EA9GL,UAAA,CACJ,MAAA,GAAQ,sBAAA,GACP,OAAA,CAAQ,wBAAA;EA0KA;;;;;;;;;EA3JL,iBAAA,CACJ,MAAA,EAAQ,6BAAA,GACP,OAAA,CAAQ,+BAAA;EAqNR;;;;;;EArMG,eAAA,CACJ,MAAA,GAAQ,2BAAA,GACP,OAAA,CAAQ,6BAAA;EAqPD;;;;;;EAtOJ,cAAA,CACJ,MAAA,GAAQ,0BAAA,GACP,OAAA,CAAQ,4BAAA;EAgRA;;;;;EAlQL,kBAAA,CACJ,MAAA,GAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EAsRD;;;;;;;;;;EAnQJ,sBAAA,CACJ,MAAA,EAAQ,kCAAA,GACP,OAAA,CAAQ,oCAAA;EAzGR;;;;;;;;EA0HG,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GACP,OAAA,CAAQ,0BAAA;EAxCA;;;;;;;;EA0DL,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EApBR;;;;;;;EAqCG,kBAAA,CACJ,MAAA,GAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EADD;;;;;;EAaJ,wBAAA,CACJ,MAAA,GAAQ,oCAAA,GACP,OAAA,CAAQ,sCAAA;EAAR;;;;;;;EAgBG,uBAAA,CACJ,MAAA,GAAQ,mCAAA,GACP,OAAA,CAAQ,qCAAA;EAoBD;;;;;;;;;;EADJ,oBAAA,CACJ,MAAA,EAAQ,gCAAA,GACP,OAAA,CAAQ,kCAAA;EA0CT;;;;;;;AAkCyB;;;EAxDrB,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;;;;;;;;;;EAmBL,gBAAA,CACJ,MAAA,GAAQ,4BAAA,GACP,OAAA,CAAQ,8BAAA;;;;UAYG,OAAA;EAAA,QAIA,WAAA;;;;;UAiBN,mBAAA;AAAA"}
@@ -1,4 +1,4 @@
1
- import { mapNuanzeCollateralFlowSeriesResponse, mapNuanzeCollateralFlowSummaryResponse, mapNuanzeCollateralFlowsResponse, mapNuanzeFollowedLeaderboardResponse, mapNuanzeFundingRatesResponse, mapNuanzeLeaderboardResponse, mapNuanzeMarketByTickerResponse, mapNuanzeMarketCandlesResponse, mapNuanzeMarketPositioningResponse, mapNuanzeMarketPositionsResponse, mapNuanzeMarketTradesResponse, mapNuanzeMarketsResponse, mapNuanzeNewsResponse, mapNuanzeOpenPositionsResponse, mapNuanzePlatformSummaryResponse, mapNuanzeWalletPnlResponse, mapNuanzeWalletPnlSeriesResponse, mapNuanzeWalletPositionsResponse, mapNuanzeWalletSummaryResponse, mapNuanzeWalletTradesResponse } from "./dataMappers.js";
1
+ import { mapNuanzeCollateralFlowSeriesResponse, mapNuanzeCollateralFlowSummaryResponse, mapNuanzeCollateralFlowsResponse, mapNuanzeFollowedLeaderboardResponse, mapNuanzeFundingRatesResponse, mapNuanzeLeaderboardResponse, mapNuanzeMarketByTickerResponse, mapNuanzeMarketCandlesResponse, mapNuanzeMarketPositioningResponse, mapNuanzeMarketPositionsResponse, mapNuanzeMarketTradesResponse, mapNuanzeMarketsResponse, mapNuanzeNewsResponse, mapNuanzeOpenPositionsResponse, mapNuanzePlatformSummaryResponse, mapNuanzeSubaccountLeaderboardResponse, mapNuanzeWalletPnlResponse, mapNuanzeWalletPnlSeriesResponse, mapNuanzeWalletPositionsResponse, mapNuanzeWalletSummaryResponse, mapNuanzeWalletTradesResponse } from "./dataMappers.js";
2
2
  import { NuanzeServerFailureError } from "./types/NuanzeServerFailureError.js";
3
3
  import { isNuanzeServerFailureResponse } from "./types/serverQueryTypes.js";
4
4
  import axios from "axios";
@@ -10,11 +10,7 @@ import axios from "axios";
10
10
  * Read-only and credential-free, so unlike the other service clients it takes no wallet client or
11
11
  * linked signer. It also sends no `x-nado-client-type` header: Nuanze is a public API that does not
12
12
  * attribute traffic per client, and its `Access-Control-Allow-Headers` does not list the header, so
13
- * sending it would fail CORS preflight in the browser. Most operations are GET;
14
- * {@link NuanzeClient.getFollowedLeaderboard} is a non-mutating POST whose body carries a followed
15
- * set larger than a query string can reliably hold. The API meters a weighted token bucket per
16
- * client IP and reports its state in the `RateLimit-Limit`, `RateLimit-Remaining`, and
17
- * `RateLimit-Reset` response headers; add an interceptor on {@link axiosInstance} to observe them.
13
+ * sending it would fail CORS preflight in the browser. All operations are GET.
18
14
  */
19
15
  var NuanzeClient = class {
20
16
  constructor(opts) {
@@ -71,7 +67,7 @@ var NuanzeClient = class {
71
67
  }
72
68
  /**
73
69
  * Gets the account PnL leaderboard. Equity-basis account PnL includes realized and unrealized
74
- * movement plus funding and is not realized PnL. All-time analytics cost five rate-limit units.
70
+ * movement plus funding and is not realized PnL.
75
71
  *
76
72
  * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid.
77
73
  */
@@ -79,6 +75,17 @@ var NuanzeClient = class {
79
75
  return mapNuanzeLeaderboardResponse(await this.getJson("/leaderboard", params));
80
76
  }
81
77
  /**
78
+ * Gets the global public leaderboard of username-claimed subaccounts. Results are sorted by
79
+ * equity-basis account PnL descending with nulls last. `globalRank` is independent of the active
80
+ * privacy and trading filters. Pagination uses a filter-bound opaque cursor.
81
+ *
82
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`, or
83
+ * `CURSOR_FILTER_MISMATCH` when filters or the cursor are invalid.
84
+ */
85
+ async getSubaccountLeaderboard(params = {}) {
86
+ return mapNuanzeSubaccountLeaderboardResponse(await this.getJson("/leaderboard/subaccounts", params));
87
+ }
88
+ /**
82
89
  * Gets platform activity summary from five-minute aggregates.
83
90
  *
84
91
  * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if the window is not a documented value.
@@ -87,17 +94,15 @@ var NuanzeClient = class {
87
94
  return mapNuanzePlatformSummaryResponse(await this.getJson("/platform/summary", params));
88
95
  }
89
96
  /**
90
- * Gets leaderboard stats for a set of followed subaccounts. POST rather than GET so the body can
91
- * carry up to 300 `subaccountHex` values. The response preserves request order. Subaccounts with
92
- * no data in the window are backfilled with `pnl: null`, `globalRank: null`, zero counts, and an
93
- * empty `productIds`. Costs five rate-limit units. The response is not cached.
97
+ * Gets a keyset-paginated leaderboard for every subaccount a username actively follows, sorted
98
+ * by PnL descending with nulls last. Subaccounts with no PnL in the window are included by
99
+ * default with null PnL/rank, zero counts, and no products.
94
100
  *
95
- * @throws {NuanzeServerFailureError} With `INVALID_SUBACCOUNT` if a hex is not 32-byte
96
- * 0x-prefixed, and `BAD_REQUEST` if the set is empty, exceeds 300, or `timeframe` is not a
97
- * documented value.
101
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when params are invalid, or
102
+ * `USERNAME_NOT_FOUND` when the supplied username has no claimed identity.
98
103
  */
99
104
  async getFollowedLeaderboard(params) {
100
- return mapNuanzeFollowedLeaderboardResponse(await this.postJson("/wallets/leaderboard", params));
105
+ return mapNuanzeFollowedLeaderboardResponse(await this.getJson("/wallets/leaderboard", params));
101
106
  }
102
107
  /**
103
108
  * Gets replica-backed wallet analytics. Without `subaccountName`, latest cumulative values are
@@ -218,7 +223,7 @@ var NuanzeClient = class {
218
223
  * Gets privacy-preserving aggregate positioning for an active perpetual. Cross and isolated legs
219
224
  * are summed within owner/subaccount/product before direction classification. Every cell requires
220
225
  * at least 20 distinct contributing owners. No identity, individual position, entry price, PnL,
221
- * margin, or leverage fields are returned. This operation costs five rate-limit units.
226
+ * margin, or leverage fields are returned.
222
227
  *
223
228
  * @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`, or
224
229
  * `BAD_REQUEST` on invalid input, and `MARKET_NOT_FOUND` when the ticker does not resolve to a
@@ -246,8 +251,7 @@ var NuanzeClient = class {
246
251
  * Lists current open perpetual position legs across every market by signed unrealized PnL.
247
252
  * Descending returns the largest gainers and ascending returns the largest losers. This is a
248
253
  * latest indexed snapshot with no timeframe. Legs below $10 absolute notional are excluded.
249
- * Each row includes market identity and its source snapshot timestamp. Costs five rate-limit
250
- * units.
254
+ * Each row includes market identity and its source snapshot timestamp.
251
255
  *
252
256
  * @throws {NuanzeServerFailureError} With `INVALID_CURSOR`, `CURSOR_FILTER_MISMATCH`, or
253
257
  * `BAD_REQUEST` when the query or cursor is invalid.
@@ -259,18 +263,11 @@ var NuanzeClient = class {
259
263
  * Performs a GET against `{baseUrl}{path}` and classifies the status before returning the body.
260
264
  */
261
265
  async getJson(path, params) {
262
- return this.requestJson("GET", path, { params });
263
- }
264
- /**
265
- * Performs a POST against `{baseUrl}{path}` with a JSON body and classifies the status before
266
- * returning the response. Used only for the non-mutating followed-leaderboard operation.
267
- */
268
- async postJson(path, data) {
269
- return this.requestJson("POST", path, { data });
266
+ return this.requestJson(path, { params });
270
267
  }
271
- async requestJson(method, path, config = {}) {
268
+ async requestJson(path, config = {}) {
272
269
  const response = await this.axiosInstance.request({
273
- method,
270
+ method: "GET",
274
271
  url: `${this.opts.url}${path}`,
275
272
  ...config
276
273
  });