pub struct AccountManager<W> { /* private fields */ }Expand description
Manages account creation, address computation, and deployment.
AccountManager is the main entry point for working with Aztec accounts.
It combines a wallet backend, a secret key, and an account contract type
to provide deterministic address computation, account instance creation,
and deployment method generation.
Implementations§
Source§impl<W: Wallet> AccountManager<W>
impl<W: Wallet> AccountManager<W>
Sourcepub async fn create(
wallet: W,
secret_key: Fr,
account_contract: Box<dyn AccountContract>,
salt: Option<impl Into<Salt>>,
) -> Result<Self, Error>
pub async fn create( wallet: W, secret_key: Fr, account_contract: Box<dyn AccountContract>, salt: Option<impl Into<Salt>>, ) -> Result<Self, Error>
Create a new account manager.
Validates the account contract by fetching its artifact and initializer metadata. Contract instance hashing and key derivation are not implemented yet, so the stored instance remains an explicit placeholder until the deployment/key path lands.
Sourcepub async fn complete_address(&self) -> Result<CompleteAddress, Error>
pub async fn complete_address(&self) -> Result<CompleteAddress, Error>
Get the complete address of this account.
Derives the full key set from the secret key, computes the partial address from the contract instance, and returns the complete address.
Sourcepub const fn address(&self) -> AztecAddress
pub const fn address(&self) -> AztecAddress
Get the address of this account instance.
Sourcepub const fn instance(&self) -> &ContractInstanceWithAddress
pub const fn instance(&self) -> &ContractInstanceWithAddress
Get the contract instance for this account.
Sourcepub const fn secret_key(&self) -> Fr
pub const fn secret_key(&self) -> Fr
Get the secret key for this account.
Sourcepub const fn has_initializer(&self) -> bool
pub const fn has_initializer(&self) -> bool
Return whether this account contract has an initializer function.
Sourcepub async fn account(&self) -> Result<AccountWithSecretKey, Error>
pub async fn account(&self) -> Result<AccountWithSecretKey, Error>
Get an Account implementation backed by this manager’s account
contract, paired with the secret key.
Sourcepub async fn deploy_method(&self) -> Result<DeployAccountMethod<'_, W>, Error>
pub async fn deploy_method(&self) -> Result<DeployAccountMethod<'_, W>, Error>
Get a deployment method for this account’s contract.
Fetches the artifact and initialization spec from the account contract,
creates a generic ContractDeployer + DeployMethod, and wraps it
with account-specific fee-payment logic in a DeployAccountMethod.
Auto Trait Implementations§
impl<W> Freeze for AccountManager<W>where
W: Freeze,
impl<W> !RefUnwindSafe for AccountManager<W>
impl<W> Send for AccountManager<W>where
W: Send,
impl<W> Sync for AccountManager<W>where
W: Sync,
impl<W> Unpin for AccountManager<W>where
W: Unpin,
impl<W> !UnwindSafe for AccountManager<W>
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
§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>
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>
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