From f31a2751ab143e8f413501ab8c8ad0f867b539b6 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 20 Jul 2021 04:27:04 +0000 Subject: [PATCH] Added autolykos2 support --- index.js | 10 ++++++++++ package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 98ef81a..bece0b1 100644 --- a/index.js +++ b/index.js @@ -189,4 +189,14 @@ module.exports.EthBlockTemplate = function(rpcData) { difficulty: difficulty, height: parseInt(rpcData[3]) }; +}; + +module.exports.ErgBlockTemplate = function(rpcData) { + const difficulty = module.exports.baseDiff().div(bignum(rpcData.b)).toNumber(); + return { + hash: rpcData.msg, + hash2: rpcData.pk, + difficulty: difficulty, + height: parseInt(rpcData.h) + }; }; \ No newline at end of file diff --git a/package.json b/package.json index 24fa48d..f8e1b4d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cryptoforknote-util", - "version": "9.2.0", + "version": "10.0.0", "main": "cryptoforknote-util", "author": { "name": "LucasJones",