Workflows & Decision Trees
Quick Decision Tree
Select the right endpoint based on what the user wants to do:Balance & Portfolio Queries
- Check wallet balance →
getTokenBalancesForWalletAddress(primary, 1 per call) - Get historical balance at block →
getHistoricalTokenBalancesForWalletAddress(specialized, 1 per call) - Get portfolio value over time →
getHistoricalPortfolioForWalletAddress(primary, 2 per item) - Get native token only →
getNativeTokenBalance(primary, 0.5 per call)
Transaction Queries
- Get recent transactions →
getRecentTransactionsForAddress(primary, 0.1 per item) - Get paginated history →
getTransactionsForAddressV3(primary, 0.1 per item) - Get single transaction details →
getTransaction(primary, 0.1 per call) - Get ERC20 transfers →
getErc20TransfersForWalletAddress(primary, 0.05 per item) - Get transaction summary →
getTransactionSummary(primary, 1 per call)
Security & Approvals
- Check token approvals →
getApprovals(primary, 2 per call) - Check NFT approvals →
getNftApprovals(primary, 1 per call)
NFT & Token Queries
- Get NFT holdings →
getNftsForAddress(primary, 1 per call) - Get token holders →
getTokenHoldersV2ForTokenAddress(specialized, 0.02 per item)
Multi-chain Queries
- Check which chains address is active on →
getAddressActivity(primary, 0.5 per call) - Get balances across chains →
getMultiChainBalances(specialized, 2.5 per call) - Get transactions across chains →
getMultiChainMultiAddressTransactions(specialized, 0.25 per item)
Token & Price Queries
- Get token price history →
getTokenPrices(primary, 1 per call) - Get DEX pool prices →
getPoolSpotPrices(specialized, Foundational only)
Block & Event Queries
- Get block details →
getBlock(specialized, 1 per call) - Get block heights by date →
getBlockHeights(specialized, 1 per call) - Get contract event logs →
getLogEventsByAddress(specialized, 0.01 per item) - Get logs by topic hash →
getLogEventsByTopicHash(specialized, 0.01 per item)
Common Multi-Endpoint Workflows
Portfolio Valuation & Analysis
Transaction Deep Dive
Security Audit
Multi-Chain Portfolio
NFT Collection Analysis
Common Errors & Troubleshooting
This section covers common errors for frequently used endpoints.Get token balances for address
1. 400 Bad Request - Invalid address- Solution: Ensure address starts with 0x and is 40 hex characters
- Example: Valid:
0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
- Solution: Use exact chain name (case-sensitive):
eth-mainnetnot “ethereum” - Example: Correct:
eth-mainnet| Wrong:ethereum
- Solution: Filter by
is_spam: falseor use minimum quote threshold - Example: Filter:
items.filter(t => !t.is_spam && parseFloat(t.quote) > 0.01)
Get paginated transactions for address (v3)
1. 400 Bad Request - Invalid pagination- Solution: Page numbers are 0-indexed. First page is 0, not 1.
- Example: First:
page-number=0| Second:page-number=1
- Solution: Check
pagination.has_morefield. Continue untilhas_more: false. - Example: Loop:
while (response.data.pagination.has_more)
Get a transaction
1. 404 Not Found - Transaction not found- Solution: Verify tx hash format (0x + 64 hex chars) and wait for confirmation
- Example: Valid:
0x1234...(66 chars total)
- Solution: Each trace flag adds 0.05 credits. Only on Foundational chains.
- Example: Base: 0.1 | With traces: 0.25 credits
Wallet Activity Stream
1. WebSocket connection failed- Solution: Verify URL (wss://gr-staging-v2.streaming.covalenthq.com/graphql) and auth header
- Example: Header:
Authorization: Bearer YOUR_API_KEY
- Solution: Use enum format:
ETH_MAINNETnoteth-mainnet. Check chain supports Streaming. - Example: GraphQL:
ETH_MAINNET| REST:eth-mainnet
General Tips
- Always check
response.errorfield before accessingresponse.data - Chain names are case-sensitive: use exact values from Chain Capabilities Matrix
- Token balances are strings: use BigInt or decimal libraries for math
- Pagination is 0-indexed: first page is 0, not 1
- Check Chain Capabilities Matrix for feature availability