chainCode method

String chainCode()

Primary SDK chain code from injectedConfig, then the first CAIP-2 namespace, otherwise EVM.

Implementation

String chainCode() {
  return switch ((firstOrNull(this.injectedConfig)?.chain ?? "").toLowerCase()) { "eip155" => "EVM", "evm" => "EVM", "solana" => "SOL", "sol" => "SOL", "bip122" => "BTC", "bitcoin" => "BTC", "btc" => "BTC", "sui" => "SUI", "cosmos" => "COSMOS", "starknet" => "STARK", _ => (switch ((firstOrNull(this.chains) ?? "").split(":").first.toLowerCase()) { "eip155" => "EVM", "evm" => "EVM", "solana" => "SOL", "sol" => "SOL", "bip122" => "BTC", "bitcoin" => "BTC", "btc" => "BTC", "sui" => "SUI", "cosmos" => "COSMOS", "starknet" => "STARK", _ => "EVM" }) };
}