@covalenthq/client-sdk 0.2.8 → 0.4.2

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 (117) hide show
  1. package/README.md +64 -14
  2. package/dist/cjs/index.d.ts +9 -0
  3. package/dist/cjs/index.js +4619 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/dist/cjs/services/BalanceService.d.ts +443 -0
  6. package/dist/cjs/services/BaseService.d.ts +357 -0
  7. package/dist/cjs/services/CovalentClient.d.ts +65 -0
  8. package/dist/cjs/services/NftService.d.ts +484 -0
  9. package/dist/cjs/services/PricingService.d.ts +88 -0
  10. package/dist/cjs/services/SecurityService.d.ts +96 -0
  11. package/dist/cjs/services/TransactionService.d.ts +440 -0
  12. package/dist/cjs/services/XykService.d.ts +682 -0
  13. package/dist/cjs/util/ApiHelpers.d.ts +5 -0
  14. package/dist/cjs/util/backoff.d.ts +11 -0
  15. package/dist/cjs/util/types/BalanceServiceTypes.d.ts +284 -0
  16. package/dist/cjs/util/types/BaseServiceTypes.d.ts +180 -0
  17. package/dist/cjs/util/types/GenericTypes.d.ts +96 -0
  18. package/dist/cjs/util/types/NftServiceTypes.d.ts +221 -0
  19. package/dist/cjs/util/types/PricingServiceTypes.d.ts +31 -0
  20. package/dist/cjs/util/types/SecurityServiceTypes.d.ts +71 -0
  21. package/dist/cjs/util/types/TransactionServiceTypes.d.ts +312 -0
  22. package/dist/cjs/util/types/XykServiceTypes.d.ts +479 -0
  23. package/dist/es/index.d.ts +9 -0
  24. package/dist/es/index.js +4616 -0
  25. package/dist/es/index.js.map +1 -0
  26. package/dist/es/services/BalanceService.d.ts +443 -0
  27. package/dist/es/services/BaseService.d.ts +357 -0
  28. package/dist/es/services/CovalentClient.d.ts +65 -0
  29. package/dist/es/services/NftService.d.ts +484 -0
  30. package/dist/es/services/PricingService.d.ts +88 -0
  31. package/dist/es/services/SecurityService.d.ts +96 -0
  32. package/dist/es/services/TransactionService.d.ts +440 -0
  33. package/dist/es/services/XykService.d.ts +682 -0
  34. package/dist/es/util/ApiHelpers.d.ts +5 -0
  35. package/dist/es/util/backoff.d.ts +11 -0
  36. package/dist/es/util/types/BalanceServiceTypes.d.ts +284 -0
  37. package/dist/es/util/types/BaseServiceTypes.d.ts +180 -0
  38. package/dist/es/util/types/GenericTypes.d.ts +96 -0
  39. package/dist/es/util/types/NftServiceTypes.d.ts +221 -0
  40. package/dist/es/util/types/PricingServiceTypes.d.ts +31 -0
  41. package/dist/es/util/types/SecurityServiceTypes.d.ts +71 -0
  42. package/dist/es/util/types/TransactionServiceTypes.d.ts +312 -0
  43. package/dist/es/util/types/XykServiceTypes.d.ts +479 -0
  44. package/dist/esm/index.d.ts +9 -0
  45. package/dist/esm/index.js +4616 -0
  46. package/dist/esm/index.js.map +1 -0
  47. package/dist/esm/services/BalanceService.d.ts +443 -0
  48. package/dist/esm/services/BaseService.d.ts +357 -0
  49. package/dist/esm/services/CovalentClient.d.ts +65 -0
  50. package/dist/esm/services/NftService.d.ts +484 -0
  51. package/dist/esm/services/PricingService.d.ts +88 -0
  52. package/dist/esm/services/SecurityService.d.ts +96 -0
  53. package/dist/esm/services/TransactionService.d.ts +440 -0
  54. package/dist/esm/services/XykService.d.ts +682 -0
  55. package/dist/esm/util/ApiHelpers.d.ts +5 -0
  56. package/dist/esm/util/backoff.d.ts +11 -0
  57. package/dist/esm/util/types/BalanceServiceTypes.d.ts +284 -0
  58. package/dist/esm/util/types/BaseServiceTypes.d.ts +180 -0
  59. package/dist/esm/util/types/GenericTypes.d.ts +96 -0
  60. package/dist/esm/util/types/NftServiceTypes.d.ts +221 -0
  61. package/dist/esm/util/types/PricingServiceTypes.d.ts +31 -0
  62. package/dist/esm/util/types/SecurityServiceTypes.d.ts +71 -0
  63. package/dist/esm/util/types/TransactionServiceTypes.d.ts +312 -0
  64. package/dist/esm/util/types/XykServiceTypes.d.ts +479 -0
  65. package/dist/index.d.ts +3 -3
  66. package/dist/index.js +9 -27
  67. package/dist/index.js.map +1 -1
  68. package/dist/services/BalanceService.d.ts +49 -11
  69. package/dist/services/BalanceService.js +110 -81
  70. package/dist/services/BalanceService.js.map +1 -1
  71. package/dist/services/BaseService.d.ts +46 -10
  72. package/dist/services/BaseService.js +193 -145
  73. package/dist/services/BaseService.js.map +1 -1
  74. package/dist/services/CovalentClient.d.ts +65 -0
  75. package/dist/services/CovalentClient.js +44 -0
  76. package/dist/services/CovalentClient.js.map +1 -0
  77. package/dist/services/NftService.d.ts +52 -22
  78. package/dist/services/NftService.js +236 -235
  79. package/dist/services/NftService.js.map +1 -1
  80. package/dist/services/PricingService.d.ts +8 -3
  81. package/dist/services/PricingService.js +43 -37
  82. package/dist/services/PricingService.js.map +1 -1
  83. package/dist/services/SecurityService.d.ts +9 -3
  84. package/dist/services/SecurityService.js +38 -31
  85. package/dist/services/SecurityService.js.map +1 -1
  86. package/dist/services/TransactionService.d.ts +41 -9
  87. package/dist/services/TransactionService.js +133 -100
  88. package/dist/services/TransactionService.js.map +1 -1
  89. package/dist/services/XykService.d.ts +81 -19
  90. package/dist/services/XykService.js +451 -278
  91. package/dist/services/XykService.js.map +1 -1
  92. package/dist/util/ApiHelpers.d.ts +2 -1
  93. package/dist/util/ApiHelpers.js +57 -36
  94. package/dist/util/ApiHelpers.js.map +1 -1
  95. package/dist/util/backoff.d.ts +5 -3
  96. package/dist/util/backoff.js +35 -13
  97. package/dist/util/backoff.js.map +1 -1
  98. package/dist/util/types/BalanceServiceTypes.d.ts +25 -0
  99. package/dist/util/types/BalanceServiceTypes.js +1 -2
  100. package/dist/util/types/BaseServiceTypes.d.ts +8 -0
  101. package/dist/util/types/BaseServiceTypes.js +1 -2
  102. package/dist/util/types/GenericTypes.d.ts +21 -0
  103. package/dist/util/types/GenericTypes.js +1 -2
  104. package/dist/util/types/NftServiceTypes.d.ts +10 -2
  105. package/dist/util/types/NftServiceTypes.js +1 -2
  106. package/dist/util/types/PricingServiceTypes.d.ts +1 -14
  107. package/dist/util/types/PricingServiceTypes.js +1 -2
  108. package/dist/util/types/SecurityServiceTypes.d.ts +1 -0
  109. package/dist/util/types/SecurityServiceTypes.js +1 -2
  110. package/dist/util/types/TransactionServiceTypes.d.ts +15 -17
  111. package/dist/util/types/TransactionServiceTypes.js +1 -2
  112. package/dist/util/types/XykServiceTypes.d.ts +20 -6
  113. package/dist/util/types/XykServiceTypes.js +1 -2
  114. package/package.json +19 -4
  115. package/dist/services/Client.d.ts +0 -29
  116. package/dist/services/Client.js +0 -30
  117. package/dist/services/Client.js.map +0 -1
@@ -0,0 +1,11 @@
1
+ export declare const DEFAULT_BACKOFF_MAX_RETRIES = 5;
2
+ export declare const BASE_DELAY_MS = 1000;
3
+ export declare class ExponentialBackoff<T> {
4
+ private maxRetries;
5
+ retryCount: number;
6
+ _apiKey: string;
7
+ _debug: boolean;
8
+ constructor(apiKey: string, debug: boolean, maxRetries?: number);
9
+ backOff(url: string): Promise<T>;
10
+ setNumAttempts(retryCount: number): void;
11
+ }
@@ -0,0 +1,284 @@
1
+ import { NftData, Pagination } 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 list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
26
+ supports_erc: string;
27
+ /** * The contract logo URL. */
28
+ logo_url: string;
29
+ /** * The timestamp when the token was transferred. */
30
+ last_transferred_at: Date;
31
+ /** * Indicates if a token is the chain's native gas token, eg: ETH on Ethereum. */
32
+ native_token: boolean;
33
+ /** * One of `cryptocurrency`, `stablecoin`, `nft` or `dust`. */
34
+ type: string;
35
+ /** * Denotes whether the token is suspected spam. */
36
+ is_spam: boolean;
37
+ /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
38
+ balance: bigint | null;
39
+ /** * The 24h asset balance. Use `contract_decimals` to scale this balance for display purposes. */
40
+ balance_24h: bigint | null;
41
+ /** * The exchange rate for the requested quote currency. */
42
+ quote_rate: number;
43
+ /** * The 24h exchange rate for the requested quote currency. */
44
+ quote_rate_24h: number;
45
+ /** * The current balance converted to fiat in `quote-currency`. */
46
+ quote: number;
47
+ /** * The 24h balance converted to fiat in `quote-currency`. */
48
+ quote_24h: number;
49
+ /** * A prettier version of the quote for rendering purposes. */
50
+ pretty_quote: string;
51
+ /** * A prettier version of the 24h quote for rendering purposes. */
52
+ pretty_quote_24h: string;
53
+ /** * NFT-specific data. */
54
+ nft_data: NftData[];
55
+ }
56
+ export interface PortfolioResponse {
57
+ /** * The requested address. */
58
+ address: string;
59
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
60
+ updated_at: Date;
61
+ /** * The requested quote currency eg: `USD`. */
62
+ quote_currency: string;
63
+ /** * The requested chain ID eg: `1`. */
64
+ chain_id: number;
65
+ /** * The requested chain name eg: `eth-mainnet`. */
66
+ chain_name: string;
67
+ /** * List of response items. */
68
+ items: PortfolioItem[];
69
+ }
70
+ export interface PortfolioItem {
71
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
72
+ contract_address: string;
73
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
74
+ contract_decimals: number;
75
+ /** * The string returned by the `name()` method. */
76
+ contract_name: string;
77
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
78
+ contract_ticker_symbol: string;
79
+ /** * The contract logo URL. */
80
+ logo_url: string;
81
+ holdings: HoldingItem[];
82
+ }
83
+ export interface HoldingItem {
84
+ /** * The exchange rate for the requested quote currency. */
85
+ quote_rate: number;
86
+ timestamp: Date;
87
+ close: OhlcItem;
88
+ high: OhlcItem;
89
+ low: OhlcItem;
90
+ open: OhlcItem;
91
+ }
92
+ export interface OhlcItem {
93
+ /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
94
+ balance: bigint | null;
95
+ /** * The current balance converted to fiat in `quote-currency`. */
96
+ quote: number;
97
+ /** * A prettier version of the quote for rendering purposes. */
98
+ pretty_quote: string;
99
+ }
100
+ export interface Erc20TransfersResponse {
101
+ /** * The requested address. */
102
+ address: string;
103
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
104
+ updated_at: Date;
105
+ /** * The requested quote currency eg: `USD`. */
106
+ quote_currency: string;
107
+ /** * The requested chain ID eg: `1`. */
108
+ chain_id: number;
109
+ /** * The requested chain name eg: `eth-mainnet`. */
110
+ chain_name: string;
111
+ /** * List of response items. */
112
+ items: BlockTransactionWithContractTransfers[];
113
+ /** * Pagination metadata. */
114
+ pagination: Pagination;
115
+ }
116
+ export interface BlockTransactionWithContractTransfers {
117
+ /** * The block signed timestamp in UTC. */
118
+ block_signed_at: Date;
119
+ /** * The height of the block. */
120
+ block_height: number;
121
+ /** * The requested transaction hash. */
122
+ tx_hash: string;
123
+ /** * The offset is the position of the tx in the block. */
124
+ tx_offset: number;
125
+ /** * Whether or not transaction is successful. */
126
+ successful: boolean;
127
+ /** * The sender's wallet address. */
128
+ from_address: string;
129
+ /** * The label of `from` address. */
130
+ from_address_label: string;
131
+ /** * The receiver's wallet address. */
132
+ to_address: string;
133
+ /** * The label of `to` address. */
134
+ to_address_label: string;
135
+ /** * The value attached to this tx. */
136
+ value: bigint | null;
137
+ /** * The value attached in `quote-currency` to this tx. */
138
+ value_quote: number;
139
+ /** * A prettier version of the quote for rendering purposes. */
140
+ pretty_value_quote: string;
141
+ gas_offered: number;
142
+ /** * The gas spent for this tx. */
143
+ gas_spent: number;
144
+ /** * The gas price at the time of this tx. */
145
+ gas_price: number;
146
+ /** * The transaction's gas_price * gas_spent, denoted in wei. */
147
+ fees_paid: bigint | null;
148
+ /** * The gas spent in `quote-currency` denomination. */
149
+ gas_quote: number;
150
+ /** * A prettier version of the quote for rendering purposes. */
151
+ pretty_gas_quote: string;
152
+ /** * The native gas exchange rate for the requested `quote-currency`. */
153
+ gas_quote_rate: number;
154
+ transfers: TokenTransferItem[];
155
+ }
156
+ export interface TokenTransferItem {
157
+ /** * The block signed timestamp in UTC. */
158
+ block_signed_at: Date;
159
+ /** * The requested transaction hash. */
160
+ tx_hash: string;
161
+ /** * The sender's wallet address. */
162
+ from_address: string;
163
+ /** * The label of `from` address. */
164
+ from_address_label: string;
165
+ /** * The receiver's wallet address. */
166
+ to_address: string;
167
+ /** * The label of `to` address. */
168
+ to_address_label: string;
169
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
170
+ contract_decimals: number;
171
+ /** * The string returned by the `name()` method. */
172
+ contract_name: string;
173
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
174
+ contract_ticker_symbol: string;
175
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
176
+ contract_address: string;
177
+ /** * The contract logo URL. */
178
+ logo_url: string;
179
+ /** * Categorizes token transactions as either `transfer-in` or `transfer-out`, indicating whether tokens are being received or sent from an account. */
180
+ transfer_type: string;
181
+ /** * The delta attached to this transfer. */
182
+ delta: bigint | null;
183
+ /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
184
+ balance: bigint | null;
185
+ /** * The exchange rate for the requested quote currency. */
186
+ quote_rate: number;
187
+ /** * The current delta converted to fiat in `quote-currency`. */
188
+ delta_quote: number;
189
+ /** * A prettier version of the quote for rendering purposes. */
190
+ pretty_delta_quote: string;
191
+ /** * The current balance converted to fiat in `quote-currency`. */
192
+ balance_quote: number;
193
+ /** * Additional details on which transfer events were invoked. Defaults to `true`. */
194
+ method_calls: MethodCallsForTransfers[];
195
+ }
196
+ export interface MethodCallsForTransfers {
197
+ /** * The address of the sender. */
198
+ sender_address: string;
199
+ method: string;
200
+ }
201
+ export interface TokenHoldersResponse {
202
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
203
+ updated_at: Date;
204
+ /** * The requested chain ID eg: `1`. */
205
+ chain_id: number;
206
+ /** * The requested chain name eg: `eth-mainnet`. */
207
+ chain_name: string;
208
+ /** * List of response items. */
209
+ items: TokenHolder[];
210
+ /** * Pagination metadata. */
211
+ pagination: Pagination;
212
+ }
213
+ export interface TokenHolder {
214
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
215
+ contract_decimals: number;
216
+ /** * The string returned by the `name()` method. */
217
+ contract_name: string;
218
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
219
+ contract_ticker_symbol: string;
220
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
221
+ contract_address: string;
222
+ /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
223
+ supports_erc: string;
224
+ /** * The contract logo URL. */
225
+ logo_url: string;
226
+ /** * The requested address. */
227
+ address: string;
228
+ /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
229
+ balance: bigint | null;
230
+ /** * Total supply of this token. */
231
+ total_supply: bigint | null;
232
+ /** * The height of the block. */
233
+ block_height: number;
234
+ }
235
+ export interface HistoricalBalancesResponse {
236
+ /** * The requested address. */
237
+ address: string;
238
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
239
+ updated_at: Date;
240
+ /** * The requested quote currency eg: `USD`. */
241
+ quote_currency: string;
242
+ /** * The requested chain ID eg: `1`. */
243
+ chain_id: number;
244
+ /** * The requested chain name eg: `eth-mainnet`. */
245
+ chain_name: string;
246
+ /** * List of response items. */
247
+ items: HistoricalBalanceItem[];
248
+ }
249
+ export interface HistoricalBalanceItem {
250
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
251
+ contract_decimals: number;
252
+ /** * The string returned by the `name()` method. */
253
+ contract_name: string;
254
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
255
+ contract_ticker_symbol: string;
256
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
257
+ contract_address: string;
258
+ /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
259
+ supports_erc: string;
260
+ /** * The contract logo URL. */
261
+ logo_url: string;
262
+ /** * The height of the block. */
263
+ block_height: number;
264
+ /** * The block height when the token was last transferred. */
265
+ last_transferred_block_height: number;
266
+ /** * The timestamp when the token was transferred. */
267
+ last_transferred_at: Date;
268
+ /** * Indicates if a token is the chain's native gas token, eg: ETH on Ethereum. */
269
+ native_token: boolean;
270
+ /** * One of `cryptocurrency`, `stablecoin`, `nft` or `dust`. */
271
+ type: string;
272
+ /** * Denotes whether the token is suspected spam. */
273
+ is_spam: boolean;
274
+ /** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
275
+ balance: bigint | null;
276
+ /** * The exchange rate for the requested quote currency. */
277
+ quote_rate: number;
278
+ /** * The current balance converted to fiat in `quote-currency`. */
279
+ quote: number;
280
+ /** * A prettier version of the quote for rendering purposes. */
281
+ pretty_quote: string;
282
+ /** * NFT-specific data. */
283
+ nft_data: NftData[];
284
+ }
@@ -0,0 +1,180 @@
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 block signed timestamp in UTC. */
14
+ signed_at: Date;
15
+ /** * The block height. */
16
+ height: number;
17
+ }
18
+ export interface ResolvedAddress {
19
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
20
+ updated_at: Date;
21
+ /** * The requested chain ID eg: `1`. */
22
+ chain_id: number;
23
+ /** * The requested chain name eg: `eth-mainnet`. */
24
+ chain_name: string;
25
+ /** * List of response items. */
26
+ items: ResolvedAddressItem[];
27
+ }
28
+ export interface ResolvedAddressItem {
29
+ /** * The requested address. */
30
+ address: string;
31
+ name: string;
32
+ }
33
+ export interface BlockHeightsResponse {
34
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
35
+ updated_at: Date;
36
+ /** * The requested chain ID eg: `1`. */
37
+ chain_id: number;
38
+ /** * The requested chain name eg: `eth-mainnet`. */
39
+ chain_name: string;
40
+ /** * List of response items. */
41
+ items: Block[];
42
+ /** * Pagination metadata. */
43
+ pagination: Pagination;
44
+ }
45
+ export interface GetLogsResponse {
46
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
47
+ updated_at: Date;
48
+ /** * The requested chain ID eg: `1`. */
49
+ chain_id: number;
50
+ /** * The requested chain name eg: `eth-mainnet`. */
51
+ chain_name: string;
52
+ /** * List of response items. */
53
+ items: GetLogsEvent[];
54
+ }
55
+ export interface GetLogsEvent {
56
+ /** * The block signed timestamp in UTC. */
57
+ block_signed_at: Date;
58
+ /** * The height of the block. */
59
+ block_height: number;
60
+ /** * The hash of the block. */
61
+ block_hash: string;
62
+ /** * The offset is the position of the tx in the block. */
63
+ tx_offset: number;
64
+ /** * The offset is the position of the log entry within an event log. */
65
+ log_offset: number;
66
+ /** * The requested transaction hash. */
67
+ tx_hash: string;
68
+ /** * The log topics in raw data. */
69
+ raw_log_topics: string;
70
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
71
+ sender_contract_decimals: number;
72
+ /** * The name of the sender. */
73
+ sender_name: string;
74
+ /** * The ticker symbol for the sender. This field is set by a developer and non-unique across a network. */
75
+ sender_contract_ticker_symbol: string;
76
+ /** * The address of the sender. */
77
+ sender_address: string;
78
+ /** * The label of the sender address. */
79
+ sender_address_label: string;
80
+ /** * The contract logo URL. */
81
+ sender_logo_url: string;
82
+ /** * The log events in raw. */
83
+ raw_log_data: string;
84
+ /** * The decoded item. */
85
+ decoded: DecodedItem;
86
+ }
87
+ export interface LogEventsByAddressResponse {
88
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
89
+ updated_at: Date;
90
+ /** * The requested chain ID eg: `1`. */
91
+ chain_id: number;
92
+ /** * The requested chain name eg: `eth-mainnet`. */
93
+ chain_name: string;
94
+ /** * List of response items. */
95
+ items: LogEvent[];
96
+ /** * Pagination metadata. */
97
+ pagination: Pagination;
98
+ }
99
+ export interface LogEventsByTopicHashResponse {
100
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
101
+ updated_at: Date;
102
+ /** * The requested chain ID eg: `1`. */
103
+ chain_id: number;
104
+ /** * The requested chain name eg: `eth-mainnet`. */
105
+ chain_name: string;
106
+ /** * List of response items. */
107
+ items: LogEvent[];
108
+ /** * Pagination metadata. */
109
+ pagination: Pagination;
110
+ }
111
+ export interface AllChainsResponse {
112
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
113
+ updated_at: Date;
114
+ /** * List of response items. */
115
+ items: ChainItem[];
116
+ }
117
+ export interface ChainItem {
118
+ /** * The chain name eg: `eth-mainnet`. */
119
+ name: string;
120
+ /** * The requested chain ID eg: `1`. */
121
+ chain_id: string;
122
+ /** * True if the chain is a testnet. */
123
+ is_testnet: boolean;
124
+ /** * Schema name to use for direct SQL. */
125
+ db_schema_name: string;
126
+ /** * The chains label eg: `Ethereum Mainnet`. */
127
+ label: string;
128
+ /** * The category label eg: `Ethereum`. */
129
+ category_label: string;
130
+ /** * A svg logo url for the chain. */
131
+ logo_url: string;
132
+ /** * A black png logo url for the chain. */
133
+ black_logo_url: string;
134
+ /** * A white png logo url for the chain. */
135
+ white_logo_url: string;
136
+ /** * True if the chain is an AppChain. */
137
+ is_appchain: boolean;
138
+ /** * The ChainItem the appchain is a part of. */
139
+ appchain_of: ChainItem;
140
+ }
141
+ export interface AllChainsStatusResponse {
142
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
143
+ updated_at: Date;
144
+ /** * List of response items. */
145
+ items: ChainStatusItem[];
146
+ }
147
+ export interface ChainStatusItem {
148
+ /** * The chain name eg: `eth-mainnet`. */
149
+ name: string;
150
+ /** * The requested chain ID eg: `1`. */
151
+ chain_id: string;
152
+ /** * True if the chain is a testnet. */
153
+ is_testnet: boolean;
154
+ /** * A svg logo url for the chain. */
155
+ logo_url: boolean;
156
+ /** * A black png logo url for the chain. */
157
+ black_logo_url: string;
158
+ /** * A white png logo url for the chain. */
159
+ white_logo_url: string;
160
+ /** * True if the chain is an AppChain. */
161
+ is_appchain: boolean;
162
+ /** * The height of the lastest block available. */
163
+ synced_block_height: number;
164
+ /** * The signed timestamp of lastest block available. */
165
+ synced_blocked_signed_at: Date;
166
+ /** * True if the chain has data and ready for querying. */
167
+ has_data: boolean;
168
+ }
169
+ export interface ChainActivityResponse {
170
+ /** * The timestamp when the response was generated. Useful to show data staleness to users. */
171
+ updated_at: Date;
172
+ /** * The requested address. */
173
+ address: string;
174
+ /** * List of response items. */
175
+ items: ChainActivityEvent[];
176
+ }
177
+ export interface ChainActivityEvent extends ChainItem {
178
+ /** * The timestamp when the address was last seen on the chain. */
179
+ last_seen_at: Date;
180
+ }
@@ -0,0 +1,96 @@
1
+ export interface Pagination {
2
+ /** * True is there is another page. */
3
+ has_more: boolean;
4
+ /** * The requested page number. */
5
+ page_number: number;
6
+ /** * The requested number of items on the current page. */
7
+ page_size: number;
8
+ /** * The total number of items across all pages for this request. */
9
+ total_count: number;
10
+ }
11
+ export interface NftCollectionAttribute {
12
+ trait_type: string;
13
+ value: string;
14
+ }
15
+ export interface NftData {
16
+ /** * The token's id. */
17
+ token_id: bigint | null;
18
+ token_url: string;
19
+ /** * The original minter. */
20
+ original_owner: string;
21
+ external_data: NftExternalData;
22
+ /** * If `true`, the asset data is available from the Covalent CDN. */
23
+ asset_cached: boolean;
24
+ /** * If `true`, the image data is available from the Covalent CDN. */
25
+ image_cached: boolean;
26
+ }
27
+ export interface NftExternalData {
28
+ name: string;
29
+ description: string;
30
+ asset_url: string;
31
+ asset_file_extension: string;
32
+ asset_mime_type: string;
33
+ asset_size_bytes: string;
34
+ image: string;
35
+ image_256: string;
36
+ image_512: string;
37
+ image_1024: string;
38
+ animation_url: string;
39
+ external_url: string;
40
+ attributes: NftCollectionAttribute[];
41
+ }
42
+ export interface DecodedItem {
43
+ name: string;
44
+ signature: string;
45
+ params: Param[];
46
+ }
47
+ export interface Param {
48
+ name: string;
49
+ type: string;
50
+ indexed: boolean;
51
+ decoded: boolean;
52
+ value: string;
53
+ }
54
+ export interface LogEvent {
55
+ /** * The block signed timestamp in UTC. */
56
+ block_signed_at: Date;
57
+ /** * The height of the block. */
58
+ block_height: number;
59
+ /** * The offset is the position of the tx in the block. */
60
+ tx_offset: number;
61
+ /** * The offset is the position of the log entry within an event log. */
62
+ log_offset: number;
63
+ /** * The requested transaction hash. */
64
+ tx_hash: string;
65
+ /** * The log topics in raw data. */
66
+ raw_log_topics: string;
67
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
68
+ sender_contract_decimals: number;
69
+ /** * The name of the sender. */
70
+ sender_name: string;
71
+ sender_contract_ticker_symbol: string;
72
+ /** * The address of the sender. */
73
+ sender_address: string;
74
+ /** * The label of the sender address. */
75
+ sender_address_label: string;
76
+ /** * The contract logo URL. */
77
+ sender_logo_url: string;
78
+ /** * The log events in raw. */
79
+ raw_log_data: string;
80
+ /** * The decoded item. */
81
+ decoded: DecodedItem;
82
+ }
83
+ export interface ContractMetadata {
84
+ /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
85
+ contract_decimals: number;
86
+ /** * The string returned by the `name()` method. */
87
+ contract_name: string;
88
+ /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
89
+ contract_ticker_symbol: string;
90
+ /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
91
+ contract_address: string;
92
+ /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
93
+ supports_erc: string;
94
+ /** * The contract logo URL. */
95
+ logo_url: string;
96
+ }