Skip to main content
Version: main branch

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: [
    "0x000000000000000000000000000000000000000000000000000000000000000101",
    false
    ]

Returns

  • unit (object):

    • unitId (string) - Hex encoded unit identifier.
    • data (object) - Unit data depending on the unit type.
    • 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": [
"0x000000000000000000000000000000000000000000000000000000000000000101",
false
]
}'

Response

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"networkId": 3,
"partitionId": 1,
"unitId": "0x000000000000000000000000000000000000000000000000000000000000000101",
"data": {
"value": "1000000000000000000",
"ownerPredicate": "0x83004101f6",
"locked": "0",
"counter": "0"
}
}
}