Skip to content

Commit

Permalink
fix pairs container
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagleft committed Feb 3, 2022
1 parent f3a6e1c commit d43d687
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,13 @@ type APITradeData struct {

// APIPairsResponse - ..
type APIPairsResponse struct {
Success bool `json:"success"`
Result []PairsDataContainer `json:"pairs"`
Success bool `json:"success"`
Result APIPairsData `json:"result"`
}

// APIPairsData - ..
type APIPairsData struct {
Pairs []PairsDataContainer `json:"pairs"`
}

// PairsDataContainer - ..
Expand Down
2 changes: 1 addition & 1 deletion trade.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (c *Client) GetPairs() ([]PairsDataContainer, error) {
if !response.Success {
return nil, errors.New("failed to get pairs list") // TODO
}
return response.Result, nil
return response.Result.Pairs, nil
}

// GetOrderBook by trade pair
Expand Down

0 comments on commit d43d687

Please sign in to comment.