Skip to content

Commit 8b477e1

Browse files
author
jagdeep sidhu
committed
[PLW003v3-ER03] | PIN not recognized to reveal UTXO PK
fixes #729
1 parent bef8b7c commit 8b477e1

File tree

12 files changed

+141
-74
lines changed

12 files changed

+141
-74
lines changed

source/assets/locales/de.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
"password": "Passwort",
167167
"importAccountsWont": "Importierte Konten werden nicht mit Ihrer ursprünglichen Pali-Konto-Geheimen Wiederherstellungsphrase verknüpft.",
168168
"yourPrivateKey": "Ihr privater Schlüssel",
169+
"hardwareWalletPrivateKeyUnavailable": "Hardware-Wallet-Konto: Private Schlüssel verlassen Ledger/Trezor-Geräte nie, daher kann Pali sie nicht exportieren.",
169170
"utxoKeyOnEvmError": "Dies scheint ein UTXO-Privatschlüssel zu sein. Bitte wechseln Sie zu einem UTXO-Netzwerk (Bitcoin/Syscoin), um ihn zu importieren.",
170171
"evmKeyOnUtxoError": "Dies scheint ein EVM-Privatschlüssel zu sein. Bitte wechseln Sie zu einem EVM-Netzwerk, um ihn zu importieren.",
171172
"invalidPrivateKeyFormat": "Ungültiges Privatschlüsselformat",

source/assets/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@
485485
"password": "Password",
486486
"importAccountsWont": "Imported accounts won't link to your initial Pali account Secret Recovery Phrase.",
487487
"yourPrivateKey": "Your Private Key",
488+
"hardwareWalletPrivateKeyUnavailable": "Hardware wallet account: Private keys never leave Ledger/Trezor devices, so Pali cannot export them.",
488489
"utxoKeyOnEvmError": "This appears to be a UTXO private key. Please switch to a UTXO network (Bitcoin/Syscoin) to import it.",
489490
"evmKeyOnUtxoError": "This appears to be an EVM private key. Please switch to an EVM network to import it.",
490491
"invalidPrivateKeyFormat": "Invalid private key format",

source/assets/locales/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@
485485
"enterYourPassword": "Ingresa tu contraseña",
486486
"importAccountsWont": "Las cuentas importadas no estarán vinculadas a la Frase de Recuperación Secreta de tu cuenta Pali inicial.",
487487
"yourPrivateKey": "Tu Clave Privada",
488+
"hardwareWalletPrivateKeyUnavailable": "Cuenta de monedero hardware: Las claves privadas nunca salen de los dispositivos Ledger/Trezor, por lo que Pali no puede exportarlas.",
488489
"utxoKeyOnEvmError": "Esto parece ser una clave privada UTXO. Por favor, cambia a una red UTXO (Bitcoin/Syscoin) para importarla.",
489490
"evmKeyOnUtxoError": "Esto parece ser una clave privada EVM. Por favor, cambia a una red EVM para importarla.",
490491
"invalidPrivateKeyFormat": "Formato de clave privada inválido",

source/assets/locales/fr.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
"password": "Mot de passe",
167167
"importAccountsWont": "Les comptes importés ne seront pas liés à votre phrase de récupération secrète initiale du compte Pali.",
168168
"yourPrivateKey": "Votre clé privée",
169+
"hardwareWalletPrivateKeyUnavailable": "Compte de portefeuille matériel : les clés privées ne quittent jamais les appareils Ledger/Trezor, donc Pali ne peut pas les exporter.",
169170
"utxoKeyOnEvmError": "Cela semble être une clé privée UTXO. Veuillez basculer vers un réseau UTXO (Bitcoin/Syscoin) pour l'importer.",
170171
"evmKeyOnUtxoError": "Cela semble être une clé privée EVM. Veuillez basculer vers un réseau EVM pour l'importer.",
171172
"invalidPrivateKeyFormat": "Format de clé privée invalide",

source/assets/locales/ja.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
"password": "パスワード",
167167
"importAccountsWont": "インポートされたアカウントは、初期のPaliアカウント秘密リカバリーフレーズにリンクされません。",
168168
"yourPrivateKey": "あなたの秘密鍵",
169+
"hardwareWalletPrivateKeyUnavailable": "ハードウェアウォレットアカウント: 秘密鍵は Ledger/Trezor デバイスから決して外部に出ないため、Pali ではエクスポートできません。",
169170
"utxoKeyOnEvmError": "これはUTXO秘密鍵のようです。インポートするにはUTXOネットワーク(Bitcoin/Syscoin)に切り替えてください。",
170171
"evmKeyOnUtxoError": "これはEVM秘密鍵のようです。インポートするにはEVMネットワークに切り替えてください。",
171172
"invalidPrivateKeyFormat": "無効な秘密鍵フォーマット",

source/assets/locales/ko.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
"password": "비밀번호",
167167
"importAccountsWont": "가져온 계정은 초기 Pali 계정 비밀 복구 구문에 연결되지 않습니다.",
168168
"yourPrivateKey": "개인 키",
169+
"hardwareWalletPrivateKeyUnavailable": "하드웨어 지갑 계정: 개인 키는 Ledger/Trezor 기기 밖으로 절대 나가지 않으므로 Pali에서 내보낼 수 없습니다.",
169170
"utxoKeyOnEvmError": "이것은 UTXO 개인 키로 보입니다. 가져오려면 UTXO 네트워크(Bitcoin/Syscoin)로 전환하세요.",
170171
"evmKeyOnUtxoError": "이것은 EVM 개인 키로 보입니다. 가져오려면 EVM 네트워크로 전환하세요.",
171172
"invalidPrivateKeyFormat": "잘못된 개인 키 형식",

source/assets/locales/pt.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@
478478
"password": "Senha",
479479
"importAccountsWont": "As contas importadas não se vincularão à sua Frase de Recuperação Secreta inicial da conta Pali.",
480480
"yourPrivateKey": "Sua Chave Privada",
481+
"hardwareWalletPrivateKeyUnavailable": "Conta de carteira de hardware: As chaves privadas nunca saem dos dispositivos Ledger/Trezor, portanto o Pali não pode exportá-las.",
481482
"utxoKeyOnEvmError": "Isso parece ser uma chave privada UTXO. Por favor, mude para uma rede UTXO (Bitcoin/Syscoin) para importá-la.",
482483
"evmKeyOnUtxoError": "Isso parece ser uma chave privada EVM. Por favor, mude para uma rede EVM para importá-la.",
483484
"invalidPrivateKeyFormat": "Formato de chave privada inválido",

source/assets/locales/ru.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
"password": "Пароль",
167167
"importAccountsWont": "Импортированные аккаунты не будут связаны с вашей изначальной секретной фразой восстановления аккаунта Pali.",
168168
"yourPrivateKey": "Ваш приватный ключ",
169+
"hardwareWalletPrivateKeyUnavailable": "Аппаратный кошелёк: приватные ключи никогда не покидают устройства Ledger/Trezor, поэтому Pali не может их экспортировать.",
169170
"utxoKeyOnEvmError": "Это похоже на приватный ключ UTXO. Пожалуйста, переключитесь на сеть UTXO (Bitcoin/Syscoin), чтобы импортировать его.",
170171
"evmKeyOnUtxoError": "Это похоже на приватный ключ EVM. Пожалуйста, переключитесь на сеть EVM, чтобы импортировать его.",
171172
"invalidPrivateKeyFormat": "Неверный формат приватного ключа",

source/assets/locales/zh.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
"password": "密码",
167167
"importAccountsWont": "导入的账户不会链接到您初始的Pali账户密钥恢复短语。",
168168
"yourPrivateKey": "您的私钥",
169+
"hardwareWalletPrivateKeyUnavailable": "硬件钱包账户:私钥永远不会离开 Ledger/Trezor 设备,因此 Pali 无法导出它们。",
169170
"utxoKeyOnEvmError": "这似乎是一个UTXO私钥。请切换到UTXO网络(Bitcoin/Syscoin)以导入它。",
170171
"evmKeyOnUtxoError": "这似乎是一个EVM私钥。请切换到EVM网络以导入它。",
171172
"invalidPrivateKeyFormat": "无效的私钥格式",

source/components/Header/AccountMenu.tsx

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Menu } from '@headlessui/react';
22
import React from 'react';
33
import { useTranslation } from 'react-i18next';
4+
import { useSelector } from 'react-redux';
45

56
import {
67
AddUserSvg,
@@ -11,6 +12,7 @@ import {
1112
} from 'components/Icon/Icon';
1213
import { useUtils } from 'hooks/index';
1314
import { useController } from 'hooks/useController';
15+
import { RootState } from 'state/store';
1416
import { KeyringAccountType } from 'types/network';
1517
import {
1618
createNavigationContext,
@@ -23,6 +25,12 @@ export const AccountMenu: React.FC = () => {
2325
const { navigate } = useUtils();
2426
const { controllerEmitter, handleWalletLockedError } = useController();
2527
const { t } = useTranslation();
28+
const activeAccountMeta = useSelector(
29+
(state: RootState) => state.vault.activeAccount
30+
);
31+
const isHardwareAccount =
32+
activeAccountMeta?.type === KeyringAccountType.Ledger ||
33+
activeAccountMeta?.type === KeyringAccountType.Trezor;
2634
const setActiveAccount = async (id: number, type: KeyringAccountType) => {
2735
try {
2836
await controllerEmitter(['wallet', 'setAccount'], [Number(id), type]);
@@ -87,24 +95,26 @@ export const AccountMenu: React.FC = () => {
8795
</li>
8896
</Menu.Item>
8997

90-
<Menu.Item>
91-
<li
92-
onClick={() => {
93-
const returnContext = createNavigationContext('/home');
94-
navigateWithContext(
95-
navigate,
96-
'/settings/account/private-key',
97-
{ fromMenu: true },
98-
returnContext
99-
);
100-
}}
101-
className="py-1.5 cursor-pointer px-6 w-full backface-visibility-hidden flex items-center gap-3 justify-start text-white text-sm font-medium hover:bg-brand-blue500 hover:bg-opacity-20 active:bg-opacity-40 focus:outline-none transition-colors duration-200"
102-
>
103-
<KeySvg className="mb-2 text-brand-white" />
98+
{!isHardwareAccount && (
99+
<Menu.Item>
100+
<li
101+
onClick={() => {
102+
const returnContext = createNavigationContext('/home');
103+
navigateWithContext(
104+
navigate,
105+
'/settings/account/private-key',
106+
{ fromMenu: true },
107+
returnContext
108+
);
109+
}}
110+
className="py-1.5 cursor-pointer px-6 w-full backface-visibility-hidden flex items-center gap-3 justify-start text-white text-sm font-medium hover:bg-brand-blue500 hover:bg-opacity-20 active:bg-opacity-40 focus:outline-none transition-colors duration-200"
111+
>
112+
<KeySvg className="mb-2 text-brand-white" />
104113

105-
<span>{t('accountMenu.yourKeys')}</span>
106-
</li>
107-
</Menu.Item>
114+
<span>{t('accountMenu.yourKeys')}</span>
115+
</li>
116+
</Menu.Item>
117+
)}
108118

109119
<Menu.Item>
110120
<li

0 commit comments

Comments
 (0)