pyth-crosschain/backend/fetcher/IPriceFetcher.ts

28 lines
582 B
TypeScript
Raw Normal View History

2021-10-07 10:41:19 -07:00
/**
* Pricecaster Service.
*
* Fetcher backend component.
*
* (c) 2021 Randlabs, Inc.
*/
2021-10-12 06:37:11 -07:00
import { PriceTicker } from '../common/priceTicker'
import { IStrategy } from '../strategy/strategy'
2021-10-07 10:41:19 -07:00
export interface IPriceFetcher {
start(): void
stop(): void
2021-10-08 12:03:37 -07:00
hasData(): boolean
2021-10-07 10:41:19 -07:00
/**
* Set price aggregation strategy for this fetcher.
* @param IStrategy The local price aggregation strategy
*/
2021-10-12 06:37:11 -07:00
setStrategy(s: IStrategy): void
2021-10-07 10:41:19 -07:00
/**
* Get the current price, according to running strategy.
*/
2021-10-08 12:03:37 -07:00
queryTicker(): PriceTicker | undefined
2021-10-07 10:41:19 -07:00
}