⚡ We welcome businesses to test our enterprise-grade service

bcn
Bytecoin (BCN)

Method: POST get_random_outputs

dropdown

方法 RPC get_random_outputs 例如 Bytecoin (BCN)

POST get_random_outputs

相对于指定的确认_height_or_depth,获取随机输出的必要数量(output_count)。

如果区块链缺乏足够的,响应的输出可能比要求的量少。

Parameters

amounts - UINT64的数组

阵列中的原子单元的量。

output_count - 享受

每个指定金额显示的输出数量。

confirmed_height_or_depth - 享受

选修的。

正值读为高度,负值读为深度*,0是创世纪块。 将从[0..confirmed_height_or_depth]窗口中选择Mix-ins。

*深度是从尖端块中计算出来的。 不同的节点可能具有不同的提示数,具体取决于区块链同步状态。

Request

curl --location --request POST 'https://bcn.getblock.io/mainnet/' \
--header 'x-api-key: YOUR-API-KEY' \
--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

{
    "id": "getblock.io",
    "jsonrpc": "2.0",
    "result": {
        "outputs": {
            "100": [
                {
                    "amount": 100,
                    "global_index": 63491465,
                    "height": 2400148,
                    "public_key": "11e1c823ce6e0c6aecca65917353db4988b53f91f3888ebb84c729927d929e3d",
                    "stack_index": 18560,
                    "unlock_block_or_timestamp": 0,
                    "unlock_time": 0
                },
                {
                    "amount": 100,
                    "global_index": 61165945,
                    "height": 2143330,
                    "public_key": "a4a5b245313d5772bce4fd7d9e7d4d390d6d7a42cf96a7ca2bcc5ec615ab84e9",
                    "stack_index": 18050,
                    "unlock_block_or_timestamp": 0,
                    "unlock_time": 0
                }
            ],
            "200": [
                {
                    "amount": 200,
                    "global_index": 63131082,
                    "height": 2350507,
                    "public_key": "53485a8c19eaa4788e6dbd5c455e238699c111e4e4019fb0a53fa955424e6ff1",
                    "stack_index": 16953,
                    "unlock_block_or_timestamp": 0,
                    "unlock_time": 0
                },
                {
                    "amount": 200,
                    "global_index": 57876995,
                    "height": 1955723,
                    "public_key": "96c92f1ca73bd7d8a6e2b6f2bdbbcb15f892cefb4b7c90e0baf9d8f112186e0d",
                    "stack_index": 13438,
                    "unlock_block_or_timestamp": 0,
                    "unlock_time": 0
                }
            ]
        }
    }
}