On-chain data at a specific blockhash
Ternoa-js provides the capability to query chain state at a specific/custom passed blockhash
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");
Last updated