Trait starknet_accounts::Account
source · pub trait Account: ExecutionEncoder + Sized {
type SignError: Error + Send + Sync;
// Required methods
fn address(&self) -> FieldElement;
fn chain_id(&self) -> FieldElement;
fn sign_execution<'life0, 'life1, 'async_trait>(
&'life0 self,
execution: &'life1 RawExecution,
query_only: bool
) -> Pin<Box<dyn Future<Output = Result<Vec<FieldElement>, Self::SignError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn sign_declaration<'life0, 'life1, 'async_trait>(
&'life0 self,
declaration: &'life1 RawDeclaration,
query_only: bool
) -> Pin<Box<dyn Future<Output = Result<Vec<FieldElement>, Self::SignError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn sign_legacy_declaration<'life0, 'life1, 'async_trait>(
&'life0 self,
legacy_declaration: &'life1 RawLegacyDeclaration,
query_only: bool
) -> Pin<Box<dyn Future<Output = Result<Vec<FieldElement>, Self::SignError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn execute(&self, calls: Vec<Call>) -> Execution<'_, Self> { ... }
fn declare(
&self,
contract_class: Arc<FlattenedSierraClass>,
compiled_class_hash: FieldElement
) -> Declaration<'_, Self> { ... }
fn declare_legacy(
&self,
contract_class: Arc<LegacyContractClass>
) -> LegacyDeclaration<'_, Self> { ... }
}Expand description
The standard Starknet account contract interface. It makes no assumption about the underlying signer or provider. Account implementations that come with an active connection to the network should also implement ConnectedAccount for useful functionalities like estimating fees and sending transactions.
Required Associated Types§
Required Methods§
fn address(&self) -> FieldElement
fn chain_id(&self) -> FieldElement
fn sign_execution<'life0, 'life1, 'async_trait>(
&'life0 self,
execution: &'life1 RawExecution,
query_only: bool
) -> Pin<Box<dyn Future<Output = Result<Vec<FieldElement>, Self::SignError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign_declaration<'life0, 'life1, 'async_trait>(
&'life0 self,
declaration: &'life1 RawDeclaration,
query_only: bool
) -> Pin<Box<dyn Future<Output = Result<Vec<FieldElement>, Self::SignError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign_legacy_declaration<'life0, 'life1, 'async_trait>(
&'life0 self,
legacy_declaration: &'life1 RawLegacyDeclaration,
query_only: bool
) -> Pin<Box<dyn Future<Output = Result<Vec<FieldElement>, Self::SignError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
fn execute(&self, calls: Vec<Call>) -> Execution<'_, Self>
fn declare( &self, contract_class: Arc<FlattenedSierraClass>, compiled_class_hash: FieldElement ) -> Declaration<'_, Self>
fn declare_legacy( &self, contract_class: Arc<LegacyContractClass> ) -> LegacyDeclaration<'_, Self>
Object Safety§
This trait is not object safe.