pub trait ConnectedAccount: Account {
    type Provider: Provider + Sync;

    // Required method
    fn provider(&self) -> &Self::Provider;

    // Provided methods
    fn block_id(&self) -> BlockId { ... }
    fn get_nonce<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<FieldElement, ProviderError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

An Account implementation that also comes with a Provider. Functionalities that require a connection to the sequencer or node are offloaded to this trait to keep the base Account clean and flexible.

Required Associated Types§

Required Methods§

source

fn provider(&self) -> &Self::Provider

Provided Methods§

source

fn block_id(&self) -> BlockId

Block ID to use when checking nonce and estimating fees.

source

fn get_nonce<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FieldElement, ProviderError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<A> ConnectedAccount for &A

§

type Provider = <A as ConnectedAccount>::Provider

source§

fn provider(&self) -> &Self::Provider

source§

fn block_id(&self) -> BlockId

source§

fn get_nonce<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FieldElement, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl<A> ConnectedAccount for Box<A>
where A: ConnectedAccount + Sync + Send,

§

type Provider = <A as ConnectedAccount>::Provider

source§

fn provider(&self) -> &Self::Provider

source§

fn block_id(&self) -> BlockId

source§

fn get_nonce<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FieldElement, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl<A> ConnectedAccount for Arc<A>
where A: ConnectedAccount + Sync + Send,

§

type Provider = <A as ConnectedAccount>::Provider

source§

fn provider(&self) -> &Self::Provider

source§

fn block_id(&self) -> BlockId

source§

fn get_nonce<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FieldElement, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

source§

impl<P, S> ConnectedAccount for SingleOwnerAccount<P, S>
where P: Provider + Sync + Send, S: Signer + Sync + Send,

§

type Provider = P