@covalenthq/client-sdk 2.3.7 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +578 -595
- package/dist/index.js +740 -994
- package/dist/index.js.map +1 -1
- package/dist/src/services/AllChainsService.d.ts +4 -14
- package/dist/src/services/BalanceService.d.ts +24 -10
- package/dist/src/services/BaseService.d.ts +23 -11
- package/dist/src/services/BitcoinService.d.ts +7 -1
- package/dist/src/services/NftService.d.ts +7 -147
- package/dist/src/services/PricingService.d.ts +5 -1
- package/dist/src/services/SecurityService.d.ts +3 -9
- package/dist/src/services/StreamingService.d.ts +78 -6
- package/dist/src/services/TransactionService.d.ts +15 -6
- package/dist/src/utils/types/BalanceService.types.d.ts +2 -12
- package/dist/src/utils/types/Generic.types.d.ts +13 -8
- package/dist/src/utils/types/NftService.types.d.ts +1 -281
- package/dist/src/utils/types/SecurityService.types.d.ts +0 -52
- package/dist/src/utils/types/StreamingService.types.d.ts +67 -6
- package/dist/src/utils/types/TransactionService.types.d.ts +2 -0
- package/package.json +7 -10
|
@@ -12,6 +12,8 @@ export declare class AllChainsService {
|
|
|
12
12
|
*
|
|
13
13
|
* Commonly used to locate chains which an address is active on with a single API call.
|
|
14
14
|
*
|
|
15
|
+
* **Credit Cost**: 0.5 per call
|
|
16
|
+
*
|
|
15
17
|
* @param {string} walletAddress - The requested wallet address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
16
18
|
* @param {GetAddressActivityQueryParamOpts} queryParamOpts
|
|
17
19
|
* - `testnets`: Set to true to include testnets with activity in the response. By default, it's set to `false` and only returns mainnet activity.
|
|
@@ -34,22 +36,10 @@ export declare class AllChainsService {
|
|
|
34
36
|
*/
|
|
35
37
|
getMultiChainMultiAddressTransactions(queryParamOpts?: GetMultiChainMultiAddressTransactionsParamOtps): Promise<GoldRushResponse<MultiChainMultiAddressTransactionsResponse>>;
|
|
36
38
|
/**
|
|
37
|
-
* @deprecated This method is deprecated and will be removed in the upcoming versions. Please use `AllChainsService.getMultiChainMultiAddressTransactions` instead.
|
|
38
39
|
*
|
|
39
|
-
*
|
|
40
|
+
* Fetch paginated spot & historical native and token balances for a single address on up to 10 EVM chains with one API call.
|
|
40
41
|
*
|
|
41
|
-
*
|
|
42
|
-
* @param {string[]} addresses - An array of addresses for which transactions are fetched. Does not support name resolution.
|
|
43
|
-
* @param {number} limit - Number of transactions to return per page, up to the default max of 100 items.
|
|
44
|
-
* @param {string} before - Pagination cursor pointing to fetch transactions before a certain point.
|
|
45
|
-
* @param {string} after - Pagination cursor pointing to fetch transactions after a certain point.
|
|
46
|
-
* @param {boolean} withLogs - Whether to include raw logs in the response.
|
|
47
|
-
* @param {boolean} withDecodedLogs - Whether to include decoded logs in the response.
|
|
48
|
-
* @param {Quote | CryptocurrencyQuote} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, `GBP`, `BTC` and `ETH`.
|
|
49
|
-
*
|
|
50
|
-
*/
|
|
51
|
-
getMultiChainAndMultiAddressTransactions(queryParamOpts?: GetMultiChainMultiAddressTransactionsParamOtps): Promise<GoldRushResponse<MultiChainMultiAddressTransactionsResponse>>;
|
|
52
|
-
/**
|
|
42
|
+
* **Credit Cost**: 2.5 per call
|
|
53
43
|
*
|
|
54
44
|
* @param {string} walletAddress - The requested wallet Address.
|
|
55
45
|
* @param {GetMultiChainBalanceQueryParamOpts} queryParamOpts
|
|
@@ -10,16 +10,15 @@ export declare class BalanceService {
|
|
|
10
10
|
constructor(execution: Execution);
|
|
11
11
|
/**
|
|
12
12
|
*
|
|
13
|
-
* Commonly used to fetch the native
|
|
13
|
+
* Commonly used to fetch the native and fungible (ERC20) tokens held by an address. Response includes spot prices and other metadata.
|
|
14
|
+
*
|
|
15
|
+
* **Credit Cost**: 1 per call
|
|
14
16
|
*
|
|
15
17
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
16
18
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
17
19
|
* @param {GetTokenBalancesForWalletAddressQueryParamOpts} queryParamOpts
|
|
18
20
|
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
19
|
-
* - `nft`: If `true`, NFTs will be included in the response.
|
|
20
|
-
* - `noNftFetch`: If `true`, only NFTs that have been cached will be included in the response. Helpful for faster response times.
|
|
21
21
|
* - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
|
|
22
|
-
* - `noNftAssetMetadata`: 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.
|
|
23
22
|
*
|
|
24
23
|
*/
|
|
25
24
|
getTokenBalancesForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetTokenBalancesForWalletAddressQueryParamOpts): Promise<GoldRushResponse<BalancesResponse>>;
|
|
@@ -27,6 +26,8 @@ export declare class BalanceService {
|
|
|
27
26
|
*
|
|
28
27
|
* Commonly used to render a daily portfolio balance for an address broken down by the token. The timeframe is user-configurable, defaults to 30 days.
|
|
29
28
|
*
|
|
29
|
+
* **Credit Cost**: 2 per 30 days
|
|
30
|
+
*
|
|
30
31
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
31
32
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
32
33
|
* @param {GetHistoricalPortfolioForWalletAddressQueryParamOpts} queryParamOpts
|
|
@@ -39,6 +40,8 @@ export declare class BalanceService {
|
|
|
39
40
|
*
|
|
40
41
|
* Commonly used to render the transfer-in and transfer-out of a token along with historical prices from an address.
|
|
41
42
|
*
|
|
43
|
+
* **Credit Cost**: 0.05 per item
|
|
44
|
+
*
|
|
42
45
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
43
46
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
44
47
|
* @param {GetErc20TransfersForWalletAddressQueryParamOpts} queryParamOpts
|
|
@@ -55,6 +58,8 @@ export declare class BalanceService {
|
|
|
55
58
|
*
|
|
56
59
|
* Commonly used to render the transfer-in and transfer-out of a token along with historical prices from an address.
|
|
57
60
|
*
|
|
61
|
+
* **Credit Cost**: 0.05 per item
|
|
62
|
+
*
|
|
58
63
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
59
64
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
60
65
|
* @param {GetErc20TransfersForWalletAddressQueryParamOpts} queryParamOpts
|
|
@@ -69,11 +74,14 @@ export declare class BalanceService {
|
|
|
69
74
|
getErc20TransfersForWalletAddressByPage(chainName: Chain, walletAddress: string, queryParamOpts: GetErc20TransfersForWalletAddressQueryParamOpts): Promise<GoldRushResponse<Erc20TransfersResponse>>;
|
|
70
75
|
/**
|
|
71
76
|
*
|
|
72
|
-
*
|
|
77
|
+
* Used to get a paginated list of current or historical token holders for a specified ERC20 or ERC721 token.
|
|
78
|
+
*
|
|
79
|
+
* **Credit Cost**: 0.02 per item
|
|
73
80
|
*
|
|
74
81
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
75
82
|
* @param {string} tokenAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
76
83
|
* @param {GetTokenHoldersV2ForTokenAddressQueryParamOpts} queryParamOpts
|
|
84
|
+
* - `noSnapshot`: Defaults to `false`. Set to `true` to bypass last snapshot and get the latest token holders list.
|
|
77
85
|
* - `blockHeight`: Ending block to define a block range. Omitting this parameter defaults to the latest block height.
|
|
78
86
|
* - `pageSize`: Number of items per page. Note: Currently, only values of `100` and `1000` are supported. Omitting this parameter defaults to 100.
|
|
79
87
|
* - `pageNumber`: 0-indexed page number to begin pagination.
|
|
@@ -83,11 +91,14 @@ export declare class BalanceService {
|
|
|
83
91
|
getTokenHoldersV2ForTokenAddress(chainName: Chain, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): AsyncIterable<GoldRushResponse<TokenHoldersResponse>>;
|
|
84
92
|
/**
|
|
85
93
|
*
|
|
86
|
-
*
|
|
94
|
+
* Used to get a paginated list of current or historical token holders for a specified ERC20 or ERC721 token.
|
|
95
|
+
*
|
|
96
|
+
* **Credit Cost**: 0.02 per item
|
|
87
97
|
*
|
|
88
98
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
89
99
|
* @param {string} tokenAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
90
100
|
* @param {GetTokenHoldersV2ForTokenAddressQueryParamOpts} queryParamOpts
|
|
101
|
+
* - `noSnapshot`: Defaults to `false`. Set to `true` to bypass last snapshot and get the latest token holders list.
|
|
91
102
|
* - `blockHeight`: Ending block to define a block range. Omitting this parameter defaults to the latest block height.
|
|
92
103
|
* - `pageSize`: Number of items per page. Note: Currently, only values of `100` and `1000` are supported. Omitting this parameter defaults to 100.
|
|
93
104
|
* - `pageNumber`: 0-indexed page number to begin pagination.
|
|
@@ -97,22 +108,25 @@ export declare class BalanceService {
|
|
|
97
108
|
getTokenHoldersV2ForTokenAddressByPage(chainName: Chain, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): Promise<GoldRushResponse<TokenHoldersResponse>>;
|
|
98
109
|
/**
|
|
99
110
|
*
|
|
100
|
-
* Commonly used to fetch the historical native
|
|
111
|
+
* Commonly used to fetch the historical native and fungible (ERC20) tokens held by an address at a given block height or date. Response includes daily prices and other metadata.
|
|
112
|
+
*
|
|
113
|
+
* **Credit Cost**: 1 per call
|
|
101
114
|
*
|
|
102
115
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
103
116
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
104
117
|
* @param {GetHistoricalTokenBalancesForWalletAddressQueryParamOpts} queryParamOpts
|
|
105
118
|
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
106
|
-
* - `nft`: If `true`, NFTs will be included in the response.
|
|
107
|
-
* - `noNftFetch`: If `true`, only NFTs that have been cached will be included in the response. Helpful for faster response times.
|
|
108
119
|
* - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
|
|
109
|
-
* - `noNftAssetMetadata`: 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.
|
|
110
120
|
* - `blockHeight`: Ending block to define a block range. Omitting this parameter defaults to the latest block height.
|
|
111
121
|
* - `date`: Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date.
|
|
112
122
|
*
|
|
113
123
|
*/
|
|
114
124
|
getHistoricalTokenBalancesForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetHistoricalTokenBalancesForWalletAddressQueryParamOpts): Promise<GoldRushResponse<HistoricalBalancesResponse>>;
|
|
115
125
|
/**
|
|
126
|
+
*
|
|
127
|
+
* Lightweight endpoint to just get the native token balance for an EVM address.
|
|
128
|
+
*
|
|
129
|
+
* **Credit Cost**: 0.5 per call
|
|
116
130
|
*
|
|
117
131
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
118
132
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type Execution } from "../utils/functions/execution";
|
|
2
|
-
import { type ChainActivityResponse, type GetAddressActivityQueryParamOpts } from "../utils/types/AllChainService.types";
|
|
3
2
|
import { type AllChainsResponse, type AllChainsStatusResponse, type BlockHeightsResponse, type BlockResponse, type GasPricesResponse, type GetBlockHeightsQueryParamOpts, type GetGasPricesQueryParamOpts, type GetLogEventsByAddressQueryParamOpts, type GetLogEventsByTopicHashQueryParamOpts, type GetLogsQueryParamOpts, type GetLogsResponse, type LogEventsByAddressResponse, type LogEventsByTopicHashResponse, type ResolvedAddress } from "../utils/types/BaseService.types";
|
|
4
3
|
import { type Chain, type GoldRushResponse } from "../utils/types/Generic.types";
|
|
5
4
|
/**
|
|
@@ -13,6 +12,8 @@ export declare class BaseService {
|
|
|
13
12
|
*
|
|
14
13
|
* Commonly used to fetch and render a single block for a block explorer.
|
|
15
14
|
*
|
|
15
|
+
* **Credit Cost**: 1 per call
|
|
16
|
+
*
|
|
16
17
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
17
18
|
* @param {string} blockHeight - The block height or `latest` for the latest block available.
|
|
18
19
|
*
|
|
@@ -20,7 +21,9 @@ export declare class BaseService {
|
|
|
20
21
|
getBlock(chainName: Chain, blockHeight: string): Promise<GoldRushResponse<BlockResponse>>;
|
|
21
22
|
/**
|
|
22
23
|
*
|
|
23
|
-
* Commonly used to resolve ENS, RNS and Unstoppable Domains addresses.
|
|
24
|
+
* Commonly used to resolve ENS, RNS and Unstoppable Domains addresses. Only supports the resolution of a registered domain to an address.
|
|
25
|
+
*
|
|
26
|
+
* **Credit Cost**: 1 per call
|
|
24
27
|
*
|
|
25
28
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
26
29
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
@@ -31,6 +34,8 @@ export declare class BaseService {
|
|
|
31
34
|
*
|
|
32
35
|
* Commonly used to get all the block heights within a particular date range. Useful for rendering a display where you sort blocks by day.
|
|
33
36
|
*
|
|
37
|
+
* **Credit Cost**: 1 per call
|
|
38
|
+
*
|
|
34
39
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
35
40
|
* @param {string} startDate - The start date in YYYY-MM-DD format.
|
|
36
41
|
* @param {string | "latest"} endDate - The end date in YYYY-MM-DD format. Also accepts "latest" for the latest block height
|
|
@@ -44,6 +49,8 @@ export declare class BaseService {
|
|
|
44
49
|
*
|
|
45
50
|
* Commonly used to get all the block heights within a particular date range. Useful for rendering a display where you sort blocks by day.
|
|
46
51
|
*
|
|
52
|
+
* **Credit Cost**: 1 per call
|
|
53
|
+
*
|
|
47
54
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
48
55
|
* @param {string} startDate - The start date in YYYY-MM-DD format.
|
|
49
56
|
* @param {string | "latest"} endDate - The end date in YYYY-MM-DD format. Also accepts "latest" for the latest block height
|
|
@@ -57,6 +64,8 @@ export declare class BaseService {
|
|
|
57
64
|
*
|
|
58
65
|
* Commonly used to get all the event logs of the latest block, or for a range of blocks. Includes sender contract metadata as well as decoded logs.
|
|
59
66
|
*
|
|
67
|
+
* **Credit Cost**: 0.01 per item
|
|
68
|
+
*
|
|
60
69
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
61
70
|
* @param {GetLogsQueryParamOpts} queryParamOpts
|
|
62
71
|
* - `startingBlock`: The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`.
|
|
@@ -72,6 +81,8 @@ export declare class BaseService {
|
|
|
72
81
|
*
|
|
73
82
|
* Commonly used to get all the event logs emitted from a particular contract address. Useful for building dashboards that examine on-chain interactions.
|
|
74
83
|
*
|
|
84
|
+
* **Credit Cost**: 0.01 per item
|
|
85
|
+
*
|
|
75
86
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
76
87
|
* @param {string} contractAddress - The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
77
88
|
* @param {GetLogEventsByAddressQueryParamOpts} queryParamOpts
|
|
@@ -86,6 +97,8 @@ export declare class BaseService {
|
|
|
86
97
|
*
|
|
87
98
|
* Commonly used to get all the event logs emitted from a particular contract address. Useful for building dashboards that examine on-chain interactions.
|
|
88
99
|
*
|
|
100
|
+
* **Credit Cost**: 0.01 per item
|
|
101
|
+
*
|
|
89
102
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
90
103
|
* @param {string} contractAddress - The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
91
104
|
* @param {GetLogEventsByAddressQueryParamOpts} queryParamOpts
|
|
@@ -100,6 +113,8 @@ export declare class BaseService {
|
|
|
100
113
|
*
|
|
101
114
|
* Commonly used to get all event logs of the same topic hash across all contracts within a particular chain. Useful for cross-sectional analysis of event logs that are emitted on-chain.
|
|
102
115
|
*
|
|
116
|
+
* **Credit Cost**: 0.01 per item
|
|
117
|
+
*
|
|
103
118
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
104
119
|
* @param {string} topicHash - The endpoint will return event logs that contain this topic hash.
|
|
105
120
|
* @param {GetLogEventsByTopicHashQueryParamOpts} queryParamOpts
|
|
@@ -115,6 +130,8 @@ export declare class BaseService {
|
|
|
115
130
|
*
|
|
116
131
|
* Commonly used to get all event logs of the same topic hash across all contracts within a particular chain. Useful for cross-sectional analysis of event logs that are emitted on-chain.
|
|
117
132
|
*
|
|
133
|
+
* **Credit Cost**: 0.01 per item
|
|
134
|
+
*
|
|
118
135
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
119
136
|
* @param {string} topicHash - The endpoint will return event logs that contain this topic hash.
|
|
120
137
|
* @param {GetLogEventsByTopicHashQueryParamOpts} queryParamOpts
|
|
@@ -130,6 +147,7 @@ export declare class BaseService {
|
|
|
130
147
|
*
|
|
131
148
|
* Commonly used to build internal dashboards for all supported chains on Covalent.
|
|
132
149
|
*
|
|
150
|
+
* **Credit Cost**: 0.01 per call
|
|
133
151
|
*
|
|
134
152
|
*/
|
|
135
153
|
getAllChains(): Promise<GoldRushResponse<AllChainsResponse>>;
|
|
@@ -137,21 +155,15 @@ export declare class BaseService {
|
|
|
137
155
|
*
|
|
138
156
|
* Commonly used to build internal status dashboards of all supported chains.
|
|
139
157
|
*
|
|
158
|
+
* **Credit Cost**: 1 per call
|
|
140
159
|
*
|
|
141
160
|
*/
|
|
142
161
|
getAllChainStatus(): Promise<GoldRushResponse<AllChainsStatusResponse>>;
|
|
143
162
|
/**
|
|
144
|
-
* @deprecated This method is deprecated and will be removed in the upcoming versions. Please use `AllChainsService.getAddressActivity` instead.
|
|
145
163
|
*
|
|
146
|
-
*
|
|
164
|
+
* Get real-time gas estimates for different transaction speeds on a specific network, enabling users to optimize transaction costs and confirmation times.
|
|
147
165
|
*
|
|
148
|
-
*
|
|
149
|
-
* @param {GetAddressActivityQueryParamOpts} queryParamOpts
|
|
150
|
-
* - `testnets`: Set to true to include testnets with activity in the response. By default, it's set to `false` and only returns mainnet activity.
|
|
151
|
-
*
|
|
152
|
-
*/
|
|
153
|
-
getAddressActivity(walletAddress: string, queryParamOpts?: GetAddressActivityQueryParamOpts): Promise<GoldRushResponse<ChainActivityResponse>>;
|
|
154
|
-
/**
|
|
166
|
+
* **Credit Cost**: 1 per call
|
|
155
167
|
*
|
|
156
168
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
157
169
|
* @param {string} eventType - The desired event type to retrieve gas prices for. Supports `erc20` transfer events, `uniswapv3` swap events and `nativetokens` transfers.
|
|
@@ -10,6 +10,10 @@ export declare class BitcoinService {
|
|
|
10
10
|
private execution;
|
|
11
11
|
constructor(execution: Execution);
|
|
12
12
|
/**
|
|
13
|
+
*
|
|
14
|
+
* Commonly used to fetch the historical Bitcoin balance held by an address at a given block height or date. Response includes daily prices and other metadata.
|
|
15
|
+
*
|
|
16
|
+
* **Credit Cost**: 1 per call
|
|
13
17
|
*
|
|
14
18
|
* @param {string} walletAddress - The requested Bitcoin HD address.
|
|
15
19
|
* @param {GetBitcoinHdWalletBalancesQueryParamOpts} queryParamOpts
|
|
@@ -29,7 +33,9 @@ export declare class BitcoinService {
|
|
|
29
33
|
getTransactionsForBtcAddress(queryParamOpts?: GetTransactionsForBitcoinAddressParamOpts): Promise<GoldRushResponse<BitcoinTransactionResponse>>;
|
|
30
34
|
/**
|
|
31
35
|
*
|
|
32
|
-
*
|
|
36
|
+
* Fetch Bitcoin balance for a non-HD address. Response includes spot prices and other metadata.
|
|
37
|
+
*
|
|
38
|
+
* **Credit Cost**: 1 per call
|
|
33
39
|
*
|
|
34
40
|
* @param {string} walletAddress - The requested Bitcoin Non HD address.
|
|
35
41
|
* @param {GetBitcoinNonHdWalletBalancesQueryParamOpts} queryParamOpts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Execution } from "../utils/functions/execution";
|
|
2
2
|
import { type Chain, type GoldRushResponse } from "../utils/types/Generic.types";
|
|
3
|
-
import { type
|
|
3
|
+
import { type CheckOwnershipInNftQueryParamOpts, type GetNftsForAddressQueryParamOpts, type NftAddressBalanceNftResponse, type NftOwnershipForCollectionResponse } from "../utils/types/NftService.types";
|
|
4
4
|
/**
|
|
5
5
|
* NFTs API
|
|
6
6
|
*
|
|
@@ -8,168 +8,26 @@ import { type ChainCollectionResponse, type CheckOwnershipInNftQueryParamOpts, t
|
|
|
8
8
|
export declare class NftService {
|
|
9
9
|
private execution;
|
|
10
10
|
constructor(execution: Execution);
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* Commonly used to fetch the list of NFT collections with downloaded and cached off chain data like token metadata and asset files.
|
|
14
|
-
*
|
|
15
|
-
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
16
|
-
* @param {GetChainCollectionsQueryParamOpts} queryParamOpts
|
|
17
|
-
* - `pageSize`: Number of items per page. Omitting this parameter defaults to 100.
|
|
18
|
-
* - `pageNumber`: 0-indexed page number to begin pagination.
|
|
19
|
-
* - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
getChainCollections(chainName: Chain, queryParamOpts?: GetChainCollectionsQueryParamOpts): AsyncIterable<GoldRushResponse<ChainCollectionResponse>>;
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* Commonly used to fetch the list of NFT collections with downloaded and cached off chain data like token metadata and asset files.
|
|
26
|
-
*
|
|
27
|
-
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
28
|
-
* @param {GetChainCollectionsQueryParamOpts} queryParamOpts
|
|
29
|
-
* - `pageSize`: Number of items per page. Omitting this parameter defaults to 100.
|
|
30
|
-
* - `pageNumber`: 0-indexed page number to begin pagination.
|
|
31
|
-
* - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
getChainCollectionsByPage(chainName: Chain, queryParamOpts?: GetChainCollectionsQueryParamOpts): Promise<GoldRushResponse<ChainCollectionResponse>>;
|
|
35
11
|
/**
|
|
36
12
|
*
|
|
37
13
|
* Commonly used to render the NFTs (including ERC721 and ERC1155) held by an address.
|
|
38
14
|
*
|
|
15
|
+
* **Credit Cost**: 1 per call
|
|
16
|
+
*
|
|
39
17
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
40
18
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
41
19
|
* @param {GetNftsForAddressQueryParamOpts} queryParamOpts
|
|
42
20
|
* - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
|
|
43
21
|
* - `noNftAssetMetadata`: 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.
|
|
44
|
-
* - `withUncached`: By default, this endpoint only works on chains where we've cached the assets and the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side.
|
|
45
22
|
*
|
|
46
23
|
*/
|
|
47
24
|
getNftsForAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetNftsForAddressQueryParamOpts): Promise<GoldRushResponse<NftAddressBalanceNftResponse>>;
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* Commonly used to get NFT token IDs with metadata from a collection. Useful for building NFT card displays.
|
|
51
|
-
*
|
|
52
|
-
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
53
|
-
* @param {string} contractAddress - The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
54
|
-
* @param {GetTokenIdsForContractWithMetadataQueryParamOpts} queryParamOpts
|
|
55
|
-
* - `noMetadata`: Omit metadata.
|
|
56
|
-
* - `pageSize`: Number of items per page. Omitting this parameter defaults to 100.
|
|
57
|
-
* - `pageNumber`: 0-indexed page number to begin pagination.
|
|
58
|
-
* - `traitsFilter`: Filters NFTs based on a specific trait. If this filter is used, the API will return all NFTs with the specified trait. Accepts comma-separated values, is case-sensitive, and requires proper URL encoding.
|
|
59
|
-
* - `valuesFilter`: Filters NFTs based on a specific trait value. If this filter is used, the API will return all NFTs with the specified trait value. If used with "traits-filter", only NFTs matching both filters will be returned. Accepts comma-separated values, is case-sensitive, and requires proper URL encoding.
|
|
60
|
-
* - `withUncached`: By default, this endpoint only works on chains where we've cached the assets and the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side.
|
|
61
|
-
*
|
|
62
|
-
*/
|
|
63
|
-
getTokenIdsForContractWithMetadata(chainName: Chain, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): AsyncIterable<GoldRushResponse<NftMetadataResponse>>;
|
|
64
|
-
/**
|
|
65
|
-
*
|
|
66
|
-
* Commonly used to get NFT token IDs with metadata from a collection. Useful for building NFT card displays.
|
|
67
|
-
*
|
|
68
|
-
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
69
|
-
* @param {string} contractAddress - The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
70
|
-
* @param {GetTokenIdsForContractWithMetadataQueryParamOpts} queryParamOpts
|
|
71
|
-
* - `noMetadata`: Omit metadata.
|
|
72
|
-
* - `pageSize`: Number of items per page. Omitting this parameter defaults to 100.
|
|
73
|
-
* - `pageNumber`: 0-indexed page number to begin pagination.
|
|
74
|
-
* - `traitsFilter`: Filters NFTs based on a specific trait. If this filter is used, the API will return all NFTs with the specified trait. Accepts comma-separated values, is case-sensitive, and requires proper URL encoding.
|
|
75
|
-
* - `valuesFilter`: Filters NFTs based on a specific trait value. If this filter is used, the API will return all NFTs with the specified trait value. If used with "traits-filter", only NFTs matching both filters will be returned. Accepts comma-separated values, is case-sensitive, and requires proper URL encoding.
|
|
76
|
-
* - `withUncached`: By default, this endpoint only works on chains where we've cached the assets and the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side.
|
|
77
|
-
*
|
|
78
|
-
*/
|
|
79
|
-
getTokenIdsForContractWithMetadataByPage(chainName: Chain, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): Promise<GoldRushResponse<NftMetadataResponse>>;
|
|
80
|
-
/**
|
|
81
|
-
*
|
|
82
|
-
* Commonly used to get a single NFT metadata by token ID from a collection. Useful for building NFT card displays.
|
|
83
|
-
*
|
|
84
|
-
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
85
|
-
* @param {string} contractAddress - The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
86
|
-
* @param {string} tokenId - The requested token ID.
|
|
87
|
-
* @param {GetNftMetadataForGivenTokenIdForContractQueryParamOpts} queryParamOpts
|
|
88
|
-
* - `noMetadata`: Omit metadata.
|
|
89
|
-
* - `withUncached`: By default, this endpoint only works on chains where we've cached the assets and the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side.
|
|
90
|
-
*
|
|
91
|
-
*/
|
|
92
|
-
getNftMetadataForGivenTokenIdForContract(chainName: Chain, contractAddress: string, tokenId: string, queryParamOpts?: GetNftMetadataForGivenTokenIdForContractQueryParamOpts): Promise<GoldRushResponse<NftMetadataResponse>>;
|
|
93
|
-
/**
|
|
94
|
-
*
|
|
95
|
-
* Commonly used to get all transactions of an NFT token. Useful for building a transaction history table or price chart.
|
|
96
|
-
*
|
|
97
|
-
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
98
|
-
* @param {string} contractAddress - The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
99
|
-
* @param {string} tokenId - The requested token ID.
|
|
100
|
-
* @param {GetNftTransactionsForContractTokenIdQueryParamOpts} queryParamOpts
|
|
101
|
-
* - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
|
|
102
|
-
*
|
|
103
|
-
*/
|
|
104
|
-
getNftTransactionsForContractTokenId(chainName: Chain, contractAddress: string, tokenId: string, queryParamOpts?: GetNftTransactionsForContractTokenIdQueryParamOpts): Promise<GoldRushResponse<NftTransactionsResponse>>;
|
|
105
|
-
/**
|
|
106
|
-
*
|
|
107
|
-
* Commonly used to fetch and render the traits of a collection as seen in rarity calculators.
|
|
108
|
-
*
|
|
109
|
-
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
110
|
-
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
111
|
-
*
|
|
112
|
-
*/
|
|
113
|
-
getTraitsForCollection(chainName: Chain, collectionContract: string): Promise<GoldRushResponse<NftCollectionTraitsResponse>>;
|
|
114
|
-
/**
|
|
115
|
-
*
|
|
116
|
-
* Commonly used to get the count of unique values for traits within an NFT collection.
|
|
117
|
-
*
|
|
118
|
-
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
119
|
-
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
120
|
-
* @param {string} trait - The requested trait.
|
|
121
|
-
*
|
|
122
|
-
*/
|
|
123
|
-
getAttributesForTraitInCollection(chainName: Chain, collectionContract: string, trait: string): Promise<GoldRushResponse<NftCollectionAttributesForTraitResponse>>;
|
|
124
|
-
/**
|
|
125
|
-
*
|
|
126
|
-
* Commonly used to calculate rarity scores for a collection based on its traits.
|
|
127
|
-
*
|
|
128
|
-
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
129
|
-
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
130
|
-
*
|
|
131
|
-
*/
|
|
132
|
-
getCollectionTraitsSummary(chainName: Chain, collectionContract: string): Promise<GoldRushResponse<NftCollectionTraitsSummaryResponse>>;
|
|
133
|
-
/**
|
|
134
|
-
*
|
|
135
|
-
* Commonly used to render a price floor chart for an NFT collection.
|
|
136
|
-
*
|
|
137
|
-
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
138
|
-
* @param {string} collectionAddress - The requested address.
|
|
139
|
-
* @param {GetNftsForAddressQueryParamOpts} queryParamOpts
|
|
140
|
-
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
141
|
-
* - `days`: The number of days to return data for. Request up 365 days. Defaults to 30 days.
|
|
142
|
-
*
|
|
143
|
-
*/
|
|
144
|
-
getHistoricalFloorPricesForCollection(chainName: Chain, collectionAddress: string, queryParamOpts?: GetCollectionMarketDataQueryParamOpts): Promise<GoldRushResponse<NftCollectionFloorPriceResponse>>;
|
|
145
|
-
/**
|
|
146
|
-
*
|
|
147
|
-
* Commonly used to build a time-series chart of the transaction volume of an NFT collection.
|
|
148
|
-
*
|
|
149
|
-
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
150
|
-
* @param {string} collectionAddress - The requested address.
|
|
151
|
-
* @param {GetNftsForAddressQueryParamOpts} queryParamOpts
|
|
152
|
-
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
153
|
-
* - `days`: The number of days to return data for. Request up 365 days. Defaults to 30 days.
|
|
154
|
-
*
|
|
155
|
-
*/
|
|
156
|
-
getHistoricalVolumeForCollection(chainName: Chain, collectionAddress: string, queryParamOpts?: GetCollectionMarketDataQueryParamOpts): Promise<GoldRushResponse<NftCollectionVolumeResponse>>;
|
|
157
|
-
/**
|
|
158
|
-
*
|
|
159
|
-
* Commonly used to build a time-series chart of the sales count of an NFT collection.
|
|
160
|
-
*
|
|
161
|
-
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
162
|
-
* @param {string} collectionAddress - The requested address.
|
|
163
|
-
* @param {GetNftsForAddressQueryParamOpts} queryParamOpts
|
|
164
|
-
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
165
|
-
* - `days`: The number of days to return data for. Request up 365 days. Defaults to 30 days.
|
|
166
|
-
*
|
|
167
|
-
*/
|
|
168
|
-
getHistoricalSalesCountForCollection(chainName: Chain, collectionAddress: string, queryParamOpts?: GetCollectionMarketDataQueryParamOpts): Promise<GoldRushResponse<NftCollectionSalesCountResponse>>;
|
|
169
25
|
/**
|
|
170
26
|
*
|
|
171
27
|
* Commonly used to verify ownership of NFTs (including ERC-721 and ERC-1155) within a collection.
|
|
172
28
|
*
|
|
29
|
+
* **Credit Cost**: 1 per call
|
|
30
|
+
*
|
|
173
31
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
174
32
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
175
33
|
* @param {string} collectionContract - The requested collection address.
|
|
@@ -183,6 +41,8 @@ export declare class NftService {
|
|
|
183
41
|
*
|
|
184
42
|
* Commonly used to verify ownership of a specific token (ERC-721 or ERC-1155) within a collection.
|
|
185
43
|
*
|
|
44
|
+
* **Credit Cost**: 1 per call
|
|
45
|
+
*
|
|
186
46
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
187
47
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
188
48
|
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
@@ -10,7 +10,9 @@ export declare class PricingService {
|
|
|
10
10
|
constructor(execution: Execution);
|
|
11
11
|
/**
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* Get the historical prices of one (or many) large cap ERC20 tokens between specified date ranges. Also supports native tokens.
|
|
14
|
+
*
|
|
15
|
+
* **Credit Cost**: 1 per call
|
|
14
16
|
*
|
|
15
17
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
16
18
|
* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
@@ -26,6 +28,8 @@ export declare class PricingService {
|
|
|
26
28
|
*
|
|
27
29
|
* Get the spot token pair prices for a specified pool contract address. Supports pools on Uniswap V2, V3 and their forks.
|
|
28
30
|
*
|
|
31
|
+
* **Credit Cost**: 1 per call
|
|
32
|
+
*
|
|
29
33
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
30
34
|
* @param {string} contractAddress - The pool contract address.
|
|
31
35
|
* @param {GetTokenPricesQueryParamOpts} queryParamOpts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Execution } from "../utils/functions/execution";
|
|
2
2
|
import { type Chain, type GoldRushResponse } from "../utils/types/Generic.types";
|
|
3
|
-
import { type ApprovalsResponse
|
|
3
|
+
import { type ApprovalsResponse } from "../utils/types/SecurityService.types";
|
|
4
4
|
/**
|
|
5
5
|
* Approvals API
|
|
6
6
|
*
|
|
@@ -12,17 +12,11 @@ export declare class SecurityService {
|
|
|
12
12
|
*
|
|
13
13
|
* Commonly used to get a list of approvals across all token contracts categorized by spenders for a wallet’s assets.
|
|
14
14
|
*
|
|
15
|
+
* **Credit Cost**: 2 per call
|
|
16
|
+
*
|
|
15
17
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
16
18
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
17
19
|
*
|
|
18
20
|
*/
|
|
19
21
|
getApprovals(chainName: Chain, walletAddress: string): Promise<GoldRushResponse<ApprovalsResponse>>;
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
23
|
-
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
getNftApprovals(chainName: Chain, walletAddress: string): Promise<GoldRushResponse<NftApprovalsResponse>>;
|
|
28
22
|
}
|