import { type Account, type Address, type PublicClient, type WalletClient, type Hex } from "viem"; import type { ChainName, TxResult, Deployed } from "./types.js"; import { type ChainConfig } from "./chains.js"; import { VaultModule } from "./vault.js"; import { AccountantModule } from "./accountant.js"; import { TellerModule } from "./teller.js"; import { RolesModule } from "./roles.js"; import { IntegrationsModule } from "./integrations.js"; import { StrategyModule } from "./strategy.js"; import { QueueModule } from "./queue.js"; import { MonitorModule } from "./monitor.js"; import { NavModule } from "./nav.js"; import { FactoryV2Module } from "./factoryV2.js"; import { RegistryModule } from "./registryV2.js"; import { PolicyManagerModule } from "./policyManager.js"; import { IndexerClient } from "./indexerClient.js"; import { NavPipelineModule } from "./navPipeline.js"; import { ResearchToolsModule } from "./researchTools.js"; import { SimulatorClient } from "./simulatorClient.js"; export interface LucidlyClientOptions { /** Chain name ("ethereum" | "base" | "arbitrum") or numeric id. */ chain: ChainName | number; rpcUrl: string; /** A viem Account (e.g. from privateKeyToAccount). Omit for a read-only client. */ signer?: Account; /** Optional default active vault address. */ vault?: Address; /** Override viem's receipt/block polling interval (ms). Useful against fast local nodes. */ pollingInterval?: number; /** Optional lucidlypro-indexer GraphQL endpoint (e.g. "http://localhost:42069"). */ indexerUrl?: string; /** Optional lucidly-simulator endpoint (e.g. "https://simulator.rdv8.xyz"). When set, `client.simulator` * is wired up. The simulator runs Trail leaf calls against anvil forks and returns receipts + * balance diffs without broadcasting to mainnet. */ simulatorUrl?: string; } /** * viem-based entrypoint for Lucidly. Mirrors the CLI surface so an agent can call it programmatically. * Read methods work without a signer (dashboards); writes require `signer`. */ export declare class LucidlyClient { readonly chainConfig: ChainConfig; readonly publicClient: PublicClient; readonly walletClient?: WalletClient; readonly account?: Account; private _activeVault?; private _active?; readonly vault: VaultModule; readonly accountant: AccountantModule; readonly teller: TellerModule; readonly roles: RolesModule; readonly integrations: IntegrationsModule; readonly strategy: StrategyModule; readonly queue: QueueModule; readonly monitor: MonitorModule; readonly nav: NavModule; readonly factoryV2: FactoryV2Module; readonly registry: RegistryModule; readonly policyManager: PolicyManagerModule; readonly navPipeline: NavPipelineModule; readonly researchTools: ResearchToolsModule; /** Indexer client. `undefined` if no indexerUrl was provided — callers MUST guard or set it later. */ indexer?: IndexerClient; /** Simulator client. `undefined` if no simulatorUrl was provided. Use `setSimulatorUrl()` to attach * at runtime. Guards similarly to `indexer`. */ simulator?: SimulatorClient; constructor(opts: LucidlyClientOptions); /** Attach (or replace) the indexer client at runtime. */ setIndexerUrl(url: string): void; /** Attach (or replace) the simulator client at runtime. */ setSimulatorUrl(url: string): void; get activeVault(): Address | undefined; get activeDeployment(): Deployed | undefined; setActiveVault(v: Address): void; /** Record a full deployment so accountant/teller/manager/rolesAuthority resolve automatically. */ setActiveDeployment(d: Deployed): void; requireVault(op: string, override?: Address): Address; requireAccountant(op: string, override?: Address): Address; requireTeller(op: string, override?: Address): Address; requireManager(op: string, override?: Address): Address; requireRolesAuthority(op: string, override?: Address): Address; requireSigner(op: string): { walletClient: WalletClient; account: Account; }; resolveToken(symbolOrAddress: Address | string): Address; /** Read a contract (no signer required). */ read(params: { address: Address; abi: readonly unknown[]; functionName: string; args?: readonly unknown[]; }): Promise; /** Send a write tx and return its hash (does not wait). */ send(params: { address: Address; abi: readonly unknown[]; functionName: string; args?: readonly unknown[]; value?: bigint; }): Promise; /** Send a write tx, wait for the receipt, and return it. */ sendAndWait(params: { address: Address; abi: readonly unknown[]; functionName: string; args?: readonly unknown[]; value?: bigint; }): Promise; /** Deploy a contract from an artifact, wait for the receipt, return the new address. */ deployContract(params: { abi: readonly unknown[]; bytecode: Hex; args?: readonly unknown[]; }): Promise
; /** Wrap a hash in the documented { hash, wait() } shape. */ wrapTx(hash: Hex): TxResult; }