Skip to main content

Scripts & Addresses

Access scripts & addresses and using Chronik.

address(address)

Return an object that can be used to fetch address data from Chronik in a fluent Interface.

See address API docs.

Live Editor
function DemoAddress() {
    return (
        <Json
            fn={async () => {
                // Some address with little history
                return await chronik
                    .address('ecash:qr3ax9kpca8qkgtwk0cdqdhnprsgfsq3xu2dx56fmw')
                    .history(0);
            }}
        />
    );
}
Result
Loading...

script(type, payload)

Return an object that can be used to fetch script data from Chronik in a fluent Interface.

See script API docs.

Live Editor
function DemoScript() {
    return (
        <Json
            fn={async () => {
                // Same address, but using the Public-Key-Hash
                return await chronik
                    .script('p2pkh', 'e3d316c1c74e0b216eb3f0d036f308e084c01137')
                    .history(0);
            }}
        />
    );
}
Result
Loading...

history(pageOffset, pageSize)

Fetch the tx history of a script or address, from latest to earliest.

See history API docs.

Live Editor
function DemoAddressHistory() {
    return (
        <Json
            fn={async () => {
                // IFP address
                return await chronik
                    .address('ecash:prfhcnyqnl5cgrnmlfmms675w93ld7mvvqd0y8lz07')
                    .history(300, 2);
            }}
        />
    );
}
Result
Loading...

utxos()

Fetch the utxos of a script or address.

See utxos API docs.

Live Editor
function DemoScriptUtxos() {
    return (
        <Json
            fn={async () => {
                // Genesis PK utxos
                return await chronik
                    .script(
                        'p2pk',
                        '04678afdb0fe5548271967f1a67130b7105cd6a828e03909a6' +
                            '7962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c' +
                            '384df7ba0b8d578a4c702b6bf11d5f',
                    )
                    .utxos();
            }}
        />
    );
}
Result
Loading...