Skip to main content

Blocks

Access blocks using Chronik

blocks(hashOrHeight)

Fetch the block given hash or height.

See blocks API docs.

Live Editor
function DemoBlock() {
    return (
        <Json
            fn={async () => {
                return await chronik.block(
                    '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f',
                );
            }}
        />
    );
}
Result
Loading...

blockTxs(hashOrHeight, page, pageSize)

Fetch the tx history of a block given hash or height. page and pageSize is optional.

See blockTxs API docs.

Live Editor
function DemoBlockTxs() {
    return (
        <Json
            fn={async () => {
                return await chronik.blockTxs(0);
            }}
        />
    );
}
Result
Loading...

blocks(startHeight, endHeight)

Fetch block info of a range of blocks. startHeight and endHeight are inclusive ranges.

See blocks API docs.

Live Editor
function DemoBlocks() {
    return (
        <Json
            fn={async () => {
                return await chronik.blocks(50, 52);
            }}
        />
    );
}
Result
Loading...