Apply federation to lightning balances if available

This commit is contained in:
Tony Giorgio
2023-12-21 17:03:13 -06:00
committed by Tony Giorgio
parent e1cfae2f7f
commit 3bd1d03377
3 changed files with 11 additions and 3 deletions

View File

@@ -67,7 +67,9 @@ function InboundWarning() {
const network = state.mutiny_wallet?.get_network() as Network;
const threshold = network === "bitcoin" ? 100000 : 10000;
const balance = state.balance?.lightning || 0n;
const balance =
(state.balance?.lightning || 0n) +
(state.balance?.federation || 0n);
if (balance === 0n && amount < threshold) {
return i18n.t("settings.gift.receive_too_small", {

View File

@@ -73,7 +73,9 @@ export function MethodChooser(props: {
const [store, _actions] = useMegaStore();
const methods = createMemo(() => {
const lnBalance = store.balance?.lightning || 0n;
const lnBalance =
(store.balance?.lightning || 0n) +
(store.balance?.federation || 0n);
const onchainBalance =
(store.balance?.confirmed || 0n) +
(store.balance?.unconfirmed || 0n);

View File

@@ -116,7 +116,11 @@ function PlusCTA() {
const hasEnough = () => {
if (!planDetails()) return false;
return (state.balance?.lightning || 0n) > planDetails().amount_sat;
return (
(state.balance?.lightning || 0n) +
(state.balance?.federation || 0n) >
planDetails().amount_sat
);
};
return (