ftx: drop the legacy unused account request

This commit is contained in:
c9s 2022-03-03 00:20:09 +08:00
parent e9ac08b158
commit 4321cab557

View File

@ -1,47 +0,0 @@
package ftx
import (
"context"
"encoding/json"
"fmt"
)
type accountRequest struct {
*restRequest
}
func (r *accountRequest) Account(ctx context.Context) (accountResponse, error) {
resp, err := r.
Method("GET").
ReferenceURL("api/account").
DoAuthenticatedRequest(ctx)
if err != nil {
return accountResponse{}, err
}
var a accountResponse
if err := json.Unmarshal(resp.Body, &a); err != nil {
return accountResponse{}, fmt.Errorf("failed to unmarshal account response body to json: %w", err)
}
return a, nil
}
func (r *accountRequest) Positions(ctx context.Context) (positionsResponse, error) {
resp, err := r.
Method("GET").
ReferenceURL("api/positions").
DoAuthenticatedRequest(ctx)
if err != nil {
return positionsResponse{}, err
}
var p positionsResponse
if err := json.Unmarshal(resp.Body, &p); err != nil {
return positionsResponse{}, fmt.Errorf("failed to unmarshal position response body to json: %w", err)
}
return p, nil
}