forked from cashubtc/cashu.me
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Erik Brakke
committed
May 4, 2023
1 parent
7099563
commit 4696d4b
Showing
2 changed files
with
43 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { defineStore } from "pinia"; | ||
import { useMintsStore } from "./mints"; | ||
import { useLocalStorage } from "@vueuse/core"; | ||
|
||
export const useWalletStore = defineStore("wallet", { | ||
state: () => { | ||
return { | ||
invoiceHistory: useLocalStorage("cashu.invoiceHistory", []), | ||
invoiceData: { | ||
amount: 0, | ||
memo: "", | ||
bolt11: "", | ||
hash: "", | ||
}, | ||
payInvoiceData: { | ||
blocking: false, | ||
bolt11: "", | ||
show: false, | ||
invoice: null, | ||
lnurlpay: null, | ||
lnurlauth: null, | ||
data: { | ||
request: "", | ||
amount: 0, | ||
comment: "", | ||
}, | ||
}, | ||
}; | ||
}, | ||
getters: { | ||
wallet() { | ||
const mints = useMintsStore(); | ||
const wallet = new CashuWallet(mints.keys, mints.activeMint); | ||
return wallet; | ||
}, | ||
}, | ||
}); |