import type { SessionResponse } from '@openfort/openfort-js'; import type { Hex } from 'viem'; import { OpenfortError } from '../../core/errors'; import type { OpenfortHookOptions } from '../../types'; type RevokePermissionsRequest = { sessionKey: Hex; }; type RevokePermissionsResult = SessionResponse; type RevokePermissionsHookResult = { error?: OpenfortError; } & Partial; type RevokePermissionsHookOptions = OpenfortHookOptions; /** * Hook for revoking permissions to session keys (EIP-7715) * * This hook manages the creation and authorization of session keys, allowing users to * delegate permissions to specific accounts for a limited time. This enables use cases * like session-based authentication and gasless transactions within defined scopes. * The hook leverages EIP-7715 for permission revocation. * * @param hookOptions - Optional configuration with callback functions * @returns Current revoke permissions state and actions * * @example * ```tsx * import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; * import { useRevokePermissions } from '@openfort/openfort-react'; * * const { revokePermissions, isLoading, isError, error } = useRevokePermissions({ * onSuccess: (result) => console.log('Permissions revoked:', result), * onError: (error) => console.error('Permission revoke failed:', error), * }); * * // Revoke Permissions to a session key * const handleRevokePermissions = async () => { * try { * const sessionKey = '0x...'; // The session key to revoke permissions for * * const result = await revokePermissions({ * sessionKey, * }); * * console.log('Revoke result:', result); * } catch (error) { * console.error('Error revoking permissions:', error); * } * }; * ``` */ export declare const useRevokePermissions: (hookOptions?: RevokePermissionsHookOptions) => { isLoading: boolean; isError: boolean; isSuccess: boolean; error: OpenfortError | null | undefined; revokePermissions: ({ sessionKey }: RevokePermissionsRequest, options?: RevokePermissionsHookOptions) => Promise; data: SessionResponse | null; reset: () => void; }; export {};