diff --git a/apps/wallet-mobile/package.json b/apps/wallet-mobile/package.json index 607457be33..f4ede3773e 100644 --- a/apps/wallet-mobile/package.json +++ b/apps/wallet-mobile/package.json @@ -101,7 +101,7 @@ "@emurgo/csl-mobile-bridge": "^7.1.0", "@emurgo/msl-mobile-bridge": "^1.0.4", "@emurgo/react-native-hid": "5.15.8", - "@emurgo/yoroi-lib": "^2.0.0", + "@emurgo/yoroi-lib": "2.2.1", "@formatjs/intl-datetimeformat": "^6.7.0", "@formatjs/intl-getcanonicallocales": "^2.1.0", "@formatjs/intl-locale": "^3.2.1", diff --git a/apps/wallet-mobile/src/features/ReviewTx/common/ExplorerInfoLinks.tsx b/apps/wallet-mobile/src/features/ReviewTx/common/ExplorerInfoLinks.tsx new file mode 100644 index 0000000000..d626c9350a --- /dev/null +++ b/apps/wallet-mobile/src/features/ReviewTx/common/ExplorerInfoLinks.tsx @@ -0,0 +1,71 @@ +import {useTheme} from '@yoroi/theme' +import {Explorers} from '@yoroi/types' +import * as React from 'react' +import {Linking, StyleSheet, Text, TouchableOpacity, View} from 'react-native' + +import {Space} from '../../../components/Space/Space' +import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet' +import {useStrings} from './hooks/useStrings' + +export const ExplorerInfoLinks = ({id, type}: {id: string; type: 'token' | 'pool'}) => { + const {styles} = useStyles() + const {wallet} = useSelectedWallet() + const strings = useStrings() + + const handleOpenLink = async (explorer: Explorers.Explorer) => { + if (id == null) return + if (explorer === Explorers.Explorer.CardanoScan) { + await Linking.openURL(wallet.networkManager.explorers.cardanoscan[type](id)) + } else { + await Linking.openURL(wallet.networkManager.explorers.cexplorer[type](id)) + } + } + + return ( + + + + {strings.details} + + + handleOpenLink(Explorers.Explorer.CardanoScan)}> + {explorerNames[Explorers.Explorer.CardanoScan]} + + + handleOpenLink(Explorers.Explorer.CExplorer)}> + {explorerNames[Explorers.Explorer.CExplorer]} + + + + ) +} + +const explorerNames = { + [Explorers.Explorer.CardanoScan]: 'Cardanoscan', + [Explorers.Explorer.CExplorer]: 'Adaex', +} + +const useStyles = () => { + const {atoms, color} = useTheme() + + const styles = StyleSheet.create({ + label: { + ...atoms.body_2_md_regular, + color: color.text_gray_low, + }, + link: { + ...atoms.link_1_lg_underline, + color: color.text_primary_medium, + }, + linkGroup: { + ...atoms.flex_row, + ...atoms.gap_lg, + }, + }) + + const colors = { + copy: color.gray_900, + } + + return {styles, colors} as const +} diff --git a/apps/wallet-mobile/src/features/ReviewTx/common/PoolDetails.tsx b/apps/wallet-mobile/src/features/ReviewTx/common/PoolDetails.tsx new file mode 100644 index 0000000000..b0cf143b2d --- /dev/null +++ b/apps/wallet-mobile/src/features/ReviewTx/common/PoolDetails.tsx @@ -0,0 +1,215 @@ +import {FullPoolInfo} from '@emurgo/yoroi-lib' +import {useTheme} from '@yoroi/theme' +import {Image} from 'expo-image' +import * as React from 'react' +import {StyleSheet, Text, View} from 'react-native' +import {ScrollView} from 'react-native-gesture-handler' + +import {Space} from '../../../components/Space/Space' +import {isEmptyString} from '../../../kernel/utils' +import {formatTokenWithText} from '../../../yoroi-wallets/utils/format' +import {asQuantity, Quantities} from '../../../yoroi-wallets/utils/utils' +import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet' +import {CopiableText} from './CopiableText' +import {ExplorerInfoLinks} from './ExplorerInfoLinks' +import {useStrings} from './hooks/useStrings' +import {generatePoolName} from './operations' + +export const PoolDetails = ({poolInfo}: {poolInfo: FullPoolInfo}) => { + const {styles} = useStyles() + const strings = useStrings() + const {wallet} = useSelectedWallet() + + const {chain, explorer} = poolInfo + + const lastChainPoolInfo = chain?.history.at(-1) ?? null + const poolName = generatePoolName(poolInfo) + + return ( + + + + + + + {poolName} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {poolInfo.explorer && !isEmptyString(poolInfo.explorer.id) && ( + + )} + + ) +} + +const PoolIcon = ({imageUrl}: {imageUrl: string | null | undefined}) => { + const {styles} = useStyles() + + if (imageUrl == null) return null + + return ( + + + + ) +} + +const PoolId = ({poolId}: {poolId: string | undefined}) => { + const {styles} = useStyles() + const strings = useStrings() + + if (isEmptyString(poolId)) return null + + return ( + + {strings.poolId} + + + + + + {poolId} + + + + ) +} +const PoolHash = ({poolHash}: {poolHash?: string}) => { + const {styles} = useStyles() + const strings = useStrings() + + if (isEmptyString(poolHash)) return null + + return ( + + {strings.poolHash} + + + + + + {poolHash} + + + + ) +} + +const Info = ({label, value}: {label: string; value?: string}) => { + const {styles} = useStyles() + + if (isEmptyString(value)) return null + + return ( + + {label} + + {value} + + ) +} + +const Row = ({children}: {children: React.ReactNode}) => { + const {styles} = useStyles() + return {children} +} + +const useStyles = () => { + const {atoms, color} = useTheme() + + const styles = StyleSheet.create({ + root: { + ...atoms.flex_1, + ...atoms.px_lg, + }, + imageContainer: { + ...atoms.justify_center, + ...atoms.align_center, + }, + image: { + width: 80, + height: 80, + }, + label: { + ...atoms.body_2_md_regular, + color: color.text_gray_low, + }, + value: { + ...atoms.flex_1, + ...atoms.text_right, + ...atoms.body_2_md_regular, + color: color.text_gray_max, + }, + copiableText: { + ...atoms.flex_1, + ...atoms.align_center, + }, + row: { + ...atoms.flex_row, + ...atoms.justify_center, + }, + title: { + color: color.text_gray_medium, + ...atoms.body_1_lg_medium, + }, + }) + + const colors = { + copy: color.gray_900, + } + + return {styles, colors} as const +} diff --git a/apps/wallet-mobile/src/features/ReviewTx/common/TokenDetails.tsx b/apps/wallet-mobile/src/features/ReviewTx/common/TokenDetails.tsx index e96569c482..fa86831745 100644 --- a/apps/wallet-mobile/src/features/ReviewTx/common/TokenDetails.tsx +++ b/apps/wallet-mobile/src/features/ReviewTx/common/TokenDetails.tsx @@ -2,7 +2,7 @@ import {usePortfolioTokenDiscovery} from '@yoroi/portfolio' import {useTheme} from '@yoroi/theme' import {Portfolio} from '@yoroi/types' import * as React from 'react' -import {Linking, ScrollView, StyleSheet, Text, TouchableOpacity, View} from 'react-native' +import {ScrollView, StyleSheet, Text, TouchableOpacity, View} from 'react-native' import {useCopy} from '../../../components/Clipboard/ClipboardProvider' import {Icon} from '../../../components/Icon' @@ -13,11 +13,14 @@ import {time} from '../../../kernel/constants' import {isEmptyString} from '../../../kernel/utils' import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet' import {CopiableText} from './CopiableText' +import {ExplorerInfoLinks} from './ExplorerInfoLinks' import {useStrings} from './hooks/useStrings' -export const TokenDetails = ({tokenInfo}: {tokenInfo: Portfolio.Token.Info}) => { +export const TokenDetails = ({tokenInfo}: {tokenInfo: Portfolio.Token.Info | undefined}) => { const {styles} = useStyles() + if (tokenInfo == null) return null + return (
@@ -31,7 +34,7 @@ export const TokenDetails = ({tokenInfo}: {tokenInfo: Portfolio.Token.Info}) => const Header = ({info}: {info: Portfolio.Token.Info}) => { const {styles} = useStyles() - const [policyId, assetName] = info.id.split('.') + const [policyId, assetName] = info?.id.split('.') ?? ['', ''] const title = !isEmptyString(info.ticker) ? info.ticker : !isEmptyString(info.name) ? info.name : '' @@ -146,7 +149,7 @@ const Overview = ({ - + ) } @@ -156,7 +159,7 @@ const Overview = ({ - + ) } @@ -273,39 +276,6 @@ const Description = ({info}: {info: Portfolio.Token.Info}) => { ) } -const Links = ({info}: {info: Portfolio.Token.Info}) => { - const {styles} = useStyles() - const {wallet} = useSelectedWallet() - const strings = useStrings() - - const handleOpenLink = async (direction: 'cardanoscan' | 'adaex') => { - if (info == null) return - if (direction === 'cardanoscan') { - await Linking.openURL(wallet.networkManager.explorers.cardanoscan.token(info.id)) - } else { - await Linking.openURL(wallet.networkManager.explorers.cexplorer.token(info.id)) - } - } - - return ( - - - - {strings.details} - - - handleOpenLink('cardanoscan')}> - Cardanoscan - - - handleOpenLink('adaex')}> - Adaex - - - - ) -} - const Row = ({children}: {children: React.ReactNode}) => { const {styles} = useStyles() return {children} @@ -349,14 +319,6 @@ const useStyles = () => { tabs: { ...atoms.flex_row, }, - link: { - ...atoms.link_1_lg_underline, - color: color.text_primary_medium, - }, - linkGroup: { - ...atoms.flex_row, - ...atoms.gap_lg, - }, copiableText: { ...atoms.flex_1, ...atoms.align_center, diff --git a/apps/wallet-mobile/src/features/ReviewTx/common/hooks/useFormattedTx.tsx b/apps/wallet-mobile/src/features/ReviewTx/common/hooks/useFormattedTx.tsx index 133c96b4e6..e721dd853a 100644 --- a/apps/wallet-mobile/src/features/ReviewTx/common/hooks/useFormattedTx.tsx +++ b/apps/wallet-mobile/src/features/ReviewTx/common/hooks/useFormattedTx.tsx @@ -225,7 +225,7 @@ const formatCertificates = (certificates: TransactionBody['certs']) => { return ( certificates?.map((cert) => { const [type, certificate] = Object.entries(cert)[0] - return {type, certificate} as unknown as FormattedCertificate + return {type, value: certificate} as unknown as FormattedCertificate }) ?? null ) } diff --git a/apps/wallet-mobile/src/features/ReviewTx/common/hooks/useStrings.tsx b/apps/wallet-mobile/src/features/ReviewTx/common/hooks/useStrings.tsx index 81fa9da683..70a38569af 100644 --- a/apps/wallet-mobile/src/features/ReviewTx/common/hooks/useStrings.tsx +++ b/apps/wallet-mobile/src/features/ReviewTx/common/hooks/useStrings.tsx @@ -28,6 +28,15 @@ export const useStrings = () => { json: intl.formatMessage(messages.json), metadata: intl.formatMessage(messages.metadata), policyId: intl.formatMessage(messages.policyId), + poolId: intl.formatMessage(messages.poolId), + poolHash: intl.formatMessage(messages.poolHash), + poolSize: intl.formatMessage(messages.poolSize), + poolTaxFix: intl.formatMessage(messages.poolTaxFix), + poolTaxRatio: intl.formatMessage(messages.poolTaxRatio), + poolPledge: intl.formatMessage(messages.poolPledge), + poolRoa: intl.formatMessage(messages.poolRoa), + poolShare: intl.formatMessage(messages.poolShare), + poolSaturation: intl.formatMessage(messages.poolSaturation), fingerprint: intl.formatMessage(messages.fingerprint), name: intl.formatMessage(messages.name), tokenSupply: intl.formatMessage(messages.tokenSupply), @@ -35,6 +44,7 @@ export const useStrings = () => { description: intl.formatMessage(messages.description), details: intl.formatMessage(messages.details), tokenDetailsTitle: intl.formatMessage(messages.tokenDetailsTitle), + poolDetailsTitle: intl.formatMessage(messages.poolDetailsTitle), registerStakingKey: intl.formatMessage(messages.registerStakingKey), selectAbstain: intl.formatMessage(messages.selectAbstain), selectNoConfidence: intl.formatMessage(messages.selectNoConfidence), @@ -137,6 +147,42 @@ const messages = defineMessages({ id: 'txReview.tokenDetails.policyId.label', defaultMessage: '!!!Policy ID', }, + poolId: { + id: 'txReview.poolDetails.poolId.label', + defaultMessage: '!!!Pool ID', + }, + poolHash: { + id: 'txReview.poolDetails.poolHash.label', + defaultMessage: '!!!Hash', + }, + poolSize: { + id: 'txReview.poolDetails.poolSize.label', + defaultMessage: '!!!Pool size', + }, + poolRoa: { + id: 'txReview.poolDetails.poolRoa.label', + defaultMessage: '!!!ROA 30d', + }, + poolShare: { + id: 'txReview.poolDetails.poolShare.label', + defaultMessage: '!!!Share', + }, + poolSaturation: { + id: 'txReview.poolDetails.poolSaturation.label', + defaultMessage: '!!!Saturation', + }, + poolTaxFix: { + id: 'txReview.poolDetails.taxFix.label', + defaultMessage: '!!!Tax fix', + }, + poolTaxRatio: { + id: 'txReview.poolDetails.taxRatio.label', + defaultMessage: '!!!Tax ratio', + }, + poolPledge: { + id: 'txReview.poolDetails.pledge.label', + defaultMessage: '!!!Pledge', + }, fingerprint: { id: 'txReview.tokenDetails.fingerprint.label', defaultMessage: '!!!Fingerprint', @@ -165,6 +211,10 @@ const messages = defineMessages({ id: 'txReview.tokenDetails.title', defaultMessage: '!!!Asset Details', }, + poolDetailsTitle: { + id: 'txReview.poolDetails.title', + defaultMessage: '!!!Pool Details', + }, registerStakingKey: { id: 'txReview.operations.registerStakingKey', defaultMessage: '!!!Register staking key deposit', diff --git a/apps/wallet-mobile/src/features/ReviewTx/common/operations.tsx b/apps/wallet-mobile/src/features/ReviewTx/common/operations.tsx index 3c37ed4762..86894c0e07 100644 --- a/apps/wallet-mobile/src/features/ReviewTx/common/operations.tsx +++ b/apps/wallet-mobile/src/features/ReviewTx/common/operations.tsx @@ -1,17 +1,19 @@ +import {FullPoolInfo} from '@emurgo/yoroi-lib' import {useTheme} from '@yoroi/theme' import * as React from 'react' -import {Linking, StyleSheet, Text, View} from 'react-native' +import {StyleSheet, Text, useWindowDimensions, View} from 'react-native' import {TouchableOpacity} from 'react-native-gesture-handler' import {useQuery} from 'react-query' +import {useModal} from '../../../components/Modal/ModalContext' import {Space} from '../../../components/Space/Space' import {wrappedCsl} from '../../../yoroi-wallets/cardano/wrappedCsl' import {usePoolInfo} from '../../../yoroi-wallets/hooks' import {formatTokenWithText} from '../../../yoroi-wallets/utils/format' import {asQuantity} from '../../../yoroi-wallets/utils/utils' -import {useSelectedNetwork} from '../../WalletManager/common/hooks/useSelectedNetwork' import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet' import {useStrings} from './hooks/useStrings' +import {PoolDetails} from './PoolDetails' import {CertificateType, FormattedTx} from './types' export const StakeRegistrationOperation = () => { @@ -60,9 +62,14 @@ export const StakeDelegateOperation = ({poolId}: {poolId: string}) => { const {styles} = useStyles() const strings = useStrings() const poolInfo = usePoolInfo({poolId}) - const {networkManager} = useSelectedNetwork() + const {openModal} = useModal() + const {height: windowHeight} = useWindowDimensions() - const poolInfoText = poolInfo != null ? `[${poolInfo.ticker}] ${poolInfo.name}` : poolId + const handleShowPoolDetails = () => { + openModal(strings.poolDetailsTitle, , windowHeight * 0.8) + } + + const poolName = generatePoolName(poolInfo) ?? poolId return ( @@ -70,16 +77,17 @@ export const StakeDelegateOperation = ({poolId}: {poolId: string}) => { - Linking.openURL(networkManager.explorers.cardanoscan.pool(poolId))} - > - {poolInfoText} + + {poolName} ) } +export const generatePoolName = (poolInfo: FullPoolInfo) => { + return poolInfo.explorer != null ? `[${poolInfo.explorer.ticker}] ${poolInfo.explorer.name}` : null +} + export const AbstainOperation = () => { const {styles} = useStyles() const strings = useStrings() diff --git a/apps/wallet-mobile/src/kernel/i18n/locales/en-US.json b/apps/wallet-mobile/src/kernel/i18n/locales/en-US.json index 36da6d3b81..4c60068fb9 100644 --- a/apps/wallet-mobile/src/kernel/i18n/locales/en-US.json +++ b/apps/wallet-mobile/src/kernel/i18n/locales/en-US.json @@ -1240,6 +1240,15 @@ "txReview.tokenDetails.jsonTab.title": "JSON", "txReview.tokenDetails.jsonTab.metadata": "Metadata", "txReview.tokenDetails.policyId.label": "Policy ID", + "txReview.poolDetails.poolId.label": "Pool ID", + "txReview.poolDetails.poolHash.label": "Hash", + "txReview.poolDetails.poolSize.label": "Pool size", + "txReview.poolDetails.poolRoa.label": "ROA 30d", + "txReview.poolDetails.poolShare.label": "Share", + "txReview.poolDetails.poolSaturation.label": "Saturation", + "txReview.poolDetails.taxRatio.label": "Tax ratio", + "txReview.poolDetails.taxFix.label": "Tax fix", + "txReview.poolDetails.pledge.label": "Pledge", "txReview.tokenDetails.fingerprint.label": "Fingerprint", "txReview.tokenDetails.overViewTab.name.label": "Name", "txReview.tokenDetails.overViewTab.tokenSupply.label": "Token supply", @@ -1247,6 +1256,7 @@ "txReview.tokenDetails.overViewTab.description.label": "Description", "txReview.tokenDetails.overViewTab.details.label": "Details on", "txReview.tokenDetails.title": "Asset Details", + "txReview.poolDetails.title": "Pool Details", "txReview.operations.registerStakingKey": "Register staking key deposit", "txReview.operations.deregisterStakingKey": "Deregister staking key", "txReview.operations.rewardsWithdrawal.label": "Staking", diff --git a/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts b/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts index ce610714ec..b4b8859a65 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import {walletChecksum} from '@emurgo/cip4-js' import {Certificate} from '@emurgo/cross-csl-core' -import {PoolInfoApi} from '@emurgo/yoroi-lib' +import {FullPoolInfo, PoolInfoApi} from '@emurgo/yoroi-lib' import AsyncStorage, {AsyncStorageStatic} from '@react-native-async-storage/async-storage' import {mountMMKVStorage, observableStorageMaker, parseBoolean, useMutationWithInvalidations} from '@yoroi/common' import {themeStorageMaker} from '@yoroi/theme' @@ -26,7 +26,6 @@ import {isDev, isNightly} from '../../kernel/env' import {logger} from '../../kernel/logger/logger' import {deriveAddressFromXPub} from '../cardano/account-manager/derive-address-from-xpub' import {getSpendingKey, getStakingKey} from '../cardano/addressInfo/addressInfo' -import {getPoolBech32Id} from '../cardano/delegationUtils' import {WalletEvent, YoroiWallet} from '../cardano/types' import {TRANSACTION_DIRECTION, TRANSACTION_STATUS, TxSubmissionStatus} from '../types/other' import {YoroiSignedTx, YoroiUnsignedTx} from '../types/yoroi' @@ -705,19 +704,18 @@ export const useThemeStorageMaker = () => { return themeStorage } -export const usePoolInfo = ({poolId}: {poolId: string}) => { +export const usePoolInfo = ({poolId}: {poolId: string}): FullPoolInfo => { const {networkManager} = useSelectedNetwork() const poolInfoApi = React.useMemo( () => new PoolInfoApi(networkManager.legacyApiBaseUrl), [networkManager.legacyApiBaseUrl], ) const poolInfo = useQuery({ - queryKey: ['usePoolInfoStakeOperation', poolId], + queryKey: ['usePoolInfo', poolId], queryFn: async () => { - const poolBech32Id = await getPoolBech32Id(poolId) - return poolInfoApi.getSingleExplorerPoolInfo(poolBech32Id) + return poolInfoApi.getSingleFullPoolInfo(poolId) }, }) - return poolInfo?.data ?? null + return poolInfo?.data ?? {chain: null, explorer: null} } diff --git a/apps/wallet-mobile/translations/messages/src/features/ReviewTx/common/hooks/useStrings.json b/apps/wallet-mobile/translations/messages/src/features/ReviewTx/common/hooks/useStrings.json index 023616af6a..155f975c28 100644 --- a/apps/wallet-mobile/translations/messages/src/features/ReviewTx/common/hooks/useStrings.json +++ b/apps/wallet-mobile/translations/messages/src/features/ReviewTx/common/hooks/useStrings.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!Confirm", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 56, + "line": 66, "column": 11, - "index": 2958 + "index": 3528 }, "end": { - "line": 59, + "line": 69, "column": 3, - "index": 3025 + "index": 3595 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!UTxOs", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 60, + "line": 70, "column": 9, - "index": 3036 + "index": 3606 }, "end": { - "line": 63, + "line": 73, "column": 3, - "index": 3099 + "index": 3669 } }, { @@ -34,14 +34,14 @@ "defaultMessage": "!!!UTxOs", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 64, + "line": 74, "column": 12, - "index": 3113 + "index": 3683 }, "end": { - "line": 67, + "line": 77, "column": 3, - "index": 3185 + "index": 3755 } }, { @@ -49,14 +49,14 @@ "defaultMessage": "!!!Overview", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 68, + "line": 78, "column": 15, - "index": 3202 + "index": 3772 }, "end": { - "line": 71, + "line": 81, "column": 3, - "index": 3280 + "index": 3850 } }, { @@ -64,14 +64,14 @@ "defaultMessage": "!!!Metadata", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 72, + "line": 82, "column": 15, - "index": 3297 + "index": 3867 }, "end": { - "line": 75, + "line": 85, "column": 3, - "index": 3378 + "index": 3948 } }, { @@ -79,14 +79,14 @@ "defaultMessage": "!!!Metadata hash", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 76, + "line": 86, "column": 16, - "index": 3396 + "index": 3966 }, "end": { - "line": 79, + "line": 89, "column": 3, - "index": 3483 + "index": 4053 } }, { @@ -94,14 +94,14 @@ "defaultMessage": "!!!Metadata", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 80, + "line": 90, "column": 21, - "index": 3506 + "index": 4076 }, "end": { - "line": 83, + "line": 93, "column": 3, - "index": 3593 + "index": 4163 } }, { @@ -109,14 +109,14 @@ "defaultMessage": "!!!Wallet", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 84, + "line": 94, "column": 15, - "index": 3610 + "index": 4180 }, "end": { - "line": 87, + "line": 97, "column": 3, - "index": 3684 + "index": 4254 } }, { @@ -124,14 +124,14 @@ "defaultMessage": "!!!Fee", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 88, + "line": 98, "column": 12, - "index": 3698 + "index": 4268 }, "end": { - "line": 91, + "line": 101, "column": 3, - "index": 3757 + "index": 4327 } }, { @@ -139,14 +139,14 @@ "defaultMessage": "!!!Your Wallet", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 92, + "line": 102, "column": 17, - "index": 3776 + "index": 4346 }, "end": { - "line": 95, + "line": 105, "column": 3, - "index": 3862 + "index": 4432 } }, { @@ -154,14 +154,14 @@ "defaultMessage": "!!!Send", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 96, + "line": 106, "column": 13, - "index": 3877 + "index": 4447 }, "end": { - "line": 99, + "line": 109, "column": 3, - "index": 3952 + "index": 4522 } }, { @@ -169,14 +169,14 @@ "defaultMessage": "!!!To", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 100, + "line": 110, "column": 18, - "index": 3972 + "index": 4542 }, "end": { - "line": 103, + "line": 113, "column": 3, - "index": 4050 + "index": 4620 } }, { @@ -184,14 +184,14 @@ "defaultMessage": "!!!To script", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 104, + "line": 114, "column": 24, - "index": 4076 + "index": 4646 }, "end": { - "line": 107, + "line": 117, "column": 3, - "index": 4167 + "index": 4737 } }, { @@ -199,14 +199,14 @@ "defaultMessage": "!!!Inputs", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 108, + "line": 118, "column": 20, - "index": 4189 + "index": 4759 }, "end": { - "line": 111, + "line": 121, "column": 3, - "index": 4270 + "index": 4840 } }, { @@ -214,14 +214,14 @@ "defaultMessage": "!!!Outputs", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 112, + "line": 122, "column": 21, - "index": 4293 + "index": 4863 }, "end": { - "line": 115, + "line": 125, "column": 3, - "index": 4376 + "index": 4946 } }, { @@ -229,14 +229,14 @@ "defaultMessage": "!!!Your address", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 116, + "line": 126, "column": 25, - "index": 4403 + "index": 4973 }, "end": { - "line": 119, + "line": 129, "column": 3, - "index": 4495 + "index": 5065 } }, { @@ -244,14 +244,14 @@ "defaultMessage": "!!!Foreign address", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 120, + "line": 130, "column": 28, - "index": 4525 + "index": 5095 }, "end": { - "line": 123, + "line": 133, "column": 3, - "index": 4623 + "index": 5193 } }, { @@ -259,14 +259,14 @@ "defaultMessage": "!!!Overview", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 124, + "line": 134, "column": 12, - "index": 4637 + "index": 5207 }, "end": { - "line": 127, + "line": 137, "column": 3, - "index": 4728 + "index": 5298 } }, { @@ -274,14 +274,14 @@ "defaultMessage": "!!!JSON", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 128, + "line": 138, "column": 8, - "index": 4738 + "index": 5308 }, "end": { - "line": 131, + "line": 141, "column": 3, - "index": 4821 + "index": 5391 } }, { @@ -289,14 +289,14 @@ "defaultMessage": "!!!Metadata", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 132, + "line": 142, "column": 12, - "index": 4835 + "index": 5405 }, "end": { - "line": 135, + "line": 145, "column": 3, - "index": 4925 + "index": 5495 } }, { @@ -304,14 +304,149 @@ "defaultMessage": "!!!Policy ID", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 136, + "line": 146, + "column": 12, + "index": 5509 + }, + "end": { + "line": 149, + "column": 3, + "index": 5598 + } + }, + { + "id": "txReview.poolDetails.poolId.label", + "defaultMessage": "!!!Pool ID", + "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", + "start": { + "line": 150, + "column": 10, + "index": 5610 + }, + "end": { + "line": 153, + "column": 3, + "index": 5694 + } + }, + { + "id": "txReview.poolDetails.poolHash.label", + "defaultMessage": "!!!Hash", + "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", + "start": { + "line": 154, "column": 12, - "index": 4939 + "index": 5708 + }, + "end": { + "line": 157, + "column": 3, + "index": 5791 + } + }, + { + "id": "txReview.poolDetails.poolSize.label", + "defaultMessage": "!!!Pool size", + "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", + "start": { + "line": 158, + "column": 12, + "index": 5805 + }, + "end": { + "line": 161, + "column": 3, + "index": 5893 + } + }, + { + "id": "txReview.poolDetails.poolRoa.label", + "defaultMessage": "!!!ROA 30d", + "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", + "start": { + "line": 162, + "column": 11, + "index": 5906 + }, + "end": { + "line": 165, + "column": 3, + "index": 5991 + } + }, + { + "id": "txReview.poolDetails.poolShare.label", + "defaultMessage": "!!!Share", + "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", + "start": { + "line": 166, + "column": 13, + "index": 6006 }, "end": { - "line": 139, + "line": 169, "column": 3, - "index": 5028 + "index": 6091 + } + }, + { + "id": "txReview.poolDetails.poolSaturation.label", + "defaultMessage": "!!!Saturation", + "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", + "start": { + "line": 170, + "column": 18, + "index": 6111 + }, + "end": { + "line": 173, + "column": 3, + "index": 6206 + } + }, + { + "id": "txReview.poolDetails.taxFix.label", + "defaultMessage": "!!!Tax fix", + "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", + "start": { + "line": 174, + "column": 14, + "index": 6222 + }, + "end": { + "line": 177, + "column": 3, + "index": 6306 + } + }, + { + "id": "txReview.poolDetails.taxRatio.label", + "defaultMessage": "!!!Tax ratio", + "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", + "start": { + "line": 178, + "column": 16, + "index": 6324 + }, + "end": { + "line": 181, + "column": 3, + "index": 6412 + } + }, + { + "id": "txReview.poolDetails.pledge.label", + "defaultMessage": "!!!Pledge", + "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", + "start": { + "line": 182, + "column": 14, + "index": 6428 + }, + "end": { + "line": 185, + "column": 3, + "index": 6511 } }, { @@ -319,14 +454,14 @@ "defaultMessage": "!!!Fingerprint", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 140, + "line": 186, "column": 15, - "index": 5045 + "index": 6528 }, "end": { - "line": 143, + "line": 189, "column": 3, - "index": 5139 + "index": 6622 } }, { @@ -334,14 +469,14 @@ "defaultMessage": "!!!Name", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 144, + "line": 190, "column": 8, - "index": 5149 + "index": 6632 }, "end": { - "line": 147, + "line": 193, "column": 3, - "index": 5241 + "index": 6724 } }, { @@ -349,14 +484,14 @@ "defaultMessage": "!!!Token Supply", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 148, + "line": 194, "column": 15, - "index": 5258 + "index": 6741 }, "end": { - "line": 151, + "line": 197, "column": 3, - "index": 5365 + "index": 6848 } }, { @@ -364,14 +499,14 @@ "defaultMessage": "!!!Symbol", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 152, + "line": 198, "column": 10, - "index": 5377 + "index": 6860 }, "end": { - "line": 155, + "line": 201, "column": 3, - "index": 5473 + "index": 6956 } }, { @@ -379,14 +514,14 @@ "defaultMessage": "!!!Description", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 156, + "line": 202, "column": 15, - "index": 5490 + "index": 6973 }, "end": { - "line": 159, + "line": 205, "column": 3, - "index": 5596 + "index": 7079 } }, { @@ -394,14 +529,14 @@ "defaultMessage": "!!!Details on", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 160, + "line": 206, "column": 11, - "index": 5609 + "index": 7092 }, "end": { - "line": 163, + "line": 209, "column": 3, - "index": 5710 + "index": 7193 } }, { @@ -409,14 +544,29 @@ "defaultMessage": "!!!Asset Details", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 164, + "line": 210, "column": 21, - "index": 5733 + "index": 7216 }, "end": { - "line": 167, + "line": 213, "column": 3, - "index": 5817 + "index": 7300 + } + }, + { + "id": "txReview.poolDetails.title", + "defaultMessage": "!!!Pool Details", + "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", + "start": { + "line": 214, + "column": 20, + "index": 7322 + }, + "end": { + "line": 217, + "column": 3, + "index": 7404 } }, { @@ -424,14 +574,14 @@ "defaultMessage": "!!!Register staking key deposit", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 168, + "line": 218, "column": 22, - "index": 5841 + "index": 7428 }, "end": { - "line": 171, + "line": 221, "column": 3, - "index": 5951 + "index": 7538 } }, { @@ -439,14 +589,14 @@ "defaultMessage": "!!!Deregister staking key", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 172, + "line": 222, "column": 24, - "index": 5977 + "index": 7564 }, "end": { - "line": 175, + "line": 225, "column": 3, - "index": 6083 + "index": 7670 } }, { @@ -454,14 +604,14 @@ "defaultMessage": "!!!Staking", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 176, + "line": 226, "column": 26, - "index": 6111 + "index": 7698 }, "end": { - "line": 179, + "line": 229, "column": 3, - "index": 6205 + "index": 7792 } }, { @@ -469,14 +619,14 @@ "defaultMessage": "!!!Rewards withdrawal", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 180, + "line": 230, "column": 25, - "index": 6232 + "index": 7819 }, "end": { - "line": 183, + "line": 233, "column": 3, - "index": 6336 + "index": 7923 } }, { @@ -484,14 +634,14 @@ "defaultMessage": "!!!Select abstain", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 184, + "line": 234, "column": 17, - "index": 6355 + "index": 7942 }, "end": { - "line": 187, + "line": 237, "column": 3, - "index": 6446 + "index": 8033 } }, { @@ -499,14 +649,14 @@ "defaultMessage": "!!!Select no confidence", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 188, + "line": 238, "column": 22, - "index": 6470 + "index": 8057 }, "end": { - "line": 191, + "line": 241, "column": 3, - "index": 6572 + "index": 8159 } }, { @@ -514,14 +664,14 @@ "defaultMessage": "!!!Delegate voting to", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 192, + "line": 242, "column": 24, - "index": 6598 + "index": 8185 }, "end": { - "line": 195, + "line": 245, "column": 3, - "index": 6700 + "index": 8287 } }, { @@ -529,14 +679,14 @@ "defaultMessage": "!!!Stake entire wallet balance to", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 196, + "line": 246, "column": 17, - "index": 6719 + "index": 8306 }, "end": { - "line": 199, + "line": 249, "column": 3, - "index": 6826 + "index": 8413 } }, { @@ -544,14 +694,14 @@ "defaultMessage": "!!!Transaction submitted", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 200, + "line": 250, "column": 20, - "index": 6848 + "index": 8435 }, "end": { - "line": 203, + "line": 253, "column": 3, - "index": 6938 + "index": 8525 } }, { @@ -559,14 +709,14 @@ "defaultMessage": "!!!Check this transaction in the list of wallet transactions", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 204, + "line": 254, "column": 19, - "index": 6959 + "index": 8546 }, "end": { - "line": 207, + "line": 257, "column": 3, - "index": 7084 + "index": 8671 } }, { @@ -574,14 +724,14 @@ "defaultMessage": "!!!Go to transactions", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 208, + "line": 258, "column": 21, - "index": 7107 + "index": 8694 }, "end": { - "line": 211, + "line": 261, "column": 3, - "index": 7195 + "index": 8782 } }, { @@ -589,14 +739,14 @@ "defaultMessage": "!!!Transaction failed", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 212, + "line": 262, "column": 17, - "index": 7214 + "index": 8801 }, "end": { - "line": 215, + "line": 265, "column": 3, - "index": 7298 + "index": 8885 } }, { @@ -604,14 +754,14 @@ "defaultMessage": "!!!Your transaction has not been processed properly due to technical issues", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 216, + "line": 266, "column": 16, - "index": 7316 + "index": 8903 }, "end": { - "line": 219, + "line": 269, "column": 3, - "index": 7453 + "index": 9040 } }, { @@ -619,14 +769,14 @@ "defaultMessage": "!!!Go to transactions", "file": "src/features/ReviewTx/common/hooks/useStrings.tsx", "start": { - "line": 220, + "line": 270, "column": 18, - "index": 7473 + "index": 9060 }, "end": { - "line": 223, + "line": 273, "column": 3, - "index": 7558 + "index": 9145 } } ] \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 7f60dbc4ac..2ba634c17a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2167,6 +2167,21 @@ "@ledgerhq/logs" "^5.15.0" rxjs "^6.5.5" +"@emurgo/yoroi-lib@2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@emurgo/yoroi-lib/-/yoroi-lib-2.2.1.tgz#144f182707fa6fa1a1fe19737110f465fdbfd40a" + integrity sha512-+83CcW9FVUsq+N9KhbhHMOzGou3v34gERWRe1sqWp0E+vQADhj7+hh7k+v8fjsTSyB7vJAwo8naI8S9azeWcKw== + dependencies: + "@cardano-foundation/ledgerjs-hw-app-cardano" "^7.1.3" + "@emurgo/cross-csl-core" "6.1.0" + "@noble/hashes" "^1.3.2" + axios "^1.7.5" + axios-cache-interceptor "^1.5.3" + bech32 "^2.0.0" + bignumber.js "^9.0.1" + blake2b "2.1.4" + easy-crc "1.1.0" + "@emurgo/yoroi-lib@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@emurgo/yoroi-lib/-/yoroi-lib-2.0.0.tgz#5f8361a942f9aa8094c842ffece1893cc33f7b63" @@ -21292,16 +21307,7 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -21414,7 +21420,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -21442,13 +21448,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -23071,7 +23070,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -23107,15 +23106,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"