dydxprotocol/v3-client

onboarding: Cannot find name 'ethereumAddress'

Closed this issue · 2 comments

 const onboardingInformation: {
    apiKey: ApiKeyCredentials,
    user: UserResponseObject,
    account: AccountResponseObject,
  } = await client.onboarding.createUser({ starkKey: '', starkKeyYCoordinate: '', country: '' }, ethereumAddress: '');
  

typescript telling me this.. how is it fixed?

Add context code here that will show how you got this message

The contract for create user is .createUser(object, string) so you cannot put ethereumAddress: '' in the second param.

Here is the working code::

client.onboarding.createUser(
                                {
                                    starkKey: starKey.publicKey,
                                    starkKeyYCoordinate: starKey.publicKeyYCoordinate,
                                    country: 'SG'
                                },
                                address,
                                null,
                                SigningMethod.MetaMask
                            ).then((responseFromNewUser) => {
                                return new Promise((resolve, reject) => resolve(responseFromNewUser.apiKey))
                            })