Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to retrieve keypair xxx #1968

Open
picascaz opened this issue Jan 9, 2025 · 0 comments
Open

Unable to retrieve keypair xxx #1968

picascaz opened this issue Jan 9, 2025 · 0 comments

Comments

@picascaz
Copy link

picascaz commented Jan 9, 2025

Issues with upgrading chrome extension mv2 to mv3

error: Unable to retrieve keypair 'cTM3b5VHhkviXcXsg6QLMpK4W4vgNd6fjCi26CdXd4s7q4jud'

"@polkadot/api": "4.13.1",
"@polkadot/api-contract": "4.13.1",
"@polkadot/extension-inject": "0.38.1",
"@polkadot/react-identicon": "0.80.1",
"@polkadot/ui-keyring": "0.80.1",
"@polkadot/wasm-crypto": "^6.2.1",

node version --> 14.7

code:
const getSignMessage = async (account, password, message) => {
try {
const accountPair =keyring.getPair(account.address);

if (accountPair.isLocked) {
  accountPair.unlock(password);
}
const signedMessage = u8aToHex(
  accountPair.sign(stringToU8a(message.message))
);
const result = {
  account: getAccountForUI(account),
  message: {
    ...message,
    signedMessage,
  },
};
return result;

} catch (err) {
console.error("getSignMessage error", err);
}
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant