diff --git a/backends/CLNRest.ts b/backends/CLNRest.ts index cc5587360..50aed1229 100644 --- a/backends/CLNRest.ts +++ b/backends/CLNRest.ts @@ -404,7 +404,7 @@ export default class CLNRest { supportsAddressTypeSelection = () => false; supportsTaproot = () => false; supportsBumpFee = () => false; - supportsLSPs = () => false; + supportsFlowLSP = () => false; supportsNetworkInfo = () => false; supportsSimpleTaprootChannels = () => false; supportsCustomPreimages = () => false; diff --git a/backends/CLightningREST.ts b/backends/CLightningREST.ts index aeb74c970..bd825040a 100644 --- a/backends/CLightningREST.ts +++ b/backends/CLightningREST.ts @@ -295,7 +295,7 @@ export default class CLightningREST extends LND { supportsAddressTypeSelection = () => false; supportsTaproot = () => false; supportsBumpFee = () => false; - supportsLSPs = () => false; + supportsFlowLSP = () => false; supportsNetworkInfo = () => false; supportsSimpleTaprootChannels = () => false; supportsCustomPreimages = () => false; diff --git a/backends/Eclair.ts b/backends/Eclair.ts index 43aad7b9e..d4c2d99b3 100644 --- a/backends/Eclair.ts +++ b/backends/Eclair.ts @@ -501,7 +501,7 @@ export default class Eclair { supportsAddressTypeSelection = () => false; supportsTaproot = () => false; supportsBumpFee = () => false; - supportsLSPs = () => false; + supportsFlowLSP = () => false; supportsNetworkInfo = () => false; supportsSimpleTaprootChannels = () => false; supportsCustomPreimages = () => false; diff --git a/backends/EmbeddedLND.ts b/backends/EmbeddedLND.ts index 1dfaea042..2617876f3 100644 --- a/backends/EmbeddedLND.ts +++ b/backends/EmbeddedLND.ts @@ -309,7 +309,7 @@ export default class EmbeddedLND extends LND { supportsAddressTypeSelection = () => true; supportsTaproot = () => this.supports('v0.15.0'); supportsBumpFee = () => true; - supportsLSPs = () => true; + supportsFlowLSP = () => true; supportsNetworkInfo = () => true; supportsSimpleTaprootChannels = () => this.supports('v0.17.0'); supportsCustomPreimages = () => true; diff --git a/backends/LND.ts b/backends/LND.ts index 844cf456d..a1a7b7b9d 100644 --- a/backends/LND.ts +++ b/backends/LND.ts @@ -695,7 +695,7 @@ export default class LND { supportsAddressTypeSelection = () => true; supportsTaproot = () => this.supports('v0.15.0'); supportsBumpFee = () => true; - supportsLSPs = () => true; + supportsFlowLSP = () => true; supportsNetworkInfo = () => true; supportsSimpleTaprootChannels = () => this.supports('v0.17.0'); supportsCustomPreimages = () => true; diff --git a/backends/LightningNodeConnect.ts b/backends/LightningNodeConnect.ts index ba0bf4d9f..176535ebc 100644 --- a/backends/LightningNodeConnect.ts +++ b/backends/LightningNodeConnect.ts @@ -535,7 +535,7 @@ export default class LightningNodeConnect { supportsAddressTypeSelection = () => true; supportsTaproot = () => this.supports('v0.15.0'); supportsBumpFee = () => true; - supportsLSPs = () => false; + supportsFlowLSP = () => false; supportsNetworkInfo = () => true; supportsSimpleTaprootChannels = () => this.supports('v0.17.0'); supportsCustomPreimages = () => true; diff --git a/backends/LndHub.ts b/backends/LndHub.ts index c9f6626af..b0115a47c 100644 --- a/backends/LndHub.ts +++ b/backends/LndHub.ts @@ -148,7 +148,7 @@ export default class LndHub extends LND { supportsAddressTypeSelection = () => false; supportsTaproot = () => false; supportsBumpFee = () => false; - supportsLSPs = () => false; + supportsFlowLSP = () => false; supportsNetworkInfo = () => false; supportsSimpleTaprootChannels = () => false; supportsCustomPreimages = () => false; diff --git a/backends/Spark.ts b/backends/Spark.ts index 62bd1924e..1531bd7c4 100644 --- a/backends/Spark.ts +++ b/backends/Spark.ts @@ -373,7 +373,7 @@ export default class Spark { supportsAddressTypeSelection = () => false; supportsTaproot = () => false; supportsBumpFee = () => false; - supportsLSPs = () => false; + supportsFlowLSP = () => false; supportsNetworkInfo = () => false; supportsSimpleTaprootChannels = () => false; supportsCustomPreimages = () => false; diff --git a/locales/en.json b/locales/en.json index 46395ee6c..4adc44b82 100644 --- a/locales/en.json +++ b/locales/en.json @@ -1158,10 +1158,11 @@ "views.Settings.LightningAddress.generatingPreimages": "Generating preimages", "views.Settings.LightningAddress.ChangeAddress": "Change address", "views.Settings.LightningAddress.nostrKeys.changeWarning": "Warning: changing your Nostr keys will delete your pending payments. Please redeem your pending payments before submitting new keys.", - "views.Settings.LightningAddress.explainer1": "To get started with a lightning address you must first have a lightning channel and inbound liquidity.", - "views.Settings.LightningAddress.explainer2": "The easiest way to do so is to purchase a 0-conf channel from our LSP, OLYMPUS by ZEUS. Just generate an invoice and pay yourself from another lightning wallet.", - "views.Settings.LightningAddress.explainer3": "For best results, open up a channel with our node, OLYMPUS by ZEUS.", + "views.Settings.LightningAddress.explainer1": "To get started with a lightning address you must first have a lightning channel from the ZEUS LSP with inbound liquidity.", + "views.Settings.LightningAddress.explainer2": "The easiest way to do so is to purchase a 0-conf channel. Just generate an invoice and pay yourself from another lightning wallet.", + "views.Settings.LightningAddress.explainer3": "Purchasing a standard channel will require you to wait for several on-chain confirmation before your channel is useable.", "views.Settings.LightningAddress.get0ConfChan": "Get 0-conf channel", + "views.Settings.LightningAddress.getStandardChan": "Get standard channel", "views.Settings.LightningAddress.generateNew": "Generate new pre-images", "views.Settings.LightningAddressSettings.title": "Lightning address settings", "views.Settings.LightningAddressSettings.automaticallyAccept": "Automatically accept payments on startup", diff --git a/stores/InvoicesStore.ts b/stores/InvoicesStore.ts index 6ee74b316..c602b62fa 100644 --- a/stores/InvoicesStore.ts +++ b/stores/InvoicesStore.ts @@ -291,7 +291,7 @@ export default class InvoicesStore { if (customPreimage) req.preimage = customPreimage; if ( - BackendUtils.supportsLSPs() && + BackendUtils.supportsFlowLSP() && this.settingsStore.settings?.enableLSP && value && value !== '0' && @@ -356,7 +356,7 @@ export default class InvoicesStore { let jit_bolt11: string = ''; if ( - BackendUtils.supportsLSPs() && + BackendUtils.supportsFlowLSP() && this.settingsStore.settings?.enableLSP && value !== '0' && !noLsp diff --git a/stores/NodeInfoStore.ts b/stores/NodeInfoStore.ts index e6b44f70b..37f7048d8 100644 --- a/stores/NodeInfoStore.ts +++ b/stores/NodeInfoStore.ts @@ -136,7 +136,7 @@ export default class NodeInfoStore { }; @action - public lspNotConfigured = () => { + public flowLspNotConfigured = () => { const { implementation, certVerification } = this.settingsStore; const scidAlias = @@ -145,7 +145,7 @@ export default class NodeInfoStore { const zeroConfConfig = zeroConf && scidAlias; const restIsConfigured = certVerification && zeroConfConfig; - const lspNotConfigured = + const flowLspNotConfigured = implementation === 'lnd' ? !restIsConfigured : implementation === 'embedded-lnd' @@ -153,7 +153,7 @@ export default class NodeInfoStore { : true; return { - lspNotConfigured, + flowLspNotConfigured, restIsConfigured, zeroConfConfig, zeroConf, diff --git a/utils/BackendUtils.ts b/utils/BackendUtils.ts index afec8d280..b18e2cbc7 100644 --- a/utils/BackendUtils.ts +++ b/utils/BackendUtils.ts @@ -166,7 +166,7 @@ class BackendUtils { this.call('supportsAddressTypeSelection'); supportsTaproot = () => this.call('supportsTaproot'); supportsBumpFee = () => this.call('supportsBumpFee'); - supportsLSPs = () => this.call('supportsLSPs'); + supportsFlowLSP = () => this.call('supportsFlowLSP'); supportsNetworkInfo = () => this.call('supportsNetworkInfo'); supportsSimpleTaprootChannels = () => this.call('supportsSimpleTaprootChannels'); diff --git a/views/Receive.tsx b/views/Receive.tsx index 442807a5b..618b52e70 100644 --- a/views/Receive.tsx +++ b/views/Receive.tsx @@ -150,7 +150,7 @@ interface ReceiveState { needInbound: boolean; enableLSP: boolean; lspIsActive: boolean; - lspNotConfigured: boolean; + flowLspNotConfigured: boolean; routeHintMode: RouteHintMode; selectedRouteHintChannels?: Channel[]; hideRightHeaderComponent?: boolean; @@ -204,7 +204,7 @@ export default class Receive extends React.Component< needInbound: false, enableLSP: true, lspIsActive: false, - lspNotConfigured: true, + flowLspNotConfigured: true, routeHintMode: RouteHintMode.Automatic, selectedRouteHintChannels: undefined }; @@ -234,7 +234,7 @@ export default class Receive extends React.Component< status(); } - const { lspNotConfigured } = NodeInfoStore.lspNotConfigured(); + const { flowLspNotConfigured } = NodeInfoStore.flowLspNotConfigured(); const newExpirySeconds = settings?.invoices?.expirySeconds || '3600'; @@ -274,9 +274,9 @@ export default class Receive extends React.Component< enableLSP: settings?.enableLSP, lspIsActive: settings?.enableLSP && - BackendUtils.supportsLSPs() && - !lspNotConfigured, - lspNotConfigured + BackendUtils.supportsFlowLSP() && + !flowLspNotConfigured, + flowLspNotConfigured }); const lnOnly = @@ -1121,7 +1121,7 @@ export default class Receive extends React.Component< needInbound, enableLSP, lspIsActive, - lspNotConfigured, + flowLspNotConfigured, routeHintMode, selectedRouteHintChannels, blindedPaths, @@ -2079,8 +2079,8 @@ export default class Receive extends React.Component< !creatingInvoice && route.params?.selectedIndex !== 2 && ( <> - {BackendUtils.supportsLSPs() && - !lspNotConfigured && ( + {BackendUtils.supportsFlowLSP() && + !flowLspNotConfigured && ( { const isTestNet = nodeInfo?.isTestNet; - const { lspNotConfigured, zeroConfConfig, scidAlias, zeroConf } = - NodeInfoStore.lspNotConfigured(); + const { flowLspNotConfigured, zeroConfConfig, scidAlias, zeroConf } = + NodeInfoStore.flowLspNotConfigured(); const showReset: boolean = !enableLSP || @@ -96,7 +96,7 @@ export default class LSP extends React.Component { navigation={navigation} /> - {lspNotConfigured ? ( + {flowLspNotConfigured ? ( <> @@ -348,7 +348,7 @@ export default class LSP extends React.Component { )} - {!lspNotConfigured && ( + {!flowLspNotConfigured && ( { { element: twelveMoButton } ]; - const { lspNotConfigured } = NodeInfoStore.lspNotConfigured(); + const { flowLspNotConfigured } = NodeInfoStore.flowLspNotConfigured(); const flowServiceAvailable = SettingsStore.settings?.enableLSP && - BackendUtils.supportsLSPs() && - !lspNotConfigured; + BackendUtils.supportsFlowLSP() && + !flowLspNotConfigured; const isOlympus = LSPStore.isOlympus(); diff --git a/views/Settings/LightningAddress/index.tsx b/views/Settings/LightningAddress/index.tsx index 10adcc40a..b24bbbad6 100644 --- a/views/Settings/LightningAddress/index.tsx +++ b/views/Settings/LightningAddress/index.tsx @@ -30,7 +30,9 @@ import { Spacer } from '../../../components/layout/Spacer'; import ChannelsStore from '../../../stores/ChannelsStore'; import LightningAddressStore from '../../../stores/LightningAddressStore'; +import NodeInfoStore from '../../../stores/NodeInfoStore'; import SettingsStore, { + DEFAULT_LSPS1_PUBKEY_MAINNET, DEFAULT_NOSTR_RELAYS } from '../../../stores/SettingsStore'; import UnitsStore from '../../../stores/UnitsStore'; @@ -47,6 +49,7 @@ interface LightningAddressProps { navigation: StackNavigationProp; ChannelsStore: ChannelsStore; LightningAddressStore: LightningAddressStore; + NodeInfoStore: NodeInfoStore; SettingsStore: SettingsStore; UnitsStore: UnitsStore; route: Route< @@ -63,7 +66,13 @@ interface LightningAddressState { nostrRelays: Array; } -@inject('LightningAddressStore', 'ChannelsStore', 'SettingsStore', 'UnitsStore') +@inject( + 'LightningAddressStore', + 'NodeInfoStore', + 'ChannelsStore', + 'SettingsStore', + 'UnitsStore' +) @observer export default class LightningAddress extends React.Component< LightningAddressProps, @@ -141,6 +150,7 @@ export default class LightningAddress extends React.Component< const { navigation, LightningAddressStore, + NodeInfoStore, ChannelsStore, SettingsStore, UnitsStore @@ -182,8 +192,18 @@ export default class LightningAddress extends React.Component< !automaticallyAccept || readyToAutomaticallyAccept; - const hasChannels = - ChannelsStore.channels && ChannelsStore.channels.length > 0; + let hasZeusLspChannel = false; + ChannelsStore.channels?.every((channel) => { + if (channel.remotePubkey === DEFAULT_LSPS1_PUBKEY_MAINNET) { + hasZeusLspChannel = true; + return; + } + }); + + const { flowLspNotConfigured } = NodeInfoStore.flowLspNotConfigured(); + const supportsLSPS1 = + BackendUtils.supportsLSPS1customMessage() || + BackendUtils.supportsLSPS1rest(); const InfoButton = () => ( @@ -379,7 +399,7 @@ export default class LightningAddress extends React.Component< !redeeming && !redeemingAll && !lightningAddressHandle && - hasChannels && ( + hasZeusLspChannel && ( <> @@ -566,25 +586,16 @@ export default class LightningAddress extends React.Component< !redeeming && !redeemingAll && !lightningAddressHandle && - !hasChannels && ( + !hasZeusLspChannel && ( <> - - - {localeString( - 'views.Settings.LightningAddress.explainer1' - )} - - {BackendUtils.supportsLSPs() && ( + {localeString( - 'views.Settings.LightningAddress.explainer2' - ).replace( - 'OLYMPUS by ZEUS', - 'Olympus by ZEUS' + 'views.Settings.LightningAddress.explainer1' )} - )} - {BackendUtils.supportsLSPs() && ( - - {localeString( - 'views.Wallet.KeypadPane.lspExplainerFirstChannel' + {BackendUtils.supportsFlowLSP() && + !flowLspNotConfigured && ( + + {localeString( + 'views.Settings.LightningAddress.explainer2' + ).replace( + 'OLYMPUS by ZEUS', + 'Olympus by ZEUS' + )} + )} - - )} - {!BackendUtils.supportsLSPs() && ( - - {localeString( - 'views.Settings.LightningAddress.explainer3' - ).replace( - 'OLYMPUS by ZEUS', - 'Olympus by ZEUS' + {BackendUtils.supportsFlowLSP() && + !flowLspNotConfigured && ( + + {localeString( + 'views.Wallet.KeypadPane.lspExplainerFirstChannel' + )} + )} - - )} - -