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. -
sinceUnitID
(string) - Optional Hex encoded unit identifier. If provided, the method will return units starting from the one after this ID. -
limit
(number) - Optional number specifying the maximum number of units to return.params: [
16,
"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_getUnits",
"params": []
}'
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": [
"0x000000000000000000000000000000000000000000000000000000000000001101",
"0x000000000000000000000000000000000000000000000000000000000000001301",
"0x000000000000000000000000000000000000000000000000000000000000001201"
]
}