diff --git a/pkg/exchange/ftx/rest.go b/pkg/exchange/ftx/rest.go index 493bbd382..691c4b6a3 100644 --- a/pkg/exchange/ftx/rest.go +++ b/pkg/exchange/ftx/rest.go @@ -55,9 +55,7 @@ func (r *restRequest) Transfer(ctx context.Context, p TransferPayload) (transfer type restRequest struct { *walletRequest *orderRequest - *accountRequest *marketRequest - *fillsRequest *transferRequest key, secret string @@ -88,9 +86,7 @@ func newRestRequest(c *http.Client, baseURL *url.URL) *restRequest { p: make(map[string]interface{}), } - r.fillsRequest = &fillsRequest{restRequest: r} r.marketRequest = &marketRequest{restRequest: r} - r.accountRequest = &accountRequest{restRequest: r} r.walletRequest = &walletRequest{restRequest: r} r.orderRequest = &orderRequest{restRequest: r} return r diff --git a/pkg/exchange/ftx/rest_fills_request.go b/pkg/exchange/ftx/rest_fills_request.go deleted file mode 100644 index b08fe3e65..000000000 --- a/pkg/exchange/ftx/rest_fills_request.go +++ /dev/null @@ -1,50 +0,0 @@ -package ftx - -import ( - "context" - "encoding/json" - "fmt" - "strconv" - "time" -) - -type fillsRequest struct { - *restRequest -} - -func (r *fillsRequest) Fills(ctx context.Context, market string, since, until time.Time, limit int64, orderByASC bool) (fillsResponse, error) { - q := make(map[string]string) - if len(market) > 0 { - q["market"] = market - } - if since != (time.Time{}) { - q["start_time"] = strconv.FormatInt(since.Unix(), 10) - } - if until != (time.Time{}) { - q["end_time"] = strconv.FormatInt(until.Unix(), 10) - } - if limit > 0 { - q["limit"] = strconv.FormatInt(limit, 10) - } - // default is descending - if orderByASC { - q["order"] = "asc" - } - resp, err := r. - Method("GET"). - ReferenceURL("api/fills"). - Query(q). - DoAuthenticatedRequest(ctx) - - if err != nil { - return fillsResponse{}, err - } - - var f fillsResponse - if err := json.Unmarshal(resp.Body, &f); err != nil { - fmt.Println("??? => ", resp.Body) - return fillsResponse{}, fmt.Errorf("failed to unmarshal fills response body to json: %w", err) - } - - return f, nil -}