Explorer

Get Chains

Learn how to retrieve supported blockchain networks using the Okto SDK.

The getChains function retrieves a list of all blockchain networks supported by Okto. This includes information about each chain's configuration, network details, and supported features.

Available on

Ethereum
Ethereum
Polygon
Polygon
Avalanche
Avalanche
Arbitrum
Arbitrum
BSC
BSC
Fantom
Fantom
Linea
Linea
Metis
Metis
Optimism
Optimism
Base
Base
Base Sepolia
Base Sepolia
HyperEVM Testnet
HyperEVM Testnet
Polygon Amoy
Polygon Amoy

To enable these chains for your application, please configure them in the Okto Dashboard.

Not available on

Example

import { useOkto } from '@okto_web3/react-sdk';
import { getChains } from '@okto_web3/react-sdk'; 
 
function ChainsList() {
    const oktoClient = useOkto();
 
    async function fetchChains() {
        try {
            const chains = await getChains(oktoClient); 
            console.log('Supported chains:', chains);
        } catch (error) {
            console.error('Error fetching chains:', error);
        }
    }
 
    return (
        <button onClick={fetchChains}>
            Fetch Supported Chains
        </button>
    );
}

Note

For error handling:

Method Overview

MethodDescription
async getChainsGet all supported blockchain networks

Get Chains

async getChains(oktoClient: OktoClient) retrieves the list of all blockchain networks supported by Okto.

Parameters

ParameterTypeDescriptionRequired
oktoClientOktoClientInstance of OktoClient obtained from useOkto hookYes

Response

Success Response

Field NameTypeDescription
chainsPromise<GetSupportedNetworksResponseData[]>Array of supported blockchain networks

On this page