maxapi: volume, side, market is always required for creating orders

This commit is contained in:
c9s 2021-06-09 02:15:50 +08:00
parent 2da633c221
commit 48c84824cf

View File

@ -499,14 +499,10 @@ func (r *CreateOrderRequest) ClientOrderID(clientOrderID string) *CreateOrderReq
}
func (r *CreateOrderRequest) Do(ctx context.Context) (order *Order, err error) {
var payload = map[string]interface{}{}
if r.market != nil {
payload["market"] = r.market
}
if r.volume != nil {
payload["volume"] = r.volume
var payload = map[string]interface{}{
"market": r.market,
"volume": r.volume,
"side": r.side,
}
if r.price != nil {
@ -517,10 +513,6 @@ func (r *CreateOrderRequest) Do(ctx context.Context) (order *Order, err error) {
payload["stop_price"] = r.stopPrice
}
if r.side != nil {
payload["side"] = r.side
}
if r.orderType != nil {
payload["ord_type"] = r.orderType
}