Struct ContractFunctionInteraction
pub struct ContractFunctionInteraction<'a, W> { /* private fields */ }Expand description
A pending interaction with a single contract function.
Created by Contract::method. Use request to get the
raw execution payload, simulate to dry-run, or
send to submit to the network.
Implementations§
§impl<'a, W> ContractFunctionInteraction<'a, W>where
W: Wallet,
impl<'a, W> ContractFunctionInteraction<'a, W>where
W: Wallet,
pub fn new(
wallet: &'a W,
call: FunctionCall,
) -> ContractFunctionInteraction<'a, W>
pub fn new( wallet: &'a W, call: FunctionCall, ) -> ContractFunctionInteraction<'a, W>
Create a new interaction for a single function call.
pub fn new_with_capsules(
wallet: &'a W,
call: FunctionCall,
capsules: Vec<Capsule>,
) -> ContractFunctionInteraction<'a, W>
pub fn new_with_capsules( wallet: &'a W, call: FunctionCall, capsules: Vec<Capsule>, ) -> ContractFunctionInteraction<'a, W>
Create a new interaction with capsules attached.
pub fn with(
self,
auth_witnesses: Vec<AuthWitness>,
capsules: Vec<Capsule>,
) -> ContractFunctionInteraction<'a, W>
pub fn with( self, auth_witnesses: Vec<AuthWitness>, capsules: Vec<Capsule>, ) -> ContractFunctionInteraction<'a, W>
Return a new interaction with additional auth witnesses and capsules.
pub fn get_function_call(&self) -> &FunctionCall
pub fn get_function_call(&self) -> &FunctionCall
Returns the underlying FunctionCall for use in authwit hash computation.
pub fn request(&self) -> Result<ExecutionPayload, Error>
pub fn request(&self) -> Result<ExecutionPayload, Error>
Build an ExecutionPayload containing this single call.
pub async fn simulate(
&self,
opts: SimulateOptions,
) -> Result<TxSimulationResult, Error>
pub async fn simulate( &self, opts: SimulateOptions, ) -> Result<TxSimulationResult, Error>
Simulate the call without sending it.
pub async fn profile(
&self,
opts: ProfileOptions,
) -> Result<TxProfileResult, Error>
pub async fn profile( &self, opts: ProfileOptions, ) -> Result<TxProfileResult, Error>
Profile the gate count / execution steps for this call.
pub async fn send(&self, opts: SendOptions) -> Result<SendResult, Error>
pub async fn send(&self, opts: SendOptions) -> Result<SendResult, Error>
Send the call as a transaction.
Trait Implementations§
Auto Trait Implementations§
impl<'a, W> Freeze for ContractFunctionInteraction<'a, W>
impl<'a, W> RefUnwindSafe for ContractFunctionInteraction<'a, W>where
W: RefUnwindSafe,
impl<'a, W> Send for ContractFunctionInteraction<'a, W>where
W: Sync,
impl<'a, W> Sync for ContractFunctionInteraction<'a, W>where
W: Sync,
impl<'a, W> Unpin for ContractFunctionInteraction<'a, W>
impl<'a, W> UnwindSafe for ContractFunctionInteraction<'a, W>where
W: RefUnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more