@nadohq/nuanze-client 0.41.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.
- package/README.md +72 -0
- package/dist/NuanzeClient-BUjoXpWV.cjs +327 -0
- package/dist/NuanzeClient-BUjoXpWV.cjs.map +1 -0
- package/dist/NuanzeClient.cjs +4 -0
- package/dist/NuanzeClient.d.cts +229 -0
- package/dist/NuanzeClient.d.cts.map +1 -0
- package/dist/NuanzeClient.d.ts +229 -0
- package/dist/NuanzeClient.d.ts.map +1 -0
- package/dist/NuanzeClient.js +293 -0
- package/dist/NuanzeClient.js.map +1 -0
- package/dist/NuanzeServerFailureError-B9EhXPyW.d.cts +29 -0
- package/dist/NuanzeServerFailureError-B9EhXPyW.d.cts.map +1 -0
- package/dist/NuanzeServerFailureError-DqWaKEMA.d.ts +29 -0
- package/dist/NuanzeServerFailureError-DqWaKEMA.d.ts.map +1 -0
- package/dist/clientModelTypes-A-D7ER-p.d.ts +932 -0
- package/dist/clientModelTypes-A-D7ER-p.d.ts.map +1 -0
- package/dist/clientModelTypes-BLPA-e3V.d.cts +932 -0
- package/dist/clientModelTypes-BLPA-e3V.d.cts.map +1 -0
- package/dist/clientTypes-DdpinbkS.d.ts +642 -0
- package/dist/clientTypes-DdpinbkS.d.ts.map +1 -0
- package/dist/clientTypes-Du2RLy4W.d.cts +642 -0
- package/dist/clientTypes-Du2RLy4W.d.cts.map +1 -0
- package/dist/dataMappers.cjs +688 -0
- package/dist/dataMappers.cjs.map +1 -0
- package/dist/dataMappers.d.cts +159 -0
- package/dist/dataMappers.d.cts.map +1 -0
- package/dist/dataMappers.d.ts +159 -0
- package/dist/dataMappers.d.ts.map +1 -0
- package/dist/dataMappers.js +650 -0
- package/dist/dataMappers.js.map +1 -0
- package/dist/endpoints.cjs +18 -0
- package/dist/endpoints.cjs.map +1 -0
- package/dist/endpoints.d.cts +14 -0
- package/dist/endpoints.d.cts.map +1 -0
- package/dist/endpoints.d.ts +14 -0
- package/dist/endpoints.d.ts.map +1 -0
- package/dist/endpoints.js +17 -0
- package/dist/endpoints.js.map +1 -0
- package/dist/index.cjs +79 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +9 -0
- package/dist/nuanzeErrorCodes-CWCTWh2k.d.cts +14 -0
- package/dist/nuanzeErrorCodes-CWCTWh2k.d.cts.map +1 -0
- package/dist/nuanzeErrorCodes-Dh6juim0.d.ts +14 -0
- package/dist/nuanzeErrorCodes-Dh6juim0.d.ts.map +1 -0
- package/dist/serverModelTypes-D-vS_7uc.d.ts +377 -0
- package/dist/serverModelTypes-D-vS_7uc.d.ts.map +1 -0
- package/dist/serverModelTypes-DZDxdIzz.d.cts +377 -0
- package/dist/serverModelTypes-DZDxdIzz.d.cts.map +1 -0
- package/dist/serverQueryTypes-BBIFZZ36.d.cts +240 -0
- package/dist/serverQueryTypes-BBIFZZ36.d.cts.map +1 -0
- package/dist/serverQueryTypes-e7HWmE8t.d.ts +240 -0
- package/dist/serverQueryTypes-e7HWmE8t.d.ts.map +1 -0
- package/dist/types/NuanzeServerFailureError.cjs +21 -0
- package/dist/types/NuanzeServerFailureError.cjs.map +1 -0
- package/dist/types/NuanzeServerFailureError.d.cts +2 -0
- package/dist/types/NuanzeServerFailureError.d.ts +2 -0
- package/dist/types/NuanzeServerFailureError.js +20 -0
- package/dist/types/NuanzeServerFailureError.js.map +1 -0
- package/dist/types/clientModelTypes.cjs +236 -0
- package/dist/types/clientModelTypes.cjs.map +1 -0
- package/dist/types/clientModelTypes.d.cts +2 -0
- package/dist/types/clientModelTypes.d.ts +2 -0
- package/dist/types/clientModelTypes.js +208 -0
- package/dist/types/clientModelTypes.js.map +1 -0
- package/dist/types/clientTypes.cjs +0 -0
- package/dist/types/clientTypes.d.cts +2 -0
- package/dist/types/clientTypes.d.ts +2 -0
- package/dist/types/clientTypes.js +1 -0
- package/dist/types/index.cjs +36 -0
- package/dist/types/index.d.cts +7 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +5 -0
- package/dist/types/nuanzeErrorCodes.cjs +32 -0
- package/dist/types/nuanzeErrorCodes.cjs.map +1 -0
- package/dist/types/nuanzeErrorCodes.d.cts +2 -0
- package/dist/types/nuanzeErrorCodes.d.ts +2 -0
- package/dist/types/nuanzeErrorCodes.js +31 -0
- package/dist/types/nuanzeErrorCodes.js.map +1 -0
- package/dist/types/serverModelTypes.cjs +0 -0
- package/dist/types/serverModelTypes.d.cts +2 -0
- package/dist/types/serverModelTypes.d.ts +2 -0
- package/dist/types/serverModelTypes.js +1 -0
- package/dist/types/serverQueryTypes.cjs +15 -0
- package/dist/types/serverQueryTypes.cjs.map +1 -0
- package/dist/types/serverQueryTypes.d.cts +2 -0
- package/dist/types/serverQueryTypes.d.ts +2 -0
- package/dist/types/serverQueryTypes.js +14 -0
- package/dist/types/serverQueryTypes.js.map +1 -0
- package/package.json +54 -0
- package/src/NuanzeClient.ts +556 -0
- package/src/dataMappers.ts +889 -0
- package/src/endpoints.ts +14 -0
- package/src/index.ts +4 -0
- package/src/types/NuanzeServerFailureError.ts +36 -0
- package/src/types/clientModelTypes.ts +1085 -0
- package/src/types/clientTypes.ts +719 -0
- package/src/types/index.ts +6 -0
- package/src/types/nuanzeErrorCodes.ts +31 -0
- package/src/types/serverModelTypes.ts +422 -0
- package/src/types/serverQueryTypes.ts +298 -0
|
@@ -0,0 +1,229 @@
|
|
|
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";
|
|
2
|
+
import { AxiosInstance } from "axios";
|
|
3
|
+
|
|
4
|
+
//#region src/NuanzeClient.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Options for constructing a {@link NuanzeClient}.
|
|
7
|
+
*/
|
|
8
|
+
interface NuanzeClientOpts {
|
|
9
|
+
/**
|
|
10
|
+
* Base URL of the Nuanze API, including the version segment, e.g. {@link NUANZE_CLIENT_ENDPOINTS}.
|
|
11
|
+
*/
|
|
12
|
+
url: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Client for the Nuanze public analytics API: markets, wallets, trades, candles, collateral flows,
|
|
16
|
+
* and positioning.
|
|
17
|
+
*
|
|
18
|
+
* Read-only and credential-free, so unlike the other service clients it takes no wallet client or
|
|
19
|
+
* linked signer. It also sends no `x-nado-client-type` header: Nuanze is a public API that does not
|
|
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.
|
|
26
|
+
*/
|
|
27
|
+
declare class NuanzeClient {
|
|
28
|
+
readonly opts: NuanzeClientOpts;
|
|
29
|
+
readonly axiosInstance: AxiosInstance;
|
|
30
|
+
constructor(opts: NuanzeClientOpts);
|
|
31
|
+
/**
|
|
32
|
+
* Lists published editorial stories, sorted by `publishedAt` descending then `id` descending.
|
|
33
|
+
* The opaque cursor is exclusive and bound to normalized filters. Raw article ingestion, scoring,
|
|
34
|
+
* queue, and newsdesk fields are excluded.
|
|
35
|
+
*
|
|
36
|
+
* @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`, or
|
|
37
|
+
* `CURSOR_FILTER_MISMATCH` when filters or the cursor are invalid.
|
|
38
|
+
*/
|
|
39
|
+
getNews(params?: GetNuanzeNewsParams): Promise<GetNuanzeNewsResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Gets the active market universe, ordered by `productId` ascending. Never truncated, so `count`
|
|
42
|
+
* always equals the length of `markets`. Market metadata refreshes about every five minutes and
|
|
43
|
+
* prices about every minute.
|
|
44
|
+
*
|
|
45
|
+
* @throws {NuanzeServerFailureError} With error code `BAD_REQUEST` if a filter value is not a
|
|
46
|
+
* documented venue or tradability state.
|
|
47
|
+
*/
|
|
48
|
+
getMarkets(params?: GetNuanzeMarketsParams): Promise<GetNuanzeMarketsResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* Resolves a market by ticker. Lookup is case-insensitive and accepts canonical tickers or
|
|
51
|
+
* legacy source symbols. An explicit unavailable venue returns `MARKET_NOT_FOUND`. With no
|
|
52
|
+
* venue, `strictVenue=true` returns `AMBIGUOUS_MARKET` for multi-venue assets; otherwise the
|
|
53
|
+
* primary venue is used.
|
|
54
|
+
*
|
|
55
|
+
* @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`, or
|
|
56
|
+
* `BAD_REQUEST` on invalid selectors, and `MARKET_NOT_FOUND` when the ticker does not resolve.
|
|
57
|
+
*/
|
|
58
|
+
getMarketByTicker(params: GetNuanzeMarketByTickerParams): Promise<GetNuanzeMarketByTickerResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* Lists the latest funding observation per active perpetual market, refreshed about every five
|
|
61
|
+
* minutes.
|
|
62
|
+
*
|
|
63
|
+
* @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid.
|
|
64
|
+
*/
|
|
65
|
+
getFundingRates(params?: GetNuanzeFundingRatesParams): Promise<GetNuanzeFundingRatesResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* 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.
|
|
69
|
+
*
|
|
70
|
+
* @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid.
|
|
71
|
+
*/
|
|
72
|
+
getLeaderboard(params?: GetNuanzeLeaderboardParams): Promise<GetNuanzeLeaderboardResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Gets platform activity summary from five-minute aggregates.
|
|
75
|
+
*
|
|
76
|
+
* @throws {NuanzeServerFailureError} With `BAD_REQUEST` if the window is not a documented value.
|
|
77
|
+
*/
|
|
78
|
+
getPlatformSummary(params?: GetNuanzePlatformSummaryParams): Promise<GetNuanzePlatformSummaryResponse>;
|
|
79
|
+
/**
|
|
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.
|
|
84
|
+
*
|
|
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.
|
|
88
|
+
*/
|
|
89
|
+
getFollowedLeaderboard(params: GetNuanzeFollowedLeaderboardParams): Promise<GetNuanzeFollowedLeaderboardResponse>;
|
|
90
|
+
/**
|
|
91
|
+
* Gets replica-backed wallet analytics. Without `subaccountName`, latest cumulative values are
|
|
92
|
+
* selected per known subaccount and then summed. The response is a snapshot and does not claim
|
|
93
|
+
* live health, withdrawable collateral, open-order, or signer state.
|
|
94
|
+
*
|
|
95
|
+
* @throws {NuanzeServerFailureError} With `INVALID_ADDRESS` or `BAD_REQUEST` on invalid input,
|
|
96
|
+
* and `WALLET_NOT_FOUND` when the address has no wallet data.
|
|
97
|
+
*/
|
|
98
|
+
getWalletSummary(params: GetNuanzeWalletSummaryParams): Promise<GetNuanzeWalletSummaryResponse>;
|
|
99
|
+
/**
|
|
100
|
+
* Lists at most 500 current replica position rows across all known subaccounts by default. Rows
|
|
101
|
+
* remain per subaccount. Spot rows are excluded unless `includeSpot=true`. This is not an
|
|
102
|
+
* execution-grade live feed.
|
|
103
|
+
*
|
|
104
|
+
* @throws {NuanzeServerFailureError} With `INVALID_ADDRESS` or `BAD_REQUEST` on invalid input,
|
|
105
|
+
* and `WALLET_NOT_FOUND` when the address has no wallet data.
|
|
106
|
+
*/
|
|
107
|
+
getWalletPositions(params: GetNuanzeWalletPositionsParams): Promise<GetNuanzeWalletPositionsResponse>;
|
|
108
|
+
/**
|
|
109
|
+
* Lists market trades: one taker-side row per match, sorted by `matchedAt` then `id` descending.
|
|
110
|
+
* The exclusive cursor is bound to operation and normalized filters. `from` is inclusive and
|
|
111
|
+
* `to` exclusive. Wallet identity is absent.
|
|
112
|
+
*
|
|
113
|
+
* @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`,
|
|
114
|
+
* `INVALID_CURSOR`, `CURSOR_FILTER_MISMATCH`, `RANGE_TOO_LARGE`, or `BAD_REQUEST` on invalid
|
|
115
|
+
* input, and `MARKET_NOT_FOUND` when the ticker does not resolve.
|
|
116
|
+
*/
|
|
117
|
+
getMarketTrades(params: GetNuanzeMarketTradesParams): Promise<GetNuanzeMarketTradesResponse>;
|
|
118
|
+
/**
|
|
119
|
+
* Lists market candles. Source storage is 1h; 4h and 1d are UTC-aligned rollups and missing bars
|
|
120
|
+
* are not interpolated. The newest `limit` matching bars are selected and returned
|
|
121
|
+
* oldest-to-newest, at most 750, with no pagination. A current bucket has `complete=false`.
|
|
122
|
+
*
|
|
123
|
+
* @throws {NuanzeServerFailureError} With `UNSUPPORTED_INTERVAL`, `RANGE_TOO_LARGE`,
|
|
124
|
+
* `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`, or `BAD_REQUEST` on invalid input, and
|
|
125
|
+
* `MARKET_NOT_FOUND` when the ticker does not resolve.
|
|
126
|
+
*/
|
|
127
|
+
getMarketCandles(params: GetNuanzeMarketCandlesParams): Promise<GetNuanzeMarketCandlesResponse>;
|
|
128
|
+
/**
|
|
129
|
+
* Lists wallet-owned maker and taker execution rows, sorted by `matchedAt` then `id` descending.
|
|
130
|
+
* The cursor is exclusive and filter-bound. `from` is inclusive and `to` exclusive.
|
|
131
|
+
*
|
|
132
|
+
* @throws {NuanzeServerFailureError} With `INVALID_ADDRESS`, `INVALID_CURSOR`,
|
|
133
|
+
* `CURSOR_FILTER_MISMATCH`, `RANGE_TOO_LARGE`, or `BAD_REQUEST` on invalid input, and
|
|
134
|
+
* `WALLET_NOT_FOUND` when the address has no wallet data.
|
|
135
|
+
*/
|
|
136
|
+
getWalletTrades(params: GetNuanzeWalletTradesParams): Promise<GetNuanzeWalletTradesResponse>;
|
|
137
|
+
/**
|
|
138
|
+
* Gets wallet account PnL. 24h is rolling and uses hourly snapshots with a daily fallback
|
|
139
|
+
* baseline. Longer windows use daily snapshots; `all` starts at earliest coverage. PnL includes
|
|
140
|
+
* realized and unrealized movement plus funding.
|
|
141
|
+
*
|
|
142
|
+
* @throws {NuanzeServerFailureError} With `INVALID_ADDRESS` or `BAD_REQUEST` on invalid input,
|
|
143
|
+
* and `WALLET_NOT_FOUND` when the address has no wallet data.
|
|
144
|
+
*/
|
|
145
|
+
getWalletPnl(params: GetNuanzeWalletPnlParams): Promise<GetNuanzeWalletPnlResponse>;
|
|
146
|
+
/**
|
|
147
|
+
* Gets a wallet account series of at most 1,000 deterministically sampled points ordered by
|
|
148
|
+
* timestamp. Series contain a boundary anchor and a carried-forward request-time tip; synthetic
|
|
149
|
+
* points are identified. Latest buckets may be provisional.
|
|
150
|
+
*
|
|
151
|
+
* @throws {NuanzeServerFailureError} With `INVALID_ADDRESS` or `BAD_REQUEST` on invalid input,
|
|
152
|
+
* and `WALLET_NOT_FOUND` when the address has no wallet data.
|
|
153
|
+
*/
|
|
154
|
+
getWalletPnlSeries(params: GetNuanzeWalletPnlSeriesParams): Promise<GetNuanzeWalletPnlSeriesResponse>;
|
|
155
|
+
/**
|
|
156
|
+
* Lists public collateral events, sorted by timestamp then `id` descending. Repeated `productId`
|
|
157
|
+
* uses OR semantics. `minUsd` excludes unvalued events; without it unvalued events remain.
|
|
158
|
+
*
|
|
159
|
+
* @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`, or
|
|
160
|
+
* `CURSOR_FILTER_MISMATCH` when filters or the cursor are invalid.
|
|
161
|
+
*/
|
|
162
|
+
getCollateralFlows(params?: GetNuanzeCollateralFlowsParams): Promise<GetNuanzeCollateralFlowsResponse>;
|
|
163
|
+
/**
|
|
164
|
+
* Gets collateral flow aggregates: deposited, withdrawn, net, and gross, with valuation coverage
|
|
165
|
+
* and a prior equal-window comparison. `all` has no prior window.
|
|
166
|
+
*
|
|
167
|
+
* @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid.
|
|
168
|
+
*/
|
|
169
|
+
getCollateralFlowSummary(params?: GetNuanzeCollateralFlowSummaryParams): Promise<GetNuanzeCollateralFlowSummaryResponse>;
|
|
170
|
+
/**
|
|
171
|
+
* Gets collateral flow series of at most 1,000 UTC buckets. Allowed timeframe/bucket pairs are
|
|
172
|
+
* 24h/hour, 7d/hour or day (default hour), 30d/day, and all/day.
|
|
173
|
+
*
|
|
174
|
+
* @throws {NuanzeServerFailureError} With `UNSUPPORTED_BUCKET` or `BAD_REQUEST` when the pair or
|
|
175
|
+
* filters are invalid.
|
|
176
|
+
*/
|
|
177
|
+
getCollateralFlowSeries(params?: GetNuanzeCollateralFlowSeriesParams): Promise<GetNuanzeCollateralFlowSeriesResponse>;
|
|
178
|
+
/**
|
|
179
|
+
* Gets privacy-preserving aggregate positioning for an active perpetual. Cross and isolated legs
|
|
180
|
+
* are summed within owner/subaccount/product before direction classification. Every cell requires
|
|
181
|
+
* 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.
|
|
183
|
+
*
|
|
184
|
+
* @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`, or
|
|
185
|
+
* `BAD_REQUEST` on invalid input, and `MARKET_NOT_FOUND` when the ticker does not resolve to a
|
|
186
|
+
* perp.
|
|
187
|
+
*/
|
|
188
|
+
getMarketPositioning(params: GetNuanzeMarketPositioningParams): Promise<GetNuanzeMarketPositioningResponse>;
|
|
189
|
+
/**
|
|
190
|
+
* Lists open perpetual position legs for the resolved market. Results default to absolute
|
|
191
|
+
* notional descending and can be ordered by signed unrealized PnL or absolute base amount in
|
|
192
|
+
* either direction. Spot markets are not supported. Legs below $10 absolute notional are excluded.
|
|
193
|
+
* Wallet addresses and signed exact base amounts are returned.
|
|
194
|
+
*
|
|
195
|
+
* @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`,
|
|
196
|
+
* `INVALID_CURSOR`, `CURSOR_FILTER_MISMATCH`, or `BAD_REQUEST` on invalid input, and
|
|
197
|
+
* `MARKET_NOT_FOUND` when the ticker does not resolve to a perp.
|
|
198
|
+
*/
|
|
199
|
+
getMarketPositions(params: GetNuanzeMarketPositionsParams): Promise<GetNuanzeMarketPositionsResponse>;
|
|
200
|
+
/**
|
|
201
|
+
* Lists current open perpetual position legs across every market by signed unrealized PnL.
|
|
202
|
+
* Descending returns the largest gainers and ascending returns the largest losers. This is a
|
|
203
|
+
* 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.
|
|
206
|
+
*
|
|
207
|
+
* @throws {NuanzeServerFailureError} With `INVALID_CURSOR`, `CURSOR_FILTER_MISMATCH`, or
|
|
208
|
+
* `BAD_REQUEST` when the query or cursor is invalid.
|
|
209
|
+
*/
|
|
210
|
+
getOpenPositions(params?: GetNuanzeOpenPositionsParams): Promise<GetNuanzeOpenPositionsResponse>;
|
|
211
|
+
/**
|
|
212
|
+
* Performs a GET against `{baseUrl}{path}` and classifies the status before returning the body.
|
|
213
|
+
*/
|
|
214
|
+
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
|
+
private requestJson;
|
|
221
|
+
/**
|
|
222
|
+
* Validates the HTTP status before interpreting the body. Nuanze maps every domain failure onto a
|
|
223
|
+
* non-2xx status carrying a failure envelope, so anything else is a transport-level error.
|
|
224
|
+
*/
|
|
225
|
+
private checkResponseStatus;
|
|
226
|
+
}
|
|
227
|
+
//#endregion
|
|
228
|
+
export { NuanzeClient, NuanzeClient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;EA6DJ,eAAA,CACJ,MAAA,EAAQ,2BAAA,GACP,OAAA,CAAQ,6BAAA;EAtBL;;;;;;;;EAwCA,YAAA,CACJ,MAAA,EAAQ,wBAAA,GACP,OAAA,CAAQ,0BAAA;EApBA;;;;;;;;EAsCL,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EAAR;;;;;;;EAiBG,kBAAA,CACJ,MAAA,GAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EAaD;;;;;;EADJ,wBAAA,CACJ,MAAA,GAAQ,oCAAA,GACP,OAAA,CAAQ,sCAAA;EAkBR;;;;;;;EAFG,uBAAA,CACJ,MAAA,GAAQ,mCAAA,GACP,OAAA,CAAQ,qCAAA;EA0CD;;;;;;;;;;EAvBJ,oBAAA,CACJ,MAAA,EAAQ,gCAAA,GACP,OAAA,CAAQ,kCAAA;EAoEG;;;AAkBa;;;;;;;EAlErB,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;;;;;;;;;;;EAoBL,gBAAA,CACJ,MAAA,GAAQ,4BAAA,GACP,OAAA,CAAQ,8BAAA;;;;UAYG,OAAA;;;;;UAQA,QAAA;EAAA,QAIA,WAAA;;;;;UAkBN,mBAAA;AAAA"}
|
|
@@ -0,0 +1,229 @@
|
|
|
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";
|
|
2
|
+
import { AxiosInstance } from "axios";
|
|
3
|
+
|
|
4
|
+
//#region src/NuanzeClient.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Options for constructing a {@link NuanzeClient}.
|
|
7
|
+
*/
|
|
8
|
+
interface NuanzeClientOpts {
|
|
9
|
+
/**
|
|
10
|
+
* Base URL of the Nuanze API, including the version segment, e.g. {@link NUANZE_CLIENT_ENDPOINTS}.
|
|
11
|
+
*/
|
|
12
|
+
url: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Client for the Nuanze public analytics API: markets, wallets, trades, candles, collateral flows,
|
|
16
|
+
* and positioning.
|
|
17
|
+
*
|
|
18
|
+
* Read-only and credential-free, so unlike the other service clients it takes no wallet client or
|
|
19
|
+
* linked signer. It also sends no `x-nado-client-type` header: Nuanze is a public API that does not
|
|
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.
|
|
26
|
+
*/
|
|
27
|
+
declare class NuanzeClient {
|
|
28
|
+
readonly opts: NuanzeClientOpts;
|
|
29
|
+
readonly axiosInstance: AxiosInstance;
|
|
30
|
+
constructor(opts: NuanzeClientOpts);
|
|
31
|
+
/**
|
|
32
|
+
* Lists published editorial stories, sorted by `publishedAt` descending then `id` descending.
|
|
33
|
+
* The opaque cursor is exclusive and bound to normalized filters. Raw article ingestion, scoring,
|
|
34
|
+
* queue, and newsdesk fields are excluded.
|
|
35
|
+
*
|
|
36
|
+
* @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`, or
|
|
37
|
+
* `CURSOR_FILTER_MISMATCH` when filters or the cursor are invalid.
|
|
38
|
+
*/
|
|
39
|
+
getNews(params?: GetNuanzeNewsParams): Promise<GetNuanzeNewsResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Gets the active market universe, ordered by `productId` ascending. Never truncated, so `count`
|
|
42
|
+
* always equals the length of `markets`. Market metadata refreshes about every five minutes and
|
|
43
|
+
* prices about every minute.
|
|
44
|
+
*
|
|
45
|
+
* @throws {NuanzeServerFailureError} With error code `BAD_REQUEST` if a filter value is not a
|
|
46
|
+
* documented venue or tradability state.
|
|
47
|
+
*/
|
|
48
|
+
getMarkets(params?: GetNuanzeMarketsParams): Promise<GetNuanzeMarketsResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* Resolves a market by ticker. Lookup is case-insensitive and accepts canonical tickers or
|
|
51
|
+
* legacy source symbols. An explicit unavailable venue returns `MARKET_NOT_FOUND`. With no
|
|
52
|
+
* venue, `strictVenue=true` returns `AMBIGUOUS_MARKET` for multi-venue assets; otherwise the
|
|
53
|
+
* primary venue is used.
|
|
54
|
+
*
|
|
55
|
+
* @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`, or
|
|
56
|
+
* `BAD_REQUEST` on invalid selectors, and `MARKET_NOT_FOUND` when the ticker does not resolve.
|
|
57
|
+
*/
|
|
58
|
+
getMarketByTicker(params: GetNuanzeMarketByTickerParams): Promise<GetNuanzeMarketByTickerResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* Lists the latest funding observation per active perpetual market, refreshed about every five
|
|
61
|
+
* minutes.
|
|
62
|
+
*
|
|
63
|
+
* @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid.
|
|
64
|
+
*/
|
|
65
|
+
getFundingRates(params?: GetNuanzeFundingRatesParams): Promise<GetNuanzeFundingRatesResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* 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.
|
|
69
|
+
*
|
|
70
|
+
* @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid.
|
|
71
|
+
*/
|
|
72
|
+
getLeaderboard(params?: GetNuanzeLeaderboardParams): Promise<GetNuanzeLeaderboardResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Gets platform activity summary from five-minute aggregates.
|
|
75
|
+
*
|
|
76
|
+
* @throws {NuanzeServerFailureError} With `BAD_REQUEST` if the window is not a documented value.
|
|
77
|
+
*/
|
|
78
|
+
getPlatformSummary(params?: GetNuanzePlatformSummaryParams): Promise<GetNuanzePlatformSummaryResponse>;
|
|
79
|
+
/**
|
|
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.
|
|
84
|
+
*
|
|
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.
|
|
88
|
+
*/
|
|
89
|
+
getFollowedLeaderboard(params: GetNuanzeFollowedLeaderboardParams): Promise<GetNuanzeFollowedLeaderboardResponse>;
|
|
90
|
+
/**
|
|
91
|
+
* Gets replica-backed wallet analytics. Without `subaccountName`, latest cumulative values are
|
|
92
|
+
* selected per known subaccount and then summed. The response is a snapshot and does not claim
|
|
93
|
+
* live health, withdrawable collateral, open-order, or signer state.
|
|
94
|
+
*
|
|
95
|
+
* @throws {NuanzeServerFailureError} With `INVALID_ADDRESS` or `BAD_REQUEST` on invalid input,
|
|
96
|
+
* and `WALLET_NOT_FOUND` when the address has no wallet data.
|
|
97
|
+
*/
|
|
98
|
+
getWalletSummary(params: GetNuanzeWalletSummaryParams): Promise<GetNuanzeWalletSummaryResponse>;
|
|
99
|
+
/**
|
|
100
|
+
* Lists at most 500 current replica position rows across all known subaccounts by default. Rows
|
|
101
|
+
* remain per subaccount. Spot rows are excluded unless `includeSpot=true`. This is not an
|
|
102
|
+
* execution-grade live feed.
|
|
103
|
+
*
|
|
104
|
+
* @throws {NuanzeServerFailureError} With `INVALID_ADDRESS` or `BAD_REQUEST` on invalid input,
|
|
105
|
+
* and `WALLET_NOT_FOUND` when the address has no wallet data.
|
|
106
|
+
*/
|
|
107
|
+
getWalletPositions(params: GetNuanzeWalletPositionsParams): Promise<GetNuanzeWalletPositionsResponse>;
|
|
108
|
+
/**
|
|
109
|
+
* Lists market trades: one taker-side row per match, sorted by `matchedAt` then `id` descending.
|
|
110
|
+
* The exclusive cursor is bound to operation and normalized filters. `from` is inclusive and
|
|
111
|
+
* `to` exclusive. Wallet identity is absent.
|
|
112
|
+
*
|
|
113
|
+
* @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`,
|
|
114
|
+
* `INVALID_CURSOR`, `CURSOR_FILTER_MISMATCH`, `RANGE_TOO_LARGE`, or `BAD_REQUEST` on invalid
|
|
115
|
+
* input, and `MARKET_NOT_FOUND` when the ticker does not resolve.
|
|
116
|
+
*/
|
|
117
|
+
getMarketTrades(params: GetNuanzeMarketTradesParams): Promise<GetNuanzeMarketTradesResponse>;
|
|
118
|
+
/**
|
|
119
|
+
* Lists market candles. Source storage is 1h; 4h and 1d are UTC-aligned rollups and missing bars
|
|
120
|
+
* are not interpolated. The newest `limit` matching bars are selected and returned
|
|
121
|
+
* oldest-to-newest, at most 750, with no pagination. A current bucket has `complete=false`.
|
|
122
|
+
*
|
|
123
|
+
* @throws {NuanzeServerFailureError} With `UNSUPPORTED_INTERVAL`, `RANGE_TOO_LARGE`,
|
|
124
|
+
* `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`, or `BAD_REQUEST` on invalid input, and
|
|
125
|
+
* `MARKET_NOT_FOUND` when the ticker does not resolve.
|
|
126
|
+
*/
|
|
127
|
+
getMarketCandles(params: GetNuanzeMarketCandlesParams): Promise<GetNuanzeMarketCandlesResponse>;
|
|
128
|
+
/**
|
|
129
|
+
* Lists wallet-owned maker and taker execution rows, sorted by `matchedAt` then `id` descending.
|
|
130
|
+
* The cursor is exclusive and filter-bound. `from` is inclusive and `to` exclusive.
|
|
131
|
+
*
|
|
132
|
+
* @throws {NuanzeServerFailureError} With `INVALID_ADDRESS`, `INVALID_CURSOR`,
|
|
133
|
+
* `CURSOR_FILTER_MISMATCH`, `RANGE_TOO_LARGE`, or `BAD_REQUEST` on invalid input, and
|
|
134
|
+
* `WALLET_NOT_FOUND` when the address has no wallet data.
|
|
135
|
+
*/
|
|
136
|
+
getWalletTrades(params: GetNuanzeWalletTradesParams): Promise<GetNuanzeWalletTradesResponse>;
|
|
137
|
+
/**
|
|
138
|
+
* Gets wallet account PnL. 24h is rolling and uses hourly snapshots with a daily fallback
|
|
139
|
+
* baseline. Longer windows use daily snapshots; `all` starts at earliest coverage. PnL includes
|
|
140
|
+
* realized and unrealized movement plus funding.
|
|
141
|
+
*
|
|
142
|
+
* @throws {NuanzeServerFailureError} With `INVALID_ADDRESS` or `BAD_REQUEST` on invalid input,
|
|
143
|
+
* and `WALLET_NOT_FOUND` when the address has no wallet data.
|
|
144
|
+
*/
|
|
145
|
+
getWalletPnl(params: GetNuanzeWalletPnlParams): Promise<GetNuanzeWalletPnlResponse>;
|
|
146
|
+
/**
|
|
147
|
+
* Gets a wallet account series of at most 1,000 deterministically sampled points ordered by
|
|
148
|
+
* timestamp. Series contain a boundary anchor and a carried-forward request-time tip; synthetic
|
|
149
|
+
* points are identified. Latest buckets may be provisional.
|
|
150
|
+
*
|
|
151
|
+
* @throws {NuanzeServerFailureError} With `INVALID_ADDRESS` or `BAD_REQUEST` on invalid input,
|
|
152
|
+
* and `WALLET_NOT_FOUND` when the address has no wallet data.
|
|
153
|
+
*/
|
|
154
|
+
getWalletPnlSeries(params: GetNuanzeWalletPnlSeriesParams): Promise<GetNuanzeWalletPnlSeriesResponse>;
|
|
155
|
+
/**
|
|
156
|
+
* Lists public collateral events, sorted by timestamp then `id` descending. Repeated `productId`
|
|
157
|
+
* uses OR semantics. `minUsd` excludes unvalued events; without it unvalued events remain.
|
|
158
|
+
*
|
|
159
|
+
* @throws {NuanzeServerFailureError} With `BAD_REQUEST`, `INVALID_CURSOR`, or
|
|
160
|
+
* `CURSOR_FILTER_MISMATCH` when filters or the cursor are invalid.
|
|
161
|
+
*/
|
|
162
|
+
getCollateralFlows(params?: GetNuanzeCollateralFlowsParams): Promise<GetNuanzeCollateralFlowsResponse>;
|
|
163
|
+
/**
|
|
164
|
+
* Gets collateral flow aggregates: deposited, withdrawn, net, and gross, with valuation coverage
|
|
165
|
+
* and a prior equal-window comparison. `all` has no prior window.
|
|
166
|
+
*
|
|
167
|
+
* @throws {NuanzeServerFailureError} With `BAD_REQUEST` if a filter value is invalid.
|
|
168
|
+
*/
|
|
169
|
+
getCollateralFlowSummary(params?: GetNuanzeCollateralFlowSummaryParams): Promise<GetNuanzeCollateralFlowSummaryResponse>;
|
|
170
|
+
/**
|
|
171
|
+
* Gets collateral flow series of at most 1,000 UTC buckets. Allowed timeframe/bucket pairs are
|
|
172
|
+
* 24h/hour, 7d/hour or day (default hour), 30d/day, and all/day.
|
|
173
|
+
*
|
|
174
|
+
* @throws {NuanzeServerFailureError} With `UNSUPPORTED_BUCKET` or `BAD_REQUEST` when the pair or
|
|
175
|
+
* filters are invalid.
|
|
176
|
+
*/
|
|
177
|
+
getCollateralFlowSeries(params?: GetNuanzeCollateralFlowSeriesParams): Promise<GetNuanzeCollateralFlowSeriesResponse>;
|
|
178
|
+
/**
|
|
179
|
+
* Gets privacy-preserving aggregate positioning for an active perpetual. Cross and isolated legs
|
|
180
|
+
* are summed within owner/subaccount/product before direction classification. Every cell requires
|
|
181
|
+
* 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.
|
|
183
|
+
*
|
|
184
|
+
* @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`, or
|
|
185
|
+
* `BAD_REQUEST` on invalid input, and `MARKET_NOT_FOUND` when the ticker does not resolve to a
|
|
186
|
+
* perp.
|
|
187
|
+
*/
|
|
188
|
+
getMarketPositioning(params: GetNuanzeMarketPositioningParams): Promise<GetNuanzeMarketPositioningResponse>;
|
|
189
|
+
/**
|
|
190
|
+
* Lists open perpetual position legs for the resolved market. Results default to absolute
|
|
191
|
+
* notional descending and can be ordered by signed unrealized PnL or absolute base amount in
|
|
192
|
+
* either direction. Spot markets are not supported. Legs below $10 absolute notional are excluded.
|
|
193
|
+
* Wallet addresses and signed exact base amounts are returned.
|
|
194
|
+
*
|
|
195
|
+
* @throws {NuanzeServerFailureError} With `AMBIGUOUS_MARKET`, `MARKET_SELECTOR_MISMATCH`,
|
|
196
|
+
* `INVALID_CURSOR`, `CURSOR_FILTER_MISMATCH`, or `BAD_REQUEST` on invalid input, and
|
|
197
|
+
* `MARKET_NOT_FOUND` when the ticker does not resolve to a perp.
|
|
198
|
+
*/
|
|
199
|
+
getMarketPositions(params: GetNuanzeMarketPositionsParams): Promise<GetNuanzeMarketPositionsResponse>;
|
|
200
|
+
/**
|
|
201
|
+
* Lists current open perpetual position legs across every market by signed unrealized PnL.
|
|
202
|
+
* Descending returns the largest gainers and ascending returns the largest losers. This is a
|
|
203
|
+
* 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.
|
|
206
|
+
*
|
|
207
|
+
* @throws {NuanzeServerFailureError} With `INVALID_CURSOR`, `CURSOR_FILTER_MISMATCH`, or
|
|
208
|
+
* `BAD_REQUEST` when the query or cursor is invalid.
|
|
209
|
+
*/
|
|
210
|
+
getOpenPositions(params?: GetNuanzeOpenPositionsParams): Promise<GetNuanzeOpenPositionsResponse>;
|
|
211
|
+
/**
|
|
212
|
+
* Performs a GET against `{baseUrl}{path}` and classifies the status before returning the body.
|
|
213
|
+
*/
|
|
214
|
+
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
|
+
private requestJson;
|
|
221
|
+
/**
|
|
222
|
+
* Validates the HTTP status before interpreting the body. Nuanze maps every domain failure onto a
|
|
223
|
+
* non-2xx status carrying a failure envelope, so anything else is a transport-level error.
|
|
224
|
+
*/
|
|
225
|
+
private checkResponseStatus;
|
|
226
|
+
}
|
|
227
|
+
//#endregion
|
|
228
|
+
export { NuanzeClient, NuanzeClientOpts };
|
|
229
|
+
//# sourceMappingURL=NuanzeClient.d.ts.map
|
|
@@ -0,0 +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