@undrground/auth
Version:
Web3 Lukso authentication for NextJS. Built by the undrground team
27 lines (24 loc) • 985 B
TypeScript
import { SessionOptions } from 'iron-session';
import { SiweMessage } from 'siwe';
type SessionData = {
nonce?: string;
siwe?: SiweMessage;
};
type VerifySiwe = {
message: string;
signature: string;
nonce: string;
eoa: boolean;
};
type OptionalSession = {
sessionOptions?: SessionOptions;
};
type SetSession = OptionalSession & {
siwe: string;
};
declare const setNonce: ({ sessionOptions, }: OptionalSession) => Promise<string>;
declare const verifySiwe: ({ message, signature, nonce, eoa, }: VerifySiwe) => Promise<SiweMessage>;
declare const setSession: ({ siwe, sessionOptions, }: SetSession) => Promise<void>;
declare const getSession: ({ sessionOptions, }: OptionalSession) => Promise<SiweMessage | undefined>;
declare const destroySession: ({ sessionOptions, }: OptionalSession) => Promise<void>;
export { type OptionalSession, type SessionData, type SetSession, type VerifySiwe, destroySession, getSession, setNonce, setSession, verifySiwe };