diff --git a/CHANGELOG.md b/CHANGELOG.md index 4912b0b7e..78579a199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ changes. - Allow searching for yourself in DRep Directory [Issue 2993](https://github.com/IntersectMBO/govtool/issues/2993) - Add mathematical styling for governance actions [Issue 2984](https://github.com/IntersectMBO/govtool/issues/2984) - Add script to update GovTool version +- Add `isStakeKeyRegistered` for the usage by pillars [Issue 2384](https://github.com/IntersectMBO/govtool/issues/2384) ### Fixed diff --git a/govtool/frontend/src/context/wallet.tsx b/govtool/frontend/src/context/wallet.tsx index dc0a7bf8d..77c3de83a 100644 --- a/govtool/frontend/src/context/wallet.tsx +++ b/govtool/frontend/src/context/wallet.tsx @@ -249,6 +249,7 @@ interface CardanoContextType { ) => Promise; pendingTransaction: PendingTransaction; isPendingTransaction: () => boolean; + isStakeKeyRegistered: () => boolean; buildNewInfoGovernanceAction: ( infoProps: InfoProps, ) => Promise; @@ -347,6 +348,12 @@ const CardanoProvider = (props: Props) => { } }; + /** + * Checks if there are any registered stake keys. + * @returns {boolean} True if there are registered stake keys, false otherwise. + */ + const isStakeKeyRegistered = () => !!registeredStakeKeysListState.length; + const enable = useCallback( async (walletName: string) => { setIsEnableLoading(walletName); @@ -1474,6 +1481,7 @@ const CardanoProvider = (props: Props) => { isEnabled, isMainnet, isPendingTransaction, + isStakeKeyRegistered, pendingTransaction, pubDRepKey, registeredStakeKeysListState, @@ -1507,6 +1515,7 @@ const CardanoProvider = (props: Props) => { isEnabled, isMainnet, isPendingTransaction, + isStakeKeyRegistered, pendingTransaction, pubDRepKey, registeredStakeKeysListState,