Versions in this module Expand all Collapse all v0 v0.1.0 Aug 1, 2026 Changes in this version + const DefaultAPIURL + const DefaultGatewayURL + const IntentBuyLong + const IntentBuyShort + const IntentSellLong + const IntentSellShort + const StateCanceled + const StateExpired + const StateFilled + const StateNew + const StatePartiallyFilled + const StateRejected + const SubAccountBalance + const SubMarketData + const SubMarketDataLite + const SubOrder + const SubPosition + const SubTrade + const TIFFillOrKill + const TIFGoodTillCancel + const TIFImmediateOrCancel + type APIError struct + Body string + StatusCode int + What string + func (e *APIError) Error() string + type Amount struct + Currency string + Value string + func USD(cents int) Amount + func (a Amount) Cents() int + type BBO struct + AskC int + AskPx string + BidC int + BidPx string + LastTradeC int + LastTradePx string + MarketSlug string + type Balance struct + BalanceC int64 + BuyingPowerC int64 + type Book struct + Bids []Level + MarketSlug string + Offers []Level + State string + type Client struct + func NewAuthedClient(hc *http.Client, signer *Signer, gatewayURL, apiURL string) *Client + func NewClient(hc *http.Client) *Client + func (c *Client) Balance(ctx context.Context) (Balance, error) + func (c *Client) CancelAllOrders(ctx context.Context, slugs ...string) ([]string, error) + func (c *Client) CancelOrder(ctx context.Context, orderID, marketSlug string) error + func (c *Client) ClosePosition(ctx context.Context, marketSlug string) (OrderResult, error) + func (c *Client) CreateOrder(ctx context.Context, o Order) (OrderResult, error) + func (c *Client) DialMarkets(ctx context.Context) (*MarketsStream, error) + func (c *Client) DialPrivate(ctx context.Context) (*PrivateStream, error) + func (c *Client) FetchBBO(ctx context.Context, slug string) (BBO, error) + func (c *Client) FetchBook(ctx context.Context, slug string) (Book, error) + func (c *Client) FetchEvent(ctx context.Context, slug string) (Event, error) + func (c *Client) FetchMarket(ctx context.Context, slug string) (Market, error) + func (c *Client) FetchOrder(ctx context.Context, orderID string) (OpenOrder, error) + func (c *Client) FetchSettlement(ctx context.Context, slug string) (Settlement, error) + func (c *Client) ListMarkets(ctx context.Context, f MarketFilter) ([]Market, error) + func (c *Client) OpenOrders(ctx context.Context, slugs ...string) ([]OpenOrder, error) + func (c *Client) Positions(ctx context.Context) (map[string]Position, error) + type Event struct + Active bool + Closed bool + EndTime string + ID int64 + Markets []Market + Slug string + StartTime string + Title string + type Level struct + PriceC int + Px string + Qty string + Size float64 + type Market struct + Active bool + Closed bool + Description string + EventSlug string + ID int64 + Liquidity float64 + Outcome string + Slug string + Title string + Volume float64 + type MarketFilter struct + ActiveOnly bool + EventSlug string + Limit int + Offset int + type MarketsMessage struct + BBO *BBO + Book *Book + Err string + Heartbeat bool + RequestID string + Trade *StreamTrade + type MarketsStream struct + func (s *MarketsStream) Close() error + func (s *MarketsStream) Next(ctx context.Context) (MarketsMessage, error) + func (s *MarketsStream) SubscribeBBOs(ctx context.Context, requestID string, slugs ...string) error + func (s *MarketsStream) SubscribeBooks(ctx context.Context, requestID string, slugs ...string) error + func (s *MarketsStream) SubscribeTrades(ctx context.Context, requestID string, slugs ...string) error + func (s *MarketsStream) Unsubscribe(ctx context.Context, requestID string) error + type OpenOrder struct + AvgPriceC int + AvgPx string + CreateTime string + CumQuantity int + ID string + Intent string + MarketSlug string + PriceC int + Quantity int + Remaining int + State string + TimeInForce string + type Order struct + Intent string + MarketSlug string + PostOnly bool + PriceC int + Quantity int + TimeInForce string + type OrderResult struct + AvgPriceC int + AvgPx string + FillCount int + OrderID string + Remaining int + State string + type OrderSnapshot struct + EOF bool + Orders []OpenOrder + type Position struct + CostC int + Expired bool + Net int + NetFP float64 + RealizedC int + type PositionSnapshot struct + EOF bool + Positions map[string]Position + type PositionUpdate struct + MarketSlug string + Position Position + type PrivateMessage struct + Balance *Balance + Err string + Execution *StreamExecution + Heartbeat bool + OrderSnapshot *OrderSnapshot + PositionSnapshot *PositionSnapshot + PositionUpdate *PositionUpdate + RequestID string + type PrivateStream struct + func (s *PrivateStream) Close() error + func (s *PrivateStream) Next(ctx context.Context) (PrivateMessage, error) + func (s *PrivateStream) SubscribeBalance(ctx context.Context, requestID string) error + func (s *PrivateStream) SubscribeOrders(ctx context.Context, requestID string, slugs ...string) error + func (s *PrivateStream) SubscribePositions(ctx context.Context, requestID string, slugs ...string) error + func (s *PrivateStream) Unsubscribe(ctx context.Context, requestID string) error + type Settlement struct + MarketSlug string + PriceC int + Px string + SettledAt string + type Signer struct + func NewSigner(keyID, secretKey string) (*Signer, error) + type StreamExecution struct + Aggressor bool + LastPriceC int + LastPx string + LastQty string + LastShares float64 + Order OpenOrder + RejectReason string + TradeID string + TransactTime string + Type string + type StreamTrade struct + MarketSlug string + PriceC int + Px string + Qty string + Quantity float64 + TakerIntent string + TradeTime string