Wallet {#if $session?.wallet}
Connected
{:else} {/if}
{#if $session?.wallet} {#if $session.wallet.type === "webln"} {@const {node, version} = $session.wallet.info}

Connected to {node?.alias || version || "unknown wallet"} via {$session.wallet.type}

Balance: {#await getWebLn() ?.enable() .then(() => getWebLn().getBalance())} {:then res} {new Intl.NumberFormat(LOCALE).format(res?.balance || 0)} {:catch} [unknown] {/await} sats

{:else if $session.wallet.type === "nwc"} {@const {lud16, relayUrl, nostrWalletConnectUrl} = $session.wallet.info}

Connected to {lud16} via {displayRelayUrl(relayUrl)}

Balance: {#await new nwc.NWCClient({nostrWalletConnectUrl}).getBalance()} {:then res} {new Intl.NumberFormat(LOCALE).format(fromMsats(res?.balance || 0))} {:catch} [unknown] {/await} sats

{/if} {:else}

No wallet connected

{/if}
Lightning Address
{profileLightningAddress ? profileLightningAddress : "Not set"}
{#if profileLightningAddress && walletLud16 && profile?.lud16 !== walletLud16}
Your profile has a different lightning address than your connected wallet.
{/if}