mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 15:10:46 +00:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user