Initialization
import { initializeApi } from "ternoa-js";
await initializeApi();import { initializeApi } from "ternoa-js";
// The endpoint here will make the init API on the Ternoa Mainnet network
await initializeApi("wss://mainnet.ternoa.io");Accessing the Ternoa API
...
//we assume that API has been initiated before
const api = await getRawApi()
// Do something
// example: To get the last block
const signedBlock = await api.rpc.chain.getBlock();
...
}Last updated