Search code examples
nearprotocol

How to add a ledger-enabled account created outside of near wallet to the near wallet?


I have an account which was initially created via near-cli.

I then geneated a ledger key:

near generate-key key --useLedgerKey="44'/397'/0'/0'/2'"

And added it to the account:

near add-key <account_id> <the key from the previous step>

I now open the wallet, click "Access your account", "Ledger Recovery", "Sign in with Ledger", "Sign In".

At this stage it asks me to confirm the public key, though doesn't really show which public key I am approving. I approve it on the ledger.

It asks me for the account id, I enter it. It says "user found".

I confirm, and it errors out with "No accounts are associated with this Ledger device. You must first create an account, then add this Ledger to it to login."

How do I get around it? Am I using the wrong path when generating the key?


Solution

  • Currently, the NEAR Wallet only supports the default Ledger path: "44'/397'/0'/0'/1'"

    If you add the public key that corresponds to this HD path to your account, you should be able to login successfully.

    near generate-key key --useLedgerKey="44'/397'/0'/0'/1'"