diff --git a/suite-common/wallet-core/src/send/sendFormThunks.ts b/suite-common/wallet-core/src/send/sendFormThunks.ts index e6b1fe1bae08..57db6c2b4a67 100644 --- a/suite-common/wallet-core/src/send/sendFormThunks.ts +++ b/suite-common/wallet-core/src/send/sendFormThunks.ts @@ -425,7 +425,7 @@ export const signTransactionThunk = createThunk( ); export const enhancePrecomposedTransactionThunk = createThunk( - `${SEND_MODULE_PREFIX}/prepareTransactionForSigningThunk`, + `${SEND_MODULE_PREFIX}/enhancePrecomposedTransactionThunk`, async ( { transactionFormValues: formValues, @@ -440,7 +440,6 @@ export const enhancePrecomposedTransactionThunk = createThunk( ) => { const device = selectDevice(getState()); const selectedAccountNetwork = getNetwork(selectedAccount.symbol); - if (!device) return rejectWithValue('Device not found'); // native RBF is available since FW 1.9.4/2.3.5 @@ -467,14 +466,19 @@ export const enhancePrecomposedTransactionThunk = createThunk( ...precomposedTransaction, }; - if (formValues.rbfParams && !isCardanoTx(selectedAccount, enhancedPrecomposedTransaction)) { + if (!isCardanoTx(selectedAccount, enhancedPrecomposedTransaction)) { enhancedPrecomposedTransaction.rbf = formValues.options.includes('bitcoinRBF'); - enhancedPrecomposedTransaction.prevTxid = formValues.rbfParams.txid; - enhancedPrecomposedTransaction.feeDifference = new BigNumber(precomposedTransaction.fee) - .minus(formValues.rbfParams.baseFee) - .toFixed(); - enhancedPrecomposedTransaction.useNativeRbf = useNativeRbf; - enhancedPrecomposedTransaction.useDecreaseOutput = hasDecreasedOutput; + + if (formValues.rbfParams) { + enhancedPrecomposedTransaction.prevTxid = formValues.rbfParams.txid; + enhancedPrecomposedTransaction.feeDifference = new BigNumber( + precomposedTransaction.fee, + ) + .minus(formValues.rbfParams.baseFee) + .toFixed(); + enhancedPrecomposedTransaction.useNativeRbf = useNativeRbf; + enhancedPrecomposedTransaction.useDecreaseOutput = hasDecreasedOutput; + } } if ( @@ -494,7 +498,6 @@ export const enhancePrecomposedTransactionThunk = createThunk( enhancedPrecomposedTransaction.isTokenKnown = isTokenKnown; } - // store formValues and transactionInfo in send reducer to be used by TransactionReviewModal dispatch( sendFormActions.storePrecomposedTransaction({