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

getActiveOrders #178

Open
snowkidind opened this issue Apr 2, 2022 · 8 comments
Open

getActiveOrders #178

snowkidind opened this issue Apr 2, 2022 · 8 comments

Comments

@snowkidind
Copy link

async getActiveOrders(

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,
        });
    }
@zoo475698058
Copy link

When I test v3/active-orders, return "MSG ":"Unauthorized". Why

@snowkidind
Copy link
Author

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')
  }
}

@zoo475698058
Copy link

您需要初始化客户端。

查看我在 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

@shaw-matt
Copy link

Ever figure this out @zoo475698058? Running into the exact same issue. The documentation for this client is very poor.

@CryptoWizardsNet
Copy link

Same issue with Invalid Signature. We need example code for this in the docs or in the GitHub examples folder.

@CryptoWizardsNet
Copy link

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?

@CryptoWizardsNet
Copy link

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.

@kungla
Copy link

kungla commented Dec 20, 2022

+1 to last comment - really hard to figure that out.

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

No branches or pull requests

5 participants