I'm trying to new Cardano.Bip32PrivateKey
from string cborHex which in file skey
generate by cardano-cli
import * as Cardano from "@emurgo/cardano-serialization-lib-nodejs";
function genAccountKey(cborHex: string) {
return Cardano.Bip32PrivateKey.from_bytes(Buffer.from(cborHex, "hex"))
.derive(harden(1852)) // purpose
.derive(harden(1815)) // coin type
.derive(harden(0)); // account #0
}
genAccountKey("58204022747367deee69f601900e15ddc04fc8024753b6a1539ee2a8bed29832f420");
but I got this err (node:87994) UnhandledPromiseRejectionWarning: Invalid Secret Key size