@@ -26,11 +26,11 @@ import { EBackupCategory } from '../../store/types/backup';
2626import { ETransactionSpeed } from '../../store/types/settings' ;
2727import { reduceValue } from '../helpers' ;
2828import i18n from '../i18n' ;
29+ import { getSpendingBalance } from '../lightning' ;
2930import { EAvailableNetwork } from '../networks' ;
3031import { showToast } from '../notifications' ;
3132import { TRANSACTION_DEFAULTS } from './constants' ;
3233import {
33- getBalance ,
3434 getOnChainWallet ,
3535 getOnChainWalletElectrum ,
3636 getOnChainWalletTransaction ,
@@ -294,7 +294,7 @@ export const getMaxSendAmount = ({
294294
295295 if ( method === 'lightning' ) {
296296 // lightning transaction
297- const { spendingBalance } = getBalance ( ) ;
297+ const spendingBalance = getSpendingBalance ( ) ;
298298 const fee = getEstimatedRoutingFee ( spendingBalance ) ;
299299 const amount = spendingBalance - fee ;
300300 const maxAmount = { amount, fee } ;
@@ -351,8 +351,7 @@ export const sendMax = async ({
351351 // TODO: Re-work lightning transaction invoices once beignet migration is complete.
352352 // Handle max toggle for lightning invoice
353353 if ( paymentMethod === 'lightning' ) {
354- const { spendingBalance } = getBalance ( ) ;
355-
354+ const spendingBalance = getSpendingBalance ( ) ;
356355 const fee = getEstimatedRoutingFee ( spendingBalance ) ;
357356 const amount = spendingBalance - fee ;
358357
@@ -457,7 +456,7 @@ export const updateSendAmount = ({
457456
458457 if ( paymentMethod === 'lightning' ) {
459458 // lightning transaction
460- const { spendingBalance } = getBalance ( ) ;
459+ const spendingBalance = getSpendingBalance ( ) ;
461460
462461 if ( amount > spendingBalance ) {
463462 return err ( i18n . t ( 'wallet:send_amount_error_balance' ) ) ;
0 commit comments