Skip to content

Commit

Permalink
Upgrade ledger:backup cmd to use ledger action (#5527)
Browse files Browse the repository at this point in the history
  • Loading branch information
NullSoldier authored Oct 9, 2024
1 parent 04d5cdb commit 28b2127
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions ironfish-cli/src/commands/wallet/multisig/ledger/backup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import { IronfishCommand } from '../../../../command'
import { LedgerMultiSigner } from '../../../../ledger'
import * as ui from '../../../../ui'

export class MultisigLedgerBackup extends IronfishCommand {
static description = `show encrypted multisig keys from a Ledger device`

async start(): Promise<void> {
const ledger = new LedgerMultiSigner()
try {
await ledger.connect()
} catch (e) {
if (e instanceof Error) {
this.error(e.message)
} else {
throw e
}
}

const encryptedKeys = await ledger.dkgBackupKeys()
const encryptedKeys = await ui.ledger({
ledger,
message: 'Getting Ledger Keys',
approval: true,
action: () => ledger.dkgBackupKeys(),
})

this.log()
this.log('Encrypted Ledger Multisig Backup:')
Expand Down

0 comments on commit 28b2127

Please sign in to comment.