Skip to content

Commit

Permalink
feature(wallet-mobile): new tx review for yoroi governance
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss committed Oct 16, 2024
1 parent 8cf9b05 commit a1dcb5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -169,14 +171,17 @@ export const useGovernanceActions = () => {
const RegisterStakingKeyOperation = () => {
const {styles} = useStyles()
const strings = useStrings()
const {wallet} = useSelectedWallet()

return (
<View style={styles.operation}>
<Text style={styles.operationLabel}>{strings.registerStakingKey}</Text>

<Space width="lg" />

<Text style={styles.operationValue}>2 ADA</Text>
<Text style={styles.operationValue}>
{formatTokenWithText(asQuantity(wallet.protocolParams.keyDeposit), wallet.portfolioPrimaryTokenInfo)}
</Text>
</View>
)
}
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet-mobile/src/yoroi-wallets/cardano/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -58,6 +58,7 @@ export type Pagination = {
export interface YoroiWallet {
id: string
publicKeyHex: string
protocolParams: Api.Cardano.ProtocolParams
readonly portfolioPrimaryTokenInfo: Readonly<Portfolio.Token.Info>

// ---------------------------------------------------------------------------------------
Expand Down

0 comments on commit a1dcb5e

Please sign in to comment.