@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type NewPairsStreamParams, type NewPairsStreamResponse, type OHLCVPairsStreamParams, type OHLCVPairsStreamResponse, type OHLCVTokensStreamParams, type OHLCVTokensStreamResponse, type StreamingServiceConfig, type StreamSubscriptionOptions, type UnsubscribeFunction, type UpdatePairsStreamParams, type UpdatePairsStreamResponse, type WalletActivityStreamParams, type WalletActivityStreamResponse } from "../utils/types/StreamingService.types";
|
|
1
|
+
import { type NewPairsStreamParams, type NewPairsStreamResponse, type OHLCVPairsStreamParams, type OHLCVPairsStreamResponse, type OHLCVTokensStreamParams, type OHLCVTokensStreamResponse, type StreamingServiceConfig, type StreamSubscriptionOptions, type TokenSearchParams, type TokenSearchResponse, type UnsubscribeFunction, type UpdatePairsStreamParams, type UpdatePairsStreamResponse, type UPnLForTokenParams, type UPnLForTokenResponse, type UPnLForWalletParams, type UPnLForWalletResponse, type WalletActivityStreamParams, type WalletActivityStreamResponse } from "../utils/types/StreamingService.types";
|
|
2
2
|
import { type Client } from "graphql-ws";
|
|
3
3
|
/**
|
|
4
4
|
* Streaming API Service
|
|
@@ -30,7 +30,12 @@ export declare class StreamingService {
|
|
|
30
30
|
*/
|
|
31
31
|
rawQuery<T = Array<object>>(query: string, variables: Record<string, unknown>, callbacks: StreamSubscriptionOptions<T>): UnsubscribeFunction;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
*
|
|
34
|
+
* The OHLCV Pairs stream provides real-time updates on the Open, High, Low, Close prices and Volume of one or many token pairs at configurable intervals.
|
|
35
|
+
*
|
|
36
|
+
* **Credit Cost**: 0 per call
|
|
37
|
+
*
|
|
38
|
+
* **Beta**: This endpoint is in beta.
|
|
34
39
|
*
|
|
35
40
|
* @param params - Parameters for the OHLCV pairs stream
|
|
36
41
|
* @param callbacks - Subscription callbacks
|
|
@@ -55,7 +60,12 @@ export declare class StreamingService {
|
|
|
55
60
|
*/
|
|
56
61
|
subscribeToOHLCVPairs(params: OHLCVPairsStreamParams, callbacks: StreamSubscriptionOptions<OHLCVPairsStreamResponse[]>): UnsubscribeFunction;
|
|
57
62
|
/**
|
|
58
|
-
*
|
|
63
|
+
*
|
|
64
|
+
* The OHLCV Tokens stream provides real-time updates on the Open, High, Low, Close prices and Volume of one or many tokens at configurable intervals.
|
|
65
|
+
*
|
|
66
|
+
* **Credit Cost**: 0 per call
|
|
67
|
+
*
|
|
68
|
+
* **Beta**: This endpoint is in beta.
|
|
59
69
|
*
|
|
60
70
|
* @param params - Parameters for the OHLCV tokens stream
|
|
61
71
|
* @param callbacks - Subscription callbacks
|
|
@@ -80,7 +90,12 @@ export declare class StreamingService {
|
|
|
80
90
|
*/
|
|
81
91
|
subscribeToOHLCVTokens(params: OHLCVTokensStreamParams, callbacks: StreamSubscriptionOptions<OHLCVTokensStreamResponse[]>): UnsubscribeFunction;
|
|
82
92
|
/**
|
|
83
|
-
*
|
|
93
|
+
*
|
|
94
|
+
* The New DEX Pairs stream provides real-time updates when new liquidity pairs are created on decentralized exchanges (DEXes). This documentation follows our standard streaming API structure.
|
|
95
|
+
*
|
|
96
|
+
* **Credit Cost**: 0 per call
|
|
97
|
+
*
|
|
98
|
+
* **Beta**: This endpoint is in beta.
|
|
84
99
|
*
|
|
85
100
|
* @param params - Parameters for the new pairs stream
|
|
86
101
|
* @param callbacks - Subscription callbacks
|
|
@@ -103,7 +118,12 @@ export declare class StreamingService {
|
|
|
103
118
|
*/
|
|
104
119
|
subscribeToNewPairs(params: NewPairsStreamParams, callbacks: StreamSubscriptionOptions<NewPairsStreamResponse[]>): UnsubscribeFunction;
|
|
105
120
|
/**
|
|
106
|
-
*
|
|
121
|
+
*
|
|
122
|
+
* The Update DEX Pairs stream provides real-time event updates on the prices, volumes, market cap and liquidity of one or many token pairs.
|
|
123
|
+
*
|
|
124
|
+
* **Credit Cost**: 0 per call
|
|
125
|
+
*
|
|
126
|
+
* **Beta**: This endpoint is in beta.
|
|
107
127
|
*
|
|
108
128
|
* @param params - Parameters for the update pairs stream
|
|
109
129
|
* @param callbacks - Subscription callbacks
|
|
@@ -128,7 +148,12 @@ export declare class StreamingService {
|
|
|
128
148
|
*/
|
|
129
149
|
subscribeToUpdatePairs(params: UpdatePairsStreamParams, callbacks: StreamSubscriptionOptions<UpdatePairsStreamResponse>): UnsubscribeFunction;
|
|
130
150
|
/**
|
|
131
|
-
*
|
|
151
|
+
*
|
|
152
|
+
* The Wallet Activity stream provides real-time updates on wallet transactions, token transfers, and interactions with smart contracts . This documentation follows our standard Streaming API structure.
|
|
153
|
+
*
|
|
154
|
+
* **Credit Cost**: 0 per call
|
|
155
|
+
*
|
|
156
|
+
* **Beta**: This endpoint is in beta.
|
|
132
157
|
*
|
|
133
158
|
* @param params - Parameters for the wallet activity stream
|
|
134
159
|
* @param callbacks - Subscription callbacks
|
|
@@ -150,4 +175,51 @@ export declare class StreamingService {
|
|
|
150
175
|
* ```
|
|
151
176
|
*/
|
|
152
177
|
subscribeToWalletActivity(params: WalletActivityStreamParams, callbacks: StreamSubscriptionOptions<WalletActivityStreamResponse[]>): UnsubscribeFunction;
|
|
178
|
+
/**
|
|
179
|
+
* Search for tokens by keyword, ticker, or contract address
|
|
180
|
+
*
|
|
181
|
+
* @param params - Parameters for the token search query
|
|
182
|
+
* @returns Promise resolving to an array of matching tokens
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```typescript
|
|
186
|
+
* const results = await streamingService.searchToken({
|
|
187
|
+
* query: "PEPE"
|
|
188
|
+
* });
|
|
189
|
+
* console.log("Search Results:", results);
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
searchToken(params: TokenSearchParams): Promise<TokenSearchResponse[]>;
|
|
193
|
+
/**
|
|
194
|
+
* Get top trader wallets and their PnL for a specific token
|
|
195
|
+
*
|
|
196
|
+
* @param params - Parameters for the UPnL token query
|
|
197
|
+
* @returns Promise resolving to an array of top trader wallet data
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```typescript
|
|
201
|
+
* const traders = await streamingService.getUPnLForToken({
|
|
202
|
+
* chain_name: StreamingChain.ETH_MAINNET,
|
|
203
|
+
* token_address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
|
|
204
|
+
* });
|
|
205
|
+
* console.log("Top Traders:", traders);
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
getUPnLForToken(params: UPnLForTokenParams): Promise<UPnLForTokenResponse[]>;
|
|
209
|
+
/**
|
|
210
|
+
* Get unrealized and realized PnL for all tokens held by a wallet
|
|
211
|
+
*
|
|
212
|
+
* @param params - Parameters for the UPnL wallet query
|
|
213
|
+
* @returns Promise resolving to an array of token PnL data for the wallet
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```typescript
|
|
217
|
+
* const pnl = await streamingService.getUPnLForWallet({
|
|
218
|
+
* chain_name: StreamingChain.ETH_MAINNET,
|
|
219
|
+
* wallet_address: "0xfe97b0C517a84F98fc6eDe3CD26B43012d31992a"
|
|
220
|
+
* });
|
|
221
|
+
* console.log("Wallet PnL:", pnl);
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
getUPnLForWallet(params: UPnLForWalletParams): Promise<UPnLForWalletResponse[]>;
|
|
153
225
|
}
|
|
@@ -10,7 +10,9 @@ export declare class TransactionService {
|
|
|
10
10
|
constructor(execution: Execution);
|
|
11
11
|
/**
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* Used to fetch and render a single transaction including its decoded event logs. For foundational chains, can also retrieve internal transactions, state changes and method ID where available.
|
|
14
|
+
*
|
|
15
|
+
* **Credit Cost**: 0.1 per call
|
|
14
16
|
*
|
|
15
17
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
16
18
|
* @param {string} txHash - The transaction hash.
|
|
@@ -25,13 +27,16 @@ export declare class TransactionService {
|
|
|
25
27
|
getTransaction(chainName: Chain, txHash: string, queryParamOpts?: GetTransactionQueryParamOpts): Promise<GoldRushResponse<TransactionResponse>>;
|
|
26
28
|
/**
|
|
27
29
|
*
|
|
28
|
-
*
|
|
30
|
+
* Used to fetch the earliest and latest transactions, and the transaction count for a wallet. Also enriched with gas expenditure details and total ERC20 token transfers count.
|
|
31
|
+
*
|
|
32
|
+
* **Credit Cost**: 1 per call
|
|
29
33
|
*
|
|
30
34
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
31
35
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
32
36
|
* @param {GetTransactionSummaryQueryParamOpts} queryParamOpts
|
|
33
37
|
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
34
38
|
* - `withGas`: Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions.
|
|
39
|
+
* - `withTransferCount`: Represents the total count of ERC-20 token movement events, including `Transfer`, `Deposit` and `Withdraw`. Response times may be impacted for wallets with large number of transactions. Additional charge of 3 credits.
|
|
35
40
|
*
|
|
36
41
|
*/
|
|
37
42
|
getTransactionSummary(chainName: Chain, walletAddress: string, queryParamOpts?: GetTransactionSummaryQueryParamOpts): Promise<GoldRushResponse<TransactionsSummaryResponse>>;
|
|
@@ -51,6 +56,8 @@ export declare class TransactionService {
|
|
|
51
56
|
*
|
|
52
57
|
* Commonly used to fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
|
|
53
58
|
*
|
|
59
|
+
* **Credit Cost**: 0.1 per item
|
|
60
|
+
*
|
|
54
61
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
55
62
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
56
63
|
* @param {GetAllTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
@@ -67,6 +74,8 @@ export declare class TransactionService {
|
|
|
67
74
|
*
|
|
68
75
|
* Commonly used to fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
|
|
69
76
|
*
|
|
77
|
+
* **Credit Cost**: 0.1 per item
|
|
78
|
+
*
|
|
70
79
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
71
80
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
72
81
|
* @param {GetAllTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
@@ -106,6 +115,8 @@ export declare class TransactionService {
|
|
|
106
115
|
*
|
|
107
116
|
* Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
|
|
108
117
|
*
|
|
118
|
+
* **Credit Cost**: 0.1 per item
|
|
119
|
+
*
|
|
109
120
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
110
121
|
* @param {number} blockHeight - The requested block height.
|
|
111
122
|
* @param {number} page - The requested page, 0-indexed.
|
|
@@ -119,6 +130,8 @@ export declare class TransactionService {
|
|
|
119
130
|
*
|
|
120
131
|
* Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
|
|
121
132
|
*
|
|
133
|
+
* **Credit Cost**: 0.1 per item
|
|
134
|
+
*
|
|
122
135
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
123
136
|
* @param {string} blockHash - The requested block hash.
|
|
124
137
|
* @param {getTransactionsForBlockByPageQueryParamOpts} queryParamOpts
|
|
@@ -127,8 +140,4 @@ export declare class TransactionService {
|
|
|
127
140
|
*
|
|
128
141
|
*/
|
|
129
142
|
getTransactionsForBlock(chainName: Chain, blockHash: string, queryParamOpts?: getTransactionsForBlockByPageQueryParamOpts): Promise<GoldRushResponse<TransactionsForBlockResponse>>;
|
|
130
|
-
/**
|
|
131
|
-
* @deprecated This method has been deprecated and will be removed in future releases. Use `getPaginatedTransactionsForAddress` instead.
|
|
132
|
-
*/
|
|
133
|
-
getTransactionsForAddressV3(chainName: Chain, walletAddress: string, page: number, queryParamOpts?: getPaginatedTransactionsForAddressQueryParamOpts): Promise<GoldRushResponse<TransactionsResponse>>;
|
|
134
143
|
}
|
|
@@ -379,14 +379,8 @@ export type NativeBalanceItem = Nullable<{
|
|
|
379
379
|
export type GetTokenBalancesForWalletAddressQueryParamOpts = Nullable<{
|
|
380
380
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
381
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
382
|
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
387
383
|
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
384
|
}>;
|
|
391
385
|
export type GetHistoricalPortfolioForWalletAddressQueryParamOpts = Nullable<{
|
|
392
386
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
@@ -409,6 +403,8 @@ export type GetErc20TransfersForWalletAddressQueryParamOpts = Nullable<{
|
|
|
409
403
|
pageNumber?: number;
|
|
410
404
|
}>;
|
|
411
405
|
export type GetTokenHoldersV2ForTokenAddressQueryParamOpts = Nullable<{
|
|
406
|
+
/** * Defaults to `false`. Set to `true` to bypass last snapshot and get the latest token holders list. */
|
|
407
|
+
noSnapshot?: boolean;
|
|
412
408
|
/** * Ending block to define a block range. Omitting this parameter defaults to the latest block height. */
|
|
413
409
|
blockHeight?: number | string;
|
|
414
410
|
/** * Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date. */
|
|
@@ -421,14 +417,8 @@ export type GetTokenHoldersV2ForTokenAddressQueryParamOpts = Nullable<{
|
|
|
421
417
|
export type GetHistoricalTokenBalancesForWalletAddressQueryParamOpts = Nullable<{
|
|
422
418
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
423
419
|
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
420
|
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
429
421
|
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
422
|
/** * Ending block to define a block range. Omitting this parameter defaults to the latest block height. */
|
|
433
423
|
blockHeight?: number | string;
|
|
434
424
|
/** * Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date. */
|
|
@@ -2,17 +2,16 @@ export declare enum ChainName {
|
|
|
2
2
|
ETH_MAINNET = "eth-mainnet",
|
|
3
3
|
ETH_SEPOLIA = "eth-sepolia",
|
|
4
4
|
ETH_HOLESKY = "eth-holesky",
|
|
5
|
-
ETH_HOODI = "eth-hoodi",
|
|
6
5
|
MATIC_MAINNET = "matic-mainnet",
|
|
7
6
|
AVALANCHE_MAINNET = "avalanche-mainnet",
|
|
8
7
|
AVALANCHE_TESTNET = "avalanche-testnet",
|
|
9
8
|
BSC_MAINNET = "bsc-mainnet",
|
|
10
9
|
BSC_TESTNET = "bsc-testnet",
|
|
11
10
|
MOONBEAM_MAINNET = "moonbeam-mainnet",
|
|
12
|
-
MOONBEAM_MOONBASE_ALPHA = "moonbeam-moonbase-alpha",
|
|
13
11
|
MOONBEAM_MOONRIVER = "moonbeam-moonriver",
|
|
14
12
|
ARBITRUM_MAINNET = "arbitrum-mainnet",
|
|
15
13
|
ARBITRUM_NOVA_MAINNET = "arbitrum-nova-mainnet",
|
|
14
|
+
ARBITRUM_SEPOLIA = "arbitrum-sepolia",
|
|
16
15
|
FANTOM_MAINNET = "fantom-mainnet",
|
|
17
16
|
FANTOM_TESTNET = "fantom-testnet",
|
|
18
17
|
BTC_MAINNET = "btc-mainnet",
|
|
@@ -24,17 +23,22 @@ export declare enum ChainName {
|
|
|
24
23
|
EMERALD_PARATIME_MAINNET = "emerald-paratime-mainnet",
|
|
25
24
|
MONAD_TESTNET = "monad-testnet",
|
|
26
25
|
MONAD_MAINNET = "monad-mainnet",
|
|
26
|
+
MEGAETH_MAINNET = "megaeth-mainnet",
|
|
27
27
|
BERACHAIN_MAINNET = "berachain-mainnet",
|
|
28
|
+
BERACHAIN_TESTNET = "berachain-testnet",
|
|
29
|
+
HYPERCORE_MAINNET = "hypercore-mainnet",
|
|
28
30
|
PLASMA_MAINNET = "plasma-mainnet",
|
|
29
31
|
UNICHAIN_MAINNET = "unichain-mainnet",
|
|
30
32
|
PLASMA_TESTNET = "plasma-testnet",
|
|
31
33
|
ARC_TESTNET = "arc-testnet",
|
|
34
|
+
ADI_TESTNET = "adi-testnet",
|
|
32
35
|
CANTO_MAINNET = "canto-mainnet",
|
|
33
36
|
LINEA_MAINNET = "linea-mainnet",
|
|
34
37
|
LINEA_SEPOLIA_TESTNET = "linea-sepolia-testnet",
|
|
35
38
|
POLYGON_AMOY_TESTNET = "polygon-amoy-testnet",
|
|
36
39
|
MANTLE_MAINNET = "mantle-mainnet",
|
|
37
40
|
BASE_MAINNET = "base-mainnet",
|
|
41
|
+
BASE_SEPOLIA_TESTNET = "base-sepolia-testnet",
|
|
38
42
|
OASIS_SAPPHIRE_MAINNET = "oasis-sapphire-mainnet",
|
|
39
43
|
CELO_MAINNET = "celo-mainnet",
|
|
40
44
|
HYPEREVM_MAINNET = "hyperevm-mainnet",
|
|
@@ -46,10 +50,9 @@ export declare enum ChainName {
|
|
|
46
50
|
SONIC_MAINNET = "sonic-mainnet",
|
|
47
51
|
WORLD_MAINNET = "world-mainnet",
|
|
48
52
|
WORLD_SEPOLIA_TESTNET = "world-sepolia-testnet",
|
|
49
|
-
|
|
53
|
+
MANTA_SEPOLIA_TESTNET = "manta-sepolia-testnet",
|
|
50
54
|
INK_SEPOLIA_TESTNET = "ink-sepolia-testnet",
|
|
51
55
|
INK_MAINNET = "ink-mainnet",
|
|
52
|
-
LENS_MAINNET = "lens-mainnet",
|
|
53
56
|
ZKSYNC_MAINNET = "zksync-mainnet",
|
|
54
57
|
BNB_OPBNB_MAINNET = "bnb-opbnb-mainnet",
|
|
55
58
|
ZETACHAIN_MAINNET = "zetachain-mainnet",
|
|
@@ -64,17 +67,16 @@ export declare enum ChainID {
|
|
|
64
67
|
ETH_MAINNET = 1,
|
|
65
68
|
ETH_SEPOLIA = 11155111,
|
|
66
69
|
ETH_HOLESKY = 17000,
|
|
67
|
-
ETH_HOODI = 560048,
|
|
68
70
|
MATIC_MAINNET = 137,
|
|
69
71
|
AVALANCHE_MAINNET = 43114,
|
|
70
72
|
AVALANCHE_TESTNET = 43113,
|
|
71
73
|
BSC_MAINNET = 56,
|
|
72
74
|
BSC_TESTNET = 97,
|
|
73
75
|
MOONBEAM_MAINNET = 1284,
|
|
74
|
-
MOONBEAM_MOONBASE_ALPHA = 1287,
|
|
75
76
|
MOONBEAM_MOONRIVER = 1285,
|
|
76
77
|
ARBITRUM_MAINNET = 42161,
|
|
77
78
|
ARBITRUM_NOVA_MAINNET = 42170,
|
|
79
|
+
ARBITRUM_SEPOLIA = 421614,
|
|
78
80
|
FANTOM_MAINNET = 250,
|
|
79
81
|
FANTOM_TESTNET = 4002,
|
|
80
82
|
BTC_MAINNET = 20090103,
|
|
@@ -86,17 +88,21 @@ export declare enum ChainID {
|
|
|
86
88
|
EMERALD_PARATIME_MAINNET = 42262,
|
|
87
89
|
MONAD_TESTNET = 10143,
|
|
88
90
|
MONAD_MAINNET = 143,
|
|
91
|
+
MEGAETH_MAINNET = 4326,
|
|
89
92
|
BERACHAIN_MAINNET = 80094,
|
|
93
|
+
BERACHAIN_TESTNET = 80084,
|
|
90
94
|
PLASMA_MAINNET = 9745,
|
|
91
95
|
UNICHAIN_MAINNET = 130,
|
|
92
96
|
PLASMA_TESTNET = 9746,
|
|
93
97
|
ARC_TESTNET = 5042002,
|
|
98
|
+
ADI_TESTNET = 99999,
|
|
94
99
|
CANTO_MAINNET = 7700,
|
|
95
100
|
LINEA_MAINNET = 59144,
|
|
96
101
|
LINEA_SEPOLIA_TESTNET = 59141,
|
|
97
102
|
POLYGON_AMOY_TESTNET = 80002,
|
|
98
103
|
MANTLE_MAINNET = 5000,
|
|
99
104
|
BASE_MAINNET = 8453,
|
|
105
|
+
BASE_SEPOLIA_TESTNET = 84532,
|
|
100
106
|
OASIS_SAPPHIRE_MAINNET = 23294,
|
|
101
107
|
CELO_MAINNET = 42220,
|
|
102
108
|
HYPEREVM_MAINNET = 999,
|
|
@@ -108,10 +114,9 @@ export declare enum ChainID {
|
|
|
108
114
|
SONIC_MAINNET = 146,
|
|
109
115
|
WORLD_MAINNET = 480,
|
|
110
116
|
WORLD_SEPOLIA_TESTNET = 4801,
|
|
111
|
-
|
|
117
|
+
MANTA_SEPOLIA_TESTNET = 3441006,
|
|
112
118
|
INK_SEPOLIA_TESTNET = 763373,
|
|
113
119
|
INK_MAINNET = 57073,
|
|
114
|
-
LENS_MAINNET = 232,
|
|
115
120
|
ZKSYNC_MAINNET = 324,
|
|
116
121
|
BNB_OPBNB_MAINNET = 204,
|
|
117
122
|
ZETACHAIN_MAINNET = 7000,
|
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export type ChainCollectionResponse = 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: ChainCollectionItem[];
|
|
11
|
-
/** * Pagination metadata. */
|
|
12
|
-
pagination: Pagination;
|
|
13
|
-
}>;
|
|
14
|
-
export type ChainCollectionItem = Nullable<{
|
|
15
|
-
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
16
|
-
contract_address: string;
|
|
17
|
-
/** * The string returned by the `name()` method. */
|
|
18
|
-
contract_name: string;
|
|
19
|
-
/** * Denotes whether the token is suspected spam. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
20
|
-
is_spam: boolean;
|
|
21
|
-
token_total_supply: number;
|
|
22
|
-
cached_metadata_count: number;
|
|
23
|
-
cached_asset_count: number;
|
|
24
|
-
last_scraped_at: Date;
|
|
25
|
-
}>;
|
|
1
|
+
import { type NftData, type Nullable } from "./Generic.types";
|
|
26
2
|
export type NftAddressBalanceNftResponse = Nullable<{
|
|
27
3
|
/** * The requested address. */
|
|
28
4
|
address: string;
|
|
@@ -55,146 +31,6 @@ export type NftTokenContractBalanceItem = Nullable<{
|
|
|
55
31
|
floor_price_native_quote: number;
|
|
56
32
|
nft_data: NftData[];
|
|
57
33
|
}>;
|
|
58
|
-
export type NftMetadataResponse = Nullable<{
|
|
59
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
60
|
-
updated_at: Date;
|
|
61
|
-
/** * List of response items. */
|
|
62
|
-
items: NftTokenContract[];
|
|
63
|
-
/** * Pagination metadata. */
|
|
64
|
-
pagination: Pagination;
|
|
65
|
-
}>;
|
|
66
|
-
export type NftTokenContract = Nullable<{
|
|
67
|
-
/** * The string returned by the `name()` method. */
|
|
68
|
-
contract_name: string;
|
|
69
|
-
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
70
|
-
contract_ticker_symbol: string;
|
|
71
|
-
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
72
|
-
contract_address: string;
|
|
73
|
-
/** * Denotes whether the token is suspected spam. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
74
|
-
is_spam: boolean;
|
|
75
|
-
type: string;
|
|
76
|
-
nft_data: NftData;
|
|
77
|
-
}>;
|
|
78
|
-
export type NftTransactionsResponse = Nullable<{
|
|
79
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
80
|
-
updated_at: Date;
|
|
81
|
-
/** * The requested chain ID eg: `1`. */
|
|
82
|
-
chain_id: ChainID;
|
|
83
|
-
/** * The requested chain name eg: `eth-mainnet`. */
|
|
84
|
-
chain_name: ChainName;
|
|
85
|
-
/** * List of response items. */
|
|
86
|
-
items: NftTransaction[];
|
|
87
|
-
}>;
|
|
88
|
-
export type NftTransaction = Nullable<{
|
|
89
|
-
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
90
|
-
contract_decimals: number;
|
|
91
|
-
/** * The string returned by the `name()` method. */
|
|
92
|
-
contract_name: string;
|
|
93
|
-
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
94
|
-
contract_ticker_symbol: string;
|
|
95
|
-
/** * The contract logo URL. */
|
|
96
|
-
logo_url: string;
|
|
97
|
-
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
98
|
-
contract_address: string;
|
|
99
|
-
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
100
|
-
supports_erc: string[];
|
|
101
|
-
nft_transactions: NftTransactionItem[];
|
|
102
|
-
/** * Denotes whether the token is suspected spam. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
103
|
-
is_spam: boolean;
|
|
104
|
-
}>;
|
|
105
|
-
export type NftTransactionItem = Nullable<{
|
|
106
|
-
/** * The block signed timestamp in UTC. */
|
|
107
|
-
block_signed_at: Date;
|
|
108
|
-
/** * The height of the block. */
|
|
109
|
-
block_height: number;
|
|
110
|
-
/** * The requested transaction hash. */
|
|
111
|
-
tx_hash: string;
|
|
112
|
-
/** * The offset is the position of the tx in the block. */
|
|
113
|
-
tx_offset: number;
|
|
114
|
-
/** * Whether or not transaction is successful. */
|
|
115
|
-
successful: boolean;
|
|
116
|
-
/** * The sender's wallet address. */
|
|
117
|
-
from_address: string;
|
|
118
|
-
/** * The label of `from` address. */
|
|
119
|
-
from_address_label: string;
|
|
120
|
-
/** * The receiver's wallet address. */
|
|
121
|
-
to_address: string;
|
|
122
|
-
/** * The label of `to` address. */
|
|
123
|
-
to_address_label: string;
|
|
124
|
-
/** * The value attached to this tx. */
|
|
125
|
-
value: bigint;
|
|
126
|
-
/** * The value attached in `quote-currency` to this tx. */
|
|
127
|
-
value_quote: number;
|
|
128
|
-
/** * A prettier version of the quote for rendering purposes. */
|
|
129
|
-
pretty_value_quote: string;
|
|
130
|
-
gas_offered: number;
|
|
131
|
-
/** * The gas spent for this tx. */
|
|
132
|
-
gas_spent: number;
|
|
133
|
-
/** * The gas price at the time of this tx. */
|
|
134
|
-
gas_price: number;
|
|
135
|
-
/** * The total transaction fees (gas_price * gas_spent) paid for this tx, denoted in wei. */
|
|
136
|
-
fees_paid: bigint;
|
|
137
|
-
/** * The gas spent in `quote-currency` denomination. */
|
|
138
|
-
gas_quote: number;
|
|
139
|
-
/** * A prettier version of the quote for rendering purposes. */
|
|
140
|
-
pretty_gas_quote: string;
|
|
141
|
-
gas_quote_rate: number;
|
|
142
|
-
/** * The log events. */
|
|
143
|
-
log_events: LogEvent[];
|
|
144
|
-
}>;
|
|
145
|
-
export type NftCollectionTraitsResponse = Nullable<{
|
|
146
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
147
|
-
updated_at: Date;
|
|
148
|
-
/** * List of response items. */
|
|
149
|
-
items: NftTrait[];
|
|
150
|
-
}>;
|
|
151
|
-
export type NftTrait = Nullable<{
|
|
152
|
-
name: string;
|
|
153
|
-
}>;
|
|
154
|
-
export type NftCollectionAttributesForTraitResponse = Nullable<{
|
|
155
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
156
|
-
updated_at: Date;
|
|
157
|
-
/** * List of response items. */
|
|
158
|
-
items: NftSummaryAttribute[];
|
|
159
|
-
}>;
|
|
160
|
-
export type NftSummaryAttribute = Nullable<{
|
|
161
|
-
trait_type: string;
|
|
162
|
-
values: NftAttribute[];
|
|
163
|
-
unique_values: number;
|
|
164
|
-
}>;
|
|
165
|
-
export type NftAttribute = Nullable<{
|
|
166
|
-
value: string;
|
|
167
|
-
count: number;
|
|
168
|
-
}>;
|
|
169
|
-
export type NftCollectionTraitsSummaryResponse = Nullable<{
|
|
170
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
171
|
-
updated_at: Date;
|
|
172
|
-
/** * List of response items. */
|
|
173
|
-
items: NftTraitSummary[];
|
|
174
|
-
}>;
|
|
175
|
-
export type NftTraitSummary = Nullable<{
|
|
176
|
-
/** * Trait name */
|
|
177
|
-
name: string;
|
|
178
|
-
/** * Type of the value of the trait. */
|
|
179
|
-
value_type: string;
|
|
180
|
-
/** * Populated for `numeric` traits. */
|
|
181
|
-
value_numeric: NftTraitNumeric;
|
|
182
|
-
/** * Populated for `string` traits. */
|
|
183
|
-
value_string: NftTraitString;
|
|
184
|
-
attributes: NftSummaryAttribute[];
|
|
185
|
-
}>;
|
|
186
|
-
export type NftTraitNumeric = Nullable<{
|
|
187
|
-
min: number;
|
|
188
|
-
max: number;
|
|
189
|
-
}>;
|
|
190
|
-
export type NftTraitString = Nullable<{
|
|
191
|
-
/** * String value */
|
|
192
|
-
value: string;
|
|
193
|
-
/** * Number of distinct tokens that have this trait value. */
|
|
194
|
-
token_count: number;
|
|
195
|
-
/** * Percentage of tokens in the collection that have this trait. */
|
|
196
|
-
trait_percentage: number;
|
|
197
|
-
}>;
|
|
198
34
|
export type NftOwnershipForCollectionResponse = Nullable<{
|
|
199
35
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
200
36
|
updated_at: Date;
|
|
@@ -225,45 +61,11 @@ export type NftOwnershipForCollectionItem = Nullable<{
|
|
|
225
61
|
type: string;
|
|
226
62
|
nft_data: NftData;
|
|
227
63
|
}>;
|
|
228
|
-
export type GetChainCollectionsQueryParamOpts = Nullable<{
|
|
229
|
-
/** * Number of items per page. Omitting this parameter defaults to 100. */
|
|
230
|
-
pageSize?: number;
|
|
231
|
-
/** * 0-indexed page number to begin pagination. */
|
|
232
|
-
pageNumber?: number;
|
|
233
|
-
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
234
|
-
noSpam?: boolean;
|
|
235
|
-
}>;
|
|
236
64
|
export type GetNftsForAddressQueryParamOpts = Nullable<{
|
|
237
65
|
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
238
66
|
noSpam?: boolean;
|
|
239
67
|
/** * 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. */
|
|
240
68
|
noNftAssetMetadata?: boolean;
|
|
241
|
-
/** * 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. */
|
|
242
|
-
withUncached?: boolean;
|
|
243
|
-
}>;
|
|
244
|
-
export type GetTokenIdsForContractWithMetadataQueryParamOpts = Nullable<{
|
|
245
|
-
/** * Omit metadata. */
|
|
246
|
-
noMetadata?: boolean;
|
|
247
|
-
/** * Number of items per page. Omitting this parameter defaults to 100. */
|
|
248
|
-
pageSize?: number;
|
|
249
|
-
/** * 0-indexed page number to begin pagination. */
|
|
250
|
-
pageNumber?: number;
|
|
251
|
-
/** * 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. */
|
|
252
|
-
traitsFilter?: string;
|
|
253
|
-
/** * 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. */
|
|
254
|
-
valuesFilter?: string;
|
|
255
|
-
/** * 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. */
|
|
256
|
-
withUncached?: boolean;
|
|
257
|
-
}>;
|
|
258
|
-
export type GetNftMetadataForGivenTokenIdForContractQueryParamOpts = Nullable<{
|
|
259
|
-
/** * Omit metadata. */
|
|
260
|
-
noMetadata?: boolean;
|
|
261
|
-
/** * 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. */
|
|
262
|
-
withUncached?: boolean;
|
|
263
|
-
}>;
|
|
264
|
-
export type GetNftTransactionsForContractTokenIdQueryParamOpts = Nullable<{
|
|
265
|
-
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
266
|
-
noSpam?: boolean;
|
|
267
69
|
}>;
|
|
268
70
|
export type CheckOwnershipInNftQueryParamOpts = Nullable<{
|
|
269
71
|
/** * Filters NFTs based on a specific trait. If this filter is used, the API will return all NFTs with the specified trait. Must be used with "values-filter", is case-sensitive, and requires proper URL encoding. */
|
|
@@ -271,85 +73,3 @@ export type CheckOwnershipInNftQueryParamOpts = Nullable<{
|
|
|
271
73
|
/** * Filters NFTs based on a specific trait value. If this filter is used, the API will return all NFTs with the specified trait value. Must be used with "traits-filter", is case-sensitive, and requires proper URL encoding. */
|
|
272
74
|
valuesFilter?: string;
|
|
273
75
|
}>;
|
|
274
|
-
export type GetCollectionMarketDataQueryParamOpts = Nullable<{
|
|
275
|
-
/** * The requested quote currency eg: `USD`. */
|
|
276
|
-
quote_currency?: Quote;
|
|
277
|
-
/** The number of days to return data for. Request up 365 days. Defaults to 30 days. */
|
|
278
|
-
days?: number;
|
|
279
|
-
}>;
|
|
280
|
-
export type NftCollectionFloorPriceResponse = Nullable<{
|
|
281
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
282
|
-
updated_at: Date;
|
|
283
|
-
/** The requested address. */
|
|
284
|
-
address: string;
|
|
285
|
-
/** * The requested quote currency eg: `USD`. */
|
|
286
|
-
quote_currency: Quote;
|
|
287
|
-
/** * The requested chain name eg: `eth-mainnet`. */
|
|
288
|
-
chain_name: ChainName;
|
|
289
|
-
/** * The requested chain ID eg: `1`. */
|
|
290
|
-
chain_id: ChainID;
|
|
291
|
-
/** * List of response items. */
|
|
292
|
-
items: NftCollectionFloorPriceItem[];
|
|
293
|
-
}>;
|
|
294
|
-
export type NftCollectionFloorPriceItem = Nullable<{
|
|
295
|
-
/** * The timestamp of the date of sale. */
|
|
296
|
-
date: Date;
|
|
297
|
-
/** * The ticker symbol for the native currency. */
|
|
298
|
-
native_ticker_symbol: string;
|
|
299
|
-
/** * The contract name of the native currency. */
|
|
300
|
-
native_name: string;
|
|
301
|
-
/** * The current floor price in native currency. */
|
|
302
|
-
floor_price_native_quote: number;
|
|
303
|
-
/** * The current floor price converted to fiat in quote-currency. */
|
|
304
|
-
floor_price_quote: number;
|
|
305
|
-
/** * A prettier version of the floor price quote for rendering purposes. */
|
|
306
|
-
pretty_floor_price_quote: string;
|
|
307
|
-
}>;
|
|
308
|
-
export type NftCollectionVolumeResponse = Nullable<{
|
|
309
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
310
|
-
updated_at: Date;
|
|
311
|
-
/** The requested address. */
|
|
312
|
-
address: string;
|
|
313
|
-
/** * The requested quote currency eg: `USD`. */
|
|
314
|
-
quote_currency: Quote;
|
|
315
|
-
/** * The requested chain name eg: `eth-mainnet`. */
|
|
316
|
-
chain_name: ChainName;
|
|
317
|
-
/** * The requested chain ID eg: `1`. */
|
|
318
|
-
chain_id: ChainID;
|
|
319
|
-
/** * List of response items. */
|
|
320
|
-
items: NftCollectionVolumeItem[];
|
|
321
|
-
}>;
|
|
322
|
-
export type NftCollectionVolumeItem = Nullable<{
|
|
323
|
-
/** * The timestamp of the date of sale. */
|
|
324
|
-
date: Date;
|
|
325
|
-
/** * The ticker symbol for the native currency. */
|
|
326
|
-
native_ticker_symbol: string;
|
|
327
|
-
/** * The contract name of the native currency. */
|
|
328
|
-
native_name: string;
|
|
329
|
-
/** * The current volume converted to fiat in `quoteCurrency`. */
|
|
330
|
-
volume_quote: number;
|
|
331
|
-
/** * The current volume in native currency. */
|
|
332
|
-
volume_native_quote: number;
|
|
333
|
-
/** * A prettier version of the volume quote for rendering purposes. */
|
|
334
|
-
pretty_volume_quote: string;
|
|
335
|
-
}>;
|
|
336
|
-
export type NftCollectionSalesCountResponse = Nullable<{
|
|
337
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
338
|
-
updated_at: Date;
|
|
339
|
-
/** The requested address. */
|
|
340
|
-
address: string;
|
|
341
|
-
/** * The requested quote currency eg: `USD`. */
|
|
342
|
-
quote_currency: Quote;
|
|
343
|
-
/** * The requested chain name eg: `eth-mainnet`. */
|
|
344
|
-
chain_name: ChainName;
|
|
345
|
-
/** * The requested chain ID eg: `1`. */
|
|
346
|
-
chain_id: ChainID;
|
|
347
|
-
/** * List of response items. */
|
|
348
|
-
items: NftCollectionSalesCountItem[];
|
|
349
|
-
}>;
|
|
350
|
-
export type NftCollectionSalesCountItem = Nullable<{
|
|
351
|
-
/** * The timestamp of the date of sale. */
|
|
352
|
-
date: Date;
|
|
353
|
-
/** * The total amount of sales for the current day. */
|
|
354
|
-
sales_count: string;
|
|
355
|
-
}>;
|