mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-05 07:26:47 +00:00
Exchanges: Include format pair in wrapper functions and test for formatting issues via tool wrapper issues (#582)
* Adds formatting of pair within binance wrapper, adds return of error from cli.ShowCommmandHelp * Add formatting function to submit order wrapper functions * Remove superfluous functionality * Updated exchange wrapper issues to create a disruptive pair to see which exchanges require attention, updates currency code generation and matching * reinstated format check, fixed tests * fixed niterinos * fix test * fix spelling mistake * make html file more aesthetic * Add missing format pairs * add formatting to pair for BTC Markets func * fix spelling
This commit is contained in:
@@ -337,27 +337,27 @@ func (b *Bithumb) GetExchangeHistory(p currency.Pair, assetType asset.Item, time
|
||||
// SubmitOrder submits a new order
|
||||
// TODO: Fill this out to support limit orders
|
||||
func (b *Bithumb) SubmitOrder(s *order.Submit) (order.SubmitResponse, error) {
|
||||
if err := s.Validate(); err != nil {
|
||||
return order.SubmitResponse{}, err
|
||||
}
|
||||
|
||||
var submitOrderResponse order.SubmitResponse
|
||||
if err := s.Validate(); err != nil {
|
||||
return submitOrderResponse, err
|
||||
}
|
||||
|
||||
fPair, err := b.FormatExchangeCurrency(s.Pair, s.AssetType)
|
||||
if err != nil {
|
||||
return submitOrderResponse, err
|
||||
}
|
||||
|
||||
var orderID string
|
||||
var err error
|
||||
if s.Side == order.Buy {
|
||||
var result MarketBuy
|
||||
result, err = b.MarketBuyOrder(s.Pair.Base.String(), s.Amount)
|
||||
result, err = b.MarketBuyOrder(fPair.Base.String(), s.Amount)
|
||||
if err != nil {
|
||||
return submitOrderResponse, err
|
||||
}
|
||||
orderID = result.OrderID
|
||||
} else if s.Side == order.Sell {
|
||||
var result MarketSell
|
||||
result, err = b.MarketSellOrder(s.Pair.Base.String(), s.Amount)
|
||||
result, err = b.MarketSellOrder(fPair.Base.String(), s.Amount)
|
||||
if err != nil {
|
||||
return submitOrderResponse, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user