diff --git a/ironfish-cli/src/commands/wallet/multisig/dkg/create.ts b/ironfish-cli/src/commands/wallet/multisig/dkg/create.ts index c150ce4854..c291a97c8a 100644 --- a/ironfish-cli/src/commands/wallet/multisig/dkg/create.ts +++ b/ironfish-cli/src/commands/wallet/multisig/dkg/create.ts @@ -301,15 +301,18 @@ export class DkgCreateCommand extends IronfishCommand { async performRound1WithLedger( ledger: LedgerMultiSigner, - client: RpcClient, - participantName: string, identities: string[], minSigners: number, ): Promise<{ round1: { secretPackage: string; publicPackage: string } }> { - const identityResponse = await client.wallet.multisig.getIdentity({ name: participantName }) - const identity = identityResponse.content.identity + const identity = ( + await ui.ledger({ + ledger, + message: 'Getting Ledger Identity', + action: () => ledger.dkgGetIdentity(0), + }) + ).toString('hex') if (!identities.includes(identity)) { identities.push(identity) @@ -351,13 +354,7 @@ export class DkgCreateCommand extends IronfishCommand { }) if (ledger) { - return await this.performRound1WithLedger( - ledger, - client, - participantName, - identities, - minSigners, - ) + return await this.performRound1WithLedger(ledger, identities, minSigners) } this.log('\nPerforming DKG Round 1...') diff --git a/ironfish-cli/src/commands/wallet/multisig/dkg/round1.ts b/ironfish-cli/src/commands/wallet/multisig/dkg/round1.ts index 3edae07d70..379153c8b0 100644 --- a/ironfish-cli/src/commands/wallet/multisig/dkg/round1.ts +++ b/ironfish-cli/src/commands/wallet/multisig/dkg/round1.ts @@ -1,7 +1,6 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -import { RpcClient } from '@ironfish/sdk' import { Flags } from '@oclif/core' import { IronfishCommand } from '../../../../command' import { RemoteFlags } from '../../../../flags' @@ -72,7 +71,7 @@ export class DkgRound1Command extends IronfishCommand { } if (flags.ledger) { - await this.performRound1WithLedger(client, participantName, identities, minSigners) + await this.performRound1WithLedger(identities, minSigners) return } @@ -94,16 +93,16 @@ export class DkgRound1Command extends IronfishCommand { this.log('Send the round 1 public package to each participant') } - async performRound1WithLedger( - client: RpcClient, - participantName: string, - identities: string[], - minSigners: number, - ): Promise { + async performRound1WithLedger(identities: string[], minSigners: number): Promise { const ledger = new LedgerMultiSigner() - const identityResponse = await client.wallet.multisig.getIdentity({ name: participantName }) - const identity = identityResponse.content.identity + const identity = ( + await ui.ledger({ + ledger, + message: 'Getting Ledger Identity', + action: () => ledger.dkgGetIdentity(0), + }) + ).toString('hex') if (!identities.includes(identity)) { identities.push(identity)