Skip to content

02QueryingIndexerAuction

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

⚠️ The Docs have been moved to https://docs.ts.injective.network/querying/querying-api/querying-indexer-auction ⚠️

Example code snippets to query the indexer for auction module related data.

Using gRPC

  • Get an auction based off the round
import { IndexerGrpcAuctionApi } from "@injectivelabs/sdk-ts";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";

const endpoints = getNetworkEndpoints(Network.TestnetK8s);
const indexerGrpcAuctionApi = new IndexerGrpcAuctionApi(endpoints.indexer);

const round = 1;

const auction = await indexerGrpcAuctionApi.fetchAuction(round);

console.log(auction);
  • Get all auctions
import { IndexerGrpcAuctionApi } from "@injectivelabs/sdk-ts";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";

const endpoints = getNetworkEndpoints(Network.TestnetK8s);
const indexerGrpcAuctionApi = new IndexerGrpcAuctionApi(endpoints.indexer);

const auction = await indexerGrpcAuctionApi.fetchAuctions();

console.log(auction);

⚠️ DOCUMENTATION ⚠️

Clone this wiki locally