diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 76f72d1c99..1d82e5d720 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -87,9 +87,7 @@ jobs: yarn install cd apps/wallet-mobile yarn install - cd ios - pod install - cd .. + npx pod-install --yes yarn workspaces run build - name: Copy Apple Signing Key run: | diff --git a/apps/wallet-mobile/.env b/apps/wallet-mobile/.env index 9fe20e2b3c..1ac5746e88 100644 --- a/apps/wallet-mobile/.env +++ b/apps/wallet-mobile/.env @@ -16,4 +16,6 @@ WALLET_2_MNEMONIC=abandon abandon abandon abandon abandon abandon abandon abando BANXA_TEST_WALLET=addr1qyfuspldlchc5kechfe5jzdrr9jms2s9w0tq4hggy9zgkhxssydveuc8xyx4zh27fwcmr62mraeezjwf24hzkyejwfmq7yptmd FRONTEND_FEE_ADDRESS_MAINNET=addr1q9ry6jfdgm0lcrtfpgwrgxg7qfahv80jlghhrthy6w8hmyjuw9ngccy937pm7yw0jjnxasm7hzxjrf8rzkqcj26788lqws5fke -FRONTEND_FEE_ADDRESS_PREPROD=addr_test1qrgpjmyy8zk9nuza24a0f4e7mgp9gd6h3uayp0rqnjnkl54v4dlyj0kwfs0x4e38a7047lymzp37tx0y42glslcdtzhqzp57km \ No newline at end of file +FRONTEND_FEE_ADDRESS_PREPROD=addr_test1qrgpjmyy8zk9nuza24a0f4e7mgp9gd6h3uayp0rqnjnkl54v4dlyj0kwfs0x4e38a7047lymzp37tx0y42glslcdtzhqzp57km + +UNSTOPPABLE_API_KEY=czsajliz-wxgu6tujd1zqq7hey_pclfqhdjsqolsxjfsurgh diff --git a/apps/wallet-mobile/.env.nightly b/apps/wallet-mobile/.env.nightly index f01172cf46..cb7d421413 100644 --- a/apps/wallet-mobile/.env.nightly +++ b/apps/wallet-mobile/.env.nightly @@ -7,4 +7,6 @@ DISABLE_LOGBOX=true BANXA_TEST_WALLET=addr1qyfuspldlchc5kechfe5jzdrr9jms2s9w0tq4hggy9zgkhxssydveuc8xyx4zh27fwcmr62mraeezjwf24hzkyejwfmq7yptmd FRONTEND_FEE_ADDRESS_MAINNET=addr1q9ry6jfdgm0lcrtfpgwrgxg7qfahv80jlghhrthy6w8hmyjuw9ngccy937pm7yw0jjnxasm7hzxjrf8rzkqcj26788lqws5fke -FRONTEND_FEE_ADDRESS_PREPROD=addr_test1qrgpjmyy8zk9nuza24a0f4e7mgp9gd6h3uayp0rqnjnkl54v4dlyj0kwfs0x4e38a7047lymzp37tx0y42glslcdtzhqzp57km \ No newline at end of file +FRONTEND_FEE_ADDRESS_PREPROD=addr_test1qrgpjmyy8zk9nuza24a0f4e7mgp9gd6h3uayp0rqnjnkl54v4dlyj0kwfs0x4e38a7047lymzp37tx0y42glslcdtzhqzp57km + +UNSTOPPABLE_API_KEY=czsajliz-wxgu6tujd1zqq7hey_pclfqhdjsqolsxjfsurgh diff --git a/apps/wallet-mobile/.env.production b/apps/wallet-mobile/.env.production index 729f3ffb33..2300c957cc 100644 --- a/apps/wallet-mobile/.env.production +++ b/apps/wallet-mobile/.env.production @@ -4,4 +4,6 @@ BUILD_VARIANT=PROD SENTRY_DSN=https://7f7c6cb60a6f429facd34f491dfc5133@o1138840.ingest.sentry.io/6783228 FRONTEND_FEE_ADDRESS_MAINNET=addr1q9ry6jfdgm0lcrtfpgwrgxg7qfahv80jlghhrthy6w8hmyjuw9ngccy937pm7yw0jjnxasm7hzxjrf8rzkqcj26788lqws5fke -FRONTEND_FEE_ADDRESS_PREPROD=addr_test1qrgpjmyy8zk9nuza24a0f4e7mgp9gd6h3uayp0rqnjnkl54v4dlyj0kwfs0x4e38a7047lymzp37tx0y42glslcdtzhqzp57km \ No newline at end of file +FRONTEND_FEE_ADDRESS_PREPROD=addr_test1qrgpjmyy8zk9nuza24a0f4e7mgp9gd6h3uayp0rqnjnkl54v4dlyj0kwfs0x4e38a7047lymzp37tx0y42glslcdtzhqzp57km + +UNSTOPPABLE_API_KEY=czsajliz-wxgu6tujd1zqq7hey_pclfqhdjsqolsxjfsurgh diff --git a/apps/wallet-mobile/.env.staging b/apps/wallet-mobile/.env.staging index 65dcd903dc..9c9cbb8f5d 100644 --- a/apps/wallet-mobile/.env.staging +++ b/apps/wallet-mobile/.env.staging @@ -16,4 +16,6 @@ WALLET_2_MNEMONIC=abandon abandon abandon abandon abandon abandon abandon abando BANXA_TEST_WALLET=addr1qyfuspldlchc5kechfe5jzdrr9jms2s9w0tq4hggy9zgkhxssydveuc8xyx4zh27fwcmr62mraeezjwf24hzkyejwfmq7yptmd FRONTEND_FEE_ADDRESS_MAINNET=addr1q9ry6jfdgm0lcrtfpgwrgxg7qfahv80jlghhrthy6w8hmyjuw9ngccy937pm7yw0jjnxasm7hzxjrf8rzkqcj26788lqws5fke -FRONTEND_FEE_ADDRESS_PREPROD=addr_test1qrgpjmyy8zk9nuza24a0f4e7mgp9gd6h3uayp0rqnjnkl54v4dlyj0kwfs0x4e38a7047lymzp37tx0y42glslcdtzhqzp57km \ No newline at end of file +FRONTEND_FEE_ADDRESS_PREPROD=addr_test1qrgpjmyy8zk9nuza24a0f4e7mgp9gd6h3uayp0rqnjnkl54v4dlyj0kwfs0x4e38a7047lymzp37tx0y42glslcdtzhqzp57km + +UNSTOPPABLE_API_KEY=czsajliz-wxgu6tujd1zqq7hey_pclfqhdjsqolsxjfsurgh diff --git a/apps/wallet-mobile/.prettierignore b/apps/wallet-mobile/.prettierignore deleted file mode 100644 index d433ceffb3..0000000000 --- a/apps/wallet-mobile/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -src/metrics/ampli/index.ts \ No newline at end of file diff --git a/apps/wallet-mobile/.storybook/decorators/LayoutGrid.tsx b/apps/wallet-mobile/.storybook/decorators/LayoutGrid.tsx deleted file mode 100644 index 855169cc45..0000000000 --- a/apps/wallet-mobile/.storybook/decorators/LayoutGrid.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react' -import {StyleSheet, View} from 'react-native' - -export const LayoutGrid = ({children}: {children: React.ReactNode}) => { - return ( - <> - {children} - - - - - - - - - - - - - - - - - - - - ) -} - -const commonStyles = { - opacity: 0.5, -} - -const Margin = () => -const Column = () => -const Gutter = () => diff --git a/apps/wallet-mobile/.storybook/decorators/index.ts b/apps/wallet-mobile/.storybook/decorators/index.ts index 29502adb97..572430fbca 100644 --- a/apps/wallet-mobile/.storybook/decorators/index.ts +++ b/apps/wallet-mobile/.storybook/decorators/index.ts @@ -1,5 +1,3 @@ -export * from './intl' -export * from './LayoutGrid' export * from './modals' export * from './navigation' export * from './query' diff --git a/apps/wallet-mobile/.storybook/decorators/intl.tsx b/apps/wallet-mobile/.storybook/decorators/intl.tsx deleted file mode 100644 index e7fc923fa8..0000000000 --- a/apps/wallet-mobile/.storybook/decorators/intl.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react' - -import {LanguageProvider} from '../../src/i18n' - -export const withIntl = (storyFn) => {storyFn()} diff --git a/apps/wallet-mobile/.storybook/decorators/navigation.tsx b/apps/wallet-mobile/.storybook/decorators/navigation.tsx index 5528c0ef54..37dbdaaf70 100644 --- a/apps/wallet-mobile/.storybook/decorators/navigation.tsx +++ b/apps/wallet-mobile/.storybook/decorators/navigation.tsx @@ -1,77 +1,16 @@ import React from 'react' -import {NavigationContext, NavigationProp, NavigationRouteContext, RouteProp} from '@react-navigation/native' -import {action} from '@storybook/addon-actions' - -import {StackNavigationProp} from '@react-navigation/stack' -import {BottomTabNavigationProp} from '@react-navigation/bottom-tabs' - -export const navigation = { - setParams: action('setParams'), - setOptions: action('setOptions'), - - // NavigationHelpers - dispatch: action('dispatch'), - navigate: action('navigate'), - reset: action('reset'), - goBack: action('goBack'), - isFocused: (...args) => { - action('isFocused') - - return true - }, - canGoBack: (...args) => { - action('canGoBack') - - return true - }, - - // EventConsumer - addListener: (event: string) => { - action('addListener')(event) - - return () => action('unsubscribe')(event) - }, - removeListener: action('removeListener'), -} - -export const stackNavigation: Partial> = { - ...navigation, - replace: action('replace'), - push: action('push'), - pop: action('pop'), - popToTop: action('popToTop'), -} - -export const tabNavigation: Partial> = { - ...navigation, - jumpTo: action('jumpTo'), -} - -export const CommonNavigationProvider = ({children}: {children: React.ReactNode}) => ( - {children} -) - -export const StackNavigationProvider = ({children}: {children: React.ReactNode}) => ( - }>{children} -) - -export const TabNavigationProvider = ({children}: {children: React.ReactNode}) => ( - }>{children} -) +import {NavigationRouteContext} from '@react-navigation/native' const route = { key: 'route.key', name: 'route.name', } -export const RouteProvider: React.FC}>> = ({children, params}) => ( +export const RouteProvider: React.FC}>> = ({ + children, + params, +}) => ( {children} ) - -export const withCommonNavigation = (storyFn) => ( - - {storyFn({navigation, route})} - -) diff --git a/apps/wallet-mobile/.storybook/storybook.requires.js b/apps/wallet-mobile/.storybook/storybook.requires.js index d2c35fc4b2..44b28cf79a 100644 --- a/apps/wallet-mobile/.storybook/storybook.requires.js +++ b/apps/wallet-mobile/.storybook/storybook.requires.js @@ -75,6 +75,9 @@ const getStories = () => { "./src/components/Checkbox/Checkbox.stories.tsx": require("../src/components/Checkbox/Checkbox.stories.tsx"), "./src/components/ConfirmTx/ConfirmTx.stories.tsx": require("../src/components/ConfirmTx/ConfirmTx.stories.tsx"), "./src/components/ConfirmTx/Dialog.stories.tsx": require("../src/components/ConfirmTx/Dialog.stories.tsx"), + "./src/components/ConfirmTxWithHwModal/ConfirmTxWithHwModal.stories.tsx": require("../src/components/ConfirmTxWithHwModal/ConfirmTxWithHwModal.stories.tsx"), + "./src/components/ConfirmTxWithOsModal/ConfirmTxWithOsModal.stories.tsx": require("../src/components/ConfirmTxWithOsModal/ConfirmTxWithOsModal.stories.tsx"), + "./src/components/ConfirmTxWithSpendingPasswordModal/ConfirmTxWithSpendingPasswordModal.stories.tsx": require("../src/components/ConfirmTxWithSpendingPasswordModal/ConfirmTxWithSpendingPasswordModal.stories.tsx"), "./src/components/DangerousActionModal/DangerousActionModal.stories.tsx": require("../src/components/DangerousActionModal/DangerousActionModal.stories.tsx"), "./src/components/ErrorBoundary/ErrorBoundary.stories.tsx": require("../src/components/ErrorBoundary/ErrorBoundary.stories.tsx"), "./src/components/ErrorModal/ErrorModal.stories.tsx": require("../src/components/ErrorModal/ErrorModal.stories.tsx"), @@ -86,6 +89,7 @@ const getStories = () => { "./src/components/LanguagePicker/LanguagePickerWarning.stories.tsx": require("../src/components/LanguagePicker/LanguagePickerWarning.stories.tsx"), "./src/components/Link/Link.stories.tsx": require("../src/components/Link/Link.stories.tsx"), "./src/components/LoadingOverlay/LoadingOverlay.stories.tsx": require("../src/components/LoadingOverlay/LoadingOverlay.stories.tsx"), + "./src/components/ModalError/ModalError.stories.tsx": require("../src/components/ModalError/ModalError.stories.tsx"), "./src/components/ModalScreenWrapper/ModalScreenWrapper.stories.tsx": require("../src/components/ModalScreenWrapper/ModalScreenWrapper.stories.tsx"), "./src/components/NftImageGallery/NftImageGallery.stories.tsx": require("../src/components/NftImageGallery/NftImageGallery.stories.tsx"), "./src/components/NftPreview/NftPreview.stories.tsx": require("../src/components/NftPreview/NftPreview.stories.tsx"), @@ -111,11 +115,26 @@ const getStories = () => { "./src/features/Initialization/LanguagePickerScreen/LanguagePickerScreen.stories.tsx": require("../src/features/Initialization/LanguagePickerScreen/LanguagePickerScreen.stories.tsx"), "./src/features/Initialization/TermsOfServiceChangedScreen/TermsOfServiceChangedScreen.stories.tsx": require("../src/features/Initialization/TermsOfServiceChangedScreen/TermsOfServiceChangedScreen.stories.tsx"), "./src/features/Menu/Menu.stories.tsx": require("../src/features/Menu/Menu.stories.tsx"), + "./src/features/RampOnOff/common/AmountCard/AmountCard.stories.tsx": require("../src/features/RampOnOff/common/AmountCard/AmountCard.stories.tsx"), + "./src/features/RampOnOff/common/ButtonActionGroup/ButtonActionGroup.stories.tsx": require("../src/features/RampOnOff/common/ButtonActionGroup/ButtonActionGroup.stories.tsx"), + "./src/features/RampOnOff/common/DescribeAction/DescribeAction.stories.tsx": require("../src/features/RampOnOff/common/DescribeAction/DescribeAction.stories.tsx"), + "./src/features/RampOnOff/common/ShowBuyBanner/BuyBannerBig.stories.tsx": require("../src/features/RampOnOff/common/ShowBuyBanner/BuyBannerBig.stories.tsx"), + "./src/features/RampOnOff/common/ShowBuyBanner/BuyBannerSmall.stories.tsx": require("../src/features/RampOnOff/common/ShowBuyBanner/BuyBannerSmall.stories.tsx"), + "./src/features/RampOnOff/common/ShowBuyBanner/ShowBuyBanner.stories.tsx": require("../src/features/RampOnOff/common/ShowBuyBanner/ShowBuyBanner.stories.tsx"), + "./src/features/RampOnOff/useCases/CreateExchange/CreateExchange.stories.tsx": require("../src/features/RampOnOff/useCases/CreateExchange/CreateExchange.stories.tsx"), + "./src/features/RampOnOff/useCases/CreateExchange/EditAmount/EditAmount.stories.tsx": require("../src/features/RampOnOff/useCases/CreateExchange/EditAmount/EditAmount.stories.tsx"), + "./src/features/RampOnOff/useCases/CreateExchange/SelectBuyOrSell/SelectBuyOrSell.stories.tsx": require("../src/features/RampOnOff/useCases/CreateExchange/SelectBuyOrSell/SelectBuyOrSell.stories.tsx"), + "./src/features/RampOnOff/useCases/CreateExchange/ShowDisclaimer/ShowDisclaimer.stories.tsx": require("../src/features/RampOnOff/useCases/CreateExchange/ShowDisclaimer/ShowDisclaimer.stories.tsx"), + "./src/features/RampOnOff/useCases/CreateExchange/ShowProviderFee/ShowProviderFee.stories.tsx": require("../src/features/RampOnOff/useCases/CreateExchange/ShowProviderFee/ShowProviderFee.stories.tsx"), + "./src/features/RampOnOff/useCases/CreateExchange/ShowProviderInfo/ShowProviderInfo.stories.tsx": require("../src/features/RampOnOff/useCases/CreateExchange/ShowProviderInfo/ShowProviderInfo.stories.tsx"), + "./src/features/RampOnOff/useCases/ShowExchangeResult/ContentResult/ContentResult.stories.tsx": require("../src/features/RampOnOff/useCases/ShowExchangeResult/ContentResult/ContentResult.stories.tsx"), + "./src/features/RampOnOff/useCases/ShowExchangeResult/ShowExchangeResult.stories.tsx": require("../src/features/RampOnOff/useCases/ShowExchangeResult/ShowExchangeResult.stories.tsx"), "./src/features/Scan/common/CodeScannerButton.stories.tsx": require("../src/features/Scan/common/CodeScannerButton.stories.tsx"), "./src/features/Scan/illustrations/Ilustrations.stories.tsx": require("../src/features/Scan/illustrations/Ilustrations.stories.tsx"), "./src/features/Scan/useCases/ScanCodeScreen.stories.tsx": require("../src/features/Scan/useCases/ScanCodeScreen.stories.tsx"), "./src/features/Scan/useCases/ShowCameraPermissionDeniedScreen/OpenDeviceAppSettingsButton.stories.tsx": require("../src/features/Scan/useCases/ShowCameraPermissionDeniedScreen/OpenDeviceAppSettingsButton.stories.tsx"), "./src/features/Scan/useCases/ShowCameraPermissionDeniedScreen/ShowCameraPermissionDeniedScreen.stories.tsx": require("../src/features/Scan/useCases/ShowCameraPermissionDeniedScreen/ShowCameraPermissionDeniedScreen.stories.tsx"), + "./src/features/Send/common/ButtonGroup/ButtonGroup.stories.tsx": require("../src/features/Send/common/ButtonGroup/ButtonGroup.stories.tsx"), "./src/features/Send/useCases/ConfirmTx/ConfirmTxScreen.stories.tsx": require("../src/features/Send/useCases/ConfirmTx/ConfirmTxScreen.stories.tsx"), "./src/features/Send/useCases/ConfirmTx/FailedTx/FailedTxScreen.stories.tsx": require("../src/features/Send/useCases/ConfirmTx/FailedTx/FailedTxScreen.stories.tsx"), "./src/features/Send/useCases/ConfirmTx/SubmittedTx/SubmittedTxScreen.stories.tsx": require("../src/features/Send/useCases/ConfirmTx/SubmittedTx/SubmittedTxScreen.stories.tsx"), @@ -124,6 +143,10 @@ const getStories = () => { "./src/features/Send/useCases/ListAmountsToSend/AddToken/Show/MaxAmountsPerTx.stories.tsx": require("../src/features/Send/useCases/ListAmountsToSend/AddToken/Show/MaxAmountsPerTx.stories.tsx"), "./src/features/Send/useCases/ListAmountsToSend/EditAmount/EditAmountScreen.stories.tsx": require("../src/features/Send/useCases/ListAmountsToSend/EditAmount/EditAmountScreen.stories.tsx"), "./src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.stories.tsx": require("../src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.stories.tsx"), + "./src/features/Send/useCases/StartMultiTokenTx/InputReceiver/InputReceiver.stories.tsx": require("../src/features/Send/useCases/StartMultiTokenTx/InputReceiver/InputReceiver.stories.tsx"), + "./src/features/Send/useCases/StartMultiTokenTx/InputReceiver/ShowResolvedAddressSelected.stories.tsx": require("../src/features/Send/useCases/StartMultiTokenTx/InputReceiver/ShowResolvedAddressSelected.stories.tsx"), + "./src/features/Send/useCases/StartMultiTokenTx/NotifySupportedNameServers/NotifySupportedNameServers.stories.tsx": require("../src/features/Send/useCases/StartMultiTokenTx/NotifySupportedNameServers/NotifySupportedNameServers.stories.tsx"), + "./src/features/Send/useCases/StartMultiTokenTx/SelectNameServer/SelectNameServer.stories.tsx": require("../src/features/Send/useCases/StartMultiTokenTx/SelectNameServer/SelectNameServer.stories.tsx"), "./src/features/Send/useCases/StartMultiTokenTx/StartMultiTokenTxScreen.stories.tsx": require("../src/features/Send/useCases/StartMultiTokenTx/StartMultiTokenTxScreen.stories.tsx"), "./src/features/Settings/About/About.stories.tsx": require("../src/features/Settings/About/About.stories.tsx"), "./src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.stories.tsx": require("../src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.stories.tsx"), @@ -141,36 +164,44 @@ const getStories = () => { "./src/features/Settings/RemoveWallet/RemoveWalletScreen.stories.tsx": require("../src/features/Settings/RemoveWallet/RemoveWalletScreen.stories.tsx"), "./src/features/Settings/TermsOfService/TermsOfServiceScreen.stories.tsx": require("../src/features/Settings/TermsOfService/TermsOfServiceScreen.stories.tsx"), "./src/features/Settings/WalletSettings/WalletSettingsScreen.stories.tsx": require("../src/features/Settings/WalletSettings/WalletSettingsScreen.stories.tsx"), + "./src/features/Staking/Governance/common/Action/Action.stories.tsx": require("../src/features/Staking/Governance/common/Action/Action.stories.tsx"), + "./src/features/Staking/Governance/common/LearnMoreLink/LearnMoreLink.stories.tsx": require("../src/features/Staking/Governance/common/LearnMoreLink/LearnMoreLink.stories.tsx"), + "./src/features/Staking/Governance/useCases/ChangeVote/ChangeVoteScreen.stories.tsx": require("../src/features/Staking/Governance/useCases/ChangeVote/ChangeVoteScreen.stories.tsx"), + "./src/features/Staking/Governance/useCases/ConfirmTx/ConfirmTxScreen.stories.tsx": require("../src/features/Staking/Governance/useCases/ConfirmTx/ConfirmTxScreen.stories.tsx"), + "./src/features/Staking/Governance/useCases/EnterDrepIdModal/EnterDrepIdModal.stories.tsx": require("../src/features/Staking/Governance/useCases/EnterDrepIdModal/EnterDrepIdModal.stories.tsx"), + "./src/features/Staking/Governance/useCases/FailedTx/FailedTxScreen.stories.tsx": require("../src/features/Staking/Governance/useCases/FailedTx/FailedTxScreen.stories.tsx"), + "./src/features/Staking/Governance/useCases/Home/HomeScreen.stories.tsx": require("../src/features/Staking/Governance/useCases/Home/HomeScreen.stories.tsx"), + "./src/features/Staking/Governance/useCases/SuccessTx/SuccessTxScreen.stories.tsx": require("../src/features/Staking/Governance/useCases/SuccessTx/SuccessTxScreen.stories.tsx"), "./src/features/Swap/common/AmountCard/AmountCard.stories.tsx": require("../src/features/Swap/common/AmountCard/AmountCard.stories.tsx"), "./src/features/Swap/common/ButtonGroup/ButtonGroup.stories.tsx": require("../src/features/Swap/common/ButtonGroup/ButtonGroup.stories.tsx"), "./src/features/Swap/common/ConfirmRawTx/ConfirmRawTx.stories.tsx": require("../src/features/Swap/common/ConfirmRawTx/ConfirmRawTx.stories.tsx"), "./src/features/Swap/common/ConfirmWithSpendingPassword/ConfirmWithSpendingPassword.stories.tsx": require("../src/features/Swap/common/ConfirmWithSpendingPassword/ConfirmWithSpendingPassword.stories.tsx"), "./src/features/Swap/common/LiquidityPool/LiquidityPool.stories.tsx": require("../src/features/Swap/common/LiquidityPool/LiquidityPool.stories.tsx"), - "./src/features/Swap/common/ModalError/ModalError.stories.tsx": require("../src/features/Swap/common/ModalError/ModalError.stories.tsx"), "./src/features/Swap/common/SelectPool/SelectPoolFromList/SelectPoolFromList.stories.tsx": require("../src/features/Swap/common/SelectPool/SelectPoolFromList/SelectPoolFromList.stories.tsx"), "./src/features/Swap/common/ServiceUnavailable/ServiceUnavailable.stories.tsx": require("../src/features/Swap/common/ServiceUnavailable/ServiceUnavailable.stories.tsx"), "./src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxScreen.stories.tsx": require("../src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxScreen.stories.tsx"), "./src/features/Swap/useCases/ConfirmTxScreen/ShowFailedTxScreen/ShowFailedTxScreen.stories.tsx": require("../src/features/Swap/useCases/ConfirmTxScreen/ShowFailedTxScreen/ShowFailedTxScreen.stories.tsx"), "./src/features/Swap/useCases/ConfirmTxScreen/ShowSubmittedTxScreen/ShowSubmittedTxScreen.stories.tsx": require("../src/features/Swap/useCases/ConfirmTxScreen/ShowSubmittedTxScreen/ShowSubmittedTxScreen.stories.tsx"), "./src/features/Swap/useCases/ConfirmTxScreen/TransactionSummary.stories.tsx": require("../src/features/Swap/useCases/ConfirmTxScreen/TransactionSummary.stories.tsx"), + "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/AmountActions.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/AmountActions.stories.tsx"), + "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/ClearQuantities.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/ClearQuantities.stories.tsx"), + "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/SwitchTokens.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/SwitchTokens.stories.tsx"), + "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/OrderActions/OrderActions.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/OrderActions/OrderActions.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/CreateOrder.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/CreateOrder.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/EditBuyAmount.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/EditBuyAmount.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/SelectBuyTokenFromListScreen/SelectBuyTokenFromListScreen.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/SelectBuyTokenFromListScreen/SelectBuyTokenFromListScreen.stories.tsx"), - "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditLimitPrice.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditLimitPrice.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/SelectPoolFromListScreen/SelectPoolFromListScreen.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/SelectPoolFromListScreen/SelectPoolFromListScreen.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.stories.tsx"), + "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPrice/EditPrice.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPrice/EditPrice.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/EditSellAmount.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/EditSellAmount.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/SelectSellTokenFromListScreen/SelectSellTokenFromListScreen.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/SelectSellTokenFromListScreen/SelectSellTokenFromListScreen.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/EditSlippage.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/EditSlippage.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/EditSlippageScreen/EditSlippageScreen.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/EditSlippageScreen/EditSlippageScreen.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/ShowSlippageActions.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/ShowSlippageActions.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/ShowSlippageInfo.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/ShowSlippageInfo.stories.tsx"), - "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/LimitPriceWarning/LimitPriceWarning.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/LimitPriceWarning/LimitPriceWarning.stories.tsx"), - "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/ShowTokenActions/ClearQuantities.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/ShowTokenActions/ClearQuantities.stories.tsx"), - "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/ShowTokenActions/ShowTokenActions.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/ShowTokenActions/ShowTokenActions.stories.tsx"), - "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/ShowTokenActions/SwitchTokens.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/ShowTokenActions/SwitchTokens.stories.tsx"), - "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/ShowTokenActions/TopTokenActions.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/ShowTokenActions/TopTokenActions.stories.tsx"), - "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/SlippageWarning/SlippageWarning.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/SlippageWarning/SlippageWarning.stories.tsx"), + "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/WarnLimitPrice/WarnLimitPrice.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/WarnLimitPrice/WarnLimitPrice.stories.tsx"), + "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/WarnPriceImpact/WarnPriceImpact.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/WarnPriceImpact/WarnPriceImpact.stories.tsx"), + "./src/features/Swap/useCases/StartSwapScreen/CreateOrder/WarnSlippage/WarnSlippage.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/CreateOrder/WarnSlippage/WarnSlippage.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/ListOrders/ListOrders.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/ListOrders/ListOrders.stories.tsx"), "./src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.stories.tsx"), @@ -194,9 +225,6 @@ const getStories = () => { "./src/Staking/PoolDetails/PoolDetailScreen.stories.tsx": require("../src/Staking/PoolDetails/PoolDetailScreen.stories.tsx"), "./src/Staking/PoolWarningModal/PoolWarningModal.stories.tsx": require("../src/Staking/PoolWarningModal/PoolWarningModal.stories.tsx"), "./src/Staking/StakingCenter/StakingCenter.stories.tsx": require("../src/Staking/StakingCenter/StakingCenter.stories.tsx"), - "./src/theme/Palette.stories.tsx": require("../src/theme/Palette.stories.tsx"), - "./src/theme/Theme.stories.tsx": require("../src/theme/Theme.stories.tsx"), - "./src/theme/Typography.stories.tsx": require("../src/theme/Typography.stories.tsx"), "./src/TxHistory/AssetList/ActionsBanner.stories.tsx": require("../src/TxHistory/AssetList/ActionsBanner.stories.tsx"), "./src/TxHistory/AssetList/ChipButton/ChipButton.stories.tsx": require("../src/TxHistory/AssetList/ChipButton/ChipButton.stories.tsx"), "./src/TxHistory/BalanceBanner.stories.tsx": require("../src/TxHistory/BalanceBanner.stories.tsx"), diff --git a/apps/wallet-mobile/android/app/build.gradle b/apps/wallet-mobile/android/app/build.gradle index 87b9e2812a..060ba3c347 100644 --- a/apps/wallet-mobile/android/app/build.gradle +++ b/apps/wallet-mobile/android/app/build.gradle @@ -108,8 +108,8 @@ android { applicationId "com.emurgo" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 607 - versionName "4.24.0" + versionCode 622 + versionName "4.25.0" testBuildType System.getProperty('testBuildType', 'debug') testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } diff --git a/apps/wallet-mobile/android/app/src/main/AndroidManifest.xml b/apps/wallet-mobile/android/app/src/main/AndroidManifest.xml index 05b3ba0a1f..fce3e7d54c 100644 --- a/apps/wallet-mobile/android/app/src/main/AndroidManifest.xml +++ b/apps/wallet-mobile/android/app/src/main/AndroidManifest.xml @@ -1,43 +1,28 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/wallet-mobile/ios/Podfile.lock b/apps/wallet-mobile/ios/Podfile.lock index 7eff5f118c..c8ecaa4269 100644 --- a/apps/wallet-mobile/ios/Podfile.lock +++ b/apps/wallet-mobile/ios/Podfile.lock @@ -383,7 +383,7 @@ PODS: - react-native-config/App (= 1.5.1) - react-native-config/App (1.5.1): - React-Core - - react-native-haskell-shelley (5.1.3): + - react-native-haskell-shelley (6.0.0-alpha.2): - React - react-native-pager-view (6.2.0): - React-Core @@ -900,7 +900,7 @@ SPEC CHECKSUMS: react-native-background-timer: 17ea5e06803401a379ebf1f20505b793ac44d0fe react-native-ble-plx: f10240444452dfb2d2a13a0e4f58d7783e92d76e react-native-config: 86038147314e2e6d10ea9972022aa171e6b1d4d8 - react-native-haskell-shelley: 92544de7277b53cda2393528d530b526c81b48a6 + react-native-haskell-shelley: c01783e1181b8fc1fea715a288801056d70afc07 react-native-pager-view: 0ccb8bf60e2ebd38b1f3669fa3650ecce81db2df react-native-quick-base64: 62290829c619fbabca4c41cfec75ae759d08fc1c react-native-randombytes: b6677f7d495c27e9ee0dbd77ebc97b3c59173729 diff --git a/apps/wallet-mobile/ios/nightly.plist b/apps/wallet-mobile/ios/nightly.plist index fb7e6a3e33..c820d61eba 100644 --- a/apps/wallet-mobile/ios/nightly.plist +++ b/apps/wallet-mobile/ios/nightly.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 4.24.0 + 4.25.0 CFBundleSignature ???? CFBundleVersion - 496 + 511 LSApplicationCategoryType LSRequiresIPhoneOS diff --git a/apps/wallet-mobile/ios/yoroi.xcodeproj/project.pbxproj b/apps/wallet-mobile/ios/yoroi.xcodeproj/project.pbxproj index 1b68bf51c0..69226d01a2 100644 --- a/apps/wallet-mobile/ios/yoroi.xcodeproj/project.pbxproj +++ b/apps/wallet-mobile/ios/yoroi.xcodeproj/project.pbxproj @@ -366,15 +366,10 @@ TargetAttributes = { 00E356ED1AD99517003FC87E = { CreatedOnToolsVersion = 6.2; - ProvisioningStyle = Automatic; TestTargetID = 13B07F861A680F5B00A75B9A; }; 13B07F861A680F5B00A75B9A = { LastSwiftMigration = 1120; - ProvisioningStyle = Automatic; - }; - BD60BE622A34B13000EFF020 = { - ProvisioningStyle = Automatic; }; }; }; @@ -749,8 +744,9 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = F8NVT2G2L4; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = F8NVT2G2L4; ENVFILE = "$(PODS_ROOT)/../../.env"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -775,7 +771,8 @@ OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; PRODUCT_BUNDLE_IDENTIFIER = com.emurgo.yoroi; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.emurgo.yoroi"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore com.emurgo.yoroi"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -791,9 +788,10 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; - DEVELOPMENT_TEAM = F8NVT2G2L4; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = F8NVT2G2L4; ENVFILE = "$(PODS_ROOT)/../../.env"; INFOPLIST_FILE = yoroiTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -814,7 +812,8 @@ OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; PRODUCT_BUNDLE_IDENTIFIER = com.emurgo.yoroi; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.emurgo.yoroi"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore com.emurgo.yoroi"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -830,9 +829,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 496; - DEVELOPMENT_TEAM = F8NVT2G2L4; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 511; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = F8NVT2G2L4; ENABLE_BITCODE = NO; ENVFILE = "$(PODS_ROOT)/../../.env"; INFOPLIST_FILE = yoroi/Info.plist; @@ -854,7 +854,8 @@ OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; PRODUCT_BUNDLE_IDENTIFIER = com.emurgo.yoroi; PRODUCT_NAME = yoroi; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.emurgo.yoroi"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore com.emurgo.yoroi"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -872,9 +873,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 496; - DEVELOPMENT_TEAM = F8NVT2G2L4; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 511; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = F8NVT2G2L4; ENVFILE = "$(PODS_ROOT)/../../.env.production"; INFOPLIST_FILE = yoroi/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Yoroi; @@ -895,7 +897,8 @@ OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; PRODUCT_BUNDLE_IDENTIFIER = com.emurgo.yoroi; PRODUCT_NAME = yoroi; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.emurgo.yoroi"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore com.emurgo.yoroi"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -1064,9 +1067,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-nightly"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 496; - DEVELOPMENT_TEAM = F8NVT2G2L4; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 511; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = F8NVT2G2L4; ENABLE_BITCODE = NO; ENVFILE = "$(PODS_ROOT)/../../.env.nightly"; INFOPLIST_FILE = nightly.plist; @@ -1088,7 +1092,8 @@ OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; PRODUCT_BUNDLE_IDENTIFIER = com.emurgo.yoroi; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.emurgo.yoroi"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore com.emurgo.yoroi"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -1106,9 +1111,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-nightly"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 496; - DEVELOPMENT_TEAM = F8NVT2G2L4; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 511; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = F8NVT2G2L4; ENVFILE = "$(PODS_ROOT)/../../.env.nightly"; INFOPLIST_FILE = nightly.plist; INFOPLIST_KEY_CFBundleDisplayName = "Yoroi Nightly"; @@ -1129,7 +1135,8 @@ OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; PRODUCT_BUNDLE_IDENTIFIER = com.emurgo.yoroi; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.emurgo.yoroi"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore com.emurgo.yoroi"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; diff --git a/apps/wallet-mobile/ios/yoroi/AppDelegate.mm b/apps/wallet-mobile/ios/yoroi/AppDelegate.mm index 4a78bdc03e..c2a64f350c 100644 --- a/apps/wallet-mobile/ios/yoroi/AppDelegate.mm +++ b/apps/wallet-mobile/ios/yoroi/AppDelegate.mm @@ -1,3 +1,4 @@ +#import #import "AppDelegate.h" #import "RNBootSplash.h" @@ -38,4 +39,11 @@ - (BOOL)concurrentRootEnabled return true; } +- (BOOL)application:(UIApplication *)application + openURL:(NSURL *)url + options:(NSDictionary *)options +{ + return [RCTLinkingManager application:application openURL:url options:options]; +} + @end diff --git a/apps/wallet-mobile/ios/yoroi/Info.plist b/apps/wallet-mobile/ios/yoroi/Info.plist index b926485ebf..085205703e 100644 --- a/apps/wallet-mobile/ios/yoroi/Info.plist +++ b/apps/wallet-mobile/ios/yoroi/Info.plist @@ -17,11 +17,26 @@ CFBundlePackageType APPL CFBundleShortVersionString - 4.24.0 + 4.25.0 CFBundleSignature ???? + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLName + yoroi + CFBundleURLSchemes + + yoroi + + + CFBundleVersion - 496 + 511 + ITSAppUsesNonExemptEncryption + LSApplicationCategoryType LSRequiresIPhoneOS @@ -88,11 +103,9 @@ UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait - UIViewControllerBasedStatusBarAppearance - - ITSAppUsesNonExemptEncryption - UIUserInterfaceStyle Light + UIViewControllerBasedStatusBarAppearance + diff --git a/apps/wallet-mobile/ios/yoroiTests/Info.plist b/apps/wallet-mobile/ios/yoroiTests/Info.plist index 31b1a148ea..f705f9781f 100644 --- a/apps/wallet-mobile/ios/yoroiTests/Info.plist +++ b/apps/wallet-mobile/ios/yoroiTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 4.24.0 + 4.25.0 CFBundleSignature ???? CFBundleVersion - 496 + 511 diff --git a/apps/wallet-mobile/package.json b/apps/wallet-mobile/package.json index e8314af352..17d1d77b07 100644 --- a/apps/wallet-mobile/package.json +++ b/apps/wallet-mobile/package.json @@ -1,6 +1,6 @@ { "name": "@yoroi/wallet-mobile", - "version": "4.24.0", + "version": "4.25.0", "private": true, "scripts": { "android-bundle": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res", @@ -94,12 +94,12 @@ "@cardano-foundation/ledgerjs-hw-app-cardano": "^6.0.0", "@emurgo/cip14-js": "^3.0.1", "@emurgo/cip4-js": "1.0.7", - "@emurgo/cross-csl-core": "^3.1.0", - "@emurgo/cross-csl-mobile": "^3.1.0", - "@emurgo/csl-mobile-bridge": "5.1.3", + "@emurgo/cross-csl-core": "^4.0.0-alpha.1", + "@emurgo/cross-csl-mobile": "^4.0.0-alpha.1", + "@emurgo/csl-mobile-bridge": "6.0.0-alpha.2", "@emurgo/react-native-blockies-svg": "^0.0.2", "@emurgo/react-native-hid": "^5.15.6", - "@emurgo/yoroi-lib": "^0.11.0", + "@emurgo/yoroi-lib": "0.14.2", "@formatjs/intl-datetimeformat": "^6.7.0", "@formatjs/intl-getcanonicallocales": "^2.1.0", "@formatjs/intl-locale": "^3.2.1", @@ -120,12 +120,16 @@ "@react-navigation/stack": "^6.3.16", "@sentry/react-native": "^5.8.0", "@shopify/flash-list": "^1.4.1", - "@unstoppabledomains/resolution": "6.0.3", - "@yoroi/api": "1.3.0", - "@yoroi/banxa": "1.3.0", - "@yoroi/common": "1.3.0", - "@yoroi/links": "1.3.0", - "@yoroi/swap": "1.3.0", + "@types/bip39": "^3.0.0", + "@types/pbkdf2": "^3.1.2", + "@yoroi/api": "1.5.1", + "@yoroi/banxa": "1.5.0", + "@yoroi/common": "1.5.1", + "@yoroi/links": "1.5.1", + "@yoroi/resolver": "2.0.4", + "@yoroi/staking": "1.5.1", + "@yoroi/swap": "1.5.1", + "@yoroi/theme": "^1.0.0", "add": "2.0.6", "assert": "^2.0.0", "base-64": "^1.0.0", @@ -202,7 +206,7 @@ "@babel/preset-react": "^7.16.7", "@babel/runtime": "^7.20.0", "@emurgo/cardano-serialization-lib-nodejs": "^9.1.4", - "@emurgo/cross-csl-nodejs": "^3.1.0", + "@emurgo/cross-csl-nodejs": "^4.0.0-alpha.1", "@formatjs/cli": "^6.1.0", "@formatjs/ts-transformer": "^3.13.0", "@react-navigation/devtools": "^6.0.13", @@ -222,6 +226,7 @@ "@testing-library/react-hooks": "^8.0.1", "@testing-library/react-native": "^9.0.0", "@tsconfig/react-native": "^2.0.2", + "@types/bs58": "^4.0.4", "@types/chai": "^4.3.4", "@types/jest": "^29.2.1", "@types/lodash": "^4.14.175", @@ -231,10 +236,11 @@ "@types/react-native": "0.71.6", "@types/react-native-background-timer": "^2.0.0", "@types/react-test-renderer": "^18.0.0", + "@types/tinycolor2": "^1.4.6", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.32.0", - "@yoroi/types": "1.3.0", + "@yoroi/types": "1.5.2", "babel-eslint": "^10.1.0", "babel-jest": "^29.2.1", "babel-loader": "8.2.2", @@ -256,13 +262,14 @@ "i18n-unused": "^0.8.0", "lint-staged": "^13.2.2", "metro-react-native-babel-preset": "0.73.9", + "mockdate": "^3.0.5", "node-fetch": "<3", "pod-install": "^0.1.38", "prettier": "^2.4.1", "prettier-plugin-packagejson": "^2.2.11", "prettylint": "^1.0.0", "react-addons-test-utils": "^15.6.2", - "react-devtools-core": "4.26.1", + "react-devtools-core": "^4.28", "react-dom": "16.8.3", "react-intl-translations-manager": "^5.0.3", "react-native-typescript-transformer": "^1.2.13", diff --git a/apps/wallet-mobile/src/AppNavigator.tsx b/apps/wallet-mobile/src/AppNavigator.tsx index 06d2600242..ed0f138b04 100644 --- a/apps/wallet-mobile/src/AppNavigator.tsx +++ b/apps/wallet-mobile/src/AppNavigator.tsx @@ -15,7 +15,7 @@ import {ModalProvider} from './components/Modal/ModalContext' import {ModalScreen} from './components/Modal/ModalScreen' import {AgreementChangedNavigator, InitializationNavigator} from './features/Initialization' import {LegalAgreement, useLegalAgreement} from './features/Initialization/common' -import {CONFIG} from './legacy/config' +import {CONFIG, LINKING_CONFIG, LINKING_PREFIXES} from './legacy/config' import {DeveloperScreen} from './legacy/DeveloperScreen' import {AppRoutes} from './navigation' import {SearchProvider} from './Search/SearchContext' @@ -28,6 +28,15 @@ const navRef = React.createRef { const strings = useStrings() + const [routeName, setRouteName] = React.useState() + + const enableDeepLink = routeName === 'history-list' + + const linking = { + enabled: enableDeepLink, + prefixes: LINKING_PREFIXES, + config: LINKING_CONFIG, + } useHideScreenInAppSwitcher() useAutoLogout() @@ -62,8 +71,13 @@ export const AppNavigator = () => { } } + const handleStateChange = () => { + const currentRouteName = navRef.current?.getCurrentRoute()?.name + setRouteName(currentRouteName) + } + return ( - + - + + - - + + - {strings.subTitle} + {strings.subTitle} - + - {wallet.isHW ? ( - - ) : ( - - {wallet.isEasyConfirmationEnabled ? strings.authOsInstructions : strings.description} - - )} - - - - + ) : ( + + {wallet.isEasyConfirmationEnabled ? strings.authOsInstructions : strings.description} + )} - label={strings.fees} - editable={false} - autoComplete="off" - /> - {!wallet.isEasyConfirmationEnabled && !wallet.isHW && ( + + - )} - - - - - - onNext()} - isProvidingPassword - providedPassword={password} - setUseUSB={setUseUSB} - useUSB={useUSB} - yoroiUnsignedTx={votingRegTx} - biometricInstructions={[strings.authOsInstructions]} - chooseTransportOnConfirmation - onCIP36SupportChange={handleCIP36SupportChange} - autoConfirm={!supportsCIP36} - supportsCIP36={supportsCIP36} - /> - + + {!wallet.isEasyConfirmationEnabled && !wallet.isHW && ( + + )} + + + + + + onNext()} + isProvidingPassword + providedPassword={password} + setUseUSB={setUseUSB} + useUSB={useUSB} + yoroiUnsignedTx={votingRegTx} + biometricInstructions={[strings.authOsInstructions]} + chooseTransportOnConfirmation + onCIP36SupportChange={handleCIP36SupportChange} + autoConfirm={!supportsCIP36} + supportsCIP36={supportsCIP36} + /> + + ) } diff --git a/apps/wallet-mobile/src/Catalyst/DownloadCatalyst.tsx b/apps/wallet-mobile/src/Catalyst/DownloadCatalyst.tsx index 2cb93e2f76..b1ea991e4d 100644 --- a/apps/wallet-mobile/src/Catalyst/DownloadCatalyst.tsx +++ b/apps/wallet-mobile/src/Catalyst/DownloadCatalyst.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import React, {useState} from 'react' import {defineMessages, useIntl} from 'react-intl' -import {Image, Linking, ScrollView, StyleSheet, TouchableOpacity, View} from 'react-native' +import {Image, Linking, ScrollView, StyleSheet, TouchableOpacity, View, ViewProps} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' import appstoreBadge from '../assets/img/app-store-badge.png' @@ -73,7 +73,7 @@ export const DownloadCatalyst = ({onNext}: Props) => { ) } -const Tip = (props) => +const Tip = (props: ViewProps) => const PlayStoreButton = () => { const openPlayStore = async () => { diff --git a/apps/wallet-mobile/src/Catalyst/InsufficientFundsModal.tsx b/apps/wallet-mobile/src/Catalyst/InsufficientFundsModal.tsx index dbfffb2053..f2723098d5 100644 --- a/apps/wallet-mobile/src/Catalyst/InsufficientFundsModal.tsx +++ b/apps/wallet-mobile/src/Catalyst/InsufficientFundsModal.tsx @@ -45,7 +45,7 @@ const useStrings = () => { const intl = useIntl() return { - insufficientBalance: ({requiredBalance, currentBalance}) => + insufficientBalance: ({requiredBalance, currentBalance}: {requiredBalance: string; currentBalance: string}) => intl.formatMessage(globalMessages.insufficientBalance, { requiredBalance, currentBalance, diff --git a/apps/wallet-mobile/src/Catalyst/QrCode.tsx b/apps/wallet-mobile/src/Catalyst/QrCode.tsx index 6375e5114d..252a471026 100644 --- a/apps/wallet-mobile/src/Catalyst/QrCode.tsx +++ b/apps/wallet-mobile/src/Catalyst/QrCode.tsx @@ -1,6 +1,6 @@ import React, {useState} from 'react' import {defineMessages, useIntl} from 'react-intl' -import {ScrollView, StyleSheet, View} from 'react-native' +import {ScrollView, StyleSheet, View, ViewProps} from 'react-native' import QRCodeSVG from 'react-native-qrcode-svg' import {SafeAreaView} from 'react-native-safe-area-context' @@ -80,13 +80,13 @@ export const QrCode = ({onNext, votingKeyEncrypted}: {onNext: () => void; voting ) } -const AlertBox = (props) => +const AlertBox = (props: ViewProps) => const QRCode = ({text}: {text: string}) => ( ) -const SecretCodeBox = (props) => +const SecretCodeBox = (props: ViewProps) => const messages = defineMessages({ subTitle: { diff --git a/apps/wallet-mobile/src/Catalyst/VotingBanner.tsx b/apps/wallet-mobile/src/Catalyst/VotingBanner.tsx index 18babe7f27..41891a8be2 100644 --- a/apps/wallet-mobile/src/Catalyst/VotingBanner.tsx +++ b/apps/wallet-mobile/src/Catalyst/VotingBanner.tsx @@ -1,3 +1,4 @@ +import {catalystManagerMaker} from '@yoroi/staking' import React, {useEffect, useState} from 'react' import {defineMessages, useIntl} from 'react-intl' import {StyleSheet, TouchableOpacity, View} from 'react-native' @@ -8,7 +9,6 @@ import globalMessages, {confirmationMessages} from '../i18n/global-messages' import {isNightly} from '../legacy/config' import {Logger} from '../legacy/logging' import {COLORS} from '../theme' -import {isRegistrationOpen} from '../yoroi-wallets/cardano/catalyst/catalystUtils' import {useCanVote} from './hooks' import {InsufficientFundsModal} from './InsufficientFundsModal' @@ -42,7 +42,9 @@ export const VotingBanner = ({onPress, disabled}: Props) => { } } - setShowCatalystBanner((canVote && isRegistrationOpen(fundInfo)) || isNightly() || __DEV__) + const catalyst = catalystManagerMaker() + + setShowCatalystBanner((canVote && catalyst.isRegistrationOpen(fundInfo)) || isNightly() || __DEV__) } checkCatalystFundInfo() @@ -103,7 +105,7 @@ const useStrings = () => { name: intl.formatMessage(messages.name), attention: intl.formatMessage(globalMessages.attention), back: intl.formatMessage(confirmationMessages.commonButtons.backButton), - noBalance: ({requiredBalance, currentBalance}) => + noBalance: ({requiredBalance, currentBalance}: {requiredBalance: string; currentBalance: string}) => intl.formatMessage(globalMessages.insufficientBalance, { requiredBalance, currentBalance, diff --git a/apps/wallet-mobile/src/Catalyst/VotingRegistration.tsx b/apps/wallet-mobile/src/Catalyst/VotingRegistration.tsx index 6a9fc68956..50c71e84ab 100644 --- a/apps/wallet-mobile/src/Catalyst/VotingRegistration.tsx +++ b/apps/wallet-mobile/src/Catalyst/VotingRegistration.tsx @@ -1,4 +1,4 @@ -import {useNavigation} from '@react-navigation/native' +import {useFocusEffect, useNavigation} from '@react-navigation/native' import {createStackNavigator} from '@react-navigation/stack' import cryptoRandomString from 'crypto-random-string' import React, {useState} from 'react' @@ -6,6 +6,7 @@ import {useIntl} from 'react-intl' import {Boundary} from '../components' import globalMessages from '../i18n/global-messages' +import {useMetrics} from '../metrics/metricsManager' import { defaultStackNavigationOptions, useWalletNavigation, @@ -25,6 +26,13 @@ export const VotingRegistration = () => { const pin = usePin({length: 4, type: 'numeric'}) const [votingKeyEncrypted, setVotingKeyEncrypted] = React.useState(undefined) const [complete, setComplete] = React.useState(false) + const {track} = useMetrics() + + useFocusEffect( + React.useCallback(() => { + track.votingPageViewed() + }, [track]), + ) return ( { const intl = useIntl() const navigateTo = useNavigateTo() + const governanceStrings = useGovernanceStrings() const wallet = useSelectedWallet() const {isLoading: isSyncing, sync} = useSync(wallet) const isOnline = useIsOnline(wallet) + const {openModal} = useModal() const balances = useBalances(wallet) const primaryAmount = Amounts.getAmount(balances, '') const {stakingInfo, refetch: refetchStakingInfo, error, isLoading} = useStakingInfo(wallet) + const isGovernanceFeatureEnabled = useIsGovernanceFeatureEnabled(wallet) const [showWithdrawalDialog, setShowWithdrawalDialog] = React.useState(false) const {resetToTxHistory} = useWalletNavigation() + const isParticipatingInGovernance = useIsParticipatingInGovernance(wallet) + const walletNavigateTo = useWalletNavigation() + + const handleOnParticipatePress = () => { + walletNavigateTo.navigateToGovernanceCentre({navigateToStakingOnSuccess: true}) + } + + const onWithdraw = () => { + if (isGovernanceFeatureEnabled && !isParticipatingInGovernance) { + openModal( + governanceStrings.withdrawWarningTitle, + , + ) + return + } + setShowWithdrawalDialog(true) + } + return ( @@ -77,7 +104,7 @@ export const Dashboard = () => { totalAdaSum={!isEmptyString(primaryAmount.quantity) ? new BigNumber(primaryAmount.quantity) : null} totalRewards={new BigNumber(stakingInfo.rewards)} totalDelegated={new BigNumber(stakingInfo.amount)} - onWithdraw={() => setShowWithdrawalDialog(true)} + onWithdraw={onWithdraw} disableWithdraw={wallet.isReadOnly} /> ) : ( @@ -85,7 +112,7 @@ export const Dashboard = () => { totalAdaSum={!isEmptyString(primaryAmount.quantity) ? new BigNumber(primaryAmount.quantity) : null} totalRewards={null} totalDelegated={null} - onWithdraw={() => setShowWithdrawalDialog(true)} + onWithdraw={onWithdraw} disableWithdraw /> )} @@ -214,7 +241,7 @@ const EpochInfo = () => { ) } -const Actions = (props) => +const Actions = (props: ViewProps) => const messages = defineMessages({ stakingCenterButton: { diff --git a/apps/wallet-mobile/src/Dashboard/DashboardNavigator.tsx b/apps/wallet-mobile/src/Dashboard/DashboardNavigator.tsx index 74d518cd4a..3c25f171c8 100644 --- a/apps/wallet-mobile/src/Dashboard/DashboardNavigator.tsx +++ b/apps/wallet-mobile/src/Dashboard/DashboardNavigator.tsx @@ -1,9 +1,11 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import {createStackNavigator} from '@react-navigation/stack' +import {GovernanceProvider} from '@yoroi/staking' import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {SettingsButton} from '../components/Button' +import {useGovernanceManagerMaker} from '../features/Staking/Governance' import {DashboardRoutes, defaultStackNavigationOptions, useWalletNavigation} from '../navigation' import {useSelectedWallet} from '../SelectedWallet' import {DelegationConfirmation} from '../Staking' @@ -17,34 +19,33 @@ export const DashboardNavigator = () => { const walletName = useWalletName(wallet) const strings = useStrings() + const manager = useGovernanceManagerMaker() + return ( - - , - }} - /> + + + , + }} + /> - + - - + + + ) } diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx b/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx index b4ba57328a..c1306dd6a9 100644 --- a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx +++ b/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx @@ -154,7 +154,7 @@ const useStrings = () => { balanceLabel: intl.formatMessage(messages.balanceLabel), confirmButton: intl.formatMessage(confirmationMessages.commonButtons.confirmButton), finalBalanceLabel: intl.formatMessage(messages.finalBalanceLabel), - unregisterExplanation: (args) => intl.formatMessage(messages.unregisterExplanation, args), + unregisterExplanation: (args: {refundAmount: string}) => intl.formatMessage(messages.unregisterExplanation, args), confirmTx: intl.formatMessage(txLabels.confirmTx), password: intl.formatMessage(txLabels.password), diff --git a/apps/wallet-mobile/src/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx b/apps/wallet-mobile/src/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx index c89c76a533..cffaa861a1 100644 --- a/apps/wallet-mobile/src/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx +++ b/apps/wallet-mobile/src/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx @@ -12,7 +12,7 @@ const device: Device = { const doTheThing = () => new Promise((resolve) => setTimeout(resolve, 1000)) -const onSelect = async (device) => { +const onSelect = async (device: Device) => { action('onSelect start')(device) await doTheThing() action('onSelect end')(device) diff --git a/apps/wallet-mobile/src/HW/LedgerConnect/LedgerConnect.tsx b/apps/wallet-mobile/src/HW/LedgerConnect/LedgerConnect.tsx index 39f66ecf0d..80bd871863 100644 --- a/apps/wallet-mobile/src/HW/LedgerConnect/LedgerConnect.tsx +++ b/apps/wallet-mobile/src/HW/LedgerConnect/LedgerConnect.tsx @@ -1,4 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore import TransportHID from '@emurgo/react-native-hid' import TransportBLE from '@ledgerhq/react-native-hw-transport-ble' import React from 'react' @@ -31,7 +33,7 @@ type State = { devices: Array deviceId?: null | DeviceId deviceObj?: null | DeviceObj - error?: any + error?: Error | null refreshing: boolean waiting: boolean } @@ -49,7 +51,7 @@ class _LedgerConnect extends React.Component { _subscriptions: null | {unsubscribe: () => void} = null _bluetoothEnabled: null | boolean = null - _transportLib: any = null + _transportLib: TransportHID | TransportBLE | null = null _isMounted = false componentDidMount() { @@ -100,29 +102,35 @@ class _LedgerConnect extends React.Component { startScan = () => { const {useUSB} = this.props + const onComplete = () => { + Logger.debug('listen: subscription completed') + this.setState({refreshing: false}) + } + + const onError = (error: Error) => { + this.setState({error, refreshing: false, devices: []}) + } + + const onBLENext = (e: {type: string; descriptor: Device}) => { + if (e.type === 'add') { + Logger.debug('listen: new device detected') + // with bluetooth, new devices are appended in the screen + this.setState(deviceAddition(e.descriptor)) + } + } + + const onHWNext = (e: {type: string; descriptor: DeviceObj}) => { + if (e.type === 'add') { + Logger.debug('listen: new device detected') + // if a device is detected, save it in state immediately + this.setState({refreshing: false, deviceObj: e.descriptor}) + } + } + this._subscriptions = this._transportLib.listen({ - complete: () => { - Logger.debug('listen: subscription completed') - this.setState({refreshing: false}) - }, - next: (e) => { - if (e.type === 'add') { - Logger.debug('listen: new device detected') - if (useUSB === true) { - // if a device is detected, save it in state immediately - this.setState({ - refreshing: false, - deviceObj: e.descriptor, - }) - } else { - // with bluetooth, new devices are appended in the screen - this.setState(deviceAddition(e.descriptor)) - } - } - }, - error: (error) => { - this.setState({error, refreshing: false, devices: []}) - }, + complete: onComplete, + next: useUSB ? onHWNext : onBLENext, + error: onError, }) } @@ -160,6 +168,7 @@ class _LedgerConnect extends React.Component { }) await onConnectBLE(device.id.toString()) } catch (e) { + if (!(e instanceof Error)) return Logger.debug(e as any) if (e instanceof RejectedByUserError) { this.reload() @@ -179,6 +188,7 @@ class _LedgerConnect extends React.Component { }) await this.props.onConnectUSB(deviceObj) } catch (e) { + if (!(e instanceof Error)) return Logger.debug(e as any) if (e instanceof RejectedByUserError) { this.reload() @@ -317,10 +327,10 @@ const messages = defineMessages({ }) const deviceAddition = - (device) => - ({devices}) => { + (device: Device) => + ({devices}: {devices: Device[]}) => { return { - devices: devices.some((i) => i.id === device.id) === true ? devices : devices.concat(device), + devices: devices.some((i) => i.id === device.id) ? devices : devices.concat(device), } } diff --git a/apps/wallet-mobile/src/Legal/TermsOfService/TermsOfService.tsx b/apps/wallet-mobile/src/Legal/TermsOfService/TermsOfService.tsx index 14a4650fab..c0fcaba02a 100644 --- a/apps/wallet-mobile/src/Legal/TermsOfService/TermsOfService.tsx +++ b/apps/wallet-mobile/src/Legal/TermsOfService/TermsOfService.tsx @@ -4,9 +4,10 @@ import Markdown from 'react-native-markdown-display' import {useQuery} from 'react-query' import {Spacer} from '../../components' +import {LanguageCode} from '../../i18n/languages' import {loadTOS} from './loadTos' -export const useTos = ({languageCode}: {languageCode: string}) => { +export const useTos = ({languageCode}: {languageCode: LanguageCode}) => { const query = useQuery({ queryKey: ['tos', languageCode], queryFn: () => loadTOS(languageCode), @@ -15,7 +16,7 @@ export const useTos = ({languageCode}: {languageCode: string}) => { return query.data } -export const TermsOfService = ({languageCode}: {languageCode: string}) => { +export const TermsOfService = ({languageCode}: {languageCode: LanguageCode}) => { const tos = useTos({languageCode}) return tos != null ? ( diff --git a/apps/wallet-mobile/src/Legal/TermsOfService/loadTos.ts b/apps/wallet-mobile/src/Legal/TermsOfService/loadTos.ts index 83df0389de..bbc1eec750 100644 --- a/apps/wallet-mobile/src/Legal/TermsOfService/loadTos.ts +++ b/apps/wallet-mobile/src/Legal/TermsOfService/loadTos.ts @@ -48,11 +48,6 @@ const tosByCode = { 'zh-Hans': ZH_CN_TOS, } -export const loadTOS = (languageCode: string): string => { - console.log('------------------------------') - console.log(languageCode) - // fetch(HU_HU_TOS).then((response) => response.text()).then((text) => console.log(text)) - console.log(tosByCode[languageCode]) - console.log('------------------------------') +export const loadTOS = (languageCode: keyof typeof tosByCode): string => { return tosByCode[languageCode] } diff --git a/apps/wallet-mobile/src/NftDetails/NftDetails.tsx b/apps/wallet-mobile/src/NftDetails/NftDetails.tsx index 76642fb722..bcb44a4393 100644 --- a/apps/wallet-mobile/src/NftDetails/NftDetails.tsx +++ b/apps/wallet-mobile/src/NftDetails/NftDetails.tsx @@ -3,8 +3,16 @@ import {isRecord, isString} from '@yoroi/common' import {Balance} from '@yoroi/types' import React, {ReactNode, useState} from 'react' import {defineMessages, useIntl} from 'react-intl' -import {Dimensions, Linking, StyleSheet, TouchableOpacity, View} from 'react-native' -import {ScrollView} from 'react-native-gesture-handler' +import { + Dimensions, + Linking, + RefreshControl, + SafeAreaView, + ScrollView, + StyleSheet, + TouchableOpacity, + View, +} from 'react-native' import {CopyButton, FadeIn, Icon, Spacer, Text} from '../components' import {NftPreview} from '../components/NftPreview' @@ -17,57 +25,64 @@ import {useNavigateTo} from '../Nfts/navigation' import {useSelectedWallet} from '../SelectedWallet' import {COLORS} from '../theme' import {getNetworkConfigById} from '../yoroi-wallets/cardano/networks' -import {useNft} from '../yoroi-wallets/hooks' +import {useNativeAssetInvalidation, useNft} from '../yoroi-wallets/hooks' export const NftDetails = () => { const {id} = useRoute>().params const strings = useStrings() const wallet = useSelectedWallet() const nft = useNft(wallet, {id}) + const [policy, name] = nft.id.split('.') const [activeTab, setActiveTab] = useState<'overview' | 'metadata'>('overview') const {track} = useMetrics() + const {invalidate, isLoading} = useNativeAssetInvalidation({networkId: wallet.networkId, policy, name}) return ( - - {features.moderatingNftsEnabled ? : } - - - { - if (activeTab !== 'overview') { - setActiveTab('overview') - track.nftGalleryDetailsTab({nft_tab: 'Overview'}) - } - }} - label={strings.overview} - active={activeTab === 'overview'} - testID="overview" - /> - - { - if (activeTab !== 'metadata') { - setActiveTab('metadata') - track.nftGalleryDetailsTab({nft_tab: 'Metadata'}) - } - }} - label={strings.metadata} - active={activeTab === 'metadata'} - testID="metadata" - /> - - - - - - - - - - - - + + } + > + {features.moderatingNftsEnabled ? : } + + + { + if (activeTab !== 'overview') { + setActiveTab('overview') + track.nftGalleryDetailsTab({nft_tab: 'Overview'}) + } + }} + label={strings.overview} + active={activeTab === 'overview'} + testID="overview" + /> + + { + if (activeTab !== 'metadata') { + setActiveTab('metadata') + track.nftGalleryDetailsTab({nft_tab: 'Metadata'}) + } + }} + label={strings.metadata} + active={activeTab === 'metadata'} + testID="metadata" + /> + + + + + + + + + + + + + ) } @@ -76,7 +91,7 @@ const UnModeratedNftImage = ({nft}: {nft: Balance.TokenInfo}) => { const navigateTo = useNavigateTo() return ( navigateTo.nftZoom(nft.id)} style={styles.imageWrapper}> - + ) } @@ -97,7 +112,7 @@ const ModeratedNftImage = ({nft}: {nft: Balance.TokenInfo}) => { return ( navigateTo.nftZoom(nft.id)} style={styles.imageWrapper}> - + ) } diff --git a/apps/wallet-mobile/src/NftDetails/NftDetailsImage.tsx b/apps/wallet-mobile/src/NftDetails/NftDetailsImage.tsx index f51b69f670..986a54d937 100644 --- a/apps/wallet-mobile/src/NftDetails/NftDetailsImage.tsx +++ b/apps/wallet-mobile/src/NftDetails/NftDetailsImage.tsx @@ -1,5 +1,7 @@ import React from 'react' import {Dimensions, StyleSheet, View} from 'react-native' +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore import ViewTransformer from 'react-native-easy-view-transformer' import {FadeIn} from '../components' @@ -27,13 +29,12 @@ export const NftDetailsImage = () => { }, [nft?.id, track]) const dimensions = Dimensions.get('window') - const imageSize = Math.min(dimensions.width, dimensions.height) return ( - + diff --git a/apps/wallet-mobile/src/Nfts/Nfts.tsx b/apps/wallet-mobile/src/Nfts/Nfts.tsx index fd26aee91c..73e38fd75d 100644 --- a/apps/wallet-mobile/src/Nfts/Nfts.tsx +++ b/apps/wallet-mobile/src/Nfts/Nfts.tsx @@ -5,7 +5,7 @@ import {defineMessages, useIntl} from 'react-intl' import {RefreshControl, ScrollView, StyleSheet, Text, View} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' -import {Icon, NftImageGallery, SkeletonGallery, Spacer} from '../components' +import {Icon, NftImageGallery, SkeletonGallery, Spacer, StatusBar} from '../components' import {useMetrics} from '../metrics/metricsManager' import {useSearch, useSearchOnNavBar} from '../Search/SearchContext' import {useSelectedWallet} from '../SelectedWallet' @@ -134,6 +134,8 @@ export const Nfts = () => { const Wrapper = ({children}: {children: ReactNode}) => { return ( + + diff --git a/apps/wallet-mobile/src/Receive/AddressModal.tsx b/apps/wallet-mobile/src/Receive/AddressModal.tsx index 08a6de7c12..52cff2d3e3 100644 --- a/apps/wallet-mobile/src/Receive/AddressModal.tsx +++ b/apps/wallet-mobile/src/Receive/AddressModal.tsx @@ -1,7 +1,7 @@ import {fromPairs} from 'lodash' import React, {useState} from 'react' import {defineMessages, useIntl} from 'react-intl' -import {StyleSheet, View} from 'react-native' +import {StyleSheet, View, ViewProps} from 'react-native' import QRCode from 'react-native-qrcode-svg' import {CopyButton, Spacer, Text} from '../components' @@ -125,8 +125,8 @@ const PathInfo = ({path}: PathInfoProps) => { ) } -const Info = (props) => -const Row = (props) => +const Info = (props: ViewProps) => +const Row = (props: ViewProps) => const styles = StyleSheet.create({ info: { @@ -188,7 +188,7 @@ const useStrings = () => { } } -const useKeyHashes = (address) => { +const useKeyHashes = (address: string) => { const [spending, setSpending] = useState(null) const [staking, setStaking] = useState(null) diff --git a/apps/wallet-mobile/src/Receive/Addresses.tsx b/apps/wallet-mobile/src/Receive/Addresses.tsx index f4036a2745..9b064a4502 100644 --- a/apps/wallet-mobile/src/Receive/Addresses.tsx +++ b/apps/wallet-mobile/src/Receive/Addresses.tsx @@ -1,7 +1,7 @@ import {fromPairs} from 'lodash' import React from 'react' import {defineMessages, useIntl} from 'react-intl' -import {StyleSheet, TouchableOpacity, View} from 'react-native' +import {StyleSheet, TouchableOpacity, TouchableOpacityProps, View, ViewProps} from 'react-native' import {CopyButton, Icon, Spacer, Text} from '../components' import {useSelectedWallet} from '../SelectedWallet' @@ -108,11 +108,11 @@ const UnusedAddress = ({address, onPress}: {address: string; onPress: () => void ) } -const Header = (props) => -const Row = (props) => -const Address = (props) => -const Actions = (props) => -const VerifyButton = (props) => ( +const Header = (props: ViewProps) => +const Row = (props: ViewProps) => +const Address = (props: ViewProps) => +const Actions = (props: ViewProps) => +const VerifyButton = (props: TouchableOpacityProps) => ( diff --git a/apps/wallet-mobile/src/Receive/ReceiveScreen.tsx b/apps/wallet-mobile/src/Receive/ReceiveScreen.tsx index 10380e8206..6aa7e8dd03 100644 --- a/apps/wallet-mobile/src/Receive/ReceiveScreen.tsx +++ b/apps/wallet-mobile/src/Receive/ReceiveScreen.tsx @@ -1,9 +1,11 @@ +import {useFocusEffect} from '@react-navigation/native' import _ from 'lodash' import React from 'react' import {defineMessages, useIntl} from 'react-intl' -import {ActivityIndicator, ScrollView, StyleSheet, View} from 'react-native' +import {ActivityIndicator, ScrollView, StyleSheet, View, ViewProps} from 'react-native' import {Button, Spacer, StatusBar} from '../components' +import {useMetrics} from '../metrics/metricsManager' import {useSelectedWallet} from '../SelectedWallet' import {COLORS} from '../theme' import {useReceiveAddresses} from '../yoroi-wallets/hooks' @@ -22,6 +24,14 @@ export const ReceiveScreen = () => { wallet.generateNewReceiveAddressIfNeeded() }, [wallet]) + const {track} = useMetrics() + + useFocusEffect( + React.useCallback(() => { + track.receivePageViewed() + }, [track]), + ) + return ( @@ -61,7 +71,7 @@ export const ReceiveScreen = () => { ) } -const Content = (props) => +const Content = (props: ViewProps) => const messages = defineMessages({ infoText: { diff --git a/apps/wallet-mobile/src/SelectedWallet/WalletSelection/WalletSelectionScreen.tsx b/apps/wallet-mobile/src/SelectedWallet/WalletSelection/WalletSelectionScreen.tsx index 6b273ca27f..04aef826e0 100644 --- a/apps/wallet-mobile/src/SelectedWallet/WalletSelection/WalletSelectionScreen.tsx +++ b/apps/wallet-mobile/src/SelectedWallet/WalletSelection/WalletSelectionScreen.tsx @@ -1,4 +1,4 @@ -import {useNavigation} from '@react-navigation/native' +import {useFocusEffect, useNavigation} from '@react-navigation/native' import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {FlatList, InteractionManager, Linking, RefreshControl, StyleSheet, Text, TouchableOpacity} from 'react-native' @@ -11,10 +11,12 @@ import {StatusBar} from '../../components/StatusBar' import {showErrorDialog} from '../../dialogs' import globalMessages, {errorMessages} from '../../i18n/global-messages' import {isNightly} from '../../legacy/config' +import {useMetrics} from '../../metrics/metricsManager' import {useWalletNavigation} from '../../navigation' import {COLORS} from '../../theme' import {useWalletManager} from '../../WalletManager' import * as HASKELL_SHELLEY from '../../yoroi-wallets/cardano/constants/mainnet/constants' +import * as SANCHONET from '../../yoroi-wallets/cardano/constants/sanchonet/constants' import * as HASKELL_SHELLEY_TESTNET from '../../yoroi-wallets/cardano/constants/testnet/constants' import {InvalidState, NetworkError} from '../../yoroi-wallets/cardano/errors' import {isJormungandr} from '../../yoroi-wallets/cardano/networks' @@ -33,6 +35,13 @@ export const WalletSelectionScreen = () => { const selectWalletMeta = useSetSelectedWalletMeta() const selectWallet = useSetSelectedWallet() const intl = useIntl() + const {track} = useMetrics() + + useFocusEffect( + React.useCallback(() => { + track.allWalletsPageViewed() + }, [track]), + ) const {openWallet, isLoading} = useOpenWallet({ onSuccess: ([wallet, walletMeta]) => { @@ -89,6 +98,8 @@ export const WalletSelectionScreen = () => { + + @@ -197,6 +208,25 @@ const OnlyNightlyShelleyTestnetButton = () => { ) } +const OnlyNightlyShelleySanchonetButton = () => { + const navigation = useNavigation() + const strings = useStrings() + + if (!isNightly() && !__DEV__) return null + + const handleOnPress = () => { + navigation.navigate('new-wallet', { + screen: 'choose-create-restore', + params: { + networkId: SANCHONET.NETWORK_ID, + walletImplementationId: SANCHONET.WALLET_IMPLEMENTATION_ID, + }, + }) + } + + return