get_random_outputs - Bitcoin Cash
Example code for the get_random_outputs json-rpc method. Сomplete guide on how to use get_random_outputs json-rpc in GetBlock.io Web3 documentation.
Parameters
amounts - array of uint64
Amounts in Atomic Units in an Array.
output_count - uint32
Number of outputs to show for each specified amount in amounts.
confirmed_height_or_depth - int32
Optional.
Positive values are read as height, negative values are read as depth*, 0 is genesis block. Mix-ins will be selected from the [0..confirmed_height_or_depth] window.
* Depth is calculated from the tip block. Different nodes may have different tip numbers depending on blockchain sync status.
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/'
--header 'Content-Type: application/json'
--data-raw '{"jsonrpc": "2.0",
"method": "get_random_outputs",
"params": {"amounts": [100, 200], "output_count": 2, "confirmed_height_or_depth": -1},
"id": "getblock.io"}'Response
Last updated
Was this helpful?