UNPKG

predictit.js

Version:

Unofficial JS Client for PredictIt

15 lines (14 loc) 640 B
import 'isomorphic-fetch'; import { PredictItContract, PredictItMarket, PredictItMarketStub, PredictItSearchResults } from './models'; export declare const PI_API_ENDPOINT = "https://www.predictit.org/api"; export declare const predictIt: { stub: { allMarkets: () => Promise<{ markets: PredictItMarketStub[]; }>; market: (id: number) => Promise<PredictItMarketStub>; }; market: (id: number) => Promise<PredictItMarket>; contracts: (marketId: number) => Promise<PredictItContract[]>; search: (query: string, page?: number, itemsPerPage?: number) => Promise<PredictItSearchResults>; };