ChainId

sealed class ChainId

Type-safe chain identifier following CAIP-2 format.

Provides compile-time type safety for chain IDs, preventing typos and invalid values. Supports both predefined chain IDs and custom chain IDs for extensibility.

Example Usage:

// Predefined chain IDs
val chainId = ChainId.Algorand.Testnet
val client = AlgorandBlockchainAnchorClient(chainId.toString(), options)

// Custom chain IDs
val customChain = ChainId.Custom("algorand:custom", "algorand")

String Conversion: Chain IDs can be converted to strings using toString() for backward compatibility with existing APIs.

Inheritors

Types

Link copied to clipboard
sealed class Algorand : ChainId

Algorand chain identifiers.

Link copied to clipboard
object Companion
Link copied to clipboard
data class Custom(chainId: String, namespace: String) : ChainId

Custom chain ID for extensibility.

Link copied to clipboard
sealed class Eip155 : ChainId

EVM chain identifiers (EIP-155).

Link copied to clipboard
sealed class Indy : ChainId

Hyperledger Indy chain identifiers.

Functions

Link copied to clipboard
abstract fun getNamespace(): String

Returns the namespace (e.g., "algorand", "eip155", "indy").

Link copied to clipboard
abstract override fun toString(): String

Returns the string representation of the chain ID (CAIP-2 format).