pub enum AnyAccount {
Ed25519(Ed25519Account),
MultiEd25519(MultiEd25519Account),
MultiKey(MultiKeyAccount),
Keyless(KeylessAccount),
Secp256k1(Secp256k1Account),
}Expand description
An enum that can hold any account type.
This is useful when you need to store different account types in the same collection or pass them around generically.
Variants§
Ed25519(Ed25519Account)
Available on crate feature
ed25519 only.An Ed25519 account.
MultiEd25519(MultiEd25519Account)
Available on crate feature
ed25519 only.A multi-Ed25519 account.
MultiKey(MultiKeyAccount)
A multi-key account (mixed signature types).
Keyless(KeylessAccount)
Available on crate feature
keyless only.A Keyless account.
Secp256k1(Secp256k1Account)
Available on crate feature
secp256k1 only.A Secp256k1 account.
Trait Implementations§
Source§impl Account for AnyAccount
impl Account for AnyAccount
Source§fn address(&self) -> AccountAddress
fn address(&self) -> AccountAddress
Returns the account address.
Source§fn authentication_key(&self) -> AuthenticationKey
fn authentication_key(&self) -> AuthenticationKey
Returns the authentication key.
Source§fn sign(&self, message: &[u8]) -> AptosResult<Vec<u8>>
fn sign(&self, message: &[u8]) -> AptosResult<Vec<u8>>
Signs a message and returns the signature bytes. Read more
Source§fn signature_scheme(&self) -> u8
fn signature_scheme(&self) -> u8
Returns the scheme identifier for this account type.
Source§impl Debug for AnyAccount
impl Debug for AnyAccount
Source§impl From<Ed25519Account> for AnyAccount
Available on crate feature ed25519 only.
impl From<Ed25519Account> for AnyAccount
Available on crate feature
ed25519 only.Source§fn from(account: Ed25519Account) -> Self
fn from(account: Ed25519Account) -> Self
Converts to this type from the input type.
Source§impl From<KeylessAccount> for AnyAccount
Available on crate feature keyless only.
impl From<KeylessAccount> for AnyAccount
Available on crate feature
keyless only.Source§fn from(account: KeylessAccount) -> Self
fn from(account: KeylessAccount) -> Self
Converts to this type from the input type.
Source§impl From<MultiEd25519Account> for AnyAccount
Available on crate feature ed25519 only.
impl From<MultiEd25519Account> for AnyAccount
Available on crate feature
ed25519 only.Source§fn from(account: MultiEd25519Account) -> Self
fn from(account: MultiEd25519Account) -> Self
Converts to this type from the input type.
Source§impl From<MultiKeyAccount> for AnyAccount
impl From<MultiKeyAccount> for AnyAccount
Source§fn from(account: MultiKeyAccount) -> Self
fn from(account: MultiKeyAccount) -> Self
Converts to this type from the input type.
Source§impl From<Secp256k1Account> for AnyAccount
Available on crate feature secp256k1 only.
impl From<Secp256k1Account> for AnyAccount
Available on crate feature
secp256k1 only.Source§fn from(account: Secp256k1Account) -> Self
fn from(account: Secp256k1Account) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AnyAccount
impl RefUnwindSafe for AnyAccount
impl Send for AnyAccount
impl Sync for AnyAccount
impl Unpin for AnyAccount
impl UnwindSafe for AnyAccount
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<A> Sponsor for Awhere
A: Account,
impl<A> Sponsor for Awhere
A: Account,
Source§fn sponsor<S: Account>(
&self,
sender: &S,
sender_sequence_number: u64,
payload: TransactionPayload,
chain_id: ChainId,
) -> AptosResult<SignedTransaction>
fn sponsor<S: Account>( &self, sender: &S, sender_sequence_number: u64, payload: TransactionPayload, chain_id: ChainId, ) -> AptosResult<SignedTransaction>
Sponsors a transaction for another account. Read more
Source§fn sponsor_with_gas<S: Account>(
&self,
sender: &S,
sender_sequence_number: u64,
payload: TransactionPayload,
chain_id: ChainId,
max_gas_amount: u64,
gas_unit_price: u64,
) -> AptosResult<SignedTransaction>
fn sponsor_with_gas<S: Account>( &self, sender: &S, sender_sequence_number: u64, payload: TransactionPayload, chain_id: ChainId, max_gas_amount: u64, gas_unit_price: u64, ) -> AptosResult<SignedTransaction>
Sponsors a transaction with custom gas settings. Read more