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.
Example
import { useOkto } from '@okto_web3/react-native-sdk';
import { getChains } from '@okto_web3/react-native-sdk';
import { View, Text, Pressable } from 'react-native';
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 (
<View>
<Pressable onPress={fetchChains}>
<Text>Fetch Supported Chains</Text>
</Pressable>
</View>
);
}
Method Overview
Method | Description |
---|---|
async getChains | Get all supported blockchain networks |
Get Chains
async getChains(oktoClient: OktoClient)
retrieves the list of all blockchain networks supported by Okto.
Parameters
Parameter | Type | Description |
---|---|---|
oktoClient | OktoClient | Instance of OktoClient obtained from useOkto hook |
Response
Success Response
Field Name | Type | Description |
---|---|---|
chains | Promise<GetSupportedNetworksResponseData[]> | Array of supported blockchain networks |
Note
For error handling:
- Use the error code to debug issues. Check out the SDK errors and warnings documentation
- For help, navigate to the troubleshooting guide to contact support