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

I got double order when calling createOrder #7

Open
lvntruong opened this issue Nov 7, 2021 · 3 comments
Open

I got double order when calling createOrder #7

lvntruong opened this issue Nov 7, 2021 · 3 comments

Comments

@lvntruong
Copy link

I got double order when calling the function createOrder

This is my code

const createOrder = (price, amount, side) => {
  const api = new GateApi.SpotApi(client);
  const order = new Order(); // Order |
  order.price = price; // string | Order price
  order.amount = amount; // string | Order amount
  order.side = side; // string | Order side
  order.currencyPair = currencyPair; // string | Currency pair
  api.createOrder(order).then(
    (value) =>
      console.log("API called successfully. Returned data: ", value.body),
    (error) => console.error(error)
  );
};

Screen Shot 2021-11-07 at 22 56 18

Thanks!

@adam-hom
Copy link

Hi Le Vu Nhat Truong, I don't know the answer unfortunately for You question, I hope getio will respond finally.

Could You please how You pass auth credentials to login user in getio? Because I don't see any example in documentation, it is somehow passed to ApiClient?

Thank You for information!

@lvntruong
Copy link
Author

Hi @adam-hom ,
You can refer this code:

const GateApi = require("gate-api");
const client = new GateApi.ApiClient();

client.setApiKeySecret(
  "YOUR_API_KEY",
  "YOUR_SECRET"
);

const api = new GateApi.SpotApi(client);

@ghost
Copy link

ghost commented May 11, 2022

Hi @lvntruong Could it be that you are accidentally calling the order function twice?

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

2 participants