Optionalui: UserInterfaceCheck if a session key permission exists on-chain and validate its whitelist.
The session to check
Object with exists flag, permission name, and optional mismatch details
Fetch permission data from the blockchain. Uses custom fetchPermission function if provided in config, otherwise uses default implementation.
Permission data or undefined if not found
Get the permission name for the session key. Uses config.permission if set, otherwise generates from app name or defaults to 'sessionkey'.
OptionalappName: string
Optional application name to generate permission from
The permission name
Type guard to check if a session has an active session key wallet.
The session to check
True if the session has a session key wallet
Check if an action is whitelisted for signing with the session key.
The action to check
True if the action is whitelisted
Remove the session key from the given session. Removes the key from on-chain permission and unlinks/deletes as needed.
The session to remove the session key from
Set up a new session key for the given session. Generates a new K1 key, creates the permission on-chain, and wraps the session wallet.
The session to set up a session key for
OptionalonConflict: (existingKeys: KeyWeight[]) => Promise<SessionKeyConflictChoice>
Optional callback if the permission already exists with other keys
The public key and permission name of the created session key
Update the on-chain linkauth actions to match the current whitelist. Removes extra links and adds missing links to synchronize state.
The session with an active session key
Validate that the session's whitelist matches the on-chain linked actions.
The session with an active session key to validate
Mismatch details if whitelist differs from on-chain state, undefined if they match
Manages session key lifecycle including setup, validation, and removal.