diff --git a/docs/offline.html b/docs/offline.html index 0fe40a6..65e3893 100644 --- a/docs/offline.html +++ b/docs/offline.html @@ -236,6 +236,11 @@ + + + + + @@ -498,7 +503,7 @@
Troubleshooting
// --- DATA --- data: { wallet: { - type: 'privatekey', + type: 'mnemonics', // 'privatekey', 'keystorefile' mnemonics: null, keystore: null, privateKey: null, @@ -949,14 +954,28 @@
Troubleshooting
async recomputeWallet() { console.log(moment().format("HH:mm:ss") + " recomputeWallet: " + JSON.stringify(this.wallet)); if (this.wallet.type == 'privatekey') { - const wallet = new ethers.Wallet(this.wallet.privateKey); - this.wallet.address = wallet.address; - this.wallet.publicKey = wallet.publicKey; - // TODO: ethers.js returns an error - // this.wallet.compressedPublicKey = wallet.compressedPublicKey || 'ethers.js returning an error'; - console.table(wallet); + try { + const wallet = new ethers.Wallet(this.wallet.privateKey); + this.wallet.address = wallet.address; + this.wallet.publicKey = wallet.publicKey; + // TODO: ethers.js returns an error + // this.wallet.compressedPublicKey = wallet.compressedPublicKey || 'ethers.js returning an error'; + console.table(wallet); + } catch (e) { + console.log(moment().format("HH:mm:ss") + " recomputeWallet ERROR: " + e.message); + } } else if (this.wallet.type == 'mnemonics') { console.log(moment().format("HH:mm:ss") + " recomputeWallet - mnemonics: " + JSON.stringify(this.wallet)); + try { + const wallet = new ethers.Wallet.fromMnemonic(this.wallet.mnemonics); + this.wallet.address = wallet.address; + this.wallet.publicKey = wallet.publicKey; + // TODO: ethers.js returns an error + // this.wallet.compressedPublicKey = wallet.compressedPublicKey || 'ethers.js returning an error'; + console.table(wallet); + } catch (e) { + console.log(moment().format("HH:mm:ss") + " recomputeWallet ERROR: " + e.message); + } } else if (this.wallet.type == 'keystorefile'){ console.log(moment().format("HH:mm:ss") + " recomputeWallet - keystorefile: " + JSON.stringify(this.wallet)); }