@covalenthq/client-sdk 2.2.3 → 2.2.4

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.
@@ -56,79 +56,16 @@ export type Transaction = Nullable<{
56
56
  gas_quote_rate: number;
57
57
  /** * The explorer links for this transaction. */
58
58
  explorers: Explorer[];
59
- /** * The details for the dex transaction. */
60
- dex_details: DexReport[];
61
59
  /** * The details for the NFT sale transaction. */
62
60
  nft_sale_details: NftSalesReport[];
63
- /** * The details for the lending protocol transaction. */
64
- lending_details: LendingReport[];
65
61
  /** * The log events. */
66
62
  log_events: LogEvent[];
67
- /** * The details related to the safe transaction. */
68
- safe_details: SafeDetails[];
69
- }>;
70
- export type DexReport = Nullable<{
71
- /** * The offset is the position of the log entry within an event log. */
72
- log_offset: number;
73
- /** * Stores the name of the protocol that facilitated the event. */
74
- protocol_name: string;
75
- /** * Stores the contract address of the protocol that facilitated the event. */
76
- protocol_address: string;
77
- /** * The protocol logo URL. */
78
- protocol_logo_url: string;
79
- /** * Stores the aggregator responsible for the event. */
80
- aggregator_name: string;
81
- /** * Stores the contract address of the aggregator responsible for the event. */
82
- aggregator_address: string;
83
- /** * DEXs often have multiple version - e.g Uniswap V1, V2 and V3. The `version` field allows you to look at a specific version of the DEX. */
84
- version: number;
85
- /** * Similarly to the `version` field, `fork_version` gives you the version of the forked DEX. For example, most DEXs are a fork of Uniswap V2; therefore, `fork` = `aave` & `fork_version` = `2` */
86
- fork_version: number;
87
- /** * Many DEXs are a fork of an already established DEX. The fork field allows you to see which DEX has been forked. */
88
- fork: string;
89
- /** * Stores the event taking place - e.g `swap`, `add_liquidity` and `remove_liquidity`. */
90
- event: string;
91
- /** * Stores the address of the pair that the user interacts with. */
92
- pair_address: string;
93
- pair_lp_fee_bps: number;
94
- lp_token_address: string;
95
- lp_token_ticker: string;
96
- lp_token_num_decimals: number;
97
- lp_token_name: string;
98
- lp_token_value: string;
99
- exchange_rate_usd: number;
100
- /** * Stores the address of token 0 in the specific pair. */
101
- token_0_address: string;
102
- /** * Stores the ticker symbol of token 0 in the specific pair. */
103
- token_0_ticker: string;
104
- /** * Stores the number of contract decimals of token 0 in the specific pair. */
105
- token_0_num_decimals: number;
106
- /** * Stores the contract name of token 0 in the specific pair. */
107
- token_0_name: string;
108
- /** * Stores the address of token 1 in the specific pair. */
109
- token_1_address: string;
110
- /** * Stores the ticker symbol of token 1 in the specific pair. */
111
- token_1_ticker: string;
112
- /** * Stores the number of contract decimals of token 1 in the specific pair. */
113
- token_1_num_decimals: number;
114
- /** * Stores the contract name of token 1 in the specific pair. */
115
- token_1_name: string;
116
- /** * Stores the amount of token 0 used in the transaction. For example, 1 ETH, 100 USDC, 30 UNI, etc. */
117
- token_0_amount: string;
118
- token_0_quote_rate: number;
119
- token_0_usd_quote: number;
120
- pretty_token_0_usd_quote: string;
121
- token_0_logo_url: string;
122
- /** * Stores the amount of token 1 used in the transaction. For example, 1 ETH, 100 USDC, 30 UNI, etc. */
123
- token_1_amount: string;
124
- token_1_quote_rate: number;
125
- token_1_usd_quote: number;
126
- pretty_token_1_usd_quote: string;
127
- token_1_logo_url: string;
128
- /** * Stores the wallet address that initiated the transaction (i.e the wallet paying the gas fee). */
129
- sender: string;
130
- /** * Stores the recipient of the transaction - recipients can be other wallets or smart contracts. For example, if you want to Swap tokens on Uniswap, the Uniswap router would typically be the recipient of the transaction. */
131
- recipient: string;
63
+ /** * List of internal transfers/transactions associated with the wallet address. */
64
+ internal_transfers: InternalTransfer[];
65
+ /** * List of state changes with before and after values and balances for involved contract and wallet addresses. */
66
+ state_changes: StateChange[];
67
+ /** * Object with a transaction's input data such as the Method ID. */
68
+ input_data: InputData;
132
69
  }>;
133
70
  export type NftSalesReport = Nullable<{
134
71
  /** * The offset is the position of the log entry within an event log. */
@@ -181,87 +118,6 @@ export type NftSalesReport = Nullable<{
181
118
  trade_type: string;
182
119
  trade_group_type: string;
183
120
  }>;
184
- export type LendingReport = Nullable<{
185
- /** * The offset is the position of the log entry within an event log. */
186
- log_offset: number;
187
- /** * Stores the name of the lending protocol that facilitated the event. */
188
- protocol_name: string;
189
- /** * Stores the contract address of the lending protocol that facilitated the event. */
190
- protocol_address: string;
191
- /** * The protocol logo URL. */
192
- protocol_logo_url: string;
193
- /** * Lending protocols often have multiple version (e.g. Aave V1, V2 and V3). The `version` field allows you to look at a specific version of the Lending protocol. */
194
- version: string;
195
- /** * Many lending protocols are a fork of an already established protocol. The fork column allows you to see which lending protocol has been forked. */
196
- fork: string;
197
- /** * Similarly to the `version` column, `fork_version` gives you the version of the forked lending protocol. For example, most lending protocols in the space are a fork of Aave V2; therefore, `fork` = `aave` & `fork_version` = `2` */
198
- fork_version: string;
199
- /** * Stores the event taking place - e.g `borrow`, `deposit`, `liquidation`, 'repay' and 'withdraw'. */
200
- event: string;
201
- /** * Stores the name of the LP token issued by the lending protocol. LP tokens can be debt or interest bearing tokens. */
202
- lp_token_name: string;
203
- /** * Stores the number decimal of the LP token. */
204
- lp_decimals: number;
205
- /** * Stores the ticker symbol of the LP token. */
206
- lp_ticker_symbol: string;
207
- /** * Stores the token address of the LP token. */
208
- lp_token_address: string;
209
- /** * Stores the amount of LP token used in the event (e.g. 1 aETH, 100 cUSDC, etc). */
210
- lp_token_amount: number;
211
- /** * Stores the total USD amount of all the LP Token used in the event. */
212
- lp_token_price: number;
213
- /** * Stores the exchange rate between the LP and underlying token. */
214
- exchange_rate: number;
215
- /** * Stores the USD price of the LP Token used in the event. */
216
- exchange_rate_usd: number;
217
- /** * Stores the name of the token going into the lending protocol (e.g the token getting deposited). */
218
- token_name_in: string;
219
- /** * Stores the number decimal of the token going into the lending protocol. */
220
- token_decimal_in: number;
221
- /** * Stores the address of the token going into the lending protocol. */
222
- token_address_in: string;
223
- /** * Stores the ticker symbol of the token going into the lending protocol. */
224
- token_ticker_in: string;
225
- /** * Stores the logo URL of the token going into the lending protocol. */
226
- token_logo_in: string;
227
- /** * Stores the amount of tokens going into the lending protocol (e.g 1 ETH, 100 USDC, etc). */
228
- token_amount_in: number;
229
- /** * Stores the total USD amount of all tokens going into the lending protocol. */
230
- amount_in_usd: number;
231
- pretty_amount_in_usd: string;
232
- /** * Stores the name of the token going out of the lending protocol (e.g the token getting deposited). */
233
- token_name_out: string;
234
- /** * Stores the number decimal of the token going out of the lending protocol. */
235
- token_decimals_out: number;
236
- /** * Stores the address of the token going out of the lending protocol. */
237
- token_address_out: string;
238
- /** * Stores the ticker symbol of the token going out of the lending protocol. */
239
- token_ticker_out: string;
240
- /** * Stores the logo URL of the token going out of the lending protocol. */
241
- token_logo_out: string;
242
- /** * Stores the amount of tokens going out of the lending protocol (e.g 1 ETH, 100 USDC, etc). */
243
- token_amount_out: number;
244
- /** * Stores the total USD amount of all tokens going out of the lending protocol. */
245
- amount_out_usd: number;
246
- pretty_amount_out_usd: string;
247
- /** * Stores the type of loan the user is taking out. Lending protocols enable you to take out a stable or variable loan. Only relevant to borrow events. */
248
- borrow_rate_mode: number;
249
- /** * Stores the interest rate of the loan. Only relevant to borrow events. */
250
- borrow_rate: number;
251
- on_behalf_of: string;
252
- /** * Stores the wallet address liquidating the loan. Only relevant to liquidation events. */
253
- liquidator: string;
254
- /** * Stores the wallet address of the user initiating the event. */
255
- user: string;
256
- }>;
257
- export type SafeDetails = Nullable<{
258
- /** * The address that signed the safe transaction. */
259
- owner_address: string;
260
- /** * The signature of the owner for the safe transaction. */
261
- signature: string;
262
- /** * The type of safe signature used. */
263
- signature_type: string;
264
- }>;
265
121
  export type RecentTransactionsResponse = Nullable<{
266
122
  /** * The requested address. */
267
123
  address: string;
@@ -406,8 +262,12 @@ export type GetTransactionQueryParamOpts = Nullable<{
406
262
  quoteCurrency?: Quote;
407
263
  /** * Omit log events. */
408
264
  noLogs?: boolean;
409
- /** * Include safe details. */
410
- withSafe?: boolean;
265
+ /** * Whether to include internal transfers/transactions. */
266
+ withInternal?: boolean;
267
+ /** * Whether to include all transaction state changes with before and after values. */
268
+ withState?: boolean;
269
+ /** * Whether to include the transaction's input data such as the Method ID. */
270
+ withInputData?: boolean;
411
271
  }>;
412
272
  export type GetAllTransactionsForAddressQueryParamOpts = Nullable<{
413
273
  /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
@@ -416,16 +276,18 @@ export type GetAllTransactionsForAddressQueryParamOpts = Nullable<{
416
276
  noLogs?: boolean;
417
277
  /** * Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order. */
418
278
  blockSignedAtAsc?: boolean;
419
- /** * Include safe details. */
420
- withSafe?: boolean;
279
+ /** * Whether to include internal transfers/transactions. */
280
+ withInternal?: boolean;
281
+ /** * Whether to include all transaction state changes with before and after values. */
282
+ withState?: boolean;
283
+ /** * Whether to include the transaction's input data such as the Method ID. */
284
+ withInputData?: boolean;
421
285
  }>;
422
286
  export type GetTransactionsForBlockQueryParamOpts = Nullable<{
423
287
  /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
424
288
  quoteCurrency?: Quote;
425
289
  /** * Omit log events. */
426
290
  noLogs?: boolean;
427
- /** * Include safe details. */
428
- withSafe?: boolean;
429
291
  }>;
430
292
  export type GetTransactionsForAddressV3QueryParamOpts = Nullable<{
431
293
  /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
@@ -434,32 +296,12 @@ export type GetTransactionsForAddressV3QueryParamOpts = Nullable<{
434
296
  noLogs?: boolean;
435
297
  /** * Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order. */
436
298
  blockSignedAtAsc?: boolean;
437
- /** * Include safe details. */
438
- withSafe?: boolean;
439
299
  }>;
440
300
  export type GetTimeBucketTransactionsForAddressQueryParamOpts = Nullable<{
441
301
  /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
442
302
  quoteCurrency?: Quote;
443
303
  /** * Omit log events. */
444
304
  noLogs?: boolean;
445
- /** * Include safe details. */
446
- withSafe?: boolean;
447
- }>;
448
- export type GetTransactionsForBlockHashByPageQueryParamOpts = Nullable<{
449
- /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
450
- quoteCurrency?: Quote;
451
- /** * Omit log events. */
452
- noLogs?: boolean;
453
- /** * Include safe details. */
454
- withSafe?: boolean;
455
- }>;
456
- export type GetTransactionsForBlockHashQueryParamOpts = Nullable<{
457
- /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
458
- quoteCurrency?: Quote;
459
- /** * Omit log events. */
460
- noLogs?: boolean;
461
- /** * Include safe details. */
462
- withSafe?: boolean;
463
305
  }>;
464
306
  export type GetTransactionSummaryQueryParamOpts = Nullable<{
465
307
  /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
@@ -467,3 +309,39 @@ export type GetTransactionSummaryQueryParamOpts = Nullable<{
467
309
  /** * Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions. */
468
310
  withGas?: boolean;
469
311
  }>;
312
+ export type InternalTransfer = Nullable<{
313
+ /** * The contract address sending the native token. */
314
+ from_address: string;
315
+ /** * The internal transfer recipient wallet address. */
316
+ to_address: string;
317
+ /** * The value of the internal transfer in wei. */
318
+ value: string;
319
+ /** * The gas available from the parent transaction or contract call. */
320
+ gas_limit: number;
321
+ }>;
322
+ export type StateChange = Nullable<{
323
+ /** * The address associated with the state change. */
324
+ address: string;
325
+ /** * The balance of the native token before the transaction in wei. */
326
+ balance_before: string;
327
+ /** * The balance of the native token after the transaction in wei. */
328
+ balance_after: string;
329
+ /** * List of before and after values in the storage address. */
330
+ storage_changes: StorageChange[];
331
+ /** * The transaction count for this address before the transaction. */
332
+ nonce_before: number;
333
+ /** * The transaction count for this address after the transaction. */
334
+ nonce_after: number;
335
+ }>;
336
+ export type StorageChange = Nullable<{
337
+ /** * The specific storage slot in the contract's storage space. */
338
+ storage_address: string;
339
+ /** * The hex value stored in the slot before the transaction. */
340
+ value_before: string;
341
+ /** * The hex value stored in the slot after the transaction. */
342
+ value_after: string;
343
+ }>;
344
+ export type InputData = Nullable<{
345
+ /** * The first 4 bytes of the invoked smart contract function signature. Used to identify the function being called in the contract. */
346
+ method_id: string;
347
+ }>;