UNPKG

@gemini-wallet/core

Version:

Core SDK for Gemini Wallet integration with popup communication

47 lines (41 loc) 1.31 kB
/** * Interface for storage backends used by the Gemini wallet SDK */ export type IStorage = { /** * Store a serializable object in storage * @param key Storage key * @param item Object to store */ storeObject<T>(key: string, item: T): Promise<void>; /** * Load a serializable object from storage * @param key Storage key * @param fallback Default value if key doesn't exist * @returns The stored object or fallback */ loadObject<T>(key: string, fallback: T): Promise<T>; /** * Store a string value in storage * @param key Storage key * @param value String value to store */ setItem(key: string, value: string): Promise<void>; /** * Retrieve a string value from storage * @param key Storage key * @returns The stored string or null if not found */ getItem(key: string): Promise<string | undefined>; /** * Remove an item from storage * @param key Storage key */ removeItem(key: string): Promise<void>; }; // Export storage keys export const STORAGE_ETH_ACCOUNTS_KEY = "eth-accounts"; export const STORAGE_ETH_ACTIVE_CHAIN_KEY = "eth-active-chain"; export const STORAGE_PASSKEY_CREDENTIAL_KEY = "passkey-credential"; export const STORAGE_SMART_ACCOUNT_KEY = "smart-account"; export const STORAGE_SETTINGS_KEY = "settings";