mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
ftx: print result directly
This commit is contained in:
parent
86af4d2b40
commit
b8f54ed4b9
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user