> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dzap.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Supported Chains

> Explore all blockchain networks supported by the DZap SDK

> DZap supports multiple blockchain networks, enabling cross-chain operations and full DeFi access.

The DZap SDK provides extensive multi-chain support, allowing you to interact with DeFi protocols across various blockchain networks. Each chain has specific capabilities and supported features.

## Chain IDs (reference)

Common mainnet chain IDs for use in `fromChain`, `toChain`, and RPC config:

| Chain     | chainId |
| --------- | ------- |
| Ethereum  | 1       |
| Arbitrum  | 42161   |
| Optimism  | 10      |
| Polygon   | 137     |
| Base      | 8453    |
| BNB Chain | 56      |
| Avalanche | 43114   |

For the full list, call `getAllSupportedChains()` and use each chain’s `chainId` and `name`.

## Get Supported Chains

Retrieve all chains supported by DZap:

```typescript theme={null}
import { DZapClient } from "@dzapio/sdk";

const dZap = DZapClient.getInstance();

// Get all supported chains
const supportedChains = await dZap.getAllSupportedChains();

console.log(
  `DZap supports ${Object.keys(supportedChains).length} blockchain networks:`
);
Object.values(supportedChains).forEach((chain) => {
  console.log(`${chain.name} (${chain.chainId}) - ${chain.coin}`);
});

// Get chains that support specific features
const bridgeChains = Object.values(supportedChains).filter(
  (chain) => chain.supportedAs.source && chain.supportedAs.destination
);

const zapChains = Object.values(supportedChains).filter(
  (chain) => chain.contracts?.zap
);

console.log(`Bridge-enabled chains: ${bridgeChains.length}`);
console.log(`Zap-enabled chains: ${zapChains.length}`);
```

## Filter Chains by Feature

Find chains that support zapping and list their contract addresses:

```typescript theme={null}
const supportedChains = await dZap.getAllSupportedChains();

// Get all zap-enabled chains with their contract addresses
const zapChains = Object.values(supportedChains)
  .filter((chain) => chain.contracts?.zap && chain.isEnabled)
  .map((chain) => ({
    name: chain.name,
    chainId: chain.chainId,
    zapContract: chain.contracts!.zap,
    explorer: chain.blockExplorerUrl,
  }));

console.log("Zap-enabled chains:");
zapChains.forEach((c) => {
  console.log(`  ${c.name} (${c.chainId}): ${c.zapContract}`);
});
```

## Build a Chain Selector

Create a filtered chain list for a UI dropdown:

```typescript theme={null}
const supportedChains = await dZap.getAllSupportedChains();

// Build options for a source chain selector
const sourceChainOptions = Object.values(supportedChains)
  .filter((chain) => chain.supportedAs.source && chain.mainnet && chain.isEnabled)
  .map((chain) => ({
    label: chain.name,
    value: chain.chainId,
    icon: chain.logo,
    nativeSymbol: chain.coin,
  }))
  .sort((a, b) => a.label.localeCompare(b.label));

console.log(`${sourceChainOptions.length} source chains available`);
```

## Chain Information Structure

Each chain contains detailed configuration:

```typescript theme={null}
type Chain = {
  coinKey: string; // Unique identifier
  chainId: number; // EIP-155 chain ID (or the chain's native numeric ID for non-EVM chains)
  chainType: string; // 'evm', 'svm', 'bvm', 'suivm', 'tronvm', 'tonvm', 'aptosvm', etc.
  name: string; // Human-readable name
  coin: string; // Native coin symbol
  dcaContract: string; // DCA contract address
  swapBridgeContract: string; // Swap/bridge contract address
  logo: string; // Chain logo URL
  tokenlistUrl?: string; // Token list URL
  multicallAddress?: string; // Multicall contract address, when available
  blockExplorerUrl: string; // Block explorer URL
  nativeToken: NativeTokenInfo; // Native token details
  rpcProviders: ApiRpcResponse[]; // Available RPC endpoints
  pricingAvailable: boolean; // Price data available
  balanceAvailable: boolean; // Balance queries supported
  supportedAs: {
    source: boolean; // Can be used as source chain
    destination: boolean; // Can be used as destination chain
  };
  contracts?: Partial<{
    router: string; // Swap router contract
    dca: string; // DCA contract
    zap: string; // Zap contract
  }>;
  coingecko?: {
    chainKey: string; // CoinGecko chain identifier
    nativeTokenKey: string; // CoinGecko native token ID
  };
  defiLlama?: {
    chainKey: string; // DeFiLlama chain identifier
    nativeTokenKey: string; // DeFiLlama native token ID
  };
  disableMultiTxn: boolean; // Whether multi-transaction operations are disabled
  isEnabled: boolean; // Whether chain is currently enabled
  mainnet: boolean; // Whether this is a mainnet chain
  tags?: { title: string; link?: string; message?: string }[]; // UI badges (e.g. "New", "Beta")
  version?: "v1" | "v2"; // DZap contract version deployed on this chain
};
```
