ftx: remove legacy place order request method

This commit is contained in:
c9s 2022-03-03 11:42:40 +08:00
parent 5bbb796e94
commit 2510f14d53

View File

@ -1,10 +1,6 @@
package ftx package ftx
import ( import (
"context"
"encoding/json"
"fmt"
"github.com/c9s/bbgo/pkg/fixedpoint" "github.com/c9s/bbgo/pkg/fixedpoint"
) )
@ -37,30 +33,3 @@ type PlaceOrderPayload struct {
ClientID string ClientID string
} }
func (r *orderRequest) PlaceOrder(ctx context.Context, p PlaceOrderPayload) (orderResponse, error) {
resp, err := r.
Method("POST").
ReferenceURL("api/orders").
Payloads(map[string]interface{}{
"market": p.Market,
"side": p.Side,
"price": p.Price,
"type": p.Type,
"size": p.Size,
"reduceOnly": p.ReduceOnly,
"ioc": p.IOC,
"postOnly": p.PostOnly,
"clientId": p.ClientID,
}).
DoAuthenticatedRequest(ctx)
if err != nil {
return orderResponse{}, err
}
var o orderResponse
if err := json.Unmarshal(resp.Body, &o); err != nil {
return orderResponse{}, fmt.Errorf("failed to unmarshal order response body to json: %w", err)
}
return o, nil
}