state_getUnits
Returns list of unit identifiers, optionally filtered by unit type identifier. This RPC function is disabled by default and must be explicitly enabled on the node.
Parameters
-
unitTypeId
(number) - Optional unit type identifier. The identifier values are partition-specific. For example, identifier "1" is a bill type identifier on money partition but a fungible token type identifier on tokens partition. Values 16-31 are reserved for common unit types supported across all transaction systems; for example, "16" identifies fee credit records across all partitions.params: [
16
]
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_getUnits",
"params": []
}'
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": [
"0x000000000000000000000000000000000000000000000000000000000000001101",
"0x000000000000000000000000000000000000000000000000000000000000001301",
"0x000000000000000000000000000000000000000000000000000000000000001201"
]
}