@nadohq/nuanze-client 0.47.0 → 0.49.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 (54) hide show
  1. package/README.md +47 -7
  2. package/dist/{NuanzeClient-DK1Y8O_6.cjs → NuanzeClient-Tl_Dke8Z.cjs} +59 -2
  3. package/dist/NuanzeClient-Tl_Dke8Z.cjs.map +1 -0
  4. package/dist/NuanzeClient.cjs +1 -1
  5. package/dist/NuanzeClient.d.cts +50 -2
  6. package/dist/NuanzeClient.d.cts.map +1 -1
  7. package/dist/NuanzeClient.d.ts +50 -2
  8. package/dist/NuanzeClient.d.ts.map +1 -1
  9. package/dist/NuanzeClient.js +59 -2
  10. package/dist/NuanzeClient.js.map +1 -1
  11. package/dist/{NuanzeServerFailureError-DNZobL5e.d.ts → NuanzeServerFailureError-DpJbwqx9.d.ts} +2 -2
  12. package/dist/{NuanzeServerFailureError-DNZobL5e.d.ts.map → NuanzeServerFailureError-DpJbwqx9.d.ts.map} +1 -1
  13. package/dist/{NuanzeServerFailureError-BhwISexo.d.cts → NuanzeServerFailureError-Du6XnrqA.d.cts} +2 -2
  14. package/dist/{NuanzeServerFailureError-BhwISexo.d.cts.map → NuanzeServerFailureError-Du6XnrqA.d.cts.map} +1 -1
  15. package/dist/{clientTypes-Dn_aEMkq.d.cts → clientTypes-CX6Rpkyf.d.cts} +126 -2
  16. package/dist/clientTypes-CX6Rpkyf.d.cts.map +1 -0
  17. package/dist/{clientTypes-o_pl9igJ.d.ts → clientTypes-Dm5-t7pz.d.ts} +126 -2
  18. package/dist/clientTypes-Dm5-t7pz.d.ts.map +1 -0
  19. package/dist/dataMappers.cjs +49 -2
  20. package/dist/dataMappers.cjs.map +1 -1
  21. package/dist/dataMappers.d.cts +24 -4
  22. package/dist/dataMappers.d.cts.map +1 -1
  23. package/dist/dataMappers.d.ts +24 -4
  24. package/dist/dataMappers.d.ts.map +1 -1
  25. package/dist/dataMappers.js +46 -2
  26. package/dist/dataMappers.js.map +1 -1
  27. package/dist/index.cjs +4 -1
  28. package/dist/index.d.cts +5 -5
  29. package/dist/index.d.ts +5 -5
  30. package/dist/index.js +2 -2
  31. package/dist/{serverQueryTypes-CumC-LaJ.d.cts → serverQueryTypes-0DJc4-Oo.d.cts} +32 -2
  32. package/dist/serverQueryTypes-0DJc4-Oo.d.cts.map +1 -0
  33. package/dist/{serverQueryTypes-BZPjG_2U.d.ts → serverQueryTypes-qJw753VN.d.ts} +32 -2
  34. package/dist/serverQueryTypes-qJw753VN.d.ts.map +1 -0
  35. package/dist/types/NuanzeServerFailureError.d.cts +1 -1
  36. package/dist/types/NuanzeServerFailureError.d.ts +1 -1
  37. package/dist/types/clientTypes.d.cts +2 -2
  38. package/dist/types/clientTypes.d.ts +2 -2
  39. package/dist/types/index.d.cts +4 -4
  40. package/dist/types/index.d.ts +4 -4
  41. package/dist/types/serverQueryTypes.cjs.map +1 -1
  42. package/dist/types/serverQueryTypes.d.cts +2 -2
  43. package/dist/types/serverQueryTypes.d.ts +2 -2
  44. package/dist/types/serverQueryTypes.js.map +1 -1
  45. package/package.json +3 -3
  46. package/src/NuanzeClient.ts +94 -1
  47. package/src/dataMappers.ts +72 -1
  48. package/src/types/clientTypes.ts +132 -0
  49. package/src/types/serverQueryTypes.ts +33 -0
  50. package/dist/NuanzeClient-DK1Y8O_6.cjs.map +0 -1
  51. package/dist/clientTypes-Dn_aEMkq.d.cts.map +0 -1
  52. package/dist/clientTypes-o_pl9igJ.d.ts.map +0 -1
  53. package/dist/serverQueryTypes-BZPjG_2U.d.ts.map +0 -1
  54. package/dist/serverQueryTypes-CumC-LaJ.d.cts.map +0 -1
package/README.md CHANGED
@@ -2,9 +2,11 @@
2
2
 
3
3
  HTTP client for the Nuanze public analytics API. Serves markets, wallets, trades, candles, collateral flows,
4
4
  positioning, and globally ranked current open positions. Read-only and credential-free, so unlike the other
5
- service clients it takes no wallet client or linked signer. Leaderboard viewer lookups take an explicit public
6
- wallet address (`getLeaderboard` `viewAs`) or bytes32 subaccount hex (`getSubaccountLeaderboard` `viewAs`) and
7
- require no authentication.
5
+ service clients it takes no wallet client or linked signer. Leaderboard lookups take explicit public
6
+ identifiers and require no authentication: collection viewer lookups take a wallet address (`getLeaderboard`
7
+ `viewAs`) or bytes32 subaccount hex (`getSubaccountLeaderboard` and `getFollowedLeaderboard` `viewAs`), while
8
+ dedicated point reads (`getWalletLeaderboardPosition`, `getSubaccountLeaderboardPosition`,
9
+ `getFollowedLeaderboardPosition`) fetch one rank by path identifier.
8
10
 
9
11
  [Full SDK Documentation](https://nadohq.github.io/nado-typescript-sdk/index.html)
10
12
 
@@ -59,9 +61,12 @@ Each method maps one-to-one onto a public GET operation:
59
61
  - `getMarketByTicker`
60
62
  - `getFundingRates`
61
63
  - `getLeaderboard`
64
+ - `getWalletLeaderboardPosition`
62
65
  - `getSubaccountLeaderboard`
66
+ - `getSubaccountLeaderboardPosition`
63
67
  - `getPlatformSummary`
64
68
  - `getFollowedLeaderboard`
69
+ - `getFollowedLeaderboardPosition`
65
70
  - `getWalletSummary`
66
71
  - `getWalletPositions`
67
72
  - `getMarketTrades`
@@ -77,11 +82,21 @@ Each method maps one-to-one onto a public GET operation:
77
82
  - `getOpenPositions`
78
83
 
79
84
  Decimal fields are mapped to `BigNumber`; timestamps stay UTC ISO 8601 strings, matching the API contract.
80
- Both leaderboard collections accept an optional `viewAs` viewer selector: `getLeaderboard` takes an EVM address
81
- and returns the wallet's full row plus rank as `viewer`; `getSubaccountLeaderboard` takes a bytes32 subaccount hex
82
- and returns `{ filteredRank, item }` as `viewer`. A `viewer` is null when `viewAs` is omitted or has no source row.
85
+ All leaderboard collections accept an optional `viewAs` viewer selector: `getLeaderboard` takes an EVM address
86
+ and returns the wallet's full row plus rank as `viewer`; `getSubaccountLeaderboard` and `getFollowedLeaderboard`
87
+ take a bytes32 subaccount hex and return `{ filteredRank, item }` as `viewer`. A `viewer` is null when `viewAs` is
88
+ omitted or has no source row (for the followed leaderboard: when the follower does not actively follow it).
83
89
  For subaccounts, privacy, trading, and username-claim filters define the filtered-rank population without removing
84
- an existing full item or its `globalRank`; exclusion sets only `filteredRank` to null.
90
+ an existing full item or its `globalRank`; exclusion sets only `filteredRank` to null. On the followed leaderboard
91
+ `filteredRank` counts only the follower's filter-passing followed subaccounts, while `globalRank` stays global.
92
+
93
+ The dedicated point reads coexist with `viewAs`: `getWalletLeaderboardPosition({ address })` GETs
94
+ `/leaderboard/wallets/{address}`, `getSubaccountLeaderboardPosition({ subaccountHex })` GETs
95
+ `/leaderboard/subaccounts/{subaccountHex}`, and `getFollowedLeaderboardPosition({ subaccountHex, viewAs })` GETs
96
+ `/wallets/leaderboard/followed/{viewAs}` scoped to the `subaccountHex` follower, each returning the same row shape
97
+ without pagination. Use a point read when only one rank is needed; use `viewAs` for an inline lookup scoped to a
98
+ ranked page. Position `item` is null only when no leaderboard source row exists for the identifier, and a
99
+ filter-excluded subaccount keeps its full item (including `globalRank`) with `filteredRank` null.
85
100
 
86
101
  ```ts
87
102
  const board = await nuanze.getLeaderboard({
@@ -100,6 +115,31 @@ const subs = await nuanze.getSubaccountLeaderboard({
100
115
  if (subs.viewer) {
101
116
  console.log(subs.viewer.filteredRank, subs.viewer.item?.globalRank);
102
117
  }
118
+
119
+ const position = await nuanze.getWalletLeaderboardPosition({
120
+ address: '0x1234567890123456789012345678901234567890',
121
+ timeframe: '30d',
122
+ });
123
+ if (position.item) {
124
+ console.log(position.item.rank, position.item.accountPnl.toFixed());
125
+ }
126
+
127
+ const subPosition = await nuanze.getSubaccountLeaderboardPosition({
128
+ subaccountHex: '0x1234...0012',
129
+ timeframe: '30d',
130
+ });
131
+ if (subPosition.item) {
132
+ console.log(subPosition.filteredRank, subPosition.item.globalRank);
133
+ }
134
+
135
+ const followedPosition = await nuanze.getFollowedLeaderboardPosition({
136
+ subaccountHex: '0xabcd...0000', // follower
137
+ viewAs: '0x1234...0012', // followed subaccount to position
138
+ timeframe: '30d',
139
+ });
140
+ if (followedPosition.item) {
141
+ console.log(followedPosition.filteredRank, followedPosition.item.globalRank);
142
+ }
103
143
  ```
104
144
 
105
145
  ## Errors
@@ -103,6 +103,20 @@ var NuanzeClient = class {
103
103
  return require_dataMappers.mapNuanzeLeaderboardResponse(await this.getJson("/leaderboard", params));
104
104
  }
105
105
  /**
106
+ * Gets one wallet's leaderboard position by explicit EVM address. Equity-basis account PnL
107
+ * includes realized and unrealized movement plus funding and is not realized PnL. `item` is
108
+ * null only when the wallet leaderboard source row is absent; `rank` is the global rank in
109
+ * the unfiltered leaderboard, independent of collection `limit` and `offset`. For an inline
110
+ * lookup scoped to a ranked page, `getLeaderboard` accepts `viewAs` instead.
111
+ *
112
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid, or
113
+ * `INVALID_ADDRESS` when the address is malformed.
114
+ */
115
+ async getWalletLeaderboardPosition(params) {
116
+ const { address, ...query } = params;
117
+ return require_dataMappers.mapNuanzeWalletLeaderboardPositionResponse(await this.getJson(`/leaderboard/wallets/${encodeURIComponent(address)}`, query));
118
+ }
119
+ /**
106
120
  * Gets the global public leaderboard of subaccounts. Results are sorted by equity-basis account
107
121
  * PnL descending with nulls last. Username and display name are null when unavailable.
108
122
  * `globalRank` is independent of the active privacy and trading filters. Pagination uses a
@@ -119,6 +133,23 @@ var NuanzeClient = class {
119
133
  return require_dataMappers.mapNuanzeSubaccountLeaderboardResponse(await this.getJson("/leaderboard/subaccounts", params));
120
134
  }
121
135
  /**
136
+ * Gets one subaccount's leaderboard position by explicit bytes32 subaccount hex
137
+ * (the SDK `subaccountToHex` form). `item.globalRank` reflects the subaccount's true position
138
+ * across the full leaderboard, independent of the `includePrivate`, `includeUntraded`, and
139
+ * `includeUnclaimed` filters, while `filteredRank` uses the request's active filters: an
140
+ * absent source row yields `filteredRank` null with `item` null, an existing but
141
+ * filter-excluded row keeps its full item with `filteredRank` null, and an included row
142
+ * carries both ranks. For an inline lookup scoped to a ranked page,
143
+ * `getSubaccountLeaderboard` accepts `viewAs` instead.
144
+ *
145
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when filters are invalid, or
146
+ * `INVALID_SUBACCOUNT` when the subaccount hex is malformed.
147
+ */
148
+ async getSubaccountLeaderboardPosition(params) {
149
+ const { subaccountHex, ...query } = params;
150
+ return require_dataMappers.mapNuanzeSubaccountLeaderboardPositionResponse(await this.getJson(`/leaderboard/subaccounts/${encodeURIComponent(subaccountHex)}`, query));
151
+ }
152
+ /**
122
153
  * Gets platform activity summary from five-minute aggregates.
123
154
  *
124
155
  * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if the window is not a documented value.
@@ -131,13 +162,39 @@ var NuanzeClient = class {
131
162
  * follows, sorted by PnL descending with nulls last. The follower does not need a claimed
132
163
  * username. Subaccounts with no PnL in the window are included by default with null PnL/rank,
133
164
  * zero counts, and no products. Private subaccounts are excluded unless `includePrivate=true`.
165
+ * Pass `viewAs` with a bytes32 subaccount hex to also receive that followed subaccount's
166
+ * `filteredRank` (counted among the follower's filter-passing followed subaccounts) plus full
167
+ * item as `viewer` without altering pagination: `viewer` is null when `viewAs` is omitted or
168
+ * the follower does not actively follow that subaccount, and a filter-excluded followed row
169
+ * keeps its item with `filteredRank` null.
134
170
  *
135
- * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when params are invalid.
171
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`,
172
+ * `CURSOR_FILTER_MISMATCH`, or `INVALID_SUBACCOUNT` when params, the cursor, the follower
173
+ * hex, or `viewAs` are invalid.
136
174
  */
137
175
  async getFollowedLeaderboard(params) {
138
176
  return require_dataMappers.mapNuanzeFollowedLeaderboardResponse(await this.getJson("/wallets/leaderboard", params));
139
177
  }
140
178
  /**
179
+ * Gets one followed subaccount's position within a follower's leaderboard. `subaccountHex`
180
+ * identifies the follower whose active follow graph is ranked and `viewAs` the followed
181
+ * subaccount to position, both as bytes32 subaccount hex (the SDK `subaccountToHex` form).
182
+ * `item.globalRank` reflects the subaccount's true position across the full global subaccount
183
+ * leaderboard, independent of the follow graph and of the `includeUntraded`, `includePrivate`,
184
+ * and `includeUnclaimed` filters, while `filteredRank` counts only the follower's followed
185
+ * subaccounts passing the request's active filters: a subaccount the follower does not follow
186
+ * yields `filteredRank` null with `item` null, an existing but filter-excluded followed row
187
+ * keeps its full item with `filteredRank` null, and an included row carries both ranks. For an
188
+ * inline lookup scoped to a ranked page, `getFollowedLeaderboard` accepts `viewAs` instead.
189
+ *
190
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when the timeframe or filters are
191
+ * invalid, or `INVALID_SUBACCOUNT` when either subaccount hex is malformed.
192
+ */
193
+ async getFollowedLeaderboardPosition(params) {
194
+ const { viewAs, ...query } = params;
195
+ return require_dataMappers.mapNuanzeFollowedLeaderboardPositionResponse(await this.getJson(`/wallets/leaderboard/followed/${encodeURIComponent(viewAs)}`, query));
196
+ }
197
+ /**
141
198
  * Gets replica-backed wallet analytics. Without `subaccountName`, latest cumulative values are
142
199
  * selected per known subaccount and then summed. The response is a snapshot and does not claim
143
200
  * live health, withdrawable collateral, open-order, or signer state.
@@ -345,4 +402,4 @@ Object.defineProperty(exports, "__toESM", {
345
402
  }
346
403
  });
347
404
 
348
- //# sourceMappingURL=NuanzeClient-DK1Y8O_6.cjs.map
405
+ //# sourceMappingURL=NuanzeClient-Tl_Dke8Z.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NuanzeClient-Tl_Dke8Z.cjs","names":["mapNuanzeNewsResponse","mapNuanzeMarketsResponse","mapNuanzeMarketByTickerResponse","mapNuanzeFundingRatesResponse","mapNuanzeLeaderboardResponse","mapNuanzeWalletLeaderboardPositionResponse","mapNuanzeSubaccountLeaderboardResponse","mapNuanzeSubaccountLeaderboardPositionResponse","mapNuanzePlatformSummaryResponse","mapNuanzeFollowedLeaderboardResponse","mapNuanzeFollowedLeaderboardPositionResponse","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 mapNuanzeFollowedLeaderboardPositionResponse,\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 mapNuanzeSubaccountLeaderboardPositionResponse,\n mapNuanzeSubaccountLeaderboardResponse,\n mapNuanzeWalletLeaderboardPositionResponse,\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 GetNuanzeFollowedLeaderboardPositionParams,\n GetNuanzeFollowedLeaderboardPositionResponse,\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 GetNuanzeSubaccountLeaderboardPositionParams,\n GetNuanzeSubaccountLeaderboardPositionResponse,\n GetNuanzeSubaccountLeaderboardResponse,\n GetNuanzeWalletLeaderboardPositionParams,\n GetNuanzeWalletLeaderboardPositionResponse,\n GetNuanzeWalletPnlParams,\n GetNuanzeWalletPnlResponse,\n GetNuanzeWalletPnlSeriesParams,\n GetNuanzeWalletPnlSeriesResponse,\n GetNuanzeWalletPositionsParams,\n GetNuanzeWalletPositionsResponse,\n GetNuanzeWalletSummaryParams,\n GetNuanzeWalletSummaryResponse,\n GetNuanzeWalletTradesParams,\n GetNuanzeWalletTradesResponse,\n NuanzeMarketSelector,\n} from './types/clientTypes';\nimport { NuanzeServerFailureError } from './types/NuanzeServerFailureError';\nimport { NuanzeServerMarketPositioningResponse } from './types/serverModelTypes';\nimport {\n NuanzeServerCollateralFlowSeriesResponse,\n NuanzeServerCollateralFlowSummaryResponse,\n NuanzeServerCollateralFlowsResponse,\n NuanzeServerFollowedLeaderboardPositionResponse,\n NuanzeServerFollowedLeaderboardResponse,\n NuanzeServerFundingRatesResponse,\n NuanzeServerLeaderboardResponse,\n NuanzeServerMarketByTickerResponse,\n NuanzeServerMarketCandlesResponse,\n NuanzeServerMarketPositionsResponse,\n NuanzeServerMarketTradesResponse,\n NuanzeServerMarketsResponse,\n NuanzeServerNewsResponse,\n NuanzeServerOpenPositionsResponse,\n NuanzeServerPlatformSummaryResponse,\n NuanzeServerSubaccountLeaderboardPositionResponse,\n NuanzeServerSubaccountLeaderboardResponse,\n NuanzeServerWalletLeaderboardPositionResponse,\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 * Ticker filters include every product for the asset without distinguishing spot from perpetual\n * markets; an optional product ID narrows to one exact product. The opaque cursor is exclusive\n * and bound to normalized filters. Raw article ingestion, scoring, queue, and newsdesk fields are\n * 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 {@link NuanzeMarketSelector}. Supply at least `ticker` or `productId`;\n * when both are given, `productId` is used for the path segment and `ticker` is ignored.\n * Ticker lookup is case-insensitive and accepts canonical tickers or legacy source symbols.\n * An explicit unavailable venue returns `MARKET_NOT_FOUND`. With no venue, `strictVenue=true`\n * returns `AMBIGUOUS_MARKET` for multi-venue assets; otherwise the primary venue is used.\n *\n * @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET` or `BAD_REQUEST` on invalid\n * selectors, and `MARKET_NOT_FOUND` when the selector does not resolve.\n */\n async getMarketByTicker(\n params: GetNuanzeMarketByTickerParams,\n ): Promise<GetNuanzeMarketByTickerResponse> {\n return mapNuanzeMarketByTickerResponse(\n await this.getMarketJson<NuanzeServerMarketByTickerResponse>(params),\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. Pass `viewAs` with an EVM address to also\n * receive that wallet's full row plus rank as `viewer`, computed in the same request without\n * altering pagination; `viewer` is null when `viewAs` is omitted or has no source row.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid, or\n * `INVALID_ADDRESS` when `viewAs` is malformed.\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 one wallet's leaderboard position by explicit EVM address. Equity-basis account PnL\n * includes realized and unrealized movement plus funding and is not realized PnL. `item` is\n * null only when the wallet leaderboard source row is absent; `rank` is the global rank in\n * the unfiltered leaderboard, independent of collection `limit` and `offset`. For an inline\n * lookup scoped to a ranked page, `getLeaderboard` accepts `viewAs` instead.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid, or\n * `INVALID_ADDRESS` when the address is malformed.\n */\n async getWalletLeaderboardPosition(\n params: GetNuanzeWalletLeaderboardPositionParams,\n ): Promise<GetNuanzeWalletLeaderboardPositionResponse> {\n const { address, ...query } = params;\n return mapNuanzeWalletLeaderboardPositionResponse(\n await this.getJson<NuanzeServerWalletLeaderboardPositionResponse>(\n `/leaderboard/wallets/${encodeURIComponent(address)}`,\n query,\n ),\n );\n }\n\n /**\n * Gets the global public leaderboard of subaccounts. Results are sorted by equity-basis account\n * PnL descending with nulls last. Username and display name are null when unavailable.\n * `globalRank` is independent of the active privacy and trading filters. Pagination uses a\n * filter-bound opaque cursor. Pass `viewAs` with a bytes32 subaccount hex to also receive that\n * subaccount's `filteredRank` plus full item as `viewer` without altering pagination: `viewer`\n * is null when `viewAs` is omitted or has no source row, and a filter-excluded row keeps its\n * item with `filteredRank` null.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`,\n * `CURSOR_FILTER_MISMATCH`, or `INVALID_SUBACCOUNT` when filters, the cursor, or `viewAs`\n * 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 one subaccount's leaderboard position by explicit bytes32 subaccount hex\n * (the SDK `subaccountToHex` form). `item.globalRank` reflects the subaccount's true position\n * across the full leaderboard, independent of the `includePrivate`, `includeUntraded`, and\n * `includeUnclaimed` filters, while `filteredRank` uses the request's active filters: an\n * absent source row yields `filteredRank` null with `item` null, an existing but\n * filter-excluded row keeps its full item with `filteredRank` null, and an included row\n * carries both ranks. For an inline lookup scoped to a ranked page,\n * `getSubaccountLeaderboard` accepts `viewAs` instead.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when filters are invalid, or\n * `INVALID_SUBACCOUNT` when the subaccount hex is malformed.\n */\n async getSubaccountLeaderboardPosition(\n params: GetNuanzeSubaccountLeaderboardPositionParams,\n ): Promise<GetNuanzeSubaccountLeaderboardPositionResponse> {\n const { subaccountHex, ...query } = params;\n return mapNuanzeSubaccountLeaderboardPositionResponse(\n await this.getJson<NuanzeServerSubaccountLeaderboardPositionResponse>(\n `/leaderboard/subaccounts/${encodeURIComponent(subaccountHex)}`,\n query,\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 supplied bytes32 subaccount actively\n * follows, sorted by PnL descending with nulls last. The follower does not need a claimed\n * username. Subaccounts with no PnL in the window are included by default with null PnL/rank,\n * zero counts, and no products. Private subaccounts are excluded unless `includePrivate=true`.\n * Pass `viewAs` with a bytes32 subaccount hex to also receive that followed subaccount's\n * `filteredRank` (counted among the follower's filter-passing followed subaccounts) plus full\n * item as `viewer` without altering pagination: `viewer` is null when `viewAs` is omitted or\n * the follower does not actively follow that subaccount, and a filter-excluded followed row\n * keeps its item with `filteredRank` null.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`,\n * `CURSOR_FILTER_MISMATCH`, or `INVALID_SUBACCOUNT` when params, the cursor, the follower\n * hex, or `viewAs` are invalid.\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 one followed subaccount's position within a follower's leaderboard. `subaccountHex`\n * identifies the follower whose active follow graph is ranked and `viewAs` the followed\n * subaccount to position, both as bytes32 subaccount hex (the SDK `subaccountToHex` form).\n * `item.globalRank` reflects the subaccount's true position across the full global subaccount\n * leaderboard, independent of the follow graph and of the `includeUntraded`, `includePrivate`,\n * and `includeUnclaimed` filters, while `filteredRank` counts only the follower's followed\n * subaccounts passing the request's active filters: a subaccount the follower does not follow\n * yields `filteredRank` null with `item` null, an existing but filter-excluded followed row\n * keeps its full item with `filteredRank` null, and an included row carries both ranks. For an\n * inline lookup scoped to a ranked page, `getFollowedLeaderboard` accepts `viewAs` instead.\n *\n * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when the timeframe or filters are\n * invalid, or `INVALID_SUBACCOUNT` when either subaccount hex is malformed.\n */\n async getFollowedLeaderboardPosition(\n params: GetNuanzeFollowedLeaderboardPositionParams,\n ): Promise<GetNuanzeFollowedLeaderboardPositionResponse> {\n const { viewAs, ...query } = params;\n return mapNuanzeFollowedLeaderboardPositionResponse(\n await this.getJson<NuanzeServerFollowedLeaderboardPositionResponse>(\n `/wallets/leaderboard/followed/${encodeURIComponent(viewAs)}`,\n query,\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 for a {@link NuanzeMarketSelector}: one taker-side row per match, sorted\n * by `matchedAt` then `id` descending. Supply at least `ticker` or `productId`; when both are\n * given, `productId` is used for the path segment and `ticker` is ignored. The exclusive cursor\n * is bound to operation and normalized filters. `from` is inclusive and `to` exclusive. Wallet\n * identity is absent.\n *\n * @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `INVALID_CURSOR`,\n * `CURSOR_FILTER_MISMATCH`, `RANGE_TOO_LARGE`, or `BAD_REQUEST` on invalid input, and\n * `MARKET_NOT_FOUND` when the selector does not resolve.\n */\n async getMarketTrades(\n params: GetNuanzeMarketTradesParams,\n ): Promise<GetNuanzeMarketTradesResponse> {\n return mapNuanzeMarketTradesResponse(\n await this.getMarketJson<NuanzeServerMarketTradesResponse>(\n params,\n '/trades',\n ),\n );\n }\n\n /**\n * Lists market candles for a {@link NuanzeMarketSelector}. Supply at least `ticker` or\n * `productId`; when both are given, `productId` is used for the path segment and `ticker` is\n * ignored. Source storage is 1h; 4h and 1d are UTC-aligned rollups and missing bars are not\n * interpolated. The newest `limit` matching bars are selected and returned oldest-to-newest,\n * 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`, or `BAD_REQUEST` on invalid input, and `MARKET_NOT_FOUND` when the\n * selector does not resolve.\n */\n async getMarketCandles(\n params: GetNuanzeMarketCandlesParams,\n ): Promise<GetNuanzeMarketCandlesResponse> {\n return mapNuanzeMarketCandlesResponse(\n await this.getMarketJson<NuanzeServerMarketCandlesResponse>(\n params,\n '/candles',\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 identified by\n * {@link NuanzeMarketSelector}. Supply at least `ticker` or `productId`; when both are given,\n * `productId` is used for the path segment and `ticker` is ignored. Cross and isolated legs\n * are summed within owner/subaccount/product before direction classification. Every cell\n * requires at least 20 distinct contributing owners. No identity, individual position, entry\n * price, PnL, margin, or leverage fields are returned.\n *\n * @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET` or `BAD_REQUEST` on invalid input,\n * and `MARKET_NOT_FOUND` when the selector does not resolve to a perp.\n */\n async getMarketPositioning(\n params: GetNuanzeMarketPositioningParams,\n ): Promise<GetNuanzeMarketPositioningResponse> {\n return mapNuanzeMarketPositioningResponse(\n await this.getMarketJson<NuanzeServerMarketPositioningResponse>(\n params,\n '/positioning',\n ),\n );\n }\n\n /**\n * Lists open perpetual position legs for a market identified by {@link NuanzeMarketSelector}.\n * Supply at least `ticker` or `productId`; when both are given, `productId` is used for the\n * path segment and `ticker` is ignored. Results default to absolute notional descending and\n * can be ordered by signed unrealized PnL or absolute base amount in either direction. Spot\n * markets are not supported. Legs below $10 absolute notional are excluded. Wallet addresses,\n * nullable synced usernames and display names, and signed exact base amounts are returned.\n * Isolated positions include effective leverage computed by Nuanze; cross positions return\n * null leverage.\n *\n * @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `INVALID_CURSOR`,\n * `CURSOR_FILTER_MISMATCH`, or `BAD_REQUEST` on invalid input, and `MARKET_NOT_FOUND` when the\n * selector does not resolve to a perp.\n */\n async getMarketPositions(\n params: GetNuanzeMarketPositionsParams,\n ): Promise<GetNuanzeMarketPositionsResponse> {\n return mapNuanzeMarketPositionsResponse(\n await this.getMarketJson<NuanzeServerMarketPositionsResponse>(\n params,\n '/positions',\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 * Private subaccounts are excluded unless `includePrivate=true`. Each row includes market\n * identity, nullable synced username and display name, and its source snapshot timestamp.\n * Isolated positions include effective leverage computed by Nuanze; cross positions return\n * null leverage.\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 getMarketJson<T>(\n params: NuanzeMarketSelector & object,\n suffix = '',\n ): Promise<T> {\n const { productId, ticker, ...query } = params;\n const selector = productId ?? ticker;\n if (selector === undefined) {\n throw new Error('A market ticker or productId is required.');\n }\n return this.getJson<T>(\n `/markets/${encodeURIComponent(selector.toString())}${suffix}`,\n query,\n );\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8HA,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;;;;;;;;;;;CAYA,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,MAAM,KAAK,QAAqC,YAAY,MAAM,CACpE;CACF;;;;;;;;;;;CAYA,MAAM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toStringTag, { value: "Module" });
2
- const require_NuanzeClient = require("./NuanzeClient-DK1Y8O_6.cjs");
2
+ const require_NuanzeClient = require("./NuanzeClient-Tl_Dke8Z.cjs");
3
3
  require("./dataMappers.cjs");
4
4
  exports.NuanzeClient = require_NuanzeClient.NuanzeClient;
@@ -1,4 +1,4 @@
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-Dn_aEMkq.cjs";
1
+ import { A as GetNuanzeOpenPositionsResponse, B as GetNuanzeWalletPnlResponse, C as GetNuanzeMarketTradesParams, D as GetNuanzeNewsParams, E as GetNuanzeMarketsResponse, F as GetNuanzeSubaccountLeaderboardPositionResponse, G as GetNuanzeWalletSummaryParams, H as GetNuanzeWalletPnlSeriesResponse, I as GetNuanzeSubaccountLeaderboardResponse, J as GetNuanzeWalletTradesResponse, K as GetNuanzeWalletSummaryResponse, L as GetNuanzeWalletLeaderboardPositionParams, M as GetNuanzePlatformSummaryResponse, N as GetNuanzeSubaccountLeaderboardParams, O as GetNuanzeNewsResponse, P as GetNuanzeSubaccountLeaderboardPositionParams, R as GetNuanzeWalletLeaderboardPositionResponse, S as GetNuanzeMarketPositionsResponse, T as GetNuanzeMarketsParams, U as GetNuanzeWalletPositionsParams, V as GetNuanzeWalletPnlSeriesParams, W as GetNuanzeWalletPositionsResponse, _ as GetNuanzeMarketCandlesParams, a as GetNuanzeCollateralFlowsParams, b as GetNuanzeMarketPositioningResponse, c as GetNuanzeFollowedLeaderboardPositionParams, d as GetNuanzeFundingRatesParams, f as GetNuanzeFundingRatesResponse, g as GetNuanzeMarketByTickerResponse, h as GetNuanzeMarketByTickerParams, i as GetNuanzeCollateralFlowSummaryResponse, j as GetNuanzePlatformSummaryParams, k as GetNuanzeOpenPositionsParams, l as GetNuanzeFollowedLeaderboardPositionResponse, m as GetNuanzeLeaderboardResponse, n as GetNuanzeCollateralFlowSeriesResponse, o as GetNuanzeCollateralFlowsResponse, p as GetNuanzeLeaderboardParams, q as GetNuanzeWalletTradesParams, r as GetNuanzeCollateralFlowSummaryParams, s as GetNuanzeFollowedLeaderboardParams, t as GetNuanzeCollateralFlowSeriesParams, u as GetNuanzeFollowedLeaderboardResponse, v as GetNuanzeMarketCandlesResponse, w as GetNuanzeMarketTradesResponse, x as GetNuanzeMarketPositionsParams, y as GetNuanzeMarketPositioningParams, z as GetNuanzeWalletPnlParams } from "./clientTypes-CX6Rpkyf.cjs";
2
2
  import { AxiosInstance } from "axios";
3
3
 
4
4
  //#region src/NuanzeClient.d.ts
@@ -72,6 +72,17 @@ declare class NuanzeClient {
72
72
  * `INVALID_ADDRESS` when `viewAs` is malformed.
73
73
  */
74
74
  getLeaderboard(params?: GetNuanzeLeaderboardParams): Promise<GetNuanzeLeaderboardResponse>;
75
+ /**
76
+ * Gets one wallet's leaderboard position by explicit EVM address. Equity-basis account PnL
77
+ * includes realized and unrealized movement plus funding and is not realized PnL. `item` is
78
+ * null only when the wallet leaderboard source row is absent; `rank` is the global rank in
79
+ * the unfiltered leaderboard, independent of collection `limit` and `offset`. For an inline
80
+ * lookup scoped to a ranked page, `getLeaderboard` accepts `viewAs` instead.
81
+ *
82
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid, or
83
+ * `INVALID_ADDRESS` when the address is malformed.
84
+ */
85
+ getWalletLeaderboardPosition(params: GetNuanzeWalletLeaderboardPositionParams): Promise<GetNuanzeWalletLeaderboardPositionResponse>;
75
86
  /**
76
87
  * Gets the global public leaderboard of subaccounts. Results are sorted by equity-basis account
77
88
  * PnL descending with nulls last. Username and display name are null when unavailable.
@@ -86,6 +97,20 @@ declare class NuanzeClient {
86
97
  * are invalid.
87
98
  */
88
99
  getSubaccountLeaderboard(params?: GetNuanzeSubaccountLeaderboardParams): Promise<GetNuanzeSubaccountLeaderboardResponse>;
100
+ /**
101
+ * Gets one subaccount's leaderboard position by explicit bytes32 subaccount hex
102
+ * (the SDK `subaccountToHex` form). `item.globalRank` reflects the subaccount's true position
103
+ * across the full leaderboard, independent of the `includePrivate`, `includeUntraded`, and
104
+ * `includeUnclaimed` filters, while `filteredRank` uses the request's active filters: an
105
+ * absent source row yields `filteredRank` null with `item` null, an existing but
106
+ * filter-excluded row keeps its full item with `filteredRank` null, and an included row
107
+ * carries both ranks. For an inline lookup scoped to a ranked page,
108
+ * `getSubaccountLeaderboard` accepts `viewAs` instead.
109
+ *
110
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when filters are invalid, or
111
+ * `INVALID_SUBACCOUNT` when the subaccount hex is malformed.
112
+ */
113
+ getSubaccountLeaderboardPosition(params: GetNuanzeSubaccountLeaderboardPositionParams): Promise<GetNuanzeSubaccountLeaderboardPositionResponse>;
89
114
  /**
90
115
  * Gets platform activity summary from five-minute aggregates.
91
116
  *
@@ -97,10 +122,33 @@ declare class NuanzeClient {
97
122
  * follows, sorted by PnL descending with nulls last. The follower does not need a claimed
98
123
  * username. Subaccounts with no PnL in the window are included by default with null PnL/rank,
99
124
  * zero counts, and no products. Private subaccounts are excluded unless `includePrivate=true`.
125
+ * Pass `viewAs` with a bytes32 subaccount hex to also receive that followed subaccount's
126
+ * `filteredRank` (counted among the follower's filter-passing followed subaccounts) plus full
127
+ * item as `viewer` without altering pagination: `viewer` is null when `viewAs` is omitted or
128
+ * the follower does not actively follow that subaccount, and a filter-excluded followed row
129
+ * keeps its item with `filteredRank` null.
100
130
  *
101
- * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when params are invalid.
131
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`,
132
+ * `CURSOR_FILTER_MISMATCH`, or `INVALID_SUBACCOUNT` when params, the cursor, the follower
133
+ * hex, or `viewAs` are invalid.
102
134
  */
103
135
  getFollowedLeaderboard(params: GetNuanzeFollowedLeaderboardParams): Promise<GetNuanzeFollowedLeaderboardResponse>;
136
+ /**
137
+ * Gets one followed subaccount's position within a follower's leaderboard. `subaccountHex`
138
+ * identifies the follower whose active follow graph is ranked and `viewAs` the followed
139
+ * subaccount to position, both as bytes32 subaccount hex (the SDK `subaccountToHex` form).
140
+ * `item.globalRank` reflects the subaccount's true position across the full global subaccount
141
+ * leaderboard, independent of the follow graph and of the `includeUntraded`, `includePrivate`,
142
+ * and `includeUnclaimed` filters, while `filteredRank` counts only the follower's followed
143
+ * subaccounts passing the request's active filters: a subaccount the follower does not follow
144
+ * yields `filteredRank` null with `item` null, an existing but filter-excluded followed row
145
+ * keeps its full item with `filteredRank` null, and an included row carries both ranks. For an
146
+ * inline lookup scoped to a ranked page, `getFollowedLeaderboard` accepts `viewAs` instead.
147
+ *
148
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when the timeframe or filters are
149
+ * invalid, or `INVALID_SUBACCOUNT` when either subaccount hex is malformed.
150
+ */
151
+ getFollowedLeaderboardPosition(params: GetNuanzeFollowedLeaderboardPositionParams): Promise<GetNuanzeFollowedLeaderboardPositionResponse>;
104
152
  /**
105
153
  * Gets replica-backed wallet analytics. Without `subaccountName`, latest cumulative values are
106
154
  * selected per known subaccount and then summed. The response is a snapshot and does not claim
@@ -1 +1 @@
1
- {"version":3,"file":"NuanzeClient.d.cts","names":[],"sources":["../src/src/NuanzeClient.ts"],"mappings":";;;;;;AAkGA;UAAiB,gBAAA;;;AAIZ;EAAH,GAAG;AAAA;;;;;;;;;;cAYQ,YAAA;EAAA,SACF,IAAA,EAAM,gBAAA;EAAA,SACN,aAAA,EAAe,aAAA;cAEZ,IAAA,EAAM,gBAAA;EAwER;;;;;;;;;;EAjDJ,OAAA,CACJ,MAAA,GAAQ,mBAAA,GACP,OAAA,CAAQ,qBAAA;EA4GR;;;;;;;;EA9FG,UAAA,CACJ,MAAA,GAAQ,sBAAA,GACP,OAAA,CAAQ,wBAAA;EAsJR;;;;;;;;;;EAtIG,iBAAA,CACJ,MAAA,EAAQ,6BAAA,GACP,OAAA,CAAQ,+BAAA;EAwNA;;;;;;EA5ML,eAAA,CACJ,MAAA,GAAQ,2BAAA,GACP,OAAA,CAAQ,6BAAA;EAiPR;;;;;;;;;EA/NG,cAAA,CACJ,MAAA,GAAQ,0BAAA,GACP,OAAA,CAAQ,4BAAA;EA2SD;;;;;;;;;;;;;EArRJ,wBAAA,CACJ,MAAA,GAAQ,oCAAA,GACP,OAAA,CAAQ,sCAAA;EArHC;;;;;EAmIN,kBAAA,CACJ,MAAA,GAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EA9FL;;;;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AmBT;;;;;;;;EADI,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EA4CD;;;;;;;;;;;EAvBJ,eAAA,CACJ,MAAA,EAAQ,2BAAA,GACP,OAAA,CAAQ,6BAAA;EA6DR;;;;;;;;;;;EAzCG,gBAAA,CACJ,MAAA,EAAQ,4BAAA,GACP,OAAA,CAAQ,8BAAA;EA0FL;;;;;;;;EAzEA,eAAA,CACJ,MAAA,EAAQ,2BAAA,GACP,OAAA,CAAQ,6BAAA;EA2FA;;;;;;;;EAzEL,YAAA,CACJ,MAAA,EAAQ,wBAAA,GACP,OAAA,CAAQ,0BAAA;EAsHR;;;;;;;;EApGG,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EAwJG;;;AAiBa;;;;EAxJrB,kBAAA,CACJ,MAAA,GAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;;;;;;;EAYL,wBAAA,CACJ,MAAA,GAAQ,oCAAA,GACP,OAAA,CAAQ,sCAAA;;;;;;;;EAgBL,uBAAA,CACJ,MAAA,GAAQ,mCAAA,GACP,OAAA,CAAQ,qCAAA;;;;;;;;;;;;EAoBL,oBAAA,CACJ,MAAA,EAAQ,gCAAA,GACP,OAAA,CAAQ,kCAAA;;;;;;;;;;;;;;;EAuBL,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;;;;;;;;;;;;;EAqBL,gBAAA,CACJ,MAAA,GAAQ,4BAAA,GACP,OAAA,CAAQ,8BAAA;;;;UAYG,OAAA;EAAA,QAIA,aAAA;EAAA,QAeA,WAAA;;;;;UAiBN,mBAAA;AAAA"}
@@ -1,4 +1,4 @@
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-o_pl9igJ.js";
1
+ import { A as GetNuanzeOpenPositionsResponse, B as GetNuanzeWalletPnlResponse, C as GetNuanzeMarketTradesParams, D as GetNuanzeNewsParams, E as GetNuanzeMarketsResponse, F as GetNuanzeSubaccountLeaderboardPositionResponse, G as GetNuanzeWalletSummaryParams, H as GetNuanzeWalletPnlSeriesResponse, I as GetNuanzeSubaccountLeaderboardResponse, J as GetNuanzeWalletTradesResponse, K as GetNuanzeWalletSummaryResponse, L as GetNuanzeWalletLeaderboardPositionParams, M as GetNuanzePlatformSummaryResponse, N as GetNuanzeSubaccountLeaderboardParams, O as GetNuanzeNewsResponse, P as GetNuanzeSubaccountLeaderboardPositionParams, R as GetNuanzeWalletLeaderboardPositionResponse, S as GetNuanzeMarketPositionsResponse, T as GetNuanzeMarketsParams, U as GetNuanzeWalletPositionsParams, V as GetNuanzeWalletPnlSeriesParams, W as GetNuanzeWalletPositionsResponse, _ as GetNuanzeMarketCandlesParams, a as GetNuanzeCollateralFlowsParams, b as GetNuanzeMarketPositioningResponse, c as GetNuanzeFollowedLeaderboardPositionParams, d as GetNuanzeFundingRatesParams, f as GetNuanzeFundingRatesResponse, g as GetNuanzeMarketByTickerResponse, h as GetNuanzeMarketByTickerParams, i as GetNuanzeCollateralFlowSummaryResponse, j as GetNuanzePlatformSummaryParams, k as GetNuanzeOpenPositionsParams, l as GetNuanzeFollowedLeaderboardPositionResponse, m as GetNuanzeLeaderboardResponse, n as GetNuanzeCollateralFlowSeriesResponse, o as GetNuanzeCollateralFlowsResponse, p as GetNuanzeLeaderboardParams, q as GetNuanzeWalletTradesParams, r as GetNuanzeCollateralFlowSummaryParams, s as GetNuanzeFollowedLeaderboardParams, t as GetNuanzeCollateralFlowSeriesParams, u as GetNuanzeFollowedLeaderboardResponse, v as GetNuanzeMarketCandlesResponse, w as GetNuanzeMarketTradesResponse, x as GetNuanzeMarketPositionsParams, y as GetNuanzeMarketPositioningParams, z as GetNuanzeWalletPnlParams } from "./clientTypes-Dm5-t7pz.js";
2
2
  import { AxiosInstance } from "axios";
3
3
 
4
4
  //#region src/NuanzeClient.d.ts
@@ -72,6 +72,17 @@ declare class NuanzeClient {
72
72
  * `INVALID_ADDRESS` when `viewAs` is malformed.
73
73
  */
74
74
  getLeaderboard(params?: GetNuanzeLeaderboardParams): Promise<GetNuanzeLeaderboardResponse>;
75
+ /**
76
+ * Gets one wallet's leaderboard position by explicit EVM address. Equity-basis account PnL
77
+ * includes realized and unrealized movement plus funding and is not realized PnL. `item` is
78
+ * null only when the wallet leaderboard source row is absent; `rank` is the global rank in
79
+ * the unfiltered leaderboard, independent of collection `limit` and `offset`. For an inline
80
+ * lookup scoped to a ranked page, `getLeaderboard` accepts `viewAs` instead.
81
+ *
82
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid, or
83
+ * `INVALID_ADDRESS` when the address is malformed.
84
+ */
85
+ getWalletLeaderboardPosition(params: GetNuanzeWalletLeaderboardPositionParams): Promise<GetNuanzeWalletLeaderboardPositionResponse>;
75
86
  /**
76
87
  * Gets the global public leaderboard of subaccounts. Results are sorted by equity-basis account
77
88
  * PnL descending with nulls last. Username and display name are null when unavailable.
@@ -86,6 +97,20 @@ declare class NuanzeClient {
86
97
  * are invalid.
87
98
  */
88
99
  getSubaccountLeaderboard(params?: GetNuanzeSubaccountLeaderboardParams): Promise<GetNuanzeSubaccountLeaderboardResponse>;
100
+ /**
101
+ * Gets one subaccount's leaderboard position by explicit bytes32 subaccount hex
102
+ * (the SDK `subaccountToHex` form). `item.globalRank` reflects the subaccount's true position
103
+ * across the full leaderboard, independent of the `includePrivate`, `includeUntraded`, and
104
+ * `includeUnclaimed` filters, while `filteredRank` uses the request's active filters: an
105
+ * absent source row yields `filteredRank` null with `item` null, an existing but
106
+ * filter-excluded row keeps its full item with `filteredRank` null, and an included row
107
+ * carries both ranks. For an inline lookup scoped to a ranked page,
108
+ * `getSubaccountLeaderboard` accepts `viewAs` instead.
109
+ *
110
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when filters are invalid, or
111
+ * `INVALID_SUBACCOUNT` when the subaccount hex is malformed.
112
+ */
113
+ getSubaccountLeaderboardPosition(params: GetNuanzeSubaccountLeaderboardPositionParams): Promise<GetNuanzeSubaccountLeaderboardPositionResponse>;
89
114
  /**
90
115
  * Gets platform activity summary from five-minute aggregates.
91
116
  *
@@ -97,10 +122,33 @@ declare class NuanzeClient {
97
122
  * follows, sorted by PnL descending with nulls last. The follower does not need a claimed
98
123
  * username. Subaccounts with no PnL in the window are included by default with null PnL/rank,
99
124
  * zero counts, and no products. Private subaccounts are excluded unless `includePrivate=true`.
125
+ * Pass `viewAs` with a bytes32 subaccount hex to also receive that followed subaccount's
126
+ * `filteredRank` (counted among the follower's filter-passing followed subaccounts) plus full
127
+ * item as `viewer` without altering pagination: `viewer` is null when `viewAs` is omitted or
128
+ * the follower does not actively follow that subaccount, and a filter-excluded followed row
129
+ * keeps its item with `filteredRank` null.
100
130
  *
101
- * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when params are invalid.
131
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`,
132
+ * `CURSOR_FILTER_MISMATCH`, or `INVALID_SUBACCOUNT` when params, the cursor, the follower
133
+ * hex, or `viewAs` are invalid.
102
134
  */
103
135
  getFollowedLeaderboard(params: GetNuanzeFollowedLeaderboardParams): Promise<GetNuanzeFollowedLeaderboardResponse>;
136
+ /**
137
+ * Gets one followed subaccount's position within a follower's leaderboard. `subaccountHex`
138
+ * identifies the follower whose active follow graph is ranked and `viewAs` the followed
139
+ * subaccount to position, both as bytes32 subaccount hex (the SDK `subaccountToHex` form).
140
+ * `item.globalRank` reflects the subaccount's true position across the full global subaccount
141
+ * leaderboard, independent of the follow graph and of the `includeUntraded`, `includePrivate`,
142
+ * and `includeUnclaimed` filters, while `filteredRank` counts only the follower's followed
143
+ * subaccounts passing the request's active filters: a subaccount the follower does not follow
144
+ * yields `filteredRank` null with `item` null, an existing but filter-excluded followed row
145
+ * keeps its full item with `filteredRank` null, and an included row carries both ranks. For an
146
+ * inline lookup scoped to a ranked page, `getFollowedLeaderboard` accepts `viewAs` instead.
147
+ *
148
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when the timeframe or filters are
149
+ * invalid, or `INVALID_SUBACCOUNT` when either subaccount hex is malformed.
150
+ */
151
+ getFollowedLeaderboardPosition(params: GetNuanzeFollowedLeaderboardPositionParams): Promise<GetNuanzeFollowedLeaderboardPositionResponse>;
104
152
  /**
105
153
  * Gets replica-backed wallet analytics. Without `subaccountName`, latest cumulative values are
106
154
  * selected per known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AAQ,wBAAA,GACP,OAAA,CAAQ,0BAAA;EAsHR;;;;;;;;EApGG,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EAwJG;;;AAiBa;;;;EAxJrB,kBAAA,CACJ,MAAA,GAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;;;;;;;EAYL,wBAAA,CACJ,MAAA,GAAQ,oCAAA,GACP,OAAA,CAAQ,sCAAA;;;;;;;;EAgBL,uBAAA,CACJ,MAAA,GAAQ,mCAAA,GACP,OAAA,CAAQ,qCAAA;;;;;;;;;;;;EAoBL,oBAAA,CACJ,MAAA,EAAQ,gCAAA,GACP,OAAA,CAAQ,kCAAA;;;;;;;;;;;;;;;EAuBL,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;;;;;;;;;;;;;EAqBL,gBAAA,CACJ,MAAA,GAAQ,4BAAA,GACP,OAAA,CAAQ,8BAAA;;;;UAYG,OAAA;EAAA,QAIA,aAAA;EAAA,QAeA,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, mapNuanzeSubaccountLeaderboardResponse, mapNuanzeWalletPnlResponse, mapNuanzeWalletPnlSeriesResponse, mapNuanzeWalletPositionsResponse, mapNuanzeWalletSummaryResponse, mapNuanzeWalletTradesResponse } from "./dataMappers.js";
1
+ import { mapNuanzeCollateralFlowSeriesResponse, mapNuanzeCollateralFlowSummaryResponse, mapNuanzeCollateralFlowsResponse, mapNuanzeFollowedLeaderboardPositionResponse, mapNuanzeFollowedLeaderboardResponse, mapNuanzeFundingRatesResponse, mapNuanzeLeaderboardResponse, mapNuanzeMarketByTickerResponse, mapNuanzeMarketCandlesResponse, mapNuanzeMarketPositioningResponse, mapNuanzeMarketPositionsResponse, mapNuanzeMarketTradesResponse, mapNuanzeMarketsResponse, mapNuanzeNewsResponse, mapNuanzeOpenPositionsResponse, mapNuanzePlatformSummaryResponse, mapNuanzeSubaccountLeaderboardPositionResponse, mapNuanzeSubaccountLeaderboardResponse, mapNuanzeWalletLeaderboardPositionResponse, 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";
@@ -80,6 +80,20 @@ var NuanzeClient = class {
80
80
  return mapNuanzeLeaderboardResponse(await this.getJson("/leaderboard", params));
81
81
  }
82
82
  /**
83
+ * Gets one wallet's leaderboard position by explicit EVM address. Equity-basis account PnL
84
+ * includes realized and unrealized movement plus funding and is not realized PnL. `item` is
85
+ * null only when the wallet leaderboard source row is absent; `rank` is the global rank in
86
+ * the unfiltered leaderboard, independent of collection `limit` and `offset`. For an inline
87
+ * lookup scoped to a ranked page, `getLeaderboard` accepts `viewAs` instead.
88
+ *
89
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid, or
90
+ * `INVALID_ADDRESS` when the address is malformed.
91
+ */
92
+ async getWalletLeaderboardPosition(params) {
93
+ const { address, ...query } = params;
94
+ return mapNuanzeWalletLeaderboardPositionResponse(await this.getJson(`/leaderboard/wallets/${encodeURIComponent(address)}`, query));
95
+ }
96
+ /**
83
97
  * Gets the global public leaderboard of subaccounts. Results are sorted by equity-basis account
84
98
  * PnL descending with nulls last. Username and display name are null when unavailable.
85
99
  * `globalRank` is independent of the active privacy and trading filters. Pagination uses a
@@ -96,6 +110,23 @@ var NuanzeClient = class {
96
110
  return mapNuanzeSubaccountLeaderboardResponse(await this.getJson("/leaderboard/subaccounts", params));
97
111
  }
98
112
  /**
113
+ * Gets one subaccount's leaderboard position by explicit bytes32 subaccount hex
114
+ * (the SDK `subaccountToHex` form). `item.globalRank` reflects the subaccount's true position
115
+ * across the full leaderboard, independent of the `includePrivate`, `includeUntraded`, and
116
+ * `includeUnclaimed` filters, while `filteredRank` uses the request's active filters: an
117
+ * absent source row yields `filteredRank` null with `item` null, an existing but
118
+ * filter-excluded row keeps its full item with `filteredRank` null, and an included row
119
+ * carries both ranks. For an inline lookup scoped to a ranked page,
120
+ * `getSubaccountLeaderboard` accepts `viewAs` instead.
121
+ *
122
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when filters are invalid, or
123
+ * `INVALID_SUBACCOUNT` when the subaccount hex is malformed.
124
+ */
125
+ async getSubaccountLeaderboardPosition(params) {
126
+ const { subaccountHex, ...query } = params;
127
+ return mapNuanzeSubaccountLeaderboardPositionResponse(await this.getJson(`/leaderboard/subaccounts/${encodeURIComponent(subaccountHex)}`, query));
128
+ }
129
+ /**
99
130
  * Gets platform activity summary from five-minute aggregates.
100
131
  *
101
132
  * @throws {NuanzeServerFailureError} With `BAD_REQUEST` if the window is not a documented value.
@@ -108,13 +139,39 @@ var NuanzeClient = class {
108
139
  * follows, sorted by PnL descending with nulls last. The follower does not need a claimed
109
140
  * username. Subaccounts with no PnL in the window are included by default with null PnL/rank,
110
141
  * zero counts, and no products. Private subaccounts are excluded unless `includePrivate=true`.
142
+ * Pass `viewAs` with a bytes32 subaccount hex to also receive that followed subaccount's
143
+ * `filteredRank` (counted among the follower's filter-passing followed subaccounts) plus full
144
+ * item as `viewer` without altering pagination: `viewer` is null when `viewAs` is omitted or
145
+ * the follower does not actively follow that subaccount, and a filter-excluded followed row
146
+ * keeps its item with `filteredRank` null.
111
147
  *
112
- * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when params are invalid.
148
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`,
149
+ * `CURSOR_FILTER_MISMATCH`, or `INVALID_SUBACCOUNT` when params, the cursor, the follower
150
+ * hex, or `viewAs` are invalid.
113
151
  */
114
152
  async getFollowedLeaderboard(params) {
115
153
  return mapNuanzeFollowedLeaderboardResponse(await this.getJson("/wallets/leaderboard", params));
116
154
  }
117
155
  /**
156
+ * Gets one followed subaccount's position within a follower's leaderboard. `subaccountHex`
157
+ * identifies the follower whose active follow graph is ranked and `viewAs` the followed
158
+ * subaccount to position, both as bytes32 subaccount hex (the SDK `subaccountToHex` form).
159
+ * `item.globalRank` reflects the subaccount's true position across the full global subaccount
160
+ * leaderboard, independent of the follow graph and of the `includeUntraded`, `includePrivate`,
161
+ * and `includeUnclaimed` filters, while `filteredRank` counts only the follower's followed
162
+ * subaccounts passing the request's active filters: a subaccount the follower does not follow
163
+ * yields `filteredRank` null with `item` null, an existing but filter-excluded followed row
164
+ * keeps its full item with `filteredRank` null, and an included row carries both ranks. For an
165
+ * inline lookup scoped to a ranked page, `getFollowedLeaderboard` accepts `viewAs` instead.
166
+ *
167
+ * @throws {NuanzeServerFailureError} With `BAD_REQUEST` when the timeframe or filters are
168
+ * invalid, or `INVALID_SUBACCOUNT` when either subaccount hex is malformed.
169
+ */
170
+ async getFollowedLeaderboardPosition(params) {
171
+ const { viewAs, ...query } = params;
172
+ return mapNuanzeFollowedLeaderboardPositionResponse(await this.getJson(`/wallets/leaderboard/followed/${encodeURIComponent(viewAs)}`, query));
173
+ }
174
+ /**
118
175
  * Gets replica-backed wallet analytics. Without `subaccountName`, latest cumulative values are
119
176
  * selected per known subaccount and then summed. The response is a snapshot and does not claim
120
177
  * live health, withdrawable collateral, open-order, or signer state.