TERNOA Documentation
Learn Build
  • What is Ternoa Chain ?
  • SPECS
    • Polygon CDK zkEVM
    • Polygon AggLayer
    • Avail DA
    • Trusted Execution Environments 
  • BUILD
    • Wallets
    • RPC
    • API
    • Explorer
  • Tools
    • Staking
    • Ternoa Safe
    • TIP
  • Community
    • Ternoa.com
    • Github
    • Discord
    • Twitter
    • Medium
Powered by GitBook
On this page
  1. Build
  2. Javascript SDK
  3. Ternoa-js library utilities

On-chain data at a specific blockhash

Last updated 1 year ago

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:

The Ternoa-js architecture
The Ternoa-js workflow
Make custom requests
Read storage, at a specific blockhash
State at a specific block
Access Ternoa API