nostr-hooks
Version:
React hooks for developing Nostr clients
13 lines (12 loc) • 587 B
TypeScript
import { NDKUser } from '@nostr-dev-kit/ndk';
export type ActiveUserStatus = 'loading' | 'success' | 'no-user';
/**
* Custom hook that retrieves the active user using the NDK instance and the signer.
*
* @param fetchProfile - Optional boolean indicating whether to fetch profile for the active user. Default is false.
* @returns An object containing the active user, null if there is no user, or undefined if the user is being fetched.
*/
export declare const useActiveUser: (fetchProfile?: boolean) => {
activeUser: NDKUser | null | undefined;
status: ActiveUserStatus;
};