I am using litecore-lib in nodejs.
Code:
var pkey = new litecore.PrivateKey();
var address = pkey.toAddress();
spawn('litecoin-cli',['importprivkey',pkey]);
But it gives me Error Message:
error code: -5 error message: Invalid private key encoding
Please Help!!?
var pkey = new litecore.PrivateKey();
var address = pkey.toAddress();
spawn('litecoin-cli',['importprivkey',pkey.toWIP()]);
Forgot to convert the address to WIP format. Now working fine