@azuro-org/toolkit
Version:
This framework-agnostic package provides essential utilities for building applications on the Azuro Protocol.
28 lines (27 loc) • 787 B
TypeScript
import { type ConditionsQuery } from '../docs/feed/conditions';
import { ConditionState } from '../docs/feed/types';
import type { Selection } from '../global';
export type MarketOutcome = {
selectionName: string;
odds: number;
gameId: string;
isExpressForbidden: boolean;
isWon?: boolean;
} & Selection;
type TMarket<C> = {
marketKey: string;
name: string;
description: string;
conditions: C;
};
type Condition = {
conditionId: string;
state: ConditionState;
margin: string;
isExpressForbidden: boolean;
outcomes: MarketOutcome[];
};
export type Market = TMarket<Condition[]>;
export type GameMarkets = Market[];
export declare const groupConditionsByMarket: (conditions: ConditionsQuery["conditions"]) => GameMarkets;
export {};