-
Notifications
You must be signed in to change notification settings - Fork 195
02QueryingIndexerAuction
Ivan Angelkoski edited this page Jun 12, 2023
·
4 revisions
Example code snippets to query the indexer for auction module related data.
- 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);
Powering the future of decentralized finance.