@@ -51,6 +51,7 @@ export class DkgRound3Command extends IronfishCommand {
51
51
ledger : Flags . boolean ( {
52
52
default : false ,
53
53
description : 'Perform operation with a ledger device' ,
54
+ exclusive : [ 'participantName' ] ,
54
55
} ) ,
55
56
createdAt : Flags . integer ( {
56
57
description :
@@ -64,15 +65,10 @@ export class DkgRound3Command extends IronfishCommand {
64
65
const client = await this . connectRpc ( )
65
66
await ui . checkWalletUnlocked ( client )
66
67
67
- let participantName = flags . participantName
68
- if ( ! participantName ) {
69
- participantName = await ui . multisigSecretPrompt ( client )
70
- }
71
-
72
68
let round2SecretPackage = flags . round2SecretPackage
73
69
if ( ! round2SecretPackage ) {
74
70
round2SecretPackage = await ui . inputPrompt (
75
- ` Enter the round 2 encrypted secret package for participant ${ participantName } ` ,
71
+ ' Enter your round 2 encrypted secret package' ,
76
72
true ,
77
73
)
78
74
}
@@ -127,9 +123,14 @@ export class DkgRound3Command extends IronfishCommand {
127
123
}
128
124
129
125
if ( flags . ledger ) {
126
+ let accountName = flags . accountName
127
+ if ( ! accountName ) {
128
+ accountName = await ui . inputPrompt ( 'Enter a name for the account' , true )
129
+ }
130
+
130
131
await this . performRound3WithLedger (
131
132
client ,
132
- participantName ,
133
+ accountName ,
133
134
round1PublicPackages ,
134
135
round2PublicPackages ,
135
136
round2SecretPackage ,
@@ -138,6 +139,11 @@ export class DkgRound3Command extends IronfishCommand {
138
139
return
139
140
}
140
141
142
+ let participantName = flags . participantName
143
+ if ( ! participantName ) {
144
+ participantName = await ui . multisigSecretPrompt ( client )
145
+ }
146
+
141
147
const response = await client . wallet . multisig . dkg . round3 ( {
142
148
participantName,
143
149
accountName : flags . accountName ,
@@ -155,7 +161,7 @@ export class DkgRound3Command extends IronfishCommand {
155
161
156
162
async performRound3WithLedger (
157
163
client : RpcClient ,
158
- participantName : string ,
164
+ accountName : string ,
159
165
round1PublicPackagesStr : string [ ] ,
160
166
round2PublicPackagesStr : string [ ] ,
161
167
round2SecretPackage : string ,
@@ -238,7 +244,7 @@ export class DkgRound3Command extends IronfishCommand {
238
244
identity,
239
245
} ,
240
246
version : ACCOUNT_SCHEMA_VERSION ,
241
- name : participantName ,
247
+ name : accountName ,
242
248
spendingKey : null ,
243
249
createdAt : null ,
244
250
ledger : true ,
@@ -249,7 +255,7 @@ export class DkgRound3Command extends IronfishCommand {
249
255
client ,
250
256
encodeAccountImport ( accountImport , AccountFormat . Base64Json ) ,
251
257
this . logger ,
252
- participantName ,
258
+ accountName ,
253
259
accountCreatedAt ,
254
260
)
255
261
0 commit comments