mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
ftx: remove legacy place order request method
This commit is contained in:
parent
5bbb796e94
commit
2510f14d53
|
@ -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
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user