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/4)

API reference for Sui. All methods ->

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

Methods supported​

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": [
"0x2",
"coin",
"value"
]
}'

Response example​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"visibility": "Public",
"isEntry": false,
"typeParameters": [
{
"abilities": []
}
],
"parameters": [
{
"Reference": {
"Struct": {
"address": "0x0000000000000000000000000000000000000000000000000000000000000002",
"module": "coin",
"name": "Coin",
"typeArguments": [
{
"TypeParameter": 0
}
]
}
}
}
],
"return": [
"U64"
]
}
}

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> (object): flags that specify which object fields 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": [
"0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a",
{
"showType": true,
"showOwner": true,
"showPreviousTransaction": true,
"showDisplay": false,
"showContent": true,
"showBcs": false,
"showStorageRebate": true
}
]
}'

Response example​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": {
"objectId": "0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a",
"version": "877862839",
"digest": "EsLdoYtriKHEzNKqAcHxFG3WyZHybzmAzHiHwSHDMYWk",
"type": "0x2::coin_registry::Currency<0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC>",
"owner": {
"Shared": {
"initial_shared_version": 648066630
}
},
"previousTransaction": "bUHzY3AxSUrFhggxBYj9RUf3C3pa3nE1evWjQu9bTvA",
"storageRebate": "3648000",
"content": {
"dataType": "moveObject",
"type": "0x2::coin_registry::Currency<0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC>",
"hasPublicTransfer": false,
"fields": {
"decimals": 6,
"description": "USDC is a US dollar-backed stablecoin issued by Circle. USDC is designed to provide a faster, safer, and more efficient way to send, spend, and exchange money around the world.",
"extra_fields": {
"type": "0x2::vec_map::VecMap<0x1::string::String, 0x2::coin_registry::ExtraField>",
"fields": {
"contents": []
}
},
"icon_url": "https://circle.com/usdc-icon",
"id": {
"id": "0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a"
},
"metadata_cap_id": {
"type": "0x2::coin_registry::MetadataCapState",
"variant": "Unclaimed",
"fields": {}
},
"name": "USDC",
"regulated": {
"type": "0x2::coin_registry::RegulatedState",
"variant": "Regulated",
"fields": {
"allow_global_pause": null,
"cap": "0x699b31629c5afb1898ff72105ac323e6904c356587d607b086cdd7e883380ffe",
"variant": 0
}
},
"supply": {
"type": "0x2::coin_registry::SupplyState<0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC>",
"variant": "Unknown",
"fields": {}
},
"symbol": "USDC",
"treasury_cap_id": null
}
}
}
}
}

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",
"id": 1,
"result": {
"minSupportedProtocolVersion": "1",
"maxSupportedProtocolVersion": "139",
"protocolVersion": "6",
"featureFlags": {
"abstract_size_in_object_runtime": false,
"accept_passkey_in_multisig": false,
"accept_zklogin_in_multisig": false,
"additional_borrow_checks": false,
"additional_consensus_digest_indirect_state": false,
"additional_multisig_checks": false,
"address_aliases": false,
"address_balance_gas_check_rgp_at_signing": false
},
"attributes": {
"accumulator_object_storage_cost": null,
"address_from_bytes_cost_base": {
"u64": "52"
},
"address_from_u256_cost_base": {
"u64": "52"
},
"address_to_u256_cost_base": {
"u64": "52"
},
"allowed_txn_cost_overage_burst_per_object_in_commit": null,
"base_tx_cost_fixed": {
"u64": "2000"
},
"base_tx_cost_per_byte": {
"u64": "0"
},
"bcs_failure_cost": null
},
"configs": {
"abstract_size_in_object_runtime": false,
"accept_passkey_in_multisig": false,
"accept_zklogin_in_multisig": false,
"additional_borrow_checks": false,
"additional_consensus_digest_indirect_state": false,
"additional_multisig_checks": false,
"address_aliases": false,
"address_balance_gas_check_rgp_at_signing": false
}
}
}

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

Response example​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"digest": "jaBYC1XVXR7TVhA2YvapQ34fjNw2Jyuba8C8VVA533s",
"transaction": {
"data": {
"messageVersion": "v1",
"transaction": {
"kind": "ProgrammableTransaction",
"inputs": [
{
"type": "pure",
"valueType": "u64",
"value": "26314406379282"
},
{
"type": "pure",
"valueType": "address",
"value": "0x1cffd38e00d38023c8ecde44a4e5b541bd2b157648e6a299f4ab5d4687d42935"
},
{
"type": "object",
"objectType": "sharedObject",
"objectId": "0x0000000000000000000000000000000000000000000000000000000000000005",
"initialSharedVersion": "1",
"mutable": true
}
],
"transactions": [
{
"SplitCoins": [
"GasCoin",
[
{
"Input": 0
}
]
]
},
{
"MoveCall": {
"package": "0x0000000000000000000000000000000000000000000000000000000000000003",
"module": "sui_system",
"function": "request_add_stake",
"arguments": [
{
"Input": 2
},
{
"Result": 0
},
{
"Input": 1
}
]
}
}
]
},
"sender": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26",
"gasData": {
"payment": [
{
"objectId": "0x4da1e109117bd649ca431d91f11632ea84e577ed53c23ab2f8ab1e80aeb37887",
"version": 1061859825,
"digest": "Cq8PU5p7nEc6WGhVyRzB8YwTHz7iv2rnsQY8R5TAdjYs"
},
{
"objectId": "0x6b08ff404cd8855bb4b816fde4f8a271125080375abecacc7c54237148cf3e27",
"version": 1061695977,
"digest": "FpQT74mGxd6Y4xCA5jQUDpVjetqnnTRqNawgDDLxk8AY"
},
{
"objectId": "0xc8a7e744ab6e2b6d0743fc25d77e99b55d56cc5a54da92df24fa086b0df48f76",
"version": 1036220756,
"digest": "2exx5q69gtoPFgbZGA8tqfgUMrdXBXabBSC37NLzZ5ZV"
}
],
"owner": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26",
"price": "200",
"budget": "1882729"
}
},
"txSignatures": [
"AHSWeOEj2BWI46KU5/EZfgdQ+3Q2cs1V8pcA0rdIHDowLd4YnRKxiri9W4dm8gitU6+WeMj3Jd5XC8OWfZhABgJV/BxrFoB0zkEv7dw2OiEjP8M6c+9jlIQ503Tnn245cQ=="
]
},
"effects": {
"messageVersion": "v1",
"status": {
"status": "success"
},
"executedEpoch": "1292",
"gasUsed": {
"computationCost": "200000",
"storageCost": "909568000",
"storageRebate": "910160975",
"nonRefundableStorageFee": "91025"
},
"modifiedAtVersions": [
{
"objectId": "0x0000000000000000000000000000000000000000000000000000000000000005",
"sequenceNumber": "1062199344"
},
{
"objectId": "0x4da1e109117bd649ca431d91f11632ea84e577ed53c23ab2f8ab1e80aeb37887",
"sequenceNumber": "1061859825"
},
{
"objectId": "0x5b890eaf2abcfa2ab90b77b8e6f3d5d8609586c3e583baf3dccd5af17edf48d1",
"sequenceNumber": "1062199344"
},
{
"objectId": "0x6b08ff404cd8855bb4b816fde4f8a271125080375abecacc7c54237148cf3e27",
"sequenceNumber": "1061695977"
},
{
"objectId": "0xc8a7e744ab6e2b6d0743fc25d77e99b55d56cc5a54da92df24fa086b0df48f76",
"sequenceNumber": "1036220756"
}
],
"sharedObjects": [
{
"objectId": "0x0000000000000000000000000000000000000000000000000000000000000005",
"version": 1062199344,
"digest": "YRgNBSQmUPVSsuQycRn1bZBy7ViKd9U5gYgy1Sz83NT"
}
],
"transactionDigest": "jaBYC1XVXR7TVhA2YvapQ34fjNw2Jyuba8C8VVA533s",
"created": [
{
"owner": {
"AddressOwner": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26"
},
"reference": {
"objectId": "0x4980ca647e7045185ae38ecca064fb98c26d502dd730eec5d937f365b54f2561",
"version": 1062199345,
"digest": "FD2cGLALujiNcy6wbM8xiLMEjU2e2EtUGMDrCHexsJbx"
}
}
],
"mutated": [
{
"owner": {
"Shared": {
"initial_shared_version": 1
}
},
"reference": {
"objectId": "0x0000000000000000000000000000000000000000000000000000000000000005",
"version": 1062199345,
"digest": "AtZGWsux9jkwUfcHL2vkkgCTXc4JYLzrGXxa34e74BEz"
}
},
{
"owner": {
"AddressOwner": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26"
},
"reference": {
"objectId": "0x4da1e109117bd649ca431d91f11632ea84e577ed53c23ab2f8ab1e80aeb37887",
"version": 1062199345,
"digest": "4fg9Zph1VcoDDup9MuNUKMVYK4iWYSpckB4NqvXh6veB"
}
},
{
"owner": {
"ObjectOwner": "0x0000000000000000000000000000000000000000000000000000000000000005"
},
"reference": {
"objectId": "0x5b890eaf2abcfa2ab90b77b8e6f3d5d8609586c3e583baf3dccd5af17edf48d1",
"version": 1062199345,
"digest": "3Y6qX9mk9KnZaCPSLfwWTyyGjaA5xz9T8cAv2XMUfzBq"
}
}
],
"deleted": [
{
"objectId": "0x6b08ff404cd8855bb4b816fde4f8a271125080375abecacc7c54237148cf3e27",
"version": 1062199345,
"digest": "7gyGAp71YXQRoxmFBaHxofQXAipvgHyBKPyxmdSJxyvz"
},
{
"objectId": "0xc8a7e744ab6e2b6d0743fc25d77e99b55d56cc5a54da92df24fa086b0df48f76",
"version": 1062199345,
"digest": "7gyGAp71YXQRoxmFBaHxofQXAipvgHyBKPyxmdSJxyvz"
}
],
"gasObject": {
"owner": {
"AddressOwner": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26"
},
"reference": {
"objectId": "0x4da1e109117bd649ca431d91f11632ea84e577ed53c23ab2f8ab1e80aeb37887",
"version": 1062199345,
"digest": "4fg9Zph1VcoDDup9MuNUKMVYK4iWYSpckB4NqvXh6veB"
}
},
"eventsDigest": "HN5X8Gbu9UsbUgu7REwbNxKTviRQjx7QgnDKkKr8SQRy",
"dependencies": [
"4QzLZEfrc5LXT2iA7z8mDFhSJHVyaZ8yecf4FBN5L27S",
"6ed5G9fiVgvDWhYEdpjFzkTBEXDvaPJcqrmzZC4itDMA",
"AsqjfPDf7KbBdVrr8zQXayPtKaf1gUhDmFtxfNjtEZka",
"GRELVAQAQdBr3RCKFRUdtKb9eVfVx1Y2FnAJ1UMXK9EW",
"GSnefqtHJEtbP648gjjTZRTeBs18vVxBW6k67yJqwCSs"
]
},
"events": [
{
"id": {
"txDigest": "jaBYC1XVXR7TVhA2YvapQ34fjNw2Jyuba8C8VVA533s",
"eventSeq": "0"
},
"packageId": "0x0000000000000000000000000000000000000000000000000000000000000003",
"transactionModule": "sui_system",
"sender": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26",
"type": "0x3::validator::StakingRequestEvent",
"parsedJson": {
"amount": "26314406379282",
"epoch": "1292",
"pool_id": "0x835cf40f2a04615d16cf03cc1d19480b96f1055df2fa122959baa57d206663ec",
"staker_address": "0x30430471882ea79bd2153df98b455c6b62a6acf76642a17649665266eddb9a26",
"validator_address": "0x1cffd38e00d38023c8ecde44a4e5b541bd2b157648e6a299f4ab5d4687d42935"
},
"bcsEncoding": "base64",
"bcs": "g1z0DyoEYV0WzwPMHRlIC5bxBV3y+hIpWbqlfSBmY+wc/9OOANOAI8js3kSk5bVBvSsVdkjmopn0q11Gh9QpNTBDBHGILqeb0hU9+YtFXGtipqz3ZkKhdklmUmbt25omDAUAAAAAAAASP9jM7hcAAA==",
"timestampMs": "1793024222131"
}
],
"timestampMs": "1793024222131",
"checkpoint": "338351849"
}
}

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

Response example​

{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"data": {
"objectId": "0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a",
"version": "877862839",
"digest": "EsLdoYtriKHEzNKqAcHxFG3WyZHybzmAzHiHwSHDMYWk",
"type": "0x2::coin_registry::Currency<0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC>",
"owner": {
"Shared": {
"initial_shared_version": 648066630
}
},
"previousTransaction": "bUHzY3AxSUrFhggxBYj9RUf3C3pa3nE1evWjQu9bTvA",
"storageRebate": "3648000",
"content": {
"dataType": "moveObject",
"type": "0x2::coin_registry::Currency<0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC>",
"hasPublicTransfer": false,
"fields": {
"decimals": 6,
"description": "USDC is a US dollar-backed stablecoin issued by Circle. USDC is designed to provide a faster, safer, and more efficient way to send, spend, and exchange money around the world.",
"extra_fields": {
"type": "0x2::vec_map::VecMap<0x1::string::String, 0x2::coin_registry::ExtraField>",
"fields": {
"contents": []
}
},
"icon_url": "https://circle.com/usdc-icon",
"id": {
"id": "0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a"
},
"metadata_cap_id": {
"type": "0x2::coin_registry::MetadataCapState",
"variant": "Unclaimed",
"fields": {}
},
"name": "USDC",
"regulated": {
"type": "0x2::coin_registry::RegulatedState",
"variant": "Regulated",
"fields": {
"allow_global_pause": null,
"cap": "0x699b31629c5afb1898ff72105ac323e6904c356587d607b086cdd7e883380ffe",
"variant": 0
}
},
"supply": {
"type": "0x2::coin_registry::SupplyState<0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC>",
"variant": "Unknown",
"fields": {}
},
"symbol": "USDC",
"treasury_cap_id": null
}
}
}
},
{
"data": {
"objectId": "0x7b073091241e64725b7a8b2bed3f37bc8f549d41b5408a783aa00bd1cb49cc1c",
"version": "952132138",
"digest": "22FgbKATz1Vsx4CALemNuD3zv1dTVXoJoxoMMzodmXu6",
"type": "0x2::dynamic_field::Field<u64, 0x3::staking_pool::PoolTokenExchangeRate>",
"owner": {
"ObjectOwner": "0xe442ab05c4060ff179b7dc9bc60bc05324befd384ab10a87a5138e6477b2d5da"
},
"previousTransaction": "3kxeUe1YNKRcHQd46b49ZVocqWm9bUZSjwxbx2e2tkds",
"storageRebate": "0",
"content": {
"dataType": "moveObject",
"type": "0x2::dynamic_field::Field<u64, 0x3::staking_pool::PoolTokenExchangeRate>",
"hasPublicTransfer": false,
"fields": {
"id": {
"id": "0x7b073091241e64725b7a8b2bed3f37bc8f549d41b5408a783aa00bd1cb49cc1c"
},
"name": "1200",
"value": {
"type": "0x3::staking_pool::PoolTokenExchangeRate",
"fields": {
"pool_token_amount": "27371146201545824",
"sui_amount": "27415649547761097"
}
}
}
}
}
}
]
}