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 the indexer for portfolio module related data.
Using gRPC
Fetch portfolio based on injective address, such as bank balances and subaccount balances
import { IndexerGrpcPortfolioApi } from "@injectivelabs/sdk-ts/client/indexer";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";
const endpoints = getNetworkEndpoints(Network.Testnet);
const indexerGrpcPortfolioApi = new IndexerGrpcPortfolioApi(endpoints.indexer);
const injectiveAddress = "inj...";
const portfolio = await indexerGrpcPortfolioApi.fetchAccountPortfolioBalances(
injectiveAddress
);
console.log(portfolio);