We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 have traded on dydx.exchange before I run this code. This code always showed me below:
AxiosServerError: 401: Unauthorized - { "errors": [ { "msg": "Unauthorized" } ] }
// I tried to call the cancel function and it work. await client.private.cancelAllOrders()
please help me with any ideas.
const main = async () => { let client = new DydxClient(HTTP_HOST, { web3: web3, apiTimeout: 3000, networkId: 1, }) client.starkPrivateKey = await client.onboarding.deriveStarkKey(address) client.apiKeyCredentials = await client.onboarding.recoverDefaultApiCredentials(address) const timestamp = new Date().toISOString() const account_response = await client.private.getAccount(address) const position_id = account_response['account']['positionId'] let OrderResponseObject = await client.private.createOrder( { market: 'ETH-USD', side: 'BUY', type: 'LIMIT', postOnly: false, size: '0.01', price: '1000', limitFee: '0.015', expiration: '2022-12-21T21:30:20.200Z', // cancelId: position_id, // signature: signature, }, position_id, // required for creating the order signature ) console.log(OrderResponseObject) } main();
The text was updated successfully, but these errors were encountered:
Try specifying timeInForce: 'GTT', without that you might get unauthorized back
timeInForce: 'GTT'
Sorry, something went wrong.
I am so glad to get your reply. I will try later because of another question...
I have the same problem in testing Create A New Order, how do I test if the API signature is correct
No branches or pull requests
I have traded on dydx.exchange before I run this code.
This code always showed me below:
please help me with any ideas.
The text was updated successfully, but these errors were encountered: