pub struct SingleOwnerAccount<P, S>{ /* private fields */ }Expand description
A generic Account implementation for controlling account contracts that only have one signer
using ECDSA the STARK curve.
Implementations§
Source§impl<P, S> SingleOwnerAccount<P, S>
impl<P, S> SingleOwnerAccount<P, S>
Sourcepub const fn new(
provider: P,
signer: S,
address: Felt,
chain_id: Felt,
encoding: ExecutionEncoding,
) -> SingleOwnerAccount<P, S>
pub const fn new( provider: P, signer: S, address: Felt, chain_id: Felt, encoding: ExecutionEncoding, ) -> SingleOwnerAccount<P, S>
Create a new account controlled by a single signer.
§Parameters
provider: AProviderimplementation that provides access to the Starknet network.signer: ASignerimplementation that can generate valid signatures for this account.address: Account contract address.chain_id: Network chain ID.encoding: How__execute__calldata should be encoded.
Sourcepub fn set_block_id(&mut self, block_id: BlockId) -> &SingleOwnerAccount<P, S>
pub fn set_block_id(&mut self, block_id: BlockId) -> &SingleOwnerAccount<P, S>
Sets a new block ID to run queries against.
Trait Implementations§
Source§impl<P, S> Account for SingleOwnerAccount<P, S>
impl<P, S> Account for SingleOwnerAccount<P, S>
Source§type SignError = SignError<<S as Signer>::SignError>
type SignError = SignError<<S as Signer>::SignError>
Possible errors for signing transactions.
Source§fn chain_id(&self) -> Felt
fn chain_id(&self) -> Felt
Gets the chain ID of the network where the account contract was deployed.
Source§fn sign_execution_v3<'life0, 'life1, 'async_trait>(
&'life0 self,
execution: &'life1 RawExecutionV3,
query_only: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Felt>, <SingleOwnerAccount<P, S> as Account>::SignError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
SingleOwnerAccount<P, S>: 'async_trait,
fn sign_execution_v3<'life0, 'life1, 'async_trait>(
&'life0 self,
execution: &'life1 RawExecutionV3,
query_only: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Felt>, <SingleOwnerAccount<P, S> as Account>::SignError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
SingleOwnerAccount<P, S>: 'async_trait,
Signs an execution request to authorize an
INVOKE v3 transaction that pays transaction
fees in STRK. Read moreSource§fn sign_declaration_v3<'life0, 'life1, 'async_trait>(
&'life0 self,
declaration: &'life1 RawDeclarationV3,
query_only: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Felt>, <SingleOwnerAccount<P, S> as Account>::SignError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
SingleOwnerAccount<P, S>: 'async_trait,
fn sign_declaration_v3<'life0, 'life1, 'async_trait>(
&'life0 self,
declaration: &'life1 RawDeclarationV3,
query_only: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Felt>, <SingleOwnerAccount<P, S> as Account>::SignError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
SingleOwnerAccount<P, S>: 'async_trait,
Signs an execution request to authorize an
DECLARE v3 transaction that pays transaction
fees in STRK for declaring Cairo 1 classes. Read moreSource§fn is_signer_interactive(&self, context: SignerInteractivityContext<'_>) -> bool
fn is_signer_interactive(&self, context: SignerInteractivityContext<'_>) -> 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. Read moreSource§fn execute_v3(&self, calls: Vec<Call>) -> ExecutionV3<'_, Self>
fn execute_v3(&self, calls: Vec<Call>) -> ExecutionV3<'_, Self>
Generates an instance of
ExecutionV3 for sending INVOKE v3 transactions. Pays
transaction fees in STRK.Source§fn execute(&self, calls: Vec<Call>) -> ExecutionV3<'_, Self>
fn execute(&self, calls: Vec<Call>) -> ExecutionV3<'_, Self>
👎Deprecated: transaction version used might change unexpectedly; use
execute_v3 insteadGenerates an instance of
ExecutionV3 for sending INVOKE v3 transactions. Pays
transaction fees in STRK.Source§fn declare_v3(
&self,
contract_class: Arc<FlattenedSierraClass>,
compiled_class_hash: Felt,
) -> DeclarationV3<'_, Self>
fn declare_v3( &self, contract_class: Arc<FlattenedSierraClass>, compiled_class_hash: Felt, ) -> DeclarationV3<'_, Self>
Generates an instance of
DeclarationV3 for sending DECLARE v3 transactions. Pays
transaction fees in STRK. Read moreSource§fn declare(
&self,
contract_class: Arc<FlattenedSierraClass>,
compiled_class_hash: Felt,
) -> DeclarationV3<'_, Self>
fn declare( &self, contract_class: Arc<FlattenedSierraClass>, compiled_class_hash: Felt, ) -> DeclarationV3<'_, Self>
👎Deprecated: transaction version used might change unexpectedly; use
declare_v3 insteadGenerates an instance of
DeclarationV3 for sending DECLARE v3 transactions. Pays
transaction fees in STRK. Read moreSource§impl<P, S> Clone for SingleOwnerAccount<P, S>
impl<P, S> Clone for SingleOwnerAccount<P, S>
Source§fn clone(&self) -> SingleOwnerAccount<P, S>
fn clone(&self) -> SingleOwnerAccount<P, S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<P, S> ConnectedAccount for SingleOwnerAccount<P, S>
impl<P, S> ConnectedAccount for SingleOwnerAccount<P, S>
Source§fn provider(&self) -> &<SingleOwnerAccount<P, S> as ConnectedAccount>::Provider
fn provider(&self) -> &<SingleOwnerAccount<P, S> as ConnectedAccount>::Provider
Gets a reference to the attached
Provider instance.Source§impl<P, S> Debug for SingleOwnerAccount<P, S>
impl<P, S> Debug for SingleOwnerAccount<P, S>
Auto Trait Implementations§
impl<P, S> Freeze for SingleOwnerAccount<P, S>
impl<P, S> RefUnwindSafe for SingleOwnerAccount<P, S>where
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<P, S> Send for SingleOwnerAccount<P, S>
impl<P, S> Sync for SingleOwnerAccount<P, S>
impl<P, S> Unpin for SingleOwnerAccount<P, S>
impl<P, S> UnwindSafe for SingleOwnerAccount<P, S>where
P: UnwindSafe,
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more