Skip to content

02QueryingChainMint

Ivan Angelkoski edited this page Jun 12, 2023 · 4 revisions

⚠️ The Docs have been moved to https://docs.ts.injective.network/querying/querying-chain/querying-chain-mint ⚠️

Example code snippets to query the mint module on the chain.

Using gRPC

  • Get parameters related to the mint module
import { ChainGrpcMintApi } from "@injectivelabs/sdk-ts";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";

const endpoints = getNetworkEndpoints(Network.TestnetK8s);
const chainGrpcMintApi = new ChainGrpcMintApi(endpoints.grpc);

const moduleParams = await chainGrpcMintApi.fetchModuleParams();

console.log(moduleParams);
  • Get the inflation
import { ChainGrpcMintApi } from "@injectivelabs/sdk-ts";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";

const endpoints = getNetworkEndpoints(Network.TestnetK8s);
const chainGrpcMintApi = new ChainGrpcMintApi(endpoints.grpc);

const inflation = await chainGrpcMintApi.fetchInflation();

console.log(inflation);
  • Get the annual provisions
import { ChainGrpcMintApi } from "@injectivelabs/sdk-ts";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";

const endpoints = getNetworkEndpoints(Network.TestnetK8s);
const chainGrpcMintApi = new ChainGrpcMintApi(endpoints.grpc);

const annualProvisions = await chainGrpcMintApi.fetchAnnualProvisions();

console.log(annualProvisions);

⚠️ DOCUMENTATION ⚠️

Clone this wiki locally