Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Can not convert private key to address #17

Open
elvis-hp opened this issue Oct 30, 2018 · 3 comments
Open

Can not convert private key to address #17

elvis-hp opened this issue Oct 30, 2018 · 3 comments

Comments

@elvis-hp
Copy link

elvis-hp commented Oct 30, 2018

Hi, pls see the photo, I can not convert Private key to address.
I'm using: "litecore-lib": "^0.13.22",

And my codes:
var privateKey = "***"
var litecore = require('litecore-lib');
var address = new litecore.PrivateKey(privateKey).toAddress();
pls help me, thank you so much!

screen shot 2018-10-30 at 5 55 02 pm

@elvis-hp elvis-hp changed the title Can not convert private key to adress Can not convert private key to address Oct 30, 2018
@ultragtx
Copy link

Hi @0xngoubou, this issue may be caused by bad npm modules, if you are using yarn, try npm instead.

I've tested on my OSX machine with node 10.8.0, created a new project, npm i litecore-lib, and it works with no issue.

Here's the package-lock.json if you need: package-lock.json.txt

@elvis-hp
Copy link
Author

Hi, @ultragtx, thank you for helping me.
But it does not work for. I try: npm i litecore-lib
But it still bugs in bitcore-lib (not litecore-lib)
Before that, I installed and used bitcore-lib. My project supports both BTC and BCH. Now need to add LiteCoin.

screen shot 2018-10-31 at 11 48 18 am

@elvis-hp
Copy link
Author

elvis-hp commented Nov 5, 2018

new error:

var privateKey = new litecore.PrivateKey();
console.log("privateKey", privateKey);
var address = privateKey.toAddress();
console.log("new address", address);

screen shot 2018-11-05 at 1 38 42 pm

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants