Deposit address wrapper Update (#232)

* Add get deposit address and fix authentication issue for ZB exchange

*  Add get deposit address for Yobit exchange

* Add get deposit address for Poloniex exchange

* Add get deposit address for LocalBitcoins exchange

* Remove support for deposit address on Liqui exchange

*  Add get deposit address for LakeBTC exchange

* Add notes as to the reason of non implementation

* Add get deposit address for Kraken exchange

* Add get deposit address for HitBTC exchange

*  Add get deposit address for GateIO exchange

* Add get deposit address for Exmo exchange

*  Remove support for deposit address on Coinut exchange

* Add test case for BTC Markets function still not supported yet.

*  Add get deposit address for Bittrex exchange

* Add get deposit address for Bitstamp exchange

* Add get deposit address for Bitmex exchange
Rm unused swagger.json file in Bitmex exchange

* Add get deposit address for Bithumb exchange

* Add get deposit address for Binance exchange
Fix bug in Authenticated requests, concatenates sig string on end of query

* Remove support for deposit address on ANX exchange

* Updated account type to segregate multiple accounts on an exchange.

* Fix requested changes

* Add get deposit address for Bitfinex exchange
Add parameter for getting deposit address to wrapper

* Add get deposit address for ANX exchange

* Fix misspelling in Poloniex

* Drop working field and initialisation of zero value for Account Type

* Change switch to symbol package currency code
This commit is contained in:
Ryan O'Hara-Reid
2019-01-17 11:44:23 +11:00
committed by Adrian Gallagher
parent 88303b81ab
commit 84a67359c9
75 changed files with 1234 additions and 6559 deletions

View File

@@ -321,8 +321,18 @@ func (b *Bithumb) GetWalletAddress(currency string) (WalletAddressRes, error) {
params := url.Values{}
params.Set("currency", common.StringToUpper(currency))
return response,
b.SendAuthenticatedHTTPRequest(privateWalletAdd, params, &response)
err := b.SendAuthenticatedHTTPRequest(privateWalletAdd, params, &response)
if err != nil {
return response, err
}
if response.Data.WalletAddress == "" {
return response,
fmt.Errorf("deposit address needs to be created via the Bithumb website before retreival for currency %s",
currency)
}
return response, nil
}
// GetLastTransaction returns customer last transaction

View File

@@ -7,7 +7,7 @@ import (
"github.com/thrasher-/gocryptotrader/config"
"github.com/thrasher-/gocryptotrader/currency/pair"
"github.com/thrasher-/gocryptotrader/currency/symbol"
"github.com/thrasher-/gocryptotrader/exchanges"
exchange "github.com/thrasher-/gocryptotrader/exchanges"
)
// Please supply your own keys here for due diligence testing
@@ -482,3 +482,17 @@ func TestWithdrawInternationalBank(t *testing.T) {
t.Errorf("Expected '%v', recieved: '%v'", common.ErrFunctionNotSupported, err)
}
}
func TestGetDepositAddress(t *testing.T) {
if testAPIKey != "" && testAPISecret != "" {
_, err := b.GetDepositAddress(symbol.BTC, "")
if err != nil {
t.Error("Test Failed - GetDepositAddress() error", err)
}
} else {
_, err := b.GetDepositAddress(symbol.BTC, "")
if err == nil {
t.Error("Test Failed - GetDepositAddress() error cannot be nil")
}
}
}

View File

@@ -146,8 +146,11 @@ func (b *Bithumb) GetAccountInfo() (exchange.AccountInfo, error) {
})
}
info.Currencies = exchangeBalances
info.ExchangeName = b.GetName()
info.Accounts = append(info.Accounts, exchange.Account{
Currencies: exchangeBalances,
})
info.Exchange = b.GetName()
return info, nil
}
@@ -248,8 +251,13 @@ func (b *Bithumb) GetOrderInfo(orderID int64) (exchange.OrderDetail, error) {
}
// GetDepositAddress returns a deposit address for a specified currency
func (b *Bithumb) GetDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
return "", common.ErrNotYetImplemented
func (b *Bithumb) GetDepositAddress(cryptocurrency pair.CurrencyItem, accountID string) (string, error) {
addr, err := b.GetWalletAddress(cryptocurrency.String())
if err != nil {
return "", err
}
return addr.Data.WalletAddress, nil
}
// WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is