@@ -26,11 +26,11 @@ import { EBackupCategory } from '../../store/types/backup';
26
26
import { ETransactionSpeed } from '../../store/types/settings' ;
27
27
import { reduceValue } from '../helpers' ;
28
28
import i18n from '../i18n' ;
29
+ import { getSpendingBalance } from '../lightning' ;
29
30
import { EAvailableNetwork } from '../networks' ;
30
31
import { showToast } from '../notifications' ;
31
32
import { TRANSACTION_DEFAULTS } from './constants' ;
32
33
import {
33
- getBalance ,
34
34
getOnChainWallet ,
35
35
getOnChainWalletElectrum ,
36
36
getOnChainWalletTransaction ,
@@ -294,7 +294,7 @@ export const getMaxSendAmount = ({
294
294
295
295
if ( method === 'lightning' ) {
296
296
// lightning transaction
297
- const { spendingBalance } = getBalance ( ) ;
297
+ const spendingBalance = getSpendingBalance ( ) ;
298
298
const fee = getEstimatedRoutingFee ( spendingBalance ) ;
299
299
const amount = spendingBalance - fee ;
300
300
const maxAmount = { amount, fee } ;
@@ -351,8 +351,7 @@ export const sendMax = async ({
351
351
// TODO: Re-work lightning transaction invoices once beignet migration is complete.
352
352
// Handle max toggle for lightning invoice
353
353
if ( paymentMethod === 'lightning' ) {
354
- const { spendingBalance } = getBalance ( ) ;
355
-
354
+ const spendingBalance = getSpendingBalance ( ) ;
356
355
const fee = getEstimatedRoutingFee ( spendingBalance ) ;
357
356
const amount = spendingBalance - fee ;
358
357
@@ -457,7 +456,7 @@ export const updateSendAmount = ({
457
456
458
457
if ( paymentMethod === 'lightning' ) {
459
458
// lightning transaction
460
- const { spendingBalance } = getBalance ( ) ;
459
+ const spendingBalance = getSpendingBalance ( ) ;
461
460
462
461
if ( amount > spendingBalance ) {
463
462
return err ( i18n . t ( 'wallet:send_amount_error_balance' ) ) ;
0 commit comments