Type alias Markets<C, MS>

Markets<C, MS>: {
    create: C extends RpcContext<MS> ? (<C, P>(params: P) => Promise<CreateMarketResult<C, MS, P>>) : never;
    get: PFunc<((query: MarketGetQuery) => Promise<IOption<Market<C, MS>>>), C extends RpcContext<MS> ? {
        $: ((query: MarketGetQuery) => Observable<RpcMarket<C, MS>>);
    } : {}>;
    getStage: C extends RpcContext<MS> ? ((market: Market<Context<MS>, MS>, time?: ChainTime) => Promise<MarketStage>) : never;
    list: ((query?: MarketsListQuery<C>) => Promise<MarketList<C, MS>>);
}

Zeitgeist Markets model. Query and create markets.

Type Parameters

Type declaration

  • create: C extends RpcContext<MS> ? (<C, P>(params: P) => Promise<CreateMarketResult<C, MS, P>>) : never

    Create a market. Only available when connecting to rpc.

  • get: PFunc<((query: MarketGetQuery) => Promise<IOption<Market<C, MS>>>), C extends RpcContext<MS> ? {
        $: ((query: MarketGetQuery) => Observable<RpcMarket<C, MS>>);
    } : {}>

    Get a market by its id.

  • getStage: C extends RpcContext<MS> ? ((market: Market<Context<MS>, MS>, time?: ChainTime) => Promise<MarketStage>) : never

    Get the current stage of a market.

    Param

    Market<Context, MS>

    Param

    ChainTime | undefined

    Returns

    Promise

  • list: ((query?: MarketsListQuery<C>) => Promise<MarketList<C, MS>>)
      • (query?: MarketsListQuery<C>): Promise<MarketList<C, MS>>
      • List markets. Stronger quering is enabled when connecting to indexer.

        Note

        Pagination behaves differently between rcp and indexer environments.

        Returns

        Promise<MarketList<C, MS>>

        Parameters

        Returns Promise<MarketList<C, MS>>

Generated using TypeDoc