predictorsdk

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 8 Imported by: 0

README

sdk-go

The official Go client for the PredictorSDK matching markets API.

Installation

go get github.com/PredictorSDK/sdk-go

Usage

package main

import (
	"context"
	"fmt"

	predictorsdk "github.com/PredictorSDK/sdk-go"
	predictorclient "github.com/PredictorSDK/sdk-go/client"
	"github.com/PredictorSDK/sdk-go/option"
)

func main() {
	client := predictorclient.New(option.WithToken("your-api-key"))

	response, err := client.GetSportsMatchingMarkets(context.TODO(), &predictorsdk.GetSportsMatchingMarketsRequest{
		KalshiEventTicker: []*string{predictorsdk.String("KXMLB-25-NYM-COL-2025-04-03")},
	})
	if err != nil {
		panic(err)
	}
	fmt.Println(response.Markets)
}

Documentation

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Environments = struct {
	Production string
}{
	Production: "https://api.predictorsdk.com",
}

Environments defines all of the API environments. These values can be used with the WithBaseURL RequestOption to override the client's default environment, if any.

View Source
var ErrorCodes internal.ErrorCodes = internal.ErrorCodes{
	400: func(apiError *core.APIError) error {
		return &BadRequestError{
			APIError: apiError,
		}
	},
	401: func(apiError *core.APIError) error {
		return &UnauthorizedError{
			APIError: apiError,
		}
	},
	402: func(apiError *core.APIError) error {
		return &PaymentRequiredError{
			APIError: apiError,
		}
	},
	403: func(apiError *core.APIError) error {
		return &ForbiddenError{
			APIError: apiError,
		}
	},
	429: func(apiError *core.APIError) error {
		return &TooManyRequestsError{
			APIError: apiError,
		}
	},
	503: func(apiError *core.APIError) error {
		return &ServiceUnavailableError{
			APIError: apiError,
		}
	},
	404: func(apiError *core.APIError) error {
		return &NotFoundError{
			APIError: apiError,
		}
	},
	502: func(apiError *core.APIError) error {
		return &BadGatewayError{
			APIError: apiError,
		}
	},
}

Functions

func Bool

func Bool(b bool) *bool

Bool returns a pointer to the given bool value.

func Byte

func Byte(b byte) *byte

Byte returns a pointer to the given byte value.

func Bytes

func Bytes(b []byte) *[]byte

Bytes returns a pointer to the given []byte value.

func Complex64

func Complex64(c complex64) *complex64

Complex64 returns a pointer to the given complex64 value.

func Complex128

func Complex128(c complex128) *complex128

Complex128 returns a pointer to the given complex128 value.

func Float32

func Float32(f float32) *float32

Float32 returns a pointer to the given float32 value.

func Float64

func Float64(f float64) *float64

Float64 returns a pointer to the given float64 value.

func Int

func Int(i int) *int

Int returns a pointer to the given int value.

func Int8

func Int8(i int8) *int8

Int8 returns a pointer to the given int8 value.

func Int16

func Int16(i int16) *int16

Int16 returns a pointer to the given int16 value.

func Int32

func Int32(i int32) *int32

Int32 returns a pointer to the given int32 value.

func Int64

func Int64(i int64) *int64

Int64 returns a pointer to the given int64 value.

func MustParseDate

func MustParseDate(date string) time.Time

MustParseDate attempts to parse the given string as a date time.Time, and panics upon failure.

func MustParseDateTime

func MustParseDateTime(datetime string) time.Time

MustParseDateTime attempts to parse the given string as a datetime time.Time, and panics upon failure.

func Rune

func Rune(r rune) *rune

Rune returns a pointer to the given rune value.

func String

func String(s string) *string

String returns a pointer to the given string value.

func Time

func Time(t time.Time) *time.Time

Time returns a pointer to the given time.Time value.

func UUID

func UUID(u uuid.UUID) *uuid.UUID

UUID returns a pointer to the given uuid.UUID value.

func Uint

func Uint(u uint) *uint

Uint returns a pointer to the given uint value.

func Uint8

func Uint8(u uint8) *uint8

Uint8 returns a pointer to the given uint8 value.

func Uint16

func Uint16(u uint16) *uint16

Uint16 returns a pointer to the given uint16 value.

func Uint32

func Uint32(u uint32) *uint32

Uint32 returns a pointer to the given uint32 value.

func Uint64

func Uint64(u uint64) *uint64

Uint64 returns a pointer to the given uint64 value.

func Uintptr

func Uintptr(u uintptr) *uintptr

Uintptr returns a pointer to the given uintptr value.

Types

type BadGatewayError added in v0.2.0

type BadGatewayError struct {
	*core.APIError
	Body *ErrorResponse
}

Upstream platform failed for an unclassified reason.

func (*BadGatewayError) MarshalJSON added in v0.2.0

func (b *BadGatewayError) MarshalJSON() ([]byte, error)

func (*BadGatewayError) UnmarshalJSON added in v0.2.0

func (b *BadGatewayError) UnmarshalJSON(data []byte) error

func (*BadGatewayError) Unwrap added in v0.2.0

func (b *BadGatewayError) Unwrap() error

type BadRequestError

type BadRequestError struct {
	*core.APIError
	Body *ErrorResponse
}

Invalid query parameters (e.g. combining multiple filter types)

func (*BadRequestError) MarshalJSON

func (b *BadRequestError) MarshalJSON() ([]byte, error)

func (*BadRequestError) UnmarshalJSON

func (b *BadRequestError) UnmarshalJSON(data []byte) error

func (*BadRequestError) Unwrap

func (b *BadRequestError) Unwrap() error

type CryptoPriceItem added in v0.2.0

type CryptoPriceItem struct {
	// Trading pair in lowercase (e.g. `btcusdt`).
	Symbol string `json:"symbol" url:"symbol"`
	// Close price for the 1-second interval.
	Value float64 `json:"value" url:"value"`
	// Unix timestamp in milliseconds for the start of the 1-second interval.
	Timestamp int64 `json:"timestamp" url:"timestamp"`
	// contains filtered or unexported fields
}

func (*CryptoPriceItem) GetExtraProperties added in v0.2.0

func (c *CryptoPriceItem) GetExtraProperties() map[string]interface{}

func (*CryptoPriceItem) GetSymbol added in v0.2.0

func (c *CryptoPriceItem) GetSymbol() string

func (*CryptoPriceItem) GetTimestamp added in v0.2.0

func (c *CryptoPriceItem) GetTimestamp() int64

func (*CryptoPriceItem) GetValue added in v0.2.0

func (c *CryptoPriceItem) GetValue() float64

func (*CryptoPriceItem) MarshalJSON added in v0.2.0

func (c *CryptoPriceItem) MarshalJSON() ([]byte, error)

func (*CryptoPriceItem) SetSymbol added in v0.2.0

func (c *CryptoPriceItem) SetSymbol(symbol string)

SetSymbol sets the Symbol field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptoPriceItem) SetTimestamp added in v0.2.0

func (c *CryptoPriceItem) SetTimestamp(timestamp int64)

SetTimestamp sets the Timestamp field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptoPriceItem) SetValue added in v0.2.0

func (c *CryptoPriceItem) SetValue(value float64)

SetValue sets the Value field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptoPriceItem) String added in v0.2.0

func (c *CryptoPriceItem) String() string

func (*CryptoPriceItem) UnmarshalJSON added in v0.2.0

func (c *CryptoPriceItem) UnmarshalJSON(data []byte) error

type CryptoPricesResponse added in v0.2.0

type CryptoPricesResponse struct {
	Prices []*CryptoPriceItem `json:"prices" url:"prices"`
	// Base64-encoded cursor for fetching the next page. Absent when there are no more results.
	PaginationKey *string `json:"pagination_key,omitempty" url:"pagination_key,omitempty"`
	// Number of prices in this response page. Omitted on empty responses for unknown symbols.
	Total *int `json:"total,omitempty" url:"total,omitempty"`
	// contains filtered or unexported fields
}

func (*CryptoPricesResponse) GetExtraProperties added in v0.2.0

func (c *CryptoPricesResponse) GetExtraProperties() map[string]interface{}

func (*CryptoPricesResponse) GetPaginationKey added in v0.2.0

func (c *CryptoPricesResponse) GetPaginationKey() *string

func (*CryptoPricesResponse) GetPrices added in v0.2.0

func (c *CryptoPricesResponse) GetPrices() []*CryptoPriceItem

func (*CryptoPricesResponse) GetTotal added in v0.2.0

func (c *CryptoPricesResponse) GetTotal() *int

func (*CryptoPricesResponse) MarshalJSON added in v0.2.0

func (c *CryptoPricesResponse) MarshalJSON() ([]byte, error)

func (*CryptoPricesResponse) SetPaginationKey added in v0.2.0

func (c *CryptoPricesResponse) SetPaginationKey(paginationKey *string)

SetPaginationKey sets the PaginationKey field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptoPricesResponse) SetPrices added in v0.2.0

func (c *CryptoPricesResponse) SetPrices(prices []*CryptoPriceItem)

SetPrices sets the Prices field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptoPricesResponse) SetTotal added in v0.2.0

func (c *CryptoPricesResponse) SetTotal(total *int)

SetTotal sets the Total field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*CryptoPricesResponse) String added in v0.2.0

func (c *CryptoPricesResponse) String() string

func (*CryptoPricesResponse) UnmarshalJSON added in v0.2.0

func (c *CryptoPricesResponse) UnmarshalJSON(data []byte) error

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error" url:"error"`
	// Additional detail about the error. May be present, including on some validation errors.
	Message    *string `json:"message,omitempty" url:"message,omitempty"`
	StatusCode int     `json:"status_code" url:"status_code"`
	// contains filtered or unexported fields
}

func (*ErrorResponse) GetError

func (e *ErrorResponse) GetError() string

func (*ErrorResponse) GetExtraProperties

func (e *ErrorResponse) GetExtraProperties() map[string]interface{}

func (*ErrorResponse) GetMessage added in v0.2.0

func (e *ErrorResponse) GetMessage() *string

func (*ErrorResponse) GetStatusCode

func (e *ErrorResponse) GetStatusCode() int

func (*ErrorResponse) MarshalJSON

func (e *ErrorResponse) MarshalJSON() ([]byte, error)

func (*ErrorResponse) SetError

func (e *ErrorResponse) SetError(error_ string)

SetError sets the Error field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*ErrorResponse) SetMessage added in v0.2.0

func (e *ErrorResponse) SetMessage(message *string)

SetMessage sets the Message field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*ErrorResponse) SetStatusCode

func (e *ErrorResponse) SetStatusCode(statusCode int)

SetStatusCode sets the StatusCode field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*ErrorResponse) String

func (e *ErrorResponse) String() string

func (*ErrorResponse) UnmarshalJSON

func (e *ErrorResponse) UnmarshalJSON(data []byte) error

type EventFanout added in v0.5.0

type EventFanout struct {
	// Sibling event tickers the server attempted to fetch alongside the primary event. Determined by the Kalshi sibling registry for the primary event's series.
	SiblingsAttempted []string `json:"siblings_attempted" url:"siblings_attempted"`
	// Sibling event tickers that returned successfully and contributed markets to the merged response.
	SiblingsReturned []string `json:"siblings_returned" url:"siblings_returned"`
	// Sibling event tickers that did not exist upstream (404) or errored. The primary event still returned 200 — these are reported for observability, not as request failures.
	SiblingsMissing []string `json:"siblings_missing" url:"siblings_missing"`
	// contains filtered or unexported fields
}

func (*EventFanout) GetExtraProperties added in v0.5.0

func (e *EventFanout) GetExtraProperties() map[string]interface{}

func (*EventFanout) GetSiblingsAttempted added in v0.5.0

func (e *EventFanout) GetSiblingsAttempted() []string

func (*EventFanout) GetSiblingsMissing added in v0.5.0

func (e *EventFanout) GetSiblingsMissing() []string

func (*EventFanout) GetSiblingsReturned added in v0.5.0

func (e *EventFanout) GetSiblingsReturned() []string

func (*EventFanout) MarshalJSON added in v0.5.0

func (e *EventFanout) MarshalJSON() ([]byte, error)

func (*EventFanout) SetSiblingsAttempted added in v0.5.0

func (e *EventFanout) SetSiblingsAttempted(siblingsAttempted []string)

SetSiblingsAttempted sets the SiblingsAttempted field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*EventFanout) SetSiblingsMissing added in v0.5.0

func (e *EventFanout) SetSiblingsMissing(siblingsMissing []string)

SetSiblingsMissing sets the SiblingsMissing field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*EventFanout) SetSiblingsReturned added in v0.5.0

func (e *EventFanout) SetSiblingsReturned(siblingsReturned []string)

SetSiblingsReturned sets the SiblingsReturned field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*EventFanout) String added in v0.5.0

func (e *EventFanout) String() string

func (*EventFanout) UnmarshalJSON added in v0.5.0

func (e *EventFanout) UnmarshalJSON(data []byte) error

type EventMarket added in v0.5.0

type EventMarket struct {
	// Platform-native market identifier. Kalshi ticker (`KXMLBGAME-26MAY221840CLEPHI-CLE`), Polymarket numeric market id, SX Bet `marketHash`, or Predict market id.
	MarketID string `json:"market_id" url:"market_id"`
	// Human-readable market title/question.
	Title string `json:"title" url:"title"`
	// contains filtered or unexported fields
}

func (*EventMarket) GetExtraProperties added in v0.5.0

func (e *EventMarket) GetExtraProperties() map[string]interface{}

func (*EventMarket) GetMarketID added in v0.5.0

func (e *EventMarket) GetMarketID() string

func (*EventMarket) GetTitle added in v0.5.0

func (e *EventMarket) GetTitle() string

func (*EventMarket) MarshalJSON added in v0.5.0

func (e *EventMarket) MarshalJSON() ([]byte, error)

func (*EventMarket) SetMarketID added in v0.5.0

func (e *EventMarket) SetMarketID(marketID string)

SetMarketID sets the MarketID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*EventMarket) SetTitle added in v0.5.0

func (e *EventMarket) SetTitle(title string)

SetTitle sets the Title field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*EventMarket) String added in v0.5.0

func (e *EventMarket) String() string

func (*EventMarket) UnmarshalJSON added in v0.5.0

func (e *EventMarket) UnmarshalJSON(data []byte) error

type EventResponse added in v0.5.0

type EventResponse struct {
	// Echo of the platform-native event identifier supplied in the request path.
	EventID string `json:"event_id" url:"event_id"`
	// The platform the event_id was resolved against, either inferred from the ID format or supplied via `?platform=`.
	Platform EventResponsePlatform `json:"platform" url:"platform"`
	// Human-readable event title from the platform.
	Title string `json:"title" url:"title"`
	// Markets nested under this event. Order is platform-native for the primary event, followed by markets from fanout siblings (Kalshi sports) in registry order.
	Markets []*EventMarket `json:"markets" url:"markets"`
	// Present when the response was assembled from multiple upstream events (Kalshi sports sibling fanout). Lists which sibling event tickers were attempted, which contributed markets, and which failed or didn't exist. Absent for non-Kalshi platforms and for Kalshi events whose series is not in the sibling registry.
	Fanout *EventFanout `json:"fanout,omitempty" url:"fanout,omitempty"`
	// contains filtered or unexported fields
}

func (*EventResponse) GetEventID added in v0.5.0

func (e *EventResponse) GetEventID() string

func (*EventResponse) GetExtraProperties added in v0.5.0

func (e *EventResponse) GetExtraProperties() map[string]interface{}

func (*EventResponse) GetFanout added in v0.5.0

func (e *EventResponse) GetFanout() *EventFanout

func (*EventResponse) GetMarkets added in v0.5.0

func (e *EventResponse) GetMarkets() []*EventMarket

func (*EventResponse) GetPlatform added in v0.5.0

func (e *EventResponse) GetPlatform() EventResponsePlatform

func (*EventResponse) GetTitle added in v0.5.0

func (e *EventResponse) GetTitle() string

func (*EventResponse) MarshalJSON added in v0.5.0

func (e *EventResponse) MarshalJSON() ([]byte, error)

func (*EventResponse) SetEventID added in v0.5.0

func (e *EventResponse) SetEventID(eventID string)

SetEventID sets the EventID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*EventResponse) SetFanout added in v0.5.0

func (e *EventResponse) SetFanout(fanout *EventFanout)

SetFanout sets the Fanout field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*EventResponse) SetMarkets added in v0.5.0

func (e *EventResponse) SetMarkets(markets []*EventMarket)

SetMarkets sets the Markets field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*EventResponse) SetPlatform added in v0.5.0

func (e *EventResponse) SetPlatform(platform EventResponsePlatform)

SetPlatform sets the Platform field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*EventResponse) SetTitle added in v0.5.0

func (e *EventResponse) SetTitle(title string)

SetTitle sets the Title field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*EventResponse) String added in v0.5.0

func (e *EventResponse) String() string

func (*EventResponse) UnmarshalJSON added in v0.5.0

func (e *EventResponse) UnmarshalJSON(data []byte) error

type EventResponsePlatform added in v0.5.0

type EventResponsePlatform string

The platform the event_id was resolved against, either inferred from the ID format or supplied via `?platform=`.

const (
	EventResponsePlatformKalshi     EventResponsePlatform = "kalshi"
	EventResponsePlatformPolymarket EventResponsePlatform = "polymarket"
	EventResponsePlatformPredict    EventResponsePlatform = "predict"
	EventResponsePlatformSxbet      EventResponsePlatform = "sxbet"
)

func NewEventResponsePlatformFromString added in v0.5.0

func NewEventResponsePlatformFromString(s string) (EventResponsePlatform, error)

func (EventResponsePlatform) Ptr added in v0.5.0

type FileParam

type FileParam struct {
	io.Reader
	// contains filtered or unexported fields
}

FileParam is a file type suitable for multipart/form-data uploads.

func NewFileParam

func NewFileParam(
	reader io.Reader,
	filename string,
	contentType string,
	opts ...FileParamOption,
) *FileParam

NewFileParam returns a *FileParam type suitable for multipart/form-data uploads. All file upload endpoints accept a simple io.Reader, which is usually created by opening a file via os.Open.

However, some endpoints require additional metadata about the file such as a specific Content-Type or custom filename. FileParam makes it easier to create the correct type signature for these endpoints.

func (*FileParam) ContentType

func (f *FileParam) ContentType() string

func (*FileParam) Name

func (f *FileParam) Name() string

type FileParamOption

type FileParamOption interface {
	// contains filtered or unexported methods
}

FileParamOption adapts the behavior of the FileParam. No options are implemented yet, but this interface allows for future extensibility.

type ForbiddenError

type ForbiddenError struct {
	*core.APIError
	Body *ErrorResponse
}

API key lacks the required permission

func (*ForbiddenError) MarshalJSON

func (f *ForbiddenError) MarshalJSON() ([]byte, error)

func (*ForbiddenError) UnmarshalJSON

func (f *ForbiddenError) UnmarshalJSON(data []byte) error

func (*ForbiddenError) Unwrap

func (f *ForbiddenError) Unwrap() error

type GetBinanceCryptoPricesRequest added in v0.2.0

type GetBinanceCryptoPricesRequest struct {
	// Binance trading pair (e.g. `btcusdt`, `ethusdt`, `solusdt`). Must contain only alphanumeric characters (no hyphens, underscores, or other separators). Uppercase is accepted and automatically lowercased (e.g. `BTCUSDT` → `btcusdt`). Must be a valid Binance symbol; unknown symbols return `200` with an empty `prices` array.
	Currency string `json:"-" url:"currency"`
	// Start of the time range as a Unix timestamp in milliseconds (inclusive). Negative values are clamped to 0.
	StartTime *int64 `json:"-" url:"start_time,omitempty"`
	// End of the time range as a Unix timestamp in milliseconds (inclusive). Negative values are clamped to 0.
	EndTime *int64 `json:"-" url:"end_time,omitempty"`
	// Maximum number of prices to return. Defaults to 100 when a time range is present. Values above 100 are silently clamped to 100. Without a time range, this parameter is ignored — the endpoint always returns the single latest price.
	Limit *int `json:"-" url:"limit,omitempty"`
	// Base64-encoded cursor from a previous response to fetch the next page of results.
	PaginationKey *string `json:"-" url:"pagination_key,omitempty"`
	// contains filtered or unexported fields
}

func (*GetBinanceCryptoPricesRequest) SetCurrency added in v0.2.0

func (g *GetBinanceCryptoPricesRequest) SetCurrency(currency string)

SetCurrency sets the Currency field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetBinanceCryptoPricesRequest) SetEndTime added in v0.2.0

func (g *GetBinanceCryptoPricesRequest) SetEndTime(endTime *int64)

SetEndTime sets the EndTime field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetBinanceCryptoPricesRequest) SetLimit added in v0.2.0

func (g *GetBinanceCryptoPricesRequest) SetLimit(limit *int)

SetLimit sets the Limit field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetBinanceCryptoPricesRequest) SetPaginationKey added in v0.2.0

func (g *GetBinanceCryptoPricesRequest) SetPaginationKey(paginationKey *string)

SetPaginationKey sets the PaginationKey field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetBinanceCryptoPricesRequest) SetStartTime added in v0.2.0

func (g *GetBinanceCryptoPricesRequest) SetStartTime(startTime *int64)

SetStartTime sets the StartTime field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type GetEventRequest added in v0.5.0

type GetEventRequest struct {
	// Platform-native event identifier. Examples per platform: Kalshi event ticker (`KXMLBGAME-26MAY221840CLEPHI`), Polymarket event slug (`mlb-cle-phi-2026-05-22`), SX Bet event id (`L10073358`), Predict market id (`110629`).
	EventID string `json:"-" url:"-"`
	// Optional platform override. When omitted, inferred from the `event_id` format: `KX…` → Kalshi, `L\d+` → SX Bet. Numeric IDs and kebab-case slugs are shared shape between Polymarket and Predict; in that case the service probes Polymarket first and falls back to Predict on 404. Pass `platform` explicitly to skip the probe.
	Platform *GetEventRequestPlatform `json:"-" url:"platform,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEventRequest) SetEventID added in v0.5.0

func (g *GetEventRequest) SetEventID(eventID string)

SetEventID sets the EventID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetEventRequest) SetPlatform added in v0.5.0

func (g *GetEventRequest) SetPlatform(platform *GetEventRequestPlatform)

SetPlatform sets the Platform field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type GetEventRequestPlatform added in v0.5.0

type GetEventRequestPlatform string
const (
	GetEventRequestPlatformKalshi     GetEventRequestPlatform = "kalshi"
	GetEventRequestPlatformPolymarket GetEventRequestPlatform = "polymarket"
	GetEventRequestPlatformPredict    GetEventRequestPlatform = "predict"
	GetEventRequestPlatformSxbet      GetEventRequestPlatform = "sxbet"
)

func NewGetEventRequestPlatformFromString added in v0.5.0

func NewGetEventRequestPlatformFromString(s string) (GetEventRequestPlatform, error)

func (GetEventRequestPlatform) Ptr added in v0.5.0

type GetMarketRequest added in v0.6.0

type GetMarketRequest struct {
	// Composite (`{provider}:{native_id}`) or platform-native market identifier. Examples per platform: Kalshi market ticker (`KXMLBGAME-26MAY262005HOUTEX-TEX`), Polymarket numeric id or slug (`540817` or `new-rhianna-album-before-gta-vi-926`), Predict market id (`356635`), SX Bet `marketHash` (`0x…64hex`).
	MarketID string `json:"-" url:"-"`
	// Optional platform override. When omitted, inferred from the composite prefix or from the native ID format (`KX…` → Kalshi, `0x…64hex` → SX Bet). Numeric IDs and kebab-case slugs are shared shape between Polymarket and Predict; in that case the service probes Polymarket first and falls back to Predict on 404. Pass `platform` explicitly to skip the probe. When the override contradicts a composite prefix (e.g. `kalshi:X` with `?platform=polymarket`), the request returns 400.
	Platform *GetMarketRequestPlatform `json:"-" url:"platform,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMarketRequest) SetMarketID added in v0.6.0

func (g *GetMarketRequest) SetMarketID(marketID string)

SetMarketID sets the MarketID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetMarketRequest) SetPlatform added in v0.6.0

func (g *GetMarketRequest) SetPlatform(platform *GetMarketRequestPlatform)

SetPlatform sets the Platform field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type GetMarketRequestPlatform added in v0.6.0

type GetMarketRequestPlatform string
const (
	GetMarketRequestPlatformKalshi     GetMarketRequestPlatform = "kalshi"
	GetMarketRequestPlatformPolymarket GetMarketRequestPlatform = "polymarket"
	GetMarketRequestPlatformPredict    GetMarketRequestPlatform = "predict"
	GetMarketRequestPlatformSxbet      GetMarketRequestPlatform = "sxbet"
)

func NewGetMarketRequestPlatformFromString added in v0.6.0

func NewGetMarketRequestPlatformFromString(s string) (GetMarketRequestPlatform, error)

func (GetMarketRequestPlatform) Ptr added in v0.6.0

type GetMarketsRequest added in v0.3.0

type GetMarketsRequest struct {
	// Maximum number of markets to return per page. Range 1–100, default 25.
	Limit *int `json:"-" url:"limit,omitempty"`
	// Opaque cursor from a previous response's `pagination.nextCursor` in the SDKs (raw JSON: `pagination.next_cursor`).
	Cursor *string `json:"-" url:"cursor,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMarketsRequest) SetCursor added in v0.3.0

func (g *GetMarketsRequest) SetCursor(cursor *string)

SetCursor sets the Cursor field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetMarketsRequest) SetLimit added in v0.3.0

func (g *GetMarketsRequest) SetLimit(limit *int)

SetLimit sets the Limit field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type GetPolymarketWalletRequest added in v0.4.0

type GetPolymarketWalletRequest struct {
	// Wallet address to look up. May be a Polymarket proxy address or the underlying signer EOA — the endpoint resolves either form. Must match `^0x[a-fA-F0-9]{40}$`. Mixed-case input is accepted and lowercased in the response. Mutually exclusive with `username`; exactly one of the two is required.
	Address *string `json:"-" url:"address,omitempty"`
	// Polymarket display name to look up. Match is case-insensitive and exact against the user's stored `name` (so `Car`, `car`, and `CAR` all resolve, but `Theo` does not match `Theo47`). A leading `@` is accepted and stripped before the lookup. Mutually exclusive with `address`; exactly one of the two is required. Example: `Car`.
	Username *string `json:"-" url:"username,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPolymarketWalletRequest) SetAddress added in v0.4.0

func (g *GetPolymarketWalletRequest) SetAddress(address *string)

SetAddress sets the Address field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetPolymarketWalletRequest) SetUsername added in v0.4.0

func (g *GetPolymarketWalletRequest) SetUsername(username *string)

SetUsername sets the Username field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type GetSportsMatchingMarketsRequest

type GetSportsMatchingMarketsRequest struct {
	// Maximum number of matched events to return per page. Range 1–100, default 25. Ignored when a platform-ID filter is supplied.
	Limit *int `json:"-" url:"limit,omitempty"`
	// Opaque cursor from a previous response's `pagination.nextCursor` in the SDKs (raw JSON: `pagination.next_cursor`). Must be used with the same filter set — a cursor from `include_settled=true` cannot be replayed against `include_settled=false` and will return `400`.
	Cursor *string `json:"-" url:"cursor,omitempty"`
	// When `true`, include settled/archived events alongside currently live matches. Defaults to `false`.
	IncludeSettled *bool `json:"-" url:"include_settled,omitempty"`
	// Kalshi event ticker(s) to find matching markets for (e.g. `KXNFLGAME-25AUG16ARIDEN`). Provide the parameter multiple times for multiple tickers. Only one filter type may be used per request. Lookup mode — pagination parameters are ignored.
	KalshiEventTicker []*string `json:"-" url:"kalshi_event_ticker,omitempty"`
	// Polymarket market slug(s) to find matching markets for (e.g. `nfl-ari-den-2025-08-16`). Provide the parameter multiple times for multiple slugs. Only one filter type may be used per request. Lookup mode — pagination parameters are ignored.
	PolymarketMarketSlug []*string `json:"-" url:"polymarket_market_slug,omitempty"`
	// Predict market ID(s) to find matching markets for (e.g. `110629`). Provide the parameter multiple times for multiple IDs. Only one filter type may be used per request. Lookup mode — pagination parameters are ignored.
	PredictMarketID []*string `json:"-" url:"predict_market_id,omitempty"`
	// SX Bet market ID(s) to find matching markets for (e.g. `0x4c000abdbf197ef32ecdf15561b1d636f1e5b02629f466678757fd83e2ec3599`). Provide the parameter multiple times for multiple IDs. Only one filter type may be used per request. Lookup mode — pagination parameters are ignored.
	SxbetMarketID []*string `json:"-" url:"sxbet_market_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetSportsMatchingMarketsRequest) SetCursor added in v0.3.0

func (g *GetSportsMatchingMarketsRequest) SetCursor(cursor *string)

SetCursor sets the Cursor field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetSportsMatchingMarketsRequest) SetIncludeSettled added in v0.3.0

func (g *GetSportsMatchingMarketsRequest) SetIncludeSettled(includeSettled *bool)

SetIncludeSettled sets the IncludeSettled field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetSportsMatchingMarketsRequest) SetKalshiEventTicker

func (g *GetSportsMatchingMarketsRequest) SetKalshiEventTicker(kalshiEventTicker []*string)

SetKalshiEventTicker sets the KalshiEventTicker field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetSportsMatchingMarketsRequest) SetLimit added in v0.3.0

func (g *GetSportsMatchingMarketsRequest) SetLimit(limit *int)

SetLimit sets the Limit field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetSportsMatchingMarketsRequest) SetPolymarketMarketSlug

func (g *GetSportsMatchingMarketsRequest) SetPolymarketMarketSlug(polymarketMarketSlug []*string)

SetPolymarketMarketSlug sets the PolymarketMarketSlug field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetSportsMatchingMarketsRequest) SetPredictMarketID

func (g *GetSportsMatchingMarketsRequest) SetPredictMarketID(predictMarketID []*string)

SetPredictMarketID sets the PredictMarketID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*GetSportsMatchingMarketsRequest) SetSxbetMarketID

func (g *GetSportsMatchingMarketsRequest) SetSxbetMarketID(sxbetMarketID []*string)

SetSxbetMarketID sets the SxbetMarketID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type ListPolymarketWalletPositionsRequest added in v0.5.0

type ListPolymarketWalletPositionsRequest struct {
	// Polymarket proxy wallet address. Must match `^0x[a-fA-F0-9]{40}$`. Mixed-case input is accepted and lowercased in the response. Mutually exclusive with `username`; exactly one of the two is required.
	Address *string `json:"-" url:"address,omitempty"`
	// Polymarket display name to resolve to a proxy wallet. Match is case-insensitive and exact against the user's stored `name`. A leading `@` is accepted and stripped. Mutually exclusive with `address`.
	Username *string `json:"-" url:"username,omitempty"`
	// Number of items per page. Defaults to 50.
	Limit *int `json:"-" url:"limit,omitempty"`
	// Opaque cursor from a previous response's `pagination.next_cursor`. Bound to the resolved wallet address — replaying a cursor against a different identifier returns `400`.
	Cursor *string `json:"-" url:"cursor,omitempty"`
	// contains filtered or unexported fields
}

func (*ListPolymarketWalletPositionsRequest) SetAddress added in v0.5.0

func (l *ListPolymarketWalletPositionsRequest) SetAddress(address *string)

SetAddress sets the Address field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*ListPolymarketWalletPositionsRequest) SetCursor added in v0.5.0

func (l *ListPolymarketWalletPositionsRequest) SetCursor(cursor *string)

SetCursor sets the Cursor field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*ListPolymarketWalletPositionsRequest) SetLimit added in v0.5.0

func (l *ListPolymarketWalletPositionsRequest) SetLimit(limit *int)

SetLimit sets the Limit field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*ListPolymarketWalletPositionsRequest) SetUsername added in v0.5.0

func (l *ListPolymarketWalletPositionsRequest) SetUsername(username *string)

SetUsername sets the Username field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

type MarketDetailOutcome added in v0.6.0

type MarketDetailOutcome struct {
	// Outcome label as the platform reports it. Kalshi binary markets normalize to `Yes`/`No`; Polymarket parses the stringified outcomes array (also typically `Yes`/`No`); Predict reports per-outcome names; SX Bet uses outcome-one/outcome-two names (e.g. team labels with spreads applied).
	Name string `json:"name" url:"name"`
	// contains filtered or unexported fields
}

func (*MarketDetailOutcome) GetExtraProperties added in v0.6.0

func (m *MarketDetailOutcome) GetExtraProperties() map[string]interface{}

func (*MarketDetailOutcome) GetName added in v0.6.0

func (m *MarketDetailOutcome) GetName() string

func (*MarketDetailOutcome) MarshalJSON added in v0.6.0

func (m *MarketDetailOutcome) MarshalJSON() ([]byte, error)

func (*MarketDetailOutcome) SetName added in v0.6.0

func (m *MarketDetailOutcome) SetName(name string)

SetName sets the Name field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*MarketDetailOutcome) String added in v0.6.0

func (m *MarketDetailOutcome) String() string

func (*MarketDetailOutcome) UnmarshalJSON added in v0.6.0

func (m *MarketDetailOutcome) UnmarshalJSON(data []byte) error

type MarketDetailResponse added in v0.6.0

type MarketDetailResponse struct {
	// Composite market identifier in the format `{provider}:{provider_id}`. Matches the `id` field returned by `GET /v1/markets` so list output flows into detail lookups without preprocessing.
	ID string `json:"id" url:"id"`
	// Prediction market provider the market_id resolved against.
	Provider MarketDetailResponseProvider `json:"provider" url:"provider"`
	// Platform-native market identifier. Kalshi ticker, Polymarket numeric id, Predict numeric id, or SX Bet `marketHash`. For Polymarket markets resolved by slug, this is normalized to the numeric id.
	ProviderID string `json:"provider_id" url:"provider_id"`
	// Human-readable market title. Each platform exposes a slightly different field — Kalshi `title`, Polymarket `question`, Predict `title`, SX Bet composed from team names with outcome-name fallback for outright markets.
	Title string `json:"title" url:"title"`
	// Normalized lifecycle status. Mapping per platform: Kalshi `active` → open · `closed`/`determined` → closed · `settled`/`finalized` → settled. Polymarket `archived` → settled · `closed && !archived` → closed · otherwise → open. Predict `tradingStatus=OPEN` → open · `CLOSED && !RESOLVED` → closed · `status=RESOLVED` → settled. SX Bet `ACTIVE` → open · otherwise closed. Unknown upstream values default to closed.
	Status MarketDetailResponseStatus `json:"status" url:"status"`
	// Outcome labels for the market. Every supported platform models per-market outcomes as a 2-element list in practice (multi-outcome events are modeled as multiple binary markets nested under one event/category). Prices and sizes are deliberately omitted from v0 — see the endpoint description.
	Outcomes []*MarketDetailOutcome `json:"outcomes" url:"outcomes"`
	// contains filtered or unexported fields
}

func (*MarketDetailResponse) GetExtraProperties added in v0.6.0

func (m *MarketDetailResponse) GetExtraProperties() map[string]interface{}

func (*MarketDetailResponse) GetID added in v0.6.0

func (m *MarketDetailResponse) GetID() string

func (*MarketDetailResponse) GetOutcomes added in v0.6.0

func (m *MarketDetailResponse) GetOutcomes() []*MarketDetailOutcome

func (*MarketDetailResponse) GetProvider added in v0.6.0

func (*MarketDetailResponse) GetProviderID added in v0.6.0

func (m *MarketDetailResponse) GetProviderID() string

func (*MarketDetailResponse) GetStatus added in v0.6.0

func (*MarketDetailResponse) GetTitle added in v0.6.0

func (m *MarketDetailResponse) GetTitle() string

func (*MarketDetailResponse) MarshalJSON added in v0.6.0

func (m *MarketDetailResponse) MarshalJSON() ([]byte, error)

func (*MarketDetailResponse) SetID added in v0.6.0

func (m *MarketDetailResponse) SetID(id string)

SetID sets the ID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*MarketDetailResponse) SetOutcomes added in v0.6.0

func (m *MarketDetailResponse) SetOutcomes(outcomes []*MarketDetailOutcome)

SetOutcomes sets the Outcomes field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*MarketDetailResponse) SetProvider added in v0.6.0

func (m *MarketDetailResponse) SetProvider(provider MarketDetailResponseProvider)

SetProvider sets the Provider field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*MarketDetailResponse) SetProviderID added in v0.6.0

func (m *MarketDetailResponse) SetProviderID(providerID string)

SetProviderID sets the ProviderID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*MarketDetailResponse) SetStatus added in v0.6.0

func (m *MarketDetailResponse) SetStatus(status MarketDetailResponseStatus)

SetStatus sets the Status field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*MarketDetailResponse) SetTitle added in v0.6.0

func (m *MarketDetailResponse) SetTitle(title string)

SetTitle sets the Title field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*MarketDetailResponse) String added in v0.6.0

func (m *MarketDetailResponse) String() string

func (*MarketDetailResponse) UnmarshalJSON added in v0.6.0

func (m *MarketDetailResponse) UnmarshalJSON(data []byte) error

type MarketDetailResponseProvider added in v0.6.0

type MarketDetailResponseProvider string

Prediction market provider the market_id resolved against.

const (
	MarketDetailResponseProviderKalshi     MarketDetailResponseProvider = "kalshi"
	MarketDetailResponseProviderPolymarket MarketDetailResponseProvider = "polymarket"
	MarketDetailResponseProviderPredict    MarketDetailResponseProvider = "predict"
	MarketDetailResponseProviderSxbet      MarketDetailResponseProvider = "sxbet"
)

func NewMarketDetailResponseProviderFromString added in v0.6.0

func NewMarketDetailResponseProviderFromString(s string) (MarketDetailResponseProvider, error)

func (MarketDetailResponseProvider) Ptr added in v0.6.0

type MarketDetailResponseStatus added in v0.6.0

type MarketDetailResponseStatus string

Normalized lifecycle status. Mapping per platform: Kalshi `active` → open · `closed`/`determined` → closed · `settled`/`finalized` → settled. Polymarket `archived` → settled · `closed && !archived` → closed · otherwise → open. Predict `tradingStatus=OPEN` → open · `CLOSED && !RESOLVED` → closed · `status=RESOLVED` → settled. SX Bet `ACTIVE` → open · otherwise closed. Unknown upstream values default to closed.

const (
	MarketDetailResponseStatusOpen    MarketDetailResponseStatus = "open"
	MarketDetailResponseStatusClosed  MarketDetailResponseStatus = "closed"
	MarketDetailResponseStatusSettled MarketDetailResponseStatus = "settled"
)

func NewMarketDetailResponseStatusFromString added in v0.6.0

func NewMarketDetailResponseStatusFromString(s string) (MarketDetailResponseStatus, error)

func (MarketDetailResponseStatus) Ptr added in v0.6.0

type MarketsListResponse added in v0.3.0

type MarketsListResponse struct {
	// Array of markets for the current page.
	Data []*UnifiedMarket `json:"data" url:"data"`
	// Pagination metadata for the current page.
	Pagination *PaginationBlock `json:"pagination" url:"pagination"`
	// contains filtered or unexported fields
}

func (*MarketsListResponse) GetData added in v0.3.0

func (m *MarketsListResponse) GetData() []*UnifiedMarket

func (*MarketsListResponse) GetExtraProperties added in v0.3.0

func (m *MarketsListResponse) GetExtraProperties() map[string]interface{}

func (*MarketsListResponse) GetPagination added in v0.3.0

func (m *MarketsListResponse) GetPagination() *PaginationBlock

func (*MarketsListResponse) MarshalJSON added in v0.3.0

func (m *MarketsListResponse) MarshalJSON() ([]byte, error)

func (*MarketsListResponse) SetData added in v0.3.0

func (m *MarketsListResponse) SetData(data []*UnifiedMarket)

SetData sets the Data field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*MarketsListResponse) SetPagination added in v0.3.0

func (m *MarketsListResponse) SetPagination(pagination *PaginationBlock)

SetPagination sets the Pagination field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*MarketsListResponse) String added in v0.3.0

func (m *MarketsListResponse) String() string

func (*MarketsListResponse) UnmarshalJSON added in v0.3.0

func (m *MarketsListResponse) UnmarshalJSON(data []byte) error

type NotFoundError added in v0.4.0

type NotFoundError struct {
	*core.APIError
	Body *ErrorResponse
}

Resource not found.

func (*NotFoundError) MarshalJSON added in v0.4.0

func (n *NotFoundError) MarshalJSON() ([]byte, error)

func (*NotFoundError) UnmarshalJSON added in v0.4.0

func (n *NotFoundError) UnmarshalJSON(data []byte) error

func (*NotFoundError) Unwrap added in v0.4.0

func (n *NotFoundError) Unwrap() error

type PaginationBlock added in v0.3.0

type PaginationBlock struct {
	// Number of items requested per page (echoes the `limit` query param).
	Limit int `json:"limit" url:"limit"`
	// Total matching items across all pages, when known. Set to `0` for endpoints whose upstream does not expose a total count — clients should rely on `has_more` and `next_cursor` to paginate in that case.
	Total int `json:"total" url:"total"`
	// Whether additional pages exist beyond this one.
	HasMore bool `json:"has_more" url:"has_more"`
	// Opaque cursor for fetching the next page. Pass back via the `cursor` query parameter. Omitted when `has_more` is `false`. Clients must preserve the same filter set when re-using a cursor — mismatches return `400`.
	NextCursor *string `json:"next_cursor,omitempty" url:"next_cursor,omitempty"`
	// contains filtered or unexported fields
}

func (*PaginationBlock) GetExtraProperties added in v0.3.0

func (p *PaginationBlock) GetExtraProperties() map[string]interface{}

func (*PaginationBlock) GetHasMore added in v0.3.0

func (p *PaginationBlock) GetHasMore() bool

func (*PaginationBlock) GetLimit added in v0.3.0

func (p *PaginationBlock) GetLimit() int

func (*PaginationBlock) GetNextCursor added in v0.3.0

func (p *PaginationBlock) GetNextCursor() *string

func (*PaginationBlock) GetTotal added in v0.3.0

func (p *PaginationBlock) GetTotal() int

func (*PaginationBlock) MarshalJSON added in v0.3.0

func (p *PaginationBlock) MarshalJSON() ([]byte, error)

func (*PaginationBlock) SetHasMore added in v0.3.0

func (p *PaginationBlock) SetHasMore(hasMore bool)

SetHasMore sets the HasMore field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PaginationBlock) SetLimit added in v0.3.0

func (p *PaginationBlock) SetLimit(limit int)

SetLimit sets the Limit field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PaginationBlock) SetNextCursor added in v0.3.0

func (p *PaginationBlock) SetNextCursor(nextCursor *string)

SetNextCursor sets the NextCursor field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PaginationBlock) SetTotal added in v0.3.0

func (p *PaginationBlock) SetTotal(total int)

SetTotal sets the Total field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PaginationBlock) String added in v0.3.0

func (p *PaginationBlock) String() string

func (*PaginationBlock) UnmarshalJSON added in v0.3.0

func (p *PaginationBlock) UnmarshalJSON(data []byte) error

type PaymentRequiredError added in v0.3.1

type PaymentRequiredError struct {
	*core.APIError
	Body *PaymentRequiredErrorBody
}

Free tier monthly request allowance is exhausted, or the caller's paid subscription is in a payment-recovery state. This endpoint is available on every plan, so 402 never indicates a tier mismatch here.

func (*PaymentRequiredError) MarshalJSON added in v0.3.1

func (p *PaymentRequiredError) MarshalJSON() ([]byte, error)

func (*PaymentRequiredError) UnmarshalJSON added in v0.3.1

func (p *PaymentRequiredError) UnmarshalJSON(data []byte) error

func (*PaymentRequiredError) Unwrap added in v0.3.1

func (p *PaymentRequiredError) Unwrap() error

type PaymentRequiredErrorAction added in v0.3.1

type PaymentRequiredErrorAction string

Recommended client action for this 402.

const (
	PaymentRequiredErrorActionUpgradePlan    PaymentRequiredErrorAction = "upgrade_plan"
	PaymentRequiredErrorActionResolvePayment PaymentRequiredErrorAction = "resolve_payment"
)

func NewPaymentRequiredErrorActionFromString added in v0.3.1

func NewPaymentRequiredErrorActionFromString(s string) (PaymentRequiredErrorAction, error)

func (PaymentRequiredErrorAction) Ptr added in v0.3.1

type PaymentRequiredErrorBody added in v0.3.1

type PaymentRequiredErrorBody struct {
	Error string `json:"error" url:"error"`
	// Additional detail about the error.
	Message    *string `json:"message,omitempty" url:"message,omitempty"`
	StatusCode int     `json:"status_code" url:"status_code"`
	// Recommended client action for this 402.
	Action PaymentRequiredErrorAction `json:"action" url:"action"`
	// Billing tier that would satisfy the gate (e.g. `starter`, `pro`, `business`, `enterprise`).
	RequiredTier string `json:"required_tier" url:"required_tier"`
	// Billing tier currently associated with the caller.
	CurrentTier string `json:"current_tier" url:"current_tier"`
	// Monthly Free-tier allowance. Present only when the 402 is caused by the Free cap.
	IncludedRequestsPerMonth *int64 `json:"included_requests_per_month,omitempty" url:"included_requests_per_month,omitempty"`
	// Requests the Free caller has made in the current calendar month. Present only when the 402 is caused by the Free cap.
	CurrentPeriodRequests *int64 `json:"current_period_requests,omitempty" url:"current_period_requests,omitempty"`
	// contains filtered or unexported fields
}

func (*PaymentRequiredErrorBody) GetAction added in v0.3.1

func (*PaymentRequiredErrorBody) GetCurrentPeriodRequests added in v0.3.1

func (p *PaymentRequiredErrorBody) GetCurrentPeriodRequests() *int64

func (*PaymentRequiredErrorBody) GetCurrentTier added in v0.3.1

func (p *PaymentRequiredErrorBody) GetCurrentTier() string

func (*PaymentRequiredErrorBody) GetError added in v0.3.1

func (p *PaymentRequiredErrorBody) GetError() string

func (*PaymentRequiredErrorBody) GetExtraProperties added in v0.3.1

func (p *PaymentRequiredErrorBody) GetExtraProperties() map[string]interface{}

func (*PaymentRequiredErrorBody) GetIncludedRequestsPerMonth added in v0.3.1

func (p *PaymentRequiredErrorBody) GetIncludedRequestsPerMonth() *int64

func (*PaymentRequiredErrorBody) GetMessage added in v0.3.1

func (p *PaymentRequiredErrorBody) GetMessage() *string

func (*PaymentRequiredErrorBody) GetRequiredTier added in v0.3.1

func (p *PaymentRequiredErrorBody) GetRequiredTier() string

func (*PaymentRequiredErrorBody) GetStatusCode added in v0.3.1

func (p *PaymentRequiredErrorBody) GetStatusCode() int

func (*PaymentRequiredErrorBody) MarshalJSON added in v0.3.1

func (p *PaymentRequiredErrorBody) MarshalJSON() ([]byte, error)

func (*PaymentRequiredErrorBody) SetAction added in v0.3.1

SetAction sets the Action field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PaymentRequiredErrorBody) SetCurrentPeriodRequests added in v0.3.1

func (p *PaymentRequiredErrorBody) SetCurrentPeriodRequests(currentPeriodRequests *int64)

SetCurrentPeriodRequests sets the CurrentPeriodRequests field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PaymentRequiredErrorBody) SetCurrentTier added in v0.3.1

func (p *PaymentRequiredErrorBody) SetCurrentTier(currentTier string)

SetCurrentTier sets the CurrentTier field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PaymentRequiredErrorBody) SetError added in v0.3.1

func (p *PaymentRequiredErrorBody) SetError(error_ string)

SetError sets the Error field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PaymentRequiredErrorBody) SetIncludedRequestsPerMonth added in v0.3.1

func (p *PaymentRequiredErrorBody) SetIncludedRequestsPerMonth(includedRequestsPerMonth *int64)

SetIncludedRequestsPerMonth sets the IncludedRequestsPerMonth field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PaymentRequiredErrorBody) SetMessage added in v0.3.1

func (p *PaymentRequiredErrorBody) SetMessage(message *string)

SetMessage sets the Message field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PaymentRequiredErrorBody) SetRequiredTier added in v0.3.1

func (p *PaymentRequiredErrorBody) SetRequiredTier(requiredTier string)

SetRequiredTier sets the RequiredTier field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PaymentRequiredErrorBody) SetStatusCode added in v0.3.1

func (p *PaymentRequiredErrorBody) SetStatusCode(statusCode int)

SetStatusCode sets the StatusCode field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PaymentRequiredErrorBody) String added in v0.3.1

func (p *PaymentRequiredErrorBody) String() string

func (*PaymentRequiredErrorBody) UnmarshalJSON added in v0.3.1

func (p *PaymentRequiredErrorBody) UnmarshalJSON(data []byte) error

type PlatformMarket

type PlatformMarket struct {
	Platform PlatformMarketPlatform `json:"platform" url:"platform"`
	// Kalshi event ticker. Present when platform is KALSHI.
	EventTicker *string `json:"event_ticker,omitempty" url:"event_ticker,omitempty"`
	// Kalshi market tickers. Present when platform is KALSHI.
	MarketTickers []string `json:"market_tickers,omitempty" url:"market_tickers,omitempty"`
	// Polymarket market slug. Present when platform is POLYMARKET.
	MarketSlug *string `json:"market_slug,omitempty" url:"market_slug,omitempty"`
	// Polymarket token IDs. Present when platform is POLYMARKET.
	TokenIDs []string `json:"token_ids,omitempty" url:"token_ids,omitempty"`
	// Source market ID. Present for platforms other than Kalshi and Polymarket.
	MarketID *string `json:"market_id,omitempty" url:"market_id,omitempty"`
	// Source outcome IDs. Present for platforms that use outcome IDs.
	OutcomeIDs []string `json:"outcome_ids,omitempty" url:"outcome_ids,omitempty"`
	// contains filtered or unexported fields
}

func (*PlatformMarket) GetEventTicker

func (p *PlatformMarket) GetEventTicker() *string

func (*PlatformMarket) GetExtraProperties

func (p *PlatformMarket) GetExtraProperties() map[string]interface{}

func (*PlatformMarket) GetMarketID

func (p *PlatformMarket) GetMarketID() *string

func (*PlatformMarket) GetMarketSlug

func (p *PlatformMarket) GetMarketSlug() *string

func (*PlatformMarket) GetMarketTickers

func (p *PlatformMarket) GetMarketTickers() []string

func (*PlatformMarket) GetOutcomeIDs

func (p *PlatformMarket) GetOutcomeIDs() []string

func (*PlatformMarket) GetPlatform

func (p *PlatformMarket) GetPlatform() PlatformMarketPlatform

func (*PlatformMarket) GetTokenIDs

func (p *PlatformMarket) GetTokenIDs() []string

func (*PlatformMarket) MarshalJSON

func (p *PlatformMarket) MarshalJSON() ([]byte, error)

func (*PlatformMarket) SetEventTicker

func (p *PlatformMarket) SetEventTicker(eventTicker *string)

SetEventTicker sets the EventTicker field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PlatformMarket) SetMarketID

func (p *PlatformMarket) SetMarketID(marketID *string)

SetMarketID sets the MarketID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PlatformMarket) SetMarketSlug

func (p *PlatformMarket) SetMarketSlug(marketSlug *string)

SetMarketSlug sets the MarketSlug field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PlatformMarket) SetMarketTickers

func (p *PlatformMarket) SetMarketTickers(marketTickers []string)

SetMarketTickers sets the MarketTickers field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PlatformMarket) SetOutcomeIDs

func (p *PlatformMarket) SetOutcomeIDs(outcomeIDs []string)

SetOutcomeIDs sets the OutcomeIDs field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PlatformMarket) SetPlatform

func (p *PlatformMarket) SetPlatform(platform PlatformMarketPlatform)

SetPlatform sets the Platform field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PlatformMarket) SetTokenIDs

func (p *PlatformMarket) SetTokenIDs(tokenIDs []string)

SetTokenIDs sets the TokenIDs field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PlatformMarket) String

func (p *PlatformMarket) String() string

func (*PlatformMarket) UnmarshalJSON

func (p *PlatformMarket) UnmarshalJSON(data []byte) error

type PlatformMarketPlatform

type PlatformMarketPlatform string
const (
	PlatformMarketPlatformKalshi     PlatformMarketPlatform = "KALSHI"
	PlatformMarketPlatformPolymarket PlatformMarketPlatform = "POLYMARKET"
	PlatformMarketPlatformPredict    PlatformMarketPlatform = "PREDICT"
	PlatformMarketPlatformSxbet      PlatformMarketPlatform = "SXBET"
)

func NewPlatformMarketPlatformFromString

func NewPlatformMarketPlatformFromString(s string) (PlatformMarketPlatform, error)

func (PlatformMarketPlatform) Ptr

type PolymarketPosition added in v0.5.0

type PolymarketPosition struct {
	// Polymarket condition ID (`0x`-prefixed hex).
	ConditionID string `json:"condition_id" url:"condition_id"`
	// Outcome label held in this position (`Yes`/`No` for binary markets).
	Outcome string `json:"outcome" url:"outcome"`
	// Number of outcome shares held.
	Shares float64 `json:"shares" url:"shares"`
	// contains filtered or unexported fields
}

func (*PolymarketPosition) GetConditionID added in v0.5.0

func (p *PolymarketPosition) GetConditionID() string

func (*PolymarketPosition) GetExtraProperties added in v0.5.0

func (p *PolymarketPosition) GetExtraProperties() map[string]interface{}

func (*PolymarketPosition) GetOutcome added in v0.5.0

func (p *PolymarketPosition) GetOutcome() string

func (*PolymarketPosition) GetShares added in v0.5.0

func (p *PolymarketPosition) GetShares() float64

func (*PolymarketPosition) MarshalJSON added in v0.5.0

func (p *PolymarketPosition) MarshalJSON() ([]byte, error)

func (*PolymarketPosition) SetConditionID added in v0.5.0

func (p *PolymarketPosition) SetConditionID(conditionID string)

SetConditionID sets the ConditionID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PolymarketPosition) SetOutcome added in v0.5.0

func (p *PolymarketPosition) SetOutcome(outcome string)

SetOutcome sets the Outcome field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PolymarketPosition) SetShares added in v0.5.0

func (p *PolymarketPosition) SetShares(shares float64)

SetShares sets the Shares field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PolymarketPosition) String added in v0.5.0

func (p *PolymarketPosition) String() string

func (*PolymarketPosition) UnmarshalJSON added in v0.5.0

func (p *PolymarketPosition) UnmarshalJSON(data []byte) error

type PolymarketPositionsResponse added in v0.5.0

type PolymarketPositionsResponse struct {
	// Resolved Polymarket proxy wallet (lowercased).
	Address    string                `json:"address" url:"address"`
	Data       []*PolymarketPosition `json:"data" url:"data"`
	Pagination *PaginationBlock      `json:"pagination" url:"pagination"`
	// contains filtered or unexported fields
}

func (*PolymarketPositionsResponse) GetAddress added in v0.5.0

func (p *PolymarketPositionsResponse) GetAddress() string

func (*PolymarketPositionsResponse) GetData added in v0.5.0

func (*PolymarketPositionsResponse) GetExtraProperties added in v0.5.0

func (p *PolymarketPositionsResponse) GetExtraProperties() map[string]interface{}

func (*PolymarketPositionsResponse) GetPagination added in v0.5.0

func (p *PolymarketPositionsResponse) GetPagination() *PaginationBlock

func (*PolymarketPositionsResponse) MarshalJSON added in v0.5.0

func (p *PolymarketPositionsResponse) MarshalJSON() ([]byte, error)

func (*PolymarketPositionsResponse) SetAddress added in v0.5.0

func (p *PolymarketPositionsResponse) SetAddress(address string)

SetAddress sets the Address field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PolymarketPositionsResponse) SetData added in v0.5.0

func (p *PolymarketPositionsResponse) SetData(data []*PolymarketPosition)

SetData sets the Data field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PolymarketPositionsResponse) SetPagination added in v0.5.0

func (p *PolymarketPositionsResponse) SetPagination(pagination *PaginationBlock)

SetPagination sets the Pagination field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PolymarketPositionsResponse) String added in v0.5.0

func (p *PolymarketPositionsResponse) String() string

func (*PolymarketPositionsResponse) UnmarshalJSON added in v0.5.0

func (p *PolymarketPositionsResponse) UnmarshalJSON(data []byte) error

type PolymarketWalletResponse added in v0.4.0

type PolymarketWalletResponse struct {
	// Polymarket proxy address (lowercased) the profile is keyed on. When the input was a signer EOA, this is the resolved proxy.
	Address string `json:"address" url:"address"`
	// Original signer EOA from the request, when the input was an EOA that resolved to a different proxy. `null` when the input was already a proxy address (no resolution needed) or when no populated profile could be found for the resolved proxy.
	Signer *string `json:"signer,omitempty" url:"signer,omitempty"`
	// URL of the wallet's profile image, or `null` if unset.
	ProfileImage *string `json:"profile_image,omitempty" url:"profile_image,omitempty"`
	// User-chosen display name when set; otherwise the auto-generated pseudonym Polymarket assigns. `null` only when both are missing.
	DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"`
	// contains filtered or unexported fields
}

func (*PolymarketWalletResponse) GetAddress added in v0.4.0

func (p *PolymarketWalletResponse) GetAddress() string

func (*PolymarketWalletResponse) GetDisplayName added in v0.4.0

func (p *PolymarketWalletResponse) GetDisplayName() *string

func (*PolymarketWalletResponse) GetExtraProperties added in v0.4.0

func (p *PolymarketWalletResponse) GetExtraProperties() map[string]interface{}

func (*PolymarketWalletResponse) GetProfileImage added in v0.4.0

func (p *PolymarketWalletResponse) GetProfileImage() *string

func (*PolymarketWalletResponse) GetSigner added in v0.4.0

func (p *PolymarketWalletResponse) GetSigner() *string

func (*PolymarketWalletResponse) MarshalJSON added in v0.4.0

func (p *PolymarketWalletResponse) MarshalJSON() ([]byte, error)

func (*PolymarketWalletResponse) SetAddress added in v0.4.0

func (p *PolymarketWalletResponse) SetAddress(address string)

SetAddress sets the Address field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PolymarketWalletResponse) SetDisplayName added in v0.4.0

func (p *PolymarketWalletResponse) SetDisplayName(displayName *string)

SetDisplayName sets the DisplayName field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PolymarketWalletResponse) SetProfileImage added in v0.4.0

func (p *PolymarketWalletResponse) SetProfileImage(profileImage *string)

SetProfileImage sets the ProfileImage field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PolymarketWalletResponse) SetSigner added in v0.4.0

func (p *PolymarketWalletResponse) SetSigner(signer *string)

SetSigner sets the Signer field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*PolymarketWalletResponse) String added in v0.4.0

func (p *PolymarketWalletResponse) String() string

func (*PolymarketWalletResponse) UnmarshalJSON added in v0.4.0

func (p *PolymarketWalletResponse) UnmarshalJSON(data []byte) error

type ServiceUnavailableError

type ServiceUnavailableError struct {
	*core.APIError
	Body *ErrorResponse
}

Matching markets reader unavailable

func (*ServiceUnavailableError) MarshalJSON

func (s *ServiceUnavailableError) MarshalJSON() ([]byte, error)

func (*ServiceUnavailableError) UnmarshalJSON

func (s *ServiceUnavailableError) UnmarshalJSON(data []byte) error

func (*ServiceUnavailableError) Unwrap

func (s *ServiceUnavailableError) Unwrap() error

type SportsMatchingResponse

type SportsMatchingResponse struct {
	// Key-value pairs where each key is the queried identifier (Kalshi event ticker, Polymarket slug, or canonical event ID when no filter is provided) and each value is an array of platform market objects.
	Markets map[string][]*PlatformMarket `json:"markets" url:"markets"`
	// Pagination metadata for the current page. Present in list mode (no platform-ID filter). Absent in lookup mode since the response is bounded by the filter.
	Pagination *PaginationBlock `json:"pagination,omitempty" url:"pagination,omitempty"`
	// contains filtered or unexported fields
}

func (*SportsMatchingResponse) GetExtraProperties

func (s *SportsMatchingResponse) GetExtraProperties() map[string]interface{}

func (*SportsMatchingResponse) GetMarkets

func (s *SportsMatchingResponse) GetMarkets() map[string][]*PlatformMarket

func (*SportsMatchingResponse) GetPagination added in v0.3.0

func (s *SportsMatchingResponse) GetPagination() *PaginationBlock

func (*SportsMatchingResponse) MarshalJSON

func (s *SportsMatchingResponse) MarshalJSON() ([]byte, error)

func (*SportsMatchingResponse) SetMarkets

func (s *SportsMatchingResponse) SetMarkets(markets map[string][]*PlatformMarket)

SetMarkets sets the Markets field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*SportsMatchingResponse) SetPagination added in v0.3.0

func (s *SportsMatchingResponse) SetPagination(pagination *PaginationBlock)

SetPagination sets the Pagination field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*SportsMatchingResponse) String

func (s *SportsMatchingResponse) String() string

func (*SportsMatchingResponse) UnmarshalJSON

func (s *SportsMatchingResponse) UnmarshalJSON(data []byte) error

type TooManyRequestsError

type TooManyRequestsError struct {
	*core.APIError
	Body *ErrorResponse
}

API key exceeded its rate limit

func (*TooManyRequestsError) MarshalJSON

func (t *TooManyRequestsError) MarshalJSON() ([]byte, error)

func (*TooManyRequestsError) UnmarshalJSON

func (t *TooManyRequestsError) UnmarshalJSON(data []byte) error

func (*TooManyRequestsError) Unwrap

func (t *TooManyRequestsError) Unwrap() error

type UnauthorizedError

type UnauthorizedError struct {
	*core.APIError
	Body *ErrorResponse
}

Missing or invalid API key

func (*UnauthorizedError) MarshalJSON

func (u *UnauthorizedError) MarshalJSON() ([]byte, error)

func (*UnauthorizedError) UnmarshalJSON

func (u *UnauthorizedError) UnmarshalJSON(data []byte) error

func (*UnauthorizedError) Unwrap

func (u *UnauthorizedError) Unwrap() error

type UnifiedMarket added in v0.3.0

type UnifiedMarket struct {
	// Composite market identifier in the format `{provider}:{provider_id}` (e.g. `kalshi:KXNBAGAME-26MAR06INDLAL-LAL`).
	ID string `json:"id" url:"id"`
	// Prediction market provider.
	Provider UnifiedMarketProvider `json:"provider" url:"provider"`
	// Human-readable market title/question.
	Title string `json:"title" url:"title"`
	// contains filtered or unexported fields
}

func (*UnifiedMarket) GetExtraProperties added in v0.3.0

func (u *UnifiedMarket) GetExtraProperties() map[string]interface{}

func (*UnifiedMarket) GetID added in v0.3.0

func (u *UnifiedMarket) GetID() string

func (*UnifiedMarket) GetProvider added in v0.3.0

func (u *UnifiedMarket) GetProvider() UnifiedMarketProvider

func (*UnifiedMarket) GetTitle added in v0.3.0

func (u *UnifiedMarket) GetTitle() string

func (*UnifiedMarket) MarshalJSON added in v0.3.0

func (u *UnifiedMarket) MarshalJSON() ([]byte, error)

func (*UnifiedMarket) SetID added in v0.3.0

func (u *UnifiedMarket) SetID(id string)

SetID sets the ID field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*UnifiedMarket) SetProvider added in v0.3.0

func (u *UnifiedMarket) SetProvider(provider UnifiedMarketProvider)

SetProvider sets the Provider field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*UnifiedMarket) SetTitle added in v0.3.0

func (u *UnifiedMarket) SetTitle(title string)

SetTitle sets the Title field and marks it as non-optional; this prevents an empty or null value for this field from being omitted during serialization.

func (*UnifiedMarket) String added in v0.3.0

func (u *UnifiedMarket) String() string

func (*UnifiedMarket) UnmarshalJSON added in v0.3.0

func (u *UnifiedMarket) UnmarshalJSON(data []byte) error

type UnifiedMarketProvider added in v0.3.0

type UnifiedMarketProvider string

Prediction market provider.

const (
	UnifiedMarketProviderKalshi     UnifiedMarketProvider = "kalshi"
	UnifiedMarketProviderPolymarket UnifiedMarketProvider = "polymarket"
	UnifiedMarketProviderPredict    UnifiedMarketProvider = "predict"
	UnifiedMarketProviderSxbet      UnifiedMarketProvider = "sxbet"
)

func NewUnifiedMarketProviderFromString added in v0.3.0

func NewUnifiedMarketProviderFromString(s string) (UnifiedMarketProvider, error)

func (UnifiedMarketProvider) Ptr added in v0.3.0

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL