@covalenthq/client-sdk 2.0.0 → 2.0.1
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.
- package/dist/cjs/index.d.ts +17 -0
- package/dist/cjs/index.js +2862 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/src/GoldRushClient.d.ts +20 -0
- package/dist/cjs/src/services/BalanceService.d.ts +125 -0
- package/dist/cjs/src/services/BaseService.d.ts +161 -0
- package/dist/cjs/src/services/NftService.d.ts +157 -0
- package/dist/cjs/src/services/PricingService.d.ts +25 -0
- package/dist/cjs/src/services/SecurityService.d.ts +28 -0
- package/dist/cjs/src/services/TransactionService.d.ts +128 -0
- package/dist/cjs/src/utils/functions/bigIntParser.d.ts +1 -0
- package/dist/cjs/src/utils/functions/calculatePrettyBalance.d.ts +1 -0
- package/dist/cjs/src/utils/functions/debugOutput.d.ts +2 -0
- package/dist/cjs/src/utils/functions/endpointGenerator.d.ts +4 -0
- package/dist/cjs/src/utils/functions/execution.d.ts +11 -0
- package/dist/cjs/src/utils/functions/isValidApiKey.d.ts +1 -0
- package/dist/cjs/src/utils/functions/paginateEndpoint.d.ts +7 -0
- package/dist/cjs/src/utils/functions/prettifyCurrency.d.ts +2 -0
- package/dist/cjs/src/utils/types/BalanceService.types.d.ts +442 -0
- package/dist/cjs/src/utils/types/BaseService.types.d.ts +326 -0
- package/dist/cjs/src/utils/types/Generic.types.d.ts +477 -0
- package/dist/cjs/src/utils/types/NftService.types.d.ts +273 -0
- package/dist/cjs/src/utils/types/PricingService.types.d.ts +39 -0
- package/dist/cjs/src/utils/types/SecurityService.types.d.ts +122 -0
- package/dist/cjs/src/utils/types/TransactionService.types.d.ts +474 -0
- package/dist/es/index.d.ts +17 -0
- package/dist/es/index.js +2854 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/src/GoldRushClient.d.ts +20 -0
- package/dist/es/src/services/BalanceService.d.ts +125 -0
- package/dist/es/src/services/BaseService.d.ts +161 -0
- package/dist/es/src/services/NftService.d.ts +157 -0
- package/dist/es/src/services/PricingService.d.ts +25 -0
- package/dist/es/src/services/SecurityService.d.ts +28 -0
- package/dist/es/src/services/TransactionService.d.ts +128 -0
- package/dist/es/src/utils/functions/bigIntParser.d.ts +1 -0
- package/dist/es/src/utils/functions/calculatePrettyBalance.d.ts +1 -0
- package/dist/es/src/utils/functions/debugOutput.d.ts +2 -0
- package/dist/es/src/utils/functions/endpointGenerator.d.ts +4 -0
- package/dist/es/src/utils/functions/execution.d.ts +11 -0
- package/dist/es/src/utils/functions/isValidApiKey.d.ts +1 -0
- package/dist/es/src/utils/functions/paginateEndpoint.d.ts +7 -0
- package/dist/es/src/utils/functions/prettifyCurrency.d.ts +2 -0
- package/dist/es/src/utils/types/BalanceService.types.d.ts +442 -0
- package/dist/es/src/utils/types/BaseService.types.d.ts +326 -0
- package/dist/es/src/utils/types/Generic.types.d.ts +477 -0
- package/dist/es/src/utils/types/NftService.types.d.ts +273 -0
- package/dist/es/src/utils/types/PricingService.types.d.ts +39 -0
- package/dist/es/src/utils/types/SecurityService.types.d.ts +122 -0
- package/dist/es/src/utils/types/TransactionService.types.d.ts +474 -0
- package/dist/esm/index.d.ts +17 -0
- package/dist/esm/index.js +2854 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/src/GoldRushClient.d.ts +20 -0
- package/dist/esm/src/services/BalanceService.d.ts +125 -0
- package/dist/esm/src/services/BaseService.d.ts +161 -0
- package/dist/esm/src/services/NftService.d.ts +157 -0
- package/dist/esm/src/services/PricingService.d.ts +25 -0
- package/dist/esm/src/services/SecurityService.d.ts +28 -0
- package/dist/esm/src/services/TransactionService.d.ts +128 -0
- package/dist/esm/src/utils/functions/bigIntParser.d.ts +1 -0
- package/dist/esm/src/utils/functions/calculatePrettyBalance.d.ts +1 -0
- package/dist/esm/src/utils/functions/debugOutput.d.ts +2 -0
- package/dist/esm/src/utils/functions/endpointGenerator.d.ts +4 -0
- package/dist/esm/src/utils/functions/execution.d.ts +11 -0
- package/dist/esm/src/utils/functions/isValidApiKey.d.ts +1 -0
- package/dist/esm/src/utils/functions/paginateEndpoint.d.ts +7 -0
- package/dist/esm/src/utils/functions/prettifyCurrency.d.ts +2 -0
- package/dist/esm/src/utils/types/BalanceService.types.d.ts +442 -0
- package/dist/esm/src/utils/types/BaseService.types.d.ts +326 -0
- package/dist/esm/src/utils/types/Generic.types.d.ts +477 -0
- package/dist/esm/src/utils/types/NftService.types.d.ts +273 -0
- package/dist/esm/src/utils/types/PricingService.types.d.ts +39 -0
- package/dist/esm/src/utils/types/SecurityService.types.d.ts +122 -0
- package/dist/esm/src/utils/types/TransactionService.types.d.ts +474 -0
- package/package.json +2 -2
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
import { type ChainID, type ChainName, type ContractMetadata, type Explorer, type GoldRushResponse, type LogEvent, type PaginationLinks, type Quote } from "./Generic.types";
|
|
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: ChainID;
|
|
7
|
+
/** * The requested chain name eg: `eth-mainnet`. */
|
|
8
|
+
chain_name: ChainName;
|
|
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;
|
|
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;
|
|
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: ChainID;
|
|
273
|
+
/** * The requested chain name eg: `eth-mainnet`. */
|
|
274
|
+
chain_name: ChainName;
|
|
275
|
+
/** * The current page of the response. */
|
|
276
|
+
current_page: number;
|
|
277
|
+
/** * URL link to the next and prev pages. */
|
|
278
|
+
links: PaginationLinks;
|
|
279
|
+
/** * An executable async function for the next page. */
|
|
280
|
+
next: (() => Promise<GoldRushResponse<RecentTransactionsResponse>>) | null;
|
|
281
|
+
/** * An executable async function for the prev page. */
|
|
282
|
+
prev: (() => Promise<GoldRushResponse<RecentTransactionsResponse>>) | null;
|
|
283
|
+
/** * List of response items. */
|
|
284
|
+
items: Transaction[];
|
|
285
|
+
}
|
|
286
|
+
export interface TransactionsTimeBucketResponse {
|
|
287
|
+
/** * The requested address. */
|
|
288
|
+
address: string;
|
|
289
|
+
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
290
|
+
updated_at: Date;
|
|
291
|
+
/** * The requested quote currency eg: `USD`. */
|
|
292
|
+
quote_currency: string;
|
|
293
|
+
/** * The requested chain ID eg: `1`. */
|
|
294
|
+
chain_id: ChainID;
|
|
295
|
+
/** * The requested chain name eg: `eth-mainnet`. */
|
|
296
|
+
chain_name: ChainName;
|
|
297
|
+
complete: boolean;
|
|
298
|
+
/** * The current bucket of the response. */
|
|
299
|
+
current_bucket: number;
|
|
300
|
+
/** * URL link to the next and prev pages. */
|
|
301
|
+
links: PaginationLinks;
|
|
302
|
+
/** * An executable async function for the next page. */
|
|
303
|
+
next: (() => Promise<GoldRushResponse<TransactionsTimeBucketResponse>>) | null;
|
|
304
|
+
/** * An executable async function for the prev page. */
|
|
305
|
+
prev: (() => Promise<GoldRushResponse<TransactionsTimeBucketResponse>>) | null;
|
|
306
|
+
/** * List of response items. */
|
|
307
|
+
items: Transaction[];
|
|
308
|
+
}
|
|
309
|
+
export interface TransactionsBlockResponse {
|
|
310
|
+
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
311
|
+
updated_at: Date;
|
|
312
|
+
/** * The requested chain ID eg: `1`. */
|
|
313
|
+
chain_id: ChainID;
|
|
314
|
+
/** * The requested chain name eg: `eth-mainnet`. */
|
|
315
|
+
chain_name: ChainName;
|
|
316
|
+
/** * List of response items. */
|
|
317
|
+
items: Transaction[];
|
|
318
|
+
}
|
|
319
|
+
export interface TransactionsSummaryResponse {
|
|
320
|
+
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
321
|
+
updated_at: Date;
|
|
322
|
+
/** * The requested address. */
|
|
323
|
+
address: string;
|
|
324
|
+
/** * The requested chain ID eg: `1`. */
|
|
325
|
+
chain_id: ChainID;
|
|
326
|
+
/** * The requested chain name eg: `eth-mainnet`. */
|
|
327
|
+
chain_name: ChainName;
|
|
328
|
+
/** * List of response items. */
|
|
329
|
+
items: TransactionsSummary[];
|
|
330
|
+
}
|
|
331
|
+
export interface TransactionsSummary {
|
|
332
|
+
/** * The total number of transactions. */
|
|
333
|
+
total_count: number;
|
|
334
|
+
/** * The earliest transaction detected. */
|
|
335
|
+
earliest_transaction: TransactionSummary;
|
|
336
|
+
/** * The latest transaction detected. */
|
|
337
|
+
latest_transaction: TransactionSummary;
|
|
338
|
+
/** * The gas summary for the transactions. */
|
|
339
|
+
gas_summary: GasSummary;
|
|
340
|
+
}
|
|
341
|
+
export interface TransactionSummary {
|
|
342
|
+
/** * The block signed timestamp in UTC. */
|
|
343
|
+
block_signed_at: Date;
|
|
344
|
+
/** * The requested transaction hash. */
|
|
345
|
+
tx_hash: string;
|
|
346
|
+
/** * The link to the transaction details using the Covalent API. */
|
|
347
|
+
tx_detail_link: string;
|
|
348
|
+
}
|
|
349
|
+
export interface TransactionsResponse {
|
|
350
|
+
/** * The requested address. */
|
|
351
|
+
address: string;
|
|
352
|
+
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
353
|
+
updated_at: Date;
|
|
354
|
+
/** * The requested quote currency eg: `USD`. */
|
|
355
|
+
quote_currency: string;
|
|
356
|
+
/** * The requested chain ID eg: `1`. */
|
|
357
|
+
chain_id: ChainID;
|
|
358
|
+
/** * The requested chain name eg: `eth-mainnet`. */
|
|
359
|
+
chain_name: ChainName;
|
|
360
|
+
/** * The current page of the response. */
|
|
361
|
+
current_page: number;
|
|
362
|
+
/** * URL link to the next and prev pages. */
|
|
363
|
+
links: PaginationLinks;
|
|
364
|
+
/** * An executable async function for the next page. */
|
|
365
|
+
next: (() => Promise<GoldRushResponse<TransactionsResponse>>) | null;
|
|
366
|
+
/** * An executable async function for the prev page. */
|
|
367
|
+
prev: (() => Promise<GoldRushResponse<TransactionsResponse>>) | null;
|
|
368
|
+
/** * List of response items. */
|
|
369
|
+
items: Transaction[];
|
|
370
|
+
}
|
|
371
|
+
export interface TransactionsBlockPageResponse {
|
|
372
|
+
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
373
|
+
updated_at: Date;
|
|
374
|
+
/** * The requested chain ID eg: `1`. */
|
|
375
|
+
chain_id: ChainID;
|
|
376
|
+
/** * The requested chain name eg: `eth-mainnet`. */
|
|
377
|
+
chain_name: ChainName;
|
|
378
|
+
/** * URL link to the next and prev pages. */
|
|
379
|
+
links: PaginationLinks;
|
|
380
|
+
/** * An executable async function for the next page. */
|
|
381
|
+
next: (() => Promise<GoldRushResponse<TransactionsBlockPageResponse>>) | null;
|
|
382
|
+
/** * An executable async function for the prev page. */
|
|
383
|
+
prev: (() => Promise<GoldRushResponse<TransactionsBlockPageResponse>>) | null;
|
|
384
|
+
/** * List of response items. */
|
|
385
|
+
items: Transaction[];
|
|
386
|
+
}
|
|
387
|
+
export interface GasSummary {
|
|
388
|
+
/** * The total number of transactions sent by the address. */
|
|
389
|
+
total_sent_count: number;
|
|
390
|
+
/** * The total transaction fees paid by the address, denoted in wei. */
|
|
391
|
+
total_fees_paid: bigint;
|
|
392
|
+
/** * The total transaction fees paid by the address, denoted in `quote-currency`. */
|
|
393
|
+
total_gas_quote: number;
|
|
394
|
+
/** * A prettier version of the quote for rendering purposes. */
|
|
395
|
+
pretty_total_gas_quote: string;
|
|
396
|
+
/** * The average gas quote per transaction. */
|
|
397
|
+
average_gas_quote_per_tx: number;
|
|
398
|
+
/** * A prettier version of the quote for rendering purposes. */
|
|
399
|
+
pretty_average_gas_quote_per_tx: string;
|
|
400
|
+
/** * The requested chain native gas token metadata. */
|
|
401
|
+
gas_metadata: ContractMetadata;
|
|
402
|
+
}
|
|
403
|
+
export interface GetTransactionQueryParamOpts {
|
|
404
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
405
|
+
quoteCurrency?: Quote;
|
|
406
|
+
/** * Omit log events. */
|
|
407
|
+
noLogs?: boolean;
|
|
408
|
+
/** * Decoded DEX details including protocol (e.g. Uniswap), event (e.g 'add_liquidity') and tokens involved with historical prices. Additional 0.05 credits charged if data available. */
|
|
409
|
+
withDex?: boolean;
|
|
410
|
+
/** * Decoded NFT sales details including marketplace (e.g. Opensea) and cached media links. Additional 0.05 credits charged if data available. */
|
|
411
|
+
withNftSales?: boolean;
|
|
412
|
+
/** * Decoded lending details including protocol (e.g. Aave), event (e.g. 'deposit') and tokens involved with prices. Additional 0.05 credits charged if data available. */
|
|
413
|
+
withLending?: boolean;
|
|
414
|
+
/** * Include safe details. */
|
|
415
|
+
withSafe?: boolean;
|
|
416
|
+
}
|
|
417
|
+
export interface GetAllTransactionsForAddressQueryParamOpts {
|
|
418
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
419
|
+
quoteCurrency?: Quote;
|
|
420
|
+
/** * Omit log events. */
|
|
421
|
+
noLogs?: boolean;
|
|
422
|
+
/** * Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order. */
|
|
423
|
+
blockSignedAtAsc?: boolean;
|
|
424
|
+
/** * Include safe details. */
|
|
425
|
+
withSafe?: boolean;
|
|
426
|
+
}
|
|
427
|
+
export interface GetTransactionsForBlockQueryParamOpts {
|
|
428
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
429
|
+
quoteCurrency?: Quote;
|
|
430
|
+
/** * Omit log events. */
|
|
431
|
+
noLogs?: boolean;
|
|
432
|
+
/** * Include safe details. */
|
|
433
|
+
withSafe?: boolean;
|
|
434
|
+
}
|
|
435
|
+
export interface GetTransactionsForAddressV3QueryParamOpts {
|
|
436
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
437
|
+
quoteCurrency?: Quote;
|
|
438
|
+
/** * Omit log events. */
|
|
439
|
+
noLogs?: boolean;
|
|
440
|
+
/** * Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order. */
|
|
441
|
+
blockSignedAtAsc?: boolean;
|
|
442
|
+
/** * Include safe details. */
|
|
443
|
+
withSafe?: boolean;
|
|
444
|
+
}
|
|
445
|
+
export interface GetTimeBucketTransactionsForAddressQueryParamOpts {
|
|
446
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
447
|
+
quoteCurrency?: Quote;
|
|
448
|
+
/** * Omit log events. */
|
|
449
|
+
noLogs?: boolean;
|
|
450
|
+
/** * Include safe details. */
|
|
451
|
+
withSafe?: boolean;
|
|
452
|
+
}
|
|
453
|
+
export interface GetTransactionsForBlockHashByPageQueryParamOpts {
|
|
454
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
455
|
+
quoteCurrency?: Quote;
|
|
456
|
+
/** * Omit log events. */
|
|
457
|
+
noLogs?: boolean;
|
|
458
|
+
/** * Include safe details. */
|
|
459
|
+
withSafe?: boolean;
|
|
460
|
+
}
|
|
461
|
+
export interface GetTransactionsForBlockHashQueryParamOpts {
|
|
462
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
463
|
+
quoteCurrency?: Quote;
|
|
464
|
+
/** * Omit log events. */
|
|
465
|
+
noLogs?: boolean;
|
|
466
|
+
/** * Include safe details. */
|
|
467
|
+
withSafe?: boolean;
|
|
468
|
+
}
|
|
469
|
+
export interface GetTransactionSummaryQueryParamOpts {
|
|
470
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
471
|
+
quoteCurrency?: Quote;
|
|
472
|
+
/** * Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions. */
|
|
473
|
+
withGas?: boolean;
|
|
474
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export {
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Please use `GoldRushClient` going forward!
|
|
4
|
+
* `CovalentClient` will be removed after Aug 30, 2024.
|
|
5
|
+
*/
|
|
6
|
+
GoldRushClient as CovalentClient, GoldRushClient, } from "./src/GoldRushClient";
|
|
7
|
+
export { bigIntParser } from "./src/utils/functions/bigIntParser";
|
|
8
|
+
export { calculatePrettyBalance } from "./src/utils/functions/calculatePrettyBalance";
|
|
9
|
+
export { isValidApiKey } from "./src/utils/functions/isValidApiKey";
|
|
10
|
+
export { prettifyCurrency } from "./src/utils/functions/prettifyCurrency";
|
|
11
|
+
export * from "./src/utils/types/BalanceService.types";
|
|
12
|
+
export * from "./src/utils/types/BaseService.types";
|
|
13
|
+
export * from "./src/utils/types/Generic.types";
|
|
14
|
+
export * from "./src/utils/types/NftService.types";
|
|
15
|
+
export * from "./src/utils/types/PricingService.types";
|
|
16
|
+
export * from "./src/utils/types/SecurityService.types";
|
|
17
|
+
export * from "./src/utils/types/TransactionService.types";
|