UNPKG

@nomicfoundation/hardhat-viem

Version:
45 lines 3.1 kB
import type { EthereumProvider } from "hardhat/types"; import type { Address, Chain, PublicClientConfig, WalletClientConfig, TestClientConfig } from "viem"; import type { PublicClient, TestClient, TestClientMode, WalletClient } from "../types"; /** * Get a PublicClient instance. This is a read-only client that can be used to * query the blockchain. * * @param provider The Ethereum provider used to connect to the blockchain. * @param publicClientConfig Optional configuration for the PublicClient instance. See the viem documentation for more information. * @returns A PublicClient instance. */ export declare function getPublicClient(provider: EthereumProvider, publicClientConfig?: Partial<PublicClientConfig>): Promise<PublicClient>; export declare function innerGetPublicClient(provider: EthereumProvider, chain: Chain, publicClientConfig?: Partial<PublicClientConfig>): Promise<PublicClient>; /** * Get a list of WalletClient instances. These are read-write clients that can * be used to send transactions to the blockchain. Each client is associated * with an account obtained from the provider using `eth_accounts`. * * @param provider The Ethereum provider used to connect to the blockchain. * @param walletClientConfig Optional configuration for the WalletClient instances. See the viem documentation for more information. * @returns A list of WalletClient instances. */ export declare function getWalletClients(provider: EthereumProvider, walletClientConfig?: Partial<WalletClientConfig>): Promise<WalletClient[]>; export declare function innerGetWalletClients(provider: EthereumProvider, chain: Chain, accounts: Address[], walletClientConfig?: Partial<WalletClientConfig>): Promise<WalletClient[]>; /** * Get a WalletClient instance for a specific address. This is a read-write * client that can be used to send transactions to the blockchain. * * @param provider The Ethereum provider used to connect to the blockchain. * @param address The public address of the account to use. * @param walletClientConfig Optional configuration for the WalletClient instance. See the viem documentation for more information. * @returns A WalletClient instance. */ export declare function getWalletClient(provider: EthereumProvider, address: Address, walletClientConfig?: Partial<WalletClientConfig>): Promise<WalletClient>; /** * Get a TestClient instance. This is a read-write client that can be used to * perform actions only available on test nodes such as hardhat or anvil. * * @param provider The Ethereum provider used to connect to the blockchain. * @param testClientConfig Optional configuration for the TestClient instance. See the viem documentation for more information. * @returns A TestClient instance. */ export declare function getTestClient(provider: EthereumProvider, testClientConfig?: Partial<TestClientConfig>): Promise<TestClient>; export declare function innerGetTestClient(provider: EthereumProvider, chain: Chain, mode: TestClientMode, testClientConfig?: Partial<TestClientConfig>): Promise<TestClient>; //# sourceMappingURL=clients.d.ts.map