Creo mi billetera de firmante de la siguiente manera:
const seed = bip39.mnemonicToSeedSync(WALLET_MNEMONIC, WALLET_PASSWORD); const privateKeyBuffer = bip32 .fromSeed(seed) .derivePath(`m/44'/434'/0'/0/0`).privateKey; const keyring = new Keyring({ss58Format: 2}); return keyring.addFromAddress('0x'+privateKeyBuffer.toString("hex"));y trato de transferir KSM de esa cuenta a otra:
const unsub = await api.tx.balances .transfer(recipientAddress, amount) .signAndSend(signerWallet, (result) => { console.log(`Current status is ${result.status}`); if (result.status.isInBlock) { console.log(`Transaction included at blockHash ${result.status.asInBlock}`); } else if (result.status.isFinalized) { console.log(`Transaction finalized at blockHash ${result.status.asFinalized}`); unsub(); } });Sin embargo me sale ese error:
Cannot sign with a locked key pair¿Cuál es el problema con mi código?