Skip to main content
Version: main branch

state_getUnitsByOwnerID

Returns unit identifiers by owner identifier. Owner identifier is derived from the owner predicate of the unit. Currently only SHA256 hash of the public key is used as the owner identifier.

Parameters

  1. ownerId (string) - Hex encoded owner identifier.

    params: [
    "0xf52022bb450407d92f13bf1c53128a676bcf304818e9f41a5ef4ebeae9c0d6b0"
    ]

Returns

  • unitIds (array of string) - Hex encoded unit identifiers.

Example

Request

curl http://127.0.0.1:26866/rpc \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "state_getUnitsByOwnerID",
"params": [
"0xf52022bb450407d92f13bf1c53128a676bcf304818e9f41a5ef4ebeae9c0d6b0"
]
}'

Response

{
"jsonrpc": "2.0",
"id": 1,
"result": [
"0x000000000000000000000000000000000000000000000000000000000000001101",
"0x000000000000000000000000000000000000000000000000000000000000001301",
"0x000000000000000000000000000000000000000000000000000000000000001201"
]
}