Struct fuels_programs::contract::MultiContractCallHandler
source · pub struct MultiContractCallHandler<T: Account> {
pub contract_calls: Vec<ContractCall>,
pub log_decoder: LogDecoder,
pub tx_parameters: TxParameters,
pub account: T,
/* private fields */
}
Expand description
Helper that handles bundling multiple calls into a single transaction
Fields§
§contract_calls: Vec<ContractCall>
§log_decoder: LogDecoder
§tx_parameters: TxParameters
§account: T
Implementations§
source§impl<T: Account> MultiContractCallHandler<T>
impl<T: Account> MultiContractCallHandler<T>
pub fn new(account: T) -> Self
sourcepub fn add_call(
&mut self,
call_handler: ContractCallHandler<impl Account, impl Tokenizable>
) -> &mut Self
pub fn add_call( &mut self, call_handler: ContractCallHandler<impl Account, impl Tokenizable> ) -> &mut Self
Adds a contract call to be bundled in the transaction Note that this is a builder method
sourcepub fn tx_params(&mut self, params: TxParameters) -> &mut Self
pub fn tx_params(&mut self, params: TxParameters) -> &mut Self
Sets the transaction parameters for a given transaction. Note that this is a builder method
sourcepub async fn build_tx(&self) -> Result<ScriptTransaction>
pub async fn build_tx(&self) -> Result<ScriptTransaction>
Returns the script that executes the contract calls
sourcepub async fn call<D: Tokenizable + Debug>(
&mut self
) -> Result<FuelCallResponse<D>>
pub async fn call<D: Tokenizable + Debug>( &mut self ) -> Result<FuelCallResponse<D>>
Call contract methods on the node, in a state-modifying manner.
sourcepub async fn simulate<D: Tokenizable + Debug>(
&mut self
) -> Result<FuelCallResponse<D>>
pub async fn simulate<D: Tokenizable + Debug>( &mut self ) -> Result<FuelCallResponse<D>>
Call contract methods on the node, in a simulated manner, meaning the state of the blockchain is not modified but simulated. It is the same as the call method because the API is more user-friendly this way.
sourcepub async fn estimate_tx_dependencies(
self,
max_attempts: Option<u64>
) -> Result<Self>
pub async fn estimate_tx_dependencies( self, max_attempts: Option<u64> ) -> Result<Self>
Simulates the call and attempts to resolve missing tx dependencies. Forwards the received error if it cannot be fixed.
sourcepub async fn estimate_transaction_cost(
&self,
tolerance: Option<f64>
) -> Result<TransactionCost>
pub async fn estimate_transaction_cost( &self, tolerance: Option<f64> ) -> Result<TransactionCost>
Get a contract’s estimated cost
sourcepub fn get_response<D: Tokenizable + Debug>(
&self,
receipts: Vec<Receipt>
) -> Result<FuelCallResponse<D>>
pub fn get_response<D: Tokenizable + Debug>( &self, receipts: Vec<Receipt> ) -> Result<FuelCallResponse<D>>
Create a FuelCallResponse
from call receipts
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for MultiContractCallHandler<T>where T: RefUnwindSafe,
impl<T> Send for MultiContractCallHandler<T>
impl<T> Sync for MultiContractCallHandler<T>
impl<T> Unpin for MultiContractCallHandler<T>where T: Unpin,
impl<T> UnwindSafe for MultiContractCallHandler<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> AnyDebug for Twhere
T: Any + Debug,
impl<T> AnyDebug for Twhere T: Any + Debug,
source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Any
.