How to estimate gas fees?

You can use the sui_devInspectTransaction RPC endpoint to run the transaction and see what it would do (including how much gas it would cost) without actually running it on-chain.

Note that the cost can change when you run it for real, e.g. if objects that you loaded for the dev-inspect transaction changed size in the interim, and there are some transactions that you can call with devInspect, but would not run successfully with moveCall.

19 Likes