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.
- package/index.js +14 -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
|
-
|
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