When submitting a script through polkadot-js console and trying to sign using Talisman wallet, I got the error Cannot sign with a locked key pair
:
The script is one of the examples, where SENDER is the address from my Talisman wallet:
const SENDER = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
const RECEIVER = '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty';
// Get a random number between 1 and 100000
const randomAmount = Math.floor((Math.random() * 100000) + 1);
// Create a extrinsic, transferring randomAmount units to receiver.
const transfer = api.tx.balances.transferAllowDeath(RECEIVER, randomAmount);
// Sign and Send the transaction
await transfer.signAndSend(SENDER, ({ events = [], status }) => {
if (status.isInBlock) {
console.log('Successful transfer of ' + randomAmount + ' with hash ' + status.asInBlock.toHex());
} else {
console.log('Status of transfer: ' + status.type);
}
events.forEach(({ phase, event: { data, method, section } }) => {
console.log(phase.toString() + ' : ' + section + '.' + method + ' ' + data.toString());
});
});
Environment
- Brave Browser - Version 1.65.114 Chromium: 124.0.6367.60 (Official Build) (64-bit)
- Talisman Wallet - Version v1.25.0