0

I am trying to sign a transaction using cardano-wallet-js. The private key is being generated from Cardano-wallet. Here's the code snippet:

 rootKey = Seed.deriveRootKey([
      'script', vintage','furnace','churn','legal','improve',
'enroll','collect','love','limb','guilt',genre',
'region','sunset','region','vapor','loop','proud',
'range','witness','list','weasel','volume','shrug',]);
  } catch (error) {
    console.log(`error in rootkey gen: ${error}`);
  }

let coinSelection = 
await wallet.getCoinSelection(buyerAddresses, amounts, {assets: assets});

  let signingKeys = coinSelection.inputs.map(i => {
    let privateKey = Seed.deriveKey(rootKey, i.derivation_path);
    return privateKey;
  });



  let txVkeyWitnessess = Vkeywitnesses.new();
  try{
    txVkeyWitnessess.add(
    make_vkey_witness(
      hash_transaction(txBody),
      PrivateKey.from_normal_bytes(signingKeys[0].to_raw_key().as_bytes())
    ));

  } catch(error) {
console.log(error);
return;
  }

Am am not sure what I am doing wrong but I keep getting the error: Invalid normal secret key. Any ideas what I could be getting wrong?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.