AccountContract

Trait AccountContract 

Source
pub trait AccountContract: Send + Sync {
    // Required methods
    fn contract_artifact<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<ContractArtifact, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn initialization_function_and_args<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<InitializationSpec>, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn account(&self, address: CompleteAddress) -> Box<dyn Account>;
    fn auth_witness_provider(
        &self,
        address: CompleteAddress,
    ) -> Box<dyn AuthorizationProvider>;
}
Expand description

Defines an account contract type (e.g., Schnorr, ECDSA).

Implementations provide the contract artifact, initialization parameters, and the ability to produce Account and AuthorizationProvider instances for a given address.

Required Methods§

Source

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

Get the contract artifact for this account type.

Source

fn initialization_function_and_args<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<InitializationSpec>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get the initialization function name and arguments, if any.

Source

fn account(&self, address: CompleteAddress) -> Box<dyn Account>

Create an Account instance for the given address.

Source

fn auth_witness_provider( &self, address: CompleteAddress, ) -> Box<dyn AuthorizationProvider>

Create an AuthorizationProvider for the given address.

Implementors§