exchanges/binance/coinm: fix order submission (#819)

* exchanges/binance: proper arguments order when calling Binance.FuturesNewOrder

* exchanges/binance: adapt FuturesOrderPlaceData (+ unmarshaling) to latest coin/delivery futures API

* exchanges/binance: introduce futuresNewOrderRequest and use it to pass order parameters for coin margined futures

* exchanges/binance: test json unmarshaling of FuturesOrderPlaceData

* exchanges/binance: reorder fields as per docs, include missing fields (also in tests)

* exchanges/binance/coinm: use constants instead of hard coded strings (also fixes linting)

* exchanges/binance/coinm: pass futuresNewOrderRequest by reference

* exchanges/binance/coinm: expose FuturesNewOrderRequest

* exchanges/binance/coinm: do not explicitly assign default values fields of FuturesNewOrderRequest

* exchanges/binance/coinm: document FuturesNewOrderRequest

* exchanges/binance/coinm: expose all fields of FuturesNewOrderRequest

* exchanges/binance/coinm: expose fields of FuturesNewOrderRequest

* exchange/binance/coin: order submission: add support for priceProtect

Co-authored-by: Yordan Miladinov <jordanmiladinov@gmail.bg>
This commit is contained in:
Yordan Miladinov
2021-11-10 01:24:30 +02:00
committed by GitHub
parent da8a9f8372
commit 417b2a77ef
5 changed files with 169 additions and 48 deletions

View File

@@ -903,7 +903,17 @@ func TestFuturesNewOrder(t *testing.T) {
if !areTestAPIKeysSet() || !canManipulateRealOrders {
t.Skip("skipping test: api keys not set or canManipulateRealOrders set to false")
}
_, err := b.FuturesNewOrder(context.Background(), currency.NewPairWithDelimiter("BTCUSD", "PERP", "_"), "BUY", "", "LIMIT", "GTC", "", "", "", "", 1, 1, 0, 0, 0, false)
_, err := b.FuturesNewOrder(
context.Background(),
&FuturesNewOrderRequest{
Symbol: currency.NewPairWithDelimiter("BTCUSD", "PERP", "_"),
Side: "BUY",
OrderType: "LIMIT",
TimeInForce: "GTC",
Quantity: 1,
Price: 1,
},
)
if err != nil {
t.Error(err)
}