near/near-cli-rs

No way to set ledger-path when adding a key on account creation

Closed this issue · 1 comments

I'll go the long way to explain what is missing (or what I didn't manage to find)

When one is creating an account there are two ways in which the Ledger can be used:

  1. To sign the transaction (I am creating an account and funding it myself)
  2. To add a key from the Ledger to the account being created

1. Sign Transaction (works perfectly)

# Create an account funded by an account I control with my ledger, add a new random keypair
near account create-account fund-myself bob.testnet 1 NEAR autogenerate-new-keypair save-to-keychain sign-as alice.testnet network-config testnet sign-with-ledger --seed-phrase-hd-path 44'/397'/0'/0'/1' send

Notice that here I can use --seed-phrase-hd-path to setup the path to the key

2. Add key from ledger

I would expect to be able to select which path to use from the ledger however:

near account create-account sponsor-by-faucet-service bob.testnet use-ledger --seed-phrase-hd-path "44'/397'/0'/0'/1'" network-config testnet create
# error: unexpected argument '--seed-phrase-hd-path' found
near account create-account sponsor-by-faucet-service bob.testnet use-ledger "44'/397'/0'/0'/1'" network-config testnet create 
# error: unrecognized subcommand '44'/397'/0'/0'/1''

In this case, there is no way to select the path I want to use to add the key to the account

frol commented

Indeed, we missed it somehow.

@FroVolod Please, fix it