-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
报错信息:
"json: cannot unmarshal array into Go value of type gateapi.Position"
代码:
func (base *GateService) FuturesPosition(currencyPair string) (gateapi.Position, error) {
client := gateapi.NewAPIClient(gateapi.NewConfiguration())
ctx := context.WithValue(context.Background(),
gateapi.ContextGateAPIV4,
gateapi.GateAPIV4{
Key: base.Config.ApiKey,
Secret: base.Config.ApiSecret,
},
)
settle := "usdt" // string - Settle currency
// currencyPair = ""
result, _, err := client.FuturesApi.GetPosition(ctx, settle, currencyPair)
if err != nil {
if e, ok := err.(gateapi.GateAPIError); ok {
return result, errors.New(e.Message)
} else {
return result, err
}
}
return result, nil
}合约:ARB_USDT
Metadata
Metadata
Assignees
Labels
No labels