full-blockchain-solidity-course-js
full-blockchain-solidity-course-js copied to clipboard
fromEncrptedJsonSyn (Lesson5)
Lesson
Lesson 5
Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")
07:46:25
Operating System
Windows 11
Describe the bug
let wallet = new ethers.Wallet.fromEncryptedJson( encryptedJson, process.env.PRIVATE_KEY_PASSWORD );
TypeError: ethers.Wallet.createEncryptedJson is not a constructor "this is the error I am getting over and over again"
@Abhishek2061 Use this;
let wallet = new ethers.Wallet.fromEncryptedJsonSync(
encryptedJson,
process.env.PRIVATE_KEY_PASSWORD
);
@alymurtazamemon have tried it but still the same error is showing
let wallet = ethers.Wallet.fromEncryptedJsonSync(
encryptedJson,
process.env.PRIVATE_KEY_PASSWORD
);
This should fix the not a constructor problem