v3-client
v3-client copied to clipboard
getActiveOrders
https://github.com/dydxprotocol/v3-client/blob/16b171f49b0822b7c51d8d9290576a208893250a/src/modules/private.ts#L399
Documentation states that id should be optional and it is not here.
async getActiveOrders(market, side, id, genericParams = {}) {
return this._get('active-orders', {
market,
side,
id, // is not optional
...genericParams,
});
}
When I test v3/active-orders, return "MSG ":"Unauthorized". Why
You need to initialize the client.
Check out the gist I made at https://gist.github.com/snowkidind/9545ca43962dc1251a226031ea797b06
const init = async () => {
try {
const apiCreds1 = await client1.onboarding.recoverDefaultApiCredentials(signer1.address)
client1.apiKeyCredentials = apiCreds1
const keyPairWithYCoordinate1 = await client1.onboarding.deriveStarkKey(signer1.address)
client1.starkPrivateKey = keyPairWithYCoordinate1.privateKey
inited = true
} catch (error) {
console.log(error)
console.log('WARNING: An error occurred initializing dydx client')
}
}
您需要初始化客户端。
查看我在 https://gist.github.com/snowkidind/9545ca43962dc1251a226031ea797b06上制作的要点
const init = async () => { try { const apiCreds1 = await client1.onboarding.recoverDefaultApiCredentials(signer1.address) client1.apiKeyCredentials = apiCreds1 const keyPairWithYCoordinate1 = await client1.onboarding.deriveStarkKey(signer1.address) client1.starkPrivateKey = keyPairWithYCoordinate1.privateKey inited = true } catch (error) { console.log(error) console.log('WARNING: An error occurred initializing dydx client') } }
Thank you, my problem has been solved because of secretKey URl safe processing. Now I'm trying to deal with Invalid Signature for Order
Ever figure this out @zoo475698058? Running into the exact same issue. The documentation for this client is very poor.
Same issue with Invalid Signature. We need example code for this in the docs or in the GitHub examples folder.
Ever figure this out @zoo475698058? Running into the exact same issue. The documentation for this client is very poor.
@shaw-matt I have tried everything to figure this out and still failing. Have you had any success yet?
I have finally figured it out. When using the Stark private key, you do not need a signature.
This was a very painful process to find out and needed to go right into the Python code. Luckily there was a comment which gave it away in the Python repository.
+1 to last comment - really hard to figure that out.