-
Notifications
You must be signed in to change notification settings - Fork 198
02StreamingIndexerAuction
Bojan Angjelkoski edited this page Apr 2, 2023
·
5 revisions
Example code snippets to stream from the indexer for auction module related data.
- stream auction bids
import { IndexerGrpcAuctionStream } from '@injectivelabs/sdk-ts'
import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
const endpoints = getNetworkEndpoints(Network.TestnetK8s)
const indexerGrpcAuctionStream = new IndexerGrpcAuctionStream(endpoints.indexer)
const streamFn = indexerGrpcAuctionStream.streamBids.bind(indexerGrpcAuctionStream)
const callback = (bids) => {
console.log(bids)
}
const streamFnArgs = {
accountAddress,
callback
}
streamFn(streamFnArgs)
Powering the future of decentralized finance.