JSPM

@dashevo/dark-gravity-wave

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 183
  • Score
    100M100P100Q91966F
  • License MIT

Dark Gravity Wave difficulty retarget algorithm in JavaScript

Package Exports

  • @dashevo/dark-gravity-wave

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@dashevo/dark-gravity-wave) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

dark-gravity-wave-js

Build Status NPM version

Dark Gravity Wave difficulty retarget algorithm in JavaScript

Install

npm install @dashevo/dark-gravity-wave

Usage

var dgw = require('@dashevo/dark-gravity-wave');

dgw.getTarget(lastHeaders);
// -> '1be4c4d3'

API

getTarget(array)

array

Type: array

Get the difficulty. The array must contain the last 24 blocks. Arrays with length > 24 are allowed however only latest 24 will be considered. Array objects must contain timestamp and target properties (where target = the difficulty at which the block has been solved)

getTarget(array,blockTime)

array

Type: array, int (default 150)

Get the difficulty for dark-gravity-wave's other than dash's 150 second block time.

Contributing

Feel free to dive in! Open an issue or submit PRs.

License

MIT © Dash Core Group, Inc.