@kryptogo/kryptogokit-sdk-react
Version:
KryptogoKit offers a comprehensive web3 wallet solution with seamless KryptoGO Auth integration and multi-wallet connection support. Designed for users. Built for developers.
32 lines (31 loc) • 1.33 kB
TypeScript
import { type ReactNode } from 'react';
export type AuthenticationStatus = 'loading' | 'unauthenticated' | 'authenticated';
export interface AuthenticationAdapter<Message> {
getNonce: () => Promise<string>;
createMessage: (args: {
nonce: string;
address: string;
chainId: number;
}) => Message;
getMessageBody: (args: {
message: Message;
}) => string;
verify: (args: {
message: Message;
signature: string;
}) => Promise<boolean>;
signOut: () => Promise<void>;
}
export interface AuthenticationConfig<Message> {
adapter: AuthenticationAdapter<Message>;
status: AuthenticationStatus;
}
export declare function createAuthenticationAdapter<Message>(adapter: AuthenticationAdapter<Message>): AuthenticationAdapter<Message>;
interface KryptogoKitAuthenticationProviderProps<Message> extends AuthenticationConfig<Message> {
enabled?: boolean;
children: ReactNode;
}
export declare function KryptogoKitAuthenticationProvider<Message = unknown>({ adapter, children, enabled, status, }: KryptogoKitAuthenticationProviderProps<Message>): import("react/jsx-runtime").JSX.Element;
export declare function useAuthenticationAdapter(): AuthenticationAdapter<any>;
export declare function useAuthenticationStatus(): AuthenticationStatus | null;
export {};