diff --git a/docs/offline.html b/docs/offline.html
index 825bab2..d8eb99b 100644
--- a/docs/offline.html
+++ b/docs/offline.html
@@ -116,7 +116,7 @@
-
+
@@ -151,7 +151,7 @@
Generate Random
-
+
diff --git a/docs/wallettool.html b/docs/wallettool.html
index 11b5f39..b44638e 100644
--- a/docs/wallettool.html
+++ b/docs/wallettool.html
@@ -50,6 +50,35 @@
Warning: This is experimental unaudited work-in-progress software. This dapp is meant for use on permanently offline computers.
+
+
+
+ Address
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Save To Keystore
+
+
+
+
+
@@ -139,7 +168,7 @@
-
+
{{ data.item.index }}
@@ -163,7 +192,7 @@
Load From Keystore
Save To Keystore
-
+
@@ -233,6 +262,14 @@
generatedAddresses: [],
selectedAddress: null,
+ address: {
+ path: null,
+ privateKey: null,
+ address: null,
+ password: null,
+ confirmPassword: null,
+ },
+
settings: {
tabIndex: 0,
version: 12,
@@ -285,13 +322,29 @@
console.log(moment().format("HH:mm:ss") + " TODO updateURL: " + where);
},
- generatedAddressesRowSelected(item) {
- console.log(moment().format("HH:mm:ss") + " generatedAddressesRowSelected: " + JSON.stringify(item));
+ addressesRowSelected(item) {
+ console.log(moment().format("HH:mm:ss") + " addressesRowSelected: " + JSON.stringify(item));
if (item && item.length > 0) {
- this.selectedAddress = item[0];
- } else {
- this.selectedAddress = null;
+ this.address.path = item[0].path;
+ this.address.address = item[0].address;
+ this.address.privateKey = item[0].privateKey;
+ this.address.password = null;
+ this.address.confirmPassword = null;
}
+ console.log(moment().format("HH:mm:ss") + " addressesRowSelected - this.address: " + JSON.stringify(this.address, null, 2));
+ // if (item && item.length > 0) {
+ // this.address.mode = 'vieworupdate';
+ // this.address.type = item[0].type;
+ // this.address.address = item[0].address;
+ // this.address.addressError = null;
+ // this.address.name = item[0].name;
+ // this.address.keystore = item[0].keystore;
+ // this.address.password = null;
+ // this.address.privateKey = null;
+ // console.log(moment().format("HH:mm:ss") + " addressesRowSelected - this.address: " + JSON.stringify(this.address));
+ // this.$refs.addressesTable.clearSelected();
+ // }
+ this.$bvModal.show('modal-address');
},
showLoadPrivateKeyFromKeystoreModal() {
@@ -452,6 +505,28 @@
await reader.readAsText(fileList[0]);
},
+ async saveMnemonicPrivateKeyToKeystore() {
+ console.log(moment().format("HH:mm:ss") + " saveMnemonicPrivateKeyToKeystore - this.address: " + JSON.stringify(this.address));
+ const filename = "UTC--" + moment.utc().format("YYYY-MM-DDTHH-mm-ss") + ".0Z--" + this.address.address.slice(2).toLowerCase();
+ console.log("filename: " + filename);
+ const wallet = new ethers.Wallet(this.address.privateKey);
+ const encrypted = await wallet.encrypt(this.address.password);
+ console.log(moment().format("HH:mm:ss") + " saveMnemonicPrivateKeyToKeystore - encrypted: " + encrypted);
+ const encryptedObject = JSON.parse(encrypted);
+ // // const filename = encryptedObject && encryptedObject['x-ethers'] && encryptedObject['x-ethers'].gethFilename || "UTC--error-getting-filename";
+ // console.log("filename: " + filename);
+ console.log(moment().format("HH:mm:ss") + " saveMnemonicPrivateKeyToKeystore - JSON.stringify(JSON.parse(encrypted), null, 2): " + JSON.stringify(JSON.parse(encrypted), null, 2));
+ let jsonContent = "data:text/json;charset=utf-8," + encrypted;
+ console.log(moment().format("HH:mm:ss") + " saveMnemonicPrivateKeyToKeystore - jsonContent: " + jsonContent);
+ var encodedUri = encodeURI(jsonContent);
+ var link = document.createElement("a");
+ link.setAttribute("href", encodedUri);
+ link.setAttribute("download", filename);
+ document.body.appendChild(link); // Required for FF
+ link.click(); // This will download the data with the specified file name
+ this.$bvModal.hide('modal-saveprivatekeytokeystore');
+ },
+
download(withPrivateKeys) {
console.log(moment().format("HH:mm:ss") + " download - withPrivateKeys: " + withPrivateKeys);
const rows = [];