go-binance
go-binance copied to clipboard
How to Implement the TestNet api for CreateOrderService
Trust everyone is good, adding .Test(context.Background()) is not working
order, err := client.NewCreateOrderService().Symbol(model.Symbol).
Side(binance.SideTypeBuy).Type(binance.OrderTypeLimit).
TimeInForce(binance.TimeInForceTypeGTC).Quantity("5").
Price("200").Do(context.Background())
if err != nil {
fmt.Println("gdgh", err)
return
}
fmt.Println(order)
Hi, what is the error return?
Hi, what is the error return?
assignment mismatch: 2 variables but client.NewCreateOrderService().Symbol(model.Symbol).Side(binance.SideTypeBuy).Type(binance.OrderTypeLimit).TimeInForce(binance.TimeInForceTypeGTC).Quantity("5").Price("200").Test returns 1 value
Hi, what is the error return?
assignment mismatch: 2 variables but client.NewCreateOrderService().Symbol(model.Symbol).Side(binance.SideTypeBuy).Type(binance.OrderTypeLimit).TimeInForce(binance.TimeInForceTypeGTC).Quantity("5").Price("200").Test returns 1 value
as the message said, Test()
only return 1 value which is error
, I think you use the statement:
order, err := client.NewCreateOrderService()....Test()
please try to fix it like this:
err := client.NewCreateOrderService()....Test()
Thanks, it worked, but how do i check reponse of request validity?
Thanks, it worked, but how do i check reponse of request validity?
what do you exactly mean for 'response'?
just like there was fmt.Println(order), does that means i will check for error instead