/** * CredentialsProvider — abstraction over per-vault, per-venue API credentials. * * Lucidly Pro vaults are strategist-deployed permissionless objects. Each vault has a strategist * EOA, and the strategist may configure off-chain venue credentials (HyperLiquid API key, etc.) * for their vault. The SDK has NO opinion on where those credentials live — it consumes them * through this interface. Concrete adapters land in callers that have a storage story: * * • CLI: probably env or `~/.lucidly/credentials/.json` (file-based) * • UI: probably IndexedDB encrypted with a strategist-supplied passphrase * • Server: probably AWS KMS / Doppler / 1Password Service Account / etc. * * The SDK ships: * • `CredentialsProvider` interface * • `EnvCredentialsProvider` — reads from process.env with deterministic naming (CLI/scripts) * • `InMemoryCredentialsProvider` — for tests * * Anything more sophisticated (file-based, KMS-backed) lives in the caller package. */ export interface VenueCredentials { /** * Credential payload. Shape is venue-specific: * • HyperLiquid: { apiSecret: "0x..."; accountAddress: "0x..." } (uses Ethereum-signed messages) * • Binance: { apiKey: "..."; apiSecret: "..." } (HMAC) * • Generic: freeform record, the venue-specific runner adapter destructures it */ [field: string]: string | undefined; } export interface CredentialsProvider { /** * Resolve credentials for a (vault, venue) pair. Return `null` if no credentials are * configured — the runner should treat that as a "skip api step" or surface a clear error, * depending on policy. * * The SDK never logs or stores the returned object; it's passed through to the venue adapter. */ getCredentials(vault: `0x${string}`, venue: string): Promise; /** * Optional: list venues for which credentials are configured for a given vault. Used by the * UI to show "credentials configured: hyperliquid, binance" hints. Implementations that can't * cheaply enumerate (e.g. KMS lookup-by-name) can omit and return []. */ listVenues?(vault: `0x${string}`): Promise; } export declare class EnvCredentialsProvider implements CredentialsProvider { private readonly env; constructor(env?: NodeJS.ProcessEnv); getCredentials(vault: `0x${string}`, venue: string): Promise; } export declare class InMemoryCredentialsProvider implements CredentialsProvider { /** key = `${vault.toLowerCase()}::${venue.toLowerCase()}` */ private readonly store; constructor(initial?: Record>); set(vault: `0x${string}`, venue: string, creds: VenueCredentials): void; getCredentials(vault: `0x${string}`, venue: string): Promise; listVenues(vault: `0x${string}`): Promise; private key; }