Wallet.isEncryptedWallet
See original GitHub issueHi, excuse me that i am asking here, however i cannot fix the issue for days. I try to make unlock wallet with keystore file, however devtool warn me
Uncaught TypeError: Wallet.isEncryptedWallet is not a function at UnlockWalletKeystore (ana.js:349) at HTMLButtonElement.onclick (index.html:200)
how can i fix this? probably my code is old and i should migrate to new version but i dont know how to do it. Excuse me again
function UnlockWalletKeystore() {
var password = $("#keystorewalletpass").val();
var buffer = fs.readFileSync(keyFile);
var walletData = buffer.toString();
$("#keystorebtn").html("Decrypting...");
$("#keystorebtn").prop("disabled", true);
if (password!='' && keyFile!='' && Wallet.isEncryptedWallet(walletData)){
Wallet.fromEncryptedWallet(walletData, password).then(function(wallet) {
console.log("Opened Address: " + wallet.address);
wallet.provider = new ethers.providers.getDefaultProvider(false);
myWallet = wallet;
SuccessAccess();
updateBalance();
// UpdatePortfolio();
$("#keystorebtn").html("Decrypting...");
});
} else {
$("#keystorejsonerror").html('<i class="fas fa-exclamation-circle"></i> Invalid Keystore JSON File or Password')
$("#keystorejsonerror").show();
$("#keystorebtn").prop("disabled", false);
$("#keystorebtn").html("Open");
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:24 (8 by maintainers)
Top Results From Across the Web
Wallet encryption - Bitcoin Wiki
Wallet encryption uses AES-256-CBC to encrypt only the private keys that are held in a wallet. The keys are encrypted with a master...
Read more >Securing your wallet - Bitcoin.org
Encrypting your wallet or your smartphone allows you to set a password for anyone trying to withdraw any funds. This helps protect against...
Read more >What Is a Crypto Wallet and How to Keep Your Wallet Secure?
Software wallets are very secure when you enable their two-factor authentication login settings; however, since they connect to the internet, ...
Read more >What Is Crypto Wallet, Encryption And Private-Public Keys
As I explained in the previous article, Crypto Wallet is a piece of software which can hold account like your physical wallet hold...
Read more >14 Cryptocurrency Wallets to Store Your Crypto Securely
Let's look at some of the best crypto currency wallets. ... It's a cryptocurrency wallet that stores users' private keys in a secure...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You are changing the contract address after you have already instantiated the Contract. Strings are immutable and passed by value, not by reference. So changing the string after passing it into somewhere else will have no effect.
You would need to make the Contract object re-assignable. This may lead to issues in other places though. I highly Recommend architecting the application to support changing networks, which would mean you have a function that setups up the world for a given network, on change: 1) tear down the old world and 2) rebuild the new one.
Otherwise you will always have lingering un-garbage-collects nuggets within your app resolving and possibly updating the UI after switching networks.
This is why I warn people of the absolute pain it is to support changing networks and to only do so if they absolutely need to. It is not simple… 😒
Does that help at all, though? 😃
@PlusBitPos Your
myWallet
doesn’t have a provider object attached to it, so after signing the transaction it doesn’t know which eth node backend it should send it to. So you need to connect it.You can also refer docs for wallet and providers.