@covalenthq/client-sdk 0.2.9 → 0.5.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 (116) hide show
  1. package/README.md +117 -46
  2. package/dist/cjs/index.d.ts +9 -0
  3. package/dist/cjs/index.js +5226 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/dist/cjs/services/BalanceService.d.ts +543 -0
  6. package/dist/cjs/services/BaseService.d.ts +357 -0
  7. package/dist/cjs/services/CovalentClient.d.ts +65 -0
  8. package/dist/cjs/services/NftService.d.ts +620 -0
  9. package/dist/cjs/services/PricingService.d.ts +88 -0
  10. package/dist/cjs/services/SecurityService.d.ts +158 -0
  11. package/dist/cjs/services/TransactionService.d.ts +457 -0
  12. package/dist/cjs/services/XykService.d.ts +686 -0
  13. package/dist/cjs/util/ApiHelpers.d.ts +5 -0
  14. package/dist/cjs/util/backoff.d.ts +11 -0
  15. package/dist/cjs/util/types/BalanceServiceTypes.d.ts +322 -0
  16. package/dist/cjs/util/types/BaseServiceTypes.d.ts +180 -0
  17. package/dist/cjs/util/types/GenericTypes.d.ts +96 -0
  18. package/dist/cjs/util/types/NftServiceTypes.d.ts +297 -0
  19. package/dist/cjs/util/types/PricingServiceTypes.d.ts +31 -0
  20. package/dist/cjs/util/types/SecurityServiceTypes.d.ts +121 -0
  21. package/dist/cjs/util/types/TransactionServiceTypes.d.ts +322 -0
  22. package/dist/cjs/util/types/XykServiceTypes.d.ts +479 -0
  23. package/dist/es/index.d.ts +9 -0
  24. package/dist/es/index.js +5223 -0
  25. package/dist/es/index.js.map +1 -0
  26. package/dist/es/services/BalanceService.d.ts +543 -0
  27. package/dist/es/services/BaseService.d.ts +357 -0
  28. package/dist/es/services/CovalentClient.d.ts +65 -0
  29. package/dist/es/services/NftService.d.ts +620 -0
  30. package/dist/es/services/PricingService.d.ts +88 -0
  31. package/dist/es/services/SecurityService.d.ts +158 -0
  32. package/dist/es/services/TransactionService.d.ts +457 -0
  33. package/dist/es/services/XykService.d.ts +686 -0
  34. package/dist/es/util/ApiHelpers.d.ts +5 -0
  35. package/dist/es/util/backoff.d.ts +11 -0
  36. package/dist/es/util/types/BalanceServiceTypes.d.ts +322 -0
  37. package/dist/es/util/types/BaseServiceTypes.d.ts +180 -0
  38. package/dist/es/util/types/GenericTypes.d.ts +96 -0
  39. package/dist/es/util/types/NftServiceTypes.d.ts +297 -0
  40. package/dist/es/util/types/PricingServiceTypes.d.ts +31 -0
  41. package/dist/es/util/types/SecurityServiceTypes.d.ts +121 -0
  42. package/dist/es/util/types/TransactionServiceTypes.d.ts +322 -0
  43. package/dist/es/util/types/XykServiceTypes.d.ts +479 -0
  44. package/dist/esm/index.d.ts +9 -0
  45. package/dist/esm/index.js +5223 -0
  46. package/dist/esm/index.js.map +1 -0
  47. package/dist/esm/services/BalanceService.d.ts +543 -0
  48. package/dist/esm/services/BaseService.d.ts +357 -0
  49. package/dist/esm/services/CovalentClient.d.ts +65 -0
  50. package/dist/esm/services/NftService.d.ts +620 -0
  51. package/dist/esm/services/PricingService.d.ts +88 -0
  52. package/dist/esm/services/SecurityService.d.ts +158 -0
  53. package/dist/esm/services/TransactionService.d.ts +457 -0
  54. package/dist/esm/services/XykService.d.ts +686 -0
  55. package/dist/esm/util/ApiHelpers.d.ts +5 -0
  56. package/dist/esm/util/backoff.d.ts +11 -0
  57. package/dist/esm/util/types/BalanceServiceTypes.d.ts +322 -0
  58. package/dist/esm/util/types/BaseServiceTypes.d.ts +180 -0
  59. package/dist/esm/util/types/GenericTypes.d.ts +96 -0
  60. package/dist/esm/util/types/NftServiceTypes.d.ts +297 -0
  61. package/dist/esm/util/types/PricingServiceTypes.d.ts +31 -0
  62. package/dist/esm/util/types/SecurityServiceTypes.d.ts +121 -0
  63. package/dist/esm/util/types/TransactionServiceTypes.d.ts +322 -0
  64. package/dist/esm/util/types/XykServiceTypes.d.ts +479 -0
  65. package/dist/index.d.ts +1 -1
  66. package/dist/index.js +9 -27
  67. package/dist/index.js.map +1 -1
  68. package/dist/services/BalanceService.d.ts +149 -11
  69. package/dist/services/BalanceService.js +300 -84
  70. package/dist/services/BalanceService.js.map +1 -1
  71. package/dist/services/BaseService.d.ts +46 -10
  72. package/dist/services/BaseService.js +199 -151
  73. package/dist/services/BaseService.js.map +1 -1
  74. package/dist/services/CovalentClient.d.ts +65 -0
  75. package/dist/services/CovalentClient.js +44 -0
  76. package/dist/services/CovalentClient.js.map +1 -0
  77. package/dist/services/NftService.d.ts +182 -16
  78. package/dist/services/NftService.js +490 -211
  79. package/dist/services/NftService.js.map +1 -1
  80. package/dist/services/PricingService.d.ts +8 -3
  81. package/dist/services/PricingService.js +44 -38
  82. package/dist/services/PricingService.js.map +1 -1
  83. package/dist/services/SecurityService.d.ts +71 -3
  84. package/dist/services/SecurityService.js +140 -32
  85. package/dist/services/SecurityService.js.map +1 -1
  86. package/dist/services/TransactionService.d.ts +58 -9
  87. package/dist/services/TransactionService.js +152 -103
  88. package/dist/services/TransactionService.js.map +1 -1
  89. package/dist/services/XykService.d.ts +85 -19
  90. package/dist/services/XykService.js +470 -291
  91. package/dist/services/XykService.js.map +1 -1
  92. package/dist/util/ApiHelpers.d.ts +2 -1
  93. package/dist/util/ApiHelpers.js +57 -36
  94. package/dist/util/ApiHelpers.js.map +1 -1
  95. package/dist/util/backoff.d.ts +5 -3
  96. package/dist/util/backoff.js +35 -13
  97. package/dist/util/backoff.js.map +1 -1
  98. package/dist/util/types/BalanceServiceTypes.d.ts +63 -0
  99. package/dist/util/types/BalanceServiceTypes.js +1 -2
  100. package/dist/util/types/BaseServiceTypes.d.ts +8 -0
  101. package/dist/util/types/BaseServiceTypes.js +1 -2
  102. package/dist/util/types/GenericTypes.d.ts +7 -0
  103. package/dist/util/types/GenericTypes.js +1 -2
  104. package/dist/util/types/NftServiceTypes.d.ts +86 -2
  105. package/dist/util/types/NftServiceTypes.js +1 -2
  106. package/dist/util/types/PricingServiceTypes.js +1 -2
  107. package/dist/util/types/SecurityServiceTypes.d.ts +51 -0
  108. package/dist/util/types/SecurityServiceTypes.js +1 -2
  109. package/dist/util/types/TransactionServiceTypes.d.ts +24 -2
  110. package/dist/util/types/TransactionServiceTypes.js +1 -2
  111. package/dist/util/types/XykServiceTypes.d.ts +20 -6
  112. package/dist/util/types/XykServiceTypes.js +1 -2
  113. package/package.json +19 -4
  114. package/dist/services/Client.d.ts +0 -29
  115. package/dist/services/Client.js +0 -30
  116. package/dist/services/Client.js.map +0 -1
@@ -0,0 +1,543 @@
1
+ import { Chain, Quote, Response } from "./CovalentClient";
2
+ declare class BalancesResponse {
3
+ /** * The requested address. */
4
+ address: string;
5
+ /** * The requested chain ID eg: `1`. */
6
+ chain_id: number;
7
+ /** * The requested chain name eg: `eth-mainnet`. */
8
+ chain_name: string;
9
+ /** * The requested quote currency eg: `USD`. */
10
+ quote_currency: string;
11
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
12
+ updated_at: Date;
13
+ /** * List of response items. */
14
+ items: BalanceItem[];
15
+ constructor(data: BalancesResponse);
16
+ }
17
+ declare class BalanceItem {
18
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
19
+ contract_decimals: number;
20
+ /** * The string returned by the `name()` method. */
21
+ contract_name: string;
22
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
23
+ contract_ticker_symbol: string;
24
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
25
+ contract_address: string;
26
+ /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
27
+ supports_erc: string;
28
+ /** * The contract logo URL. */
29
+ logo_url: string;
30
+ /** * The timestamp when the token was transferred. */
31
+ last_transferred_at: Date;
32
+ /** * Indicates if a token is the chain's native gas token, eg: ETH on Ethereum. */
33
+ native_token: boolean;
34
+ /** * One of `cryptocurrency`, `stablecoin`, `nft` or `dust`. */
35
+ type: string;
36
+ /** * Denotes whether the token is suspected spam. */
37
+ is_spam: boolean;
38
+ /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
39
+ balance: bigint | null;
40
+ /** * The 24h asset balance. Use `contract_decimals` to scale this balance for display purposes. */
41
+ balance_24h: bigint | null;
42
+ /** * The exchange rate for the requested quote currency. */
43
+ quote_rate: number;
44
+ /** * The 24h exchange rate for the requested quote currency. */
45
+ quote_rate_24h: number;
46
+ /** * The current balance converted to fiat in `quote-currency`. */
47
+ quote: number;
48
+ /** * The 24h balance converted to fiat in `quote-currency`. */
49
+ quote_24h: number;
50
+ /** * A prettier version of the quote for rendering purposes. */
51
+ pretty_quote: string;
52
+ /** * A prettier version of the 24h quote for rendering purposes. */
53
+ pretty_quote_24h: string;
54
+ /** * NFT-specific data. */
55
+ nft_data: NftData[];
56
+ constructor(data: BalanceItem);
57
+ }
58
+ declare class NftData {
59
+ /** * The token's id. */
60
+ token_id: bigint | null;
61
+ token_url: string;
62
+ /** * The original minter. */
63
+ original_owner: string;
64
+ external_data: NftExternalData;
65
+ /** * If `true`, the asset data is available from the Covalent CDN. */
66
+ asset_cached: boolean;
67
+ /** * If `true`, the image data is available from the Covalent CDN. */
68
+ image_cached: boolean;
69
+ constructor(data: NftData);
70
+ }
71
+ declare class NftExternalData {
72
+ name: string;
73
+ description: string;
74
+ asset_url: string;
75
+ asset_file_extension: string;
76
+ asset_mime_type: string;
77
+ asset_size_bytes: string;
78
+ image: string;
79
+ image_256: string;
80
+ image_512: string;
81
+ image_1024: string;
82
+ animation_url: string;
83
+ external_url: string;
84
+ attributes: NftCollectionAttribute[];
85
+ constructor(data: NftExternalData);
86
+ }
87
+ declare class NftCollectionAttribute {
88
+ trait_type: string;
89
+ value: string;
90
+ constructor(data: NftCollectionAttribute);
91
+ }
92
+ declare class PortfolioResponse {
93
+ /** * The requested address. */
94
+ address: string;
95
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
96
+ updated_at: Date;
97
+ /** * The requested quote currency eg: `USD`. */
98
+ quote_currency: string;
99
+ /** * The requested chain ID eg: `1`. */
100
+ chain_id: number;
101
+ /** * The requested chain name eg: `eth-mainnet`. */
102
+ chain_name: string;
103
+ /** * List of response items. */
104
+ items: PortfolioItem[];
105
+ constructor(data: PortfolioResponse);
106
+ }
107
+ declare class PortfolioItem {
108
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
109
+ contract_address: string;
110
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
111
+ contract_decimals: number;
112
+ /** * The string returned by the `name()` method. */
113
+ contract_name: string;
114
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
115
+ contract_ticker_symbol: string;
116
+ /** * The contract logo URL. */
117
+ logo_url: string;
118
+ holdings: HoldingItem[];
119
+ constructor(data: PortfolioItem);
120
+ }
121
+ declare class HoldingItem {
122
+ /** * The exchange rate for the requested quote currency. */
123
+ quote_rate: number;
124
+ timestamp: Date;
125
+ close: OhlcItem;
126
+ high: OhlcItem;
127
+ low: OhlcItem;
128
+ open: OhlcItem;
129
+ constructor(data: HoldingItem);
130
+ }
131
+ declare class OhlcItem {
132
+ /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
133
+ balance: bigint | null;
134
+ /** * The current balance converted to fiat in `quote-currency`. */
135
+ quote: number;
136
+ /** * A prettier version of the quote for rendering purposes. */
137
+ pretty_quote: string;
138
+ constructor(data: OhlcItem);
139
+ }
140
+ declare class Erc20TransfersResponse {
141
+ /** * The requested address. */
142
+ address: string;
143
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
144
+ updated_at: Date;
145
+ /** * The requested quote currency eg: `USD`. */
146
+ quote_currency: string;
147
+ /** * The requested chain ID eg: `1`. */
148
+ chain_id: number;
149
+ /** * The requested chain name eg: `eth-mainnet`. */
150
+ chain_name: string;
151
+ /** * List of response items. */
152
+ items: BlockTransactionWithContractTransfers[];
153
+ /** * Pagination metadata. */
154
+ pagination: Pagination;
155
+ constructor(data: Erc20TransfersResponse);
156
+ }
157
+ declare class BlockTransactionWithContractTransfers {
158
+ /** * The block signed timestamp in UTC. */
159
+ block_signed_at: Date;
160
+ /** * The height of the block. */
161
+ block_height: number;
162
+ /** * The requested transaction hash. */
163
+ tx_hash: string;
164
+ /** * The offset is the position of the tx in the block. */
165
+ tx_offset: number;
166
+ /** * Whether or not transaction is successful. */
167
+ successful: boolean;
168
+ /** * The sender's wallet address. */
169
+ from_address: string;
170
+ /** * The label of `from` address. */
171
+ from_address_label: string;
172
+ /** * The receiver's wallet address. */
173
+ to_address: string;
174
+ /** * The label of `to` address. */
175
+ to_address_label: string;
176
+ /** * The value attached to this tx. */
177
+ value: bigint | null;
178
+ /** * The value attached in `quote-currency` to this tx. */
179
+ value_quote: number;
180
+ /** * A prettier version of the quote for rendering purposes. */
181
+ pretty_value_quote: string;
182
+ gas_offered: number;
183
+ /** * The gas spent for this tx. */
184
+ gas_spent: number;
185
+ /** * The gas price at the time of this tx. */
186
+ gas_price: number;
187
+ /** * The transaction's gas_price * gas_spent, denoted in wei. */
188
+ fees_paid: bigint | null;
189
+ /** * The gas spent in `quote-currency` denomination. */
190
+ gas_quote: number;
191
+ /** * A prettier version of the quote for rendering purposes. */
192
+ pretty_gas_quote: string;
193
+ /** * The native gas exchange rate for the requested `quote-currency`. */
194
+ gas_quote_rate: number;
195
+ transfers: TokenTransferItem[];
196
+ constructor(data: BlockTransactionWithContractTransfers);
197
+ }
198
+ declare class Pagination {
199
+ /** * True is there is another page. */
200
+ has_more: boolean;
201
+ /** * The requested page number. */
202
+ page_number: number;
203
+ /** * The requested number of items on the current page. */
204
+ page_size: number;
205
+ /** * The total number of items across all pages for this request. */
206
+ total_count: number;
207
+ constructor(data: Pagination);
208
+ }
209
+ declare class TokenTransferItem {
210
+ /** * The block signed timestamp in UTC. */
211
+ block_signed_at: Date;
212
+ /** * The requested transaction hash. */
213
+ tx_hash: string;
214
+ /** * The sender's wallet address. */
215
+ from_address: string;
216
+ /** * The label of `from` address. */
217
+ from_address_label: string;
218
+ /** * The receiver's wallet address. */
219
+ to_address: string;
220
+ /** * The label of `to` address. */
221
+ to_address_label: string;
222
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
223
+ contract_decimals: number;
224
+ /** * The string returned by the `name()` method. */
225
+ contract_name: string;
226
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
227
+ contract_ticker_symbol: string;
228
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
229
+ contract_address: string;
230
+ /** * The contract logo URL. */
231
+ logo_url: string;
232
+ /** * Categorizes token transactions as either `transfer-in` or `transfer-out`, indicating whether tokens are being received or sent from an account. */
233
+ transfer_type: string;
234
+ /** * The delta attached to this transfer. */
235
+ delta: bigint | null;
236
+ /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
237
+ balance: bigint | null;
238
+ /** * The exchange rate for the requested quote currency. */
239
+ quote_rate: number;
240
+ /** * The current delta converted to fiat in `quote-currency`. */
241
+ delta_quote: number;
242
+ /** * A prettier version of the quote for rendering purposes. */
243
+ pretty_delta_quote: string;
244
+ /** * The current balance converted to fiat in `quote-currency`. */
245
+ balance_quote: number;
246
+ /** * Additional details on which transfer events were invoked. Defaults to `true`. */
247
+ method_calls: MethodCallsForTransfers[];
248
+ constructor(data: TokenTransferItem);
249
+ }
250
+ declare class MethodCallsForTransfers {
251
+ /** * The address of the sender. */
252
+ sender_address: string;
253
+ method: string;
254
+ constructor(data: MethodCallsForTransfers);
255
+ }
256
+ declare class TokenHolder {
257
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
258
+ contract_decimals: number;
259
+ /** * The string returned by the `name()` method. */
260
+ contract_name: string;
261
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
262
+ contract_ticker_symbol: string;
263
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
264
+ contract_address: string;
265
+ /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
266
+ supports_erc: string;
267
+ /** * The contract logo URL. */
268
+ logo_url: string;
269
+ /** * The requested address. */
270
+ address: string;
271
+ /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
272
+ balance: bigint | null;
273
+ /** * Total supply of this token. */
274
+ total_supply: bigint | null;
275
+ /** * The height of the block. */
276
+ block_height: number;
277
+ constructor(data: TokenHolder);
278
+ }
279
+ declare class HistoricalBalancesResponse {
280
+ /** * The requested address. */
281
+ address: string;
282
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
283
+ updated_at: Date;
284
+ /** * The requested quote currency eg: `USD`. */
285
+ quote_currency: string;
286
+ /** * The requested chain ID eg: `1`. */
287
+ chain_id: number;
288
+ /** * The requested chain name eg: `eth-mainnet`. */
289
+ chain_name: string;
290
+ /** * List of response items. */
291
+ items: HistoricalBalanceItem[];
292
+ constructor(data: HistoricalBalancesResponse);
293
+ }
294
+ declare class HistoricalBalanceItem {
295
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
296
+ contract_decimals: number;
297
+ /** * The string returned by the `name()` method. */
298
+ contract_name: string;
299
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
300
+ contract_ticker_symbol: string;
301
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
302
+ contract_address: string;
303
+ /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
304
+ supports_erc: string;
305
+ /** * The contract logo URL. */
306
+ logo_url: string;
307
+ /** * The height of the block. */
308
+ block_height: number;
309
+ /** * The block height when the token was last transferred. */
310
+ last_transferred_block_height: number;
311
+ /** * The timestamp when the token was transferred. */
312
+ last_transferred_at: Date;
313
+ /** * Indicates if a token is the chain's native gas token, eg: ETH on Ethereum. */
314
+ native_token: boolean;
315
+ /** * One of `cryptocurrency`, `stablecoin`, `nft` or `dust`. */
316
+ type: string;
317
+ /** * Denotes whether the token is suspected spam. */
318
+ is_spam: boolean;
319
+ /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
320
+ balance: bigint | null;
321
+ /** * The exchange rate for the requested quote currency. */
322
+ quote_rate: number;
323
+ /** * The current balance converted to fiat in `quote-currency`. */
324
+ quote: number;
325
+ /** * A prettier version of the quote for rendering purposes. */
326
+ pretty_quote: string;
327
+ /** * NFT-specific data. */
328
+ nft_data: NftData[];
329
+ constructor(data: HistoricalBalanceItem);
330
+ }
331
+ declare class TokenBalanceNativeResponse {
332
+ /** * The requested address. */
333
+ address: string;
334
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
335
+ updated_at: Date;
336
+ /** * The requested quote currency eg: `USD`. */
337
+ quote_currency: string;
338
+ /** * The requested chain ID eg: `1`. */
339
+ chain_id: number;
340
+ /** * The requested chain name eg: `eth-mainnet`. */
341
+ chain_name: string;
342
+ /** * List of response items. */
343
+ items: NativeBalanceItem[];
344
+ constructor(data: TokenBalanceNativeResponse);
345
+ }
346
+ declare class NativeBalanceItem {
347
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
348
+ contract_decimals: number;
349
+ /** * The string returned by the `name()` method. */
350
+ contract_name: string;
351
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
352
+ contract_ticker_symbol: string;
353
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
354
+ contract_address: string;
355
+ /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
356
+ supports_erc: string;
357
+ /** * The contract logo URL. */
358
+ logo_url: string;
359
+ /** * The height of the block. */
360
+ block_height: number;
361
+ /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
362
+ balance: bigint | null;
363
+ /** * The exchange rate for the requested quote currency. */
364
+ quote_rate: number;
365
+ /** * The current balance converted to fiat in `quote-currency`. */
366
+ quote: number;
367
+ /** * A prettier version of the quote for rendering purposes. */
368
+ pretty_quote: string;
369
+ constructor(data: NativeBalanceItem);
370
+ }
371
+ export interface GetTokenBalancesForWalletAddressQueryParamOpts {
372
+ /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
373
+ quoteCurrency?: Quote;
374
+ /** * If `true`, NFTs will be included in the response. */
375
+ nft?: boolean;
376
+ /** * If `true`, only NFTs that have been cached will be included in the response. Helpful for faster response times. */
377
+ noNftFetch?: boolean;
378
+ /** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
379
+ noSpam?: boolean;
380
+ /** * If `true`, the response shape is limited to a list of collections and token ids, omitting metadata and asset information. Helpful for faster response times and wallets holding a large number of NFTs. */
381
+ noNftAssetMetadata?: boolean;
382
+ }
383
+ export interface GetHistoricalPortfolioForWalletAddressQueryParamOpts {
384
+ /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
385
+ quoteCurrency?: Quote;
386
+ /** * The number of days to return data for. Defaults to 30 days. */
387
+ days?: number;
388
+ }
389
+ export interface GetErc20TransfersForWalletAddressQueryParamOpts {
390
+ /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
391
+ quoteCurrency?: Quote;
392
+ /** * The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically. */
393
+ contractAddress?: string;
394
+ /** * The block height to start from, defaults to `0`. */
395
+ startingBlock?: number;
396
+ /** * The block height to end at, defaults to current block height. */
397
+ endingBlock?: number;
398
+ /** * Number of items per page. Omitting this parameter defaults to 100. */
399
+ pageSize?: number;
400
+ /** * 0-indexed page number to begin pagination. */
401
+ pageNumber?: number;
402
+ }
403
+ export interface GetTokenHoldersV2ForTokenAddressQueryParamOpts {
404
+ /** * Ending block to define a block range. Omitting this parameter defaults to the latest block height. */
405
+ blockHeight?: number;
406
+ /** * Number of items per page. Note: Currently, only values of `100` and `1000` are supported. Omitting this parameter defaults to 100. */
407
+ pageSize?: number;
408
+ /** * 0-indexed page number to begin pagination. */
409
+ pageNumber?: number;
410
+ }
411
+ export interface GetHistoricalTokenBalancesForWalletAddressQueryParamOpts {
412
+ /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
413
+ quoteCurrency?: Quote;
414
+ /** * If `true`, NFTs will be included in the response. */
415
+ nft?: boolean;
416
+ /** * If `true`, only NFTs that have been cached will be included in the response. Helpful for faster response times. */
417
+ noNftFetch?: boolean;
418
+ /** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
419
+ noSpam?: boolean;
420
+ /** * If `true`, the response shape is limited to a list of collections and token ids, omitting metadata and asset information. Helpful for faster response times and wallets holding a large number of NFTs. */
421
+ noNftAssetMetadata?: boolean;
422
+ /** * Ending block to define a block range. Omitting this parameter defaults to the latest block height. */
423
+ blockHeight?: number;
424
+ /** * Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date. */
425
+ date?: number;
426
+ }
427
+ export interface GetNativeTokenBalanceQueryParamOpts {
428
+ /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
429
+ quoteCurrency?: Quote;
430
+ /** * Ending block to define a block range. Omitting this parameter defaults to the latest block height. */
431
+ blockHeight?: number;
432
+ }
433
+ /**
434
+ * Balances APIs
435
+ *
436
+ */
437
+ export declare class BalanceService {
438
+ private apiKey;
439
+ private debug;
440
+ private threadCount;
441
+ private LIMIT;
442
+ constructor(apiKey: string, debug?: boolean, threadCount?: number);
443
+ /**
444
+ *
445
+ * Commonly used to fetch the native, fungible (ERC20), and non-fungible (ERC721 & ERC1155) tokens held by an address. Response includes spot prices and other metadata.
446
+ *
447
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
448
+ * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
449
+ * @param {GetTokenBalancesForWalletAddressQueryParamOpts} queryParamOpts
450
+ * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
451
+ * - `nft`: If `true`, NFTs will be included in the response.
452
+ * - `noNftFetch`: If `true`, only NFTs that have been cached will be included in the response. Helpful for faster response times.
453
+ * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
454
+ * - `noNftAssetMetadata`: If `true`, the response shape is limited to a list of collections and token ids, omitting metadata and asset information. Helpful for faster response times and wallets holding a large number of NFTs.
455
+ *
456
+ */
457
+ getTokenBalancesForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetTokenBalancesForWalletAddressQueryParamOpts): Promise<Response<BalancesResponse>>;
458
+ /**
459
+ *
460
+ * Commonly used to render a daily portfolio balance for an address broken down by the token. The timeframe is user-configurable, defaults to 30 days.
461
+ *
462
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
463
+ * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
464
+ * @param {GetHistoricalPortfolioForWalletAddressQueryParamOpts} queryParamOpts
465
+ * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
466
+ * - `days`: The number of days to return data for. Defaults to 30 days.
467
+ *
468
+ */
469
+ getHistoricalPortfolioForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetHistoricalPortfolioForWalletAddressQueryParamOpts): Promise<Response<PortfolioResponse>>;
470
+ /**
471
+ *
472
+ * Commonly used to render the transfer-in and transfer-out of a token along with historical prices from an address.
473
+ *
474
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
475
+ * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
476
+ * @param {GetErc20TransfersForWalletAddressQueryParamOpts} queryParamOpts
477
+ * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
478
+ * - `contractAddress`: The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
479
+ * - `startingBlock`: The block height to start from, defaults to `0`.
480
+ * - `endingBlock`: The block height to end at, defaults to current block height.
481
+ * - `pageSize`: Number of items per page. Omitting this parameter defaults to 100.
482
+ * - `pageNumber`: 0-indexed page number to begin pagination.
483
+ *
484
+ */
485
+ getErc20TransfersForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetErc20TransfersForWalletAddressQueryParamOpts): AsyncIterable<BlockTransactionWithContractTransfers>;
486
+ /**
487
+ *
488
+ * Commonly used to render the transfer-in and transfer-out of a token along with historical prices from an address.
489
+ *
490
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
491
+ * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
492
+ * @param {GetErc20TransfersForWalletAddressQueryParamOpts} queryParamOpts
493
+ * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
494
+ * - `contractAddress`: The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
495
+ * - `startingBlock`: The block height to start from, defaults to `0`.
496
+ * - `endingBlock`: The block height to end at, defaults to current block height.
497
+ * - `pageSize`: Number of items per page. Omitting this parameter defaults to 100.
498
+ * - `pageNumber`: 0-indexed page number to begin pagination.
499
+ *
500
+ */
501
+ getErc20TransfersForWalletAddressByPage(chainName: Chain, walletAddress: string, queryParamOpts?: GetErc20TransfersForWalletAddressQueryParamOpts): Promise<Response<Erc20TransfersResponse>>;
502
+ /**
503
+ *
504
+ * Commonly used to get a list of all the token holders for a specified ERC20 or ERC721 token. Returns historic token holders when block-height is set (defaults to `latest`). Useful for building pie charts of token holders.
505
+ *
506
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
507
+ * @param {string} tokenAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
508
+ * @param {GetTokenHoldersV2ForTokenAddressQueryParamOpts} queryParamOpts
509
+ * - `blockHeight`: Ending block to define a block range. Omitting this parameter defaults to the latest block height.
510
+ * - `pageSize`: Number of items per page. Note: Currently, only values of `100` and `1000` are supported. Omitting this parameter defaults to 100.
511
+ * - `pageNumber`: 0-indexed page number to begin pagination.
512
+ *
513
+ */
514
+ getTokenHoldersV2ForTokenAddress(chainName: Chain, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): AsyncIterable<TokenHolder>;
515
+ /**
516
+ *
517
+ * Commonly used to fetch the historical native, fungible (ERC20), and non-fungible (ERC721 & ERC1155) tokens held by an address at a given block height or date. Response includes daily prices and other metadata.
518
+ *
519
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
520
+ * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
521
+ * @param {GetHistoricalTokenBalancesForWalletAddressQueryParamOpts} queryParamOpts
522
+ * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
523
+ * - `nft`: If `true`, NFTs will be included in the response.
524
+ * - `noNftFetch`: If `true`, only NFTs that have been cached will be included in the response. Helpful for faster response times.
525
+ * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
526
+ * - `noNftAssetMetadata`: If `true`, the response shape is limited to a list of collections and token ids, omitting metadata and asset information. Helpful for faster response times and wallets holding a large number of NFTs.
527
+ * - `blockHeight`: Ending block to define a block range. Omitting this parameter defaults to the latest block height.
528
+ * - `date`: Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date.
529
+ *
530
+ */
531
+ getHistoricalTokenBalancesForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetHistoricalTokenBalancesForWalletAddressQueryParamOpts): Promise<Response<HistoricalBalancesResponse>>;
532
+ /**
533
+ *
534
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
535
+ * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
536
+ * @param {GetNativeTokenBalanceQueryParamOpts} queryParamOpts
537
+ * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
538
+ * - `blockHeight`: Ending block to define a block range. Omitting this parameter defaults to the latest block height.
539
+ *
540
+ */
541
+ getNativeTokenBalance(chainName: Chain, walletAddress: string, queryParamOpts?: GetNativeTokenBalanceQueryParamOpts): Promise<Response<TokenBalanceNativeResponse>>;
542
+ }
543
+ export {};