On-chain data at a specific blockhash

Ternoa-js provides the capability to query chain state at a specific/custom passed blockhash

If you are not familiar with the process of creating a transaction on the Ternoa chain, we highly suggest first reading the Getting Started section of the documentation with a focus on:

To learn more about how to access the Ternoa-js API & make custom interactions with the Ternoa chain read these sections:

const api = getRawApi()
const lastHeader = await api.rpc.chain.getHeader();
const apiAt = await api.at(lastHeader.hash);

Once you have access to the apiAt a specific blockhash, you can perform any operation. For example to query a balance:

 const balance = await apiAt.query.system.account("//REPLACE BY THE ADRESS");

Useful resources from Polkadot{.js} documentation:

Last updated