-
Notifications
You must be signed in to change notification settings - Fork 195
02QueryingChainIBC
Ivan Angelkoski edited this page Jun 12, 2023
·
4 revisions
Example code snippets to query the chain for IBC related data.
- Get the denom trace from the IBC hash
import { ChainGrpcIbcApi } from "@injectivelabs/sdk-ts";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";
const endpoints = getNetworkEndpoints(Network.TestnetK8s);
const chainGrpcIbcApi = new ChainGrpcIbcApi(endpoints.grpc);
const hash = "...";
const denomTrace = await chainGrpcIbcApi.fetchDenomTrace(hash);
console.log(denomTrace);
- Get a list of denom traces
import { ChainGrpcIbcApi } from "@injectivelabs/sdk-ts";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";
const endpoints = getNetworkEndpoints(Network.TestnetK8s);
const chainGrpcIbcApi = new ChainGrpcIbcApi(endpoints.grpc);
const denomTraces = await chainGrpcIbcApi.fetchDenomsTrace();
console.log(denomTraces);
Powering the future of decentralized finance.