UNPKG

@lit-protocol/auth-helpers

Version:

This submodule manages permissions and capabilities related to accessing specific resources on the blockchain. It utilizes features from the 'siwe' and 'siwe-recap' libraries to verify and handle data, allowing users to encode and decode session capabilit

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?: CID[]): ISessionCapabilityObject; export declare function decode(encoded: string): ISessionCapabilityObject; export declare function extract(siwe: SiweMessage): ISessionCapabilityObject;