From a1dcb5e8746c1ca427b5008dba40836fbcd00ea9 Mon Sep 17 00:00:00 2001 From: Javier Bueno Date: Wed, 16 Oct 2024 12:30:24 +0200 Subject: [PATCH] feature(wallet-mobile): new tx review for yoroi governance --- .../src/features/Staking/Governance/common/helpers.tsx | 7 ++++++- apps/wallet-mobile/src/yoroi-wallets/cardano/types.ts | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/wallet-mobile/src/features/Staking/Governance/common/helpers.tsx b/apps/wallet-mobile/src/features/Staking/Governance/common/helpers.tsx index 397187d1b2..8e02078802 100644 --- a/apps/wallet-mobile/src/features/Staking/Governance/common/helpers.tsx +++ b/apps/wallet-mobile/src/features/Staking/Governance/common/helpers.tsx @@ -19,6 +19,8 @@ import {useWalletNavigation} from '../../../../kernel/navigation' import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' import {useStakingKey} from '../../../../yoroi-wallets/hooks' import {YoroiUnsignedTx} from '../../../../yoroi-wallets/types/yoroi' +import {formatTokenWithText} from '../../../../yoroi-wallets/utils/format' +import {asQuantity} from '../../../../yoroi-wallets/utils/utils' import {CardanoMobile} from '../../../../yoroi-wallets/wallets' import {useReviewTx} from '../../../ReviewTx/common/ReviewTxProvider' import {useBestBlock} from '../../../WalletManager/common/hooks/useBestBlock' @@ -169,6 +171,7 @@ export const useGovernanceActions = () => { const RegisterStakingKeyOperation = () => { const {styles} = useStyles() const strings = useStrings() + const {wallet} = useSelectedWallet() return ( @@ -176,7 +179,9 @@ const RegisterStakingKeyOperation = () => { - 2 ADA + + {formatTokenWithText(asQuantity(wallet.protocolParams.keyDeposit), wallet.portfolioPrimaryTokenInfo)} + ) } diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/types.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/types.ts index d80576eb94..172059076c 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/types.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/types.ts @@ -10,7 +10,7 @@ import { TxMetadata as TxMetadataType, UnsignedTx as UnsignedTxType, } from '@emurgo/yoroi-lib' -import {App, HW, Network, Portfolio, Wallet} from '@yoroi/types' +import {Api, App, HW, Network, Portfolio, Wallet} from '@yoroi/types' import {BigNumber} from 'bignumber.js' import {WalletEncryptedStorage} from '../../kernel/storage/EncryptedStorage' @@ -58,6 +58,7 @@ export type Pagination = { export interface YoroiWallet { id: string publicKeyHex: string + protocolParams: Api.Cardano.ProtocolParams readonly portfolioPrimaryTokenInfo: Readonly // ---------------------------------------------------------------------------------------