@covalenthq/client-sdk 1.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +223 -282
  3. package/package.json +25 -12
  4. package/dist/cjs/index.d.ts +0 -20
  5. package/dist/cjs/index.js +0 -8190
  6. package/dist/cjs/index.js.map +0 -1
  7. package/dist/cjs/services/BalanceService.d.ts +0 -638
  8. package/dist/cjs/services/BaseService.d.ts +0 -571
  9. package/dist/cjs/services/CovalentClient.d.ts +0 -57
  10. package/dist/cjs/services/NftService.d.ts +0 -686
  11. package/dist/cjs/services/PricingService.d.ts +0 -103
  12. package/dist/cjs/services/SecurityService.d.ts +0 -162
  13. package/dist/cjs/services/TransactionService.d.ts +0 -711
  14. package/dist/cjs/services/XykService.d.ts +0 -1018
  15. package/dist/cjs/util/ApiHelpers.d.ts +0 -6
  16. package/dist/cjs/util/ApiKeyValidator.d.ts +0 -8
  17. package/dist/cjs/util/CalculatePrettyBalance.d.ts +0 -1
  18. package/dist/cjs/util/Chains.d.ts +0 -223
  19. package/dist/cjs/util/backoff.d.ts +0 -12
  20. package/dist/cjs/util/prettifyCurrency.d.ts +0 -2
  21. package/dist/cjs/util/types/BalanceServiceTypes.d.ts +0 -378
  22. package/dist/cjs/util/types/BaseServiceTypes.d.ts +0 -276
  23. package/dist/cjs/util/types/GenericTypes.d.ts +0 -116
  24. package/dist/cjs/util/types/NftServiceTypes.d.ts +0 -303
  25. package/dist/cjs/util/types/PricingServiceTypes.d.ts +0 -33
  26. package/dist/cjs/util/types/SecurityServiceTypes.d.ts +0 -121
  27. package/dist/cjs/util/types/TransactionServiceTypes.d.ts +0 -388
  28. package/dist/cjs/util/types/XykServiceTypes.d.ts +0 -687
  29. package/dist/es/index.d.ts +0 -20
  30. package/dist/es/index.js +0 -8176
  31. package/dist/es/index.js.map +0 -1
  32. package/dist/es/services/BalanceService.d.ts +0 -638
  33. package/dist/es/services/BaseService.d.ts +0 -571
  34. package/dist/es/services/CovalentClient.d.ts +0 -57
  35. package/dist/es/services/NftService.d.ts +0 -686
  36. package/dist/es/services/PricingService.d.ts +0 -103
  37. package/dist/es/services/SecurityService.d.ts +0 -162
  38. package/dist/es/services/TransactionService.d.ts +0 -711
  39. package/dist/es/services/XykService.d.ts +0 -1018
  40. package/dist/es/util/ApiHelpers.d.ts +0 -6
  41. package/dist/es/util/ApiKeyValidator.d.ts +0 -8
  42. package/dist/es/util/CalculatePrettyBalance.d.ts +0 -1
  43. package/dist/es/util/Chains.d.ts +0 -223
  44. package/dist/es/util/backoff.d.ts +0 -12
  45. package/dist/es/util/prettifyCurrency.d.ts +0 -2
  46. package/dist/es/util/types/BalanceServiceTypes.d.ts +0 -378
  47. package/dist/es/util/types/BaseServiceTypes.d.ts +0 -276
  48. package/dist/es/util/types/GenericTypes.d.ts +0 -116
  49. package/dist/es/util/types/NftServiceTypes.d.ts +0 -303
  50. package/dist/es/util/types/PricingServiceTypes.d.ts +0 -33
  51. package/dist/es/util/types/SecurityServiceTypes.d.ts +0 -121
  52. package/dist/es/util/types/TransactionServiceTypes.d.ts +0 -388
  53. package/dist/es/util/types/XykServiceTypes.d.ts +0 -687
  54. package/dist/esm/index.d.ts +0 -20
  55. package/dist/esm/index.js +0 -8176
  56. package/dist/esm/index.js.map +0 -1
  57. package/dist/esm/services/BalanceService.d.ts +0 -638
  58. package/dist/esm/services/BaseService.d.ts +0 -571
  59. package/dist/esm/services/CovalentClient.d.ts +0 -57
  60. package/dist/esm/services/NftService.d.ts +0 -686
  61. package/dist/esm/services/PricingService.d.ts +0 -103
  62. package/dist/esm/services/SecurityService.d.ts +0 -162
  63. package/dist/esm/services/TransactionService.d.ts +0 -711
  64. package/dist/esm/services/XykService.d.ts +0 -1018
  65. package/dist/esm/util/ApiHelpers.d.ts +0 -6
  66. package/dist/esm/util/ApiKeyValidator.d.ts +0 -8
  67. package/dist/esm/util/CalculatePrettyBalance.d.ts +0 -1
  68. package/dist/esm/util/Chains.d.ts +0 -223
  69. package/dist/esm/util/backoff.d.ts +0 -12
  70. package/dist/esm/util/prettifyCurrency.d.ts +0 -2
  71. package/dist/esm/util/types/BalanceServiceTypes.d.ts +0 -378
  72. package/dist/esm/util/types/BaseServiceTypes.d.ts +0 -276
  73. package/dist/esm/util/types/GenericTypes.d.ts +0 -116
  74. package/dist/esm/util/types/NftServiceTypes.d.ts +0 -303
  75. package/dist/esm/util/types/PricingServiceTypes.d.ts +0 -33
  76. package/dist/esm/util/types/SecurityServiceTypes.d.ts +0 -121
  77. package/dist/esm/util/types/TransactionServiceTypes.d.ts +0 -388
  78. package/dist/esm/util/types/XykServiceTypes.d.ts +0 -687
  79. package/dist/index.d.ts +0 -20
  80. package/dist/index.js +0 -21
  81. package/dist/index.js.map +0 -1
  82. package/dist/services/BalanceService.d.ts +0 -638
  83. package/dist/services/BalanceService.js +0 -959
  84. package/dist/services/BalanceService.js.map +0 -1
  85. package/dist/services/BaseService.d.ts +0 -571
  86. package/dist/services/BaseService.js +0 -1202
  87. package/dist/services/BaseService.js.map +0 -1
  88. package/dist/services/CovalentClient.d.ts +0 -57
  89. package/dist/services/CovalentClient.js +0 -49
  90. package/dist/services/CovalentClient.js.map +0 -1
  91. package/dist/services/NftService.d.ts +0 -686
  92. package/dist/services/NftService.js +0 -1490
  93. package/dist/services/NftService.js.map +0 -1
  94. package/dist/services/PricingService.d.ts +0 -103
  95. package/dist/services/PricingService.js +0 -155
  96. package/dist/services/PricingService.js.map +0 -1
  97. package/dist/services/SecurityService.d.ts +0 -162
  98. package/dist/services/SecurityService.js +0 -249
  99. package/dist/services/SecurityService.js.map +0 -1
  100. package/dist/services/TransactionService.d.ts +0 -711
  101. package/dist/services/TransactionService.js +0 -1687
  102. package/dist/services/TransactionService.js.map +0 -1
  103. package/dist/services/XykService.d.ts +0 -1018
  104. package/dist/services/XykService.js +0 -1827
  105. package/dist/services/XykService.js.map +0 -1
  106. package/dist/util/ApiHelpers.d.ts +0 -6
  107. package/dist/util/ApiHelpers.js +0 -87
  108. package/dist/util/ApiHelpers.js.map +0 -1
  109. package/dist/util/ApiKeyValidator.d.ts +0 -8
  110. package/dist/util/ApiKeyValidator.js +0 -13
  111. package/dist/util/ApiKeyValidator.js.map +0 -1
  112. package/dist/util/CalculatePrettyBalance.d.ts +0 -1
  113. package/dist/util/CalculatePrettyBalance.js +0 -32
  114. package/dist/util/CalculatePrettyBalance.js.map +0 -1
  115. package/dist/util/Chains.d.ts +0 -223
  116. package/dist/util/Chains.js +0 -225
  117. package/dist/util/Chains.js.map +0 -1
  118. package/dist/util/backoff.d.ts +0 -12
  119. package/dist/util/backoff.js +0 -47
  120. package/dist/util/backoff.js.map +0 -1
  121. package/dist/util/prettifyCurrency.d.ts +0 -2
  122. package/dist/util/prettifyCurrency.js +0 -69
  123. package/dist/util/prettifyCurrency.js.map +0 -1
  124. package/dist/util/types/BalanceServiceTypes.d.ts +0 -378
  125. package/dist/util/types/BalanceServiceTypes.js +0 -2
  126. package/dist/util/types/BalanceServiceTypes.js.map +0 -1
  127. package/dist/util/types/BaseServiceTypes.d.ts +0 -276
  128. package/dist/util/types/BaseServiceTypes.js +0 -2
  129. package/dist/util/types/BaseServiceTypes.js.map +0 -1
  130. package/dist/util/types/GenericTypes.d.ts +0 -116
  131. package/dist/util/types/GenericTypes.js +0 -2
  132. package/dist/util/types/GenericTypes.js.map +0 -1
  133. package/dist/util/types/NftServiceTypes.d.ts +0 -303
  134. package/dist/util/types/NftServiceTypes.js +0 -2
  135. package/dist/util/types/NftServiceTypes.js.map +0 -1
  136. package/dist/util/types/PricingServiceTypes.d.ts +0 -33
  137. package/dist/util/types/PricingServiceTypes.js +0 -2
  138. package/dist/util/types/PricingServiceTypes.js.map +0 -1
  139. package/dist/util/types/SecurityServiceTypes.d.ts +0 -121
  140. package/dist/util/types/SecurityServiceTypes.js +0 -2
  141. package/dist/util/types/SecurityServiceTypes.js.map +0 -1
  142. package/dist/util/types/TransactionServiceTypes.d.ts +0 -388
  143. package/dist/util/types/TransactionServiceTypes.js +0 -2
  144. package/dist/util/types/TransactionServiceTypes.js.map +0 -1
  145. package/dist/util/types/XykServiceTypes.d.ts +0 -687
  146. package/dist/util/types/XykServiceTypes.js +0 -2
  147. package/dist/util/types/XykServiceTypes.js.map +0 -1
@@ -1,6 +0,0 @@
1
- import { Source } from "../services/CovalentClient";
2
- export declare function checkAndModifyResponse(jsonObj: any): void;
3
- export declare function debugOutput(url: string, responseStatus: number, startTime: Date | undefined): Promise<void>;
4
- type Constructor<T> = new (...args: any[]) => T;
5
- export declare function paginateEndpoint<T1, T2>(url: string, apiKey: string, urlsParams: URLSearchParams, dataClassConstructor: Constructor<T1>, debug: boolean, threadCount: number, enableRetry: boolean, source: Source): AsyncIterable<T1>;
6
- export {};
@@ -1,8 +0,0 @@
1
- export declare class ApiKeyValidator {
2
- readonly _apiKey: string;
3
- private static readonly _apiKeyV1Pattern;
4
- private static readonly _apiKeyV2Pattern;
5
- static readonly INVALID_API_KEY_MESSAGE = "Invalid or missing API key (sign up at covalenthq.com/platform)";
6
- constructor(apiKey: string);
7
- isValidApiKey(): boolean;
8
- }
@@ -1 +0,0 @@
1
- export declare const calculatePrettyBalance: (value: number | bigint, decimals?: number, roundOff?: boolean, precision?: number) => string;
@@ -1,223 +0,0 @@
1
- export declare enum Chains {
2
- BTC_MAINNET = "btc-mainnet",
3
- ETH_MAINNET = "eth-mainnet",
4
- MATIC_MAINNET = "matic-mainnet",
5
- BSC_MAINNET = "bsc-mainnet",
6
- AVALANCHE_MAINNET = "avalanche-mainnet",
7
- OPTIMISM_MAINNET = "optimism-mainnet",
8
- FANTOM_MAINNET = "fantom-mainnet",
9
- MOONBEAM_MAINNET = "moonbeam-mainnet",
10
- MOONBEAM_MOONRIVER = "moonbeam-moonriver",
11
- RSK_MAINNET = "rsk-mainnet",
12
- ARBITRUM_MAINNET = "arbitrum-mainnet",
13
- PALM_MAINNET = "palm-mainnet",
14
- KLAYTN_MAINNET = "klaytn-mainnet",
15
- HECO_MAINNET = "heco-mainnet",
16
- NERVOS_GODWOKEN_MAINNET = "nervos-godwoken-mainnet",
17
- AXIE_MAINNET = "axie-mainnet",
18
- EVMOS_MAINNET = "evmos-mainnet",
19
- ASTAR_MAINNET = "astar-mainnet",
20
- IOTEX_MAINNET = "iotex-mainnet",
21
- HARMONY_MAINNET = "harmony-mainnet",
22
- CRONOS_MAINNET = "cronos-mainnet",
23
- AURORA_MAINNET = "aurora-mainnet",
24
- EMERALD_PARATIME_MAINNET = "emerald-paratime-mainnet",
25
- BOBA_MAINNET = "boba-mainnet",
26
- ETH_GOERLI = "eth-goerli",
27
- MATIC_MUMBAI = "matic-mumbai",
28
- AVALANCHE_TESTNET = "avalanche-testnet",
29
- BSC_TESTNET = "bsc-testnet",
30
- MOONBEAM_MOONBASE_ALPHA = "moonbeam-moonbase-alpha",
31
- RSK_TESTNET = "rsk-testnet",
32
- ARBITRUM_GOERLI = "arbitrum-goerli",
33
- FANTOM_TESTNET = "fantom-testnet",
34
- PALM_TESTNET = "palm-testnet",
35
- HECO_TESTNET = "heco-testnet",
36
- NERVOS_GODWOKEN_TESTNET = "nervos-godwoken-testnet",
37
- EVMOS_TESTNET = "evmos-testnet",
38
- IOTEX_TESTNET = "iotex-testnet",
39
- HARMONY_TESTNET = "harmony-testnet",
40
- AURORA_TESTNET = "aurora-testnet",
41
- SCROLL_L2_TESTNET = "scroll-l2-testnet",
42
- SCROLL_SEPOLIA_TESTNET = "scroll-sepolia-testnet",
43
- COVALENT_INTERNAL_NETWORK_V1 = "covalent-internal-network-v1",
44
- DEFI_KINGDOMS_MAINNET = "defi-kingdoms-mainnet",
45
- SWIMMER_MAINNET = "swimmer-mainnet",
46
- BOBA_AVALANCHE_MAINNET = "boba-avalanche-mainnet",
47
- BOBA_BOBABEAM_MAINNET = "boba-bobabeam-mainnet",
48
- BOBA_BNB_MAINNET = "boba-bnb-mainnet",
49
- BOBA_RINKEBY_TESTNET = "boba-rinkeby-testnet",
50
- BOBA_BOBABASE_TESTNET = "boba-bobabase-testnet",
51
- BOBA_BNB_TESTNET = "boba-bnb-testnet",
52
- BOBA_AVALANCHE_TESTNET = "boba-avalanche-testnet",
53
- KLAYTN_TESTNET = "klaytn-testnet",
54
- GATHER_MAINNET = "gather-mainnet",
55
- GATHER_TESTNET = "gather-testnet",
56
- SKALE_CALYPSO = "skale-calypso",
57
- SKALE_MAINNET = "skale-mainnet",
58
- SKALE_RAZOR = "skale-razor",
59
- AVALANCHE_DEXALOT_MAINNET = "avalanche-dexalot-mainnet",
60
- SKALE_OMNUS = "skale-omnus",
61
- AVALANCHE_DEXALOT_TESTNET = "avalanche-dexalot-testnet",
62
- ASTAR_SHIBUYA = "astar-shibuya",
63
- CRONOS_TESTNET = "cronos-testnet",
64
- DEFI_KINGDOMS_TESTNET = "defi-kingdoms-testnet",
65
- METIS_MAINNET = "metis-mainnet",
66
- METIS_STARDUST = "metis-stardust",
67
- MILKOMEDA_A1_MAINNET = "milkomeda-a1-mainnet",
68
- MILKOMEDA_A1_DEVNET = "milkomeda-a1-devnet",
69
- MILKOMEDA_C1_MAINNET = "milkomeda-c1-mainnet",
70
- MILKOMEDA_C1_DEVNET = "milkomeda-c1-devnet",
71
- SWIMMER_TESTNET = "swimmer-testnet",
72
- SOLANA_MAINNET = "solana-mainnet",
73
- SKALE_EUROPA = "skale-europa",
74
- METER_MAINNET = "meter-mainnet",
75
- METER_TESTNET = "meter-testnet",
76
- SKALE_EXORDE = "skale-exorde",
77
- BOBA_GOERLI = "boba-goerli",
78
- NEON_TESTNET = "neon-testnet",
79
- SKALE_STAGING_UUM = "skale-staging-uum",
80
- SKALE_STAGING_LCC = "skale-staging-lcc",
81
- ARBITRUM_NOVA_MAINNET = "arbitrum-nova-mainnet",
82
- CANTO_MAINNET = "canto-mainnet",
83
- BITTORRENT_MAINNET = "bittorrent-mainnet",
84
- BITTORRENT_TESTNET = "bittorrent-testnet",
85
- FLARENETWORKS_FLARE_MAINNET = "flarenetworks-flare-mainnet",
86
- FLARENETWORKS_FLARE_TESTNET = "flarenetworks-flare-testnet",
87
- FLARENETWORKS_CANARY_MAINNET = "flarenetworks-canary-mainnet",
88
- FLARENETWORKS_CANARY_TESTNET = "flarenetworks-canary-testnet",
89
- KCC_MAINNET = "kcc-mainnet",
90
- KCC_TESTNET = "kcc-testnet",
91
- POLYGON_ZKEVM_TESTNET = "polygon-zkevm-testnet",
92
- LINEA_TESTNET = "linea-testnet",
93
- BASE_TESTNET = "base-testnet",
94
- MANTLE_TESTNET = "mantle-testnet",
95
- SCROLL_ALPHA_TESTNET = "scroll-alpha-testnet",
96
- OASYS_MAINNET = "oasys-mainnet",
97
- OASYS_TESTNET = "oasys-testnet",
98
- FINDORA_MAINNET = "findora-mainnet",
99
- FINDORA_FORGE_TESTNET = "findora-forge-testnet",
100
- SX_MAINNET = "sx-mainnet",
101
- OASIS_SAPPHIRE_MAINNET = "oasis-sapphire-mainnet",
102
- OASIS_SAPPHIRE_TESTNET = "oasis-sapphire-testnet",
103
- OPTIMISM_GOERLI = "optimism-goerli",
104
- POLYGON_ZKEVM_MAINNET = "polygon-zkevm-mainnet",
105
- HORIZEN_YUMA_TESTNET = "horizen-yuma-testnet",
106
- CLV_PARACHAIN = "clv-parachain",
107
- ENERGI_MAINNET = "energi-mainnet",
108
- ENERGI_TESTNET = "energi-testnet",
109
- HORIZEN_GOBI_TESTNET = "horizen-gobi-testnet",
110
- ETH_SEPOLIA = "eth-sepolia",
111
- SKALE_NEBULA = "skale-nebula",
112
- SKALE_BATTLEGROUND = "skale-battleground",
113
- AVALANCHE_MELD_TESTNET = "avalanche-meld-testnet",
114
- GUNZILLA_TESTNET = "gunzilla-testnet",
115
- ULTRON_MAINNET = "ultron-mainnet",
116
- ULTRON_TESTNET = "ultron-testnet",
117
- ZORA_MAINNET = "zora-mainnet",
118
- ZORA_GOERLI_TESTNET = "zora-goerli-testnet",
119
- NEON_MAINNET = "neon-mainnet",
120
- AVALANCHE_SHRAPNEL_MAINNET = "avalanche-shrapnel-mainnet",
121
- BASE_MAINNET = "base-mainnet",
122
- MANTLE_MAINNET = "mantle-mainnet",
123
- AVALANCHE_LOCO_LEGENDS_MAINNET = "avalanche-loco-legends-mainnet",
124
- LINEA_MAINNET = "linea-mainnet",
125
- HORIZEN_EON_MAINNET = "horizen-eon-mainnet",
126
- AVALANCHE_NUMBERS = "avalanche-numbers",
127
- AVALANCHE_DOS = "avalanche-dos",
128
- AVALANCHE_STEP_NETWORK = "avalanche-step-network",
129
- AVALANCHE_XPLUS = "avalanche-xplus",
130
- AVALANCHE_XANACHAIN = "avalanche-xanachain",
131
- AVALANCHE_MELD_MAINNET = "avalanche-meld-mainnet",
132
- OPSIDE_PUBLIC_ZKEVM = "opside-public-zkevm",
133
- OPSIDE_LAW_CHAIN = "opside-law-chain",
134
- AVALANCHE_SHRAPNEL_TESTNET = "avalanche-shrapnel-testnet",
135
- AVALANCHE_LOCO_LEGENDS_TESTNET = "avalanche-loco-legends-testnet",
136
- OPSIDE_CB_ZKEVM = "opside-cb-zkevm",
137
- OPSIDE_PRE_ALPHA_TESTNET = "opside-pre-alpha-testnet",
138
- OPSIDE_ERA7 = "opside-era7",
139
- OPSIDE_XTHRILL = "opside-xthrill",
140
- ZKSYNC_MAINNET = "zksync-mainnet",
141
- METIS_TESTNET = "metis-testnet",
142
- ZKSYNC_TESTNET = "zksync-testnet",
143
- AVALANCHE_BLITZ_TESTNET = "avalanche-blitz-testnet",
144
- AVALANCHE_D_CHAIN_TESTNET = "avalanche-d-chain-testnet",
145
- AVALANCHE_GREEN_DOT_TESTNET = "avalanche-green-dot-testnet",
146
- AVALANCHE_MINTARA_TESTNET = "avalanche-mintara-testnet",
147
- AVALANCHE_BEAM_TESTNET = "avalanche-beam-testnet",
148
- BNB_META_APES_MAINNET = "bnb-meta-apes-mainnet",
149
- BNB_ANTIMATTER_MAINNET = "bnb-antimatter-mainnet",
150
- BNB_ANTIMATTER_TESTNET = "bnb-antimatter-testnet",
151
- BNB_OPBNB_TESTNET = "bnb-opbnb-testnet",
152
- OPSIDE_DEBOX = "opside-debox",
153
- OPSIDE_JACKBOT = "opside-jackbot",
154
- OPSIDE_ODX_ZKEVM_TESTNET = "opside-odx-zkevm-testnet",
155
- OPSIDE_READON_CONTENT_TESTNET = "opside-readon-content-testnet",
156
- OPSIDE_RELATION = "opside-relation",
157
- OPSIDE_SOQUEST_ZKEVM = "opside-soquest-zkevm",
158
- OPSIDE_VIP3 = "opside-vip3",
159
- OPSIDE_ZKMETA = "opside-zkmeta",
160
- AVALANCHE_PULSAR_TESTNET = "avalanche-pulsar-testnet",
161
- AVALANCHE_UPTN = "avalanche-uptn",
162
- BNB_FNCY_MAINNET = "bnb-fncy-mainnet",
163
- ZETACHAIN_TESTNET = "zetachain-testnet",
164
- KINTO_TESTNET = "kinto-testnet",
165
- MODE_TESTNET = "mode-testnet",
166
- LOOT_MAINNET = "loot-mainnet",
167
- BNB_FNCY_TESTNET = "bnb-fncy-testnet",
168
- MANTA_TESTNET = "manta-testnet",
169
- PGN_MAINNET = "pgn-mainnet",
170
- PGN_TESTNET = "pgn-testnet",
171
- GNOSIS_MAINNET = "gnosis-mainnet",
172
- GNOSIS_TESTNET = "gnosis-testnet",
173
- ROLLUX_MAINNET = "rollux-mainnet",
174
- ROLLUX_TESTNET = "rollux-testnet",
175
- TAIKO_JOLNIR_TESTNET = "taiko-jolnir-testnet",
176
- OPTIMISM_SEPOLIA = "optimism-sepolia",
177
- BNB_OPBNB_MAINNET = "bnb-opbnb-mainnet",
178
- TELOS_MAINNET = "telos-mainnet",
179
- TELOS_TESTNET = "telos-testnet",
180
- AVALANCHE_HUBBLE_EXCHANGE_TESTNET = "avalanche-hubble-exchange-testnet",
181
- AVALANCHE_MIHO_TESTNET = "avalanche-miho-testnet",
182
- AVALANCHE_BULLETIN_TESTNET = "avalanche-bulletin-testnet",
183
- AVALANCHE_KIWI_TESTNET = "avalanche-kiwi-testnet",
184
- AVALANCHE_HERO_TESTNET = "avalanche-hero-testnet",
185
- AVALANCHE_AVACLOUD_TESTNET = "avalanche-avacloud-testnet",
186
- AVALANCHE_THIRDWEB_TESTNET = "avalanche-thirdweb-testnet",
187
- AVALANCHE_MONDRIAN_TESTNET = "avalanche-mondrian-testnet",
188
- AVALANCHE_CONDUIT_TESTNET = "avalanche-conduit-testnet",
189
- AVALANCHE_NMAC_TESTNET = "avalanche-nmac-testnet",
190
- AVALANCHE_ORDERLY_TESTNET = "avalanche-orderly-testnet",
191
- AVALANCHE_AMPLIFY_TESTNET = "avalanche-amplify-testnet",
192
- AVALANCHE_MIRAI_TESTNET = "avalanche-mirai-testnet",
193
- AVALANCHE_WAGMI_TESTNET = "avalanche-wagmi-testnet",
194
- AVALANCHE_PLAYA3ULL_TESTNET = "avalanche-playa3ull-testnet",
195
- AVALANCHE_BEAM_MAINNET = "avalanche-beam-mainnet",
196
- SCROLL_MAINNET = "scroll-mainnet",
197
- ETH_HOLESKY = "eth-holesky",
198
- TOMOCHAIN_MAINNET = "tomochain-mainnet",
199
- TOMOCHAIN_TESTNET = "tomochain-testnet",
200
- AVALANCHE_JONO11_TESTNET = "avalanche-jono11-testnet",
201
- BASE_SEPOLIA_TESTNET = "base-sepolia-testnet",
202
- XAI_TESTNET = "xai-testnet",
203
- ARBITRUM_SEPOLIA = "arbitrum-sepolia",
204
- LUMOZ_PUBLIC_ZKSYNC_V2 = "lumoz-public-zksync-v2",
205
- LUMOZ_DECIBLING = "lumoz-decibling",
206
- LUMOZ_STARK_SPORT = "lumoz-stark-sport",
207
- AVALANCHE_LT0_TESTNET = "avalanche-lt0-testnet",
208
- AVALANCHE_LT1_TESTNET = "avalanche-lt1-testnet",
209
- AVALANCHE_LT2_TESTNET = "avalanche-lt2-testnet",
210
- AVALANCHE_LT3_TESTNET = "avalanche-lt3-testnet",
211
- AVALANCHE_LT4_TESTNET = "avalanche-lt4-testnet",
212
- AVALANCHE_LT5_TESTNET = "avalanche-lt5-testnet",
213
- SYNDR_TESTNET = "syndr-testnet",
214
- CROSSFI_EVM_TESTNET = "crossfi-evm-testnet",
215
- CELO_MAINNET = "celo-mainnet",
216
- TAIKO_KATLA_TESTNET = "taiko-katla-testnet",
217
- MOVEMENT_MEVM_TESTNET = "movement-mevm-testnet",
218
- ZORA_SEPOLIA_TESTNET = "zora-sepolia-testnet",
219
- MERLIN_MAINNET = "merlin-mainnet",
220
- MERLIN_TESTNET = "merlin-testnet",
221
- AVALANCHE_HUBBLE_EXCHANGE_MAINNET = "avalanche-hubble-exchange-mainnet",
222
- XAI_MAINNET = "xai-mainnet"
223
- }
@@ -1,12 +0,0 @@
1
- import { Source } from "../services/CovalentClient";
2
- export declare const DEFAULT_BACKOFF_MAX_RETRIES = 5;
3
- export declare const BASE_DELAY_MS = 1000;
4
- export declare class ExponentialBackoff<T> {
5
- private maxRetries;
6
- retryCount: number;
7
- _apiKey: string;
8
- _debug: boolean;
9
- constructor(apiKey: string, debug: boolean, maxRetries?: number);
10
- backOff(url: string, source: Source): Promise<T>;
11
- setNumAttempts(retryCount: number): void;
12
- }
@@ -1,2 +0,0 @@
1
- import { Quote } from "../services/CovalentClient";
2
- export declare const prettifyCurrency: (value: any, decimals?: number, currency?: Quote, ignoreSmallValue?: boolean, ignoreMinus?: boolean, ignoreZero?: boolean) => string;
@@ -1,378 +0,0 @@
1
- import { Pagination, Explorer, ContractMetadata, LogoUrls, NftCollectionAttribute } from "./GenericTypes";
2
- export interface BalancesResponse {
3
- /** * The requested address. */
4
- address: string;
5
- /** * The requested chain ID eg: `1`. */
6
- chain_id: number;
7
- /** * The requested chain name eg: `eth-mainnet`. */
8
- chain_name: string;
9
- /** * The requested quote currency eg: `USD`. */
10
- quote_currency: string;
11
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
12
- updated_at: Date;
13
- /** * List of response items. */
14
- items: BalanceItem[];
15
- }
16
- export interface BalanceItem {
17
- /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
18
- contract_decimals: number;
19
- /** * The string returned by the `name()` method. */
20
- contract_name: string;
21
- /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
22
- contract_ticker_symbol: string;
23
- /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
24
- contract_address: string;
25
- /** * A display-friendly name for the contract. */
26
- contract_display_name: string;
27
- /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
28
- supports_erc: string[];
29
- /** * The contract logo URL. */
30
- logo_url: string;
31
- /** * The contract logo URLs. */
32
- logo_urls: LogoUrls;
33
- /** * The timestamp when the token was transferred. */
34
- last_transferred_at: Date;
35
- /** * Indicates if a token is the chain's native gas token, eg: ETH on Ethereum. */
36
- native_token: boolean;
37
- /** * One of `cryptocurrency`, `stablecoin`, `nft` or `dust`. */
38
- type: string;
39
- /** * Denotes whether the token is suspected spam. */
40
- is_spam: boolean;
41
- /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
42
- balance: bigint | null;
43
- /** * The 24h asset balance. Use `contract_decimals` to scale this balance for display purposes. */
44
- balance_24h: bigint | null;
45
- /** * The exchange rate for the requested quote currency. */
46
- quote_rate: number;
47
- /** * The 24h exchange rate for the requested quote currency. */
48
- quote_rate_24h: number;
49
- /** * The current balance converted to fiat in `quote-currency`. */
50
- quote: number;
51
- /** * The 24h balance converted to fiat in `quote-currency`. */
52
- quote_24h: number;
53
- /** * A prettier version of the quote for rendering purposes. */
54
- pretty_quote: string;
55
- /** * A prettier version of the 24h quote for rendering purposes. */
56
- pretty_quote_24h: string;
57
- /** * The protocol metadata. */
58
- protocol_metadata: ProtocolMetadata;
59
- /** * NFT-specific data. */
60
- nft_data: BalanceNftData[];
61
- }
62
- export interface ProtocolMetadata {
63
- /** * The name of the protocol. */
64
- protocol_name: string;
65
- }
66
- export interface BalanceNftData {
67
- /** * The token's id. */
68
- token_id: bigint | null;
69
- /** * The count of the number of NFTs with this ID. */
70
- token_balance: bigint | null;
71
- /** * External URL for additional metadata. */
72
- token_url: string;
73
- /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
74
- supports_erc: string[];
75
- /** * The latest price value on chain of the token ID. */
76
- token_price_wei: bigint | null;
77
- /** * The latest quote_rate of the token ID denominated in unscaled ETH. */
78
- token_quote_rate_eth: string;
79
- /** * The address of the original owner of this NFT. */
80
- original_owner: string;
81
- external_data: NftExternalDataV1;
82
- /** * The current owner of this NFT. */
83
- owner: string;
84
- /** * The address of the current owner of this NFT. */
85
- owner_address: string;
86
- /** * When set to true, this NFT has been Burned. */
87
- burned: boolean;
88
- }
89
- export interface NftExternalDataV1 {
90
- name: string;
91
- description: string;
92
- image: string;
93
- image_256: string;
94
- image_512: string;
95
- image_1024: string;
96
- animation_url: string;
97
- external_url: string;
98
- attributes: NftCollectionAttribute[];
99
- owner: string;
100
- }
101
- export interface PortfolioResponse {
102
- /** * The requested address. */
103
- address: string;
104
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
105
- updated_at: Date;
106
- /** * The requested quote currency eg: `USD`. */
107
- quote_currency: string;
108
- /** * The requested chain ID eg: `1`. */
109
- chain_id: number;
110
- /** * The requested chain name eg: `eth-mainnet`. */
111
- chain_name: string;
112
- /** * List of response items. */
113
- items: PortfolioItem[];
114
- }
115
- export interface PortfolioItem {
116
- /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
117
- contract_address: string;
118
- /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
119
- contract_decimals: number;
120
- /** * The string returned by the `name()` method. */
121
- contract_name: string;
122
- /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
123
- contract_ticker_symbol: string;
124
- /** * The contract logo URL. */
125
- logo_url: string;
126
- holdings: HoldingItem[];
127
- }
128
- export interface HoldingItem {
129
- /** * The exchange rate for the requested quote currency. */
130
- quote_rate: number;
131
- timestamp: Date;
132
- close: OhlcItem;
133
- high: OhlcItem;
134
- low: OhlcItem;
135
- open: OhlcItem;
136
- }
137
- export interface OhlcItem {
138
- /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
139
- balance: bigint | null;
140
- /** * The current balance converted to fiat in `quote-currency`. */
141
- quote: number;
142
- /** * A prettier version of the quote for rendering purposes. */
143
- pretty_quote: string;
144
- }
145
- export interface Erc20TransfersResponse {
146
- /** * The requested address. */
147
- address: string;
148
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
149
- updated_at: Date;
150
- /** * The requested quote currency eg: `USD`. */
151
- quote_currency: string;
152
- /** * The requested chain ID eg: `1`. */
153
- chain_id: number;
154
- /** * The requested chain name eg: `eth-mainnet`. */
155
- chain_name: string;
156
- /** * List of response items. */
157
- items: BlockTransactionWithContractTransfers[];
158
- /** * Pagination metadata. */
159
- pagination: Pagination;
160
- }
161
- export interface BlockTransactionWithContractTransfers {
162
- /** * The block signed timestamp in UTC. */
163
- block_signed_at: Date;
164
- /** * The height of the block. */
165
- block_height: number;
166
- /** * The hash of the block. Use it to remove transactions from re-org-ed blocks. */
167
- block_hash: string;
168
- /** * The requested transaction hash. */
169
- tx_hash: string;
170
- /** * The offset is the position of the tx in the block. */
171
- tx_offset: number;
172
- /** * Whether or not transaction is successful. */
173
- successful: boolean;
174
- /** * The address of the miner. */
175
- miner_address: string;
176
- /** * The sender's wallet address. */
177
- from_address: string;
178
- /** * The label of `from` address. */
179
- from_address_label: string;
180
- /** * The receiver's wallet address. */
181
- to_address: string;
182
- /** * The label of `to` address. */
183
- to_address_label: string;
184
- /** * The value attached to this tx. */
185
- value: bigint | null;
186
- /** * The value attached in `quote-currency` to this tx. */
187
- value_quote: number;
188
- /** * A prettier version of the quote for rendering purposes. */
189
- pretty_value_quote: string;
190
- /** * The requested chain native gas token metadata. */
191
- gas_metadata: ContractMetadata;
192
- gas_offered: number;
193
- /** * The gas spent for this tx. */
194
- gas_spent: number;
195
- /** * The gas price at the time of this tx. */
196
- gas_price: number;
197
- /** * The transaction's gas_price * gas_spent, denoted in wei. */
198
- fees_paid: bigint | null;
199
- /** * The gas spent in `quote-currency` denomination. */
200
- gas_quote: number;
201
- /** * A prettier version of the quote for rendering purposes. */
202
- pretty_gas_quote: string;
203
- /** * The native gas exchange rate for the requested `quote-currency`. */
204
- gas_quote_rate: number;
205
- transfers: TokenTransferItem[];
206
- }
207
- export interface TokenTransferItem {
208
- /** * The block signed timestamp in UTC. */
209
- block_signed_at: Date;
210
- /** * The requested transaction hash. */
211
- tx_hash: string;
212
- /** * The sender's wallet address. */
213
- from_address: string;
214
- /** * The label of `from` address. */
215
- from_address_label: string;
216
- /** * The receiver's wallet address. */
217
- to_address: string;
218
- /** * The label of `to` address. */
219
- to_address_label: string;
220
- /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
221
- contract_decimals: number;
222
- /** * The string returned by the `name()` method. */
223
- contract_name: string;
224
- /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
225
- contract_ticker_symbol: string;
226
- /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
227
- contract_address: string;
228
- /** * The contract logo URL. */
229
- logo_url: string;
230
- /** * Categorizes token transactions as either `transfer-in` or `transfer-out`, indicating whether tokens are being received or sent from an account. */
231
- transfer_type: string;
232
- /** * The delta attached to this transfer. */
233
- delta: bigint | null;
234
- /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
235
- balance: bigint | null;
236
- /** * The exchange rate for the requested quote currency. */
237
- quote_rate: number;
238
- /** * The current delta converted to fiat in `quote-currency`. */
239
- delta_quote: number;
240
- /** * A prettier version of the quote for rendering purposes. */
241
- pretty_delta_quote: string;
242
- /** * The current balance converted to fiat in `quote-currency`. */
243
- balance_quote: number;
244
- /** * Additional details on which transfer events were invoked. Defaults to `true`. */
245
- method_calls: MethodCallsForTransfers[];
246
- /** * The explorer links for this transaction. */
247
- explorers: Explorer[];
248
- }
249
- export interface MethodCallsForTransfers {
250
- /** * The address of the sender. */
251
- sender_address: string;
252
- method: string;
253
- }
254
- export interface TokenHoldersResponse {
255
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
256
- updated_at: Date;
257
- /** * The requested chain ID eg: `1`. */
258
- chain_id: number;
259
- /** * The requested chain name eg: `eth-mainnet`. */
260
- chain_name: string;
261
- /** * List of response items. */
262
- items: TokenHolder[];
263
- /** * Pagination metadata. */
264
- pagination: Pagination;
265
- }
266
- export interface TokenHolder {
267
- /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
268
- contract_decimals: number;
269
- /** * The string returned by the `name()` method. */
270
- contract_name: string;
271
- /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
272
- contract_ticker_symbol: string;
273
- /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
274
- contract_address: string;
275
- /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
276
- supports_erc: string[];
277
- /** * The contract logo URL. */
278
- logo_url: string;
279
- /** * The requested address. */
280
- address: string;
281
- /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
282
- balance: bigint | null;
283
- /** * Total supply of this token. */
284
- total_supply: bigint | null;
285
- /** * The height of the block. */
286
- block_height: number;
287
- }
288
- export interface HistoricalBalancesResponse {
289
- /** * The requested address. */
290
- address: string;
291
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
292
- updated_at: Date;
293
- /** * The requested quote currency eg: `USD`. */
294
- quote_currency: string;
295
- /** * The requested chain ID eg: `1`. */
296
- chain_id: number;
297
- /** * The requested chain name eg: `eth-mainnet`. */
298
- chain_name: string;
299
- /** * List of response items. */
300
- items: HistoricalBalanceItem[];
301
- }
302
- export interface HistoricalBalanceItem {
303
- /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
304
- contract_decimals: number;
305
- /** * The string returned by the `name()` method. */
306
- contract_name: string;
307
- /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
308
- contract_ticker_symbol: string;
309
- /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
310
- contract_address: string;
311
- /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
312
- supports_erc: string[];
313
- /** * The contract logo URL. */
314
- logo_url: string;
315
- /** * The height of the block. */
316
- block_height: number;
317
- /** * The block height when the token was last transferred. */
318
- last_transferred_block_height: number;
319
- contract_display_name: string;
320
- /** * The timestamp when the token was transferred. */
321
- last_transferred_at: Date;
322
- /** * Indicates if a token is the chain's native gas token, eg: ETH on Ethereum. */
323
- native_token: boolean;
324
- /** * One of `cryptocurrency`, `stablecoin`, `nft` or `dust`. */
325
- type: string;
326
- /** * Denotes whether the token is suspected spam. */
327
- is_spam: boolean;
328
- /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
329
- balance: bigint | null;
330
- /** * The exchange rate for the requested quote currency. */
331
- quote_rate: number;
332
- /** * The current balance converted to fiat in `quote-currency`. */
333
- quote: number;
334
- /** * A prettier version of the quote for rendering purposes. */
335
- pretty_quote: string;
336
- /** * The protocol metadata. */
337
- protocol_metadata: ProtocolMetadata;
338
- /** * NFT-specific data. */
339
- nft_data: BalanceNftData[];
340
- }
341
- export interface TokenBalanceNativeResponse {
342
- /** * The requested address. */
343
- address: string;
344
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
345
- updated_at: Date;
346
- /** * The requested quote currency eg: `USD`. */
347
- quote_currency: string;
348
- /** * The requested chain ID eg: `1`. */
349
- chain_id: number;
350
- /** * The requested chain name eg: `eth-mainnet`. */
351
- chain_name: string;
352
- /** * List of response items. */
353
- items: NativeBalanceItem[];
354
- }
355
- export interface NativeBalanceItem {
356
- /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
357
- contract_decimals: number;
358
- /** * The string returned by the `name()` method. */
359
- contract_name: string;
360
- /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
361
- contract_ticker_symbol: string;
362
- /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
363
- contract_address: string;
364
- /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
365
- supports_erc: string[];
366
- /** * The contract logo URL. */
367
- logo_url: string;
368
- /** * The height of the block. */
369
- block_height: number;
370
- /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
371
- balance: bigint | null;
372
- /** * The exchange rate for the requested quote currency. */
373
- quote_rate: number;
374
- /** * The current balance converted to fiat in `quote-currency`. */
375
- quote: number;
376
- /** * A prettier version of the quote for rendering purposes. */
377
- pretty_quote: string;
378
- }