Skip to content

Commit

Permalink
wallet:multisig:account:participants displays your identity separately (
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-if authored Sep 27, 2024
1 parent 427c53f commit 0ce965d
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions ironfish-cli/src/commands/wallet/multisig/account/participants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,29 @@ export class MultisigAccountParticipants extends IronfishCommand {
const client = await this.connectRpc()
await ui.checkWalletUnlocked(client)

const response = await client.wallet.multisig.getAccountIdentities({
account: flags.account,
})
const accountIdentities = (
await client.wallet.multisig.getAccountIdentities({
account: flags.account,
})
).content.identities

for (const identity of response.content.identities) {
const participants = (await client.wallet.multisig.getIdentities()).content.identities

const matchingIdentities = participants.filter((identity) =>
accountIdentities.includes(identity.identity),
)

let participant: string | undefined
if (matchingIdentities.length === 1) {
participant = matchingIdentities[0].identity
this.log(`Your identity:\n${participant}`)
this.log('\nOther participating identities:')
}

for (const identity of accountIdentities) {
if (participant && participant === identity) {
continue
}
this.log(identity)
}
}
Expand Down

0 comments on commit 0ce965d

Please sign in to comment.