Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions govtool/frontend/src/context/wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ interface CardanoContextType {
) => Promise<VotingBuilder>;
pendingTransaction: PendingTransaction;
isPendingTransaction: () => boolean;
isStakeKeyRegistered: () => boolean;
buildNewInfoGovernanceAction: (
infoProps: InfoProps,
) => Promise<VotingProposalBuilder | undefined>;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1474,6 +1481,7 @@ const CardanoProvider = (props: Props) => {
isEnabled,
isMainnet,
isPendingTransaction,
isStakeKeyRegistered,
pendingTransaction,
pubDRepKey,
registeredStakeKeysListState,
Expand Down Expand Up @@ -1507,6 +1515,7 @@ const CardanoProvider = (props: Props) => {
isEnabled,
isMainnet,
isPendingTransaction,
isStakeKeyRegistered,
pendingTransaction,
pubDRepKey,
registeredStakeKeysListState,
Expand Down