@covalenthq/client-sdk 2.3.1 → 2.3.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 (66) hide show
  1. package/dist/{cjs/index.js → index.js} +12 -28
  2. package/dist/index.js.map +1 -0
  3. package/dist/{esm/src → src}/utils/types/Generic.types.d.ts +11 -27
  4. package/package.json +9 -13
  5. package/dist/cjs/index.js.map +0 -1
  6. package/dist/cjs/src/utils/types/Generic.types.d.ts +0 -391
  7. package/dist/esm/index.d.ts +0 -16
  8. package/dist/esm/index.js +0 -5696
  9. package/dist/esm/index.js.map +0 -1
  10. package/dist/esm/src/GoldRushClient.d.ts +0 -27
  11. package/dist/esm/src/services/AllChainsService.d.ts +0 -63
  12. package/dist/esm/src/services/BalanceService.d.ts +0 -125
  13. package/dist/esm/src/services/BaseService.d.ts +0 -163
  14. package/dist/esm/src/services/BitcoinService.d.ts +0 -40
  15. package/dist/esm/src/services/NftService.d.ts +0 -193
  16. package/dist/esm/src/services/PricingService.d.ts +0 -36
  17. package/dist/esm/src/services/SecurityService.d.ts +0 -28
  18. package/dist/esm/src/services/StreamingService.d.ts +0 -151
  19. package/dist/esm/src/services/TransactionService.d.ts +0 -134
  20. package/dist/esm/src/utils/functions/bigIntParser.d.ts +0 -1
  21. package/dist/esm/src/utils/functions/calculatePrettyBalance.d.ts +0 -1
  22. package/dist/esm/src/utils/functions/debugOutput.d.ts +0 -2
  23. package/dist/esm/src/utils/functions/endpointGenerator.d.ts +0 -4
  24. package/dist/esm/src/utils/functions/execution.d.ts +0 -11
  25. package/dist/esm/src/utils/functions/isValidApiKey.d.ts +0 -1
  26. package/dist/esm/src/utils/functions/paginateEndpoint.d.ts +0 -7
  27. package/dist/esm/src/utils/functions/prettifyCurrency.d.ts +0 -2
  28. package/dist/esm/src/utils/functions/timestamp-parser.d.ts +0 -1
  29. package/dist/esm/src/utils/types/AllChainService.types.d.ts +0 -123
  30. package/dist/esm/src/utils/types/BalanceService.types.d.ts +0 -442
  31. package/dist/esm/src/utils/types/BaseService.types.d.ts +0 -312
  32. package/dist/esm/src/utils/types/BitcoinService.types.d.ts +0 -88
  33. package/dist/esm/src/utils/types/NftService.types.d.ts +0 -355
  34. package/dist/esm/src/utils/types/PricingService.types.d.ts +0 -80
  35. package/dist/esm/src/utils/types/SecurityService.types.d.ts +0 -124
  36. package/dist/esm/src/utils/types/StreamingService.types.d.ts +0 -201
  37. package/dist/esm/src/utils/types/TransactionService.types.d.ts +0 -392
  38. /package/dist/{cjs/index.d.ts → index.d.ts} +0 -0
  39. /package/dist/{cjs/src → src}/GoldRushClient.d.ts +0 -0
  40. /package/dist/{cjs/src → src}/services/AllChainsService.d.ts +0 -0
  41. /package/dist/{cjs/src → src}/services/BalanceService.d.ts +0 -0
  42. /package/dist/{cjs/src → src}/services/BaseService.d.ts +0 -0
  43. /package/dist/{cjs/src → src}/services/BitcoinService.d.ts +0 -0
  44. /package/dist/{cjs/src → src}/services/NftService.d.ts +0 -0
  45. /package/dist/{cjs/src → src}/services/PricingService.d.ts +0 -0
  46. /package/dist/{cjs/src → src}/services/SecurityService.d.ts +0 -0
  47. /package/dist/{cjs/src → src}/services/StreamingService.d.ts +0 -0
  48. /package/dist/{cjs/src → src}/services/TransactionService.d.ts +0 -0
  49. /package/dist/{cjs/src → src}/utils/functions/bigIntParser.d.ts +0 -0
  50. /package/dist/{cjs/src → src}/utils/functions/calculatePrettyBalance.d.ts +0 -0
  51. /package/dist/{cjs/src → src}/utils/functions/debugOutput.d.ts +0 -0
  52. /package/dist/{cjs/src → src}/utils/functions/endpointGenerator.d.ts +0 -0
  53. /package/dist/{cjs/src → src}/utils/functions/execution.d.ts +0 -0
  54. /package/dist/{cjs/src → src}/utils/functions/isValidApiKey.d.ts +0 -0
  55. /package/dist/{cjs/src → src}/utils/functions/paginateEndpoint.d.ts +0 -0
  56. /package/dist/{cjs/src → src}/utils/functions/prettifyCurrency.d.ts +0 -0
  57. /package/dist/{cjs/src → src}/utils/functions/timestamp-parser.d.ts +0 -0
  58. /package/dist/{cjs/src → src}/utils/types/AllChainService.types.d.ts +0 -0
  59. /package/dist/{cjs/src → src}/utils/types/BalanceService.types.d.ts +0 -0
  60. /package/dist/{cjs/src → src}/utils/types/BaseService.types.d.ts +0 -0
  61. /package/dist/{cjs/src → src}/utils/types/BitcoinService.types.d.ts +0 -0
  62. /package/dist/{cjs/src → src}/utils/types/NftService.types.d.ts +0 -0
  63. /package/dist/{cjs/src → src}/utils/types/PricingService.types.d.ts +0 -0
  64. /package/dist/{cjs/src → src}/utils/types/SecurityService.types.d.ts +0 -0
  65. /package/dist/{cjs/src → src}/utils/types/StreamingService.types.d.ts +0 -0
  66. /package/dist/{cjs/src → src}/utils/types/TransactionService.types.d.ts +0 -0
@@ -1,201 +0,0 @@
1
- import type { ContractMetadata } from "./Generic.types";
2
- /**
3
- * Common enums and types for Streaming API
4
- */
5
- export declare enum StreamingChain {
6
- BASE_MAINNET = "BASE_MAINNET",
7
- ETH_MAINNET = "ETH_MAINNET",
8
- BSC_MAINNET = "BSC_MAINNET"
9
- }
10
- export declare enum StreamingInterval {
11
- FIFTEEN_SECONDS = "FIFTEEN_SECONDS",
12
- THIRTY_SECONDS = "THIRTY_SECONDS",
13
- ONE_MINUTE = "ONE_MINUTE",
14
- FIVE_MINUTES = "FIVE_MINUTES",
15
- FIFTEEN_MINUTES = "FIFTEEN_MINUTES",
16
- THIRTY_MINUTES = "THIRTY_MINUTES",
17
- ONE_HOUR = "ONE_HOUR",
18
- FOUR_HOURS = "FOUR_HOURS",
19
- ONE_DAY = "ONE_DAY"
20
- }
21
- export declare enum StreamingTimeframe {
22
- ONE_MINUTE = "ONE_MINUTE",
23
- FIVE_MINUTES = "FIVE_MINUTES",
24
- FIFTEEN_MINUTES = "FIFTEEN_MINUTES",
25
- THIRTY_MINUTES = "THIRTY_MINUTES",
26
- ONE_HOUR = "ONE_HOUR",
27
- FOUR_HOURS = "FOUR_HOURS",
28
- ONE_DAY = "ONE_DAY",
29
- ONE_WEEK = "ONE_WEEK",
30
- ONE_MONTH = "ONE_MONTH"
31
- }
32
- export declare enum StreamingProtocol {
33
- UNISWAP_V2 = "UNISWAP_V2",
34
- UNISWAP_V3 = "UNISWAP_V3"
35
- }
36
- /**
37
- * OHLCV Pairs Stream Types
38
- */
39
- export interface OHLCVPairsStreamParams {
40
- chain_name: StreamingChain;
41
- pair_addresses: string[];
42
- interval: StreamingInterval;
43
- timeframe: StreamingTimeframe;
44
- limit?: number;
45
- }
46
- export interface OHLCVPairsStreamResponse {
47
- chain_name: StreamingChain;
48
- pair_address: string;
49
- interval: StreamingInterval;
50
- timeframe: StreamingTimeframe;
51
- timestamp: string;
52
- open: number;
53
- high: number;
54
- low: number;
55
- close: number;
56
- volume: number;
57
- price_usd: number;
58
- volume_usd: number;
59
- base_token: ContractMetadata;
60
- quote_token: ContractMetadata;
61
- }
62
- /**
63
- * OHLCV Tokens Stream Types
64
- */
65
- export interface OHLCVTokensStreamParams {
66
- chain_name: StreamingChain;
67
- token_addresses: string[];
68
- interval: StreamingInterval;
69
- timeframe: StreamingTimeframe;
70
- limit?: number;
71
- }
72
- export interface OHLCVTokensStreamResponse {
73
- chain_name: StreamingChain;
74
- pair_address: string;
75
- interval: StreamingInterval;
76
- timeframe: StreamingTimeframe;
77
- timestamp: string;
78
- open: number;
79
- high: number;
80
- low: number;
81
- close: number;
82
- volume: number;
83
- volume_usd: number;
84
- quote_rate: number;
85
- quote_rate_usd: number;
86
- base_token: ContractMetadata;
87
- quote_token: ContractMetadata;
88
- }
89
- /**
90
- * New DEX Pairs Stream Types
91
- */
92
- export interface NewPairsStreamParams {
93
- chain_name: StreamingChain;
94
- protocols: StreamingProtocol[];
95
- }
96
- export interface PriceMetrics {
97
- last_5m: number;
98
- last_1hr: number;
99
- last_6hr: number;
100
- last_24hr: number;
101
- }
102
- export interface SwapMetrics {
103
- last_5m: number;
104
- last_1hr: number;
105
- last_6hr: number;
106
- last_24hr: number;
107
- }
108
- export interface NewPairsStreamResponse {
109
- chain_name: string;
110
- protocol: string;
111
- protocol_version: string;
112
- pair_address: string;
113
- deployer_address: string;
114
- tx_hash: string;
115
- block_signed_at: string;
116
- liquidity: number;
117
- supply: number;
118
- market_cap: number;
119
- event_name: string;
120
- quote_rate: number;
121
- quote_rate_usd: number;
122
- base_token_metadata: ContractMetadata;
123
- quote_token_metadata: ContractMetadata;
124
- pair_metadata: ContractMetadata;
125
- prices: PriceMetrics;
126
- swaps: SwapMetrics;
127
- }
128
- /**
129
- * Token Balances Stream Types
130
- */
131
- export interface TokenBalancesStreamParams {
132
- chain_name: StreamingChain;
133
- wallet_address: string;
134
- }
135
- export interface TokenBalanceItem {
136
- balance: string;
137
- balance_pretty: number;
138
- quote_rate_usd: number;
139
- quote_usd: number;
140
- metadata: ContractMetadata;
141
- is_native: boolean;
142
- }
143
- export interface TokenBalancesStreamResponse {
144
- wallet_address: string;
145
- chain_name: string;
146
- last_block: number;
147
- items: TokenBalanceItem[];
148
- }
149
- /**
150
- * Wallet Activity Stream Types
151
- */
152
- export interface WalletActivityStreamParams {
153
- chain_name: StreamingChain;
154
- wallet_addresses: string[];
155
- }
156
- export interface WalletActivityLogItem {
157
- emitter_address: string;
158
- log_offset: number;
159
- data: string;
160
- topics: string[];
161
- }
162
- export interface WalletActivityStreamResponse {
163
- tx_hash: string;
164
- from_address: string;
165
- to_address: string;
166
- value: number;
167
- chain_name: string;
168
- block_signed_at: string;
169
- block_height: number;
170
- block_hash: string;
171
- miner_address: string;
172
- gas_used: number;
173
- tx_offset: number;
174
- successful: boolean;
175
- decoded_type: string;
176
- decoded_details?: object;
177
- logs: WalletActivityLogItem[];
178
- }
179
- /**
180
- * Streaming service configuration
181
- */
182
- export interface StreamingServiceConfig {
183
- shouldRetry?: (retries: number) => boolean;
184
- maxReconnectAttempts?: number;
185
- onConnecting?: () => void;
186
- onOpened?: () => void;
187
- onClosed?: () => void;
188
- onError?: (error: any) => void;
189
- }
190
- /**
191
- * Stream subscription options
192
- */
193
- export interface StreamSubscriptionOptions<T = Array<object>> {
194
- next: (payload: T) => void;
195
- error?: (error: any) => void;
196
- complete?: () => void;
197
- }
198
- /**
199
- * Unsubscribe function type
200
- */
201
- export type UnsubscribeFunction = () => void;
@@ -1,392 +0,0 @@
1
- import { type ChainID, type ChainName, type ContractMetadata, type Explorer, type GoldRushResponse, type LogEvent, type Nullable, type PaginationLinks, type Quote } from "./Generic.types";
2
- export type TransactionResponse = Nullable<{
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 type Transaction = Nullable<{
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
- /** * The gas offered for this tx. */
44
- gas_offered: number;
45
- /** * The gas spent for this tx. */
46
- gas_spent: number;
47
- /** * The gas price at the time of this tx. */
48
- gas_price: number;
49
- /** * The total transaction fees (`gas_price` * `gas_spent`) paid for this tx, denoted in wei. */
50
- fees_paid: bigint;
51
- /** * The gas spent in `quote-currency` denomination. */
52
- gas_quote: number;
53
- /** * A prettier version of the quote for rendering purposes. */
54
- pretty_gas_quote: string;
55
- /** * The native gas exchange rate for the requested `quote-currency`. */
56
- gas_quote_rate: number;
57
- /** * The explorer links for this transaction. */
58
- explorers: Explorer[];
59
- /** * The details for the NFT sale transaction. */
60
- nft_sale_details: NftSalesReport[];
61
- /** * The log events. */
62
- log_events: LogEvent[];
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;
69
- }>;
70
- export type NftSalesReport = Nullable<{
71
- /** * The offset is the position of the log entry within an event log. */
72
- log_offset: number;
73
- /** * Stores the topic event hash. All events have a unique topic event hash. */
74
- topic0: string;
75
- /** * Stores the contract address of the protocol that facilitated the event. */
76
- protocol_contract_address: string;
77
- /** * Stores the name of the protocol that facilitated the event. */
78
- protocol_name: string;
79
- /** * The protocol logo URL. */
80
- protocol_logo_url: string;
81
- /** * Stores the address of the transaction recipient. */
82
- to: string;
83
- /** * Stores the address of the transaction sender. */
84
- from: string;
85
- /** * Stores the address selling the NFT. */
86
- maker: string;
87
- /** * Stores the address buying the NFT. */
88
- taker: string;
89
- /** * 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. */
90
- token_id: string;
91
- /** * Stores the address of the collection. For example, [Bored Ape Yacht Club](https://etherscan.io/token/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d) */
92
- collection_address: string;
93
- /** * Stores the name of the collection. */
94
- collection_name: string;
95
- /** * Stores the address of the token used to purchase the NFT. */
96
- token_address: string;
97
- /** * Stores the name of the token used to purchase the NFT. */
98
- token_name: string;
99
- /** * Stores the ticker symbol of the token used to purchase the NFT. */
100
- ticker_symbol: string;
101
- /** * Stores the number decimal of the token used to purchase the NFT. */
102
- num_decimals: number;
103
- contract_quote_rate: number;
104
- /** * 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`. */
105
- nft_token_price: number;
106
- /** * The USD amount used to purchase the NFT. */
107
- nft_token_price_usd: number;
108
- pretty_nft_token_price_usd: string;
109
- /** * 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.) */
110
- nft_token_price_native: number;
111
- pretty_nft_token_price_native: string;
112
- /** * Stores the number of NFTs involved in the sale. It's quick routine to see multiple NFTs involved in a single sale. */
113
- token_count: number;
114
- num_token_ids_sold_per_sale: number;
115
- num_token_ids_sold_per_tx: number;
116
- num_collections_sold_per_sale: number;
117
- num_collections_sold_per_tx: number;
118
- trade_type: string;
119
- trade_group_type: string;
120
- }>;
121
- export type RecentTransactionsResponse = Nullable<{
122
- /** * The requested address. */
123
- address: string;
124
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
125
- updated_at: Date;
126
- /** * The requested quote currency eg: `USD`. */
127
- quote_currency: Quote;
128
- /** * The requested chain ID eg: `1`. */
129
- chain_id: ChainID;
130
- /** * The requested chain name eg: `eth-mainnet`. */
131
- chain_name: ChainName;
132
- /** * The current page of the response. */
133
- current_page: number;
134
- /** * URL link to the next and prev pages. */
135
- links: PaginationLinks;
136
- /** * An executable async function for the next page. */
137
- next: (() => Promise<GoldRushResponse<RecentTransactionsResponse>>) | null;
138
- /** * An executable async function for the prev page. */
139
- prev: (() => Promise<GoldRushResponse<RecentTransactionsResponse>>) | null;
140
- /** * List of response items. */
141
- items: Transaction[];
142
- }>;
143
- export type TransactionsTimeBucketResponse = Nullable<{
144
- /** * The requested address. */
145
- address: string;
146
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
147
- updated_at: Date;
148
- /** * The requested quote currency eg: `USD`. */
149
- quote_currency: Quote;
150
- /** * The requested chain ID eg: `1`. */
151
- chain_id: ChainID;
152
- /** * The requested chain name eg: `eth-mainnet`. */
153
- chain_name: ChainName;
154
- complete: boolean;
155
- /** * The current bucket of the response. */
156
- current_bucket: number;
157
- /** * URL link to the next and prev pages. */
158
- links: PaginationLinks;
159
- /** * An executable async function for the next page. */
160
- next: (() => Promise<GoldRushResponse<TransactionsTimeBucketResponse>>) | null;
161
- /** * An executable async function for the prev page. */
162
- prev: (() => Promise<GoldRushResponse<TransactionsTimeBucketResponse>>) | null;
163
- /** * List of response items. */
164
- items: Transaction[];
165
- }>;
166
- export type TransactionsBlockResponse = Nullable<{
167
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
168
- updated_at: Date;
169
- /** * The requested chain ID eg: `1`. */
170
- chain_id: ChainID;
171
- /** * The requested chain name eg: `eth-mainnet`. */
172
- chain_name: ChainName;
173
- /** * List of response items. */
174
- items: Transaction[];
175
- /** * URL link to the next and prev pages. */
176
- links: PaginationLinks;
177
- /** * An executable async function for the next page. */
178
- next: (() => Promise<GoldRushResponse<TransactionsBlockResponse>>) | null;
179
- /** * An executable async function for the prev page. */
180
- prev: (() => Promise<GoldRushResponse<TransactionsBlockResponse>>) | null;
181
- }>;
182
- export type TransactionsSummaryResponse = Nullable<{
183
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
184
- updated_at: Date;
185
- /** * The requested address. */
186
- address: string;
187
- /** * The requested chain ID eg: `1`. */
188
- chain_id: ChainID;
189
- /** * The requested chain name eg: `eth-mainnet`. */
190
- chain_name: ChainName;
191
- /** * List of response items. */
192
- items: TransactionsSummary[];
193
- }>;
194
- export type TransactionsSummary = Nullable<{
195
- /** * The total number of transactions. */
196
- total_count: number;
197
- /** * The earliest transaction detected. */
198
- earliest_transaction: TransactionSummary;
199
- /** * The latest transaction detected. */
200
- latest_transaction: TransactionSummary;
201
- /** * The gas summary for the transactions. */
202
- gas_summary: GasSummary;
203
- }>;
204
- export type TransactionSummary = Nullable<{
205
- /** * The block signed timestamp in UTC. */
206
- block_signed_at: Date;
207
- /** * The requested transaction hash. */
208
- tx_hash: string;
209
- /** * The link to the transaction details using the Covalent API. */
210
- tx_detail_link: string;
211
- }>;
212
- export type TransactionsResponse = Nullable<{
213
- /** * The requested address. */
214
- address: string;
215
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
216
- updated_at: Date;
217
- /** * The requested quote currency eg: `USD`. */
218
- quote_currency: Quote;
219
- /** * The requested chain ID eg: `1`. */
220
- chain_id: ChainID;
221
- /** * The requested chain name eg: `eth-mainnet`. */
222
- chain_name: ChainName;
223
- /** * The current page of the response. */
224
- current_page: number;
225
- /** * URL link to the next and prev pages. */
226
- links: PaginationLinks;
227
- /** * An executable async function for the next page. */
228
- next: (() => Promise<GoldRushResponse<TransactionsResponse>>) | null;
229
- /** * An executable async function for the prev page. */
230
- prev: (() => Promise<GoldRushResponse<TransactionsResponse>>) | null;
231
- /** * List of response items. */
232
- items: Transaction[];
233
- }>;
234
- export type TransactionsBlockPageResponse = Nullable<{
235
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
236
- updated_at: Date;
237
- /** * The requested chain ID eg: `1`. */
238
- chain_id: ChainID;
239
- /** * The requested chain name eg: `eth-mainnet`. */
240
- chain_name: ChainName;
241
- /** * URL link to the next and prev pages. */
242
- links: PaginationLinks;
243
- /** * An executable async function for the next page. */
244
- next: (() => Promise<GoldRushResponse<TransactionsBlockPageResponse>>) | null;
245
- /** * An executable async function for the prev page. */
246
- prev: (() => Promise<GoldRushResponse<TransactionsBlockPageResponse>>) | null;
247
- /** * List of response items. */
248
- items: Transaction[];
249
- }>;
250
- export type GasSummary = Nullable<{
251
- /** * The total number of transactions sent by the address. */
252
- total_sent_count: number;
253
- /** * The total transaction fees paid by the address, denoted in wei. */
254
- total_fees_paid: bigint;
255
- /** * The total transaction fees paid by the address, denoted in `quote-currency`. */
256
- total_gas_quote: number;
257
- /** * A prettier version of the quote for rendering purposes. */
258
- pretty_total_gas_quote: string;
259
- /** * The average gas quote per transaction. */
260
- average_gas_quote_per_tx: number;
261
- /** * A prettier version of the quote for rendering purposes. */
262
- pretty_average_gas_quote_per_tx: string;
263
- /** * The requested chain native gas token metadata. */
264
- gas_metadata: ContractMetadata;
265
- }>;
266
- export type GetTransactionQueryParamOpts = Nullable<{
267
- /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
268
- quoteCurrency?: Quote;
269
- /** * Omit log events. */
270
- noLogs?: boolean;
271
- /** * Whether to include internal transfers/transactions. */
272
- withInternal?: boolean;
273
- /** * Whether to include all transaction state changes with before and after values. */
274
- withState?: boolean;
275
- /** * Whether to include the transaction's input data such as the Method ID. */
276
- withInputData?: boolean;
277
- }>;
278
- export type GetAllTransactionsForAddressQueryParamOpts = Nullable<{
279
- /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
280
- quoteCurrency?: Quote;
281
- /** * Omit log events. */
282
- noLogs?: boolean;
283
- /** * Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order. */
284
- blockSignedAtAsc?: boolean;
285
- /** * Whether to include internal transfers/transactions. */
286
- withInternal?: boolean;
287
- /** * Whether to include all transaction state changes with before and after values. */
288
- withState?: boolean;
289
- /** * Whether to include the transaction's input data such as the Method ID. */
290
- withInputData?: boolean;
291
- }>;
292
- export type getTransactionsForBlockByPageQueryParamOpts = Nullable<{
293
- /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
294
- quoteCurrency?: Quote;
295
- /** * Omit log events. */
296
- noLogs?: boolean;
297
- }>;
298
- export type getPaginatedTransactionsForAddressQueryParamOpts = Nullable<{
299
- /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
300
- quoteCurrency?: Quote;
301
- /** * Omit log events. */
302
- noLogs?: boolean;
303
- /** * Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order. */
304
- blockSignedAtAsc?: boolean;
305
- }>;
306
- export type GetTimeBucketTransactionsForAddressQueryParamOpts = Nullable<{
307
- /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
308
- quoteCurrency?: Quote;
309
- /** * Omit log events. */
310
- noLogs?: boolean;
311
- }>;
312
- export type GetTransactionSummaryQueryParamOpts = Nullable<{
313
- /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
314
- quoteCurrency?: Quote;
315
- /** * Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions. */
316
- withGas?: boolean;
317
- }>;
318
- export type InternalTransfer = Nullable<{
319
- /** * The contract address sending the native token. */
320
- from_address: string;
321
- /** * The internal transfer recipient wallet address. */
322
- to_address: string;
323
- /** * The value of the internal transfer in wei. */
324
- value: string;
325
- /** * The gas available from the parent transaction or contract call. */
326
- gas_limit: number;
327
- }>;
328
- export type StateChange = Nullable<{
329
- /** * The address associated with the state change. */
330
- address: string;
331
- /** * The balance of the native token before the transaction in wei. */
332
- balance_before: string;
333
- /** * The balance of the native token after the transaction in wei. */
334
- balance_after: string;
335
- /** * List of before and after values in the storage address. */
336
- storage_changes: StorageChange[];
337
- /** * The transaction count for this address before the transaction. */
338
- nonce_before: number;
339
- /** * The transaction count for this address after the transaction. */
340
- nonce_after: number;
341
- }>;
342
- export type StorageChange = Nullable<{
343
- /** * The specific storage slot in the contract's storage space. */
344
- storage_address: string;
345
- /** * The hex value stored in the slot before the transaction. */
346
- value_before: string;
347
- /** * The hex value stored in the slot after the transaction. */
348
- value_after: string;
349
- }>;
350
- export type InputData = Nullable<{
351
- /** * The first 4 bytes of the invoked smart contract function signature. Used to identify the function being called in the contract. */
352
- method_id: string;
353
- }>;
354
- export type GetEarliestTransactionsForAddressQueryParamOpts = Nullable<{
355
- /** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
356
- quoteCurrency?: Quote;
357
- /** * Omit log events. */
358
- noLogs?: boolean;
359
- }>;
360
- export type EarliestTransactionsForAddressResponse = Nullable<{
361
- /** * The requested address. */
362
- address: string;
363
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
364
- updated_at: Date;
365
- /** * The requested quote currency eg: `USD`. */
366
- quote_currency: Quote;
367
- /** * The requested chain ID eg: `1`. */
368
- chain_id: ChainID;
369
- /** * The requested chain name eg: `eth-mainnet`. */
370
- chain_name: ChainName;
371
- complete: boolean;
372
- /** * The current bucket of the response. */
373
- current_bucket: number;
374
- /** * URL link to the next and prev pages. */
375
- links: PaginationLinks;
376
- /** * List of response items. */
377
- items: Transaction[];
378
- /** * An executable async function for the prev page. */
379
- prev: (() => Promise<GoldRushResponse<EarliestTransactionsForAddressResponse>>) | null;
380
- /** * An executable async function for the next page. */
381
- next: (() => Promise<GoldRushResponse<EarliestTransactionsForAddressResponse>>) | null;
382
- }>;
383
- export type TransactionsForBlockResponse = Nullable<{
384
- /** * The timestamp when the response was generated. Useful to show data staleness to users. */
385
- updated_at: Date;
386
- /** * The requested chain ID eg: `1`. */
387
- chain_id: ChainID;
388
- /** * The requested chain name eg: `eth-mainnet`. */
389
- chain_name: ChainName;
390
- /** * List of response items. */
391
- items: Transaction[];
392
- }>;
File without changes
File without changes
File without changes
File without changes