TransactionExecutionService.SimulateTransaction
Simulate transaction through sui.rpc.v2.TransactionExecutionService/SimulateTransaction on Inodra's Sui gRPC endpoint.
Endpoint
| Network | Host | Authentication |
|---|---|---|
| Mainnet | mainnet-grpc.inodra.com:443 | x-api-key metadata |
| Testnet | testnet-grpc.inodra.com:443 | x-api-key metadata |
Full method name: sui.rpc.v2.TransactionExecutionService/SimulateTransaction. Unary: one request, one response. Get a key from the dashboard; the same key works on every protocol.
Request: SimulateTransactionRequest
| Field | Type | Description |
|---|---|---|
transaction | Transaction | |
read_mask | google.protobuf.FieldMask | Mask specifying which fields to read. |
checks | SimulateTransactionRequest.TransactionChecks | Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction |
do_gas_selection | bool | Perform gas selection based on a budget estimation and include the selected gas payment and budget in the response. If selection fails because the gas owner lacks enough SUI to cover the budget, the returned error carries a google.rpc.ErrorInfo with reason INSUFFICIENT_GAS_BALANCE, or TRANSACTION_EXECUTION_FAILED if the transaction also fails while estimating the budget (see ErrorReason). This option will be ignored if checks is DISABLED. |
Response: SimulateTransactionResponse
| Field | Type | Description |
|---|---|---|
transaction | ExecutedTransaction | |
command_outputs | repeated CommandResult | |
suggested_gas_price | uint64 | A suggested gas price to use, that is above RGP, in order to provide a better chance of the transaction being included in the presence of congested objects. |
ExecutedTransaction
| Field | Type | Description |
|---|---|---|
digest | string | The digest of this Transaction. |
transaction | Transaction | The transaction itself. |
signatures | repeated UserSignature | List of user signatures that are used to authorize the execution of this transaction. |
effects | TransactionEffects | The TransactionEffects for this transaction. |
events | TransactionEvents | The TransactionEvents for this transaction. This field might be empty, even if it was explicitly requested, if the transaction didn't produce any events. sui.types.TransactionEffects.events_digest is populated if the transaction produced any events. |
checkpoint | uint64 | The sequence number for the checkpoint that includes this transaction. |
timestamp | google.protobuf.Timestamp | The Unix timestamp of the checkpoint that includes this transaction. |
balance_changes | repeated BalanceChange | |
objects | ObjectSet | Set of objects either referenced as inputs or produced as outputs from this Transaction. |
transaction_index | uint64 | Zero-based position of this transaction within the checkpoint that includes it. |
CommandResult
An intermediate result/output from the execution of a single command
| Field | Type | Description |
|---|---|---|
return_values | repeated CommandOutput | |
mutated_by_ref | repeated CommandOutput |
grpcurl
grpcurl -H "x-api-key: YOUR_API_KEY" \
-d '{
"transaction": {
"bcs": {
"value": "AA=="
}
},
"read_mask": {
"paths": [
"transaction"
]
},
"do_gas_selection": true
}' \
mainnet-grpc.inodra.com:443 \
sui.rpc.v2.TransactionExecutionService/SimulateTransactionServer reflection is enabled, so no proto files are needed for grpcurl. Field masks are written as {"paths": [...]}.
The body is a template: replace the empty BCS bytes with your own values before the call succeeds.
TypeScript
import { GrpcWebFetchTransport, SuiGrpcClient } from '@mysten/sui/grpc'
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519'
import { Transaction } from '@mysten/sui/transactions'
const transport = new GrpcWebFetchTransport({
baseUrl: 'https://mainnet-grpc.inodra.com',
meta: { 'x-api-key': process.env.INODRA_API_KEY! }
})
const client = new SuiGrpcClient({ network: 'mainnet', transport })
const keypair = Ed25519Keypair.fromSecretKey(process.env.SUI_SECRET_KEY!)
const tx = new Transaction()
tx.setSender(keypair.toSuiAddress())
const [coin] = tx.splitCoins(tx.gas, [1_000_000])
tx.transferObjects([coin], keypair.toSuiAddress())
const result = await client.simulateTransaction({ transaction: tx, include: { effects: true } })
console.log(result)Uses the typed SuiGrpcClient method from @mysten/sui v2 that calls this RPC. Install with npm install @mysten/sui and set INODRA_API_KEY. The gRPC gateway guide covers native gRPC transport for backends.
Credits
5 credits per call. See credits and billing for the full table.
JSON-RPC equivalent
Replaces sui_dryRunTransactionBlock. The JSON-RPC to gRPC migration guide has before and after code for the common calls.