From 6d080c959a8fc490c6249aa07458de3dd16fd96d Mon Sep 17 00:00:00 2001 From: Evan Kaloudis Date: Tue, 25 Jul 2023 14:54:58 -0400 Subject: [PATCH] views/Receive: add wrapped invoice explainer --- Navigation.ts | 4 +++ locales/en.json | 5 ++- views/LspExplanationRouting.tsx | 60 +++++++++++++++++++++++++++++++++ views/Receive.tsx | 8 +++-- 4 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 views/LspExplanationRouting.tsx diff --git a/Navigation.ts b/Navigation.ts index 062c387903..01c797174c 100644 --- a/Navigation.ts +++ b/Navigation.ts @@ -84,6 +84,7 @@ import EditFee from './views/EditFee'; import Seed from './views/Settings/Seed'; import Sync from './views/Sync'; import LspExplanation from './views/LspExplanation'; +import LspExplanationRouting from './views/LspExplanationRouting'; const AppScenes = { Wallet: { @@ -287,6 +288,9 @@ const AppScenes = { LspExplanation: { screen: LspExplanation }, + LspExplanationRouting: { + screen: LspExplanationRouting + }, EmbeddedNodeSettings: { screen: EmbeddedNode }, diff --git a/locales/en.json b/locales/en.json index a5896d6baa..37a0dfc964 100644 --- a/locales/en.json +++ b/locales/en.json @@ -466,6 +466,7 @@ "views.Receive.p2trKey": "Taproot (P2TR)", "views.Receive.p2trDescription": "The latest, most powerful, bitcoin address type. Not widely supported.", "views.Receive.lspExplainer": "LSP will take the following amount as a setup fee:", + "views.Receive.lspExplainerRouting": "LSP will take the following amount as a routing fee:", "views.Send.title": "Send", "views.Send.lnPayment": "Lightning payment request", "views.Send.btcAddress": "Bitcoin address", @@ -730,5 +731,7 @@ "views.LspExplanation.title": "What are these fees?", "views.LspExplanation.text1": "Zeus is a self-custodial lightning wallet. In order to send or receive a lightning payment, you must open a lightning payment channel, which has a setup fee.", "views.LspExplanation.text2": "Once the channel is set up, you'll only have to pay normal network fees until your channel exhausts its capacity.", - "views.LspExplanation.buttonText": "Learn more about liquidity" + "views.LspExplanation.buttonText": "Learn more about liquidity", + "views.LspExplanationRouting.text1": "In order to provide you with some privacy and improve payment performance, the Lightning Service Provider (LSP) will do some heavy lifting for you with a technique called invoice wrapping. The fee is nominal; it's typically just a few satoshis.", + "views.LspExplanationRouting.text2": "You can turn off the LSP entirely and save on these fees by navigating to Settings > Lightning Service Provider (LSP), but you will sacfrifice these privacy and payment performance gains." } diff --git a/views/LspExplanationRouting.tsx b/views/LspExplanationRouting.tsx new file mode 100644 index 0000000000..c74756e5cb --- /dev/null +++ b/views/LspExplanationRouting.tsx @@ -0,0 +1,60 @@ +import React from 'react'; +import { Text, View } from 'react-native'; + +import Screen from '../components/Screen'; +import Header from '../components/Header'; + +import { localeString } from '../utils/LocaleUtils'; +import { themeColor } from '../utils/ThemeUtils'; + +interface LspExplanationProps { + navigation: any; +} + +const FONT_SIZE = 18; + +export default class LspExplanation extends React.PureComponent< + LspExplanationProps, + {} +> { + render() { + const { navigation } = this.props; + return ( + +
+ + + {localeString('views.LspExplanationRouting.text1')} + + + {localeString('views.LspExplanationRouting.text2')} + + + + ); + } +} diff --git a/views/Receive.tsx b/views/Receive.tsx index 4e98764925..31b3104ab0 100644 --- a/views/Receive.tsx +++ b/views/Receive.tsx @@ -1129,7 +1129,9 @@ export default class Receive extends React.Component< navigation.navigate( - 'LspExplanation' + zeroConfFee > 1000 + ? 'LspExplanation' + : 'LspExplanationRouting' ) } > @@ -1152,7 +1154,9 @@ export default class Receive extends React.Component< }} > {localeString( - 'views.Receive.lspExplainer' + zeroConfFee > 1000 + ? 'views.Receive.lspExplainer' + : 'views.Receive.lspExplainerRouting' )}