import { P as Permit, V as ValidationResult, a as Permission, b as PermitSignaturePrimaryType, E as EIP712Types, c as EIP712Message, S as SerializedPermit } from './permit-DnVMDT5h.cjs'; export { C as CreateSelfPermitOptions, d as CreateSharingPermitOptions, f as EIP712Domain, j as EIP712Type, i as EthEncryptedData, p as Expand, G as GenerateSealingKey, I as ImportPermitOptions, I as ImportSharedPermitOptions, o as PermitHashFields, e as PermitMetadata, l as PermitOf, k as PermitType, g as PermitUtils, R as RecipientPermit, h as SealingKey, m as SelfPermit, C as SelfPermitOptions, n as SharingPermit, d as SharingPermitOptions } from './permit-DnVMDT5h.cjs'; import { z } from 'zod'; import * as zustand_middleware from 'zustand/middleware'; import * as zustand_vanilla from 'zustand/vanilla'; import 'viem'; declare const addressSchema: z.ZodPipe>; declare const addressNotZeroSchema: z.ZodPipe>; declare const bytesSchema: z.ZodCustom<`0x${string}`, `0x${string}`>; declare const bytesNotEmptySchema: z.ZodCustom<`0x${string}`, `0x${string}`>; /** * Validator for self permit creation options */ declare const SelfPermitOptionsValidator: z.ZodObject<{ type: z.ZodDefault>>; issuer: z.ZodPipe>; name: z.ZodDefault>; expiration: z.ZodDefault>; recipient: z.ZodDefault>>>; validatorId: z.ZodDefault>; validatorContract: z.ZodDefault>>>; issuerSignature: z.ZodDefault>>; recipientSignature: z.ZodDefault>>; }, z.core.$strip>; /** * Validator for fully formed self permits */ declare const SelfPermitValidator: z.ZodObject<{ name: z.ZodDefault>; type: z.ZodEnum<{ self: "self"; sharing: "sharing"; recipient: "recipient"; }>; issuer: z.ZodPipe>; expiration: z.ZodDefault>; recipient: z.ZodDefault>>>; validatorId: z.ZodDefault>; validatorContract: z.ZodDefault>>>; issuerSignature: z.ZodDefault>>; recipientSignature: z.ZodDefault>>; sealingPair: z.ZodOptional>; }, z.core.$strip>; /** * Validator for sharing permit creation options */ declare const SharingPermitOptionsValidator: z.ZodObject<{ type: z.ZodDefault>>; issuer: z.ZodPipe>; recipient: z.ZodPipe>; name: z.ZodDefault>; expiration: z.ZodDefault>; validatorId: z.ZodDefault>; validatorContract: z.ZodDefault>>>; issuerSignature: z.ZodDefault>>; recipientSignature: z.ZodDefault>>; }, z.core.$strip>; /** * Validator for fully formed sharing permits */ declare const SharingPermitValidator: z.ZodObject<{ name: z.ZodDefault>; type: z.ZodEnum<{ self: "self"; sharing: "sharing"; recipient: "recipient"; }>; issuer: z.ZodPipe>; expiration: z.ZodDefault>; recipient: z.ZodDefault>>>; validatorId: z.ZodDefault>; validatorContract: z.ZodDefault>>>; issuerSignature: z.ZodDefault>>; recipientSignature: z.ZodDefault>>; sealingPair: z.ZodOptional>; }, z.core.$strip>; /** * Validator for import permit creation options (recipient receiving shared permit) */ declare const ImportPermitOptionsValidator: z.ZodObject<{ type: z.ZodDefault>>; issuer: z.ZodPipe>; recipient: z.ZodPipe>; name: z.ZodDefault>; expiration: z.ZodInt; validatorId: z.ZodDefault>; validatorContract: z.ZodDefault>>>; issuerSignature: z.ZodCustom<`0x${string}`, `0x${string}`>; recipientSignature: z.ZodDefault>>; }, z.core.$strip>; /** * Validator for fully formed import/recipient permits */ declare const ImportPermitValidator: z.ZodObject<{ name: z.ZodDefault>; type: z.ZodEnum<{ self: "self"; sharing: "sharing"; recipient: "recipient"; }>; issuer: z.ZodPipe>; expiration: z.ZodDefault>; recipient: z.ZodDefault>>>; validatorId: z.ZodDefault>; validatorContract: z.ZodDefault>>>; issuerSignature: z.ZodDefault>>; recipientSignature: z.ZodDefault>>; sealingPair: z.ZodOptional>; }, z.core.$strip>; /** * Validates self permit creation options */ declare const validateSelfPermitOptions: (options: any) => { type: "self"; issuer: `0x${string}`; name: string; expiration: number; recipient: `0x${string}`; validatorId: number; validatorContract: `0x${string}`; issuerSignature: `0x${string}`; recipientSignature: `0x${string}`; }; /** * Validates sharing permit creation options */ declare const validateSharingPermitOptions: (options: any) => { type: "sharing"; issuer: `0x${string}`; recipient: `0x${string}`; name: string; expiration: number; validatorId: number; validatorContract: `0x${string}`; issuerSignature: `0x${string}`; recipientSignature: `0x${string}`; }; /** * Validates import permit creation options */ declare const validateImportPermitOptions: (options: any) => { type: "recipient"; issuer: `0x${string}`; recipient: `0x${string}`; name: string; expiration: number; validatorId: number; validatorContract: `0x${string}`; issuerSignature: `0x${string}`; recipientSignature: `0x${string}`; }; /** * Validates a fully formed self permit */ declare const validateSelfPermit: (permit: any) => { name: string; type: "self" | "sharing" | "recipient"; issuer: `0x${string}`; expiration: number; recipient: `0x${string}`; validatorId: number; validatorContract: `0x${string}`; issuerSignature: `0x${string}`; recipientSignature: `0x${string}`; sealingPair?: { privateKey: string; publicKey: string; } | undefined; }; /** * Validates a fully formed sharing permit */ declare const validateSharingPermit: (permit: any) => { name: string; type: "self" | "sharing" | "recipient"; issuer: `0x${string}`; expiration: number; recipient: `0x${string}`; validatorId: number; validatorContract: `0x${string}`; issuerSignature: `0x${string}`; recipientSignature: `0x${string}`; sealingPair?: { privateKey: string; publicKey: string; } | undefined; }; /** * Validates a fully formed import/recipient permit */ declare const validateImportPermit: (permit: any) => { name: string; type: "self" | "sharing" | "recipient"; issuer: `0x${string}`; expiration: number; recipient: `0x${string}`; validatorId: number; validatorContract: `0x${string}`; issuerSignature: `0x${string}`; recipientSignature: `0x${string}`; sealingPair?: { privateKey: string; publicKey: string; } | undefined; }; /** * Simple validation functions for common checks */ declare const ValidationUtils: { /** * Check if permit is expired */ isExpired: (permit: Permit) => boolean; /** * Check if permit is signed by the active party */ isSigned: (permit: Permit) => boolean; /** * Checks that a permit is signed and not expired. */ isSignedAndNotExpired: (permit: Permit) => ValidationResult; /** * Asserts that a permit is signed and not expired. * * Throws `Error` with message: * - `Permit is expired` * - `Permit is not signed` */ assertSignedAndNotExpired: (permit: Permit) => void; isValid: (permit: Permit) => ValidationResult; }; declare const PermitSignatureAllFields: readonly [{ readonly name: "issuer"; readonly type: "address"; }, { readonly name: "expiration"; readonly type: "uint64"; }, { readonly name: "recipient"; readonly type: "address"; }, { readonly name: "validatorId"; readonly type: "uint256"; }, { readonly name: "validatorContract"; readonly type: "address"; }, { readonly name: "sealingKey"; readonly type: "bytes32"; }, { readonly name: "issuerSignature"; readonly type: "bytes"; }]; type PermitSignatureFieldOption = (typeof PermitSignatureAllFields)[number]['name']; declare const SignatureTypes: { readonly PermissionedV2IssuerSelf: ("recipient" | "issuer" | "expiration" | "validatorId" | "validatorContract" | "sealingKey")[]; readonly PermissionedV2IssuerShared: ("recipient" | "issuer" | "expiration" | "validatorId" | "validatorContract")[]; readonly PermissionedV2Recipient: ("issuerSignature" | "sealingKey")[]; }; /** * Get signature types and message for EIP712 signing */ declare const getSignatureTypesAndMessage: (primaryType: PermitSignaturePrimaryType, fields: T[] | readonly T[], values: Pick & Partial) => { types: EIP712Types; primaryType: string; message: EIP712Message; }; /** * Signature utilities for permit operations */ declare const SignatureUtils: { /** * Get signature parameters for a permit */ getSignatureParams: (permit: Permission, primaryType: PermitSignaturePrimaryType) => { types: EIP712Types; primaryType: string; message: EIP712Message; }; /** * Determine the required signature type based on permit type */ getPrimaryType: (permitType: "self" | "sharing" | "recipient") => PermitSignaturePrimaryType; }; type ChainRecord = Record; type AccountRecord = Record; type HashRecord = Record; type PermitsStore = { permits: ChainRecord>>; activePermitHash: ChainRecord>; }; declare const PERMIT_STORE_DEFAULTS: PermitsStore; declare const _permitStore: Omit, "persist"> & { persist: { setOptions: (options: Partial>) => void; clearStorage: () => void; rehydrate: () => Promise | void; hasHydrated: () => boolean; onHydrate: (fn: (state: PermitsStore) => void) => () => void; onFinishHydration: (fn: (state: PermitsStore) => void) => () => void; getOptions: () => Partial>; }; }; declare const clearStaleStore: () => void; declare const getPermit: (chainId: number | undefined, account: string | undefined, hash: string | undefined) => Permit | undefined; declare const getActivePermit: (chainId: number | undefined, account: string | undefined) => Permit | undefined; declare const getPermits: (chainId: number | undefined, account: string | undefined) => Record; declare const setPermit: (chainId: number, account: string, permit: Permit) => void; declare const removePermit: (chainId: number, account: string, hash: string) => void; declare const getActivePermitHash: (chainId: number | undefined, account: string | undefined) => string | undefined; declare const setActivePermitHash: (chainId: number, account: string, hash: string) => void; declare const removeActivePermitHash: (chainId: number, account: string) => void; declare const resetStore: () => void; declare const permitStore: { store: Omit, "persist"> & { persist: { setOptions: (options: Partial>) => void; clearStorage: () => void; rehydrate: () => Promise | void; hasHydrated: () => boolean; onHydrate: (fn: (state: PermitsStore) => void) => () => void; onFinishHydration: (fn: (state: PermitsStore) => void) => () => void; getOptions: () => Partial>; }; }; getPermit: (chainId: number | undefined, account: string | undefined, hash: string | undefined) => Permit | undefined; getActivePermit: (chainId: number | undefined, account: string | undefined) => Permit | undefined; getPermits: (chainId: number | undefined, account: string | undefined) => Record; setPermit: (chainId: number, account: string, permit: Permit) => void; removePermit: (chainId: number, account: string, hash: string) => void; getActivePermitHash: (chainId: number | undefined, account: string | undefined) => string | undefined; setActivePermitHash: (chainId: number, account: string, hash: string) => void; removeActivePermitHash: (chainId: number, account: string) => void; resetStore: () => void; }; export { EIP712Message, EIP712Types, ImportPermitOptionsValidator, ImportPermitValidator, PERMIT_STORE_DEFAULTS, Permission, Permit, PermitSignaturePrimaryType, SelfPermitOptionsValidator, SelfPermitValidator, SerializedPermit, SharingPermitOptionsValidator, SharingPermitValidator, SignatureTypes, SignatureUtils, ValidationResult, ValidationUtils, _permitStore, addressNotZeroSchema, addressSchema, bytesNotEmptySchema, bytesSchema, clearStaleStore, getActivePermit, getActivePermitHash, getPermit, getPermits, getSignatureTypesAndMessage, permitStore, removeActivePermitHash, removePermit, resetStore, setActivePermitHash, setPermit, validateImportPermit, validateImportPermitOptions, validateSelfPermit, validateSelfPermitOptions, validateSharingPermit, validateSharingPermitOptions };