import { AbstractSigner } from 'ethers'; import type { Account, Chain, Transport, WalletClient } from 'viem'; /** * Convert viem WalletClient to ethers-compatible Signer. * * Supports both: * - Local accounts (privateKeyToAccount, mnemonicToAccount) * - JSON-RPC accounts (browser wallets like MetaMask) * * Works with ALL viem transport types including: * - http() - Standard HTTP transport * - webSocket() - WebSocket transport * - custom() - Injected providers (MetaMask, WalletConnect, etc.) * * @param client - viem WalletClient instance with account and chain defined * @returns ethers AbstractSigner for use with sendMessage, manuallyExecute, etc. * * @example * ```typescript * import { createWalletClient, http } from 'viem' * import { privateKeyToAccount } from 'viem/accounts' * import { mainnet } from 'viem/chains' * import { fromViemClient, viemWallet } from '@chainlink/ccip-sdk/viem' * * const account = privateKeyToAccount('0x...') * const walletClient = createWalletClient({ * chain: mainnet, * transport: http('https://eth.llamarpc.com'), * account, * }) * * const chain = await fromViemClient(publicClient) * const request = await chain.sendMessage( * router, * destChainSelector, * message, * { wallet: viemWallet(walletClient) } * ) * ``` * * @example Browser wallet (MetaMask) * ```typescript * import { createWalletClient, custom } from 'viem' * import { mainnet } from 'viem/chains' * import { viemWallet } from '@chainlink/ccip-sdk/viem' * * const walletClient = createWalletClient({ * chain: mainnet, * transport: custom(window.ethereum), * account: connectedAccount, * }) * * // Works with injected providers! * const signer = viemWallet(walletClient) * ``` */ export declare function viemWallet(client: WalletClient): AbstractSigner; //# sourceMappingURL=wallet-adapter.d.ts.map