pub enum Account {
KeyPair(SingleAccount),
Multisig(MultisigAccount),
}Expand description
Represents either a single-signature or multisig account.
This is the main account type used for interacting with the Stellar network. It provides methods for signing transactions, configuring account settings, and managing sequence numbers.
Variants§
KeyPair(SingleAccount)
Single-signature account with one key pair
Multisig(MultisigAccount)
Multi-signature account
Implementations§
Source§impl Account
impl Account
Sourcepub async fn load(&self, env: &Env) -> Result<AccountEntry, SorobanHelperError>
pub async fn load(&self, env: &Env) -> Result<AccountEntry, SorobanHelperError>
Sourcepub fn account_id(&self) -> AccountId
pub fn account_id(&self) -> AccountId
Returns the account ID.
Sourcepub async fn get_sequence(
&self,
env: &Env,
) -> Result<AccountSequence, SorobanHelperError>
pub async fn get_sequence( &self, env: &Env, ) -> Result<AccountSequence, SorobanHelperError>
Sourcepub async fn next_sequence(
&self,
env: &Env,
) -> Result<AccountSequence, SorobanHelperError>
pub async fn next_sequence( &self, env: &Env, ) -> Result<AccountSequence, SorobanHelperError>
Sets the number of authorized calls for the account.
§Parameters
authorized_calls- The number of calls to authorize
Sourcepub fn sign_transaction_unsafe(
&self,
tx: &Transaction,
network_id: &Hash,
) -> Result<TransactionEnvelope, SorobanHelperError>
pub fn sign_transaction_unsafe( &self, tx: &Transaction, network_id: &Hash, ) -> Result<TransactionEnvelope, SorobanHelperError>
Sourcepub fn sign_transaction(
&mut self,
tx: &Transaction,
network_id: &Hash,
) -> Result<TransactionEnvelope, SorobanHelperError>
pub fn sign_transaction( &mut self, tx: &Transaction, network_id: &Hash, ) -> Result<TransactionEnvelope, SorobanHelperError>
Sourcepub fn sign_transaction_envelope(
&mut self,
tx_envelope: &TransactionEnvelope,
network_id: &Hash,
) -> Result<TransactionEnvelope, SorobanHelperError>
pub fn sign_transaction_envelope( &mut self, tx_envelope: &TransactionEnvelope, network_id: &Hash, ) -> Result<TransactionEnvelope, SorobanHelperError>
Sourcepub async fn configure(
self,
env: &Env,
config: AccountConfig,
) -> Result<TransactionEnvelope, SorobanHelperError>
pub async fn configure( self, env: &Env, config: AccountConfig, ) -> Result<TransactionEnvelope, SorobanHelperError>
Configures the account by building and signing a transaction that sets options.
This can be used to add signers, set thresholds, and modify other account settings.
§Parameters
env- The environment to use for transaction buildingconfig- The account configuration to apply
§Returns
A signed transaction envelope containing the set options operations
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Account
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnwindSafe for Account
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more