feat: add private key viewing for addresses
All checks were successful
check / check (push) Successful in 22s
All checks were successful
check / check (push) Successful in 22s
Add a 'Show private key' button on the address detail view that opens a dedicated password-prompt screen with a clear warning about key sensitivity. After correct password entry, the derived private key is displayed in a read-only well with a copy button. - Add getPrivateKeyForAddress() to wallet.js - Add showPrivateKey view with password verification - Add clipboard policy section to README explaining why we never auto-clear the clipboard - Register new view in helpers.js VIEWS array and wire up in index.js Closes #19
This commit is contained in:
@@ -41,6 +41,18 @@ function getSignerForAddress(walletData, addrIndex, decryptedSecret) {
|
||||
return new Wallet(decryptedSecret);
|
||||
}
|
||||
|
||||
function getPrivateKeyForAddress(walletData, addrIndex, decryptedSecret) {
|
||||
if (walletData.type === "hd") {
|
||||
const node = HDNodeWallet.fromPhrase(
|
||||
decryptedSecret,
|
||||
"",
|
||||
BIP44_ETH_PATH,
|
||||
);
|
||||
return node.deriveChild(addrIndex).privateKey;
|
||||
}
|
||||
return decryptedSecret;
|
||||
}
|
||||
|
||||
function isValidMnemonic(mnemonic) {
|
||||
return Mnemonic.isValidMnemonic(mnemonic);
|
||||
}
|
||||
@@ -51,5 +63,6 @@ module.exports = {
|
||||
hdWalletFromMnemonic,
|
||||
addressFromPrivateKey,
|
||||
getSignerForAddress,
|
||||
getPrivateKeyForAddress,
|
||||
isValidMnemonic,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user