Parameters
- transactionobjectREQUIRED
Unsigned transaction data, supplied as structured fields or a Bcs object. Simulation does not require signatures.
- read_maskobject
Field mask for the simulation response, for example transaction.effects.status, transaction.transaction, and command_outputs. Omitted fields are not returned.
- checksstring
Whether checks should be ENABLED (default) or DISABLED during simulation
- do_gas_selectionboolean
Select gas payment automatically when true. With gas selection disabled and no gas payment, simulation uses mock gas; this does not prove that the sender can pay for execution.
Returns
- transactionobject
Simulated execution data. Fields depend on read_mask; this is not an on-chain receipt.
- transactionobject
Resolved transaction data. Its expiration may carry allowed proposers when server and client compatibility requirements are met.
- effectsobject
Simulation effects; selected by the read mask.
- statusobject
Execution outcome.
- successboolean
Whether simulated execution succeeded.
- errorobject
Execution error, present only when simulation fails.
- eventsobject
Events, when requested and emitted.
- balanceChangesarray
Balance changes, when requested.
- objectsarray
Objects, when requested.
- commandOutputsarray
Per-command results, when selected by the read mask.
- returnValuesarray
Returned values, when present.
- valueobject
BCS-encoded value, when present.
- jsonany
JSON representation of the value, when available.
- mutatedByRefarray
Values mutated by reference, when present.
- suggestedGasPricestring
Optional suggested gas price; returned only when applicable and selected by the read mask.
1# Set QN_SUI_GRPC_HOST to your endpoint hostname:9000 and QN_SUI_TOKEN to its token.2# The public docs demo does not require x-token authentication.3grpcurl -max-time 20 \4-H "x-token: ${QN_SUI_TOKEN:-}" \5-d '6{7"transaction": {8"sender": "0x0000000000000000000000000000000000000000000000000000000000000001",9"kind": {10"programmable_transaction": {11"commands": [12{13"move_call": {14"package": "0x2",15"module": "tx_context",16"function": "epoch"17}18}19]20}21}22},23"checks": "DISABLED",24"do_gas_selection": false,25"read_mask": {26"paths": [27"transaction.transaction",28"transaction.effects.status",29"command_outputs",30"suggested_gas_price"31]32}33}34' \35"$QN_SUI_GRPC_HOST" \36sui.rpc.v2.TransactionExecutionService/SimulateTransaction37
1# Set QN_SUI_GRPC_HOST to your endpoint hostname:9000 and QN_SUI_TOKEN to its token.2# The public docs demo does not require x-token authentication.3grpcurl -max-time 20 \4-H "x-token: ${QN_SUI_TOKEN:-}" \5-d '6{7"transaction": {8"sender": "0x0000000000000000000000000000000000000000000000000000000000000001",9"kind": {10"programmable_transaction": {11"commands": [12{13"move_call": {14"package": "0x2",15"module": "tx_context",16"function": "epoch"17}18}19]20}21}22},23"checks": "DISABLED",24"do_gas_selection": false,25"read_mask": {26"paths": [27"transaction.transaction",28"transaction.effects.status",29"command_outputs",30"suggested_gas_price"31]32}33}34' \35"$QN_SUI_GRPC_HOST" \36sui.rpc.v2.TransactionExecutionService/SimulateTransaction37
1package main23import (4"context"5"crypto/tls"6"fmt"7"log"8"os"9"time"1011"google.golang.org/grpc"12"google.golang.org/grpc/credentials"13"google.golang.org/grpc/metadata"14"google.golang.org/protobuf/encoding/protojson"15pb "sui-grpc/sui/rpc/v2" // Your generated protobuf package16)1718func main() {19conn, err := grpc.NewClient(os.Getenv("QN_SUI_GRPC_HOST"),20grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})))21if err != nil {22log.Fatal(err)23}24defer conn.Close()25ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)26defer cancel()27if token := os.Getenv("QN_SUI_TOKEN"); token != "" {28ctx = metadata.AppendToOutgoingContext(ctx, "x-token", token)29}30// Only advertise a version your client can decode; omit it for legacy behavior.31if version := os.Getenv("SUI_CLIENT_PROTOCOL_VERSION"); version != "" {32ctx = metadata.AppendToOutgoingContext(ctx, "x-sui-client-protocol-version", version)33}34// Unsigned simulation using mock gas; no transaction is submitted.35request := new(pb.SimulateTransactionRequest)36if err := protojson.Unmarshal([]byte(`37{38"transaction": {39"sender": "0x0000000000000000000000000000000000000000000000000000000000000001",40"kind": {41"programmable_transaction": {42"commands": [43{44"move_call": {45"package": "0x2",46"module": "tx_context",47"function": "epoch"48}49}50]51}52}53},54"checks": "DISABLED",55"do_gas_selection": false,56"read_mask": "transaction.transaction,transaction.effects.status,commandOutputs,suggestedGasPrice"57}58`), request); err != nil {59log.Fatal(err)60}61response, err := pb.NewTransactionExecutionServiceClient(conn).SimulateTransaction(ctx, request)62if err != nil {63log.Fatal(err)64}65result, err := (protojson.MarshalOptions{Indent: " "}).Marshal(response)66if err != nil {67log.Fatal(err)68}69fmt.Println(string(result))70}71
1package main23import (4"context"5"crypto/tls"6"fmt"7"log"8"os"9"time"1011"google.golang.org/grpc"12"google.golang.org/grpc/credentials"13"google.golang.org/grpc/metadata"14"google.golang.org/protobuf/encoding/protojson"15pb "sui-grpc/sui/rpc/v2" // Your generated protobuf package16)1718func main() {19conn, err := grpc.NewClient(os.Getenv("QN_SUI_GRPC_HOST"),20grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})))21if err != nil {22log.Fatal(err)23}24defer conn.Close()25ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)26defer cancel()27if token := os.Getenv("QN_SUI_TOKEN"); token != "" {28ctx = metadata.AppendToOutgoingContext(ctx, "x-token", token)29}30// Only advertise a version your client can decode; omit it for legacy behavior.31if version := os.Getenv("SUI_CLIENT_PROTOCOL_VERSION"); version != "" {32ctx = metadata.AppendToOutgoingContext(ctx, "x-sui-client-protocol-version", version)33}34// Unsigned simulation using mock gas; no transaction is submitted.35request := new(pb.SimulateTransactionRequest)36if err := protojson.Unmarshal([]byte(`37{38"transaction": {39"sender": "0x0000000000000000000000000000000000000000000000000000000000000001",40"kind": {41"programmable_transaction": {42"commands": [43{44"move_call": {45"package": "0x2",46"module": "tx_context",47"function": "epoch"48}49}50]51}52}53},54"checks": "DISABLED",55"do_gas_selection": false,56"read_mask": "transaction.transaction,transaction.effects.status,commandOutputs,suggestedGasPrice"57}58`), request); err != nil {59log.Fatal(err)60}61response, err := pb.NewTransactionExecutionServiceClient(conn).SimulateTransaction(ctx, request)62if err != nil {63log.Fatal(err)64}65result, err := (protojson.MarshalOptions{Indent: " "}).Marshal(response)66if err != nil {67log.Fatal(err)68}69fmt.Println(string(result))70}71
1import * as grpc from '@grpc/grpc-js';2import * as protoLoader from '@grpc/proto-loader';3import * as path from 'path';45const endpoint = process.env.QN_SUI_GRPC_HOST!; // Your endpoint hostname:90006const token = process.env.QN_SUI_TOKEN;7const protoRoot = path.join(__dirname, 'protos/proto');8const definition = protoLoader.loadSync(9path.join(protoRoot, 'sui/rpc/v2/transaction_execution_service.proto'),10{ keepCase: true, longs: String, enums: String, includeDirs: [protoRoot] },11);12const proto = grpc.loadPackageDefinition(definition) as any;13const client = new proto.sui.rpc.v2.TransactionExecutionService(14endpoint, grpc.credentials.createSsl(),15);16const metadata = new grpc.Metadata();17if (token) metadata.set('x-token', token);18// Only advertise a version your client can decode; omit it for legacy behavior.19if (process.env.SUI_CLIENT_PROTOCOL_VERSION) {20metadata.set('x-sui-client-protocol-version', process.env.SUI_CLIENT_PROTOCOL_VERSION);21}2223// Unsigned simulation using mock gas; no transaction is submitted.24const request = {25"transaction": {26"sender": "0x0000000000000000000000000000000000000000000000000000000000000001",27"kind": {28"programmable_transaction": {29"commands": [30{31"move_call": {32"package": "0x2",33"module": "tx_context",34"function": "epoch"35}36}37]38}39}40},41"checks": "DISABLED",42"do_gas_selection": false,43"read_mask": {44"paths": [45"transaction.transaction",46"transaction.effects.status",47"command_outputs",48"suggested_gas_price"49]50}51};52client.SimulateTransaction(request, metadata, { deadline: Date.now() + 20000 },53(error: grpc.ServiceError | null, response: any) => {54if (error) {55console.error(error);56process.exitCode = 1;57} else {58console.log(JSON.stringify(response, null, 2));59}60client.close();61},62);63
1import * as grpc from '@grpc/grpc-js';2import * as protoLoader from '@grpc/proto-loader';3import * as path from 'path';45const endpoint = process.env.QN_SUI_GRPC_HOST!; // Your endpoint hostname:90006const token = process.env.QN_SUI_TOKEN;7const protoRoot = path.join(__dirname, 'protos/proto');8const definition = protoLoader.loadSync(9path.join(protoRoot, 'sui/rpc/v2/transaction_execution_service.proto'),10{ keepCase: true, longs: String, enums: String, includeDirs: [protoRoot] },11);12const proto = grpc.loadPackageDefinition(definition) as any;13const client = new proto.sui.rpc.v2.TransactionExecutionService(14endpoint, grpc.credentials.createSsl(),15);16const metadata = new grpc.Metadata();17if (token) metadata.set('x-token', token);18// Only advertise a version your client can decode; omit it for legacy behavior.19if (process.env.SUI_CLIENT_PROTOCOL_VERSION) {20metadata.set('x-sui-client-protocol-version', process.env.SUI_CLIENT_PROTOCOL_VERSION);21}2223// Unsigned simulation using mock gas; no transaction is submitted.24const request = {25"transaction": {26"sender": "0x0000000000000000000000000000000000000000000000000000000000000001",27"kind": {28"programmable_transaction": {29"commands": [30{31"move_call": {32"package": "0x2",33"module": "tx_context",34"function": "epoch"35}36}37]38}39}40},41"checks": "DISABLED",42"do_gas_selection": false,43"read_mask": {44"paths": [45"transaction.transaction",46"transaction.effects.status",47"command_outputs",48"suggested_gas_price"49]50}51};52client.SimulateTransaction(request, metadata, { deadline: Date.now() + 20000 },53(error: grpc.ServiceError | null, response: any) => {54if (error) {55console.error(error);56process.exitCode = 1;57} else {58console.log(JSON.stringify(response, null, 2));59}60client.close();61},62);63
1import json2import os3import grpc4from google.protobuf.json_format import MessageToJson, ParseDict5from sui.rpc.v2 import transaction_execution_service_pb2 as pb6from sui.rpc.v2 import transaction_execution_service_pb2_grpc as services78endpoint = os.environ["QN_SUI_GRPC_HOST"] # Your endpoint hostname:90009metadata = []10if os.environ.get("QN_SUI_TOKEN"):11metadata.append(("x-token", os.environ["QN_SUI_TOKEN"]))12# Only advertise a version your client can decode; omit it for legacy behavior.13if os.environ.get("SUI_CLIENT_PROTOCOL_VERSION"):14metadata.append(("x-sui-client-protocol-version", os.environ["SUI_CLIENT_PROTOCOL_VERSION"]))1516# Unsigned simulation using mock gas; no transaction is submitted.17request = ParseDict(json.loads(r'''18{19"transaction": {20"sender": "0x0000000000000000000000000000000000000000000000000000000000000001",21"kind": {22"programmable_transaction": {23"commands": [24{25"move_call": {26"package": "0x2",27"module": "tx_context",28"function": "epoch"29}30}31]32}33}34},35"checks": "DISABLED",36"do_gas_selection": False,37"read_mask": "transaction.transaction,transaction.effects.status,commandOutputs,suggestedGasPrice"38}39'''), pb.SimulateTransactionRequest())40with grpc.secure_channel(endpoint, grpc.ssl_channel_credentials()) as channel:41client = services.TransactionExecutionServiceStub(channel)42response = client.SimulateTransaction(request, metadata=metadata, timeout=20)43print(MessageToJson(response))44
1import json2import os3import grpc4from google.protobuf.json_format import MessageToJson, ParseDict5from sui.rpc.v2 import transaction_execution_service_pb2 as pb6from sui.rpc.v2 import transaction_execution_service_pb2_grpc as services78endpoint = os.environ["QN_SUI_GRPC_HOST"] # Your endpoint hostname:90009metadata = []10if os.environ.get("QN_SUI_TOKEN"):11metadata.append(("x-token", os.environ["QN_SUI_TOKEN"]))12# Only advertise a version your client can decode; omit it for legacy behavior.13if os.environ.get("SUI_CLIENT_PROTOCOL_VERSION"):14metadata.append(("x-sui-client-protocol-version", os.environ["SUI_CLIENT_PROTOCOL_VERSION"]))1516# Unsigned simulation using mock gas; no transaction is submitted.17request = ParseDict(json.loads(r'''18{19"transaction": {20"sender": "0x0000000000000000000000000000000000000000000000000000000000000001",21"kind": {22"programmable_transaction": {23"commands": [24{25"move_call": {26"package": "0x2",27"module": "tx_context",28"function": "epoch"29}30}31]32}33}34},35"checks": "DISABLED",36"do_gas_selection": False,37"read_mask": "transaction.transaction,transaction.effects.status,commandOutputs,suggestedGasPrice"38}39'''), pb.SimulateTransactionRequest())40with grpc.secure_channel(endpoint, grpc.ssl_channel_credentials()) as channel:41client = services.TransactionExecutionServiceStub(channel)42response = client.SimulateTransaction(request, metadata=metadata, timeout=20)43print(MessageToJson(response))44