Versions in this module Expand all Collapse all v1 v1.0.0 Jun 16, 2026 Changes in this version + const BaseURL + const WSBaseURL + var SingleEventMap = map[string]string + func BuildQueryString(params map[string]interface{}) string + func FormatSymbol(symbol string) string + func GenerateSignature(secretKey, data string) string + func Timestamp() int64 + type APIError struct + Code int + Message string + func (e *APIError) Error() string + type AccountPositionEvent struct + Balances []struct{ ... } + EventTime int64 + EventType string + LastAccountUpdate int64 + type AccountResponse struct + AccountType string + Balances []struct{ ... } + BuyerCommission int64 + CanDeposit bool + CanTrade bool + CanWithdraw bool + MakerCommission int64 + SellerCommission int64 + TakerCommission int64 + UpdateTime int64 + type AggTradeEvent struct + AggTradeID int64 + FirstTradeID int64 + Ignore bool + IsBuyerMaker bool + LastTradeID int64 + Price string + Quantity string + TradeTime int64 + type BookTickerEvent struct + BestAskPrice string + BestAskQty string + BestBidPrice string + BestBidQty string + Symbol string + UpdateID int64 + type BookTickerResponse struct + AskPrice string + AskQty string + BidPrice string + BidQty string + Symbol string + type CancelOrderResponse struct + ClientOrderID string + CummulativeQuoteQty string + ExecutedQty string + OrderID int64 + OrderListID int64 + OrigClientOrderID string + OrigQty string + Price string + Side string + Status string + Symbol string + TimeInForce string + Type string + type CancelReplaceOrderParams struct + CancelOrderID int64 + CancelOrigClientOrderID string + CancelReplaceMode string + IcebergQty string + NewClientOrderID string + NewOrderRespType string + Price string + Quantity string + Side string + StopPrice string + Symbol string + TimeInForce string + Type string + type CancelReplaceOrderResponse struct + CancelResponse *CancelOrderResponse + CancelResult string + NewOrderResponse *OrderResponse + NewOrderStatus string + func (r *CancelReplaceOrderResponse) UnmarshalJSON(data []byte) error + func (r CancelReplaceOrderResponse) MarshalJSON() ([]byte, error) + type Client struct + APIKey string + BaseURL string + Debug bool + HTTPClient *http.Client + Logger *zap.SugaredLogger + OrderCount mbx.OrderCount + SecretKey string + UsedWeight mbx.UsedWeight + func NewClient(apiKey, secretKey string) *Client + func (c *Client) BookTicker(ctx context.Context, symbol string) (*BookTickerResponse, error) + func (c *Client) CancelOrder(ctx context.Context, symbol string, orderID int64, origClientOrderID string) (*CancelOrderResponse, error) + func (c *Client) CloseListenKey(ctx context.Context, listenKey string) error + func (c *Client) CreateListenKey(ctx context.Context) (string, error) + func (c *Client) Delete(ctx context.Context, endpoint string, params map[string]interface{}, ...) error + func (c *Client) Depth(ctx context.Context, symbol string, limit int) (*DepthResponse, error) + func (c *Client) ExchangeInfo(ctx context.Context) (*ExchangeInfoResponse, error) + func (c *Client) Get(ctx context.Context, endpoint string, params map[string]interface{}, ...) error + func (c *Client) GetAccount(ctx context.Context) (*AccountResponse, error) + func (c *Client) GetOpenOrders(ctx context.Context, symbol string) ([]OrderResponse, error) + func (c *Client) GetOrder(ctx context.Context, symbol string, orderID int64, origClientOrderID string) (*OrderResponse, error) + func (c *Client) KeepAliveListenKey(ctx context.Context, listenKey string) error + func (c *Client) Klines(ctx context.Context, symbol, interval string, limit int, ...) ([]KlineResponse, error) + func (c *Client) ModifyOrder(ctx context.Context, p CancelReplaceOrderParams) (*CancelReplaceOrderResponse, error) + func (c *Client) MyTrades(ctx context.Context, symbol string, limit int, startTime, endTime int64, ...) ([]Trade, error) + func (c *Client) PlaceOrder(ctx context.Context, p PlaceOrderParams) (*OrderResponse, error) + func (c *Client) Post(ctx context.Context, endpoint string, params map[string]interface{}, ...) error + func (c *Client) Ticker(ctx context.Context, symbol string) (*TickerResponse, error) + func (c *Client) WithBaseURL(url string) *Client + func (c *Client) WithDebug(debug bool) *Client + type DepthEvent struct + Asks [][]string + Bids [][]string + FinalUpdateID int64 + FirstUpdateID int64 + type DepthResponse struct + Asks [][]string + Bids [][]string + LastUpdateID int64 + type ExchangeInfoResponse struct + ServerTime int64 + Symbols []struct{ ... } + Timezone string + type ExecutionReportEvent struct + ClientOrderID string + CommissionAmount string + CommissionAsset string + CreationTime int64 + CumulativeFilledQuantity string + CumulativeQuoteAssetTransactedQuantity string + EventTime int64 + EventType string + ExecutionType string + IcebergQuantity string + Ignore int64 + Ignore2 bool + IsMaker bool + IsOrderWorking bool + LastExecutedPrice string + LastExecutedQuantity string + LastQuoteAssetTransactedQuantity string + OrderID int64 + OrderListID int64 + OrderStatus string + OrderType string + OriginalClientOrderID string + Price string + Quantity string + QuoteOrderQuantity string + RejectReason string + SelfTradePreventionMode string + Side string + StopPrice string + Symbol string + TimeInForce string + TradeID int64 + TransactionTime int64 + WorkingTime int64 + type FlexibleFloat string + func (f *FlexibleFloat) UnmarshalJSON(data []byte) error + func (f FlexibleFloat) Float64() float64 + type KlineEvent struct + Kline struct{ ... } + type KlineResponse []interface + type ListenKeyResponse struct + ListenKey string + type OrderResponse struct + ClientOrderID string + CummulativeQuoteQty string + ExecutedQty string + OrderID int64 + OrderListID int64 + OrigQty string + Price string + Side string + Status string + Symbol string + TimeInForce string + TransactTime int64 + Type string + type PlaceOrderParams struct + IcebergQty string + NewClientOrderID string + NewOrderRespType string + Price string + Quantity string + Side string + StopPrice string + Symbol string + TimeInForce string + Type string + type ServerTimeResponse struct + ServerTime int64 + type Subscription struct + type TickerResponse struct + AskPrice string + AskQty string + BidPrice string + BidQty string + CloseTime int64 + Count int64 + FirstId int64 + HighPrice string + LastId int64 + LastPrice string + LastQty string + LowPrice string + OpenPrice string + OpenTime int64 + PrevClosePrice string + PriceChange string + PriceChangePercent string + QuoteVolume string + Symbol string + Volume string + WeightedAvgPrice string + type Trade struct + Commission string + CommissionAsset string + ID int64 + IsBestMatch bool + IsBuyer bool + IsMaker bool + OrderID int64 + OrderListID int64 + Price string + Qty string + QuoteQty string + Symbol string + Time int64 + type UserStreamManager struct + Client *Client + KeepAliveInt time.Duration + ListenKey string + StopCh chan struct{} + func NewUserStreamManager(client *Client) *UserStreamManager + func (m *UserStreamManager) Start(ctx context.Context) (string, error) + func (m *UserStreamManager) Stop(ctx context.Context) error + type WSClient struct + Conn *websocket.Conn + Debug bool + Handler func([]byte) + Logger *zap.SugaredLogger + Mu sync.RWMutex + ReconnectWait time.Duration + URL string + WriteMu sync.Mutex + func NewWSClient(ctx context.Context, url string) *WSClient + func NewWsClient(ctx context.Context, url string) *WSClient + func (c *WSClient) CallSubscription(key string, message []byte) + func (c *WSClient) Close() + func (c *WSClient) Connect() error + func (c *WSClient) IsConnected() bool + func (c *WSClient) SetHandler(stream string, handler func([]byte) error) + func (c *WSClient) Subscribe(stream string, handler func([]byte) error) error + func (c *WSClient) Unsubscribe(stream string) error + func (c *WSClient) WriteJSON(v interface{}) error + type WsAccountClient struct + APIKey string + ListenKey string + SecretKey string + StreamMgr *UserStreamManager + func NewWsAccountClient(ctx context.Context, apiKey, secretKey string) *WsAccountClient + func (c *WsAccountClient) Close() + func (c *WsAccountClient) Connect() error + func (c *WsAccountClient) SubscribeAccountPosition(handler func(*AccountPositionEvent)) + func (c *WsAccountClient) SubscribeExecutionReport(handler func(*ExecutionReportEvent)) + type WsAccountUpdateEvent struct + Balances []struct{ ... } + BuyerCommissionRate int64 + CanDeposit bool + CanTrade bool + CanWithdraw bool + EventTime int64 + EventType string + LastUpdateTime int64 + MakerCommissionRate int64 + SellerCommissionRate int64 + TakerCommissionRate int64 + type WsAggTradeEvent struct + AggTradeID int64 + EventTime int64 + EventType string + FirstTradeID int64 + Ignore bool + IsBuyerMaker bool + LastTradeID int64 + Price string + Quantity string + Symbol string + TradeTime int64 + type WsBookTickerEvent struct + BestAskPrice string + BestAskQty string + BestBidPrice string + BestBidQty string + EventTime int64 + EventType string + Symbol string + UpdateID int64 + type WsClient = WSClient + type WsDepthEvent struct + Asks [][]interface{} + Bids [][]interface{} + EventTime int64 + EventType string + FinalUpdateID int64 + FinalUpdateIDLast int64 + FirstUpdateID int64 + Symbol string + TransactionTime int64 + type WsEventHeader struct + EventTime int64 + EventType string + Symbol string + type WsExecutionReportEvent struct + ClientOrderID string + CommissionAmount string + CommissionAsset string + CreationTime int64 + CumulativeFilledQty string + CumulativeQuoteQty string + EventTime int64 + EventType string + ExecutionType string + IcebergQuantity string + Ignore int64 + IsMaker bool + IsOrderWorking bool + LastExecutedPrice string + LastExecutedQty string + LastQuoteQty string + OrderID int64 + OrderListID int64 + OrderStatus string + OrderType string + OriginalClientID string + Price string + Quantity string + QuoteOrderQty string + RejectReason string + Side string + StopPrice string + Symbol string + TimeInForce string + TradeID int64 + TransactionTime int64 + type WsKlineEvent struct + EventTime int64 + EventType string + Kline struct{ ... } + Symbol string + type WsMarketClient struct + func NewWsMarketClient(ctx context.Context) *WsMarketClient + func (c *WsMarketClient) SubscribeAggTrade(symbol string, handler func(*AggTradeEvent) error) error + func (c *WsMarketClient) SubscribeBookTicker(symbol string, handler func(*BookTickerEvent) error) error + func (c *WsMarketClient) SubscribeIncrementOrderBook(symbol string, interval string, callback func(*WsDepthEvent) error) error + func (c *WsMarketClient) SubscribeKline(symbol string, interval string, handler func(*KlineEvent) error) error + func (c *WsMarketClient) SubscribeLimitOrderBook(symbol string, depth int, speed string, handler func(*DepthEvent) error) error + func (c *WsMarketClient) UnsubscribeAggTrade(symbol string) error + func (c *WsMarketClient) UnsubscribeKline(symbol string, interval string) error + func (c *WsMarketClient) UnsubscribeLimitOrderBook(symbol string, depth int, speed string) error