From b8e8c25f78f86ee98fd64855862987340d885310 Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Fri, 13 Dec 2019 08:26:55 +1100 Subject: [PATCH] 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) }