Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Implement the TestNet api for CreateOrderService #385

Closed
saintmalik opened this issue Jun 26, 2022 · 7 comments
Closed

How to Implement the TestNet api for CreateOrderService #385

saintmalik opened this issue Jun 26, 2022 · 7 comments

Comments

@saintmalik
Copy link

saintmalik commented Jun 26, 2022

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)

@adshao
Copy link
Owner

adshao commented Jun 27, 2022

Hi, what is the error return?

@saintmalik
Copy link
Author

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

@adshao
Copy link
Owner

adshao commented Jul 1, 2022

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()

@saintmalik
Copy link
Author

Thanks, it worked, but how do i check reponse of request validity?

@adshao
Copy link
Owner

adshao commented Jul 1, 2022

Thanks, it worked, but how do i check reponse of request validity?

what do you exactly mean for 'response'?

@saintmalik
Copy link
Author

just like there was fmt.Println(order), does that means i will check for error instead

@xyq-c-cpp
Copy link
Collaborator

No response for a long time, close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants