@covalenthq/client-sdk 0.7.6 → 0.8.1

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 (76) hide show
  1. package/README.md +5 -0
  2. package/dist/cjs/index.js +2762 -199
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/services/BalanceService.d.ts +14 -13
  5. package/dist/cjs/services/BaseService.d.ts +12 -11
  6. package/dist/cjs/services/CovalentClient.d.ts +5 -3
  7. package/dist/cjs/services/NftService.d.ts +18 -17
  8. package/dist/cjs/services/PricingService.d.ts +4 -3
  9. package/dist/cjs/services/SecurityService.d.ts +5 -4
  10. package/dist/cjs/services/TransactionService.d.ts +79 -12
  11. package/dist/cjs/services/XykService.d.ts +226 -15
  12. package/dist/cjs/util/ApiHelpers.d.ts +2 -1
  13. package/dist/cjs/util/backoff.d.ts +2 -1
  14. package/dist/cjs/util/types/TransactionServiceTypes.d.ts +11 -0
  15. package/dist/cjs/util/types/XykServiceTypes.d.ts +114 -0
  16. package/dist/es/index.js +2762 -199
  17. package/dist/es/index.js.map +1 -1
  18. package/dist/es/services/BalanceService.d.ts +14 -13
  19. package/dist/es/services/BaseService.d.ts +12 -11
  20. package/dist/es/services/CovalentClient.d.ts +5 -3
  21. package/dist/es/services/NftService.d.ts +18 -17
  22. package/dist/es/services/PricingService.d.ts +4 -3
  23. package/dist/es/services/SecurityService.d.ts +5 -4
  24. package/dist/es/services/TransactionService.d.ts +79 -12
  25. package/dist/es/services/XykService.d.ts +226 -15
  26. package/dist/es/util/ApiHelpers.d.ts +2 -1
  27. package/dist/es/util/backoff.d.ts +2 -1
  28. package/dist/es/util/types/TransactionServiceTypes.d.ts +11 -0
  29. package/dist/es/util/types/XykServiceTypes.d.ts +114 -0
  30. package/dist/esm/index.js +2762 -199
  31. package/dist/esm/index.js.map +1 -1
  32. package/dist/esm/services/BalanceService.d.ts +14 -13
  33. package/dist/esm/services/BaseService.d.ts +12 -11
  34. package/dist/esm/services/CovalentClient.d.ts +5 -3
  35. package/dist/esm/services/NftService.d.ts +18 -17
  36. package/dist/esm/services/PricingService.d.ts +4 -3
  37. package/dist/esm/services/SecurityService.d.ts +5 -4
  38. package/dist/esm/services/TransactionService.d.ts +79 -12
  39. package/dist/esm/services/XykService.d.ts +226 -15
  40. package/dist/esm/util/ApiHelpers.d.ts +2 -1
  41. package/dist/esm/util/backoff.d.ts +2 -1
  42. package/dist/esm/util/types/TransactionServiceTypes.d.ts +11 -0
  43. package/dist/esm/util/types/XykServiceTypes.d.ts +114 -0
  44. package/dist/services/BalanceService.d.ts +14 -13
  45. package/dist/services/BalanceService.js +16 -15
  46. package/dist/services/BalanceService.js.map +1 -1
  47. package/dist/services/BaseService.d.ts +12 -11
  48. package/dist/services/BaseService.js +25 -24
  49. package/dist/services/BaseService.js.map +1 -1
  50. package/dist/services/CovalentClient.d.ts +5 -3
  51. package/dist/services/CovalentClient.js +17 -17
  52. package/dist/services/CovalentClient.js.map +1 -1
  53. package/dist/services/NftService.d.ts +18 -17
  54. package/dist/services/NftService.js +30 -29
  55. package/dist/services/NftService.js.map +1 -1
  56. package/dist/services/PricingService.d.ts +4 -3
  57. package/dist/services/PricingService.js +4 -3
  58. package/dist/services/PricingService.js.map +1 -1
  59. package/dist/services/SecurityService.d.ts +5 -4
  60. package/dist/services/SecurityService.js +6 -5
  61. package/dist/services/SecurityService.js.map +1 -1
  62. package/dist/services/TransactionService.d.ts +79 -12
  63. package/dist/services/TransactionService.js +369 -41
  64. package/dist/services/TransactionService.js.map +1 -1
  65. package/dist/services/XykService.d.ts +226 -15
  66. package/dist/services/XykService.js +335 -34
  67. package/dist/services/XykService.js.map +1 -1
  68. package/dist/util/ApiHelpers.d.ts +2 -1
  69. package/dist/util/ApiHelpers.js +3 -3
  70. package/dist/util/ApiHelpers.js.map +1 -1
  71. package/dist/util/backoff.d.ts +2 -1
  72. package/dist/util/backoff.js +3 -3
  73. package/dist/util/backoff.js.map +1 -1
  74. package/dist/util/types/TransactionServiceTypes.d.ts +11 -0
  75. package/dist/util/types/XykServiceTypes.d.ts +114 -0
  76. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { Chain, Quote, Response } from "./CovalentClient";
1
+ import { Chain, Quote, Response, ChainID, Source } from "./CovalentClient";
2
2
  import { Chains } from "../util/Chains";
3
3
  declare class BalancesResponse {
4
4
  /** * The requested address. */
@@ -445,7 +445,7 @@ export interface GetErc20TransfersForWalletAddressQueryParamOpts {
445
445
  }
446
446
  export interface GetTokenHoldersV2ForTokenAddressQueryParamOpts {
447
447
  /** * Ending block to define a block range. Omitting this parameter defaults to the latest block height. */
448
- blockHeight?: number;
448
+ blockHeight?: number | string;
449
449
  /** * Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date. */
450
450
  date?: string;
451
451
  /** * Number of items per page. Note: Currently, only values of `100` and `1000` are supported. Omitting this parameter defaults to 100. */
@@ -465,7 +465,7 @@ export interface GetHistoricalTokenBalancesForWalletAddressQueryParamOpts {
465
465
  /** * 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. */
466
466
  noNftAssetMetadata?: boolean;
467
467
  /** * Ending block to define a block range. Omitting this parameter defaults to the latest block height. */
468
- blockHeight?: number;
468
+ blockHeight?: number | string;
469
469
  /** * Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date. */
470
470
  date?: string;
471
471
  }
@@ -473,7 +473,7 @@ export interface GetNativeTokenBalanceQueryParamOpts {
473
473
  /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
474
474
  quoteCurrency?: Quote;
475
475
  /** * Ending block to define a block range. Omitting this parameter defaults to the latest block height. */
476
- blockHeight?: number;
476
+ blockHeight?: number | string;
477
477
  }
478
478
  /**
479
479
  * Balances APIs
@@ -485,8 +485,9 @@ export declare class BalanceService {
485
485
  private threadCount;
486
486
  private is_key_valid;
487
487
  private enableRetry;
488
+ private source;
488
489
  private LIMIT;
489
- constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean, enableRetry?: boolean);
490
+ constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean, enableRetry: boolean, source: Source);
490
491
  /**
491
492
  *
492
493
  * 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.
@@ -501,7 +502,7 @@ export declare class BalanceService {
501
502
  * - `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.
502
503
  *
503
504
  */
504
- getTokenBalancesForWalletAddress(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetTokenBalancesForWalletAddressQueryParamOpts): Promise<Response<BalancesResponse>>;
505
+ getTokenBalancesForWalletAddress(chainName: Chain | Chains | ChainID, walletAddress: string, queryParamOpts?: GetTokenBalancesForWalletAddressQueryParamOpts): Promise<Response<BalancesResponse>>;
505
506
  /**
506
507
  *
507
508
  * 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.
@@ -513,7 +514,7 @@ export declare class BalanceService {
513
514
  * - `days`: The number of days to return data for. Defaults to 30 days.
514
515
  *
515
516
  */
516
- getHistoricalPortfolioForWalletAddress(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetHistoricalPortfolioForWalletAddressQueryParamOpts): Promise<Response<PortfolioResponse>>;
517
+ getHistoricalPortfolioForWalletAddress(chainName: Chain | Chains | ChainID, walletAddress: string, queryParamOpts?: GetHistoricalPortfolioForWalletAddressQueryParamOpts): Promise<Response<PortfolioResponse>>;
517
518
  /**
518
519
  *
519
520
  * Commonly used to render the transfer-in and transfer-out of a token along with historical prices from an address.
@@ -529,7 +530,7 @@ export declare class BalanceService {
529
530
  * - `pageNumber`: 0-indexed page number to begin pagination.
530
531
  *
531
532
  */
532
- getErc20TransfersForWalletAddress(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetErc20TransfersForWalletAddressQueryParamOpts): AsyncIterable<BlockTransactionWithContractTransfers>;
533
+ getErc20TransfersForWalletAddress(chainName: Chain | Chains | ChainID, walletAddress: string, queryParamOpts?: GetErc20TransfersForWalletAddressQueryParamOpts): AsyncIterable<BlockTransactionWithContractTransfers>;
533
534
  /**
534
535
  *
535
536
  * Commonly used to render the transfer-in and transfer-out of a token along with historical prices from an address.
@@ -545,7 +546,7 @@ export declare class BalanceService {
545
546
  * - `pageNumber`: 0-indexed page number to begin pagination.
546
547
  *
547
548
  */
548
- getErc20TransfersForWalletAddressByPage(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetErc20TransfersForWalletAddressQueryParamOpts): Promise<Response<Erc20TransfersResponse>>;
549
+ getErc20TransfersForWalletAddressByPage(chainName: Chain | Chains | ChainID, walletAddress: string, queryParamOpts?: GetErc20TransfersForWalletAddressQueryParamOpts): Promise<Response<Erc20TransfersResponse>>;
549
550
  /**
550
551
  *
551
552
  * 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.
@@ -559,7 +560,7 @@ export declare class BalanceService {
559
560
  * - `date`: Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date.
560
561
  *
561
562
  */
562
- getTokenHoldersV2ForTokenAddress(chainName: Chain | Chains, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): AsyncIterable<TokenHolder>;
563
+ getTokenHoldersV2ForTokenAddress(chainName: Chain | Chains | ChainID, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): AsyncIterable<TokenHolder>;
563
564
  /**
564
565
  *
565
566
  * 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.
@@ -573,7 +574,7 @@ export declare class BalanceService {
573
574
  * - `date`: Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date.
574
575
  *
575
576
  */
576
- getTokenHoldersV2ForTokenAddressByPage(chainName: Chain | Chains, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): Promise<Response<TokenHoldersResponse>>;
577
+ getTokenHoldersV2ForTokenAddressByPage(chainName: Chain | Chains | ChainID, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): Promise<Response<TokenHoldersResponse>>;
577
578
  /**
578
579
  *
579
580
  * 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.
@@ -590,7 +591,7 @@ export declare class BalanceService {
590
591
  * - `date`: Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date.
591
592
  *
592
593
  */
593
- getHistoricalTokenBalancesForWalletAddress(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetHistoricalTokenBalancesForWalletAddressQueryParamOpts): Promise<Response<HistoricalBalancesResponse>>;
594
+ getHistoricalTokenBalancesForWalletAddress(chainName: Chain | Chains | ChainID, walletAddress: string, queryParamOpts?: GetHistoricalTokenBalancesForWalletAddressQueryParamOpts): Promise<Response<HistoricalBalancesResponse>>;
594
595
  /**
595
596
  *
596
597
  * @param {string} chainName - The chain name eg: `eth-mainnet`.
@@ -600,6 +601,6 @@ export declare class BalanceService {
600
601
  * - `blockHeight`: Ending block to define a block range. Omitting this parameter defaults to the latest block height.
601
602
  *
602
603
  */
603
- getNativeTokenBalance(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetNativeTokenBalanceQueryParamOpts): Promise<Response<TokenBalanceNativeResponse>>;
604
+ getNativeTokenBalance(chainName: Chain | Chains | ChainID, walletAddress: string, queryParamOpts?: GetNativeTokenBalanceQueryParamOpts): Promise<Response<TokenBalanceNativeResponse>>;
604
605
  }
605
606
  export {};
@@ -1,4 +1,4 @@
1
- import { Chain, Quote, Response } from "./CovalentClient";
1
+ import { Chain, Quote, Response, ChainID, Source } from "./CovalentClient";
2
2
  import { Chains } from "../util/Chains";
3
3
  declare class BlockResponse {
4
4
  /** * The timestamp when the response was generated. Useful to show data staleness to users. */
@@ -365,8 +365,9 @@ export declare class BaseService {
365
365
  private threadCount;
366
366
  private is_key_valid;
367
367
  private enableRetry;
368
+ private source;
368
369
  private LIMIT;
369
- constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean, enableRetry?: boolean);
370
+ constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean, enableRetry: boolean, source: Source);
370
371
  /**
371
372
  *
372
373
  * Commonly used to fetch and render a single block for a block explorer.
@@ -375,7 +376,7 @@ export declare class BaseService {
375
376
  * @param {string} blockHeight - The block height or `latest` for the latest block available.
376
377
  *
377
378
  */
378
- getBlock(chainName: Chain | Chains, blockHeight: string): Promise<Response<BlockResponse>>;
379
+ getBlock(chainName: Chain | Chains | ChainID, blockHeight: string): Promise<Response<BlockResponse>>;
379
380
  /**
380
381
  *
381
382
  * Commonly used to resolve ENS, RNS and Unstoppable Domains addresses.
@@ -384,7 +385,7 @@ export declare class BaseService {
384
385
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
385
386
  *
386
387
  */
387
- getResolvedAddress(chainName: Chain | Chains, walletAddress: string): Promise<Response<ResolvedAddress>>;
388
+ getResolvedAddress(chainName: Chain | Chains | ChainID, walletAddress: string): Promise<Response<ResolvedAddress>>;
388
389
  /**
389
390
  *
390
391
  * Commonly used to get all the block heights within a particular date range. Useful for rendering a display where you sort blocks by day.
@@ -397,7 +398,7 @@ export declare class BaseService {
397
398
  * - `pageNumber`: 0-indexed page number to begin pagination.
398
399
  *
399
400
  */
400
- getBlockHeights(chainName: Chain | Chains, startDate: string, endDate: string, queryParamOpts?: GetBlockHeightsQueryParamOpts): AsyncIterable<Block>;
401
+ getBlockHeights(chainName: Chain | Chains | ChainID, startDate: string, endDate: string, queryParamOpts?: GetBlockHeightsQueryParamOpts): AsyncIterable<Block>;
401
402
  /**
402
403
  *
403
404
  * Commonly used to get all the block heights within a particular date range. Useful for rendering a display where you sort blocks by day.
@@ -410,7 +411,7 @@ export declare class BaseService {
410
411
  * - `pageNumber`: 0-indexed page number to begin pagination.
411
412
  *
412
413
  */
413
- getBlockHeightsByPage(chainName: Chain | Chains, startDate: string, endDate: string, queryParamOpts?: GetBlockHeightsQueryParamOpts): Promise<Response<BlockHeightsResponse>>;
414
+ getBlockHeightsByPage(chainName: Chain | Chains | ChainID, startDate: string, endDate: string, queryParamOpts?: GetBlockHeightsQueryParamOpts): Promise<Response<BlockHeightsResponse>>;
414
415
  /**
415
416
  *
416
417
  * 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.
@@ -425,7 +426,7 @@ export declare class BaseService {
425
426
  * - `skipDecode`: Omit decoded log events.
426
427
  *
427
428
  */
428
- getLogs(chainName: Chain | Chains, queryParamOpts?: GetLogsQueryParamOpts): Promise<Response<GetLogsResponse>>;
429
+ getLogs(chainName: Chain | Chains | ChainID, queryParamOpts?: GetLogsQueryParamOpts): Promise<Response<GetLogsResponse>>;
429
430
  /**
430
431
  *
431
432
  * Commonly used to get all the event logs emitted from a particular contract address. Useful for building dashboards that examine on-chain interactions.
@@ -439,7 +440,7 @@ export declare class BaseService {
439
440
  * - `pageNumber`: 0-indexed page number to begin pagination.
440
441
  *
441
442
  */
442
- getLogEventsByAddress(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetLogEventsByAddressQueryParamOpts): AsyncIterable<LogEvent>;
443
+ getLogEventsByAddress(chainName: Chain | Chains | ChainID, contractAddress: string, queryParamOpts?: GetLogEventsByAddressQueryParamOpts): AsyncIterable<LogEvent>;
443
444
  /**
444
445
  *
445
446
  * Commonly used to get all the event logs emitted from a particular contract address. Useful for building dashboards that examine on-chain interactions.
@@ -453,7 +454,7 @@ export declare class BaseService {
453
454
  * - `pageNumber`: 0-indexed page number to begin pagination.
454
455
  *
455
456
  */
456
- getLogEventsByAddressByPage(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetLogEventsByAddressQueryParamOpts): Promise<Response<LogEventsByAddressResponse>>;
457
+ getLogEventsByAddressByPage(chainName: Chain | Chains | ChainID, contractAddress: string, queryParamOpts?: GetLogEventsByAddressQueryParamOpts): Promise<Response<LogEventsByAddressResponse>>;
457
458
  /**
458
459
  *
459
460
  * 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.
@@ -468,7 +469,7 @@ export declare class BaseService {
468
469
  * - `pageNumber`: 0-indexed page number to begin pagination.
469
470
  *
470
471
  */
471
- getLogEventsByTopicHash(chainName: Chain | Chains, topicHash: string, queryParamOpts?: GetLogEventsByTopicHashQueryParamOpts): AsyncIterable<LogEvent>;
472
+ getLogEventsByTopicHash(chainName: Chain | Chains | ChainID, topicHash: string, queryParamOpts?: GetLogEventsByTopicHashQueryParamOpts): AsyncIterable<LogEvent>;
472
473
  /**
473
474
  *
474
475
  * 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.
@@ -483,7 +484,7 @@ export declare class BaseService {
483
484
  * - `pageNumber`: 0-indexed page number to begin pagination.
484
485
  *
485
486
  */
486
- getLogEventsByTopicHashByPage(chainName: Chain | Chains, topicHash: string, queryParamOpts?: GetLogEventsByTopicHashQueryParamOpts): Promise<Response<LogEventsByTopicHashResponse>>;
487
+ getLogEventsByTopicHashByPage(chainName: Chain | Chains | ChainID, topicHash: string, queryParamOpts?: GetLogEventsByTopicHashQueryParamOpts): Promise<Response<LogEventsByTopicHashResponse>>;
487
488
  /**
488
489
  *
489
490
  * Commonly used to build internal dashboards for all supported chains on Covalent.
@@ -7,7 +7,9 @@ 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-l2-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" | "avalanche-hubble-exchange-testnet" | "avalanche-miho-testnet" | "avalanche-bulletin-testnet" | "avalanche-kiwi-testnet" | "avalanche-hero-testnet" | "avalanche-avacloud-testnet" | "avalanche-thirdweb-testnet" | "avalanche-mondrian-testnet" | "avalanche-conduit-testnet" | "avalanche-nmac-testnet" | "avalanche-orderly-testnet" | "avalanche-amplify-testnet" | "avalanche-mirai-testnet" | "avalanche-wagmi-testnet" | "avalanche-playa3ull-testnet" | "avalanche-beam-mainnet" | "scroll-mainnet" | "eth-holesky";
9
9
  export type Quote = "USD" | "CAD" | "EUR" | "SGD" | "INR" | "JPY" | "VND" | "CNY" | "KRW" | "RUB" | "TRY" | "NGN" | "ARS" | "AUD" | "CHF" | "GBP";
10
- export declare const userAgent = "com.covalenthq.sdk.typescript/0.7.6";
10
+ export type ChainID = 20090103 | 1 | 137 | 56 | 43114 | 10 | 250 | 1284 | 1285 | 30 | 42161 | 11297108109 | 8217 | 128 | 71402 | 2020 | 9001 | 592 | 4689 | 1666600000 | 25 | 1313161554 | 42262 | 288 | 5 | 80001 | 43113 | 97 | 1287 | 31 | 421613 | 4002 | 11297108099 | 256 | 71401 | 9000 | 336 | 4690 | 1666700000 | 1313161555 | 534354 | 534351 | 1131378225 | 53935 | 73772 | 43288 | 1294 | 56288 | 28 | 1297 | 9728 | 4328 | 1001 | 192837465 | 356256156 | 1564830818 | 278611351 | 432204 | 1026062157 | 432201 | 81 | 338 | 335 | 1088 | 588 | 2002 | 200202 | 2001 | 200101 | 73773 | 1399811149 | 2046399126 | 82 | 83 | 2139927552 | 2888 | 245022926 | 344106930 | 476158412 | 42170 | 7700 | 119 | 1029 | 14 | 114 | 19 | 16 | 321 | 322 | 1422 | 59140 | 84531 | 5001 | 534353 | 248 | 9372 | 2152 | 2154 | 416 | 23294 | 23295 | 420 | 1101 | 1662 | 1024 | 39797 | 49797 | 1663 | 11155111 | 1482601649 | 644937893 | 222000222 | 49321 | 1231 | 1230 | 7777777 | 999 | 245022934 | 2044 | 8453 | 5000 | 262018 | 59144 | 7332 | 10507 | 7979 | 1234 | 1228 | 8888 | 333000333 | 12008 | 12011 | 2038 | 1995 | 12010 | 51178 | 12009 | 12012 | 324 | 599 | 280 | 1343 | 11115 | 6765897100 | 1079 | 13337 | 16350 | 1990 | 20221 | 5611 | 12018 | 12013 | 12020 | 12015 | 12016 | 12014 | 12017 | 12019 | 431234 | 6119 | 73 | 7001 | 42888 | 919 | 5151706 | 923018 | 3441005 | 424 | 58008 | 100 | 10200 | 570 | 57000 | 167007 | 11155420 | 204 | 40 | 41 | 321123 | 360163 | 78431 | 2037 | 17772 | 152703 | 894538 | 179188 | 78432 | 7777 | 986532 | 78430 | 2195 | 11111 | 3012 | 4337 | 534352 | 17000 | 88 | 89 | 20765 | 84532 | 47279324479 | 421614 | 12027 | 12028 | 12029 | 31330 | 31331 | 31332 | 31333 | 31334 | 31335 | 412346 | 8545 | 42220;
11
+ export type Source = "Ponder" | "GoldRush";
12
+ export declare const userAgent = "com.covalenthq.sdk.typescript/0.8.1";
11
13
  export declare class Response<T> {
12
14
  data: T;
13
15
  error: boolean;
@@ -34,7 +36,7 @@ export declare class CovalentClient {
34
36
  TransactionService: TransactionService;
35
37
  XykService: XykService;
36
38
  private _is_key_valid;
37
- constructor(apiKey: string, settings?: CovalentClientSettings);
39
+ constructor(apiKey: string, settings?: CovalentClientSettings, source?: Source);
38
40
  }
39
41
  /**
40
42
  * @deprecated
@@ -51,5 +53,5 @@ export declare class Client {
51
53
  TransactionService: TransactionService;
52
54
  XykService: XykService;
53
55
  private _is_key_valid;
54
- constructor(apiKey: string, settings?: CovalentClientSettings);
56
+ constructor(apiKey: string, settings?: CovalentClientSettings, source?: Source);
55
57
  }
@@ -1,4 +1,4 @@
1
- import { Chain, Quote, Response } from "./CovalentClient";
1
+ import { Chain, Quote, Response, ChainID, Source } from "./CovalentClient";
2
2
  import { Chains } from "../util/Chains";
3
3
  declare class ChainCollectionResponse {
4
4
  /** * The timestamp when the response was generated. Useful to show data staleness to users. */
@@ -485,8 +485,9 @@ export declare class NftService {
485
485
  private threadCount;
486
486
  private is_key_valid;
487
487
  private enableRetry;
488
+ private source;
488
489
  private LIMIT;
489
- constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean, enableRetry?: boolean);
490
+ constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean, enableRetry: boolean, source: Source);
490
491
  /**
491
492
  *
492
493
  * Commonly used to fetch the list of NFT collections with downloaded and cached off chain data like token metadata and asset files.
@@ -498,7 +499,7 @@ export declare class NftService {
498
499
  * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
499
500
  *
500
501
  */
501
- getChainCollections(chainName: Chain | Chains, queryParamOpts?: GetChainCollectionsQueryParamOpts): AsyncIterable<ChainCollectionItem>;
502
+ getChainCollections(chainName: Chain | Chains | ChainID, queryParamOpts?: GetChainCollectionsQueryParamOpts): AsyncIterable<ChainCollectionItem>;
502
503
  /**
503
504
  *
504
505
  * Commonly used to fetch the list of NFT collections with downloaded and cached off chain data like token metadata and asset files.
@@ -510,7 +511,7 @@ export declare class NftService {
510
511
  * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
511
512
  *
512
513
  */
513
- getChainCollectionsByPage(chainName: Chain | Chains, queryParamOpts?: GetChainCollectionsQueryParamOpts): Promise<Response<ChainCollectionResponse>>;
514
+ getChainCollectionsByPage(chainName: Chain | Chains | ChainID, queryParamOpts?: GetChainCollectionsQueryParamOpts): Promise<Response<ChainCollectionResponse>>;
514
515
  /**
515
516
  *
516
517
  * Commonly used to render the NFTs (including ERC721 and ERC1155) held by an address.
@@ -523,7 +524,7 @@ export declare class NftService {
523
524
  * - `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.
524
525
  *
525
526
  */
526
- getNftsForAddress(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetNftsForAddressQueryParamOpts): Promise<Response<NftAddressBalanceNftResponse>>;
527
+ getNftsForAddress(chainName: Chain | Chains | ChainID, walletAddress: string, queryParamOpts?: GetNftsForAddressQueryParamOpts): Promise<Response<NftAddressBalanceNftResponse>>;
527
528
  /**
528
529
  *
529
530
  * Commonly used to get NFT token IDs with metadata from a collection. Useful for building NFT card displays.
@@ -539,7 +540,7 @@ export declare class NftService {
539
540
  * - `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.
540
541
  *
541
542
  */
542
- getTokenIdsForContractWithMetadata(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): AsyncIterable<NftTokenContract>;
543
+ getTokenIdsForContractWithMetadata(chainName: Chain | Chains | ChainID, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): AsyncIterable<NftTokenContract>;
543
544
  /**
544
545
  *
545
546
  * Commonly used to get NFT token IDs with metadata from a collection. Useful for building NFT card displays.
@@ -555,7 +556,7 @@ export declare class NftService {
555
556
  * - `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.
556
557
  *
557
558
  */
558
- getTokenIdsForContractWithMetadataByPage(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): Promise<Response<NftMetadataResponse>>;
559
+ getTokenIdsForContractWithMetadataByPage(chainName: Chain | Chains | ChainID, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): Promise<Response<NftMetadataResponse>>;
559
560
  /**
560
561
  *
561
562
  * Commonly used to get a single NFT metadata by token ID from a collection. Useful for building NFT card displays.
@@ -568,7 +569,7 @@ export declare class NftService {
568
569
  * - `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.
569
570
  *
570
571
  */
571
- getNftMetadataForGivenTokenIdForContract(chainName: Chain | Chains, contractAddress: string, tokenId: string, queryParamOpts?: GetNftMetadataForGivenTokenIdForContractQueryParamOpts): Promise<Response<NftMetadataResponse>>;
572
+ getNftMetadataForGivenTokenIdForContract(chainName: Chain | Chains | ChainID, contractAddress: string, tokenId: string, queryParamOpts?: GetNftMetadataForGivenTokenIdForContractQueryParamOpts): Promise<Response<NftMetadataResponse>>;
572
573
  /**
573
574
  *
574
575
  * Commonly used to get all transactions of an NFT token. Useful for building a transaction history table or price chart.
@@ -580,7 +581,7 @@ export declare class NftService {
580
581
  * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
581
582
  *
582
583
  */
583
- getNftTransactionsForContractTokenId(chainName: Chain | Chains, contractAddress: string, tokenId: string, queryParamOpts?: GetNftTransactionsForContractTokenIdQueryParamOpts): Promise<Response<NftTransactionsResponse>>;
584
+ getNftTransactionsForContractTokenId(chainName: Chain | Chains | ChainID, contractAddress: string, tokenId: string, queryParamOpts?: GetNftTransactionsForContractTokenIdQueryParamOpts): Promise<Response<NftTransactionsResponse>>;
584
585
  /**
585
586
  *
586
587
  * Commonly used to fetch and render the traits of a collection as seen in rarity calculators.
@@ -589,7 +590,7 @@ export declare class NftService {
589
590
  * @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
590
591
  *
591
592
  */
592
- getTraitsForCollection(chainName: Chain | Chains, collectionContract: string): Promise<Response<NftCollectionTraitsResponse>>;
593
+ getTraitsForCollection(chainName: Chain | Chains | ChainID, collectionContract: string): Promise<Response<NftCollectionTraitsResponse>>;
593
594
  /**
594
595
  *
595
596
  * Commonly used to get the count of unique values for traits within an NFT collection.
@@ -599,7 +600,7 @@ export declare class NftService {
599
600
  * @param {string} trait - The requested trait.
600
601
  *
601
602
  */
602
- getAttributesForTraitInCollection(chainName: Chain | Chains, collectionContract: string, trait: string): Promise<Response<NftCollectionAttributesForTraitResponse>>;
603
+ getAttributesForTraitInCollection(chainName: Chain | Chains | ChainID, collectionContract: string, trait: string): Promise<Response<NftCollectionAttributesForTraitResponse>>;
603
604
  /**
604
605
  *
605
606
  * Commonly used to calculate rarity scores for a collection based on its traits.
@@ -608,7 +609,7 @@ export declare class NftService {
608
609
  * @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
609
610
  *
610
611
  */
611
- getCollectionTraitsSummary(chainName: Chain | Chains, collectionContract: string): Promise<Response<NftCollectionTraitSummaryResponse>>;
612
+ getCollectionTraitsSummary(chainName: Chain | Chains | ChainID, collectionContract: string): Promise<Response<NftCollectionTraitSummaryResponse>>;
612
613
  /**
613
614
  *
614
615
  * Commonly used to verify ownership of NFTs (including ERC-721 and ERC-1155) within a collection.
@@ -618,7 +619,7 @@ export declare class NftService {
618
619
  * @param {string} collectionContract - The requested collection address.
619
620
  *
620
621
  */
621
- checkOwnershipInNft(chainName: Chain | Chains, walletAddress: string, collectionContract: string): Promise<Response<NftOwnershipForCollectionResponse>>;
622
+ checkOwnershipInNft(chainName: Chain | Chains | ChainID, walletAddress: string, collectionContract: string): Promise<Response<NftOwnershipForCollectionResponse>>;
622
623
  /**
623
624
  *
624
625
  * Commonly used to verify ownership of a specific token (ERC-721 or ERC-1155) within a collection.
@@ -629,7 +630,7 @@ export declare class NftService {
629
630
  * @param {string} tokenId - The requested token ID.
630
631
  *
631
632
  */
632
- checkOwnershipInNftForSpecificTokenId(chainName: Chain | Chains, walletAddress: string, collectionContract: string, tokenId: string): Promise<Response<NftOwnershipForCollectionResponse>>;
633
+ checkOwnershipInNftForSpecificTokenId(chainName: Chain | Chains | ChainID, walletAddress: string, collectionContract: string, tokenId: string): Promise<Response<NftOwnershipForCollectionResponse>>;
633
634
  /**
634
635
  *
635
636
  * Commonly used to build a time-series chart of the sales count of an NFT collection.
@@ -641,7 +642,7 @@ export declare class NftService {
641
642
  * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
642
643
  *
643
644
  */
644
- getNftMarketSaleCount(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetNftMarketSaleCountQueryParamOpts): Promise<Response<NftMarketSaleCountResponse>>;
645
+ getNftMarketSaleCount(chainName: Chain | Chains | ChainID, contractAddress: string, queryParamOpts?: GetNftMarketSaleCountQueryParamOpts): Promise<Response<NftMarketSaleCountResponse>>;
645
646
  /**
646
647
  *
647
648
  * Commonly used to build a time-series chart of the transaction volume of an NFT collection.
@@ -653,7 +654,7 @@ export declare class NftService {
653
654
  * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
654
655
  *
655
656
  */
656
- getNftMarketVolume(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetNftMarketVolumeQueryParamOpts): Promise<Response<NftMarketVolumeResponse>>;
657
+ getNftMarketVolume(chainName: Chain | Chains | ChainID, contractAddress: string, queryParamOpts?: GetNftMarketVolumeQueryParamOpts): Promise<Response<NftMarketVolumeResponse>>;
657
658
  /**
658
659
  *
659
660
  * Commonly used to render a price floor chart for an NFT collection.
@@ -665,6 +666,6 @@ export declare class NftService {
665
666
  * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
666
667
  *
667
668
  */
668
- getNftMarketFloorPrice(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetNftMarketFloorPriceQueryParamOpts): Promise<Response<NftMarketFloorPriceResponse>>;
669
+ getNftMarketFloorPrice(chainName: Chain | Chains | ChainID, contractAddress: string, queryParamOpts?: GetNftMarketFloorPriceQueryParamOpts): Promise<Response<NftMarketFloorPriceResponse>>;
669
670
  }
670
671
  export {};
@@ -1,4 +1,4 @@
1
- import { Chain, Quote } from "./CovalentClient";
1
+ import { Chain, ChainID, Quote, Source } from "./CovalentClient";
2
2
  import { Chains } from "../util/Chains";
3
3
  declare class TokenPricesResponse {
4
4
  /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
@@ -71,8 +71,9 @@ export declare class PricingService {
71
71
  private threadCount;
72
72
  private is_key_valid;
73
73
  private enableRetry;
74
+ private source;
74
75
  private LIMIT;
75
- constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean, enableRetry?: boolean);
76
+ constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean, enableRetry: boolean, source: Source);
76
77
  /**
77
78
  *
78
79
  * Commonly used to get historic prices of a token between date ranges. Supports native tokens.
@@ -86,6 +87,6 @@ export declare class PricingService {
86
87
  * - `pricesAtAsc`: Sort the prices in chronological ascending order. By default, it's set to `false` and returns prices in chronological descending order.
87
88
  *
88
89
  */
89
- getTokenPrices(chainName: Chain | Chains, quoteCurrency: Quote, contractAddress: string, queryParamOpts?: GetTokenPricesQueryParamOpts): Promise<Response<TokenPricesResponse>>;
90
+ getTokenPrices(chainName: Chain | Chains | ChainID, quoteCurrency: Quote, contractAddress: string, queryParamOpts?: GetTokenPricesQueryParamOpts): Promise<Response<TokenPricesResponse>>;
90
91
  }
91
92
  export {};
@@ -1,4 +1,4 @@
1
- import { Chain, Response } from "./CovalentClient";
1
+ import { Chain, Response, ChainID, Source } from "./CovalentClient";
2
2
  import { Chains } from "../util/Chains";
3
3
  declare class ApprovalsResponse {
4
4
  /** * The requested address. */
@@ -138,8 +138,9 @@ export declare class SecurityService {
138
138
  private threadCount;
139
139
  private is_key_valid;
140
140
  private enableRetry;
141
+ private source;
141
142
  private LIMIT;
142
- constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean, enableRetry?: boolean);
143
+ constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean, enableRetry: boolean, source: Source);
143
144
  /**
144
145
  *
145
146
  * Commonly used to get a list of approvals across all token contracts categorized by spenders for a wallet’s assets.
@@ -148,7 +149,7 @@ export declare class SecurityService {
148
149
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
149
150
  *
150
151
  */
151
- getApprovals(chainName: Chain | Chains, walletAddress: string): Promise<Response<ApprovalsResponse>>;
152
+ getApprovals(chainName: Chain | Chains | ChainID, walletAddress: string): Promise<Response<ApprovalsResponse>>;
152
153
  /**
153
154
  *
154
155
  * @param {string} chainName - The chain name eg: `eth-mainnet`.
@@ -156,6 +157,6 @@ export declare class SecurityService {
156
157
 
157
158
  *
158
159
  */
159
- getNftApprovals(chainName: Chain | Chains, walletAddress: string): Promise<Response<NftApprovalsResponse>>;
160
+ getNftApprovals(chainName: Chain | Chains | ChainID, walletAddress: string): Promise<Response<NftApprovalsResponse>>;
160
161
  }
161
162
  export {};