near/near-cli-rs

Allow an easy way to export account

Closed this issue · 0 comments

frol commented

I am thinking about having near account export-account that would reveal the private key and seed phrase (if available) stored in the keychain.

Similarly to near account import-account there will be several ways to export:

  • near account export-account <account-id> using-web-wallet network-config testnet
  • near account export-account <account-id> using-seed-phrase network-config testnet
  • near account export-account <account-id> using-private-key network-config testnet

For web wallet option, near CLI should generate a URL for auto-import of access key and open it in the browser:

https://WALLET_URL/auto-import-secret-key#YOUR_ACCOUNT_ID/YOUR_PRIVATE_KEY

For other options, just print the access key.

Given that a single account might have several access keys, let's follow the same strategy as for signing transactions (fetch the list of access keys from RPC, and export first full access key that is available locally)