BaseWallet

Struct BaseWallet 

pub struct BaseWallet<P, N, A> { /* private fields */ }
Expand description

A production Wallet backed by PXE + Aztec node connections.

Routes private-state operations (simulate, prove, events, registration) through the PXE, public-state queries (chain info, contract metadata) through the Aztec node, and delegates auth witness creation to the account provider.

Implementations§

§

impl<P, N, A> BaseWallet<P, N, A>
where P: Pxe, N: AztecNode, A: AccountProvider,

pub fn new(pxe: P, node: N, accounts: A) -> BaseWallet<P, N, A>

Create a new BaseWallet with the given PXE, node, and account provider.

pub fn pxe(&self) -> &P

Get a reference to the underlying PXE client.

pub fn node(&self) -> &N

Get a reference to the underlying Aztec node client.

pub fn account_provider(&self) -> &A

Get a reference to the account provider.

Trait Implementations§

§

impl<P, N, A> Wallet for BaseWallet<P, N, A>
where P: Pxe, N: AztecNode, A: AccountProvider,

§

fn get_chain_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ChainInfo, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Get chain identification information.
§

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, BaseWallet<P, N, A>: 'async_trait,

Get the list of accounts managed by this wallet.
§

fn get_address_book<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Aliased<AztecAddress>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Get the address book entries.
§

fn register_sender<'life0, 'async_trait>( &'life0 self, address: AztecAddress, _alias: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<AztecAddress, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Register a sender address with an optional alias.
§

fn get_contract_metadata<'life0, 'async_trait>( &'life0 self, address: AztecAddress, ) -> Pin<Box<dyn Future<Output = Result<ContractMetadata, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Get metadata about a registered contract.
§

fn get_contract_class_metadata<'life0, 'async_trait>( &'life0 self, class_id: Fr, ) -> Pin<Box<dyn Future<Output = Result<ContractClassMetadata, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Get metadata about a registered contract class.
§

fn register_contract<'life0, 'async_trait>( &'life0 self, instance: ContractInstanceWithAddress, artifact: Option<ContractArtifact>, secret_key: Option<Fr>, ) -> Pin<Box<dyn Future<Output = Result<ContractInstanceWithAddress, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Register a contract instance (and optionally its artifact) with the wallet.
§

fn get_private_events<'life0, 'life1, 'async_trait>( &'life0 self, event_metadata: &'life1 EventMetadataDefinition, filter: PrivateEventFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<PrivateEvent>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Get private events matching the given filter.
§

fn simulate_tx<'life0, 'async_trait>( &'life0 self, exec: ExecutionPayload, opts: SimulateOptions, ) -> Pin<Box<dyn Future<Output = Result<TxSimulationResult, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Simulate a transaction without sending it.
§

fn execute_utility<'life0, 'async_trait>( &'life0 self, call: FunctionCall, opts: ExecuteUtilityOptions, ) -> Pin<Box<dyn Future<Output = Result<UtilityExecutionResult, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Execute a utility (view) function.
§

fn profile_tx<'life0, 'async_trait>( &'life0 self, exec: ExecutionPayload, opts: ProfileOptions, ) -> Pin<Box<dyn Future<Output = Result<TxProfileResult, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Profile a transaction for gas estimation and performance data.
§

fn send_tx<'life0, 'async_trait>( &'life0 self, exec: ExecutionPayload, opts: SendOptions, ) -> Pin<Box<dyn Future<Output = Result<SendResult, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Send a transaction to the network.
§

fn wait_for_contract<'life0, 'async_trait>( &'life0 self, address: AztecAddress, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Wait until a deployed contract instance is queryable from the node.
§

fn wait_for_tx_proven<'life0, 'async_trait>( &'life0 self, tx_hash: TxHash, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Wait until the block containing a transaction is proven on L1.
§

fn create_auth_wit<'life0, 'async_trait>( &'life0 self, from: AztecAddress, message_hash_or_intent: MessageHashOrIntent, ) -> Pin<Box<dyn Future<Output = Result<AuthWitness, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Create an authorization witness.
§

fn get_public_storage_at<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, contract: &'life1 AztecAddress, slot: &'life2 Fr, ) -> Pin<Box<dyn Future<Output = Result<Fr, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, BaseWallet<P, N, A>: 'async_trait,

Read a public storage value at the given contract address and slot.

Auto Trait Implementations§

§

impl<P, N, A> Freeze for BaseWallet<P, N, A>
where P: Freeze, N: Freeze, A: Freeze,

§

impl<P, N, A> RefUnwindSafe for BaseWallet<P, N, A>

§

impl<P, N, A> Send for BaseWallet<P, N, A>
where P: Send, N: Send, A: Send,

§

impl<P, N, A> Sync for BaseWallet<P, N, A>
where P: Sync, N: Sync, A: Sync,

§

impl<P, N, A> Unpin for BaseWallet<P, N, A>
where P: Unpin, N: Unpin, A: Unpin,

§

impl<P, N, A> UnwindSafe for BaseWallet<P, N, A>
where P: UnwindSafe, N: UnwindSafe, A: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more