+
+ {transactions.length == 0 && (
+
+ }
+ onClick={() => {
+ utils.openUrl(
+ "https://guides.getalby.com/user-guide/v/alby-account-and-browser-extension/"
+ );
+ }}
+ />
+ )}
+
+ {!(
+ currentAccount?.hasMnemonic &&
+ currentAccount?.isMnemonicBackupDone
+ ) && (
+
+ }
+ onClick={async () => {
+ if (currentAccount?.hasMnemonic) {
+ openOptions(
+ `accounts/${currentAccount?.id}/secret-key/backup`
+ );
+ } else {
+ openOptions(
+ `accounts/${currentAccount?.id}/secret-key/new`
+ );
+ }
+ }}
+ />
+ )}
+
+ {transactions.length == 0 && (
+
+ }
+ onClick={() => {
+ navigate("/receive");
+ }}
+ />
+ )}
+
+ {!(
+ currentAccount?.hasMnemonic &&
+ currentAccount?.isMnemonicBackupDone
+ ) && (
+
+ }
+ onClick={async () => {
+ openOptions(
+ `accounts/${currentAccount?.id}/secret-key/import`
+ );
+ }}
+ />
+ )}
+
{!isLoading && transactions.length > 0 && (
diff --git a/src/app/screens/Receive/index.tsx b/src/app/screens/Receive/index.tsx
index 9558692df9..fb913cc41e 100644
--- a/src/app/screens/Receive/index.tsx
+++ b/src/app/screens/Receive/index.tsx
@@ -1,12 +1,12 @@
import {
- BitcoinCircleIcon,
+ BitcoinIcon,
CaretLeftIcon,
CopyIcon,
- LightningIcon,
} from "@bitcoin-design/bitcoin-icons-react/outline";
import Container from "@components/Container";
import Header from "@components/Header";
import IconButton from "@components/IconButton";
+import { PopiconsBoltLine, PopiconsWithdrawalLine } from "@popicons/react";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
@@ -15,7 +15,6 @@ import QRCode from "~/app/components/QRCode";
import SkeletonLoader from "~/app/components/SkeletonLoader";
import toast from "~/app/components/Toast";
import { useAccount } from "~/app/context/AccountContext";
-import RedeemIcon from "~/app/icons/RedeemIcon";
import { isAlbyLNDHubAccount, isAlbyOAuthAccount } from "~/app/utils";
import api from "~/common/lib/api";
import { IconLinkCard } from "../../components/IconLinkCard/IconLinkCard";
@@ -123,7 +122,9 @@ function Receive() {
}
+ icon={
+
+ }
onClick={() => {
navigate("/receive/invoice");
}}
@@ -132,7 +133,9 @@ function Receive() {
}
+ icon={
+
+ }
onClick={() => {
navigate("/onChainReceive");
}}
@@ -141,7 +144,9 @@ function Receive() {
}
+ icon={
+
+ }
onClick={() => {
navigate("/lnurlRedeem");
}}
diff --git a/src/common/lib/api.ts b/src/common/lib/api.ts
index 19ddfd1bfe..fb8375ec8c 100644
--- a/src/common/lib/api.ts
+++ b/src/common/lib/api.ts
@@ -57,6 +57,7 @@ export interface GetAccountRes extends Pick
{
liquidEnabled: boolean;
nostrEnabled: boolean;
hasMnemonic: boolean;
+ isMnemonicBackupDone: boolean;
hasImportedNostrKey: boolean;
bitcoinNetwork: BitcoinNetworkType;
useMnemonicForLnurlAuth: boolean;
diff --git a/src/extension/background-script/actions/accounts/__tests__/add.test.ts b/src/extension/background-script/actions/accounts/__tests__/add.test.ts
index 1b6f108575..1948d04cbb 100644
--- a/src/extension/background-script/actions/accounts/__tests__/add.test.ts
+++ b/src/extension/background-script/actions/accounts/__tests__/add.test.ts
@@ -28,6 +28,7 @@ const message: MessageAccountAdd = {
config: "123456config",
name: "purple",
nostrPrivateKey: "123456nostr",
+ isMnemonicBackupDone: false,
},
origin: { internal: true },
prompt: true,
@@ -59,6 +60,7 @@ describe("add account to account-list", () => {
config: "secret-config-string-42",
name: "purple",
nostrPrivateKey: "123456nostr",
+ isMnemonicBackupDone: false,
},
},
});
@@ -107,6 +109,7 @@ describe("add account to account-list", () => {
config: "secret-config-string-42",
name: "purple",
nostrPrivateKey: "123456nostr",
+ isMnemonicBackupDone: false,
},
"666": {
config: "xyz",
diff --git a/src/extension/background-script/actions/accounts/__tests__/get.test.ts b/src/extension/background-script/actions/accounts/__tests__/get.test.ts
index 6022ed3c94..71f714eb89 100644
--- a/src/extension/background-script/actions/accounts/__tests__/get.test.ts
+++ b/src/extension/background-script/actions/accounts/__tests__/get.test.ts
@@ -30,6 +30,7 @@ const mockState = {
mnemonic: btcFixture.mnemonic,
bitcoinNetwork: "regtest",
useMnemonicForLnurlAuth: true,
+ isMnemonicBackupDone: true,
},
"1e1e8ea6-493e-480b-9855-303d37506e97": {
config: "config-123-456",
@@ -65,6 +66,7 @@ describe("account info", () => {
hasImportedNostrKey: true,
bitcoinNetwork: "bitcoin",
useMnemonicForLnurlAuth: false,
+ isMnemonicBackupDone: true,
};
expect(await getAccount(message)).toStrictEqual({
@@ -92,6 +94,7 @@ describe("account info", () => {
hasImportedNostrKey: true,
bitcoinNetwork: "regtest",
useMnemonicForLnurlAuth: true,
+ isMnemonicBackupDone: true,
};
expect(await getAccount(message)).toStrictEqual({
diff --git a/src/extension/background-script/actions/accounts/add.ts b/src/extension/background-script/actions/accounts/add.ts
index df38e0d0ad..29e8f9eda2 100644
--- a/src/extension/background-script/actions/accounts/add.ts
+++ b/src/extension/background-script/actions/accounts/add.ts
@@ -27,6 +27,7 @@ const add = async (message: MessageAccountAdd) => {
...newAccount,
id: accountId,
name,
+ isMnemonicBackupDone: false,
};
const mnemonic = await generateMnemonic({
diff --git a/src/extension/background-script/actions/accounts/edit.ts b/src/extension/background-script/actions/accounts/edit.ts
index 597b56e2bb..262c48fb75 100644
--- a/src/extension/background-script/actions/accounts/edit.ts
+++ b/src/extension/background-script/actions/accounts/edit.ts
@@ -22,6 +22,11 @@ const edit = async (message: MessageAccountEdit) => {
message.args.useMnemonicForLnurlAuth;
}
+ if (message.args.isMnemonicBackupDone !== undefined) {
+ accounts[accountId].isMnemonicBackupDone =
+ message.args.isMnemonicBackupDone;
+ }
+
state.setState({ accounts });
// make sure we immediately persist the updated accounts
await state.getState().saveToStorage();
diff --git a/src/extension/background-script/actions/accounts/get.ts b/src/extension/background-script/actions/accounts/get.ts
index bffb228e67..7d102a892c 100644
--- a/src/extension/background-script/actions/accounts/get.ts
+++ b/src/extension/background-script/actions/accounts/get.ts
@@ -22,6 +22,10 @@ const get = async (message: MessageAccountGet) => {
liquidEnabled: !!account.mnemonic,
nostrEnabled: !!account.nostrPrivateKey,
hasMnemonic: !!account.mnemonic,
+ // for existing accounts consider mnemonic backup already done
+ isMnemonicBackupDone: account.isMnemonicBackupDone
+ ? account.isMnemonicBackupDone
+ : true,
// Note: undefined (default for new accounts) it is also considered imported
hasImportedNostrKey: account.hasImportedNostrKey !== false,
bitcoinNetwork: account.bitcoinNetwork || "bitcoin",
diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json
index 19c7ed1e4d..2c5364eff4 100644
--- a/src/i18n/locales/en/translation.json
+++ b/src/i18n/locales/en/translation.json
@@ -373,7 +373,26 @@
"is_blocked_hint": "Alby is currently disabled on {{host}}",
"block_removed": "Enabled {{host}}. Please reload the website.",
"no_transactions": "No transactions for this account yet.",
- "see_all": "See all"
+ "see_all": "See all",
+ "actions": {
+ "get_started": {
+ "title": "Get Started With Alby Extension",
+ "description": "New to Alby Extension? Check out our guides, videos, and explanations"
+ },
+ "backup_masterkey": {
+ "title": "Back up your Master Key",
+ "description": "Learn what Master Key is, how it’s used for Nostr and make sure to back up"
+ },
+
+ "receive_bitcoin": {
+ "title": "Receive bitcoin",
+ "description": "Get bitcoin to your lightning address, a lightning invoice or bitcoin address."
+ },
+ "import_masterkey": {
+ "title": "Import your Master Key",
+ "description": "If you already have a Master Key, you can import it using recovery phrase"
+ }
+ }
}
},
"accounts": {
diff --git a/src/types.ts b/src/types.ts
index 6bc4f7f414..9d2a499e59 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -25,6 +25,7 @@ export interface Account {
mnemonic?: string | null;
hasImportedNostrKey?: boolean;
bitcoinNetwork?: BitcoinNetworkType;
+ isMnemonicBackupDone?: boolean;
useMnemonicForLnurlAuth?: boolean;
avatarUrl?: string;
}
@@ -231,6 +232,7 @@ export interface MessageAccountEdit extends MessageDefault {
name?: Account["name"];
bitcoinNetwork?: BitcoinNetworkType;
useMnemonicForLnurlAuth?: boolean;
+ isMnemonicBackupDone?: boolean;
};
action: "editAccount";
}