Skip to content

Commit fbb2730

Browse files
committedDec 2, 2023
Add public client to getContractAtConfig
1 parent 8db6b34 commit fbb2730

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
 

‎packages/hardhat-viem/src/internal/contracts.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export async function getContractAt(
198198
config: GetContractAtConfig = {}
199199
): Promise<GetContractReturnType> {
200200
const [publicClient, walletClient, contractArtifact] = await Promise.all([
201-
getPublicClient(network.provider),
201+
config.publicClient ?? getPublicClient(network.provider),
202202
config.walletClient ??
203203
getDefaultWalletClient(network.provider, network.name),
204204
artifacts.readArtifact(contractName),

‎packages/hardhat-viem/src/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export type SendDeploymentTransactionConfig = SendTransactionConfig;
3434

3535
export interface GetContractAtConfig {
3636
walletClient?: WalletClient;
37+
publicClient?: PublicClient;
3738
}
3839

3940
export type GetContractReturnType<

0 commit comments

Comments
 (0)