Closed malware8 closed 6 months ago
func (c Client) GetTransferableCoin(ctx context.Context, auth Authorization, request GetTransferableCoinRequest) (GetTransferableCoinResponse, error) { client := sdk.NewBybitHttpClient(auth.ApiKey, auth.SecKey, sdk.WithBaseURL(sdk.TESTNET))
result := &GetTransferableCoinResponse{}
params := map[string]interface{}{
"fromAccountType": request.FromAccountType,
"toAccountType": request.ToAccountType,
}
response, err := client.NewAssetService(params).GetTransferableCoin(ctx, sdk.WithRecvWindow(c.cfg.WithRecvWindow))
if err != nil {
logrus.Error("Bybit SDK - get transferable coin failed with error: ", err.Error())
if strings.TrimSpace(response.RetMsg) != "" {
return nil, NewBybitError(response.RetMsg)
}
return nil, err
}
err = result.FromInterface(response.Result)
if err != nil {
return nil, err
}
return result, nil
}
but in the programming language "Python" it works fine
fix it and publish on v1.0.2
The documentation shows the fields I need to submit. But "API" responds that the fields are invalid.
Link to documentation
`func (c Client) GetTransferableCoin(ctx context.Context, auth Authorization, request GetTransferableCoinRequest) (GetTransferableCoinResponse, error) { client := sdk.NewBybitHttpClient(auth.ApiKey, auth.SecKey, sdk.WithBaseURL(sdk.TESTNET)) params := map[string]interface{}{"fromAccountType": request.FromAccountType, "toAccountType": request.ToAccountType}
}`
log output: bybit.api.go2024/02/09 16:58:58 response body: {"retCode":131203,"retMsg":"request parameter err: fromAccountType invalid",