MuxedAccount

Represents a multiplexed (muxed) account on Stellar's network.

A muxed account is an extension of the regular account that allows multiple entities to share the same ed25519 key pair as their account ID while providing a unique identifier for each entity.

A muxed account consists of two parts:

  • The ed25519 account ID, which starts with the letter "G"

  • An optional account multiplexing ID, which is a 64-bit unsigned integer

When the multiplexing ID is set, the address starts with "M" instead of "G".

Usage

// Create from regular account ID
val account = MuxedAccount("GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H")

// Create from muxed account address
val muxedAccount = MuxedAccount("MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL6")
println(muxedAccount.accountId) // Returns underlying G... address
println(muxedAccount.id) // Returns the muxed ID

// Create from account ID and muxed ID
val muxed = MuxedAccount("GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H", 123456789UL)
println(muxed.address) // Returns M... address

See also

Constructors

Link copied to clipboard
constructor(accountId: String, id: ULong? = null)

Creates a new muxed account from the given ed25519 account ID and optional multiplexing ID.

constructor(address: String)

Creates a new muxed account from the given muxed account address.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The ed25519 account ID. It starts with the letter "G".

Link copied to clipboard

Returns the account address representation of this muxed account.

Link copied to clipboard

Alias for accountId. Returns the underlying ed25519 account ID (always starts with 'G'). This exists for compatibility with different naming conventions.

Link copied to clipboard
val id: ULong?

The optional account multiplexing ID. It is a 64-bit unsigned integer. Null if this is a regular (non-muxed) account.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Converts this muxed account to its XDR representation.