@covalenthq/client-sdk 0.6.6 → 0.7.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 (82) hide show
  1. package/README.md +16 -5
  2. package/dist/cjs/index.d.ts +2 -1
  3. package/dist/cjs/index.js +758 -25
  4. package/dist/cjs/index.js.map +1 -1
  5. package/dist/cjs/services/BalanceService.d.ts +11 -9
  6. package/dist/cjs/services/BaseService.d.ts +65 -11
  7. package/dist/cjs/services/CovalentClient.d.ts +3 -15
  8. package/dist/cjs/services/NftService.d.ts +18 -16
  9. package/dist/cjs/services/PricingService.d.ts +4 -2
  10. package/dist/cjs/services/SecurityService.d.ts +5 -3
  11. package/dist/cjs/services/TransactionService.d.ts +12 -10
  12. package/dist/cjs/services/XykService.d.ts +16 -14
  13. package/dist/cjs/util/ApiKeyValidator.d.ts +8 -0
  14. package/dist/cjs/util/Chains.d.ts +180 -0
  15. package/dist/cjs/util/types/BaseServiceTypes.d.ts +36 -0
  16. package/dist/cjs/util/types/TransactionServiceTypes.d.ts +3 -3
  17. package/dist/es/index.d.ts +2 -1
  18. package/dist/es/index.js +759 -26
  19. package/dist/es/index.js.map +1 -1
  20. package/dist/es/services/BalanceService.d.ts +11 -9
  21. package/dist/es/services/BaseService.d.ts +65 -11
  22. package/dist/es/services/CovalentClient.d.ts +3 -15
  23. package/dist/es/services/NftService.d.ts +18 -16
  24. package/dist/es/services/PricingService.d.ts +4 -2
  25. package/dist/es/services/SecurityService.d.ts +5 -3
  26. package/dist/es/services/TransactionService.d.ts +12 -10
  27. package/dist/es/services/XykService.d.ts +16 -14
  28. package/dist/es/util/ApiKeyValidator.d.ts +8 -0
  29. package/dist/es/util/Chains.d.ts +180 -0
  30. package/dist/es/util/types/BaseServiceTypes.d.ts +36 -0
  31. package/dist/es/util/types/TransactionServiceTypes.d.ts +3 -3
  32. package/dist/esm/index.d.ts +2 -1
  33. package/dist/esm/index.js +759 -26
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/esm/services/BalanceService.d.ts +11 -9
  36. package/dist/esm/services/BaseService.d.ts +65 -11
  37. package/dist/esm/services/CovalentClient.d.ts +3 -15
  38. package/dist/esm/services/NftService.d.ts +18 -16
  39. package/dist/esm/services/PricingService.d.ts +4 -2
  40. package/dist/esm/services/SecurityService.d.ts +5 -3
  41. package/dist/esm/services/TransactionService.d.ts +12 -10
  42. package/dist/esm/services/XykService.d.ts +16 -14
  43. package/dist/esm/util/ApiKeyValidator.d.ts +8 -0
  44. package/dist/esm/util/Chains.d.ts +180 -0
  45. package/dist/esm/util/types/BaseServiceTypes.d.ts +36 -0
  46. package/dist/esm/util/types/TransactionServiceTypes.d.ts +3 -3
  47. package/dist/index.d.ts +2 -1
  48. package/dist/index.js +1 -0
  49. package/dist/index.js.map +1 -1
  50. package/dist/services/BalanceService.d.ts +11 -9
  51. package/dist/services/BalanceService.js +57 -1
  52. package/dist/services/BalanceService.js.map +1 -1
  53. package/dist/services/BaseService.d.ts +65 -11
  54. package/dist/services/BaseService.js +187 -1
  55. package/dist/services/BaseService.js.map +1 -1
  56. package/dist/services/CovalentClient.d.ts +3 -15
  57. package/dist/services/CovalentClient.js +20 -15
  58. package/dist/services/CovalentClient.js.map +1 -1
  59. package/dist/services/NftService.d.ts +18 -16
  60. package/dist/services/NftService.js +113 -1
  61. package/dist/services/NftService.js.map +1 -1
  62. package/dist/services/PricingService.d.ts +4 -2
  63. package/dist/services/PricingService.js +11 -1
  64. package/dist/services/PricingService.js.map +1 -1
  65. package/dist/services/SecurityService.d.ts +5 -3
  66. package/dist/services/SecurityService.js +19 -1
  67. package/dist/services/SecurityService.js.map +1 -1
  68. package/dist/services/TransactionService.d.ts +12 -10
  69. package/dist/services/TransactionService.js +49 -4
  70. package/dist/services/TransactionService.js.map +1 -1
  71. package/dist/services/XykService.d.ts +16 -14
  72. package/dist/services/XykService.js +115 -1
  73. package/dist/services/XykService.js.map +1 -1
  74. package/dist/util/ApiKeyValidator.d.ts +8 -0
  75. package/dist/util/ApiKeyValidator.js +13 -0
  76. package/dist/util/ApiKeyValidator.js.map +1 -0
  77. package/dist/util/Chains.d.ts +180 -0
  78. package/dist/util/Chains.js +182 -0
  79. package/dist/util/Chains.js.map +1 -0
  80. package/dist/util/types/BaseServiceTypes.d.ts +36 -0
  81. package/dist/util/types/TransactionServiceTypes.d.ts +3 -3
  82. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import { Chain, Quote, Response } from "./CovalentClient";
2
+ import { Chains } from "../util/Chains";
2
3
  declare class BalancesResponse {
3
4
  /** * The requested address. */
4
5
  address: string;
@@ -482,8 +483,9 @@ export declare class BalanceService {
482
483
  private apiKey;
483
484
  private debug;
484
485
  private threadCount;
486
+ private is_key_valid;
485
487
  private LIMIT;
486
- constructor(apiKey: string, debug?: boolean, threadCount?: number);
488
+ constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean);
487
489
  /**
488
490
  *
489
491
  * 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.
@@ -498,7 +500,7 @@ export declare class BalanceService {
498
500
  * - `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.
499
501
  *
500
502
  */
501
- getTokenBalancesForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetTokenBalancesForWalletAddressQueryParamOpts): Promise<Response<BalancesResponse>>;
503
+ getTokenBalancesForWalletAddress(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetTokenBalancesForWalletAddressQueryParamOpts): Promise<Response<BalancesResponse>>;
502
504
  /**
503
505
  *
504
506
  * 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.
@@ -510,7 +512,7 @@ export declare class BalanceService {
510
512
  * - `days`: The number of days to return data for. Defaults to 30 days.
511
513
  *
512
514
  */
513
- getHistoricalPortfolioForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetHistoricalPortfolioForWalletAddressQueryParamOpts): Promise<Response<PortfolioResponse>>;
515
+ getHistoricalPortfolioForWalletAddress(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetHistoricalPortfolioForWalletAddressQueryParamOpts): Promise<Response<PortfolioResponse>>;
514
516
  /**
515
517
  *
516
518
  * Commonly used to render the transfer-in and transfer-out of a token along with historical prices from an address.
@@ -526,7 +528,7 @@ export declare class BalanceService {
526
528
  * - `pageNumber`: 0-indexed page number to begin pagination.
527
529
  *
528
530
  */
529
- getErc20TransfersForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetErc20TransfersForWalletAddressQueryParamOpts): AsyncIterable<BlockTransactionWithContractTransfers>;
531
+ getErc20TransfersForWalletAddress(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetErc20TransfersForWalletAddressQueryParamOpts): AsyncIterable<BlockTransactionWithContractTransfers>;
530
532
  /**
531
533
  *
532
534
  * Commonly used to render the transfer-in and transfer-out of a token along with historical prices from an address.
@@ -542,7 +544,7 @@ export declare class BalanceService {
542
544
  * - `pageNumber`: 0-indexed page number to begin pagination.
543
545
  *
544
546
  */
545
- getErc20TransfersForWalletAddressByPage(chainName: Chain, walletAddress: string, queryParamOpts?: GetErc20TransfersForWalletAddressQueryParamOpts): Promise<Response<Erc20TransfersResponse>>;
547
+ getErc20TransfersForWalletAddressByPage(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetErc20TransfersForWalletAddressQueryParamOpts): Promise<Response<Erc20TransfersResponse>>;
546
548
  /**
547
549
  *
548
550
  * 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.
@@ -556,7 +558,7 @@ export declare class BalanceService {
556
558
  * - `date`: Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date.
557
559
  *
558
560
  */
559
- getTokenHoldersV2ForTokenAddress(chainName: Chain, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): AsyncIterable<TokenHolder>;
561
+ getTokenHoldersV2ForTokenAddress(chainName: Chain | Chains, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): AsyncIterable<TokenHolder>;
560
562
  /**
561
563
  *
562
564
  * 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.
@@ -570,7 +572,7 @@ export declare class BalanceService {
570
572
  * - `date`: Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date.
571
573
  *
572
574
  */
573
- getTokenHoldersV2ForTokenAddressByPage(chainName: Chain, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): Promise<Response<TokenHoldersResponse>>;
575
+ getTokenHoldersV2ForTokenAddressByPage(chainName: Chain | Chains, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): Promise<Response<TokenHoldersResponse>>;
574
576
  /**
575
577
  *
576
578
  * 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.
@@ -587,7 +589,7 @@ export declare class BalanceService {
587
589
  * - `date`: Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date.
588
590
  *
589
591
  */
590
- getHistoricalTokenBalancesForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetHistoricalTokenBalancesForWalletAddressQueryParamOpts): Promise<Response<HistoricalBalancesResponse>>;
592
+ getHistoricalTokenBalancesForWalletAddress(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetHistoricalTokenBalancesForWalletAddressQueryParamOpts): Promise<Response<HistoricalBalancesResponse>>;
591
593
  /**
592
594
  *
593
595
  * @param {string} chainName - The chain name eg: `eth-mainnet`.
@@ -597,6 +599,6 @@ export declare class BalanceService {
597
599
  * - `blockHeight`: Ending block to define a block range. Omitting this parameter defaults to the latest block height.
598
600
  *
599
601
  */
600
- getNativeTokenBalance(chainName: Chain, walletAddress: string, queryParamOpts?: GetNativeTokenBalanceQueryParamOpts): Promise<Response<TokenBalanceNativeResponse>>;
602
+ getNativeTokenBalance(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetNativeTokenBalanceQueryParamOpts): Promise<Response<TokenBalanceNativeResponse>>;
601
603
  }
602
604
  export {};
@@ -1,4 +1,5 @@
1
- import { Chain, Response } from "./CovalentClient";
1
+ import { Chain, Quote, Response } from "./CovalentClient";
2
+ import { Chains } from "../util/Chains";
2
3
  declare class BlockResponse {
3
4
  /** * The timestamp when the response was generated. Useful to show data staleness to users. */
4
5
  updated_at: Date;
@@ -265,6 +266,45 @@ declare class ChainActivityEvent extends ChainItem {
265
266
  last_seen_at: Date;
266
267
  constructor(data: ChainActivityEvent);
267
268
  }
269
+ declare class GasPricesResponse {
270
+ /** * The requested chain ID eg: `1`. */
271
+ chain_id: number;
272
+ /** * The requested chain name eg: `eth-mainnet`. */
273
+ chain_name: string;
274
+ /** * The requested quote currency eg: `USD`. */
275
+ quote_currency: string;
276
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
277
+ updated_at: Date;
278
+ /** * The requested event type. */
279
+ event_type: string;
280
+ /** * The exchange rate for the requested quote currency. */
281
+ gas_quote_rate: number;
282
+ /** * List of response items. */
283
+ items: PriceItem[];
284
+ constructor(data: GasPricesResponse);
285
+ }
286
+ declare class PriceItem {
287
+ /** * The average gas price, in WEI, for the time interval. */
288
+ gas_price: string;
289
+ /** * The average gas spent for the time interval. */
290
+ gas_spent: string;
291
+ /** * The average gas spent in `quote-currency` denomination for the time interval. */
292
+ gas_quote: number;
293
+ /** * Other fees, when applicable. For example: OP chain L1 fees. */
294
+ other_fees: OtherFees;
295
+ /** * The sum of the L1 and L2 gas spent, in quote-currency, for the specified time interval. */
296
+ total_gas_quote: number;
297
+ /** * A prettier version of the total average gas spent, in quote-currency, for the specified time interval, for rendering purposes. */
298
+ pretty_total_gas_quote: string;
299
+ /** * The specified time interval. */
300
+ interval: string;
301
+ constructor(data: PriceItem);
302
+ }
303
+ declare class OtherFees {
304
+ /** * The calculated L1 gas spent, when applicable, in quote-currency, for the specified time interval. */
305
+ l1_gas_quote: number;
306
+ constructor(data: OtherFees);
307
+ }
268
308
  export interface GetBlockHeightsQueryParamOpts {
269
309
  /** * Number of items per page. Omitting this parameter defaults to 100. */
270
310
  pageSize?: number;
@@ -311,6 +351,10 @@ export interface GetAddressActivityQueryParamOpts {
311
351
  /** * Set to true to include testnets with activity in the response. By default, it's set to `false` and only returns mainnet activity. */
312
352
  testnets?: boolean;
313
353
  }
354
+ export interface GetGasPricesQueryParamOpts {
355
+ /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
356
+ quoteCurrency?: Quote;
357
+ }
314
358
  /**
315
359
  * Class A - Base
316
360
  *
@@ -319,8 +363,9 @@ export declare class BaseService {
319
363
  private apiKey;
320
364
  private debug;
321
365
  private threadCount;
366
+ private is_key_valid;
322
367
  private LIMIT;
323
- constructor(apiKey: string, debug?: boolean, threadCount?: number);
368
+ constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean);
324
369
  /**
325
370
  *
326
371
  * Commonly used to fetch and render a single block for a block explorer.
@@ -329,7 +374,7 @@ export declare class BaseService {
329
374
  * @param {string} blockHeight - The block height or `latest` for the latest block available.
330
375
  *
331
376
  */
332
- getBlock(chainName: Chain, blockHeight: string): Promise<Response<BlockResponse>>;
377
+ getBlock(chainName: Chain | Chains, blockHeight: string): Promise<Response<BlockResponse>>;
333
378
  /**
334
379
  *
335
380
  * Commonly used to resolve ENS, RNS and Unstoppable Domains addresses.
@@ -338,7 +383,7 @@ export declare class BaseService {
338
383
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
339
384
  *
340
385
  */
341
- getResolvedAddress(chainName: Chain, walletAddress: string): Promise<Response<ResolvedAddress>>;
386
+ getResolvedAddress(chainName: Chain | Chains, walletAddress: string): Promise<Response<ResolvedAddress>>;
342
387
  /**
343
388
  *
344
389
  * Commonly used to get all the block heights within a particular date range. Useful for rendering a display where you sort blocks by day.
@@ -351,7 +396,7 @@ export declare class BaseService {
351
396
  * - `pageNumber`: 0-indexed page number to begin pagination.
352
397
  *
353
398
  */
354
- getBlockHeights(chainName: Chain, startDate: string, endDate: string, queryParamOpts?: GetBlockHeightsQueryParamOpts): AsyncIterable<Block>;
399
+ getBlockHeights(chainName: Chain | Chains, startDate: string, endDate: string, queryParamOpts?: GetBlockHeightsQueryParamOpts): AsyncIterable<Block>;
355
400
  /**
356
401
  *
357
402
  * Commonly used to get all the block heights within a particular date range. Useful for rendering a display where you sort blocks by day.
@@ -364,7 +409,7 @@ export declare class BaseService {
364
409
  * - `pageNumber`: 0-indexed page number to begin pagination.
365
410
  *
366
411
  */
367
- getBlockHeightsByPage(chainName: Chain, startDate: string, endDate: string, queryParamOpts?: GetBlockHeightsQueryParamOpts): Promise<Response<BlockHeightsResponse>>;
412
+ getBlockHeightsByPage(chainName: Chain | Chains, startDate: string, endDate: string, queryParamOpts?: GetBlockHeightsQueryParamOpts): Promise<Response<BlockHeightsResponse>>;
368
413
  /**
369
414
  *
370
415
  * Commonly used to get all the event logs of the latest block, or for a range of blocks. Includes sender contract metadata as well as decoded logs.
@@ -379,7 +424,7 @@ export declare class BaseService {
379
424
  * - `skipDecode`: Omit decoded log events.
380
425
  *
381
426
  */
382
- getLogs(chainName: Chain, queryParamOpts?: GetLogsQueryParamOpts): Promise<Response<GetLogsResponse>>;
427
+ getLogs(chainName: Chain | Chains, queryParamOpts?: GetLogsQueryParamOpts): Promise<Response<GetLogsResponse>>;
383
428
  /**
384
429
  *
385
430
  * Commonly used to get all the event logs emitted from a particular contract address. Useful for building dashboards that examine on-chain interactions.
@@ -393,7 +438,7 @@ export declare class BaseService {
393
438
  * - `pageNumber`: 0-indexed page number to begin pagination.
394
439
  *
395
440
  */
396
- getLogEventsByAddress(chainName: Chain, contractAddress: string, queryParamOpts?: GetLogEventsByAddressQueryParamOpts): AsyncIterable<LogEvent>;
441
+ getLogEventsByAddress(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetLogEventsByAddressQueryParamOpts): AsyncIterable<LogEvent>;
397
442
  /**
398
443
  *
399
444
  * Commonly used to get all the event logs emitted from a particular contract address. Useful for building dashboards that examine on-chain interactions.
@@ -407,7 +452,7 @@ export declare class BaseService {
407
452
  * - `pageNumber`: 0-indexed page number to begin pagination.
408
453
  *
409
454
  */
410
- getLogEventsByAddressByPage(chainName: Chain, contractAddress: string, queryParamOpts?: GetLogEventsByAddressQueryParamOpts): Promise<Response<LogEventsByAddressResponse>>;
455
+ getLogEventsByAddressByPage(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetLogEventsByAddressQueryParamOpts): Promise<Response<LogEventsByAddressResponse>>;
411
456
  /**
412
457
  *
413
458
  * Commonly used to get all event logs of the same topic hash across all contracts within a particular chain. Useful for cross-sectional analysis of event logs that are emitted on-chain.
@@ -422,7 +467,7 @@ export declare class BaseService {
422
467
  * - `pageNumber`: 0-indexed page number to begin pagination.
423
468
  *
424
469
  */
425
- getLogEventsByTopicHash(chainName: Chain, topicHash: string, queryParamOpts?: GetLogEventsByTopicHashQueryParamOpts): AsyncIterable<LogEvent>;
470
+ getLogEventsByTopicHash(chainName: Chain | Chains, topicHash: string, queryParamOpts?: GetLogEventsByTopicHashQueryParamOpts): AsyncIterable<LogEvent>;
426
471
  /**
427
472
  *
428
473
  * Commonly used to get all event logs of the same topic hash across all contracts within a particular chain. Useful for cross-sectional analysis of event logs that are emitted on-chain.
@@ -437,7 +482,7 @@ export declare class BaseService {
437
482
  * - `pageNumber`: 0-indexed page number to begin pagination.
438
483
  *
439
484
  */
440
- getLogEventsByTopicHashByPage(chainName: Chain, topicHash: string, queryParamOpts?: GetLogEventsByTopicHashQueryParamOpts): Promise<Response<LogEventsByTopicHashResponse>>;
485
+ getLogEventsByTopicHashByPage(chainName: Chain | Chains, topicHash: string, queryParamOpts?: GetLogEventsByTopicHashQueryParamOpts): Promise<Response<LogEventsByTopicHashResponse>>;
441
486
  /**
442
487
  *
443
488
  * Commonly used to build internal dashboards for all supported chains on Covalent.
@@ -462,5 +507,14 @@ export declare class BaseService {
462
507
  *
463
508
  */
464
509
  getAddressActivity(walletAddress: string, queryParamOpts?: GetAddressActivityQueryParamOpts): Promise<Response<ChainActivityResponse>>;
510
+ /**
511
+ *
512
+ * @param {string} chainName - The chain name eg: `eth-mainnet`.
513
+ * @param {string} eventType - The desired event type to retrieve gas prices for. Supports `erc20` transfer events, `uniswapv3` swap events and `nativetokens` transfers.
514
+ * @param {GetGasPricesQueryParamOpts} queryParamOpts
515
+ * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
516
+ *
517
+ */
518
+ getGasPrices(chainName: Chains, eventType: string, queryParamOpts?: GetGasPricesQueryParamOpts): Promise<Response<GasPricesResponse>>;
465
519
  }
466
520
  export {};
@@ -7,21 +7,7 @@ import { TransactionService } from "./TransactionService";
7
7
  import { XykService } from "./XykService";
8
8
  export type Chain = "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-mainnet" | "avalanche-mainnet" | "optimism-mainnet" | "fantom-mainnet" | "moonbeam-mainnet" | "moonbeam-moonriver" | "rsk-mainnet" | "arbitrum-mainnet" | "palm-mainnet" | "klaytn-mainnet" | "heco-mainnet" | "nervos-godwoken-mainnet" | "axie-mainnet" | "evmos-mainnet" | "astar-mainnet" | "iotex-mainnet" | "harmony-mainnet" | "cronos-mainnet" | "aurora-mainnet" | "emerald-paratime-mainnet" | "boba-mainnet" | "eth-goerli" | "matic-mumbai" | "avalanche-testnet" | "bsc-testnet" | "moonbeam-moonbase-alpha" | "rsk-testnet" | "arbitrum-goerli" | "fantom-testnet" | "palm-testnet" | "heco-testnet" | "nervos-godwoken-testnet" | "evmos-testnet" | "astar-shiden" | "iotex-testnet" | "harmony-testnet" | "aurora-testnet" | "scroll-sepolia-testnet" | "covalent-internal-network-v1" | "defi-kingdoms-mainnet" | "swimmer-mainnet" | "boba-avalanche-mainnet" | "boba-bobabeam-mainnet" | "boba-bnb-mainnet" | "boba-rinkeby-testnet" | "boba-bobabase-testnet" | "boba-bnb-testnet" | "boba-avalanche-testnet" | "klaytn-testnet" | "gather-mainnet" | "gather-testnet" | "skale-calypso" | "skale-mainnet" | "skale-razor" | "avalanche-dexalot-mainnet" | "skale-omnus" | "avalanche-dexalot-testnet" | "astar-shibuya" | "cronos-testnet" | "defi-kingdoms-testnet" | "metis-mainnet" | "metis-stardust" | "milkomeda-a1-mainnet" | "milkomeda-a1-devnet" | "milkomeda-c1-mainnet" | "milkomeda-c1-devnet" | "swimmer-testnet" | "solana-mainnet" | "skale-europa" | "meter-mainnet" | "meter-testnet" | "skale-exorde" | "boba-goerli" | "neon-testnet" | "skale-staging-uum" | "skale-staging-lcc" | "arbitrum-nova-mainnet" | "canto-mainnet" | "bittorrent-mainnet" | "bittorrent-testnet" | "flarenetworks-flare-mainnet" | "flarenetworks-flare-testnet" | "flarenetworks-canary-mainnet" | "flarenetworks-canary-testnet" | "kcc-mainnet" | "kcc-testnet" | "polygon-zkevm-testnet" | "linea-testnet" | "base-testnet" | "mantle-testnet" | "scroll-alpha-testnet" | "oasys-mainnet" | "oasys-testnet" | "findora-mainnet" | "findora-forge-testnet" | "sx-mainnet" | "oasis-sapphire-mainnet" | "oasis-sapphire-testnet" | "optimism-goerli" | "polygon-zkevm-mainnet" | "horizen-yuma-testnet" | "clv-parachain" | "energi-mainnet" | "energi-testnet" | "horizen-gobi-testnet" | "eth-sepolia" | "skale-nebula" | "skale-battleground" | "avalanche-meld-testnet" | "gunzilla-testnet" | "ultron-mainnet" | "ultron-testnet" | "zora-mainnet" | "zora-testnet" | "neon-mainnet" | "avalanche-shrapnel-mainnet" | "base-mainnet" | "mantle-mainnet" | "avalanche-loco-legends-mainnet" | "linea-mainnet" | "horizen-eon-mainnet" | "avalanche-numbers" | "avalanche-dos" | "avalanche-step-network" | "avalanche-xplus" | "avalanche-xanachain" | "avalanche-meld-mainnet" | "opside-public-zkevm" | "opside-law-chain" | "avalanche-shrapnel-testnet" | "avalanche-loco-legends-testnet" | "opside-cb-zkevm" | "opside-pre-alpha-testnet" | "opside-era7" | "opside-xthrill" | "zksync-mainnet" | "metis-testnet" | "zksync-testnet" | "avalanche-blitz-testnet" | "avalanche-d-chain-testnet" | "avalanche-green-dot-testnet" | "avalanche-mintara-testnet" | "avalanche-beam-testnet" | "bnb-meta-apes-mainnet" | "bnb-antimatter-mainnet" | "bnb-antimatter-testnet" | "bnb-opbnb-testnet" | "opside-debox" | "opside-jackbot" | "opside-odx-zkevm-testnet" | "opside-readon-content-testnet" | "opside-relation" | "opside-soquest-zkevm" | "opside-vip3" | "opside-zkmeta" | "avalanche-pulsar-testnet" | "avalanche-uptn" | "bnb-fncy-mainnet" | "zetachain-testnet" | "kinto-testnet" | "mode-testnet" | "loot-mainnet" | "bnb-fncy-testnet" | "manta-testnet" | "pgn-mainnet" | "pgn-testnet" | "gnosis-mainnet" | "gnosis-testnet" | "rollux-mainnet" | "rollux-testnet" | "taiko-jolnir-testnet" | "optimism-sepolia" | "bnb-opbnb-mainnet" | "telos-mainnet" | "telos-testnet";
9
9
  export type Quote = "USD" | "CAD" | "EUR" | "SGD" | "INR" | "JPY" | "VND" | "CNY" | "KRW" | "RUB" | "TRY" | "NGN" | "ARS" | "AUD" | "CHF" | "GBP";
10
- /**
11
- * @deprecated
12
- * Please use {@link Chain} going forward! This type will be removed after Oct 31, 2023.
13
- * @see #Chain
14
- * CovalentClient Class
15
- */
16
- export type Chains = "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-mainnet" | "avalanche-mainnet" | "optimism-mainnet" | "fantom-mainnet" | "moonbeam-mainnet" | "moonbeam-moonriver" | "rsk-mainnet" | "arbitrum-mainnet" | "palm-mainnet" | "klaytn-mainnet" | "heco-mainnet" | "nervos-godwoken-mainnet" | "axie-mainnet" | "evmos-mainnet" | "astar-mainnet" | "iotex-mainnet" | "harmony-mainnet" | "cronos-mainnet" | "aurora-mainnet" | "emerald-paratime-mainnet" | "boba-mainnet" | "eth-goerli" | "matic-mumbai" | "avalanche-testnet" | "bsc-testnet" | "moonbeam-moonbase-alpha" | "rsk-testnet" | "arbitrum-goerli" | "fantom-testnet" | "palm-testnet" | "heco-testnet" | "nervos-godwoken-testnet" | "evmos-testnet" | "astar-shiden" | "iotex-testnet" | "harmony-testnet" | "aurora-testnet" | "scroll-sepolia-testnet" | "covalent-internal-network-v1" | "defi-kingdoms-mainnet" | "swimmer-mainnet" | "boba-avalanche-mainnet" | "boba-bobabeam-mainnet" | "boba-bnb-mainnet" | "boba-rinkeby-testnet" | "boba-bobabase-testnet" | "boba-bnb-testnet" | "boba-avalanche-testnet" | "klaytn-testnet" | "gather-mainnet" | "gather-testnet" | "skale-calypso" | "skale-mainnet" | "skale-razor" | "avalanche-dexalot-mainnet" | "skale-omnus" | "avalanche-dexalot-testnet" | "astar-shibuya" | "cronos-testnet" | "defi-kingdoms-testnet" | "metis-mainnet" | "metis-stardust" | "milkomeda-a1-mainnet" | "milkomeda-a1-devnet" | "milkomeda-c1-mainnet" | "milkomeda-c1-devnet" | "swimmer-testnet" | "solana-mainnet" | "skale-europa" | "meter-mainnet" | "meter-testnet" | "skale-exorde" | "boba-goerli" | "neon-testnet" | "skale-staging-uum" | "skale-staging-lcc" | "arbitrum-nova-mainnet" | "canto-mainnet" | "bittorrent-mainnet" | "bittorrent-testnet" | "flarenetworks-flare-mainnet" | "flarenetworks-flare-testnet" | "flarenetworks-canary-mainnet" | "flarenetworks-canary-testnet" | "kcc-mainnet" | "kcc-testnet" | "polygon-zkevm-testnet" | "linea-testnet" | "base-testnet" | "mantle-testnet" | "scroll-alpha-testnet" | "oasys-mainnet" | "oasys-testnet" | "findora-mainnet" | "findora-forge-testnet" | "sx-mainnet" | "oasis-sapphire-mainnet" | "oasis-sapphire-testnet" | "optimism-goerli" | "polygon-zkevm-mainnet" | "horizen-yuma-testnet" | "clv-parachain" | "energi-mainnet" | "energi-testnet" | "horizen-gobi-testnet" | "eth-sepolia" | "skale-nebula" | "skale-battleground" | "avalanche-meld-testnet" | "gunzilla-testnet" | "ultron-mainnet" | "ultron-testnet" | "zora-mainnet" | "zora-testnet" | "neon-mainnet" | "avalanche-shrapnel-mainnet" | "base-mainnet" | "mantle-mainnet" | "avalanche-loco-legends-mainnet" | "linea-mainnet" | "horizen-eon-mainnet" | "avalanche-numbers" | "avalanche-dos" | "avalanche-step-network" | "avalanche-xplus" | "avalanche-xanachain" | "avalanche-meld-mainnet" | "opside-public-zkevm" | "opside-law-chain" | "avalanche-shrapnel-testnet" | "avalanche-loco-legends-testnet" | "opside-cb-zkevm" | "opside-pre-alpha-testnet" | "opside-era7" | "opside-xthrill" | "zksync-mainnet" | "metis-testnet" | "zksync-testnet" | "avalanche-blitz-testnet" | "avalanche-d-chain-testnet" | "avalanche-green-dot-testnet" | "avalanche-mintara-testnet" | "avalanche-beam-testnet" | "bnb-meta-apes-mainnet" | "bnb-antimatter-mainnet" | "bnb-antimatter-testnet" | "bnb-opbnb-testnet" | "opside-debox" | "opside-jackbot" | "opside-odx-zkevm-testnet" | "opside-readon-content-testnet" | "opside-relation" | "opside-soquest-zkevm" | "opside-vip3" | "opside-zkmeta" | "avalanche-pulsar-testnet" | "avalanche-uptn" | "bnb-fncy-mainnet" | "zetachain-testnet" | "kinto-testnet" | "mode-testnet" | "loot-mainnet" | "bnb-fncy-testnet" | "manta-testnet" | "pgn-mainnet" | "pgn-testnet" | "gnosis-mainnet" | "gnosis-testnet" | "rollux-mainnet" | "rollux-testnet" | "taiko-jolnir-testnet" | "optimism-sepolia" | "bnb-opbnb-mainnet" | "telos-mainnet" | "telos-testnet";
17
- /**
18
- * @deprecated
19
- * Please use {@link Quote} going forward! This type will be removed after Oct 31, 2023.
20
- * @see #Quote
21
- * CovalentClient Class
22
- */
23
- export type Quotes = "USD" | "CAD" | "EUR" | "SGD" | "INR" | "JPY" | "VND" | "CNY" | "KRW" | "RUB" | "TRY" | "NGN" | "ARS" | "AUD" | "CHF" | "GBP";
24
- export declare const userAgent = "com.covalenthq.sdk.typescript/0.6.6";
10
+ export declare const userAgent = "com.covalenthq.sdk.typescript/0.7.0";
25
11
  export declare class Response<T> {
26
12
  data: T;
27
13
  error: boolean;
@@ -45,6 +31,7 @@ export declare class CovalentClient {
45
31
  PricingService: PricingService;
46
32
  TransactionService: TransactionService;
47
33
  XykService: XykService;
34
+ private _is_key_valid;
48
35
  constructor(apiKey: string, settings?: CovalentClientSettings);
49
36
  }
50
37
  /**
@@ -61,5 +48,6 @@ export declare class Client {
61
48
  PricingService: PricingService;
62
49
  TransactionService: TransactionService;
63
50
  XykService: XykService;
51
+ private _is_key_valid;
64
52
  constructor(apiKey: string, settings?: CovalentClientSettings);
65
53
  }
@@ -1,4 +1,5 @@
1
1
  import { Chain, Quote, Response } from "./CovalentClient";
2
+ import { Chains } from "../util/Chains";
2
3
  declare class ChainCollectionResponse {
3
4
  /** * The timestamp when the response was generated. Useful to show data staleness to users. */
4
5
  updated_at: Date;
@@ -482,8 +483,9 @@ export declare class NftService {
482
483
  private apiKey;
483
484
  private debug;
484
485
  private threadCount;
486
+ private is_key_valid;
485
487
  private LIMIT;
486
- constructor(apiKey: string, debug?: boolean, threadCount?: number);
488
+ constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean);
487
489
  /**
488
490
  *
489
491
  * Commonly used to fetch the list of NFT collections with downloaded and cached off chain data like token metadata and asset files.
@@ -495,7 +497,7 @@ export declare class NftService {
495
497
  * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
496
498
  *
497
499
  */
498
- getChainCollections(chainName: Chain, queryParamOpts?: GetChainCollectionsQueryParamOpts): AsyncIterable<ChainCollectionItem>;
500
+ getChainCollections(chainName: Chain | Chains, queryParamOpts?: GetChainCollectionsQueryParamOpts): AsyncIterable<ChainCollectionItem>;
499
501
  /**
500
502
  *
501
503
  * Commonly used to fetch the list of NFT collections with downloaded and cached off chain data like token metadata and asset files.
@@ -507,7 +509,7 @@ export declare class NftService {
507
509
  * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
508
510
  *
509
511
  */
510
- getChainCollectionsByPage(chainName: Chain, queryParamOpts?: GetChainCollectionsQueryParamOpts): Promise<Response<ChainCollectionResponse>>;
512
+ getChainCollectionsByPage(chainName: Chain | Chains, queryParamOpts?: GetChainCollectionsQueryParamOpts): Promise<Response<ChainCollectionResponse>>;
511
513
  /**
512
514
  *
513
515
  * Commonly used to render the NFTs (including ERC721 and ERC1155) held by an address.
@@ -520,7 +522,7 @@ export declare class NftService {
520
522
  * - `withUncached`: By default, this endpoint only works on chains where we've cached the assets and the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side.
521
523
  *
522
524
  */
523
- getNftsForAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetNftsForAddressQueryParamOpts): Promise<Response<NftAddressBalanceNftResponse>>;
525
+ getNftsForAddress(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetNftsForAddressQueryParamOpts): Promise<Response<NftAddressBalanceNftResponse>>;
524
526
  /**
525
527
  *
526
528
  * Commonly used to get NFT token IDs with metadata from a collection. Useful for building NFT card displays.
@@ -536,7 +538,7 @@ export declare class NftService {
536
538
  * - `withUncached`: By default, this endpoint only works on chains where we've cached the assets and the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side.
537
539
  *
538
540
  */
539
- getTokenIdsForContractWithMetadata(chainName: Chain, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): AsyncIterable<NftTokenContract>;
541
+ getTokenIdsForContractWithMetadata(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): AsyncIterable<NftTokenContract>;
540
542
  /**
541
543
  *
542
544
  * Commonly used to get NFT token IDs with metadata from a collection. Useful for building NFT card displays.
@@ -552,7 +554,7 @@ export declare class NftService {
552
554
  * - `withUncached`: By default, this endpoint only works on chains where we've cached the assets and the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side.
553
555
  *
554
556
  */
555
- getTokenIdsForContractWithMetadataByPage(chainName: Chain, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): Promise<Response<NftMetadataResponse>>;
557
+ getTokenIdsForContractWithMetadataByPage(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): Promise<Response<NftMetadataResponse>>;
556
558
  /**
557
559
  *
558
560
  * Commonly used to get a single NFT metadata by token ID from a collection. Useful for building NFT card displays.
@@ -565,7 +567,7 @@ export declare class NftService {
565
567
  * - `withUncached`: By default, this endpoint only works on chains where we've cached the assets and the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side.
566
568
  *
567
569
  */
568
- getNftMetadataForGivenTokenIdForContract(chainName: Chain, contractAddress: string, tokenId: string, queryParamOpts?: GetNftMetadataForGivenTokenIdForContractQueryParamOpts): Promise<Response<NftMetadataResponse>>;
570
+ getNftMetadataForGivenTokenIdForContract(chainName: Chain | Chains, contractAddress: string, tokenId: string, queryParamOpts?: GetNftMetadataForGivenTokenIdForContractQueryParamOpts): Promise<Response<NftMetadataResponse>>;
569
571
  /**
570
572
  *
571
573
  * Commonly used to get all transactions of an NFT token. Useful for building a transaction history table or price chart.
@@ -577,7 +579,7 @@ export declare class NftService {
577
579
  * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
578
580
  *
579
581
  */
580
- getNftTransactionsForContractTokenId(chainName: Chain, contractAddress: string, tokenId: string, queryParamOpts?: GetNftTransactionsForContractTokenIdQueryParamOpts): Promise<Response<NftTransactionsResponse>>;
582
+ getNftTransactionsForContractTokenId(chainName: Chain | Chains, contractAddress: string, tokenId: string, queryParamOpts?: GetNftTransactionsForContractTokenIdQueryParamOpts): Promise<Response<NftTransactionsResponse>>;
581
583
  /**
582
584
  *
583
585
  * Commonly used to fetch and render the traits of a collection as seen in rarity calculators.
@@ -586,7 +588,7 @@ export declare class NftService {
586
588
  * @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
587
589
  *
588
590
  */
589
- getTraitsForCollection(chainName: Chain, collectionContract: string): Promise<Response<NftCollectionTraitsResponse>>;
591
+ getTraitsForCollection(chainName: Chain | Chains, collectionContract: string): Promise<Response<NftCollectionTraitsResponse>>;
590
592
  /**
591
593
  *
592
594
  * Commonly used to get the count of unique values for traits within an NFT collection.
@@ -596,7 +598,7 @@ export declare class NftService {
596
598
  * @param {string} trait - The requested trait.
597
599
  *
598
600
  */
599
- getAttributesForTraitInCollection(chainName: Chain, collectionContract: string, trait: string): Promise<Response<NftCollectionAttributesForTraitResponse>>;
601
+ getAttributesForTraitInCollection(chainName: Chain | Chains, collectionContract: string, trait: string): Promise<Response<NftCollectionAttributesForTraitResponse>>;
600
602
  /**
601
603
  *
602
604
  * Commonly used to calculate rarity scores for a collection based on its traits.
@@ -605,7 +607,7 @@ export declare class NftService {
605
607
  * @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
606
608
  *
607
609
  */
608
- getCollectionTraitsSummary(chainName: Chain, collectionContract: string): Promise<Response<NftCollectionTraitSummaryResponse>>;
610
+ getCollectionTraitsSummary(chainName: Chain | Chains, collectionContract: string): Promise<Response<NftCollectionTraitSummaryResponse>>;
609
611
  /**
610
612
  *
611
613
  * Commonly used to verify ownership of NFTs (including ERC-721 and ERC-1155) within a collection.
@@ -615,7 +617,7 @@ export declare class NftService {
615
617
  * @param {string} collectionContract - The requested collection address.
616
618
  *
617
619
  */
618
- checkOwnershipInNft(chainName: Chain, walletAddress: string, collectionContract: string): Promise<Response<NftOwnershipForCollectionResponse>>;
620
+ checkOwnershipInNft(chainName: Chain | Chains, walletAddress: string, collectionContract: string): Promise<Response<NftOwnershipForCollectionResponse>>;
619
621
  /**
620
622
  *
621
623
  * Commonly used to verify ownership of a specific token (ERC-721 or ERC-1155) within a collection.
@@ -626,7 +628,7 @@ export declare class NftService {
626
628
  * @param {string} tokenId - The requested token ID.
627
629
  *
628
630
  */
629
- checkOwnershipInNftForSpecificTokenId(chainName: Chain, walletAddress: string, collectionContract: string, tokenId: string): Promise<Response<NftOwnershipForCollectionResponse>>;
631
+ checkOwnershipInNftForSpecificTokenId(chainName: Chain | Chains, walletAddress: string, collectionContract: string, tokenId: string): Promise<Response<NftOwnershipForCollectionResponse>>;
630
632
  /**
631
633
  *
632
634
  * Commonly used to build a time-series chart of the sales count of an NFT collection.
@@ -638,7 +640,7 @@ export declare class NftService {
638
640
  * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
639
641
  *
640
642
  */
641
- getNftMarketSaleCount(chainName: Chain, contractAddress: string, queryParamOpts?: GetNftMarketSaleCountQueryParamOpts): Promise<Response<NftMarketSaleCountResponse>>;
643
+ getNftMarketSaleCount(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetNftMarketSaleCountQueryParamOpts): Promise<Response<NftMarketSaleCountResponse>>;
642
644
  /**
643
645
  *
644
646
  * Commonly used to build a time-series chart of the transaction volume of an NFT collection.
@@ -650,7 +652,7 @@ export declare class NftService {
650
652
  * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
651
653
  *
652
654
  */
653
- getNftMarketVolume(chainName: Chain, contractAddress: string, queryParamOpts?: GetNftMarketVolumeQueryParamOpts): Promise<Response<NftMarketVolumeResponse>>;
655
+ getNftMarketVolume(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetNftMarketVolumeQueryParamOpts): Promise<Response<NftMarketVolumeResponse>>;
654
656
  /**
655
657
  *
656
658
  * Commonly used to render a price floor chart for an NFT collection.
@@ -662,6 +664,6 @@ export declare class NftService {
662
664
  * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
663
665
  *
664
666
  */
665
- getNftMarketFloorPrice(chainName: Chain, contractAddress: string, queryParamOpts?: GetNftMarketFloorPriceQueryParamOpts): Promise<Response<NftMarketFloorPriceResponse>>;
667
+ getNftMarketFloorPrice(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetNftMarketFloorPriceQueryParamOpts): Promise<Response<NftMarketFloorPriceResponse>>;
666
668
  }
667
669
  export {};
@@ -1,4 +1,5 @@
1
1
  import { Chain, Quote } from "./CovalentClient";
2
+ import { Chains } from "../util/Chains";
2
3
  declare class TokenPricesResponse {
3
4
  /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
4
5
  contract_decimals: number;
@@ -68,8 +69,9 @@ export declare class PricingService {
68
69
  private apiKey;
69
70
  private debug;
70
71
  private threadCount;
72
+ private is_key_valid;
71
73
  private LIMIT;
72
- constructor(apiKey: string, debug?: boolean, threadCount?: number);
74
+ constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean);
73
75
  /**
74
76
  *
75
77
  * Commonly used to get historic prices of a token between date ranges. Supports native tokens.
@@ -83,6 +85,6 @@ export declare class PricingService {
83
85
  * - `pricesAtAsc`: Sort the prices in chronological ascending order. By default, it's set to `false` and returns prices in chronological descending order.
84
86
  *
85
87
  */
86
- getTokenPrices(chainName: Chain, quoteCurrency: Quote, contractAddress: string, queryParamOpts?: GetTokenPricesQueryParamOpts): Promise<Response<TokenPricesResponse>>;
88
+ getTokenPrices(chainName: Chain | Chains, quoteCurrency: Quote, contractAddress: string, queryParamOpts?: GetTokenPricesQueryParamOpts): Promise<Response<TokenPricesResponse>>;
87
89
  }
88
90
  export {};
@@ -1,4 +1,5 @@
1
1
  import { Chain, Response } from "./CovalentClient";
2
+ import { Chains } from "../util/Chains";
2
3
  declare class ApprovalsResponse {
3
4
  /** * The requested address. */
4
5
  address: string;
@@ -135,8 +136,9 @@ export declare class SecurityService {
135
136
  private apiKey;
136
137
  private debug;
137
138
  private threadCount;
139
+ private is_key_valid;
138
140
  private LIMIT;
139
- constructor(apiKey: string, debug?: boolean, threadCount?: number);
141
+ constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean);
140
142
  /**
141
143
  *
142
144
  * Commonly used to get a list of approvals across all token contracts categorized by spenders for a wallet’s assets.
@@ -145,7 +147,7 @@ export declare class SecurityService {
145
147
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
146
148
  *
147
149
  */
148
- getApprovals(chainName: Chain, walletAddress: string): Promise<Response<ApprovalsResponse>>;
150
+ getApprovals(chainName: Chain | Chains, walletAddress: string): Promise<Response<ApprovalsResponse>>;
149
151
  /**
150
152
  *
151
153
  * @param {string} chainName - The chain name eg: `eth-mainnet`.
@@ -153,6 +155,6 @@ export declare class SecurityService {
153
155
 
154
156
  *
155
157
  */
156
- getNftApprovals(chainName: Chain, walletAddress: string): Promise<Response<NftApprovalsResponse>>;
158
+ getNftApprovals(chainName: Chain | Chains, walletAddress: string): Promise<Response<NftApprovalsResponse>>;
157
159
  }
158
160
  export {};
@@ -1,4 +1,5 @@
1
1
  import { Chain, Quote, Response } from "./CovalentClient";
2
+ import { Chains } from "../util/Chains";
2
3
  declare class TransactionResponse {
3
4
  /** * The timestamp when the response was generated. Useful to show data staleness to users. */
4
5
  updated_at: Date;
@@ -57,11 +58,11 @@ declare class Transaction {
57
58
  /** * The explorer links for this transaction. */
58
59
  explorers: Explorer[];
59
60
  /** * The details for the dex transaction. */
60
- dex_details: DexReport;
61
+ dex_details: DexReport[];
61
62
  /** * The details for the NFT sale transaction. */
62
- nft_sale_details: NftSalesReport;
63
+ nft_sale_details: NftSalesReport[];
63
64
  /** * The details for the lending protocol transaction. */
64
- lending_details: LendingReport;
65
+ lending_details: LendingReport[];
65
66
  /** * The log events. */
66
67
  log_events: LogEvent[];
67
68
  /** * The details related to the safe transaction. */
@@ -476,8 +477,9 @@ export declare class TransactionService {
476
477
  private apiKey;
477
478
  private debug;
478
479
  private threadCount;
480
+ private is_key_valid;
479
481
  private LIMIT;
480
- constructor(apiKey: string, debug?: boolean, threadCount?: number);
482
+ constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean);
481
483
  /**
482
484
  *
483
485
  * Commonly used to fetch and render a single transaction including its decoded log events. Additionally return semantically decoded information for DEX trades, lending and NFT sales.
@@ -493,7 +495,7 @@ export declare class TransactionService {
493
495
  * - `withSafe`: Include safe details.
494
496
  *
495
497
  */
496
- getTransaction(chainName: Chain, txHash: string, queryParamOpts?: GetTransactionQueryParamOpts): Promise<Response<TransactionResponse>>;
498
+ getTransaction(chainName: Chain | Chains, txHash: string, queryParamOpts?: GetTransactionQueryParamOpts): Promise<Response<TransactionResponse>>;
497
499
  /**
498
500
  *
499
501
  * Commonly used to fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
@@ -507,7 +509,7 @@ export declare class TransactionService {
507
509
  * - `withSafe`: Include safe details.
508
510
  *
509
511
  */
510
- getAllTransactionsForAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): AsyncIterable<Transaction>;
512
+ getAllTransactionsForAddress(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): AsyncIterable<Transaction>;
511
513
  /**
512
514
  *
513
515
  * Commonly used to fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
@@ -521,7 +523,7 @@ export declare class TransactionService {
521
523
  * - `withSafe`: Include safe details.
522
524
  *
523
525
  */
524
- getAllTransactionsForAddressByPage(chainName: Chain, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): Promise<Response<RecentTransactionsResponse>>;
526
+ getAllTransactionsForAddressByPage(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): Promise<Response<RecentTransactionsResponse>>;
525
527
  /**
526
528
  *
527
529
  * Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
@@ -534,7 +536,7 @@ export declare class TransactionService {
534
536
  * - `withSafe`: Include safe details.
535
537
  *
536
538
  */
537
- getTransactionsForBlock(chainName: Chain, blockHeight: number, queryParamOpts?: GetTransactionsForBlockQueryParamOpts): Promise<Response<TransactionsBlockResponse>>;
539
+ getTransactionsForBlock(chainName: Chain | Chains, blockHeight: number, queryParamOpts?: GetTransactionsForBlockQueryParamOpts): Promise<Response<TransactionsBlockResponse>>;
538
540
  /**
539
541
  *
540
542
  * Commonly used to fetch the earliest and latest transactions, and the transaction count for a wallet. Calculate the age of the wallet and the time it has been idle and quickly gain insights into their engagement with web3.
@@ -543,7 +545,7 @@ export declare class TransactionService {
543
545
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
544
546
  *
545
547
  */
546
- getTransactionSummary(chainName: Chain, walletAddress: string): Promise<Response<TransactionsSummaryResponse>>;
548
+ getTransactionSummary(chainName: Chain | Chains, walletAddress: string): Promise<Response<TransactionsSummaryResponse>>;
547
549
  /**
548
550
  *
549
551
  * @param {string} chainName - The chain name eg: `eth-mainnet`.
@@ -556,6 +558,6 @@ export declare class TransactionService {
556
558
  * - `withSafe`: Include safe details.
557
559
  *
558
560
  */
559
- getTransactionsForAddressV3(chainName: Chain, walletAddress: string, page: number, queryParamOpts?: GetTransactionsForAddressV3QueryParamOpts): Promise<Response<TransactionsResponse>>;
561
+ getTransactionsForAddressV3(chainName: Chain | Chains, walletAddress: string, page: number, queryParamOpts?: GetTransactionsForAddressV3QueryParamOpts): Promise<Response<TransactionsResponse>>;
560
562
  }
561
563
  export {};