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.

  2. sinceUnitID (string) - Optional Hex encoded unit identifier. If provided, the method will return units starting from the one after this ID.

  3. limit (number) - Optional number specifying the maximum number of units to return.

    params: [
    "0xf52022bb450407d92f13bf1c53128a676bcf304818e9f41a5ef4ebeae9c0d6b0",
    "0x0955CF2CDB1F9687F4B9BCCCC07A4809B8DC1DD0DF7B0D674795B28C5830510E01",
    100
    ]

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"
]
}