@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.
- package/README.md +117 -46
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.js +5226 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/services/BalanceService.d.ts +543 -0
- package/dist/cjs/services/BaseService.d.ts +357 -0
- package/dist/cjs/services/CovalentClient.d.ts +65 -0
- package/dist/cjs/services/NftService.d.ts +620 -0
- package/dist/cjs/services/PricingService.d.ts +88 -0
- package/dist/cjs/services/SecurityService.d.ts +158 -0
- package/dist/cjs/services/TransactionService.d.ts +457 -0
- package/dist/cjs/services/XykService.d.ts +686 -0
- package/dist/cjs/util/ApiHelpers.d.ts +5 -0
- package/dist/cjs/util/backoff.d.ts +11 -0
- package/dist/cjs/util/types/BalanceServiceTypes.d.ts +322 -0
- package/dist/cjs/util/types/BaseServiceTypes.d.ts +180 -0
- package/dist/cjs/util/types/GenericTypes.d.ts +96 -0
- package/dist/cjs/util/types/NftServiceTypes.d.ts +297 -0
- package/dist/cjs/util/types/PricingServiceTypes.d.ts +31 -0
- package/dist/cjs/util/types/SecurityServiceTypes.d.ts +121 -0
- package/dist/cjs/util/types/TransactionServiceTypes.d.ts +322 -0
- package/dist/cjs/util/types/XykServiceTypes.d.ts +479 -0
- package/dist/es/index.d.ts +9 -0
- package/dist/es/index.js +5223 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/services/BalanceService.d.ts +543 -0
- package/dist/es/services/BaseService.d.ts +357 -0
- package/dist/es/services/CovalentClient.d.ts +65 -0
- package/dist/es/services/NftService.d.ts +620 -0
- package/dist/es/services/PricingService.d.ts +88 -0
- package/dist/es/services/SecurityService.d.ts +158 -0
- package/dist/es/services/TransactionService.d.ts +457 -0
- package/dist/es/services/XykService.d.ts +686 -0
- package/dist/es/util/ApiHelpers.d.ts +5 -0
- package/dist/es/util/backoff.d.ts +11 -0
- package/dist/es/util/types/BalanceServiceTypes.d.ts +322 -0
- package/dist/es/util/types/BaseServiceTypes.d.ts +180 -0
- package/dist/es/util/types/GenericTypes.d.ts +96 -0
- package/dist/es/util/types/NftServiceTypes.d.ts +297 -0
- package/dist/es/util/types/PricingServiceTypes.d.ts +31 -0
- package/dist/es/util/types/SecurityServiceTypes.d.ts +121 -0
- package/dist/es/util/types/TransactionServiceTypes.d.ts +322 -0
- package/dist/es/util/types/XykServiceTypes.d.ts +479 -0
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.js +5223 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/services/BalanceService.d.ts +543 -0
- package/dist/esm/services/BaseService.d.ts +357 -0
- package/dist/esm/services/CovalentClient.d.ts +65 -0
- package/dist/esm/services/NftService.d.ts +620 -0
- package/dist/esm/services/PricingService.d.ts +88 -0
- package/dist/esm/services/SecurityService.d.ts +158 -0
- package/dist/esm/services/TransactionService.d.ts +457 -0
- package/dist/esm/services/XykService.d.ts +686 -0
- package/dist/esm/util/ApiHelpers.d.ts +5 -0
- package/dist/esm/util/backoff.d.ts +11 -0
- package/dist/esm/util/types/BalanceServiceTypes.d.ts +322 -0
- package/dist/esm/util/types/BaseServiceTypes.d.ts +180 -0
- package/dist/esm/util/types/GenericTypes.d.ts +96 -0
- package/dist/esm/util/types/NftServiceTypes.d.ts +297 -0
- package/dist/esm/util/types/PricingServiceTypes.d.ts +31 -0
- package/dist/esm/util/types/SecurityServiceTypes.d.ts +121 -0
- package/dist/esm/util/types/TransactionServiceTypes.d.ts +322 -0
- package/dist/esm/util/types/XykServiceTypes.d.ts +479 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -27
- package/dist/index.js.map +1 -1
- package/dist/services/BalanceService.d.ts +149 -11
- package/dist/services/BalanceService.js +300 -84
- package/dist/services/BalanceService.js.map +1 -1
- package/dist/services/BaseService.d.ts +46 -10
- package/dist/services/BaseService.js +199 -151
- package/dist/services/BaseService.js.map +1 -1
- package/dist/services/CovalentClient.d.ts +65 -0
- package/dist/services/CovalentClient.js +44 -0
- package/dist/services/CovalentClient.js.map +1 -0
- package/dist/services/NftService.d.ts +182 -16
- package/dist/services/NftService.js +490 -211
- package/dist/services/NftService.js.map +1 -1
- package/dist/services/PricingService.d.ts +8 -3
- package/dist/services/PricingService.js +44 -38
- package/dist/services/PricingService.js.map +1 -1
- package/dist/services/SecurityService.d.ts +71 -3
- package/dist/services/SecurityService.js +140 -32
- package/dist/services/SecurityService.js.map +1 -1
- package/dist/services/TransactionService.d.ts +58 -9
- package/dist/services/TransactionService.js +152 -103
- package/dist/services/TransactionService.js.map +1 -1
- package/dist/services/XykService.d.ts +85 -19
- package/dist/services/XykService.js +470 -291
- package/dist/services/XykService.js.map +1 -1
- package/dist/util/ApiHelpers.d.ts +2 -1
- package/dist/util/ApiHelpers.js +57 -36
- package/dist/util/ApiHelpers.js.map +1 -1
- package/dist/util/backoff.d.ts +5 -3
- package/dist/util/backoff.js +35 -13
- package/dist/util/backoff.js.map +1 -1
- package/dist/util/types/BalanceServiceTypes.d.ts +63 -0
- package/dist/util/types/BalanceServiceTypes.js +1 -2
- package/dist/util/types/BaseServiceTypes.d.ts +8 -0
- package/dist/util/types/BaseServiceTypes.js +1 -2
- package/dist/util/types/GenericTypes.d.ts +7 -0
- package/dist/util/types/GenericTypes.js +1 -2
- package/dist/util/types/NftServiceTypes.d.ts +86 -2
- package/dist/util/types/NftServiceTypes.js +1 -2
- package/dist/util/types/PricingServiceTypes.js +1 -2
- package/dist/util/types/SecurityServiceTypes.d.ts +51 -0
- package/dist/util/types/SecurityServiceTypes.js +1 -2
- package/dist/util/types/TransactionServiceTypes.d.ts +24 -2
- package/dist/util/types/TransactionServiceTypes.js +1 -2
- package/dist/util/types/XykServiceTypes.d.ts +20 -6
- package/dist/util/types/XykServiceTypes.js +1 -2
- package/package.json +19 -4
- package/dist/services/Client.d.ts +0 -29
- package/dist/services/Client.js +0 -30
- package/dist/services/Client.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Chain, Quote, Response } from "./CovalentClient";
|
|
2
2
|
declare class BalancesResponse {
|
|
3
3
|
/** * The requested address. */
|
|
4
4
|
address: string;
|
|
@@ -37,12 +37,20 @@ declare class BalanceItem {
|
|
|
37
37
|
is_spam: boolean;
|
|
38
38
|
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
39
39
|
balance: bigint | null;
|
|
40
|
+
/** * The 24h asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
41
|
+
balance_24h: bigint | null;
|
|
40
42
|
/** * The exchange rate for the requested quote currency. */
|
|
41
43
|
quote_rate: number;
|
|
44
|
+
/** * The 24h exchange rate for the requested quote currency. */
|
|
45
|
+
quote_rate_24h: number;
|
|
42
46
|
/** * The current balance converted to fiat in `quote-currency`. */
|
|
43
47
|
quote: number;
|
|
48
|
+
/** * The 24h balance converted to fiat in `quote-currency`. */
|
|
49
|
+
quote_24h: number;
|
|
44
50
|
/** * A prettier version of the quote for rendering purposes. */
|
|
45
51
|
pretty_quote: string;
|
|
52
|
+
/** * A prettier version of the 24h quote for rendering purposes. */
|
|
53
|
+
pretty_quote_24h: string;
|
|
46
54
|
/** * NFT-specific data. */
|
|
47
55
|
nft_data: NftData[];
|
|
48
56
|
constructor(data: BalanceItem);
|
|
@@ -123,11 +131,29 @@ declare class HoldingItem {
|
|
|
123
131
|
declare class OhlcItem {
|
|
124
132
|
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
125
133
|
balance: bigint | null;
|
|
134
|
+
/** * The current balance converted to fiat in `quote-currency`. */
|
|
126
135
|
quote: number;
|
|
127
136
|
/** * A prettier version of the quote for rendering purposes. */
|
|
128
137
|
pretty_quote: string;
|
|
129
138
|
constructor(data: OhlcItem);
|
|
130
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
|
+
}
|
|
131
157
|
declare class BlockTransactionWithContractTransfers {
|
|
132
158
|
/** * The block signed timestamp in UTC. */
|
|
133
159
|
block_signed_at: Date;
|
|
@@ -137,10 +163,15 @@ declare class BlockTransactionWithContractTransfers {
|
|
|
137
163
|
tx_hash: string;
|
|
138
164
|
/** * The offset is the position of the tx in the block. */
|
|
139
165
|
tx_offset: number;
|
|
166
|
+
/** * Whether or not transaction is successful. */
|
|
140
167
|
successful: boolean;
|
|
168
|
+
/** * The sender's wallet address. */
|
|
141
169
|
from_address: string;
|
|
170
|
+
/** * The label of `from` address. */
|
|
142
171
|
from_address_label: string;
|
|
172
|
+
/** * The receiver's wallet address. */
|
|
143
173
|
to_address: string;
|
|
174
|
+
/** * The label of `to` address. */
|
|
144
175
|
to_address_label: string;
|
|
145
176
|
/** * The value attached to this tx. */
|
|
146
177
|
value: bigint | null;
|
|
@@ -149,7 +180,9 @@ declare class BlockTransactionWithContractTransfers {
|
|
|
149
180
|
/** * A prettier version of the quote for rendering purposes. */
|
|
150
181
|
pretty_value_quote: string;
|
|
151
182
|
gas_offered: number;
|
|
183
|
+
/** * The gas spent for this tx. */
|
|
152
184
|
gas_spent: number;
|
|
185
|
+
/** * The gas price at the time of this tx. */
|
|
153
186
|
gas_price: number;
|
|
154
187
|
/** * The transaction's gas_price * gas_spent, denoted in wei. */
|
|
155
188
|
fees_paid: bigint | null;
|
|
@@ -162,14 +195,29 @@ declare class BlockTransactionWithContractTransfers {
|
|
|
162
195
|
transfers: TokenTransferItem[];
|
|
163
196
|
constructor(data: BlockTransactionWithContractTransfers);
|
|
164
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
|
+
}
|
|
165
209
|
declare class TokenTransferItem {
|
|
166
210
|
/** * The block signed timestamp in UTC. */
|
|
167
211
|
block_signed_at: Date;
|
|
168
212
|
/** * The requested transaction hash. */
|
|
169
213
|
tx_hash: string;
|
|
214
|
+
/** * The sender's wallet address. */
|
|
170
215
|
from_address: string;
|
|
216
|
+
/** * The label of `from` address. */
|
|
171
217
|
from_address_label: string;
|
|
218
|
+
/** * The receiver's wallet address. */
|
|
172
219
|
to_address: string;
|
|
220
|
+
/** * The label of `to` address. */
|
|
173
221
|
to_address_label: string;
|
|
174
222
|
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
175
223
|
contract_decimals: number;
|
|
@@ -181,6 +229,7 @@ declare class TokenTransferItem {
|
|
|
181
229
|
contract_address: string;
|
|
182
230
|
/** * The contract logo URL. */
|
|
183
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. */
|
|
184
233
|
transfer_type: string;
|
|
185
234
|
/** * The delta attached to this transfer. */
|
|
186
235
|
delta: bigint | null;
|
|
@@ -188,14 +237,18 @@ declare class TokenTransferItem {
|
|
|
188
237
|
balance: bigint | null;
|
|
189
238
|
/** * The exchange rate for the requested quote currency. */
|
|
190
239
|
quote_rate: number;
|
|
240
|
+
/** * The current delta converted to fiat in `quote-currency`. */
|
|
191
241
|
delta_quote: number;
|
|
192
242
|
/** * A prettier version of the quote for rendering purposes. */
|
|
193
243
|
pretty_delta_quote: string;
|
|
244
|
+
/** * The current balance converted to fiat in `quote-currency`. */
|
|
194
245
|
balance_quote: number;
|
|
246
|
+
/** * Additional details on which transfer events were invoked. Defaults to `true`. */
|
|
195
247
|
method_calls: MethodCallsForTransfers[];
|
|
196
248
|
constructor(data: TokenTransferItem);
|
|
197
249
|
}
|
|
198
250
|
declare class MethodCallsForTransfers {
|
|
251
|
+
/** * The address of the sender. */
|
|
199
252
|
sender_address: string;
|
|
200
253
|
method: string;
|
|
201
254
|
constructor(data: MethodCallsForTransfers);
|
|
@@ -275,9 +328,49 @@ declare class HistoricalBalanceItem {
|
|
|
275
328
|
nft_data: NftData[];
|
|
276
329
|
constructor(data: HistoricalBalanceItem);
|
|
277
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
|
+
}
|
|
278
371
|
export interface GetTokenBalancesForWalletAddressQueryParamOpts {
|
|
279
372
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
280
|
-
quoteCurrency?:
|
|
373
|
+
quoteCurrency?: Quote;
|
|
281
374
|
/** * If `true`, NFTs will be included in the response. */
|
|
282
375
|
nft?: boolean;
|
|
283
376
|
/** * If `true`, only NFTs that have been cached will be included in the response. Helpful for faster response times. */
|
|
@@ -289,13 +382,13 @@ export interface GetTokenBalancesForWalletAddressQueryParamOpts {
|
|
|
289
382
|
}
|
|
290
383
|
export interface GetHistoricalPortfolioForWalletAddressQueryParamOpts {
|
|
291
384
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
292
|
-
quoteCurrency?:
|
|
385
|
+
quoteCurrency?: Quote;
|
|
293
386
|
/** * The number of days to return data for. Defaults to 30 days. */
|
|
294
387
|
days?: number;
|
|
295
388
|
}
|
|
296
389
|
export interface GetErc20TransfersForWalletAddressQueryParamOpts {
|
|
297
390
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
298
|
-
quoteCurrency?:
|
|
391
|
+
quoteCurrency?: Quote;
|
|
299
392
|
/** * The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically. */
|
|
300
393
|
contractAddress?: string;
|
|
301
394
|
/** * The block height to start from, defaults to `0`. */
|
|
@@ -317,7 +410,7 @@ export interface GetTokenHoldersV2ForTokenAddressQueryParamOpts {
|
|
|
317
410
|
}
|
|
318
411
|
export interface GetHistoricalTokenBalancesForWalletAddressQueryParamOpts {
|
|
319
412
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
320
|
-
quoteCurrency?:
|
|
413
|
+
quoteCurrency?: Quote;
|
|
321
414
|
/** * If `true`, NFTs will be included in the response. */
|
|
322
415
|
nft?: boolean;
|
|
323
416
|
/** * If `true`, only NFTs that have been cached will be included in the response. Helpful for faster response times. */
|
|
@@ -331,14 +424,25 @@ export interface GetHistoricalTokenBalancesForWalletAddressQueryParamOpts {
|
|
|
331
424
|
/** * Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date. */
|
|
332
425
|
date?: number;
|
|
333
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
|
+
}
|
|
334
433
|
/**
|
|
335
434
|
* Balances APIs
|
|
336
435
|
*
|
|
337
436
|
*/
|
|
338
437
|
export declare class BalanceService {
|
|
339
438
|
private apiKey;
|
|
340
|
-
|
|
439
|
+
private debug;
|
|
440
|
+
private threadCount;
|
|
441
|
+
private LIMIT;
|
|
442
|
+
constructor(apiKey: string, debug?: boolean, threadCount?: number);
|
|
341
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.
|
|
342
446
|
*
|
|
343
447
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
344
448
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
@@ -350,8 +454,10 @@ export declare class BalanceService {
|
|
|
350
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.
|
|
351
455
|
*
|
|
352
456
|
*/
|
|
353
|
-
getTokenBalancesForWalletAddress(chainName:
|
|
457
|
+
getTokenBalancesForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetTokenBalancesForWalletAddressQueryParamOpts): Promise<Response<BalancesResponse>>;
|
|
354
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.
|
|
355
461
|
*
|
|
356
462
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
357
463
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
@@ -360,8 +466,26 @@ export declare class BalanceService {
|
|
|
360
466
|
* - `days`: The number of days to return data for. Defaults to 30 days.
|
|
361
467
|
*
|
|
362
468
|
*/
|
|
363
|
-
getHistoricalPortfolioForWalletAddress(chainName:
|
|
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>;
|
|
364
486
|
/**
|
|
487
|
+
*
|
|
488
|
+
* Commonly used to render the transfer-in and transfer-out of a token along with historical prices from an address.
|
|
365
489
|
*
|
|
366
490
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
367
491
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
@@ -374,8 +498,10 @@ export declare class BalanceService {
|
|
|
374
498
|
* - `pageNumber`: 0-indexed page number to begin pagination.
|
|
375
499
|
*
|
|
376
500
|
*/
|
|
377
|
-
|
|
501
|
+
getErc20TransfersForWalletAddressByPage(chainName: Chain, walletAddress: string, queryParamOpts?: GetErc20TransfersForWalletAddressQueryParamOpts): Promise<Response<Erc20TransfersResponse>>;
|
|
378
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.
|
|
379
505
|
*
|
|
380
506
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
381
507
|
* @param {string} tokenAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
@@ -385,8 +511,10 @@ export declare class BalanceService {
|
|
|
385
511
|
* - `pageNumber`: 0-indexed page number to begin pagination.
|
|
386
512
|
*
|
|
387
513
|
*/
|
|
388
|
-
getTokenHoldersV2ForTokenAddress(chainName:
|
|
514
|
+
getTokenHoldersV2ForTokenAddress(chainName: Chain, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): AsyncIterable<TokenHolder>;
|
|
389
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.
|
|
390
518
|
*
|
|
391
519
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
392
520
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
@@ -400,6 +528,16 @@ export declare class BalanceService {
|
|
|
400
528
|
* - `date`: Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date.
|
|
401
529
|
*
|
|
402
530
|
*/
|
|
403
|
-
getHistoricalTokenBalancesForWalletAddress(chainName:
|
|
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>>;
|
|
404
542
|
}
|
|
405
543
|
export {};
|