Description

Multiplexed addresses are like aliases for a normal account.

pub struct MuxedAccount {
    account: Account,
    muxed_xdr: stellar_xdr::MuxedAccount,
    m_address: String,
    id: String,
}

Interface Code

pub trait MuxedAccount {
 
    // Parses an M-address into a MuxedAccount object
    fn from_address(m_address: &str, sequence_num: u64) -> Self;

    // Returns the underlying account object shared among all muxed accounts with this Stellar address
    fn base_account(&self) -> &Account;

    // Returns the M-address representing this account's (G-address, ID)
    fn account_id(&self) -> &str;

    // Returns the ID of the muxed account
    fn id(&self) -> &str;

    // Sets the ID of the muxed account
    fn set_id(&mut self, id: &str) -> Result<(), &str>;

    // Returns the sequence number for the underlying account
    fn sequence_number(&self) -> u64;

    // Increments the sequence number for the underlying account by one
    fn increment_sequence_number(&mut self);

    // Returns the XDR object representing this muxed account's G-address and uint64 ID
    fn to_xdr_object(&self) -> xdr::MuxedAccount;

    // Checks if this muxed account is equal to another muxed account
    fn equals(&self, other_muxed_account: &dyn MuxedAccount) -> bool;
}

Interface Code Link

https://github.com/rahul-soshte/rs-stellar-base/blob/main/src/muxed_account.rs