@loyal-labs/private-transactions 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +16 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23428,8 +23428,9 @@ class LoyalPrivateTransactionsClient {
|
|
|
23428
23428
|
console.error("/getDelegationStatus", JSON.stringify(delegationStatus, null, 2));
|
|
23429
23429
|
console.error("baseAccountInfo", prettyStringify(baseAccountInfo));
|
|
23430
23430
|
console.error("ephemeralAccountInfo", prettyStringify(ephemeralAccountInfo));
|
|
23431
|
-
|
|
23432
|
-
|
|
23431
|
+
const authority = delegationStatus.result?.delegationRecord?.authority;
|
|
23432
|
+
if (authority && authority !== ER_VALIDATOR.toString()) {
|
|
23433
|
+
console.error(`Account is delegated on wrong validator: ${displayName}${account.toString()} - validator: ${authority}`);
|
|
23433
23434
|
}
|
|
23434
23435
|
throw new Error(`Account is delegated to ER: ${displayName}${account.toString()}`);
|
|
23435
23436
|
}
|
|
@@ -23488,7 +23489,19 @@ class LoyalPrivateTransactionsClient {
|
|
|
23488
23489
|
console.error("[getDelegationStatus] TEE fetch failed, falling back to devnet-router:", e);
|
|
23489
23490
|
}
|
|
23490
23491
|
const res = await fetch("https://devnet-router.magicblock.app/getDelegationStatus", options);
|
|
23491
|
-
|
|
23492
|
+
const routerData = await res.json();
|
|
23493
|
+
if (routerData.error?.message?.includes(ER_VALIDATOR.toString())) {
|
|
23494
|
+
return {
|
|
23495
|
+
...routerData,
|
|
23496
|
+
result: {
|
|
23497
|
+
isDelegated: true,
|
|
23498
|
+
delegationRecord: {
|
|
23499
|
+
authority: ER_VALIDATOR.toString()
|
|
23500
|
+
}
|
|
23501
|
+
}
|
|
23502
|
+
};
|
|
23503
|
+
}
|
|
23504
|
+
return routerData;
|
|
23492
23505
|
}
|
|
23493
23506
|
}
|
|
23494
23507
|
// index.ts
|