For the complete documentation index, see llms.txt. This page is also available as Markdown.

TransactionExecutionService/ExecuteTransaction - SUI

Example code for the TransactionExecutionService/ExecuteTransaction gRPC method. Complete guide on how to use TransactionExecutionService/ExecuteTransaction gRPC method in GetBlock Web3 documentation.

Submits a signed transaction for execution and returns the resulting effects. This is the canonical write path for Sui — coin transfers, NFT mints, Move calls, package publishes, all go through here. The transaction must be a BCS-serialized signed transaction blob with one or more signatures.

Service: sui.rpc.v2.TransactionExecutionService Proto file: sui/rpc/v2/transaction_execution_service.proto Full method path: sui.rpc.v2.TransactionExecutionService/ExecuteTransaction

Request Fields

Field
Type
Required
Description

transaction

Transaction

Yes

BCS-encoded signed transaction (as bytes or hex)

signatures

repeated UserSignature

Yes

One or more signatures over the transaction

Request Example

# Clone the official proto files first (one-time setup):
#   git clone https://github.com/MystenLabs/sui-apis.git && cd sui-apis

grpcurl \
  -import-path proto \
  -proto sui/rpc/v2/transaction_execution_service.proto \
  -H "x-grpc-web: 1" \
  -d '{
    "transaction": {
        "bcs": "AQAA..."
    },
    "signatures": [
        {
            "bcs": "AKx..."
        }
    ]
}' \
  go.getblock.io:443/<ACCESS-TOKEN> \
  sui.rpc.v2.TransactionExecutionService/ExecuteTransaction
import * as grpc from '@grpc/grpc-js';
import * as protoLoader from '@grpc/proto-loader';
import * as path from 'path';

const PROTO_PATH = path.join(__dirname, 'protos/proto/sui/rpc/v2/transaction_execution_service.proto');
const ACCESS_TOKEN = '<ACCESS-TOKEN>';

const packageDef = protoLoader.loadSync(PROTO_PATH, {
    includeDirs: [path.join(__dirname, 'protos/proto')],
    keepCase: true, longs: String, enums: String, defaults: true,
});
const proto = grpc.loadPackageDefinition(packageDef) as any;
const ServiceClient = proto.sui.rpc.v2.TransactionExecutionService;

const metadata = new grpc.Metadata();
metadata.add('authorization', `Bearer ${ACCESS_TOKEN}`);

const client = new ServiceClient('go.getblock.io:443', grpc.credentials.createSsl());

const request = {
    "transaction": {
        "bcs": "AQAA..."
    },
    "signatures": [
        {
            "bcs": "AKx..."
        }
    ]
};

client.ExecuteTransaction(request, metadata, (err: any, response: any) => {
    if (err) {
        console.error('Error:', err);
        return;
    }
    console.log(JSON.stringify(response, null, 2));
});

Response Example

Responses are encoded in Protocol Buffers binary format on the wire. The example below shows the protobuf JSON encoding for readability.

Response Fields

Field
Type
Description

transaction.digest

string

Resulting transaction digest

transaction.effects.status

ExecutionStatus

success: true or error with details

transaction.effects.gas_used

GasCostSummary

Computation cost, storage cost, and storage rebate in MIST

transaction.effects.created

repeated ObjectRef

Newly created objects (e.g. minted NFTs)

transaction.effects.mutated

repeated ObjectRef

Objects modified by this transaction

transaction.effects.deleted

repeated ObjectRef

Objects deleted by this transaction

transaction.events

repeated Event

Move-level events emitted during execution

transaction.checkpoint

string

Checkpoint sequence number containing this transaction

Use Cases

  • Submitting SUI transfers

  • Calling Move functions on deployed packages

  • Publishing new Move packages

  • Minting and transferring NFTs and other Move objects

Error Handling

gRPC uses status codes rather than JSON-RPC numeric error codes. The most relevant for this method:

Status Code
Numeric
Cause

UNAUTHENTICATED

16

Missing or invalid <ACCESS-TOKEN> in the URL path

INVALID_ARGUMENT

3

Request fields are missing, malformed, or fail validation

UNAVAILABLE

14

Node is overloaded or temporarily unable to handle the request — retry with backoff

DEADLINE_EXCEEDED

4

Request did not complete within the timeout window

RESOURCE_EXHAUSTED

8

Rate limit exceeded for your plan

INVALID_ARGUMENT

3

Malformed transaction bytes, malformed signature, or wrong number of signatures

FAILED_PRECONDITION

9

Transaction execution failed during pre-flight validation (e.g. insufficient gas, invalid object reference, sequence mismatch)

SDK Integration

Was this helpful?