ContactKey

value class ContactKey(val value: String)(source)

Type-safe wrapper for contact key strings (channel index + node address).

Contact keys are persisted as strings in the format "<channel><nodeId>" (e.g. "0^all", "1!a1b2c3d4").

Constructors

Link copied to clipboard
constructor(value: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Parsed NodeAddress for the contact.

Link copied to clipboard

The node address portion: everything after the channel digit, or the whole key when there is no channel prefix. Empty if the key is empty.

Link copied to clipboard

The channel index (first character). Returns 0 if the key is empty or has no channel digit.

Link copied to clipboard

The channel index if the key carries a leading channel digit, or null for a legacy unprefixed direct-message key. Callers that must distinguish "channel 0" from "no channel prefix" (e.g. PKI vs legacy DM routing) need this rather than channel.

Link copied to clipboard