Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async run() {
const result = await super.run();
if (result.publicKey) {
const compressedPublicKey = compressPublicKey(result.publicKey);
return compressedPublicKey;
} else {
throw new {message: "Unable to export public key."};
}
}
export async function exportLedgerPubKey(path, ledgerbtc) {
try {
const result = await ledgerbtc.getWalletPublicKey(path, {verify: true});
if (result.publicKey) {
const compressedPublicKey = compressPublicKey(result.publicKey);
return { success: true, publicKey: compressedPublicKey };
} else { return null; }
} catch(e) {
return { success: false, text: e.message };
}
}