@@ -160,12 +160,7 @@ export class StakingWallet implements IStakingWallet {
160160 if ( ! transaction . buildParams ) {
161161 throw Error ( `Staking transaction ${ transaction . id } build params not expanded` ) ;
162162 }
163- const isBtcUndelegate =
164- this . wallet . baseCoin . getFamily ( ) === 'btc' &&
165- transaction . transactionType . toLowerCase ( ) === 'undelegate_withdraw' ;
166- const wallet = isBtcUndelegate
167- ? await this . getDescriptorWallet ( transaction )
168- : await this . getWalletForBuildingAndSigning ( ) ;
163+ const wallet = await this . extractWallet ( transaction ) ;
169164
170165 return {
171166 transaction : transaction ,
@@ -174,6 +169,18 @@ export class StakingWallet implements IStakingWallet {
174169 }
175170 }
176171
172+ private async extractWallet ( transaction : StakingTransaction ) {
173+ return this . isBtcUndelegate ( transaction )
174+ ? await this . getDescriptorWallet ( transaction )
175+ : await this . getWalletForBuildingAndSigning ( ) ;
176+ }
177+
178+ private isBtcUndelegate ( transaction : StakingTransaction ) {
179+ return (
180+ this . wallet . baseCoin . getFamily ( ) === 'btc' && transaction . transactionType . toLowerCase ( ) === 'undelegate_withdraw'
181+ ) ;
182+ }
183+
177184 /**
178185 * Sign the staking transaction
179186 * @param signOptions
@@ -269,7 +276,10 @@ export class StakingWallet implements IStakingWallet {
269276 ) : Promise < StakingSignedTransaction > {
270277 const builtTx = await this . build ( transaction ) ;
271278 // default to verifying a transaction unless explicitly skipped
272- const skipVerification = signOptions . transactionVerificationOptions ?. skipTransactionVerification ?? false ;
279+ // skipping the verification for btc undelegate because it is just single sig
280+ const skipVerification =
281+ ( signOptions . transactionVerificationOptions ?. skipTransactionVerification || this . isBtcUndelegate ( transaction ) ) ??
282+ false ;
273283 if ( ! isStakingTxRequestPrebuildResult ( builtTx . result ) && ! skipVerification ) {
274284 await this . validateBuiltStakingTransaction ( builtTx . transaction , builtTx ) ;
275285 }
0 commit comments