diff --git a/src/components/SettingsView.vue b/src/components/SettingsView.vue
index 01eeee6e..c980c178 100644
--- a/src/components/SettingsView.vue
+++ b/src/components/SettingsView.vue
@@ -238,100 +238,6 @@
-
-
@@ -339,14 +245,22 @@
Lightning address
This is your lightning address. Enable it to check for incoming
- payments at startup.Your Lightning address is generated from your nostr
+ keys.
+
+
+
+
-
-
-
+
+
+
+ Claim automatically
+ Receive incoming payments automatically when the wallet is
+ started.
+
+
+
+
+
+
+
+
+ Your nostr keys
+ Link your wallet to a nostr account to generate your
+ Lightning address.
+
+
+
+
+
+
+
+
+ Wallet seed phrase
+ Generate nostr key pair from seed
+
+
+
+
+
+
+
+
+
+ Nsec Bunker
+ Use a NIP-46 bunker
+
+
+ Delete connection
+
+
+
+
+
+
+
+
+ Use your nsec
+ Enter your nostr private key
+
+
+
+ Delete nsec
+
+
+
+
+
+
+
+
+ Signing extension
+ Use a NIP-07 signing extension
+
+ No NIP-07 signing extension found
+
+
+
+
+
+
+
+
Link wallet
@@ -783,7 +850,7 @@ export default defineComponent({
...mapState(useNPCStore, ["npcAddress"]),
...mapState(useNostrStore, ["pubkey", "mintRecommendations", "signerType"]),
...mapState(useWalletStore, ["mnemonic"]),
- ...mapWritableState(useNPCStore, ["npcEnabled"]),
+ ...mapWritableState(useNPCStore, ["npcEnabled", "automaticClaim"]),
...mapWritableState(useWalletStore, ["keysetCounters"]),
...mapWritableState(useMintsStore, [
"addMintData",
@@ -818,6 +885,13 @@ export default defineComponent({
this.unsubscribeNWC();
}
},
+ npcEnabled: function () {
+ if (this.npcEnabled) {
+ this.generateNPCConnection();
+ } else {
+ this.npcAddress = "";
+ }
+ },
},
methods: {
...mapActions(useNostrStore, [
diff --git a/src/stores/nostr.ts b/src/stores/nostr.ts
index 4c3bf659..e9d0002e 100644
--- a/src/stores/nostr.ts
+++ b/src/stores/nostr.ts
@@ -123,7 +123,7 @@ export const useNostrStore = defineStore("nostr", {
},
resetNip46Signer: async function () {
this.nip46Token = "";
- await this.initNip46Signer();
+ await this.initWalletSeedPrivateKeySigner();
},
initPrivateKeySigner: async function (nsec?: string) {
if (!nsec && !this.privateKeySignerPrivateKey.length) {
diff --git a/src/stores/npubcash.ts b/src/stores/npubcash.ts
index 09e6aa34..80d3c9b9 100644
--- a/src/stores/npubcash.ts
+++ b/src/stores/npubcash.ts
@@ -55,6 +55,7 @@ const NIP98Kind = 27235;
export const useNPCStore = defineStore("npc", {
state: () => ({
npcEnabled: useLocalStorage("cashu.npc.enabled", false),
+ automaticClaim: useLocalStorage("cashu.npc.automaticClaim", false),
// npcConnections: useLocalStorage("cashu.npc.connections", []),
npcAddress: useLocalStorage("cashu.npc.address", ""),
npcDomain: useLocalStorage("cashu.npc.domain", "npub.cash"),
@@ -79,14 +80,19 @@ export const useNPCStore = defineStore("npc", {
// add token to history first
this.addPendingTokenToHistory(token)
receiveStore.receiveData.tokensBase64 = token;
- try {
- // redeem token automatically
- const walletStore = useWalletStore()
- await walletStore.redeem()
- } catch {
- // if it doesn't work, show the receive window
+ if (this.automaticClaim) {
+ try {
+ // redeem token automatically
+ const walletStore = useWalletStore()
+ await walletStore.redeem()
+ } catch {
+ // if it doesn't work, show the receive window
+ receiveStore.showReceiveTokens = true;
+ }
+ } else {
receiveStore.showReceiveTokens = true;
}
+
// this.storeUnclaimedProofs(token)
// const proofsToClaim = this.getUnclaimedProofs(token)
// const proofsStore = useProofsStore()
@@ -156,11 +162,16 @@ export const useNPCStore = defineStore("npc", {
},
generateNPCConnection: async function () {
const nostrStore = useNostrStore()
- // await nostrStore.initSigner()
+ if (!nostrStore.pubkey) {
+ return
+ }
const walletPublicKeyHex = nostrStore.pubkey
console.log('Lightning address for wallet:', nip19.npubEncode(walletPublicKeyHex) + '@' + this.npcDomain)
console.log('npub:', nip19.npubEncode(walletPublicKeyHex))
this.baseURL = `https://${this.npcDomain}`
+ if (!this.npcEnabled) {
+ return
+ }
// get info
const info = await this.getInfo()
if (info.error) {