From 422a4548c1d00e808cfb4936b25ce24028ebfcc7 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Thu, 1 Feb 2024 05:20:04 -0600 Subject: [PATCH 1/5] Add lightning sweep functionality to fedimint --- src/components/BalanceBox.tsx | 45 ++++--- src/components/Failure.tsx | 86 +++++++++++++ src/components/index.ts | 1 + src/i18n/en/translations.ts | 8 ++ src/router.tsx | 4 +- src/routes/Send.tsx | 37 +----- src/routes/SwapLightning.tsx | 228 ++++++++++++++++++++++++++++++++++ src/routes/index.ts | 1 + 8 files changed, 359 insertions(+), 51 deletions(-) create mode 100644 src/components/Failure.tsx create mode 100644 src/routes/SwapLightning.tsx diff --git a/src/components/BalanceBox.tsx b/src/components/BalanceBox.tsx index b0ddba93..f1755f28 100644 --- a/src/components/BalanceBox.tsx +++ b/src/components/BalanceBox.tsx @@ -94,21 +94,38 @@ export function BalanceBox(props: { loading?: boolean }) { }>
-
-
- -
-
- +
+
+
+ +
+
+ +
+ 0n}> +
+ + swaplightning + +
+
diff --git a/src/components/Failure.tsx b/src/components/Failure.tsx new file mode 100644 index 00000000..7c4465bb --- /dev/null +++ b/src/components/Failure.tsx @@ -0,0 +1,86 @@ +import { MutinyInvoice } from "@mutinywallet/mutiny-wasm"; +import { A, useNavigate, useSearchParams } from "@solidjs/router"; +import { + createEffect, + createMemo, + createResource, + createSignal, + JSX, + Match, + onMount, + Show, + Suspense, + Switch +} from "solid-js"; + +import bolt from "~/assets/icons/bolt.svg"; +import chain from "~/assets/icons/chain.svg"; +import close from "~/assets/icons/close.svg"; +import { + ActivityDetailsModal, + AmountEditable, + AmountFiat, + AmountSats, + BackPop, + Button, + DefaultMain, + Fee, + FeeDisplay, + HackActivityType, + InfoBox, + LabelCircle, + LoadingShimmer, + MegaCheck, + MegaClock, + MegaEx, + MethodChoice, + MutinyWalletGuard, + NavBar, + showToast, + SimpleInput, + SmallHeader, + StringShower, + SuccessModal, + UnstyledBackPop, + VStack +} from "~/components"; +import { useI18n } from "~/i18n/context"; +import { ParsedParams } from "~/logic/waila"; +import { useMegaStore } from "~/state/megaStore"; +import { eify, vibrateSuccess } from "~/utils"; + +export function Failure(props: { reason: string }) { + const i18n = useI18n(); + + return ( + + + +

+ {i18n.t("send.payment_pending")} +

+ + {i18n.t("send.payment_pending_description")} + +
+ + +

+ {i18n.t("send.error_channel_reserves")} +

+ + {i18n.t("send.error_channel_reserves_explained")}{" "} + {i18n.t("common.why")} + +
+ + +

+ {props.reason} +

+
+
+ ); +} diff --git a/src/components/index.ts b/src/components/index.ts index 0bd0e280..3b6a779f 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -36,6 +36,7 @@ export * from "./Restart"; export * from "./ResyncOnchain"; export * from "./SeedWords"; export * from "./SetupErrorDisplay"; +export * from "./Failure"; export * from "./ShareCard"; export * from "./Toaster"; export * from "./NostrActivity"; diff --git a/src/i18n/en/translations.ts b/src/i18n/en/translations.ts index c9c9eff4..89ccc6bb 100644 --- a/src/i18n/en/translations.ts +++ b/src/i18n/en/translations.ts @@ -600,6 +600,14 @@ export default { connecting: "Connecting...", confirm_swap: "Confirm Swap" }, + swap_lightning: { + insufficient_funds: "You don't have enough funds to swap to lightning", + header: "Swap to Lightning", + completed: "Swap Completed", + sats_added: "+{{amount}} sats have been added to your Lightning balance", + sats_fee: "+{{amount}} sats fee", + confirm_swap: "Confirm Swap" + }, reload: { mutiny_update: "Mutiny Update", new_version_description: diff --git a/src/router.tsx b/src/router.tsx index 8eea78a7..557331ee 100644 --- a/src/router.tsx +++ b/src/router.tsx @@ -15,7 +15,8 @@ import { Scanner, Search, Send, - Swap + Swap, + SwapLightning } from "~/routes"; import { Admin, @@ -101,6 +102,7 @@ export function Router() { + diff --git a/src/routes/Send.tsx b/src/routes/Send.tsx index 4d4164e8..14c76f0f 100644 --- a/src/routes/Send.tsx +++ b/src/routes/Send.tsx @@ -25,6 +25,7 @@ import { BackPop, Button, DefaultMain, + Failure, Fee, FeeDisplay, HackActivityType, @@ -190,42 +191,6 @@ function DestinationItem(props: { ); } -function Failure(props: { reason: string }) { - const i18n = useI18n(); - - return ( - - - -

- {i18n.t("send.payment_pending")} -

- - {i18n.t("send.payment_pending_description")} - -
- - -

- {i18n.t("send.error_channel_reserves")} -

- - {i18n.t("send.error_channel_reserves_explained")}{" "} - {i18n.t("common.why")} - -
- - -

- {props.reason} -

-
-
- ); -} - export function Send() { const [state, actions] = useMegaStore(); const navigate = useNavigate(); diff --git a/src/routes/SwapLightning.tsx b/src/routes/SwapLightning.tsx new file mode 100644 index 00000000..bae39674 --- /dev/null +++ b/src/routes/SwapLightning.tsx @@ -0,0 +1,228 @@ +import { createForm, required } from "@modular-forms/solid"; +import { FedimintSweepResult } from "@mutinywallet/mutiny-wasm"; +import { useNavigate } from "@solidjs/router"; +import { + createMemo, + createResource, + createSignal, + For, + Match, + Show, + Switch +} from "solid-js"; + +import { + ActivityDetailsModal, + AmountEditable, + AmountFiat, + BackLink, + Button, + Card, + DefaultMain, + Failure, + Fee, + HackActivityType, + InfoBox, + LargeHeader, + MegaCheck, + MegaEx, + MutinyWalletGuard, + NavBar, + showToast, + SuccessModal, + TextField, + VStack +} from "~/components"; +import { useI18n } from "~/i18n/context"; +import { Network } from "~/logic/mutinyWalletSetup"; +import { useMegaStore } from "~/state/megaStore"; +import { eify, vibrateSuccess } from "~/utils"; + +type SweepResultDetails = { + result?: FedimintSweepResult; + failure_reason?: string; +}; + +export function SwapLightning() { + const [state, _actions] = useMegaStore(); + const navigate = useNavigate(); + const i18n = useI18n(); + + const [amountSats, setAmountSats] = createSignal(0n); + + const [loading, setLoading] = createSignal(false); + + // Details Modal + const [detailsOpen, setDetailsOpen] = createSignal(false); + const [detailsKind, setDetailsKind] = createSignal(); + const [detailsId, setDetailsId] = createSignal(""); + + const [sweepResult, setSweepResult] = createSignal(); + + function resetState() { + setAmountSats(0n); + setLoading(false); + setSweepResult(undefined); + } + + const handleSwap = async () => { + if (canSwap()) { + try { + setLoading(true); + + if (isMax()) { + const result = + await state.mutiny_wallet?.sweep_federation_balance( + undefined + ); + + setSweepResult({ result: result }); + } else { + const result = + await state.mutiny_wallet?.sweep_federation_balance( + amountSats() + ); + + setSweepResult({ result: result }); + } + + await vibrateSuccess(); + } catch (e) { + const error = eify(e); + setSweepResult({ failure_reason: error.message }); + console.error(e); + } finally { + setLoading(false); + } + } + }; + + const canSwap = () => { + const balance = state.balance?.federation || 0n; + const network = state.mutiny_wallet?.get_network() as Network; + + return amountSats() <= balance; + }; + + const amountWarning = () => { + if (amountSats() === 0n || !!sweepResult() || loading()) { + return undefined; + } + + if (amountSats() > (state.balance?.federation || 0n)) { + return i18n.t("swap.insufficient_funds"); + } + + return undefined; + }; + + function calculateMaxFederation() { + return state.balance?.federation ?? 0n; + } + + const maxFederationBalance = createMemo(() => { + return calculateMaxFederation(); + }); + + const isMax = createMemo(() => { + return amountSats() === calculateMaxFederation(); + }); + + return ( + + + + {i18n.t("swap.header")} + { + if (!open) resetState(); + }} + onConfirm={() => { + resetState(); + navigate("/"); + }} + > + + + + + + + + + +
+

+ {i18n.t("swap.completed")} +

+

+ {i18n.t("swap.sats_added", { + amount: Number( + sweepResult()?.result?.amount + ).toLocaleString() + })} +

+
+ +
+
+
+ +
+
+
+
+
+ + + 0n}> + {amountWarning()} + + +
+ + + +
+ + + + ); +} diff --git a/src/routes/index.ts b/src/routes/index.ts index 923dec31..a47f92d4 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -7,4 +7,5 @@ export * from "./Receive"; export * from "./Scanner"; export * from "./Send"; export * from "./Swap"; +export * from "./SwapLightning"; export * from "./Search"; From 36effd52f99fd1654b2562e4943d1a7a9f060a4f Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Thu, 1 Feb 2024 11:13:13 -0600 Subject: [PATCH 2/5] Show the channel fee warning from federation swap --- src/components/ReceiveWarnings.tsx | 7 ++- src/i18n/en/translations.ts | 3 +- src/routes/Receive.tsx | 5 +- src/routes/SwapLightning.tsx | 90 +++++++++++++++++++++++------- 4 files changed, 81 insertions(+), 24 deletions(-) diff --git a/src/components/ReceiveWarnings.tsx b/src/components/ReceiveWarnings.tsx index 13564623..aa4d2dd1 100644 --- a/src/components/ReceiveWarnings.tsx +++ b/src/components/ReceiveWarnings.tsx @@ -5,7 +5,10 @@ import { FeesModal } from "~/components/MoreInfoModal"; import { useI18n } from "~/i18n/context"; import { useMegaStore } from "~/state/megaStore"; -export function ReceiveWarnings(props: { amountSats: string | bigint }) { +export function ReceiveWarnings(props: { + amountSats: string | bigint; + from_fedi_to_ln: boolean; +}) { const i18n = useI18n(); const [state, _actions] = useMegaStore(); @@ -26,7 +29,7 @@ export function ReceiveWarnings(props: { amountSats: string | bigint }) { }); const warningText = () => { - if (state.federations?.length !== 0) { + if (state.federations?.length !== 0 && props.from_fedi_to_ln != true) { return undefined; } if ((state.balance?.lightning || 0n) === 0n) { diff --git a/src/i18n/en/translations.ts b/src/i18n/en/translations.ts index 89ccc6bb..c7062fcb 100644 --- a/src/i18n/en/translations.ts +++ b/src/i18n/en/translations.ts @@ -606,7 +606,8 @@ export default { completed: "Swap Completed", sats_added: "+{{amount}} sats have been added to your Lightning balance", sats_fee: "+{{amount}} sats fee", - confirm_swap: "Confirm Swap" + confirm_swap: "Confirm Swap", + preview_swap: "Preview Swap Fee" }, reload: { mutiny_update: "Mutiny Update", diff --git a/src/routes/Receive.tsx b/src/routes/Receive.tsx index 51360623..6a347fb3 100644 --- a/src/routes/Receive.tsx +++ b/src/routes/Receive.tsx @@ -377,7 +377,10 @@ export function Receive() { setAmountSats={setAmount} onSubmit={getQr} /> - +
diff --git a/src/routes/SwapLightning.tsx b/src/routes/SwapLightning.tsx index bae39674..3e4bb6a0 100644 --- a/src/routes/SwapLightning.tsx +++ b/src/routes/SwapLightning.tsx @@ -21,13 +21,14 @@ import { DefaultMain, Failure, Fee, - HackActivityType, + FeeDisplay, InfoBox, LargeHeader, MegaCheck, MegaEx, MutinyWalletGuard, NavBar, + ReceiveWarnings, showToast, SuccessModal, TextField, @@ -49,18 +50,20 @@ export function SwapLightning() { const i18n = useI18n(); const [amountSats, setAmountSats] = createSignal(0n); + const [feeSats, setFeeSats] = createSignal(0n); + const [maxFederationBalanceBeforeSwap, setMaxFederationBalanceBeforeSwap] = + createSignal(0n); + const [previewFee, setPreviewFee] = createSignal(false); const [loading, setLoading] = createSignal(false); - // Details Modal - const [detailsOpen, setDetailsOpen] = createSignal(false); - const [detailsKind, setDetailsKind] = createSignal(); - const [detailsId, setDetailsId] = createSignal(""); - const [sweepResult, setSweepResult] = createSignal(); function resetState() { setAmountSats(0n); + setFeeSats(0n); + setPreviewFee(false); + setMaxFederationBalanceBeforeSwap(0n); setLoading(false); setSweepResult(undefined); } @@ -110,7 +113,7 @@ export function SwapLightning() { } if (amountSats() > (state.balance?.federation || 0n)) { - return i18n.t("swap.insufficient_funds"); + return i18n.t("swap_lightning.insufficient_funds"); } return undefined; @@ -128,11 +131,47 @@ export function SwapLightning() { return amountSats() === calculateMaxFederation(); }); + const feeIsSet = createMemo(() => { + return feeSats() !== 0n; + }); + + const feeEstimate = async () => { + if (canSwap()) { + try { + setLoading(true); + if (isMax()) { + const fee = + await state.mutiny_wallet?.estimate_sweep_federation_fee( + undefined + ); + setFeeSats(fee); + setMaxFederationBalanceBeforeSwap(calculateMaxFederation()); + setPreviewFee(true); + } else { + const fee = + await state.mutiny_wallet?.estimate_sweep_federation_fee( + amountSats() + ); + setFeeSats(fee); + setMaxFederationBalanceBeforeSwap(calculateMaxFederation()); + setPreviewFee(true); + } + } catch (e) { + console.error(e); + return undefined; + } finally { + setLoading(false); + } + } + + return undefined; + }; + return ( - {i18n.t("swap.header")} + {i18n.t("swap_lightning.header")} - - -

- {i18n.t("swap.completed")} + {i18n.t("swap_lightning.completed")}

- {i18n.t("swap.sats_added", { + {i18n.t("swap_lightning.sats_added", { amount: Number( sweepResult()?.result?.amount ).toLocaleString() @@ -205,6 +236,17 @@ export function SwapLightning() { } ]} /> + + + + 0n}> {amountWarning()} @@ -214,10 +256,18 @@ export function SwapLightning() {

From 0a36b58c5bc736d1eb310e73f79de21d5baff799 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Mon, 5 Feb 2024 17:39:52 +0000 Subject: [PATCH 3/5] fedi swap edit and "stages" --- src/components/Failure.tsx | 51 +----- src/i18n/en/translations.ts | 3 + src/routes/Send.tsx | 8 +- src/routes/SwapLightning.tsx | 290 ++++++++++++++++++++--------------- 4 files changed, 175 insertions(+), 177 deletions(-) diff --git a/src/components/Failure.tsx b/src/components/Failure.tsx index 7c4465bb..6aefbbf9 100644 --- a/src/components/Failure.tsx +++ b/src/components/Failure.tsx @@ -1,53 +1,8 @@ -import { MutinyInvoice } from "@mutinywallet/mutiny-wasm"; -import { A, useNavigate, useSearchParams } from "@solidjs/router"; -import { - createEffect, - createMemo, - createResource, - createSignal, - JSX, - Match, - onMount, - Show, - Suspense, - Switch -} from "solid-js"; +import { A } from "@solidjs/router"; +import { Match, Switch } from "solid-js"; -import bolt from "~/assets/icons/bolt.svg"; -import chain from "~/assets/icons/chain.svg"; -import close from "~/assets/icons/close.svg"; -import { - ActivityDetailsModal, - AmountEditable, - AmountFiat, - AmountSats, - BackPop, - Button, - DefaultMain, - Fee, - FeeDisplay, - HackActivityType, - InfoBox, - LabelCircle, - LoadingShimmer, - MegaCheck, - MegaClock, - MegaEx, - MethodChoice, - MutinyWalletGuard, - NavBar, - showToast, - SimpleInput, - SmallHeader, - StringShower, - SuccessModal, - UnstyledBackPop, - VStack -} from "~/components"; +import { InfoBox, MegaClock, MegaEx } from "~/components"; import { useI18n } from "~/i18n/context"; -import { ParsedParams } from "~/logic/waila"; -import { useMegaStore } from "~/state/megaStore"; -import { eify, vibrateSuccess } from "~/utils"; export function Failure(props: { reason: string }) { const i18n = useI18n(); diff --git a/src/i18n/en/translations.ts b/src/i18n/en/translations.ts index c7062fcb..0335fc85 100644 --- a/src/i18n/en/translations.ts +++ b/src/i18n/en/translations.ts @@ -603,7 +603,10 @@ export default { swap_lightning: { insufficient_funds: "You don't have enough funds to swap to lightning", header: "Swap to Lightning", + header_preview: "Preview Swap", completed: "Swap Completed", + too_small: + "Invalid amount entered. You need to swap at least 100k sats.", sats_added: "+{{amount}} sats have been added to your Lightning balance", sats_fee: "+{{amount}} sats fee", confirm_swap: "Confirm Swap", diff --git a/src/routes/Send.tsx b/src/routes/Send.tsx index 14c76f0f..6438ce51 100644 --- a/src/routes/Send.tsx +++ b/src/routes/Send.tsx @@ -1,5 +1,5 @@ import { MutinyInvoice, TagItem } from "@mutinywallet/mutiny-wasm"; -import { A, useNavigate, useSearchParams } from "@solidjs/router"; +import { useNavigate, useSearchParams } from "@solidjs/router"; import { createEffect, createMemo, @@ -33,8 +33,6 @@ import { LabelCircle, LoadingShimmer, MegaCheck, - MegaClock, - MegaEx, MethodChoice, MutinyWalletGuard, NavBar, @@ -236,8 +234,8 @@ export function Send() { ? sentDetails()?.txid : undefined : sentDetails() - ? sentDetails()?.payment_hash - : undefined; + ? sentDetails()?.payment_hash + : undefined; const kind = sentDetails()?.txid ? "OnChain" : "Lightning"; console.log("Opening details modal: ", paymentTxId, kind); diff --git a/src/routes/SwapLightning.tsx b/src/routes/SwapLightning.tsx index 3e4bb6a0..2250256a 100644 --- a/src/routes/SwapLightning.tsx +++ b/src/routes/SwapLightning.tsx @@ -1,23 +1,13 @@ -import { createForm, required } from "@modular-forms/solid"; import { FedimintSweepResult } from "@mutinywallet/mutiny-wasm"; import { useNavigate } from "@solidjs/router"; -import { - createMemo, - createResource, - createSignal, - For, - Match, - Show, - Switch -} from "solid-js"; +import { createMemo, createSignal, Match, Show, Switch } from "solid-js"; import { - ActivityDetailsModal, AmountEditable, AmountFiat, + BackButton, BackLink, Button, - Card, DefaultMain, Failure, Fee, @@ -25,17 +15,13 @@ import { InfoBox, LargeHeader, MegaCheck, - MegaEx, MutinyWalletGuard, NavBar, ReceiveWarnings, - showToast, SuccessModal, - TextField, VStack } from "~/components"; import { useI18n } from "~/i18n/context"; -import { Network } from "~/logic/mutinyWalletSetup"; import { useMegaStore } from "~/state/megaStore"; import { eify, vibrateSuccess } from "~/utils"; @@ -49,11 +35,14 @@ export function SwapLightning() { const navigate = useNavigate(); const i18n = useI18n(); + const [stage, setStage] = createSignal<"start" | "preview" | "done">( + "start" + ); + const [amountSats, setAmountSats] = createSignal(0n); const [feeSats, setFeeSats] = createSignal(0n); const [maxFederationBalanceBeforeSwap, setMaxFederationBalanceBeforeSwap] = createSignal(0n); - const [previewFee, setPreviewFee] = createSignal(false); const [loading, setLoading] = createSignal(false); @@ -62,49 +51,46 @@ export function SwapLightning() { function resetState() { setAmountSats(0n); setFeeSats(0n); - setPreviewFee(false); setMaxFederationBalanceBeforeSwap(0n); setLoading(false); setSweepResult(undefined); + setStage("start"); } const handleSwap = async () => { - if (canSwap()) { - try { - setLoading(true); + try { + setLoading(true); + setFeeEstimateWarning(undefined); - if (isMax()) { - const result = - await state.mutiny_wallet?.sweep_federation_balance( - undefined - ); + if (isMax()) { + const result = + await state.mutiny_wallet?.sweep_federation_balance( + undefined + ); - setSweepResult({ result: result }); - } else { - const result = - await state.mutiny_wallet?.sweep_federation_balance( - amountSats() - ); + setSweepResult({ result: result }); + } else { + const result = + await state.mutiny_wallet?.sweep_federation_balance( + amountSats() + ); - setSweepResult({ result: result }); - } - - await vibrateSuccess(); - } catch (e) { - const error = eify(e); - setSweepResult({ failure_reason: error.message }); - console.error(e); - } finally { - setLoading(false); + setSweepResult({ result: result }); } + + await vibrateSuccess(); + } catch (e) { + const error = eify(e); + setSweepResult({ failure_reason: error.message }); + console.error(e); + } finally { + setLoading(false); } }; const canSwap = () => { const balance = state.balance?.federation || 0n; - const network = state.mutiny_wallet?.get_network() as Network; - - return amountSats() <= balance; + return amountSats() > 0n && amountSats() <= balance; }; const amountWarning = () => { @@ -135,43 +121,53 @@ export function SwapLightning() { return feeSats() !== 0n; }); + const [feeEstimateWarning, setFeeEstimateWarning] = createSignal(); + const feeEstimate = async () => { - if (canSwap()) { - try { - setLoading(true); - if (isMax()) { - const fee = - await state.mutiny_wallet?.estimate_sweep_federation_fee( - undefined - ); - setFeeSats(fee); - setMaxFederationBalanceBeforeSwap(calculateMaxFederation()); - setPreviewFee(true); - } else { - const fee = - await state.mutiny_wallet?.estimate_sweep_federation_fee( - amountSats() - ); - setFeeSats(fee); - setMaxFederationBalanceBeforeSwap(calculateMaxFederation()); - setPreviewFee(true); - } - } catch (e) { - console.error(e); - return undefined; - } finally { - setLoading(false); + try { + setLoading(true); + setFeeEstimateWarning(undefined); + + const fee = + await state.mutiny_wallet?.estimate_sweep_federation_fee( + isMax() ? undefined : amountSats() + ); + + if (fee) { + setFeeSats(fee); } - } + setMaxFederationBalanceBeforeSwap(calculateMaxFederation()); - return undefined; + setStage("preview"); + } catch (e) { + console.error(e); + setFeeEstimateWarning(i18n.t("swap_lightning.too_small")); + } finally { + setLoading(false); + } }; return ( - - {i18n.t("swap_lightning.header")} + + + + + {i18n.t("swap_lightning.header")} + + + + setStage("start")} + showOnDesktop + /> + + {i18n.t("swap_lightning.header_preview")} + + + - + @@ -221,55 +217,101 @@ export function SwapLightning() {
- - - - - - - 0n}> - {amountWarning()} - - -
- - - + + + + + + 0n} + > + + {amountWarning()} + + + + + {feeEstimateWarning()} + + + +
+ + + + + + + + + + + 0n} + > + + {amountWarning()} + + + +
+ + + + +
From 187d26cb678690bf7aa01dc52c1ad1023c5ad789 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Tue, 6 Feb 2024 04:45:51 -0600 Subject: [PATCH 4/5] Bump to v0.5.8 --- android/app/build.gradle | 4 ++-- ios/App/App.xcodeproj/project.pbxproj | 4 ++-- package.json | 4 ++-- pnpm-lock.yaml | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 1f55a5a1..8a8948f1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "com.mutinywallet.mutinywallet" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 48 - versionName "0.5.7" + versionCode 49 + versionName "0.5.8" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj index 77a7daf1..0337b0fb 100644 --- a/ios/App/App.xcodeproj/project.pbxproj +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -360,7 +360,7 @@ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 1.5.7; + MARKETING_VERSION = 1.5.8; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; PRODUCT_BUNDLE_IDENTIFIER = com.mutinywallet.mutiny; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -387,7 +387,7 @@ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 1.5.7; + MARKETING_VERSION = 1.5.8; PRODUCT_BUNDLE_IDENTIFIER = com.mutinywallet.mutiny; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/package.json b/package.json index 8a708c44..52fbf3fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mutiny-wallet", - "version": "0.5.7", + "version": "0.5.8", "license": "MIT", "packageManager": "pnpm@8.6.6", "scripts": { @@ -55,7 +55,7 @@ "@kobalte/core": "^0.9.8", "@kobalte/tailwindcss": "^0.5.0", "@modular-forms/solid": "^0.18.1", - "@mutinywallet/mutiny-wasm": "0.5.7", + "@mutinywallet/mutiny-wasm": "0.5.8", "@mutinywallet/waila-wasm": "^0.2.6", "@solid-primitives/upload": "^0.0.111", "@solidjs/meta": "^0.29.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 56ad47bc..1093e522 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,8 +54,8 @@ importers: specifier: ^0.18.1 version: 0.18.1(solid-js@1.8.5) '@mutinywallet/mutiny-wasm': - specifier: 0.5.7 - version: 0.5.7 + specifier: 0.5.8 + version: 0.5.8 '@mutinywallet/waila-wasm': specifier: ^0.2.6 version: 0.2.6 @@ -2570,8 +2570,8 @@ packages: solid-js: 1.8.5 dev: false - /@mutinywallet/mutiny-wasm@0.5.7: - resolution: {integrity: sha512-swz7lFC86b8zWAc5gDz4I4O+66va2aOS9sHOkKhG0SEMp2vVti11Y4lpN0aJVuCy8Wx4FNZZLSxro00pYyf8kQ==} + /@mutinywallet/mutiny-wasm@0.5.8: + resolution: {integrity: sha512-Bwx3sMXuMiE876Kk1FI9uZoJMPkHc5RGFmUHsFeSMMGDxC2YLO5N5ilaIIig89ZbAYcBi7Y1N4Nq/2nZFcM+9A==} dev: false /@mutinywallet/waila-wasm@0.2.6: From 835236c78d4830eb6008f48259ebde1c0ed13b01 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Tue, 6 Feb 2024 04:48:04 -0600 Subject: [PATCH 5/5] Fix prettier --- src/i18n/en/translations.ts | 3 ++- src/routes/Send.tsx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/i18n/en/translations.ts b/src/i18n/en/translations.ts index 0335fc85..e82c9445 100644 --- a/src/i18n/en/translations.ts +++ b/src/i18n/en/translations.ts @@ -607,7 +607,8 @@ export default { completed: "Swap Completed", too_small: "Invalid amount entered. You need to swap at least 100k sats.", - sats_added: "+{{amount}} sats have been added to your Lightning balance", + sats_added: + "+{{amount}} sats have been added to your Lightning balance", sats_fee: "+{{amount}} sats fee", confirm_swap: "Confirm Swap", preview_swap: "Preview Swap Fee" diff --git a/src/routes/Send.tsx b/src/routes/Send.tsx index 6438ce51..6e856f8d 100644 --- a/src/routes/Send.tsx +++ b/src/routes/Send.tsx @@ -234,8 +234,8 @@ export function Send() { ? sentDetails()?.txid : undefined : sentDetails() - ? sentDetails()?.payment_hash - : undefined; + ? sentDetails()?.payment_hash + : undefined; const kind = sentDetails()?.txid ? "OnChain" : "Lightning"; console.log("Opening details modal: ", paymentTxId, kind);