cazala / coin-hive

CoinHive cryptocurrency miner for node.js
https://www.npmjs.com/package/coin-hive
MIT License
1.98k stars 397 forks source link

cannot create new CoinHive.User #82

Closed MaestroJurko closed 6 years ago

MaestroJurko commented 6 years ago
node:40465) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: _coinHive2.default.User is not aconstructor

I tried to generate a new CoinHive user, but cannot. What am I doint wrong?

const miner = new CoinHive.User(key, hash)
cazala commented 6 years ago
const miner = await CoinHive('site-key', { username: 'bla' });
MaestroJurko commented 6 years ago

Yes sorry, I thought it is CoinHive API, but I see this is a wrapper so that we can mine with node. Sorry again and thank you for this great library.