StateService.ListOwnedObjects
List owned objects through sui.rpc.v2.StateService/ListOwnedObjects on Inodra's Sui gRPC endpoint.
Endpoint
| Network | Host | Authentication |
|---|---|---|
| Mainnet | mainnet-grpc.inodra.com:443 | x-api-key metadata |
| Testnet | testnet-grpc.inodra.com:443 | x-api-key metadata |
Full method name: sui.rpc.v2.StateService/ListOwnedObjects. Unary: one request, one response. Get a key from the dashboard; the same key works on every protocol.
Request: ListOwnedObjectsRequest
| Field | Type | Description |
|---|---|---|
owner | string | Required. The address of the account that owns the objects. |
page_size | uint32 | The maximum number of entries return. The service may return fewer than this value. If unspecified, at most 50 entries will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
page_token | bytes | A page token, received from a previous ListOwnedObjects call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListOwnedObjects must match the call that provided the page token. |
read_mask | google.protobuf.FieldMask | Mask specifying which fields to read. If no mask is specified, defaults to object_id,version,object_type. |
object_type | string | Optional type filter to limit the types of objects listed. Providing an object type with no type params will return objects of that type with any type parameter, e.g. 0x2::coin::Coin will return all Coin<T> objects regardless of the type parameter T. Providing a type with a type param will restrict the returned objects to only those objects that match the provided type parameters, e.g. 0x2::coin::Coin<0x2::sui::SUI> will only return Coin<SUI> objects. |
Response: ListOwnedObjectsResponse
| Field | Type | Description |
|---|---|---|
objects | repeated Object | Page of dynamic fields owned by the specified parent. |
next_page_token | bytes | A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages. |
Object
An object on the Sui blockchain.
| Field | Type | Description |
|---|---|---|
bcs | Bcs | This Object serialized as BCS. |
object_id | string | ObjectId for this object. |
version | uint64 | Version of the object. |
digest | string | The digest of this Object. |
owner | Owner | Owner of the object. |
object_type | string | The type of this object. This will be 'package' for packages and a StructTag for move structs. |
has_public_transfer | bool | DEPRECATED this field is no longer used to determine whether a tx can transfer this object. Instead, it is always calculated from the objects type when loaded in execution. Only set for Move structs |
contents | Bcs | BCS bytes of a Move struct value. Only set for Move structs |
package | Package | Package information for Move Packages |
previous_transaction | string | The digest of the transaction that created or last mutated this object |
storage_rebate | uint64 | The amount of SUI to rebate if this object gets deleted. This number is re-calculated each time the object is mutated based on the present storage gas price. |
json | google.protobuf.Value | JSON rendering of the object. |
balance | uint64 | Current balance if this object is a 0x2::coin::Coin<T> |
display | Display | JSON rendering of the object based on an on-chain template. This will not be set if the value's type does not have an associated Display template. |
grpcurl
grpcurl -H "x-api-key: YOUR_API_KEY" \
-d '{
"owner": "0x0000000000000000000000000000000000000000000000000000000000000002",
"page_size": 20,
"read_mask": {
"paths": [
"object_id",
"version",
"object_type"
]
}
}' \
mainnet-grpc.inodra.com:443 \
sui.rpc.v2.StateService/ListOwnedObjectsServer reflection is enabled, so no proto files are needed for grpcurl. Field masks are written as {"paths": [...]}.
TypeScript
import { GrpcWebFetchTransport, SuiGrpcClient } from '@mysten/sui/grpc'
const transport = new GrpcWebFetchTransport({
baseUrl: 'https://mainnet-grpc.inodra.com',
meta: { 'x-api-key': process.env.INODRA_API_KEY! }
})
const client = new SuiGrpcClient({ network: 'mainnet', transport })
const { objects, cursor } = await client.listOwnedObjects({
owner: '0x0000000000000000000000000000000000000000000000000000000000000002',
limit: 20
})
console.log(objects, cursor)Uses the typed SuiGrpcClient method from @mysten/sui v2 that calls this RPC. Install with npm install @mysten/sui and set INODRA_API_KEY. The gRPC gateway guide covers native gRPC transport for backends.
Credits
1 credit per item actually returned; an empty page bills the 1-credit minimum. See credits and billing for the full table.
JSON-RPC equivalent
Replaces suix_getOwnedObjects and suix_getCoins and suix_getAllCoins. The JSON-RPC to gRPC migration guide has before and after code for the common calls.