Yv 756 withdraw rewards governance popup (#4383)
Co-authored-by: jorbuedo <[email protected]>
Co-authored-by: jorbuedo <[email protected]>
- Only add VoteDelegation certificate when not deregistering - Fix calculateRequiredAda to not subtract deregistration refund (refunds are in outputs, not inputs) - Ensures transaction validity and proper UTXO selection
- Replace direct import of GOVERNANCE_YOROI_DREP_ID_HEX with getYoroiDrepIdHex function for network-aware DRep ID selection. - Ensure DashboardScreen uses the appropriate DRep ID based on the wallet's network.
Add comprehensive migration plan for creating new browser extension in monorepo with shared packages extracted from mobile app. Plan includes: - Monorepo setup and package extraction strategy - Extension project initialization with Vite/React Query 5 - Feature migration approach (incremental porting) - Challenges and solutions for platform differences - Testing and documentation strategy
Added QRsIllustration component to the scan QR code option in the restore wallet screen, matching the visual style of the other mnemonic type options. Set size to 128x120 to match other illustrations.
- Add GOVERNANCE_YOROI_DREP_ID_HEX_PREPROD constant with preprod DRep ID - Create getYoroiDrepIdHex() helper function to return network-appropriate DRep ID - Update all components to use network-aware DRep ID selection: - YoroiDrepCard now shows correct DRep ID based on wallet network - useEarnRewardsDelegation uses network-aware DRep ID - StakingCenter uses network-aware DRep ID for combined delegations - useGovernanceVoteFlow uses network-aware DRep ID for comparisons - ChangeVoteScreen uses network-aware DRep ID - All helper functions updated to use network-aware DRep ID - Maintain backward compatibility with legacy GOVERNANCE_YOROI_DREP_ID_HEX export - Add tests for new constants and helper function
- Add getTxIdFromArgs utility function to safely extract txId from callback args - Prioritizes args?.txId (already calculated), falls back to unsigned CBOR (safe), then signedTx (with null checks) - Replace manual txId calculations in onSuccess callbacks with utility function: - useDappConnectorManager.tsx: collateral reorganization transactions - ManageCollateralScreen.tsx: collateral creation transactions - helpers.tsx: governance action tracking (delegate, vote) - Prevents CSL null pointer errors by using safe fallback hierarchy - Ensures consistent behavior across all transaction flows
- Add comprehensive error logging in useOnConfirm and useSubmitTx for transaction failures - Fix CSL Optional handling in signatureUtils for collateral (use Optional directly instead of calling .value()) - Fix collateral transaction hash calculation to use txId from args when available - Add null checks before calling toBytes() on Transaction objects - Improve error messages to extract Cardano-specific errors from nested structures
- Fix ResultScreen params extraction to handle nested route.params structure - Unify error and success screen layouts for consistent styling - Remove debug logging from transaction submission flow - Add proper error handling for governance action updates
- Fix ResultScreen params extraction to handle nested route.params structure - Unify error and success screen layouts for consistent styling - Remove debug logging from transaction submission flow - Add proper error handling for governance action updates
- Fix navigation error when restoring wallet via QR code on fresh install (no wallets) - Check hasWallets before navigating through manage-wallets - Use reset() instead of navigate() for proper nested navigation typing - Prevent password manager prompts during wallet restoration - Use textContentType='none' and autoComplete='off' for password fields - Apply to both restore-from-link and regular mnemonic restore flows
- Fix suggestion box positioning above keyboard on real devices in mnemonic input - Add scan QR code option to ChooseMnemonicTypeScreen for restoring from QR codes - Improve navigation for restore-from-link to use reset() instead of navigate() to prevent blocking - Add scan QR code translations for all supported locales - Remove any type usage in useActionExecutor navigation code
- Introduced a new function to create a combined transaction for rewards withdrawal and DRep delegation. - Updated DashboardScreen to utilize the new transaction creation method, enhancing user experience by allowing simultaneous operations. - Refactored related logic to manage loading states and error handling more effectively. - Removed unused delegation certificate logic to streamline the code. Files updated: - DashboardScreen.tsx: Integrated new transaction method and improved state management. - index.ts: Exported the new transaction creation function. - wallet-helpers.ts: Implemented the logic for creating the combined transaction.
- Add Midnight Glacier Drop airdrop redemption feature - Add Airdrop menu item and screen for NIGHT token redemption - Implement redemption API integration with thaw schedule checking - Add eligibility check and banner notification in transaction history - Support gradual token unlocking (thawing) with four 25% installments - Add address allocation display with thaw schedule and redemption status - Implement transaction building and signing for token redemption - Refactor airdrop feature to use @yoroi/tx instead of deprecated yoroi-lib - Update UTXO selection to use ModernUtxo and selectUtxos patterns - Discard wallet-manager.ts changes (kept mobile-experimental version)
- Fix UTXO selection in all transaction recipes to account for minimum UTXO value required for change outputs - Add keyDeposit calculation when StakeRegistration certificate is present in governance transactions - Ensure sufficient ADA is selected to cover fees, deposits (if applicable), minimum UTXO for change, and buffer - Fixes 'Insufficient input in transaction' errors when wallet has enough funds but not in first UTXO Files updated: - createUnsignedGovernanceTx.ts: Added keyDeposit check for StakeRegistration certificates - createDelegationTx.ts: Added min UTXO for change calculation - createWithdrawalTx.ts: Added min UTXO for change calculation - createCombinedDelegationTx.ts: Added min UTXO for change calculation - createVotingRegTx.ts: Added min UTXO for change calculation - helpers.ts (selectUtxosForAmounts): Added min UTXO for change calculation - HomeScreen.tsx & ChangeVoteScreen.tsx: Modal lifecycle fixes (from previous work)