evernode-js-client 0.6.6 → 0.6.7

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 +10 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -12563,14 +12563,16 @@ class BaseEvernodeClient {
12563
12563
  if (idStateData) {
12564
12564
  const idStateDecoded = StateHelpers.decodeCandidateIdState(Buffer.from(idStateData, 'hex'));
12565
12565
 
12566
- const ownerStateKey = StateHelpers.generateCandidateOwnerStateKey(idStateDecoded.ownerAddress);
12567
- const ownerStateIndex = StateHelpers.getHookStateIndex(this.governorAddress, ownerStateKey);
12568
- const ownerLedgerEntry = await this.xrplApi.getLedgerEntry(ownerStateIndex);
12569
-
12570
- const ownerStateData = ownerLedgerEntry?.HookStateData;
12571
- if (ownerStateData) {
12572
- const ownerStateDecoded = StateHelpers.decodeCandidateOwnerState(Buffer.from(ownerStateKey, 'hex'), Buffer.from(ownerStateData, 'hex'));
12573
- return { ...ownerStateDecoded, ...idStateDecoded };
12566
+ if (StateHelpers.getCandidateType(candidateId) === EvernodeConstants.CandidateTypes.NewHook) {
12567
+ const ownerStateKey = StateHelpers.generateCandidateOwnerStateKey(idStateDecoded.ownerAddress);
12568
+ const ownerStateIndex = StateHelpers.getHookStateIndex(this.governorAddress, ownerStateKey);
12569
+ const ownerLedgerEntry = await this.xrplApi.getLedgerEntry(ownerStateIndex);
12570
+
12571
+ const ownerStateData = ownerLedgerEntry?.HookStateData;
12572
+ if (ownerStateData) {
12573
+ const ownerStateDecoded = StateHelpers.decodeCandidateOwnerState(Buffer.from(ownerStateKey, 'hex'), Buffer.from(ownerStateData, 'hex'));
12574
+ return { ...ownerStateDecoded, ...idStateDecoded };
12575
+ }
12574
12576
  }
12575
12577
 
12576
12578
  return { ...idStateDecoded, uniqueId: candidateId };
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.6.6",
9
+ "version": "0.6.7",
10
10
  "dependencies": {
11
11
  "elliptic": "6.5.4",
12
12
  "libsodium-wrappers": "0.7.10",