mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-09 07:26:48 +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:
@@ -369,7 +369,6 @@ func (b *Binance) newOrder(api string, o *NewOrderRequest, resp *NewOrderRespons
|
||||
if o.NewOrderRespType != "" {
|
||||
params.Set("newOrderRespType", o.NewOrderRespType)
|
||||
}
|
||||
|
||||
return b.SendAuthHTTPRequest(http.MethodPost, path, params, limitOrder, resp)
|
||||
}
|
||||
|
||||
|
||||
@@ -375,7 +375,12 @@ func (b *Binance) UpdateTicker(p currency.Pair, assetType asset.Item) (*ticker.P
|
||||
|
||||
// FetchTicker returns the ticker for a currency pair
|
||||
func (b *Binance) FetchTicker(p currency.Pair, assetType asset.Item) (*ticker.Price, error) {
|
||||
tickerNew, err := ticker.GetTicker(b.Name, p, assetType)
|
||||
fPair, err := b.FormatExchangeCurrency(p, assetType)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
tickerNew, err := ticker.GetTicker(b.Name, fPair, assetType)
|
||||
if err != nil {
|
||||
return b.UpdateTicker(p, assetType)
|
||||
}
|
||||
@@ -498,10 +503,6 @@ func (b *Binance) GetExchangeHistory(p currency.Pair, assetType asset.Item, time
|
||||
|
||||
// SubmitOrder submits a new order
|
||||
func (b *Binance) 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
|
||||
@@ -527,8 +528,13 @@ func (b *Binance) SubmitOrder(s *order.Submit) (order.SubmitResponse, error) {
|
||||
return submitOrderResponse, errors.New("unsupported order type")
|
||||
}
|
||||
|
||||
fPair, err := b.FormatExchangeCurrency(s.Pair, s.AssetType)
|
||||
if err != nil {
|
||||
return submitOrderResponse, err
|
||||
}
|
||||
|
||||
var orderRequest = NewOrderRequest{
|
||||
Symbol: s.Pair.Base.String() + s.Pair.Quote.String(),
|
||||
Symbol: fPair.String(),
|
||||
Side: sideType,
|
||||
Price: s.Price,
|
||||
Quantity: s.Amount,
|
||||
|
||||
Reference in New Issue
Block a user