From a91d147781ab8ce7cd6ccc30788a8f763b088980 Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Thu, 12 Dec 2019 14:16:45 +1100 Subject: [PATCH 1/6] Moved withdraw structs into own package --- cmd/exchange_template/wrapper_file.tmpl | 6 +-- cmd/exchange_wrapper_coverage/main.go | 7 +-- cmd/exchange_wrapper_issues/main.go | 7 +-- engine/helpers.go | 3 +- exchanges/alphapoint/alphapoint_test.go | 7 +-- exchanges/alphapoint/alphapoint_wrapper.go | 7 +-- exchanges/anx/anx_test.go | 9 ++-- exchanges/anx/anx_wrapper.go | 7 +-- exchanges/binance/binance.go | 4 +- exchanges/binance/binance_test.go | 9 ++-- exchanges/binance/binance_wrapper.go | 7 +-- exchanges/bitfinex/bitfinex.go | 3 +- exchanges/bitfinex/bitfinex_test.go | 13 ++--- exchanges/bitfinex/bitfinex_wrapper.go | 7 +-- exchanges/bitflyer/bitflyer_test.go | 9 ++-- exchanges/bitflyer/bitflyer_wrapper.go | 7 +-- exchanges/bithumb/bithumb_test.go | 11 ++-- exchanges/bithumb/bithumb_wrapper.go | 7 +-- exchanges/bitmex/bitmex_test.go | 9 ++-- exchanges/bitmex/bitmex_wrapper.go | 7 +-- exchanges/bitstamp/bitstamp_test.go | 13 ++--- exchanges/bitstamp/bitstamp_wrapper.go | 7 +-- exchanges/bittrex/bittrex_test.go | 9 ++-- exchanges/bittrex/bittrex_wrapper.go | 7 +-- exchanges/btcmarkets/btcmarkets_wrapper.go | 7 +-- exchanges/btse/btse_wrapper.go | 7 +-- exchanges/coinbasepro/coinbasepro_test.go | 13 ++--- exchanges/coinbasepro/coinbasepro_wrapper.go | 7 +-- exchanges/coinbene/coinbene_wrapper.go | 7 +-- exchanges/coinut/coinut_test.go | 9 ++-- exchanges/coinut/coinut_wrapper.go | 7 +-- exchanges/exchange_types.go | 51 ------------------ exchanges/exmo/exmo_test.go | 9 ++-- exchanges/exmo/exmo_wrapper.go | 7 +-- exchanges/gateio/gateio_test.go | 9 ++-- exchanges/gateio/gateio_wrapper.go | 7 +-- exchanges/gemini/gemini_test.go | 9 ++-- exchanges/gemini/gemini_wrapper.go | 7 +-- exchanges/hitbtc/hitbtc_test.go | 9 ++-- exchanges/hitbtc/hitbtc_wrapper.go | 7 +-- exchanges/huobi/huobi_test.go | 9 ++-- exchanges/huobi/huobi_wrapper.go | 7 +-- exchanges/interfaces.go | 7 +-- exchanges/itbit/itbit_test.go | 9 ++-- exchanges/itbit/itbit_wrapper.go | 7 +-- exchanges/kraken/kraken_test.go | 13 ++--- exchanges/kraken/kraken_wrapper.go | 7 +-- exchanges/lakebtc/lakebtc_test.go | 9 ++-- exchanges/lakebtc/lakebtc_wrapper.go | 7 +-- exchanges/lbank/lbank_wrapper.go | 7 +-- exchanges/localbitcoins/localbitcoins_test.go | 9 ++-- .../localbitcoins/localbitcoins_wrapper.go | 7 +-- exchanges/okcoin/okcoin_test.go | 9 ++-- exchanges/okex/okex_test.go | 9 ++-- exchanges/okgroup/okgroup_wrapper.go | 7 +-- exchanges/poloniex/poloniex_test.go | 9 ++-- exchanges/poloniex/poloniex_wrapper.go | 7 +-- exchanges/withdraw/withdraw.go | 1 + exchanges/withdraw/withdraw_types.go | 54 +++++++++++++++++++ exchanges/yobit/yobit_test.go | 9 ++-- exchanges/yobit/yobit_wrapper.go | 7 +-- exchanges/zb/zb_test.go | 9 ++-- exchanges/zb/zb_wrapper.go | 7 +-- gctrpc/rpc.pb.go | 3 +- 64 files changed, 323 insertions(+), 260 deletions(-) create mode 100644 exchanges/withdraw/withdraw.go create mode 100644 exchanges/withdraw/withdraw_types.go diff --git a/cmd/exchange_template/wrapper_file.tmpl b/cmd/exchange_template/wrapper_file.tmpl index 0ed4873f..8dc2f88f 100644 --- a/cmd/exchange_template/wrapper_file.tmpl +++ b/cmd/exchange_template/wrapper_file.tmpl @@ -333,19 +333,19 @@ func ({{.Variable}} *{{.CapitalName}}) GetDepositAddress(cryptocurrency currency // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func ({{.Variable}} *{{.CapitalName}}) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func ({{.Variable}} *{{.CapitalName}}) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { return "", common.ErrNotYetImplemented } // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func ({{.Variable}} *{{.CapitalName}}) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func ({{.Variable}} *{{.CapitalName}}) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrNotYetImplemented } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func ({{.Variable}} *{{.CapitalName}}) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func ({{.Variable}} *{{.CapitalName}}) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrNotYetImplemented } diff --git a/cmd/exchange_wrapper_coverage/main.go b/cmd/exchange_wrapper_coverage/main.go index 40dba073..e352c028 100644 --- a/cmd/exchange_wrapper_coverage/main.go +++ b/cmd/exchange_wrapper_coverage/main.go @@ -12,6 +12,7 @@ import ( exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/asset" "github.com/thrasher-corp/gocryptotrader/exchanges/order" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) const ( @@ -173,16 +174,16 @@ func testWrappers(e exchange.IBotExchange) []string { funcs = append(funcs, "GetDepositAddress") } - _, err = e.WithdrawCryptocurrencyFunds(&exchange.CryptoWithdrawRequest{}) + _, err = e.WithdrawCryptocurrencyFunds(&withdraw.CryptoWithdrawRequest{}) if err == common.ErrNotYetImplemented { funcs = append(funcs, "WithdrawCryptocurrencyFunds") } - _, err = e.WithdrawFiatFunds(&exchange.FiatWithdrawRequest{}) + _, err = e.WithdrawFiatFunds(&withdraw.FiatWithdrawRequest{}) if err == common.ErrNotYetImplemented { funcs = append(funcs, "WithdrawFiatFunds") } - _, err = e.WithdrawFiatFundsToInternationalBank(&exchange.FiatWithdrawRequest{}) + _, err = e.WithdrawFiatFundsToInternationalBank(&withdraw.FiatWithdrawRequest{}) if err == common.ErrNotYetImplemented { funcs = append(funcs, "WithdrawFiatFundsToInternationalBank") } diff --git a/cmd/exchange_wrapper_issues/main.go b/cmd/exchange_wrapper_issues/main.go index e4d2b6e4..704fc220 100644 --- a/cmd/exchange_wrapper_issues/main.go +++ b/cmd/exchange_wrapper_issues/main.go @@ -22,6 +22,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/orderbook" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) func main() { @@ -619,11 +620,11 @@ func testWrappers(e exchange.IBotExchange, base *exchange.Base, config *Config) Response: jsonifyInterface([]interface{}{r19}), }) - genericWithdrawRequest := exchange.GenericWithdrawRequestInfo{ + genericWithdrawRequest := withdraw.GenericWithdrawRequestInfo{ Amount: config.OrderSubmission.Amount, Currency: p.Quote, } - withdrawRequest := exchange.CryptoWithdrawRequest{ + withdrawRequest := withdraw.CryptoWithdrawRequest{ GenericWithdrawRequestInfo: genericWithdrawRequest, Address: withdrawAddressOverride, } @@ -663,7 +664,7 @@ func testWrappers(e exchange.IBotExchange, base *exchange.Base, config *Config) Response: jsonifyInterface([]interface{}{r21}), }) - fiatWithdrawRequest := exchange.FiatWithdrawRequest{ + fiatWithdrawRequest := withdraw.FiatWithdrawRequest{ GenericWithdrawRequestInfo: genericWithdrawRequest, BankAccountName: config.BankDetails.BankAccountName, BankAccountNumber: config.BankDetails.BankAccountNumber, diff --git a/engine/helpers.go b/engine/helpers.go index 0db45287..570989bb 100644 --- a/engine/helpers.go +++ b/engine/helpers.go @@ -26,6 +26,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/orderbook" "github.com/thrasher-corp/gocryptotrader/exchanges/stats" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" "github.com/thrasher-corp/gocryptotrader/portfolio" "github.com/thrasher-corp/gocryptotrader/utils" @@ -699,7 +700,7 @@ func GetExchangeCryptocurrencyDepositAddresses() map[string]map[string]string { } // WithdrawCryptocurrencyFundsByExchange withdraws the desired cryptocurrency and amount to a desired cryptocurrency address -func WithdrawCryptocurrencyFundsByExchange(exchName string, req *exchange.CryptoWithdrawRequest) (string, error) { +func WithdrawCryptocurrencyFundsByExchange(exchName string, req *withdraw.CryptoWithdrawRequest) (string, error) { if req == nil { return "", errors.New("crypto withdraw request param is nil") } diff --git a/exchanges/alphapoint/alphapoint_test.go b/exchanges/alphapoint/alphapoint_test.go index 910e9880..6ed0c2c8 100644 --- a/exchanges/alphapoint/alphapoint_test.go +++ b/exchanges/alphapoint/alphapoint_test.go @@ -10,6 +10,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/currency" exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/order" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) const ( @@ -560,7 +561,7 @@ func TestModifyOrder(t *testing.T) { func TestWithdraw(t *testing.T) { t.Parallel() - var withdrawCryptoRequest = exchange.CryptoWithdrawRequest{} + var withdrawCryptoRequest = withdraw.CryptoWithdrawRequest{} _, err := a.WithdrawCryptocurrencyFunds(&withdrawCryptoRequest) if err != common.ErrNotYetImplemented { t.Errorf("Expected 'Not implemented', received %v", err) @@ -573,7 +574,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := a.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrNotYetImplemented { t.Errorf("Expected '%v', received: '%v'", common.ErrNotYetImplemented, err) @@ -586,7 +587,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := a.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrNotYetImplemented { t.Errorf("Expected '%v', received: '%v'", common.ErrNotYetImplemented, err) diff --git a/exchanges/alphapoint/alphapoint_wrapper.go b/exchanges/alphapoint/alphapoint_wrapper.go index 4df2c5d5..f7fd940e 100644 --- a/exchanges/alphapoint/alphapoint_wrapper.go +++ b/exchanges/alphapoint/alphapoint_wrapper.go @@ -16,6 +16,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // GetDefaultConfig returns a default exchange config for Alphapoint @@ -282,18 +283,18 @@ func (a *Alphapoint) GetDepositAddress(cryptocurrency currency.Code, _ string) ( // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (a *Alphapoint) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (a *Alphapoint) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { return "", common.ErrNotYetImplemented } // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted -func (a *Alphapoint) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (a *Alphapoint) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrNotYetImplemented } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func (a *Alphapoint) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (a *Alphapoint) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrNotYetImplemented } diff --git a/exchanges/anx/anx_test.go b/exchanges/anx/anx_test.go index c817c725..4242a104 100644 --- a/exchanges/anx/anx_test.go +++ b/exchanges/anx/anx_test.go @@ -8,6 +8,7 @@ import ( exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/asset" "github.com/thrasher-corp/gocryptotrader/exchanges/order" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply your own keys here for due diligence testing @@ -326,8 +327,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -346,7 +347,7 @@ func TestWithdraw(t *testing.T) { func TestWithdrawFiat(t *testing.T) { t.Parallel() - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := a.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", @@ -357,7 +358,7 @@ func TestWithdrawFiat(t *testing.T) { func TestWithdrawInternationalBank(t *testing.T) { t.Parallel() - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := a.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", diff --git a/exchanges/anx/anx_wrapper.go b/exchanges/anx/anx_wrapper.go index 5c1184bf..a7092432 100644 --- a/exchanges/anx/anx_wrapper.go +++ b/exchanges/anx/anx_wrapper.go @@ -18,6 +18,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -417,20 +418,20 @@ func (a *ANX) GetDepositAddress(cryptocurrency currency.Code, _ string) (string, // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (a *ANX) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (a *ANX) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { return a.Send(withdrawRequest.Currency.String(), withdrawRequest.Address, "", strconv.FormatFloat(withdrawRequest.Amount, 'f', -1, 64)) } // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func (a *ANX) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (a *ANX) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { // Fiat withdrawals available via website return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func (a *ANX) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (a *ANX) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { // Fiat withdrawals available via website return "", common.ErrFunctionNotSupported } diff --git a/exchanges/binance/binance.go b/exchanges/binance/binance.go index fb0f8a16..c324dc5f 100644 --- a/exchanges/binance/binance.go +++ b/exchanges/binance/binance.go @@ -46,7 +46,7 @@ const ( allOrders = "/api/v3/allOrders" // Withdraw API endpoints - withdraw = "/wapi/v3/withdraw.html" + withdrawEndpoint = "/wapi/v3/withdraw.html" depositHistory = "/wapi/v3/depositHistory.html" withdrawalHistory = "/wapi/v3/withdrawHistory.html" depositAddress = "/wapi/v3/depositAddress.html" @@ -643,7 +643,7 @@ func getCryptocurrencyWithdrawalFee(c currency.Code) float64 { // WithdrawCrypto sends cryptocurrency to the address of your choosing func (b *Binance) WithdrawCrypto(asset, address, addressTag, name, amount string) (string, error) { var resp WithdrawResponse - path := b.API.Endpoints.URL + withdraw + path := b.API.Endpoints.URL + withdrawEndpoint params := url.Values{} params.Set("asset", asset) diff --git a/exchanges/binance/binance_test.go b/exchanges/binance/binance_test.go index 0934d278..4019a849 100644 --- a/exchanges/binance/binance_test.go +++ b/exchanges/binance/binance_test.go @@ -8,6 +8,7 @@ import ( exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/asset" "github.com/thrasher-corp/gocryptotrader/exchanges/order" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply your own keys here for due diligence testing @@ -453,8 +454,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: 0, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -476,7 +477,7 @@ func TestWithdraw(t *testing.T) { func TestWithdrawFiat(t *testing.T) { t.Parallel() - var withdrawFiatRequest exchange.FiatWithdrawRequest + var withdrawFiatRequest withdraw.FiatWithdrawRequest _, err := b.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -486,7 +487,7 @@ func TestWithdrawFiat(t *testing.T) { func TestWithdrawInternationalBank(t *testing.T) { t.Parallel() - var withdrawFiatRequest exchange.FiatWithdrawRequest + var withdrawFiatRequest withdraw.FiatWithdrawRequest _, err := b.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/binance/binance_wrapper.go b/exchanges/binance/binance_wrapper.go index 4f79f15c..288649d5 100644 --- a/exchanges/binance/binance_wrapper.go +++ b/exchanges/binance/binance_wrapper.go @@ -19,6 +19,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -494,7 +495,7 @@ func (b *Binance) GetDepositAddress(cryptocurrency currency.Code, _ string) (str // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Binance) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (b *Binance) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { amountStr := strconv.FormatFloat(withdrawRequest.Amount, 'f', -1, 64) return b.WithdrawCrypto(withdrawRequest.Currency.String(), withdrawRequest.Address, @@ -504,13 +505,13 @@ func (b *Binance) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWi // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (b *Binance) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Binance) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (b *Binance) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Binance) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/bitfinex/bitfinex.go b/exchanges/bitfinex/bitfinex.go index a79811f3..ba239f48 100644 --- a/exchanges/bitfinex/bitfinex.go +++ b/exchanges/bitfinex/bitfinex.go @@ -15,6 +15,7 @@ import ( exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -541,7 +542,7 @@ func (b *Bitfinex) WithdrawCryptocurrency(withdrawType, wallet, address, payment } // WithdrawFIAT Sends an authenticated request to withdraw FIAT currency -func (b *Bitfinex) WithdrawFIAT(withdrawalType, walletType string, withdrawRequest *exchange.FiatWithdrawRequest) ([]Withdrawal, error) { +func (b *Bitfinex) WithdrawFIAT(withdrawalType, walletType string, withdrawRequest *withdraw.FiatWithdrawRequest) ([]Withdrawal, error) { var response []Withdrawal req := make(map[string]interface{}) diff --git a/exchanges/bitfinex/bitfinex_test.go b/exchanges/bitfinex/bitfinex_test.go index ce29001d..35996134 100644 --- a/exchanges/bitfinex/bitfinex_test.go +++ b/exchanges/bitfinex/bitfinex_test.go @@ -17,6 +17,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply your own keys here to do better tests @@ -884,8 +885,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -908,8 +909,8 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.USD, Description: "WITHDRAW IT ALL", @@ -941,8 +942,8 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/bitfinex/bitfinex_wrapper.go b/exchanges/bitfinex/bitfinex_wrapper.go index 555dedf4..a2431e22 100644 --- a/exchanges/bitfinex/bitfinex_wrapper.go +++ b/exchanges/bitfinex/bitfinex_wrapper.go @@ -19,6 +19,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -485,7 +486,7 @@ func (b *Bitfinex) GetDepositAddress(cryptocurrency currency.Code, accountID str } // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted -func (b *Bitfinex) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (b *Bitfinex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { withdrawalType := b.ConvertSymbolToWithdrawalType(withdrawRequest.Currency) // Bitfinex has support for three types, exchange, margin and deposit // As this is for trading, I've made the wrapper default 'exchange' @@ -509,7 +510,7 @@ func (b *Bitfinex) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoW // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted // Returns comma delimited withdrawal IDs -func (b *Bitfinex) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Bitfinex) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { withdrawalType := "wire" // Bitfinex has support for three types, exchange, margin and deposit // As this is for trading, I've made the wrapper default 'exchange' @@ -541,7 +542,7 @@ func (b *Bitfinex) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawReque // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted // Returns comma delimited withdrawal IDs -func (b *Bitfinex) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Bitfinex) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return b.WithdrawFiatFunds(withdrawRequest) } diff --git a/exchanges/bitflyer/bitflyer_test.go b/exchanges/bitflyer/bitflyer_test.go index 31a87a5c..41c5cf20 100644 --- a/exchanges/bitflyer/bitflyer_test.go +++ b/exchanges/bitflyer/bitflyer_test.go @@ -11,6 +11,7 @@ import ( exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/asset" "github.com/thrasher-corp/gocryptotrader/exchanges/order" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply your own keys here for due diligence testing @@ -366,8 +367,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -398,7 +399,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := b.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrNotYetImplemented { @@ -412,7 +413,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := b.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrNotYetImplemented { diff --git a/exchanges/bitflyer/bitflyer_wrapper.go b/exchanges/bitflyer/bitflyer_wrapper.go index 7bbce079..3f3304e8 100644 --- a/exchanges/bitflyer/bitflyer_wrapper.go +++ b/exchanges/bitflyer/bitflyer_wrapper.go @@ -16,6 +16,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -309,19 +310,19 @@ func (b *Bitflyer) GetDepositAddress(cryptocurrency currency.Code, accountID str // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Bitflyer) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (b *Bitflyer) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { return "", common.ErrNotYetImplemented } // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (b *Bitflyer) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Bitflyer) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrNotYetImplemented } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (b *Bitflyer) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Bitflyer) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrNotYetImplemented } diff --git a/exchanges/bithumb/bithumb_test.go b/exchanges/bithumb/bithumb_test.go index b2331ba2..0dea6ecc 100644 --- a/exchanges/bithumb/bithumb_test.go +++ b/exchanges/bithumb/bithumb_test.go @@ -10,6 +10,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/currency" exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/order" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply your own keys here for due diligence testing @@ -448,8 +449,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -472,8 +473,8 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.USD, Description: "WITHDRAW IT ALL", @@ -506,7 +507,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := b.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/bithumb/bithumb_wrapper.go b/exchanges/bithumb/bithumb_wrapper.go index 73dc3c3f..03f16bbd 100644 --- a/exchanges/bithumb/bithumb_wrapper.go +++ b/exchanges/bithumb/bithumb_wrapper.go @@ -19,6 +19,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -407,7 +408,7 @@ func (b *Bithumb) GetDepositAddress(cryptocurrency currency.Code, _ string) (str // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Bithumb) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (b *Bithumb) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { _, err := b.WithdrawCrypto(withdrawRequest.Address, withdrawRequest.AddressTag, withdrawRequest.Currency.String(), @@ -417,7 +418,7 @@ func (b *Bithumb) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWi // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (b *Bithumb) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Bithumb) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { if math.Mod(withdrawRequest.Amount, 1) != 0 { return "", errors.New("currency KRW does not support decimal places") } @@ -438,7 +439,7 @@ func (b *Bithumb) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawReques } // WithdrawFiatFundsToInternationalBank is not supported as Bithumb only withdraws KRW to South Korean banks -func (b *Bithumb) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Bithumb) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/bitmex/bitmex_test.go b/exchanges/bitmex/bitmex_test.go index f92fdee0..8a693f1d 100644 --- a/exchanges/bitmex/bitmex_test.go +++ b/exchanges/bitmex/bitmex_test.go @@ -16,6 +16,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply your own keys here for due diligence testing @@ -606,8 +607,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -634,7 +635,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := b.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -646,7 +647,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := b.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/bitmex/bitmex_wrapper.go b/exchanges/bitmex/bitmex_wrapper.go index 4f65011d..a5908ea9 100644 --- a/exchanges/bitmex/bitmex_wrapper.go +++ b/exchanges/bitmex/bitmex_wrapper.go @@ -18,6 +18,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -509,7 +510,7 @@ func (b *Bitmex) GetDepositAddress(cryptocurrency currency.Code, _ string) (stri // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Bitmex) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (b *Bitmex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { var request = UserRequestWithdrawalParams{ Address: withdrawRequest.Address, Amount: withdrawRequest.Amount, @@ -530,13 +531,13 @@ func (b *Bitmex) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWit // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Bitmex) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Bitmex) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func (b *Bitmex) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Bitmex) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/bitstamp/bitstamp_test.go b/exchanges/bitstamp/bitstamp_test.go index 39d7dfd4..b385a891 100644 --- a/exchanges/bitstamp/bitstamp_test.go +++ b/exchanges/bitstamp/bitstamp_test.go @@ -7,6 +7,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/currency" exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/order" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please add your private keys and customerID for better tests @@ -454,8 +455,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -481,8 +482,8 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.USD, Description: "WITHDRAW IT ALL", @@ -519,8 +520,8 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.USD, Description: "WITHDRAW IT ALL", diff --git a/exchanges/bitstamp/bitstamp_wrapper.go b/exchanges/bitstamp/bitstamp_wrapper.go index fc6fa247..d228e472 100644 --- a/exchanges/bitstamp/bitstamp_wrapper.go +++ b/exchanges/bitstamp/bitstamp_wrapper.go @@ -18,6 +18,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -420,7 +421,7 @@ func (b *Bitstamp) GetDepositAddress(cryptocurrency currency.Code, _ string) (st // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Bitstamp) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (b *Bitstamp) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { resp, err := b.CryptoWithdrawal(withdrawRequest.Amount, withdrawRequest.Address, withdrawRequest.Currency.String(), @@ -442,7 +443,7 @@ func (b *Bitstamp) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoW // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (b *Bitstamp) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Bitstamp) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { resp, err := b.OpenBankWithdrawal(withdrawRequest.Amount, withdrawRequest.Currency.String(), withdrawRequest.BankAccountName, @@ -470,7 +471,7 @@ func (b *Bitstamp) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawReque // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (b *Bitstamp) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Bitstamp) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { resp, err := b.OpenInternationalBankWithdrawal(withdrawRequest.Amount, withdrawRequest.Currency.String(), withdrawRequest.BankAccountName, diff --git a/exchanges/bittrex/bittrex_test.go b/exchanges/bittrex/bittrex_test.go index 5cc15712..e83c5bf0 100644 --- a/exchanges/bittrex/bittrex_test.go +++ b/exchanges/bittrex/bittrex_test.go @@ -10,6 +10,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/currency" exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/order" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply you own test keys here to run better tests. @@ -442,8 +443,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -469,7 +470,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := b.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { @@ -482,7 +483,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := b.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { diff --git a/exchanges/bittrex/bittrex_wrapper.go b/exchanges/bittrex/bittrex_wrapper.go index 0af7bb87..162f6048 100644 --- a/exchanges/bittrex/bittrex_wrapper.go +++ b/exchanges/bittrex/bittrex_wrapper.go @@ -17,6 +17,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -408,20 +409,20 @@ func (b *Bittrex) GetDepositAddress(cryptocurrency currency.Code, _ string) (str // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Bittrex) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (b *Bittrex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { uuid, err := b.Withdraw(withdrawRequest.Currency.String(), withdrawRequest.AddressTag, withdrawRequest.Address, withdrawRequest.Amount) return uuid.Result.ID, err } // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (b *Bittrex) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Bittrex) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (b *Bittrex) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *Bittrex) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/btcmarkets/btcmarkets_wrapper.go b/exchanges/btcmarkets/btcmarkets_wrapper.go index 7c59d882..a4804030 100644 --- a/exchanges/btcmarkets/btcmarkets_wrapper.go +++ b/exchanges/btcmarkets/btcmarkets_wrapper.go @@ -18,6 +18,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -477,7 +478,7 @@ func (b *BTCMarkets) GetDepositAddress(cryptocurrency currency.Code, accountID s } // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted -func (b *BTCMarkets) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (b *BTCMarkets) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { a, err := b.RequestWithdraw(withdrawRequest.Currency.String(), withdrawRequest.Amount, withdrawRequest.Address, @@ -493,7 +494,7 @@ func (b *BTCMarkets) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.Crypt // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (b *BTCMarkets) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *BTCMarkets) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { if withdrawRequest.Currency != currency.AUD { return "", errors.New("only aud is supported for withdrawals") } @@ -512,7 +513,7 @@ func (b *BTCMarkets) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawReq // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (b *BTCMarkets) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *BTCMarkets) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/btse/btse_wrapper.go b/exchanges/btse/btse_wrapper.go index 02444533..57060b1b 100644 --- a/exchanges/btse/btse_wrapper.go +++ b/exchanges/btse/btse_wrapper.go @@ -19,6 +19,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -497,19 +498,19 @@ func (b *BTSE) GetDepositAddress(cryptocurrency currency.Code, accountID string) // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *BTSE) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (b *BTSE) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *BTSE) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *BTSE) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func (b *BTSE) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (b *BTSE) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/coinbasepro/coinbasepro_test.go b/exchanges/coinbasepro/coinbasepro_test.go index b594603c..05484ed4 100644 --- a/exchanges/coinbasepro/coinbasepro_test.go +++ b/exchanges/coinbasepro/coinbasepro_test.go @@ -14,6 +14,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) var c CoinbasePro @@ -498,8 +499,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -525,8 +526,8 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: 100, Currency: currency.USD, }, @@ -547,8 +548,8 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: 100, Currency: currency.USD, }, diff --git a/exchanges/coinbasepro/coinbasepro_wrapper.go b/exchanges/coinbasepro/coinbasepro_wrapper.go index db4848e8..376718d7 100644 --- a/exchanges/coinbasepro/coinbasepro_wrapper.go +++ b/exchanges/coinbasepro/coinbasepro_wrapper.go @@ -18,6 +18,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -447,14 +448,14 @@ func (c *CoinbasePro) GetDepositAddress(cryptocurrency currency.Code, accountID // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (c *CoinbasePro) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (c *CoinbasePro) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { resp, err := c.WithdrawCrypto(withdrawRequest.Amount, withdrawRequest.Currency.String(), withdrawRequest.Address) return resp.ID, err } // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func (c *CoinbasePro) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (c *CoinbasePro) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { paymentMethods, err := c.GetPayMethods() if err != nil { return "", err @@ -481,7 +482,7 @@ func (c *CoinbasePro) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRe // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (c *CoinbasePro) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (c *CoinbasePro) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return c.WithdrawFiatFunds(withdrawRequest) } diff --git a/exchanges/coinbene/coinbene_wrapper.go b/exchanges/coinbene/coinbene_wrapper.go index 373222f1..65a5743d 100644 --- a/exchanges/coinbene/coinbene_wrapper.go +++ b/exchanges/coinbene/coinbene_wrapper.go @@ -18,6 +18,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -456,19 +457,19 @@ func (c *Coinbene) GetDepositAddress(cryptocurrency currency.Code, accountID str // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (c *Coinbene) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (c *Coinbene) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func (c *Coinbene) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (c *Coinbene) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func (c *Coinbene) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (c *Coinbene) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/coinut/coinut_test.go b/exchanges/coinut/coinut_test.go index c3616708..bf1bf3a1 100644 --- a/exchanges/coinut/coinut_test.go +++ b/exchanges/coinut/coinut_test.go @@ -14,6 +14,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) var c COINUT @@ -382,8 +383,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -406,7 +407,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := c.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -418,7 +419,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := c.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/coinut/coinut_wrapper.go b/exchanges/coinut/coinut_wrapper.go index aaa0b0e3..5882e0d2 100644 --- a/exchanges/coinut/coinut_wrapper.go +++ b/exchanges/coinut/coinut_wrapper.go @@ -19,6 +19,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -648,19 +649,19 @@ func (c *COINUT) GetDepositAddress(cryptocurrency currency.Code, accountID strin // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (c *COINUT) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (c *COINUT) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (c *COINUT) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (c *COINUT) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (c *COINUT) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (c *COINUT) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/exchange_types.go b/exchanges/exchange_types.go index 804f7921..ab39cace 100644 --- a/exchanges/exchange_types.go +++ b/exchanges/exchange_types.go @@ -156,57 +156,6 @@ type FundHistory struct { BankFrom string } -// GenericWithdrawRequestInfo stores genric withdraw request info -type GenericWithdrawRequestInfo struct { - // General withdraw information - Currency currency.Code - Description string - OneTimePassword int64 - AccountID string - PIN int64 - TradePassword string - Amount float64 -} - -// CryptoWithdrawRequest stores the info required for a crypto withdrawal request -type CryptoWithdrawRequest struct { - GenericWithdrawRequestInfo - // Crypto related information - Address string - AddressTag string - FeeAmount float64 -} - -// FiatWithdrawRequest used for fiat withdrawal requests -type FiatWithdrawRequest struct { - GenericWithdrawRequestInfo - // FIAT related information - BankAccountName string - BankAccountNumber string - BankName string - BankAddress string - BankCity string - BankCountry string - BankPostalCode string - BSB string - SwiftCode string - IBAN string - BankCode float64 - IsExpressWire bool - // Intermediary bank information - RequiresIntermediaryBank bool - IntermediaryBankAccountNumber float64 - IntermediaryBankName string - IntermediaryBankAddress string - IntermediaryBankCity string - IntermediaryBankCountry string - IntermediaryBankPostalCode string - IntermediarySwiftCode string - IntermediaryBankCode float64 - IntermediaryIBAN string - WireCurrency string -} - // Features stores the supported and enabled features // for the exchange type Features struct { diff --git a/exchanges/exmo/exmo_test.go b/exchanges/exmo/exmo_test.go index 2a5fa1d9..d8c82b3d 100644 --- a/exchanges/exmo/exmo_test.go +++ b/exchanges/exmo/exmo_test.go @@ -10,6 +10,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/currency" exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/order" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) const ( @@ -382,8 +383,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -405,7 +406,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := e.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -417,7 +418,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := e.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/exmo/exmo_wrapper.go b/exchanges/exmo/exmo_wrapper.go index 374cbf81..050e9a00 100644 --- a/exchanges/exmo/exmo_wrapper.go +++ b/exchanges/exmo/exmo_wrapper.go @@ -19,6 +19,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -418,7 +419,7 @@ func (e *EXMO) GetDepositAddress(cryptocurrency currency.Code, _ string) (string // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (e *EXMO) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (e *EXMO) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { resp, err := e.WithdrawCryptocurrency(withdrawRequest.Currency.String(), withdrawRequest.Address, withdrawRequest.AddressTag, @@ -429,13 +430,13 @@ func (e *EXMO) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithd // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (e *EXMO) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (e *EXMO) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (e *EXMO) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (e *EXMO) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/gateio/gateio_test.go b/exchanges/gateio/gateio_test.go index cfa6cf2f..222731c7 100644 --- a/exchanges/gateio/gateio_test.go +++ b/exchanges/gateio/gateio_test.go @@ -14,6 +14,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply your own APIKEYS here for due diligence testing @@ -405,8 +406,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -432,7 +433,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := g.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -444,7 +445,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := g.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/gateio/gateio_wrapper.go b/exchanges/gateio/gateio_wrapper.go index 5d0d8384..7bd18678 100644 --- a/exchanges/gateio/gateio_wrapper.go +++ b/exchanges/gateio/gateio_wrapper.go @@ -20,6 +20,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -524,19 +525,19 @@ func (g *Gateio) GetDepositAddress(cryptocurrency currency.Code, _ string) (stri // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (g *Gateio) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (g *Gateio) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { return g.WithdrawCrypto(withdrawRequest.Currency.String(), withdrawRequest.Address, withdrawRequest.Amount) } // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (g *Gateio) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (g *Gateio) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (g *Gateio) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (g *Gateio) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/gemini/gemini_test.go b/exchanges/gemini/gemini_test.go index 02704567..5273da8d 100644 --- a/exchanges/gemini/gemini_test.go +++ b/exchanges/gemini/gemini_test.go @@ -12,6 +12,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please enter sandbox API keys & assigned roles for better testing procedures @@ -477,8 +478,8 @@ func TestModifyOrder(t *testing.T) { func TestWithdraw(t *testing.T) { t.Parallel() - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -508,7 +509,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := g.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", @@ -523,7 +524,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := g.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", diff --git a/exchanges/gemini/gemini_wrapper.go b/exchanges/gemini/gemini_wrapper.go index d730b463..3f50ccab 100644 --- a/exchanges/gemini/gemini_wrapper.go +++ b/exchanges/gemini/gemini_wrapper.go @@ -19,6 +19,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -396,7 +397,7 @@ func (g *Gemini) GetDepositAddress(cryptocurrency currency.Code, _ string) (stri // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (g *Gemini) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (g *Gemini) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { resp, err := g.WithdrawCrypto(withdrawRequest.Address, withdrawRequest.Currency.String(), withdrawRequest.Amount) if err != nil { return "", err @@ -410,13 +411,13 @@ func (g *Gemini) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWit // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (g *Gemini) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (g *Gemini) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (g *Gemini) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (g *Gemini) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/hitbtc/hitbtc_test.go b/exchanges/hitbtc/hitbtc_test.go index 208d5fdc..b8f168bb 100644 --- a/exchanges/hitbtc/hitbtc_test.go +++ b/exchanges/hitbtc/hitbtc_test.go @@ -16,6 +16,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) var h HitBTC @@ -339,8 +340,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -366,7 +367,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := h.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -378,7 +379,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := h.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/hitbtc/hitbtc_wrapper.go b/exchanges/hitbtc/hitbtc_wrapper.go index 3acdf45d..dec6b9da 100644 --- a/exchanges/hitbtc/hitbtc_wrapper.go +++ b/exchanges/hitbtc/hitbtc_wrapper.go @@ -19,6 +19,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -469,20 +470,20 @@ func (h *HitBTC) GetDepositAddress(currency currency.Code, _ string) (string, er // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (h *HitBTC) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (h *HitBTC) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { _, err := h.Withdraw(withdrawRequest.Currency.String(), withdrawRequest.Address, withdrawRequest.Amount) return "", err } // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (h *HitBTC) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (h *HitBTC) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (h *HitBTC) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (h *HitBTC) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/huobi/huobi_test.go b/exchanges/huobi/huobi_test.go index 714af623..1d721524 100644 --- a/exchanges/huobi/huobi_test.go +++ b/exchanges/huobi/huobi_test.go @@ -21,6 +21,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply you own test keys here for due diligence testing. @@ -587,8 +588,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -614,7 +615,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := h.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -626,7 +627,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := h.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/huobi/huobi_wrapper.go b/exchanges/huobi/huobi_wrapper.go index b224c629..fa1ad5bc 100644 --- a/exchanges/huobi/huobi_wrapper.go +++ b/exchanges/huobi/huobi_wrapper.go @@ -19,6 +19,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -639,20 +640,20 @@ func (h *HUOBI) GetDepositAddress(cryptocurrency currency.Code, accountID string // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (h *HUOBI) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (h *HUOBI) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { resp, err := h.Withdraw(withdrawRequest.Currency, withdrawRequest.Address, withdrawRequest.AddressTag, withdrawRequest.Amount, withdrawRequest.FeeAmount) return strconv.FormatInt(resp, 10), err } // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (h *HUOBI) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (h *HUOBI) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (h *HUOBI) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (h *HUOBI) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/interfaces.go b/exchanges/interfaces.go index 3f5723e3..627ae507 100644 --- a/exchanges/interfaces.go +++ b/exchanges/interfaces.go @@ -10,6 +10,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/orderbook" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // IBotExchange enforces standard functions for all exchanges supported in @@ -50,9 +51,9 @@ type IBotExchange interface { GetDepositAddress(cryptocurrency currency.Code, accountID string) (string, error) GetOrderHistory(getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error) GetActiveOrders(getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error) - WithdrawCryptocurrencyFunds(withdrawRequest *CryptoWithdrawRequest) (string, error) - WithdrawFiatFunds(withdrawRequest *FiatWithdrawRequest) (string, error) - WithdrawFiatFundsToInternationalBank(withdrawRequest *FiatWithdrawRequest) (string, error) + WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) + WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) + WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) SetHTTPClientUserAgent(ua string) GetHTTPClientUserAgent() string SetClientProxyAddress(addr string) error diff --git a/exchanges/itbit/itbit_test.go b/exchanges/itbit/itbit_test.go index 85cfd4d6..b42859e5 100644 --- a/exchanges/itbit/itbit_test.go +++ b/exchanges/itbit/itbit_test.go @@ -11,6 +11,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/currency" exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/order" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) var i ItBit @@ -389,8 +390,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -413,7 +414,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := i.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -425,7 +426,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := i.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/itbit/itbit_wrapper.go b/exchanges/itbit/itbit_wrapper.go index 918b877d..05932dfe 100644 --- a/exchanges/itbit/itbit_wrapper.go +++ b/exchanges/itbit/itbit_wrapper.go @@ -19,6 +19,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -392,19 +393,19 @@ func (i *ItBit) GetDepositAddress(cryptocurrency currency.Code, accountID string // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (i *ItBit) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (i *ItBit) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (i *ItBit) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (i *ItBit) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (i *ItBit) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (i *ItBit) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/kraken/kraken_test.go b/exchanges/kraken/kraken_test.go index 227bde0b..7b446e73 100644 --- a/exchanges/kraken/kraken_test.go +++ b/exchanges/kraken/kraken_test.go @@ -14,6 +14,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) var k Kraken @@ -529,8 +530,8 @@ func TestModifyOrder(t *testing.T) { // TestWithdraw wrapper test func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.XXBT, Description: "WITHDRAW IT ALL", @@ -558,8 +559,8 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.EUR, Description: "WITHDRAW IT ALL", @@ -582,8 +583,8 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.EUR, Description: "WITHDRAW IT ALL", diff --git a/exchanges/kraken/kraken_wrapper.go b/exchanges/kraken/kraken_wrapper.go index 71c23b31..7356db2b 100644 --- a/exchanges/kraken/kraken_wrapper.go +++ b/exchanges/kraken/kraken_wrapper.go @@ -20,6 +20,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -569,19 +570,19 @@ func (k *Kraken) GetDepositAddress(cryptocurrency currency.Code, _ string) (stri // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal // Populate exchange.WithdrawRequest.TradePassword with withdrawal key name, as set up on your account -func (k *Kraken) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (k *Kraken) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { return k.Withdraw(withdrawRequest.Currency.String(), withdrawRequest.TradePassword, withdrawRequest.Amount) } // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (k *Kraken) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (k *Kraken) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return k.Withdraw(withdrawRequest.Currency.String(), withdrawRequest.TradePassword, withdrawRequest.Amount) } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (k *Kraken) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (k *Kraken) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return k.Withdraw(withdrawRequest.Currency.String(), withdrawRequest.TradePassword, withdrawRequest.Amount) } diff --git a/exchanges/lakebtc/lakebtc_test.go b/exchanges/lakebtc/lakebtc_test.go index afb75558..43bb7987 100644 --- a/exchanges/lakebtc/lakebtc_test.go +++ b/exchanges/lakebtc/lakebtc_test.go @@ -13,6 +13,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) var l LakeBTC @@ -375,8 +376,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -402,7 +403,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := l.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -414,7 +415,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := l.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/lakebtc/lakebtc_wrapper.go b/exchanges/lakebtc/lakebtc_wrapper.go index 0e15e043..b16ef592 100644 --- a/exchanges/lakebtc/lakebtc_wrapper.go +++ b/exchanges/lakebtc/lakebtc_wrapper.go @@ -19,6 +19,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -404,7 +405,7 @@ func (l *LakeBTC) GetDepositAddress(cryptocurrency currency.Code, _ string) (str // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (l *LakeBTC) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (l *LakeBTC) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { if withdrawRequest.Currency != currency.BTC { return "", errors.New("only BTC supported for withdrawals") } @@ -419,13 +420,13 @@ func (l *LakeBTC) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWi // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (l *LakeBTC) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (l *LakeBTC) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (l *LakeBTC) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (l *LakeBTC) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/lbank/lbank_wrapper.go b/exchanges/lbank/lbank_wrapper.go index d5eab666..1b4d4525 100644 --- a/exchanges/lbank/lbank_wrapper.go +++ b/exchanges/lbank/lbank_wrapper.go @@ -18,6 +18,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -453,7 +454,7 @@ func (l *Lbank) GetDepositAddress(cryptocurrency currency.Code, accountID string // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (l *Lbank) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (l *Lbank) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { resp, err := l.Withdraw(withdrawRequest.Address, withdrawRequest.Currency.String(), strconv.FormatFloat(withdrawRequest.Amount, 'f', -1, 64), "", withdrawRequest.Description, "") @@ -462,13 +463,13 @@ func (l *Lbank) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWith // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func (l *Lbank) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (l *Lbank) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func (l *Lbank) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (l *Lbank) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/localbitcoins/localbitcoins_test.go b/exchanges/localbitcoins/localbitcoins_test.go index d1c6bc0e..d525e8c4 100644 --- a/exchanges/localbitcoins/localbitcoins_test.go +++ b/exchanges/localbitcoins/localbitcoins_test.go @@ -7,6 +7,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/currency" exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/order" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply your own APIKEYS here for due diligence testing @@ -332,8 +333,8 @@ func TestModifyOrder(t *testing.T) { func TestWithdraw(t *testing.T) { t.Parallel() - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -359,7 +360,7 @@ func TestWithdraw(t *testing.T) { func TestWithdrawFiat(t *testing.T) { t.Parallel() - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := l.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", @@ -371,7 +372,7 @@ func TestWithdrawFiat(t *testing.T) { func TestWithdrawInternationalBank(t *testing.T) { t.Parallel() - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := l.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", diff --git a/exchanges/localbitcoins/localbitcoins_wrapper.go b/exchanges/localbitcoins/localbitcoins_wrapper.go index 1e1bf0a2..a6c8073a 100644 --- a/exchanges/localbitcoins/localbitcoins_wrapper.go +++ b/exchanges/localbitcoins/localbitcoins_wrapper.go @@ -20,6 +20,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -393,7 +394,7 @@ func (l *LocalBitcoins) GetDepositAddress(cryptocurrency currency.Code, _ string // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (l *LocalBitcoins) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (l *LocalBitcoins) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { return "", l.WalletSend(withdrawRequest.Address, withdrawRequest.Amount, @@ -402,13 +403,13 @@ func (l *LocalBitcoins) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.Cr // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (l *LocalBitcoins) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (l *LocalBitcoins) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (l *LocalBitcoins) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (l *LocalBitcoins) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/okcoin/okcoin_test.go b/exchanges/okcoin/okcoin_test.go index 2d212f0e..8555c9bc 100644 --- a/exchanges/okcoin/okcoin_test.go +++ b/exchanges/okcoin/okcoin_test.go @@ -20,6 +20,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply you own test keys here for due diligence testing. @@ -1058,8 +1059,8 @@ func TestModifyOrder(t *testing.T) { func TestWithdraw(t *testing.T) { TestSetRealOrderDefaults(t) - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -1076,7 +1077,7 @@ func TestWithdraw(t *testing.T) { // TestWithdrawFiat Wrapper test func TestWithdrawFiat(t *testing.T) { TestSetRealOrderDefaults(t) - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := o.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -1086,7 +1087,7 @@ func TestWithdrawFiat(t *testing.T) { // TestSubmitOrder Wrapper test func TestWithdrawInternationalBank(t *testing.T) { TestSetRealOrderDefaults(t) - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := o.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/okex/okex_test.go b/exchanges/okex/okex_test.go index 70ae6246..d59bd3e1 100644 --- a/exchanges/okex/okex_test.go +++ b/exchanges/okex/okex_test.go @@ -22,6 +22,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply you own test keys here for due diligence testing. @@ -1751,8 +1752,8 @@ func TestModifyOrder(t *testing.T) { func TestWithdraw(t *testing.T) { TestSetRealOrderDefaults(t) t.Parallel() - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -1769,7 +1770,7 @@ func TestWithdraw(t *testing.T) { func TestWithdrawFiat(t *testing.T) { TestSetRealOrderDefaults(t) t.Parallel() - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := o.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", @@ -1782,7 +1783,7 @@ func TestWithdrawFiat(t *testing.T) { func TestWithdrawInternationalBank(t *testing.T) { TestSetRealOrderDefaults(t) t.Parallel() - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := o.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", diff --git a/exchanges/okgroup/okgroup_wrapper.go b/exchanges/okgroup/okgroup_wrapper.go index c3dcca42..ef0804cf 100644 --- a/exchanges/okgroup/okgroup_wrapper.go +++ b/exchanges/okgroup/okgroup_wrapper.go @@ -14,6 +14,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/orderbook" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -366,7 +367,7 @@ func (o *OKGroup) GetDepositAddress(p currency.Code, accountID string) (string, // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (o *OKGroup) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (o *OKGroup) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { withdrawal, err := o.AccountWithdraw(AccountWithdrawRequest{ Amount: withdrawRequest.Amount, Currency: withdrawRequest.Currency.Lower().String(), @@ -390,13 +391,13 @@ func (o *OKGroup) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWi // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (o *OKGroup) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (o *OKGroup) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (o *OKGroup) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (o *OKGroup) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/poloniex/poloniex_test.go b/exchanges/poloniex/poloniex_test.go index cc939aca..480c96b8 100644 --- a/exchanges/poloniex/poloniex_test.go +++ b/exchanges/poloniex/poloniex_test.go @@ -13,6 +13,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply your own APIKEYS here for due diligence testing @@ -347,8 +348,8 @@ func TestModifyOrder(t *testing.T) { func TestWithdraw(t *testing.T) { t.Parallel() - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: 0, Currency: currency.LTC, Description: "WITHDRAW IT ALL", @@ -377,7 +378,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest exchange.FiatWithdrawRequest + var withdrawFiatRequest withdraw.FiatWithdrawRequest _, err := p.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", @@ -391,7 +392,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest exchange.FiatWithdrawRequest + var withdrawFiatRequest withdraw.FiatWithdrawRequest _, err := p.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", diff --git a/exchanges/poloniex/poloniex_wrapper.go b/exchanges/poloniex/poloniex_wrapper.go index 496e1e63..2c178495 100644 --- a/exchanges/poloniex/poloniex_wrapper.go +++ b/exchanges/poloniex/poloniex_wrapper.go @@ -18,6 +18,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -462,20 +463,20 @@ func (p *Poloniex) GetDepositAddress(cryptocurrency currency.Code, _ string) (st // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (p *Poloniex) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (p *Poloniex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { _, err := p.Withdraw(withdrawRequest.Currency.String(), withdrawRequest.Address, withdrawRequest.Amount) return "", err } // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (p *Poloniex) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (p *Poloniex) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (p *Poloniex) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (p *Poloniex) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/withdraw/withdraw.go b/exchanges/withdraw/withdraw.go new file mode 100644 index 00000000..96d5bcff --- /dev/null +++ b/exchanges/withdraw/withdraw.go @@ -0,0 +1 @@ +package withdraw diff --git a/exchanges/withdraw/withdraw_types.go b/exchanges/withdraw/withdraw_types.go new file mode 100644 index 00000000..dd089d03 --- /dev/null +++ b/exchanges/withdraw/withdraw_types.go @@ -0,0 +1,54 @@ +package withdraw + +import "github.com/thrasher-corp/gocryptotrader/currency" + +// GenericWithdrawRequestInfo stores genric withdraw request info +type GenericWithdrawRequestInfo struct { + // General withdraw information + Currency currency.Code + Description string + OneTimePassword int64 + AccountID string + PIN int64 + TradePassword string + Amount float64 +} + +// CryptoWithdrawRequest stores the info required for a crypto withdrawal request +type CryptoWithdrawRequest struct { + GenericWithdrawRequestInfo + // Crypto related information + Address string + AddressTag string + FeeAmount float64 +} + +// FiatWithdrawRequest used for fiat withdrawal requests +type FiatWithdrawRequest struct { + GenericWithdrawRequestInfo + // FIAT related information + BankAccountName string + BankAccountNumber string + BankName string + BankAddress string + BankCity string + BankCountry string + BankPostalCode string + BSB string + SwiftCode string + IBAN string + BankCode float64 + IsExpressWire bool + // Intermediary bank information + RequiresIntermediaryBank bool + IntermediaryBankAccountNumber float64 + IntermediaryBankName string + IntermediaryBankAddress string + IntermediaryBankCity string + IntermediaryBankCountry string + IntermediaryBankPostalCode string + IntermediarySwiftCode string + IntermediaryBankCode float64 + IntermediaryIBAN string + WireCurrency string +} diff --git a/exchanges/yobit/yobit_test.go b/exchanges/yobit/yobit_test.go index 4a2dafab..5eb1ebcb 100644 --- a/exchanges/yobit/yobit_test.go +++ b/exchanges/yobit/yobit_test.go @@ -13,6 +13,7 @@ import ( exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/asset" "github.com/thrasher-corp/gocryptotrader/exchanges/order" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) var y Yobit @@ -445,8 +446,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -472,7 +473,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := y.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", @@ -486,7 +487,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := y.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", diff --git a/exchanges/yobit/yobit_wrapper.go b/exchanges/yobit/yobit_wrapper.go index 363f8208..eeb3d8b3 100644 --- a/exchanges/yobit/yobit_wrapper.go +++ b/exchanges/yobit/yobit_wrapper.go @@ -19,6 +19,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -406,7 +407,7 @@ func (y *Yobit) GetDepositAddress(cryptocurrency currency.Code, _ string) (strin // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (y *Yobit) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (y *Yobit) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { resp, err := y.WithdrawCoinsToAddress(withdrawRequest.Currency.String(), withdrawRequest.Amount, withdrawRequest.Address) if err != nil { return "", err @@ -419,13 +420,13 @@ func (y *Yobit) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWith // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (y *Yobit) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (y *Yobit) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (y *Yobit) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (y *Yobit) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/zb/zb_test.go b/exchanges/zb/zb_test.go index 3182e16e..72c54e59 100644 --- a/exchanges/zb/zb_test.go +++ b/exchanges/zb/zb_test.go @@ -16,6 +16,7 @@ import ( exchange "github.com/thrasher-corp/gocryptotrader/exchanges" "github.com/thrasher-corp/gocryptotrader/exchanges/order" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" ) // Please supply you own test keys here for due diligence testing. @@ -413,8 +414,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := exchange.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: exchange.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ + GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -441,7 +442,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := z.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -453,7 +454,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = exchange.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} _, err := z.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/zb/zb_wrapper.go b/exchanges/zb/zb_wrapper.go index eac00ae5..8664d284 100644 --- a/exchanges/zb/zb_wrapper.go +++ b/exchanges/zb/zb_wrapper.go @@ -19,6 +19,7 @@ import ( "github.com/thrasher-corp/gocryptotrader/exchanges/request" "github.com/thrasher-corp/gocryptotrader/exchanges/ticker" "github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler" + "github.com/thrasher-corp/gocryptotrader/exchanges/withdraw" log "github.com/thrasher-corp/gocryptotrader/logger" ) @@ -498,19 +499,19 @@ func (z *ZB) GetDepositAddress(cryptocurrency currency.Code, _ string) (string, // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (z *ZB) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.CryptoWithdrawRequest) (string, error) { +func (z *ZB) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { return z.Withdraw(withdrawRequest.Currency.Lower().String(), withdrawRequest.Address, withdrawRequest.TradePassword, withdrawRequest.Amount, withdrawRequest.FeeAmount, false) } // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (z *ZB) WithdrawFiatFunds(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (z *ZB) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (z *ZB) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.FiatWithdrawRequest) (string, error) { +func (z *ZB) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/gctrpc/rpc.pb.go b/gctrpc/rpc.pb.go index a5796e2b..8098fdf0 100644 --- a/gctrpc/rpc.pb.go +++ b/gctrpc/rpc.pb.go @@ -6,12 +6,13 @@ package gctrpc import ( context "context" fmt "fmt" + math "math" + proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - math "math" ) // Reference imports to suppress errors if they are not otherwise used. From db25bb137434b249a01648b8b70e9b1d4ee3cfc0 Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Thu, 12 Dec 2019 14:17:02 +1100 Subject: [PATCH 2/6] removed empty file --- exchanges/withdraw/withdraw.go | 1 - 1 file changed, 1 deletion(-) delete mode 100644 exchanges/withdraw/withdraw.go diff --git a/exchanges/withdraw/withdraw.go b/exchanges/withdraw/withdraw.go deleted file mode 100644 index 96d5bcff..00000000 --- a/exchanges/withdraw/withdraw.go +++ /dev/null @@ -1 +0,0 @@ -package withdraw From 732e9735baedd3430b438b854e3ccad640e851d7 Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Thu, 12 Dec 2019 14:22:47 +1100 Subject: [PATCH 3/6] reverted rpc.pb.go change --- gctrpc/rpc.pb.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gctrpc/rpc.pb.go b/gctrpc/rpc.pb.go index 8098fdf0..a5796e2b 100644 --- a/gctrpc/rpc.pb.go +++ b/gctrpc/rpc.pb.go @@ -6,13 +6,12 @@ package gctrpc import ( context "context" fmt "fmt" - math "math" - proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. From b8e8c25f78f86ee98fd64855862987340d885310 Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Fri, 13 Dec 2019 08:26:55 +1100 Subject: [PATCH 4/6] Renamed structs to remove package name --- cmd/exchange_wrapper_coverage/main.go | 2 +- cmd/exchange_wrapper_issues/main.go | 30 +++++++++---------- engine/helpers.go | 2 +- exchanges/alphapoint/alphapoint_test.go | 2 +- exchanges/alphapoint/alphapoint_wrapper.go | 2 +- exchanges/anx/anx_test.go | 4 +-- exchanges/anx/anx_wrapper.go | 2 +- exchanges/binance/binance_test.go | 4 +-- exchanges/binance/binance_wrapper.go | 2 +- exchanges/bitfinex/bitfinex_test.go | 8 ++--- exchanges/bitfinex/bitfinex_wrapper.go | 2 +- exchanges/bitflyer/bitflyer_test.go | 4 +-- exchanges/bitflyer/bitflyer_wrapper.go | 2 +- exchanges/bithumb/bithumb_test.go | 6 ++-- exchanges/bithumb/bithumb_wrapper.go | 2 +- exchanges/bitmex/bitmex_test.go | 4 +-- exchanges/bitmex/bitmex_wrapper.go | 2 +- exchanges/bitstamp/bitstamp_test.go | 8 ++--- exchanges/bitstamp/bitstamp_wrapper.go | 2 +- exchanges/bittrex/bittrex_test.go | 4 +-- exchanges/bittrex/bittrex_wrapper.go | 2 +- exchanges/btcmarkets/btcmarkets_wrapper.go | 6 ++-- exchanges/btse/btse_wrapper.go | 2 +- exchanges/coinbasepro/coinbasepro_test.go | 8 ++--- exchanges/coinbasepro/coinbasepro_wrapper.go | 2 +- exchanges/coinbene/coinbene_wrapper.go | 2 +- exchanges/coinut/coinut_test.go | 4 +-- exchanges/coinut/coinut_wrapper.go | 2 +- exchanges/exmo/exmo_test.go | 4 +-- exchanges/exmo/exmo_wrapper.go | 2 +- exchanges/gateio/gateio_test.go | 4 +-- exchanges/gateio/gateio_wrapper.go | 2 +- exchanges/gemini/gemini_test.go | 4 +-- exchanges/gemini/gemini_wrapper.go | 2 +- exchanges/hitbtc/hitbtc_test.go | 4 +-- exchanges/hitbtc/hitbtc_wrapper.go | 2 +- exchanges/huobi/huobi_test.go | 4 +-- exchanges/huobi/huobi_wrapper.go | 2 +- exchanges/interfaces.go | 2 +- exchanges/itbit/itbit_test.go | 4 +-- exchanges/itbit/itbit_wrapper.go | 2 +- exchanges/kraken/kraken_test.go | 8 ++--- exchanges/kraken/kraken_wrapper.go | 2 +- exchanges/lakebtc/lakebtc_test.go | 4 +-- exchanges/lakebtc/lakebtc_wrapper.go | 2 +- exchanges/lbank/lbank_wrapper.go | 2 +- exchanges/localbitcoins/localbitcoins_test.go | 4 +-- .../localbitcoins/localbitcoins_wrapper.go | 2 +- exchanges/okcoin/okcoin_test.go | 4 +-- exchanges/okex/okex_test.go | 4 +-- exchanges/okgroup/okgroup_wrapper.go | 2 +- exchanges/poloniex/poloniex_test.go | 4 +-- exchanges/poloniex/poloniex_wrapper.go | 2 +- exchanges/withdraw/withdraw_types.go | 12 ++++---- exchanges/yobit/yobit_test.go | 4 +-- exchanges/yobit/yobit_wrapper.go | 2 +- exchanges/zb/zb_test.go | 4 +-- exchanges/zb/zb_wrapper.go | 2 +- 58 files changed, 112 insertions(+), 112 deletions(-) diff --git a/cmd/exchange_wrapper_coverage/main.go b/cmd/exchange_wrapper_coverage/main.go index e352c028..b0a583a9 100644 --- a/cmd/exchange_wrapper_coverage/main.go +++ b/cmd/exchange_wrapper_coverage/main.go @@ -174,7 +174,7 @@ func testWrappers(e exchange.IBotExchange) []string { funcs = append(funcs, "GetDepositAddress") } - _, err = e.WithdrawCryptocurrencyFunds(&withdraw.CryptoWithdrawRequest{}) + _, err = e.WithdrawCryptocurrencyFunds(&withdraw.CryptoRequest{}) if err == common.ErrNotYetImplemented { funcs = append(funcs, "WithdrawCryptocurrencyFunds") } diff --git a/cmd/exchange_wrapper_issues/main.go b/cmd/exchange_wrapper_issues/main.go index 704fc220..8089713d 100644 --- a/cmd/exchange_wrapper_issues/main.go +++ b/cmd/exchange_wrapper_issues/main.go @@ -620,13 +620,13 @@ func testWrappers(e exchange.IBotExchange, base *exchange.Base, config *Config) Response: jsonifyInterface([]interface{}{r19}), }) - genericWithdrawRequest := withdraw.GenericWithdrawRequestInfo{ + genericWithdrawRequest := withdraw.GenericInfo{ Amount: config.OrderSubmission.Amount, Currency: p.Quote, } - withdrawRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: genericWithdrawRequest, - Address: withdrawAddressOverride, + withdrawRequest := withdraw.CryptoRequest{ + GenericInfo: genericWithdrawRequest, + Address: withdrawAddressOverride, } var r20 string r20, err = e.WithdrawCryptocurrencyFunds(&withdrawRequest) @@ -665,17 +665,17 @@ func testWrappers(e exchange.IBotExchange, base *exchange.Base, config *Config) }) fiatWithdrawRequest := withdraw.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: genericWithdrawRequest, - BankAccountName: config.BankDetails.BankAccountName, - BankAccountNumber: config.BankDetails.BankAccountNumber, - SwiftCode: config.BankDetails.SwiftCode, - IBAN: config.BankDetails.Iban, - BankCity: config.BankDetails.BankCity, - BankName: config.BankDetails.BankName, - BankAddress: config.BankDetails.BankAddress, - BankCountry: config.BankDetails.BankCountry, - BankPostalCode: config.BankDetails.BankPostalCode, - BankCode: config.BankDetails.BankCode, + GenericInfo: genericWithdrawRequest, + BankAccountName: config.BankDetails.BankAccountName, + BankAccountNumber: config.BankDetails.BankAccountNumber, + SwiftCode: config.BankDetails.SwiftCode, + IBAN: config.BankDetails.Iban, + BankCity: config.BankDetails.BankCity, + BankName: config.BankDetails.BankName, + BankAddress: config.BankDetails.BankAddress, + BankCountry: config.BankDetails.BankCountry, + BankPostalCode: config.BankDetails.BankPostalCode, + BankCode: config.BankDetails.BankCode, IsExpressWire: config.BankDetails.IsExpressWire, RequiresIntermediaryBank: config.BankDetails.RequiresIntermediaryBank, IntermediaryBankName: config.BankDetails.IntermediaryBankName, diff --git a/engine/helpers.go b/engine/helpers.go index 570989bb..1a8ebf9f 100644 --- a/engine/helpers.go +++ b/engine/helpers.go @@ -700,7 +700,7 @@ func GetExchangeCryptocurrencyDepositAddresses() map[string]map[string]string { } // WithdrawCryptocurrencyFundsByExchange withdraws the desired cryptocurrency and amount to a desired cryptocurrency address -func WithdrawCryptocurrencyFundsByExchange(exchName string, req *withdraw.CryptoWithdrawRequest) (string, error) { +func WithdrawCryptocurrencyFundsByExchange(exchName string, req *withdraw.CryptoRequest) (string, error) { if req == nil { return "", errors.New("crypto withdraw request param is nil") } diff --git a/exchanges/alphapoint/alphapoint_test.go b/exchanges/alphapoint/alphapoint_test.go index 6ed0c2c8..62606568 100644 --- a/exchanges/alphapoint/alphapoint_test.go +++ b/exchanges/alphapoint/alphapoint_test.go @@ -561,7 +561,7 @@ func TestModifyOrder(t *testing.T) { func TestWithdraw(t *testing.T) { t.Parallel() - var withdrawCryptoRequest = withdraw.CryptoWithdrawRequest{} + var withdrawCryptoRequest = withdraw.CryptoRequest{} _, err := a.WithdrawCryptocurrencyFunds(&withdrawCryptoRequest) if err != common.ErrNotYetImplemented { t.Errorf("Expected 'Not implemented', received %v", err) diff --git a/exchanges/alphapoint/alphapoint_wrapper.go b/exchanges/alphapoint/alphapoint_wrapper.go index f7fd940e..0249e8c4 100644 --- a/exchanges/alphapoint/alphapoint_wrapper.go +++ b/exchanges/alphapoint/alphapoint_wrapper.go @@ -283,7 +283,7 @@ func (a *Alphapoint) GetDepositAddress(cryptocurrency currency.Code, _ string) ( // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (a *Alphapoint) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (a *Alphapoint) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { return "", common.ErrNotYetImplemented } diff --git a/exchanges/anx/anx_test.go b/exchanges/anx/anx_test.go index 4242a104..5f25f9ad 100644 --- a/exchanges/anx/anx_test.go +++ b/exchanges/anx/anx_test.go @@ -327,8 +327,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/anx/anx_wrapper.go b/exchanges/anx/anx_wrapper.go index a7092432..3652b71d 100644 --- a/exchanges/anx/anx_wrapper.go +++ b/exchanges/anx/anx_wrapper.go @@ -418,7 +418,7 @@ func (a *ANX) GetDepositAddress(cryptocurrency currency.Code, _ string) (string, // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (a *ANX) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (a *ANX) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { return a.Send(withdrawRequest.Currency.String(), withdrawRequest.Address, "", strconv.FormatFloat(withdrawRequest.Amount, 'f', -1, 64)) } diff --git a/exchanges/binance/binance_test.go b/exchanges/binance/binance_test.go index 4019a849..7e845962 100644 --- a/exchanges/binance/binance_test.go +++ b/exchanges/binance/binance_test.go @@ -454,8 +454,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: 0, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/binance/binance_wrapper.go b/exchanges/binance/binance_wrapper.go index 288649d5..1a1e3c12 100644 --- a/exchanges/binance/binance_wrapper.go +++ b/exchanges/binance/binance_wrapper.go @@ -495,7 +495,7 @@ func (b *Binance) GetDepositAddress(cryptocurrency currency.Code, _ string) (str // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Binance) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (b *Binance) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { amountStr := strconv.FormatFloat(withdrawRequest.Amount, 'f', -1, 64) return b.WithdrawCrypto(withdrawRequest.Currency.String(), withdrawRequest.Address, diff --git a/exchanges/bitfinex/bitfinex_test.go b/exchanges/bitfinex/bitfinex_test.go index 35996134..09435b91 100644 --- a/exchanges/bitfinex/bitfinex_test.go +++ b/exchanges/bitfinex/bitfinex_test.go @@ -885,8 +885,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -910,7 +910,7 @@ func TestWithdrawFiat(t *testing.T) { } var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.USD, Description: "WITHDRAW IT ALL", @@ -943,7 +943,7 @@ func TestWithdrawInternationalBank(t *testing.T) { } var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/bitfinex/bitfinex_wrapper.go b/exchanges/bitfinex/bitfinex_wrapper.go index a2431e22..27154604 100644 --- a/exchanges/bitfinex/bitfinex_wrapper.go +++ b/exchanges/bitfinex/bitfinex_wrapper.go @@ -486,7 +486,7 @@ func (b *Bitfinex) GetDepositAddress(cryptocurrency currency.Code, accountID str } // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted -func (b *Bitfinex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (b *Bitfinex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { withdrawalType := b.ConvertSymbolToWithdrawalType(withdrawRequest.Currency) // Bitfinex has support for three types, exchange, margin and deposit // As this is for trading, I've made the wrapper default 'exchange' diff --git a/exchanges/bitflyer/bitflyer_test.go b/exchanges/bitflyer/bitflyer_test.go index 41c5cf20..523b53bc 100644 --- a/exchanges/bitflyer/bitflyer_test.go +++ b/exchanges/bitflyer/bitflyer_test.go @@ -367,8 +367,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/bitflyer/bitflyer_wrapper.go b/exchanges/bitflyer/bitflyer_wrapper.go index 3f3304e8..29310336 100644 --- a/exchanges/bitflyer/bitflyer_wrapper.go +++ b/exchanges/bitflyer/bitflyer_wrapper.go @@ -310,7 +310,7 @@ func (b *Bitflyer) GetDepositAddress(cryptocurrency currency.Code, accountID str // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Bitflyer) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (b *Bitflyer) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { return "", common.ErrNotYetImplemented } diff --git a/exchanges/bithumb/bithumb_test.go b/exchanges/bithumb/bithumb_test.go index 0dea6ecc..de357544 100644 --- a/exchanges/bithumb/bithumb_test.go +++ b/exchanges/bithumb/bithumb_test.go @@ -449,8 +449,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -474,7 +474,7 @@ func TestWithdrawFiat(t *testing.T) { } var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.USD, Description: "WITHDRAW IT ALL", diff --git a/exchanges/bithumb/bithumb_wrapper.go b/exchanges/bithumb/bithumb_wrapper.go index 03f16bbd..694ca7f8 100644 --- a/exchanges/bithumb/bithumb_wrapper.go +++ b/exchanges/bithumb/bithumb_wrapper.go @@ -408,7 +408,7 @@ func (b *Bithumb) GetDepositAddress(cryptocurrency currency.Code, _ string) (str // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Bithumb) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (b *Bithumb) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { _, err := b.WithdrawCrypto(withdrawRequest.Address, withdrawRequest.AddressTag, withdrawRequest.Currency.String(), diff --git a/exchanges/bitmex/bitmex_test.go b/exchanges/bitmex/bitmex_test.go index 8a693f1d..c3b44e7d 100644 --- a/exchanges/bitmex/bitmex_test.go +++ b/exchanges/bitmex/bitmex_test.go @@ -607,8 +607,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/bitmex/bitmex_wrapper.go b/exchanges/bitmex/bitmex_wrapper.go index a5908ea9..994a3b96 100644 --- a/exchanges/bitmex/bitmex_wrapper.go +++ b/exchanges/bitmex/bitmex_wrapper.go @@ -510,7 +510,7 @@ func (b *Bitmex) GetDepositAddress(cryptocurrency currency.Code, _ string) (stri // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Bitmex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (b *Bitmex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { var request = UserRequestWithdrawalParams{ Address: withdrawRequest.Address, Amount: withdrawRequest.Amount, diff --git a/exchanges/bitstamp/bitstamp_test.go b/exchanges/bitstamp/bitstamp_test.go index b385a891..e5dc0c2b 100644 --- a/exchanges/bitstamp/bitstamp_test.go +++ b/exchanges/bitstamp/bitstamp_test.go @@ -455,8 +455,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -483,7 +483,7 @@ func TestWithdrawFiat(t *testing.T) { } var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.USD, Description: "WITHDRAW IT ALL", @@ -521,7 +521,7 @@ func TestWithdrawInternationalBank(t *testing.T) { } var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.USD, Description: "WITHDRAW IT ALL", diff --git a/exchanges/bitstamp/bitstamp_wrapper.go b/exchanges/bitstamp/bitstamp_wrapper.go index d228e472..7bf38ada 100644 --- a/exchanges/bitstamp/bitstamp_wrapper.go +++ b/exchanges/bitstamp/bitstamp_wrapper.go @@ -421,7 +421,7 @@ func (b *Bitstamp) GetDepositAddress(cryptocurrency currency.Code, _ string) (st // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Bitstamp) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (b *Bitstamp) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { resp, err := b.CryptoWithdrawal(withdrawRequest.Amount, withdrawRequest.Address, withdrawRequest.Currency.String(), diff --git a/exchanges/bittrex/bittrex_test.go b/exchanges/bittrex/bittrex_test.go index e83c5bf0..17726811 100644 --- a/exchanges/bittrex/bittrex_test.go +++ b/exchanges/bittrex/bittrex_test.go @@ -443,8 +443,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/bittrex/bittrex_wrapper.go b/exchanges/bittrex/bittrex_wrapper.go index 162f6048..073c3036 100644 --- a/exchanges/bittrex/bittrex_wrapper.go +++ b/exchanges/bittrex/bittrex_wrapper.go @@ -409,7 +409,7 @@ func (b *Bittrex) GetDepositAddress(cryptocurrency currency.Code, _ string) (str // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Bittrex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (b *Bittrex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { uuid, err := b.Withdraw(withdrawRequest.Currency.String(), withdrawRequest.AddressTag, withdrawRequest.Address, withdrawRequest.Amount) return uuid.Result.ID, err } diff --git a/exchanges/btcmarkets/btcmarkets_wrapper.go b/exchanges/btcmarkets/btcmarkets_wrapper.go index a4804030..58a1c124 100644 --- a/exchanges/btcmarkets/btcmarkets_wrapper.go +++ b/exchanges/btcmarkets/btcmarkets_wrapper.go @@ -478,7 +478,7 @@ func (b *BTCMarkets) GetDepositAddress(cryptocurrency currency.Code, accountID s } // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted -func (b *BTCMarkets) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (b *BTCMarkets) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { a, err := b.RequestWithdraw(withdrawRequest.Currency.String(), withdrawRequest.Amount, withdrawRequest.Address, @@ -498,8 +498,8 @@ func (b *BTCMarkets) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawReq if withdrawRequest.Currency != currency.AUD { return "", errors.New("only aud is supported for withdrawals") } - a, err := b.RequestWithdraw(withdrawRequest.GenericWithdrawRequestInfo.Currency.String(), - withdrawRequest.GenericWithdrawRequestInfo.Amount, + a, err := b.RequestWithdraw(withdrawRequest.GenericInfo.Currency.String(), + withdrawRequest.GenericInfo.Amount, "", withdrawRequest.BankAccountName, withdrawRequest.BankAccountNumber, diff --git a/exchanges/btse/btse_wrapper.go b/exchanges/btse/btse_wrapper.go index 57060b1b..3e1d6c40 100644 --- a/exchanges/btse/btse_wrapper.go +++ b/exchanges/btse/btse_wrapper.go @@ -498,7 +498,7 @@ func (b *BTSE) GetDepositAddress(cryptocurrency currency.Code, accountID string) // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *BTSE) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (b *BTSE) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/coinbasepro/coinbasepro_test.go b/exchanges/coinbasepro/coinbasepro_test.go index 05484ed4..489a71b1 100644 --- a/exchanges/coinbasepro/coinbasepro_test.go +++ b/exchanges/coinbasepro/coinbasepro_test.go @@ -499,8 +499,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", @@ -527,7 +527,7 @@ func TestWithdrawFiat(t *testing.T) { } var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + GenericInfo: withdraw.GenericInfo{ Amount: 100, Currency: currency.USD, }, @@ -549,7 +549,7 @@ func TestWithdrawInternationalBank(t *testing.T) { } var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + GenericInfo: withdraw.GenericInfo{ Amount: 100, Currency: currency.USD, }, diff --git a/exchanges/coinbasepro/coinbasepro_wrapper.go b/exchanges/coinbasepro/coinbasepro_wrapper.go index 376718d7..3a36091d 100644 --- a/exchanges/coinbasepro/coinbasepro_wrapper.go +++ b/exchanges/coinbasepro/coinbasepro_wrapper.go @@ -448,7 +448,7 @@ func (c *CoinbasePro) GetDepositAddress(cryptocurrency currency.Code, accountID // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (c *CoinbasePro) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (c *CoinbasePro) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { resp, err := c.WithdrawCrypto(withdrawRequest.Amount, withdrawRequest.Currency.String(), withdrawRequest.Address) return resp.ID, err } diff --git a/exchanges/coinbene/coinbene_wrapper.go b/exchanges/coinbene/coinbene_wrapper.go index 65a5743d..738b1cc5 100644 --- a/exchanges/coinbene/coinbene_wrapper.go +++ b/exchanges/coinbene/coinbene_wrapper.go @@ -457,7 +457,7 @@ func (c *Coinbene) GetDepositAddress(cryptocurrency currency.Code, accountID str // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (c *Coinbene) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (c *Coinbene) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/coinut/coinut_test.go b/exchanges/coinut/coinut_test.go index bf1bf3a1..1807f0bb 100644 --- a/exchanges/coinut/coinut_test.go +++ b/exchanges/coinut/coinut_test.go @@ -383,8 +383,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/coinut/coinut_wrapper.go b/exchanges/coinut/coinut_wrapper.go index 5882e0d2..1733cb1c 100644 --- a/exchanges/coinut/coinut_wrapper.go +++ b/exchanges/coinut/coinut_wrapper.go @@ -649,7 +649,7 @@ func (c *COINUT) GetDepositAddress(cryptocurrency currency.Code, accountID strin // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (c *COINUT) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (c *COINUT) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/exmo/exmo_test.go b/exchanges/exmo/exmo_test.go index d8c82b3d..197e969e 100644 --- a/exchanges/exmo/exmo_test.go +++ b/exchanges/exmo/exmo_test.go @@ -383,8 +383,8 @@ func TestWithdraw(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/exmo/exmo_wrapper.go b/exchanges/exmo/exmo_wrapper.go index 050e9a00..20cb009c 100644 --- a/exchanges/exmo/exmo_wrapper.go +++ b/exchanges/exmo/exmo_wrapper.go @@ -419,7 +419,7 @@ func (e *EXMO) GetDepositAddress(cryptocurrency currency.Code, _ string) (string // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (e *EXMO) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (e *EXMO) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { resp, err := e.WithdrawCryptocurrency(withdrawRequest.Currency.String(), withdrawRequest.Address, withdrawRequest.AddressTag, diff --git a/exchanges/gateio/gateio_test.go b/exchanges/gateio/gateio_test.go index 222731c7..7024d43c 100644 --- a/exchanges/gateio/gateio_test.go +++ b/exchanges/gateio/gateio_test.go @@ -406,8 +406,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/gateio/gateio_wrapper.go b/exchanges/gateio/gateio_wrapper.go index 7bd18678..a7aec29d 100644 --- a/exchanges/gateio/gateio_wrapper.go +++ b/exchanges/gateio/gateio_wrapper.go @@ -525,7 +525,7 @@ func (g *Gateio) GetDepositAddress(cryptocurrency currency.Code, _ string) (stri // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (g *Gateio) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (g *Gateio) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { return g.WithdrawCrypto(withdrawRequest.Currency.String(), withdrawRequest.Address, withdrawRequest.Amount) } diff --git a/exchanges/gemini/gemini_test.go b/exchanges/gemini/gemini_test.go index 5273da8d..856c66f2 100644 --- a/exchanges/gemini/gemini_test.go +++ b/exchanges/gemini/gemini_test.go @@ -478,8 +478,8 @@ func TestModifyOrder(t *testing.T) { func TestWithdraw(t *testing.T) { t.Parallel() - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/gemini/gemini_wrapper.go b/exchanges/gemini/gemini_wrapper.go index 3f50ccab..58860e91 100644 --- a/exchanges/gemini/gemini_wrapper.go +++ b/exchanges/gemini/gemini_wrapper.go @@ -397,7 +397,7 @@ func (g *Gemini) GetDepositAddress(cryptocurrency currency.Code, _ string) (stri // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (g *Gemini) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (g *Gemini) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { resp, err := g.WithdrawCrypto(withdrawRequest.Address, withdrawRequest.Currency.String(), withdrawRequest.Amount) if err != nil { return "", err diff --git a/exchanges/hitbtc/hitbtc_test.go b/exchanges/hitbtc/hitbtc_test.go index b8f168bb..ff177df2 100644 --- a/exchanges/hitbtc/hitbtc_test.go +++ b/exchanges/hitbtc/hitbtc_test.go @@ -340,8 +340,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/hitbtc/hitbtc_wrapper.go b/exchanges/hitbtc/hitbtc_wrapper.go index dec6b9da..dfb6d27f 100644 --- a/exchanges/hitbtc/hitbtc_wrapper.go +++ b/exchanges/hitbtc/hitbtc_wrapper.go @@ -470,7 +470,7 @@ func (h *HitBTC) GetDepositAddress(currency currency.Code, _ string) (string, er // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (h *HitBTC) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (h *HitBTC) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { _, err := h.Withdraw(withdrawRequest.Currency.String(), withdrawRequest.Address, withdrawRequest.Amount) return "", err } diff --git a/exchanges/huobi/huobi_test.go b/exchanges/huobi/huobi_test.go index 1d721524..b8e615bc 100644 --- a/exchanges/huobi/huobi_test.go +++ b/exchanges/huobi/huobi_test.go @@ -588,8 +588,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/huobi/huobi_wrapper.go b/exchanges/huobi/huobi_wrapper.go index fa1ad5bc..bb1475b9 100644 --- a/exchanges/huobi/huobi_wrapper.go +++ b/exchanges/huobi/huobi_wrapper.go @@ -640,7 +640,7 @@ func (h *HUOBI) GetDepositAddress(cryptocurrency currency.Code, accountID string // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (h *HUOBI) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (h *HUOBI) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { resp, err := h.Withdraw(withdrawRequest.Currency, withdrawRequest.Address, withdrawRequest.AddressTag, withdrawRequest.Amount, withdrawRequest.FeeAmount) return strconv.FormatInt(resp, 10), err } diff --git a/exchanges/interfaces.go b/exchanges/interfaces.go index 627ae507..27378d3a 100644 --- a/exchanges/interfaces.go +++ b/exchanges/interfaces.go @@ -51,7 +51,7 @@ type IBotExchange interface { GetDepositAddress(cryptocurrency currency.Code, accountID string) (string, error) GetOrderHistory(getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error) GetActiveOrders(getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error) - WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) + WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) SetHTTPClientUserAgent(ua string) diff --git a/exchanges/itbit/itbit_test.go b/exchanges/itbit/itbit_test.go index b42859e5..33e0df08 100644 --- a/exchanges/itbit/itbit_test.go +++ b/exchanges/itbit/itbit_test.go @@ -390,8 +390,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/itbit/itbit_wrapper.go b/exchanges/itbit/itbit_wrapper.go index 05932dfe..07eeb98c 100644 --- a/exchanges/itbit/itbit_wrapper.go +++ b/exchanges/itbit/itbit_wrapper.go @@ -393,7 +393,7 @@ func (i *ItBit) GetDepositAddress(cryptocurrency currency.Code, accountID string // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (i *ItBit) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (i *ItBit) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/kraken/kraken_test.go b/exchanges/kraken/kraken_test.go index 7b446e73..174d6c23 100644 --- a/exchanges/kraken/kraken_test.go +++ b/exchanges/kraken/kraken_test.go @@ -530,8 +530,8 @@ func TestModifyOrder(t *testing.T) { // TestWithdraw wrapper test func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.XXBT, Description: "WITHDRAW IT ALL", @@ -560,7 +560,7 @@ func TestWithdrawFiat(t *testing.T) { } var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.EUR, Description: "WITHDRAW IT ALL", @@ -584,7 +584,7 @@ func TestWithdrawInternationalBank(t *testing.T) { } var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.EUR, Description: "WITHDRAW IT ALL", diff --git a/exchanges/kraken/kraken_wrapper.go b/exchanges/kraken/kraken_wrapper.go index 7356db2b..3504eb4c 100644 --- a/exchanges/kraken/kraken_wrapper.go +++ b/exchanges/kraken/kraken_wrapper.go @@ -570,7 +570,7 @@ func (k *Kraken) GetDepositAddress(cryptocurrency currency.Code, _ string) (stri // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal // Populate exchange.WithdrawRequest.TradePassword with withdrawal key name, as set up on your account -func (k *Kraken) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (k *Kraken) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { return k.Withdraw(withdrawRequest.Currency.String(), withdrawRequest.TradePassword, withdrawRequest.Amount) } diff --git a/exchanges/lakebtc/lakebtc_test.go b/exchanges/lakebtc/lakebtc_test.go index 43bb7987..ab376322 100644 --- a/exchanges/lakebtc/lakebtc_test.go +++ b/exchanges/lakebtc/lakebtc_test.go @@ -376,8 +376,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/lakebtc/lakebtc_wrapper.go b/exchanges/lakebtc/lakebtc_wrapper.go index b16ef592..3e652869 100644 --- a/exchanges/lakebtc/lakebtc_wrapper.go +++ b/exchanges/lakebtc/lakebtc_wrapper.go @@ -405,7 +405,7 @@ func (l *LakeBTC) GetDepositAddress(cryptocurrency currency.Code, _ string) (str // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (l *LakeBTC) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (l *LakeBTC) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { if withdrawRequest.Currency != currency.BTC { return "", errors.New("only BTC supported for withdrawals") } diff --git a/exchanges/lbank/lbank_wrapper.go b/exchanges/lbank/lbank_wrapper.go index 1b4d4525..686c2e2b 100644 --- a/exchanges/lbank/lbank_wrapper.go +++ b/exchanges/lbank/lbank_wrapper.go @@ -454,7 +454,7 @@ func (l *Lbank) GetDepositAddress(cryptocurrency currency.Code, accountID string // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (l *Lbank) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (l *Lbank) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { resp, err := l.Withdraw(withdrawRequest.Address, withdrawRequest.Currency.String(), strconv.FormatFloat(withdrawRequest.Amount, 'f', -1, 64), "", withdrawRequest.Description, "") diff --git a/exchanges/localbitcoins/localbitcoins_test.go b/exchanges/localbitcoins/localbitcoins_test.go index d525e8c4..42b8d841 100644 --- a/exchanges/localbitcoins/localbitcoins_test.go +++ b/exchanges/localbitcoins/localbitcoins_test.go @@ -333,8 +333,8 @@ func TestModifyOrder(t *testing.T) { func TestWithdraw(t *testing.T) { t.Parallel() - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/localbitcoins/localbitcoins_wrapper.go b/exchanges/localbitcoins/localbitcoins_wrapper.go index a6c8073a..58a34886 100644 --- a/exchanges/localbitcoins/localbitcoins_wrapper.go +++ b/exchanges/localbitcoins/localbitcoins_wrapper.go @@ -394,7 +394,7 @@ func (l *LocalBitcoins) GetDepositAddress(cryptocurrency currency.Code, _ string // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (l *LocalBitcoins) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (l *LocalBitcoins) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { return "", l.WalletSend(withdrawRequest.Address, withdrawRequest.Amount, diff --git a/exchanges/okcoin/okcoin_test.go b/exchanges/okcoin/okcoin_test.go index 8555c9bc..5ecdbf60 100644 --- a/exchanges/okcoin/okcoin_test.go +++ b/exchanges/okcoin/okcoin_test.go @@ -1059,8 +1059,8 @@ func TestModifyOrder(t *testing.T) { func TestWithdraw(t *testing.T) { TestSetRealOrderDefaults(t) - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/okex/okex_test.go b/exchanges/okex/okex_test.go index d59bd3e1..990229d5 100644 --- a/exchanges/okex/okex_test.go +++ b/exchanges/okex/okex_test.go @@ -1752,8 +1752,8 @@ func TestModifyOrder(t *testing.T) { func TestWithdraw(t *testing.T) { TestSetRealOrderDefaults(t) t.Parallel() - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/okgroup/okgroup_wrapper.go b/exchanges/okgroup/okgroup_wrapper.go index ef0804cf..0d55023c 100644 --- a/exchanges/okgroup/okgroup_wrapper.go +++ b/exchanges/okgroup/okgroup_wrapper.go @@ -367,7 +367,7 @@ func (o *OKGroup) GetDepositAddress(p currency.Code, accountID string) (string, // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (o *OKGroup) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (o *OKGroup) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { withdrawal, err := o.AccountWithdraw(AccountWithdrawRequest{ Amount: withdrawRequest.Amount, Currency: withdrawRequest.Currency.Lower().String(), diff --git a/exchanges/poloniex/poloniex_test.go b/exchanges/poloniex/poloniex_test.go index 480c96b8..6c964395 100644 --- a/exchanges/poloniex/poloniex_test.go +++ b/exchanges/poloniex/poloniex_test.go @@ -348,8 +348,8 @@ func TestModifyOrder(t *testing.T) { func TestWithdraw(t *testing.T) { t.Parallel() - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: 0, Currency: currency.LTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/poloniex/poloniex_wrapper.go b/exchanges/poloniex/poloniex_wrapper.go index 2c178495..83c4ed2e 100644 --- a/exchanges/poloniex/poloniex_wrapper.go +++ b/exchanges/poloniex/poloniex_wrapper.go @@ -463,7 +463,7 @@ func (p *Poloniex) GetDepositAddress(cryptocurrency currency.Code, _ string) (st // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (p *Poloniex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (p *Poloniex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { _, err := p.Withdraw(withdrawRequest.Currency.String(), withdrawRequest.Address, withdrawRequest.Amount) return "", err } diff --git a/exchanges/withdraw/withdraw_types.go b/exchanges/withdraw/withdraw_types.go index dd089d03..eafa1144 100644 --- a/exchanges/withdraw/withdraw_types.go +++ b/exchanges/withdraw/withdraw_types.go @@ -2,8 +2,8 @@ package withdraw import "github.com/thrasher-corp/gocryptotrader/currency" -// GenericWithdrawRequestInfo stores genric withdraw request info -type GenericWithdrawRequestInfo struct { +// GenericInfo stores genric withdraw request info +type GenericInfo struct { // General withdraw information Currency currency.Code Description string @@ -14,9 +14,9 @@ type GenericWithdrawRequestInfo struct { Amount float64 } -// CryptoWithdrawRequest stores the info required for a crypto withdrawal request -type CryptoWithdrawRequest struct { - GenericWithdrawRequestInfo +// CryptoRequest stores the info required for a crypto withdrawal request +type CryptoRequest struct { + GenericInfo // Crypto related information Address string AddressTag string @@ -25,7 +25,7 @@ type CryptoWithdrawRequest struct { // FiatWithdrawRequest used for fiat withdrawal requests type FiatWithdrawRequest struct { - GenericWithdrawRequestInfo + GenericInfo // FIAT related information BankAccountName string BankAccountNumber string diff --git a/exchanges/yobit/yobit_test.go b/exchanges/yobit/yobit_test.go index 5eb1ebcb..6ba53d41 100644 --- a/exchanges/yobit/yobit_test.go +++ b/exchanges/yobit/yobit_test.go @@ -446,8 +446,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/yobit/yobit_wrapper.go b/exchanges/yobit/yobit_wrapper.go index eeb3d8b3..1a693246 100644 --- a/exchanges/yobit/yobit_wrapper.go +++ b/exchanges/yobit/yobit_wrapper.go @@ -407,7 +407,7 @@ func (y *Yobit) GetDepositAddress(cryptocurrency currency.Code, _ string) (strin // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (y *Yobit) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (y *Yobit) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { resp, err := y.WithdrawCoinsToAddress(withdrawRequest.Currency.String(), withdrawRequest.Amount, withdrawRequest.Address) if err != nil { return "", err diff --git a/exchanges/zb/zb_test.go b/exchanges/zb/zb_test.go index 72c54e59..f526995b 100644 --- a/exchanges/zb/zb_test.go +++ b/exchanges/zb/zb_test.go @@ -414,8 +414,8 @@ func TestModifyOrder(t *testing.T) { } func TestWithdraw(t *testing.T) { - withdrawCryptoRequest := withdraw.CryptoWithdrawRequest{ - GenericWithdrawRequestInfo: withdraw.GenericWithdrawRequestInfo{ + withdrawCryptoRequest := withdraw.CryptoRequest{ + GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, Description: "WITHDRAW IT ALL", diff --git a/exchanges/zb/zb_wrapper.go b/exchanges/zb/zb_wrapper.go index 8664d284..e4920c7f 100644 --- a/exchanges/zb/zb_wrapper.go +++ b/exchanges/zb/zb_wrapper.go @@ -499,7 +499,7 @@ func (z *ZB) GetDepositAddress(cryptocurrency currency.Code, _ string) (string, // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func (z *ZB) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func (z *ZB) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { return z.Withdraw(withdrawRequest.Currency.Lower().String(), withdrawRequest.Address, withdrawRequest.TradePassword, withdrawRequest.Amount, withdrawRequest.FeeAmount, false) } From 9178dbcc61a7a077c60cb103fe46b7f3ce353b23 Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Fri, 13 Dec 2019 08:36:07 +1100 Subject: [PATCH 5/6] removed withdraw from struct name: --- cmd/exchange_template/wrapper_file.tmpl | 6 +++--- cmd/exchange_wrapper_coverage/main.go | 4 ++-- cmd/exchange_wrapper_issues/main.go | 2 +- exchanges/alphapoint/alphapoint_test.go | 4 ++-- exchanges/alphapoint/alphapoint_wrapper.go | 4 ++-- exchanges/anx/anx_test.go | 4 ++-- exchanges/anx/anx_wrapper.go | 4 ++-- exchanges/binance/binance_test.go | 4 ++-- exchanges/binance/binance_wrapper.go | 4 ++-- exchanges/bitfinex/bitfinex.go | 2 +- exchanges/bitfinex/bitfinex_test.go | 4 ++-- exchanges/bitfinex/bitfinex_wrapper.go | 4 ++-- exchanges/bitflyer/bitflyer_test.go | 4 ++-- exchanges/bitflyer/bitflyer_wrapper.go | 4 ++-- exchanges/bithumb/bithumb_test.go | 4 ++-- exchanges/bithumb/bithumb_wrapper.go | 4 ++-- exchanges/bitmex/bitmex_test.go | 4 ++-- exchanges/bitmex/bitmex_wrapper.go | 4 ++-- exchanges/bitstamp/bitstamp_test.go | 4 ++-- exchanges/bitstamp/bitstamp_wrapper.go | 4 ++-- exchanges/bittrex/bittrex_test.go | 4 ++-- exchanges/bittrex/bittrex_wrapper.go | 4 ++-- exchanges/btcmarkets/btcmarkets_wrapper.go | 4 ++-- exchanges/btse/btse_wrapper.go | 4 ++-- exchanges/coinbasepro/coinbasepro_test.go | 4 ++-- exchanges/coinbasepro/coinbasepro_wrapper.go | 4 ++-- exchanges/coinbene/coinbene_wrapper.go | 4 ++-- exchanges/coinut/coinut_test.go | 4 ++-- exchanges/coinut/coinut_wrapper.go | 4 ++-- exchanges/exmo/exmo_test.go | 4 ++-- exchanges/exmo/exmo_wrapper.go | 4 ++-- exchanges/gateio/gateio_test.go | 4 ++-- exchanges/gateio/gateio_wrapper.go | 4 ++-- exchanges/gemini/gemini_test.go | 4 ++-- exchanges/gemini/gemini_wrapper.go | 4 ++-- exchanges/hitbtc/hitbtc_test.go | 4 ++-- exchanges/hitbtc/hitbtc_wrapper.go | 4 ++-- exchanges/huobi/huobi_test.go | 4 ++-- exchanges/huobi/huobi_wrapper.go | 4 ++-- exchanges/interfaces.go | 4 ++-- exchanges/itbit/itbit_test.go | 4 ++-- exchanges/itbit/itbit_wrapper.go | 4 ++-- exchanges/kraken/kraken_test.go | 4 ++-- exchanges/kraken/kraken_wrapper.go | 4 ++-- exchanges/lakebtc/lakebtc_test.go | 4 ++-- exchanges/lakebtc/lakebtc_wrapper.go | 4 ++-- exchanges/lbank/lbank_wrapper.go | 4 ++-- exchanges/localbitcoins/localbitcoins_test.go | 4 ++-- exchanges/localbitcoins/localbitcoins_wrapper.go | 4 ++-- exchanges/okcoin/okcoin_test.go | 4 ++-- exchanges/okex/okex_test.go | 4 ++-- exchanges/okgroup/okgroup_wrapper.go | 4 ++-- exchanges/poloniex/poloniex_test.go | 4 ++-- exchanges/poloniex/poloniex_wrapper.go | 4 ++-- exchanges/withdraw/withdraw_types.go | 4 ++-- exchanges/yobit/yobit_test.go | 4 ++-- exchanges/yobit/yobit_wrapper.go | 4 ++-- exchanges/zb/zb_test.go | 4 ++-- exchanges/zb/zb_wrapper.go | 4 ++-- 59 files changed, 117 insertions(+), 117 deletions(-) diff --git a/cmd/exchange_template/wrapper_file.tmpl b/cmd/exchange_template/wrapper_file.tmpl index 8dc2f88f..f45f14dd 100644 --- a/cmd/exchange_template/wrapper_file.tmpl +++ b/cmd/exchange_template/wrapper_file.tmpl @@ -333,19 +333,19 @@ func ({{.Variable}} *{{.CapitalName}}) GetDepositAddress(cryptocurrency currency // WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is // submitted -func ({{.Variable}} *{{.CapitalName}}) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoWithdrawRequest) (string, error) { +func ({{.Variable}} *{{.CapitalName}}) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) { return "", common.ErrNotYetImplemented } // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func ({{.Variable}} *{{.CapitalName}}) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func ({{.Variable}} *{{.CapitalName}}) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrNotYetImplemented } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func ({{.Variable}} *{{.CapitalName}}) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func ({{.Variable}} *{{.CapitalName}}) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrNotYetImplemented } diff --git a/cmd/exchange_wrapper_coverage/main.go b/cmd/exchange_wrapper_coverage/main.go index b0a583a9..f2d08f37 100644 --- a/cmd/exchange_wrapper_coverage/main.go +++ b/cmd/exchange_wrapper_coverage/main.go @@ -179,11 +179,11 @@ func testWrappers(e exchange.IBotExchange) []string { funcs = append(funcs, "WithdrawCryptocurrencyFunds") } - _, err = e.WithdrawFiatFunds(&withdraw.FiatWithdrawRequest{}) + _, err = e.WithdrawFiatFunds(&withdraw.FiatRequest{}) if err == common.ErrNotYetImplemented { funcs = append(funcs, "WithdrawFiatFunds") } - _, err = e.WithdrawFiatFundsToInternationalBank(&withdraw.FiatWithdrawRequest{}) + _, err = e.WithdrawFiatFundsToInternationalBank(&withdraw.FiatRequest{}) if err == common.ErrNotYetImplemented { funcs = append(funcs, "WithdrawFiatFundsToInternationalBank") } diff --git a/cmd/exchange_wrapper_issues/main.go b/cmd/exchange_wrapper_issues/main.go index 8089713d..6df02176 100644 --- a/cmd/exchange_wrapper_issues/main.go +++ b/cmd/exchange_wrapper_issues/main.go @@ -664,7 +664,7 @@ func testWrappers(e exchange.IBotExchange, base *exchange.Base, config *Config) Response: jsonifyInterface([]interface{}{r21}), }) - fiatWithdrawRequest := withdraw.FiatWithdrawRequest{ + fiatWithdrawRequest := withdraw.FiatRequest{ GenericInfo: genericWithdrawRequest, BankAccountName: config.BankDetails.BankAccountName, BankAccountNumber: config.BankDetails.BankAccountNumber, diff --git a/exchanges/alphapoint/alphapoint_test.go b/exchanges/alphapoint/alphapoint_test.go index 62606568..d2993897 100644 --- a/exchanges/alphapoint/alphapoint_test.go +++ b/exchanges/alphapoint/alphapoint_test.go @@ -574,7 +574,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := a.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrNotYetImplemented { t.Errorf("Expected '%v', received: '%v'", common.ErrNotYetImplemented, err) @@ -587,7 +587,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := a.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrNotYetImplemented { t.Errorf("Expected '%v', received: '%v'", common.ErrNotYetImplemented, err) diff --git a/exchanges/alphapoint/alphapoint_wrapper.go b/exchanges/alphapoint/alphapoint_wrapper.go index 0249e8c4..a02a0918 100644 --- a/exchanges/alphapoint/alphapoint_wrapper.go +++ b/exchanges/alphapoint/alphapoint_wrapper.go @@ -288,13 +288,13 @@ func (a *Alphapoint) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Crypt } // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted -func (a *Alphapoint) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (a *Alphapoint) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrNotYetImplemented } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func (a *Alphapoint) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (a *Alphapoint) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrNotYetImplemented } diff --git a/exchanges/anx/anx_test.go b/exchanges/anx/anx_test.go index 5f25f9ad..b2aedd89 100644 --- a/exchanges/anx/anx_test.go +++ b/exchanges/anx/anx_test.go @@ -347,7 +347,7 @@ func TestWithdraw(t *testing.T) { func TestWithdrawFiat(t *testing.T) { t.Parallel() - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := a.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", @@ -358,7 +358,7 @@ func TestWithdrawFiat(t *testing.T) { func TestWithdrawInternationalBank(t *testing.T) { t.Parallel() - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := a.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", diff --git a/exchanges/anx/anx_wrapper.go b/exchanges/anx/anx_wrapper.go index 3652b71d..d3fb07bf 100644 --- a/exchanges/anx/anx_wrapper.go +++ b/exchanges/anx/anx_wrapper.go @@ -424,14 +424,14 @@ func (a *ANX) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoReques // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func (a *ANX) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (a *ANX) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { // Fiat withdrawals available via website return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func (a *ANX) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (a *ANX) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { // Fiat withdrawals available via website return "", common.ErrFunctionNotSupported } diff --git a/exchanges/binance/binance_test.go b/exchanges/binance/binance_test.go index 7e845962..6bdcc3e5 100644 --- a/exchanges/binance/binance_test.go +++ b/exchanges/binance/binance_test.go @@ -477,7 +477,7 @@ func TestWithdraw(t *testing.T) { func TestWithdrawFiat(t *testing.T) { t.Parallel() - var withdrawFiatRequest withdraw.FiatWithdrawRequest + var withdrawFiatRequest withdraw.FiatRequest _, err := b.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -487,7 +487,7 @@ func TestWithdrawFiat(t *testing.T) { func TestWithdrawInternationalBank(t *testing.T) { t.Parallel() - var withdrawFiatRequest withdraw.FiatWithdrawRequest + var withdrawFiatRequest withdraw.FiatRequest _, err := b.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/binance/binance_wrapper.go b/exchanges/binance/binance_wrapper.go index 1a1e3c12..1c569cec 100644 --- a/exchanges/binance/binance_wrapper.go +++ b/exchanges/binance/binance_wrapper.go @@ -505,13 +505,13 @@ func (b *Binance) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRe // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (b *Binance) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Binance) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (b *Binance) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Binance) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/bitfinex/bitfinex.go b/exchanges/bitfinex/bitfinex.go index ba239f48..ec627bba 100644 --- a/exchanges/bitfinex/bitfinex.go +++ b/exchanges/bitfinex/bitfinex.go @@ -542,7 +542,7 @@ func (b *Bitfinex) WithdrawCryptocurrency(withdrawType, wallet, address, payment } // WithdrawFIAT Sends an authenticated request to withdraw FIAT currency -func (b *Bitfinex) WithdrawFIAT(withdrawalType, walletType string, withdrawRequest *withdraw.FiatWithdrawRequest) ([]Withdrawal, error) { +func (b *Bitfinex) WithdrawFIAT(withdrawalType, walletType string, withdrawRequest *withdraw.FiatRequest) ([]Withdrawal, error) { var response []Withdrawal req := make(map[string]interface{}) diff --git a/exchanges/bitfinex/bitfinex_test.go b/exchanges/bitfinex/bitfinex_test.go index 09435b91..99972950 100644 --- a/exchanges/bitfinex/bitfinex_test.go +++ b/exchanges/bitfinex/bitfinex_test.go @@ -909,7 +909,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + var withdrawFiatRequest = withdraw.FiatRequest{ GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.USD, @@ -942,7 +942,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + var withdrawFiatRequest = withdraw.FiatRequest{ GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.BTC, diff --git a/exchanges/bitfinex/bitfinex_wrapper.go b/exchanges/bitfinex/bitfinex_wrapper.go index 27154604..bcbd211e 100644 --- a/exchanges/bitfinex/bitfinex_wrapper.go +++ b/exchanges/bitfinex/bitfinex_wrapper.go @@ -510,7 +510,7 @@ func (b *Bitfinex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoR // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted // Returns comma delimited withdrawal IDs -func (b *Bitfinex) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Bitfinex) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { withdrawalType := "wire" // Bitfinex has support for three types, exchange, margin and deposit // As this is for trading, I've made the wrapper default 'exchange' @@ -542,7 +542,7 @@ func (b *Bitfinex) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawReque // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted // Returns comma delimited withdrawal IDs -func (b *Bitfinex) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Bitfinex) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return b.WithdrawFiatFunds(withdrawRequest) } diff --git a/exchanges/bitflyer/bitflyer_test.go b/exchanges/bitflyer/bitflyer_test.go index 523b53bc..814781db 100644 --- a/exchanges/bitflyer/bitflyer_test.go +++ b/exchanges/bitflyer/bitflyer_test.go @@ -399,7 +399,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := b.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrNotYetImplemented { @@ -413,7 +413,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := b.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrNotYetImplemented { diff --git a/exchanges/bitflyer/bitflyer_wrapper.go b/exchanges/bitflyer/bitflyer_wrapper.go index 29310336..5005d92b 100644 --- a/exchanges/bitflyer/bitflyer_wrapper.go +++ b/exchanges/bitflyer/bitflyer_wrapper.go @@ -316,13 +316,13 @@ func (b *Bitflyer) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoR // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (b *Bitflyer) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Bitflyer) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrNotYetImplemented } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (b *Bitflyer) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Bitflyer) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrNotYetImplemented } diff --git a/exchanges/bithumb/bithumb_test.go b/exchanges/bithumb/bithumb_test.go index de357544..b1efe9bb 100644 --- a/exchanges/bithumb/bithumb_test.go +++ b/exchanges/bithumb/bithumb_test.go @@ -473,7 +473,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + var withdrawFiatRequest = withdraw.FiatRequest{ GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.USD, @@ -507,7 +507,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := b.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/bithumb/bithumb_wrapper.go b/exchanges/bithumb/bithumb_wrapper.go index 694ca7f8..d1a19627 100644 --- a/exchanges/bithumb/bithumb_wrapper.go +++ b/exchanges/bithumb/bithumb_wrapper.go @@ -418,7 +418,7 @@ func (b *Bithumb) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRe // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (b *Bithumb) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Bithumb) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { if math.Mod(withdrawRequest.Amount, 1) != 0 { return "", errors.New("currency KRW does not support decimal places") } @@ -439,7 +439,7 @@ func (b *Bithumb) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawReques } // WithdrawFiatFundsToInternationalBank is not supported as Bithumb only withdraws KRW to South Korean banks -func (b *Bithumb) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Bithumb) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/bitmex/bitmex_test.go b/exchanges/bitmex/bitmex_test.go index c3b44e7d..f43da283 100644 --- a/exchanges/bitmex/bitmex_test.go +++ b/exchanges/bitmex/bitmex_test.go @@ -635,7 +635,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := b.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -647,7 +647,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := b.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/bitmex/bitmex_wrapper.go b/exchanges/bitmex/bitmex_wrapper.go index 994a3b96..f62982f6 100644 --- a/exchanges/bitmex/bitmex_wrapper.go +++ b/exchanges/bitmex/bitmex_wrapper.go @@ -531,13 +531,13 @@ func (b *Bitmex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoReq // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *Bitmex) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Bitmex) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func (b *Bitmex) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Bitmex) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/bitstamp/bitstamp_test.go b/exchanges/bitstamp/bitstamp_test.go index e5dc0c2b..bbb1f8f4 100644 --- a/exchanges/bitstamp/bitstamp_test.go +++ b/exchanges/bitstamp/bitstamp_test.go @@ -482,7 +482,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + var withdrawFiatRequest = withdraw.FiatRequest{ GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.USD, @@ -520,7 +520,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + var withdrawFiatRequest = withdraw.FiatRequest{ GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.USD, diff --git a/exchanges/bitstamp/bitstamp_wrapper.go b/exchanges/bitstamp/bitstamp_wrapper.go index 7bf38ada..0a7a8e03 100644 --- a/exchanges/bitstamp/bitstamp_wrapper.go +++ b/exchanges/bitstamp/bitstamp_wrapper.go @@ -443,7 +443,7 @@ func (b *Bitstamp) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoR // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (b *Bitstamp) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Bitstamp) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { resp, err := b.OpenBankWithdrawal(withdrawRequest.Amount, withdrawRequest.Currency.String(), withdrawRequest.BankAccountName, @@ -471,7 +471,7 @@ func (b *Bitstamp) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawReque // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (b *Bitstamp) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Bitstamp) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { resp, err := b.OpenInternationalBankWithdrawal(withdrawRequest.Amount, withdrawRequest.Currency.String(), withdrawRequest.BankAccountName, diff --git a/exchanges/bittrex/bittrex_test.go b/exchanges/bittrex/bittrex_test.go index 17726811..10cf424b 100644 --- a/exchanges/bittrex/bittrex_test.go +++ b/exchanges/bittrex/bittrex_test.go @@ -470,7 +470,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := b.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { @@ -483,7 +483,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := b.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { diff --git a/exchanges/bittrex/bittrex_wrapper.go b/exchanges/bittrex/bittrex_wrapper.go index 073c3036..b121f217 100644 --- a/exchanges/bittrex/bittrex_wrapper.go +++ b/exchanges/bittrex/bittrex_wrapper.go @@ -416,13 +416,13 @@ func (b *Bittrex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRe // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (b *Bittrex) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Bittrex) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (b *Bittrex) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *Bittrex) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/btcmarkets/btcmarkets_wrapper.go b/exchanges/btcmarkets/btcmarkets_wrapper.go index 58a1c124..736a4e39 100644 --- a/exchanges/btcmarkets/btcmarkets_wrapper.go +++ b/exchanges/btcmarkets/btcmarkets_wrapper.go @@ -494,7 +494,7 @@ func (b *BTCMarkets) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Crypt // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (b *BTCMarkets) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *BTCMarkets) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { if withdrawRequest.Currency != currency.AUD { return "", errors.New("only aud is supported for withdrawals") } @@ -513,7 +513,7 @@ func (b *BTCMarkets) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawReq // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (b *BTCMarkets) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *BTCMarkets) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/btse/btse_wrapper.go b/exchanges/btse/btse_wrapper.go index 3e1d6c40..2f6454d3 100644 --- a/exchanges/btse/btse_wrapper.go +++ b/exchanges/btse/btse_wrapper.go @@ -504,13 +504,13 @@ func (b *BTSE) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoReque // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func (b *BTSE) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *BTSE) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func (b *BTSE) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (b *BTSE) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/coinbasepro/coinbasepro_test.go b/exchanges/coinbasepro/coinbasepro_test.go index 489a71b1..75fe978f 100644 --- a/exchanges/coinbasepro/coinbasepro_test.go +++ b/exchanges/coinbasepro/coinbasepro_test.go @@ -526,7 +526,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + var withdrawFiatRequest = withdraw.FiatRequest{ GenericInfo: withdraw.GenericInfo{ Amount: 100, Currency: currency.USD, @@ -548,7 +548,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + var withdrawFiatRequest = withdraw.FiatRequest{ GenericInfo: withdraw.GenericInfo{ Amount: 100, Currency: currency.USD, diff --git a/exchanges/coinbasepro/coinbasepro_wrapper.go b/exchanges/coinbasepro/coinbasepro_wrapper.go index 3a36091d..92aef9ac 100644 --- a/exchanges/coinbasepro/coinbasepro_wrapper.go +++ b/exchanges/coinbasepro/coinbasepro_wrapper.go @@ -455,7 +455,7 @@ func (c *CoinbasePro) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Cryp // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func (c *CoinbasePro) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (c *CoinbasePro) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { paymentMethods, err := c.GetPayMethods() if err != nil { return "", err @@ -482,7 +482,7 @@ func (c *CoinbasePro) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRe // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (c *CoinbasePro) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (c *CoinbasePro) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return c.WithdrawFiatFunds(withdrawRequest) } diff --git a/exchanges/coinbene/coinbene_wrapper.go b/exchanges/coinbene/coinbene_wrapper.go index 738b1cc5..fae0eb7c 100644 --- a/exchanges/coinbene/coinbene_wrapper.go +++ b/exchanges/coinbene/coinbene_wrapper.go @@ -463,13 +463,13 @@ func (c *Coinbene) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoR // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func (c *Coinbene) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (c *Coinbene) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func (c *Coinbene) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (c *Coinbene) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/coinut/coinut_test.go b/exchanges/coinut/coinut_test.go index 1807f0bb..c00e8174 100644 --- a/exchanges/coinut/coinut_test.go +++ b/exchanges/coinut/coinut_test.go @@ -407,7 +407,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := c.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -419,7 +419,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := c.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/coinut/coinut_wrapper.go b/exchanges/coinut/coinut_wrapper.go index 1733cb1c..753ebc14 100644 --- a/exchanges/coinut/coinut_wrapper.go +++ b/exchanges/coinut/coinut_wrapper.go @@ -655,13 +655,13 @@ func (c *COINUT) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoReq // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (c *COINUT) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (c *COINUT) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (c *COINUT) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (c *COINUT) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/exmo/exmo_test.go b/exchanges/exmo/exmo_test.go index 197e969e..8931b2ac 100644 --- a/exchanges/exmo/exmo_test.go +++ b/exchanges/exmo/exmo_test.go @@ -406,7 +406,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := e.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -418,7 +418,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := e.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/exmo/exmo_wrapper.go b/exchanges/exmo/exmo_wrapper.go index 20cb009c..a56c614e 100644 --- a/exchanges/exmo/exmo_wrapper.go +++ b/exchanges/exmo/exmo_wrapper.go @@ -430,13 +430,13 @@ func (e *EXMO) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoReque // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (e *EXMO) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (e *EXMO) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (e *EXMO) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (e *EXMO) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/gateio/gateio_test.go b/exchanges/gateio/gateio_test.go index 7024d43c..30376734 100644 --- a/exchanges/gateio/gateio_test.go +++ b/exchanges/gateio/gateio_test.go @@ -433,7 +433,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := g.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -445,7 +445,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := g.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/gateio/gateio_wrapper.go b/exchanges/gateio/gateio_wrapper.go index a7aec29d..02dd43f6 100644 --- a/exchanges/gateio/gateio_wrapper.go +++ b/exchanges/gateio/gateio_wrapper.go @@ -531,13 +531,13 @@ func (g *Gateio) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoReq // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (g *Gateio) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (g *Gateio) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (g *Gateio) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (g *Gateio) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/gemini/gemini_test.go b/exchanges/gemini/gemini_test.go index 856c66f2..f960cd89 100644 --- a/exchanges/gemini/gemini_test.go +++ b/exchanges/gemini/gemini_test.go @@ -509,7 +509,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := g.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", @@ -524,7 +524,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := g.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", diff --git a/exchanges/gemini/gemini_wrapper.go b/exchanges/gemini/gemini_wrapper.go index 58860e91..3c2b7fe3 100644 --- a/exchanges/gemini/gemini_wrapper.go +++ b/exchanges/gemini/gemini_wrapper.go @@ -411,13 +411,13 @@ func (g *Gemini) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoReq // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (g *Gemini) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (g *Gemini) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (g *Gemini) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (g *Gemini) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/hitbtc/hitbtc_test.go b/exchanges/hitbtc/hitbtc_test.go index ff177df2..2553858d 100644 --- a/exchanges/hitbtc/hitbtc_test.go +++ b/exchanges/hitbtc/hitbtc_test.go @@ -367,7 +367,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := h.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -379,7 +379,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := h.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/hitbtc/hitbtc_wrapper.go b/exchanges/hitbtc/hitbtc_wrapper.go index dfb6d27f..e3747a21 100644 --- a/exchanges/hitbtc/hitbtc_wrapper.go +++ b/exchanges/hitbtc/hitbtc_wrapper.go @@ -477,13 +477,13 @@ func (h *HitBTC) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoReq // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (h *HitBTC) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (h *HitBTC) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (h *HitBTC) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (h *HitBTC) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/huobi/huobi_test.go b/exchanges/huobi/huobi_test.go index b8e615bc..1f6b6508 100644 --- a/exchanges/huobi/huobi_test.go +++ b/exchanges/huobi/huobi_test.go @@ -615,7 +615,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := h.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -627,7 +627,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := h.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/huobi/huobi_wrapper.go b/exchanges/huobi/huobi_wrapper.go index bb1475b9..d61f7ada 100644 --- a/exchanges/huobi/huobi_wrapper.go +++ b/exchanges/huobi/huobi_wrapper.go @@ -647,13 +647,13 @@ func (h *HUOBI) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequ // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (h *HUOBI) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (h *HUOBI) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (h *HUOBI) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (h *HUOBI) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/interfaces.go b/exchanges/interfaces.go index 27378d3a..01232c43 100644 --- a/exchanges/interfaces.go +++ b/exchanges/interfaces.go @@ -52,8 +52,8 @@ type IBotExchange interface { GetOrderHistory(getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error) GetActiveOrders(getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest) (string, error) - WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) - WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) + WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) + WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) SetHTTPClientUserAgent(ua string) GetHTTPClientUserAgent() string SetClientProxyAddress(addr string) error diff --git a/exchanges/itbit/itbit_test.go b/exchanges/itbit/itbit_test.go index 33e0df08..d97301a4 100644 --- a/exchanges/itbit/itbit_test.go +++ b/exchanges/itbit/itbit_test.go @@ -414,7 +414,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := i.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -426,7 +426,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := i.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/itbit/itbit_wrapper.go b/exchanges/itbit/itbit_wrapper.go index 07eeb98c..2e11ba08 100644 --- a/exchanges/itbit/itbit_wrapper.go +++ b/exchanges/itbit/itbit_wrapper.go @@ -399,13 +399,13 @@ func (i *ItBit) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequ // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (i *ItBit) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (i *ItBit) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (i *ItBit) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (i *ItBit) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/kraken/kraken_test.go b/exchanges/kraken/kraken_test.go index 174d6c23..09a7ef8a 100644 --- a/exchanges/kraken/kraken_test.go +++ b/exchanges/kraken/kraken_test.go @@ -559,7 +559,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + var withdrawFiatRequest = withdraw.FiatRequest{ GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.EUR, @@ -583,7 +583,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{ + var withdrawFiatRequest = withdraw.FiatRequest{ GenericInfo: withdraw.GenericInfo{ Amount: -1, Currency: currency.EUR, diff --git a/exchanges/kraken/kraken_wrapper.go b/exchanges/kraken/kraken_wrapper.go index 3504eb4c..908ed74b 100644 --- a/exchanges/kraken/kraken_wrapper.go +++ b/exchanges/kraken/kraken_wrapper.go @@ -576,13 +576,13 @@ func (k *Kraken) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoReq // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (k *Kraken) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (k *Kraken) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return k.Withdraw(withdrawRequest.Currency.String(), withdrawRequest.TradePassword, withdrawRequest.Amount) } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (k *Kraken) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (k *Kraken) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return k.Withdraw(withdrawRequest.Currency.String(), withdrawRequest.TradePassword, withdrawRequest.Amount) } diff --git a/exchanges/lakebtc/lakebtc_test.go b/exchanges/lakebtc/lakebtc_test.go index ab376322..4158fc87 100644 --- a/exchanges/lakebtc/lakebtc_test.go +++ b/exchanges/lakebtc/lakebtc_test.go @@ -403,7 +403,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := l.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -415,7 +415,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := l.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/lakebtc/lakebtc_wrapper.go b/exchanges/lakebtc/lakebtc_wrapper.go index 3e652869..c9a08651 100644 --- a/exchanges/lakebtc/lakebtc_wrapper.go +++ b/exchanges/lakebtc/lakebtc_wrapper.go @@ -420,13 +420,13 @@ func (l *LakeBTC) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRe // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (l *LakeBTC) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (l *LakeBTC) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (l *LakeBTC) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (l *LakeBTC) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/lbank/lbank_wrapper.go b/exchanges/lbank/lbank_wrapper.go index 686c2e2b..eaa99cc4 100644 --- a/exchanges/lbank/lbank_wrapper.go +++ b/exchanges/lbank/lbank_wrapper.go @@ -463,13 +463,13 @@ func (l *Lbank) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequ // WithdrawFiatFunds returns a withdrawal ID when a withdrawal is // submitted -func (l *Lbank) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (l *Lbank) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is // submitted -func (l *Lbank) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (l *Lbank) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/localbitcoins/localbitcoins_test.go b/exchanges/localbitcoins/localbitcoins_test.go index 42b8d841..84f86403 100644 --- a/exchanges/localbitcoins/localbitcoins_test.go +++ b/exchanges/localbitcoins/localbitcoins_test.go @@ -360,7 +360,7 @@ func TestWithdraw(t *testing.T) { func TestWithdrawFiat(t *testing.T) { t.Parallel() - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := l.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", @@ -372,7 +372,7 @@ func TestWithdrawFiat(t *testing.T) { func TestWithdrawInternationalBank(t *testing.T) { t.Parallel() - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := l.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", diff --git a/exchanges/localbitcoins/localbitcoins_wrapper.go b/exchanges/localbitcoins/localbitcoins_wrapper.go index 58a34886..8665a9fe 100644 --- a/exchanges/localbitcoins/localbitcoins_wrapper.go +++ b/exchanges/localbitcoins/localbitcoins_wrapper.go @@ -403,13 +403,13 @@ func (l *LocalBitcoins) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Cr // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (l *LocalBitcoins) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (l *LocalBitcoins) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (l *LocalBitcoins) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (l *LocalBitcoins) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/okcoin/okcoin_test.go b/exchanges/okcoin/okcoin_test.go index 5ecdbf60..8350cb8e 100644 --- a/exchanges/okcoin/okcoin_test.go +++ b/exchanges/okcoin/okcoin_test.go @@ -1077,7 +1077,7 @@ func TestWithdraw(t *testing.T) { // TestWithdrawFiat Wrapper test func TestWithdrawFiat(t *testing.T) { TestSetRealOrderDefaults(t) - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := o.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -1087,7 +1087,7 @@ func TestWithdrawFiat(t *testing.T) { // TestSubmitOrder Wrapper test func TestWithdrawInternationalBank(t *testing.T) { TestSetRealOrderDefaults(t) - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := o.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/okex/okex_test.go b/exchanges/okex/okex_test.go index 990229d5..563c9b58 100644 --- a/exchanges/okex/okex_test.go +++ b/exchanges/okex/okex_test.go @@ -1770,7 +1770,7 @@ func TestWithdraw(t *testing.T) { func TestWithdrawFiat(t *testing.T) { TestSetRealOrderDefaults(t) t.Parallel() - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := o.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", @@ -1783,7 +1783,7 @@ func TestWithdrawFiat(t *testing.T) { func TestWithdrawInternationalBank(t *testing.T) { TestSetRealOrderDefaults(t) t.Parallel() - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := o.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", diff --git a/exchanges/okgroup/okgroup_wrapper.go b/exchanges/okgroup/okgroup_wrapper.go index 0d55023c..45293d69 100644 --- a/exchanges/okgroup/okgroup_wrapper.go +++ b/exchanges/okgroup/okgroup_wrapper.go @@ -391,13 +391,13 @@ func (o *OKGroup) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRe // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (o *OKGroup) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (o *OKGroup) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (o *OKGroup) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (o *OKGroup) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/poloniex/poloniex_test.go b/exchanges/poloniex/poloniex_test.go index 6c964395..4852e6af 100644 --- a/exchanges/poloniex/poloniex_test.go +++ b/exchanges/poloniex/poloniex_test.go @@ -378,7 +378,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest withdraw.FiatWithdrawRequest + var withdrawFiatRequest withdraw.FiatRequest _, err := p.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", @@ -392,7 +392,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest withdraw.FiatWithdrawRequest + var withdrawFiatRequest withdraw.FiatRequest _, err := p.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", diff --git a/exchanges/poloniex/poloniex_wrapper.go b/exchanges/poloniex/poloniex_wrapper.go index 83c4ed2e..4de4bc82 100644 --- a/exchanges/poloniex/poloniex_wrapper.go +++ b/exchanges/poloniex/poloniex_wrapper.go @@ -470,13 +470,13 @@ func (p *Poloniex) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoR // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (p *Poloniex) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (p *Poloniex) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (p *Poloniex) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (p *Poloniex) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/withdraw/withdraw_types.go b/exchanges/withdraw/withdraw_types.go index eafa1144..3c677588 100644 --- a/exchanges/withdraw/withdraw_types.go +++ b/exchanges/withdraw/withdraw_types.go @@ -23,8 +23,8 @@ type CryptoRequest struct { FeeAmount float64 } -// FiatWithdrawRequest used for fiat withdrawal requests -type FiatWithdrawRequest struct { +// FiatRequest used for fiat withdrawal requests +type FiatRequest struct { GenericInfo // FIAT related information BankAccountName string diff --git a/exchanges/yobit/yobit_test.go b/exchanges/yobit/yobit_test.go index 6ba53d41..02df1b73 100644 --- a/exchanges/yobit/yobit_test.go +++ b/exchanges/yobit/yobit_test.go @@ -473,7 +473,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := y.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", @@ -487,7 +487,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := y.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", diff --git a/exchanges/yobit/yobit_wrapper.go b/exchanges/yobit/yobit_wrapper.go index 1a693246..2311d0c9 100644 --- a/exchanges/yobit/yobit_wrapper.go +++ b/exchanges/yobit/yobit_wrapper.go @@ -420,13 +420,13 @@ func (y *Yobit) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequ // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (y *Yobit) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (y *Yobit) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (y *Yobit) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (y *Yobit) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } diff --git a/exchanges/zb/zb_test.go b/exchanges/zb/zb_test.go index f526995b..f1f066b2 100644 --- a/exchanges/zb/zb_test.go +++ b/exchanges/zb/zb_test.go @@ -442,7 +442,7 @@ func TestWithdrawFiat(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := z.WithdrawFiatFunds(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) @@ -454,7 +454,7 @@ func TestWithdrawInternationalBank(t *testing.T) { t.Skip("API keys set, canManipulateRealOrders false, skipping test") } - var withdrawFiatRequest = withdraw.FiatWithdrawRequest{} + var withdrawFiatRequest = withdraw.FiatRequest{} _, err := z.WithdrawFiatFundsToInternationalBank(&withdrawFiatRequest) if err != common.ErrFunctionNotSupported { t.Errorf("Expected '%v', received: '%v'", common.ErrFunctionNotSupported, err) diff --git a/exchanges/zb/zb_wrapper.go b/exchanges/zb/zb_wrapper.go index e4920c7f..19e63b70 100644 --- a/exchanges/zb/zb_wrapper.go +++ b/exchanges/zb/zb_wrapper.go @@ -505,13 +505,13 @@ func (z *ZB) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.CryptoRequest // WithdrawFiatFunds returns a withdrawal ID when a // withdrawal is submitted -func (z *ZB) WithdrawFiatFunds(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (z *ZB) WithdrawFiatFunds(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } // WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a // withdrawal is submitted -func (z *ZB) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatWithdrawRequest) (string, error) { +func (z *ZB) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.FiatRequest) (string, error) { return "", common.ErrFunctionNotSupported } From 64e5997ab10d21409bb3fd453d455e27203aa287 Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Fri, 13 Dec 2019 12:15:35 +1100 Subject: [PATCH 6/6] goimport file --- cmd/exchange_wrapper_issues/main.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/exchange_wrapper_issues/main.go b/cmd/exchange_wrapper_issues/main.go index 6df02176..d8023a1b 100644 --- a/cmd/exchange_wrapper_issues/main.go +++ b/cmd/exchange_wrapper_issues/main.go @@ -665,17 +665,17 @@ func testWrappers(e exchange.IBotExchange, base *exchange.Base, config *Config) }) fiatWithdrawRequest := withdraw.FiatRequest{ - GenericInfo: genericWithdrawRequest, - BankAccountName: config.BankDetails.BankAccountName, - BankAccountNumber: config.BankDetails.BankAccountNumber, - SwiftCode: config.BankDetails.SwiftCode, - IBAN: config.BankDetails.Iban, - BankCity: config.BankDetails.BankCity, - BankName: config.BankDetails.BankName, - BankAddress: config.BankDetails.BankAddress, - BankCountry: config.BankDetails.BankCountry, - BankPostalCode: config.BankDetails.BankPostalCode, - BankCode: config.BankDetails.BankCode, + GenericInfo: genericWithdrawRequest, + BankAccountName: config.BankDetails.BankAccountName, + BankAccountNumber: config.BankDetails.BankAccountNumber, + SwiftCode: config.BankDetails.SwiftCode, + IBAN: config.BankDetails.Iban, + BankCity: config.BankDetails.BankCity, + BankName: config.BankDetails.BankName, + BankAddress: config.BankDetails.BankAddress, + BankCountry: config.BankDetails.BankCountry, + BankPostalCode: config.BankDetails.BankPostalCode, + BankCode: config.BankDetails.BankCode, IsExpressWire: config.BankDetails.IsExpressWire, RequiresIntermediaryBank: config.BankDetails.RequiresIntermediaryBank, IntermediaryBankName: config.BankDetails.IntermediaryBankName,