diff --git a/public/i18n/en.json b/public/i18n/en.json index 888852d5..908ffeb2 100644 --- a/public/i18n/en.json +++ b/public/i18n/en.json @@ -148,7 +148,9 @@ "body": "Lightning receives will automatically go into your chosen federation. You can swap to self-custodial later if you want." }, "receive_strings_error": "Something went wrong generating an invoice or on-chain address.", - "error_under_min_onchain": "That's under the dust limit! On-chain transactions should be much bigger." + "error_under_min_onchain": "That's under the dust limit! On-chain transactions should be much bigger.", + "warning_on_chain_fedi": "On-chain fedimint deposits require 10 confirmations.", + "warning_address_reuse": "Only send to this address once!" }, "send": { "search": { diff --git a/src/components/ActivityDetailsModal.tsx b/src/components/ActivityDetailsModal.tsx index a64e5164..a9e3c455 100644 --- a/src/components/ActivityDetailsModal.tsx +++ b/src/components/ActivityDetailsModal.tsx @@ -168,7 +168,7 @@ function OnchainHeader(props: { info: OnChainTx; kind?: HackActivityType }) { - + 0}>
- -
- {/* Have to do all these shenanigans because css / html is hard */} -
- + +
+ {/* Have to do all these shenanigans because css / html is hard */} + +
- -
- + + ); diff --git a/src/components/ReceiveWarnings.tsx b/src/components/ReceiveWarnings.tsx index c7895afc..216678b4 100644 --- a/src/components/ReceiveWarnings.tsx +++ b/src/components/ReceiveWarnings.tsx @@ -1,4 +1,4 @@ -import { createResource, Match, Switch } from "solid-js"; +import { createMemo, createResource, Match, Switch } from "solid-js"; import { InfoBox } from "~/components/InfoBox"; import { FeesModal } from "~/components/MoreInfoModal"; @@ -79,6 +79,12 @@ export function ReceiveWarnings(props: { } }; + const onChainFedi = createMemo(() => { + if (props.flavor === "onchain" && state.federations?.length) { + return true; + } + }); + return ( @@ -92,6 +98,11 @@ export function ReceiveWarnings(props: { {warningText()} + + + {i18n.t("receive.warning_on_chain_fedi")} + + ); } diff --git a/src/routes/Receive.tsx b/src/routes/Receive.tsx index 2116a2f4..69872be6 100644 --- a/src/routes/Receive.tsx +++ b/src/routes/Receive.tsx @@ -60,6 +60,7 @@ export type OnChainTx = { }>; }; txid: string; + internal_id: string; received: number; sent: number; confirmation_time: { @@ -213,7 +214,7 @@ export function Receive() { const paymentTxId = paidState() === "onchain_paid" ? paymentTx() - ? paymentTx()?.txid + ? paymentTx()?.internal_id : undefined : paymentInvoice() ? paymentInvoice()?.payment_hash @@ -459,6 +460,11 @@ export function Receive() {

{error()}

+ + + {i18n.t("receive.warning_address_reuse")} + + { - return ( - (state.balance?.confirmed ?? 0n) + - (state.balance?.unconfirmed ?? 0n) - ); + const conf = state.balance?.confirmed ?? 0n; + const unc = state.balance?.unconfirmed ?? 0n; + const fed = state.balance?.federation ?? 0n; + + if (fed > conf + unc) { + return fed; + } else { + return conf + unc; + } }); const maxLightning = createMemo(() => {