full-blockchain-solidity-course-js icon indicating copy to clipboard operation
full-blockchain-solidity-course-js copied to clipboard

fromEncrptedJsonSyn (Lesson5)

Open Abhishek2061 opened this issue 1 year ago • 3 comments

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 avatar Jun 04 '23 13:06 Abhishek2061

@Abhishek2061 Use this;

let wallet = new ethers.Wallet.fromEncryptedJsonSync(
  encryptedJson,
  process.env.PRIVATE_KEY_PASSWORD
);

alymurtazamemon avatar Jun 07 '23 10:06 alymurtazamemon

@alymurtazamemon have tried it but still the same error is showing

Abhishek2061 avatar Jun 23 '23 15:06 Abhishek2061

let wallet = ethers.Wallet.fromEncryptedJsonSync(
  encryptedJson,
  process.env.PRIVATE_KEY_PASSWORD
); 

This should fix the not a constructor problem

the-first-elder avatar Jul 14 '23 05:07 the-first-elder