evernode-js-client 0.5.17-beta-v3.7 → 0.5.17-beta-v3.8

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 +14 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -15305,9 +15305,21 @@ class StateHelpers {
15305
15305
  }
15306
15306
  else if (Buffer.from(HookStateKeys.PREFIX_CANDIDATE_ID, 'hex').compare(stateKey, 0, 4) === 0) {
15307
15307
  // Generate the owner state key.
15308
- return {
15308
+ const candidateData = {
15309
15309
  type: this.StateTypes.CANDIDATE_ID,
15310
- key: hexKey,
15310
+ key: hexKey
15311
+ };
15312
+
15313
+ const uniqueIdBuf = Buffer.alloc(32, 0);
15314
+ stateKey.copy(uniqueIdBuf, 4, 4, 32);
15315
+ candidateData.uniqueId = uniqueIdBuf.toString('hex').toUpperCase();
15316
+
15317
+ const candidateType = stateKey.readUInt8(4);
15318
+ if (EvernodeConstants.CandidateTypes.DudHost === candidateType)
15319
+ candidateData.dudHostAddress = codec.encodeAccountID(stateKey.slice(12, 32));
15320
+
15321
+ return {
15322
+ ...candidateData,
15311
15323
  ...this.decodeCandidateIdState(stateData)
15312
15324
  }
15313
15325
  }
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  ],
7
7
  "homepage": "https://github.com/HotPocketDev/evernode-js-client",
8
8
  "license": "MIT",
9
- "version": "0.5.17-beta-v3.7",
9
+ "version": "0.5.17-beta-v3.8",
10
10
  "dependencies": {
11
11
  "elliptic": "6.5.4",
12
12
  "libsodium-wrappers": "0.7.10",