From d778c8f924b444c65491a4ee1309cb8023ca4df0 Mon Sep 17 00:00:00 2001 From: Ludovit Scholtz Date: Sat, 1 Jun 2024 13:06:11 +0200 Subject: [PATCH] #88 #89 Improve the basic account creation --- src/locales/af.json | 5 +- src/locales/cs.json | 5 +- src/locales/en.json | 5 +- src/locales/es.json | 5 +- src/locales/hu.json | 5 +- src/locales/it.json | 5 +- src/locales/nl.json | 5 +- src/locales/ru.json | 5 +- src/locales/sk.json | 5 +- src/locales/tr.json | 5 +- src/pages/NewAccount/Ed25529.vue | 145 +++++++++++++++++++++++++++++-- 11 files changed, 180 insertions(+), 15 deletions(-) diff --git a/src/locales/af.json b/src/locales/af.json index 4f95e05..95671dc 100644 --- a/src/locales/af.json +++ b/src/locales/af.json @@ -296,7 +296,10 @@ "no_accounts_at_network": "There are no accounts for selected network", "basic_options": "Basic options", "advanced_options": "Advanced options", - "skip_challange": "Skip challange" + "skip_challange": "Skip challange", + "new_account_challange": "New account challange", + "click_to_show_positions": "Click to show positions", + "to": "to" }, "arc76account": { "title": "Email and password account (ARC-0076)", diff --git a/src/locales/cs.json b/src/locales/cs.json index d0682f9..4a7d778 100644 --- a/src/locales/cs.json +++ b/src/locales/cs.json @@ -295,7 +295,10 @@ "no_accounts_at_network": "There are no accounts for selected network", "basic_options": "Basic options", "advanced_options": "Advanced options", - "skip_challange": "Skip challange" + "skip_challange": "Skip challange", + "new_account_challange": "New account challange", + "click_to_show_positions": "Click to show positions", + "to": "to" }, "arc76account": { "title": "Email and password account (ARC-0076)", diff --git a/src/locales/en.json b/src/locales/en.json index 916a9f1..0c8bca7 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -298,7 +298,10 @@ "no_accounts_at_network": "There are no accounts for selected network", "basic_options": "Basic options", "advanced_options": "Advanced options", - "skip_challange": "Skip challange" + "skip_challange": "Skip challange", + "new_account_challange": "New account challange", + "click_to_show_positions": "Click to show positions", + "to": "to" }, "arc76account": { "title": "Email and password account (ARC-0076)", diff --git a/src/locales/es.json b/src/locales/es.json index f6ed7a0..06c88fa 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -296,7 +296,10 @@ "no_accounts_at_network": "There are no accounts for selected network", "basic_options": "Basic options", "advanced_options": "Advanced options", - "skip_challange": "Skip challange" + "skip_challange": "Skip challange", + "new_account_challange": "New account challange", + "click_to_show_positions": "Click to show positions", + "to": "to" }, "arc76account": { "title": "Cuenta de correo y contraseña (ARC-0076)", diff --git a/src/locales/hu.json b/src/locales/hu.json index 897de84..9f292c8 100644 --- a/src/locales/hu.json +++ b/src/locales/hu.json @@ -295,7 +295,10 @@ "no_accounts_at_network": "Nincsek számláid a kiválasztott hálózaton", "basic_options": "Alapbeállítások", "advanced_options": "Speciális beállítások", - "skip_challange": "Skip challange" + "skip_challange": "Skip challange", + "new_account_challange": "New account challange", + "click_to_show_positions": "Click to show positions", + "to": "to" }, "arc76account": { "title": "Email és jelszó számla (ARC-0076)", diff --git a/src/locales/it.json b/src/locales/it.json index 86482c5..e2a1ee2 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -295,7 +295,10 @@ "no_accounts_at_network": "There are no accounts for selected network", "basic_options": "Basic options", "advanced_options": "Advanced options", - "skip_challange": "Skip challange" + "skip_challange": "Skip challange", + "new_account_challange": "New account challange", + "click_to_show_positions": "Click to show positions", + "to": "to" }, "arc76account": { "title": "Email and password account (ARC-0076)", diff --git a/src/locales/nl.json b/src/locales/nl.json index cad1786..65b031d 100644 --- a/src/locales/nl.json +++ b/src/locales/nl.json @@ -295,7 +295,10 @@ "no_accounts_at_network": "There are no accounts for selected network", "basic_options": "Basic options", "advanced_options": "Advanced options", - "skip_challange": "Skip challange" + "skip_challange": "Skip challange", + "new_account_challange": "New account challange", + "click_to_show_positions": "Click to show positions", + "to": "to" }, "arc76account": { "title": "Email and password account (ARC-0076)", diff --git a/src/locales/ru.json b/src/locales/ru.json index 130dc13..b3f4fe5 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -294,7 +294,10 @@ "no_accounts_at_network": "Для выбранной сети нет учетных записей", "basic_options": "Основные параметры", "advanced_options": "Дополнительные параметры", - "skip_challange": "Skip challange" + "skip_challange": "Skip challange", + "new_account_challange": "New account challange", + "click_to_show_positions": "Click to show positions", + "to": "to" }, "arc76account": { "title": "address электронной почты и пароль учетной записи (ARC-0076)", diff --git a/src/locales/sk.json b/src/locales/sk.json index 70b41ae..18df05a 100644 --- a/src/locales/sk.json +++ b/src/locales/sk.json @@ -295,7 +295,10 @@ "no_accounts_at_network": "Pre vybranú sieť nemáte priradený žiadny účet. Zobrazujú sa všetky účty.", "basic_options": "Základné účty", "advanced_options": "Pokročilé možnosti", - "skip_challange": "Preskočiť overenie" + "skip_challange": "Preskočiť overenie", + "new_account_challange": "New account challange", + "click_to_show_positions": "Click to show positions", + "to": "to" }, "arc76account": { "title": "Účet z emailu a hesla (ARC-0076)", diff --git a/src/locales/tr.json b/src/locales/tr.json index c628c82..9f69178 100644 --- a/src/locales/tr.json +++ b/src/locales/tr.json @@ -389,7 +389,10 @@ "no_accounts_at_network": "Seçili ağ için hesap yok", "basic_options": "Temel seçenekler", "advanced_options": "Gelişmiş seçenekler", - "skip_challange": "Skip challange" + "skip_challange": "Skip challange", + "new_account_challange": "New account challange", + "click_to_show_positions": "Click to show positions", + "to": "to" }, "arc76account": { "title": "E-posta ve şifre hesabı (ARC-0076)", diff --git a/src/pages/NewAccount/Ed25529.vue b/src/pages/NewAccount/Ed25529.vue index 8aa7240..b087900 100644 --- a/src/pages/NewAccount/Ed25529.vue +++ b/src/pages/NewAccount/Ed25529.vue @@ -11,6 +11,7 @@ const state = reactive({ lastError: "", page: "newaccount", w: "", + words: [] as string[], a: "", showQR: false, guess: "", @@ -19,6 +20,16 @@ const state = reactive({ s: false, addr: "", name: "", + card1Fliped: false, + card2Fliped: false, + card3Fliped: false, + card4Fliped: false, + card5Fliped: false, + card1FlipedBefore: false, + card2FlipedBefore: false, + card3FlipedBefore: false, + card4FlipedBefore: false, + card5FlipedBefore: false, }); const reset = async () => { @@ -47,6 +58,7 @@ const createAccount = async () => { let account = algosdk.generateAccount(); state.a = account.addr; state.w = algosdk.secretKeyToMnemonic(account.sk); + state.words = state.w.split(" "); } catch (err: any) { const error = err.message ?? err; console.error("failed to create account", error, err); @@ -57,8 +69,8 @@ const createAccount = async () => { const makeRandom = () => { state.guess = ""; state.challenge = true; - //this.r = Math.floor(Math.random() * 25) + 1; - state.r = 1; + state.r = Math.floor(Math.random() * 25) + 1; + //state.r = 1; }; async function skipChallange() { @@ -77,8 +89,7 @@ async function skipChallange() { async function confirmCreate() { try { - const words = state.w.split(" "); - if (words[state.r - 1] == state.guess.trim()) { + if (state.words[state.r - 1] == state.guess.trim()) { await store.dispatch("wallet/addPrivateAccount", { mn: state.w, name: state.name, @@ -99,6 +110,8 @@ onMounted(async () => { await store.dispatch("wallet/prolong"); await createAccount(); }); + +const rotateCard = () => {};