const ethers = require ("ethers")
const fs = require ("fs-extra")
require ("dotenv").config()
async function main () {
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY)
const encryptedJSonKey = await wallet.encrypt(process.env.PRIVATE_KEY_PASS , process.env.PRIVATE_KEY)
console.log(encryptedJSonKey)
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Error: progressCb should be function at scryptInit (E:\BlockchainForLife\Patrick\node_modules@noble\hashes\scrypt.js:110:15) at scryptAsync (E:\BlockchainForLife\Patrick\node_modules@noble\hashes\scrypt.js:199:84) at _scryptAsync (E:\BlockchainForLife\Patrick\node_modules\ethers\lib.commonjs\crypto\scrypt.js:8:43) at scrypt (E:\BlockchainForLife\Patrick\node_modules\ethers\lib.commonjs\crypto\scrypt.js:55:42) at encryptKeystoreJson (E:\BlockchainForLife\Patrick\node_modules\ethers\lib.commonjs\wallet\json-keystore.js:291:45) at Wallet.encrypt (E:\BlockchainForLife\Patrick\node_modules\ethers\lib.commonjs\wallet\wallet.js:48:65) at main (E:\BlockchainForLife\Patrick\encryptKey.js:7:41) at Object. (E:\BlockchainForLife\Patrick\encryptKey.js:11:1) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)