Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dashevo/dark-gravity-wave

Package Overview
Dependencies
Maintainers
12
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dashevo/dark-gravity-wave

Dark Gravity Wave difficulty retarget algorithm in JavaScript

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
12
Created
Source

dark-gravity-wave-js

Build Status NPM version

Dark Gravity Wave difficulty retargeting algorithm in JavaScript

Install

npm install @dashevo/dark-gravity-wave

Usage

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

dgw.hasValidTarget(header, previousHeaders, 'testnet');
// -> true or false

API

hasValidTarget(header, previousHeaders, [network = 'mainnet'])

header

Type: object

previousHeaders

Type: array

network

Type: string (optional, default = 'mainnet')

Validates the target (bits) property of a block header. The 2nd argument, the array of most recent previous headers, must contain block header objects of the last 24 blocks. Arrays with length > 24 are allowed however only the latest 24 will be considered. The block header objects must contain timestamp and target properties (nBits field of the block header)

Contributing

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

License

MIT © Dash Core Group, Inc.

Keywords

FAQs

Package last updated on 24 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc