Sui JSON-RPC (deprecated) (1/4)
API reference for Sui. All methods ->
Sui JSON-RPC is deprecated and runs on a reduced method set. Use gRPC or GraphQL for new work.
The Sui full-node software no longer serves JSON-RPC. On Ankr, https://rpc.ankr.com/sui (mainnet) answers JSON-RPC from a Sui indexer instead of a full node, and supports only the methods on these pages. Any other method returns -32601 Method not found, including sui_getChainIdentifier, sui_getLatestCheckpointSequenceNumber, sui_getEvents, suix_queryEvents, suix_getAllCoins and the unsafe_* transaction builders. JSON-RPC is HTTPS only (no WebSocket), and there is no JSON-RPC on Sui testnet.
Move to:
- gRPC for indexers, backend services, and most dApp use cases, on mainnet and testnet. For historical data, use the gRPC Archive endpoint (
archive.sui.grpc.ankr.com:443). - GraphQL for frontends, dashboards, and analytics tools.
Your existing Premium token works on gRPC and GraphQL, so no new credentials are needed. If you are unsure which interface replaces a JSON-RPC method you rely on, contact support and we will map it for you.
Sui API is available on Web3 API platform.
Sui is the first permissionless Layer 1 blockchain designed from the ground up to enable creators and developers to build experiences that cater to the next billion users in Web3. Sui is horizontally scalable to support a wide range of application development with unrivaled speed at low cost.
In order for your Web3 application to interact with Sui — either by reading blockchain data or sending transactions to the network — it must connect to a Sui node. We recommend gRPC or GraphQL; JSON-RPC covers only the methods listed below (see the notice above).
The API interaction follows the JSON-RPC which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format.
Methods supported
sui_devInspectTransactionBlock— runs the transaction in dev-inspect mode.sui_dryRunTransactionBlock— retrieves transaction execution effects including the gas cost summary, while the effects are not committed to the chain.sui_executeTransactionBlock— executes the transaction and wait for results if desired.sui_getCheckpoint— retrieves a checkpoint.sui_getNormalizedMoveFunction— retrieves a structured representation of Move function.sui_getObject— retrieves the object information for a specified object.sui_getProtocolConfig— retrieves the protocol config table for the given version number.sui_getTransactionBlock— retrieves the transaction response object.sui_multiGetObjects— retrieves the object data for a list of objects.sui_tryGetPastObject— retrieves the object information for a specified version.sui_tryMultiGetPastObjects— retrieves the object information for a specified version.suix_getAllBalances— retrieves the total coin balance for all coin type, owned by the address owner.suix_getBalance— retrieves the total coin balance for one coin type, owned by the address owner.suix_getCoinMetadata— retrieves metadata (as symbol or decimals) for a coin.suix_getCoins— retrieves all coin type objects owned by an address.suix_getDynamicFieldObject— retrieves the dynamic field object information for a specified object.suix_getDynamicFields— retrieves the list of dynamic field objects owned by an object.suix_getLatestSuiSystemState— retrieves the latest SUI system state object on-chain.suix_getOwnedObjects— retrieves the list of objects owned by an address.suix_getReferenceGasPrice— retrieves the reference gas price for the network.suix_getStakes— retrieves allDelegatedStake.suix_getStakesByIds— retrieves one or moreDelegatedStakes.suix_getValidatorsApy— retrieves the validator APY.suix_queryTransactionBlocks— retrieves list of transactions for a specified query criteria.suix_resolveNameServiceAddress— retrieves the resolved address given the resolver and name.suix_resolveNameServiceNames— retrieves the resolved names given an address.
sui_devInspectTransactionBlock
Runs the transaction in dev-inspect mode.
This mode allows for nearly any transaction (or Move call) with any arguments. Detailed results are provided, including both the transaction effects and any return values.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<sender_address>: Sui address.<tx_bytes>(Base64): a BCS encodedTransactionKind(as opposed toTransactionData, which includegasBudgetandgasPrice).<gas_price>(string): gas is not charged, but gas usage is still calculated. Defaults to using a reference gas price.<epoch>(string): the epoch to perform the call. Will be set from the system state object if not provided.
Returns
effects(TransactionBlockEffects): the summary of effects that likely would be generated if the transaction is actually run. Note however, that not all dev-inspect transactions are actually usable as transactions, so it might not be possible actually to generate these effects from a normal transaction.error(string, null): an execution error from executing the transactions.events(Event): events that likely would be generated if the transaction is actually run.results(SuiExecutionResult): execution results (including return values) from executing the transactions.
Request example
curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "sui_devInspectTransactionBlock",
"params": [
"0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26",
"AAEBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgVjbG9jawx0aW1lc3RhbXBfbXMAAQEAAA=="
]
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"effects": {
"messageVersion": "v1",
"status": {
"status": "success"
},
"executedEpoch": "1292",
"gasUsed": {
"computationCost": "100000",
"storageCost": "988000",
"storageRebate": "0",
"nonRefundableStorageFee": "0"
},
"modifiedAtVersions": [
{
"objectId": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"sequenceNumber": "1"
}
],
"sharedObjects": [
{
"objectId": "0x0000000000000000000000000000000000000000000000000000000000000006",
"version": 1006393757,
"digest": "BvN4TxiWWLptkqqw4TqBuB1kPodUo53RsyGnM8PFYUks"
}
],
"transactionDigest": "HvrV3iYA5KJyf72qm6wtg2kZUZkEQwLYqxNc7EwEePMw",
"mutated": [
{
"owner": {
"AddressOwner": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26"
},
"reference": {
"objectId": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"version": 1006393758,
"digest": "5exrYRVB7LaohkN4wZJByXmgQL6YSLyEbnC13YpjHDvj"
}
}
],
"gasObject": {
"owner": {
"AddressOwner": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26"
},
"reference": {
"objectId": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"version": 1006393758,
"digest": "5exrYRVB7LaohkN4wZJByXmgQL6YSLyEbnC13YpjHDvj"
}
},
"dependencies": [
"FzB9793r5XvxA6ZgReqQNU6fKikn7NA3uYsDB2qBsSph",
"Gqy3E34TVKehFKGfiXkWin4p8Mc7wfTYbCk9K2oxnron"
]
},
"events": [],
"results": [
{
"returnValues": [
[
[
194,
26,
153,
120,
161,
1,
0,
0
],
"u64"
]
]
}
]
}
}
Methods supported
sui_dryRunTransactionBlock
Retrieves transaction execution effects including the gas cost summary, while the effects are not committed to the chain.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<tx_bytes>(Base64): a BCS encodedTransactionData, which includes the sender and the gas data (gasBudget,gasPrice, gas payment).
Returns
balanceChanges: balance change.effects: transaction block effects.events: an event.input: transaction block data.objectChanges: object change.
Request example
curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "sui_dryRunTransactionBlock",
"params": [
"AAABAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgEAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIFY2xvY2sMdGltZXN0YW1wX21zAAEBAAAwQwRxiC6nm9IVPfmLRVxrYqas92ZCoXZJZlJm7duaJgAwQwRxiC6nm9IVPfmLRVxrYqas92ZCoXZJZlJm7duaJugDAAAAAAAAgJaYAAAAAAAA"
]
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"effects": {
"messageVersion": "v1",
"status": {
"status": "success"
},
"executedEpoch": "1292",
"gasUsed": {
"computationCost": "1000000",
"storageCost": "988000",
"storageRebate": "0",
"nonRefundableStorageFee": "0"
},
"modifiedAtVersions": [
{
"objectId": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"sequenceNumber": "1"
}
],
"sharedObjects": [
{
"objectId": "0x0000000000000000000000000000000000000000000000000000000000000006",
"version": 1006393760,
"digest": "EqXMgyTuoZ44s9qMuNQSuknEPk5NPx44dCsDqfMMKbze"
}
],
"transactionDigest": "6YUz92BpGQRcAcVs33J7eWWqv3BidS1gxq2a7Kjmv2Hr",
"mutated": [
{
"owner": {
"AddressOwner": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26"
},
"reference": {
"objectId": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"version": 1006393761,
"digest": "6eWtgFEHBdo2dMxVZ8qiHf3dVxxYKJCCnbbs6ewjXe7j"
}
}
],
"gasObject": {
"owner": {
"AddressOwner": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26"
},
"reference": {
"objectId": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"version": 1006393761,
"digest": "6eWtgFEHBdo2dMxVZ8qiHf3dVxxYKJCCnbbs6ewjXe7j"
}
},
"dependencies": [
"D931zNW6qRLpHxCdq1GBgfvY36E4aM8HyRd2MkQCnLma",
"FzB9793r5XvxA6ZgReqQNU6fKikn7NA3uYsDB2qBsSph"
]
},
"events": [],
"objectChanges": [
{
"type": "mutated",
"sender": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26",
"owner": {
"AddressOwner": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26"
},
"objectType": "0x2::coin::Coin<0x2::sui::SUI>",
"objectId": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"version": "1006393761",
"previousVersion": "1",
"digest": "6eWtgFEHBdo2dMxVZ8qiHf3dVxxYKJCCnbbs6ewjXe7j"
}
],
"balanceChanges": [
{
"owner": {
"AddressOwner": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26"
},
"coinType": "0x2::sui::SUI",
"amount": "-1988000"
}
],
"input": {
"messageVersion": "v1",
"transaction": {
"kind": "ProgrammableTransaction",
"inputs": [
{
"type": "object",
"objectType": "sharedObject",
"objectId": "0x0000000000000000000000000000000000000000000000000000000000000006",
"initialSharedVersion": "1",
"mutable": false
}
],
"transactions": [
{
"MoveCall": {
"package": "0x0000000000000000000000000000000000000000000000000000000000000002",
"module": "clock",
"function": "timestamp_ms",
"arguments": [
{
"Input": 0
}
]
}
}
]
},
"sender": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26",
"gasData": {
"payment": [],
"owner": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26",
"price": "1000",
"budget": "10000000"
}
},
"executionErrorSource": null
}
}
sui_executeTransactionBlock
Executes the transaction and wait for results if desired.
Request types:
WaitForEffectsCert: waits forTransactionEffectsCertand then return to client. This mode is a proxy for transaction finality.WaitForLocalExecution: waits forTransactionEffectsCertand make sure the node executed the transaction locally before returning the client. The local execution makes sure this node is aware of this transaction when client fires subsequent queries. However, if the node fails to execute the transaction locally in a timely manner, a bool type in the response is set tofalseto indicate the case.request_typeis default to beWaitForEffectsCertunlessoptions.show_eventsoroptions.show_effectsistrue.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<tx_bytes>(Base64): a BCS encodedTransactionData, which includes the sender and the gas data (gasBudget,gasPrice, gas payment).<signatures>(Base64): a list of signatures (flag || signature || pubkeybytes, as base-64 encoded string). Signature is committed to the intent message of the transaction data, as base-64 encoded string.<options>(TransactionBlockResponseOptions): options for specifying the content to be returned.<request_type>(ExecuteTransactionRequestType): a request type, derived fromSuiTransactionBlockResponseOptionsif None.
Returns
<SuiTransactionBlockResponse>
Request example
curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "sui_executeTransactionBlock",
"params": [
"AAACACBqEB6aOvXIBwES+Ahkizbvv43uihqC3kbZUE6WoRCKFwEAjvdvVsOZYzousxC8qRJOXy84znOeqsu2YAaIgE4HhEgCAAAAAAAAACB9w3+ufZMpihJFwxtCBojBaGy00TVtFxgN2C6TpIPFqwEBAQEBAAEAAAS0l6kWtGVmCaf6gnoJGE1vR2gdO6dM4NejbGSysfiHAZ+Q9/hmzCnfsdpjc86U+dldylpA9OF2mRjuv5+64AvTAgAAAAAAAAAgjleHL0UiRGjh/BfIFHCJ3EMY/dQA22c2TvNQyVJnbYUEtJepFrRlZgmn+oJ6CRhNb0doHTunTODXo2xksrH4hwoAAAAAAAAAAC0xAQAAAAAA",
[
"AEZc4UMAoxzWtp+i1dvyOgmy+Eeb/5ZNwO5dpHBqX5Rt36+HhYnBby8asFU4b0i7TjQZGgLahT8w3NQUfk0NUQnqvbuA0Q1Bqu4RHV3JPpqmH+C527hWJGUBOZN1j9sg8w=="
],
{
"showInput": true,
"showRawInput": true,
"showEffects": true,
"showEvents": true,
"showObjectChanges": true,
"showBalanceChanges": true
},
"WaitForEffectsCert"
]
}'
Response example
{
"jsonrpc": "2.0",
"result": {
"digest": "BgSFSEFYbCrVUJJtHFeoLmLJi8jDf1CpC2o8S33HjeDJ",
"transaction": {
"data": {
"messageVersion": "v1",
"transaction": {
"kind": "ProgrammableTransaction",
"inputs": [
{
"type": "pure",
"valueType": "address",
"value": "0x6a101e9a3af5c8070112f808648b36efbf8dee8a1a82de46d9504e96a1108a17"
},
{
"type": "object",
"objectType": "immOrOwnedObject",
"objectId": "0x8ef76f56c399633a2eb310bca9124e5f2f38ce739eaacbb6600688804e078448",
"version": "2",
"digest": "9Tvs1pGrMbNv7kkr1PoKLsWamyQpaFz5UWbL2AQ1ezk2"
}
],
"transactions": [
{
"TransferObjects": [
[
{
"Input": 1
}
],
{
"Input": 0
}
]
}
]
},
"sender": "0x04b497a916b4656609a7fa827a09184d6f47681d3ba74ce0d7a36c64b2b1f887",
"gasData": {
"payment": [
{
"objectId": "0x9f90f7f866cc29dfb1da6373ce94f9d95dca5a40f4e1769918eebf9fbae00bd3",
"version": 2,
"digest": "AaeJbTYkUuyromsivxzkoxSkHt7pCESTyQG7xz6nbQ2G"
}
],
"owner": "0x04b497a916b4656609a7fa827a09184d6f47681d3ba74ce0d7a36c64b2b1f887",
"price": "10",
"budget": "20000000"
}
},
"txSignatures": [
"AEZc4UMAoxzWtp+i1dvyOgmy+Eeb/5ZNwO5dpHBqX5Rt36+HhYnBby8asFU4b0i7TjQZGgLahT8w3NQUfk0NUQnqvbuA0Q1Bqu4RHV3JPpqmH+C527hWJGUBOZN1j9sg8w=="
]
},
"rawTransaction": "AQAAAAAAAgAgahAemjr1yAcBEvgIZIs277+N7ooagt5G2VBOlqEQihcBAI73b1bDmWM6LrMQvKkSTl8vOM5znqrLtmAGiIBOB4RIAgAAAAAAAAAgfcN/rn2TKYoSRcMbQgaIwWhstNE1bRcYDdguk6SDxasBAQEBAQABAAAEtJepFrRlZgmn+oJ6CRhNb0doHTunTODXo2xksrH4hwGfkPf4Zswp37HaY3POlPnZXcpaQPThdpkY7r+fuuAL0wIAAAAAAAAAII5Xhy9FIkRo4fwXyBRwidxDGP3UANtnNk7zUMlSZ22FBLSXqRa0ZWYJp/qCegkYTW9HaB07p0zg16NsZLKx+IcKAAAAAAAAAAAtMQEAAAAAAAFhAEZc4UMAoxzWtp+i1dvyOgmy+Eeb/5ZNwO5dpHBqX5Rt36+HhYnBby8asFU4b0i7TjQZGgLahT8w3NQUfk0NUQnqvbuA0Q1Bqu4RHV3JPpqmH+C527hWJGUBOZN1j9sg8w==",
"effects": {
"messageVersion": "v1",
"status": {
"status": "success"
},
"executedEpoch": "0",
"gasUsed": {
"computationCost": "100",
"storageCost": "100",
"storageRebate": "10",
"nonRefundableStorageFee": "0"
},
"transactionDigest": "9agZ3azEMgMqxrDVG8P4GddELfWag2HhimEkpjixHhGE",
"mutated": [
{
"owner": {
"AddressOwner": "0x04b497a916b4656609a7fa827a09184d6f47681d3ba74ce0d7a36c64b2b1f887"
},
"reference": {
"objectId": "0x9f90f7f866cc29dfb1da6373ce94f9d95dca5a40f4e1769918eebf9fbae00bd3",
"version": 2,
"digest": "AaeJbTYkUuyromsivxzkoxSkHt7pCESTyQG7xz6nbQ2G"
}
},
{
"owner": {
"AddressOwner": "0x6a101e9a3af5c8070112f808648b36efbf8dee8a1a82de46d9504e96a1108a17"
},
"reference": {
"objectId": "0x8ef76f56c399633a2eb310bca9124e5f2f38ce739eaacbb6600688804e078448",
"version": 2,
"digest": "9Tvs1pGrMbNv7kkr1PoKLsWamyQpaFz5UWbL2AQ1ezk2"
}
}
],
"gasObject": {
"owner": {
"ObjectOwner": "0x04b497a916b4656609a7fa827a09184d6f47681d3ba74ce0d7a36c64b2b1f887"
},
"reference": {
"objectId": "0x9f90f7f866cc29dfb1da6373ce94f9d95dca5a40f4e1769918eebf9fbae00bd3",
"version": 2,
"digest": "AaeJbTYkUuyromsivxzkoxSkHt7pCESTyQG7xz6nbQ2G"
}
},
"eventsDigest": "816hEv4WAW2reK9xkf11PeHiaZJrp7PQT9oGJZhdf9TN"
},
"objectChanges": [
{
"type": "transferred",
"sender": "0x04b497a916b4656609a7fa827a09184d6f47681d3ba74ce0d7a36c64b2b1f887",
"recipient": {
"AddressOwner": "0x6a101e9a3af5c8070112f808648b36efbf8dee8a1a82de46d9504e96a1108a17"
},
"objectType": "0x2::example::Object",
"objectId": "0x8ef76f56c399633a2eb310bca9124e5f2f38ce739eaacbb6600688804e078448",
"version": "2",
"digest": "7PsBHpUW6yfGNov2WrbVafLjgT9nYziQ3gVDbRq6zTbF"
}
]
}
}
sui_getCheckpoint
Retrieves a checkpoint.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<id>: checkpoint identifier, can use either checkpoint digest, or checkpoint sequence number as input.
Returns
checkpointCommitments: commitments to checkpoint state.digest: checkpoint digest.endOfEpochData: to be present only on the final checkpoint of the epoch.epoch: checkpoint's epoch ID.epochRollingGasCostSummary: the running total gas costs of all transactions included in the current epoch so far until this checkpoint.networkTotalTransactions: total number of transactions committed since genesis, including those in this checkpoint.previousDigest: digest of the previous checkpoint.sequenceNumber: checkpoint sequence number.timestampMs: timestamp of the checkpoint — number of milliseconds from the Unix epoch Checkpoint timestamps are monotonic, but not strongly monotonic — subsequent checkpoints can have same timestamp if they originate from the same underlining consensus committransactions: transaction digests.validatorSignature: validator Signature.
Request example
curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "sui_getCheckpoint",
"params": [
"1000"
]
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"epoch": "0",
"sequenceNumber": "1000",
"digest": "BE4JixC94sDtCgHJZruyk7QffZnWDFvM2oFjC8XtChET",
"networkTotalTransactions": "1001",
"previousDigest": "41nPNZWHvvajmBQjX3GbppsgGZDEB6DhN4UxPkjSYRRj",
"epochRollingGasCostSummary": {
"computationCost": "0",
"storageCost": "0",
"storageRebate": "0",
"nonRefundableStorageFee": "0"
},
"timestampMs": "1681393657483",
"transactions": [
"9NnjyPG8V2TPCSbNE391KDyge42AwV3vUD7aNtQQ9eqS"
],
"checkpointCommitments": [],
"validatorSignature": "r8/5+Rm7niIlndcnvjSJ/vZLPrH3xY/ePGYTvrVbTascoQSpS+wsGlC+bQBpzIwA"
}
}