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