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.
- package/index.js +10 -8
- 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
|
-
|
12567
|
-
|
12568
|
-
|
12569
|
-
|
12570
|
-
|
12571
|
-
|
12572
|
-
|
12573
|
-
|
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 };
|