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

using System;
using System.Threading.Tasks;
using UnityEngine;
 
//This is an independent script which called GetChain() Api
namespace OktoSDK
{
    public class Chain : MonoBehaviour
    {
        public async Task<object> GetChains(OktoClient oc)
        {
            if (!oc.IsLoggedIn())
            {
                ResponsePanel.SetResponse("You are not logged In!");
                return "You are not logged In!";
            }
            try
            {
                var supportedNetworks = await BffClientRepository.GetBffClientRepository().GetSupportedNetworks();
                return supportedNetworks;
            }
            catch (Exception error)
            {
                Debug.LogError($"Failed to retrieve supported networks: {error}");
                throw new Exception("Unable to fetch supported networks");
            }
        }
    }
}

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 OktoClient.csYes

Response

Success Response

Field NameTypeDescription
chainsTask<List<NetworkData>>List of supported blockchain networks

On this page