Example code snippets to query for chain node related data.
Last modified on July 9, 2026
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";
import { ChainRestTendermintApi } from "@injectivelabs/sdk-ts/client/chain";
const endpoints = getNetworkEndpoints(Network.Testnet);
const chainRestTendermintApi = new ChainRestTendermintApi(endpoints.rest);
const latestBlock = await chainRestTendermintApi.fetchLatestBlock();
console.log(latestBlock);
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";
import { ChainRestTendermintApi } from "@injectivelabs/sdk-ts/client/chain";
const endpoints = getNetworkEndpoints(Network.Testnet);
const chainRestTendermintApi = new ChainRestTendermintApi(endpoints.rest);
const nodeInfo = await chainRestTendermintApi.fetchNodeInfo();
console.log(nodeInfo);
