Documentation Index
Fetch the complete documentation index at: https://injectivelabs-mintlify-jp-developers-first-half-1777019423.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Example code snippets to query for chain node related data.
Using HTTP REST
Fetch the latest block info
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);
Fetch chain node info
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);