import { Address, Account } from 'viem'; import { W as WalletClient, P as PublicClient } from './doc-types-471vSmPO.cjs'; /** * Base configuration for all L2 Business Clients */ interface ClientConfig { /** * Viem WalletClient for write operations. * Must have an account attached. */ client: WalletClient; /** * Optional PublicClient for read operations. * If not provided, one will be derived from the WalletClient or created internally if possible (but usually explicit is better). * Currently L1 actions use PublicClient | WalletClient, so WalletClient is enough for both if it has a provider. * However, explicitly accepting PublicClient encourages separation. */ publicClient?: PublicClient; /** * Registry contract address. * Essential for looking up other contracts if not provided explicitly. */ registryAddress?: Address; /** * GToken contract address. * Required for operations involving token approvals and transfers. */ gTokenAddress?: Address; /** * GTokenStaking contract address. * Required for role registration that involves staking. */ gTokenStakingAddress?: Address; /** * PaymasterFactory contract address. * Required for deploying new PaymasterV4 instances. */ paymasterFactoryAddress?: Address; xpntsFactoryAddress?: Address; ethUsdPriceFeedAddress?: Address; entryPointAddress?: Address; } /** * Common options for transaction methods */ interface TransactionOptions { /** * Override the account to use for the transaction. * If not provided, uses the account from the WalletClient. */ account?: Account | Address; /** * Optional value to send with the transaction (in wei) */ value?: bigint; } /** * Generic result wrapper for business operations * Currently just returns the type directly, but can be expanded for metadata. */ type BusinessResult = Promise; declare abstract class BaseClient { client: WalletClient; publicClient?: PublicClient; protected registryAddress?: Address; protected gTokenAddress?: Address; protected gTokenStakingAddress?: Address; protected paymasterFactoryAddress?: Address; protected entryPointAddress?: Address; constructor(config: ClientConfig); /** * Get the account address of the connected wallet */ getAddress(): Address; /** * Helper to ensure public client exists or fallback to wallet client (if it supports read) */ getStartPublicClient(): PublicClient | WalletClient; protected requireRegistry(): Address; protected requireGToken(): Address; protected requireGTokenStaking(): Address; protected requirePaymasterFactory(): Address; protected requireEntryPoint(): Address; } export { type BusinessResult as B, type ClientConfig as C, type TransactionOptions as T, BaseClient as a };