Learn how to discover supported blockchain networks in Aave v4.
Chain data provides information about blockchain networks supported by Aave v4, including:
Identification: name, chain ID, icon URL
Configuration: explorer URL, whether it is a testnet
Native token details: wrapped token address and metadata
The following TypeScript interface illustrates the core Chain type:
interface Chain { __typename: "Chain"; chainId: ChainId; name: string; icon: string; rpcUrl: string; explorerUrl: string; isTestnet: boolean; nativeWrappedToken: EvmAddress; nativeInfo: TokenInfo; nativeGateway: EvmAddress; signatureGateway: EvmAddress;}
Discover all blockchain networks supported by Aave v4.
Use the useChains hook to fetch a list of supported chains.
import { type ChainsRequest, useChains } from "@aave/react";
function ChainsList({ request }: { request: ChainsRequest }) { const { data, loading, error } = useChains(request);
if (loading) return <div>Loading…</div>;
if (error) return <div>Error: {error.message}</div>;
return ( <div> {data.map((chain) => ( <div key={chain.chainId}> <h3>{chain.name}</h3> <p>Chain ID: {chain.chainId}</p> </div> ))} </div> );}
See below for examples of ChainsRequest objects.
import { ChainsFilter } from "@aave/react";
const request: ChainsRequest = { query: { filter: ChainsFilter.ALL },};
Where ChainsFilter is one of:
ChainsFilter.ALL - All chains
ChainsFilter.MAINNET_ONLY - Mainnets only
ChainsFilter.TESTNET_ONLY - Testnets only
Get detailed information about a specific blockchain network by its chain ID.
Use the useChain hook to fetch a specific chain.
import { type ChainRequest, useChain } from "@aave/react";
function ChainDetails({ request }: { request: ChainRequest }) { const { data, loading, error } = useChain(request);
if (loading) return <div>Loading…</div>;
if (error) return <div>Error: {error.message}</div>;
if (!data) return <div>Chain not found</div>;
return ( <div> <h3>{data.name}</h3> <p>Chain ID: {data.chainId}</p> </div> );}
See below for an example of a ChainRequest object.
import { chainId } from "@aave/react";
const request: ChainRequest = { chainId: chainId(1),};