From 2699b34ae1b5441b0f8639268a941d79119aa34e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Tue, 25 Jul 2023 22:27:14 +0200 Subject: [PATCH] Implement the sub-address generation --- pwa/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pwa/app.js b/pwa/app.js index 94db75f..bd02331 100644 --- a/pwa/app.js +++ b/pwa/app.js @@ -148,9 +148,11 @@ document.addEventListener('DOMContentLoaded', () => { // Add a click event on the new address button to generate it document.querySelector('#btn-generate').addEventListener('click', (event) => { - console.log('Generating a new address…'); event.preventDefault(); - // TODO + const account = getAccountByName(document.querySelector('#account-name').value); + const new_address = account.genSubAddr(document.querySelector('#sub-addr-name').value); + document.querySelector('#generated-addr').value = new_address; + console.log(`New sub-address for account ${account.getName()}: ${new_address}`); }); });