Skip to content

TypeError: wallet.connect is not a function #143

Answered by LordReya
OIU2020 asked this question in Q&A
Discussion options

You must be logged in to vote

You forgot the sync at new ethers.wallet.fromEncryptedJsonSync It should be like this:

const encryptedJson = fs.readFileSync("./.encryptkey.json", "utf8");
let wallet = new ethers.Wallet.fromEncryptedJsonSync(
encryptedJson,
process.env.PRIVATE_KEY_PASSWORD
);
wallet = await wallet.connect(provider);

Let me know if that helps :)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@M-Marcel
Comment options

@DEFIdaniel1
Comment options

Answer selected by OIU2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants