@covalenthq/client-sdk 0.7.5 → 0.8.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 (76) hide show
  1. package/README.md +25 -0
  2. package/dist/cjs/index.js +1183 -451
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/services/BalanceService.d.ts +15 -13
  5. package/dist/cjs/services/BaseService.d.ts +13 -11
  6. package/dist/cjs/services/CovalentClient.d.ts +8 -4
  7. package/dist/cjs/services/NftService.d.ts +19 -17
  8. package/dist/cjs/services/PricingService.d.ts +5 -3
  9. package/dist/cjs/services/SecurityService.d.ts +6 -4
  10. package/dist/cjs/services/TransactionService.d.ts +83 -12
  11. package/dist/cjs/services/XykService.d.ts +287 -22
  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 +160 -8
  16. package/dist/es/index.js +1183 -451
  17. package/dist/es/index.js.map +1 -1
  18. package/dist/es/services/BalanceService.d.ts +15 -13
  19. package/dist/es/services/BaseService.d.ts +13 -11
  20. package/dist/es/services/CovalentClient.d.ts +8 -4
  21. package/dist/es/services/NftService.d.ts +19 -17
  22. package/dist/es/services/PricingService.d.ts +5 -3
  23. package/dist/es/services/SecurityService.d.ts +6 -4
  24. package/dist/es/services/TransactionService.d.ts +83 -12
  25. package/dist/es/services/XykService.d.ts +287 -22
  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 +160 -8
  30. package/dist/esm/index.js +1183 -451
  31. package/dist/esm/index.js.map +1 -1
  32. package/dist/esm/services/BalanceService.d.ts +15 -13
  33. package/dist/esm/services/BaseService.d.ts +13 -11
  34. package/dist/esm/services/CovalentClient.d.ts +8 -4
  35. package/dist/esm/services/NftService.d.ts +19 -17
  36. package/dist/esm/services/PricingService.d.ts +5 -3
  37. package/dist/esm/services/SecurityService.d.ts +6 -4
  38. package/dist/esm/services/TransactionService.d.ts +83 -12
  39. package/dist/esm/services/XykService.d.ts +287 -22
  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 +160 -8
  44. package/dist/services/BalanceService.d.ts +15 -13
  45. package/dist/services/BalanceService.js +47 -39
  46. package/dist/services/BalanceService.js.map +1 -1
  47. package/dist/services/BaseService.d.ts +13 -11
  48. package/dist/services/BaseService.js +77 -65
  49. package/dist/services/BaseService.js.map +1 -1
  50. package/dist/services/CovalentClient.d.ts +8 -4
  51. package/dist/services/CovalentClient.js +19 -19
  52. package/dist/services/CovalentClient.js.map +1 -1
  53. package/dist/services/NftService.d.ts +19 -17
  54. package/dist/services/NftService.js +96 -81
  55. package/dist/services/NftService.js.map +1 -1
  56. package/dist/services/PricingService.d.ts +5 -3
  57. package/dist/services/PricingService.js +10 -7
  58. package/dist/services/PricingService.js.map +1 -1
  59. package/dist/services/SecurityService.d.ts +6 -4
  60. package/dist/services/SecurityService.js +17 -13
  61. package/dist/services/SecurityService.js.map +1 -1
  62. package/dist/services/TransactionService.d.ts +83 -12
  63. package/dist/services/TransactionService.js +434 -90
  64. package/dist/services/TransactionService.js.map +1 -1
  65. package/dist/services/XykService.d.ts +287 -22
  66. package/dist/services/XykService.js +438 -93
  67. package/dist/services/XykService.js.map +1 -1
  68. package/dist/util/ApiHelpers.d.ts +2 -1
  69. package/dist/util/ApiHelpers.js +7 -6
  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 +160 -8
  76. package/package.json +1 -1
@@ -7,11 +7,13 @@ 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.5";
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.0";
11
13
  export declare class Response<T> {
12
14
  data: T;
13
15
  error: boolean;
14
- error_code: number;
16
+ error_code: number | string;
15
17
  error_message: string;
16
18
  }
17
19
  export interface CovalentClientSettings {
@@ -19,6 +21,8 @@ export interface CovalentClientSettings {
19
21
  debug?: boolean;
20
22
  /** * The number of concurrent requests allowed. */
21
23
  threadCount?: number;
24
+ /** Toggle to turn on and off retry logic */
25
+ enableRetry?: boolean;
22
26
  }
23
27
  /**
24
28
  * CovalentClient Class
@@ -32,7 +36,7 @@ export declare class CovalentClient {
32
36
  TransactionService: TransactionService;
33
37
  XykService: XykService;
34
38
  private _is_key_valid;
35
- constructor(apiKey: string, settings?: CovalentClientSettings);
39
+ constructor(apiKey: string, settings?: CovalentClientSettings, source?: Source);
36
40
  }
37
41
  /**
38
42
  * @deprecated
@@ -49,5 +53,5 @@ export declare class Client {
49
53
  TransactionService: TransactionService;
50
54
  XykService: XykService;
51
55
  private _is_key_valid;
52
- constructor(apiKey: string, settings?: CovalentClientSettings);
56
+ constructor(apiKey: string, settings?: CovalentClientSettings, source?: Source);
53
57
  }
@@ -6,24 +6,24 @@ import { PricingService } from "./PricingService";
6
6
  import { TransactionService } from "./TransactionService";
7
7
  import { XykService } from "./XykService";
8
8
  import { ApiKeyValidator } from "../util/ApiKeyValidator";
9
- export const userAgent = "com.covalenthq.sdk.typescript/0.7.5";
9
+ export const userAgent = "com.covalenthq.sdk.typescript/0.8.0";
10
10
  export class Response {
11
11
  }
12
12
  /**
13
13
  * CovalentClient Class
14
14
  */
15
15
  export class CovalentClient {
16
- constructor(apiKey, settings) {
17
- const { debug = false, threadCount = 3 } = settings || {};
16
+ constructor(apiKey, settings, source) {
17
+ const { debug = false, threadCount = 3, enableRetry = true } = settings || {};
18
18
  const validator = new ApiKeyValidator(apiKey);
19
19
  this._is_key_valid = validator.isValidApiKey();
20
- this.SecurityService = new SecurityService(apiKey, debug, threadCount, this._is_key_valid);
21
- this.BalanceService = new BalanceService(apiKey, debug, threadCount, this._is_key_valid);
22
- this.BaseService = new BaseService(apiKey, debug, threadCount, this._is_key_valid);
23
- this.NftService = new NftService(apiKey, debug, threadCount, this._is_key_valid);
24
- this.PricingService = new PricingService(apiKey, debug, threadCount, this._is_key_valid);
25
- this.TransactionService = new TransactionService(apiKey, debug, threadCount, this._is_key_valid);
26
- this.XykService = new XykService(apiKey, debug, threadCount, this._is_key_valid);
20
+ this.SecurityService = new SecurityService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
21
+ this.BalanceService = new BalanceService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
22
+ this.BaseService = new BaseService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
23
+ this.NftService = new NftService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
24
+ this.PricingService = new PricingService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
25
+ this.TransactionService = new TransactionService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
26
+ this.XykService = new XykService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
27
27
  }
28
28
  }
29
29
  /**
@@ -33,17 +33,17 @@ export class CovalentClient {
33
33
  * CovalentClient Class
34
34
  */
35
35
  export class Client {
36
- constructor(apiKey, settings) {
37
- const { debug = false, threadCount = 3 } = settings || {};
36
+ constructor(apiKey, settings, source) {
37
+ const { debug = false, threadCount = 3, enableRetry = true } = settings || {};
38
38
  const validator = new ApiKeyValidator(apiKey);
39
39
  this._is_key_valid = validator.isValidApiKey();
40
- this.SecurityService = new SecurityService(apiKey, debug, threadCount, this._is_key_valid);
41
- this.BalanceService = new BalanceService(apiKey, debug, threadCount, this._is_key_valid);
42
- this.BaseService = new BaseService(apiKey, debug, threadCount, this._is_key_valid);
43
- this.NftService = new NftService(apiKey, debug, threadCount, this._is_key_valid);
44
- this.PricingService = new PricingService(apiKey, debug, threadCount, this._is_key_valid);
45
- this.TransactionService = new TransactionService(apiKey, debug, threadCount, this._is_key_valid);
46
- this.XykService = new XykService(apiKey, debug, threadCount, this._is_key_valid);
40
+ this.SecurityService = new SecurityService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
41
+ this.BalanceService = new BalanceService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
42
+ this.BaseService = new BaseService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
43
+ this.NftService = new NftService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
44
+ this.PricingService = new PricingService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
45
+ this.TransactionService = new TransactionService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
46
+ this.XykService = new XykService(apiKey, debug, threadCount, this._is_key_valid, enableRetry, source);
47
47
  }
48
48
  }
49
49
  //# sourceMappingURL=CovalentClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CovalentClient.js","sourceRoot":"","sources":["../../src/services/CovalentClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAK1D,MAAM,CAAC,MAAM,SAAS,GAAG,qCAAqC,CAAC;AAE/D,MAAM,OAAO,QAAQ;CAKpB;AASD;;GAEG;AACH,MAAM,OAAO,cAAc;IAkBvB,YAAY,MAAc,EAAE,QAAiC;QACzD,MAAM,EAAE,KAAK,GAAG,KAAK,EAAE,WAAW,GAAG,CAAC,EAAE,GAAG,QAAQ,IAAI,EAAE,CAAC;QAE1D,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;QAC9C,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,aAAa,EAAE,CAAC;QAE/C,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3F,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,aAA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AC1G,CAAC;CAEJ"}
@@ -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. */
@@ -484,8 +484,10 @@ export declare class NftService {
484
484
  private debug;
485
485
  private threadCount;
486
486
  private is_key_valid;
487
+ private enableRetry;
488
+ private source;
487
489
  private LIMIT;
488
- constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean);
490
+ constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean, enableRetry: boolean, source: Source);
489
491
  /**
490
492
  *
491
493
  * Commonly used to fetch the list of NFT collections with downloaded and cached off chain data like token metadata and asset files.
@@ -497,7 +499,7 @@ export declare class NftService {
497
499
  * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
498
500
  *
499
501
  */
500
- getChainCollections(chainName: Chain | Chains, queryParamOpts?: GetChainCollectionsQueryParamOpts): AsyncIterable<ChainCollectionItem>;
502
+ getChainCollections(chainName: Chain | Chains | ChainID, queryParamOpts?: GetChainCollectionsQueryParamOpts): AsyncIterable<ChainCollectionItem>;
501
503
  /**
502
504
  *
503
505
  * Commonly used to fetch the list of NFT collections with downloaded and cached off chain data like token metadata and asset files.
@@ -509,7 +511,7 @@ export declare class NftService {
509
511
  * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
510
512
  *
511
513
  */
512
- getChainCollectionsByPage(chainName: Chain | Chains, queryParamOpts?: GetChainCollectionsQueryParamOpts): Promise<Response<ChainCollectionResponse>>;
514
+ getChainCollectionsByPage(chainName: Chain | Chains | ChainID, queryParamOpts?: GetChainCollectionsQueryParamOpts): Promise<Response<ChainCollectionResponse>>;
513
515
  /**
514
516
  *
515
517
  * Commonly used to render the NFTs (including ERC721 and ERC1155) held by an address.
@@ -522,7 +524,7 @@ export declare class NftService {
522
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.
523
525
  *
524
526
  */
525
- getNftsForAddress(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetNftsForAddressQueryParamOpts): Promise<Response<NftAddressBalanceNftResponse>>;
527
+ getNftsForAddress(chainName: Chain | Chains | ChainID, walletAddress: string, queryParamOpts?: GetNftsForAddressQueryParamOpts): Promise<Response<NftAddressBalanceNftResponse>>;
526
528
  /**
527
529
  *
528
530
  * Commonly used to get NFT token IDs with metadata from a collection. Useful for building NFT card displays.
@@ -538,7 +540,7 @@ export declare class NftService {
538
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.
539
541
  *
540
542
  */
541
- getTokenIdsForContractWithMetadata(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): AsyncIterable<NftTokenContract>;
543
+ getTokenIdsForContractWithMetadata(chainName: Chain | Chains | ChainID, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): AsyncIterable<NftTokenContract>;
542
544
  /**
543
545
  *
544
546
  * Commonly used to get NFT token IDs with metadata from a collection. Useful for building NFT card displays.
@@ -554,7 +556,7 @@ export declare class NftService {
554
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.
555
557
  *
556
558
  */
557
- getTokenIdsForContractWithMetadataByPage(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): Promise<Response<NftMetadataResponse>>;
559
+ getTokenIdsForContractWithMetadataByPage(chainName: Chain | Chains | ChainID, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): Promise<Response<NftMetadataResponse>>;
558
560
  /**
559
561
  *
560
562
  * Commonly used to get a single NFT metadata by token ID from a collection. Useful for building NFT card displays.
@@ -567,7 +569,7 @@ export declare class NftService {
567
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.
568
570
  *
569
571
  */
570
- 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>>;
571
573
  /**
572
574
  *
573
575
  * Commonly used to get all transactions of an NFT token. Useful for building a transaction history table or price chart.
@@ -579,7 +581,7 @@ export declare class NftService {
579
581
  * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
580
582
  *
581
583
  */
582
- 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>>;
583
585
  /**
584
586
  *
585
587
  * Commonly used to fetch and render the traits of a collection as seen in rarity calculators.
@@ -588,7 +590,7 @@ export declare class NftService {
588
590
  * @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
589
591
  *
590
592
  */
591
- getTraitsForCollection(chainName: Chain | Chains, collectionContract: string): Promise<Response<NftCollectionTraitsResponse>>;
593
+ getTraitsForCollection(chainName: Chain | Chains | ChainID, collectionContract: string): Promise<Response<NftCollectionTraitsResponse>>;
592
594
  /**
593
595
  *
594
596
  * Commonly used to get the count of unique values for traits within an NFT collection.
@@ -598,7 +600,7 @@ export declare class NftService {
598
600
  * @param {string} trait - The requested trait.
599
601
  *
600
602
  */
601
- getAttributesForTraitInCollection(chainName: Chain | Chains, collectionContract: string, trait: string): Promise<Response<NftCollectionAttributesForTraitResponse>>;
603
+ getAttributesForTraitInCollection(chainName: Chain | Chains | ChainID, collectionContract: string, trait: string): Promise<Response<NftCollectionAttributesForTraitResponse>>;
602
604
  /**
603
605
  *
604
606
  * Commonly used to calculate rarity scores for a collection based on its traits.
@@ -607,7 +609,7 @@ export declare class NftService {
607
609
  * @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
608
610
  *
609
611
  */
610
- getCollectionTraitsSummary(chainName: Chain | Chains, collectionContract: string): Promise<Response<NftCollectionTraitSummaryResponse>>;
612
+ getCollectionTraitsSummary(chainName: Chain | Chains | ChainID, collectionContract: string): Promise<Response<NftCollectionTraitSummaryResponse>>;
611
613
  /**
612
614
  *
613
615
  * Commonly used to verify ownership of NFTs (including ERC-721 and ERC-1155) within a collection.
@@ -617,7 +619,7 @@ export declare class NftService {
617
619
  * @param {string} collectionContract - The requested collection address.
618
620
  *
619
621
  */
620
- checkOwnershipInNft(chainName: Chain | Chains, walletAddress: string, collectionContract: string): Promise<Response<NftOwnershipForCollectionResponse>>;
622
+ checkOwnershipInNft(chainName: Chain | Chains | ChainID, walletAddress: string, collectionContract: string): Promise<Response<NftOwnershipForCollectionResponse>>;
621
623
  /**
622
624
  *
623
625
  * Commonly used to verify ownership of a specific token (ERC-721 or ERC-1155) within a collection.
@@ -628,7 +630,7 @@ export declare class NftService {
628
630
  * @param {string} tokenId - The requested token ID.
629
631
  *
630
632
  */
631
- 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>>;
632
634
  /**
633
635
  *
634
636
  * Commonly used to build a time-series chart of the sales count of an NFT collection.
@@ -640,7 +642,7 @@ export declare class NftService {
640
642
  * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
641
643
  *
642
644
  */
643
- getNftMarketSaleCount(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetNftMarketSaleCountQueryParamOpts): Promise<Response<NftMarketSaleCountResponse>>;
645
+ getNftMarketSaleCount(chainName: Chain | Chains | ChainID, contractAddress: string, queryParamOpts?: GetNftMarketSaleCountQueryParamOpts): Promise<Response<NftMarketSaleCountResponse>>;
644
646
  /**
645
647
  *
646
648
  * Commonly used to build a time-series chart of the transaction volume of an NFT collection.
@@ -652,7 +654,7 @@ export declare class NftService {
652
654
  * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
653
655
  *
654
656
  */
655
- getNftMarketVolume(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetNftMarketVolumeQueryParamOpts): Promise<Response<NftMarketVolumeResponse>>;
657
+ getNftMarketVolume(chainName: Chain | Chains | ChainID, contractAddress: string, queryParamOpts?: GetNftMarketVolumeQueryParamOpts): Promise<Response<NftMarketVolumeResponse>>;
656
658
  /**
657
659
  *
658
660
  * Commonly used to render a price floor chart for an NFT collection.
@@ -664,6 +666,6 @@ export declare class NftService {
664
666
  * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
665
667
  *
666
668
  */
667
- getNftMarketFloorPrice(chainName: Chain | Chains, contractAddress: string, queryParamOpts?: GetNftMarketFloorPriceQueryParamOpts): Promise<Response<NftMarketFloorPriceResponse>>;
669
+ getNftMarketFloorPrice(chainName: Chain | Chains | ChainID, contractAddress: string, queryParamOpts?: GetNftMarketFloorPriceQueryParamOpts): Promise<Response<NftMarketFloorPriceResponse>>;
668
670
  }
669
671
  export {};