viem WalletClient
type incompatiability with hardhat-viem
functions
#5118
Answered
by
schaable
0xCourtney
asked this question in
Troubleshooting
-
I'm struggling to get the following code to work I want to be able to pass the WalletClient as a function parameter however I'm getting type incompatibility errors. export async function deploy(
deployer: WalletClient,
contractName: string,
constructorArgs: any[],
) {
const { deploymentTransaction, contract } =
await viem.sendDeploymentTransaction(contractName, constructorArgs, {
client: {
wallet: deployer, // Types of property account are incompatible. Type Account | undefined is not assignable to type Account. Type undefined is not assignable to type Account.
},
});
[...]
} Calling |
Beta Was this translation helpful? Give feedback.
Answered by
schaable
Apr 12, 2024
Replies: 1 comment 3 replies
-
Are you importing |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try with
import { WalletClient } from "@nomicfoundation/hardhat-viem/types";