Cancel order wrapper wrapup (#214)

* Reimplements order cancellation for alphapoint, anx, binance, bitfinex, bithumb, bitmex, bitstamp, bittrex,  btcmarkets, coinbasepro, coinut, exmo, gateio, gemini, gitbtc, huobi, hadax, itbit, kraken, lakebtc, liqui, okcoin, okex, poloniex, wex, yobit and zb wrappers. Adds new order cancellation struct type. Updates old tests that pointed to the wrong unrenamed methods

* Sets up tests for all supported exchanges. request.DoRequest errors when response status is not 200

* Updates alphapoint, coinut, hitbtc, lakebtc cancel order implementations. Finishes testing

* Adds localbitcoin cancel order wrapper support

* Fixes tests and build issues. Adds WexIssue flag for tests

* Changes CancelOrder signature to only return error. Allows exchange to format currency pairs with delimiters
This commit is contained in:
Scott
2018-11-30 16:20:34 +11:00
committed by Adrian Gallagher
parent d039593b67
commit 458aab301e
72 changed files with 1771 additions and 384 deletions

View File

@@ -89,6 +89,15 @@ type FeeBuilder struct {
Amount float64
}
// OrderCancellation type requred when requesting to cancel an order
type OrderCancellation struct {
AccountID string
OrderID string
CurrencyPair pair.CurrencyPair
WalletAddress string
Side OrderSide
}
// Definitions for each type of withdrawal method for a given exchange
const (
// No withdraw
@@ -161,7 +170,7 @@ type TradeHistory struct {
// OrderDetail holds order detail data
type OrderDetail struct {
Exchange string
ID int64
ID string
BaseCurrency string
QuoteCurrency string
OrderSide string
@@ -254,7 +263,7 @@ type IBotExchange interface {
GetFundingHistory() ([]FundHistory, error)
SubmitOrder(p pair.CurrencyPair, side OrderSide, orderType OrderType, amount, price float64, clientID string) (SubmitOrderResponse, error)
ModifyOrder(orderID int64, modify ModifyOrder) (int64, error)
CancelOrder(orderID int64) error
CancelOrder(order OrderCancellation) error
CancelAllOrders() error
GetOrderInfo(orderID int64) (OrderDetail, error)
GetDepositAddress(cryptocurrency pair.CurrencyItem) (string, error)