<div align="center"> <a href="https://goldrush.dev/products/goldrush/" target="_blank" rel="noopener noreferrer"> <img alt="GoldRush TS SDK Logo" src="./repo-static/ts-sdk-banner.png" style="max-width: 100%;"/> </a> </div>
npm install @covalenthq/client-sdkNodeJS v18 or above for best results.
bash
npm install @covalenthq/client-sdk
`
2. Create a client using the GoldRushClient
`ts
import { GoldRushClient, Chains } from "@covalenthq/client-sdk";
const client = new GoldRushClient("");
const ApiServices = async () => {
try {
const balanceResp =
await client.BalanceService.getTokenBalancesForWalletAddress(
"eth-mainnet",
"0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de"
);
if (balanceResp.error) {
throw balanceResp;
}
console.log(balanceResp.data);
} catch (error) {
console.error(error);
}
};
`
The GoldRushClient can be configured with a second object argument, settings, and a third argument for streamingConfig. The settings offered are
1. debug: A boolean that enables server logs of the API calls, enhanced with the request URL, response time and code, and other settings. It is set as false by default.
2. threadCount: A number that sets the number of concurrent requests allowed. It is set as 2 by default.
3. enableRetry: A boolean that enables retrying the API endpoint in case of a 429 - rate limit error. It is set as true by default.
4. maxRetries: A number that sets the number of retries to be made in case of 429 - rate limit error. To be in effect, it requires enableRetry to be enabled. It is set as 2 by default.
5. retryDelay: A number that sets the delay in ms for retrying the API endpoint in case of 429 - rate limit error. To be in effect, it requires enableRetry to be enabled. It is set as 2 by default.
6. source: A string that defines the source of the request of better analytics.
The streamingConfig is optional and configures the real-time streaming service. The available options are:
1. shouldRetry: A function that determines whether to retry connection based on retry count. Defaults to retry up to 5 times.
2. maxReconnectAttempts: Maximum number of reconnection attempts. Defaults to 5.
3. onConnecting: Callback function triggered when connecting to the streaming service.
4. onOpened: Callback function triggered when connection is successfully established.
5. onClosed: Callback function triggered when connection is closed.
6. onError: Callback function triggered when an error occurs.
Features
$3
The GoldRush SDK natively resolves the underlying wallet address for the following
1. ENS Domains (e.g. demo.eth)
2. Lens Handles (e.g. demo.lens)
3. Unstoppable Domains (e.g. demo.x)
4. RNS Domains (e.g. demo.ron)
$3
All the API call arguments have an option to pass typed objects as Query parameters.
For example, the following sets the quoteCurrency query parameter to CAD and the parameter nft to true for fetching all the token balances, including NFTs, for a wallet address:
`ts
const resp = await client.BalanceService.getTokenBalancesForWalletAddress(
"eth-mainnet",
"0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de",
{
quoteCurrency: "CAD",
nft: true,
}
);
`
$3
All the interfaces used, for arguments, query parameters and responses are also exported from the package which can be used for custom usage.
For example, explicitly typecasting the response
`ts
import {
GoldRushClient,
type BalancesResponse,
type BalanceItem,
} from "@covalenthq/client-sdk";
const resp = await client.BalanceService.getTokenBalancesForWalletAddress(
"eth-mainnet",
"0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de",
{
quoteCurrency: "CAD",
nft: true,
}
);
const data: BalancesResponse = resp.data;
const items: BalanceItem[] = resp.data.items;
`
$3
The SDK supports the following formats for the chain input:
1. Chain Name (e.g. eth-mainnet)
2. Chain ID (e.g. 1)
3. Chain Name Enum (e.g. ChainName.ETH_MAINNET)
4. Chain ID Enum (e.g. ChainID.ETH_MAINNET)
$3
For paginated responses, the GoldRush API can at max support 100 items per page. However, the Covalent SDK leverages generators to _seamlessly fetch all items without the user having to deal with pagination_.
For example, the following fetches ALL transactions for 0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de on Ethereum:
`ts
import { GoldRushClient } from "@covalenthq/client-sdk";
const ApiServices = async () => {
const client = new GoldRushClient("");
try {
for await (const tx of client.TransactionService.getAllTransactionsForAddress(
"eth-mainnet",
"0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de"
)) {
console.log("tx", tx);
}
} catch (error) {
console.log(error.message);
}
};
`
$3
Paginated methods have been enhanced with the introduction of next() and prev() support functions. These functions facilitate a smoother transition for developers navigating through our links object, which includes prev and next fields. Instead of requiring developers to manually extract values from these fields and create JavaScript API fetch calls for the URL values, the new next() and prev() functions provide a streamlined approach, allowing developers to simulate this behavior more efficiently.
`ts
import { GoldRushClient } from "@covalenthq/client-sdk";
const client = new GoldRushClient("");
const resp = await client.TransactionService.getAllTransactionsForAddressByPage(
"eth-mainnet",
"0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de"
); // assuming resp.data.current_page is 10
if (resp.data !== null) {
const prevPage = await resp.data.prev(); // will retrieve page 9
console.log(prevPage.data);
}
`
$3
1. bigIntParser: Formats input as a bigint value. For example
`ts
bigIntParser("-123"); // -123n
`
You can explore more examples here
2. calculatePrettyBalance: Formats large and raw numbers and bigints to human friendly format. For example
`ts
calculatePrettyBalance(1.5, 3, true, 4); // "0.0015"
`
You can explore more examples here
3. isValidApiKey: Checks for the input as a valid GoldRush API Key. For example
`ts
isValidApiKey(cqt_wF123); // false
`
You can explore more examples here
4. prettifyCurrency: Formats large and raw numbers and bigints to human friendly currency format. For example
`ts
prettifyCurrency(89.0, 2, "CAD"); // "CA$89.00"
`
You can explore more examples here
5. timestampParser: Convert ISO timestamps to various human-readable formats
`ts
timestampParser("2024-10-16T12:39:23.000Z", "descriptive"); // "October 16 2024 at 18:09:23"
`
You can explore more examples here
$3
The GoldRush SDK now supports real-time streaming of blockchain data via WebSocket connections. This allows you to subscribe to live data feeds for OHLCV (Open, High, Low, Close, Volume) data for trading pairs and tokens, new DEX pair creations, wallet activity, and more.
`ts
import {
GoldRushClient,
StreamingChain,
StreamingInterval,
StreamingTimeframe,
StreamingProtocol,
} from "@covalenthq/client-sdk";
const client = new GoldRushClient(
"",
{},
{
onConnecting: () => console.log("Connecting to streaming service..."),
onOpened: () => console.log("Connected to streaming service!"),
onClosed: () => console.log("Disconnected from streaming service"),
onError: (error) => console.error("Streaming error:", error),
}
);
// Subscribe to OHLCV data for trading pairs
const unsubscribePairs = client.StreamingService.subscribeToOHLCVPairs(
{
chain_name: StreamingChain.BASE_MAINNET,
pair_addresses: ["0x9c087Eb773291e50CF6c6a90ef0F4500e349B903"],
interval: StreamingInterval.ONE_MINUTE,
timeframe: StreamingTimeframe.ONE_HOUR,
},
{
next: (data) => {
console.log("Received OHLCV pair data:", data);
},
error: (error) => {
console.error("Streaming error:", error);
},
complete: () => {
console.log("Stream completed");
},
}
);
// Unsubscribe when done
// unsubscribePairs();
// Disconnect from streaming service when finished
// await client.StreamingService.disconnect();
`
#### Multiple Subscriptions
The SDK uses a singleton WebSocket client internally, allowing you to create multiple subscriptions through the same GoldRushClient.
`ts
// Create a single client
const client = new GoldRushClient("");
// Create multiple subscriptions through the same connection
const unsubscribePairs = client.StreamingService.subscribeToOHLCVPairs(
{
chain_name: StreamingChain.BASE_MAINNET,
pair_addresses: ["0x9c087Eb773291e50CF6c6a90ef0F4500e349B903"],
interval: StreamingInterval.ONE_MINUTE,
timeframe: StreamingTimeframe.ONE_HOUR,
},
{
next: (data) => console.log("OHLCV Pairs:", data),
}
);
const unsubscribeTokens = client.StreamingService.subscribeToOHLCVTokens(
{
chain_name: StreamingChain.BASE_MAINNET,
token_addresses: ["0x4B6104755AfB5Da4581B81C552DA3A25608c73B8"],
interval: StreamingInterval.ONE_MINUTE,
timeframe: StreamingTimeframe.ONE_HOUR,
},
{
next: (data) => console.log("OHLCV Tokens:", data),
}
);
const unsubscribeWallet = client.StreamingService.subscribeToWalletActivity(
{
chain_name: StreamingChain.BASE_MAINNET,
wallet_addresses: ["0xbaed383ede0e5d9d72430661f3285daa77e9439f"],
},
{
next: (data) => console.log("Wallet Activity:", data),
}
);
// Unsubscribe from individual streams when needed
// unsubscribePairs();
// unsubscribeTokens();
// unsubscribeWallet();
// Or disconnect from all streams at once
// await client.StreamingService.disconnect();
`
#### React Integration
For React applications, use the useEffect hook to properly manage subscription lifecycle:
`tsx
useEffect(() => {
const unsubscribe = client.StreamingService.rawQuery(
subscription {
,
{},
{
next: (data) => console.log("Received streaming data:", data),
error: (err) => console.error("Subscription error:", err),
complete: () => console.info("Subscription completed"),
}
);
// Cleanup function - unsubscribe when component unmounts
return () => {
unsubscribe();
};
}, []);
`
#### Raw Queries
You can also use raw GraphQL queries for more streamlined and selective data scenarios:
`ts
const unsubscribeNewPairs = client.StreamingService.rawQuery(
subscription {
,
{},
{
next: (data) => console.log("Raw new pairs data:", data),
error: (error) => console.error("Error:", error),
}
);
// Raw query for token OHLCV data
const unsubscribeTokenOHLCV = client.StreamingService.rawQuery(
subscription {
,
{},
{
next: (data) => console.log("Raw token OHLCV data:", data),
error: (error) => console.error("Error:", error),
}
);
`
$3
All the responses are of the same standardized format
`ts
❴
"data": `
Supported Endpoints
The Covalent SDK provides comprehensive support for all Class A, Class B, and Pricing endpoints that are grouped under the following _Service_ namespaces:
1. All Chains Service: Access to the data across multiple chains and addresses.
- getAddressActivity(walletAddress: string, queryParamOpts?: GetAddressActivityQueryParamOpts): Promise: Locate chains where an address is active on with a single API call.
- getMultiChainMultiAddressTransactions(queryParamOpts?: GetMultiChainMultiAddressTransactionsParamOtps): Promise: Fetch and render the transactions across multiple chains and addresses
- getMultiChainBalances(walletAddress: string, queryParamOpts?: GetMultiChainBalanceQueryParamOpts): Promise: Fetch the token balances of an address for multiple chains. (limited to 10 chains at a time)
2. Security Service: Access to the token approvals API endpoints
- getApprovals(chainName: Chain, walletAddress: string): Promise: Get a list of approvals across all ERC20 token contracts categorized by spenders for a wallet's assets.
- getNftApprovals(chainName: Chain, walletAddress: string): Promise: Get a list of approvals across all NFT contracts categorized by spenders for a wallet's assets.
3. Balance Service: Access to the balances endpoints
- getTokenBalancesForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetTokenBalancesForWalletAddressQueryParamOpts): Promise: Fetch the native, fungible (ERC20), and non-fungible (ERC721 & ERC1155) tokens held by an address. Response includes spot prices and other metadata.
- getHistoricalTokenBalancesForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetHistoricalTokenBalancesForWalletAddressQueryParamOpts): Promise: Fetch the historical native, fungible (ERC20), and non-fungible (ERC721 & ERC1155) tokens held by an address at a given block height or date. Response includes daily prices and other metadata.
- getHistoricalPortfolioForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetHistoricalPortfolioForWalletAddressQueryParamOpts): Promise: Render a daily portfolio balance for an address broken down by the token. The timeframe is user-configurable, defaults to 30 days.
- getErc20TransfersForWalletAddress(chainName: Chain, walletAddress: string, queryParamOpts: GetErc20TransfersForWalletAddressQueryParamOpts): AsyncIterable: Render the transfer-in and transfer-out of a token along with historical prices from an address. (Paginated)
- getErc20TransfersForWalletAddressByPage(chainName: Chain, walletAddress: string, queryParamOpts: GetErc20TransfersForWalletAddressQueryParamOpts): Promise: Render the transfer-in and transfer-out of a token along with historical prices from an address. (NonPaginated)
- getTokenHoldersV2ForTokenAddress(chainName: Chain, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): AsyncIterable: Get a list of all the token holders for a specified ERC20 or ERC721 token. Returns historic token holders when block-height is set (defaults to latest). Useful for building pie charts of token holders. (Paginated)
- getTokenHoldersV2ForTokenAddressByPage(chainName: Chain, tokenAddress: string, queryParamOpts?: GetTokenHoldersV2ForTokenAddressQueryParamOpts): Promise: Get a list of all the token holders for a specified ERC20 or ERC721 token. Returns historic token holders when block-height is set (defaults to latest). Useful for building pie charts of token holders. (Nonpaginated)
- getNativeTokenBalance(chainName: Chain, walletAddress: string, queryParamOpts?: GetNativeTokenBalanceQueryParamOpts): Promise: Get the native token balance for an address. This endpoint is required because native tokens are usually not ERC20 tokens and sometimes you want something lightweight.
4. Base Service: Access to the address activity, log events, chain status, and block retrieval endpoints
- getBlock(chainName: Chain, blockHeight: string): Promise: Fetch and render a single block for a block explorer.
- getLogs(chainName: Chain, queryParamOpts?: GetLogsQueryParamOpts): Promise: Get all the event logs of the latest block, or for a range of blocks. Includes sender contract metadata as well as decoded logs.
- getResolvedAddress(chainName: Chain, walletAddress: string): Promise: Used to resolve ENS, RNS and Unstoppable Domains addresses.
- getBlockHeights(chainName: Chain, startDate: string, endDate: string | "latest", queryParamOpts?: GetBlockHeightsQueryParamOpts): AsyncIterable: Get all the block heights within a particular date range. Useful for rendering a display where you sort blocks by day. (Paginated)
- getBlockHeightsByPage(chainName: Chain, startDate: string, endDate: string | "latest", queryParamOpts?: GetBlockHeightsQueryParamOpts): Promise: Get all the block heights within a particular date range. Useful for rendering a display where you sort blocks by day. (Nonpaginated)
- getLogEventsByAddress(chainName: Chain, contractAddress: string, queryParamOpts?: GetLogEventsByAddressQueryParamOpts): AsyncIterable: Get all the event logs emitted from a particular contract address. Useful for building dashboards that examine on-chain interactions. (Paginated)
- getLogEventsByAddressByPage(chainName: Chain, contractAddress: string, queryParamOpts?: GetLogEventsByAddressQueryParamOpts): Promise: Get all the event logs emitted from a particular contract address. Useful for building dashboards that examine on-chain interactions. (Nonpaginated)
- getLogEventsByTopicHash(chainName: Chain, topicHash: string, queryParamOpts?: GetLogEventsByTopicHashQueryParamOpts): AsyncIterable: 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. (Paginated)
- getLogEventsByTopicHashByPage(chainName: Chain, topicHash: string, queryParamOpts?: GetLogEventsByTopicHashQueryParamOpts): Promise: 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. (Nonpaginated)
- getAllChains(): Promise: Used to build internal dashboards for all supported chains on Covalent.
- getAllChainStatus(): Promise: Used to build internal status dashboards of all supported chains.
- getGasPrices(chainName: Chain, eventType: "erc20" | "nativetokens" | "uniswapv3", queryParamOpts?: GetGasPricesQueryParamOpts): Promise: Get real-time gas estimates for different transaction speeds on a specific network, enabling users to optimize transaction costs and confirmation times.
5. Bitcoin Service: Access to the Bitcoin wallet endpoints
- getBitcoinHdWalletBalances(walletAddress: string, queryParamOpts?: GetBitcoinHdWalletBalancesQueryParamOpts): Promise: Fetch balances for each active child address derived from a Bitcoin HD wallet.
- getBitcoinNonHdWalletBalances(walletAddress: string, queryParamOpts?: GetBitcoinNonHdWalletBalancesQueryParamOpts): Promise: Fetch the native, fungible (ERC20), and non-fungible (ERC721 & ERC1155) tokens held by an address. Response includes spot prices and other metadata.
- getTransactionsForBtcAddress(queryParamOpts?: GetTransactionsForBitcoinAddressParamOpts): Promise: Used to fetch the full transaction history of a Bitcoin wallet. Only supports non-HD bitcoin addresses.
6. NFT Service: Access to the NFT endpoints
- getChainCollections(chainName: Chain, queryParamOpts?: GetChainCollectionsQueryParamOpts): AsyncIterable: Used to fetch the list of NFT collections with downloaded and cached off chain data like token metadata and asset files. (Paginated)
- getChainCollectionsByPage(chainName: Chain, queryParamOpts?: GetChainCollectionsQueryParamOpts): Promise: Used to fetch the list of NFT collections with downloaded and cached off chain data like token metadata and asset files. (Nonpaginated)
- getNftsForAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetNftsForAddressQueryParamOpts): Promise: Used to render the NFTs (including ERC721 and ERC1155) held by an address.
- getTokenIdsForContractWithMetadata(chainName: Chain, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): AsyncIterable: Get NFT token IDs with metadata from a collection. Useful for building NFT card displays. (Paginated)
- getTokenIdsForContractWithMetadataByPage(chainName: Chain, contractAddress: string, queryParamOpts?: GetTokenIdsForContractWithMetadataQueryParamOpts): Promise: Get NFT token IDs with metadata from a collection. Useful for building NFT card displays. (Nonpaginated)
- getNftMetadataForGivenTokenIdForContract(chainName: Chain, contractAddress: string, tokenId: string, queryParamOpts?: GetNftMetadataForGivenTokenIdForContractQueryParamOpts): Promise: Get a single NFT metadata by token ID from a collection. Useful for building NFT card displays.
- getNftTransactionsForContractTokenId(chainName: Chain, contractAddress: string, tokenId: string, queryParamOpts?: GetNftTransactionsForContractTokenIdQueryParamOpts): Promise: Get all transactions of an NFT token. Useful for building a transaction history table or price chart.
- getTraitsForCollection(chainName: Chain, contractAddress: string): Promise: Used to fetch and render the traits of a collection as seen in rarity calculators.
- getAttributesForTraitInCollection(chainName: Chain, contractAddress: string, trait: string): Promise: Used to get the count of unique values for traits within an NFT collection.
- getCollectionTraitsSummary(chainName: Chain, contractAddress: string): Promise: Used to calculate rarity scores for a collection based on its traits.
- getHistoricalFloorPricesForCollection(chainName: Chain, contractAddress: string, queryParamOpts?: GetHistoricalFloorPricesForCollectionQueryParamOpts): Promise: Commonly used to render a price floor chart for an NFT collection.
- getHistoricalVolumeForCollection(chainName: Chain, contractAddress: string, queryParamOpts?: GetHistoricalVolumeForCollectionQueryParamOpts): Promise: Commonly used to build a time-series chart of the transaction volume of an NFT collection.
- getHistoricalSalesCountForCollection(chainName: Chain, contractAddress: string, queryParamOpts?: GetHistoricalSalesCountForCollectionQueryParamOpts): Promise: Commonly used to build a time-series chart of the sales count of an NFT collection.
- checkOwnershipInNft(chainName: Chain, contractAddress: string, walletAddress: string): Promise: Used to verify ownership of NFTs (including ERC-721 and ERC-1155) within a collection.
- checkOwnershipInNftForSpecificTokenId(chainName: Chain, contractAddress: string, tokenId: string, walletAddress: string): Promise: Used to verify ownership of a specific token (ERC-721 or ERC-1155) within a collection.
7. Pricing Service: Access to the historical token prices endpoint
- getTokenPrices(chainName: Chain, quoteCurrency: Quote, contractAddress: string, queryParamOpts?: GetTokenPricesQueryParamOpts): Promise: Get historic prices of a token between date ranges. Supports native tokens.
- getPoolSpotPrices(chainName: Chain, contractAddress: string, queryParamOpts?: PoolSpotPriceQueryParamsOpts): Promise: Get the spot token pair prices for a specified pool contract address. Supports pools on Uniswap V2, V3 and their forks.
8. Transaction Service: Access to the transactions endpoints
- getAllTransactionsForAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): AsyncIterable: Fetch and render the most recent transactions involving an address. Frequently seen in wallet applications. (Paginated)
- getAllTransactionsForAddressByPage(chainName: Chain, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): Promise: Fetch and render the most recent transactions involving an address. Frequently seen in wallet applications. (Nonpaginated)
- getPaginatedTransactionsForAddress(chainName: Chain, walletAddress: string, queryParamOpts?: getPaginatedTransactionsForAddressQueryParamOpts): Promise: Fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
- getTransaction(chainName: Chain, txHash: string, queryParamOpts?: GetTransactionQueryParamOpts): Promise: Fetch and render a single transaction including its decoded log events. Additionally return semantically decoded information for DEX trades, lending and NFT sales.
- getTransactionsForBlockByPage(chainName: Chain, blockHeight: string, queryParamOpts?: getTransactionsForBlockByPageQueryParamOpts): Promise: Fetch all transactions including their decoded log events in a block by page number and further flag interesting wallets or transactions.
- getTransactionsForBlock(chainName: Chain, blockHash: string, queryParamOpts?: GetTransactionsForBlockQueryParamOpts): Promise: Fetch all transactions including their decoded log events in a block by block hash and further flag interesting wallets or transactions.
- getTransactionSummary(chainName: Chain, walletAddress: string, queryParamOpts?: GetTransactionSummaryQueryParamOpts): Promise: 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.
- getTimeBucketTransactionsForAddress(chainName: Chain, walletAddress: string, timeBucket: number, queryParamOpts?: GetTimeBucketTransactionsForAddressQueryParamOpts): Promise: Fetch all transactions including their decoded log events in a 15-minute time bucket interval.
- getEarliestTransactionsForAddress(chainName: Chain, walletAddress: string, queryParamOpts?: GetEarliestTransactionsForAddressQueryParamOpts): Promise: Fetch and render the earliest transactions involving an address. Frequently seen in wallet applications.
9. Streaming Service: Real-time blockchain data streaming via WebSocket connections
- getClient(): Client: Get the underlying GraphQL WebSocket client for direct access.
- isConnected: boolean: Check the connection status of the streaming service.
- subscribeToOHLCVPairs(params: OHLCVPairsStreamParams, callbacks: StreamSubscriptionOptions: Subscribe to real-time OHLCV (Open, High, Low, Close, Volume) data for specific trading pairs. Supports multiple chains and configurable intervals and timeframes.
- subscribeToOHLCVTokens(params: OHLCVTokensStreamParams, callbacks: StreamSubscriptionOptions: Subscribe to real-time OHLCV (Open, High, Low, Close, Volume) data for specific tokens. Tracks token prices across their primary DEX pools with configurable intervals and timeframes.
- subscribeToWalletActivity(params: WalletActivityStreamParams, callbacks: StreamSubscriptionOptions: Subscribe to real-time wallet activity including transactions, token transfers, and smart contract interactions. Provides decoded transaction details for swaps, transfers, bridges, deposits, withdrawals, and approvals.
- subscribeToNewPairs(params: NewPairsStreamParams, callbacks: StreamSubscriptionOptions: Subscribe to real-time notifications when new liquidity pairs are created on supported decentralized exchanges (DEXes). Supports Uniswap V2/V3 across Base, Ethereum, and BSC networks.
- subscribeToUpdatePairs(params: UpdatePairsStreamParams, callbacks: StreamSubscriptionOptions: Subscribe to real-time updates for specific trading pairs including quote rate, volume, liquidity data, price deltas, and swap counts.
- rawQuery: Execute custom GraphQL subscription queries for advanced streaming scenarios and future extensibility.
- disconnect(): Promise