import { LocalAccount } from 'viem'; // Import OpenPGPSlot from parent package import type { OpenPGPSlot } from '@l8d/hardhat-yubikey/dist/src/internal/openpgp-apdu.js'; /** * A viem LocalAccount that uses a YubiKey for signing */ export type YubikeyAccount = LocalAccount<'yubikey'> & { /** * The OpenPGP slot being used for signing */ slot: OpenPGPSlot; /** * The public key associated with this account */ publicKey: `0x${string}`; }; /** * Configuration options for creating a YubiKey account */ export interface YubikeyAccountConfig { /** * The Ethereum address controlled by the YubiKey */ address: `0x${string}`; /** * Optional: Explicitly specify which OpenPGP slot to use * If not provided, the slot will be auto-discovered */ slot?: OpenPGPSlot; /** * Optional: OpenPGP card PIN (default: "123456") * Required for signing operations */ pin?: string; /** * Optional: Timeout for signing operations in milliseconds (default: 30000) */ timeout?: number; /** * Optional: Enable debug logging */ debug?: boolean; } /** * Cached slot information for an address */ export interface CachedSlotInfo { address: string; slot: OpenPGPSlot; publicKey: string; timestamp: number; } /** * Cache storage format */ export interface SlotCache { [address: string]: CachedSlotInfo; }