simulateTransaction
Simulate a transaction to preview its effects without executing it on chain.
Accepts a JSON transaction matching the Sui gRPC API schema. The JSON format allows for partial transaction specification where certain fields can be automatically resolved by the server.
Alternatively, for already serialized transactions, you can pass BCS-encoded data:
{"bcs": {"value": "<base64>"}}
Unlike executeTransaction
, this does not require signatures since the transaction is not committed to the blockchain. This allows for previewing transaction effects, estimating gas costs, and testing transaction logic without spending gas or requiring valid signatures.
simulateTransaction(
transaction: JSON!
): SimulationResult!
Arguments
simulateTransaction.transaction
● JSON!
non-null scalar
Type
SimulationResult
object
The result of simulating a transaction, including the predicted effects, events, and any errors.