Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

predictit.js

An unofficial typescript client for accessing the PredictIt API.

Install

yarn add predictit.js

or

npm install predictit.js

API

import { predictIt } from '../src'

// Load a list of all the markets
const allMarkets = await predictIt.stub.allMarkets()

// Load a specific market
const someMarket = await predictIt.stub.market(12345)

// Models

interface PredictItMarketStub {
  id: number
  name: string
  shortName: string
  image: string
  url: string
  contracts: PredictItContract[]
  timeStamp: string
  status: `Open` | `Closed`
}

interface PredictItContractStub {
  id: number
  dateEnd: string
  image: string
  name: string
  shortName: string
  status: `Open` | `Closed`
  lastTradePrice: number
  bestBuyYesCost: number
  bestBuyNoCost: number
  bestSellYesCost: number
  bestSellNoCost: number
  lastClosePrice: number
  displayOrder: number
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages