Skip to content

sui_getObject ​

Read API

Return the object information for a specified object

Parameters ​

  • object_id · ObjectID · requiredthe ID of the queried object

  • options · ObjectDataOptions · optionaloptions for specifying the content to be returned

    • showBcs · boolean · optionalWhether to show the content in BCS format. Default to be False
    • showContent · boolean · optionalWhether to show the content(i.e., package content or Move struct content) of the object. Default to be False
    • showDisplay · boolean · optionalWhether to show the Display metadata of the object for frontend rendering. Default to be False
    • showOwner · boolean · optionalWhether to show the owner of the object. Default to be False
    • showPreviousTransaction · boolean · optionalWhether to show the previous transaction digest of the object. Default to be False
    • showStorageRebate · boolean · optionalWhether to show the storage rebate of the object. Default to be False
    • showType · boolean · optionalWhether to show the type of the object. Default to be False

Result ​

Example ​

Request ​

bash
curl https://mainnet-api.inodra.com/v1/jsonrpc \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -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 ​

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "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"
          }
        }
      }
    }
  }
}

The full-stack Sui data layer.