Back to Fuels Rs

Custom contract and script calls

docs/src/custom-transactions/custom-calls.md

0.77.0721 B
Original Source

Custom contract and script calls

When preparing a contract call via CallHandler, the Rust SDK uses a transaction builder in the background. You can fetch this builder and customize it before submitting it to the network. After the transaction is executed successfully, you can use the corresponding CallHandler to generate a call response. The call response can be used to decode return values and logs. Below are examples for both contract and script calls.

Custom contract call

rust,ignore
{{#include ../../../examples/contracts/src/lib.rs:contract_call_tb}}

Custom script call

rust,ignore
{{#include ../../../e2e/tests/scripts.rs:script_call_tb}}