Skip to content

Commit

Permalink
Merge pull request #38 from lamengao/exinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
alplabin authored Nov 20, 2024
2 parents 6dd9d2e + 4b837f8 commit cf72ee4
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion market.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,21 @@ type ServerTimeResponse struct {

// Binance Exchange Information endpoint (GET /api/v3/exchangeInfo)
type ExchangeInfo struct {
c *Client
c *Client
symbol *string
symbols *[]string
}

// Symbol set symbol
func (s *ExchangeInfo) Symbol(symbol string) *ExchangeInfo {
s.symbol = &symbol
return s
}

// Symbols set symbols
func (s *ExchangeInfo) Symbols(symbols []string) *ExchangeInfo {
s.symbols = &symbols
return s
}

// Send the request
Expand All @@ -67,6 +81,12 @@ func (s *ExchangeInfo) Do(ctx context.Context, opts ...RequestOption) (res *Exch
endpoint: "/api/v3/exchangeInfo",
secType: secTypeNone,
}
if s.symbol != nil {
r.setParam("symbol", *s.symbol)
}
if s.symbols != nil {
r.setParam("symbols", *s.symbols)
}
data, err := s.c.callAPI(ctx, r, opts...)
if err != nil {
return nil, err
Expand Down

0 comments on commit cf72ee4

Please sign in to comment.