Skip to main content

state_getUnit

Returns the unit data, optionally including the state proof.

Parameters

  1. unitId (string) - Hex encoded unit identifier.
  2. includeStateProof (boolean) - If true, the response will also include the state proof.
params: [
"0x000000000000000000000000000000000000000000000000000000000000000100",
false
]

Returns

  • unit (object):

    • unitId (string) - Hex encoded unit identifier.
    • data (object) - Unit data depending on the unit type.
    • ownerPredicate (string) - Hex encoded owner predicate of the unit.
    • stateProof (object stateProof) - A proof of the state (contents of data and ownerPredicate) of the unit in the latest round.

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_getUnit",
"params": [
"0x000000000000000000000000000000000000000000000000000000000000000100",
false
]
}'

Response

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"unitId": "0x000000000000000000000000000000000000000000000000000000000000000100",
"data": {
"value": "1000000000000000000",
"lastUpdate": "0",
"backlink": "",
"locked": "0"
},
"ownerPredicate": "0x83004101f6"
}
}