Versions in this module Expand all Collapse all v1 v1.0.0 Jun 16, 2026 Changes in this version + type AccountAsset struct + Available string + Bonus string + Coin string + Equity string + Frozen string + Locked string + USDTValue string + type AccountAssets struct + AccountEquity string + Assets []AccountAsset + Available string + Coupon string + UnionTotalMargin string + UnrealizedPL string + UsdtEquity string + type AccountFeeRate struct + MakerFeeRate string + TakerFeeRate string + type AccountInfo struct + Channel string + ChannelCode string + IPs string + InviterID string + ParentID string + PermType string + Permissions []string + RegisTime string + UserID string + type CancelAllOrdersRequest struct + Category string + Symbol string + type CancelOrderRequest struct + Category string + ClientOID string + OrderID string + Symbol string + type CancelOrderResponse struct + ClientOID string + OrderID string + type Candle [7]NumberString + func (c *Candle) UnmarshalJSON(data []byte) error + type ClassicFillFeeDetail struct + Deduction string + FeeCoin string + TotalDeductionFee string + TotalFee string + type ClassicMixAccount struct + AccountEquity string + AssetMode string + Available string + BtcEquity string + Coupon string + CrossedMarginLeverage NumberString + CrossedMaxAvailable string + CrossedRiskRate string + CrossedUnrealizedPL string + Grant string + IsolatedLongLever NumberString + IsolatedMaxAvailable string + IsolatedShortLever NumberString + IsolatedUnrealizedPL string + Locked string + MarginCoin string + MarginMode string + MaxTransferOut string + PosMode string + UnrealizedPL string + UsdtEquity string + type ClassicMixFillRecord struct + BaseVolume string + CTime string + ClientOID string + FeeDetail []ClassicFillFeeDetail + InstID string + OrderID string + OrderType string + PosMode string + Price string + Profit string + QuoteVolume string + Side string + Symbol string + TradeID string + TradeScope string + TradeSide string + UTime string + type ClassicMixOrderList struct + EndID string + EntrustedList []ClassicMixOrderRecord + type ClassicMixOrderRecord struct + AccBaseVolume string + BaseVolume string + CTime string + ClientOID string + EnterPointSource string + Fee string + FeeDetail []FeeDetail + Force string + InstID string + Leverage string + MarginCoin string + MarginMode string + OrderID string + OrderSource string + OrderType string + PosMode string + PosSide string + PresetStopLossExecutePrice string + PresetStopLossPrice string + PresetStopLossType string + PresetStopSurplusExecutePrice string + PresetStopSurplusPrice string + PresetStopSurplusType string + Price string + PriceAvg string + QuoteVolume string + ReduceOnly string + Side string + Size string + Status string + Symbol string + TotalProfits string + TradeSide string + UTime string + type ClassicMixPositionRecord struct + AchievedProfits string + AssetMode string + AutoMargin string + Available string + BreakEvenPrice string + CTime string + DeductedFee string + Frozen string + HoldSide string + InstID string + KeepMarginRate string + Leverage string + LiquidationPrice string + MarginCoin string + MarginMode string + MarginRate string + MarginSize string + MarkPrice string + OpenPriceAvg string + PosID string + PosMode string + Symbol string + Total string + TotalFee string + UTime string + UnrealizedPL string + type ClassicSpotAsset struct + Available string + Coin string + Frozen string + LimitAvailable string + Locked string + UTime string + type ClassicSpotFillRecord struct + Amount string + CTime string + ClientOID string + FeeDetail []ClassicFillFeeDetail + InstID string + OrderID string + OrderType string + PriceAvg string + Side string + Size string + Symbol string + TradeID string + TradeScope string + UTime string + type ClassicSpotOrderRecord struct + AccBaseVolume string + BasePrice string + BaseVolume string + CTime string + CancelReason string + ClientOID string + EnterPointSource string + FeeDetail FlexibleFeeDetails + FillFee string + FillFeeCoin string + FillPrice string + Force string + InstID string + NewSize string + OrderID string + OrderSource string + OrderType string + Price string + PriceAvg string + QuoteVolume string + Side string + Size string + Status string + Symbol string + UTime string + UserID string + type ClassicWSFillMessage struct + Action string + Arg WSArg + Data []ClassicMixFillRecord + func DecodeClassicWSFillMessage(payload []byte) (*ClassicWSFillMessage, error) + type ClassicWSOrderMessage struct + Action string + Arg WSArg + Data []ClassicMixOrderRecord + func DecodeClassicWSOrderMessage(payload []byte) (*ClassicWSOrderMessage, error) + type ClassicWSPositionMessage struct + Action string + Arg WSArg + Data []ClassicMixPositionRecord + func DecodeClassicWSPositionMessage(payload []byte) (*ClassicWSPositionMessage, error) + type ClassicWSSpotFillMessage struct + Action string + Arg WSArg + Data []ClassicSpotFillRecord + func DecodeClassicWSSpotFillMessage(payload []byte) (*ClassicWSSpotFillMessage, error) + type ClassicWSSpotOrderMessage struct + Action string + Arg WSArg + Data []ClassicSpotOrderRecord + func DecodeClassicWSSpotOrderMessage(payload []byte) (*ClassicWSSpotOrderMessage, error) + type Client struct + func NewClient() *Client + func (c *Client) CancelAllClassicMixOrders(ctx context.Context, productType, symbol, marginCoin string) error + func (c *Client) CancelAllClassicSpotOrders(ctx context.Context, symbol string) error + func (c *Client) CancelAllOrders(ctx context.Context, req *CancelAllOrdersRequest) error + func (c *Client) CancelClassicMixOrder(ctx context.Context, ...) (*CancelOrderResponse, error) + func (c *Client) CancelClassicSpotOrder(ctx context.Context, symbol, orderID, clientOID string) (*CancelOrderResponse, error) + func (c *Client) CancelOrder(ctx context.Context, req *CancelOrderRequest) (*CancelOrderResponse, error) + func (c *Client) GetAccountAssets(ctx context.Context) (*AccountAssets, error) + func (c *Client) GetAccountFeeRate(ctx context.Context, category, symbol string) (*AccountFeeRate, error) + func (c *Client) GetAccountInfo(ctx context.Context) (*AccountInfo, error) + func (c *Client) GetCandles(ctx context.Context, category, symbol, interval, candleType string, ...) ([]Candle, error) + func (c *Client) GetClassicMixAccount(ctx context.Context, symbol, productType, marginCoin string) (*ClassicMixAccount, error) + func (c *Client) GetClassicMixOpenOrders(ctx context.Context, productType, symbol string) ([]ClassicMixOrderRecord, error) + func (c *Client) GetClassicMixOrder(ctx context.Context, symbol, productType, orderID, clientOID string) (*ClassicMixOrderRecord, error) + func (c *Client) GetClassicMixOrderHistory(ctx context.Context, productType, symbol string) ([]ClassicMixOrderRecord, error) + func (c *Client) GetClassicMixPositions(ctx context.Context, productType, marginCoin string) ([]ClassicMixPositionRecord, error) + func (c *Client) GetClassicSpotAssets(ctx context.Context, coin string) ([]ClassicSpotAsset, error) + func (c *Client) GetClassicSpotOpenOrders(ctx context.Context, symbol string) ([]ClassicSpotOrderRecord, error) + func (c *Client) GetClassicSpotOrder(ctx context.Context, orderID, clientOID string) (*ClassicSpotOrderRecord, error) + func (c *Client) GetClassicSpotOrderHistory(ctx context.Context, symbol string) ([]ClassicSpotOrderRecord, error) + func (c *Client) GetCurrentPositions(ctx context.Context, category, symbol string) ([]PositionRecord, error) + func (c *Client) GetFinancialRecords(ctx context.Context, req FinancialRecordsRequest) (*FinancialRecords, error) + func (c *Client) GetFundingAssets(ctx context.Context, coin string) ([]FundingAsset, error) + func (c *Client) GetHistoryFundRate(ctx context.Context, symbol, productType string, pageSize, pageNo int) ([]HistoryFundRateEntry, error) + func (c *Client) GetInstruments(ctx context.Context, category, symbol string) ([]Instrument, error) + func (c *Client) GetMaxTransferable(ctx context.Context, coin string) (*MaxTransferable, error) + func (c *Client) GetOpenInterest(ctx context.Context, symbol, productType string) (*OpenInterest, error) + func (c *Client) GetOpenInterestLimit(ctx context.Context, category, symbol string) (*OpenInterestLimit, error) + func (c *Client) GetOpenOrders(ctx context.Context, category, symbol string) ([]OrderRecord, error) + func (c *Client) GetOrder(ctx context.Context, category, symbol, orderID, clientOID 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) GetPrivateRaw(ctx context.Context, path string, query map[string]string, out any) error + func (c *Client) GetRecentFills(ctx context.Context, category, symbol string, limit int) ([]PublicFill, error) + func (c *Client) GetSwitchStatus(ctx context.Context) (*SwitchStatus, error) + func (c *Client) GetTicker(ctx context.Context, category, symbol string) (*Ticker, error) + func (c *Client) HasCredentials() bool + func (c *Client) ModifyClassicMixOrder(ctx context.Context, req *ModifyOrderRequest, productType, marginCoin string) (*CancelOrderResponse, error) + func (c *Client) ModifyOrder(ctx context.Context, req *ModifyOrderRequest) (*CancelOrderResponse, error) + func (c *Client) PlaceClassicMixOrder(ctx context.Context, req *PlaceOrderRequest, productType, marginCoin string) (*PlaceOrderResponse, error) + func (c *Client) PlaceClassicSpotOrder(ctx context.Context, req *PlaceOrderRequest) (*PlaceOrderResponse, error) + func (c *Client) PlaceOrder(ctx context.Context, req *PlaceOrderRequest) (*PlaceOrderResponse, error) + func (c *Client) PostPrivateRaw(ctx context.Context, path string, body any, out any) error + func (c *Client) SetClassicMixLeverage(ctx context.Context, symbol, productType, marginCoin, leverage string) error + func (c *Client) SetHoldMode(ctx context.Context, holdMode string) error + func (c *Client) SetLeverage(ctx context.Context, req *SetLeverageRequest) error + func (c *Client) WithBaseURL(baseURL string) *Client + func (c *Client) WithCredentials(apiKey, secretKey, passphrase string) *Client + func (c *Client) WithHTTPClient(httpClient *http.Client) *Client + type FeeDetail struct + Fee string + FeeCoin string + type FillRecord struct + Category string + ClientOID string + ExecID string + ExecLinkID string + ExecPnl string + ExecPrice string + ExecQty string + ExecTime string + ExecValue string + FeeDetail []FeeDetail + HoldSide string + IsRPI string + OrderID string + OrderType string + Side string + Symbol string + TradeScope string + TradeSide string + UpdatedTime string + type FinancialRecord struct + Amount string + Balance string + Category string + Coin string + Fee string + ID string + Symbol string + TS string + Type string + type FinancialRecords struct + Cursor string + List []FinancialRecord + type FinancialRecordsRequest struct + Category string + Coin string + Cursor string + EndTime string + Limit string + StartTime string + Type string + type FlexibleFeeDetails []FeeDetail + func (f *FlexibleFeeDetails) UnmarshalJSON(data []byte) error + type FundingAsset struct + Available string + Balance string + Coin string + Frozen string + type HistoryFundRateEntry struct + FundingRate string + FundingTime string + Symbol string + type Instrument struct + BaseCoin string + Category string + FundInterval string + MakerFeeRate string + MaxOrderQty string + MinOrderAmount string + MinOrderQty string + PriceMultiplier string + PricePrecision string + QuantityMultiplier string + QuantityPrecision string + QuoteCoin string + QuotePrecision string + Status string + Symbol string + TakerFeeRate string + type MaxTransferable struct + BorrowMaxTransfer string + Coin string + MaxTransfer string + type ModifyOrderRequest struct + Category string + ClientOID string + NewClientID string + NewPrice string + NewQty string + OrderID string + Symbol string + type NumberString string + func (n *NumberString) UnmarshalJSON(data []byte) error + type OpenInterest struct + List []OpenInterestEntry + TS string + type OpenInterestEntry struct + Size string + Symbol string + type OpenInterestLimit struct + MarketMakerLimit string + MasterSubLimit string + SingleUserLimit string + Symbol string + type OrderBook struct + Asks [][]NumberString + Bids [][]NumberString + TS string + type OrderList struct + EndID string + List []OrderRecord + type OrderRecord struct + Amount string + AvgPrice string + BaseVolume string + Category string + ClientOID string + CreatedTime string + CumExecQty string + CumExecValue string + DelegateType string + Fee string + FeeDetail []FeeDetail + FilledQty string + FilledVolume string + HoldMode string + HoldSide string + MarginCoin string + MarginMode string + OrderID string + OrderStatus string + OrderType string + PosSide string + Price string + Qty string + ReduceOnly string + Side string + StpMode string + Symbol string + TimeInForce string + TotalProfit string + TradeSide string + UpdatedTime string + type PlaceOrderRequest struct + Category string + ClientOID string + MarginCoin string + MarginMode string + OrderType string + Price string + Qty string + ReduceOnly string + Side string + Symbol string + TimeInForce string + TradeSide string + type PlaceOrderResponse struct + ClientOID string + OrderID string + type PositionList struct + List []PositionRecord + type PositionRecord struct + AchievedProfits string + Available string + AverageOpenPrice string + AvgPrice string + Category string + CreatedTime string + CurRealisedPnl string + Frozen string + HoldSide string + Leverage string + LiqPrice string + LiquidationPrice string + MarginMode string + MarkPrice string + OpenPriceAvg string + PosSide string + PositionStatus string + Qty string + Size string + Symbol string + Total string + UnrealizedPL string + UpdatedTime string + type PrivateWSClient struct + func NewPrivateWSClient() *PrivateWSClient + func (c *PrivateWSClient) CancelClassicPerpOrderWS(symbol, instType, marginCoin, orderID, clientOID string) (*CancelOrderResponse, error) + func (c *PrivateWSClient) CancelClassicSpotOrderWS(symbol, orderID, clientOID string) (*CancelOrderResponse, error) + func (c *PrivateWSClient) CancelUTAOrderWS(req *CancelOrderRequest) (*CancelOrderResponse, error) + func (c *PrivateWSClient) Close() error + func (c *PrivateWSClient) Connect(ctx context.Context) error + func (c *PrivateWSClient) PlaceClassicPerpOrderWS(req *PlaceOrderRequest, instType, marginCoin string) (*PlaceOrderResponse, error) + func (c *PrivateWSClient) PlaceClassicSpotOrderWS(req *PlaceOrderRequest) (*PlaceOrderResponse, error) + func (c *PrivateWSClient) PlaceUTAOrderWS(req *PlaceOrderRequest) (*PlaceOrderResponse, error) + func (c *PrivateWSClient) Subscribe(ctx context.Context, arg WSArg, handler func(json.RawMessage)) error + func (c *PrivateWSClient) Unsubscribe(ctx context.Context, arg WSArg) error + func (c *PrivateWSClient) WithClassicMode() *PrivateWSClient + func (c *PrivateWSClient) WithCredentials(apiKey, secretKey, passphrase string) *PrivateWSClient + type PublicFill struct + ExecID string + ExecLinkID string + Price string + Side string + Size string + Timestamp string + type PublicWSClient struct + func NewPublicWSClient() *PublicWSClient + func (c *PublicWSClient) Close() error + func (c *PublicWSClient) Connect(ctx context.Context) error + func (c *PublicWSClient) Subscribe(ctx context.Context, arg WSArg, handler func(json.RawMessage)) error + func (c *PublicWSClient) Unsubscribe(ctx context.Context, arg WSArg) error + type SetLeverageRequest struct + Category string + Leverage string + Symbol string + type SwitchStatus struct + Reason string + Status string + type Ticker struct + Ask1Price string + Ask1Size string + Bid1Price string + Bid1Size string + Category string + FundingRate string + HighPrice24h string + IndexPrice string + LastPrice string + LowPrice24h string + MarkPrice string + OpenPrice24h string + Symbol string + Timestamp string + Turnover24h string + Volume24h string + type WSArg struct + Channel string + InstID string + InstType string + Symbol string + Topic string + type WSEnvelope struct + Action string + Arg WSArg + Code NumberString + Data json.RawMessage + Event string + Msg string + type WSFillMessage struct + Action string + Arg WSArg + Data []FillRecord + func DecodeFillMessage(payload []byte) (*WSFillMessage, error) + type WSOrderBookData struct + Asks [][]NumberString + Bids [][]NumberString + Checksum int64 + PSeq int64 + Seq int64 + TS string + type WSOrderBookMessage struct + Action string + Arg WSArg + Data []WSOrderBookData + TS int64 + func DecodeOrderBookMessage(payload []byte) (*WSOrderBookMessage, error) + type WSOrderMessage struct + Action string + Arg WSArg + Data []OrderRecord + func DecodeOrderMessage(payload []byte) (*WSOrderMessage, error) + type WSPositionMessage struct + Action string + Arg WSArg + Data []PositionRecord + func DecodePositionMessage(payload []byte) (*WSPositionMessage, error)