For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

Sui JSON-RPC (deprecated) (2/5)

API reference for Sui. All methods ->

Part 2 of 5: 1 · 2 · 3 · 4 · 5

Methods supported

sui_getEvents

Retrieves transaction events.

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):

    • <transaction_digest> (string): the event query criteria.

Returns

  • Vec<SuiEvent>: a Sui event.

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_getEvents",
"params": [
"11a72GCQ5hGNpWGh2QhQkkusTEGS6EDqifJqxr7nSYX"
]
}'

Response example

{
"jsonrpc": "2.0",
"result": {
"data": [
{
"id": {
"txDigest": "11a72GCQ5hGNpWGh2QhQkkusTEGS6EDqifJqxr7nSYX",
"eventSeq": "0"
},
"packageId": "0xc54ab30a3d9adc07c1429c4d6bbecaf9457c9af77a91f631760853934d383634",
"transactionModule": "test_module",
"sender": "0xbcf7c32655009a61f1de0eae420a2e4ae1bb772ab2dd5d5a7dfa949c0ef06908",
"type": "0x0000000000000000000000000000000000000000000000000000000000000009::test::TestEvent",
"parsedJson": {
"test": "example value"
},
"bcs": ""
}
],
"nextCursor": {
"txDigest": "11a72GCQ5hGNpWGh2QhQkkusTEGS6EDqifJqxr7nSYX",
"eventSeq": "5"
},
"hasNextPage": false
}
}

sui_getLatestCheckpointSequenceNumber

Retrieves the sequence number of the latest checkpoint that has been executed.

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): none.

Returns

  • BigInt<u64>: the sequence number for the latest checkpoint.

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_getLatestCheckpointSequenceNumber",
"params": []
}'

Response example

{
"jsonrpc": "2.0",
"result": "507021"
}

sui_getLoadedChildObjects

Retrieves loaded child objects.

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):

    • <digest>: transaction digest.

Returns

  • <SuiLoadedChildObjectsResponse>: loaded child objects associated with the transaction the request provides.

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_getLoadedChildObjects",
"params": [
"6hpz6Qxv6t5VkNT5rcBKQS2Jootr6WHuSuRMLmmN13Jg"
]
}'

Response example

{
"jsonrpc": "2.0",
"result": {
"loadedChildObjects": [
{
"objectId": "0xb6a23efeb7298cf0a8d0b837b78749c2cfc711c42036cc6b76211639f3606a53",
"sequenceNumber": "2462820"
},
{
"objectId": "0xf61f3a566963b3eac49fe3bb57d304a454ed2f4859b44f4e49180047d5fa0a82",
"sequenceNumber": "2462820"
},
{
"objectId": "0xd55c32b09995a0ae1eedfee9c7b1354e805ed10ee3d0800105867da4655eca6d",
"sequenceNumber": "2164186"
},
{
"objectId": "0x258bfd1ad92af329a07781ee71e60065e00f2de961630d3505f8905a0f4d42c6",
"sequenceNumber": "3350147"
},
{
"objectId": "0xa78a6ba2b28f68a3299ec3417bbabc6717dcc95b9e341bc3aba1654bdbad707d",
"sequenceNumber": "3560717"
},
{
"objectId": "0xcd773bd6309363447ef3fe58a960de92aa9377b3482580ee8d5bdc5b824808df",
"sequenceNumber": "3560717"
}
]
}
}

sui_getMoveFunctionArgTypes

Retrieves the argument types of a Move function, based on normalized Type.

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):

    • <package>: an object ID.
    • <module> (string)
    • function (string)

Returns

  • Vec<MoveFunctionArgType>: the argument types for the package and function the request provides.

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_getMoveFunctionArgTypes",
"params": [
"0x007efb0f94f1e64d2e8090c619a39299d87ee8070b5f56bb10bafa0e2261d819",
"suifrens",
"mint"
]
}'

Response example

{
"jsonrpc": "2.0",
"result": [
{
"Object": "ByMutableReference"
},
"Pure",
"Pure",
{
"Object": "ByValue"
},
{
"Object": "ByImmutableReference"
},
{
"Object": "ByValue"
},
{
"Object": "ByMutableReference"
}
]
}

sui_getNormalizedMoveFunction

Retrieves a structured representation of Move function.

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):

    • <package>: an object ID.
    • <module_name> (string)
    • function_name (string)

Returns

  • SuiMoveNormalizedFunction:
    • isEntry
    • parameters: Sui Move normalized type.
    • return : Sui Move normalized type.
    • typeParameters : Sui Move ability set.
    • visibility : Sui Move visibility.

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_getNormalizedMoveFunction",
"params": [
"0xb2582f82ab308bf9c96dfb22ec7345db1b5f14fdb2b9538efb160d31842e3a17",
"moduleName",
"functionName"
]
}'

Response example

{
"jsonrpc": "2.0",
"result": {
"visibility": "Public",
"isEntry": false,
"typeParameters": [
{
"abilities": [
"Store",
"Key"
]
}
],
"parameters": [
"U64"
],
"return": [
"U64"
]
}
}

sui_getNormalizedMoveModule

Retrieves a structured representation of Move module.

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):

    • <package>: an object ID.
    • <module_name> (string)

Returns

  • SuiMoveNormalizedModule:
    • address
    • exposedFunctions
    • fileFormatVersion
    • friends: Sui Move module ID.
    • name
    • structs

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_getNormalizedMoveModule",
"params": [
"0x16dc6797cf787c839a07edc03e633842109123618df6438d21a48040e6bb568c",
"module"
]
}'

Response example

{
"jsonrpc": "2.0",
"result": {
"fileFormatVersion": 6,
"address": "0x43cc4c24010dafad05b12619b275649741cc9060d87664c26a3f9a509228c21b",
"name": "module",
"friends": [],
"structs": {},
"exposedFunctions": {}
}
}

sui_getNormalizedMoveModulesByPackage

Retrieves structured representations of all modules in the given package.

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):

    • <package>: an object ID.

Returns

  • BTreeMap<String,SuiMoveNormalizedModule>: structured representations of all the modules for the package in the request.

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_getNormalizedMoveModulesByPackage",
"params": [
"0xece356d10d89e75f565b0934851ba8d5bc59462a46078b90f1f508a1e4fd4eed"
]
}'

Response example

{
"jsonrpc": "2.0",
"result": {
"fileFormatVersion": 6,
"address": "0xafc13246bd847c60448160e0358cac4a11345594d02890c986dbf328d28d21ac",
"name": "module",
"friends": [],
"structs": {},
"exposedFunctions": {}
}
}

sui_getNormalizedMoveStruct

Retrieves a structured representation of Move struct.

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):

    • <package>: an object ID.
    • <module_name> (string): a module name.
    • <struct_name> (string): a struct name.

Returns

  • abilities: Sui Move ability set.
  • fields: Sui Move normalized field.
  • typeParameters: Sui Move struct type parameter

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_getNormalizedMoveStruct",
"params": [
"0x46c25c211cb35c05d801c769b78770474957b37379c527753c5c8ab783f697e7",
"module",
"StructName"
]
}'

Response example

{
"jsonrpc": "2.0",
"result": {
"abilities": {
"abilities": [
"Store",
"Key"
]
},
"typeParameters": [],
"fields": []
}
}

sui_getObject

Retrieves the object information for a specified object.

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):

    • <object_id>: the ID of the queried object.
    • <options> (array of boolean): specifies the object info to show.

Returns

  • <data>: object data.
  • <error>: object response error.

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_getObject",
"params": [
"0x53e4567ccafa5f36ce84c80aa8bc9be64e0d5ae796884274aef3005ae6733809",
{
"showType": true,
"showOwner": true,
"showPreviousTransaction": true,
"showDisplay": false,
"showContent": true,
"showBcs": false,
"showStorageRebate": true
}
]
}'

Response example

{
"jsonrpc": "2.0",
"result": {
"data": {
"objectId": "0x53e4567ccafa5f36ce84c80aa8bc9be64e0d5ae796884274aef3005ae6733809",
"version": "1",
"digest": "33K5ZXJ3RyubvYaHuEnQ1QXmmbhgtrFwp199dnEbL4n7",
"type": "0x2::coin::Coin<0x2::sui::SUI>",
"owner": {
"AddressOwner": "0xc8ec1d5b84dd6289e193b9f88de4a994358c9f856135236c3e75a925e1c77ac3"
},
"previousTransaction": "5PLgmQye6rraDYqpV3npV6H1cUXoJZgJh1dPCyRa3WCv",
"storageRebate": "100",
"content": {
"dataType": "moveObject",
"type": "0x2::coin::Coin<0x2::sui::SUI>",
"hasPublicTransfer": true,
"fields": {
"balance": "100000000",
"id": {
"id": "0x53e4567ccafa5f36ce84c80aa8bc9be64e0d5ae796884274aef3005ae6733809"
}
}
}
}
}
}

sui_getProtocolConfig

Retrieves the protocol config table for the given version number.

If the version number is not specified, If none is specified, the node uses the version of the latest epoch it has processed.

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):

    • <version> (BigInt_for_uint64; optional): protocol version specifier. If omitted, the latest protocol config table for the node will be returned.

Returns

  • ProtocolConfigResponse: the protocol config for the given protocol version. If none is specified, the node uses the version of the latest epoch it has processed.

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_getProtocolConfig",
"params": [
6
]
}'

Response example

{
"jsonrpc": "2.0",
"result": {
"minSupportedProtocolVersion": "1",
"maxSupportedProtocolVersion": "12",
"protocolVersion": "6",
"featureFlags": {
"advance_epoch_start_time_in_safe_mode": true,
"advance_to_highest_supported_protocol_version": false,
"ban_entry_init": false,
"commit_root_state_digest": false,
"consensus_order_end_of_epoch_last": true,
"disable_invariant_violation_check_in_swap_loc": false,
"disallow_adding_abilities_on_upgrade": false,
"disallow_change_struct_type_params_on_upgrade": false,
"loaded_child_objects_fixed": true,
"missing_type_is_compatibility_error": true,
"no_extraneous_module_bytes": false,
"package_digest_hash_module": false,
"package_upgrades": true,
"scoring_decision_with_validity_cutoff": true
},
"attributes": {
}
}
}

sui_getTotalTransactionBlocks

Retrieves the total number of transactions known to the server.

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): none.

Returns

  • BigInt<u64>: total number of transactions on the network.

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_getTotalTransactionBlocks",
"params": []
}'

Response example

{
"jsonrpc": "2.0",
"result": "2451485"
}

sui_getTransactionBlock

Retrieves the transaction response object.

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):

    • <digest>: the digest of the queried transaction.
    • <options>: options for specifying the content to be returned.

Returns

  • <SuiTransactionBlockResponse>: the transaction response object for specified transaction digest.

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_getTransactionBlock",
"params": [
"oKtFZjL99EZ2K3TLPRarpZN8gz9xReMkiNf4Tjja2no",
{
"showInput": true,
"showRawInput": false,
"showEffects": true,
"showEvents": true,
"showObjectChanges": false,
"showBalanceChanges": false
}
]
}'

Response example

{
"jsonrpc": "2.0",
"result": {
"digest": "oKtFZjL99EZ2K3TLPRarpZN8gz9xReMkiNf4Tjja2no",
"transaction": {
"data": {
"messageVersion": "v1",
"transaction": {
"kind": "ProgrammableTransaction",
"inputs": [
{
"type": "pure",
"valueType": "address",
"value": "0x8196d048b7a6d04c8edc89579d86fd3fc90c52f9a14c6b812b94fe613c5bcebb"
},
{
"type": "object",
"objectType": "immOrOwnedObject",
"objectId": "0x5eeb1d449e2516166d57d71fdeb154d0dc9ecdb7b30057d0a932684cac352cdc",
"version": "2",
"digest": "GK4NxEKSrK88XkPNeuBqtJYPmU9yMTWMD7K9TdU4ybKN"
}
],
"transactions": [
{
"TransferObjects": [
[
{
"Input": 1
}
],
{
"Input": 0
}
]
}
]
},
"sender": "0x82179c57d5895babfb655cd62e8e886a53334b5e7be9be658eb759cc35e3fc66",
"gasData": {
"payment": [
{
"objectId": "0x1a3e898029d024eec1d44c6af5e2facded84d03b5373514f16e3d66e00081051",
"version": 2,
"digest": "7nDZ5J4VyvYGUbX2f6mQdhkr3RFrb3vZqui1ogoyApD9"
}
],
"owner": "0x82179c57d5895babfb655cd62e8e886a53334b5e7be9be658eb759cc35e3fc66",
"price": "10",
"budget": "20000000"
}
},
"txSignatures": [
"ABTTP4JUSxqOQTlysdS30HzkMc3DOwJqlBJstqn2EwW0SKtvoGIoxFEbmTqIS+UYSemveVGJ+S6BijQQVS97cwxtCxWrqsEEHAdxoMDwblU5hyWJ8H3zFvk20E2fO5bzHA=="
]
},
"rawTransaction": "AQAAAAAAAgAggZbQSLem0EyO3IlXnYb9P8kMUvmhTGuBK5T+YTxbzrsBAF7rHUSeJRYWbVfXH96xVNDcns23swBX0KkyaEysNSzcAgAAAAAAAAAg43+UGkUe+CCaD7+/G1SbK7Jrjq7giJUUbfJ7w88mEMEBAQEBAQABAACCF5xX1Ylbq/tlXNYujohqUzNLXnvpvmWOt1nMNeP8ZgEaPomAKdAk7sHUTGr14vrN7YTQO1NzUU8W49ZuAAgQUQIAAAAAAAAAIGS7c6HtWLLBiwy/N3eS4gbmuA1NXupk4ucFY7FYkCbEghecV9WJW6v7ZVzWLo6IalMzS1576b5ljrdZzDXj/GYKAAAAAAAAAAAtMQEAAAAAAAFhABTTP4JUSxqOQTlysdS30HzkMc3DOwJqlBJstqn2EwW0SKtvoGIoxFEbmTqIS+UYSemveVGJ+S6BijQQVS97cwxtCxWrqsEEHAdxoMDwblU5hyWJ8H3zFvk20E2fO5bzHA==",
"effects": {
"messageVersion": "v1",
"status": {
"status": "success"
},
"executedEpoch": "0",
"gasUsed": {
"computationCost": "100",
"storageCost": "100",
"storageRebate": "10",
"nonRefundableStorageFee": "0"
},
"transactionDigest": "6AyFnAuKAKCqm1cD94EyGzBqJCDDJ716ojjmsKF2rqoi",
"mutated": [
{
"owner": {
"AddressOwner": "0x82179c57d5895babfb655cd62e8e886a53334b5e7be9be658eb759cc35e3fc66"
},
"reference": {
"objectId": "0x1a3e898029d024eec1d44c6af5e2facded84d03b5373514f16e3d66e00081051",
"version": 2,
"digest": "7nDZ5J4VyvYGUbX2f6mQdhkr3RFrb3vZqui1ogoyApD9"
}
},
{
"owner": {
"AddressOwner": "0x8196d048b7a6d04c8edc89579d86fd3fc90c52f9a14c6b812b94fe613c5bcebb"
},
"reference": {
"objectId": "0x5eeb1d449e2516166d57d71fdeb154d0dc9ecdb7b30057d0a932684cac352cdc",
"version": 2,
"digest": "GK4NxEKSrK88XkPNeuBqtJYPmU9yMTWMD7K9TdU4ybKN"
}
}
],
"gasObject": {
"owner": {
"ObjectOwner": "0x82179c57d5895babfb655cd62e8e886a53334b5e7be9be658eb759cc35e3fc66"
},
"reference": {
"objectId": "0x1a3e898029d024eec1d44c6af5e2facded84d03b5373514f16e3d66e00081051",
"version": 2,
"digest": "7nDZ5J4VyvYGUbX2f6mQdhkr3RFrb3vZqui1ogoyApD9"
}
},
"eventsDigest": "9BQobwxQvJ1JxSXNn8v8htZPTu8FEzJJGgcD4kgLUuMd"
},
"objectChanges": [
{
"type": "transferred",
"sender": "0x82179c57d5895babfb655cd62e8e886a53334b5e7be9be658eb759cc35e3fc66",
"recipient": {
"AddressOwner": "0x8196d048b7a6d04c8edc89579d86fd3fc90c52f9a14c6b812b94fe613c5bcebb"
},
"objectType": "0x2::example::Object",
"objectId": "0x5eeb1d449e2516166d57d71fdeb154d0dc9ecdb7b30057d0a932684cac352cdc",
"version": "2",
"digest": "64UQ3a7m1mjWuzgyGoH8RnMyPGDN4XYTC9dS4qiSfdK4"
}
]
}
}

sui_multiGetObjects

Retrieves the object data for a list of objects.

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):

    • <object_ids>: the IDs of the queried objects.
    • <options>: options for specifying the content to be returned.

Returns

  • Vec<SuiObjectResponse>: Sui object response.

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_multiGetObjects",
"params": [
[
"0xb61439368cd75ebe63d633af32ffb4a022d18b95b4eaa9fd3b22b43f6b2c8e92",
"0x6ea7bed8f6c3d80f2a595c2305e12dd6d07c3fbbd3ebef7dbcc7b02346cdf056",
"0x75da5e934f672d3da3e003d989075efaecc79b5cd5df0df2a168259b7115a41c",
"0x38554a9ff7b4f6b59f9426c321c8013afed093481dd4ef1267c67a8e9a0d074f",
"0xe74d1b250d5df2cb5170782a8a438fbf681eded4d1e0a2cd7dfb27e784493fb1"
],
{
"showType": true,
"showOwner": true,
"showPreviousTransaction": true,
"showDisplay": false,
"showContent": true,
"showBcs": false,
"showStorageRebate": true
}
]
}'

Response example

{
"jsonrpc": "2.0",
"result": [
{
"data": {
"objectId": "0xb61439368cd75ebe63d633af32ffb4a022d18b95b4eaa9fd3b22b43f6b2c8e92",
"version": "1",
"digest": "6D2MGzZN1DnALrbg6y9nQWwuipCa6fJERLXAwNGuGtKQ",
"type": "0x2::coin::Coin<0x2::sui::SUI>",
"owner": {
"AddressOwner": "0x090bd6d16522a6fd4fa83ec70a5f197ad656da104dde1de9880be827a1a753e5"
},
"previousTransaction": "CQN1aMpZRYrVHByFfPFceCXzv5kT7bNM4Uzoe2jbZvM",
"storageRebate": "100",
"content": {
"dataType": "moveObject",
"type": "0x2::coin::Coin<0x2::sui::SUI>",
"hasPublicTransfer": true,
"fields": {
"balance": "100000000",
"id": {
"id": "0xb61439368cd75ebe63d633af32ffb4a022d18b95b4eaa9fd3b22b43f6b2c8e92"
}
}
}
}
}
]
}