Skip to content

Commit

Permalink
feat: 💄 Add UTXO disclaimer on Bitcoin like coins (#7840)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcayuelas-ledger authored Sep 19, 2024
1 parent e837167 commit 332312b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/unlucky-seals-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

Add UTXO disclaimer on Receive
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";
import { Trans } from "react-i18next";
import { Text, Alert } from "@ledgerhq/react-ui";

export function UTXOAddressAlert() {
return (
<Alert
type={"info"}
containerProps={{ p: 12, borderRadius: 8 }}
renderContent={() => (
<Text
variant="paragraphLineHeight"
fontWeight="semiBold"
color="neutral.c100"
fontSize={13}
>
<Trans i18nKey="currentAddress.utxoWarning" />
</Text>
)}
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import SuccessDisplay from "~/renderer/components/SuccessDisplay";
import Receive2NoDevice from "~/renderer/components/Receive2NoDevice";
import { renderVerifyUnwrapped } from "~/renderer/components/DeviceAction/rendering";
import { StepProps } from "../Body";
import { AccountLike, PostOnboardingActionId } from "@ledgerhq/types-live";
import { Account, PostOnboardingActionId } from "@ledgerhq/types-live";
import { track } from "~/renderer/analytics/segment";
import Modal from "~/renderer/components/Modal";
import Alert from "~/renderer/components/Alert";
Expand All @@ -39,6 +39,7 @@ import { firstValueFrom } from "rxjs";
import { useCompleteActionCallback } from "~/renderer/components/PostOnboardingHub/logic/useCompleteAction";
import { getDefaultAccountName } from "@ledgerhq/live-wallet/accountName";
import { useMaybeAccountName } from "~/renderer/reducers/wallet";
import { UTXOAddressAlert } from "~/renderer/components/UTXOAddressAlert";

const Separator = styled.div`
border-top: 1px solid #99999933;
Expand All @@ -54,17 +55,21 @@ const QRCodeWrapper = styled.div`
width: 208px;
background: white;
`;

const UTXOFamily = ["bitcoin", "bitcoin_cash", "dash", "dogecoin", "litecoin", "zcash", "cardano"];

const Receive1ShareAddress = ({
account,
name,
address,
showQRCodeModal,
}: {
account: AccountLike;
account: Account;
name: string;
address: string;
showQRCodeModal: () => void;
}) => {
const isUTXOCompliant = UTXOFamily.includes(account.currency.id);
return (
<>
<Box horizontal alignItems="center" flow={2} mb={4}>
Expand Down Expand Up @@ -93,6 +98,12 @@ const Receive1ShareAddress = ({
<LinkShowQRCode onClick={showQRCodeModal} address={address} />
</Box>
<ReadOnlyAddressField address={address} />

{isUTXOCompliant && (
<Box mt={3}>
<UTXOAddressAlert />
</Box>
)}
</>
);
};
Expand Down
3 changes: 2 additions & 1 deletion apps/ledger-live-desktop/static/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,8 @@
"messageIfSkipped": "Your {{name}} address was not confirmed on your Ledger device. Please verify it for security.",
"showQrCode": "Show QR Code",
"taprootWarning": "Make sure the sender supports taproot",
"dashStakingWarning": "Please make sure you don't use this address for receiving staking rewards"
"dashStakingWarning": "Please make sure you don't use this address for receiving staking rewards",
"utxoWarning": "For privacy reasons, a new address is generated for every transaction. The previous ones do remain valid."
},
"emptyState": {
"dashboard": {
Expand Down

0 comments on commit 332312b

Please sign in to comment.