Skip to main content

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 data related to delegating to validators from the chain.

Using gRPC

Fetch parameters such as the base and bonus proposer reward

import { getNetworkEndpoints, Network } from "@injectivelabs/networks";
import { ChainGrpcDistributionApi } from "@injectivelabs/sdk-ts/client/chain";

const endpoints = getNetworkEndpoints(Network.Testnet);
const chainGrpcDistributionApi = new ChainGrpcDistributionApi(endpoints.grpc);

const moduleParams = await chainGrpcDistributionApi.fetchModuleParams();

console.log(moduleParams);

Fetch the amount and denom of rewards for a delegator delegating to a specific validator

import { getNetworkEndpoints, Network } from "@injectivelabs/networks";
import { ChainGrpcDistributionApi } from "@injectivelabs/sdk-ts/client/chain";

const endpoints = getNetworkEndpoints(Network.Testnet);
const chainGrpcDistributionApi = new ChainGrpcDistributionApi(endpoints.grpc);

const delegatorAddress = "inj...";
const validatorAddress = "injvaloper...";

const delegatorRewardsFromValidator =
  await chainGrpcDistributionApi.fetchDelegatorRewardsForValidatorNoThrow({
    delegatorAddress,
    validatorAddress,
  });

console.log(delegatorRewardsFromValidator);

Fetch the amount and denom of all rewards for a delegator

import { getNetworkEndpoints, Network } from "@injectivelabs/networks";
import { ChainGrpcDistributionApi } from "@injectivelabs/sdk-ts/client/chain";

const endpoints = getNetworkEndpoints(Network.Testnet);
const chainGrpcDistributionApi = new ChainGrpcDistributionApi(endpoints.grpc);

const delegatorAddress = "inj...";

const totalDelegatorRewards =
  await chainGrpcDistributionApi.fetchDelegatorRewardsNoThrow(delegatorAddress);

console.log(totalDelegatorRewards);
Last modified on April 24, 2026