@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,33 +0,0 @@
1
- import { ContractMetadata, LogoUrls } from "./GenericTypes";
2
- export interface TokenPricesResponse {
3
- /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
4
- contract_decimals: number;
5
- /** * The string returned by the `name()` method. */
6
- contract_name: string;
7
- /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
8
- contract_ticker_symbol: string;
9
- /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
10
- contract_address: string;
11
- /** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
12
- supports_erc: string[];
13
- /** * The contract logo URL. */
14
- logo_url: string;
15
- update_at: Date;
16
- /** * The requested quote currency eg: `USD`. */
17
- quote_currency: string;
18
- /** * The contract logo URLs. */
19
- logo_urls: LogoUrls;
20
- /** * List of response items. */
21
- prices: Price[];
22
- /** * List of response items. */
23
- items: Price[];
24
- }
25
- export interface Price {
26
- contract_metadata: ContractMetadata;
27
- /** * The date of the price capture. */
28
- date: Date;
29
- /** * The price in the requested `quote-currency`. */
30
- price: number;
31
- /** * A prettier version of the price for rendering purposes. */
32
- pretty_price: string;
33
- }
@@ -1,121 +0,0 @@
1
- export interface ApprovalsResponse {
2
- /** * The requested address. */
3
- address: string;
4
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
5
- updated_at: Date;
6
- /** * The requested quote currency eg: `USD`. */
7
- quote_currency: string;
8
- /** * The requested chain ID eg: `1`. */
9
- chain_id: number;
10
- /** * The requested chain name eg: `eth-mainnet`. */
11
- chain_name: string;
12
- /** * List of response items. */
13
- items: TokensApprovalItem[];
14
- }
15
- export interface TokensApprovalItem {
16
- /** * The address for the token that has approvals. */
17
- token_address: string;
18
- /** * The name for the token that has approvals. */
19
- token_address_label: string;
20
- /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
21
- ticker_symbol: string;
22
- /** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
23
- contract_decimals: number;
24
- /** * The contract logo URL. */
25
- logo_url: string;
26
- /** * The exchange rate for the requested quote currency. */
27
- quote_rate: number;
28
- /** * Wallet balance of the token. */
29
- balance: bigint | null;
30
- /** * Value of the wallet balance of the token. */
31
- balance_quote: number;
32
- /** * A prettier version of the quote for rendering purposes. */
33
- pretty_balance_quote: string;
34
- /** * Total amount at risk across all spenders. */
35
- value_at_risk: string;
36
- /** * Value of total amount at risk across all spenders. */
37
- value_at_risk_quote: number;
38
- /** * A prettier version of the quote for rendering purposes. */
39
- pretty_value_at_risk_quote: string;
40
- /** * Contracts with non-zero approvals for this token. */
41
- spenders: TokenSpenderItem[];
42
- }
43
- export interface TokenSpenderItem {
44
- /** * The height of the block. */
45
- block_height: number;
46
- /** * The offset is the position of the tx in the block. */
47
- tx_offset: number;
48
- /** * The offset is the position of the log entry within an event log." */
49
- log_offset: number;
50
- /** * The block signed timestamp in UTC. */
51
- block_signed_at: Date;
52
- /** * Most recent transaction that updated approval amounts for the token. */
53
- tx_hash: string;
54
- /** * Address of the contract with approval for the token. */
55
- spender_address: string;
56
- /** * Name of the contract with approval for the token. */
57
- spender_address_label: string;
58
- /** * Remaining number of tokens granted to the spender by the approval. */
59
- allowance: string;
60
- /** * Value of the remaining allowance specified by the approval. */
61
- allowance_quote: number;
62
- /** * A prettier version of the quote for rendering purposes. */
63
- pretty_allowance_quote: string;
64
- /** * Amount at risk for spender. */
65
- value_at_risk: string;
66
- /** * Value of amount at risk for spender. */
67
- value_at_risk_quote: number;
68
- /** * A prettier version of the quote for rendering purposes. */
69
- pretty_value_at_risk_quote: string;
70
- risk_factor: string;
71
- }
72
- export interface NftApprovalsResponse {
73
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
74
- updated_at: Date;
75
- /** * The requested chain ID eg: `1`. */
76
- chain_id: number;
77
- /** * The requested chain name eg: `eth-mainnet`. */
78
- chain_name: string;
79
- /** * The requested address. */
80
- address: string;
81
- /** * List of response items. */
82
- items: NftApprovalsItem[];
83
- }
84
- export interface NftApprovalsItem {
85
- /** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
86
- contract_address: string;
87
- /** * The label of the contract address. */
88
- contract_address_label: string;
89
- /** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
90
- contract_ticker_symbol: string;
91
- /** * List of asset balances held by the user. */
92
- token_balances: NftApprovalBalance[];
93
- /** * Contracts with non-zero approvals for this token. */
94
- spenders: NftApprovalSpender[];
95
- }
96
- export interface NftApprovalBalance {
97
- /** * The token's id. */
98
- token_id: bigint | null;
99
- /** * The NFT's token balance. */
100
- token_balance: bigint | null;
101
- }
102
- export interface NftApprovalSpender {
103
- /** * The height of the block. */
104
- block_height: number;
105
- /** * The offset is the position of the tx in the block. */
106
- tx_offset: number;
107
- /** * The offset is the position of the log entry within an event log." */
108
- log_offset: number;
109
- /** * The block signed timestamp in UTC. */
110
- block_signed_at: Date;
111
- /** * Most recent transaction that updated approval amounts for the token. */
112
- tx_hash: string;
113
- /** * Address of the contract with approval for the token. */
114
- spender_address: string;
115
- /** * Name of the contract with approval for the token. */
116
- spender_address_label: string;
117
- /** * The token ids approved. */
118
- token_ids_approved: string;
119
- /** * Remaining number of tokens granted to the spender by the approval. */
120
- allowance: string;
121
- }
@@ -1,388 +0,0 @@
1
- import { ContractMetadata, LogEvent, Explorer } from "./GenericTypes";
2
- export interface TransactionResponse {
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: Transaction[];
11
- }
12
- export interface Transaction {
13
- /** * The block signed timestamp in UTC. */
14
- block_signed_at: Date;
15
- /** * The height of the block. */
16
- block_height: number;
17
- /** * The hash of the block. Use it to remove transactions from re-org-ed blocks. */
18
- block_hash: string;
19
- /** * The requested transaction hash. */
20
- tx_hash: string;
21
- /** * The offset is the position of the tx in the block. */
22
- tx_offset: number;
23
- /** * Indicates whether a transaction failed or succeeded. */
24
- successful: boolean;
25
- /** * The sender's wallet address. */
26
- from_address: string;
27
- /** * The address of the miner. */
28
- miner_address: string;
29
- /** * The label of `from` address. */
30
- from_address_label: string;
31
- /** * The receiver's wallet address. */
32
- to_address: string;
33
- /** * The label of `to` address. */
34
- to_address_label: string;
35
- /** * The value attached to this tx. */
36
- value: bigint | null;
37
- /** * The value attached in `quote-currency` to this tx. */
38
- value_quote: number;
39
- /** * A prettier version of the quote for rendering purposes. */
40
- pretty_value_quote: string;
41
- /** * The requested chain native gas token metadata. */
42
- gas_metadata: ContractMetadata;
43
- gas_offered: number;
44
- /** * The gas spent for this tx. */
45
- gas_spent: number;
46
- /** * The gas price at the time of this tx. */
47
- gas_price: number;
48
- /** * The total transaction fees (`gas_price` * `gas_spent`) paid for this tx, denoted in wei. */
49
- fees_paid: bigint | null;
50
- /** * The gas spent in `quote-currency` denomination. */
51
- gas_quote: number;
52
- /** * A prettier version of the quote for rendering purposes. */
53
- pretty_gas_quote: string;
54
- /** * The native gas exchange rate for the requested `quote-currency`. */
55
- gas_quote_rate: number;
56
- /** * The explorer links for this transaction. */
57
- explorers: Explorer[];
58
- /** * The details for the dex transaction. */
59
- dex_details: DexReport[];
60
- /** * The details for the NFT sale transaction. */
61
- nft_sale_details: NftSalesReport[];
62
- /** * The details for the lending protocol transaction. */
63
- lending_details: LendingReport[];
64
- /** * The log events. */
65
- log_events: LogEvent[];
66
- /** * The details related to the safe transaction. */
67
- safe_details: SafeDetails[];
68
- }
69
- export interface DexReport {
70
- /** * The offset is the position of the log entry within an event log. */
71
- log_offset: number;
72
- /** * Stores the name of the protocol that facilitated the event. */
73
- protocol_name: string;
74
- /** * Stores the contract address of the protocol that facilitated the event. */
75
- protocol_address: string;
76
- /** * The protocol logo URL. */
77
- protocol_logo_url: string;
78
- /** * Stores the aggregator responsible for the event. */
79
- aggregator_name: string;
80
- /** * Stores the contract address of the aggregator responsible for the event. */
81
- aggregator_address: string;
82
- /** * 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. */
83
- version: number;
84
- /** * 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` */
85
- fork_version: number;
86
- /** * Many DEXs are a fork of an already established DEX. The fork field allows you to see which DEX has been forked. */
87
- fork: string;
88
- /** * Stores the event taking place - e.g `swap`, `add_liquidity` and `remove_liquidity`. */
89
- event: string;
90
- /** * Stores the address of the pair that the user interacts with. */
91
- pair_address: string;
92
- pair_lp_fee_bps: number;
93
- lp_token_address: string;
94
- lp_token_ticker: string;
95
- lp_token_num_decimals: number;
96
- lp_token_name: string;
97
- lp_token_value: string;
98
- exchange_rate_usd: number;
99
- /** * Stores the address of token 0 in the specific pair. */
100
- token_0_address: string;
101
- /** * Stores the ticker symbol of token 0 in the specific pair. */
102
- token_0_ticker: string;
103
- /** * Stores the number of contract decimals of token 0 in the specific pair. */
104
- token_0_num_decimals: number;
105
- /** * Stores the contract name of token 0 in the specific pair. */
106
- token_0_name: string;
107
- /** * Stores the address of token 1 in the specific pair. */
108
- token_1_address: string;
109
- /** * Stores the ticker symbol of token 1 in the specific pair. */
110
- token_1_ticker: string;
111
- /** * Stores the number of contract decimals of token 1 in the specific pair. */
112
- token_1_num_decimals: number;
113
- /** * Stores the contract name of token 1 in the specific pair. */
114
- token_1_name: string;
115
- /** * Stores the amount of token 0 used in the transaction. For example, 1 ETH, 100 USDC, 30 UNI, etc. */
116
- token_0_amount: string;
117
- token_0_quote_rate: number;
118
- token_0_usd_quote: number;
119
- pretty_token_0_usd_quote: string;
120
- token_0_logo_url: string;
121
- /** * Stores the amount of token 1 used in the transaction. For example, 1 ETH, 100 USDC, 30 UNI, etc. */
122
- token_1_amount: string;
123
- token_1_quote_rate: number;
124
- token_1_usd_quote: number;
125
- pretty_token_1_usd_quote: string;
126
- token_1_logo_url: string;
127
- /** * Stores the wallet address that initiated the transaction (i.e the wallet paying the gas fee). */
128
- sender: string;
129
- /** * 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. */
130
- recipient: string;
131
- }
132
- export interface NftSalesReport {
133
- /** * The offset is the position of the log entry within an event log. */
134
- log_offset: number;
135
- /** * Stores the topic event hash. All events have a unique topic event hash. */
136
- topic0: string;
137
- /** * Stores the contract address of the protocol that facilitated the event. */
138
- protocol_contract_address: string;
139
- /** * Stores the name of the protocol that facilitated the event. */
140
- protocol_name: string;
141
- /** * The protocol logo URL. */
142
- protocol_logo_url: string;
143
- /** * Stores the address of the transaction recipient. */
144
- to: string;
145
- /** * Stores the address of the transaction sender. */
146
- from: string;
147
- /** * Stores the address selling the NFT. */
148
- maker: string;
149
- /** * Stores the address buying the NFT. */
150
- taker: string;
151
- /** * Stores the NFTs token ID. All NFTs have a token ID. Within a collection, these token IDs are unique. If the NFT is transferred to another owner, the token id remains the same, as this number is its identifier within a collection. For example, if a collection has 10K NFTs then an NFT in that collection can have a token ID from 1-10K. */
152
- token_id: string;
153
- /** * Stores the address of the collection. For example, [Bored Ape Yacht Club](https://etherscan.io/token/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d) */
154
- collection_address: string;
155
- /** * Stores the name of the collection. */
156
- collection_name: string;
157
- /** * Stores the address of the token used to purchase the NFT. */
158
- token_address: string;
159
- /** * Stores the name of the token used to purchase the NFT. */
160
- token_name: string;
161
- /** * Stores the ticker symbol of the token used to purchase the NFT. */
162
- ticker_symbol: string;
163
- /** * Stores the number decimal of the token used to purchase the NFT. */
164
- num_decimals: number;
165
- contract_quote_rate: number;
166
- /** * The token amount used to purchase the NFT. For example, if the user purchased an NFT for 1 ETH. The `nft_token_price` field will hold `1`. */
167
- nft_token_price: number;
168
- /** * The USD amount used to purchase the NFT. */
169
- nft_token_price_usd: number;
170
- pretty_nft_token_price_usd: string;
171
- /** * The price of the NFT denominated in the chains native token. Even if a seller sells their NFT for DAI or MANA, this field denominates the price in the native token (e.g. ETH, AVAX, FTM, etc.) */
172
- nft_token_price_native: number;
173
- pretty_nft_token_price_native: string;
174
- /** * Stores the number of NFTs involved in the sale. It's quick routine to see multiple NFTs involved in a single sale. */
175
- token_count: number;
176
- num_token_ids_sold_per_sale: number;
177
- num_token_ids_sold_per_tx: number;
178
- num_collections_sold_per_sale: number;
179
- num_collections_sold_per_tx: number;
180
- trade_type: string;
181
- trade_group_type: string;
182
- }
183
- export interface LendingReport {
184
- /** * The offset is the position of the log entry within an event log. */
185
- log_offset: number;
186
- /** * Stores the name of the lending protocol that facilitated the event. */
187
- protocol_name: string;
188
- /** * Stores the contract address of the lending protocol that facilitated the event. */
189
- protocol_address: string;
190
- /** * The protocol logo URL. */
191
- protocol_logo_url: string;
192
- /** * 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. */
193
- version: string;
194
- /** * Many lending protocols are a fork of an already established protocol. The fork column allows you to see which lending protocol has been forked. */
195
- fork: string;
196
- /** * 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` */
197
- fork_version: string;
198
- /** * Stores the event taking place - e.g `borrow`, `deposit`, `liquidation`, 'repay' and 'withdraw'. */
199
- event: string;
200
- /** * Stores the name of the LP token issued by the lending protocol. LP tokens can be debt or interest bearing tokens. */
201
- lp_token_name: string;
202
- /** * Stores the number decimal of the LP token. */
203
- lp_decimals: number;
204
- /** * Stores the ticker symbol of the LP token. */
205
- lp_ticker_symbol: string;
206
- /** * Stores the token address of the LP token. */
207
- lp_token_address: string;
208
- /** * Stores the amount of LP token used in the event (e.g. 1 aETH, 100 cUSDC, etc). */
209
- lp_token_amount: number;
210
- /** * Stores the total USD amount of all the LP Token used in the event. */
211
- lp_token_price: number;
212
- /** * Stores the exchange rate between the LP and underlying token. */
213
- exchange_rate: number;
214
- /** * Stores the USD price of the LP Token used in the event. */
215
- exchange_rate_usd: number;
216
- /** * Stores the name of the token going into the lending protocol (e.g the token getting deposited). */
217
- token_name_in: string;
218
- /** * Stores the number decimal of the token going into the lending protocol. */
219
- token_decimal_in: number;
220
- /** * Stores the address of the token going into the lending protocol. */
221
- token_address_in: string;
222
- /** * Stores the ticker symbol of the token going into the lending protocol. */
223
- token_ticker_in: string;
224
- /** * Stores the logo URL of the token going into the lending protocol. */
225
- token_logo_in: string;
226
- /** * Stores the amount of tokens going into the lending protocol (e.g 1 ETH, 100 USDC, etc). */
227
- token_amount_in: number;
228
- /** * Stores the total USD amount of all tokens going into the lending protocol. */
229
- amount_in_usd: number;
230
- pretty_amount_in_usd: string;
231
- /** * Stores the name of the token going out of the lending protocol (e.g the token getting deposited). */
232
- token_name_out: string;
233
- /** * Stores the number decimal of the token going out of the lending protocol. */
234
- token_decimals_out: number;
235
- /** * Stores the address of the token going out of the lending protocol. */
236
- token_address_out: string;
237
- /** * Stores the ticker symbol of the token going out of the lending protocol. */
238
- token_ticker_out: string;
239
- /** * Stores the logo URL of the token going out of the lending protocol. */
240
- token_logo_out: string;
241
- /** * Stores the amount of tokens going out of the lending protocol (e.g 1 ETH, 100 USDC, etc). */
242
- token_amount_out: number;
243
- /** * Stores the total USD amount of all tokens going out of the lending protocol. */
244
- amount_out_usd: number;
245
- pretty_amount_out_usd: string;
246
- /** * 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. */
247
- borrow_rate_mode: number;
248
- /** * Stores the interest rate of the loan. Only relevant to borrow events. */
249
- borrow_rate: number;
250
- on_behalf_of: string;
251
- /** * Stores the wallet address liquidating the loan. Only relevant to liquidation events. */
252
- liquidator: string;
253
- /** * Stores the wallet address of the user initiating the event. */
254
- user: string;
255
- }
256
- export interface SafeDetails {
257
- /** * The address that signed the safe transaction. */
258
- owner_address: string;
259
- /** * The signature of the owner for the safe transaction. */
260
- signature: string;
261
- /** * The type of safe signature used. */
262
- signature_type: string;
263
- }
264
- export interface RecentTransactionsResponse {
265
- /** * The requested address. */
266
- address: string;
267
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
268
- updated_at: Date;
269
- /** * The requested quote currency eg: `USD`. */
270
- quote_currency: string;
271
- /** * The requested chain ID eg: `1`. */
272
- chain_id: number;
273
- /** * The requested chain name eg: `eth-mainnet`. */
274
- chain_name: string;
275
- /** * The current page of the response. */
276
- current_page: number;
277
- links: PaginationLinks;
278
- /** * List of response items. */
279
- items: Transaction[];
280
- }
281
- export interface PaginationLinks {
282
- /** * URL link to the next page. */
283
- prev: string;
284
- /** * URL link to the previous page. */
285
- next: string;
286
- }
287
- export interface TransactionsTimeBucketResponse {
288
- /** * The requested address. */
289
- address: string;
290
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
291
- updated_at: Date;
292
- /** * The requested quote currency eg: `USD`. */
293
- quote_currency: string;
294
- /** * The requested chain ID eg: `1`. */
295
- chain_id: number;
296
- /** * The requested chain name eg: `eth-mainnet`. */
297
- chain_name: string;
298
- complete: boolean;
299
- /** * The current bucket of the response. */
300
- current_bucket: number;
301
- links: PaginationLinks;
302
- /** * List of response items. */
303
- items: Transaction[];
304
- }
305
- export interface TransactionsBlockResponse {
306
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
307
- updated_at: Date;
308
- /** * The requested chain ID eg: `1`. */
309
- chain_id: number;
310
- /** * The requested chain name eg: `eth-mainnet`. */
311
- chain_name: string;
312
- /** * List of response items. */
313
- items: Transaction[];
314
- }
315
- export interface TransactionsSummaryResponse {
316
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
317
- updated_at: Date;
318
- /** * The requested address. */
319
- address: string;
320
- /** * The requested chain ID eg: `1`. */
321
- chain_id: number;
322
- /** * The requested chain name eg: `eth-mainnet`. */
323
- chain_name: string;
324
- /** * List of response items. */
325
- items: TransactionsSummary[];
326
- }
327
- export interface TransactionsSummary {
328
- /** * The total number of transactions. */
329
- total_count: number;
330
- /** * The earliest transaction detected. */
331
- earliest_transaction: TransactionSummary;
332
- /** * The latest transaction detected. */
333
- latest_transaction: TransactionSummary;
334
- /** * The gas summary for the transactions. */
335
- gas_summary: GasSummary;
336
- }
337
- export interface TransactionSummary {
338
- /** * The block signed timestamp in UTC. */
339
- block_signed_at: Date;
340
- /** * The requested transaction hash. */
341
- tx_hash: string;
342
- /** * The link to the transaction details using the Covalent API. */
343
- tx_detail_link: string;
344
- }
345
- export interface TransactionsResponse {
346
- /** * The requested address. */
347
- address: string;
348
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
349
- updated_at: Date;
350
- /** * The requested quote currency eg: `USD`. */
351
- quote_currency: string;
352
- /** * The requested chain ID eg: `1`. */
353
- chain_id: number;
354
- /** * The requested chain name eg: `eth-mainnet`. */
355
- chain_name: string;
356
- /** * The current page of the response. */
357
- current_page: number;
358
- links: PaginationLinks;
359
- /** * List of response items. */
360
- items: Transaction[];
361
- }
362
- export interface TransactionsBlockPageResponse {
363
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
364
- updated_at: Date;
365
- /** * The requested chain ID eg: `1`. */
366
- chain_id: number;
367
- /** * The requested chain name eg: `eth-mainnet`. */
368
- chain_name: string;
369
- links: PaginationLinks;
370
- /** * List of response items. */
371
- items: Transaction[];
372
- }
373
- export interface GasSummary {
374
- /** * The total number of transactions sent by the address. */
375
- total_sent_count: number;
376
- /** * The total transaction fees paid by the address, denoted in wei. */
377
- total_fees_paid: bigint | null;
378
- /** * The total transaction fees paid by the address, denoted in `quote-currency`. */
379
- total_gas_quote: number;
380
- /** * A prettier version of the quote for rendering purposes. */
381
- pretty_total_gas_quote: string;
382
- /** * The average gas quote per transaction. */
383
- average_gas_quote_per_tx: number;
384
- /** * A prettier version of the quote for rendering purposes. */
385
- pretty_average_gas_quote_per_tx: string;
386
- /** * The requested chain native gas token metadata. */
387
- gas_metadata: ContractMetadata;
388
- }