Skip to content

convertChainIdToCoinType

Converts a given chain ID to a coin type, following specific standards for mainnet and non-mainnet chains.

Import

import { convertChainIdToCoinType } from "@aa-sdk/core";

Usage

import { convertChainIdToCoinType } from "@aa-sdk/core";
import { sepolia } from "viem/chains";
 
const coinType = convertChainIdToCoinType(sepolia.id);

Parameters

chainId

number the blockchain chain ID that you want to convert to a coin type

Returns

number the corresponding coin type for the given chain ID