UNPKG

@lit-protocol/auth-helpers

Version:

Advanced authentication utilities for managing blockchain resource permissions and capabilities within the Lit Protocol ecosystem. Built on top of SIWE (Sign-In with Ethereum) and SIWE-RECAP for robust authentication flows.

21 lines (20 loc) 1.02 kB
import { SiweMessage } from 'siwe'; import { ISessionCapabilityObject } from '@lit-protocol/types'; import { AttenuationsObject, CID } from './models'; /** * * newSessionCapabilityObject is a function that abstracts away the details of * creating and verifying a session capability object. For example, it uses * the SIWE Recap object to create the capability object, but that detail is * hidden from the user. * * This function serves as an abstraction and router to the * underlying implementation of the ISessionCapabilityObject. * * @param attenuations the attenuations you want to add to the capability object * @param proof the proofs you want to add to the capability object * @returns a ISessionCapabilityObject */ export declare function newSessionCapabilityObject(attenuations?: AttenuationsObject, proof?: Array<CID>): ISessionCapabilityObject; export declare function decode(encoded: string): ISessionCapabilityObject; export declare function extract(siwe: SiweMessage): ISessionCapabilityObject;