ftx: print result directly

This commit is contained in:
c9s 2022-03-03 15:04:36 +08:00
parent 86af4d2b40
commit b8f54ed4b9

View File

@ -2,7 +2,6 @@ package ftx
import (
"context"
"encoding/json"
"fmt"
"net/http"
"net/url"
@ -576,11 +575,7 @@ func (e *Exchange) CancelOrders(ctx context.Context, orders ...types.Order) erro
}
if !resp.Success {
v, err := unmarshalResult(resp.Result)
if err != nil {
return err
}
return fmt.Errorf("cancel order failed: %v", v)
return fmt.Errorf("cancel order failed: %s", resp.Result)
}
}
return nil
@ -664,8 +659,3 @@ func (e *Exchange) Transfer(ctx context.Context, coin string, size float64, dest
}
return resp.Result.String(), nil
}
func unmarshalResult(result json.RawMessage) (a interface{}, err error) {
err = json.Unmarshal(result, &a)
return a, err
}