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

Viewed 192

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?

3 Answers

Unfortunately this is not supported yet. Current Ledger support in wallet is limited to use 44'/397'/0'/0'/1' HD key path. This is going to change in later releases.

In the meanwhile if you want to stake your tokens from multiple such accounts you might find this tool useful: http://multistaker.near.org/

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'"

The NEAR wallet now supports the updated flow which allows you to create your account using any ledger path from the CLI (as per your question), fund that account or implicit account (the 64 char nonsense string) with at least 1 NEAR and then add that account to your NEAR wallet. You can't add without funding the account since it takes NEAR to make the add.

To add to the wallet, on the wallet dropdown select "Import Account" and then click "Advanced Options" to bring up the HD path selector. Select the right HD path, plug in the ledger and good to go.

ATM Chrome isn't working with the wallet as per this post but firefox does.

Related