/
common.go
30 lines (27 loc) · 986 Bytes
/
common.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package novadax
// Symbol stands for NovaDAX's available symbol
type Symbol struct {
Symbol string `json:"symbol"`
BaseCurrency string `json:"baseCurrency"`
QuoteCurrency string `json:"quoteCurrency"`
AmountPrecision int `json:"amountPrecision"`
PricePrecision int `json:"pricePrecision"`
ValuePrecision int `json:"valuePrecision"`
MinOrderAmount string `json:"minOrderAmount"`
MinOrderValue string `json:"minOrderValue"`
}
// ListSymbolsResponse stands for the response structure for symbol listing API endpoint
type ListSymbolsResponse struct {
Code string `json:"code"`
Symbols []*Symbol `json:"data"`
}
// ListSymbols returns current available symbols for NovaDAX
func (client *Client) ListSymbols() ([]*Symbol, error) {
req, err := client.buildRequest("GET", "/v1/common/symbols", nil, false)
if err != nil {
return nil, err
}
var response ListSymbolsResponse
_, err = client.do(req, &response)
return response.Symbols, err
}