From d43d6874565684498ea3f79f655854a86c642ad6 Mon Sep 17 00:00:00 2001 From: Sagleft Date: Thu, 3 Feb 2022 20:14:16 +0200 Subject: [PATCH] fix pairs container --- structs.go | 9 +++++++-- trade.go | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/structs.go b/structs.go index b5ef1aa..2bfc9d0 100644 --- a/structs.go +++ b/structs.go @@ -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 - .. diff --git a/trade.go b/trade.go index e869a37..0cee300 100644 --- a/trade.go +++ b/trade.go @@ -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