Package org.stellar.sdk
Class MuxedAccount
java.lang.Object
org.stellar.sdk.MuxedAccount
Represents a multiplexed 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.
- See Also:
-
Constructor Summary
ConstructorDescriptionMuxedAccount
(@NonNull String address) Creates a new muxed account from the given muxed account address.MuxedAccount
(@NonNull String accountId, BigInteger muxedId) Creates a new muxed account from the given ed25519 account ID and optional multiplexing ID. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static MuxedAccount
fromXdr
(MuxedAccount xdr) Creates a new muxed account from the given XDR representation.@NonNull String
The ed25519 account ID.Returns the account address representation of this muxed account.The optional account multiplexing ID.int
hashCode()
toString()
toXdr()
Returns the XDR representation of this muxed account.
-
Constructor Details
-
MuxedAccount
Creates a new muxed account from the given ed25519 account ID and optional multiplexing ID.- Parameters:
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.- Throws:
IllegalArgumentException
- If the provided account ID is invalid.
-
MuxedAccount
Creates a new muxed account from the given muxed account address.- Parameters:
address
- The muxed account address. It can be either a regular account ID (starting with "G") or a muxed account address (starting with "M").- Throws:
IllegalArgumentException
- If the provided address is invalid.
-
-
Method Details
-
getAddress
Returns the account address representation of this muxed account.- Returns:
- The account address. It starts with "M" if the multiplexing ID is set, or with "G" if the multiplexing ID is not set.
-
fromXdr
Creates a new muxed account from the given XDR representation.- Parameters:
xdr
- The XDR representation of the muxed account.- Returns:
- A new muxed account instance.
- Throws:
IllegalArgumentException
- If the provided XDR is invalid.
-
toXdr
Returns the XDR representation of this muxed account.- Returns:
- The XDR representation of the muxed account.
-
getAccountId
The ed25519 account ID. It starts with the letter "G". -
getMuxedId
The optional account multiplexing ID. It is a 64-bit unsigned integer. -
toString
-
equals
-
hashCode
public int hashCode()
-