Moralis Covalent Plugin
This plugin enables interaction with the Covalent API (https://www.covalenthq.com/).
Get started
Grab a free api key here: https://www.covalenthq.com/
Optional parameters
When possible, this plugin supports pagination following the interface below.
interface ApiPagination { pageNumber?: number; pageSize?: number; }
The parameter pageNumber is set to 0 by default. The parameter pageSize is set to 100 by default.
This plugins also supports quoteCurrency. The parameter quoteCurrency is set to USD by default.
Endpoints
Get block
Description: Given chain id and block height return the block.
interface GetBlockDto { chainId: number; blockHeight: string; }
await Moralis.Plugins.covalent.getBlock(GetBlockDto);
Get All Contract Metadata
Description: Given chain id, return a list of all contracts on a blockchain along with their metadata.
interface GetAllContractMetaDto { chainId: number; pageNumber?: number; pageSize?: number; }
await Moralis.Plugins.covalent.getAllContractMetadata(GetAllContractMetaDto);
Get Block Heights
Description: Given chain id, start date, end date return all the block height(s) of a particular chain within a date range.
interface GetBlockHeightsDto { chainId: number; blockHeight: string; startDate: string; endDate: string; pageNumber?: number; pageSize?: number; }
await Moralis.Plugins.covalent.getBlockHeights(GetBlockHeightsDto);
Get Chains
Description: Returns a list of all chains.
interface GetChainsDto {}
await Moralis.Plugins.covalent.getChains(GetChainsDto);
Get Chain Statuses
Description: Returns a list of all chain statuses.
interface GetChainStatusesDto {}
await Moralis.Plugins.covalent.getChainsStatuses(GetChainStatusesDto);
Get Changes In Token Holders
Description: Given chain id and wallet address, return a paginated list of token holders and their current/historical balances, where the token balance of the holder changes between starting block and ending block.
interface GetChangesInTokenHoldersDto { chainId: number; address: Address; startingBlock: string; endingBlock: string; pageNumber?: number; pageSize?: number; quoteCurrency?: string; }
await Moralis.Plugins.covalent.getChangesInTokenHolerBetweenBlockHeights(GetChangesinTokenHoldersDto);
Get Erc20 Token Transactions For Address
Description: Given chain id user address and transaction hash return all ERC20 token contract transfers along with their historical prices at the time of their transfer.
interface GetErc20TokenTransactionsForAddressDto { chainId: number; address: Address; tokenAddress: Address; quoteCurrency?: string; pageNumber?: number; pageSize?: number; }
await Moralis.Plugins.covalent.getErc20TokenTransfersForAddress(GetErc20TokenTransactionsForAddressDto);
Get Historical Portfolio Value Over Time
Description: Given chain id and wallet address return wallet value for the last 30 days at 24 hour interval timestamps.
interface GetHistoricalPortfolioValueOverTimeDto { chainId: number; address: Address; quoteCurrency?: string; }
await Moralis.Plugins.covalent.getHistoricalPortfolioValueOverTime(GetHistoricalPortfolioValueOverTimeDto);
Get Log Events By Contract Address
Description: Given chain id, and contract address, return a paginated list of decoded log events emitted by a particular smart contract.
interface GetLogEventsByContractAddressDto { chainId: number; contractAddress: Address; startingBlock: string; endingBlock: string; pageNumber?: number; pageSize?: number; }
await Moralis.Plugins.covalent.getLogEventsByContractAddress(GetLogEventsByContractAddressDto);
Get log events by topic
Description: Given chain id and topic return a paginated list of decoded log events with one or more topic hashes separated by a comma.
interface GetLogEventsByTopicDto { chainId: number; topic: Topic; endBlock: string; secondaryTopic?: Topic; startBlock?: string; address?: Address; pageNumber?: number; pageSize?: number; }
await Moralis.Plugins.covalent.getTokenHoldersByTopic(GetLogEventsByTopicDto);
Get NFT Token IDs for contract
Description: Given chain id and contract address, return a list of all token IDs for the NFT contract on the blockchain.
interface GetNFTTokenIDsForContractDto { chainId: number; contractAddress: Address; pageNumber?: number; pageSize?: number; }
await Moralis.Plugins.covalent.getNftTokenIdForContract(GetNFTTokenIDsForContractDto);
Get NFT transactions for contract
Description: Given chain id, contract address and token id, return a list of transactions.
interface GetNFTTransactionsForContractDto { chainId: number; contractAddress: Address; tokenId: string; pageNumber?: number; pageSize?: number; }
await Moralis.Plugins.covalent.getNftTransactionsForContract(GetNFTTransactionsForContractDto);
Get NFT external metadata for contract
Description: Given chain id, contract address and token id, fetch and return the external metadata. Both ERC721 as well as ERC1155 standards are supported.
interface GetNFTExternalMetaForContractDto { chainId: number; contractAddress: Address; tokenId: string; }
await Moralis.Plugins.covalent.getNftExternalMetadataForContract(GetNFTExternalMetaForContractDto);
Get token balances for address
Description: Given chain id and wallet address return current token balances along with their spot prices.
interface GetTokenBalancesForAddressDto { chainId: number; address: Address; quoteCurrency?: string; }
await Moralis.Plugins.covalent.getTokenBalancesForAddress(GetTokenBalancesForAddressDto);
Get token holders as of any block height
Description: Given chain id and wallet address, return a paginated list of token holders. If block height is omitted, the latest block is used.
interface GetBlockTokenHoldersDto { chainId: number; contractAddress: Address; blockHeight: string; pageNumber?: number; pageSize?: number; quoteCurrency?: string; }
await Moralis.Plugins.covalent.getBlockTokenHolders(GetBlockTokenHoldersDto);
Get transactions
Description: Given chain id and transaction hash return return the transaction data with their decoded event logs.
interface GetTransactionDto { chainId: number; transactionHash: TransactionHash; }
await Moralis.Plugins.covalent.getTransaction(GetTransactionDto);
Get transactions for address
Description: Given chain id and wallet address return all transactions along with their decoded log events. This endpoint does a deep-crawl of the blockchain to retrieve all kinds of transactions that references the addressincluding indexed topics within the event logs.
interface GetTransactionsForAddressDto { chainId: number; address: Address; quoteCurrency?: string; pageNumber?: number; pageSize?: number; }
await Moralis.Plugins.covalent.getTransactionsForAddress(GetTransactionsForAddressDto);