Merge pull request #1083 from c9s/fix/maxapi/group-id

FIX: add group id on submit order API
This commit is contained in:
Yo-An Lin 2023-03-06 17:23:01 +08:00 committed by GitHub
commit 4e6614e711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -482,6 +482,11 @@ func (e *Exchange) SubmitOrder(ctx context.Context, order types.SubmitOrder) (cr
OrderType(orderType).
ClientOrderID(clientOrderID)
if o.GroupID > 0 {
// TODO: MAX API only support 0 ~ 2^31-1 (2147483647)
req.GroupID(strconv.FormatUint(uint64(o.GroupID), 10))
}
switch o.Type {
case types.OrderTypeStopLimit, types.OrderTypeLimit, types.OrderTypeLimitMaker:
var priceInString string

View File

@ -22,5 +22,5 @@ type CancelWalletOrderAllRequest struct {
walletType WalletType `param:"walletType,slug,required"`
side *string `param:"side"`
market *string `param:"market"`
groupID *uint32 `param:"groupID"`
groupID *uint32 `param:"group_id"`
}

View File

@ -64,12 +64,12 @@ func (c *CancelWalletOrderAllRequest) GetParameters() (map[string]interface{}, e
params["market"] = market
} else {
}
// check groupID field -> json key groupID
// check groupID field -> json key group_id
if c.groupID != nil {
groupID := *c.groupID
// assign parameter of groupID
params["groupID"] = groupID
params["group_id"] = groupID
} else {
}