betfair

package module
v0.0.0-...-8fd8219 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SS_SUCCESS = "SUCCESS"
	SS_FAIL    = "FAIL"
)
View Source
const (
	SS_ERR_INPUT_VALIDATION_ERROR = "INPUT_VALIDATION_ERROR"
	SS_ERR_INTERNAL_ERROR         = "INTERNAL_ERROR"
	SS_ERR_NO_SESSION             = "NO_SESSION"
)
View Source
const (
	EC_UNEXPECTED_ERROR            = "UNEXPECTED_ERROR"
	EC_INVALID_INPUT_DATA          = "INVALID_INPUT_DATA"
	EC_INVALID_SESSION_INFORMATION = "INVALID_SESSION_INFORMATION"
	EC_INVALID_APP_KEY             = "INVALID_APP_KEY"
	EC_SERVICE_BUSY                = "SERVICE_BUSY"
	EC_TIMEOUT_ERROR               = "TIMEOUT_ERROR"
	EC_NO_SESSION                  = "NO_SESSION"
	EC_NO_APP_KEY                  = "NO_APP_KEY"
	EC_TOO_MANY_REQUESTS           = "TOO_MANY_REQUESTS"
	EC_SERVICE_UNAVAILABLE         = "SERVICE_UNAVAILABLE"
	EC_REQUEST_SIZE_EXCEEDS_LIMIT  = "REQUEST_SIZE_EXCEEDS_LIMIT"
	EC_TOO_MUCH_DATA               = "TOO_MUCH_DATA"
	EC_ACCESS_DENIED               = "ACCESS_DENIED"
)
View Source
const (
	IT_ALL                  = "ALL"
	IT_DEPOSITS_WITHDRAWALS = "DEPOSITS_WITHDRAWALS"
	IT_EXCHANGE             = "EXCHANGE"
	IT_POKER_ROOM           = "POKER_ROOM"
)
View Source
const (
	WL_RESULT_ERR            = "RESULT_ERR"
	WL_RESULT_FIX            = "RESULT_FIX"
	WL_RESULT_LOST           = "RESULT_LOST"
	WL_RESULT_NOT_APPLICABLE = "RESULT_NOT_APPLICABLE"
	WL_RESULT_WON            = "RESULT_WON"
	WL_COMMISSION_REVERSAL   = "COMMISSION_REVERSAL"
)
View Source
const (
	AP_NONE                           = "NONE"
	AP_CANCELLATION_REQUEST_SUBMITTED = "CANCELLATION_REQUEST_SUBMITTED"
	AP_ALL_BETS_CANCELLED             = "ALL_BETS_CANCELLED"
	AP_SOME_BETS_NOT_CANCELLED        = "SOME_BETS_NOT_CANCELLED"
	AP_CANCELLATION_REQUEST_ERROR     = "CANCELLATION_REQUEST_ERROR"
	AP_CANCELLATION_STATUS_UNKNOWN    = "CANCELLATION_STATUS_UNKNOWN"
)
View Source
const (
	RM_STAKE  = "STAKE"
	RM_PAYOUT = "PAYOUT"
	RM_NONE   = "NONE"
)
View Source
const (
	RS_DORMANT          = "DORMANT"
	RS_DELAYED          = "DELAYED"
	RS_PARADING         = "PARADING"
	RS_GOINGDOWN        = "GOINGDOWN"
	RS_GOINGBEHIND      = "GOINGBEHIND"
	RS_APPROACHING      = "APPROACHING"
	RS_GOINGINTRAPS     = "GOINGINTRAPS"
	RS_HARERUNNING      = "HARERUNNING"
	RS_ATTHEPOST        = "ATTHEPOST"
	RS_OFF              = "OFF"
	RS_FINISHED         = "FINISHED"
	RS_FINALRESULT      = "FINALRESULT"
	RS_FALSESTART       = "FALSESTART"
	RS_PHOTOGRAPH       = "PHOTOGRAPH"
	RS_RESULT           = "RESULT"
	RS_WEIGHEDIN        = "WEIGHEDIN"
	RS_RACEVOID         = "RACEVOID"
	RS_NORACE           = "NORACE"
	RS_MEETINGABANDONED = "MEETINGABANDONED"
	RS_RERUN            = "RERUN"
	RS_ABANDONED        = "ABANDONED"
)
View Source
const (
	RC_OK                                = "OK"
	RC_NO_NEW_UPDATES                    = "NO_NEW_UPDATES"
	RC_NO_LIVE_DATA_AVAILABLE            = "NO_LIVE_DATA_AVAILABLE"
	RC_SERVICE_UNAVAILABLE               = "SERVICE_UNAVAILABLE"
	RC_UNEXPECTED_ERROR                  = "UNEXPECTED_ERROR"
	RC_LIVE_DATA_TEMPORARILY_UNAVAILABLE = "LIVE_DATA_TEMPORARILY_UNAVAILABLE"
)
View Source
const (
	IC_UNKNOWN = "UNKNOWN"
)
View Source
const (
	W_UK = "UK"
)

Variables

This section is empty.

Functions

func GetRandomMarketID

func GetRandomMarketID(t *testing.T, c *Client) string

func GetTLSConfig

func GetTLSConfig(certFilePath string, keyFilePath string) (*tls.Config, error)

func ReadJson

func ReadJson(res *http.Response, response any) error

func ReadStream

func ReadStream[T any](connection *tls.Conn) chan T

Types

type AccountDetailsParams

type AccountDetailsParams struct {
	Wallet Wallet `json:"wallet"`
}

type AccountDetailsResponse

type AccountDetailsResponse struct {
	CurrencyCode  string  `json:"currencyCode"`
	FirstName     string  `json:"firstName"`
	LastName      string  `json:"lastName"`
	LocaleCode    string  `json:"localeCode"`
	Region        string  `json:"region"`
	Timezone      string  `json:"timezone"`
	DiscountRate  float64 `json:"discountRate"`
	PointsBalance int     `json:"pointsBalance"`
	CountryCode   string  `json:"countryCode"`
}

type AccountFundsResponse

type AccountFundsResponse struct {
	AvailableToBetBalance float64 `json:"availableToBetBalance"`
	Exposure              float64 `json:"exposure"`
	RetainedCommission    float64 `json:"retainedCommission"`
	ExposureLimit         float64 `json:"exposureLimit"`
	DiscountRate          float64 `json:"discountRate"`
	PointsBalance         int     `json:"pointsBalance"`
	Wallet                string  `json:"wallet"`
}

type AccountStatement

type AccountStatement struct {
	RefID         string              `json:"refId"`
	ItemDate      time.Time           `json:"itemDate"`
	Amount        float64             `json:"amount"`
	Balance       float64             `json:"balance"`
	ItemClass     ItemClass           `json:"itemClass"`
	ItemClassData map[string]string   `json:"itemClassData"`
	LegacyData    StatementLegacyData `json:"legacyData"`
}

type AccountStatementParams

type AccountStatementParams struct {
	Locale        string      `json:"locale,omitempty"`
	FromRecord    int         `json:"fromRecord,omitempty"`
	RecordCount   int         `json:"recordCount,omitempty"`
	ItemDateRange TimeRange   `json:"itemDateRange,omitempty"`
	IncludeItem   IncludeItem `json:"includeItem,omitempty"`
	Wallet        Wallet      `json:"wallet,omitempty"`
}

type AccountStatementReport

type AccountStatementReport struct {
	AccountStatements []AccountStatement `json:"accountStatement"`
	MoreAvailable     bool               `json:"moreAvailable"`
}

type ActionPerformed

type ActionPerformed string

type AuthenticationMessage

type AuthenticationMessage struct {
	ID      int    `json:"id"`
	Op      string `json:"op"`
	AppKey  string `json:"appKey"`
	Session string `json:"session"`
}

type BetStatus

type BetStatus string
const (
	BS_SETTLED   BetStatus = "SETTLED"
	BS_VOIDED    BetStatus = "VOIDED"
	BS_LAPSED    BetStatus = "LAPSED"
	BS_CANCELLED BetStatus = "CANCELLED"
)

type BetTargetType

type BetTargetType string
const (
	BTT_BACKER_PROFIT BetTargetType = "BACKER_PROFIT"
	BTT_PAYOUT        BetTargetType = "PAYOUT"
)

type CancelExecutionReport

type CancelExecutionReport struct {
	CustomerRef        string                    `json:"customerRef,omitempty"`
	Status             ExecutionReportStatus     `json:"status"`
	ErrorCode          ExecutionReportErrorCode  `json:"errorCode,omitempty"`
	MarketID           string                    `json:"marketId,omitempty"`
	InstructionReports []CancelInstructionReport `json:"instructionReports,omitempty"`
}

type CancelInstruction

type CancelInstruction struct {
	BetID         string  `json:"betId,omitempty"`
	SizeReduction float64 `json:"sizeReduction,omitempty"`
}

type CancelInstructionReport

type CancelInstructionReport struct {
	Status        InstructionReportStatus    `json:"status"`
	ErrorCode     InstructionReportErrorCode `json:"errorCode,omitempty"`
	Instruction   CancelInstruction          `json:"instruction,omitempty"`
	SizeCancelled float64                    `json:"sizeCancelled"`
	CanceledDate  time.Time                  `json:"canceledDate,omitempty"`
}

type CancelOrdersParams

type CancelOrdersParams struct {
	MarketID     string              `json:"marketId,omitempty"`
	Instructions []CancelInstruction `json:"instructions,omitempty"`
	CustomerRef  string              `json:"customerRef,omitempty"`
}

type ClearedOrderSummary

type ClearedOrderSummary struct {
	EventTypeID         string          `json:"eventTypeId,omitempty"`
	EventID             string          `json:"eventId,omitempty"`
	MarketID            string          `json:"marketId,omitempty"`
	SelectionID         int64           `json:"selectionId,omitempty"`
	Handicap            float64         `json:"handicap,omitempty"`
	BetID               string          `json:"betId,omitempty"`
	PlacedDate          time.Time       `json:"placedDate,omitempty"`
	PersistenceType     PersistenceType `json:"persistenceType,omitempty"`
	OrderType           OrderType       `json:"orderType,omitempty"`
	Side                Side            `json:"side,omitempty"`
	ItemDescription     ItemDescription `json:"itemDescription,omitempty"`
	PriceRequested      float64         `json:"priceRequested,omitempty"`
	SettledDate         time.Time       `json:"settledDate,omitempty"`
	LastMatchedDate     time.Time       `json:"lastMatchedDate,omitempty"`
	BetCount            int             `json:"betCount,omitempty"`
	Commission          float64         `json:"commission,omitempty"`
	PriceMatched        float64         `json:"priceMatched,omitempty"`
	PriceReduced        bool            `json:"priceReduced,omitempty"`
	SizeSettled         float64         `json:"sizeSettled,omitempty"`
	Profit              float64         `json:"profit,omitempty"`
	SizeCancelled       float64         `json:"sizeCancelled,omitempty"`
	CustomerOrderRef    string          `json:"customerOrderRef,omitempty"`
	CustomerStrategyRef string          `json:"customerStrategyRef,omitempty"`
	SourceIDKey         string          `json:"sourceIdKey,omitempty"`
	SourceIDDescription string          `json:"sourceIdDescription,omitempty"`
}

type ClearedOrderSummaryReport

type ClearedOrderSummaryReport struct {
	ClearedOrders []ClearedOrderSummary `json:"clearedOrders"`
	MoreAvailable bool                  `json:"moreAvailable"`
}

type ClearedOrdersParams

type ClearedOrdersParams struct {
	BetStatus              BetStatus `json:"betStatus"`
	EventTypeIDs           []string  `json:"eventTypeIds,omitempty"`
	EventIDs               []string  `json:"eventIds,omitempty"`
	MarketIDs              []string  `json:"marketIds,omitempty"`
	RunnerIDs              []string  `json:"runnerIds,omitempty"`
	BetIDs                 []string  `json:"betIds,omitempty"`
	CustomerOrderRefs      []string  `json:"customerOrderRefs,omitempty"`
	CustomerStrategyRefs   []string  `json:"customerStrategyRefs,omitempty"`
	Side                   Side      `json:"side,omitempty"`
	SettledDateRange       TimeRange `json:"settledDateRange,omitempty"`
	GroupBy                GroupBy   `json:"groupBy,omitempty"`
	IncludeItemDescription bool      `json:"includeItemDescription,omitempty"`
	Locale                 string    `json:"locale,omitempty"`
	FromRecord             int       `json:"fromRecord,omitempty"`
	RecordCount            int       `json:"recordCount,omitempty"`
	IncludeSourceID        bool      `json:"includeSourceId,omitempty"`
}

type Client

type Client struct {
	HttpClient      *http.Client
	Tls             *tls.Config
	ApplicationName string
	ApplicationKey  string
	SessionToken    string
	Rest            bool
}

func NewClient

func NewClient(tls *tls.Config, app_key string, applicationName string) *Client

func NewTestClient

func NewTestClient(t *testing.T) *Client

func (*Client) CancelOrders

func (client *Client) CancelOrders(params CancelOrdersParams) (CancelExecutionReport, error)

func (*Client) Do

func (client *Client) Do(req *http.Request) (*http.Response, error)

func (*Client) GetAccountDetails

func (client *Client) GetAccountDetails() (AccountDetailsResponse, error)

func (*Client) GetAccountFunds

func (client *Client) GetAccountFunds(params AccountDetailsParams) (AccountFundsResponse, error)

func (*Client) GetAccountStatement

func (client *Client) GetAccountStatement(params AccountStatementParams) (AccountStatementReport, error)

func (*Client) GetAccounts

func (client *Client) GetAccounts(method string, params any, response any) error

func (*Client) GetDeveloperAppKeys

func (client *Client) GetDeveloperAppKeys() ([]DeveloperApp, error)

func (*Client) GetHeartbeats

func (client *Client) GetHeartbeats(method string, params any, response any) error

func (*Client) GetScores

func (client *Client) GetScores(method string, params any, response any) error

func (*Client) GetSports

func (client *Client) GetSports(method string, params any, response any) error

func (*Client) GetStream

func (client *Client) GetStream(sc *StreamingClient) error

func (*Client) Heartbeat

func (client *Client) Heartbeat(params HeartbeatParams) (HeartbeatReport, error)

func (*Client) ListClearedOrders

func (client *Client) ListClearedOrders(params ClearedOrdersParams) (ClearedOrderSummaryReport, error)

func (*Client) ListCompetitions

func (client *Client) ListCompetitions(params CompetitionParams) ([]CompetitionResult, error)

func (*Client) ListCountries

func (client *Client) ListCountries(params CountryParams) ([]CountryCodeResult, error)

func (*Client) ListCurrencyRates

func (client *Client) ListCurrencyRates(params CurrencyRateParams) ([]CurrencyRate, error)

func (*Client) ListCurrentOrders

func (client *Client) ListCurrentOrders(params CurrentOrdersParams) (CurrentOrderSummaryReport, error)

func (*Client) ListEventTypes

func (client *Client) ListEventTypes(params EventTypeParams) ([]EventTypeResult, error)

func (*Client) ListEvents

func (client *Client) ListEvents(params EventParams) ([]EventResult, error)

func (*Client) ListMarketBook

func (client *Client) ListMarketBook(params MarketBookParams) ([]MarketBook, error)

func (*Client) ListMarketCatalogue

func (client *Client) ListMarketCatalogue(params MarketCatalogueParams) ([]MarketCatalogueResult, error)

func (*Client) ListMarketProfitAndLoss

func (client *Client) ListMarketProfitAndLoss(params MarketProfitAndLossParams) ([]MarketProfitAndLoss, error)

func (*Client) ListMarketTypes

func (client *Client) ListMarketTypes(params MarketTypeParams) ([]MarketTypeResult, error)

func (*Client) ListRaceDetails

func (client *Client) ListRaceDetails(params RaceDetailsParams) ([]RaceDetails, error)

func (*Client) ListRunnerBook

func (client *Client) ListRunnerBook(params RunnerBookParams) ([]MarketBook, error)

func (*Client) ListTimeRanges

func (client *Client) ListTimeRanges(params TimeRangesParams) ([]TimeRangeResult, error)

func (*Client) ListVenues

func (client *Client) ListVenues(params VenueParams) ([]VenueResult, error)

func (*Client) Login

func (client *Client) Login(username string, password string) (*http.Response, error)

func (*Client) Logout

func (client *Client) Logout() (*http.Response, error)

func (*Client) PlaceOrders

func (client *Client) PlaceOrders(params PlaceOrdersParams) (PlaceExecutionReport, error)

func (*Client) ReplaceOrders

func (client *Client) ReplaceOrders(params ReplaceOrdersParams) (ReplaceExecutionReport, error)

func (*Client) Resume

func (client *Client) Resume(sessionToken string) (*http.Response, error)

func (*Client) UpdateOrders

func (client *Client) UpdateOrders(params UpdateOrdersParams) (UpdateExecutionReport, error)

type Competition

type Competition struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type CompetitionParams

type CompetitionParams struct {
	Filter MarketFilter `json:"filter"`
	Locale string       `json:"locale"`
}

type CompetitionResult

type CompetitionResult struct {
	Competition       Competition `json:"competition"`
	MarketCount       int         `json:"marketCount"`
	CompetitionRegion string      `json:"competitionRegion"`
}

type ConnectionMessage

type ConnectionMessage struct {
	Op           string `json:"op"`
	ConnectionID string `json:"connectionId"`
}

type CountryCodeResult

type CountryCodeResult struct {
	CountryCode string `json:"countryCode"`
	MarketCount int    `json:"marketCount"`
}

type CountryParams

type CountryParams struct {
	Filter MarketFilter `json:"filter"`
	Locale string       `json:"locale"`
}

type CurrencyRate

type CurrencyRate struct {
	CurrencyCode string  `json:"currencyCode"`
	Rate         float64 `json:"rate"`
}

type CurrencyRateParams

type CurrencyRateParams struct {
	FromCurrency string `json:"fromCurrency,omitempty"`
}

type CurrentItemDescription

type CurrentItemDescription struct {
	MarketVersion MarketVersion `json:"marketVersion,omitempty"`
}

type CurrentOrderSummary

type CurrentOrderSummary struct {
	BetID                  string                 `json:"betId"`
	MarketID               string                 `json:"marketId"`
	SelectionID            int64                  `json:"selectionId"`
	Handicap               float64                `json:"handicap"`
	PriceSize              PriceSize              `json:"priceSize"`
	BspLiability           float64                `json:"bspLiability"`
	Side                   Side                   `json:"side"`
	OrderStatus            OrderStatus            `json:"status"`
	PersistenceType        PersistenceType        `json:"persistenceType"`
	OrderType              OrderType              `json:"orderType"`
	PlacedDate             time.Time              `json:"placedDate"`
	MatchedDate            time.Time              `json:"matchedDate"`
	AveragePriceMatched    float64                `json:"averagePriceMatched,omitempty"`
	SizeMatched            float64                `json:"sizeMatched,omitempty"`
	SizeRemaining          float64                `json:"sizeRemaining,omitempty"`
	SizeLapsed             float64                `json:"sizeLapsed,omitempty"`
	SizeCancelled          float64                `json:"sizeCancelled,omitempty"`
	SizeVoided             float64                `json:"sizeVoided,omitempty"`
	RegulatorAuthCode      string                 `json:"regulatorAuthCode,omitempty"`
	RegulatorCode          string                 `json:"regulatorCode,omitempty"`
	CustomerOrderRef       string                 `json:"customerOrderRef,omitempty"`
	CustomerStrategyRef    string                 `json:"customerStrategyRef,omitempty"`
	CurrentItemDescription CurrentItemDescription `json:"currentItemDescription,omitempty"`
	SourceIdKey            string                 `json:"sourceIdKey,omitempty"`
	SourceIdDescription    string                 `json:"sourceIdDescription,omitempty"`
}

type CurrentOrderSummaryReport

type CurrentOrderSummaryReport struct {
	CurrentOrders []CurrentOrderSummary `json:"currentOrders"`
	MoreAvailable bool                  `json:"moreAvailable"`
}

type CurrentOrdersParams

type CurrentOrdersParams struct {
	BetIDs                 []string        `json:"betIds,omitempty"`
	MarketIDs              []string        `json:"marketIds,omitempty"`
	OrderProjection        OrderProjection `json:"orderProjection,omitempty"`
	CustomerOrderRefs      []string        `json:"customerOrderRefs,omitempty"`
	CustomerStrategyRefs   []string        `json:"customerStrategyRefs,omitempty"`
	DateRange              TimeRange       `json:"dateRange,omitempty"`
	OrderBy                OrderBy         `json:"orderBy,omitempty"`
	SortDir                SortDir         `json:"sortDir,omitempty"`
	FromDate               time.Time       `json:"fromDate,omitempty"`
	FromRecord             int             `json:"fromRecord,omitempty"`
	RecordCount            int             `json:"recordCount,omitempty"`
	IncludeItemDescription bool            `json:"includeItemDescription,omitempty"`
	IncludeSourceID        bool            `json:"includeSourceId,omitempty"`
}

type DeveloperApp

type DeveloperApp struct {
	AppName string `json:"appName"`
	AppID   int64  `json:"appId"`
}

type Event

type Event struct {
	ID          string    `json:"id,omitempty"`
	Name        string    `json:"name,omitempty"`
	CountryCode string    `json:"countryCode,omitempty"`
	Timezone    string    `json:"timezone,omitempty"`
	Venue       string    `json:"venue,omitempty"`
	OpenDate    time.Time `json:"openDate,omitempty"`
}

type EventParams

type EventParams struct {
	Filter MarketFilter `json:"filter"`
	Locale string       `json:"locale"`
}

type EventResult

type EventResult struct {
	Event       Event `json:"event"`
	MarketCount int   `json:"marketCount"`
}

type EventType

type EventType struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

type EventTypeParams

type EventTypeParams struct {
	Filter MarketFilter `json:"filter"`
	Locale string       `json:"locale"`
}

type EventTypeResult

type EventTypeResult struct {
	EventType   EventType `json:"eventType,omitempty"`
	MarketCount int       `json:"marketCount,omitempty"`
}

type ExchangePrices

type ExchangePrices struct {
	AvailableToBack []PriceSize `json:"availableToBack,omitempty"`
	AvailableToLay  []PriceSize `json:"availableToLay,omitempty"`
	TradedVolume    []PriceSize `json:"tradedVolume,omitempty"`
}

type ExecutionReportErrorCode

type ExecutionReportErrorCode string
const (
	ERS_ERR_ERROR_IN_MATCHER                    ExecutionReportErrorCode = "ERROR_IN_MATCHER"
	ERS_ERR_PROCESSED_WITH_ERRORS               ExecutionReportErrorCode = "PROCESSED_WITH_ERRORS"
	ERS_ERR_BET_ACTION_ERROR                    ExecutionReportErrorCode = "BET_ACTION_ERROR"
	ERS_ERR_INVALID_ACCOUNT_STATE               ExecutionReportErrorCode = "INVALID_ACCOUNT_STATE"
	ERS_ERR_INVALID_WALLET_STATUS               ExecutionReportErrorCode = "INVALID_WALLET_STATUS"
	ERS_ERR_INSUFFICIENT_FUNDS                  ExecutionReportErrorCode = "INSUFFICIENT_FUNDS"
	ERS_ERR_LOSS_LIMIT_EXCEEDED                 ExecutionReportErrorCode = "LOSS_LIMIT_EXCEEDED"
	ERS_ERR_MARKET_SUSPENDED                    ExecutionReportErrorCode = "MARKET_SUSPENDED"
	ERS_ERR_EXE_ERR_MARKET_NOT_OPEN_FOR_BETTING ExecutionReportErrorCode = "MARKET_NOT_OPEN_FOR_BETTING"
	ERS_ERR_DUPLICATE_TRANSACTION               ExecutionReportErrorCode = "DUPLICATE_TRANSACTION"
	ERS_ERR_INVALID_ORDER                       ExecutionReportErrorCode = "INVALID_ORDER"
	ERS_ERR_INVALID_MARKET_ID                   ExecutionReportErrorCode = "INVALID_MARKET_ID"
	ERS_ERR_PERMISSION_DENIED                   ExecutionReportErrorCode = "PERMISSION_DENIED"
	ERS_ERR_DUPLICATE_BETIDS                    ExecutionReportErrorCode = "DUPLICATE_BETIDS"
	ERS_ERR_NO_ACTION_REQUIRED                  ExecutionReportErrorCode = "NO_ACTION_REQUIRED"
	ERS_ERR_SERVICE_UNAVAILABLE                 ExecutionReportErrorCode = "SERVICE_UNAVAILABLE"
	ERS_ERR_REJECTED_BY_REGULATOR               ExecutionReportErrorCode = "REJECTED_BY_REGULATOR"
	ERS_ERR_NO_CHASING                          ExecutionReportErrorCode = "NO_CHASING"
	ERS_ERR_REGULATOR_IS_NOT_AVAILABLE          ExecutionReportErrorCode = "REGULATOR_IS_NOT_AVAILABLE"
	ERS_ERR_TOO_MANY_INSTRUCTIONS               ExecutionReportErrorCode = "TOO_MANY_INSTRUCTIONS"
	ERS_ERR_INVALID_MARKET_VERSION              ExecutionReportErrorCode = "INVALID_MARKET_VERSION"
	ERS_ERR_INVALID_PROFIT_RATIO                ExecutionReportErrorCode = "INVALID_PROFIT_RATIO"
)

type ExecutionReportStatus

type ExecutionReportStatus string
const (
	ERS_SUCCESS               ExecutionReportStatus = "SUCCESS"
	ERS_FAILURE               ExecutionReportStatus = "FAILURE"
	ERS_PROCESSED_WITH_ERRORS ExecutionReportStatus = "PROCESSED_WITH_ERRORS"
	ERS_TIMEOUT               ExecutionReportStatus = "TIMEOUT"
)

type GroupBy

type GroupBy string
const (
	GB_EVENT_TYPE GroupBy = "EVENT_TYPE"
	GB_EVENT      GroupBy = "EVENT"
	GB_MARKET     GroupBy = "MARKET"
	GB_SIDE       GroupBy = "SIDE"
	GB_BET        GroupBy = "BET"
)

type HeartbeatParams

type HeartbeatParams struct {
	PreferredTimeoutSeconds int `json:"preferredTimeoutSeconds"`
}

type HeartbeatReport

type HeartbeatReport struct {
	ActionPerformed      ActionPerformed `json:"actionPerformed"`
	ActualTimeoutSeconds int             `json:"actualTimeoutSeconds"`
}

type IncludeItem

type IncludeItem string

type InstructionReportErrorCode

type InstructionReportErrorCode string
const (
	IRS_ERR_INVALID_BET_SIZE                InstructionReportErrorCode = "INVALID_BET_SIZE"
	IRS_ERR_INVALID_RUNNER                  InstructionReportErrorCode = "INVALID_RUNNER"
	IRS_ERR_BET_TAKEN_OR_LAPSED             InstructionReportErrorCode = "BET_TAKEN_OR_LAPSED"
	IRS_ERR_BET_IN_PROGRESS                 InstructionReportErrorCode = "BET_IN_PROGRESS"
	IRS_ERR_RUNNER_REMOVED                  InstructionReportErrorCode = "RUNNER_REMOVED"
	IRS_ERR_MARKET_NOT_OPEN_FOR_BETTING     InstructionReportErrorCode = "MARKET_NOT_OPEN_FOR_BETTING"
	IRS_ERR_LOSS_LIMIT_EXCEEDED             InstructionReportErrorCode = "LOSS_LIMIT_EXCEEDED"
	IRS_ERR_MARKET_NOT_OPEN_FOR_BSP_BETTING InstructionReportErrorCode = "MARKET_NOT_OPEN_FOR_BSP_BETTING"
	IRS_ERR_INVALID_PRICE_EDIT              InstructionReportErrorCode = "INVALID_PRICE_EDIT"
	IRS_ERR_INVALID_ODDS                    InstructionReportErrorCode = "INVALID_ODDS"
	IRS_ERR_INSUFFICIENT_FUNDS              InstructionReportErrorCode = "INSUFFICIENT_FUNDS"
	IRS_ERR_INVALID_PERSISTENCE_TYPE        InstructionReportErrorCode = "INVALID_PERSISTENCE_TYPE"
	IRS_ERR_ERROR_IN_MATCHER                InstructionReportErrorCode = "ERROR_IN_MATCHER"
	IRS_ERR_INVALID_BACK_LAY_COMBINATION    InstructionReportErrorCode = "INVALID_BACK_LAY_COMBINATION"
	IRS_ERR_ERROR_IN_ORDER                  InstructionReportErrorCode = "ERROR_IN_ORDER"
	IRS_ERR_INVALID_BID_TYPE                InstructionReportErrorCode = "INVALID_BID_TYPE"
	IRS_ERR_INVALID_BET_ID                  InstructionReportErrorCode = "INVALID_BET_ID"
	IRS_ERR_CANCELLED_NOT_PLACED            InstructionReportErrorCode = "CANCELLED_NOT_PLACED"
	IRS_ERR_RELATED_ACTION_FAILED           InstructionReportErrorCode = "RELATED_ACTION_FAILED"
	IRS_ERR_NO_ACTION_REQUIRED              InstructionReportErrorCode = "NO_ACTION_REQUIRED"
	IRS_ERR_TIME_IN_FORCE_CONFLICT          InstructionReportErrorCode = "TIME_IN_FORCE_CONFLICT"
	IRS_ERR_UNEXPECTED_PERSISTENCE_TYPE     InstructionReportErrorCode = "UNEXPECTED_PERSISTENCE_TYPE"
	IRS_ERR_INVALID_ORDER_TYPE              InstructionReportErrorCode = "INVALID_ORDER_TYPE"
	IRS_ERR_UNEXPECTED_MIN_FILL_SIZE        InstructionReportErrorCode = "UNEXPECTED_MIN_FILL_SIZE"
	IRS_ERR_INVALID_CUSTOMER_ORDER_REF      InstructionReportErrorCode = "INVALID_CUSTOMER_ORDER_REF"
	IRS_ERR_INVALID_MIN_FILL_SIZE           InstructionReportErrorCode = "BET_LAPSED_PRICE_IMPROVEMENT_TOO_LARGE"
)

type InstructionReportStatus

type InstructionReportStatus string
const (
	IRS_SUCCESS InstructionReportStatus = "SUCCESS"
	IRS_FAILURE InstructionReportStatus = "FAILURE"
	IRS_TIMEOUT InstructionReportStatus = "TIMEOUT"
)

type ItemClass

type ItemClass string

type ItemDescription

type ItemDescription struct {
	EventTypeDesc   string    `json:"eventTypeDesc,omitempty"`
	EventDesc       string    `json:"eventDesc,omitempty"`
	MarketDesc      string    `json:"marketDesc,omitempty"`
	MarketType      string    `json:"marketType,omitempty"`
	MarketStartTime time.Time `json:"marketStartTime,omitempty"`
	RunnerDesc      string    `json:"runnerDesc,omitempty"`
	NumberOfWinners int       `json:"numberOfWinners,omitempty"`
	EachWayDivisor  float64   `json:"eachWayDivisor,omitempty"`
}

type JsonAPINGException

type JsonAPINGException struct {
	RequestUUID  string                      `json:"requestUUID"`
	ErrorCode    JsonAPINGExceptionErrorCode `json:"errorCode"`
	ErrorDetails string                      `json:"errorDetails"`
}

type JsonAPINGExceptionErrorCode

type JsonAPINGExceptionErrorCode string

type JsonData

type JsonData struct {
	APINGException JsonAPINGException `json:"APINGException"`
	ExceptionName  string             `json:"exceptionname"`
}

type JsonError

type JsonError struct {
	Code    int      `json:"code"`
	Message string   `json:"message"`
	Data    JsonData `json:"data"`
}

type JsonRPC

type JsonRPC struct {
	JsonRPC string `json:"jsonrpc"`
	Method  string `json:"method"`
	Params  any    `json:"params"`
	ID      int    `json:"id"`
}

type JsonRestErrorResponse

type JsonRestErrorResponse struct {
	FaultCode   string `json:"faultcode"`
	FaultString string `json:"faultstring"`
	Detail      struct {
	} `json:"detail"`
}

type JsonRpcResponse

type JsonRpcResponse struct {
	JsonRPC string    `json:"jsonrpc"`
	Result  any       `json:"result"`
	Error   JsonError `json:"error,omitempty"`
	ID      int       `json:"id"`
}

type KeyLineDescription

type KeyLineDescription struct {
	KeyLine []KeyLineSelection `json:"keyLine,omitempty"`
}

type KeyLineSelection

type KeyLineSelection struct {
	SelectionID int64   `json:"selectionId,omitempty"`
	Handicap    float64 `json:"handicap,omitempty"`
}

type LimitOnCloseOrder

type LimitOnCloseOrder struct {
	Liability float64 `json:"liability"`
	Price     float64 `json:"price"`
}

type LimitOrder

type LimitOrder struct {
	Size            float64         `json:"size"`
	Price           float64         `json:"price"`
	PersistenceType PersistenceType `json:"persistenceType"`
	TimeInForce     TimeInForce     `json:"timeInForce,omitempty"`
	MinFillSize     float64         `json:"minFillSize,omitempty"`
	BetTargetType   BetTargetType   `json:"betTargetType,omitempty"`
	BetTargetSize   float64         `json:"betTargetSize,omitempty"`
}

type MarketBettingType

type MarketBettingType string
const (
	MBT_ODDS                       MarketBettingType = "ODDS"
	MBT_LINE                       MarketBettingType = "LINE"
	MBT_RANGE                      MarketBettingType = "RANGE"
	MBT_ASIAN_HANDICAP_SINGLE_LINE MarketBettingType = "ASIAN_HANDICAP_SINGLE_LINE"
	MBT_ASIAN_HANDICAP_DOUBLE_LINE MarketBettingType = "ASIAN_HANDICAP_DOUBLE_LINE"
	MBT_FIXED_ODDS                 MarketBettingType = "FIXED_ODDS"
)

type MarketBook

type MarketBook struct {
	MarketID              string             `json:"marketId"`
	IsMarketDataDelayed   bool               `json:"isMarketDataDelayed"`
	Status                MarketStatus       `json:"status,omitempty"`
	BetDelay              int                `json:"betDelay,omitempty"`
	BspReconciled         bool               `json:"bspReconciled,omitempty"`
	Complete              bool               `json:"complete,omitempty"`
	Inplay                bool               `json:"inplay,omitempty"`
	NumberOfWinners       int                `json:"numberOfWinners,omitempty"`
	NumberOfRunners       int                `json:"numberOfRunners,omitempty"`
	NumberOfActiveRunners int                `json:"numberOfActiveRunners,omitempty"`
	LastMatchTime         time.Time          `json:"lastMatchTime,omitempty"`
	TotalMatched          float64            `json:"totalMatched,omitempty"`
	TotalAvailable        float64            `json:"totalAvailable,omitempty"`
	CrossMatching         bool               `json:"crossMatching,omitempty"`
	RunnersVoidable       bool               `json:"runnersVoidable,omitempty"`
	Version               int64              `json:"version,omitempty"`
	Runners               []Runner           `json:"runners,omitempty"`
	KeyLineDescription    KeyLineDescription `json:"keyLineDescription,omitempty"`
}

type MarketBookParams

type MarketBookParams struct {
	MarketIDs                     []string        `json:"marketIds"`
	PriceProjection               PriceProjection `json:"priceProjection,omitempty"`
	OrderProjection               OrderProjection `json:"orderProjection,omitempty"`
	MatchProjection               MatchProjection `json:"matchProjection,omitempty"`
	IncludeOverallPosition        bool            `json:"includeOverallPosition,omitempty"`
	PartitionMatchedByStrategyRef bool            `json:"partitionMatchedByStrategyRef,omitempty"`
	CustomerStrategyRefs          []string        `json:"customerStrategyRefs,omitempty"`
	CurrencyCode                  string          `json:"currencyCode,omitempty"`
	Locale                        string          `json:"locale,omitempty"`
	MatchedSince                  time.Time       `json:"matchedSince,omitempty"`
	BetIDs                        []string        `json:"betIds,omitempty"`
}

type MarketCatalogueParams

type MarketCatalogueParams struct {
	Filter           MarketFilter     `json:"filter"`
	MarketProjection MarketProjection `json:"marketProjection,omitempty"`
	Sort             MarketSort       `json:"sort,omitempty"`
	MaxResults       int              `json:"maxResults"`
	Locale           string           `json:"locale,omitempty"`
}

type MarketCatalogueResult

type MarketCatalogueResult struct {
	MarketID          string            `json:"marketId"`
	MarketName        string            `json:"marketName"`
	MarketStartTime   time.Time         `json:"marketStartTime,omitempty"`
	MarketDescription MarketDescription `json:"description,omitempty"`
	TotalMatched      float64           `json:"totalMatched,omitempty"`
	Runners           []RunnerCatalog   `json:"runners,omitempty"`
	EventType         EventType         `json:"eventType,omitempty"`
	Competition       Competition       `json:"competition,omitempty"`
	Event             Event             `json:"event,omitempty"`
}

type MarketChange

type MarketChange struct {
	Image            bool             `json:"img"`                        // Replace existing prices/data with the data supplied (null if delta)
	TotalVolume      float64          `json:"tv,omitempty"`               // Total amount matched across the market (null if unchanged)
	MarketDefinition MarketDefinition `json:"marketDefinition,omitempty"` // Full Market Definition if changed
	RunnerChanges    []RunnerChange   `json:"rc"`                         // List of Runner Changes
}

type MarketChangeMessage

type MarketChangeMessage struct {
	ID            int            `json:"id"`
	Op            string         `json:"op"`
	ChangeType    string         `json:"ct"`
	SegmentType   string         `json:"segmentType"`
	ConflateMs    int            `json:"conflateMs"`
	Status        string         `json:"status"`
	HeartbeatMs   int            `json:"heartbeatMs"`
	PublishTime   int64          `json:"pt"`
	InitialClk    string         `json:"initialClk"`
	Clk           string         `json:"clk"`
	MarketChanges []MarketChange `json:"mc"`
}

type MarketDataFilter

type MarketDataFilter struct {
	LadderLevels int      `json:"ladderLevels,omitempty"`
	Fields       []string `json:"fields,omitempty"`
}

type MarketDefinition

type MarketDefinition struct {
	MarketID              string    `json:"id"`                    // Market Id - the id of the market
	Venue                 string    `json:"venue"`                 // The venue - applies to horse racing and greyhound markets only
	BspMarket             bool      `json:"bspMarket"`             // If 'true' the market supports Betfair SP betting
	TurnInPlayEnabled     bool      `json:"turnInPlayEnabled"`     // If 'true' the market is set to turn in-play
	PersistenceEnabled    bool      `json:"persistenceEnabled"`    // If 'true' the market supports 'Keep' bets if the market is to be turned in-play
	MarketBaseRate        float64   `json:"marketBaseRate"`        // The commission rate applicable to the market
	EventID               string    `json:"eventId"`               // The unique id for the event
	EventTypeID           string    `json:"eventTypeId"`           // The unique eventTypeId that the event belongs to
	NumberOfWinners       int       `json:"numberOfWinners"`       // The number of winners on a market
	BettingType           string    `json:"bettingType"`           // The market betting type i.e. ODDS, ASIAN_HANDICAP_DOUBLE_LINE, etc.
	MarketType            string    `json:"marketType"`            // Market base type
	MarketTime            string    `json:"marketTime"`            // The market start time
	SuspendTime           string    `json:"suspendTime"`           // The market suspend time
	BspReconciled         bool      `json:"bspReconciled"`         // True if the market starting price has been reconciled
	Complete              bool      `json:"complete"`              // If false, runners may be added to the market
	InPlay                bool      `json:"inPlay"`                // True if the market is currently in play
	CrossMatching         bool      `json:"crossMatching"`         // True if cross-matching is enabled for this market
	RunnersVoidable       bool      `json:"runnersVoidable"`       // True if runners in the market can be voided
	NumberOfActiveRunners int       `json:"numberOfActiveRunners"` // The number of runners that are currently active
	BetDelay              int       `json:"betDelay"`              // The number of seconds an order is held until it is submitted into the market
	Status                string    `json:"status"`                // The status of the market, for example, OPEN, SUSPENDED, CLOSED (settled), etc.
	Regulators            []string  `json:"regulators"`            // The market regulators
	DiscountAllowed       bool      `json:"discountAllowed"`       // Indicate whether or not the user's discount rate is taken into account in this market
	Timezone              string    `json:"timezone"`              // This is the timezone in which the event is taking place
	OpenDate              time.Time `json:"openDate"`              // The scheduled start date and time of the event (GMT by default)
	Version               int64     `json:"version"`               // A non-monotonically increasing number indicates market changes
}

type MarketDescription

type MarketDescription struct {
	PersistenceEnabled     bool                   `json:"persistenceEnabled"`
	BspMarket              bool                   `json:"bspMarket"`
	MarketTime             time.Time              `json:"marketTime"`
	SuspendTime            time.Time              `json:"suspendTime"`
	SettleTime             time.Time              `json:"settleTime,omitempty"`
	BettingType            MarketBettingType      `json:"bettingType"`
	TurnInPlayEnabled      bool                   `json:"turnInPlayEnabled"`
	MarketType             string                 `json:"marketType"`
	Regulator              string                 `json:"regulator"`
	MarketBaseRate         float64                `json:"marketBaseRate"`
	DiscountAllowed        bool                   `json:"discountAllowed"`
	Wallet                 string                 `json:"wallet,omitempty"`
	Rules                  string                 `json:"rules,omitempty"`
	RulesHasDate           bool                   `json:"rulesHasDate,omitempty"`
	EachWayDivisor         float64                `json:"eachWayDivisor,omitempty"`
	Clarifications         string                 `json:"clarifications,omitempty"`
	LineRangeInfo          MarketLineRangeInfo    `json:"lineRangeInfo,omitempty"`
	RaceType               string                 `json:"raceType,omitempty"`
	PriceLadderDescription PriceLadderDescription `json:"priceLadderDescription,omitempty"`
}

type MarketFilter

type MarketFilter struct {
	TextQuery          string              `json:"textQuery,omitempty"`
	EventTypeIDs       []string            `json:"eventTypeIds,omitempty"`
	EventIDs           []string            `json:"eventIds,omitempty"`
	CompetitionIDs     []string            `json:"competitionIds,omitempty"`
	MarketIDs          []string            `json:"marketIds,omitempty"`
	Venues             []string            `json:"venues,omitempty"`
	BspOnly            bool                `json:"bspOnly,omitempty"`
	TurnInPlayEnabled  bool                `json:"turnInPlayEnabled,omitempty"`
	InPlayOnly         bool                `json:"inPlayOnly,omitempty"`
	MarketBettingTypes []MarketBettingType `json:"marketBettingTypes,omitempty"`
	MarketTypeCodes    []string            `json:"marketTypeCodes,omitempty"`
	MarketCountries    []string            `json:"marketCountries"`
	MarketStartTime    TimeRange           `json:"marketStartTime,omitempty"`
	WithOrders         []OrderStatus       `json:"withOrders,omitempty"`
	RaceTypes          []string            `json:"raceTypes,omitempty"`
}

type MarketLineRangeInfo

type MarketLineRangeInfo struct {
	MaxUnitValue float64 `json:"maxUnitValue"`
	MinUnitValue float64 `json:"minUnitValue"`
	Interval     float64 `json:"interval"`
	MarketUnit   string  `json:"marketUnit"`
}

type MarketOnCloseOrder

type MarketOnCloseOrder struct {
	Liability float64 `json:"liability"`
}

type MarketProfitAndLoss

type MarketProfitAndLoss struct {
	MarketID          string                `json:"marketId,omitempty"`
	CommissionApplied float64               `json:"commissionApplied,omitempty"`
	ProfitAndLosses   []RunnerProfitAndLoss `json:"profitAndLosses,omitempty"`
}

type MarketProfitAndLossParams

type MarketProfitAndLossParams struct {
	MarketIDs          []string `json:"marketIds"`
	IncludeSettledBets bool     `json:"includeSettledBets,omitempty"`
	IncludeBspBets     bool     `json:"includeBspBets,omitempty"`
	NetOfCommission    bool     `json:"netOfCommission,omitempty"`
}

type MarketProjection

type MarketProjection string
const (
	MP_COMPETITION        MarketProjection = "COMPETITION"
	MP_EVENT              MarketProjection = "EVENT"
	MP_EVENT_TYPE         MarketProjection = "EVENT_TYPE"
	MP_MARKET_START_TIME  MarketProjection = "MARKET_START_TIME"
	MP_MARKET_DESCRIPTION MarketProjection = "MARKET_DESCRIPTION"
	MP_RUNNER_DESCRIPTION MarketProjection = "RUNNER_DESCRIPTION"
	MP_RUNNER_METADATA    MarketProjection = "RUNNER_METADATA"
)

type MarketSort

type MarketSort string
const (
	MS_MINIMUM_TRADED    MarketSort = "MINIMUM_TRADED"
	MS_MAXIMUM_TRADED    MarketSort = "MAXIMUM_TRADED"
	MS_MINIMUM_AVAILABLE MarketSort = "MINIMUM_AVAILABLE"
	MS_MAXIMUM_AVAILABLE MarketSort = "MAXIMUM_AVAILABLE"
	MS_FIRST_TO_START    MarketSort = "FIRST_TO_START"
	MS_LAST_TO_START     MarketSort = "LAST_TO_START"
)

type MarketStatus

type MarketStatus string
const (
	MS_INACTIVE  MarketStatus = "INACTIVE"
	MS_OPEN      MarketStatus = "OPEN"
	MS_SUSPENDED MarketStatus = "SUSPENDED"
	MS_CLOSED    MarketStatus = "CLOSED"
)

type MarketSubscriptionMessage

type MarketSubscriptionMessage struct {
	ID                  int                `json:"id"`
	Op                  string             `json:"op"`
	SegmentationEnabled bool               `json:"segmentationEnabled"`
	ConflateMs          int                `json:"conflateMs"`
	HeartbeatMs         int                `json:"heartbeatMs"`
	InitialClk          string             `json:"initialClk,omitempty"`
	Clk                 string             `json:"clk,omitempty"`
	MarketFilter        StreamMarketFilter `json:"marketFilter"`
	MarketDataFilter    MarketDataFilter   `json:"marketDataFilter"`
}

type MarketType

type MarketType string

type MarketTypeParams

type MarketTypeParams struct {
	Filter MarketFilter `json:"filter"`
	Locale string       `json:"locale"`
}

type MarketTypeResult

type MarketTypeResult struct {
	MarketType  string `json:"marketType,omitempty"`
	MarketCount int    `json:"marketCount,omitempty"`
}

type MarketVersion

type MarketVersion struct {
	Version int64 `json:"version,omitempty"`
}

type Match

type Match struct {
	BetID     string    `json:"betId,omitempty"`
	MatchID   string    `json:"matchId,omitempty"`
	Side      Side      `json:"side"`
	Price     float64   `json:"price"`
	Size      float64   `json:"size"`
	MatchDate time.Time `json:"matchDate,omitempty"`
}

type MatchProjection

type MatchProjection string
const (
	MP_NO_ROLLUP              MatchProjection = "NO_ROLLUP"
	MP_ROLLED_UP              MatchProjection = "ROLLED_UP_BY_PRICE"
	MP_ROLLED_UP_BY_AVG_PRICE MatchProjection = "ROLLED_UP_BY_AVG_PRICE"
)

type OffersOverrides

type OffersOverrides struct {
	BestPricesDepth       int         `json:"bestPricesDepth,omitempty"`
	RollupModel           RollupModel `json:"rollupModel,omitempty"`
	RollupLimit           int         `json:"rollupLimit,omitempty"`
	RollupLiability       float64     `json:"rollupLiability,omitempty"`
	RollupLiabilityFactor int         `json:"rollupLiabilityFactor,omitempty"`
}

type Order

type Order struct {
	BetID               string          `json:"betId"`
	OrderType           OrderType       `json:"orderType"`
	Status              OrderStatus     `json:"status"`
	PersistenceType     PersistenceType `json:"persistenceType"`
	Side                Side            `json:"side"`
	Price               float64         `json:"price"`
	Size                float64         `json:"size"`
	BspLiability        float64         `json:"bspLiability"`
	PlacedDate          time.Time       `json:"placedDate"`
	AvgPriceMatched     float64         `json:"avgPriceMatched,omitempty"`
	SizeMatched         float64         `json:"sizeMatched,omitempty"`
	SizeRemaining       float64         `json:"sizeRemaining,omitempty"`
	SizeLapsed          float64         `json:"sizeLapsed,omitempty"`
	SizeCancelled       float64         `json:"sizeCancelled,omitempty"`
	SizeVoided          float64         `json:"sizeVoided,omitempty"`
	CustomerOrderRef    string          `json:"customerOrderRef,omitempty"`
	CustomerStrategyRef string          `json:"customerStrategyRef,omitempty"`
}

type OrderAccountChange

type OrderAccountChange struct {
	MarketID     string        `json:"id"`
	Closed       bool          `json:"closed"`
	FullImage    bool          `json:"fullImage"`
	OrderChanges []OrderChange `json:"orc"`
}

type OrderBy

type OrderBy string
const (
	OB_BY_BET          OrderBy = "BY_BET"
	OB_BY_MARKET       OrderBy = "BY_MARKET"
	OB_BY_MATCH_TIME   OrderBy = "BY_MATCH_TIME"
	OB_BY_PLACE_TIME   OrderBy = "BY_PLACE_TIME"
	OB_BY_SETTLED_TIME OrderBy = "BY_SETTLED_TIME"
	OB_BY_VOID_TIME    OrderBy = "BY_VOID_TIME"
)

type OrderChange

type OrderChange struct {
	FullImage       bool             `json:"fullImage"`    // Replace existing data at runner level with the data supplied (null if delta)
	SelectionID     int64            `json:"id"`           // Selection Id - the id of the runner (selection)
	Handicap        float64          `json:"hc,omitempty"` // Handicap - the handicap of the runner (null if not applicable)
	UnmatchedOrders []UnmatchedOrder `json:"uo"`           // Unmatched Orders on this runner
}

type OrderChangeMessage

type OrderChangeMessage struct {
	ID                 int                `json:"id"`
	Op                 string             `json:"op"`
	ChangeType         string             `json:"ct"`
	SegmentType        string             `json:"segmentType"`
	ConflateMs         int                `json:"conflateMs"`
	Status             string             `json:"status"`
	HeartbeatMs        int                `json:"heartbeatMs"`
	PublishTime        int64              `json:"pt"`
	InitialClk         string             `json:"initialClk"`
	Clk                string             `json:"clk"`
	OrderAccountChange OrderAccountChange `json:"oc"`
}

type OrderFilter

type OrderFilter struct {
	AccountIDs                    bool     `json:"accountIds,omitempty"`
	IncludeOverallPosition        bool     `json:"includeOverallPosition,omitempty"`
	CustomerStrategyRefs          []string `json:"customerStrategyRefs,omitempty"`
	PartitionMatchedByStrategyRef bool     `json:"partitionMatchedByStrategyRef,omitempty"`
}

type OrderProjection

type OrderProjection string
const (
	OP_ALL                OrderProjection = "ALL"
	OP_EXECUTABLE         OrderProjection = "EXECUTABLE"
	OP_EXECUTION_COMPLETE OrderProjection = "EXECUTION_COMPLETE"
)

type OrderStatus

type OrderStatus string
const (
	OS_PENDING            OrderStatus = "PENDING"
	OS_EXECUTION_COMPLETE OrderStatus = "EXECUTION_COMPLETE"
	OS_EXECUTABLE         OrderStatus = "EXECUTABLE"
	OS_EXPIRED            OrderStatus = "EXPIRED"
)

type OrderSubscriptionMessage

type OrderSubscriptionMessage struct {
	ID                  int         `json:"id"`
	Op                  string      `json:"op"`
	SegmentationEnabled bool        `json:"segmentationEnabled"`
	ConflateMs          int         `json:"conflateMs"`
	HeartbeatMs         int         `json:"heartbeatMs"`
	InitialClk          string      `json:"initialClk,omitempty"`
	Clk                 string      `json:"clk,omitempty"`
	OrderFilter         OrderFilter `json:"orderFilter,omitempty"`
}

type OrderType

type OrderType string
const (
	OT_LIMIT           OrderType = "LIMIT"
	OT_LIMIT_ON_CLOSE  OrderType = "LIMIT_ON_CLOSE"
	OT_MARKET_ON_CLOSE OrderType = "MARKET_ON_CLOSE"
)

type PersistenceType

type PersistenceType string
const (
	PT_LAPSE           PersistenceType = "LAPSE"
	PT_PERSIST         PersistenceType = "PERSIST"
	PT_MARKET_ON_CLOSE PersistenceType = "MARKET_ON_CLOSE"
)

type PlaceExecutionReport

type PlaceExecutionReport struct {
	CustomerRef        string                   `json:"customerRef,omitempty"`
	Status             ExecutionReportStatus    `json:"status"`
	ErrorCode          ExecutionReportErrorCode `json:"errorCode,omitempty"`
	MarketID           string                   `json:"marketId,omitempty"`
	InstructionReports []PlaceInstructionReport `json:"instructionReports,omitempty"`
}

type PlaceInstruction

type PlaceInstruction struct {
	OrderType          OrderType          `json:"orderType"`
	SelectionID        int64              `json:"selectionId"`
	Handicap           float64            `json:"handicap,omitempty"`
	Side               Side               `json:"side"`
	LimitOrder         LimitOrder         `json:"limitOrder,omitempty"`
	LimitOnCloseOrder  LimitOnCloseOrder  `json:"limitOnCloseOrder,omitempty"`
	MarketOnCloseOrder MarketOnCloseOrder `json:"marketOnCloseOrder,omitempty"`
	CustomerOrderRef   string             `json:"customerOrderRef,omitempty"`
}

type PlaceInstructionReport

type PlaceInstructionReport struct {
	Status              InstructionReportStatus    `json:"status"`
	ErrorCode           InstructionReportErrorCode `json:"errorCode,omitempty"`
	OrderStatus         OrderStatus                `json:"orderStatus,omitempty"`
	Instruction         PlaceInstruction           `json:"instruction"`
	BetID               string                     `json:"betId,omitempty"`
	PlacedDate          time.Time                  `json:"placedDate,omitempty"`
	AveragePriceMatched float64                    `json:"avgPrice,omitempty"`
	SizeMatched         float64                    `json:"sizeMatched,omitempty"`
}

type PlaceOrdersParams

type PlaceOrdersParams struct {
	MarketID            string             `json:"marketId"`
	Instructions        []PlaceInstruction `json:"instructions"`
	CustomerRef         string             `json:"customerRef,omitempty"`
	MarketVersion       MarketVersion      `json:"marketVersion,omitempty"`
	CustomerStrategyRef string             `json:"customerStrategyRef,omitempty"`
	Async               bool               `json:"async,omitempty"`
}

type PriceData

type PriceData string
const (
	PD_SP_AVAILABLE   PriceData = "SP_AVAILABLE"
	PD_SP_TRADED      PriceData = "SP_TRADED"
	PD_EX_BEST_OFFERS PriceData = "EX_BEST_OFFERS"
	PD_EX_ALL_OFFERS  PriceData = "EX_ALL_OFFERS"
	PD_EX_TRADED      PriceData = "EX_TRADED"
)

type PriceLadderDescription

type PriceLadderDescription struct {
	Type PriceLadderType `json:"priceLadderType,omitempty"`
}

type PriceLadderType

type PriceLadderType string
const (
	PLT_CLASSIC    PriceLadderType = "CLASSIC"
	PLT_FINEST     PriceLadderType = "FINEST"
	PLT_LINE_RANGE PriceLadderType = "LINE_RANGE"
)

type PriceProjection

type PriceProjection struct {
	PriceData             []PriceData     `json:"priceData"`
	ExBestOffersOverrides OffersOverrides `json:"exBestOffersOverrides,omitempty"`
	Virtualise            bool            `json:"virtualise,omitempty"`
	RolloverStakes        bool            `json:"rolloverStakes,omitempty"`
}

type PriceSize

type PriceSize struct {
	Price float64 `json:"price"`
	Size  float64 `json:"size"`
}

type RaceDetails

type RaceDetails struct {
	MeetingID    string       `json:"meetingId,omitempty"`
	RaceID       string       `json:"raceId,omitempty"`
	RaceStatus   RaceStatus   `json:"raceStatus,omitempty"`
	LastUpdated  time.Time    `json:"lastUpdated,omitempty"`
	Sequence     int64        `json:"sequence,omitempty"`
	ResponseCode ResponseCode `json:"responseCode,omitempty"`
}

type RaceDetailsParams

type RaceDetailsParams struct {
	MeetingIDs []string `json:"meetingIds,omitempty"`
	RaceIDs    []string `json:"raceIds,omitempty"`
}

type RaceStatus

type RaceStatus string

type ReplaceExecutionReport

type ReplaceExecutionReport struct {
	CustomerRef        string                     `json:"customerRef,omitempty"`
	Status             ExecutionReportStatus      `json:"status"`
	ErrorCode          ExecutionReportErrorCode   `json:"errorCode,omitempty"`
	MarketID           string                     `json:"marketId,omitempty"`
	InstructionReports []ReplaceInstructionReport `json:"instructionReports,omitempty"`
}

type ReplaceInstruction

type ReplaceInstruction struct {
	BetID    string  `json:"betId"`
	NewPrice float64 `json:"newPrice"`
}

type ReplaceInstructionReport

type ReplaceInstructionReport struct {
	Status                  InstructionReportStatus    `json:"status"`
	ErrorCode               InstructionReportErrorCode `json:"errorCode,omitempty"`
	CancelInstructionReport CancelInstructionReport    `json:"cancelInstructionReport,omitempty"`
	PlaceInstructionReport  PlaceInstructionReport     `json:"placeInstructionReport,omitempty"`
}

type ReplaceOrdersParams

type ReplaceOrdersParams struct {
	MarketID      string               `json:"marketId"`
	Instructions  []ReplaceInstruction `json:"instructions"`
	CustomerRef   string               `json:"customerRef,omitempty"`
	MarketVersion MarketVersion        `json:"marketVersion,omitempty"`
	Async         bool                 `json:"async,omitempty"`
}

type ResponseCode

type ResponseCode string

type RollupModel

type RollupModel string

type Runner

type Runner struct {
	SelectionID       int64              `json:"selectionId"`
	Handicap          float64            `json:"handicap"`
	Status            RunnerStatus       `json:"status"`
	AdjustmentFactor  float64            `json:"adjustmentFactor,omitempty"`
	LastPriceTraded   float64            `json:"lastPriceTraded,omitempty"`
	TotalMatched      float64            `json:"totalMatched,omitempty"`
	RemovalDate       time.Time          `json:"removalDate,omitempty"`
	StartingPrices    StartingPrices     `json:"sp,omitempty"`
	ExchangePrices    ExchangePrices     `json:"ex,omitempty"`
	Orders            []Order            `json:"orders,omitempty"`
	Matches           []Match            `json:"matches,omitempty"`
	MatchesByStrategy map[string][]Match `json:"matchesByStrategy,omitempty"`
}

type RunnerBookParams

type RunnerBookParams struct {
	MarketID                      string          `json:"marketId"`
	SelectionID                   int64           `json:"selectionId"`
	Handicap                      float64         `json:"handicap,omitempty"`
	PriceProjection               PriceProjection `json:"priceProjection,omitempty"`
	OrderProjection               OrderProjection `json:"orderProjection,omitempty"`
	MatchProjection               MatchProjection `json:"matchProjection,omitempty"`
	IncludeOverallPosition        bool            `json:"includeOverallPosition,omitempty"`
	PartitionMatchedByStrategyRef bool            `json:"partitionMatchedByStrategyRef,omitempty"`
	CustomerStrategyRefs          []string        `json:"customerStrategyRefs,omitempty"`
	CurrencyCode                  string          `json:"currencyCode,omitempty"`
	Locale                        string          `json:"locale,omitempty"`
	MatchedSince                  time.Time       `json:"matchedSince,omitempty"`
	BetIDs                        []string        `json:"betIds,omitempty"`
}

type RunnerCatalog

type RunnerCatalog struct {
	SelectionID  int64             `json:"selectionId"`
	RunnerName   string            `json:"runnerName"`
	Handicap     float64           `json:"handicap"`
	SortPriority int               `json:"sortPriority"`
	Metadata     map[string]string `json:"metadata,omitempty"`
}

type RunnerChange

type RunnerChange struct {
	Conflated                  bool        `json:"con"`           // If true, more than one change is combined in this message
	TradedVolume               float64     `json:"tv,omitempty"`  // Traded Volume on this runner (only sent if changed)
	LastTradedPrice            float64     `json:"ltp,omitempty"` // Last Traded Price on this runner (only sent if changed)
	StartingPriceNear          any         `json:"spn,omitempty"` // Starting Price Near (only sent if changed)
	StartingPriceFar           any         `json:"spf,omitempty"` // Starting Price Far (only sent if changed)
	BestAvailableToBack        [][]float64 `json:"batb"`          // Best Available To Back
	BestAvailableToLay         [][]float64 `json:"batl"`          // Best Available To Lay
	BestDisplayAvailableToBack [][]float64 `json:"bdatb"`         // Best Display Available To Back
	BestDisplayAvailableToLay  [][]float64 `json:"bdatl"`         // Best Display Available To Back
	AvailableToBack            [][]float64 `json:"atb"`           // Available To Back (non-virtual prices)
	AvailableToLay             [][]float64 `json:"atl"`           // Available To Lay (non-virtual prices)
	StartingPriceBack          [][]float64 `json:"spb"`           // Starting Price (Available To) Back
	StartingPriceLay           [][]float64 `json:"spl"`           // Starting Price (Available To) Lay
	Traded                     [][]float64 `json:"trd"`           // Traded prices and sizes
}

type RunnerProfitAndLoss

type RunnerProfitAndLoss struct {
	SelectionID int64   `json:"selectionId,omitempty"`
	IfWin       float64 `json:"ifWin,omitempty"`
	IfLose      float64 `json:"ifLose,omitempty"`
	IfPlace     float64 `json:"ifPlace,omitempty"`
}

type RunnerStatus

type RunnerStatus string
const (
	RS_ACTIVE         RunnerStatus = "ACTIVE"
	RS_WINNER         RunnerStatus = "WINNER"
	RS_LOSER          RunnerStatus = "LOSER"
	RS_PLACED         RunnerStatus = "PLACED"
	RS_REMOVED_VACANT RunnerStatus = "REMOVED_VACANT"
	RS_REMOVED        RunnerStatus = "REMOVED"
	RS_HIDDEN         RunnerStatus = "HIDDEN"
)

type SessionResponse

type SessionResponse struct {
	SessionToken string `json:"sessionToken"`
	LoginStatus  string `json:"loginStatus"`
}

type SessionStatus

type SessionStatus string

type SessionStatusError

type SessionStatusError string

type SessionStatusResponse

type SessionStatusResponse struct {
	Token   string             `json:"token"`
	Product string             `json:"product"`
	Status  SessionStatus      `json:"status"`
	Error   SessionStatusError `json:"error"`
}

type Side

type Side string
const (
	SD_BACK Side = "BACK"
	SD_LAY  Side = "LAY"
)

type SortDir

type SortDir string
const (
	SD_EARLIEST_TO_LATEST SortDir = "EARLIEST_TO_LATEST"
	SD_LATEST_TO_EARLIEST SortDir = "LATEST_TO_EARLIEST"
)

type StartingPrices

type StartingPrices struct {
	NearPrice         float64     `json:"nearPrice,omitempty"`
	FarPrice          float64     `json:"farPrice,omitempty"`
	BackStakeTaken    []PriceSize `json:"backStakeTaken,omitempty"`
	LayLiabilityTaken []PriceSize `json:"layLiabilityTaken,omitempty"`
	ActualSP          float64     `json:"actualSP,omitempty"`
}

type StatementLegacyData

type StatementLegacyData struct {
	AvgPrice             float64    `json:"avgPrice"`
	BetSize              float64    `json:"betSize"`
	BetType              string     `json:"betType"`
	BetCategoryType      string     `json:"betCategoryType"`
	CommissionRate       string     `json:"commissionRate"`
	EventID              float64    `json:"eventId"`
	EventTypeID          float64    `json:"eventTypeId"`
	FullMarketName       string     `json:"fullMarketName"`
	GrossBetAmount       float64    `json:"grossBetAmount"`
	MarketName           string     `json:"marketName"`
	MarketType           MarketType `json:"marketType"`
	PlacedDate           time.Time  `json:"placedDate"`
	SelectionID          int64      `json:"selectionId"`
	SelectionName        string     `json:"selectionName"`
	StartDate            time.Time  `json:"startDate"`
	TransactionType      string     `json:"transactionType"`
	TransactionID        float64    `json:"transactionId"`
	WinLose              WinLose    `json:"winLose"`
	DeadHeatPriceDivisor float64    `json:"deadHeatPriceDivisor"`
	AvgPriceRaw          float64    `json:"avgPriceRaw"`
}

type StatusMessage

type StatusMessage struct {
	ID                   int    `json:"id"`
	StatusCode           string `json:"statusCode"`
	ConnectionClosed     bool   `json:"connectionClosed"`
	ErrorCode            string `json:"errorCode"`
	ErrorMessage         string `json:"errorMessage"`
	ConnectionsAvailable int    `json:"connectionsAvailable"`
}

type StreamMarketFilter

type StreamMarketFilter struct {
	MarketIDs         []string `json:"marketIds,omitempty"`
	BspMarket         bool     `json:"bspMarket,omitempty"`
	BettingTypes      []string `json:"bettingTypes,omitempty"`
	EventTypeIDs      []string `json:"eventTypeIds,omitempty"`
	EventIDs          []string `json:"eventIds,omitempty"`
	TurnInPlayEnabled bool     `json:"turnInPlayEnabled,omitempty"`
	MarketTypes       []string `json:"marketTypes,omitempty"`
	Venues            []string `json:"venues,omitempty"`
	CountryCodes      []string `json:"countryCodes,omitempty"`
	RaceTypes         []string `json:"raceTypes,omitempty"`
}

type StreamingClient

type StreamingClient struct {
	Connection          *tls.Conn
	SegmentationEnabled bool
	ConflateMs          int
	HeartbeatMs         int
	InitialClk          string
	Clk                 string
}

func NewStreamingClient

func NewStreamingClient() (client *StreamingClient)

func NewTestStreamingClient

func NewTestStreamingClient(t *testing.T) *StreamingClient

func (*StreamingClient) Authenticate

func (client *StreamingClient) Authenticate(config *tls.Config, applicationKey, sessionToken string) (err error)

func (*StreamingClient) Close

func (client *StreamingClient) Close() error

func (*StreamingClient) Read

func (client *StreamingClient) Read(response any) error

func (*StreamingClient) SubscribeToMarkets

func (client *StreamingClient) SubscribeToMarkets(marketFilter StreamMarketFilter, marketDataFilter MarketDataFilter) (chan MarketChangeMessage, error)

func (*StreamingClient) SubscribeToOrders

func (client *StreamingClient) SubscribeToOrders(orderFilter OrderFilter) (chan OrderChangeMessage, error)

func (*StreamingClient) Write

func (client *StreamingClient) Write(request any, isRequest bool) error

type TimeGranularity

type TimeGranularity string
const (
	TG_DAYS    TimeGranularity = "DAYS"
	TG_HOURS   TimeGranularity = "HOURS"
	TG_MINUTES TimeGranularity = "MINUTES"
)

type TimeInForce

type TimeInForce string
const (
	TIF_FILL_OR_KILL TimeInForce = "FILL_OR_KILL"
)

type TimeRange

type TimeRange struct {
	From string `json:"from,omitempty"`
	To   string `json:"to,omitempty"`
}

type TimeRangeResult

type TimeRangeResult struct {
	TimeRange   TimeRange `json:"timeRange,omitempty"`
	MarketCount int       `json:"marketCount,omitempty"`
}

type TimeRangesParams

type TimeRangesParams struct {
	Filter      MarketFilter    `json:"filter"`
	Granularity TimeGranularity `json:"granularity"`
}

type UnmatchedOrder

type UnmatchedOrder struct {
	BetID               string      `json:"id"`             // Bet Id - the id of the order
	Price               float64     `json:"p"`              // Price - the original placed price of the order
	Size                float64     `json:"s"`              // Size - the original placed size of the order
	Bsp                 float64     `json:"bsp,omitempty"`  // BSP Liability - the BSP liability of the order (null if the order is not a BSP order)
	Side                string      `json:"side"`           // Side - the side of the order
	Status              string      `json:"status"`         // Status - the status of the order (E = EXECUTABLE, EC = EXECUTION_COMPLETE)
	PersistenceType     string      `json:"pt"`             // Persistence Type - whether the order will persist at in play or not
	OrderType           string      `json:"ot"`             // Order Type - the type of the order (L = LIMIT, MOC = MARKET_ON_CLOSE, LOC = LIMIT_ON_CLOSE)
	PlacedDate          time.Time   `json:"pd"`             // Placed Date - the date the order was placed
	MatchedDate         time.Time   `json:"md,omitempty"`   // Matched Date - the date the order was matched (null if the order is not matched)
	CancelledDate       time.Time   `json:"cd,omitempty"`   // Cancelled Date - the date the order was cancelled (null if the order is not cancelled)
	LapsedDate          time.Time   `json:"ld,omitempty"`   // Lapsed Date - the date the order was lapsed (null if the order is not lapsed)
	LapseStatusReason   string      `json:"lsrc,omitempty"` // Lapse Status Reason Code - the reason for lapsed order (null if no portion of the order is lapsed)
	AveragePriceMatched float64     `json:"avp,omitempty"`  // Average Price Matched - the average price the order was matched at (null if the order is not matched)
	SizeMatched         float64     `json:"sm"`             // Size Matched - the amount of the order that has been matched
	SizeRemaining       float64     `json:"sr"`             // Size Remaining - the amount of the order that is remaining unmatched
	SizeLapsed          float64     `json:"sl"`             // Size Lapsed - the amount of the order that has been lapsed
	SizeCancelled       float64     `json:"sc"`             // Size Cancelled - the amount of the order that has been cancelled
	SizeVoided          float64     `json:"sv"`             // Size Voided - the amount of the order that has been voided
	RegulatorAuthCode   string      `json:"rac,omitempty"`  // Regulator Auth Code - the auth code returned by the regulator
	RegulatorCode       string      `json:"rc,omitempty"`   // Regulator Code - the regulator of the order
	ReferenceOrder      string      `json:"rfo,omitempty"`  // Reference Order - the customer supplied order reference
	ReferenceStrategy   string      `json:"rfs"`            // Reference Strategy - the customer-supplied strategy reference used to group orders together (default is "")
	MatchedBacks        [][]float64 `json:"mb"`             // Matched Backs - matched amounts by distinct matched price on the Back side for this runner
	MatchedLays         [][]float64 `json:"ml"`             // Matched Lays - matched amounts by distinct matched price on the Lay side for this runner
}

type UpdateExecutionReport

type UpdateExecutionReport struct {
	CustomerRef        string                    `json:"customerRef,omitempty"`
	Status             ExecutionReportStatus     `json:"status"`
	ErrorCode          ExecutionReportErrorCode  `json:"errorCode,omitempty"`
	MarketID           string                    `json:"marketId,omitempty"`
	InstructionReports []UpdateInstructionReport `json:"instructionReports,omitempty"`
}

type UpdateInstruction

type UpdateInstruction struct {
	BetID              string          `json:"betId"`
	NewPersistenceType PersistenceType `json:"newPersistenceType,omitempty"`
}

type UpdateInstructionReport

type UpdateInstructionReport struct {
	Status            InstructionReportStatus    `json:"status"`
	ErrorCode         InstructionReportErrorCode `json:"errorCode,omitempty"`
	UpdateInstruction UpdateInstruction          `json:"instruction"`
}

type UpdateOrdersParams

type UpdateOrdersParams struct {
	MarketID     string              `json:"marketId"`
	Instructions []UpdateInstruction `json:"instructions"`
	CustomerRef  string              `json:"customerRef,omitempty"`
}

type VenueParams

type VenueParams struct {
	Filter MarketFilter `json:"filter"`
	Locale string       `json:"locale"`
}

type VenueResult

type VenueResult struct {
	Venue       string `json:"venue"`
	MarketCount int    `json:"marketCount"`
}

type Wallet

type Wallet string

type WinLose

type WinLose string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳