mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-07 23:16:53 +00:00
Add bank details support
This commit is contained in:
committed by
Adrian Gallagher
parent
48fbe78aa6
commit
ed675bde30
@@ -89,6 +89,13 @@ func (a *Alphapoint) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orde
|
||||
return ob, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (a *Alphapoint) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (a *Alphapoint) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -98,24 +105,28 @@ func (a *Alphapoint) GetExchangeHistory(p pair.CurrencyPair, assetType string) (
|
||||
|
||||
// SubmitExchangeOrder submits a new order and returns a true value when
|
||||
// successfully submitted
|
||||
func (a *Alphapoint) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
return a.CreateOrder(p.Pair().String(), side, orderType, amount, price)
|
||||
func (a *Alphapoint) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
//return a.CreateOrder(p.Pair().String(), side, orderType, amount, price)
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (a *Alphapoint) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
return a.ModifyOrder(p.Pair().String(), orderID, action)
|
||||
func (a *Alphapoint) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
//return a.ModifyOrder(p.Pair().String(), orderID, action)
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (a *Alphapoint) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return a.CancelOrder(p.Pair().String(), orderID)
|
||||
func (a *Alphapoint) CancelExchangeOrder(orderID int64) error {
|
||||
//return a.CancelOrder(p.Pair().String(), orderID)
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (a *Alphapoint) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
return a.CancelAllOrders(p.Pair().String())
|
||||
func (a *Alphapoint) CancelAllExchangeOrders() error {
|
||||
//return a.CancelAllOrders(p.Pair().String())
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
@@ -136,21 +147,27 @@ func (a *Alphapoint) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (a *Alphapoint) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (a *Alphapoint) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
addreses, err := a.GetDepositAddresses()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
for x := range addreses {
|
||||
if addreses[x].Name == p.Pair().String() {
|
||||
if addreses[x].Name == cryptocurrency.String() {
|
||||
return addreses[x].DepositAddress, nil
|
||||
}
|
||||
}
|
||||
return "", errors.New("associated currency address not found")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (a *Alphapoint) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
return "", a.WithdrawCoins(p.Pair().String(), p.GetFirstCurrency().String(), address, amount)
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (a *Alphapoint) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (a *Alphapoint) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -181,6 +181,13 @@ func (a *ANX) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (a *ANX) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (a *ANX) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -189,37 +196,51 @@ func (a *ANX) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]excha
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (a *ANX) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (a *ANX) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (a *ANX) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (a *ANX) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (a *ANX) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (a *ANX) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (a *ANX) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (a *ANX) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (a *ANX) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (a *ANX) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (a *ANX) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (a *ANX) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (a *ANX) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (a *ANX) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (a *ANX) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (a *ANX) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -126,6 +126,13 @@ func (b *Binance) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, errors.New("not implemented")
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (b *Binance) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (b *Binance) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -134,37 +141,51 @@ func (b *Binance) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]e
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (b *Binance) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (b *Binance) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (b *Binance) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (b *Binance) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (b *Binance) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *Binance) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (b *Binance) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (b *Binance) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (b *Binance) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *Binance) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (b *Binance) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (b *Binance) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (b *Binance) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (b *Binance) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *Binance) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *Binance) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -163,6 +163,13 @@ func (b *Bitfinex) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (b *Bitfinex) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (b *Bitfinex) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -171,37 +178,50 @@ func (b *Bitfinex) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (b *Bitfinex) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (b *Bitfinex) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (b *Bitfinex) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (b *Bitfinex) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (b *Bitfinex) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *Bitfinex) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (b *Bitfinex) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (b *Bitfinex) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (b *Bitfinex) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *Bitfinex) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (b *Bitfinex) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (b *Bitfinex) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (b *Bitfinex) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
func (b *Bitfinex) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *Bitfinex) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *Bitfinex) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -138,6 +138,13 @@ func (b *Bitflyer) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (b *Bitflyer) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (b *Bitflyer) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -146,37 +153,51 @@ func (b *Bitflyer) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (b *Bitflyer) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (b *Bitflyer) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (b *Bitflyer) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (b *Bitflyer) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (b *Bitflyer) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *Bitflyer) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (b *Bitflyer) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (b *Bitflyer) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (b *Bitflyer) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *Bitflyer) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (b *Bitflyer) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (b *Bitflyer) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (b *Bitflyer) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (b *Bitflyer) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *Bitflyer) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *Bitflyer) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -125,6 +125,13 @@ func (b *Bithumb) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, errors.New("not implemented")
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (b *Bithumb) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (b *Bithumb) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -133,37 +140,51 @@ func (b *Bithumb) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]e
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (b *Bithumb) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (b *Bithumb) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (b *Bithumb) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (b *Bithumb) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (b *Bithumb) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *Bithumb) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (b *Bithumb) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (b *Bithumb) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (b *Bithumb) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *Bithumb) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (b *Bithumb) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (b *Bithumb) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (b *Bithumb) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (b *Bithumb) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *Bithumb) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *Bithumb) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -148,6 +148,13 @@ func (b *Bitstamp) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (b *Bitstamp) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (b *Bitstamp) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -156,37 +163,51 @@ func (b *Bitstamp) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (b *Bitstamp) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (b *Bitstamp) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (b *Bitstamp) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (b *Bitstamp) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (b *Bitstamp) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *Bitstamp) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (b *Bitstamp) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (b *Bitstamp) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (b *Bitstamp) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *Bitstamp) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (b *Bitstamp) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (b *Bitstamp) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (b *Bitstamp) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (b *Bitstamp) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *Bitstamp) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *Bitstamp) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -154,6 +154,13 @@ func (b *Bittrex) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderb
|
||||
return orderbook.GetOrderbook(b.Name, p, assetType)
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (b *Bittrex) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (b *Bittrex) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -162,37 +169,51 @@ func (b *Bittrex) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]e
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (b *Bittrex) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (b *Bittrex) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (b *Bittrex) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (b *Bittrex) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (b *Bittrex) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *Bittrex) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (b *Bittrex) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (b *Bittrex) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (b *Bittrex) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *Bittrex) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (b *Bittrex) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (b *Bittrex) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (b *Bittrex) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (b *Bittrex) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *Bittrex) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *Bittrex) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -133,6 +133,13 @@ func (b *BTCC) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (b *BTCC) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (b *BTCC) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -141,37 +148,51 @@ func (b *BTCC) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exch
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (b *BTCC) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (b *BTCC) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (b *BTCC) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (b *BTCC) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (b *BTCC) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *BTCC) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (b *BTCC) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (b *BTCC) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (b *BTCC) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *BTCC) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (b *BTCC) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (b *BTCC) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (b *BTCC) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (b *BTCC) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *BTCC) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *BTCC) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ func (b *BTCMarkets) GetTrades(firstPair, secondPair string, values url.Values)
|
||||
// orderside - example "Bid" or "Ask"
|
||||
// orderType - example "limit"
|
||||
// clientReq - example "abc-cdf-1000"
|
||||
func (b *BTCMarkets) NewOrder(currency, instrument string, price, amount float64, orderSide, orderType, clientReq string) (int, error) {
|
||||
func (b *BTCMarkets) NewOrder(currency, instrument string, price, amount float64, orderSide, orderType, clientReq string) (int64, error) {
|
||||
newPrice := int64(price * float64(common.SatoshisPerBTC))
|
||||
newVolume := int64(amount * float64(common.SatoshisPerBTC))
|
||||
|
||||
@@ -170,7 +170,7 @@ func (b *BTCMarkets) NewOrder(currency, instrument string, price, amount float64
|
||||
if !resp.Success {
|
||||
return 0, fmt.Errorf("%s Unable to place order. Error message: %s", b.GetName(), resp.ErrorMessage)
|
||||
}
|
||||
return resp.ID, nil
|
||||
return int64(resp.ID), nil
|
||||
}
|
||||
|
||||
// CancelOrder cancels an order by its ID
|
||||
@@ -217,10 +217,19 @@ func (b *BTCMarkets) CancelOrder(orderID []int64) (bool, error) {
|
||||
// historic - if false just normal Orders open
|
||||
func (b *BTCMarkets) GetOrders(currency, instrument string, limit, since int64, historic bool) ([]Order, error) {
|
||||
request := make(map[string]interface{})
|
||||
request["currency"] = common.StringToUpper(currency)
|
||||
request["instrument"] = common.StringToUpper(instrument)
|
||||
request["limit"] = limit
|
||||
request["since"] = since
|
||||
|
||||
if currency != "" {
|
||||
request["currency"] = common.StringToUpper(currency)
|
||||
}
|
||||
if instrument != "" {
|
||||
request["instrument"] = common.StringToUpper(instrument)
|
||||
}
|
||||
if limit != 0 {
|
||||
request["limit"] = limit
|
||||
}
|
||||
if since != 0 {
|
||||
request["since"] = since
|
||||
}
|
||||
|
||||
path := btcMarketsOrderOpen
|
||||
if historic {
|
||||
|
||||
@@ -3,9 +3,10 @@ package btcmarkets
|
||||
import (
|
||||
"net/url"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/thrasher-/gocryptotrader/config"
|
||||
"github.com/thrasher-/gocryptotrader/currency/pair"
|
||||
exchange "github.com/thrasher-/gocryptotrader/exchanges"
|
||||
)
|
||||
|
||||
var bm BTCMarkets
|
||||
@@ -21,9 +22,6 @@ func TestSetDefaults(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSetup(t *testing.T) {
|
||||
t.Parallel()
|
||||
b := BTCMarkets{}
|
||||
b.Name = "BTC Markets"
|
||||
cfg := config.GetConfig()
|
||||
cfg.LoadConfig("../../testdata/configtest.json")
|
||||
bConfig, err := cfg.GetExchangeConfig("BTC Markets")
|
||||
@@ -31,21 +29,13 @@ func TestSetup(t *testing.T) {
|
||||
t.Error("Test Failed - BTC Markets Setup() init error")
|
||||
}
|
||||
|
||||
b.SetDefaults()
|
||||
b.Setup(bConfig)
|
||||
|
||||
if !b.IsEnabled() || b.AuthenticatedAPISupport || b.RESTPollingDelay != time.Duration(10) ||
|
||||
b.Verbose || b.Websocket || len(b.BaseCurrencies) < 1 ||
|
||||
len(b.AvailablePairs) < 1 || len(b.EnabledPairs) < 1 {
|
||||
t.Error("Test Failed - BTC Markets Setup values not set correctly")
|
||||
if apiKey != "" && apiSecret != "" {
|
||||
bConfig.APIKey = apiKey
|
||||
bConfig.APISecret = apiSecret
|
||||
bConfig.AuthenticatedAPISupport = true
|
||||
}
|
||||
|
||||
bConfig.Enabled = false
|
||||
b.Setup(bConfig)
|
||||
|
||||
if b.IsEnabled() {
|
||||
t.Error("Test failed - BTC Markets TestSetup incorrect value")
|
||||
}
|
||||
bm.Setup(bConfig)
|
||||
}
|
||||
|
||||
func TestGetFee(t *testing.T) {
|
||||
@@ -145,3 +135,67 @@ func TestWithdrawAUD(t *testing.T) {
|
||||
t.Error("Test failed - WithdrawAUD() error", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetExchangeAccountInfo(t *testing.T) {
|
||||
_, err := bm.GetExchangeAccountInfo()
|
||||
if err == nil {
|
||||
t.Error("Test failed - GetExchangeAccountInfo() error", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetExchangeFundTransferHistory(t *testing.T) {
|
||||
_, err := bm.GetExchangeFundTransferHistory()
|
||||
if err == nil {
|
||||
t.Error("Test failed - GetExchangeAccountInfo() error", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSubmitExchangeOrder(t *testing.T) {
|
||||
p := pair.NewCurrencyPair("LTC", "AUD")
|
||||
_, err := bm.SubmitExchangeOrder(p, exchange.OrderSideSell(), exchange.OrderTypeMarket(), 0, 0.0, "testID001")
|
||||
if err == nil {
|
||||
t.Error("Test failed - SubmitExchangeOrder() error", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestModifyExchangeOrder(t *testing.T) {
|
||||
_, err := bm.ModifyExchangeOrder(1337, exchange.ModifyOrder{})
|
||||
if err == nil {
|
||||
t.Error("Test failed - ModifyExchangeOrder() error", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCancelExchangeOrder(t *testing.T) {
|
||||
err := bm.CancelExchangeOrder(1337)
|
||||
if err == nil {
|
||||
t.Error("Test failed - CancelExchangeOrder() error", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCancelAllExchangeOrders(t *testing.T) {
|
||||
err := bm.CancelAllExchangeOrders()
|
||||
if err == nil {
|
||||
t.Error("Test failed - CancelAllExchangeOrders() error", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetExchangeOrderInfo(t *testing.T) {
|
||||
_, err := bm.GetExchangeOrderInfo(1337)
|
||||
if err == nil {
|
||||
t.Error("Test failed - GetExchangeOrderInfo() error", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWithdrawExchangeCryptoFunds(t *testing.T) {
|
||||
_, err := bm.WithdrawCryptoExchangeFunds("someaddress", "ltc", 0)
|
||||
if err == nil {
|
||||
t.Error("Test failed - WithdrawExchangeFunds() error", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWithdrawExchangeFiatFundsToLocalBank(t *testing.T) {
|
||||
_, err := bm.WithdrawFiatExchangeFunds("AUD", 0)
|
||||
if err == nil {
|
||||
t.Error("Test failed - WithdrawExchangeFiatFunds() error", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,10 +118,12 @@ func (b *BTCMarkets) UpdateOrderbook(p pair.CurrencyPair, assetType string) (ord
|
||||
func (b *BTCMarkets) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
var response exchange.AccountInfo
|
||||
response.ExchangeName = b.GetName()
|
||||
|
||||
accountBalance, err := b.GetAccountBalance()
|
||||
if err != nil {
|
||||
return response, err
|
||||
}
|
||||
|
||||
for i := 0; i < len(accountBalance); i++ {
|
||||
var exchangeCurrency exchange.AccountCurrencyInfo
|
||||
exchangeCurrency.CurrencyName = accountBalance[i].Currency
|
||||
@@ -133,6 +135,13 @@ func (b *BTCMarkets) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (b *BTCMarkets) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (b *BTCMarkets) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -141,37 +150,100 @@ func (b *BTCMarkets) GetExchangeHistory(p pair.CurrencyPair, assetType string) (
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (b *BTCMarkets) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *BTCMarkets) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return b.NewOrder(p.GetFirstCurrency().Upper().String(), p.GetSecondCurrency().Upper().String(), price, amount, side.Format(b.GetName()), orderType.Format(b.GetName()), clientID)
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (b *BTCMarkets) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *BTCMarkets) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (b *BTCMarkets) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *BTCMarkets) CancelExchangeOrder(orderID int64) error {
|
||||
_, err := b.CancelOrder([]int64{orderID})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (b *BTCMarkets) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
return errors.New("not yet implemented")
|
||||
func (b *BTCMarkets) CancelAllExchangeOrders() error {
|
||||
orders, err := b.GetOrders("", "", 0, 0, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var orderList []int64
|
||||
for _, order := range orders {
|
||||
orderList = append(orderList, order.ID)
|
||||
}
|
||||
|
||||
_, err = b.CancelOrder(orderList)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (b *BTCMarkets) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (b *BTCMarkets) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var OrderDetail exchange.OrderDetail
|
||||
|
||||
orders, err := b.GetOrderDetail([]int64{orderID})
|
||||
if err != nil {
|
||||
return OrderDetail, err
|
||||
}
|
||||
|
||||
if len(orders) > 1 {
|
||||
return OrderDetail, errors.New("too many orders returned")
|
||||
}
|
||||
|
||||
if len(orders) == 0 {
|
||||
return OrderDetail, errors.New("no orders found")
|
||||
}
|
||||
|
||||
for _, order := range orders {
|
||||
OrderDetail.Amount = order.Volume
|
||||
OrderDetail.BaseCurrency = order.Currency
|
||||
OrderDetail.CreationTime = int64(order.CreationTime)
|
||||
OrderDetail.Exchange = b.GetName()
|
||||
OrderDetail.ID = order.ID
|
||||
OrderDetail.OpenVolume = order.OpenVolume
|
||||
OrderDetail.OrderSide = order.OrderSide
|
||||
OrderDetail.OrderType = order.OrderType
|
||||
OrderDetail.Price = order.Price
|
||||
OrderDetail.QuoteCurrency = order.Instrument
|
||||
OrderDetail.Status = order.Status
|
||||
}
|
||||
|
||||
return OrderDetail, nil
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (b *BTCMarkets) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
func (b *BTCMarkets) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (b *BTCMarkets) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawCryptoExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (b *BTCMarkets) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return b.WithdrawCrypto(amount, cryptocurrency.String(), address)
|
||||
}
|
||||
|
||||
// WithdrawFiatExchangeFunds returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *BTCMarkets) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
bd, err := b.GetClientBankAccounts(b.Name, currency.Upper().String())
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return b.WithdrawAUD(bd.AccountName, bd.AccountNumber, bd.BankName, bd.BSBNumber, amount)
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (b *BTCMarkets) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -133,7 +133,14 @@ func (c *CoinbasePro) UpdateOrderbook(p pair.CurrencyPair, assetType string) (or
|
||||
return orderbook.GetOrderbook(c.Name, p, assetType)
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange openinc.
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (c *CoinbasePro) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (c *CoinbasePro) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
|
||||
@@ -141,37 +148,45 @@ func (c *CoinbasePro) GetExchangeHistory(p pair.CurrencyPair, assetType string)
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (c *CoinbasePro) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (c *CoinbasePro) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (c *CoinbasePro) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (c *CoinbasePro) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (c *CoinbasePro) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (c *CoinbasePro) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (c *CoinbasePro) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (c *CoinbasePro) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (c *CoinbasePro) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (c *CoinbasePro) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (c *CoinbasePro) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (c *CoinbasePro) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (c *CoinbasePro) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawCryptoExchangeFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (c *CoinbasePro) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawFiatExchangeFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (c *CoinbasePro) WithdrawFiatExchangeFunds(cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -130,6 +130,13 @@ func (c *COINUT) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbo
|
||||
return orderbook.GetOrderbook(c.Name, p, assetType)
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (c *COINUT) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (c *COINUT) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -138,37 +145,51 @@ func (c *COINUT) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]ex
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (c *COINUT) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (c *COINUT) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (c *COINUT) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (c *COINUT) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (c *COINUT) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (c *COINUT) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (c *COINUT) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (c *COINUT) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (c *COINUT) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (c *COINUT) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (c *COINUT) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (c *COINUT) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (c *COINUT) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (c *COINUT) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (c *COINUT) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (c *COINUT) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -50,6 +50,39 @@ type TradeHistory struct {
|
||||
Type string
|
||||
}
|
||||
|
||||
// OrderDetail holds order detail data
|
||||
type OrderDetail struct {
|
||||
Exchange string
|
||||
ID int64
|
||||
BaseCurrency string
|
||||
QuoteCurrency string
|
||||
OrderSide string
|
||||
OrderType string
|
||||
CreationTime int64
|
||||
Status string
|
||||
Price float64
|
||||
Amount float64
|
||||
OpenVolume float64
|
||||
}
|
||||
|
||||
// FundHistory holds exchange funding history data
|
||||
type FundHistory struct {
|
||||
ExchangeName string
|
||||
Status string
|
||||
TransferID int64
|
||||
Description string
|
||||
Timestamp int64
|
||||
Currency string
|
||||
Amount float64
|
||||
Fee float64
|
||||
TransferType string
|
||||
CryptoToAddress string
|
||||
CryptoFromAddress string
|
||||
CryptoTxID string
|
||||
BankTo string
|
||||
BankFrom string
|
||||
}
|
||||
|
||||
// Base stores the individual exchange information
|
||||
type Base struct {
|
||||
Name string
|
||||
@@ -99,13 +132,16 @@ type IBotExchange interface {
|
||||
GetLastPairsUpdateTime() int64
|
||||
SupportsRESTTickerBatchUpdates() bool
|
||||
|
||||
SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error)
|
||||
ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error)
|
||||
CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error)
|
||||
CancelAllExchangeOrders(p pair.CurrencyPair) error
|
||||
GetExchangeOrderInfo(orderID int64) (float64, error)
|
||||
GetExchangeDepositAddress(p pair.CurrencyPair) (string, error)
|
||||
WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error)
|
||||
GetExchangeFundTransferHistory() ([]FundHistory, error)
|
||||
SubmitExchangeOrder(p pair.CurrencyPair, side OrderSide, orderType OrderType, amount, price float64, clientID string) (int64, error)
|
||||
ModifyExchangeOrder(orderID int64, modify ModifyOrder) (int64, error)
|
||||
CancelExchangeOrder(orderID int64) error
|
||||
CancelAllExchangeOrders() error
|
||||
GetExchangeOrderInfo(orderID int64) (OrderDetail, error)
|
||||
GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error)
|
||||
|
||||
WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error)
|
||||
WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error)
|
||||
}
|
||||
|
||||
// SupportsRESTTickerBatchUpdates returns whether or not the
|
||||
@@ -217,6 +253,20 @@ func GetExchangeAssetTypes(exchName string) ([]string, error) {
|
||||
return common.SplitStrings(exch.AssetTypes, ","), nil
|
||||
}
|
||||
|
||||
// GetClientBankAccounts returns banking details associated with
|
||||
// a client for withdrawal purposes
|
||||
func (e *Base) GetClientBankAccounts(exchangeName, withdrawalCurrency string) (config.BankAccount, error) {
|
||||
cfg := config.GetConfig()
|
||||
return cfg.GetClientBankAccounts(exchangeName, withdrawalCurrency)
|
||||
}
|
||||
|
||||
// GetExchangeBankAccounts returns banking details associated with an
|
||||
// exchange for funding purposes
|
||||
func (e *Base) GetExchangeBankAccounts(exchangeName, depositCurrency string) (config.BankAccount, error) {
|
||||
cfg := config.GetConfig()
|
||||
return cfg.GetExchangeBankAccounts(exchangeName, depositCurrency)
|
||||
}
|
||||
|
||||
// CompareCurrencyPairFormats checks and returns whether or not the two supplied
|
||||
// config currency pairs match
|
||||
func CompareCurrencyPairFormats(pair1 config.CurrencyPairFormatConfig, pair2 *config.CurrencyPairFormatConfig) bool {
|
||||
@@ -480,3 +530,82 @@ func (e *Base) UpdateCurrencies(exchangeProducts []string, enabled, force bool)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ModifyOrder is a an order modifyer
|
||||
type ModifyOrder struct {
|
||||
OrderType
|
||||
OrderSide
|
||||
Price float64
|
||||
Amount float64
|
||||
}
|
||||
|
||||
// Format holds exchange formatting
|
||||
type Format struct {
|
||||
ExchangeName string
|
||||
OrderType map[string]string
|
||||
OrderSide map[string]string
|
||||
}
|
||||
|
||||
// Formatting contain a range of exchanges formatting
|
||||
type Formatting []Format
|
||||
|
||||
// formats is a quick formatting list for generic paramaters
|
||||
var formats = Formatting{
|
||||
Format{
|
||||
ExchangeName: "BTC Markets",
|
||||
OrderType: map[string]string{
|
||||
"Limit": "Limit",
|
||||
"Market": "Market",
|
||||
},
|
||||
OrderSide: map[string]string{
|
||||
"Buy": "Bid",
|
||||
"Sell": "Ask",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// OrderType enforces a standard for Ordertypes across the code base
|
||||
type OrderType string
|
||||
|
||||
// Format changes the ordertype to the exchange standard and returns a string
|
||||
func (o OrderType) Format(exchangeName string) string {
|
||||
for _, format := range formats {
|
||||
if format.ExchangeName == exchangeName {
|
||||
return format.OrderType[string(o)]
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// OrderTypeLimit returns an OrderType limit order
|
||||
func OrderTypeLimit() OrderType {
|
||||
return "Limit"
|
||||
}
|
||||
|
||||
// OrderTypeMarket returns an OrderType Market order
|
||||
func OrderTypeMarket() OrderType {
|
||||
return "Market"
|
||||
}
|
||||
|
||||
// OrderSide enforces a standard for OrderSides across the code base
|
||||
type OrderSide string
|
||||
|
||||
// Format changes the ordertype to the exchange standard and returns a string
|
||||
func (o OrderSide) Format(exchangeName string) string {
|
||||
for _, format := range formats {
|
||||
if format.ExchangeName == exchangeName {
|
||||
return format.OrderSide[string(o)]
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// OrderSideBuy returns an OrderSide buy order
|
||||
func OrderSideBuy() OrderSide {
|
||||
return "Buy"
|
||||
}
|
||||
|
||||
// OrderSideSell returns an OrderSide Sell order
|
||||
func OrderSideSell() OrderSide {
|
||||
return "Sell"
|
||||
}
|
||||
|
||||
@@ -161,6 +161,13 @@ func (e *EXMO) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (e *EXMO) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (e *EXMO) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -169,37 +176,51 @@ func (e *EXMO) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exch
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (e *EXMO) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (e *EXMO) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (e *EXMO) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (e *EXMO) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (e *EXMO) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (e *EXMO) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (e *EXMO) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (e *EXMO) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (e *EXMO) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (e *EXMO) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (e *EXMO) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (e *EXMO) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (e *EXMO) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (e *EXMO) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (e *EXMO) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (e *EXMO) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -112,6 +112,13 @@ func (g *Gemini) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbo
|
||||
return orderbook.GetOrderbook(g.Name, p, assetType)
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (g *Gemini) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (g *Gemini) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -120,37 +127,51 @@ func (g *Gemini) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]ex
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (g *Gemini) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (g *Gemini) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (g *Gemini) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (g *Gemini) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (g *Gemini) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (g *Gemini) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (g *Gemini) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (g *Gemini) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (g *Gemini) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (g *Gemini) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (g *Gemini) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (g *Gemini) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (g *Gemini) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (g *Gemini) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (g *Gemini) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (g *Gemini) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -144,6 +144,13 @@ func (h *HitBTC) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (h *HitBTC) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (h *HitBTC) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -152,37 +159,51 @@ func (h *HitBTC) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]ex
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (h *HitBTC) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (h *HitBTC) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (h *HitBTC) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (h *HitBTC) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (h *HitBTC) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (h *HitBTC) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (h *HitBTC) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (h *HitBTC) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (h *HitBTC) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (h *HitBTC) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (h *HitBTC) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (h *HitBTC) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (h *HitBTC) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (h *HitBTC) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (h *HitBTC) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (h *HitBTC) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -149,6 +149,13 @@ func (h *HUOBI) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (h *HUOBI) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (h *HUOBI) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -157,37 +164,51 @@ func (h *HUOBI) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exc
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (h *HUOBI) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (h *HUOBI) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (h *HUOBI) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (h *HUOBI) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (h *HUOBI) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (h *HUOBI) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (h *HUOBI) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (h *HUOBI) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (h *HUOBI) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (h *HUOBI) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (h *HUOBI) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (h *HUOBI) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (h *HUOBI) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (h *HUOBI) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (h *HUOBI) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (h *HUOBI) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -114,6 +114,13 @@ func (i *ItBit) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (i *ItBit) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (i *ItBit) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -122,37 +129,51 @@ func (i *ItBit) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exc
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (i *ItBit) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (i *ItBit) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (i *ItBit) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (i *ItBit) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (i *ItBit) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (i *ItBit) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (i *ItBit) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (i *ItBit) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (i *ItBit) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (i *ItBit) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (i *ItBit) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (i *ItBit) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (i *ItBit) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (i *ItBit) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (i *ItBit) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (i *ItBit) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -185,6 +185,13 @@ func (k *Kraken) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (k *Kraken) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (k *Kraken) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -193,37 +200,51 @@ func (k *Kraken) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]ex
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (k *Kraken) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (k *Kraken) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (k *Kraken) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (k *Kraken) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (k *Kraken) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (k *Kraken) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (k *Kraken) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (k *Kraken) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (k *Kraken) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (k *Kraken) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (k *Kraken) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (k *Kraken) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (k *Kraken) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (k *Kraken) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (k *Kraken) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (k *Kraken) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -124,6 +124,13 @@ func (l *LakeBTC) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (l *LakeBTC) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (l *LakeBTC) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -132,37 +139,51 @@ func (l *LakeBTC) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]e
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (l *LakeBTC) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (l *LakeBTC) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (l *LakeBTC) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (l *LakeBTC) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (l *LakeBTC) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (l *LakeBTC) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (l *LakeBTC) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (l *LakeBTC) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (l *LakeBTC) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (l *LakeBTC) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (l *LakeBTC) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (l *LakeBTC) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (l *LakeBTC) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (l *LakeBTC) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (l *LakeBTC) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (l *LakeBTC) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -133,6 +133,13 @@ func (l *Liqui) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (l *Liqui) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (l *Liqui) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -141,37 +148,51 @@ func (l *Liqui) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exc
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (l *Liqui) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (l *Liqui) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (l *Liqui) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (l *Liqui) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (l *Liqui) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (l *Liqui) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (l *Liqui) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (l *Liqui) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (l *Liqui) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (l *Liqui) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (l *Liqui) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (l *Liqui) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (l *Liqui) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (l *Liqui) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (l *Liqui) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (l *Liqui) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -105,6 +105,13 @@ func (l *LocalBitcoins) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (l *LocalBitcoins) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (l *LocalBitcoins) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -113,37 +120,51 @@ func (l *LocalBitcoins) GetExchangeHistory(p pair.CurrencyPair, assetType string
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (l *LocalBitcoins) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (l *LocalBitcoins) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (l *LocalBitcoins) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (l *LocalBitcoins) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (l *LocalBitcoins) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (l *LocalBitcoins) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (l *LocalBitcoins) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (l *LocalBitcoins) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (l *LocalBitcoins) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (l *LocalBitcoins) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (l *LocalBitcoins) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (l *LocalBitcoins) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (l *LocalBitcoins) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (l *LocalBitcoins) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (l *LocalBitcoins) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (l *LocalBitcoins) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -147,6 +147,13 @@ func (o *OKCoin) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (o *OKCoin) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (o *OKCoin) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -155,37 +162,51 @@ func (o *OKCoin) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]ex
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (o *OKCoin) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (o *OKCoin) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (o *OKCoin) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (o *OKCoin) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (o *OKCoin) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (o *OKCoin) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (o *OKCoin) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (o *OKCoin) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (o *OKCoin) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (o *OKCoin) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (o *OKCoin) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (o *OKCoin) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (o *OKCoin) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (o *OKCoin) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (o *OKCoin) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (o *OKCoin) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -152,6 +152,13 @@ func (o *OKEX) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, errors.New("not implemented")
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (o *OKEX) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (o *OKEX) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -160,37 +167,51 @@ func (o *OKEX) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exch
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (o *OKEX) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (o *OKEX) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (o *OKEX) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (o *OKEX) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (o *OKEX) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (o *OKEX) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (o *OKEX) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (o *OKEX) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (o *OKEX) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (o *OKEX) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (o *OKEX) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (o *OKEX) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (o *OKEX) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (o *OKEX) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (o *OKEX) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (o *OKEX) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -144,6 +144,13 @@ func (po *Poloniex) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (po *Poloniex) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (po *Poloniex) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -152,37 +159,51 @@ func (po *Poloniex) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (po *Poloniex) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (po *Poloniex) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (po *Poloniex) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (po *Poloniex) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (po *Poloniex) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (po *Poloniex) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (po *Poloniex) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (po *Poloniex) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (po *Poloniex) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (po *Poloniex) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (po *Poloniex) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (po *Poloniex) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (po *Poloniex) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (po *Poloniex) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (po *Poloniex) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (po *Poloniex) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -143,6 +143,13 @@ func (w *WEX) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (w *WEX) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (w *WEX) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -151,37 +158,51 @@ func (w *WEX) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]excha
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (w *WEX) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (w *WEX) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (w *WEX) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (w *WEX) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (w *WEX) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (w *WEX) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (w *WEX) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (w *WEX) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (w *WEX) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (w *WEX) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (w *WEX) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (w *WEX) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (w *WEX) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (w *WEX) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (w *WEX) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (w *WEX) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
@@ -125,6 +125,13 @@ func (y *Yobit) GetExchangeAccountInfo() (exchange.AccountInfo, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// GetExchangeFundTransferHistory returns funding history, deposits and
|
||||
// withdrawals
|
||||
func (y *Yobit) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error) {
|
||||
var fundHistory []exchange.FundHistory
|
||||
return fundHistory, errors.New("not supported on exchange")
|
||||
}
|
||||
|
||||
// GetExchangeHistory returns historic trade data since exchange opening.
|
||||
func (y *Yobit) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error) {
|
||||
var resp []exchange.TradeHistory
|
||||
@@ -133,37 +140,51 @@ func (y *Yobit) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exc
|
||||
}
|
||||
|
||||
// SubmitExchangeOrder submits a new order
|
||||
func (y *Yobit) SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) {
|
||||
func (y *Yobit) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// ModifyExchangeOrder will allow of changing orderbook placement and limit to
|
||||
// market conversion
|
||||
func (y *Yobit) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) {
|
||||
func (y *Yobit) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelExchangeOrder cancels an order by its corresponding ID number
|
||||
func (y *Yobit) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (y *Yobit) CancelExchangeOrder(orderID int64) error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// CancelAllExchangeOrders cancels all orders associated with a currency pair
|
||||
func (y *Yobit) CancelAllExchangeOrders(p pair.CurrencyPair) error {
|
||||
func (y *Yobit) CancelAllExchangeOrders() error {
|
||||
return errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeOrderInfo returns information on a current open order
|
||||
func (y *Yobit) GetExchangeOrderInfo(orderID int64) (float64, error) {
|
||||
return 0, errors.New("not yet implemented")
|
||||
func (y *Yobit) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error) {
|
||||
var orderDetail exchange.OrderDetail
|
||||
return orderDetail, errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// GetExchangeDepositAddress returns a deposit address for a specified currency
|
||||
func (y *Yobit) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) {
|
||||
func (y *Yobit) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFunds returns a withdrawal ID when a withdrawal is submitted
|
||||
func (y *Yobit) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) {
|
||||
// WithdrawExchangeCryptoFunds returns a withdrawal ID when a withdrawal is
|
||||
// submitted
|
||||
func (y *Yobit) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToLocalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (y *Yobit) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
// WithdrawExchangeFiatFundsToInternationalBank returns a withdrawal ID when a
|
||||
// withdrawal is submitted
|
||||
func (y *Yobit) WithdrawExchangeFiatFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error) {
|
||||
return "", errors.New("not yet implemented")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user