Sui - Migration Guide from JSON-RPC to gRPC
Sui deprecated JSON-RPC in favor of gRPC; map each JSON-RPC method to its gRPC service, for example sui_getObject to LedgerService/GetObject.
Sui has officially deprecated JSON-RPC in favor of gRPC. The Sui Foundation disabled JSON-RPC on Mainnet full nodes the week of July 27, 2026.
gRPC offers lower latency and smaller payloads via binary Protocol Buffers, real-time streaming, and robust type safety that catches errors at compile time.
This guide will help you transition your application to the high-performance Tatum Sui gRPC Gateway.
Migration Checklist
- Get your Tatum API Key: Your existing Tatum API key works for both protocols.
- Install Dependencies: Add
@grpc/grpc-jsand@grpc/proto-loaderto your Node.js project. - Download Protos: Clone the official sui-apis repository to get the required
.protofiles. - Update Authentication: Switch from JSON headers to gRPC metadata using the
x-api-keykey.
NOTEFor endpoints, setup and Node.js examples, see the Tatum Sui gRPC reference.
Method Mapping: JSON-RPC to gRPC
The transition involves mapping your old method calls to the new gRPC Services.
Checkpoint & Transaction Queries
| JSON-RPC Method | gRPC Service / Method |
|---|---|
sui_getLatestCheckpointSequenceNumber | LedgerService/GetCheckpoint (without a checkpoint ID) |
sui_getCheckpoint | LedgerService/GetCheckpoint |
sui_getCheckpoints | LedgerService/ListCheckpoints |
sui_getTransactionBlock | LedgerService/GetTransaction |
sui_multiGetTransactionBlocks | LedgerService/BatchGetTransactions |
Object Queries
| JSON-RPC Method | gRPC Service / Method |
|---|---|
sui_getObject | LedgerService/GetObject |
sui_multiGetObjects | LedgerService/BatchGetObjects |
sui_tryGetPastObject | LedgerService/GetObject with version |
Balance & Coin Queries
| JSON-RPC Method | gRPC Service / Method |
|---|---|
suix_getBalance | StateService/GetBalance |
suix_getAllBalances | StateService/ListBalances |
suix_getCoins | StateService/ListOwnedObjects with object_type 0x2::coin::Coin<T> |
suix_getAllCoins | StateService/ListOwnedObjects with object_type 0x2::coin::Coin |
suix_getCoinMetadata | StateService/GetCoinInfo |
Transaction Execution
| JSON-RPC Method | gRPC Service / Method |
|---|---|
sui_executeTransactionBlock | TransactionExecutionService/ExecuteTransaction |
sui_dryRunTransactionBlock | TransactionExecutionService/SimulateTransaction |
Name Service
| JSON-RPC Method | gRPC Service / Method |
|---|---|
suix_resolveNameServiceAddress | NameService/LookupName |
suix_resolveNameServiceNames | NameService/ReverseLookupName |
Code Comparison: Getting a Checkpoint
In both examples, replace {CHECKPOINT} with a checkpoint sequence number.
Before (JSON-RPC)
This is the call your app made before the migration. Tatum decommissioned its Sui JSON-RPC endpoints after their July 2026 end of life, so this request no longer returns data.
curl --location 'https://sui-mainnet.gateway.tatum.io' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "sui_getCheckpoint",
"params": [
"{CHECKPOINT}"
]
}'After (gRPC)
gRPC uses binary serialization. While you can still perform "request-response" calls, you benefit from significantly lower latency and smaller payloads.
The same request with grpcurl calls LedgerService/GetCheckpoint. The read_mask selects the fields to return; without it, you get only sequence_number and digest. Leave out sequence_number to get the latest checkpoint.
grpcurl \
-H "x-api-key: {YOUR_API_KEY}" \
-d '{ "sequence_number": "{CHECKPOINT}", "read_mask": { "paths": ["sequence_number", "digest", "summary"] } }' \
sui-mainnet-grpc.gateway.tatum.io:443 \
sui.rpc.v2.LedgerService/GetCheckpointFull nodes keep only recent checkpoints, so an old checkpoint returns NOT_FOUND.
NOTEFor Node.js clients and more examples, see the Tatum Sui gRPC reference.
Key Differences
1. Error Handling
JSON-RPC returns errors in the response body (200 OK with an error object). gRPC uses standard status codes:
- Code 16 (Unauthenticated): Check your
x-api-key. - Code 5 (NOT_FOUND): Usually indicates pruned data (historical data no longer on the full node).
2. Numbers are Strings
Large blockchain numbers (like SUI balances and checkpoint sequence numbers) are 64-bit integers. To prevent precision loss, JSON output such as grpcurl's shows them as Strings; in Node.js, load the protos with longs: String in @grpc/proto-loader to get strings too. Always parse them using BigInt().
3. Field Masks
To optimize your app, use read_mask. This allows you to request only the specific fields you need (e.g., just the owner of an object), significantly reducing payload size.
Testing the Migration
Use grpcurl to quickly verify your Tatum connection from the terminal:
grpcurl \
-H "x-api-key: {YOUR_API_KEY}" \
sui-mainnet-grpc.gateway.tatum.io:443 \
sui.rpc.v2.LedgerService/GetCheckpoint
NOTELooking for the Tatum Postman Collection? Open the Tatum Sui gRPC Postman collection.
Updated 2 days ago