Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions v2/ticker_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import (

// ListBookTickersService list best price/qty on the order book for a symbol or symbols
type ListBookTickersService struct {
c *Client
symbol *string
c *Client
symbol *string
symbols []string
}

// Symbol set symbol
Expand All @@ -20,6 +21,12 @@ func (s *ListBookTickersService) Symbol(symbol string) *ListBookTickersService {
return s
}

// Symbols set symbols
func (s *ListBookTickersService) Symbols(symbols ...string) *ListBookTickersService {
s.symbols = symbols
return s
}

// Do send request
func (s *ListBookTickersService) Do(ctx context.Context, opts ...RequestOption) (res []*BookTicker, err error) {
r := &request{
Expand All @@ -28,6 +35,8 @@ func (s *ListBookTickersService) Do(ctx context.Context, opts ...RequestOption)
}
if s.symbol != nil {
r.setParam("symbol", *s.symbol)
} else if s.symbols != nil {
r.setParam("symbols", s.symbols)
}
data, err := s.c.callAPI(ctx, r, opts...)
data = common.ToJSONList(data)
Expand Down