Create a script: convert.js
#!/usr/bin/env node import {PrivateKey} from "@hashgraph/sdk"; let hex = process.argv[2]; console.log(hex); let x = PrivateKey.fromStringED25519(hex); let der = x.toBytesDer(); let derhex = Buffer.from(der).toString('hex'); console.log(derhex); Run:
npm i Set "type": "module" in package.json Run
Run:
./convert.js