Documentation
¶
Index ¶
- Constants
- Variables
- func BuildQueryString(params map[string]interface{}) string
- func FormatSymbol(symbol string) string
- func GenerateSignature(secretKey, data string) string
- func Timestamp() int64
- type APIError
- type AccountPositionEvent
- type AccountResponse
- type AggTradeEvent
- type BookTickerEvent
- type BookTickerResponse
- type CancelOrderResponse
- type CancelReplaceOrderParams
- type CancelReplaceOrderResponse
- type 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) CloseUserDataStream(ctx context.Context, listenKey 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) KeepAliveUserDataStream(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) Put(ctx context.Context, endpoint string, params map[string]interface{}, ...) error
- func (c *Client) StartUserDataStream(ctx context.Context) (string, error)
- func (c *Client) Ticker(ctx context.Context, symbol string) (*TickerResponse, error)
- func (c *Client) WithBaseURL(url string) *Client
- func (c *Client) WithCredentials(apiKey, secretKey string) *Client
- type DepthEvent
- type DepthResponse
- type ExchangeInfoResponse
- type ExecutionReport
- type ExecutionReportEvent
- type KlineEvent
- type KlineResponse
- type ListenKeyResponse
- type OrderResponse
- type PlaceOrderParams
- type ServerTimeResponse
- type Subscription
- type SymbolInfo
- type TickerResponse
- type Trade
- type TradeEvent
- type WsAPIClient
- func (c *WsAPIClient) CancelOrderWS(apiKey, secretKey string, symbol string, orderID int64, ...) (*OrderResponse, error)
- func (c *WsAPIClient) Close()
- func (c *WsAPIClient) Connect() error
- func (c *WsAPIClient) IsConnected() bool
- func (c *WsAPIClient) ModifyOrderWS(apiKey, secretKey string, p CancelReplaceOrderParams, id string) (*CancelReplaceOrderResponse, error)
- func (c *WsAPIClient) PlaceOrderWS(apiKey, secretKey string, p PlaceOrderParams, id string) (*OrderResponse, error)
- func (c *WsAPIClient) SendRequest(id string, req interface{}) ([]byte, error)
- func (c *WsAPIClient) SetEventHandler(handler func([]byte))
- func (c *WsAPIClient) WithURL(url string) *WsAPIClient
- type WsAccountClient
- type 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 WsDepthEvent
- type WsMarketClient
- func (c *WsMarketClient) SubscribeAggTrade(symbol string, callback func(*AggTradeEvent) error) error
- func (c *WsMarketClient) SubscribeAllMiniTicker(callback func([]*WsMiniTickerEvent) error) error
- func (c *WsMarketClient) SubscribeBookTicker(symbol string, callback 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, callback func(*KlineEvent) error) error
- func (c *WsMarketClient) SubscribeLimitOrderBook(symbol string, levels int, interval string, callback func(*DepthEvent) error) error
- func (c *WsMarketClient) SubscribeTrade(symbol string, callback func(*TradeEvent) error) error
- func (c *WsMarketClient) UnsubscribeAggTrade(symbol string) error
- func (c *WsMarketClient) UnsubscribeBookTicker(symbol string) error
- func (c *WsMarketClient) UnsubscribeDepth(symbol string) error
- func (c *WsMarketClient) UnsubscribeKline(symbol string, interval string) error
- func (c *WsMarketClient) UnsubscribeLimitOrderBook(symbol string, levels int, interval string) error
- func (c *WsMarketClient) UnsubscribeTrade(symbol string) error
- type WsMiniTickerEvent
Constants ¶
const ( PongInterval = 3 * time.Minute ReconnectWait = 1 * time.Second MaxReconnectAttempts = 10 )
const (
BaseURL = "https://api.binance.com"
)
const (
WSAPIBaseURL = "wss://ws-api.binance.com:443/ws-api/v3"
)
const (
WSBaseURL = "wss://stream.binance.com:9443/ws"
)
Variables ¶
var ArrayEventMap = map[string]string{
"depthUpdate": "!depth@arr@100ms",
"24hrTicker": "!ticker@arr",
"24hrMiniTicker": "!miniTicker@arr",
}
var SingleEventMap = map[string]string{
"depthUpdate": "depth@100ms",
"markPriceUpdate": "markPrice@1s",
"24hrTicker": "ticker",
"24hrMiniTicker": "miniTicker",
"bookTicker": "bookTicker",
"aggTrade": "aggTrade",
"trade": "trade",
}
Functions ¶
func BuildQueryString ¶
BuildQueryString builds a query string from a map, sorted by key
func FormatSymbol ¶
FormatSymbol formats the symbol to uppercase (e.g., btcusdt -> BTCUSDT)
func GenerateSignature ¶
GenerateSignature generates an HMAC SHA256 signature
Types ¶
type AccountPositionEvent ¶
type AccountResponse ¶
type AccountResponse struct {
MakerCommission int64 `json:"makerCommission"`
TakerCommission int64 `json:"takerCommission"`
BuyerCommission int64 `json:"buyerCommission"`
SellerCommission int64 `json:"sellerCommission"`
CanTrade bool `json:"canTrade"`
CanWithdraw bool `json:"canWithdraw"`
CanDeposit bool `json:"canDeposit"`
UpdateTime int64 `json:"updateTime"`
AccountType string `json:"accountType"`
Balances []struct {
Asset string `json:"asset"`
Free string `json:"free"`
Locked string `json:"locked"`
} `json:"balances"`
}
type AggTradeEvent ¶
type AggTradeEvent struct {
EventType string `json:"e"`
EventTime int64 `json:"E"`
Symbol string `json:"s"`
AggTradeID int64 `json:"a"`
Price string `json:"p"`
Quantity string `json:"q"`
FirstTradeID int64 `json:"f"`
LastTradeID int64 `json:"l"`
TradeTime int64 `json:"T"`
IsBuyerMaker bool `json:"m"`
Ignore bool `json:"M"`
}
AggTradeEvent
type BookTickerEvent ¶
type BookTickerEvent struct {
UpdateID int64 `json:"u"`
Symbol string `json:"s"`
BestBidPrice string `json:"b"`
BestBidQty string `json:"B"`
BestAskPrice string `json:"a"`
BestAskQty string `json:"A"`
}
BookTickerEvent
type BookTickerResponse ¶
type CancelOrderResponse ¶
type CancelOrderResponse struct {
Symbol string `json:"symbol"`
OrigClientOrderID string `json:"origClientOrderId"`
OrderID int64 `json:"orderId"`
OrderListID int64 `json:"orderListId"`
ClientOrderID string `json:"clientOrderId"`
Price string `json:"price"`
OrigQty string `json:"origQty"`
ExecutedQty string `json:"executedQty"`
CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
Status string `json:"status"`
TimeInForce string `json:"timeInForce"`
Type string `json:"type"`
Side string `json:"side"`
}
type CancelReplaceOrderParams ¶
type CancelReplaceOrderParams struct {
Symbol string
Side string
Type string
CancelReplaceMode string // STOP_ON_FAILURE or ALLOW_FAILURE
TimeInForce string // Optional
Quantity string
Price string // Optional
CancelOrderID int64 // Optional
CancelOrigClientOrderID string // Optional
NewClientOrderID string // Optional
StopPrice string // Optional
IcebergQty string // Optional
NewOrderRespType string // Optional
}
type CancelReplaceOrderResponse ¶
type CancelReplaceOrderResponse struct {
CancelResult string `json:"cancelResult"`
NewOrderResult string `json:"newOrderResult"`
CancelResponse *CancelOrderResponse `json:"cancelResponse"`
NewOrderResponse *OrderResponse `json:"newOrderResponse"`
}
type Client ¶
type Client struct {
BaseURL string
APIKey string
SecretKey string
HTTPClient *http.Client
Logger *zap.SugaredLogger
}
func (*Client) BookTicker ¶
func (*Client) CancelOrder ¶
func (*Client) CloseUserDataStream ¶
func (*Client) ExchangeInfo ¶
func (c *Client) ExchangeInfo(ctx context.Context) (*ExchangeInfoResponse, error)
func (*Client) GetAccount ¶
func (c *Client) GetAccount(ctx context.Context) (*AccountResponse, error)
func (*Client) GetOpenOrders ¶
func (*Client) KeepAliveUserDataStream ¶
func (*Client) ModifyOrder ¶
func (c *Client) ModifyOrder(ctx context.Context, p CancelReplaceOrderParams) (*CancelReplaceOrderResponse, error)
func (*Client) PlaceOrder ¶
func (c *Client) PlaceOrder(ctx context.Context, p PlaceOrderParams) (*OrderResponse, error)
func (*Client) StartUserDataStream ¶
func (*Client) WithBaseURL ¶
func (*Client) WithCredentials ¶
type DepthEvent ¶
type DepthEvent struct {
EventType string `json:"e"`
EventTime int64 `json:"E"`
Symbol string `json:"s"`
FirstUpdateID int64 `json:"U"`
FinalUpdateID int64 `json:"u"`
Bids [][]string `json:"b"`
Asks [][]string `json:"a"`
}
DepthEvent from ws_dispatchers.go
type DepthResponse ¶
type ExchangeInfoResponse ¶
type ExchangeInfoResponse struct {
Timezone string `json:"timezone"`
ServerTime int64 `json:"serverTime"`
Symbols []SymbolInfo `json:"symbols"`
}
type ExecutionReport ¶
type ExecutionReport struct {
EventType string `json:"e"`
EventTime int64 `json:"E"`
Symbol string `json:"s"`
ClientOrderID string `json:"c"`
Side string `json:"S"`
OrderType string `json:"o"`
TimeInForce string `json:"f"`
Quantity string `json:"q"`
Price string `json:"p"`
StopPrice string `json:"P"`
IcebergQuantity string `json:"F"`
OrderListID int64 `json:"g"` // -1
OriginalClientID string `json:"C"` // ""
ExecutionType string `json:"x"` // NEW, CANCELED, replaced, REJECTED, TRADE, EXPIRED
OrderStatus string `json:"X"` // NEW, PARTIALLY_FILLED, FILLED, CANCELED, REJECTED, EXPIRED
RejectReason string `json:"r"`
OrderID int64 `json:"i"`
LastExecutedQty string `json:"l"`
CumulativeQty string `json:"z"`
LastExecPrice string `json:"L"`
Commission string `json:"n"`
CommissionAsset string `json:"N"`
TransactTime int64 `json:"T"`
TradeID int64 `json:"t"`
Ignore1 int64 `json:"I"` // Ignore
IsOrderWorking bool `json:"w"`
IsMaker bool `json:"m"`
Ignore2 bool `json:"M"` // Ignore
CreationTime int64 `json:"O"`
CumQuoteQty string `json:"Z"`
LastQuoteQty string `json:"Y"`
QuoteOrderQty string `json:"Q"`
}
type ExecutionReportEvent ¶
type ExecutionReportEvent struct {
EventType string `json:"e"`
EventTime int64 `json:"E"`
Symbol string `json:"s"`
ClientOrderID string `json:"c"`
Side string `json:"S"`
OrderType string `json:"o"`
TimeInForce string `json:"f"`
Quantity string `json:"q"`
Price string `json:"p"`
StopPrice string `json:"P"`
IcebergQuantity string `json:"F"`
OrderListID int64 `json:"g"`
OriginalClientOrderID string `json:"C"`
ExecutionType string `json:"x"`
OrderStatus string `json:"X"`
RejectReason string `json:"r"`
OrderID int64 `json:"i"`
LastExecutedQuantity string `json:"l"`
CumulativeFilledQuantity string `json:"z"`
LastExecutedPrice string `json:"L"`
CommissionAmount string `json:"n"`
CommissionAsset string `json:"N"`
TransactionTime int64 `json:"T"`
TradeID int64 `json:"t"`
Ignore int64 `json:"I"`
IsOrderWorking bool `json:"w"`
IsMaker bool `json:"m"`
Ignore2 bool `json:"M"`
CreationTime int64 `json:"O"`
CumulativeQuoteAssetTransactedQuantity string `json:"Z"`
LastQuoteAssetTransactedQuantity string `json:"Y"`
QuoteOrderQuantity string `json:"Q"`
WorkingTime int64 `json:"W"`
SelfTradePreventionMode string `json:"V"`
}
ExecutionReportEvent from ws_dispatchers.go (with fields that caused issues removed or fixed) We will use the robust definition we discovered during debugging if possible, or just standard string/int/float pointers if unsure. But for now, let's use the one from `ws_dispatchers.go` but be careful. Actually, `ws_dispatchers.go` had `EventType` `json:"e"`. Let's copy it but maybe use `json.Number` or `string` for ambiguous fields if needed. However, the issue before was "number into .e" which was strange. Let's use `interface{}` for potentially varying fields if we want, but better to be strict if possible.
type KlineEvent ¶
type KlineEvent struct {
EventType string `json:"e"`
EventTime int64 `json:"E"`
Symbol string `json:"s"`
Kline struct {
StartTime int64 `json:"t"`
CloseTime int64 `json:"T"`
Symbol string `json:"s"`
Interval string `json:"i"`
FirstTradeID int64 `json:"f"`
LastTradeID int64 `json:"L"`
OpenPrice string `json:"o"`
ClosePrice string `json:"c"`
HighPrice string `json:"h"`
LowPrice string `json:"l"`
Volume string `json:"v"`
NumberOfTrades int64 `json:"n"`
IsClosed bool `json:"x"`
QuoteVolume string `json:"q"`
TakerBuyBaseVolume string `json:"V"`
TakerBuyQuoteVolume string `json:"Q"`
Ignore string `json:"B"`
} `json:"k"`
}
KlineEvent from ws_dispatchers.go
type KlineResponse ¶
type KlineResponse []interface{} // Klines are arrays of arrays
type ListenKeyResponse ¶
type ListenKeyResponse struct {
ListenKey string `json:"listenKey"`
}
type OrderResponse ¶
type OrderResponse struct {
Symbol string `json:"symbol"`
OrderID int64 `json:"orderId"`
OrderListID int64 `json:"orderListId"`
ClientOrderID string `json:"clientOrderId"`
TransactTime int64 `json:"transactTime"`
Price string `json:"price"`
OrigQty string `json:"origQty"`
ExecutedQty string `json:"executedQty"`
CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
Status string `json:"status"`
TimeInForce string `json:"timeInForce"`
Type string `json:"type"`
Side string `json:"side"`
}
type PlaceOrderParams ¶
type ServerTimeResponse ¶
type ServerTimeResponse struct {
ServerTime int64 `json:"serverTime"`
}
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
type SymbolInfo ¶
type SymbolInfo struct {
Symbol string `json:"symbol"`
Status string `json:"status"`
BaseAsset string `json:"baseAsset"`
BaseAssetPrecision int `json:"baseAssetPrecision"`
QuoteAsset string `json:"quoteAsset"`
QuotePrecision int `json:"quotePrecision"`
Filters []map[string]interface{} `json:"filters"`
}
type TickerResponse ¶
type TickerResponse struct {
Symbol string `json:"symbol"`
PriceChange string `json:"priceChange"`
PriceChangePercent string `json:"priceChangePercent"`
WeightedAvgPrice string `json:"weightedAvgPrice"`
PrevClosePrice string `json:"prevClosePrice"`
LastPrice string `json:"lastPrice"`
LastQty string `json:"lastQty"`
BidPrice string `json:"bidPrice"`
BidQty string `json:"bidQty"`
AskPrice string `json:"askPrice"`
AskQty string `json:"askQty"`
OpenPrice string `json:"openPrice"`
HighPrice string `json:"highPrice"`
LowPrice string `json:"lowPrice"`
Volume string `json:"volume"`
QuoteVolume string `json:"quoteVolume"`
OpenTime int64 `json:"openTime"`
CloseTime int64 `json:"closeTime"`
FirstId int64 `json:"firstId"`
LastId int64 `json:"lastId"`
Count int64 `json:"count"`
}
type Trade ¶
type Trade struct {
Symbol string `json:"symbol"`
ID int64 `json:"id"`
OrderID int64 `json:"orderId"`
OrderListID int64 `json:"orderListId"`
Price string `json:"price"`
Qty string `json:"qty"`
QuoteQty string `json:"quoteQty"`
Commission string `json:"commission"`
CommissionAsset string `json:"commissionAsset"`
Time int64 `json:"time"`
IsBuyer bool `json:"isBuyer"`
IsMaker bool `json:"isMaker"`
IsBestMatch bool `json:"isBestMatch"`
}
type TradeEvent ¶
type TradeEvent struct {
EventType string `json:"e"`
EventTime int64 `json:"E"`
Symbol string `json:"s"`
TradeID int64 `json:"t"`
Price string `json:"p"`
Quantity string `json:"q"`
BuyerOrderID int64 `json:"b"`
SellerOrderID int64 `json:"a"`
TradeTime int64 `json:"T"`
IsBuyerMaker bool `json:"m"`
Ignore bool `json:"M"`
}
TradeEvent from ws_dispatchers.go
type WsAPIClient ¶
type WsAPIClient struct {
URL string
Conn *websocket.Conn
Mu sync.Mutex
WriteMu sync.Mutex
PendingRequests map[string]chan []byte
PendingMu sync.Mutex
Done chan struct{}
ReconnectWait time.Duration
Logger *zap.SugaredLogger
Debug bool
// contains filtered or unexported fields
}
func NewWsAPIClient ¶
func NewWsAPIClient(ctx context.Context) *WsAPIClient
func (*WsAPIClient) CancelOrderWS ¶
func (c *WsAPIClient) CancelOrderWS(apiKey, secretKey string, symbol string, orderID int64, origClientOrderID string, id string) (*OrderResponse, error)
func (*WsAPIClient) Close ¶
func (c *WsAPIClient) Close()
func (*WsAPIClient) Connect ¶
func (c *WsAPIClient) Connect() error
func (*WsAPIClient) IsConnected ¶
func (c *WsAPIClient) IsConnected() bool
IsConnected checks if the WebSocket connection is established
func (*WsAPIClient) ModifyOrderWS ¶
func (c *WsAPIClient) ModifyOrderWS(apiKey, secretKey string, p CancelReplaceOrderParams, id string) (*CancelReplaceOrderResponse, error)
func (*WsAPIClient) PlaceOrderWS ¶
func (c *WsAPIClient) PlaceOrderWS(apiKey, secretKey string, p PlaceOrderParams, id string) (*OrderResponse, error)
func (*WsAPIClient) SendRequest ¶
func (c *WsAPIClient) SendRequest(id string, req interface{}) ([]byte, error)
func (*WsAPIClient) SetEventHandler ¶
func (c *WsAPIClient) SetEventHandler(handler func([]byte))
SetEventHandler sets the callback for pushed events (messages without "id").
func (*WsAPIClient) WithURL ¶
func (c *WsAPIClient) WithURL(url string) *WsAPIClient
type WsAccountClient ¶
type WsAccountClient struct {
Logger *zap.SugaredLogger
// contains filtered or unexported fields
}
WsAccountClient handles user data stream via WebSocket API. Since Feb 20, 2026, Binance deprecated the listenKey system. User data events are now received by subscribing on the WS-API connection using userDataStream.subscribe.signature with HMAC-SHA256 API key.
This client shares the same WsAPIClient as the order client, subscribing to user data events on the same connection used for orders.
func NewWsAccountClient ¶
func NewWsAccountClient(wsAPI *WsAPIClient, apiKey, apiSecret string) *WsAccountClient
NewWsAccountClient creates a WsAccountClient that uses a shared WsAPIClient.
func (*WsAccountClient) Close ¶
func (c *WsAccountClient) Close()
func (*WsAccountClient) Connect ¶
func (c *WsAccountClient) Connect() error
Connect subscribes to user data stream on the shared WsAPI connection. The WsAPIClient must already be connected before calling this.
func (*WsAccountClient) IsConnected ¶
func (c *WsAccountClient) IsConnected() bool
func (*WsAccountClient) SubscribeAccountPosition ¶
func (c *WsAccountClient) SubscribeAccountPosition(callback func(*AccountPositionEvent))
func (*WsAccountClient) SubscribeExecutionReport ¶
func (c *WsAccountClient) SubscribeExecutionReport(callback func(*ExecutionReportEvent))
type WsClient ¶
type WsClient struct {
URL string
Conn *websocket.Conn
Mu sync.RWMutex
WriteMu sync.Mutex
Logger *zap.SugaredLogger
Debug bool
ReconnectWait time.Duration
// Message handler to be implemented/assigned by the embedding client
Handler func([]byte)
// contains filtered or unexported fields
}
func (*WsClient) CallSubscription ¶
func (*WsClient) IsConnected ¶
IsConnected checks if the WebSocket connection is established
func (*WsClient) SetHandler ¶
SetHandler registers a local handler (no network request)
func (*WsClient) Unsubscribe ¶
Unsubscribe sends an unsubscribe request
type WsDepthEvent ¶
type WsMarketClient ¶
type WsMarketClient struct {
*WsClient
}
func NewWsMarketClient ¶
func NewWsMarketClient(ctx context.Context) *WsMarketClient
func (*WsMarketClient) SubscribeAggTrade ¶
func (c *WsMarketClient) SubscribeAggTrade(symbol string, callback func(*AggTradeEvent) error) error
SubscribeAggTrade
func (*WsMarketClient) SubscribeAllMiniTicker ¶
func (c *WsMarketClient) SubscribeAllMiniTicker(callback func([]*WsMiniTickerEvent) error) error
func (*WsMarketClient) SubscribeBookTicker ¶
func (c *WsMarketClient) SubscribeBookTicker(symbol string, callback func(*BookTickerEvent) error) error
SubscribeBookTicker
func (*WsMarketClient) SubscribeIncrementOrderBook ¶
func (c *WsMarketClient) SubscribeIncrementOrderBook(symbol string, interval string, callback func(*WsDepthEvent) error) error
SubscribeDepth
func (*WsMarketClient) SubscribeKline ¶
func (c *WsMarketClient) SubscribeKline(symbol string, interval string, callback func(*KlineEvent) error) error
SubscribeKline
func (*WsMarketClient) SubscribeLimitOrderBook ¶
func (c *WsMarketClient) SubscribeLimitOrderBook(symbol string, levels int, interval string, callback func(*DepthEvent) error) error
SubscribeLimitOrderBook (Partial Depth)
func (*WsMarketClient) SubscribeTrade ¶
func (c *WsMarketClient) SubscribeTrade(symbol string, callback func(*TradeEvent) error) error
SubscribeTrade
func (*WsMarketClient) UnsubscribeAggTrade ¶
func (c *WsMarketClient) UnsubscribeAggTrade(symbol string) error
func (*WsMarketClient) UnsubscribeBookTicker ¶
func (c *WsMarketClient) UnsubscribeBookTicker(symbol string) error
func (*WsMarketClient) UnsubscribeDepth ¶
func (c *WsMarketClient) UnsubscribeDepth(symbol string) error
func (*WsMarketClient) UnsubscribeKline ¶
func (c *WsMarketClient) UnsubscribeKline(symbol string, interval string) error
func (*WsMarketClient) UnsubscribeLimitOrderBook ¶
func (c *WsMarketClient) UnsubscribeLimitOrderBook(symbol string, levels int, interval string) error
func (*WsMarketClient) UnsubscribeTrade ¶
func (c *WsMarketClient) UnsubscribeTrade(symbol string) error
type WsMiniTickerEvent ¶
type WsMiniTickerEvent struct {
EventType string `json:"e"`
EventTime int64 `json:"E"`
Symbol string `json:"s"`
ClosePrice string `json:"c"`
OpenPrice string `json:"o"`
HighPrice string `json:"h"`
LowPrice string `json:"l"`
Volume string `json:"v"`
QuoteVolume string `json:"q"`
}
WsMiniTickerEvent