GetObject - Sui

GetObject. Returns an object by id, at the latest or a specific version.

GetObject - sui [Value: 20CU]
Returns an object by its id, at the latest version or at a specific version.
gRPC: sui.rpc.v2.LedgerService/GetObject
Use cases

Use cases

  • Read on-chain object state
  • Fetch a historical object version
  • Inspect object owner and type
Constraints

Constraints

  • Object id is required
  • Default mask returns id, version, digest
  • Old versions may be pruned
Get started
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
grpcurl \
  -H "x-drpc-key: {API-KEY}" \
  -H "x-drpc-chain: sui" \
  -d '{
  "object_id": "0x6",
  "read_mask": "objectId,version,digest,owner,objectType,json"
}' \
  grpc.drpc.live:443 \
  sui.rpc.v2.LedgerService/GetObject
Copy
Response
200
{
  "object": {
    "object_id": "0x0000000000000000000000000000000000000000000000000000000000000006",
    "version": "748392015",
    "digest": "9fK3mP7qR2sT5vW8xY1zA4bC6dE9gH2jL5nQ8rU3wX6y",
    "owner": {
      "kind": "SHARED",
      "version": "1"
    },
    "object_type": "0x2::clock::Clock",
    "json": {
      "id": "0x0000000000000000000000000000000000000000000000000000000000000006",
      "timestamp_ms": "1775050511019"
    }
  }
}
Copy

Request params

Parametersobject
object
object_idstring
Required. The id of the requested object.
versionstring
Optional. A specific version of the object. If omitted, the latest version of a live object is returned.
read_maskstring
Optional. google.protobuf.FieldMask with the fields to return, as comma-separated paths. Defaults to `object_id,version,digest`. Use `*` to return all fields.

Response

200
Returns an object by its id, at the latest version or at a specific version.

Response params

object
objectobject
The requested object. Only fields included in `read_mask` are populated.
object
object_idstring
The object id.
versionstring
Version of the object.
digeststring
Digest of the object.
ownerobject
Owner of the object.
object
kindstring
Ownership kind: `ADDRESS`, `OBJECT`, `SHARED`, `IMMUTABLE` or `CONSENSUS_ADDRESS`.
addressstring
Owning address or object id (for `ADDRESS`, `OBJECT` and `CONSENSUS_ADDRESS` kinds).
versionstring
Initial shared version (for `SHARED`) or start version (for `CONSENSUS_ADDRESS`).
object_typestring
Type of the object: a StructTag for Move structs, or `package` for packages.
has_public_transferboolean
Deprecated. Only set for Move structs.
contentsobject
BCS bytes of the Move struct value (`name`, `value`). Only set for Move structs.
packageobject
Package information, for Move packages.
previous_transactionstring
Digest of the transaction that created or last mutated this object.
storage_rebatestring
Amount of SUI rebated if this object is deleted. Recalculated each time the object is mutated.
jsonobject
JSON rendering of the object.
balancestring
Current balance, if the object is a `0x2::coin::Coin<T>`.
displayobject
JSON rendering based on the type's on-chain `Display` template. Not set if the type has no template.
bcsobject
The object serialized as BCS (`name`, `value`).