pub struct ContractCallHandler<D> {
    pub contract_call: ContractCall,
    pub tx_parameters: TxParameters,
    pub wallet: WalletUnlocked,
    pub provider: Provider,
    pub datatype: PhantomData<D>,
    pub log_decoder: LogDecoder,
}
Expand description

Helper that handles submitting a call to a client and formatting the response

Fields§

§contract_call: ContractCall§tx_parameters: TxParameters§wallet: WalletUnlocked§provider: Provider§datatype: PhantomData<D>§log_decoder: LogDecoder

Implementations§

Sets external contracts as dependencies to this contract’s call. Effectively, this will be used to create Input::Contract/Output::Contract pairs and set them into the transaction. Note that this is a builder method, i.e. use it as a chain:

my_contract_instance.my_method(...).set_contracts(&[another_contract_id]).call()

Appends additional external contracts as dependencies to this contract’s call. Effectively, this will be used to create additional Input::Contract/Output::Contract pairs and set them into the transaction. Note that this is a builder method, i.e. use it as a chain:

my_contract_instance.my_method(...).append_contracts(additional_contract_id).call()

Sets the transaction parameters for a given transaction. Note that this is a builder method, i.e. use it as a chain:

let params = TxParameters { gas_price: 100, gas_limit: 1000000 };
my_contract_instance.my_method(...).tx_params(params).call()

Sets the call parameters for a given contract call. Note that this is a builder method, i.e. use it as a chain:

let params = CallParameters { amount: 1, asset_id: BASE_ASSET_ID };
my_contract_instance.my_method(...).call_params(params).call()

Appends num Output::Variables to the transaction. Note that this is a builder method, i.e. use it as a chain:

my_contract_instance.my_method(...).add_variable_outputs(num).call()

Appends num Output::Messages to the transaction. Note that this is a builder method, i.e. use it as a chain:

my_contract_instance.my_method(...).add_message_outputs(num).call()

Returns the script that executes the contract call

Call a contract’s method on the node, in a state-modifying manner.

Call a contract’s method 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.

Simulates the call and attempts to resolve missing tx dependencies. Forwards the received error if it cannot be fixed.

Get a contract’s estimated cost

Create a FuelCallResponse from call receipts

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more