Bittrex - changed type of field "Id" in DepositHistory struct (#419)

* Bittrex GetDepositHistory method return new DepositHistory struct type

* Id field of DepositHistory type changed to int64

* check exchange (exist and enabled) before calling methods on, to avoid program crashes

* Update bittrex_types.go
This commit is contained in:
Vazha
2020-01-22 02:30:14 +02:00
committed by Adrian Gallagher
parent 4b9de0fdd0
commit 4c33a0738a
2 changed files with 9 additions and 3 deletions

View File

@@ -417,13 +417,19 @@ func GetRelatableCurrencies(p currency.Pair, incOrig, incUSDT bool) currency.Pai
// GetSpecificOrderbook returns a specific orderbook given the currency,
// exchangeName and assetType
func GetSpecificOrderbook(p currency.Pair, exchangeName string, assetType asset.Item) (*orderbook.Base, error) {
return GetExchangeByName(exchangeName).FetchOrderbook(p, assetType)
if CheckExchangeExists(exchangeName) {
return GetExchangeByName(exchangeName).FetchOrderbook(p, assetType)
}
return &orderbook.Base{}, errors.New("exchange is not loaded/doesn't exist")
}
// GetSpecificTicker returns a specific ticker given the currency,
// exchangeName and assetType
func GetSpecificTicker(p currency.Pair, exchangeName string, assetType asset.Item) (*ticker.Price, error) {
return GetExchangeByName(exchangeName).FetchTicker(p, assetType)
if CheckExchangeExists(exchangeName) {
return GetExchangeByName(exchangeName).FetchTicker(p, assetType)
}
return &ticker.Price{}, errors.New("exchange is not loaded/doesn't exist")
}
// GetCollatedExchangeAccountInfoByCoin collates individual exchange account

View File

@@ -215,7 +215,7 @@ type DepositHistory struct {
Success bool `json:"success"`
Message string `json:"message"`
Result []struct {
ID string `json:"Id"`
ID int64 `json:"Id"`
Amount float64 `json:"Amount"`
Currency string `json:"Currency"`
Confirmations int64 `json:"Confirmations"`