pub struct SingleAccountProvider { /* private fields */ }Expand description
A simple AccountProvider that manages a single account.
This is the most common pattern: one secret key, one account contract,
one wallet. For multi-account wallets, implement AccountProvider directly.
Stores an AccountContract and creates fresh account instances on
demand (avoiding the trait-object clone problem).
Implementations§
Source§impl SingleAccountProvider
impl SingleAccountProvider
Sourcepub fn new(
complete_address: CompleteAddress,
account_contract: Box<dyn AccountContract>,
alias: impl Into<String>,
) -> SingleAccountProvider
pub fn new( complete_address: CompleteAddress, account_contract: Box<dyn AccountContract>, alias: impl Into<String>, ) -> SingleAccountProvider
Create a new single-account provider.
Trait Implementations§
Source§impl AccountProvider for SingleAccountProvider
impl AccountProvider for SingleAccountProvider
Source§fn create_tx_execution_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 AztecAddress,
exec: ExecutionPayload,
gas_settings: GasSettings,
chain_info: &'life2 ChainInfo,
fee_payer: Option<AztecAddress>,
fee_payment_method: Option<u8>,
) -> Pin<Box<dyn Future<Output = Result<TxExecutionRequest, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
SingleAccountProvider: 'async_trait,
fn create_tx_execution_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 AztecAddress,
exec: ExecutionPayload,
gas_settings: GasSettings,
chain_info: &'life2 ChainInfo,
fee_payer: Option<AztecAddress>,
fee_payment_method: Option<u8>,
) -> Pin<Box<dyn Future<Output = Result<TxExecutionRequest, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
SingleAccountProvider: 'async_trait,
Create a transaction execution request for the given account. Read more
Source§fn create_auth_wit<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 AztecAddress,
intent: MessageHashOrIntent,
chain_info: &'life2 ChainInfo,
) -> Pin<Box<dyn Future<Output = Result<AuthWitness, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
SingleAccountProvider: 'async_trait,
fn create_auth_wit<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 AztecAddress,
intent: MessageHashOrIntent,
chain_info: &'life2 ChainInfo,
) -> Pin<Box<dyn Future<Output = Result<AuthWitness, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
SingleAccountProvider: 'async_trait,
Create an authorization witness for the given account.
Source§fn get_complete_address<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 AztecAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<CompleteAddress>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
SingleAccountProvider: 'async_trait,
fn get_complete_address<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 AztecAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<CompleteAddress>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
SingleAccountProvider: 'async_trait,
Get the complete address for a managed account, if available.
Source§fn get_accounts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Aliased<AztecAddress>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
SingleAccountProvider: 'async_trait,
fn get_accounts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Aliased<AztecAddress>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
SingleAccountProvider: 'async_trait,
Get all account addresses managed by this provider.
Auto Trait Implementations§
impl Freeze for SingleAccountProvider
impl !RefUnwindSafe for SingleAccountProvider
impl Send for SingleAccountProvider
impl Sync for SingleAccountProvider
impl Unpin for SingleAccountProvider
impl !UnwindSafe for SingleAccountProvider
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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