Markets

The SDK displays markets in groups, e.g. markets related to "Goals" or markets related to "Corners".

The operator must pass an array of MarketGroups and an array of Markets to enable this functionality.

interface Market {
  id: string;
  options: MarketOption[];
  groupIds: string[];
  title: string;
  suspended?: boolean;
}

interface MarketOption {
  title: string;
  odds: string;
  id: string;
}

interface MarketGroup {
  id: string;
  title: string;
}

If you are using the React component, pass marketGroups and markets as props and update the markets by changing the props.

On an instance of the SDK, call updateMarkets and updateMarketGroups

Markets can be updated at any time and can be suspended by including suspended: true or by passing an array of market IDs to suspendMarkets .

Markets can be removed at any time by passing an array of market IDs to removeMarkets.

You can configure the odds format you are using by passing 'decimal', 'american' or 'fractional' to the oddsFormat prop.

It is the responsibility of operator to update and suspend markets accordingly. Implementing and passing onEventChanged callback is essential if MultiStream is also enabled.

Last updated