Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c6b5be8
Bump chromedriver from 143.0.4 to 144.0.0 in /packages/e2e-tests
dependabot[bot] Jan 23, 2026
80c9aa1
Merge pull request #4493 from Emurgo/dependabot/npm_and_yarn/packages…
Nebyt Jan 23, 2026
079e258
Bump chromedriver from 144.0.0 to 145.0.0 in /packages/e2e-tests
dependabot[bot] Jan 30, 2026
d4fa500
Merge remote-tracking branch 'origin/production' into develop
Feb 5, 2026
f431609
Merge branch 'develop' into dependabot/npm_and_yarn/packages/e2e-test…
Nebyt Feb 5, 2026
064945e
Merge pull request #4498 from Emurgo/dependabot/npm_and_yarn/packages…
Nebyt Feb 5, 2026
b4c9704
Bump chromedriver from 145.0.0 to 145.0.1 in /packages/e2e-tests
dependabot[bot] Feb 6, 2026
9507f60
Merge pull request #4499 from Emurgo/dependabot/npm_and_yarn/packages…
Nebyt Feb 6, 2026
55d436f
make drep selection neutral and agnostic
Cerkoryn Mar 5, 2026
f610ca9
Remove unreachable code
Cerkoryn Mar 5, 2026
c35ceb1
Remove redundant hook
Cerkoryn Mar 5, 2026
ac711c7
Remove unused constants
Cerkoryn Mar 5, 2026
ee09782
Merge pull request #4501 from Cerkoryn/drep-neutrality
zuzunker Mar 16, 2026
20a0563
unused code removal
zuzunker Mar 16, 2026
1dcce83
hook rename and flow fix
zuzunker Mar 16, 2026
5d6a508
governance status page removed, straight to governance options
zuzunker Mar 16, 2026
fee6f59
unlinked governance popup when staking
zuzunker Mar 16, 2026
db32259
"earn ada" banner removed
zuzunker Mar 16, 2026
408d5d8
yoroi drep mention removed
zuzunker Mar 16, 2026
d892d58
prettier
zuzunker Mar 16, 2026
18104e0
banner type rewards is removed
zuzunker Mar 16, 2026
4977741
governance safeguard for zero balance
zuzunker Mar 16, 2026
f98539c
removed unused depenencies
zuzunker Mar 16, 2026
b857863
prettier
zuzunker Mar 16, 2026
3a14993
Merge pull request #4502 from Emurgo/ruslan/post-governance-rework
zuzunker Mar 17, 2026
6a4d403
Version bump to match latest nightly
zuzunker Mar 17, 2026
7aa1e2b
Version bump: 5.21.0.2 (nightly)
zuzunker Mar 17, 2026
dd6ad74
Merge pull request #4504 from Emurgo/bump/develop
zuzunker Mar 17, 2026
3c03514
display governance errors
zuzunker Mar 17, 2026
157e643
Version bump: 5.22.0
zuzunker Mar 17, 2026
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
8 changes: 4 additions & 4 deletions packages/e2e-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@emurgo/cardano-serialization-lib-nodejs": "13.2.1",
"bignumber.js": "^9.1.2",
"chai": "^4.3.10",
"chromedriver": "143.0.4",
"chromedriver": "145.0.1",
"cross-env": "^7.0.3",
"dockerode": "^4.0.5",
"json-server": "^0.17.4",
Expand Down
5 changes: 1 addition & 4 deletions packages/yoroi-extension/app/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ import { DappCenterContextProvider } from './UI/features/dapp-center/module/Dapp
// $FlowIgnore: suppressing this error
import GovernanceOptionsPage from './UI/pages/Governance/GovernanceOptionsPage';
// $FlowIgnore: suppressing this error
import GovernanceStatusPage from './UI/pages/Governance/GovernanceStatusPage';
// $FlowIgnore: suppressing this error
import PortfolioDappsPage from './UI/pages/portfolio/PortfolioDappsPage';
// $FlowIgnore: suppressing this error
import NftsPage from './UI/pages/nfts/NftsPage';
Expand Down Expand Up @@ -253,8 +251,7 @@ export const YoroiRoutes = (stores: StoresMap): Node => {
</Route>

<Route element={<GovernanceSubpages stores={stores} />}>
<Route path={ROUTES.GOVERNANCE.ROOT} element={<GovernanceStatusPage stores={stores} />} />
<Route path={ROUTES.GOVERNANCE.OPTIONS} element={<GovernanceOptionsPage stores={stores} />} />
<Route path={ROUTES.GOVERNANCE.ROOT} element={<GovernanceOptionsPage stores={stores} />} />
</Route>
<Route element={<StakingSubpages stores={stores} />}>
<Route path={ROUTES.STAKING_REVAMP.ROOT} element={<StakingPageRevamp stores={stores} />} />
Expand Down
1 change: 0 additions & 1 deletion packages/yoroi-extension/app/UI/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export enum BannerType {
BuyAda = 'buyAdaBanner',
Bring = 'bringBanner',
Usda = 'usdaBanner',
Rewards = 'rewardsBanner',
}

export const SUPPORT_CRISP_CHATBOX_URL = 'https://emurgo.github.io/yoroi-crisp-support/';
Expand Down
26 changes: 3 additions & 23 deletions packages/yoroi-extension/app/UI/common/hooks/useBannersQueue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,13 @@ import LocalStorageApi from '../../../api/localStorage';
import { BannerType, DREP_BANNER_MIN_ADA } from '../constants';
import { useLocation } from 'react-router';

export function useBannerQueue({ bannersRemoteConfig, walletBalance, walletId, currentlyDelegating, governanceStatus }) {
export function useBannerQueue({ bannersRemoteConfig, walletBalance, walletId }) {
const localStorage = new LocalStorageApi();
const [visible, setVisible] = useState<BannerType | null>(null);
const [evaluationKey, setEvaluationKey] = useState(0);
const location = useLocation();

const resolveBanner = useCallback(async () => {
if (
governanceStatus.status === 'none' &&
!currentlyDelegating &&
walletBalance > 5 &&
bannersRemoteConfig?.earnRewardsWithYoroi?.display === true
) {
return BannerType.Rewards;
}
if (
(await localStorage.getMidnightBannerPhase2Closed()) === undefined &&
bannersRemoteConfig?.midnightPhase2Announcement.display === true
Expand All @@ -32,26 +24,14 @@ export function useBannerQueue({ bannersRemoteConfig, walletBalance, walletId, c
}

return null;
}, [bannersRemoteConfig, governanceStatus.status, walletBalance, currentlyDelegating, location.search]);
}, [bannersRemoteConfig, walletBalance, location.search]);

useEffect(() => {
resolveBanner().then(setVisible);
}, [
bannersRemoteConfig,
walletId,
walletBalance,
evaluationKey,
resolveBanner,
currentlyDelegating,
location.search,
governanceStatus.status,
]);
}, [bannersRemoteConfig, walletId, walletBalance, evaluationKey, resolveBanner, location.search]);

const dismiss = async type => {
switch (type) {
case BannerType.Rewards:
setVisible(null);
break;
case BannerType.MidnightPhase2:
setVisible(null);
await localStorage.setMidnightBannerPhase2Closed('true');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,21 @@ import { BannerType } from '../../common/constants';
import { BringBanner } from './BringBanner';
import { UsdaBanner } from './UsdaBanner';
import { MidnightPhase2Banner } from './MidnightPhase2Banner';
import { RewardsBanner } from './RewardsBanner';
import { observer } from 'mobx-react';

import { useGovernanceStatusState } from '../../features/governace/common/hooks/useGovernanceStatusState';

export const BannerVisibilityManager = observer(({ stores, intl }) => {
const selectedWallet = stores.wallets.selectedOrFail;
const currentlyDelegating = stores.delegation.isCurrentlyDelegating(selectedWallet.publicDeriverId);
const { governanceStatus } = useGovernanceStatusState();

const { data } = useYoroiRemoteConfig();
const { visible, dismiss } = useBannerQueue({
walletBalance: Number(
selectedWallet.balance.getDefaultEntry().amount.shiftedBy(-primaryTokenInfoMainnet.decimals).toString()
),
bannersRemoteConfig: data?.banners,
currentlyDelegating,
walletId: selectedWallet.publicDeriverId,
governanceStatus,
});

return (
<>
{visible === BannerType.Rewards && <RewardsBanner stores={stores} onClose={() => dismiss(BannerType.Rewards)} />}
{visible === BannerType.MidnightPhase2 && <MidnightPhase2Banner onClose={() => dismiss(BannerType.MidnightPhase2)} />}
{visible === BannerType.DRep && (
<DrepPromotionBanner onClose={() => dismiss(BannerType.DRep)} stores={stores} intl={intl} />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import { Button, Stack, Typography, styled, useTheme } from '@mui/material';
import BigNumber from 'bignumber.js';
import { observer } from 'mobx-react';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { dRepNormalize } from '../../../api/ada/lib/cardanoCrypto/utils';
import LocalStorageApi from '../../../api/localStorage/index';
import globalMessages from '../../../i18n/global-messages';
import { ROUTES } from '../../../routes-config';
import { YOROI_DREP_ID } from '../../features/governace/common/constants';
import { IconWrapper, Icons } from '../icons';
import { Ilustration } from './Ilustration';

Expand Down Expand Up @@ -71,17 +69,14 @@ export const DrepPromotionBanner = observer(({ stores, onClose, intl }) => {

const [governanceInfo, setGovernanceInfo] = useState({
isParticipatingToGovernance: false,
isDelegatingToYoroiDrep: false,
});

useEffect(() => {
const getGovStatus = () => {
const govInfo = stores.delegation.governanceStatus?.drepDelegation;
if (govInfo) {
const isParticipatingToGovernance = govInfo !== null;
const drepEncoded = dRepNormalize(govInfo?.drep, govInfo?.drepKind);
const isDelegatingToYoroiDrep = isParticipatingToGovernance && drepEncoded === YOROI_DREP_ID;
setGovernanceInfo({ isParticipatingToGovernance, isDelegatingToYoroiDrep });
setGovernanceInfo({ isParticipatingToGovernance });
}
};

Expand Down Expand Up @@ -126,10 +121,7 @@ export const DrepPromotionBanner = observer(({ stores, onClose, intl }) => {
},
}}
onClick={() => {
stores.routing.goToRoute({
route: ROUTES.GOVERNANCE.ROOT,
query: { delegateToYoroiDrep: true },
});
stores.routing.goToRoute({ route: ROUTES.GOVERNANCE.ROOT });
}}
>
{intl.formatMessage(globalMessages.delegateVote)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const StatusSkeletonScreen = () => {
export const OptionsSkeletonScreen = () => {
return (
<CardsRow>
{[...Array(4)].map((_, idx) => (
{[...Array(3)].map((_, idx) => (
<Stack
width={294}
height={320}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,12 @@ import {

export const LEARN_MORE_LINK =
'https://help.yoroi-wallet.com/en/article/how-can-i-participate-in-governance-through-yoroi-155o8l3/ ';
export const YOROI_VOTING_RECORD_LINK =
'https://2025budget.intersectmbo.org/voters/drep1ygr9tuapcanc3kpeyy4dc3vmrz9cfe5q7v9wj3x9j0ap3tswtre9j';
export const FIND_DREPS_LINK = 'https://beta.cexplorer.io/drep?tab=list';
export const FIND_DREPS_LINK_TESTNET = 'https://preprod.cexplorer.io/drep';
export const YOROI_DREP_ID = 'drep1ygr9tuapcanc3kpeyy4dc3vmrz9cfe5q7v9wj3x9j0ap3tswtre9j';
export const YOROI_DREP_ID_TESTNET = 'drep1y23nc498g205wtvp9esysyxam0n7msusm5d734xqlzhvkgq3pn5r7';
export const EMURGO_DREP_ID = 'drep1ytvlwvyjmzfyn56n0zz4f6lj94wxhmsl5zky6knnzrf4jygpyahug';

export const DREP_ALWAYS_ABSTAIN = API_ABSTAIN;
export const DREP_ALWAYS_NO_CONFIDENCE = API_NO_CONFIDENCE;

export const drepNames = {
[YOROI_DREP_ID]: 'Yoroi W₳llet',
[EMURGO_DREP_ID]: 'EMURGO',
[YOROI_DREP_ID_TESTNET]: 'Testnet DRep',
};

export const GOVERNANCE_STATUS = {
IDLE: 'idle',
HOVER: 'hover',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';
import { NotEnoughMoneyToSendError } from '../../../../../api/common/errors';
import { dRepToMaybeCredentialHex } from '../../../../../api/ada/lib/cardanoCrypto/utils';
import { TransactionResult } from '../../../transaction-review/common/types';
import { useGovernance } from '../../module/GovernanceContextProvider';
import { useTxReviewModal } from '../../../transaction-review/module/ReviewTxProvider';
Expand All @@ -13,20 +12,17 @@ type UseGovernanceDelegationResult = {
error: string | null;
setError: (value: string | null) => void;

// 1) direct delegation to a specific DRep (Yoroi or any other)
delegateToDrep: (drepID: string) => Promise<void>;

// 2) open modal to choose DRep id & delegate
// 1) open modal to choose DRep id & delegate
openDelegateModalForCustomDrep: () => void;

// 3) always abstain
// 2) always abstain
delegateToAbstain: () => Promise<void>;

// 4) always no-confidence
// 3) always no-confidence
delegateToNoConfidence: () => Promise<void>;
};

export const useGovernanceDelegationToYoroiDrep = (): UseGovernanceDelegationResult => {
export const useGovernanceDelegation = (): UseGovernanceDelegationResult => {
const [error, setError] = React.useState<string | null>(null);
const [loadingUnsignTx, setLoadingUnsignTx] = React.useState<boolean>(false);

Expand All @@ -41,7 +37,6 @@ export const useGovernanceDelegationToYoroiDrep = (): UseGovernanceDelegationRes
stopLoadingTxReview,
changePasswordInputValue,
showTxResultModal,
setDrepId,
setUnsignedTx,
drepCredentialHex,
} = useTxReviewModal();
Expand Down Expand Up @@ -105,20 +100,7 @@ export const useGovernanceDelegationToYoroiDrep = (): UseGovernanceDelegationRes
[createDrepDelegationTransaction, openTxReviewModal, signGovernanceTx, strings]
);

/** 1) Delegate to a specific DRep (Yoroi or any other) */
const delegateToDrep = React.useCallback(
async (drepID: string) => {
const vote: Vote = { kind: 'delegate', drepID };
const dRepCredentialHex: string | null = dRepToMaybeCredentialHex(drepID);

governanceVoteChanged(vote);
setDrepId({ drepID });
await createUnsignTx(dRepCredentialHex);
},
[governanceVoteChanged, setDrepId, createUnsignTx]
);

/** 2) Open modal to choose a custom DRep */
/** 1) Open modal to choose a custom DRep */
const openDelegateModalForCustomDrep = React.useCallback(() => {
if (!governanceManager) {
return;
Expand Down Expand Up @@ -161,7 +143,7 @@ export const useGovernanceDelegationToYoroiDrep = (): UseGovernanceDelegationRes
signGovernanceTx,
]);

/** 3) Always abstain */
/** 2) Always abstain */
const delegateToAbstain = React.useCallback(async () => {
const vote: Vote = { kind: DREP_ALWAYS_ABSTAIN };

Expand All @@ -170,7 +152,7 @@ export const useGovernanceDelegationToYoroiDrep = (): UseGovernanceDelegationRes
await createUnsignTx(DREP_ALWAYS_ABSTAIN);
}, [governanceVoteChanged, createUnsignTx]);

/** 4) Always no-confidence */
/** 3) Always no-confidence */
const delegateToNoConfidence = React.useCallback(async () => {
const vote: Vote = { kind: DREP_ALWAYS_NO_CONFIDENCE };

Expand All @@ -182,7 +164,6 @@ export const useGovernanceDelegationToYoroiDrep = (): UseGovernanceDelegationRes
loadingUnsignTx,
error,
setError,
delegateToDrep,
openDelegateModalForCustomDrep,
delegateToAbstain,
delegateToNoConfidence,
Expand Down
Loading
Loading