Add custom Nostr hooks, improve goosehints

This commit is contained in:
Alex Gleason committed 2025-04-17 11:23:46 -05:00
1 parent e2a0d55170
commit afcb62e7a1
9 files changed
+193 -16

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import { useNostr } from '@nostrify/react';
import { NLogin, useNostrLogin } from '@nostrify/react/login';
export function useLoginActions() {
const { nostr } = useNostr();
const { addLogin } = useNostrLogin();
return {
nsec(nsec: string): void {
const login = NLogin.fromNsec(nsec);
addLogin(login);
},
async bunker(uri: string): Promise<void> {
const login = await NLogin.fromBunker(uri, nostr);
addLogin(login);
},
async extension(): Promise<void> {
const login = await NLogin.fromExtension();
addLogin(login);
},
};
}