evernode-js-client 0.6.55 → 0.6.57

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +6 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -61684,23 +61684,26 @@ class HostClient extends BaseEvernodeClient {
61684
61684
 
61685
61685
  /**
61686
61686
  * Send reputation scores to the reputation hook.
61687
+ * @param {number} scoreVersion Version of the scores.
61688
+ * @param {number} clusterSize Size of the cluster.
61687
61689
  * @param {object} scores [Optional] Score object in { host: score } format.
61688
61690
  */
61689
- async sendReputations(scores = null, options = {}) {
61691
+ async sendReputations(scoreVersion, clusterSize, scores = null, options = {}) {
61690
61692
  let buffer = Buffer.alloc(1);
61691
61693
  if (scores) {
61692
61694
  const preparedScores = await this.prepareHostReputationScores(scores);
61693
61695
  if (preparedScores) {
61694
- buffer = Buffer.alloc(65, 0);
61696
+ buffer = Buffer.alloc(66, 0);
61695
61697
  let i = 0;
61696
61698
  for (const reputationScore of preparedScores) {
61697
61699
  buffer.writeUIntLE(Number(reputationScore.scoreValue), i + 1, 1);
61698
61700
  i++;
61699
61701
  }
61702
+ buffer.writeUIntLE(clusterSize, 65, 1);
61700
61703
  }
61701
61704
  }
61702
61705
 
61703
- buffer.writeUIntLE(ReputationConstants.SCORE_VERSION, 0, 1);
61706
+ buffer.writeUIntLE(scoreVersion, 0, 1);
61704
61707
 
61705
61708
  const paramData = codec.decodeAccountID(this.xrplAcc.address);
61706
61709
 
@@ -63577,7 +63580,6 @@ const ErrorReasons = {
63577
63580
  }
63578
63581
 
63579
63582
  const ReputationConstants = {
63580
- SCORE_VERSION: 1,
63581
63583
  REP_INFO_BUFFER_SIZE: 43,
63582
63584
  REP_INFO_PUBKEY_OFFSET: 0,
63583
63585
  REP_INFO_PEER_PORT_OFFSET: 33,
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  ],
7
7
  "homepage": "https://github.com/HotPocketDev/evernode-js-client",
8
8
  "license": "SEE LICENSE IN https://raw.githubusercontent.com/EvernodeXRPL/evernode-resources/main/license/evernode-license.pdf",
9
- "version": "0.6.55",
9
+ "version": "0.6.57",
10
10
  "dependencies": {
11
11
  "elliptic": "6.5.4",
12
12
  "libsodium-wrappers": "0.7.10",