diff --git a/apps/desktop2/package.json b/apps/desktop2/package.json
index 763359f7..fb531acf 100644
--- a/apps/desktop2/package.json
+++ b/apps/desktop2/package.json
@@ -26,6 +26,7 @@
"i18next-resources-to-backend": "^1.2.0",
"nostr-tools": "^2.3.1",
"react": "^18.2.0",
+ "react-currency-input-field": "^3.8.0",
"react-dom": "^18.2.0",
"react-i18next": "^14.0.5",
"slate": "^0.101.5",
diff --git a/apps/desktop2/src/components/balance.tsx b/apps/desktop2/src/components/balance.tsx
new file mode 100644
index 00000000..5be1f4ec
--- /dev/null
+++ b/apps/desktop2/src/components/balance.tsx
@@ -0,0 +1,51 @@
+import { useArk } from "@lume/ark";
+import { User } from "@lume/ui";
+import { getBitcoinDisplayValues } from "@lume/utils";
+import { useEffect, useMemo, useState } from "react";
+import { useTranslation } from "react-i18next";
+
+export function Balance({
+ recipient,
+ account,
+}: {
+ recipient: string;
+ account: string;
+}) {
+ const [t] = useTranslation();
+ const [balance, setBalance] = useState(0);
+
+ const ark = useArk();
+ const value = useMemo(() => getBitcoinDisplayValues(balance), [balance]);
+
+ useEffect(() => {
+ async function getBalance() {
+ const val = await ark.get_balance();
+ setBalance(val);
+ }
+
+ getBalance();
+ }, []);
+
+ return (
+
+
+
+
+ Your balance
+
+
+ ₿ {value.bitcoinFormatted}
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/apps/desktop2/src/routes/nwc.lazy.tsx b/apps/desktop2/src/routes/nwc.lazy.tsx
index ade7af10..97c952ab 100644
--- a/apps/desktop2/src/routes/nwc.lazy.tsx
+++ b/apps/desktop2/src/routes/nwc.lazy.tsx
@@ -25,37 +25,43 @@ function Screen() {
return (
-
-
-
-
-
-
- Connect bitcoin wallet to
- start zapping to your favorite content and creator.
-
-
-
-
-
-
-
-
-
+ {!isDone ? (
+ <>
+
+
+
+
+
+
+ Connect bitcoin wallet{" "}
+ to start zapping to your favorite content and creator.
+
+
+
+
+
+
+
+
+
+ >
+ ) : (
+
Done
+ )}
);
diff --git a/apps/desktop2/src/routes/zap.$id.lazy.tsx b/apps/desktop2/src/routes/zap.$id.lazy.tsx
new file mode 100644
index 00000000..c86fb900
--- /dev/null
+++ b/apps/desktop2/src/routes/zap.$id.lazy.tsx
@@ -0,0 +1,108 @@
+import { Balance } from "@/components/balance";
+import { useArk } from "@lume/ark";
+import { Box, Container, User } from "@lume/ui";
+import { createLazyFileRoute } from "@tanstack/react-router";
+import { useState } from "react";
+import { useTranslation } from "react-i18next";
+import CurrencyInput from "react-currency-input-field";
+
+const DEFAULT_VALUES = [69, 100, 200, 500];
+
+export const Route = createLazyFileRoute("/zap/$id")({
+ component: Screen,
+});
+
+function Screen() {
+ const { t } = useTranslation();
+ const { id } = Route.useParams();
+ // @ts-ignore, magic !!!
+ const { pubkey, account } = Route.useSearch();
+
+ const [amount, setAmount] = useState(21);
+ const [message, setMessage] = useState("");
+ const [isCompleted, setIsCompleted] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
+
+ const ark = useArk();
+
+ const submit = async () => {
+ const val = await ark.zap_event(id, amount, message);
+ console.log(val);
+ };
+
+ return (
+
+
+
+
+
+ {t("note.zap.modalTitle")}{" "}
+
+
+
+
+
+
+
+
+
+
+ setAmount(Number(value))}
+ className="w-full flex-1 border-none bg-transparent text-right text-4xl font-semibold placeholder:text-neutral-600 focus:outline-none focus:ring-0 dark:text-neutral-400"
+ />
+
+ sats
+
+
+
+ {DEFAULT_VALUES.map((value) => (
+
+ ))}
+
+
+
+
setMessage(e.target.value)}
+ spellCheck={false}
+ autoComplete="off"
+ autoCorrect="off"
+ autoCapitalize="off"
+ placeholder={t("note.zap.messagePlaceholder")}
+ className="h-11 w-full resize-none rounded-lg border-transparent bg-neutral-100 px-3 !outline-none placeholder:text-neutral-600 focus:border-blue-500 focus:ring focus:ring-blue-200 dark:bg-neutral-950 dark:text-neutral-400"
+ />
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/packages/ark/src/ark.ts b/packages/ark/src/ark.ts
index 19bcf928..f41b01c3 100644
--- a/packages/ark/src/ark.ts
+++ b/packages/ark/src/ark.ts
@@ -404,17 +404,26 @@ export class Ark {
try {
const cmd: boolean = await invoke("set_nwc", { uri });
return cmd;
- } catch {
- return false;
+ } catch (e) {
+ throw new Error(String(e));
}
}
- public async nwc_status() {
+ public async load_nwc() {
try {
- const cmd: boolean = await invoke("nwc_status");
+ const cmd: boolean = await invoke("load_nwc");
return cmd;
- } catch {
- return false;
+ } catch (e) {
+ throw new Error(String(e));
+ }
+ }
+
+ public async get_balance() {
+ try {
+ const cmd: number = await invoke("get_balance");
+ return cmd;
+ } catch (e) {
+ throw new Error(String(e));
}
}
@@ -422,8 +431,8 @@ export class Ark {
try {
const cmd: boolean = await invoke("zap_profile", { id, amount, message });
return cmd;
- } catch {
- return false;
+ } catch (e) {
+ throw new Error(String(e));
}
}
@@ -431,8 +440,8 @@ export class Ark {
try {
const cmd: boolean = await invoke("zap_event", { id, amount, message });
return cmd;
- } catch {
- return false;
+ } catch (e) {
+ throw new Error(String(e));
}
}
@@ -486,8 +495,7 @@ export class Ark {
return content.url as string;
} catch (e) {
- console.error(String(e));
- return null;
+ throw new Error(String(e));
}
}
@@ -549,7 +557,16 @@ export class Ark {
});
}
- public open_zap() {
- // todo
+ public open_zap(id: string, pubkey: string, account: string) {
+ return new WebviewWindow(`zap-${id}`, {
+ title: "Nostr Wallet Connect",
+ url: `/zap/${id}?pubkey=${pubkey}&account=${account}`,
+ minWidth: 400,
+ width: 400,
+ height: 500,
+ hiddenTitle: true,
+ titleBarStyle: "overlay",
+ fileDropEnabled: true,
+ });
}
}
diff --git a/packages/ui/src/note/buttons/zap.tsx b/packages/ui/src/note/buttons/zap.tsx
index 3e3c193e..c01dfe82 100644
--- a/packages/ui/src/note/buttons/zap.tsx
+++ b/packages/ui/src/note/buttons/zap.tsx
@@ -1,15 +1,22 @@
import { useArk } from "@lume/ark";
import { ZapIcon } from "@lume/icons";
+import { toast } from "sonner";
+import { useNoteContext } from "../provider";
export function NoteZap() {
const ark = useArk();
+ const event = useNoteContext();
const zap = async () => {
- const nwc = await ark.nwc_status();
- if (!nwc) {
- ark.open_nwc();
- } else {
- ark.open_zap();
+ try {
+ const nwc = await ark.load_nwc();
+ if (!nwc) {
+ ark.open_nwc();
+ } else {
+ ark.open_zap(event.id, event.pubkey);
+ }
+ } catch (e) {
+ toast.error(String(e));
}
};
diff --git a/packages/utils/package.json b/packages/utils/package.json
index b1214bc0..de777c07 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -9,6 +9,7 @@
},
"dependencies": {
"@tanstack/react-query": "^5.24.1",
+ "bitcoin-units": "^1.0.0",
"clsx": "^2.1.0",
"dayjs": "^1.11.10",
"nostr-tools": "^2.3.1",
diff --git a/packages/utils/src/formater.ts b/packages/utils/src/formater.ts
index 9d0e511b..9532b58e 100644
--- a/packages/utils/src/formater.ts
+++ b/packages/utils/src/formater.ts
@@ -3,6 +3,7 @@ import relativeTime from "dayjs/plugin/relativeTime";
import updateLocale from "dayjs/plugin/updateLocale";
import { nip19 } from "nostr-tools";
import { AUDIOS, IMAGES, VIDEOS } from "./constants";
+import { BitcoinUnit } from "bitcoin-units";
dayjs.extend(relativeTime);
dayjs.extend(updateLocale);
@@ -89,3 +90,34 @@ export function canPreview(text: string) {
return true;
}
+
+// source: https://github.com/synonymdev/bitkit/blob/master/src/utils/displayValues/index.ts
+export function getBitcoinDisplayValues(satoshis: number) {
+ let bitcoinFormatted = new BitcoinUnit(satoshis, "satoshis")
+ .getValue()
+ .toFixed(10)
+ .replace(/\.?0+$/, "");
+
+ const [bitcoinWhole, bitcoinDecimal] = bitcoinFormatted.split(".");
+
+ // format sats to group thousands
+ // 4000000 -> 4 000 000
+ let res = "";
+ bitcoinFormatted
+ .split("")
+ .reverse()
+ .forEach((c, index) => {
+ if (index > 0 && index % 3 === 0) {
+ res = " " + res;
+ }
+ res = c + res;
+ });
+
+ bitcoinFormatted = res;
+
+ return {
+ bitcoinFormatted,
+ bitcoinWhole,
+ bitcoinDecimal,
+ };
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 62c91ae0..06380c33 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -111,6 +111,9 @@ importers:
react:
specifier: ^18.2.0
version: 18.2.0
+ react-currency-input-field:
+ specifier: ^3.8.0
+ version: 3.8.0(react@18.2.0)
react-dom:
specifier: ^18.2.0
version: 18.2.0(react@18.2.0)
@@ -874,19 +877,19 @@ importers:
version: 1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-collapsible':
specifier: ^1.0.3
- version: 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ version: 1.0.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-dialog':
specifier: ^1.0.5
- version: 1.0.5(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ version: 1.0.5(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-dropdown-menu':
specifier: ^2.0.6
- version: 2.0.6(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ version: 2.0.6(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-hover-card':
specifier: ^1.0.7
version: 1.0.7(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-popover':
specifier: ^1.0.7
- version: 1.0.7(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ version: 1.0.7(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-tooltip':
specifier: ^1.0.7
version: 1.0.7(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
@@ -984,6 +987,9 @@ importers:
'@tanstack/react-query':
specifier: ^5.24.1
version: 5.24.1(react@18.2.0)
+ bitcoin-units:
+ specifier: ^1.0.0
+ version: 1.0.0
clsx:
specifier: ^2.1.0
version: 2.1.0
@@ -1882,13 +1888,13 @@ packages:
dependencies:
'@babel/runtime': 7.24.0
'@radix-ui/primitive': 1.0.1
- '@radix-ui/react-collapsible': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-collection': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-collapsible': 1.0.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
'@radix-ui/react-context': 1.0.1(@types/react@18.2.61)(react@18.2.0)
'@radix-ui/react-direction': 1.0.1(@types/react@18.2.61)(react@18.2.0)
'@radix-ui/react-id': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.61)(react@18.2.0)
'@types/react': 18.2.61
react: 18.2.0
@@ -1912,8 +1918,8 @@ packages:
'@radix-ui/primitive': 1.0.1
'@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
'@radix-ui/react-context': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-dialog': 1.0.5(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-dialog': 1.0.5(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-slot': 1.0.2(@types/react@18.2.61)(react@18.2.0)
'@types/react': 18.2.61
react: 18.2.0
@@ -1941,26 +1947,6 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
- /@radix-ui/react-arrow@1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@types/react': 18.2.61
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- dev: false
-
/@radix-ui/react-avatar@1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-kVK2K7ZD3wwj3qhle0ElXhOjbezIgyl2hVvgwfIdexL3rN6zJmy5AqqIf+D31lxVppdzV8CjAfZ6PklkmInZLw==}
peerDependencies:
@@ -1976,7 +1962,7 @@ packages:
dependencies:
'@babel/runtime': 7.24.0
'@radix-ui/react-context': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.61)(react@18.2.0)
'@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.61)(react@18.2.0)
'@types/react': 18.2.61
@@ -2040,33 +2026,6 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
- /@radix-ui/react-collapsible@1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-UBmVDkmR6IvDsloHVN+3rtx4Mi5TFvylYXpluuv0f37dtaz3H99bp8No0LGXRigVpl3UAT4l9j6bIchh42S/Gg==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@radix-ui/primitive': 1.0.1
- '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-context': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-id': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-presence': 1.0.1(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@types/react': 18.2.61
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- dev: false
-
/@radix-ui/react-collection@1.0.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-3SzW+0PW7yBBoQlT8wNcGtaxaD0XSu0uLUFgrtHY08Acx05TaHaOmVLR73c0j/cqpDy53KBMO7s0dx2wmOIDIA==}
peerDependencies:
@@ -2091,29 +2050,6 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
- /@radix-ui/react-collection@1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-3SzW+0PW7yBBoQlT8wNcGtaxaD0XSu0uLUFgrtHY08Acx05TaHaOmVLR73c0j/cqpDy53KBMO7s0dx2wmOIDIA==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-context': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-slot': 1.0.2(@types/react@18.2.61)(react@18.2.0)
- '@types/react': 18.2.61
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- dev: false
-
/@radix-ui/react-compose-refs@1.0.1(@types/react@18.2.61)(react@18.2.0):
resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==}
peerDependencies:
@@ -2176,39 +2112,6 @@ packages:
react-remove-scroll: 2.5.5(@types/react@18.2.61)(react@18.2.0)
dev: false
- /@radix-ui/react-dialog@1.0.5(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-GjWJX/AUpB703eEBanuBnIWdIXg6NvJFCXcNlSZk4xdszCdhrJgBoUd1cGk67vFO+WdA2pfI/plOpqz/5GUP6Q==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@radix-ui/primitive': 1.0.1
- '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-context': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-dismissable-layer': 1.0.5(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-focus-guards': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-focus-scope': 1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-id': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-portal': 1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-presence': 1.0.1(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-slot': 1.0.2(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@types/react': 18.2.61
- aria-hidden: 1.2.3
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- react-remove-scroll: 2.5.5(@types/react@18.2.61)(react@18.2.0)
- dev: false
-
/@radix-ui/react-direction@1.0.1(@types/react@18.2.61)(react@18.2.0):
resolution: {integrity: sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA==}
peerDependencies:
@@ -2248,30 +2151,6 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
- /@radix-ui/react-dismissable-layer@1.0.5(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@radix-ui/primitive': 1.0.1
- '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-use-escape-keydown': 1.0.3(@types/react@18.2.61)(react@18.2.0)
- '@types/react': 18.2.61
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- dev: false
-
/@radix-ui/react-dropdown-menu@2.0.6(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-i6TuFOoWmLWq+M/eCLGd/bQ2HfAX1RJgvrBQ6AQLmzfvsLdefxbWu8G9zczcPFfcSPehz9GcpF6K9QYreFV8hA==}
peerDependencies:
@@ -2299,32 +2178,6 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
- /@radix-ui/react-dropdown-menu@2.0.6(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-i6TuFOoWmLWq+M/eCLGd/bQ2HfAX1RJgvrBQ6AQLmzfvsLdefxbWu8G9zczcPFfcSPehz9GcpF6K9QYreFV8hA==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@radix-ui/primitive': 1.0.1
- '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-context': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-id': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-menu': 2.0.6(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@types/react': 18.2.61
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- dev: false
-
/@radix-ui/react-focus-guards@1.0.1(@types/react@18.2.61)(react@18.2.0):
resolution: {integrity: sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA==}
peerDependencies:
@@ -2362,28 +2215,6 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
- /@radix-ui/react-focus-scope@1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-sL04Mgvf+FmyvZeYfNu1EPAaaxD+aw7cYeIB9L9Fvq8+urhltTRaEo5ysKOpHuKPclsZcSUMKlN05x4u+CINpA==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@types/react': 18.2.61
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- dev: false
-
/@radix-ui/react-hover-card@1.0.7(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-OcUN2FU0YpmajD/qkph3XzMcK/NmSk9hGWnjV68p6QiZMgILugusgQwnLSDs3oFSJYGKf3Y49zgFedhGh04k9A==}
peerDependencies:
@@ -2401,11 +2232,11 @@ packages:
'@radix-ui/primitive': 1.0.1
'@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
'@radix-ui/react-context': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-dismissable-layer': 1.0.5(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-popper': 1.1.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-portal': 1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-presence': 1.0.1(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-popper': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.61)(react@18.2.0)
'@types/react': 18.2.61
react: 18.2.0
@@ -2465,43 +2296,6 @@ packages:
react-remove-scroll: 2.5.5(@types/react@18.2.61)(react@18.2.0)
dev: false
- /@radix-ui/react-menu@2.0.6(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-BVkFLS+bUC8HcImkRKPSiVumA1VPOOEC5WBMiT+QAVsPzW1FJzI9KnqgGxVDPBcql5xXrHkD3JOVoXWEXD8SYA==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@radix-ui/primitive': 1.0.1
- '@radix-ui/react-collection': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-context': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-direction': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-dismissable-layer': 1.0.5(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-focus-guards': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-focus-scope': 1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-id': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-popper': 1.1.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-portal': 1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-presence': 1.0.1(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-roving-focus': 1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-slot': 1.0.2(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@types/react': 18.2.61
- aria-hidden: 1.2.3
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- react-remove-scroll: 2.5.5(@types/react@18.2.61)(react@18.2.0)
- dev: false
-
/@radix-ui/react-popover@1.0.7(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-shtvVnlsxT6faMnK/a7n0wptwBD23xc1Z5mdrtKLwVEfsEMXodS0r5s0/g5P0hX//EKYZS2sxUjqfzlg52ZSnQ==}
peerDependencies:
@@ -2537,40 +2331,6 @@ packages:
react-remove-scroll: 2.5.5(@types/react@18.2.61)(react@18.2.0)
dev: false
- /@radix-ui/react-popover@1.0.7(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-shtvVnlsxT6faMnK/a7n0wptwBD23xc1Z5mdrtKLwVEfsEMXodS0r5s0/g5P0hX//EKYZS2sxUjqfzlg52ZSnQ==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@radix-ui/primitive': 1.0.1
- '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-context': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-dismissable-layer': 1.0.5(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-focus-guards': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-focus-scope': 1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-id': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-popper': 1.1.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-portal': 1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-presence': 1.0.1(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-slot': 1.0.2(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@types/react': 18.2.61
- aria-hidden: 1.2.3
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- react-remove-scroll: 2.5.5(@types/react@18.2.61)(react@18.2.0)
- dev: false
-
/@radix-ui/react-popper@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w==}
peerDependencies:
@@ -2601,35 +2361,6 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
- /@radix-ui/react-popper@1.1.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@floating-ui/react-dom': 2.0.8(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-arrow': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-context': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-use-rect': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-use-size': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/rect': 1.0.1
- '@types/react': 18.2.61
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- dev: false
-
/@radix-ui/react-portal@1.0.4(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==}
peerDependencies:
@@ -2651,26 +2382,6 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
- /@radix-ui/react-portal@1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@types/react': 18.2.61
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- dev: false
-
/@radix-ui/react-presence@1.0.1(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==}
peerDependencies:
@@ -2693,27 +2404,6 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
- /@radix-ui/react-presence@1.0.1(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@types/react': 18.2.61
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- dev: false
-
/@radix-ui/react-primitive@1.0.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==}
peerDependencies:
@@ -2735,26 +2425,6 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
- /@radix-ui/react-primitive@1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@radix-ui/react-slot': 1.0.2(@types/react@18.2.61)(react@18.2.0)
- '@types/react': 18.2.61
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- dev: false
-
/@radix-ui/react-roving-focus@1.0.4(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-2mUg5Mgcu001VkGy+FfzZyzbmuUWzgWkj3rvv4yu+mLw03+mTzbxZHvfcGyFp2b8EkQeMkpRQ5FiA2Vr2O6TeQ==}
peerDependencies:
@@ -2784,34 +2454,6 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
- /@radix-ui/react-roving-focus@1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0):
- resolution: {integrity: sha512-2mUg5Mgcu001VkGy+FfzZyzbmuUWzgWkj3rvv4yu+mLw03+mTzbxZHvfcGyFp2b8EkQeMkpRQ5FiA2Vr2O6TeQ==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- dependencies:
- '@babel/runtime': 7.24.0
- '@radix-ui/primitive': 1.0.1
- '@radix-ui/react-collection': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-context': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-direction': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-id': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@types/react': 18.2.61
- react: 18.2.0
- react-dom: 18.2.0(react@18.2.0)
- dev: false
-
/@radix-ui/react-slot@1.0.2(@types/react@18.2.61)(react@18.2.0):
resolution: {integrity: sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==}
peerDependencies:
@@ -2844,12 +2486,12 @@ packages:
'@radix-ui/primitive': 1.0.1
'@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.61)(react@18.2.0)
'@radix-ui/react-context': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-dismissable-layer': 1.0.5(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-id': 1.0.1(@types/react@18.2.61)(react@18.2.0)
- '@radix-ui/react-popper': 1.1.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-portal': 1.0.4(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-presence': 1.0.1(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-popper': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-slot': 1.0.2(@types/react@18.2.61)(react@18.2.0)
'@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.61)(react@18.2.0)
'@radix-ui/react-visually-hidden': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
@@ -2974,7 +2616,7 @@ packages:
optional: true
dependencies:
'@babel/runtime': 7.24.0
- '@radix-ui/react-primitive': 1.0.3(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0)
'@types/react': 18.2.61
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
@@ -3992,10 +3634,20 @@ packages:
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
dev: false
+ /big.js@6.2.1:
+ resolution: {integrity: sha512-bCtHMwL9LeDIozFn+oNhhFoq+yQ3BNdnsLSASUxLciOb1vgvpHsIO1dsENiGMgbb4SkP5TrzWzRiLddn8ahVOQ==}
+ dev: false
+
/binary-extensions@2.2.0:
resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
engines: {node: '>=8'}
+ /bitcoin-units@1.0.0:
+ resolution: {integrity: sha512-brac+Ttz7ovf/8D0jQHSWHnN2hmdjxDRBStxhjO752URLJlQIFpfZxzUteSZ81UYnRNiMkvsW9WsYPDuxHfnYA==}
+ dependencies:
+ big.js: 6.2.1
+ dev: false
+
/bl@4.1.0:
resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
requiresBuild: true
diff --git a/src-tauri/capabilities/main.json b/src-tauri/capabilities/main.json
index 3d7e447d..9421989f 100644
--- a/src-tauri/capabilities/main.json
+++ b/src-tauri/capabilities/main.json
@@ -9,7 +9,7 @@
"editor",
"settings",
"nwc",
- "zap",
+ "zap-*",
"event-*",
"user-*",
"column-*"
diff --git a/src-tauri/gen/schemas/capabilities.json b/src-tauri/gen/schemas/capabilities.json
index 7fc969d9..da9a0763 100644
--- a/src-tauri/gen/schemas/capabilities.json
+++ b/src-tauri/gen/schemas/capabilities.json
@@ -1 +1 @@
-{"desktop-capability":{"identifier":"desktop-capability","description":"Capability for the desktop","local":true,"windows":["main","splash","editor","settings","nwc","zap","event-*","user-*","column-*"],"permissions":["path:default","event:default","window:default","app:default","resources:default","menu:default","tray:default","notification:allow-is-permission-granted","notification:allow-request-permission","notification:default","os:allow-locale","os:allow-platform","updater:allow-check","updater:default","window:allow-start-dragging","store:allow-get","clipboard-manager:allow-write","clipboard-manager:allow-read","webview:allow-create-webview-window","webview:allow-create-webview","dialog:allow-open","fs:allow-read-file","shell:allow-open",{"identifier":"http:default","allow":[{"url":"http://**/"},{"url":"https://**/"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"$RESOURCE/locales/*"}]}],"platforms":["linux","macOS","windows"]}}
\ No newline at end of file
+{"desktop-capability":{"identifier":"desktop-capability","description":"Capability for the desktop","local":true,"windows":["main","splash","editor","settings","nwc","zap-*","event-*","user-*","column-*"],"permissions":["path:default","event:default","window:default","app:default","resources:default","menu:default","tray:default","notification:allow-is-permission-granted","notification:allow-request-permission","notification:default","os:allow-locale","os:allow-platform","updater:allow-check","updater:default","window:allow-start-dragging","store:allow-get","clipboard-manager:allow-write","clipboard-manager:allow-read","webview:allow-create-webview-window","webview:allow-create-webview","dialog:allow-open","fs:allow-read-file","shell:allow-open",{"identifier":"http:default","allow":[{"url":"http://**/"},{"url":"https://**/"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"$RESOURCE/locales/*"}]}],"platforms":["linux","macOS","windows"]}}
\ No newline at end of file
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 0b6c3a2f..53bd5515 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -101,9 +101,9 @@ fn main() {
nostr::metadata::get_interest,
nostr::metadata::set_settings,
nostr::metadata::get_settings,
- nostr::metadata::get_nwc_status,
nostr::metadata::set_nwc,
- nostr::metadata::nwc_status,
+ nostr::metadata::load_nwc,
+ nostr::metadata::get_balance,
nostr::metadata::zap_profile,
nostr::metadata::zap_event,
nostr::event::get_event,
diff --git a/src-tauri/src/nostr/metadata.rs b/src-tauri/src/nostr/metadata.rs
index 8b71a2c9..0007e514 100644
--- a/src-tauri/src/nostr/metadata.rs
+++ b/src-tauri/src/nostr/metadata.rs
@@ -274,14 +274,6 @@ pub async fn get_settings(id: &str, state: State<'_, Nostr>) -> Result) -> Result {
- let client = &state.client;
- let zapper = client.zapper().await.is_ok();
-
- Ok(zapper)
-}
-
#[tauri::command]
pub async fn set_nwc(uri: &str, state: State<'_, Nostr>) -> Result {
let client = &state.client;
@@ -290,7 +282,7 @@ pub async fn set_nwc(uri: &str, state: State<'_, Nostr>) -> Result
if let Ok(nwc) = NWC::new(nwc_uri).await {
let keyring = Entry::new("Lume Secret Storage", "NWC").unwrap();
let _ = keyring.set_password(uri);
- let _ = client.set_zapper(nwc);
+ let _ = client.set_zapper(nwc).await;
Ok(true)
} else {
@@ -302,14 +294,45 @@ pub async fn set_nwc(uri: &str, state: State<'_, Nostr>) -> Result
}
#[tauri::command]
-pub async fn nwc_status(state: State<'_, Nostr>) -> Result {
+pub async fn load_nwc(state: State<'_, Nostr>) -> Result {
let client = &state.client;
- match client.zapper().await {
- Ok(_) => Ok(true),
+ let keyring = Entry::new("Lume Secret Storage", "NWC").unwrap();
+
+ match keyring.get_password() {
+ Ok(val) => {
+ let uri = NostrWalletConnectURI::from_str(&val).unwrap();
+ if let Ok(nwc) = NWC::new(uri).await {
+ client.set_zapper(nwc).await;
+ Ok(true)
+ } else {
+ Err(false)
+ }
+ }
Err(_) => Err(false),
}
}
+#[tauri::command]
+pub async fn get_balance() -> Result {
+ let keyring = Entry::new("Lume Secret Storage", "NWC").unwrap();
+
+ match keyring.get_password() {
+ Ok(val) => {
+ let uri = NostrWalletConnectURI::from_str(&val).unwrap();
+ if let Ok(nwc) = NWC::new(uri).await {
+ if let Ok(balance) = nwc.get_balance().await {
+ Ok(balance)
+ } else {
+ Err("Get balance failed".into())
+ }
+ } else {
+ Err("Cannot connect to NWC".into())
+ }
+ }
+ Err(_) => Err("Something wrong".into()),
+ }
+}
+
#[tauri::command]
pub async fn zap_profile(
id: &str,