@@ -161,6 +161,7 @@ export interface SignTransactionOptions extends BaseSignTransactionOptions, Sign
161161 gasPrice ?: number ;
162162 custodianTransactionId ?: string ;
163163 common ?: EthLikeCommon . default ;
164+ walletVersion ?: number ;
164165}
165166
166167export type SignedTransaction = HalfSignedTransaction | FullySignedTransaction ;
@@ -196,6 +197,7 @@ export interface OfflineVaultTxInfo {
196197 halfSigned ?: HalfSignedTransaction ;
197198 feesUsed ?: FeesUsed ;
198199 isEvmBasedCrossChainRecovery ?: boolean ;
200+ walletVersion ?: number ;
199201}
200202
201203interface UnformattedTxInfo {
@@ -1005,6 +1007,9 @@ export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin {
10051007 . transfer ( )
10061008 . coin ( this . staticsCoin ?. name as string )
10071009 . key ( new KeyPairLib ( { prv : params . prv } ) . getKeys ( ) . prv ! ) ;
1010+ if ( params . walletVersion ) {
1011+ txBuilder . walletVersion ( params . walletVersion ) ;
1012+ }
10081013 const transaction = await txBuilder . build ( ) ;
10091014
10101015 const recipients = transaction . outputs . map ( ( output ) => ( { address : output . address , amount : output . value } ) ) ;
@@ -1633,8 +1638,8 @@ export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin {
16331638 txBuilder . walletVersion ( 4 ) ;
16341639 }
16351640
1636- // If gasLimit was not passed as a param, then fetch the gasLimit from Explorer
1637- if ( ! params . gasLimit && ! userKey . startsWith ( 'xpub' ) ) {
1641+ // If gasLimit was not passed as a param or if it is not cold/custody wallet , then fetch the gasLimit from Explorer
1642+ if ( ! params . gasLimit && userKey && ! userKey . startsWith ( 'xpub' ) ) {
16381643 const sendData = txBuilder . getSendData ( ) ;
16391644 gasLimit = await this . getGasLimitFromExternalAPI (
16401645 params . bitgoFeeAddress as string ,
@@ -1671,6 +1676,7 @@ export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin {
16711676 amount : batchExecutionInfo . totalAmount ,
16721677 backupKeyNonce : bitgoFeeAddressNonce ,
16731678 eip1559 : params . eip1559 ,
1679+ ...( txBuilder . getWalletVersion ( ) === 4 ? { walletVersion : txBuilder . getWalletVersion ( ) } : { } ) ,
16741680 } ;
16751681 _ . extend ( response , txInfo ) ;
16761682 response . nextContractSequenceId = response . contractSequenceId ;
@@ -1803,7 +1809,7 @@ export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin {
18031809 txBuilder . walletVersion ( 4 ) ;
18041810 }
18051811
1806- if ( ! params . gasLimit && ! userKey . startsWith ( 'xpub' ) ) {
1812+ if ( ! params . gasLimit && userKey && ! userKey . startsWith ( 'xpub' ) ) {
18071813 const sendData = txBuilder . getSendData ( ) ;
18081814 gasLimit = await this . getGasLimitFromExternalAPI (
18091815 params . bitgoFeeAddress as string ,
@@ -1840,6 +1846,7 @@ export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin {
18401846 amount : txAmount . toString ( ) ,
18411847 backupKeyNonce : bitgoFeeAddressNonce ,
18421848 eip1559 : params . eip1559 ,
1849+ ...( txBuilder . getWalletVersion ( ) === 4 ? { walletVersion : txBuilder . getWalletVersion ( ) } : { } ) ,
18431850 } ;
18441851 _ . extend ( response , txInfo ) ;
18451852 response . nextContractSequenceId = response . contractSequenceId ;
0 commit comments