-
Notifications
You must be signed in to change notification settings - Fork 53
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
Issue with private stark key #116
Comments
check correct way to supply and you could find your |
@rvie17 have you solved the problem? I have the same issue. |
web3.eth.accounts.wallet.add("");// I have put public stark key positionId |
Hi I have issues in createOrder function
Then met the follow error.
What am I wrong? How to solve? |
Hello i'm using the client with node.js and i'm not able to place order. I think i haven't made any error because i can access every other endpoint like /account and /positions. The code and error is below :
const
{ DydxClient } = require('@dydxprotocol/v3-client')const Web3 = require('web3')
const HTTP_HOST = 'https://api.dydx.exchange'
const WS_HOST = 'wss://api.dydx.exchange/v3/ws'
// NOTE: Set up web3 however your prefer to authenticate to your Ethereum account.
web3 = new Web3()
web3.eth.accounts.wallet.add("");// I have put public stark key
async function Place_order(){
client = new DydxClient(HTTP_HOST, { web3 })
const apiCreds = await client.onboarding.recoverDefaultApiCredentials("0x54eBDa43c2ac7Ea6252CcD5dB54EFd53EF4d9Ffd")
client.starkPrivateKey = "";// I don't share it on git
client.apiKeyCredentials = apiCreds;
const order = await client.private.createOrder(
{
positionId:"", // I don't share it on git
market:"DOT-USD",
side: "SELL",
type: "LIMIT",
postOnly: false,
size: "1",
price: "40",
expiration: "2022-12-21T21:30:20.200Z",
limitFee: "0.005"
}
);
console.log(order);
};
Place_order();
`
When i run it i get
(node:22700) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'match' of undefined
at Object.decToBn (/Users/romain/Desktop/GIT/dydx-mm/node_modules/@dydxprotocol/starkex-lib/build/src/lib/util.js:73:14)
at SignableOrder.calculateHash (/Users/romain/Desktop/GIT/dydx-mm/node_modules/@dydxprotocol/starkex-lib/build/src/signable/order.js:64:37)
at SignableOrder.getHashBN (/Users/romain/Desktop/GIT/dydx-mm/node_modules/@dydxprotocol/starkex-lib/build/src/signable/stark-signable.js:29:39)
at SignableOrder.sign (/Users/romain/Desktop/GIT/dydx-mm/node_modules/@dydxprotocol/starkex-lib/build/src/signable/stark-signable.js:37:35)
at Private.createOrder (/Users/romain/Desktop/GIT/dydx-mm/node_modules/@dydxprotocol/v3-client/build/src/modules/private.js:224:42)
at Market_Data (/Users/romain/Desktop/GIT/dydx-mm/PRIVATE/order.js:29:37)
(node:22700) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)(node:22700) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
When i put no stark private key the classic warning appear "there is no starkprivate key warining".
The text was updated successfully, but these errors were encountered: