Recipe logo

Avalanche Network

Covalent is supporting subnets!

Introduction

Avalanche is an open-source platform for launching decentralized applications and enterprise blockchain deployments in one interoperable, highly scalable ecosystem. Avalanche is the first smart contracts platform that processes 4,500+ transactions/second and instantly confirms transactions. Ethereum developers can quickly build on Avalanche as Solidity works out-of-the-box.

A key difference between Avalanche and other decentralized networks is the consensus protocol. Over time, people have come to a false understanding that blockchains have to be slow and not scalable. The Avalanche protocol employs a novel approach to consensus to achieve its strong safety guarantees, quick finality, and high-throughput, without compromising decentralization.

Quick facts

Property Value
Avalanche Mainnet C-Chain chainId 43114
Fuji Testnet C-Chain chainId 43113
Avalanche C-Chain Blockchain Explorer https://cchain.explorer.avax.network/
Block time ~3 seconds

Supported endpoints

Get token balances for address
Class A
Given chain_id and wallet address, return current token balances along with their spot prices. This endpoint supports a variety of token standards like ERC20, ERC721 and ERC1155. As a special case, network native tokens like ETH on Ethereum are also returned even though it’s not a token contract.
GET
/v1/:chain_id/address/:address/balances_v2/
Get transactions for address
Class A
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 address including indexed topics within the event logs.
GET
/v1/:chain_id/address/:address/transactions_v2/
Get ERC20 token transfers for address
Class A
Given chain_id, wallet address and contract-address, return all ERC20 token contract transfers along with their historical prices at the time of their transfer.
GET
/v1/:chain_id/address/:address/transfers_v2/
Get token holders as of any block height
Class A
Given chain_id and wallet address, return a paginated list of token holders. If block-height is omitted, the latest block is used.
GET
/v1/:chain_id/tokens/:address/token_holders/
Get log events by contract address
Class A
Given chain_id and contract address, return a paginated list of decoded log events emitted by a particular smart contract.
GET
/v1/:chain_id/events/address/:address/
Get log events by topic hash(es)
Class A
Given chain_id and topic hash(es), return a paginated list of decoded log events with one or more topic hashes separated by a comma.
GET
/v1/:chain_id/events/topics/:topic/

Go to Covalent’s API Reference


Appendix

AVAX Gas token

The AVAX token is the native token of Avalanche. This is similar to Ether in Ethereum. To interact with Avalanche, AVAX tokens are required to pay gas fees. The Covalent API response returns gas_* fields in fiat units.

Token mapping

Covalent maintains an on-chain real-time mapping of token addresses between Ethereum mainnet and the Avalanche C-chain. These addresses are used to reverse-lookup prices on Avalanche and also to return the right token logo urls.

Some example of mapped tokens:

Token Ethereum mainnet Avalanche mainnet
Uniswap UNI 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 0xdF3aCC3460965996FF496Cb9D0CF9E6859545a86
AAVE 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9 0x217446Ce09AA183a9034f4FF20d31b9268427187

For the current token mapping list, see: https://github.com/ava-labs/bridge-tokens/blob/main/data/eth_token_mapping.csv

Token prices

For tokens that have a mapping back to Ethereum mainnet, Covalent is able to return the mapped prices.

Infrastructure Providers

The following provide infrastructure for this blockchain network:

Last modified: September 21, 2022: Update postman collection URL (5744f29)