public class MuxedAccount
extends java.lang.Object
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:
Constructor and Description |
---|
MuxedAccount(@NonNull java.lang.String address)
Creates a new muxed account from the given muxed account address.
|
MuxedAccount(@NonNull java.lang.String accountId,
java.math.BigInteger muxedId)
Creates a new muxed account from the given ed25519 account ID and optional multiplexing ID.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
static MuxedAccount |
fromXdr(MuxedAccount xdr)
Creates a new muxed account from the given XDR representation.
|
@NonNull java.lang.String |
getAccountId()
The ed25519 account ID.
|
java.lang.String |
getAddress()
Returns the account address representation of this muxed account.
|
java.math.BigInteger |
getMuxedId()
The optional account multiplexing ID.
|
int |
hashCode() |
java.lang.String |
toString() |
MuxedAccount |
toXdr()
Returns the XDR representation of this muxed account.
|
public MuxedAccount(@NonNull @NonNull java.lang.String accountId, @Nullable java.math.BigInteger muxedId)
accountId
- The ed25519 account ID. It must be a valid account ID starting with "G".muxedId
- The optional account multiplexing ID. It can be null if not set.java.lang.IllegalArgumentException
- If the provided account ID is invalid.public MuxedAccount(@NonNull @NonNull java.lang.String address)
address
- The muxed account address. It can be either a regular account ID (starting with
"G") or a muxed account address (starting with "M").java.lang.IllegalArgumentException
- If the provided address is invalid.public java.lang.String getAddress()
public static MuxedAccount fromXdr(MuxedAccount xdr)
xdr
- The XDR representation of the muxed account.java.lang.IllegalArgumentException
- If the provided XDR is invalid.public MuxedAccount toXdr()
@NonNull public @NonNull java.lang.String getAccountId()
@Nullable public java.math.BigInteger getMuxedId()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object