Skip to content

Unable to create a user #209

@0x-General

Description

@0x-General

Hello, I am trying to create a new user with the following code but I'm getting a 400 error.

const keyPairWithYCoordinate = await client.onboarding.deriveStarkKey(address);

const onboardingInformation = await client.onboarding.createUser({
    starkKey: keyPairWithYCoordinate.publicKey,
    starkKeyYCoordinate: keyPairWithYCoordinate.publicKeyYCoordinate,
  }, address);

and I'm getting the following error message:

        [Symbol(kNeedDrain)]: false,
        [Symbol(corked)]: 0,
        [Symbol(kOutHeaders)]: [Object: null prototype] {
          accept: [ 'Accept', 'application/json, text/plain, */*' ],
          'content-type': [ 'Content-Type', 'application/json' ],
          'dydx-signature': [
            'DYDX-SIGNATURE',
            '0xf79cb7a5becb075cd59306f81d8507ec32e94c32fe265e697e8c07abc997bfb1482d5b893bdc8373dcf75abad9d3962585c2605b7f6736cf5b2fda54a9882d8a1c00'
          ],
          'dydx-ethereum-address': [
            'DYDX-ETHEREUM-ADDRESS',
            '0xB517c9f7a1489dF7895BdF6DC4D0F8d84B3B5CC7'
          ],
          'user-agent': [ 'User-Agent', 'axios/0.21.4' ],
          'content-length': [ 'Content-Length', 168 ],
          host: [ 'Host', 'api.stage.dydx.exchange' ]
        },
        [Symbol(kUniqueHeaders)]: null
      },
      data: {
        errors: [ { msg: 'Invalid signature for onboarding request' } ]
      }
    },
    isAxiosError: true,
    toJSON: [Function: toJSON]
  },
  status: 400,
  statusText: 'Bad Request',
  data: { errors: [ { msg: 'Invalid signature for onboarding request' } ] }
}

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions