Versions in this module Expand all Collapse all v0 v0.1.0 Aug 18, 2026 Changes in this version + const DefaultBaseURL + func Checksum(userID, authCode, apiSecret string) string + func DoubleSHA256(v string) string + func LoginURL(appCode string) string + func ParseContractCSV(r io.Reader) ([]map[string]string, error) + type APIError struct + Message string + Payload json.RawMessage + StatusCode int + func (e *APIError) Error() string + type Client struct + BaseURL string + HTTPClient *http.Client + UserID string + UserSession string + func New(userSession, userID string, opts ...Option) *Client + func (c *Client) CancelOrder(ctx context.Context, id string, confirmed bool) (map[string]any, error) + func (c *Client) ContractURL(exchange, format string) (string, error) + func (c *Client) CreateOrderWSToken(ctx context.Context) (map[string]any, error) + func (c *Client) CreateWSSession(ctx context.Context) (map[string]any, error) + func (c *Client) Do(ctx context.Context, method, path string, body any, result any) error + func (c *Client) DownloadContracts(ctx context.Context, exchange, format, destination string) error + func (c *Client) ExchangeAuthCode(ctx context.Context, userID, authCode, secret string) (map[string]any, error) + func (c *Client) Funds(ctx context.Context) (map[string]any, error) + func (c *Client) HistoricalData(ctx context.Context, token, resolution string, from, to int64, exchange string) (map[string]any, error) + func (c *Client) Holdings(ctx context.Context, product string) (map[string]any, error) + func (c *Client) InvalidateWSSession(ctx context.Context) (map[string]any, error) + func (c *Client) ModifyOrder(ctx context.Context, id string, changes map[string]any, confirmed bool) (map[string]any, error) + func (c *Client) OrderBook(ctx context.Context) (map[string]any, error) + func (c *Client) OrderHistory(ctx context.Context, id string) (map[string]any, error) + func (c *Client) OrderMargin(ctx context.Context, o Order) (map[string]any, error) + func (c *Client) PlaceOrder(ctx context.Context, o Order, confirmed bool) (map[string]any, error) + func (c *Client) Positions(ctx context.Context) (map[string]any, error) + func (c *Client) Profile(ctx context.Context) (map[string]any, error) + func (c *Client) SquareOff(ctx context.Context, o Order, confirmed bool) (map[string]any, error) + func (c *Client) TradeBook(ctx context.Context) (map[string]any, error) + type MarketTicker struct + Conn *websocket.Conn + OnMessage MessageHandler + UserID string + UserSession string + func (t *MarketTicker) Close() error + func (t *MarketTicker) Connect() error + func (t *MarketTicker) Subscribe(tokens [][2]string, depth bool) error + func (t *MarketTicker) Unsubscribe(tokens [][2]string, depth bool) error + type MessageHandler func(map[string]any) + type Option func(*Client) + func WithBaseURL(v string) Option + func WithHTTPClient(v *http.Client) Option + type Order struct + APIOrderSource string + AlgoID string + DisclosedQuantity any + Exchange string + InstrumentID string + MarketProtectionPercent any + OrderComplexity string + OrderTag string + OrderType string + Price any + Product string + Quantity int + SLTriggerPrice any + TrailingSLAmount any + TransactionType string + Validity string + type OrderTicker struct + Conn *websocket.Conn + OnMessage MessageHandler + OrderToken string + UserID string + func (t *OrderTicker) Close() error + func (t *OrderTicker) Connect() error