import { type StorageAdapter } from '@lifi/perps-sdk'; import type { LighterProviderKey } from '@lifi/perps-types'; import type { Address } from 'viem'; /** * Persisted Lighter API-key material associated with one L2 account. * `apiKeyPrivateKey` is a Lighter-native signing key, not an Ethereum key; * `apiKeyIndex` identifies its registered on-chain slot. * * @public */ export interface LighterApiKey { /** Lighter account index, looked up once via accountsByL1Address. */ accountIndex: number; /** API key slot (0-255), as named by the backend registration payload. */ apiKeyIndex: number; /** Lighter-native private key (0x-prefixed hex). */ apiKeyPrivateKey: string; /** Corresponding public key, registered via ChangePubKey. */ apiKeyPublicKey: string; } /** * Storage-backed cache for Lighter API keys. Records are namespaced by L1 * address and provider instance so multiple Lighter deployments can share one * {@link StorageAdapter} without collisions. * * @public */ export declare class LighterKeyStore { private readonly storage; private readonly cache; private providerKey; /** * Create a key store using `storage` and the optional provider namespace. * The default provider key preserves the package's standard Lighter storage * namespace. */ constructor(storage: StorageAdapter, providerKey?: LighterProviderKey); /** * Bind the resolved provider instance key. {@link LighterProvider} calls this * during registration so a consumer-constructed keystore adopts the plugin * instance's identity without pre-namespacing the adapter. * @internal */ bindProviderKey(providerKey: LighterProviderKey): void; private storageKey; /** * Load the API key for an L1 address, or `null` when no valid record exists. * Invalid persisted records are ignored by the storage validation boundary. */ get(address: Address): Promise; /** * Persist an API key for an L1 address, replacing any existing record under * that provider namespace. */ set(address: Address, value: LighterApiKey): Promise; /** * Remove the persisted API key for an L1 address and clear its in-memory * cache entry. */ remove(address: Address): Promise; } //# sourceMappingURL=LighterKeyStore.d.ts.map