@covalenthq/client-sdk 1.0.2 → 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,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
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=BalanceServiceTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BalanceServiceTypes.js","sourceRoot":"","sources":["../../../src/util/types/BalanceServiceTypes.ts"],"names":[],"mappings":""}
@@ -1,276 +0,0 @@
1
- import { DecodedItem, LogEvent, Pagination } from "./GenericTypes";
2
- export interface BlockResponse {
3
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
4
- updated_at: Date;
5
- /** * The requested chain ID eg: `1`. */
6
- chain_id: number;
7
- /** * The requested chain name eg: `eth-mainnet`. */
8
- chain_name: string;
9
- /** * List of response items. */
10
- items: Block[];
11
- }
12
- export interface Block {
13
- /** * The hash of the block. */
14
- block_hash: string;
15
- /** * The block signed timestamp in UTC. */
16
- signed_at: Date;
17
- /** * The block height. */
18
- height: number;
19
- /** * The parent block hash. */
20
- block_parent_hash: string;
21
- /** * Extra data written to the block. */
22
- extra_data: string;
23
- /** * The address of the miner. */
24
- miner_address: string;
25
- /** * The associated mining cost. */
26
- mining_cost: number;
27
- /** * The associated gas used. */
28
- gas_used: number;
29
- /** * The associated gas limit. */
30
- gas_limit: number;
31
- /** * The link to the related tx by block endpoint. */
32
- transactions_link: string;
33
- }
34
- export interface ResolvedAddress {
35
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
36
- updated_at: Date;
37
- /** * The requested chain ID eg: `1`. */
38
- chain_id: number;
39
- /** * The requested chain name eg: `eth-mainnet`. */
40
- chain_name: string;
41
- /** * List of response items. */
42
- items: ResolvedAddressItem[];
43
- }
44
- export interface ResolvedAddressItem {
45
- /** * The requested address. */
46
- address: string;
47
- name: string;
48
- }
49
- export interface BlockHeightsResponse {
50
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
51
- updated_at: Date;
52
- /** * The requested chain ID eg: `1`. */
53
- chain_id: number;
54
- /** * The requested chain name eg: `eth-mainnet`. */
55
- chain_name: string;
56
- /** * List of response items. */
57
- items: BlockHeights[];
58
- /** * Pagination metadata. */
59
- pagination: Pagination;
60
- }
61
- export interface BlockHeights {
62
- /** * The hash of the block. */
63
- block_hash: string;
64
- /** * The block signed timestamp in UTC. */
65
- signed_at: Date;
66
- /** * The block height. */
67
- height: number;
68
- /** * The parent block hash. */
69
- block_parent_hash: string;
70
- /** * Extra data written to the block. */
71
- extra_data: string;
72
- /** * The address of the miner. */
73
- miner_address: string;
74
- /** * The associated mining cost. */
75
- mining_cost: number;
76
- /** * The associated gas used. */
77
- gas_used: number;
78
- /** * The associated gas limit. */
79
- gas_limit: number;
80
- /** * The link to the related tx by block endpoint. */
81
- transactions_link: string;
82
- }
83
- export interface GetLogsResponse {
84
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
85
- updated_at: Date;
86
- /** * The requested chain ID eg: `1`. */
87
- chain_id: number;
88
- /** * The requested chain name eg: `eth-mainnet`. */
89
- chain_name: string;
90
- /** * List of response items. */
91
- items: GetLogsEvent[];
92
- }
93
- export interface GetLogsEvent {
94
- /** * The block signed timestamp in UTC. */
95
- block_signed_at: Date;
96
- /** * The height of the block. */
97
- block_height: number;
98
- /** * The hash of the block. */
99
- block_hash: string;
100
- /** * The offset is the position of the tx in the block. */
101
- tx_offset: number;
102
- /** * The offset is the position of the log entry within an event log. */
103
- log_offset: number;
104
- /** * The requested transaction hash. */
105
- tx_hash: string;
106
- /** * The log topics in raw data. */
107
- raw_log_topics: string[];
108
- /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
109
- sender_contract_decimals: number;
110
- /** * The name of the sender. */
111
- sender_name: string;
112
- /** * The ticker symbol for the sender. This field is set by a developer and non-unique across a network. */
113
- sender_contract_ticker_symbol: string;
114
- /** * The address of the sender. */
115
- sender_address: string;
116
- /** * The label of the sender address. */
117
- sender_address_label: string;
118
- /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
119
- supports_erc: string[];
120
- /** * The contract logo URL. */
121
- sender_logo_url: string;
122
- /** * The address of the deployed UniswapV2 like factory contract for this DEX. */
123
- sender_factory_address: string;
124
- /** * The log events in raw. */
125
- raw_log_data: string;
126
- /** * The decoded item. */
127
- decoded: DecodedItem;
128
- }
129
- export interface LogEventsByAddressResponse {
130
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
131
- updated_at: Date;
132
- /** * The requested chain ID eg: `1`. */
133
- chain_id: number;
134
- /** * The requested chain name eg: `eth-mainnet`. */
135
- chain_name: string;
136
- /** * List of response items. */
137
- items: LogEvent[];
138
- /** * Pagination metadata. */
139
- pagination: Pagination;
140
- }
141
- export interface LogEventsByTopicHashResponse {
142
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
143
- updated_at: Date;
144
- /** * The requested chain ID eg: `1`. */
145
- chain_id: number;
146
- /** * The requested chain name eg: `eth-mainnet`. */
147
- chain_name: string;
148
- /** * List of response items. */
149
- items: LogEvent[];
150
- /** * Pagination metadata. */
151
- pagination: Pagination;
152
- }
153
- export interface AllChainsResponse {
154
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
155
- updated_at: Date;
156
- /** * List of response items. */
157
- items: ChainItem[];
158
- }
159
- export interface ChainItem {
160
- /** * The chain name eg: `eth-mainnet`. */
161
- name: string;
162
- /** * The requested chain ID eg: `1`. */
163
- chain_id: string;
164
- /** * True if the chain is a testnet. */
165
- is_testnet: boolean;
166
- /** * Schema name to use for direct SQL. */
167
- db_schema_name: string;
168
- /** * The chains label eg: `Ethereum Mainnet`. */
169
- label: string;
170
- /** * The category label eg: `Ethereum`. */
171
- category_label: string;
172
- /** * A svg logo url for the chain. */
173
- logo_url: string;
174
- /** * A black png logo url for the chain. */
175
- black_logo_url: string;
176
- /** * A white png logo url for the chain. */
177
- white_logo_url: string;
178
- /** * The color theme for the chain. */
179
- color_theme: ColorTheme;
180
- /** * True if the chain is an AppChain. */
181
- is_appchain: boolean;
182
- /** * The ChainItem the appchain is a part of. */
183
- appchain_of: ChainItem;
184
- }
185
- export interface ColorTheme {
186
- /** * The red color code. */
187
- red: number;
188
- /** * The green color code. */
189
- green: number;
190
- /** * The blue color code. */
191
- blue: number;
192
- /** * The alpha color code. */
193
- alpha: number;
194
- /** * The hexadecimal color code. */
195
- hex: string;
196
- /** * The color represented in css rgb() functional notation. */
197
- css_rgb: string;
198
- }
199
- export interface AllChainsStatusResponse {
200
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
201
- updated_at: Date;
202
- /** * List of response items. */
203
- items: ChainStatusItem[];
204
- }
205
- export interface ChainStatusItem {
206
- /** * The chain name eg: `eth-mainnet`. */
207
- name: string;
208
- /** * The requested chain ID eg: `1`. */
209
- chain_id: string;
210
- /** * True if the chain is a testnet. */
211
- is_testnet: boolean;
212
- /** * A svg logo url for the chain. */
213
- logo_url: string;
214
- /** * A black png logo url for the chain. */
215
- black_logo_url: string;
216
- /** * A white png logo url for the chain. */
217
- white_logo_url: string;
218
- /** * True if the chain is an AppChain. */
219
- is_appchain: boolean;
220
- /** * The height of the lastest block available. */
221
- synced_block_height: number;
222
- /** * The signed timestamp of lastest block available. */
223
- synced_blocked_signed_at: Date;
224
- /** * True if the chain has data and ready for querying. */
225
- has_data: boolean;
226
- }
227
- export interface ChainActivityResponse {
228
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
229
- updated_at: Date;
230
- /** * The requested address. */
231
- address: string;
232
- /** * List of response items. */
233
- items: ChainActivityEvent[];
234
- }
235
- export interface ChainActivityEvent extends ChainItem {
236
- /** * The timestamp when the address was last seen on the chain. */
237
- last_seen_at: Date;
238
- }
239
- export interface GasPricesResponse {
240
- /** * The requested chain ID eg: `1`. */
241
- chain_id: number;
242
- /** * The requested chain name eg: `eth-mainnet`. */
243
- chain_name: string;
244
- /** * The requested quote currency eg: `USD`. */
245
- quote_currency: string;
246
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
247
- updated_at: Date;
248
- /** * The requested event type. */
249
- event_type: string;
250
- /** * The exchange rate for the requested quote currency. */
251
- gas_quote_rate: number;
252
- /** * The lowest gas fee for the latest block height. */
253
- base_fee: bigint | null;
254
- /** * List of response items. */
255
- items: PriceItem[];
256
- }
257
- export interface PriceItem {
258
- /** * The average gas price, in WEI, for the time interval. */
259
- gas_price: string;
260
- /** * The average gas spent for the time interval. */
261
- gas_spent: string;
262
- /** * The average gas spent in `quote-currency` denomination for the time interval. */
263
- gas_quote: number;
264
- /** * Other fees, when applicable. For example: OP chain L1 fees. */
265
- other_fees: OtherFees;
266
- /** * The sum of the L1 and L2 gas spent, in quote-currency, for the specified time interval. */
267
- total_gas_quote: number;
268
- /** * A prettier version of the total average gas spent, in quote-currency, for the specified time interval, for rendering purposes. */
269
- pretty_total_gas_quote: string;
270
- /** * The specified time interval. */
271
- interval: string;
272
- }
273
- export interface OtherFees {
274
- /** * The calculated L1 gas spent, when applicable, in quote-currency, for the specified time interval. */
275
- l1_gas_quote: number;
276
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=BaseServiceTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseServiceTypes.js","sourceRoot":"","sources":["../../../src/util/types/BaseServiceTypes.ts"],"names":[],"mappings":""}