@covalenthq/client-sdk 1.0.2 → 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/LICENSE +201 -0
- package/README.md +223 -282
- package/dist/cjs/index.d.ts +17 -20
- package/dist/cjs/index.js +2331 -7659
- package/dist/cjs/index.js.map +1 -1
- 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/{util/CalculatePrettyBalance.d.ts → src/utils/functions/calculatePrettyBalance.d.ts} +0 -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/{esm/util/types/BalanceServiceTypes.d.ts → cjs/src/utils/types/BalanceService.types.d.ts} +91 -27
- package/dist/{es/util/types/BaseServiceTypes.d.ts → cjs/src/utils/types/BaseService.types.d.ts} +68 -18
- package/dist/cjs/src/utils/types/Generic.types.d.ts +477 -0
- package/dist/{esm/util/types/NftServiceTypes.d.ts → cjs/src/utils/types/NftService.types.d.ts} +53 -83
- package/dist/cjs/{util/types/PricingServiceTypes.d.ts → src/utils/types/PricingService.types.d.ts} +9 -3
- package/dist/{esm/util/types/SecurityServiceTypes.d.ts → cjs/src/utils/types/SecurityService.types.d.ts} +8 -7
- package/dist/{esm/util/types/TransactionServiceTypes.d.ts → cjs/src/utils/types/TransactionService.types.d.ts} +110 -24
- package/dist/es/index.d.ts +17 -20
- package/dist/es/index.js +2327 -7649
- package/dist/es/index.js.map +1 -1
- 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/{util/CalculatePrettyBalance.d.ts → src/utils/functions/calculatePrettyBalance.d.ts} +0 -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/{cjs/util/types/BalanceServiceTypes.d.ts → es/src/utils/types/BalanceService.types.d.ts} +91 -27
- package/dist/{esm/util/types/BaseServiceTypes.d.ts → es/src/utils/types/BaseService.types.d.ts} +68 -18
- package/dist/es/src/utils/types/Generic.types.d.ts +477 -0
- package/dist/{cjs/util/types/NftServiceTypes.d.ts → es/src/utils/types/NftService.types.d.ts} +53 -83
- package/dist/es/{util/types/PricingServiceTypes.d.ts → src/utils/types/PricingService.types.d.ts} +9 -3
- package/dist/{util/types/SecurityServiceTypes.d.ts → es/src/utils/types/SecurityService.types.d.ts} +8 -7
- package/dist/{cjs/util/types/TransactionServiceTypes.d.ts → es/src/utils/types/TransactionService.types.d.ts} +110 -24
- package/dist/esm/index.d.ts +17 -20
- package/dist/esm/index.js +2327 -7649
- package/dist/esm/index.js.map +1 -1
- 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/{util/CalculatePrettyBalance.d.ts → src/utils/functions/calculatePrettyBalance.d.ts} +0 -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/{util/types/BalanceServiceTypes.d.ts → esm/src/utils/types/BalanceService.types.d.ts} +91 -27
- package/dist/{cjs/util/types/BaseServiceTypes.d.ts → esm/src/utils/types/BaseService.types.d.ts} +68 -18
- package/dist/esm/src/utils/types/Generic.types.d.ts +477 -0
- package/dist/{util/types/NftServiceTypes.d.ts → esm/src/utils/types/NftService.types.d.ts} +53 -83
- package/dist/esm/{util/types/PricingServiceTypes.d.ts → src/utils/types/PricingService.types.d.ts} +9 -3
- package/dist/{es/util/types/SecurityServiceTypes.d.ts → esm/src/utils/types/SecurityService.types.d.ts} +8 -7
- package/dist/{util/types/TransactionServiceTypes.d.ts → esm/src/utils/types/TransactionService.types.d.ts} +110 -24
- package/package.json +25 -12
- package/dist/cjs/services/BalanceService.d.ts +0 -638
- package/dist/cjs/services/BaseService.d.ts +0 -571
- package/dist/cjs/services/CovalentClient.d.ts +0 -57
- package/dist/cjs/services/NftService.d.ts +0 -686
- package/dist/cjs/services/PricingService.d.ts +0 -103
- package/dist/cjs/services/SecurityService.d.ts +0 -162
- package/dist/cjs/services/TransactionService.d.ts +0 -711
- package/dist/cjs/services/XykService.d.ts +0 -1018
- package/dist/cjs/util/ApiHelpers.d.ts +0 -6
- package/dist/cjs/util/ApiKeyValidator.d.ts +0 -8
- package/dist/cjs/util/Chains.d.ts +0 -223
- package/dist/cjs/util/backoff.d.ts +0 -12
- package/dist/cjs/util/prettifyCurrency.d.ts +0 -2
- package/dist/cjs/util/types/GenericTypes.d.ts +0 -116
- package/dist/cjs/util/types/SecurityServiceTypes.d.ts +0 -121
- package/dist/cjs/util/types/XykServiceTypes.d.ts +0 -687
- package/dist/es/services/BalanceService.d.ts +0 -638
- package/dist/es/services/BaseService.d.ts +0 -571
- package/dist/es/services/CovalentClient.d.ts +0 -57
- package/dist/es/services/NftService.d.ts +0 -686
- package/dist/es/services/PricingService.d.ts +0 -103
- package/dist/es/services/SecurityService.d.ts +0 -162
- package/dist/es/services/TransactionService.d.ts +0 -711
- package/dist/es/services/XykService.d.ts +0 -1018
- package/dist/es/util/ApiHelpers.d.ts +0 -6
- package/dist/es/util/ApiKeyValidator.d.ts +0 -8
- package/dist/es/util/Chains.d.ts +0 -223
- package/dist/es/util/backoff.d.ts +0 -12
- package/dist/es/util/prettifyCurrency.d.ts +0 -2
- package/dist/es/util/types/BalanceServiceTypes.d.ts +0 -378
- package/dist/es/util/types/GenericTypes.d.ts +0 -116
- package/dist/es/util/types/NftServiceTypes.d.ts +0 -303
- package/dist/es/util/types/TransactionServiceTypes.d.ts +0 -388
- package/dist/es/util/types/XykServiceTypes.d.ts +0 -687
- package/dist/esm/services/BalanceService.d.ts +0 -638
- package/dist/esm/services/BaseService.d.ts +0 -571
- package/dist/esm/services/CovalentClient.d.ts +0 -57
- package/dist/esm/services/NftService.d.ts +0 -686
- package/dist/esm/services/PricingService.d.ts +0 -103
- package/dist/esm/services/SecurityService.d.ts +0 -162
- package/dist/esm/services/TransactionService.d.ts +0 -711
- package/dist/esm/services/XykService.d.ts +0 -1018
- package/dist/esm/util/ApiHelpers.d.ts +0 -6
- package/dist/esm/util/ApiKeyValidator.d.ts +0 -8
- package/dist/esm/util/Chains.d.ts +0 -223
- package/dist/esm/util/backoff.d.ts +0 -12
- package/dist/esm/util/prettifyCurrency.d.ts +0 -2
- package/dist/esm/util/types/GenericTypes.d.ts +0 -116
- package/dist/esm/util/types/XykServiceTypes.d.ts +0 -687
- package/dist/index.d.ts +0 -20
- package/dist/index.js +0 -21
- package/dist/index.js.map +0 -1
- package/dist/services/BalanceService.d.ts +0 -638
- package/dist/services/BalanceService.js +0 -959
- package/dist/services/BalanceService.js.map +0 -1
- package/dist/services/BaseService.d.ts +0 -571
- package/dist/services/BaseService.js +0 -1202
- package/dist/services/BaseService.js.map +0 -1
- package/dist/services/CovalentClient.d.ts +0 -57
- package/dist/services/CovalentClient.js +0 -49
- package/dist/services/CovalentClient.js.map +0 -1
- package/dist/services/NftService.d.ts +0 -686
- package/dist/services/NftService.js +0 -1490
- package/dist/services/NftService.js.map +0 -1
- package/dist/services/PricingService.d.ts +0 -103
- package/dist/services/PricingService.js +0 -155
- package/dist/services/PricingService.js.map +0 -1
- package/dist/services/SecurityService.d.ts +0 -162
- package/dist/services/SecurityService.js +0 -249
- package/dist/services/SecurityService.js.map +0 -1
- package/dist/services/TransactionService.d.ts +0 -711
- package/dist/services/TransactionService.js +0 -1687
- package/dist/services/TransactionService.js.map +0 -1
- package/dist/services/XykService.d.ts +0 -1018
- package/dist/services/XykService.js +0 -1827
- package/dist/services/XykService.js.map +0 -1
- package/dist/util/ApiHelpers.d.ts +0 -6
- package/dist/util/ApiHelpers.js +0 -87
- package/dist/util/ApiHelpers.js.map +0 -1
- package/dist/util/ApiKeyValidator.d.ts +0 -8
- package/dist/util/ApiKeyValidator.js +0 -13
- package/dist/util/ApiKeyValidator.js.map +0 -1
- package/dist/util/CalculatePrettyBalance.d.ts +0 -1
- package/dist/util/CalculatePrettyBalance.js +0 -32
- package/dist/util/CalculatePrettyBalance.js.map +0 -1
- package/dist/util/Chains.d.ts +0 -223
- package/dist/util/Chains.js +0 -225
- package/dist/util/Chains.js.map +0 -1
- package/dist/util/backoff.d.ts +0 -12
- package/dist/util/backoff.js +0 -47
- package/dist/util/backoff.js.map +0 -1
- package/dist/util/prettifyCurrency.d.ts +0 -2
- package/dist/util/prettifyCurrency.js +0 -69
- package/dist/util/prettifyCurrency.js.map +0 -1
- package/dist/util/types/BalanceServiceTypes.js +0 -2
- package/dist/util/types/BalanceServiceTypes.js.map +0 -1
- package/dist/util/types/BaseServiceTypes.d.ts +0 -276
- package/dist/util/types/BaseServiceTypes.js +0 -2
- package/dist/util/types/BaseServiceTypes.js.map +0 -1
- package/dist/util/types/GenericTypes.d.ts +0 -116
- package/dist/util/types/GenericTypes.js +0 -2
- package/dist/util/types/GenericTypes.js.map +0 -1
- package/dist/util/types/NftServiceTypes.js +0 -2
- package/dist/util/types/NftServiceTypes.js.map +0 -1
- package/dist/util/types/PricingServiceTypes.d.ts +0 -33
- package/dist/util/types/PricingServiceTypes.js +0 -2
- package/dist/util/types/PricingServiceTypes.js.map +0 -1
- package/dist/util/types/SecurityServiceTypes.js +0 -2
- package/dist/util/types/SecurityServiceTypes.js.map +0 -1
- package/dist/util/types/TransactionServiceTypes.js +0 -2
- package/dist/util/types/TransactionServiceTypes.js.map +0 -1
- package/dist/util/types/XykServiceTypes.d.ts +0 -687
- package/dist/util/types/XykServiceTypes.js +0 -2
- package/dist/util/types/XykServiceTypes.js.map +0 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { type Execution } from "../utils/functions/execution";
|
|
2
|
+
import { type Chain, type GoldRushResponse } from "../utils/types/Generic.types";
|
|
3
|
+
import { type GetAllTransactionsForAddressQueryParamOpts, type GetTimeBucketTransactionsForAddressQueryParamOpts, type GetTransactionQueryParamOpts, type GetTransactionSummaryQueryParamOpts, type GetTransactionsForAddressV3QueryParamOpts, type GetTransactionsForBlockHashByPageQueryParamOpts, type GetTransactionsForBlockHashQueryParamOpts, type GetTransactionsForBlockQueryParamOpts, type RecentTransactionsResponse, type TransactionResponse, type TransactionsBlockPageResponse, type TransactionsBlockResponse, type TransactionsResponse, type TransactionsSummaryResponse, type TransactionsTimeBucketResponse } from "../utils/types/TransactionService.types";
|
|
4
|
+
export declare class TransactionService {
|
|
5
|
+
private execution;
|
|
6
|
+
constructor(execution: Execution);
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* Commonly used to fetch and render a single transaction including its decoded log events. Additionally return semantically decoded information for DEX trades, lending and NFT sales.
|
|
10
|
+
*
|
|
11
|
+
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
12
|
+
* @param {string} txHash - The transaction hash.
|
|
13
|
+
* @param {GetTransactionQueryParamOpts} queryParamOpts
|
|
14
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
15
|
+
* - `noLogs`: Omit log events.
|
|
16
|
+
* - `withDex`: 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.
|
|
17
|
+
* - `withNftSales`: Decoded NFT sales details including marketplace (e.g. Opensea) and cached media links. Additional 0.05 credits charged if data available.
|
|
18
|
+
* - `withLending`: 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.
|
|
19
|
+
* - `withSafe`: Include safe details.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
getTransaction(chainName: Chain, txHash: string, queryParamOpts?: GetTransactionQueryParamOpts): Promise<GoldRushResponse<TransactionResponse>>;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* Commonly used to fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
|
|
26
|
+
*
|
|
27
|
+
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
28
|
+
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
29
|
+
* @param {GetAllTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
30
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
31
|
+
* - `noLogs`: Omit log events.
|
|
32
|
+
* - `blockSignedAtAsc`: Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order.
|
|
33
|
+
* - `withSafe`: Include safe details.
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
getAllTransactionsForAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): AsyncIterable<GoldRushResponse<RecentTransactionsResponse>>;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* Commonly used to fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
|
|
40
|
+
*
|
|
41
|
+
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
42
|
+
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
43
|
+
* @param {GetAllTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
44
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
45
|
+
* - `noLogs`: Omit log events.
|
|
46
|
+
* - `blockSignedAtAsc`: Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order.
|
|
47
|
+
* - `withSafe`: Include safe details.
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
getAllTransactionsForAddressByPage(chainName: Chain, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): Promise<GoldRushResponse<RecentTransactionsResponse>>;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
|
|
54
|
+
*
|
|
55
|
+
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
56
|
+
* @param {number} blockHeight - The requested block height.
|
|
57
|
+
* @param {GetTransactionsForBlockQueryParamOpts} queryParamOpts
|
|
58
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
59
|
+
* - `noLogs`: Omit log events.
|
|
60
|
+
* - `withSafe`: Include safe details.
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
getTransactionsForBlock(chainName: Chain, blockHeight: number | string, queryParamOpts?: GetTransactionsForBlockQueryParamOpts): Promise<GoldRushResponse<TransactionsBlockResponse>>;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* Commonly used to fetch the earliest and latest transactions, and the transaction count for a wallet. Calculate the age of the wallet and the time it has been idle and quickly gain insights into their engagement with web3.
|
|
67
|
+
*
|
|
68
|
+
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
69
|
+
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
70
|
+
* @param {GetTransactionSummaryQueryParamOpts} queryParamOpts
|
|
71
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
72
|
+
* - `withGas`: Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions.
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
getTransactionSummary(chainName: Chain, walletAddress: string, queryParamOpts?: GetTransactionSummaryQueryParamOpts): Promise<GoldRushResponse<TransactionsSummaryResponse>>;
|
|
76
|
+
/**
|
|
77
|
+
*
|
|
78
|
+
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
79
|
+
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
80
|
+
* @param {number} page - The requested page, 0-indexed.
|
|
81
|
+
* @param {GetTransactionsForAddressV3QueryParamOpts} queryParamOpts
|
|
82
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
83
|
+
* - `noLogs`: Omit log events.
|
|
84
|
+
* - `blockSignedAtAsc`: Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order.
|
|
85
|
+
* - `withSafe`: Include safe details.
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
getTransactionsForAddressV3(chainName: Chain, walletAddress: string, page: number, queryParamOpts?: GetTransactionsForAddressV3QueryParamOpts): Promise<GoldRushResponse<TransactionsResponse>>;
|
|
89
|
+
/**
|
|
90
|
+
*
|
|
91
|
+
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
92
|
+
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
93
|
+
* @param {number} timeBucket - The 0-indexed 15-minute time bucket. E.g. 27 Feb 2023 05:23 GMT = 1677475383 (Unix time). 1677475383/900=1863861 timeBucket.
|
|
94
|
+
* @param {GetTimeBucketTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
95
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
96
|
+
* - `noLogs`: Omit log events.
|
|
97
|
+
* - `withSafe`: Include safe details.
|
|
98
|
+
*
|
|
99
|
+
*/
|
|
100
|
+
getTimeBucketTransactionsForAddress(chainName: Chain, walletAddress: string, timeBucket: number, queryParamOpts?: GetTimeBucketTransactionsForAddressQueryParamOpts): Promise<GoldRushResponse<TransactionsTimeBucketResponse>>;
|
|
101
|
+
/**
|
|
102
|
+
*
|
|
103
|
+
* Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
|
|
104
|
+
*
|
|
105
|
+
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
106
|
+
* @param {string} blockHash - The requested block hash.
|
|
107
|
+
* @param {number} page - The requested 0-indexed page number.
|
|
108
|
+
* @param {GetTransactionsForBlockHashByPageQueryParamOpts} queryParamOpts
|
|
109
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
110
|
+
* - `noLogs`: Omit log events.
|
|
111
|
+
* - `withSafe`: Include safe details.
|
|
112
|
+
*
|
|
113
|
+
*/
|
|
114
|
+
getTransactionsForBlockHashByPage(chainName: Chain, blockHash: string, page: number, queryParamOpts?: GetTransactionsForBlockHashByPageQueryParamOpts): Promise<GoldRushResponse<TransactionsBlockPageResponse>>;
|
|
115
|
+
/**
|
|
116
|
+
*
|
|
117
|
+
* Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
|
|
118
|
+
*
|
|
119
|
+
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
120
|
+
* @param {string} blockHash - The requested block hash.
|
|
121
|
+
* @param {GetTransactionsForBlockHashQueryParamOpts} queryParamOpts
|
|
122
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
123
|
+
* - `noLogs`: Omit log events.
|
|
124
|
+
* - `withSafe`: Include safe details.
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
127
|
+
getTransactionsForBlockHash(chainName: Chain, blockHash: string, queryParamOpts?: GetTransactionsForBlockHashQueryParamOpts): Promise<GoldRushResponse<TransactionsBlockResponse>>;
|
|
128
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const bigIntParser: (val: null | undefined | string | number | bigint) => bigint | null;
|
package/dist/es/{util/CalculatePrettyBalance.d.ts → src/utils/functions/calculatePrettyBalance.d.ts}
RENAMED
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type GoldRushClientSettings, type GoldRushResponse } from "../types/Generic.types";
|
|
2
|
+
export declare class Execution {
|
|
3
|
+
private settings;
|
|
4
|
+
private headers;
|
|
5
|
+
private maxRetries;
|
|
6
|
+
private retryDelay;
|
|
7
|
+
private enableRetry;
|
|
8
|
+
private processes;
|
|
9
|
+
constructor(settings: GoldRushClientSettings, headers: Record<string, string>);
|
|
10
|
+
execute<T>(endpoint: URL, parseData: (data: GoldRushResponse<T>) => GoldRushResponse<T>): Promise<GoldRushResponse<T>>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isValidApiKey: (apiKey: string) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type GoldRushResponse, type Pagination, type PaginationLinks } from "../types/Generic.types";
|
|
2
|
+
import { type Execution } from "./execution";
|
|
3
|
+
export declare function paginateEndpoint<T extends {
|
|
4
|
+
pagination: Pagination;
|
|
5
|
+
} | {
|
|
6
|
+
links: PaginationLinks;
|
|
7
|
+
}>(endpoint: URL, execution: Execution, parseData: (data: GoldRushResponse<T>) => GoldRushResponse<T>, implementation: "pagination" | "links"): AsyncIterable<GoldRushResponse<T>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type ChainID, type ChainName, type ContractMetadata, type Explorer, type LogoUrls, type NftCollectionAttribute, type Pagination, type Quote } from "./Generic.types";
|
|
2
2
|
export interface BalancesResponse {
|
|
3
3
|
/** * The requested address. */
|
|
4
4
|
address: string;
|
|
5
5
|
/** * The requested chain ID eg: `1`. */
|
|
6
|
-
chain_id:
|
|
6
|
+
chain_id: ChainID;
|
|
7
7
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
8
|
-
chain_name:
|
|
8
|
+
chain_name: ChainName;
|
|
9
9
|
/** * The requested quote currency eg: `USD`. */
|
|
10
10
|
quote_currency: string;
|
|
11
11
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
@@ -39,9 +39,9 @@ export interface BalanceItem {
|
|
|
39
39
|
/** * Denotes whether the token is suspected spam. */
|
|
40
40
|
is_spam: boolean;
|
|
41
41
|
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
42
|
-
balance: bigint
|
|
42
|
+
balance: bigint;
|
|
43
43
|
/** * The 24h asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
44
|
-
balance_24h: bigint
|
|
44
|
+
balance_24h: bigint;
|
|
45
45
|
/** * The exchange rate for the requested quote currency. */
|
|
46
46
|
quote_rate: number;
|
|
47
47
|
/** * The 24h exchange rate for the requested quote currency. */
|
|
@@ -65,15 +65,15 @@ export interface ProtocolMetadata {
|
|
|
65
65
|
}
|
|
66
66
|
export interface BalanceNftData {
|
|
67
67
|
/** * The token's id. */
|
|
68
|
-
token_id: bigint
|
|
68
|
+
token_id: bigint;
|
|
69
69
|
/** * The count of the number of NFTs with this ID. */
|
|
70
|
-
token_balance: bigint
|
|
70
|
+
token_balance: bigint;
|
|
71
71
|
/** * External URL for additional metadata. */
|
|
72
72
|
token_url: string;
|
|
73
73
|
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
74
74
|
supports_erc: string[];
|
|
75
75
|
/** * The latest price value on chain of the token ID. */
|
|
76
|
-
token_price_wei: bigint
|
|
76
|
+
token_price_wei: bigint;
|
|
77
77
|
/** * The latest quote_rate of the token ID denominated in unscaled ETH. */
|
|
78
78
|
token_quote_rate_eth: string;
|
|
79
79
|
/** * The address of the original owner of this NFT. */
|
|
@@ -106,9 +106,9 @@ export interface PortfolioResponse {
|
|
|
106
106
|
/** * The requested quote currency eg: `USD`. */
|
|
107
107
|
quote_currency: string;
|
|
108
108
|
/** * The requested chain ID eg: `1`. */
|
|
109
|
-
chain_id:
|
|
109
|
+
chain_id: ChainID;
|
|
110
110
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
111
|
-
chain_name:
|
|
111
|
+
chain_name: ChainName;
|
|
112
112
|
/** * List of response items. */
|
|
113
113
|
items: PortfolioItem[];
|
|
114
114
|
}
|
|
@@ -136,7 +136,7 @@ export interface HoldingItem {
|
|
|
136
136
|
}
|
|
137
137
|
export interface OhlcItem {
|
|
138
138
|
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
139
|
-
balance: bigint
|
|
139
|
+
balance: bigint;
|
|
140
140
|
/** * The current balance converted to fiat in `quote-currency`. */
|
|
141
141
|
quote: number;
|
|
142
142
|
/** * A prettier version of the quote for rendering purposes. */
|
|
@@ -150,9 +150,9 @@ export interface Erc20TransfersResponse {
|
|
|
150
150
|
/** * The requested quote currency eg: `USD`. */
|
|
151
151
|
quote_currency: string;
|
|
152
152
|
/** * The requested chain ID eg: `1`. */
|
|
153
|
-
chain_id:
|
|
153
|
+
chain_id: ChainID;
|
|
154
154
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
155
|
-
chain_name:
|
|
155
|
+
chain_name: ChainName;
|
|
156
156
|
/** * List of response items. */
|
|
157
157
|
items: BlockTransactionWithContractTransfers[];
|
|
158
158
|
/** * Pagination metadata. */
|
|
@@ -182,7 +182,7 @@ export interface BlockTransactionWithContractTransfers {
|
|
|
182
182
|
/** * The label of `to` address. */
|
|
183
183
|
to_address_label: string;
|
|
184
184
|
/** * The value attached to this tx. */
|
|
185
|
-
value: bigint
|
|
185
|
+
value: bigint;
|
|
186
186
|
/** * The value attached in `quote-currency` to this tx. */
|
|
187
187
|
value_quote: number;
|
|
188
188
|
/** * A prettier version of the quote for rendering purposes. */
|
|
@@ -195,7 +195,7 @@ export interface BlockTransactionWithContractTransfers {
|
|
|
195
195
|
/** * The gas price at the time of this tx. */
|
|
196
196
|
gas_price: number;
|
|
197
197
|
/** * The transaction's gas_price * gas_spent, denoted in wei. */
|
|
198
|
-
fees_paid: bigint
|
|
198
|
+
fees_paid: bigint;
|
|
199
199
|
/** * The gas spent in `quote-currency` denomination. */
|
|
200
200
|
gas_quote: number;
|
|
201
201
|
/** * A prettier version of the quote for rendering purposes. */
|
|
@@ -230,9 +230,9 @@ export interface TokenTransferItem {
|
|
|
230
230
|
/** * Categorizes token transactions as either `transfer-in` or `transfer-out`, indicating whether tokens are being received or sent from an account. */
|
|
231
231
|
transfer_type: string;
|
|
232
232
|
/** * The delta attached to this transfer. */
|
|
233
|
-
delta: bigint
|
|
233
|
+
delta: bigint;
|
|
234
234
|
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
235
|
-
balance: bigint
|
|
235
|
+
balance: bigint;
|
|
236
236
|
/** * The exchange rate for the requested quote currency. */
|
|
237
237
|
quote_rate: number;
|
|
238
238
|
/** * The current delta converted to fiat in `quote-currency`. */
|
|
@@ -255,9 +255,9 @@ export interface TokenHoldersResponse {
|
|
|
255
255
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
256
256
|
updated_at: Date;
|
|
257
257
|
/** * The requested chain ID eg: `1`. */
|
|
258
|
-
chain_id:
|
|
258
|
+
chain_id: ChainID;
|
|
259
259
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
260
|
-
chain_name:
|
|
260
|
+
chain_name: ChainName;
|
|
261
261
|
/** * List of response items. */
|
|
262
262
|
items: TokenHolder[];
|
|
263
263
|
/** * Pagination metadata. */
|
|
@@ -279,9 +279,9 @@ export interface TokenHolder {
|
|
|
279
279
|
/** * The requested address. */
|
|
280
280
|
address: string;
|
|
281
281
|
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
282
|
-
balance: bigint
|
|
282
|
+
balance: bigint;
|
|
283
283
|
/** * Total supply of this token. */
|
|
284
|
-
total_supply: bigint
|
|
284
|
+
total_supply: bigint;
|
|
285
285
|
/** * The height of the block. */
|
|
286
286
|
block_height: number;
|
|
287
287
|
}
|
|
@@ -293,9 +293,9 @@ export interface HistoricalBalancesResponse {
|
|
|
293
293
|
/** * The requested quote currency eg: `USD`. */
|
|
294
294
|
quote_currency: string;
|
|
295
295
|
/** * The requested chain ID eg: `1`. */
|
|
296
|
-
chain_id:
|
|
296
|
+
chain_id: ChainID;
|
|
297
297
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
298
|
-
chain_name:
|
|
298
|
+
chain_name: ChainName;
|
|
299
299
|
/** * List of response items. */
|
|
300
300
|
items: HistoricalBalanceItem[];
|
|
301
301
|
}
|
|
@@ -326,7 +326,7 @@ export interface HistoricalBalanceItem {
|
|
|
326
326
|
/** * Denotes whether the token is suspected spam. */
|
|
327
327
|
is_spam: boolean;
|
|
328
328
|
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
329
|
-
balance: bigint
|
|
329
|
+
balance: bigint;
|
|
330
330
|
/** * The exchange rate for the requested quote currency. */
|
|
331
331
|
quote_rate: number;
|
|
332
332
|
/** * The current balance converted to fiat in `quote-currency`. */
|
|
@@ -346,9 +346,9 @@ export interface TokenBalanceNativeResponse {
|
|
|
346
346
|
/** * The requested quote currency eg: `USD`. */
|
|
347
347
|
quote_currency: string;
|
|
348
348
|
/** * The requested chain ID eg: `1`. */
|
|
349
|
-
chain_id:
|
|
349
|
+
chain_id: ChainID;
|
|
350
350
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
351
|
-
chain_name:
|
|
351
|
+
chain_name: ChainName;
|
|
352
352
|
/** * List of response items. */
|
|
353
353
|
items: NativeBalanceItem[];
|
|
354
354
|
}
|
|
@@ -368,7 +368,7 @@ export interface NativeBalanceItem {
|
|
|
368
368
|
/** * The height of the block. */
|
|
369
369
|
block_height: number;
|
|
370
370
|
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
371
|
-
balance: bigint
|
|
371
|
+
balance: bigint;
|
|
372
372
|
/** * The exchange rate for the requested quote currency. */
|
|
373
373
|
quote_rate: number;
|
|
374
374
|
/** * The current balance converted to fiat in `quote-currency`. */
|
|
@@ -376,3 +376,67 @@ export interface NativeBalanceItem {
|
|
|
376
376
|
/** * A prettier version of the quote for rendering purposes. */
|
|
377
377
|
pretty_quote: string;
|
|
378
378
|
}
|
|
379
|
+
export interface GetTokenBalancesForWalletAddressQueryParamOpts {
|
|
380
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
381
|
+
quoteCurrency?: Quote;
|
|
382
|
+
/** * If `true`, NFTs will be included in the response. */
|
|
383
|
+
nft?: boolean;
|
|
384
|
+
/** * If `true`, only NFTs that have been cached will be included in the response. Helpful for faster response times. */
|
|
385
|
+
noNftFetch?: boolean;
|
|
386
|
+
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
387
|
+
noSpam?: boolean;
|
|
388
|
+
/** * If `true`, the response shape is limited to a list of collections and token ids, omitting metadata and asset information. Helpful for faster response times and wallets holding a large number of NFTs. */
|
|
389
|
+
noNftAssetMetadata?: boolean;
|
|
390
|
+
}
|
|
391
|
+
export interface GetHistoricalPortfolioForWalletAddressQueryParamOpts {
|
|
392
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
393
|
+
quoteCurrency?: Quote;
|
|
394
|
+
/** * The number of days to return data for. Defaults to 30 days. */
|
|
395
|
+
days?: number;
|
|
396
|
+
}
|
|
397
|
+
export interface GetErc20TransfersForWalletAddressQueryParamOpts {
|
|
398
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
399
|
+
quoteCurrency?: Quote;
|
|
400
|
+
/** * The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically. */
|
|
401
|
+
contractAddress?: string;
|
|
402
|
+
/** * The block height to start from, defaults to `0`. */
|
|
403
|
+
startingBlock?: number;
|
|
404
|
+
/** * The block height to end at, defaults to current block height. */
|
|
405
|
+
endingBlock?: number;
|
|
406
|
+
/** * Number of items per page. Omitting this parameter defaults to 100. */
|
|
407
|
+
pageSize?: number;
|
|
408
|
+
/** * 0-indexed page number to begin pagination. */
|
|
409
|
+
pageNumber?: number;
|
|
410
|
+
}
|
|
411
|
+
export interface GetTokenHoldersV2ForTokenAddressQueryParamOpts {
|
|
412
|
+
/** * Ending block to define a block range. Omitting this parameter defaults to the latest block height. */
|
|
413
|
+
blockHeight?: number | string;
|
|
414
|
+
/** * Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date. */
|
|
415
|
+
date?: string;
|
|
416
|
+
/** * Number of items per page. Note: Currently, only values of `100` and `1000` are supported. Omitting this parameter defaults to 100. */
|
|
417
|
+
pageSize?: number;
|
|
418
|
+
/** * 0-indexed page number to begin pagination. */
|
|
419
|
+
pageNumber?: number;
|
|
420
|
+
}
|
|
421
|
+
export interface GetHistoricalTokenBalancesForWalletAddressQueryParamOpts {
|
|
422
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
423
|
+
quoteCurrency?: Quote;
|
|
424
|
+
/** * If `true`, NFTs will be included in the response. */
|
|
425
|
+
nft?: boolean;
|
|
426
|
+
/** * If `true`, only NFTs that have been cached will be included in the response. Helpful for faster response times. */
|
|
427
|
+
noNftFetch?: boolean;
|
|
428
|
+
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
429
|
+
noSpam?: boolean;
|
|
430
|
+
/** * If `true`, the response shape is limited to a list of collections and token ids, omitting metadata and asset information. Helpful for faster response times and wallets holding a large number of NFTs. */
|
|
431
|
+
noNftAssetMetadata?: boolean;
|
|
432
|
+
/** * Ending block to define a block range. Omitting this parameter defaults to the latest block height. */
|
|
433
|
+
blockHeight?: number | string;
|
|
434
|
+
/** * Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date. */
|
|
435
|
+
date?: string;
|
|
436
|
+
}
|
|
437
|
+
export interface GetNativeTokenBalanceQueryParamOpts {
|
|
438
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
439
|
+
quoteCurrency?: Quote;
|
|
440
|
+
/** * Ending block to define a block range. Omitting this parameter defaults to the latest block height. */
|
|
441
|
+
blockHeight?: number | string;
|
|
442
|
+
}
|
package/dist/{esm/util/types/BaseServiceTypes.d.ts → es/src/utils/types/BaseService.types.d.ts}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DecodedItem, LogEvent, Pagination } from "./
|
|
1
|
+
import { type ChainID, type ChainName, type DecodedItem, type LogEvent, type Pagination, type Quote } from "./Generic.types";
|
|
2
2
|
export interface BlockResponse {
|
|
3
3
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
4
4
|
updated_at: Date;
|
|
5
5
|
/** * The requested chain ID eg: `1`. */
|
|
6
|
-
chain_id:
|
|
6
|
+
chain_id: ChainID;
|
|
7
7
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
8
|
-
chain_name:
|
|
8
|
+
chain_name: ChainName;
|
|
9
9
|
/** * List of response items. */
|
|
10
10
|
items: Block[];
|
|
11
11
|
}
|
|
@@ -35,9 +35,9 @@ export interface ResolvedAddress {
|
|
|
35
35
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
36
36
|
updated_at: Date;
|
|
37
37
|
/** * The requested chain ID eg: `1`. */
|
|
38
|
-
chain_id:
|
|
38
|
+
chain_id: ChainID;
|
|
39
39
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
40
|
-
chain_name:
|
|
40
|
+
chain_name: ChainName;
|
|
41
41
|
/** * List of response items. */
|
|
42
42
|
items: ResolvedAddressItem[];
|
|
43
43
|
}
|
|
@@ -50,9 +50,9 @@ export interface BlockHeightsResponse {
|
|
|
50
50
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
51
51
|
updated_at: Date;
|
|
52
52
|
/** * The requested chain ID eg: `1`. */
|
|
53
|
-
chain_id:
|
|
53
|
+
chain_id: ChainID;
|
|
54
54
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
55
|
-
chain_name:
|
|
55
|
+
chain_name: ChainName;
|
|
56
56
|
/** * List of response items. */
|
|
57
57
|
items: BlockHeights[];
|
|
58
58
|
/** * Pagination metadata. */
|
|
@@ -84,9 +84,9 @@ export interface GetLogsResponse {
|
|
|
84
84
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
85
85
|
updated_at: Date;
|
|
86
86
|
/** * The requested chain ID eg: `1`. */
|
|
87
|
-
chain_id:
|
|
87
|
+
chain_id: ChainID;
|
|
88
88
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
89
|
-
chain_name:
|
|
89
|
+
chain_name: ChainName;
|
|
90
90
|
/** * List of response items. */
|
|
91
91
|
items: GetLogsEvent[];
|
|
92
92
|
}
|
|
@@ -130,9 +130,9 @@ export interface LogEventsByAddressResponse {
|
|
|
130
130
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
131
131
|
updated_at: Date;
|
|
132
132
|
/** * The requested chain ID eg: `1`. */
|
|
133
|
-
chain_id:
|
|
133
|
+
chain_id: ChainID;
|
|
134
134
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
135
|
-
chain_name:
|
|
135
|
+
chain_name: ChainName;
|
|
136
136
|
/** * List of response items. */
|
|
137
137
|
items: LogEvent[];
|
|
138
138
|
/** * Pagination metadata. */
|
|
@@ -142,9 +142,9 @@ export interface LogEventsByTopicHashResponse {
|
|
|
142
142
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
143
143
|
updated_at: Date;
|
|
144
144
|
/** * The requested chain ID eg: `1`. */
|
|
145
|
-
chain_id:
|
|
145
|
+
chain_id: ChainID;
|
|
146
146
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
147
|
-
chain_name:
|
|
147
|
+
chain_name: ChainName;
|
|
148
148
|
/** * List of response items. */
|
|
149
149
|
items: LogEvent[];
|
|
150
150
|
/** * Pagination metadata. */
|
|
@@ -160,7 +160,7 @@ export interface ChainItem {
|
|
|
160
160
|
/** * The chain name eg: `eth-mainnet`. */
|
|
161
161
|
name: string;
|
|
162
162
|
/** * The requested chain ID eg: `1`. */
|
|
163
|
-
chain_id:
|
|
163
|
+
chain_id: ChainID;
|
|
164
164
|
/** * True if the chain is a testnet. */
|
|
165
165
|
is_testnet: boolean;
|
|
166
166
|
/** * Schema name to use for direct SQL. */
|
|
@@ -206,7 +206,7 @@ export interface ChainStatusItem {
|
|
|
206
206
|
/** * The chain name eg: `eth-mainnet`. */
|
|
207
207
|
name: string;
|
|
208
208
|
/** * The requested chain ID eg: `1`. */
|
|
209
|
-
chain_id:
|
|
209
|
+
chain_id: ChainID;
|
|
210
210
|
/** * True if the chain is a testnet. */
|
|
211
211
|
is_testnet: boolean;
|
|
212
212
|
/** * A svg logo url for the chain. */
|
|
@@ -238,9 +238,9 @@ export interface ChainActivityEvent extends ChainItem {
|
|
|
238
238
|
}
|
|
239
239
|
export interface GasPricesResponse {
|
|
240
240
|
/** * The requested chain ID eg: `1`. */
|
|
241
|
-
chain_id:
|
|
241
|
+
chain_id: ChainID;
|
|
242
242
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
243
|
-
chain_name:
|
|
243
|
+
chain_name: ChainName;
|
|
244
244
|
/** * The requested quote currency eg: `USD`. */
|
|
245
245
|
quote_currency: string;
|
|
246
246
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
@@ -250,7 +250,7 @@ export interface GasPricesResponse {
|
|
|
250
250
|
/** * The exchange rate for the requested quote currency. */
|
|
251
251
|
gas_quote_rate: number;
|
|
252
252
|
/** * The lowest gas fee for the latest block height. */
|
|
253
|
-
base_fee: bigint
|
|
253
|
+
base_fee: bigint;
|
|
254
254
|
/** * List of response items. */
|
|
255
255
|
items: PriceItem[];
|
|
256
256
|
}
|
|
@@ -274,3 +274,53 @@ export interface OtherFees {
|
|
|
274
274
|
/** * The calculated L1 gas spent, when applicable, in quote-currency, for the specified time interval. */
|
|
275
275
|
l1_gas_quote: number;
|
|
276
276
|
}
|
|
277
|
+
export interface GetBlockHeightsQueryParamOpts {
|
|
278
|
+
/** * Number of items per page. Omitting this parameter defaults to 100. */
|
|
279
|
+
pageSize?: number;
|
|
280
|
+
/** * 0-indexed page number to begin pagination. */
|
|
281
|
+
pageNumber?: number;
|
|
282
|
+
}
|
|
283
|
+
export interface GetLogsQueryParamOpts {
|
|
284
|
+
/** * The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`. */
|
|
285
|
+
startingBlock?: number;
|
|
286
|
+
/** * The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`. */
|
|
287
|
+
endingBlock?: string;
|
|
288
|
+
/** * The address of the log events sender contract. */
|
|
289
|
+
address?: string;
|
|
290
|
+
/** * The topic hash(es) to retrieve logs with. */
|
|
291
|
+
topics?: string;
|
|
292
|
+
/** * The block hash to retrieve logs for. */
|
|
293
|
+
blockHash?: string;
|
|
294
|
+
/** * Omit decoded log events. */
|
|
295
|
+
skipDecode?: boolean;
|
|
296
|
+
}
|
|
297
|
+
export interface GetLogEventsByAddressQueryParamOpts {
|
|
298
|
+
/** * The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`. */
|
|
299
|
+
startingBlock?: string | number;
|
|
300
|
+
/** * The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`. */
|
|
301
|
+
endingBlock?: string | number;
|
|
302
|
+
/** * Number of items per page. Omitting this parameter defaults to 100. */
|
|
303
|
+
pageSize?: number;
|
|
304
|
+
/** * 0-indexed page number to begin pagination. */
|
|
305
|
+
pageNumber?: number;
|
|
306
|
+
}
|
|
307
|
+
export interface GetLogEventsByTopicHashQueryParamOpts {
|
|
308
|
+
/** * The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`. */
|
|
309
|
+
startingBlock?: string | number;
|
|
310
|
+
/** * The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`. */
|
|
311
|
+
endingBlock?: string | number;
|
|
312
|
+
/** * Additional topic hash(es) to filter on - padded & unpadded address fields are supported. Separate multiple topics with a comma. */
|
|
313
|
+
secondaryTopics?: string;
|
|
314
|
+
/** * Number of items per page. Omitting this parameter defaults to 100. */
|
|
315
|
+
pageSize?: number;
|
|
316
|
+
/** * 0-indexed page number to begin pagination. */
|
|
317
|
+
pageNumber?: number;
|
|
318
|
+
}
|
|
319
|
+
export interface GetAddressActivityQueryParamOpts {
|
|
320
|
+
/** * Set to true to include testnets with activity in the response. By default, it's set to `false` and only returns mainnet activity. */
|
|
321
|
+
testnets?: boolean;
|
|
322
|
+
}
|
|
323
|
+
export interface GetGasPricesQueryParamOpts {
|
|
324
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
325
|
+
quoteCurrency?: Quote;
|
|
326
|
+
}
|