Versions in this module Expand all Collapse all v1 v1.0.0 Jun 16, 2026 Changes in this version + type AccountInfo struct + DCPStatus string + IsMasterTrader bool + MarginMode string + SMPGroup int + SpotHedgingStatus string + TimeWindow int + UnifiedMarginStatus UnifiedMarginStatus + UpdatedTime string + func (a AccountInfo) AccountMode() AccountMode + type AccountMode string + const AccountModeClassic + const AccountModeUTA1 + const AccountModeUTA2 + const AccountModeUnknown + func (m AccountMode) IsUnified() bool + type AmendOrderRequest struct + Category string + OrderID string + OrderLinkID string + Price string + Qty string + Symbol string + type CancelAllOrdersRequest struct + BaseCoin string + Category string + SettleCoin string + Symbol string + type CancelOrderRequest struct + Category string + OrderID string + OrderLinkID string + Symbol string + type Candle [7]NumberString + func (c *Candle) UnmarshalJSON(data []byte) error + type Client struct + func NewClient() *Client + func (c *Client) AmendOrder(ctx context.Context, req AmendOrderRequest) (*OrderActionResponse, error) + func (c *Client) CancelAllOrders(ctx context.Context, req CancelAllOrdersRequest) error + func (c *Client) CancelOrder(ctx context.Context, req CancelOrderRequest) (*OrderActionResponse, error) + func (c *Client) GetAccountInfo(ctx context.Context) (*AccountInfo, error) + func (c *Client) GetFeeRates(ctx context.Context, category, symbol string) ([]FeeRateRecord, error) + func (c *Client) GetFundingHistory(ctx context.Context, category, symbol string, startMillis, endMillis int64, ...) ([]FundingHistoryEntry, error) + func (c *Client) GetInstruments(ctx context.Context, category string) ([]Instrument, error) + func (c *Client) GetInstrumentsForBase(ctx context.Context, category, baseCoin string) ([]Instrument, error) + func (c *Client) GetKlines(ctx context.Context, category, symbol, interval string, start, end int64, ...) ([]Candle, error) + func (c *Client) GetOpenInterest(ctx context.Context, category, symbol, intervalTime string, ...) (*OpenInterestResult, error) + func (c *Client) GetOpenOrders(ctx context.Context, category, symbol string) ([]OrderRecord, error) + func (c *Client) GetOrderBook(ctx context.Context, category, symbol string, limit int) (*OrderBook, error) + func (c *Client) GetOrderHistory(ctx context.Context, category, symbol string) ([]OrderRecord, error) + func (c *Client) GetOrderHistoryFiltered(ctx context.Context, category, symbol, orderID, orderLinkID string) ([]OrderRecord, error) + func (c *Client) GetPositions(ctx context.Context, category, symbol, settleCoin string) ([]PositionRecord, error) + func (c *Client) GetPrivateRaw(ctx context.Context, path string, query map[string]string, out any) error + func (c *Client) GetRealtimeOrders(ctx context.Context, category, symbol, settleCoin, orderID, orderLinkID string, ...) ([]OrderRecord, error) + func (c *Client) GetRecentTrades(ctx context.Context, category, symbol string, limit int) ([]PublicTrade, error) + func (c *Client) GetTicker(ctx context.Context, category, symbol string) (*Ticker, error) + func (c *Client) GetWalletBalance(ctx context.Context, accountType, coin string) (*WalletBalanceResult, error) + func (c *Client) HasCredentials() bool + func (c *Client) PlaceOrder(ctx context.Context, req PlaceOrderRequest) (*OrderActionResponse, error) + func (c *Client) PostPrivateRaw(ctx context.Context, path string, body any, out any) error + func (c *Client) SetLeverage(ctx context.Context, req SetLeverageRequest) error + func (c *Client) WithBaseURL(baseURL string) *Client + func (c *Client) WithCredentials(apiKey, secretKey string) *Client + func (c *Client) WithHTTPClient(httpClient *http.Client) *Client + type ExecutionRecord struct + ExecFee string + ExecID string + ExecPrice string + ExecQty string + ExecTime string + FeeCurrency string + IsMaker bool + OrderID string + OrderLinkID string + Side string + Symbol string + type FeeRateRecord struct + BaseCoin string + MakerFeeRate string + Symbol string + TakerFeeRate string + type FeeRatesResult struct + List []FeeRateRecord + type FundingHistoryEntry struct + FundingRate string + FundingRateTimestamp string + Symbol string + type FundingHistoryResult struct + Category string + List []FundingHistoryEntry + type Instrument struct + BaseCoin string + DeliveryTime string + DisplayName string + LaunchTime string + LotSizeFilter LotSizeFilter + OptionsType string + PriceFilter PriceFilter + PriceScale string + QuoteCoin string + SettleCoin string + Status string + Symbol string + type InstrumentsResult struct + Category string + List []Instrument + NextPageCursor string + type KlinesResult struct + Category string + List []Candle + Symbol string + type LotSizeFilter struct + BasePrecision string + MinNotionalValue string + MinOrderAmt string + MinOrderQty string + QtyStep string + type NumberString string + func (n *NumberString) UnmarshalJSON(data []byte) error + type OpenInterestEntry struct + OpenInterest string + Timestamp string + type OpenInterestResult struct + Category string + List []OpenInterestEntry + NextPageCursor string + Symbol string + type OrderActionResponse struct + OrderID string + OrderLinkID string + type OrderBook struct + Asks [][]NumberString + Bids [][]NumberString + Symbol string + TS int64 + U int64 + type OrderRecord struct + AvgPrice string + ClosedPnl string + CreatedTime string + CumExecFee string + CumExecQty string + LastPriceOnCreated string + OrderID string + OrderLinkID string + OrderStatus string + OrderType string + Price string + Qty string + ReduceOnly bool + Side string + Symbol string + TimeInForce string + TriggerPrice string + UpdatedTime string + type OrdersResult struct + List []OrderRecord + NextPageCursor string + type PlaceOrderRequest struct + Category string + MarketUnit string + OrderLinkID string + OrderType string + Price string + Qty string + ReduceOnly bool + Side string + SlippageTolerance string + SlippageToleranceType string + Symbol string + TimeInForce string + type PositionRecord struct + AvgPrice string + CumRealisedPnl string + Leverage string + LiqPrice string + Side string + Size string + Symbol string + UnrealisedPnl string + type PositionsResult struct + List []PositionRecord + NextPageCursor string + type PriceFilter struct + TickSize string + type PrivateWSClient struct + func NewPrivateWSClient() *PrivateWSClient + func (c *PrivateWSClient) Close() error + func (c *PrivateWSClient) Connect(ctx context.Context) error + func (c *PrivateWSClient) Subscribe(ctx context.Context, topic string, handler func(json.RawMessage)) error + func (c *PrivateWSClient) Unsubscribe(ctx context.Context, topic string) error + func (c *PrivateWSClient) WithCredentials(apiKey, secretKey string) *PrivateWSClient + type PublicTrade struct + ExecID string + Price string + Side string + Size string + Symbol string + Time string + type PublicTradesResult struct + Category string + List []PublicTrade + type PublicWSClient struct + func NewPublicWSClient(category string) *PublicWSClient + func (c *PublicWSClient) Close() error + func (c *PublicWSClient) Connect(ctx context.Context) error + func (c *PublicWSClient) Subscribe(ctx context.Context, topic string, handler func(json.RawMessage)) error + func (c *PublicWSClient) Unsubscribe(ctx context.Context, topic string) error + type SetLeverageRequest struct + BuyLeverage string + Category string + SellLeverage string + Symbol string + type Ticker struct + Ask1Price string + Bid1Price string + HighPrice24h string + IndexPrice string + LastPrice string + LowPrice24h string + MarkPrice string + Symbol string + TS string + Time string + Turnover24h string + Volume24h string + type TickersResult struct + Category string + List []Ticker + type TradeWSClient struct + func NewTradeWSClient() *TradeWSClient + func (c *TradeWSClient) AmendOrder(ctx context.Context, req AmendOrderRequest) error + func (c *TradeWSClient) CancelOrder(ctx context.Context, req CancelOrderRequest) error + func (c *TradeWSClient) Close() error + func (c *TradeWSClient) Connect(ctx context.Context) error + func (c *TradeWSClient) PlaceOrder(ctx context.Context, req PlaceOrderRequest) error + func (c *TradeWSClient) WithCredentials(apiKey, secretKey string) *TradeWSClient + type UnifiedMarginStatus int + const UnifiedMarginStatusClassic + const UnifiedMarginStatusUTA1 + const UnifiedMarginStatusUTA1Pro + const UnifiedMarginStatusUTA2 + const UnifiedMarginStatusUTA2Pro + type WSEnvelope struct + Data json.RawMessage + TS int64 + Topic string + Type string + type WSExecutionMessage struct + Data []ExecutionRecord + Topic string + func DecodeExecutionMessage(payload []byte) (*WSExecutionMessage, error) + type WSOrderBookData struct + Asks [][]NumberString + Bids [][]NumberString + CTS int64 + Seq int64 + Symbol string + UpdateID int64 + type WSOrderBookMessage struct + Data WSOrderBookData + TS int64 + Topic string + Type string + func DecodeOrderBookMessage(payload []byte) (*WSOrderBookMessage, error) + type WSOrderMessage struct + Data []OrderRecord + Topic string + func DecodeOrderMessage(payload []byte) (*WSOrderMessage, error) + type WSPositionMessage struct + Data []PositionRecord + Topic string + func DecodePositionMessage(payload []byte) (*WSPositionMessage, error) + type WalletAccount struct + AccountType string + Coin []WalletCoin + TotalAvailableBalance string + TotalEquity string + TotalPerpUPL string + TotalWalletBalance string + type WalletBalanceResult struct + List []WalletAccount + type WalletCoin struct + Coin string + CumRealisedPnl string + Equity string + Locked string + UnrealisedPnl string + UsdValue string + WalletBalance string