mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-06 15:10:59 +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:
@@ -390,14 +390,18 @@ func (b *Bittrex) SubmitOrder(s *order.Submit) (order.SubmitResponse, error) {
|
||||
errors.New("limit orders only supported on exchange")
|
||||
}
|
||||
|
||||
fPair, err := b.FormatExchangeCurrency(s.Pair, s.AssetType)
|
||||
if err != nil {
|
||||
return submitOrderResponse, err
|
||||
}
|
||||
|
||||
var response UUID
|
||||
var err error
|
||||
if buy {
|
||||
response, err = b.PlaceBuyLimit(s.Pair.String(),
|
||||
response, err = b.PlaceBuyLimit(fPair.String(),
|
||||
s.Amount,
|
||||
s.Price)
|
||||
} else {
|
||||
response, err = b.PlaceSellLimit(s.Pair.String(),
|
||||
response, err = b.PlaceSellLimit(fPair.String(),
|
||||
s.Amount,
|
||||
s.Price)
|
||||
}
|
||||
@@ -512,7 +516,11 @@ func (b *Bittrex) GetActiveOrders(req *order.GetOrdersRequest) ([]order.Detail,
|
||||
|
||||
var currPair string
|
||||
if len(req.Pairs) == 1 {
|
||||
currPair = req.Pairs[0].String()
|
||||
fPair, err := b.FormatExchangeCurrency(req.Pairs[0], asset.Spot)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
currPair = fPair.String()
|
||||
}
|
||||
|
||||
format, err := b.GetPairFormat(asset.Spot, false)
|
||||
@@ -576,7 +584,11 @@ func (b *Bittrex) GetOrderHistory(req *order.GetOrdersRequest) ([]order.Detail,
|
||||
|
||||
var currPair string
|
||||
if len(req.Pairs) == 1 {
|
||||
currPair = req.Pairs[0].String()
|
||||
fPair, err := b.FormatExchangeCurrency(req.Pairs[0], asset.Spot)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
currPair = fPair.String()
|
||||
}
|
||||
|
||||
format, err := b.GetPairFormat(asset.Spot, false)
|
||||
|
||||
Reference in New Issue
Block a user