diff --git a/commands/generate-key.js b/commands/generate-key.js index 2bae5499..37f8ba81 100644 --- a/commands/generate-key.js +++ b/commands/generate-key.js @@ -9,6 +9,10 @@ module.exports = { .option('yolo', { description: 'Do not ask for extra confirmation when using Ledger', type: 'boolean', + }) + .option('seedPhrase', { + description: 'Seed phrase mnemonic', + type: 'string', }), handler: exitOnError(async (argv) => { let near = await require('../utils/connect')(argv); @@ -36,7 +40,7 @@ module.exports = { const { deps: { keyStore } } = near.config; const existingKey = await keyStore.getKey(argv.networkId, argv.accountId); - if (existingKey) { + if (existingKey && !argv.seedPhrase) { console.log(`Account has existing key pair with ${existingKey.publicKey} public key`); return; }