Versions in this module Expand all Collapse all v0 v0.2.20 May 27, 2026 Changes in this version + type AuthResult struct + AccessToken string + ExpiresIn int64 + RefreshToken string + Scope string + TokenType string + type Client struct + HTTPClient *http.Client + func NewClient() *Client + func (c *Client) Buy(ctx context.Context, req OrderRequest) (*OrderResult, error) + func (c *Client) CancelAll(ctx context.Context) (int64, error) + func (c *Client) CancelAllByInstrument(ctx context.Context, instrumentName string) (int64, error) + func (c *Client) CancelOrder(ctx context.Context, orderID string) (*OrderRecord, error) + func (c *Client) GetInstruments(ctx context.Context, currency, kind string, expired bool) ([]Instrument, error) + func (c *Client) GetLastTradesByInstrument(ctx context.Context, instrumentName string, count int) (*TradesResult, error) + func (c *Client) GetOpenOrdersByInstrument(ctx context.Context, instrumentName string) ([]OrderRecord, error) + func (c *Client) GetOrderBook(ctx context.Context, instrumentName string, depth int) (*OrderBook, error) + func (c *Client) GetOrderHistoryByInstrument(ctx context.Context, instrumentName string, count int) ([]OrderRecord, error) + func (c *Client) GetOrderState(ctx context.Context, orderID string) (*OrderRecord, error) + func (c *Client) GetTicker(ctx context.Context, instrumentName string) (*Ticker, error) + func (c *Client) GetTradingViewChartData(ctx context.Context, instrumentName string, start, end int64, ...) (*TradingViewChartData, error) + func (c *Client) HasCredentials() bool + func (c *Client) Sell(ctx context.Context, req OrderRequest) (*OrderResult, error) + func (c *Client) WithBaseURL(baseURL string) *Client + func (c *Client) WithCredentials(apiKey, secretKey string) *Client + type Instrument struct + BaseCurrency string + BlockTradeCommission float64 + BlockTradeMinTradeAmount float64 + BlockTradeTickSize float64 + ContractSize float64 + CounterCurrency string + CreationTimestamp int64 + ExpirationTimestamp int64 + FutureType string + InstrumentID int64 + InstrumentName string + InstrumentType string + IsActive bool + Kind string + MakerCommission float64 + MaxLeverage int + MinTradeAmount float64 + OptionType string + PriceIndex string + QuoteCurrency string + SettlementCurrency string + SettlementPeriod string + State string + Strike float64 + TakerCommission float64 + TickSize float64 + TickSizeSteps []TickSizeStep + type OrderBook struct + Asks [][]float64 + BestAskAmount float64 + BestAskPrice float64 + BestBidAmount float64 + BestBidPrice float64 + Bids [][]float64 + CurrentFunding float64 + Funding8h float64 + IndexPrice float64 + InstrumentName string + LastPrice float64 + MarkPrice float64 + State string + Stats Stats + Timestamp int64 + type OrderRecord struct + Amount float64 + AveragePrice float64 + Commission float64 + CreationTime int64 + Direction string + FilledAmount float64 + InstrumentName string + Label string + LastUpdateTime int64 + OrderID string + OrderState string + OrderType string + PostOnly bool + Price float64 + ReduceOnly bool + Replaced bool + TimeInForce string + UpdateTime int64 + type OrderRequest struct + Amount string + InstrumentName string + Label string + PostOnly bool + Price string + ReduceOnly bool + TimeInForce string + Type string + type OrderResult struct + Order OrderRecord + type Stats struct + High float64 + Low float64 + PriceChange float64 + Volume float64 + VolumeNotional float64 + VolumeUSD float64 + type TickSizeStep struct + AbovePrice float64 + TickSize float64 + type Ticker struct + BestAskAmount float64 + BestAskPrice float64 + BestBidAmount float64 + BestBidPrice float64 + CurrentFunding float64 + EstimatedDeliveryPrice float64 + Funding8h float64 + IndexPrice float64 + InstrumentName string + InterestValue float64 + LastPrice float64 + MarkPrice float64 + MaxPrice float64 + MinPrice float64 + OpenInterest float64 + SettlementPrice float64 + State string + Stats Stats + Timestamp int64 + type Trade struct + Amount float64 + Contracts float64 + Direction string + IV float64 + IndexPrice float64 + InstrumentName string + MarkPrice float64 + Price float64 + TickDirection int + Timestamp int64 + TradeID string + TradeSeq int64 + type TradesResult struct + HasMore bool + Trades []Trade + type TradingViewChartData struct + Close []float64 + Cost []float64 + High []float64 + Low []float64 + Open []float64 + Status string + Ticks []int64 + Volume []float64