mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-01 15:10:44 +00:00
Withdraw Crypto wrapper mapping (#226)
* Initial commit * Updates signature for all withdrawal methods to use new withdrawRequest struct type * Implements crypto withdraw features & tests for Alphapoint, ANX, Binance, Bitfinex, Bitflyer, Bithumb, Bitmex, Bitstamp, Bittrex, BTCC, BTCmarkets, CoinbasePro, Coinut. Updates WithdrawRequest type with more members. Breaking change to update real order testing for increased code coverage * Updates all realOrder tests to run when no API key is present. Updates exchange functions to handle errors better * Implements crypto withdrawals for Exmo, GateIO, Gemini, HitBTC, Huobi, HuobiHadax, Kraken, LakeBTC, Liqui, Localbitcoins, OKCoin, OKEX, Poloniex, Wex, Yobit and ZB. Updates real order test formatting for all real order tests * Update alphapoint. Fixes anx typos. Adds function WithdrawFiatFundsToInternationalBank to exchange wrapper interface. Adds WithdrawFiatFundsToInternationalBank to alphapoint, bitmex, coinbasepro. Updates Kraken to use TradePassword property * Reverts alphapoint to use ErrNotYetImplemented * Fixes line spacing and removes unnecessary line
This commit is contained in:
@@ -98,6 +98,29 @@ type OrderCancellation struct {
|
||||
Side OrderSide
|
||||
}
|
||||
|
||||
// WithdrawRequest used for wrapper crypto and FIAT withdraw methods
|
||||
type WithdrawRequest struct {
|
||||
// Exchange related information
|
||||
Description string
|
||||
OneTimePassword int64
|
||||
AccountID string
|
||||
PIN int64
|
||||
TradePassword string
|
||||
// Crypto related information
|
||||
Currency pair.CurrencyItem
|
||||
Address string
|
||||
AddressTag string
|
||||
Amount float64
|
||||
FeeAmount float64
|
||||
// FIAT related information
|
||||
BankName string
|
||||
BankAddress string
|
||||
BankCity string
|
||||
BankCountry string
|
||||
SwiftCode string
|
||||
WireCurrency string
|
||||
}
|
||||
|
||||
// Definitions for each type of withdrawal method for a given exchange
|
||||
const (
|
||||
// No withdraw
|
||||
@@ -268,8 +291,9 @@ type IBotExchange interface {
|
||||
GetOrderInfo(orderID int64) (OrderDetail, error)
|
||||
GetDepositAddress(cryptocurrency pair.CurrencyItem) (string, error)
|
||||
|
||||
WithdrawCryptocurrencyFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error)
|
||||
WithdrawFiatFunds(currency pair.CurrencyItem, amount float64) (string, error)
|
||||
WithdrawCryptocurrencyFunds(wtihdrawRequest WithdrawRequest) (string, error)
|
||||
WithdrawFiatFunds(wtihdrawRequest WithdrawRequest) (string, error)
|
||||
WithdrawFiatFundsToInternationalBank(wtihdrawRequest WithdrawRequest) (string, error)
|
||||
|
||||
GetWebsocket() (*Websocket, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user