diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml
new file mode 100644
index 0000000..0e36e96
--- /dev/null
+++ b/.github/workflows/pull_requests.yml
@@ -0,0 +1,39 @@
+name: PR build
+on: [pull_request]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: 🏗 Setup repo
+ uses: actions/checkout@v3
+
+ - name: Set up Java
+ uses: actions/setup-java@v2
+ with:
+ java-version: 17
+ distribution: "temurin"
+
+ - name: 🏗 Setup Node
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18.x
+ cache: yarn
+
+ - name: 🏗 Setup EAS
+ uses: expo/expo-github-action@v8
+ with:
+ eas-version: latest
+ token: ${{ secrets.EXPO_TOKEN }}
+
+ - name: 📦 Install dependencies
+ run: yarn install
+
+ - name: 🚀 Build app
+ run: eas build --non-interactive --platform android --local --profile production_apk --output=./app-release.apk
+
+ - name: Upload Artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: alby-go-android.apk
+ path: ./app-release.apk
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..9cb1f76
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,85 @@
+name: Release tag
+
+on:
+ push:
+ tags:
+ - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
+
+jobs:
+ draft_release:
+ runs-on: ubuntu-latest
+ outputs:
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+ id: ${{ steps.create_release.outputs.id }}
+ steps:
+ # Create Release
+ - name: Create Release
+ id: create_release
+ uses: actions/create-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: ${{ github.ref }}
+ release_name: Release ${{ github.ref }}
+ draft: true
+# prerelease: true
+
+ build_android:
+ needs: [draft_release]
+ runs-on: ubuntu-latest
+ steps:
+ - name: 🏗 Setup repo
+ uses: actions/checkout@v3
+
+ - name: Set up Java
+ uses: actions/setup-java@v2
+ with:
+ java-version: 17
+ distribution: "temurin"
+
+ - name: 🏗 Setup Node
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18.x
+ cache: yarn
+
+ - name: 🏗 Setup EAS
+ uses: expo/expo-github-action@v8
+ with:
+ eas-version: latest
+ token: ${{ secrets.EXPO_TOKEN }}
+
+ - name: 📦 Install dependencies
+ run: yarn install
+
+ - name: 🚀 Build app
+ run: eas build --non-interactive --platform android --local --profile production_apk --output=./app-release.apk
+
+ - name: Upload Artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: alby-go-android.apk
+ path: ./app-release.apk
+
+ # APK
+ - name: Upload APK to release
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.draft_release.outputs.upload_url }}
+ asset_path: ./app-release.apk
+ asset_name: alby-go-${{ github.ref_name }}-android.apk
+ asset_content_type: application/vnd.android.package-archive
+
+# publish-release:
+# needs: [release, build_android]
+# runs-on: ubuntu-latest
+#
+# steps:
+# - uses: eregon/publish-release@v1
+# env:
+# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+# with:
+# release_id: ${{ needs.release.outputs.id }}
+#
diff --git a/README.md b/README.md
index 538a72d..5e4e635 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Alby Mobile
+# Alby Go
A simple lightning mobile wallet interface that works great with [Alby Hub](https://albyhub.com)
diff --git a/app.json b/app.json
index a0a78ea..478c9ce 100644
--- a/app.json
+++ b/app.json
@@ -1,6 +1,6 @@
{
"expo": {
- "name": "Alby Mobile",
+ "name": "Alby Go",
"slug": "alby-mobile",
"version": "1.3.0",
"scheme": [
@@ -23,7 +23,7 @@
[
"expo-camera",
{
- "cameraPermission": "Allow Alby Mobile to use the camera to scan wallet connection and payment QR codes",
+ "cameraPermission": "Allow Alby Go to use the camera to scan wallet connection and payment QR codes",
"recordAudioAndroid": false
}
],
diff --git a/components/Screen.tsx b/components/Screen.tsx
new file mode 100644
index 0000000..c82b444
--- /dev/null
+++ b/components/Screen.tsx
@@ -0,0 +1,21 @@
+import { Stack } from "expo-router";
+import { StackAnimationTypes } from "react-native-screens";
+import { HeaderButtonProps } from "@react-navigation/native-stack/src/types";
+
+type ScreenProps = {
+ title: string;
+ right?: (props: HeaderButtonProps) => React.ReactNode;
+ animation?: StackAnimationTypes;
+};
+
+function Screen({ title, animation, right }: ScreenProps) {
+ return ;
+}
+
+export default Screen;
\ No newline at end of file
diff --git a/components/icons/AppIcon.tsx b/components/icons/AppIcon.tsx
deleted file mode 100644
index 3559dbb..0000000
--- a/components/icons/AppIcon.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import * as React from "react";
-import Svg, { SvgProps, Path } from "react-native-svg";
-import { useColorScheme } from "~/lib/useColorScheme";
-
-const AppIcon = (props: SvgProps) => {
- const { isDarkColorScheme } = useColorScheme();
- const fill = isDarkColorScheme ? "white" : "black";
-
- return (
- );
-};
-export default AppIcon;
diff --git a/components/ui/button.tsx b/components/ui/button.tsx
index e64192d..027216e 100644
--- a/components/ui/button.tsx
+++ b/components/ui/button.tsx
@@ -6,7 +6,7 @@ import { TextClassContext } from "~/components/ui/text";
import { cn } from "~/lib/utils";
const buttonVariants = cva(
- "group flex items-center justify-center rounded-md web:ring-offset-background web:transition-colors web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2",
+ "group flex items-center justify-center rounded-lg web:ring-offset-background web:transition-colors web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2",
{
variants: {
variant: {
@@ -22,7 +22,7 @@ const buttonVariants = cva(
size: {
default: "min-h-10 px-4 py-2 native:min-h-12 native:px-5 native:py-3",
sm: "min-h-9 rounded-md px-3",
- lg: "min-h-11 rounded-md px-8 native:min-h-16",
+ lg: "min-h-11 rounded-lg px-8 native:min-h-16",
icon: "min-h-10 min-w-10",
},
},
diff --git a/eas.json b/eas.json
index 05ee6fd..47e976b 100644
--- a/eas.json
+++ b/eas.json
@@ -10,7 +10,12 @@
"preview": {
"distribution": "internal"
},
- "production": {}
+ "production": {},
+ "production_apk": {
+ "android": {
+ "buildType": "apk"
+ }
+ }
},
"submit": {
"production": {}
diff --git a/hooks/useGetFiatAmount.ts b/hooks/useGetFiatAmount.ts
index 2ed68ed..b93bcd2 100644
--- a/hooks/useGetFiatAmount.ts
+++ b/hooks/useGetFiatAmount.ts
@@ -38,8 +38,10 @@ export function useGetFiatAmount() {
return `${new Intl.NumberFormat(undefined, {
style: "currency",
currency: fiatCurrency,
+ currencyDisplay: "narrowSymbol",
}).format(rate * amount)}`;
}
+
const amountWithCurrencyCode = new Intl.NumberFormat("en-US", {
style: "currency",
currency: fiatCurrency,
@@ -47,13 +49,13 @@ export function useGetFiatAmount() {
}).format(rate * amount);
return amountWithCurrencyCode.substring(
- amountWithCurrencyCode.search(/\s/) + 1
+ amountWithCurrencyCode.search(/\s/) + 1,
);
}
return undefined;
},
- [rate, fiatCurrency]
+ [rate, fiatCurrency],
);
return rate ? getFiatAmount : undefined;
@@ -65,7 +67,7 @@ export function useGetSatsAmount() {
const getSatsAmount = React.useCallback(
(fiatAmount: number) => (rate ? Math.round(fiatAmount / rate) : undefined),
- [rate, fiatCurrency]
+ [rate, fiatCurrency],
);
return rate ? getSatsAmount : undefined;
diff --git a/lib/constants.ts b/lib/constants.ts
index 075ecab..46c2eae 100644
--- a/lib/constants.ts
+++ b/lib/constants.ts
@@ -1,8 +1,8 @@
export const NAV_THEME = {
light: {
- background: "hsl(0 0% 100%)", // background
+ background: "hsl(210 20% 98%)", // background
border: "hsl(240 5.9% 90%)", // border
- card: "hsl(0 0% 100%)", // card
+ card: "hsl(210 20% 98%)", // card
notification: "hsl(0 84.2% 60.2%)", // destructive
primary: "hsl(240 5.9% 10%)", // primary
text: "hsl(240 10% 3.9%)", // foreground
diff --git a/package.json b/package.json
index da219a0..2968037 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
- "name": "alby-mobile",
+ "name": "alby-go",
"version": "1.3.0",
"main": "expo-router/entry",
"scripts": {
@@ -17,7 +17,7 @@
},
"dependencies": {
"@getalby/lightning-tools": "^5.0.3",
- "@getalby/sdk": "^3.6.1",
+ "@getalby/sdk": "^3.7.0",
"@react-native-async-storage/async-storage": "1.23.1",
"bech32": "^2.0.0",
"buffer": "^6.0.3",
diff --git a/pages/Home.tsx b/pages/Home.tsx
index 56e09a1..cbf6cf1 100644
--- a/pages/Home.tsx
+++ b/pages/Home.tsx
@@ -1,14 +1,12 @@
-import { View, Image, Pressable, StyleSheet } from "react-native";
+import { View, Pressable, StyleSheet } from "react-native";
import React, { useState } from "react";
import { useBalance } from "hooks/useBalance";
import { useAppStore } from "lib/state/appStore";
import { WalletConnection } from "~/pages/settings/wallets/WalletConnection";
import {
Link,
- router,
- Stack,
- useFocusEffect,
- useRootNavigationState,
+ router, useFocusEffect,
+ useRootNavigationState
} from "expo-router";
import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
@@ -22,6 +20,7 @@ import LargeArrowUp from "~/components/icons/LargeArrowUp";
import LargeArrowDown from "~/components/icons/LargeArrowDown";
import { SvgProps } from "react-native-svg";
import { Button } from "~/components/ui/button";
+import Screen from "~/components/Screen";
dayjs.extend(relativeTime);
@@ -69,23 +68,15 @@ export function Home() {
return (
<>
- (
-
- ),
- headerRight: () => (
-
-
-
- ),
- }}
+
+
+
+
+ }
/>
@@ -95,8 +86,8 @@ export function Home() {
style={{
...(pressed
? {
- transform: "scale(0.98)",
- }
+ transform: "scale(0.98)",
+ }
: []),
}}
onPress={switchBalanceState}
@@ -115,7 +106,7 @@ export function Home() {
getFiatAmount(Math.floor(balance.balance / 1000))}
{balanceState == BalanceState.HIDDEN && "****"}
-
+
{balanceState == BalanceState.SATS && "sats"}
>
@@ -140,10 +131,10 @@ export function Home() {
-
+
@@ -185,14 +176,14 @@ function MainButton({
style={{
flex: 1,
padding: 6,
- borderRadius: 15,
+ borderRadius: 24,
elevation: 2,
justifyContent: "center",
alignItems: "center",
...(pressed
? {
- transform: "scale(0.98)",
- }
+ transform: "scale(0.98)",
+ }
: {}),
}}
>
diff --git a/pages/Transaction.tsx b/pages/Transaction.tsx
index f92a063..bfb309f 100644
--- a/pages/Transaction.tsx
+++ b/pages/Transaction.tsx
@@ -1,8 +1,9 @@
import { Nip47Transaction } from "@getalby/sdk/dist/NWCClient";
import dayjs from "dayjs";
-import { Stack, useLocalSearchParams } from "expo-router";
+import { useLocalSearchParams } from "expo-router";
import React from "react";
import { View } from "react-native";
+import Screen from "~/components/Screen";
import { MoveDownLeft, MoveUpRight } from "~/components/Icons";
import { Text } from "~/components/ui/text";
import { useGetFiatAmount } from "~/hooks/useGetFiatAmount";
@@ -17,10 +18,8 @@ export function Transaction() {
return (
-
{transaction.type === "incoming" ? "+" : "-"} {Math.floor(transaction.amount / 1000)}
diff --git a/pages/Transactions.tsx b/pages/Transactions.tsx
index 04278e9..b079577 100644
--- a/pages/Transactions.tsx
+++ b/pages/Transactions.tsx
@@ -1,6 +1,6 @@
import { Nip47Transaction } from "@getalby/sdk/dist/NWCClient";
import dayjs from "dayjs";
-import { Link, router, Stack } from "expo-router";
+import { Link, router } from "expo-router";
import React from "react";
import {
FlatList,
@@ -9,6 +9,7 @@ import {
ScrollView,
View,
} from "react-native";
+import Screen from "~/components/Screen";
import { MoveDownLeft, MoveUpRight, X } from "~/components/Icons";
import { Button } from "~/components/ui/button";
import { Skeleton } from "~/components/ui/skeleton";
@@ -65,21 +66,16 @@ export function Transactions() {
return (
- ,
- headerRight: () => (
- {
- router.back();
- }}
- >
-
-
- ),
- }}
+ ( {
+ router.back();
+ }}
+ >
+
+ )}
/>
{allTransactions && allTransactions.length ? (
-
+
{transaction.type === "incoming" && (
-
+
{transaction.description
? transaction.description
: transaction.type === "incoming"
@@ -145,16 +141,18 @@ export function Transactions() {
+ {transaction.type === "incoming" ? "+" : "-"}
+ {" "}
{Math.floor(transaction.amount / 1000)}
sats
-
+
{getFiatAmount &&
getFiatAmount(Math.floor(transaction.amount / 1000))}
diff --git a/pages/receive/Receive.tsx b/pages/receive/Receive.tsx
index c503703..9396fa7 100644
--- a/pages/receive/Receive.tsx
+++ b/pages/receive/Receive.tsx
@@ -1,4 +1,4 @@
-import { Link, Stack, router } from "expo-router";
+import { Link, router } from "expo-router";
import { Keyboard, Share, TouchableWithoutFeedback, View } from "react-native";
import { Button } from "~/components/ui/button";
import * as Clipboard from "expo-clipboard";
@@ -14,6 +14,7 @@ import Loading from "~/components/Loading";
import { DualCurrencyInput } from "~/components/DualCurrencyInput";
import { useGetFiatAmount } from "~/hooks/useGetFiatAmount";
import QRCode from "~/components/QRCode";
+import Screen from "~/components/Screen";
export function Receive() {
const getFiatAmount = useGetFiatAmount();
@@ -174,10 +175,8 @@ export function Receive() {
return (
<>
-
{!enterCustomAmount && !invoice && !lightningAddress && (
<>
@@ -243,7 +242,7 @@ export function Receive() {
-
diff --git a/pages/settings/FiatCurrency.tsx b/pages/settings/FiatCurrency.tsx
index 171f4bb..894cdd3 100644
--- a/pages/settings/FiatCurrency.tsx
+++ b/pages/settings/FiatCurrency.tsx
@@ -1,12 +1,12 @@
-import { Stack, router } from "expo-router";
+import { router } from "expo-router";
import React from "react";
import { Keyboard, TouchableWithoutFeedback, View } from "react-native";
import Toast from "react-native-toast-message";
-import { Bitcoin } from "~/components/Icons";
import { Button } from "~/components/ui/button";
import { Input } from "~/components/ui/input";
import { Text } from "~/components/ui/text";
import { useAppStore } from "~/lib/state/appStore";
+import Screen from "~/components/Screen";
export function FiatCurrency() {
const [fiatCurrency, setFiatCurrency] = React.useState(
@@ -14,10 +14,8 @@ export function FiatCurrency() {
);
return (
-
{
@@ -31,7 +29,7 @@ export function FiatCurrency() {
placeholder="USD"
value={fiatCurrency}
onChangeText={setFiatCurrency}
- // aria-errormessage="inputError"
+ // aria-errormessage="inputError"
/>
diff --git a/pages/settings/Settings.tsx b/pages/settings/Settings.tsx
index 51beed3..1eca505 100644
--- a/pages/settings/Settings.tsx
+++ b/pages/settings/Settings.tsx
@@ -1,4 +1,4 @@
-import { Link, router, Stack } from "expo-router";
+import { Link, router } from "expo-router";
import { Alert, Pressable, TouchableOpacity, View } from "react-native";
import { Bitcoin, Egg, Palette, Power, Wallet2 } from "~/components/Icons";
@@ -9,6 +9,7 @@ import React from "react";
import Constants from "expo-constants";
import Toast from "react-native-toast-message";
import { useColorScheme } from "~/lib/useColorScheme";
+import Screen from "~/components/Screen";
export function Settings() {
const wallet = useAppStore((store) => store.wallets[store.selectedWalletId]);
@@ -18,10 +19,8 @@ export function Settings() {
return (
-
@@ -119,9 +118,7 @@ export function Settings() {
}}
>
-
- Alby Mobile v{Constants.expoConfig?.version}
-
+ Alby Go v{Constants.expoConfig?.version}
diff --git a/pages/settings/Wallets.tsx b/pages/settings/Wallets.tsx
index efe6742..0668fa3 100644
--- a/pages/settings/Wallets.tsx
+++ b/pages/settings/Wallets.tsx
@@ -1,4 +1,4 @@
-import { Link, Stack } from "expo-router";
+import { Link } from "expo-router";
import { Pressable, View } from "react-native";
import { FlatList } from "react-native";
import { Settings2, Wallet2 } from "~/components/Icons";
@@ -8,6 +8,7 @@ import { Text } from "~/components/ui/text";
import { DEFAULT_WALLET_NAME } from "~/lib/constants";
import { useAppStore } from "~/lib/state/appStore";
import { cn } from "~/lib/utils";
+import Screen from "~/components/Screen";
export function Wallets() {
const selectedWalletId = useAppStore((store) => store.selectedWalletId);
@@ -15,10 +16,8 @@ export function Wallets() {
return (
<>
-
-
diff --git a/pages/settings/wallets/EditWallet.tsx b/pages/settings/wallets/EditWallet.tsx
index 9afb669..f4ee73b 100644
--- a/pages/settings/wallets/EditWallet.tsx
+++ b/pages/settings/wallets/EditWallet.tsx
@@ -1,4 +1,4 @@
-import { Link, router, Stack } from "expo-router";
+import { Link, router } from "expo-router";
import { Alert, Pressable, View } from "react-native";
import Toast from "react-native-toast-message";
@@ -12,31 +12,30 @@ import { Text } from "~/components/ui/text";
import { DEFAULT_WALLET_NAME } from "~/lib/constants";
import { useAppStore } from "~/lib/state/appStore";
import * as Clipboard from "expo-clipboard";
+import Screen from "~/components/Screen";
export function EditWallet() {
const selectedWalletId = useAppStore((store) => store.selectedWalletId);
const wallets = useAppStore((store) => store.wallets);
return (
-
{(wallets[selectedWalletId].nwcCapabilities || []).indexOf(
"notifications",
) < 0 && (
-
- Warning: Your wallet does not support notifications capability.
-
- )}
+
+ Warning: Your wallet does not support notifications capability.
+
+ )}
{(wallets[selectedWalletId].nwcCapabilities || []).indexOf(
"list_transactions",
) < 0 && (
-
- Warning: Your wallet does not support list_transactions capability.
-
- )}
+
+ Warning: Your wallet does not support list_transactions capability.
+
+ )}
diff --git a/pages/settings/wallets/LightningAddress.tsx b/pages/settings/wallets/LightningAddress.tsx
index d6fb656..746d0d4 100644
--- a/pages/settings/wallets/LightningAddress.tsx
+++ b/pages/settings/wallets/LightningAddress.tsx
@@ -1,4 +1,4 @@
-import { Stack, router } from "expo-router";
+import { router } from "expo-router";
import React from "react";
import { Keyboard, TouchableWithoutFeedback, View } from "react-native";
import Toast from "react-native-toast-message";
@@ -6,6 +6,7 @@ import { Button } from "~/components/ui/button";
import { Input } from "~/components/ui/input";
import { Text } from "~/components/ui/text";
import { useAppStore } from "~/lib/state/appStore";
+import Screen from "~/components/Screen";
export function LightningAddress() {
const selectedWalletId = useAppStore((store) => store.selectedWalletId);
@@ -22,10 +23,8 @@ export function LightningAddress() {
>
-
Lightning Address
diff --git a/pages/settings/wallets/NewWallet.tsx b/pages/settings/wallets/NewWallet.tsx
index ae05be7..3660ca1 100644
--- a/pages/settings/wallets/NewWallet.tsx
+++ b/pages/settings/wallets/NewWallet.tsx
@@ -1,4 +1,4 @@
-import { Stack, router } from "expo-router";
+import { router } from "expo-router";
import React from "react";
import { Keyboard, TouchableWithoutFeedback, View } from "react-native";
import Toast from "react-native-toast-message";
@@ -7,6 +7,7 @@ import { Input } from "~/components/ui/input";
import { Label } from "~/components/ui/label";
import { Text } from "~/components/ui/text";
import { useAppStore } from "~/lib/state/appStore";
+import Screen from "~/components/Screen";
export function NewWallet() {
const [name, setName] = React.useState("");
@@ -17,10 +18,8 @@ export function NewWallet() {
}}
>
-
diff --git a/pages/settings/wallets/RenameWallet.tsx b/pages/settings/wallets/RenameWallet.tsx
index dccf4f2..2862b32 100644
--- a/pages/settings/wallets/RenameWallet.tsx
+++ b/pages/settings/wallets/RenameWallet.tsx
@@ -1,4 +1,4 @@
-import { Stack, router } from "expo-router";
+import { router } from "expo-router";
import React from "react";
import { Keyboard, TouchableWithoutFeedback, View } from "react-native";
import Toast from "react-native-toast-message";
@@ -7,6 +7,7 @@ import { Input } from "~/components/ui/input";
import { Text } from "~/components/ui/text";
import { DEFAULT_WALLET_NAME } from "~/lib/constants";
import { useAppStore } from "~/lib/state/appStore";
+import Screen from "~/components/Screen";
export function RenameWallet() {
const selectedWalletId = useAppStore((store) => store.selectedWalletId);
@@ -21,10 +22,8 @@ export function RenameWallet() {
}}
>
-
Wallet Name
diff --git a/pages/settings/wallets/WalletConnection.tsx b/pages/settings/wallets/WalletConnection.tsx
index 3ef88e4..3bb0909 100644
--- a/pages/settings/wallets/WalletConnection.tsx
+++ b/pages/settings/wallets/WalletConnection.tsx
@@ -5,7 +5,7 @@ import { nwc } from "@getalby/sdk";
import { ClipboardPaste, X } from "~/components/Icons";
import { useAppStore } from "lib/state/appStore";
import { Camera } from "expo-camera/legacy"; // TODO: check if Android camera detach bug is fixed and update camera
-import { router, Stack } from "expo-router";
+import { router } from "expo-router";
import { Button } from "~/components/ui/button";
import { useInfo } from "~/hooks/useInfo";
import { useBalance } from "~/hooks/useBalance";
@@ -14,6 +14,7 @@ import { errorToast } from "~/lib/errorToast";
import { Nip47Capability } from "@getalby/sdk/dist/NWCClient";
import Loading from "~/components/Loading";
import QRCodeScanner from "~/components/QRCodeScanner";
+import Screen from "~/components/Screen";
export function WalletConnection() {
const hasConnection = useAppStore((store) => !!store.nwcClient);
@@ -50,10 +51,7 @@ export function WalletConnection() {
connect(nostrWalletConnectUrl);
}
- async function connect(
- nostrWalletConnectUrl: string,
- lightningAddress?: string,
- ) {
+ async function connect(nostrWalletConnectUrl: string) {
try {
setConnecting(true);
// make sure connection is valid
@@ -69,7 +67,7 @@ export function WalletConnection() {
useAppStore.getState().setNostrWalletConnectUrl(nostrWalletConnectUrl);
useAppStore.getState().updateCurrentWallet({
nwcCapabilities: capabilities,
- ...(lightningAddress ? { lightningAddress } : {}),
+ ...(nwcClient.lud16 ? { lightningAddress: nwcClient.lud16 } : {}),
});
useAppStore.getState().setNWCClient(nwcClient);
if (router.canDismiss()) {
@@ -90,25 +88,22 @@ export function WalletConnection() {
return (
<>
- (
- {
- useAppStore
- .getState()
- .setSelectedWalletId(walletIdWithConnection);
- router.replace("/");
- }}
- >
-
-
- )
- : undefined,
- }}
+
+ walletIdWithConnection !== -1 ? (
+ {
+ useAppStore
+ .getState()
+ .setSelectedWalletId(walletIdWithConnection);
+ router.replace("/");
+ }}
+ >
+
+
+ ) : null
+ }
/>
{hasConnection && (
diff --git a/yarn.lock b/yarn.lock
index 3fc3523..631d071 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1280,10 +1280,10 @@
resolved "https://registry.yarnpkg.com/@getalby/lightning-tools/-/lightning-tools-5.0.3.tgz#4cc6ef1253a30fb4913af89b842645e0c04994bf"
integrity sha512-QG3/SBI5n2py5IgsjP3K+c8eq55eiI3PQB12yo9Pot0b5hcN7TNNoTKn0fgLJjO1iEVCUkF513kDOpjjXwK0hQ==
-"@getalby/sdk@^3.6.1":
- version "3.6.1"
- resolved "https://registry.yarnpkg.com/@getalby/sdk/-/sdk-3.6.1.tgz#b25dfd254572a44072a47cf677fcf647b0b19515"
- integrity sha512-hg3WvRXQUf9S9NE1QZaz50IrOOnBr0QehlTRBENX2wRbZPSdpuyVOc4LWyI9tme8hOabeLbNpEl6iMZ7gZENwQ==
+"@getalby/sdk@^3.7.0":
+ version "3.7.0"
+ resolved "https://registry.yarnpkg.com/@getalby/sdk/-/sdk-3.7.0.tgz#bff8ce2b2138a5860f24d48323c1219ecb6dbf5d"
+ integrity sha512-GorSxIErXm5nbM819Ib3aOyjqH0N4YyUqcD7yAQAgm/ejPpV8vTV0btp2cYl1XtYyHzZEcffDMt8luCOYCekJw==
dependencies:
eventemitter3 "^5.0.1"
nostr-tools "^1.17.0"
@@ -7039,7 +7039,16 @@ strict-uri-encode@^2.0.0:
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546"
integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==
-"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
+"string-width-cjs@npm:string-width@^4.2.0":
+ version "4.2.3"
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
+ integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
+ dependencies:
+ emoji-regex "^8.0.0"
+ is-fullwidth-code-point "^3.0.0"
+ strip-ansi "^6.0.1"
+
+string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -7099,7 +7108,7 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"
-"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
+"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -7113,6 +7122,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0:
dependencies:
ansi-regex "^4.1.0"
+strip-ansi@^6.0.0, strip-ansi@^6.0.1:
+ version "6.0.1"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
+ integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
+ dependencies:
+ ansi-regex "^5.0.1"
+
strip-ansi@^7.0.1:
version "7.1.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
@@ -7831,7 +7847,7 @@ wonka@^6.3.2:
resolved "https://registry.yarnpkg.com/wonka/-/wonka-6.3.4.tgz#76eb9316e3d67d7febf4945202b5bdb2db534594"
integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg==
-"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
+"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -7849,6 +7865,15 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"
+wrap-ansi@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
+ integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
+ dependencies:
+ ansi-styles "^4.0.0"
+ string-width "^4.1.0"
+ strip-ansi "^6.0.0"
+
wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"