We will be sunsetting Advisor during Jan, 2026 and will instead be providing information in Snyk Security DB.

You can begin to take advantage of Snyk Security DB today for a unified, package-centric experience.

How to use the @nimiq/core.BlockUtils function in @nimiq/core

To help you get started, we’ve selected a few @nimiq/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MatthewDLudwig / NimiqWrapper / releases / browser / NimiqWrapper.js View on Github external
get globalHashrate() {
		const nBits = this.wrappedNode.blockchain.head.header.nBits;
		const difficulty = Nimiq.BlockUtils.compactToDifficulty(nBits);
		return difficulty * Math.pow(2, 16) / Nimiq.Policy.BLOCK_TIME;
	}
github skypool-org / skypool-nimiq-miner / Miner.js View on Github external
_onWorkRange(data) {
        Log.i(Miner, `receive workRange ${data[P.WorkRange_256]} Difficult ${data[P.WorkRange_Difficult]}`)
        this._workrange4096 = data[P.WorkRange_256] / 16;
        this._workrange4096pullThreshold = Math.round(this._workrange4096 / 2);
        this._compact = Nimiq.BlockUtils.difficultyToCompact(new BigNumber(data[P.WorkRange_Difficult]));
    }