Aave V4 Supported Chains
Chains are the blockchain networks where Aave V4 is deployed.
Chain Data Structure
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: native token metadata, wrapped token address, and gateway
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;
isFork: boolean;
nativeAsset: NativeAsset | null;
// Deprecated: use nativeAsset
nativeWrappedToken: EvmAddress;
nativeInfo: TokenInfo;
nativeGateway: EvmAddress;
signatureGateway: EvmAddress;
}
type NativeAsset = WrappedNativeAsset | SharedBalanceNativeAsset;
interface WrappedNativeAsset {
__typename: "WrappedNativeAsset";
nativeToken: TokenInfo;
wrappedNativeTokenAddress: EvmAddress;
gateway: EvmAddress | null;
}
interface SharedBalanceNativeAsset {
__typename: "SharedBalanceNativeAsset";
nativeToken: TokenInfo;
erc20Address: EvmAddress;
}
interface TokenInfo {
__typename: "TokenInfo";
id: TokenInfoId;
name: string;
symbol: string;
// Case-folded, alias-resolved symbol grouping this token
// with the same asset on other chains.
canonicalSymbol: string;
icon: string;
decimals: number;
categories: TokenCategory[];
}
enum TokenCategory {
Stablecoin = "STABLECOIN",
EthCorrelated = "ETH_CORRELATED",
}
The following GraphQL fragments illustrate the core Chain type:
fragment Chain on Chain {
__typename
chainId
name
icon
rpcUrl
explorerUrl
isTestnet
isFork
nativeAsset {
...NativeAsset
}
# Deprecated: use nativeAsset
nativeWrappedToken
nativeInfo {
...TokenInfo
}
nativeGateway
signatureGateway
}
fragment NativeAsset on NativeAsset {
__typename
... on WrappedNativeAsset {
nativeToken {
...TokenInfo
}
wrappedNativeTokenAddress
gateway
}
... on SharedBalanceNativeAsset {
nativeToken {
...TokenInfo
}
erc20Address
}
}
fragment TokenInfo on TokenInfo {
__typename
id
name
symbol
canonicalSymbol
icon
decimals
categories
}
Listing Supported Chains
Discover all blockchain networks supported by Aave V4.
Use the use hook in React, the chains action in TypeScript, or the chains query in GraphQL 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>
);
}
import { type ChainsRequest, useChains } from "@aave/react";
function ChainsList({ request }: { request: ChainsRequest }) {
const { data } = useChains({
...request,
suspense: true,
});
return (
<div>
{data.map((chain) => (
<div key={chain.chainId}>
<h3>{chain.name}</h3>
<p>Chain ID: {chain.chainId}</p>
</div>
))}
</div>
);
}
import { ChainsFilter } from "@aave/client";
import { chains } from "@aave/client/actions";
import { client } from "./client";
const result = await chains(client, {
query: { filter: ChainsFilter.ALL },
});
if (result.isOk()) {
console.log(result.value); // Chain[]
} else {
console.error(result.error);
}
import { chainId } from "@aave/client";
import { chains } from "@aave/client/actions";
import { client } from "./client";
const result = await chains(client, {
query: { chainIds: [chainId(1), chainId(137)] },
});
if (result.isOk()) {
console.log(result.value); // Chain[]
} else {
console.error(result.error);
}
import { AaveClient } from "@aave/client";
export const client = AaveClient.create();
query ($request: ChainsRequest!) {
chains(request: $request) {
chainId
name
icon
explorerUrl
isTestnet
nativeWrappedToken
nativeInfo {
name
symbol
icon
decimals
}
nativeGateway
signatureGateway
}
}
See below for examples of Chains objects in React and query variables in GraphQL.
import { ChainsFilter, type ChainsRequest } from "@aave/react";
const request: ChainsRequest = {
query: { filter: ChainsFilter.ALL },
};
import { chainId, type ChainsRequest } from "@aave/react";
const request: ChainsRequest = {
query: { chainIds: [chainId(1), chainId(137)] },
};
{
"request": {
"query": {
"filter": "ALL" // or "MAINNET_ONLY" or "TESTNET_ONLY"
}
}
}
{
"request": {
"query": {
"chainIds": [1, 137]
}
}
}
In React and TypeScript, Chains is one of:
Chains: all chainsFilter. ALL Chains: mainnets onlyFilter. MAINNET_ ONLY Chains: testnets onlyFilter. TESTNET_ ONLY
Fetching a Single Chain
Get detailed information about a specific blockchain network by its chain ID.
Use the use hook in React, the chain action in TypeScript, or the chain query in GraphQL 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>
);
}
import { type ChainRequest, useChain } from "@aave/react";
function ChainDetails({ request }: { request: ChainRequest }) {
const { data } = useChain({
...request,
suspense: true,
});
if (!data) return <div>Chain not found</div>;
return (
<div>
<h3>{data.name}</h3>
<p>Chain ID: {data.chainId}</p>
</div>
);
}
import { chainId } from "@aave/client";
import { chain } from "@aave/client/actions";
import { client } from "./client";
const result = await chain(client, {
chainId: chainId(1),
});
if (result.isOk()) {
console.log(result.value); // Chain | null
} else {
console.error(result.error);
}
import { AaveClient } from "@aave/client";
export const client = AaveClient.create();
query ($request: ChainRequest!) {
chain(request: $request) {
chainId
name
icon
explorerUrl
isTestnet
nativeWrappedToken
nativeInfo {
name
symbol
icon
decimals
}
nativeGateway
signatureGateway
}
}
See below for an example of a Chain object in React and query variables in GraphQL.
import { chainId, type ChainRequest } from "@aave/react";
const request: ChainRequest = {
chainId: chainId(1),
};
{
"request": {
"chainId": 1
}
}