File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
modules/sdk-core/src/bitgo Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -178,15 +178,20 @@ export class StakingWallet implements IStakingWallet {
178178 stakingPrebuildTransaction : StakingPrebuildTransactionResult
179179 ) : Promise < StakingSignedTransaction > {
180180 const reqId = new RequestTracer ( ) ;
181- const keychain = await this . wallet . baseCoin . keychains ( ) . getKeysForSigning ( {
181+ const isBtcUndelegate =
182+ this . wallet . baseCoin . getFamily ( ) === 'btc' &&
183+ stakingPrebuildTransaction . transaction . transactionType . toLowerCase ( ) === 'undelegate_withdraw' ;
184+ const wallet = isBtcUndelegate
185+ ? await this . getDescriptorWallet ( stakingPrebuildTransaction . transaction )
186+ : await this . getWalletForBuildingAndSigning ( ) ;
187+
188+ const keychain = await wallet . baseCoin . keychains ( ) . getKeysForSigning ( {
182189 wallet : this . wallet ,
183190 reqId : reqId ,
184191 } ) ;
185192 return {
186193 transaction : stakingPrebuildTransaction . transaction ,
187- signed : await (
188- await this . getWalletForBuildingAndSigning ( )
189- ) . signTransaction ( {
194+ signed : await wallet . signTransaction ( {
190195 txPrebuild : stakingPrebuildTransaction . result ,
191196 walletPassphrase : signOptions . walletPassphrase ,
192197 keychain : keychain [ 0 ] ,
Original file line number Diff line number Diff line change 11/**
22 * @prettier
33 */
4+ import * as t from 'io-ts' ;
45import assert from 'assert' ;
56import { BigNumber } from 'bignumber.js' ;
67import * as _ from 'lodash' ;
@@ -1935,6 +1936,7 @@ export class Wallet implements IWallet {
19351936 return this . baseCoin . signTransaction ( {
19361937 ...signTransactionParams ,
19371938 prv : this . getUserPrv ( presign as GetUserPrvOptions ) ,
1939+ wallet : this ,
19381940 } ) ;
19391941 }
19401942
@@ -3643,7 +3645,7 @@ export class Wallet implements IWallet {
36433645 return postWithCodec (
36443646 this . bitgo ,
36453647 this . baseCoin . url ( '/wallet/' + this . id ( ) + '/tx/send' ) ,
3646- TxSendBody ,
3648+ t . intersection ( [ TxSendBody , t . partial ( { locktime : t . number } ) ] ) ,
36473649 whitelistedParams
36483650 ) . result ( ) ;
36493651 }
You can’t perform that action at this time.
0 commit comments