Versions in this module Expand all Collapse all v0 v0.1.0 Aug 1, 2026 Changes in this version + const DefaultBaseURL + const DemoBaseURL + const SideAsk + const SideBid + const TIFGoodTillCanceled + const TIFImmediateOrCancel + var ErrOrderNotFound = errors.New("kalshi: order not found") + var ErrPostOnlyCross = errors.New("kalshi: post-only order would cross") + func NormalizeTrades(trades []Trade) + type CancelResult struct + ClientOrderID string + OrderID string + ReducedBy int + ReducedByFP float64 + TSMs int64 + type Candle struct + EndTS int64 + YesAsk int + YesBid int + type Client struct + func NewAuthedClient(hc *http.Client, signer *Signer, baseURL string) *Client + func NewClient(hc *http.Client) *Client + func (c *Client) Balance(ctx context.Context) (int64, error) + func (c *Client) CancelOrder(ctx context.Context, orderID string) (CancelResult, error) + func (c *Client) CreateOrder(ctx context.Context, o Order) (OrderResult, error) + func (c *Client) DiscoverActive(ctx context.Context, series string) ([]Market, error) + func (c *Client) FetchCandlesticks(ctx context.Context, series, ticker string, startTS, endTS int64, ...) ([]Candle, error) + func (c *Client) FetchMarket(ctx context.Context, ticker string) (Market, error) + func (c *Client) FetchOrderbook(ctx context.Context, ticker string) (yesBid, yesAsk int, err error) + func (c *Client) FetchOrderbookDepth(ctx context.Context, ticker string) (yes, no []Level, err error) + func (c *Client) FetchSettled(ctx context.Context, series string, limit int) ([]Market, error) + func (c *Client) FetchTrades(ctx context.Context, ticker string) ([]Trade, error) + func (c *Client) FetchTradesSince(ctx context.Context, ticker string, since time.Time) ([]Trade, error) + func (c *Client) Fills(ctx context.Context, since time.Time) ([]Fill, error) + func (c *Client) OpenOrders(ctx context.Context) ([]OpenOrder, error) + func (c *Client) Positions(ctx context.Context) ([]Position, error) + type Fill struct + BookSide string + Count int + CountFP float64 + FeeC int + FillID string + IsTaker bool + Malformed string + OrderID string + Ticker string + Time time.Time + YesPriceC int + type Level struct + PriceC int + Size int + type Market struct + CloseTime string + OpenTime string + Result string + Status string + Ticker string + Title string + VolumeFP string + YesAsk int + YesAskDollars string + YesBid int + YesBidDollars string + func PickLive(markets []Market, now time.Time, buffer time.Duration) (m Market, ok bool) + type OpenOrder struct + BookSide string + ClientOrderID string + CreatedTime string + Filled int + FilledFP float64 + Malformed string + OrderID string + Remaining int + RemainingFP float64 + Ticker string + YesPriceC int + type Order struct + ClientOrderID string + Count int + PostOnly bool + PriceC int + Side string + Ticker string + TimeInForce string + type OrderResult struct + AvgPriceC int + FillCount int + FillCountFP float64 + OrderID string + Remaining int + RemainingFP float64 + TSMs int64 + TotalFeeC int + type Position struct + ExposureC int64 + Malformed string + NetYes int + NetYesFP float64 + Ticker string + type Signer struct + func NewSigner(keyID, pemKey string) (*Signer, error) + type Trade struct + Count float64 + CountFP string + CreatedTime string + TakerSide string + Time time.Time + TradeID string + YesCents int + YesPriceDollars string