pub trait AccountFactory: Sized {
type Provider: Provider + Sync;
type SignError: Error + Send + Sync;
// Required methods
fn class_hash(&self) -> Felt;
fn calldata(&self) -> Vec<Felt>;
fn chain_id(&self) -> Felt;
fn provider(&self) -> &Self::Provider;
fn is_signer_interactive(&self) -> bool;
fn sign_deployment_v3<'life0, 'life1, 'async_trait>(
&'life0 self,
deployment: &'life1 RawAccountDeploymentV3,
query_only: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Felt>, Self::SignError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn block_id(&self) -> BlockId { ... }
fn deploy_v3(&self, salt: Felt) -> AccountDeploymentV3<'_, Self> { ... }
fn deploy(&self, salt: Felt) -> AccountDeploymentV3<'_, Self> { ... }
}Expand description
Abstraction over different ways of deploying account contracts using the DEPLOY_ACCOUNT
transaction type.
Required Associated Types§
Required Methods§
Sourcefn class_hash(&self) -> Felt
fn class_hash(&self) -> Felt
Gets the class hash of the account contract.
Sourcefn is_signer_interactive(&self) -> bool
fn is_signer_interactive(&self) -> bool
Whether the underlying signer implementation is interactive, such as a hardware wallet.
Implementations should return true if the signing operation is very expensive, even if not
strictly “interactive” as in requiring human input.
This affects how an account factory makes decision on whether to request a real signature for estimation/simulation purposes.
Sourcefn sign_deployment_v3<'life0, 'life1, 'async_trait>(
&'life0 self,
deployment: &'life1 RawAccountDeploymentV3,
query_only: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Felt>, Self::SignError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign_deployment_v3<'life0, 'life1, 'async_trait>(
&'life0 self,
deployment: &'life1 RawAccountDeploymentV3,
query_only: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Felt>, Self::SignError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Signs an execution request to authorize an DEPLOY_ACCOUNT v3 transaction that pays
transaction fees in STRK.
If query_only is true, the commitment must be constructed in a way that a real state-
changing transaction cannot be authenticated. This is to prevent replay attacks.
Provided Methods§
Sourcefn deploy_v3(&self, salt: Felt) -> AccountDeploymentV3<'_, Self>
fn deploy_v3(&self, salt: Felt) -> AccountDeploymentV3<'_, Self>
Generates an instance of AccountDeploymentV3 for sending DEPLOY_ACCOUNT v3
transactions. Pays transaction fees in STRK.
Sourcefn deploy(&self, salt: Felt) -> AccountDeploymentV3<'_, Self>
👎Deprecated: transaction version used might change unexpectedly; use deploy_v3 instead
fn deploy(&self, salt: Felt) -> AccountDeploymentV3<'_, Self>
deploy_v3 insteadGenerates an instance of AccountDeploymentV3 for sending DEPLOY_ACCOUNT v3
transactions. Pays transaction fees in STRK.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.