diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..f49a4e16e6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/apps/wallet-mobile/.storybook/decorators/modals.tsx b/apps/wallet-mobile/.storybook/decorators/modals.tsx index 06c54db305..b8b8c012e9 100644 --- a/apps/wallet-mobile/.storybook/decorators/modals.tsx +++ b/apps/wallet-mobile/.storybook/decorators/modals.tsx @@ -2,7 +2,7 @@ import {action} from '@storybook/addon-actions' import React from 'react' import {Button, View} from 'react-native' -import {Modal} from '../../src/legacy/Modal' +import {Modal} from '../../src/components/legacy/Modal/Modal' type childrenFn = (modalProps: { visible: boolean diff --git a/apps/wallet-mobile/.storybook/storybook.requires.js b/apps/wallet-mobile/.storybook/storybook.requires.js index dd85e8e235..3c33e85fd6 100644 --- a/apps/wallet-mobile/.storybook/storybook.requires.js +++ b/apps/wallet-mobile/.storybook/storybook.requires.js @@ -55,8 +55,6 @@ try { const getStories = () => { return { "./.storybook/stories/Button/ExampleButton.stories.js": require("./stories/Button/ExampleButton.stories.js"), - "./src/Catalyst/VotingBanner.stories.tsx": require("../src/Catalyst/VotingBanner.stories.tsx"), - "./src/Catalyst/VotingRegistration.stories.tsx": require("../src/Catalyst/VotingRegistration.stories.tsx"), "./src/components/AmountItem/AmountItem.stories.tsx": require("../src/components/AmountItem/AmountItem.stories.tsx"), "./src/components/Analytics/Analytics.stories.tsx": require("../src/components/Analytics/Analytics.stories.tsx"), "./src/components/BlueCheckbox/BlueCheckbox.stories.tsx": require("../src/components/BlueCheckbox/BlueCheckbox.stories.tsx"), @@ -79,12 +77,12 @@ const getStories = () => { "./src/components/Icon/Icon.stories.tsx": require("../src/components/Icon/Icon.stories.tsx"), "./src/components/LanguagePicker/LanguagePicker.stories.tsx": require("../src/components/LanguagePicker/LanguagePicker.stories.tsx"), "./src/components/LanguagePicker/LanguagePickerWarning.stories.tsx": require("../src/components/LanguagePicker/LanguagePickerWarning.stories.tsx"), + "./src/components/legacy/Modal/Modal.stories.tsx": require("../src/components/legacy/Modal/Modal.stories.tsx"), "./src/components/Link/Link.stories.tsx": require("../src/components/Link/Link.stories.tsx"), "./src/components/Loading/Loading.stories.tsx": require("../src/components/Loading/Loading.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"), "./src/components/PairedBalance/PairedBalance.stories.tsx": require("../src/components/PairedBalance/PairedBalance.stories.tsx"), "./src/components/PressableIcon/PressableIcon.stories.tsx": require("../src/components/PressableIcon/PressableIcon.stories.tsx"), @@ -93,13 +91,6 @@ const getStories = () => { "./src/components/TokenIcon/ModeratedNftIcon.stories.tsx": require("../src/components/TokenIcon/ModeratedNftIcon.stories.tsx"), "./src/components/TokenIcon/TokenIcon.stories.tsx": require("../src/components/TokenIcon/TokenIcon.stories.tsx"), "./src/components/YoroiLogo/YoroiLogo.stories.tsx": require("../src/components/YoroiLogo/YoroiLogo.stories.tsx"), - "./src/Dashboard/Dashboard.stories.tsx": require("../src/Dashboard/Dashboard.stories.tsx"), - "./src/Dashboard/StakePoolInfos.stories.tsx": require("../src/Dashboard/StakePoolInfos.stories.tsx"), - "./src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.stories.tsx": require("../src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.stories.tsx"), - "./src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.stories.tsx": require("../src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.stories.tsx"), - "./src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.stories.tsx": require("../src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.stories.tsx"), - "./src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.stories.tsx": require("../src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.stories.tsx"), - "./src/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.stories.tsx": require("../src/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.stories.tsx"), "./src/features/Auth/backgroundTimeout.stories.tsx": require("../src/features/Auth/backgroundTimeout.stories.tsx"), "./src/features/Auth/ChangePinScreen/ChangePinScreen.stories.tsx": require("../src/features/Auth/ChangePinScreen/ChangePinScreen.stories.tsx"), "./src/features/Auth/CheckPinInput/CheckPinInput.stories.tsx": require("../src/features/Auth/CheckPinInput/CheckPinInput.stories.tsx"), @@ -154,6 +145,10 @@ const getStories = () => { "./src/features/Links/useCases/RequestedAdaPaymentWithLinkScreen/RequestedAdaPaymentWithLink.stories.tsx": require("../src/features/Links/useCases/RequestedAdaPaymentWithLinkScreen/RequestedAdaPaymentWithLink.stories.tsx"), "./src/features/Links/useCases/RequestedAdaPaymentWithLinkScreen/ShowDisclaimer/ShowDisclaimer.stories.tsx": require("../src/features/Links/useCases/RequestedAdaPaymentWithLinkScreen/ShowDisclaimer/ShowDisclaimer.stories.tsx"), "./src/features/Menu/Menu.stories.tsx": require("../src/features/Menu/Menu.stories.tsx"), + "./src/features/Nfts/useCases/NftDetails/NftDetails.stories.tsx": require("../src/features/Nfts/useCases/NftDetails/NftDetails.stories.tsx"), + "./src/features/Nfts/useCases/NftDetails/NftDetailsImage.stories.tsx": require("../src/features/Nfts/useCases/NftDetails/NftDetailsImage.stories.tsx"), + "./src/features/Nfts/useCases/Nfts.stories.tsx": require("../src/features/Nfts/useCases/Nfts.stories.tsx"), + "./src/features/Nfts/useCases/NoNftsScreen.stories.tsx": require("../src/features/Nfts/useCases/NoNftsScreen.stories.tsx"), "./src/features/Portfolio/common/TokenAmountItem/TokenAmountItem.stories.tsx": require("../src/features/Portfolio/common/TokenAmountItem/TokenAmountItem.stories.tsx"), "./src/features/Receive/common/AddressDetailCard/AddressDetailCard.stories.tsx": require("../src/features/Receive/common/AddressDetailCard/AddressDetailCard.stories.tsx"), "./src/features/Receive/common/AddressModal/AddressModal.stories.tsx": require("../src/features/Receive/common/AddressModal/AddressModal.stories.tsx"), @@ -265,30 +260,34 @@ const getStories = () => { "./src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.stories.tsx": require("../src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.stories.tsx"), "./src/features/ToggleAnalyticsSettings/ToggleAnalyticsSettings.stories.tsx": require("../src/features/ToggleAnalyticsSettings/ToggleAnalyticsSettings.stories.tsx"), "./src/features/WalletManager/useCases/SelectWalletFromListScreen/SelectWalletFromListScreen.stories.tsx": require("../src/features/WalletManager/useCases/SelectWalletFromListScreen/SelectWalletFromListScreen.stories.tsx"), - "./src/HW/Instructions/Instructions.stories.tsx": require("../src/HW/Instructions/Instructions.stories.tsx"), - "./src/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx": require("../src/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx"), - "./src/HW/LedgerConnect/LedgerConnect.stories.tsx": require("../src/HW/LedgerConnect/LedgerConnect.stories.tsx"), - "./src/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.stories.tsx": require("../src/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.stories.tsx"), "./src/kernel/metrics/metrics.stories.tsx": require("../src/kernel/metrics/metrics.stories.tsx"), - "./src/legacy/Modal/Modal.stories.tsx": require("../src/legacy/Modal/Modal.stories.tsx"), - "./src/Nfts/NftDetails/NftDetails.stories.tsx": require("../src/Nfts/NftDetails/NftDetails.stories.tsx"), - "./src/Nfts/NftDetails/NftDetailsImage.stories.tsx": require("../src/Nfts/NftDetails/NftDetailsImage.stories.tsx"), - "./src/Nfts/Nfts.stories.tsx": require("../src/Nfts/Nfts.stories.tsx"), - "./src/Nfts/NoNftsScreen.stories.tsx": require("../src/Nfts/NoNftsScreen.stories.tsx"), - "./src/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx": require("../src/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx"), - "./src/Staking/FailedTx/FailedTxScreen.stories.tsx": require("../src/Staking/FailedTx/FailedTxScreen.stories.tsx"), - "./src/Staking/PoolDetails/PoolDetailScreen.stories.tsx": require("../src/Staking/PoolDetails/PoolDetailScreen.stories.tsx"), - "./src/Staking/PoolTransition/PoolTransitionModal.stories.tsx": require("../src/Staking/PoolTransition/PoolTransitionModal.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/TxHistory/AssetList/ChipButton/ChipButton.stories.tsx": require("../src/TxHistory/AssetList/ChipButton/ChipButton.stories.tsx"), - "./src/TxHistory/AssetList/FilterBalancesByType.stories.tsx": require("../src/TxHistory/AssetList/FilterBalancesByType.stories.tsx"), - "./src/TxHistory/BalanceBanner.stories.tsx": require("../src/TxHistory/BalanceBanner.stories.tsx"), - "./src/TxHistory/ModalInfo/ModalInfo.stories.tsx": require("../src/TxHistory/ModalInfo/ModalInfo.stories.tsx"), - "./src/TxHistory/TxDetails/AssetList.stories.tsx": require("../src/TxHistory/TxDetails/AssetList.stories.tsx"), - "./src/TxHistory/TxDetails/TxDetails.stories.tsx": require("../src/TxHistory/TxDetails/TxDetails.stories.tsx"), - "./src/TxHistory/TxHistory.stories.tsx": require("../src/TxHistory/TxHistory.stories.tsx"), - "./src/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.stories.tsx": require("../src/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.stories.tsx"), + "./src/legacy/Catalyst/VotingBanner.stories.tsx": require("../src/legacy/Catalyst/VotingBanner.stories.tsx"), + "./src/legacy/Catalyst/VotingRegistration.stories.tsx": require("../src/legacy/Catalyst/VotingRegistration.stories.tsx"), + "./src/legacy/Dashboard/Dashboard.stories.tsx": require("../src/legacy/Dashboard/Dashboard.stories.tsx"), + "./src/legacy/Dashboard/StakePoolInfos.stories.tsx": require("../src/legacy/Dashboard/StakePoolInfos.stories.tsx"), + "./src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.stories.tsx": require("../src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.stories.tsx"), + "./src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.stories.tsx": require("../src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.stories.tsx"), + "./src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.stories.tsx": require("../src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.stories.tsx"), + "./src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.stories.tsx": require("../src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.stories.tsx"), + "./src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.stories.tsx": require("../src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.stories.tsx"), + "./src/legacy/HW/Instructions/Instructions.stories.tsx": require("../src/legacy/HW/Instructions/Instructions.stories.tsx"), + "./src/legacy/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx": require("../src/legacy/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx"), + "./src/legacy/HW/LedgerConnect/LedgerConnect.stories.tsx": require("../src/legacy/HW/LedgerConnect/LedgerConnect.stories.tsx"), + "./src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.stories.tsx": require("../src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.stories.tsx"), + "./src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx": require("../src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx"), + "./src/legacy/Staking/FailedTx/FailedTxScreen.stories.tsx": require("../src/legacy/Staking/FailedTx/FailedTxScreen.stories.tsx"), + "./src/legacy/Staking/PoolDetails/PoolDetailScreen.stories.tsx": require("../src/legacy/Staking/PoolDetails/PoolDetailScreen.stories.tsx"), + "./src/legacy/Staking/PoolTransition/PoolTransitionModal.stories.tsx": require("../src/legacy/Staking/PoolTransition/PoolTransitionModal.stories.tsx"), + "./src/legacy/Staking/PoolWarningModal/PoolWarningModal.stories.tsx": require("../src/legacy/Staking/PoolWarningModal/PoolWarningModal.stories.tsx"), + "./src/legacy/Staking/StakingCenter/StakingCenter.stories.tsx": require("../src/legacy/Staking/StakingCenter/StakingCenter.stories.tsx"), + "./src/legacy/TxHistory/AssetList/ChipButton/ChipButton.stories.tsx": require("../src/legacy/TxHistory/AssetList/ChipButton/ChipButton.stories.tsx"), + "./src/legacy/TxHistory/AssetList/FilterBalancesByType.stories.tsx": require("../src/legacy/TxHistory/AssetList/FilterBalancesByType.stories.tsx"), + "./src/legacy/TxHistory/BalanceBanner.stories.tsx": require("../src/legacy/TxHistory/BalanceBanner.stories.tsx"), + "./src/legacy/TxHistory/ModalInfo/ModalInfo.stories.tsx": require("../src/legacy/TxHistory/ModalInfo/ModalInfo.stories.tsx"), + "./src/legacy/TxHistory/TxDetails/AssetList.stories.tsx": require("../src/legacy/TxHistory/TxDetails/AssetList.stories.tsx"), + "./src/legacy/TxHistory/TxDetails/TxDetails.stories.tsx": require("../src/legacy/TxHistory/TxDetails/TxDetails.stories.tsx"), + "./src/legacy/TxHistory/TxHistory.stories.tsx": require("../src/legacy/TxHistory/TxHistory.stories.tsx"), + "./src/legacy/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.stories.tsx": require("../src/legacy/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.stories.tsx"), }; }; diff --git a/apps/wallet-mobile/src/AppNavigator.tsx b/apps/wallet-mobile/src/AppNavigator.tsx index 7572e4dd53..074b3978c4 100644 --- a/apps/wallet-mobile/src/AppNavigator.tsx +++ b/apps/wallet-mobile/src/AppNavigator.tsx @@ -9,7 +9,6 @@ import {Alert, AppState, AppStateStatus, InteractionManager, Platform} from 'rea import RNBootSplash from 'react-native-bootsplash' import StorybookScreen from '../.storybook' -import {useStatusBar} from './components/hooks/useStatusBar' import {ModalProvider} from './components/Modal/ModalContext' import {ModalScreen} from './components/Modal/ModalScreen' import {OsLoginScreen, PinLoginScreen, useBackgroundTimeout} from './features/Auth' @@ -22,15 +21,16 @@ import {AgreementChangedNavigator, InitializationNavigator} from './features/Ini import {LegalAgreement, useLegalAgreement} from './features/Initialization/common' import {useDeepLinkWatcher} from './features/Links/common/useDeepLinkWatcher' import {PortfolioScreen} from './features/Portfolio/useCases/PortfolioScreen' +import {SearchProvider} from './features/Search/SearchContext' import {SetupWalletNavigator} from './features/SetupWallet/SetupWalletNavigator' import { ChooseBiometricLoginScreen, useShowBiometricsScreen, } from './features/SetupWallet/useCases/ChooseBiometricLogin/ChooseBiometricLoginScreen' import {useWalletManager} from './features/WalletManager/context/WalletManagerContext' +import {useStatusBar} from './hooks/useStatusBar' import {agreementDate} from './kernel/config' import {AppRoutes} from './kernel/navigation' -import {SearchProvider} from './Search/SearchContext' import {WalletNavigator} from './WalletNavigator' import {useHasWallets} from './yoroi-wallets/hooks' diff --git a/apps/wallet-mobile/src/Nfts/index.ts b/apps/wallet-mobile/src/Nfts/index.ts deleted file mode 100644 index 01997d4dfa..0000000000 --- a/apps/wallet-mobile/src/Nfts/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './NftsNavigator' diff --git a/apps/wallet-mobile/src/WalletNavigator.tsx b/apps/wallet-mobile/src/WalletNavigator.tsx index 2cc7d3acf8..683def9d4c 100644 --- a/apps/wallet-mobile/src/WalletNavigator.tsx +++ b/apps/wallet-mobile/src/WalletNavigator.tsx @@ -6,14 +6,14 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {Keyboard, Platform} from 'react-native' -import {VotingRegistration} from './Catalyst' import {Icon, OfflineBanner} from './components' -import {DashboardNavigator} from './Dashboard' import {DiscoverNavigator} from './features/Discover' import {ShowExchangeResultOrderScreen} from './features/Exchange/useCases/ShowExchangeResultOrderScreen/ShowExchangeResultOrderScreen' import {useLinksRequestAction} from './features/Links/common/useLinksRequestAction' import {useLinksShowActionResult} from './features/Links/common/useLinksShowActionResult' import {MenuNavigator} from './features/Menu' +import {NftsNavigator} from './features/Nfts/NftsNavigator' +import {SearchProvider} from './features/Search/SearchContext' import {SettingsScreenNavigator} from './features/Settings' import {SetupWalletNavigator} from './features/SetupWallet/SetupWalletNavigator' import {GovernanceNavigator} from './features/Staking/Governance' @@ -27,9 +27,9 @@ import { WalletStackRoutes, WalletTabRoutes, } from './kernel/navigation' -import {NftsNavigator} from './Nfts/NftsNavigator' -import {SearchProvider} from './Search/SearchContext' -import {TxHistoryNavigator} from './TxHistory' +import {VotingRegistration} from './legacy/Catalyst' +import {DashboardNavigator} from './legacy/Dashboard' +import {TxHistoryNavigator} from './legacy/TxHistory' const Tab = createBottomTabNavigator() const WalletTabNavigator = () => { diff --git a/apps/wallet-mobile/src/components/AmountItem/AmountItem.tsx b/apps/wallet-mobile/src/components/AmountItem/AmountItem.tsx index 345e0fc312..260e3a473d 100644 --- a/apps/wallet-mobile/src/components/AmountItem/AmountItem.tsx +++ b/apps/wallet-mobile/src/components/AmountItem/AmountItem.tsx @@ -6,7 +6,7 @@ import {StyleSheet, View, ViewProps} from 'react-native' import {usePriceImpactRiskTheme} from '../../features/Swap/common/helpers' import {SwapPriceImpactRisk} from '../../features/Swap/common/types' -import {isEmptyString} from '../../utils' +import {isEmptyString} from '../../kernel/utils' import {YoroiWallet} from '../../yoroi-wallets/cardano/types' import {useTokenInfo} from '../../yoroi-wallets/hooks' import {Quantities} from '../../yoroi-wallets/utils' diff --git a/apps/wallet-mobile/src/components/ConfirmTx/ConfirmTx.tsx b/apps/wallet-mobile/src/components/ConfirmTx/ConfirmTx.tsx index 1f464cbcdb..40e14bf18b 100644 --- a/apps/wallet-mobile/src/components/ConfirmTx/ConfirmTx.tsx +++ b/apps/wallet-mobile/src/components/ConfirmTx/ConfirmTx.tsx @@ -11,7 +11,7 @@ import {walletManager} from '../../features/WalletManager/common/walletManager' import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' import {confirmationMessages, errorMessages, txLabels} from '../../kernel/i18n/global-messages' import LocalizableError from '../../kernel/i18n/LocalizableError' -import {isEmptyString} from '../../utils/utils' +import {isEmptyString} from '../../kernel/utils' import {WrongPassword} from '../../yoroi-wallets/cardano/errors' import {useSubmitTx} from '../../yoroi-wallets/hooks' import {DeviceId, DeviceObj, withBLE, withUSB} from '../../yoroi-wallets/hw' diff --git a/apps/wallet-mobile/src/components/ConfirmTx/Dialog.tsx b/apps/wallet-mobile/src/components/ConfirmTx/Dialog.tsx index 5b5ad9dc45..e0be862632 100644 --- a/apps/wallet-mobile/src/components/ConfirmTx/Dialog.tsx +++ b/apps/wallet-mobile/src/components/ConfirmTx/Dialog.tsx @@ -2,10 +2,10 @@ import React from 'react' import {useIntl} from 'react-intl' import {ErrorView, PleaseWaitView} from '../../components' -import {LedgerConnect, LedgerTransportSwitchView} from '../../HW' import globalMessages, {ledgerMessages, txLabels} from '../../kernel/i18n/global-messages' -import {Modal} from '../../legacy/Modal' +import {LedgerConnect, LedgerTransportSwitchView} from '../../legacy/HW' import {DeviceId, DeviceObj} from '../../yoroi-wallets/hw' +import {Modal} from '../legacy/Modal/Modal' type ErrorData = { errorMessage: string diff --git a/apps/wallet-mobile/src/components/ConfirmTxWithHwModal/ConfirmTxWithHwModal.tsx b/apps/wallet-mobile/src/components/ConfirmTxWithHwModal/ConfirmTxWithHwModal.tsx index c5fae917d9..cf61094dff 100644 --- a/apps/wallet-mobile/src/components/ConfirmTxWithHwModal/ConfirmTxWithHwModal.tsx +++ b/apps/wallet-mobile/src/components/ConfirmTxWithHwModal/ConfirmTxWithHwModal.tsx @@ -5,7 +5,7 @@ import {ActivityIndicator, ScrollView, StyleSheet, View} from 'react-native' import {LedgerTransportSwitch} from '../../features/Swap/useCases/ConfirmTxScreen/LedgerTransportSwitch' import {walletManager} from '../../features/WalletManager/common/walletManager' import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' -import {LedgerConnect} from '../../HW' +import {LedgerConnect} from '../../legacy/HW' import {useSignTxWithHW, useSubmitTx} from '../../yoroi-wallets/hooks' import {DeviceId, DeviceObj, withBLE, withUSB} from '../../yoroi-wallets/hw' import {YoroiSignedTx, YoroiUnsignedTx} from '../../yoroi-wallets/types' diff --git a/apps/wallet-mobile/src/components/CopyButton.tsx b/apps/wallet-mobile/src/components/CopyButton.tsx index 140fd8d927..bf63ccb141 100644 --- a/apps/wallet-mobile/src/components/CopyButton.tsx +++ b/apps/wallet-mobile/src/components/CopyButton.tsx @@ -4,9 +4,9 @@ import {StyleProp, StyleSheet, TouchableOpacity, View, ViewStyle} from 'react-na import Animated, {FadeInDown, FadeOutDown, Layout} from 'react-native-reanimated' import {Text} from '../../../wallet-mobile/src/components' -import {isEmptyString} from '../../../wallet-mobile/src/utils/utils' import {Icon} from '../components/Icon' -import {useCopy} from '../legacy/useCopy' +import {useCopy} from '../hooks/useCopy' +import {isEmptyString} from '../kernel/utils' export type CopyButtonProps = { value: string diff --git a/apps/wallet-mobile/src/components/DangerousActionModal/DangerousActionModal.tsx b/apps/wallet-mobile/src/components/DangerousActionModal/DangerousActionModal.tsx index f238c2a94f..a661843730 100644 --- a/apps/wallet-mobile/src/components/DangerousActionModal/DangerousActionModal.tsx +++ b/apps/wallet-mobile/src/components/DangerousActionModal/DangerousActionModal.tsx @@ -5,8 +5,8 @@ import {ScrollView, StyleSheet, View} from 'react-native' import {Icon} from '../../components/Icon' import globalMessages, {confirmationMessages} from '../../kernel/i18n/global-messages' -import {Modal} from '../../legacy/Modal' import {Button, Checkbox, Spacer, Text} from '..' +import {Modal} from '../legacy/Modal/Modal' type DangerousActionProps = { title: string diff --git a/apps/wallet-mobile/src/components/ErrorModal/ErrorModal.tsx b/apps/wallet-mobile/src/components/ErrorModal/ErrorModal.tsx index 3b033d1c7a..d102a7c483 100644 --- a/apps/wallet-mobile/src/components/ErrorModal/ErrorModal.tsx +++ b/apps/wallet-mobile/src/components/ErrorModal/ErrorModal.tsx @@ -5,10 +5,10 @@ import {Image, LayoutAnimation, ScrollView, StyleSheet, Text, TouchableOpacity, import image from '../../assets/img/error.png' import globalMessages, {errorMessages} from '../../kernel/i18n/global-messages' -import {Modal} from '../../legacy/Modal' -import {isEmptyString} from '../../utils/utils' +import {isEmptyString} from '../../kernel/utils' import {Button} from '../Button' import {Icon} from '../Icon' +import {Modal} from '../legacy/Modal/Modal' type ErrorViewProps = { title?: string diff --git a/apps/wallet-mobile/src/components/Icon/WalletAccount.tsx b/apps/wallet-mobile/src/components/Icon/WalletAccount.tsx index 444391eab0..802f37bda0 100644 --- a/apps/wallet-mobile/src/components/Icon/WalletAccount.tsx +++ b/apps/wallet-mobile/src/components/Icon/WalletAccount.tsx @@ -6,7 +6,7 @@ import React from 'react' import {StyleSheet, View, ViewStyle} from 'react-native' import tinycolor from 'tinycolor2' -import {isEmptyString} from '../../utils/utils' +import {isEmptyString} from '../../kernel/utils' const mkcolor = (primary: string, secondary: string, spots: string) => ({primary, secondary, spots}) const COLORS = [ diff --git a/apps/wallet-mobile/src/components/LanguagePicker/LanguagePicker.tsx b/apps/wallet-mobile/src/components/LanguagePicker/LanguagePicker.tsx index 6178e9a06d..3112f2909c 100644 --- a/apps/wallet-mobile/src/components/LanguagePicker/LanguagePicker.tsx +++ b/apps/wallet-mobile/src/components/LanguagePicker/LanguagePicker.tsx @@ -3,8 +3,8 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {FlatList, StyleSheet, TouchableOpacity, View, ViewProps} from 'react-native' +import {useSearch, useSearchOnNavBar} from '../../features/Search/SearchContext' import {useLanguage} from '../../kernel/i18n' -import {useSearch, useSearchOnNavBar} from '../../Search/SearchContext' import {Icon} from '../Icon' import {Text} from '../Text' import {LanguagePickerWarning} from './LanguagePickerWarning' diff --git a/apps/wallet-mobile/src/components/NftImageGallery/NftImageGallery.stories.tsx b/apps/wallet-mobile/src/components/NftImageGallery/NftImageGallery.stories.tsx deleted file mode 100644 index e79b7f2e58..0000000000 --- a/apps/wallet-mobile/src/components/NftImageGallery/NftImageGallery.stories.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import {storiesOf} from '@storybook/react-native' -import React from 'react' - -import {SkeletonGallery} from './NftImageGallery' - -storiesOf('NFT/GallerySkeleton', module).add('Skeleton', () => ) diff --git a/apps/wallet-mobile/src/components/NftImageGallery/NftImageGallery.tsx b/apps/wallet-mobile/src/components/NftImageGallery/NftImageGallery.tsx deleted file mode 100644 index bf93823f44..0000000000 --- a/apps/wallet-mobile/src/components/NftImageGallery/NftImageGallery.tsx +++ /dev/null @@ -1,270 +0,0 @@ -import {FlashList, FlashListProps} from '@shopify/flash-list' -import {Balance} from '@yoroi/types' -import React from 'react' -import {Dimensions, StyleSheet, TouchableOpacity, TouchableOpacityProps, View} from 'react-native' -import SkeletonPlaceholder from 'react-native-skeleton-placeholder' - -import {features} from '../../features' -import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' -import {useModeratedNftImage} from '../../Nfts/hooks' -import {Icon} from '../Icon' -import {NftPreview} from '../NftPreview' -import {Spacer} from '../Spacer' -import {Text} from '../Text' - -const TEXT_SIZE = 20 - -export const SkeletonGallery = ({amount}: {amount: number}) => { - const placeholders = new Array(amount).fill(undefined).map((val, i) => i) - - return } /> -} - -type Props = { - nfts: Balance.TokenInfo[] - onSelect: (id: string) => void - onRefresh: () => void - isRefreshing: boolean - bounces?: FlashListProps['bounces'] - ListEmptyComponent?: FlashListProps['ListEmptyComponent'] - withVerticalPadding?: boolean - readOnly?: boolean -} -export const NftImageGallery = ({ - nfts = [], - onSelect, - onRefresh, - isRefreshing, - readOnly, - bounces = false, - ListEmptyComponent = undefined, - withVerticalPadding = undefined, -}: Props) => { - return ( - - !('id' in nft) ? ( - - ) : features.moderatingNftsEnabled ? ( - onSelect(nft.id)} nft={nft} key={nft.id} disabled={readOnly} /> - ) : ( - onSelect(nft.id)} nft={nft} key={nft.id} disabled={readOnly} /> - ) - } - /> - ) -} - -const EmptyImage = () => null - -type ModeratedImageProps = TouchableOpacityProps & { - nft: Balance.TokenInfo -} -const UnModeratedImage = ({nft, ...props}: ModeratedImageProps) => { - return ( - - - - ) -} -const ModeratedImage = ({nft, ...props}: ModeratedImageProps) => { - const {name: text, fingerprint} = nft - const wallet = useSelectedWallet() - const {isError, status, isLoading} = useModeratedNftImage({wallet, fingerprint}) - - const isPendingManualReview = status === 'manual_review' - const isPendingAutomaticReview = status === 'pending' - - const isImageApproved = status === 'approved' - const isImageWithConsent = status === 'consent' - const isImageBlocked = status === 'blocked' - - const showSkeleton = isLoading || isPendingAutomaticReview - - if (showSkeleton) { - return ( - - - - ) - } - - if (isError) { - return ( - - - - ) - } - - return ( - - {isImageApproved && } - - {isImageWithConsent && } - - {isImageBlocked && } - - {isPendingManualReview && } - - ) -} - -function BlockedNft({nft}: {nft: Balance.TokenInfo}) { - return -} - -function PlaceholderNft({nft}: {nft: Balance.TokenInfo}) { - return ( - - - - - - - - {nft.name} - - ) -} - -function ManualReviewNft({nft}: {nft: Balance.TokenInfo}) { - return -} - -function RequiresConsentNft({nft}: {nft: Balance.TokenInfo}) { - return ( - - - - - - - - - - - - {nft.name} - - ) -} - -function ApprovedNft({nft}: {nft: Balance.TokenInfo}) { - return ( - - - - - - - - {nft.name} - - ) -} - -function SkeletonImagePlaceholder({text}: {text?: string}) { - if (typeof text !== 'undefined') - return ( - - - - - - - - {text} - - ) - - return ( - - - - - - - - ) -} - -const styles = StyleSheet.create({ - imageWrapper: { - position: 'relative', - overflow: 'hidden', - borderRadius: 8, - }, - eyeWrapper: { - position: 'absolute', - top: 0, - left: 0, - bottom: 0, - right: 0, - zIndex: 1, - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - }, - image: { - borderRadius: 8, - overlayColor: '#FFFFFF', - }, - text: { - fontSize: 14, - lineHeight: TEXT_SIZE, - }, -}) - -const IMAGE_PADDING = 8 -const ROW_SPACING = 14 -const NUMBER_OF_COLUMNS = 2 -const CONTAINER_HORIZONTAL_PADDING = 16 -const CONTAINER_VERTICAL_PADDING = 16 -const SPACE_BETWEEN_COLUMNS = CONTAINER_HORIZONTAL_PADDING -const DIMENSIONS = Dimensions.get('window') -const MIN_SIZE = Math.min(DIMENSIONS.width, DIMENSIONS.height) -const IMAGE_HORIZONTAL_PADDING = SPACE_BETWEEN_COLUMNS / NUMBER_OF_COLUMNS -const IMAGE_SIZE = (MIN_SIZE - CONTAINER_HORIZONTAL_PADDING * 2) / NUMBER_OF_COLUMNS - IMAGE_HORIZONTAL_PADDING - -function GalleryList({ - renderItem, - withVerticalPadding = false, - ...rest -}: FlashListProps & {renderItem: (item: T) => React.ReactElement; withVerticalPadding?: boolean}) { - return ( - ( - - {renderItem(item)} - - - - )} - contentContainerStyle={{ - paddingHorizontal: CONTAINER_HORIZONTAL_PADDING, - paddingVertical: withVerticalPadding ? CONTAINER_VERTICAL_PADDING : undefined, - }} - keyExtractor={(placeholder, index) => index + ''} - horizontal={false} - estimatedItemSize={IMAGE_SIZE + IMAGE_PADDING + TEXT_SIZE + ROW_SPACING} - /> - ) -} diff --git a/apps/wallet-mobile/src/components/NftImageGallery/index.ts b/apps/wallet-mobile/src/components/NftImageGallery/index.ts deleted file mode 100644 index 923c7d9524..0000000000 --- a/apps/wallet-mobile/src/components/NftImageGallery/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './NftImageGallery' diff --git a/apps/wallet-mobile/src/components/PleaseWaitModal.tsx b/apps/wallet-mobile/src/components/PleaseWaitModal.tsx index 5078578fa7..dec5b5fb81 100644 --- a/apps/wallet-mobile/src/components/PleaseWaitModal.tsx +++ b/apps/wallet-mobile/src/components/PleaseWaitModal.tsx @@ -1,7 +1,7 @@ import React from 'react' import {ActivityIndicator, StyleSheet, Text, View} from 'react-native' -import {Modal} from '../legacy/Modal' +import {Modal} from './legacy/Modal/Modal' import {Spacer} from './Spacer' type PleaseWaitViewProps = { diff --git a/apps/wallet-mobile/src/components/StandardModal/StandardModal.tsx b/apps/wallet-mobile/src/components/StandardModal/StandardModal.tsx index 0f89a28dfe..9eed5b113e 100644 --- a/apps/wallet-mobile/src/components/StandardModal/StandardModal.tsx +++ b/apps/wallet-mobile/src/components/StandardModal/StandardModal.tsx @@ -1,6 +1,6 @@ import React from 'react' -import {Modal} from '../../legacy/Modal' +import {Modal} from '../legacy/Modal/Modal' import {TwoActionView} from '../TwoActionView' type Props = { diff --git a/apps/wallet-mobile/src/components/Text.tsx b/apps/wallet-mobile/src/components/Text.tsx index 1fb0c7ee0c..72480a98bc 100644 --- a/apps/wallet-mobile/src/components/Text.tsx +++ b/apps/wallet-mobile/src/components/Text.tsx @@ -12,8 +12,6 @@ type Props = TextProps & { adjustsFontSizeToFit?: boolean } -export const foo: StyleProp = false - const androidAdjustsFontSizeToFitFix = (width: number, childrenLength: number) => { return Math.floor(1.4 * (width / childrenLength)) } diff --git a/apps/wallet-mobile/src/components/TextInput/TextInput.tsx b/apps/wallet-mobile/src/components/TextInput/TextInput.tsx index d5e4ae58cc..e6e4827efc 100644 --- a/apps/wallet-mobile/src/components/TextInput/TextInput.tsx +++ b/apps/wallet-mobile/src/components/TextInput/TextInput.tsx @@ -12,7 +12,7 @@ import { } from 'react-native' import {HelperText as HelperTextRNP, TextInput as RNPTextInput} from 'react-native-paper' -import {isEmptyString} from '../../utils/utils' +import {isEmptyString} from '../../kernel/utils' import {Icon} from '../Icon' export type TextInputProps = RNTextInputProps & diff --git a/apps/wallet-mobile/src/components/ValidatedTextInput.tsx b/apps/wallet-mobile/src/components/ValidatedTextInput.tsx index 484de32ac7..8ebc6ba60c 100644 --- a/apps/wallet-mobile/src/components/ValidatedTextInput.tsx +++ b/apps/wallet-mobile/src/components/ValidatedTextInput.tsx @@ -2,7 +2,7 @@ import {useTheme} from '@yoroi/theme' import React from 'react' import {Platform, StyleSheet, TextInput, TextInputProps, TouchableOpacity, View, ViewStyle} from 'react-native' -import {isEmptyString} from '../utils/utils' +import {isEmptyString} from '../kernel/utils' import {Icon} from './Icon' import {Text} from './Text' diff --git a/apps/wallet-mobile/src/components/index.ts b/apps/wallet-mobile/src/components/index.ts index ae7945a5dd..129a40834a 100644 --- a/apps/wallet-mobile/src/components/index.ts +++ b/apps/wallet-mobile/src/components/index.ts @@ -19,7 +19,6 @@ export * from './LanguagePicker' export * from './Line' export * from './Link' export * from './Modal' -export * from './NftImageGallery' export * from './NumericKeyboard' export * from './OfflineBanner' export * from './PleaseWaitModal' diff --git a/apps/wallet-mobile/src/legacy/Modal/Modal.stories.tsx b/apps/wallet-mobile/src/components/legacy/Modal/Modal.stories.tsx similarity index 98% rename from apps/wallet-mobile/src/legacy/Modal/Modal.stories.tsx rename to apps/wallet-mobile/src/components/legacy/Modal/Modal.stories.tsx index 1d4183ae57..5532521cad 100644 --- a/apps/wallet-mobile/src/legacy/Modal/Modal.stories.tsx +++ b/apps/wallet-mobile/src/components/legacy/Modal/Modal.stories.tsx @@ -2,7 +2,7 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' import {Text} from 'react-native' -import {WithModalProps} from '../../../.storybook/decorators' +import {WithModalProps} from '../../../../.storybook/decorators' import {Modal} from './Modal' storiesOf('Modal', module) diff --git a/apps/wallet-mobile/src/legacy/Modal/Modal.tsx b/apps/wallet-mobile/src/components/legacy/Modal/Modal.tsx similarity index 97% rename from apps/wallet-mobile/src/legacy/Modal/Modal.tsx rename to apps/wallet-mobile/src/components/legacy/Modal/Modal.tsx index 047cfbf76b..3b48841d87 100644 --- a/apps/wallet-mobile/src/legacy/Modal/Modal.tsx +++ b/apps/wallet-mobile/src/components/legacy/Modal/Modal.tsx @@ -16,8 +16,8 @@ import {useTheme} from '@yoroi/theme' import React from 'react' import {Modal as RNModal, StyleSheet, Text, TouchableOpacity, View} from 'react-native' -import {Icon} from '../../components' -import {isEmptyString} from '../../utils/utils' +import {isEmptyString} from '../../../kernel/utils' +import {Icon} from '../..' type Props = { onRequestClose: () => void diff --git a/apps/wallet-mobile/src/features/Claim/common/useClaimErrorResolver.tsx b/apps/wallet-mobile/src/features/Claim/common/useClaimErrorResolver.tsx index 9664a6c165..b04bae9d54 100644 --- a/apps/wallet-mobile/src/features/Claim/common/useClaimErrorResolver.tsx +++ b/apps/wallet-mobile/src/features/Claim/common/useClaimErrorResolver.tsx @@ -1,4 +1,4 @@ -import {useApiErrorResolver} from '../../../kernel/api/useApiErrorResolver' +import {useApiErrorResolver} from '../../../hooks/useApiErrorResolver' import { ClaimApiErrorsAlreadyClaimed, ClaimApiErrorsExpired, diff --git a/apps/wallet-mobile/src/features/Claim/useCases/ShowSuccessScreen.stories.tsx b/apps/wallet-mobile/src/features/Claim/useCases/ShowSuccessScreen.stories.tsx index 263bf3e709..a6425ba6f4 100644 --- a/apps/wallet-mobile/src/features/Claim/useCases/ShowSuccessScreen.stories.tsx +++ b/apps/wallet-mobile/src/features/Claim/useCases/ShowSuccessScreen.stories.tsx @@ -3,7 +3,7 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' import {QueryClientProvider} from 'react-query' -import {queryClientFixture} from '../../../utils/fixtures' +import {queryClientFixture} from '../../../kernel/fixtures/fixtures' import {mocks as walletMocks} from '../../../yoroi-wallets/mocks/wallet' import {SelectedWalletProvider} from '../../WalletManager/context/SelectedWalletContext' import {claimApiMockInstances} from '../module/api.mocks' diff --git a/apps/wallet-mobile/src/features/Claim/useCases/ShowSuccessScreen.tsx b/apps/wallet-mobile/src/features/Claim/useCases/ShowSuccessScreen.tsx index 230075b864..2bc8d643c4 100644 --- a/apps/wallet-mobile/src/features/Claim/useCases/ShowSuccessScreen.tsx +++ b/apps/wallet-mobile/src/features/Claim/useCases/ShowSuccessScreen.tsx @@ -11,9 +11,9 @@ import {AmountItem} from '../../../components/AmountItem/AmountItem' import {Button} from '../../../components/Button/Button' import {PressableIcon} from '../../../components/PressableIcon/PressableIcon' import {Spacer} from '../../../components/Spacer/Spacer' -import {sortTokenInfos} from '../../../utils/sorting' -import {isEmptyString} from '../../../utils/utils' +import {isEmptyString} from '../../../kernel/utils' import {useTokenInfos} from '../../../yoroi-wallets/hooks' +import {sortTokenInfos} from '../../../yoroi-wallets/utils/sorting' import {Amounts} from '../../../yoroi-wallets/utils/utils' import {useSelectedWallet} from '../../WalletManager/context/SelectedWalletContext' import {useDialogs} from '../common/useDialogs' diff --git a/apps/wallet-mobile/src/features/Dev/DeveloperScreen.tsx b/apps/wallet-mobile/src/features/Dev/DeveloperScreen.tsx index c8fbbcd9dd..ca1bf8a0e2 100644 --- a/apps/wallet-mobile/src/features/Dev/DeveloperScreen.tsx +++ b/apps/wallet-mobile/src/features/Dev/DeveloperScreen.tsx @@ -17,7 +17,7 @@ import {errorMessages} from '../../kernel/i18n/global-messages' import {AppRoutes, useWalletNavigation} from '../../kernel/navigation' import {storageVersionMaker} from '../../kernel/storage/migrations/storageVersion' import {rootStorage} from '../../kernel/storage/rootStorage' -import {isEmptyString} from '../../utils/utils' +import {isEmptyString} from '../../kernel/utils' import {generateAdaMnemonic} from '../../yoroi-wallets/cardano/mnemonic' import {useCreateWallet} from '../../yoroi-wallets/hooks' import {NetworkId} from '../../yoroi-wallets/types' diff --git a/apps/wallet-mobile/src/features/Discover/useCases/SelectDappFromList/ListSkeleton.tsx b/apps/wallet-mobile/src/features/Discover/useCases/SelectDappFromList/ListSkeleton.tsx index ee4af0236f..8163c24076 100644 --- a/apps/wallet-mobile/src/features/Discover/useCases/SelectDappFromList/ListSkeleton.tsx +++ b/apps/wallet-mobile/src/features/Discover/useCases/SelectDappFromList/ListSkeleton.tsx @@ -3,7 +3,6 @@ import * as React from 'react' import {ScrollView, StyleSheet, View} from 'react-native' import {Spacer} from '../../../../components' -import {makeList} from '../../../../utils' import {DAppItemSkeleton} from './DAppListItem/DAppItemSkeleton' export const ListSkeleton = () => { @@ -11,7 +10,7 @@ export const ListSkeleton = () => { return ( - {makeList(7).map((_, index) => ( + {Array.from({length: 7}).map((_, index) => ( diff --git a/apps/wallet-mobile/src/features/Discover/useCases/SelectDappFromList/SelectDappFromListScreen.stories.tsx b/apps/wallet-mobile/src/features/Discover/useCases/SelectDappFromList/SelectDappFromListScreen.stories.tsx index f58d70f9cb..bca9d89fe7 100644 --- a/apps/wallet-mobile/src/features/Discover/useCases/SelectDappFromList/SelectDappFromListScreen.stories.tsx +++ b/apps/wallet-mobile/src/features/Discover/useCases/SelectDappFromList/SelectDappFromListScreen.stories.tsx @@ -1,8 +1,8 @@ import {storiesOf} from '@storybook/react-native' import * as React from 'react' -import {SearchProvider} from '../../../../Search/SearchContext' import {mocks as walletMocks} from '../../../../yoroi-wallets/mocks' +import {SearchProvider} from '../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../WalletManager/context/SelectedWalletContext' import {BrowserProvider} from '../../common/BrowserProvider' import {SelectDappFromListScreen} from './SelectDappFromListScreen' diff --git a/apps/wallet-mobile/src/features/Discover/useCases/SelectDappFromList/SelectDappFromListScreen.tsx b/apps/wallet-mobile/src/features/Discover/useCases/SelectDappFromList/SelectDappFromListScreen.tsx index b6eb05a629..3c751f3b9a 100644 --- a/apps/wallet-mobile/src/features/Discover/useCases/SelectDappFromList/SelectDappFromListScreen.tsx +++ b/apps/wallet-mobile/src/features/Discover/useCases/SelectDappFromList/SelectDappFromListScreen.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import {FlatList, StyleSheet, View} from 'react-native' import {Spacer} from '../../../../components' -import {useSearch, useSearchOnNavBar} from '../../../../Search/SearchContext' +import {useSearch, useSearchOnNavBar} from '../../../Search/SearchContext' import {getGoogleSearchItem} from '../../common/helpers' import {useDAppsConnected} from '../../common/useDAppsConnected' import {useStrings} from '../../common/useStrings' diff --git a/apps/wallet-mobile/src/features/Exchange/common/AmountCard/AmountCard.tsx b/apps/wallet-mobile/src/features/Exchange/common/AmountCard/AmountCard.tsx index dc1353bf7e..2482ccdea0 100644 --- a/apps/wallet-mobile/src/features/Exchange/common/AmountCard/AmountCard.tsx +++ b/apps/wallet-mobile/src/features/Exchange/common/AmountCard/AmountCard.tsx @@ -4,10 +4,10 @@ import * as React from 'react' import {Pressable, StyleSheet, Text, TextInput, View} from 'react-native' import {Boundary, Spacer, TokenIcon, TokenIconPlaceholder} from '../../../../components' -import {formatTokenWithText} from '../../../../legacy/format' -import {isEmptyString} from '../../../../utils' +import {isEmptyString} from '../../../../kernel/utils' import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' import {useTokenInfo} from '../../../../yoroi-wallets/hooks' +import {formatTokenWithText} from '../../../../yoroi-wallets/utils/format' import {useStrings} from '../useStrings' type AmountCardProps = { diff --git a/apps/wallet-mobile/src/features/Exchange/useCases/CreateExchangeOrderScreen/EditAmount/EditAmount.stories.tsx b/apps/wallet-mobile/src/features/Exchange/useCases/CreateExchangeOrderScreen/EditAmount/EditAmount.stories.tsx index 5c1f6b35c4..ea08798c7e 100644 --- a/apps/wallet-mobile/src/features/Exchange/useCases/CreateExchangeOrderScreen/EditAmount/EditAmount.stories.tsx +++ b/apps/wallet-mobile/src/features/Exchange/useCases/CreateExchangeOrderScreen/EditAmount/EditAmount.stories.tsx @@ -3,8 +3,8 @@ import {exchangeDefaultState, ExchangeProvider, successManagerMock} from '@yoroi import * as React from 'react' import {StyleSheet, View} from 'react-native' -import {SearchProvider} from '../../../../../Search/SearchContext' import {mocks} from '../../../../../yoroi-wallets/mocks' +import {SearchProvider} from '../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../WalletManager/context/SelectedWalletContext' import {EditAmount} from './EditAmount' diff --git a/apps/wallet-mobile/src/features/Links/common/useLinksRequestRedirect.tsx b/apps/wallet-mobile/src/features/Links/common/useLinksRequestRedirect.tsx index ccab3074f7..d0264cd470 100644 --- a/apps/wallet-mobile/src/features/Links/common/useLinksRequestRedirect.tsx +++ b/apps/wallet-mobile/src/features/Links/common/useLinksRequestRedirect.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import {InteractionManager} from 'react-native' import {useModal} from '../../../components/Modal/ModalContext' -import {isEmptyString} from '../../../utils/utils' +import {isEmptyString} from '../../../kernel/utils' import {AskToRedirectScreen} from '../useCases/AskToRedirect/AskToRedirectScreen' import {useStrings} from './useStrings' diff --git a/apps/wallet-mobile/src/features/Links/useCases/RequestedAdaPaymentWithLinkScreen/RequestedAdaPaymentWithLinkScreen.tsx b/apps/wallet-mobile/src/features/Links/useCases/RequestedAdaPaymentWithLinkScreen/RequestedAdaPaymentWithLinkScreen.tsx index f18baa1616..df89a4264e 100644 --- a/apps/wallet-mobile/src/features/Links/useCases/RequestedAdaPaymentWithLinkScreen/RequestedAdaPaymentWithLinkScreen.tsx +++ b/apps/wallet-mobile/src/features/Links/useCases/RequestedAdaPaymentWithLinkScreen/RequestedAdaPaymentWithLinkScreen.tsx @@ -6,7 +6,7 @@ import {ScrollView, StyleSheet, Text, View, ViewProps} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' import {Button, Spacer, useModal} from '../../../../components' -import {isEmptyString} from '../../../../utils/utils' +import {isEmptyString} from '../../../../kernel/utils' import {useStrings} from '../../common/useStrings' import {ShowDisclaimer} from './ShowDisclaimer/ShowDisclaimer' diff --git a/apps/wallet-mobile/src/features/Menu/Menu.tsx b/apps/wallet-mobile/src/features/Menu/Menu.tsx index 7b6cd03fb4..ffea81e821 100644 --- a/apps/wallet-mobile/src/features/Menu/Menu.tsx +++ b/apps/wallet-mobile/src/features/Menu/Menu.tsx @@ -7,14 +7,14 @@ import {useIntl} from 'react-intl' import {Linking, ScrollView, StyleSheet, TouchableOpacity, View} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' -import {useCanVote} from '../../Catalyst/hooks' -import {InsufficientFundsModal} from '../../Catalyst/InsufficientFundsModal' import {Boundary, Icon, Spacer, Text} from '../../components' -import {usePrefetchStakingInfo} from '../../Dashboard/StakePoolInfos' import {dappExplorerEnabled} from '../../kernel/config' import {useMetrics} from '../../kernel/metrics/metricsManager' import {defaultStackNavigationOptions, useWalletNavigation} from '../../kernel/navigation' -import {usePoolTransition} from '../../Staking/PoolTransition/usePoolTransition' +import {useCanVote} from '../../legacy/Catalyst/hooks' +import {InsufficientFundsModal} from '../../legacy/Catalyst/InsufficientFundsModal' +import {usePrefetchStakingInfo} from '../../legacy/Dashboard/StakePoolInfos' +import {usePoolTransition} from '../../legacy/Staking/PoolTransition/usePoolTransition' import {useIsGovernanceFeatureEnabled} from '../Staking/Governance' import {useSelectedWallet} from '../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/Nfts/NftsNavigator.tsx b/apps/wallet-mobile/src/features/Nfts/NftsNavigator.tsx similarity index 79% rename from apps/wallet-mobile/src/Nfts/NftsNavigator.tsx rename to apps/wallet-mobile/src/features/Nfts/NftsNavigator.tsx index d90df1b89c..b924b95db7 100644 --- a/apps/wallet-mobile/src/Nfts/NftsNavigator.tsx +++ b/apps/wallet-mobile/src/features/Nfts/NftsNavigator.tsx @@ -3,11 +3,11 @@ import {useTheme} from '@yoroi/theme' import React from 'react' import {defineMessages, useIntl} from 'react-intl' -import {MediaDetails} from '../features/Portfolio/common/MediaDetails/MediaDetails' -import {useMetrics} from '../kernel/metrics/metricsManager' -import {defaultStackNavigationOptions, NftRoutes} from '../kernel/navigation' -import {NftDetailsImage} from './NftDetails/NftDetailsImage' -import {Nfts} from './Nfts' +import {useMetrics} from '../../kernel/metrics/metricsManager' +import {defaultStackNavigationOptions, NftRoutes} from '../../kernel/navigation' +import {MediaDetails} from '../Portfolio/common/MediaDetails/MediaDetails' +import {NftDetailsImage} from './useCases/NftDetails/NftDetailsImage' +import {Nfts} from './useCases/Nfts' const Stack = createStackNavigator() diff --git a/apps/wallet-mobile/src/Nfts/filterNfts.test.ts b/apps/wallet-mobile/src/features/Nfts/common/filterNfts.test.ts similarity index 95% rename from apps/wallet-mobile/src/Nfts/filterNfts.test.ts rename to apps/wallet-mobile/src/features/Nfts/common/filterNfts.test.ts index 9e66c1733c..e94a05a1d3 100644 --- a/apps/wallet-mobile/src/Nfts/filterNfts.test.ts +++ b/apps/wallet-mobile/src/features/Nfts/common/filterNfts.test.ts @@ -1,6 +1,6 @@ import {Balance} from '@yoroi/types' -import {nft} from '../yoroi-wallets/mocks' +import {nft} from '../../../yoroi-wallets/mocks' import {filterNfts} from './filterNfts' describe('filterNfts', () => { diff --git a/apps/wallet-mobile/src/Nfts/filterNfts.ts b/apps/wallet-mobile/src/features/Nfts/common/filterNfts.ts similarity index 92% rename from apps/wallet-mobile/src/Nfts/filterNfts.ts rename to apps/wallet-mobile/src/features/Nfts/common/filterNfts.ts index 18fcdb7bec..fd9673ad5e 100644 --- a/apps/wallet-mobile/src/Nfts/filterNfts.ts +++ b/apps/wallet-mobile/src/features/Nfts/common/filterNfts.ts @@ -1,7 +1,7 @@ import {Balance} from '@yoroi/types' import React from 'react' -import {useMetrics} from '../kernel/metrics/metricsManager' +import {useMetrics} from '../../../kernel/metrics/metricsManager' export const filterNfts = (searchTerm: string, nfts: Balance.TokenInfo[]): Balance.TokenInfo[] => { const searchTermLowerCase = searchTerm.toLowerCase() diff --git a/apps/wallet-mobile/src/Nfts/hooks.ts b/apps/wallet-mobile/src/features/Nfts/common/hooks.ts similarity index 70% rename from apps/wallet-mobile/src/Nfts/hooks.ts rename to apps/wallet-mobile/src/features/Nfts/common/hooks.ts index 7fffe19e4f..311a3fd9ff 100644 --- a/apps/wallet-mobile/src/Nfts/hooks.ts +++ b/apps/wallet-mobile/src/features/Nfts/common/hooks.ts @@ -1,5 +1,5 @@ -import {YoroiWallet} from '../yoroi-wallets/cardano/types' -import {useNftModerationStatus} from '../yoroi-wallets/hooks' +import {YoroiWallet} from '../../../yoroi-wallets/cardano/types' +import {useNftModerationStatus} from '../../../yoroi-wallets/hooks' export const useModeratedNftImage = ({wallet, fingerprint}: {wallet: YoroiWallet; fingerprint: string}) => { return useNftModerationStatus( diff --git a/apps/wallet-mobile/src/Nfts/navigation.ts b/apps/wallet-mobile/src/features/Nfts/common/navigation.ts similarity index 87% rename from apps/wallet-mobile/src/Nfts/navigation.ts rename to apps/wallet-mobile/src/features/Nfts/common/navigation.ts index 9fa6151e3a..5525e702f2 100644 --- a/apps/wallet-mobile/src/Nfts/navigation.ts +++ b/apps/wallet-mobile/src/features/Nfts/common/navigation.ts @@ -1,7 +1,7 @@ import {useNavigation} from '@react-navigation/native' import {Portfolio} from '@yoroi/types' -import {NftRouteNavigation} from '../kernel/navigation' +import {NftRouteNavigation} from '../../../kernel/navigation' export const useNavigateTo = () => { const navigation = useNavigation() diff --git a/apps/wallet-mobile/src/Nfts/NftDetails/NftDetails.stories.tsx b/apps/wallet-mobile/src/features/Nfts/useCases/NftDetails/NftDetails.stories.tsx similarity index 83% rename from apps/wallet-mobile/src/Nfts/NftDetails/NftDetails.stories.tsx rename to apps/wallet-mobile/src/features/Nfts/useCases/NftDetails/NftDetails.stories.tsx index 7133872c97..a463eee4dc 100644 --- a/apps/wallet-mobile/src/Nfts/NftDetails/NftDetails.stories.tsx +++ b/apps/wallet-mobile/src/features/Nfts/useCases/NftDetails/NftDetails.stories.tsx @@ -1,10 +1,10 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' -import {QueryProvider, RouteProvider} from '../../../.storybook/decorators' -import {MediaDetails} from '../../features/Portfolio/common/MediaDetails/MediaDetails' -import {SelectedWalletProvider} from '../../features/WalletManager/context/SelectedWalletContext' -import {mocks, nft} from '../../yoroi-wallets/mocks' +import {QueryProvider, RouteProvider} from '../../../../../.storybook/decorators' +import {mocks, nft} from '../../../../yoroi-wallets/mocks' +import {MediaDetails} from '../../../Portfolio/common/MediaDetails/MediaDetails' +import {SelectedWalletProvider} from '../../../WalletManager/context/SelectedWalletContext' storiesOf('NFT/Details', module) .add('Default', () => { diff --git a/apps/wallet-mobile/src/Nfts/NftDetails/NftDetailsImage.stories.tsx b/apps/wallet-mobile/src/features/Nfts/useCases/NftDetails/NftDetailsImage.stories.tsx similarity index 87% rename from apps/wallet-mobile/src/Nfts/NftDetails/NftDetailsImage.stories.tsx rename to apps/wallet-mobile/src/features/Nfts/useCases/NftDetails/NftDetailsImage.stories.tsx index 397d5c009a..b4a605f820 100644 --- a/apps/wallet-mobile/src/Nfts/NftDetails/NftDetailsImage.stories.tsx +++ b/apps/wallet-mobile/src/features/Nfts/useCases/NftDetails/NftDetailsImage.stories.tsx @@ -1,9 +1,9 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' -import {QueryProvider, RouteProvider} from '../../../.storybook' -import {SelectedWalletProvider} from '../../features/WalletManager/context/SelectedWalletContext' -import {mocks, nft} from '../../yoroi-wallets/mocks' +import {QueryProvider, RouteProvider} from '../../../../../.storybook' +import {mocks, nft} from '../../../../yoroi-wallets/mocks' +import {SelectedWalletProvider} from '../../../WalletManager/context/SelectedWalletContext' import {NftDetailsImage} from './NftDetailsImage' storiesOf('NFT/Details Image', module) diff --git a/apps/wallet-mobile/src/Nfts/NftDetails/NftDetailsImage.tsx b/apps/wallet-mobile/src/features/Nfts/useCases/NftDetails/NftDetailsImage.tsx similarity index 79% rename from apps/wallet-mobile/src/Nfts/NftDetails/NftDetailsImage.tsx rename to apps/wallet-mobile/src/features/Nfts/useCases/NftDetails/NftDetailsImage.tsx index f6f661a448..27d79c8d4f 100644 --- a/apps/wallet-mobile/src/Nfts/NftDetails/NftDetailsImage.tsx +++ b/apps/wallet-mobile/src/features/Nfts/useCases/NftDetails/NftDetailsImage.tsx @@ -4,12 +4,12 @@ import {StyleSheet, useWindowDimensions, View} from 'react-native' // @ts-ignore import ViewTransformer from 'react-native-easy-view-transformer' -import {FadeIn} from '../../components' -import {MediaPreview} from '../../features/Portfolio/common/MediaPreview/MediaPreview' -import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' -import {useMetrics} from '../../kernel/metrics/metricsManager' -import {NftRoutes, useParams} from '../../kernel/navigation' -import {isEmptyString} from '../../utils/utils' +import {FadeIn} from '../../../../components' +import {useMetrics} from '../../../../kernel/metrics/metricsManager' +import {NftRoutes, useParams} from '../../../../kernel/navigation' +import {isEmptyString} from '../../../../kernel/utils' +import {MediaPreview} from '../../../Portfolio/common/MediaPreview/MediaPreview' +import {useSelectedWallet} from '../../../WalletManager/context/SelectedWalletContext' type Params = NftRoutes['nft-details'] diff --git a/apps/wallet-mobile/src/Nfts/Nfts.stories.tsx b/apps/wallet-mobile/src/features/Nfts/useCases/Nfts.stories.tsx similarity index 94% rename from apps/wallet-mobile/src/Nfts/Nfts.stories.tsx rename to apps/wallet-mobile/src/features/Nfts/useCases/Nfts.stories.tsx index 06c8e60b2c..25844b1a0f 100644 --- a/apps/wallet-mobile/src/Nfts/Nfts.stories.tsx +++ b/apps/wallet-mobile/src/features/Nfts/useCases/Nfts.stories.tsx @@ -1,10 +1,10 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' -import {QueryProvider} from '../../.storybook/decorators' -import {SelectedWalletProvider} from '../features/WalletManager/context/SelectedWalletContext' -import {SearchProvider} from '../Search/SearchContext' -import {mocks} from '../yoroi-wallets/mocks' +import {QueryProvider} from '../../../../.storybook/decorators' +import {mocks} from '../../../yoroi-wallets/mocks' +import {SearchProvider} from '../../Search/SearchContext' +import {SelectedWalletProvider} from '../../WalletManager/context/SelectedWalletContext' import {Nfts} from './Nfts' storiesOf('NFT/Gallery', module) diff --git a/apps/wallet-mobile/src/Nfts/Nfts.tsx b/apps/wallet-mobile/src/features/Nfts/useCases/Nfts.tsx similarity index 90% rename from apps/wallet-mobile/src/Nfts/Nfts.tsx rename to apps/wallet-mobile/src/features/Nfts/useCases/Nfts.tsx index 9a89700896..b599d12c4f 100644 --- a/apps/wallet-mobile/src/Nfts/Nfts.tsx +++ b/apps/wallet-mobile/src/features/Nfts/useCases/Nfts.tsx @@ -7,14 +7,14 @@ import {defineMessages, useIntl} from 'react-intl' import {ScrollView, StyleSheet, Text, View} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' -import {Spacer} from '../components' -import {usePortfolioBalances} from '../features/Portfolio/common/hooks/usePortfolioBalances' -import {MediaGallery} from '../features/Portfolio/common/MediaGallery/MediaGallery' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' -import {useMetrics} from '../kernel/metrics/metricsManager' -import {useSearch, useSearchOnNavBar} from '../Search/SearchContext' -import {useTrackNftGallerySearchActivated} from './filterNfts' -import {useNavigateTo} from './navigation' +import {Spacer} from '../../../components' +import {useMetrics} from '../../../kernel/metrics/metricsManager' +import {usePortfolioBalances} from '../../Portfolio/common/hooks/usePortfolioBalances' +import {MediaGallery} from '../../Portfolio/common/MediaGallery/MediaGallery' +import {useSearch, useSearchOnNavBar} from '../../Search/SearchContext' +import {useSelectedWallet} from '../../WalletManager/context/SelectedWalletContext' +import {useTrackNftGallerySearchActivated} from '../common/filterNfts' +import {useNavigateTo} from '../common/navigation' import {NoNftsScreen} from './NoNftsScreen' export const Nfts = () => { diff --git a/apps/wallet-mobile/src/Nfts/NoNftsScreen.stories.tsx b/apps/wallet-mobile/src/features/Nfts/useCases/NoNftsScreen.stories.tsx similarity index 75% rename from apps/wallet-mobile/src/Nfts/NoNftsScreen.stories.tsx rename to apps/wallet-mobile/src/features/Nfts/useCases/NoNftsScreen.stories.tsx index 97fe9f975e..1fb4e99a50 100644 --- a/apps/wallet-mobile/src/Nfts/NoNftsScreen.stories.tsx +++ b/apps/wallet-mobile/src/features/Nfts/useCases/NoNftsScreen.stories.tsx @@ -2,10 +2,10 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' import {Text} from 'react-native' -import {QueryProvider} from '../../.storybook/decorators' -import {SelectedWalletProvider} from '../features/WalletManager/context/SelectedWalletContext' -import {SearchProvider} from '../Search/SearchContext' -import {mocks} from '../yoroi-wallets/mocks' +import {QueryProvider} from '../../../../.storybook/decorators' +import {mocks} from '../../../yoroi-wallets/mocks' +import {SearchProvider} from '../../Search/SearchContext' +import {SelectedWalletProvider} from '../../WalletManager/context/SelectedWalletContext' import {NoNftsScreen} from './NoNftsScreen' storiesOf('NFT/No Nfts Screen', module) diff --git a/apps/wallet-mobile/src/Nfts/NoNftsScreen.tsx b/apps/wallet-mobile/src/features/Nfts/useCases/NoNftsScreen.tsx similarity index 91% rename from apps/wallet-mobile/src/Nfts/NoNftsScreen.tsx rename to apps/wallet-mobile/src/features/Nfts/useCases/NoNftsScreen.tsx index e150fb9a14..a133516c68 100644 --- a/apps/wallet-mobile/src/Nfts/NoNftsScreen.tsx +++ b/apps/wallet-mobile/src/features/Nfts/useCases/NoNftsScreen.tsx @@ -2,8 +2,8 @@ import {useTheme} from '@yoroi/theme' import React, {ReactNode} from 'react' import {Image, StyleSheet, Text, View} from 'react-native' -import noNftsImage from '../assets/img/no-nft.png' -import {Spacer} from '../components' +import noNftsImage from '../../../assets/img/no-nft.png' +import {Spacer} from '../../../components' export function NoNftsScreen({heading, message}: {heading?: ReactNode; message: ReactNode}) { const styles = useStyles() diff --git a/apps/wallet-mobile/src/features/Portfolio/common/MediaDetails/MediaDetails.tsx b/apps/wallet-mobile/src/features/Portfolio/common/MediaDetails/MediaDetails.tsx index 8fbe269397..d2b2da0570 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/MediaDetails/MediaDetails.tsx +++ b/apps/wallet-mobile/src/features/Portfolio/common/MediaDetails/MediaDetails.tsx @@ -12,7 +12,7 @@ import {CopyButton, FadeIn, Spacer, Text} from '../../../../components' import {Tab, TabPanel, TabPanels, Tabs} from '../../../../components/Tabs' import {useMetrics} from '../../../../kernel/metrics/metricsManager' import {NftRoutes} from '../../../../kernel/navigation' -import {useNavigateTo} from '../../../../Nfts/navigation' +import {useNavigateTo} from '../../../Nfts/common/navigation' import {useSelectedWallet} from '../../../WalletManager/context/SelectedWalletContext' import {useWalletManager} from '../../../WalletManager/context/WalletManagerContext' import {MediaPreview} from '../MediaPreview/MediaPreview' diff --git a/apps/wallet-mobile/src/features/Portfolio/common/MediaGallery/MediaGallery.tsx b/apps/wallet-mobile/src/features/Portfolio/common/MediaGallery/MediaGallery.tsx index 93158db5cc..f815039102 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/MediaGallery/MediaGallery.tsx +++ b/apps/wallet-mobile/src/features/Portfolio/common/MediaGallery/MediaGallery.tsx @@ -1,6 +1,7 @@ import {FlashList, FlashListProps} from '@shopify/flash-list' +import {useTheme} from '@yoroi/theme' import {Balance, Portfolio} from '@yoroi/types' -import React from 'react' +import * as React from 'react' import {StyleSheet, Text, TouchableOpacity, useWindowDimensions, View} from 'react-native' import {Spacer} from '../../../../components/Spacer/Spacer' @@ -49,6 +50,7 @@ export const MediaGallery = ({ } function Media({info, imageSize}: {info: Portfolio.Token.Info; imageSize: number}) { + const styles = useStyles() return ( @@ -121,18 +123,23 @@ function GalleryList({ ) } -const styles = StyleSheet.create({ - imageWrapper: { - position: 'relative', - overflow: 'hidden', - borderRadius: 8, - }, - image: { - borderRadius: 8, - overlayColor: '#FFFFFF', - }, - text: { - fontSize: 14, - lineHeight: textHeight, - }, -}) +const useStyles = () => { + const {atoms, color} = useTheme() + const styles = StyleSheet.create({ + imageWrapper: { + position: 'relative', + overflow: 'hidden', + borderRadius: 8, + }, + image: { + borderRadius: 8, + overlayColor: '#FFFFFF', + }, + text: { + ...atoms.body_3_sm_medium, + color: color.gray_c600, + lineHeight: textHeight, + }, + }) + return styles +} diff --git a/apps/wallet-mobile/src/features/Portfolio/common/TokenAmountItem/TokenInfoIcon.tsx b/apps/wallet-mobile/src/features/Portfolio/common/TokenAmountItem/TokenInfoIcon.tsx index 795eb9015d..17eb3a8fba 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/TokenAmountItem/TokenInfoIcon.tsx +++ b/apps/wallet-mobile/src/features/Portfolio/common/TokenAmountItem/TokenInfoIcon.tsx @@ -6,7 +6,7 @@ import React from 'react' import {StyleSheet, View} from 'react-native' import {Icon} from '../../../../components/Icon' -import {isEmptyString} from '../../../../utils' +import {isEmptyString} from '../../../../kernel/utils' import {useSelectedWallet} from '../../../WalletManager/context/SelectedWalletContext' type TokenInfoIconProps = { diff --git a/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioTokenManager.ts b/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioTokenManager.ts index 170193f50d..b0e03b5c79 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioTokenManager.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioTokenManager.ts @@ -2,11 +2,6 @@ import {mountMMKVStorage, observableStorageMaker} from '@yoroi/common' import {portfolioApiMaker, portfolioTokenManagerMaker, portfolioTokenStorageMaker} from '@yoroi/portfolio' import {Chain, Portfolio} from '@yoroi/types' import {freeze} from 'immer' -import * as React from 'react' - -export const usePortfolioTokenManager = ({network}: {network: Chain.SupportedNetworks}) => { - return React.useMemo(() => buildPortfolioTokenManager({network}), [network]) -} export const buildPortfolioTokenManager = ({network}: {network: Chain.SupportedNetworks}) => { const rootStorage = mountMMKVStorage({path: '/', id: `${network}.token-manager`}) @@ -17,6 +12,8 @@ export const buildPortfolioTokenManager = ({network}: {network: Chain.SupportedN }) const api = portfolioApiMaker({ network, + maxConcurrentRequests: 4, + maxIdsPerRequest: 80, }) const tokenManager = portfolioTokenManagerMaker({ @@ -33,10 +30,6 @@ export const buildPortfolioTokenManagers = () => { const preprodPortfolioTokenManager = buildPortfolioTokenManager({network: Chain.Network.Preprod}) const sanchoPortfolioTokenManager = buildPortfolioTokenManager({network: Chain.Network.Sancho}) - mainnetPortfolioTokenManager.tokenManager.hydrate({sourceId: 'initial'}) - preprodPortfolioTokenManager.tokenManager.hydrate({sourceId: 'initial'}) - sanchoPortfolioTokenManager.tokenManager.hydrate({sourceId: 'initial'}) - const tokenManagers: Readonly<{ [Chain.Network.Mainnet]: Portfolio.Manager.Token [Chain.Network.Preprod]: Portfolio.Manager.Token diff --git a/apps/wallet-mobile/src/features/Receive/common/AddressDetailCard/AddressDetailCard.tsx b/apps/wallet-mobile/src/features/Receive/common/AddressDetailCard/AddressDetailCard.tsx index 33d4adcb1d..67418dcdea 100644 --- a/apps/wallet-mobile/src/features/Receive/common/AddressDetailCard/AddressDetailCard.tsx +++ b/apps/wallet-mobile/src/features/Receive/common/AddressDetailCard/AddressDetailCard.tsx @@ -4,8 +4,8 @@ import {StyleSheet, useWindowDimensions, View} from 'react-native' import Animated, {Layout} from 'react-native-reanimated' import {Spacer} from '../../../../components' -import {useCopy} from '../../../../legacy/useCopy' -import {isEmptyString} from '../../../../utils/utils' +import {useCopy} from '../../../../hooks/useCopy' +import {isEmptyString} from '../../../../kernel/utils' import {useKeyHashes} from '../../../../yoroi-wallets/hooks' import {useReceive} from '../ReceiveProvider' import {ShareDetailsCard} from '../ShareDetailsCard/ShareDetailsCard' diff --git a/apps/wallet-mobile/src/features/Receive/common/AddressModal/AddressModal.tsx b/apps/wallet-mobile/src/features/Receive/common/AddressModal/AddressModal.tsx index d8984b3168..0bfd3ccdeb 100644 --- a/apps/wallet-mobile/src/features/Receive/common/AddressModal/AddressModal.tsx +++ b/apps/wallet-mobile/src/features/Receive/common/AddressModal/AddressModal.tsx @@ -5,7 +5,7 @@ import {StyleSheet, View, ViewProps} from 'react-native' import QRCode from 'react-native-qrcode-svg' import {CopyButton, Spacer, Text} from '../../../../components' -import {Modal} from '../../../../legacy/Modal' +import {Modal} from '../../../../components/legacy/Modal/Modal' import {AddressType, formatPath} from '../../../../yoroi-wallets/cardano/formatPath/formatPath' import {useKeyHashes} from '../../../../yoroi-wallets/hooks' import {useSelectedWallet} from '../../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Receive/common/ShareDetailsCard/ShareDetailsCard.tsx b/apps/wallet-mobile/src/features/Receive/common/ShareDetailsCard/ShareDetailsCard.tsx index 074f82d39f..b4ca0a1994 100644 --- a/apps/wallet-mobile/src/features/Receive/common/ShareDetailsCard/ShareDetailsCard.tsx +++ b/apps/wallet-mobile/src/features/Receive/common/ShareDetailsCard/ShareDetailsCard.tsx @@ -5,7 +5,7 @@ import LinearGradient from 'react-native-linear-gradient' import {CopyButton, Text} from '../../../../components' import {useMetrics} from '../../../../kernel/metrics/metricsManager' -import {isEmptyString} from '../../../../utils/utils' +import {isEmptyString} from '../../../../kernel/utils' import {useStrings} from '../useStrings' import {useLastDateAddressUsed} from './useLastDateAddressUsed' diff --git a/apps/wallet-mobile/src/features/Receive/common/SmallAddressCard/SmallAddressCard.tsx b/apps/wallet-mobile/src/features/Receive/common/SmallAddressCard/SmallAddressCard.tsx index 39eca8ca69..85a2a5845d 100644 --- a/apps/wallet-mobile/src/features/Receive/common/SmallAddressCard/SmallAddressCard.tsx +++ b/apps/wallet-mobile/src/features/Receive/common/SmallAddressCard/SmallAddressCard.tsx @@ -4,8 +4,8 @@ import {StyleSheet, Text, TouchableOpacity, View} from 'react-native' import LinearGradient from 'react-native-linear-gradient' import Animated, {FadeInDown, FadeInUp, FadeOut, FadeOutDown, Layout} from 'react-native-reanimated' -import {useCopy} from '../../../../../src/legacy/useCopy' import {Spacer} from '../../../../components' +import {useCopy} from '../../../../hooks/useCopy' import {SkeletonSmallCardAddress} from '../SkeletonAddressDetail/SkeletonAddressDetail' import {useStrings} from '../useStrings' diff --git a/apps/wallet-mobile/src/features/Receive/useCases/DescribeSelectedAddressScreen.tsx b/apps/wallet-mobile/src/features/Receive/useCases/DescribeSelectedAddressScreen.tsx index 0cff534ed7..d62e2cf93c 100644 --- a/apps/wallet-mobile/src/features/Receive/useCases/DescribeSelectedAddressScreen.tsx +++ b/apps/wallet-mobile/src/features/Receive/useCases/DescribeSelectedAddressScreen.tsx @@ -6,9 +6,9 @@ import {SafeAreaView} from 'react-native-safe-area-context' import Icon from '../../../assets/img/copy.png' import {Button, Spacer, useModal} from '../../../components' +import {useCopy} from '../../../hooks/useCopy' import {useMetrics} from '../../../kernel/metrics/metricsManager' -import {useCopy} from '../../../legacy/useCopy' -import {isEmptyString} from '../../../utils' +import {isEmptyString} from '../../../kernel/utils' import {AddressMode} from '../../WalletManager/common/types' import {useAddressModeManager} from '../../WalletManager/common/useAddressModeManager' import {AddressDetailCard} from '../common/AddressDetailCard/AddressDetailCard' diff --git a/apps/wallet-mobile/src/features/Receive/useCases/RequestSpecificAmountScreen.tsx b/apps/wallet-mobile/src/features/Receive/useCases/RequestSpecificAmountScreen.tsx index 43554962f3..6b8096645f 100644 --- a/apps/wallet-mobile/src/features/Receive/useCases/RequestSpecificAmountScreen.tsx +++ b/apps/wallet-mobile/src/features/Receive/useCases/RequestSpecificAmountScreen.tsx @@ -15,9 +15,9 @@ import {SafeAreaView} from 'react-native-safe-area-context' import {Button, KeyboardAvoidingView, Spacer, TextInput, useModal} from '../../../components' import {ScrollView, useScrollView} from '../../../components/ScrollView/ScrollView' +import {useCopy} from '../../../hooks/useCopy' import {useMetrics} from '../../../kernel/metrics/metricsManager' -import {useCopy} from '../../../legacy/useCopy' -import {isEmptyString} from '../../../utils' +import {isEmptyString} from '../../../kernel/utils' import {editedFormatter} from '../../../yoroi-wallets/utils' import {useSelectedWallet} from '../../WalletManager/context/SelectedWalletContext' import {useReceive} from '../common/ReceiveProvider' diff --git a/apps/wallet-mobile/src/features/Scan/useCases/ScanCodeScreen.tsx b/apps/wallet-mobile/src/features/Scan/useCases/ScanCodeScreen.tsx index 4faf865ec5..6c6f56f14a 100644 --- a/apps/wallet-mobile/src/features/Scan/useCases/ScanCodeScreen.tsx +++ b/apps/wallet-mobile/src/features/Scan/useCases/ScanCodeScreen.tsx @@ -5,8 +5,8 @@ import {Alert, AlertButton} from 'react-native' import {z} from 'zod' import {CameraCodeScanner, CameraCodeScannerMethods} from '../../../components/CameraCodeScanner/CameraCodeScanner' +import * as feedback from '../../../kernel/haptics/feedback' import {ScanRoutes, useParams} from '../../../kernel/navigation' -import * as feedback from '../../../utils/feedback' import {parseScanAction} from '../common/parsers' import {useNavigateTo} from '../common/useNavigateTo' import {useScanErrorResolver} from '../common/useScanErrorResolver' diff --git a/apps/wallet-mobile/src/Search/SearchContext.tsx b/apps/wallet-mobile/src/features/Search/SearchContext.tsx similarity index 98% rename from apps/wallet-mobile/src/Search/SearchContext.tsx rename to apps/wallet-mobile/src/features/Search/SearchContext.tsx index b9bdde7d78..5fe038ddbf 100644 --- a/apps/wallet-mobile/src/Search/SearchContext.tsx +++ b/apps/wallet-mobile/src/features/Search/SearchContext.tsx @@ -5,8 +5,8 @@ import {produce} from 'immer' import React, {createContext, ReactNode, useCallback, useContext, useReducer} from 'react' import {TextInput, TouchableOpacity, TouchableOpacityProps} from 'react-native' -import {Icon} from '../components/Icon' -import {defaultStackNavigationOptions} from '../kernel/navigation' +import {Icon} from '../../components/Icon' +import {defaultStackNavigationOptions} from '../../kernel/navigation' type SearchState = { search: string diff --git a/apps/wallet-mobile/src/features/Send/common/useSendReceiver.tsx b/apps/wallet-mobile/src/features/Send/common/useSendReceiver.tsx index 63c6635ab9..fd8f9b30f1 100644 --- a/apps/wallet-mobile/src/features/Send/common/useSendReceiver.tsx +++ b/apps/wallet-mobile/src/features/Send/common/useSendReceiver.tsx @@ -4,8 +4,6 @@ import {Resolver} from '@yoroi/types' import * as React from 'react' import {useQueryClient} from 'react-query' -import {debounceMaker} from '../../../utils/debounceMaker' - export const useSendReceiver = () => { const queryClient = useQueryClient() @@ -87,3 +85,26 @@ export const useSendReceiver = () => { receiverError, } } + +const debounceMaker = unknown>(callback: T, delay: number) => { + let timeoutId: NodeJS.Timeout | null = null + + const clear = () => { + if (timeoutId !== null) { + clearTimeout(timeoutId) + } + } + + const call = (...args: Parameters) => { + clear() + + timeoutId = setTimeout(() => { + callback(...args) + }, delay) + } + + return { + clear, + call, + } as const +} diff --git a/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/BalanceAfter.tsx b/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/BalanceAfter.tsx index 8dc4f83f46..b12e1ebf91 100644 --- a/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/BalanceAfter.tsx +++ b/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/BalanceAfter.tsx @@ -3,9 +3,9 @@ import {useIntl} from 'react-intl' import {Text} from '../../../../../components/Text' import {txLabels} from '../../../../../kernel/i18n/global-messages' -import {formatTokenWithSymbol} from '../../../../../legacy/format' import {useBalances} from '../../../../../yoroi-wallets/hooks' import {YoroiUnsignedTx} from '../../../../../yoroi-wallets/types/yoroi' +import {formatTokenWithSymbol} from '../../../../../yoroi-wallets/utils/format' import {Amounts} from '../../../../../yoroi-wallets/utils/utils' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/CurrentBalance.tsx b/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/CurrentBalance.tsx index f085bac44b..31c6869e0b 100644 --- a/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/CurrentBalance.tsx +++ b/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/CurrentBalance.tsx @@ -3,8 +3,8 @@ import * as React from 'react' import {StyleSheet, View} from 'react-native' import {Text} from '../../../../../components/Text' -import {formatTokenWithText} from '../../../../../legacy/format' import {useBalances} from '../../../../../yoroi-wallets/hooks' +import {formatTokenWithText} from '../../../../../yoroi-wallets/utils/format' import {Amounts} from '../../../../../yoroi-wallets/utils/utils' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' import {useStrings} from '../../../common/strings' diff --git a/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/Fees.tsx b/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/Fees.tsx index ac3fca7a00..6dbfca31d4 100644 --- a/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/Fees.tsx +++ b/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/Fees.tsx @@ -3,8 +3,8 @@ import {useIntl} from 'react-intl' import {Text} from '../../../../../components/Text' import {txLabels} from '../../../../../kernel/i18n/global-messages' -import {formatTokenWithSymbol} from '../../../../../legacy/format' import {YoroiUnsignedTx} from '../../../../../yoroi-wallets/types/yoroi' +import {formatTokenWithSymbol} from '../../../../../yoroi-wallets/utils/format' import {Amounts} from '../../../../../yoroi-wallets/utils/utils' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/PrimaryTotal.tsx b/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/PrimaryTotal.tsx index 3154c6568b..2df3b19a9a 100644 --- a/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/PrimaryTotal.tsx +++ b/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/PrimaryTotal.tsx @@ -5,8 +5,8 @@ import {StyleSheet} from 'react-native' import {Text} from '../../../../../components/Text' import globalMessages from '../../../../../kernel/i18n/global-messages' -import {formatTokenWithSymbol} from '../../../../../legacy/format' import {YoroiUnsignedTx} from '../../../../../yoroi-wallets/types/yoroi' +import {formatTokenWithSymbol} from '../../../../../yoroi-wallets/utils/format' import {Amounts} from '../../../../../yoroi-wallets/utils/utils' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/SecondaryTotals.tsx b/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/SecondaryTotals.tsx index 7c194bac3b..20693f886f 100644 --- a/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/SecondaryTotals.tsx +++ b/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/Summary/SecondaryTotals.tsx @@ -5,10 +5,10 @@ import {StyleSheet, View} from 'react-native' import {Boundary} from '../../../../../components/Boundary/Boundary' import {Text} from '../../../../../components/Text' -import {formatTokenWithText} from '../../../../../legacy/format' import {YoroiWallet} from '../../../../../yoroi-wallets/cardano/types' import {useToken} from '../../../../../yoroi-wallets/hooks' import {YoroiUnsignedTx} from '../../../../../yoroi-wallets/types/yoroi' +import {formatTokenWithText} from '../../../../../yoroi-wallets/utils/format' import {Amounts, Quantities} from '../../../../../yoroi-wallets/utils/utils' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/AddToken/SelectTokenFromListScreen.stories.tsx b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/AddToken/SelectTokenFromListScreen.stories.tsx index 58dd753793..24d8667bd0 100644 --- a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/AddToken/SelectTokenFromListScreen.stories.tsx +++ b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/AddToken/SelectTokenFromListScreen.stories.tsx @@ -2,8 +2,8 @@ import {storiesOf} from '@storybook/react-native' import {TransferProvider} from '@yoroi/transfer' import React from 'react' -import {SearchProvider} from '../../../../../Search/SearchContext' import {mocks} from '../../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../WalletManager/context/SelectedWalletContext' import {SelectTokenFromListScreen} from './SelectTokenFromListScreen' diff --git a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/AddToken/SelectTokenFromListScreen.tsx b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/AddToken/SelectTokenFromListScreen.tsx index 3b474f30f1..4ee294e230 100644 --- a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/AddToken/SelectTokenFromListScreen.tsx +++ b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/AddToken/SelectTokenFromListScreen.tsx @@ -10,10 +10,10 @@ import {Alert, StyleSheet, TouchableOpacity, View} from 'react-native' import {Spacer, Text} from '../../../../../components' import {useMetrics} from '../../../../../kernel/metrics/metricsManager' import {TxHistoryRouteNavigation} from '../../../../../kernel/navigation' -import {useSearch, useSearchOnNavBar} from '../../../../../Search/SearchContext' import {usePortfolioBalances} from '../../../../Portfolio/common/hooks/usePortfolioBalances' import {MediaGallery} from '../../../../Portfolio/common/MediaGallery/MediaGallery' import {TokenAmountItem} from '../../../../Portfolio/common/TokenAmountItem/TokenAmountItem' +import {useSearch, useSearchOnNavBar} from '../../../../Search/SearchContext' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' import {limitOfSecondaryAmountsPerTx} from '../../../common/constants' import {useOverridePreviousSendTxRoute} from '../../../common/navigation' diff --git a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.stories.tsx b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.stories.tsx index 076e8a768d..2310f2f870 100644 --- a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.stories.tsx +++ b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.stories.tsx @@ -2,8 +2,8 @@ import {storiesOf} from '@storybook/react-native' import {TransferProvider} from '@yoroi/transfer' import React from 'react' -import {SearchProvider} from '../../../../Search/SearchContext' import {mocks} from '../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../WalletManager/context/SelectedWalletContext' import {ListAmountsToSendScreen} from './ListAmountsToSendScreen' diff --git a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.tsx b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.tsx index 040721d4a5..01aae180bc 100644 --- a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.tsx +++ b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.tsx @@ -14,9 +14,9 @@ import {Boundary, Button, Icon, Spacer} from '../../../../components' import globalMessages from '../../../../kernel/i18n/global-messages' import {assetsToSendProperties} from '../../../../kernel/metrics/helpers' import {useMetrics} from '../../../../kernel/metrics/metricsManager' -import {useSearch} from '../../../../Search/SearchContext' import {YoroiEntry} from '../../../../yoroi-wallets/types' import {TokenAmountItem} from '../../../Portfolio/common/TokenAmountItem/TokenAmountItem' +import {useSearch} from '../../../Search/SearchContext' import {useSelectedWallet} from '../../../WalletManager/context/SelectedWalletContext' import {useNavigateTo, useOverridePreviousSendTxRoute} from '../../common/navigation' import {toYoroiEntry} from '../../common/toYoroiEntry' diff --git a/apps/wallet-mobile/src/features/Settings/ChangeWalletName/ChangeWalletName.tsx b/apps/wallet-mobile/src/features/Settings/ChangeWalletName/ChangeWalletName.tsx index ea07f451d3..759b6c291d 100644 --- a/apps/wallet-mobile/src/features/Settings/ChangeWalletName/ChangeWalletName.tsx +++ b/apps/wallet-mobile/src/features/Settings/ChangeWalletName/ChangeWalletName.tsx @@ -7,7 +7,7 @@ import {SafeAreaView} from 'react-native-safe-area-context' import {Button, KeyboardAvoidingView, Spacer, TextInput} from '../../../components' import globalMessages from '../../../kernel/i18n/global-messages' -import {isEmptyString} from '../../../utils/utils' +import {isEmptyString} from '../../../kernel/utils' import {useChangeWalletName, useWalletName, useWalletNames} from '../../../yoroi-wallets/hooks' import {getWalletNameError, validateWalletName} from '../../../yoroi-wallets/utils/validators' import {useSelectedWallet} from '../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Settings/Currency/CurrencyContext.tsx b/apps/wallet-mobile/src/features/Settings/Currency/CurrencyContext.tsx index 53c63c374b..ba9bdf146d 100644 --- a/apps/wallet-mobile/src/features/Settings/Currency/CurrencyContext.tsx +++ b/apps/wallet-mobile/src/features/Settings/Currency/CurrencyContext.tsx @@ -2,8 +2,9 @@ import {parseSafe, useAsyncStorage} from '@yoroi/common' import React from 'react' import {useMutation, UseMutationOptions, useQuery, useQueryClient} from 'react-query' -import {isEmptyString} from '../../../utils' -import {ConfigCurrencies, configCurrencies, CurrencySymbol, supportedCurrencies} from '../../../yoroi-wallets/types' +import {configCurrencies, supportedCurrencies} from '../../../kernel/constants' +import {isEmptyString} from '../../../kernel/utils' +import {ConfigCurrencies, CurrencySymbol} from '../../../yoroi-wallets/types' const CurrencyContext = React.createContext(undefined) export const CurrencyProvider = ({children}: {children: React.ReactNode}) => { diff --git a/apps/wallet-mobile/src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.tsx b/apps/wallet-mobile/src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.tsx index 27d6c6a3ef..8b7439e3b7 100644 --- a/apps/wallet-mobile/src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.tsx +++ b/apps/wallet-mobile/src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.tsx @@ -9,7 +9,7 @@ import {Button, KeyboardAvoidingView, Text, TextInput} from '../../../components import {LoadingOverlay} from '../../../components/LoadingOverlay' import {showErrorDialog} from '../../../kernel/dialogs' import {errorMessages} from '../../../kernel/i18n/global-messages' -import {isEmptyString} from '../../../utils/utils' +import {isEmptyString} from '../../../kernel/utils' import {WrongPassword} from '../../../yoroi-wallets/cardano/errors' import {useEnableEasyConfirmation} from '../../../yoroi-wallets/hooks' import {useSelectedWallet} from '../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/BalanceAfter.tsx b/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/BalanceAfter.tsx index 09613b3749..b02efe2635 100644 --- a/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/BalanceAfter.tsx +++ b/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/BalanceAfter.tsx @@ -3,9 +3,9 @@ import {useIntl} from 'react-intl' import {Text} from '../../../../../components/Text' import {txLabels} from '../../../../../kernel/i18n/global-messages' -import {formatTokenWithSymbol} from '../../../../../legacy/format' import {useBalances} from '../../../../../yoroi-wallets/hooks' import {YoroiUnsignedTx} from '../../../../../yoroi-wallets/types/yoroi' +import {formatTokenWithSymbol} from '../../../../../yoroi-wallets/utils/format' import {Amounts} from '../../../../../yoroi-wallets/utils/utils' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/CurrentBalance.tsx b/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/CurrentBalance.tsx index f8b0d73c14..c62cfcbcfa 100644 --- a/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/CurrentBalance.tsx +++ b/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/CurrentBalance.tsx @@ -3,8 +3,8 @@ import * as React from 'react' import {StyleSheet, View} from 'react-native' import {Text} from '../../../../../components/Text' -import {formatTokenWithText} from '../../../../../legacy/format' import {useBalances} from '../../../../../yoroi-wallets/hooks' +import {formatTokenWithText} from '../../../../../yoroi-wallets/utils/format' import {Amounts} from '../../../../../yoroi-wallets/utils/utils' import {useStrings} from '../../../../Send/common/strings' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/Fees.tsx b/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/Fees.tsx index ac3fca7a00..6dbfca31d4 100644 --- a/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/Fees.tsx +++ b/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/Fees.tsx @@ -3,8 +3,8 @@ import {useIntl} from 'react-intl' import {Text} from '../../../../../components/Text' import {txLabels} from '../../../../../kernel/i18n/global-messages' -import {formatTokenWithSymbol} from '../../../../../legacy/format' import {YoroiUnsignedTx} from '../../../../../yoroi-wallets/types/yoroi' +import {formatTokenWithSymbol} from '../../../../../yoroi-wallets/utils/format' import {Amounts} from '../../../../../yoroi-wallets/utils/utils' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/PrimaryTotal.tsx b/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/PrimaryTotal.tsx index f10442a432..d8cf9b4922 100644 --- a/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/PrimaryTotal.tsx +++ b/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/PrimaryTotal.tsx @@ -5,8 +5,8 @@ import {StyleSheet, View} from 'react-native' import {Text} from '../../../../../components/Text' import globalMessages from '../../../../../kernel/i18n/global-messages' -import {formatTokenWithSymbol} from '../../../../../legacy/format' import {YoroiUnsignedTx} from '../../../../../yoroi-wallets/types/yoroi' +import {formatTokenWithSymbol} from '../../../../../yoroi-wallets/utils/format' import {Amounts} from '../../../../../yoroi-wallets/utils/utils' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/SecondaryTotals.tsx b/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/SecondaryTotals.tsx index c128433235..a235bdfa6a 100644 --- a/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/SecondaryTotals.tsx +++ b/apps/wallet-mobile/src/features/Settings/ManageCollateral/ConfirmTx/Summary/SecondaryTotals.tsx @@ -5,10 +5,10 @@ import {StyleSheet, View} from 'react-native' import {Boundary} from '../../../../../components/Boundary/Boundary' import {Text} from '../../../../../components/Text' -import {formatTokenWithText} from '../../../../../legacy/format' import {YoroiWallet} from '../../../../../yoroi-wallets/cardano/types' import {useToken} from '../../../../../yoroi-wallets/hooks' import {YoroiUnsignedTx} from '../../../../../yoroi-wallets/types/yoroi' +import {formatTokenWithText} from '../../../../../yoroi-wallets/utils/format' import {Amounts, Quantities} from '../../../../../yoroi-wallets/utils/utils' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Settings/SettingsItems.tsx b/apps/wallet-mobile/src/features/Settings/SettingsItems.tsx index 2c36d64b23..cabb2516fd 100644 --- a/apps/wallet-mobile/src/features/Settings/SettingsItems.tsx +++ b/apps/wallet-mobile/src/features/Settings/SettingsItems.tsx @@ -4,8 +4,8 @@ import React, {ReactElement} from 'react' import {StyleSheet, TouchableOpacity, TouchableOpacityProps, View} from 'react-native' import {Hr, Icon, Spacer, Text} from '../../components' -import {formatTokenWithSymbol} from '../../legacy/format' import {useCollateralInfo} from '../../yoroi-wallets/cardano/utxoManager/useCollateralInfo' +import {formatTokenWithSymbol} from '../../yoroi-wallets/utils/format' import {useSelectedWallet} from '../WalletManager/context/SelectedWalletContext' const Touchable = (props: TouchableOpacityProps) => diff --git a/apps/wallet-mobile/src/features/SetupWallet/common/TextInput/TextInput.tsx b/apps/wallet-mobile/src/features/SetupWallet/common/TextInput/TextInput.tsx index a7bdc918d3..b21921f51c 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/common/TextInput/TextInput.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/common/TextInput/TextInput.tsx @@ -5,7 +5,7 @@ import {StyleSheet, TextInput as RNTextInput, TextInputProps as RNTextInputProps import LinearGradient from 'react-native-linear-gradient' import {HelperText as HelperTextRNP, TextInput as RNPTextInput} from 'react-native-paper' -import {isEmptyString} from '../../../../utils/utils' +import {isEmptyString} from '../../../../kernel/utils' export type TextInputProps = RNTextInputProps & Omit, 'theme'> & { diff --git a/apps/wallet-mobile/src/features/SetupWallet/illustrations/WalletChecksum.tsx b/apps/wallet-mobile/src/features/SetupWallet/illustrations/WalletChecksum.tsx index 47da739187..7c9606e6fd 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/illustrations/WalletChecksum.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/illustrations/WalletChecksum.tsx @@ -6,7 +6,7 @@ import React from 'react' import {StyleSheet, View, ViewStyle} from 'react-native' import tinycolor from 'tinycolor2' -import {isEmptyString} from '../../../utils/utils' +import {isEmptyString} from '../../../kernel/utils' const mkcolor = (primary: string, secondary: string, spots: string) => ({primary, secondary, spots}) const COLORS = [ diff --git a/apps/wallet-mobile/src/features/SetupWallet/legacy/ConnectNanoX/ConnectNanoXScreen.tsx b/apps/wallet-mobile/src/features/SetupWallet/legacy/ConnectNanoX/ConnectNanoXScreen.tsx index 9b0bf90a67..e0e9e6c134 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/legacy/ConnectNanoX/ConnectNanoXScreen.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/legacy/ConnectNanoX/ConnectNanoXScreen.tsx @@ -7,11 +7,11 @@ import {StyleSheet} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' import {ProgressStep} from '../../../../components' -import {LedgerConnect} from '../../../../HW' import {showErrorDialog} from '../../../../kernel/dialogs' import {errorMessages} from '../../../../kernel/i18n/global-messages' import LocalizableError from '../../../../kernel/i18n/LocalizableError' import {WalletInitRouteNavigation} from '../../../../kernel/navigation' +import {LedgerConnect} from '../../../../legacy/HW' import {getHWDeviceInfo} from '../../../../yoroi-wallets/cardano/hw' import {DeviceId, DeviceObj, HWDeviceInfo} from '../../../../yoroi-wallets/hw' import {Device, NetworkId, WalletImplementationId} from '../../../../yoroi-wallets/types' diff --git a/apps/wallet-mobile/src/features/SetupWallet/legacy/SaveReadOnlyWallet/SaveReadOnlyWalletScreen.tsx b/apps/wallet-mobile/src/features/SetupWallet/legacy/SaveReadOnlyWallet/SaveReadOnlyWalletScreen.tsx index 1782b5c522..6fd8e14777 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/legacy/SaveReadOnlyWallet/SaveReadOnlyWalletScreen.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/legacy/SaveReadOnlyWallet/SaveReadOnlyWalletScreen.tsx @@ -10,7 +10,7 @@ import {showErrorDialog} from '../../../../kernel/dialogs' import {errorMessages} from '../../../../kernel/i18n/global-messages' import {useMetrics} from '../../../../kernel/metrics/metricsManager' import {useWalletNavigation} from '../../../../kernel/navigation' -import {isEmptyString} from '../../../../utils/utils' +import {isEmptyString} from '../../../../kernel/utils' import {NUMBERS} from '../../../../yoroi-wallets/cardano/numbers' import {useCreateBip44Wallet, usePlate} from '../../../../yoroi-wallets/hooks' import {NetworkId, WalletImplementationId} from '../../../../yoroi-wallets/types' diff --git a/apps/wallet-mobile/src/features/SetupWallet/legacy/WalletForm.tsx b/apps/wallet-mobile/src/features/SetupWallet/legacy/WalletForm.tsx index de3e19e06e..b3c3705f8c 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/legacy/WalletForm.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/legacy/WalletForm.tsx @@ -7,7 +7,7 @@ import {ScrollView, StyleSheet, TextInput as RNTextInput, View, ViewProps} from import {Button, Checkmark, KeyboardAvoidingView, Spacer, TextInput} from '../../../components' import globalMessages from '../../../kernel/i18n/global-messages' import {useMetrics} from '../../../kernel/metrics/metricsManager' -import {isEmptyString} from '../../../utils/utils' +import {isEmptyString} from '../../../kernel/utils' import {useWalletNames} from '../../../yoroi-wallets/hooks' import { getWalletNameError, diff --git a/apps/wallet-mobile/src/features/SetupWallet/useCases/ChooseSetupType/ChooseSetupTypeScreen.tsx b/apps/wallet-mobile/src/features/SetupWallet/useCases/ChooseSetupType/ChooseSetupTypeScreen.tsx index 58c6aa2ed4..31d9f2f909 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/useCases/ChooseSetupType/ChooseSetupTypeScreen.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/useCases/ChooseSetupType/ChooseSetupTypeScreen.tsx @@ -6,10 +6,10 @@ import {ScrollView, StyleSheet, View} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' import {Space} from '../../../../components/Space/Space' -import {LedgerTransportSwitchModal} from '../../../../HW' import {isProduction} from '../../../../kernel/env' import {useMetrics} from '../../../../kernel/metrics/metricsManager' import {WalletInitRouteNavigation} from '../../../../kernel/navigation' +import {LedgerTransportSwitchModal} from '../../../../legacy/HW' import * as HASKELL_SHELLEY from '../../../../yoroi-wallets/cardano/constants/mainnet/constants' import {ButtonCard} from '../../common/ButtonCard/ButtonCard' import {LogoBanner} from '../../common/LogoBanner/LogoBanner' diff --git a/apps/wallet-mobile/src/features/SetupWallet/useCases/CreateWallet/WalletDetailsScreen.tsx b/apps/wallet-mobile/src/features/SetupWallet/useCases/CreateWallet/WalletDetailsScreen.tsx index 485e216bd6..8b8ec711bc 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/useCases/CreateWallet/WalletDetailsScreen.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/useCases/CreateWallet/WalletDetailsScreen.tsx @@ -25,7 +25,7 @@ import {showErrorDialog} from '../../../../kernel/dialogs' import {errorMessages} from '../../../../kernel/i18n/global-messages' import {useMetrics} from '../../../../kernel/metrics/metricsManager' import {useWalletNavigation} from '../../../../kernel/navigation' -import {isEmptyString} from '../../../../utils' +import {isEmptyString} from '../../../../kernel/utils' import {useCreateWallet, usePlate, useWalletNames} from '../../../../yoroi-wallets/hooks' import {WalletImplementationId} from '../../../../yoroi-wallets/types' import { diff --git a/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/MnemonicInput/MnemonicInput.tsx b/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/MnemonicInput/MnemonicInput.tsx index ec11a52e83..6504faaeff 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/MnemonicInput/MnemonicInput.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/MnemonicInput/MnemonicInput.tsx @@ -5,7 +5,7 @@ import {Platform, StyleSheet, Text, TextInput as RNTextInput, TouchableOpacity, import {Spacer, useScrollView} from '../../../../../components' import {Space} from '../../../../../components/Space/Space' -import {isEmptyString} from '../../../../../utils/utils' +import {isEmptyString} from '../../../../../kernel/utils' import {TextInput} from '../../../common/TextInput' import {useStrings} from '../../../common/useStrings' import {Alert as AlertIllustration} from '../../../illustrations/Alert' diff --git a/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletDetailsScreen.tsx b/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletDetailsScreen.tsx index 51a0900db0..2659c2d5ff 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletDetailsScreen.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletDetailsScreen.tsx @@ -24,7 +24,7 @@ import {showErrorDialog} from '../../../../kernel/dialogs' import {errorMessages} from '../../../../kernel/i18n/global-messages' import {useMetrics} from '../../../../kernel/metrics/metricsManager' import {useWalletNavigation} from '../../../../kernel/navigation' -import {isEmptyString} from '../../../../utils' +import {isEmptyString} from '../../../../kernel/utils' import {useCreateWallet, usePlate, useWalletNames} from '../../../../yoroi-wallets/hooks' import {WalletImplementationId} from '../../../../yoroi-wallets/types' import { diff --git a/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletScreen.tsx b/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletScreen.tsx index 49228393d7..f427d52499 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletScreen.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletScreen.tsx @@ -12,7 +12,7 @@ import {Button, Icon, KeyboardAvoidingView, useModal} from '../../../../componen import {Space} from '../../../../components/Space/Space' import {useMetrics} from '../../../../kernel/metrics/metricsManager' import {useWalletNavigation, WalletInitRouteNavigation} from '../../../../kernel/navigation' -import {isEmptyString} from '../../../../utils' +import {isEmptyString} from '../../../../kernel/utils' import {makeKeys} from '../../../../yoroi-wallets/cardano/shelley/makeKeys' import {usePlate, useWalletMetas} from '../../../../yoroi-wallets/hooks' import {WalletMeta} from '../../../WalletManager/common/types' diff --git a/apps/wallet-mobile/src/features/Staking/Governance/useCases/ConfirmTx/ConfirmTxScreen.tsx b/apps/wallet-mobile/src/features/Staking/Governance/useCases/ConfirmTx/ConfirmTxScreen.tsx index e2b9bf56ec..b4010e82f1 100644 --- a/apps/wallet-mobile/src/features/Staking/Governance/useCases/ConfirmTx/ConfirmTxScreen.tsx +++ b/apps/wallet-mobile/src/features/Staking/Governance/useCases/ConfirmTx/ConfirmTxScreen.tsx @@ -12,8 +12,8 @@ import {ConfirmTxWithSpendingPasswordModal} from '../../../../../components/Conf import {PairedBalance} from '../../../../../components/PairedBalance/PairedBalance' import {useMetrics} from '../../../../../kernel/metrics/metricsManager' import {useUnsafeParams} from '../../../../../kernel/navigation' -import {formatTokenWithText} from '../../../../../legacy/format' import {Amounts} from '../../../../../yoroi-wallets/utils' +import {formatTokenWithText} from '../../../../../yoroi-wallets/utils/format' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' import {useNavigateTo, useStrings} from '../../common' import {Routes} from '../../common/navigation' diff --git a/apps/wallet-mobile/src/features/Staking/Governance/useCases/Home/HomeScreen.tsx b/apps/wallet-mobile/src/features/Staking/Governance/useCases/Home/HomeScreen.tsx index f37e0b5772..3dda3589b9 100644 --- a/apps/wallet-mobile/src/features/Staking/Governance/useCases/Home/HomeScreen.tsx +++ b/apps/wallet-mobile/src/features/Staking/Governance/useCases/Home/HomeScreen.tsx @@ -14,9 +14,9 @@ import React, {type ReactNode} from 'react' import {StyleSheet, Text, View} from 'react-native' import {Button, Spacer, useModal} from '../../../../../components' -import {useStakingInfo} from '../../../../../Dashboard/StakePoolInfos' import {useMetrics} from '../../../../../kernel/metrics/metricsManager' import {useUnsafeParams, useWalletNavigation} from '../../../../../kernel/navigation' +import {useStakingInfo} from '../../../../../legacy/Dashboard/StakePoolInfos' import { useCreateGovernanceTx, useStakingKey, diff --git a/apps/wallet-mobile/src/features/Swap/common/AmountCard/AmountCard.tsx b/apps/wallet-mobile/src/features/Swap/common/AmountCard/AmountCard.tsx index cb12977433..c643aa1cf1 100644 --- a/apps/wallet-mobile/src/features/Swap/common/AmountCard/AmountCard.tsx +++ b/apps/wallet-mobile/src/features/Swap/common/AmountCard/AmountCard.tsx @@ -6,11 +6,11 @@ import {Pressable, StyleSheet, Text, TextInput, View} from 'react-native' import {TouchableOpacity} from 'react-native-gesture-handler' import {Boundary, Icon, Spacer, TokenIcon, TokenIconPlaceholder} from '../../../../components' -import {formatTokenWithText} from '../../../../legacy/format' -import {isEmptyString} from '../../../../utils' +import {isEmptyString} from '../../../../kernel/utils' import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' import {useTokenInfo} from '../../../../yoroi-wallets/hooks' import {Quantities} from '../../../../yoroi-wallets/utils' +import {formatTokenWithText} from '../../../../yoroi-wallets/utils/format' type Props = { label?: string diff --git a/apps/wallet-mobile/src/features/Swap/common/ConfirmRawTx/ConfirmRawTxWithHW.tsx b/apps/wallet-mobile/src/features/Swap/common/ConfirmRawTx/ConfirmRawTxWithHW.tsx index b1a047e32c..0e4529ee73 100644 --- a/apps/wallet-mobile/src/features/Swap/common/ConfirmRawTx/ConfirmRawTxWithHW.tsx +++ b/apps/wallet-mobile/src/features/Swap/common/ConfirmRawTx/ConfirmRawTxWithHW.tsx @@ -4,7 +4,7 @@ import React, {useState} from 'react' import {ActivityIndicator, ScrollView, StyleSheet, View} from 'react-native' import {Text} from '../../../../components' -import {LedgerConnect} from '../../../../HW' +import {LedgerConnect} from '../../../../legacy/HW' import {DeviceId, DeviceObj, withBLE, withUSB} from '../../../../yoroi-wallets/hw' import {walletManager} from '../../../WalletManager/common/walletManager' import {useSelectedWallet} from '../../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxWithHW.tsx b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxWithHW.tsx index 9b83dce804..bf510c2436 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxWithHW.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxWithHW.tsx @@ -2,7 +2,7 @@ import React, {useState} from 'react' import {ActivityIndicator, ScrollView, StyleSheet, View} from 'react-native' import {Text} from '../../../../components' -import {LedgerConnect} from '../../../../HW' +import {LedgerConnect} from '../../../../legacy/HW' import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' import {useSignWithHwAndSubmitTx} from '../../../../yoroi-wallets/hooks' import {DeviceId, DeviceObj, withBLE, withUSB} from '../../../../yoroi-wallets/hw' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/LedgerTransportSwitch.tsx b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/LedgerTransportSwitch.tsx index e11985cdb0..e1ffd8df68 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/LedgerTransportSwitch.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/LedgerTransportSwitch.tsx @@ -2,7 +2,7 @@ import React from 'react' import {Alert, ScrollView, StyleSheet, View} from 'react-native' import {Button, Spacer, Text} from '../../../../components' -import {useIsUsbSupported} from '../../../../HW' +import {useIsUsbSupported} from '../../../../legacy/HW' import {HARDWARE_WALLETS, useLedgerPermissions} from '../../../../yoroi-wallets/hw' import {useStrings} from '../../common/strings' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/AmountActions.stories.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/AmountActions.stories.tsx index b5910f54c7..9fd333af57 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/AmountActions.stories.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/AmountActions.stories.tsx @@ -3,8 +3,8 @@ import {mockSwapManager, SwapProvider} from '@yoroi/swap' import React from 'react' import {StyleSheet, View} from 'react-native' -import {SearchProvider} from '../../../../../../../Search/SearchContext' import {mocks} from '../../../../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../../../WalletManager/context/SelectedWalletContext' import {SwapFormProvider} from '../../../../../common/SwapFormProvider' import {AmountActions} from '../AmountActions/AmountActions' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/SwitchTokens.stories.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/SwitchTokens.stories.tsx index ea0480cc60..ed1c452223 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/SwitchTokens.stories.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/Actions/AmountActions/SwitchTokens.stories.tsx @@ -3,8 +3,8 @@ import {mockSwapManager, SwapProvider} from '@yoroi/swap' import React from 'react' import {StyleSheet, View} from 'react-native' -import {SearchProvider} from '../../../../../../../Search/SearchContext' import {mocks} from '../../../../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../../../WalletManager/context/SelectedWalletContext' import {SwapFormProvider} from '../../../../../common/SwapFormProvider' import {SwitchTokens} from '../AmountActions/SwitchTokens' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/CreateOrder.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/CreateOrder.tsx index 8eb061bc91..dbb525e52b 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/CreateOrder.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/CreateOrder.tsx @@ -11,11 +11,11 @@ import {Button, KeyboardAvoidingView, Spacer, useModal} from '../../../../../com import {frontendFeeAddressMainnet, frontendFeeAddressPreprod} from '../../../../../kernel/env' import {useMetrics} from '../../../../../kernel/metrics/metricsManager' import {useWalletNavigation} from '../../../../../kernel/navigation' -import {useDisableSearchOnBar} from '../../../../../Search/SearchContext' import {NotEnoughMoneyToSendError} from '../../../../../yoroi-wallets/cardano/types' import {useTokenInfo} from '../../../../../yoroi-wallets/hooks' import {YoroiEntry} from '../../../../../yoroi-wallets/types' -import {isMainnetNetworkId, Quantities} from '../../../../../yoroi-wallets/utils' +import {Quantities} from '../../../../../yoroi-wallets/utils' +import {useDisableSearchOnBar} from '../../../../Search/SearchContext' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' import {createOrderEntry, makePossibleFrontendFeeEntry} from '../../../common/entries' import {getPriceImpactRisk} from '../../../common/helpers' @@ -127,7 +127,7 @@ export const CreateOrder = () => { datum, ) - const isMainnet = isMainnetNetworkId(wallet.networkId) + const isMainnet = wallet.isMainnet const frontendFee = selectedPoolCalculation.cost.frontendFeeInfo.fee const frontendFeeDepositAddress = isMainnet ? frontendFeeAddressMainnet : frontendFeeAddressPreprod const frontendFeeEntry = makePossibleFrontendFeeEntry(frontendFee, frontendFeeDepositAddress) diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/EditBuyAmount.stories.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/EditBuyAmount.stories.tsx index 1fc497422a..5a95de6cde 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/EditBuyAmount.stories.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/EditBuyAmount.stories.tsx @@ -4,8 +4,8 @@ import {produce} from 'immer' import React from 'react' import {StyleSheet, View} from 'react-native' -import {SearchProvider} from '../../../../../../Search/SearchContext' import {mocks} from '../../../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../../WalletManager/context/SelectedWalletContext' import {SwapFormProvider} from '../../../../common/SwapFormProvider' import {EditBuyAmount} from './EditBuyAmount' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/SelectBuyTokenFromListScreen/SelectBuyTokenFromListScreen.stories.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/SelectBuyTokenFromListScreen/SelectBuyTokenFromListScreen.stories.tsx index 04f0d763cc..acb2f9b6e7 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/SelectBuyTokenFromListScreen/SelectBuyTokenFromListScreen.stories.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/SelectBuyTokenFromListScreen/SelectBuyTokenFromListScreen.stories.tsx @@ -2,8 +2,8 @@ import {storiesOf} from '@storybook/react-native' import {mockSwapManager, SwapProvider} from '@yoroi/swap' import React from 'react' -import {SearchProvider} from '../../../../../../../Search/SearchContext' import {mocks} from '../../../../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../../../WalletManager/context/SelectedWalletContext' import {SwapFormProvider} from '../../../../../common/SwapFormProvider' import {SelectBuyTokenFromListScreen} from './SelectBuyTokenFromListScreen' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/SelectBuyTokenFromListScreen/SelectBuyTokenFromListScreen.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/SelectBuyTokenFromListScreen/SelectBuyTokenFromListScreen.tsx index 0dbdce14ac..ca4e799907 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/SelectBuyTokenFromListScreen/SelectBuyTokenFromListScreen.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/SelectBuyTokenFromListScreen/SelectBuyTokenFromListScreen.tsx @@ -10,10 +10,10 @@ import {SafeAreaView} from 'react-native-safe-area-context' import {Boundary, Icon, Spacer, Text} from '../../../../../../../components' import {AmountItem, AmountItemPlaceholder} from '../../../../../../../components/AmountItem/AmountItem' import {useMetrics} from '../../../../../../../kernel/metrics/metricsManager' -import {useSearch, useSearchOnNavBar} from '../../../../../../../Search/SearchContext' import {YoroiWallet} from '../../../../../../../yoroi-wallets/cardano/types' import {useBalance, useBalances} from '../../../../../../../yoroi-wallets/hooks' import {Amounts} from '../../../../../../../yoroi-wallets/utils' +import {useSearch, useSearchOnNavBar} from '../../../../../../Search/SearchContext' import {NoAssetFoundImage} from '../../../../../../Send/common/NoAssetFoundImage' import {useSelectedWallet} from '../../../../../../WalletManager/context/SelectedWalletContext' import {Counter} from '../../../../../common/Counter/Counter' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.stories.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.stories.tsx index 6ad467f412..2ee3a38680 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.stories.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.stories.tsx @@ -2,8 +2,8 @@ import {storiesOf} from '@storybook/react-native' import {mockSwapManager, SwapProvider} from '@yoroi/swap' import React from 'react' -import {SearchProvider} from '../../../../../../Search/SearchContext' import {mocks} from '../../../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../../WalletManager/context/SelectedWalletContext' import {SwapFormProvider} from '../../../../common/SwapFormProvider' import {ShowPoolActions} from './ShowPoolActions' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/EditSellAmount.stories.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/EditSellAmount.stories.tsx index 0c6201e13f..5df6461110 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/EditSellAmount.stories.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/EditSellAmount.stories.tsx @@ -4,8 +4,8 @@ import {produce} from 'immer' import React from 'react' import {StyleSheet, View} from 'react-native' -import {SearchProvider} from '../../../../../../Search/SearchContext' import {mocks} from '../../../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../../WalletManager/context/SelectedWalletContext' import {SwapFormProvider} from '../../../../common/SwapFormProvider' import {EditSellAmount} from './EditSellAmount' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/SelectSellTokenFromListScreen/SelectSellTokenFromListScreen.stories.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/SelectSellTokenFromListScreen/SelectSellTokenFromListScreen.stories.tsx index a8f3e30048..b0a6a003ac 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/SelectSellTokenFromListScreen/SelectSellTokenFromListScreen.stories.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/SelectSellTokenFromListScreen/SelectSellTokenFromListScreen.stories.tsx @@ -2,8 +2,8 @@ import {storiesOf} from '@storybook/react-native' import {mockSwapManager, SwapProvider} from '@yoroi/swap' import React from 'react' -import {SearchProvider} from '../../../../../../../Search/SearchContext' import {mocks} from '../../../../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../../../WalletManager/context/SelectedWalletContext' import {SwapFormProvider} from '../../../../../common/SwapFormProvider' import {SelectSellTokenFromListScreen} from './SelectSellTokenFromListScreen' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/SelectSellTokenFromListScreen/SelectSellTokenFromListScreen.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/SelectSellTokenFromListScreen/SelectSellTokenFromListScreen.tsx index 96d1d0c34e..8bf3fbc302 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/SelectSellTokenFromListScreen/SelectSellTokenFromListScreen.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/SelectSellTokenFromListScreen/SelectSellTokenFromListScreen.tsx @@ -9,9 +9,9 @@ import {SafeAreaView} from 'react-native-safe-area-context' import {Spacer, Text} from '../../../../../../../components' import {useMetrics} from '../../../../../../../kernel/metrics/metricsManager' -import {useSearch, useSearchOnNavBar} from '../../../../../../../Search/SearchContext' import {usePortfolioBalances} from '../../../../../../Portfolio/common/hooks/usePortfolioBalances' import {TokenAmountItem} from '../../../../../../Portfolio/common/TokenAmountItem/TokenAmountItem' +import {useSearch, useSearchOnNavBar} from '../../../../../../Search/SearchContext' import {NoAssetFoundImage} from '../../../../../../Send/common/NoAssetFoundImage' import {getTokenIdParts} from '../../../../../../WalletManager/common/helpers/get-token-id-parts' import {useSelectedWallet} from '../../../../../../WalletManager/context/SelectedWalletContext' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/EditSlippage.stories.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/EditSlippage.stories.tsx index 4080ce4ee2..88adf201fd 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/EditSlippage.stories.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/EditSlippage.stories.tsx @@ -3,8 +3,8 @@ import {mockSwapManager, mockSwapStateDefault, SwapProvider} from '@yoroi/swap' import {produce} from 'immer' import React from 'react' -import {SearchProvider} from '../../../../../../Search/SearchContext' import {mocks} from '../../../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../../WalletManager/context/SelectedWalletContext' import {SwapFormProvider} from '../../../../common/SwapFormProvider' import {EditSlippage} from './EditSlippage' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/ShowSlippageActions.stories.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/ShowSlippageActions.stories.tsx index 4e2cb1ade5..ac2a620054 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/ShowSlippageActions.stories.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditSlippage/ShowSlippageActions.stories.tsx @@ -2,8 +2,8 @@ import {storiesOf} from '@storybook/react-native' import {mockSwapManager, SwapProvider} from '@yoroi/swap' import React from 'react' -import {SearchProvider} from '../../../../../../Search/SearchContext' import {mocks} from '../../../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../../WalletManager/context/SelectedWalletContext' import {SwapFormProvider} from '../../../../common/SwapFormProvider' import {ShowSlippageActions} from './ShowSlippageActions' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.stories.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.stories.tsx index 0e0e3bf20f..3af4f50b54 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.stories.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.stories.tsx @@ -4,8 +4,8 @@ import React from 'react' import {QueryProvider} from '../../../../../../.storybook/decorators' import {Boundary} from '../../../../../components' -import {SearchProvider} from '../../../../../Search/SearchContext' import {mocks} from '../../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../WalletManager/context/SelectedWalletContext' import {SwapFormProvider} from '../../../common/SwapFormProvider' import {CompletedOrders, CompletedOrdersSkeleton} from './CompletedOrders' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx index cd4e35ac08..69c63296cc 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx @@ -23,10 +23,10 @@ import { } from '../../../../../components' import {frontendFeeAddressMainnet, frontendFeeAddressPreprod} from '../../../../../kernel/env' import {useMetrics} from '../../../../../kernel/metrics/metricsManager' -import {useSearch} from '../../../../../Search/SearchContext' import {useSync, useTokenInfos, useTransactionInfos} from '../../../../../yoroi-wallets/hooks' import {TransactionInfo, TxMetadataInfo} from '../../../../../yoroi-wallets/types' import {asQuantity, Quantities} from '../../../../../yoroi-wallets/utils' +import {useSearch} from '../../../../Search/SearchContext' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' import {PRICE_PRECISION} from '../../../common/constants' import {Counter} from '../../../common/Counter/Counter' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/ListOrders.stories.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/ListOrders.stories.tsx index c04101de2a..77f3c1d074 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/ListOrders.stories.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/ListOrders.stories.tsx @@ -3,8 +3,8 @@ import {mockSwapManager, SwapProvider} from '@yoroi/swap' import React from 'react' import {QueryProvider} from '../../../../../../.storybook/decorators' -import {SearchProvider} from '../../../../../Search/SearchContext' import {mocks} from '../../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../WalletManager/context/SelectedWalletContext' import {SwapFormProvider} from '../../../common/SwapFormProvider' import {ListOrders} from './ListOrders' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/ListOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/ListOrders.tsx index a64c8ead23..c08def06b9 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/ListOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/ListOrders.tsx @@ -5,7 +5,7 @@ import {StyleSheet, View} from 'react-native' import {Boundary} from '../../../../../components' import {useWalletNavigation} from '../../../../../kernel/navigation' -import {useSearchOnNavBar} from '../../../../../Search/SearchContext' +import {useSearchOnNavBar} from '../../../../Search/SearchContext' import {ButtonGroup} from '../../../common/ButtonGroup/ButtonGroup' import {ServiceUnavailable} from '../../../common/ServiceUnavailable/ServiceUnavailable' import {useStrings} from '../../../common/strings' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.stories.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.stories.tsx index 62ccec038f..9ce9eca9ff 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.stories.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.stories.tsx @@ -4,8 +4,8 @@ import React from 'react' import {QueryProvider} from '../../../../../../.storybook/decorators' import {Boundary} from '../../../../../components' -import {SearchProvider} from '../../../../../Search/SearchContext' import {mocks} from '../../../../../yoroi-wallets/mocks/wallet' +import {SearchProvider} from '../../../../Search/SearchContext' import {SelectedWalletProvider} from '../../../../WalletManager/context/SelectedWalletContext' import {SwapFormProvider} from '../../../common/SwapFormProvider' import {OpenOrders, OpenOrdersSkeleton} from './OpenOrders' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx index 6abddaf9e7..35a0a2a35b 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx @@ -27,13 +27,13 @@ import {LoadingOverlay} from '../../../../../components/LoadingOverlay' import {useLanguage} from '../../../../../kernel/i18n' import {useMetrics} from '../../../../../kernel/metrics/metricsManager' import {useWalletNavigation} from '../../../../../kernel/navigation' -import {useSearch} from '../../../../../Search/SearchContext' import {SubmitTxInsufficientCollateralError} from '../../../../../yoroi-wallets/cardano/api/errors' import {convertBech32ToHex, getTransactionSigners} from '../../../../../yoroi-wallets/cardano/common/signatureUtils' import {YoroiWallet} from '../../../../../yoroi-wallets/cardano/types' import {createRawTxSigningKey, generateCIP30UtxoCbor} from '../../../../../yoroi-wallets/cardano/utils' import {useTokenInfos, useTransactionInfos} from '../../../../../yoroi-wallets/hooks' import {Quantities} from '../../../../../yoroi-wallets/utils' +import {useSearch} from '../../../../Search/SearchContext' import {getCollateralAmountInLovelace} from '../../../../Settings/ManageCollateral/helpers' import {useSelectedWallet} from '../../../../WalletManager/context/SelectedWalletContext' import {ConfirmRawTx} from '../../../common/ConfirmRawTx/ConfirmRawTx' diff --git a/apps/wallet-mobile/src/hooks/useAllowScreenShot.tsx b/apps/wallet-mobile/src/hooks/useAllowScreenShot.tsx new file mode 100644 index 0000000000..e5b2cac85d --- /dev/null +++ b/apps/wallet-mobile/src/hooks/useAllowScreenShot.tsx @@ -0,0 +1,23 @@ +import {useFocusEffect} from '@react-navigation/native' +import {isBoolean} from '@yoroi/common' +import * as React from 'react' +import {Platform} from 'react-native' + +import { + changeScreenShareNativeSettingOnAndroid, + useScreenShareSettingEnabled, +} from '../features/Settings/ScreenShare/ScreenShare' + +export const useAllowScreenshot = () => { + const {data: screenShareSettingEnabled} = useScreenShareSettingEnabled() + const callback = React.useCallback(() => { + if (Platform.OS !== 'android') return + if (!isBoolean(screenShareSettingEnabled) || screenShareSettingEnabled) return + + changeScreenShareNativeSettingOnAndroid(true) + return () => { + changeScreenShareNativeSettingOnAndroid(false) + } + }, [screenShareSettingEnabled]) + useFocusEffect(callback) +} diff --git a/apps/wallet-mobile/src/kernel/api/useDialogsApi.tsx b/apps/wallet-mobile/src/hooks/useApiDialogs.tsx similarity index 90% rename from apps/wallet-mobile/src/kernel/api/useDialogsApi.tsx rename to apps/wallet-mobile/src/hooks/useApiDialogs.tsx index 9dc09e0341..ec9ff80d42 100644 --- a/apps/wallet-mobile/src/kernel/api/useDialogsApi.tsx +++ b/apps/wallet-mobile/src/hooks/useApiDialogs.tsx @@ -1,9 +1,9 @@ import * as React from 'react' -import {useStringsApiErrors} from './useStringsApiErrors' +import {useApiStringsErrors} from './useApiStringsErrors' -export const useDialogsApi = () => { - const strings = useStringsApiErrors() +export const useApiDialogs = () => { + const strings = useApiStringsErrors() return React.useRef({ errorBadRequest: { diff --git a/apps/wallet-mobile/src/kernel/api/useApiErrorResolver.tsx b/apps/wallet-mobile/src/hooks/useApiErrorResolver.tsx similarity index 93% rename from apps/wallet-mobile/src/kernel/api/useApiErrorResolver.tsx rename to apps/wallet-mobile/src/hooks/useApiErrorResolver.tsx index a0c6b67651..be5f8673ed 100644 --- a/apps/wallet-mobile/src/kernel/api/useApiErrorResolver.tsx +++ b/apps/wallet-mobile/src/hooks/useApiErrorResolver.tsx @@ -1,9 +1,9 @@ import {Api} from '@yoroi/types' -import {useDialogsApi} from './useDialogsApi' +import {useApiDialogs} from './useApiDialogs' export const useApiErrorResolver = () => { - const dialogs = useDialogsApi() + const dialogs = useApiDialogs() const resolver = (error: unknown) => { if (error instanceof Api.Errors.BadRequest) return dialogs.errorBadRequest diff --git a/apps/wallet-mobile/src/kernel/api/useStringsApiErrors.tsx b/apps/wallet-mobile/src/hooks/useApiStringsErrors.tsx similarity index 90% rename from apps/wallet-mobile/src/kernel/api/useStringsApiErrors.tsx rename to apps/wallet-mobile/src/hooks/useApiStringsErrors.tsx index 16b8b20265..1cd823dc9b 100644 --- a/apps/wallet-mobile/src/kernel/api/useStringsApiErrors.tsx +++ b/apps/wallet-mobile/src/hooks/useApiStringsErrors.tsx @@ -1,9 +1,9 @@ import * as React from 'react' import {useIntl} from 'react-intl' -import {apiErrors} from '../i18n/global-messages' +import {apiErrors} from '../kernel/i18n/global-messages' -export const useStringsApiErrors = () => { +export const useApiStringsErrors = () => { const intl = useIntl() return React.useRef({ diff --git a/apps/wallet-mobile/src/legacy/useCopy.ts b/apps/wallet-mobile/src/hooks/useCopy.ts similarity index 100% rename from apps/wallet-mobile/src/legacy/useCopy.ts rename to apps/wallet-mobile/src/hooks/useCopy.ts diff --git a/apps/wallet-mobile/src/components/hooks/useStatusBar.test.ts b/apps/wallet-mobile/src/hooks/useStatusBar.test.ts similarity index 100% rename from apps/wallet-mobile/src/components/hooks/useStatusBar.test.ts rename to apps/wallet-mobile/src/hooks/useStatusBar.test.ts diff --git a/apps/wallet-mobile/src/components/hooks/useStatusBar.ts b/apps/wallet-mobile/src/hooks/useStatusBar.ts similarity index 98% rename from apps/wallet-mobile/src/components/hooks/useStatusBar.ts rename to apps/wallet-mobile/src/hooks/useStatusBar.ts index f6b02ba967..79e644d19e 100644 --- a/apps/wallet-mobile/src/components/hooks/useStatusBar.ts +++ b/apps/wallet-mobile/src/hooks/useStatusBar.ts @@ -38,7 +38,7 @@ const getStatusBarStyleByRoute = ({ if (currentRouteName === 'history-list') { return { bgColorAndroid: color.primary_c100, - statusBarStyle: 'dark-content', + statusBarStyle: isDark ? 'light-content' : 'dark-content', } } else if (oldBlueRoutes.includes(currentRouteName)) { return { diff --git a/apps/wallet-mobile/src/kernel/constants.ts b/apps/wallet-mobile/src/kernel/constants.ts new file mode 100644 index 0000000000..df5758d5d1 --- /dev/null +++ b/apps/wallet-mobile/src/kernel/constants.ts @@ -0,0 +1,57 @@ +export const supportedThemes = Object.freeze({ + system: 'system', + 'default-light': 'default-light', + 'default-dark': 'default-dark', +}) + +// NOTE: to be moved into pairing module once it's implemented +export const supportedCurrencies = Object.freeze({ + ADA: 'ADA', + BRL: 'BRL', + BTC: 'BTC', + CNY: 'CNY', + ETH: 'ETH', + EUR: 'EUR', + JPY: 'JPY', + KRW: 'KRW', + USD: 'USD', +}) + +export const configCurrencies = { + [supportedCurrencies.ADA]: { + decimals: 6, + nativeName: 'Cardano', + }, + [supportedCurrencies.BRL]: { + decimals: 2, + nativeName: 'Real', + }, + [supportedCurrencies.BTC]: { + decimals: 4, + nativeName: 'Bitcoin', + }, + [supportedCurrencies.CNY]: { + decimals: 2, + nativeName: '人民币', + }, + [supportedCurrencies.ETH]: { + decimals: 4, + nativeName: 'Ethereum', + }, + [supportedCurrencies.EUR]: { + decimals: 2, + nativeName: 'Euro', + }, + [supportedCurrencies.JPY]: { + decimals: 2, + nativeName: '日本円', + }, + [supportedCurrencies.KRW]: { + decimals: 2, + nativeName: '대한민국 원', + }, + [supportedCurrencies.USD]: { + decimals: 2, + nativeName: 'US Dollar', + }, +} diff --git a/apps/wallet-mobile/src/utils/fixtures.ts b/apps/wallet-mobile/src/kernel/fixtures/fixtures.ts similarity index 100% rename from apps/wallet-mobile/src/utils/fixtures.ts rename to apps/wallet-mobile/src/kernel/fixtures/fixtures.ts diff --git a/apps/wallet-mobile/src/utils/feedback.ts b/apps/wallet-mobile/src/kernel/haptics/feedback.ts similarity index 100% rename from apps/wallet-mobile/src/utils/feedback.ts rename to apps/wallet-mobile/src/kernel/haptics/feedback.ts diff --git a/apps/wallet-mobile/src/kernel/i18n/global-messages.ts b/apps/wallet-mobile/src/kernel/i18n/global-messages.ts index fd6381f508..ade4063bae 100644 --- a/apps/wallet-mobile/src/kernel/i18n/global-messages.ts +++ b/apps/wallet-mobile/src/kernel/i18n/global-messages.ts @@ -1,6 +1,6 @@ import {defineMessages} from 'react-intl' -import {supportedCurrencies, supportedThemes} from '../../yoroi-wallets/types/other' +import {supportedCurrencies, supportedThemes} from '../constants' /* * Some messages need to be used in multiple components diff --git a/apps/wallet-mobile/src/kernel/utils.ts b/apps/wallet-mobile/src/kernel/utils.ts new file mode 100644 index 0000000000..aeef659d15 --- /dev/null +++ b/apps/wallet-mobile/src/kernel/utils.ts @@ -0,0 +1,5 @@ +import {isEmpty} from 'lodash' + +export function isEmptyString(value: string | null | undefined): value is '' | null | undefined { + return isEmpty(value) +} diff --git a/apps/wallet-mobile/src/Catalyst/ConfirmPin.tsx b/apps/wallet-mobile/src/legacy/Catalyst/ConfirmPin.tsx similarity index 91% rename from apps/wallet-mobile/src/Catalyst/ConfirmPin.tsx rename to apps/wallet-mobile/src/legacy/Catalyst/ConfirmPin.tsx index ad2142ee19..5e52773989 100644 --- a/apps/wallet-mobile/src/Catalyst/ConfirmPin.tsx +++ b/apps/wallet-mobile/src/legacy/Catalyst/ConfirmPin.tsx @@ -3,10 +3,10 @@ import {defineMessages, useIntl} from 'react-intl' import {ScrollView, StyleSheet, View} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' -import {ProgressStep, Spacer} from '../components' -import {BACKSPACE, NumericKeyboard} from '../components/NumericKeyboard' -import {showErrorDialog} from '../kernel/dialogs' -import {errorMessages} from '../kernel/i18n/global-messages' +import {ProgressStep, Spacer} from '../../components' +import {BACKSPACE, NumericKeyboard} from '../../components/NumericKeyboard' +import {showErrorDialog} from '../../kernel/dialogs' +import {errorMessages} from '../../kernel/i18n/global-messages' import {Description, PinBox, Row, Title} from './components' const PIN_LENGTH = 4 diff --git a/apps/wallet-mobile/src/Catalyst/ConfirmVotingTx.tsx b/apps/wallet-mobile/src/legacy/Catalyst/ConfirmVotingTx.tsx similarity index 89% rename from apps/wallet-mobile/src/Catalyst/ConfirmVotingTx.tsx rename to apps/wallet-mobile/src/legacy/Catalyst/ConfirmVotingTx.tsx index 41db976d3d..5792f9daf2 100644 --- a/apps/wallet-mobile/src/Catalyst/ConfirmVotingTx.tsx +++ b/apps/wallet-mobile/src/legacy/Catalyst/ConfirmVotingTx.tsx @@ -3,16 +3,16 @@ import {defineMessages, useIntl} from 'react-intl' import {ScrollView, StyleSheet} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' -import {KeyboardAvoidingView, ProgressStep, Spacer, TextInput} from '../components' -import {ConfirmTx} from '../components/ConfirmTx' -import {debugWalletInfo, features} from '../features' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' +import {KeyboardAvoidingView, ProgressStep, Spacer, TextInput} from '../../components' +import {ConfirmTx} from '../../components/ConfirmTx' +import {debugWalletInfo, features} from '../../features' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' +import {errorMessages, txLabels} from '../../kernel/i18n/global-messages' +import LocalizableError from '../../kernel/i18n/LocalizableError' +import {useVotingRegTx} from '../../yoroi-wallets/hooks' +import {Amounts} from '../../yoroi-wallets/utils' +import {formatTokenWithSymbol} from '../../yoroi-wallets/utils/format' import {Instructions as HWInstructions} from '../HW' -import {errorMessages, txLabels} from '../kernel/i18n/global-messages' -import LocalizableError from '../kernel/i18n/LocalizableError' -import {formatTokenWithSymbol} from '../legacy/format' -import {useVotingRegTx} from '../yoroi-wallets/hooks' -import {Amounts} from '../yoroi-wallets/utils' import {Actions, Description, Title} from './components' export const ConfirmVotingTx = ({ diff --git a/apps/wallet-mobile/src/Catalyst/DisplayPin.tsx b/apps/wallet-mobile/src/legacy/Catalyst/DisplayPin.tsx similarity index 94% rename from apps/wallet-mobile/src/Catalyst/DisplayPin.tsx rename to apps/wallet-mobile/src/legacy/Catalyst/DisplayPin.tsx index ea0b4a8b0b..2f413171d0 100644 --- a/apps/wallet-mobile/src/Catalyst/DisplayPin.tsx +++ b/apps/wallet-mobile/src/legacy/Catalyst/DisplayPin.tsx @@ -3,8 +3,8 @@ import {defineMessages, useIntl} from 'react-intl' import {ScrollView, StyleSheet} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' -import {Button, ProgressStep, Spacer} from '../components' -import {confirmationMessages} from '../kernel/i18n/global-messages' +import {Button, ProgressStep, Spacer} from '../../components' +import {confirmationMessages} from '../../kernel/i18n/global-messages' import {Actions, Description, PinBox, Row, Title} from './components' import {useCountdown} from './hooks' diff --git a/apps/wallet-mobile/src/Catalyst/DownloadCatalyst.tsx b/apps/wallet-mobile/src/legacy/Catalyst/DownloadCatalyst.tsx similarity index 91% rename from apps/wallet-mobile/src/Catalyst/DownloadCatalyst.tsx rename to apps/wallet-mobile/src/legacy/Catalyst/DownloadCatalyst.tsx index 20e43f5e72..696e4b39e8 100644 --- a/apps/wallet-mobile/src/Catalyst/DownloadCatalyst.tsx +++ b/apps/wallet-mobile/src/legacy/Catalyst/DownloadCatalyst.tsx @@ -4,13 +4,13 @@ import {defineMessages, useIntl} from 'react-intl' 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' -import playstoreBadge from '../assets/img/google-play-badge.png' -import AppDownload from '../assets/img/pic-catalyst-step1.png' -import {Button, ProgressStep, Spacer, StandardModal, Text} from '../components' +import appstoreBadge from '../../assets/img/app-store-badge.png' +import playstoreBadge from '../../assets/img/google-play-badge.png' +import AppDownload from '../../assets/img/pic-catalyst-step1.png' +import {Button, ProgressStep, Spacer, StandardModal, Text} from '../../components' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' +import globalMessages, {confirmationMessages} from '../../kernel/i18n/global-messages' import {useStakingInfo} from '../Dashboard/StakePoolInfos' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' -import globalMessages, {confirmationMessages} from '../kernel/i18n/global-messages' import {Actions, Row} from './components' type Props = { diff --git a/apps/wallet-mobile/src/Catalyst/InsufficientFundsModal.tsx b/apps/wallet-mobile/src/legacy/Catalyst/InsufficientFundsModal.tsx similarity index 78% rename from apps/wallet-mobile/src/Catalyst/InsufficientFundsModal.tsx rename to apps/wallet-mobile/src/legacy/Catalyst/InsufficientFundsModal.tsx index 23da9a614c..9785246c25 100644 --- a/apps/wallet-mobile/src/Catalyst/InsufficientFundsModal.tsx +++ b/apps/wallet-mobile/src/legacy/Catalyst/InsufficientFundsModal.tsx @@ -3,13 +3,13 @@ import * as React from 'react' import {useIntl} from 'react-intl' import {StyleSheet, Text, View} from 'react-native' -import {StandardModal} from '../components' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' -import globalMessages, {confirmationMessages} from '../kernel/i18n/global-messages' -import {formatTokenWithText} from '../legacy/format' -import {CATALYST} from '../yoroi-wallets/cardano/utils' -import {useBalances} from '../yoroi-wallets/hooks' -import {Amounts, asQuantity} from '../yoroi-wallets/utils' +import {StandardModal} from '../../components' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' +import globalMessages, {confirmationMessages} from '../../kernel/i18n/global-messages' +import {CATALYST} from '../../yoroi-wallets/cardano/utils' +import {useBalances} from '../../yoroi-wallets/hooks' +import {Amounts, asQuantity} from '../../yoroi-wallets/utils' +import {formatTokenWithText} from '../../yoroi-wallets/utils/format' export const InsufficientFundsModal = ({visible, onRequestClose}: {visible: boolean; onRequestClose: () => void}) => { const strings = useStrings() diff --git a/apps/wallet-mobile/src/Catalyst/QrCode.tsx b/apps/wallet-mobile/src/legacy/Catalyst/QrCode.tsx similarity index 95% rename from apps/wallet-mobile/src/Catalyst/QrCode.tsx rename to apps/wallet-mobile/src/legacy/Catalyst/QrCode.tsx index 99954068cb..001f802ff0 100644 --- a/apps/wallet-mobile/src/Catalyst/QrCode.tsx +++ b/apps/wallet-mobile/src/legacy/Catalyst/QrCode.tsx @@ -5,17 +5,17 @@ import {ScrollView, StyleSheet, View, ViewProps} from 'react-native' import QRCodeSVG from 'react-native-qrcode-svg' import {SafeAreaView} from 'react-native-safe-area-context' -import {Button, CopyButton, ProgressStep, Spacer, Text} from '../components' -import {confirmationMessages} from '../kernel/i18n/global-messages' -import {useBlockGoBack} from '../kernel/navigation' -import {useAllowScreenshots} from '../utils' +import {Button, CopyButton, ProgressStep, Spacer, Text} from '../../components' +import {useAllowScreenshot} from '../../hooks/useAllowScreenShot' +import {confirmationMessages} from '../../kernel/i18n/global-messages' +import {useBlockGoBack} from '../../kernel/navigation' import {Actions, Description, Title} from './components' import {useCountdown} from './hooks' import {VotingRegistrationBackupCheckModal} from './VotingRegistrationBackupCheckModal' export const QrCode = ({onNext, votingKeyEncrypted}: {onNext: () => void; votingKeyEncrypted: string}) => { useBlockGoBack() - useAllowScreenshots() + useAllowScreenshot() const strings = useStrings() const styles = useStyles() diff --git a/apps/wallet-mobile/src/Catalyst/VotingBanner.stories.tsx b/apps/wallet-mobile/src/legacy/Catalyst/VotingBanner.stories.tsx similarity index 79% rename from apps/wallet-mobile/src/Catalyst/VotingBanner.stories.tsx rename to apps/wallet-mobile/src/legacy/Catalyst/VotingBanner.stories.tsx index c2d1dd1a7d..5ee8f22c99 100644 --- a/apps/wallet-mobile/src/Catalyst/VotingBanner.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Catalyst/VotingBanner.stories.tsx @@ -2,8 +2,8 @@ import {action} from '@storybook/addon-actions' import {storiesOf} from '@storybook/react-native' import React from 'react' -import {SelectedWalletProvider} from '../features/WalletManager/context/SelectedWalletContext' -import {mocks} from '../yoroi-wallets/mocks' +import {SelectedWalletProvider} from '../../features/WalletManager/context/SelectedWalletContext' +import {mocks} from '../../yoroi-wallets/mocks' import {VotingBanner} from './VotingBanner' storiesOf('Voting Banner', module) diff --git a/apps/wallet-mobile/src/Catalyst/VotingBanner.tsx b/apps/wallet-mobile/src/legacy/Catalyst/VotingBanner.tsx similarity index 91% rename from apps/wallet-mobile/src/Catalyst/VotingBanner.tsx rename to apps/wallet-mobile/src/legacy/Catalyst/VotingBanner.tsx index ae8e067f22..665d479b2e 100644 --- a/apps/wallet-mobile/src/Catalyst/VotingBanner.tsx +++ b/apps/wallet-mobile/src/legacy/Catalyst/VotingBanner.tsx @@ -4,11 +4,11 @@ import React, {useEffect, useState} from 'react' import {defineMessages, useIntl} from 'react-intl' import {StyleSheet, TouchableOpacity, View} from 'react-native' -import {Icon, Text} from '../components' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' -import {isNightly} from '../kernel/env' -import globalMessages, {confirmationMessages} from '../kernel/i18n/global-messages' -import {logger} from '../kernel/logger/logger' +import {Icon, Text} from '../../components' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' +import {isNightly} from '../../kernel/env' +import globalMessages, {confirmationMessages} from '../../kernel/i18n/global-messages' +import {logger} from '../../kernel/logger/logger' import {useCanVote} from './hooks' import {InsufficientFundsModal} from './InsufficientFundsModal' diff --git a/apps/wallet-mobile/src/Catalyst/VotingRegistration.stories.tsx b/apps/wallet-mobile/src/legacy/Catalyst/VotingRegistration.stories.tsx similarity index 93% rename from apps/wallet-mobile/src/Catalyst/VotingRegistration.stories.tsx rename to apps/wallet-mobile/src/legacy/Catalyst/VotingRegistration.stories.tsx index e3f6e9b018..734f10b933 100644 --- a/apps/wallet-mobile/src/Catalyst/VotingRegistration.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Catalyst/VotingRegistration.stories.tsx @@ -3,11 +3,11 @@ import {action} from '@storybook/addon-actions' import {storiesOf} from '@storybook/react-native' import React from 'react' -import {QueryProvider, WithModalProps} from '../../.storybook/decorators' -import {Boundary} from '../components' -import {SelectedWalletProvider} from '../features/WalletManager/context/SelectedWalletContext' -import {YoroiWallet} from '../yoroi-wallets/cardano/types' -import {mocks} from '../yoroi-wallets/mocks' +import {QueryProvider, WithModalProps} from '../../../.storybook/decorators' +import {Boundary} from '../../components' +import {SelectedWalletProvider} from '../../features/WalletManager/context/SelectedWalletContext' +import {YoroiWallet} from '../../yoroi-wallets/cardano/types' +import {mocks} from '../../yoroi-wallets/mocks' import {ConfirmPin} from './ConfirmPin' import {ConfirmVotingTx} from './ConfirmVotingTx' import {DisplayPin} from './DisplayPin' diff --git a/apps/wallet-mobile/src/Catalyst/VotingRegistration.tsx b/apps/wallet-mobile/src/legacy/Catalyst/VotingRegistration.tsx similarity index 94% rename from apps/wallet-mobile/src/Catalyst/VotingRegistration.tsx rename to apps/wallet-mobile/src/legacy/Catalyst/VotingRegistration.tsx index 1ec6a98cb7..7ee81588d1 100644 --- a/apps/wallet-mobile/src/Catalyst/VotingRegistration.tsx +++ b/apps/wallet-mobile/src/legacy/Catalyst/VotingRegistration.tsx @@ -4,15 +4,15 @@ import cryptoRandomString from 'crypto-random-string' import React, {useState} from 'react' import {useIntl} from 'react-intl' -import {Boundary} from '../components' -import globalMessages from '../kernel/i18n/global-messages' -import {useMetrics} from '../kernel/metrics/metricsManager' +import {Boundary} from '../../components' +import globalMessages from '../../kernel/i18n/global-messages' +import {useMetrics} from '../../kernel/metrics/metricsManager' import { defaultStackNavigationOptions, useWalletNavigation, VotingRegistrationRouteNavigation, VotingRegistrationRoutes, -} from '../kernel/navigation' +} from '../../kernel/navigation' import {ConfirmPin} from './ConfirmPin' import {ConfirmVotingTx} from './ConfirmVotingTx' import {DisplayPin} from './DisplayPin' diff --git a/apps/wallet-mobile/src/Catalyst/VotingRegistrationBackupCheckModal.tsx b/apps/wallet-mobile/src/legacy/Catalyst/VotingRegistrationBackupCheckModal.tsx similarity index 93% rename from apps/wallet-mobile/src/Catalyst/VotingRegistrationBackupCheckModal.tsx rename to apps/wallet-mobile/src/legacy/Catalyst/VotingRegistrationBackupCheckModal.tsx index 5633665f30..358e17e7a9 100644 --- a/apps/wallet-mobile/src/Catalyst/VotingRegistrationBackupCheckModal.tsx +++ b/apps/wallet-mobile/src/legacy/Catalyst/VotingRegistrationBackupCheckModal.tsx @@ -2,9 +2,9 @@ import React, {useState} from 'react' import {defineMessages, useIntl} from 'react-intl' import {StyleSheet, View} from 'react-native' -import {Button, Checkbox, Spacer, Text} from '../components' -import globalMessages, {confirmationMessages} from '../kernel/i18n/global-messages' -import {Modal} from '../legacy/Modal' +import {Button, Checkbox, Spacer, Text} from '../../components' +import {Modal} from '../../components/legacy/Modal/Modal' +import globalMessages, {confirmationMessages} from '../../kernel/i18n/global-messages' type Props = { onConfirm: () => void diff --git a/apps/wallet-mobile/src/Catalyst/components.tsx b/apps/wallet-mobile/src/legacy/Catalyst/components.tsx similarity index 97% rename from apps/wallet-mobile/src/Catalyst/components.tsx rename to apps/wallet-mobile/src/legacy/Catalyst/components.tsx index dd83c9d68a..cc53d7cea6 100644 --- a/apps/wallet-mobile/src/Catalyst/components.tsx +++ b/apps/wallet-mobile/src/legacy/Catalyst/components.tsx @@ -1,7 +1,7 @@ import React from 'react' import {StyleSheet, TextProps, View, ViewProps} from 'react-native' -import {Text} from '../components' +import {Text} from '../../components' export const Title = ({style, ...props}: TextProps) => export const Description = ({style, ...props}: TextProps) => diff --git a/apps/wallet-mobile/src/Catalyst/hooks.ts b/apps/wallet-mobile/src/legacy/Catalyst/hooks.ts similarity index 75% rename from apps/wallet-mobile/src/Catalyst/hooks.ts rename to apps/wallet-mobile/src/legacy/Catalyst/hooks.ts index 326e3c2278..b55b9affe6 100644 --- a/apps/wallet-mobile/src/Catalyst/hooks.ts +++ b/apps/wallet-mobile/src/legacy/Catalyst/hooks.ts @@ -1,10 +1,10 @@ import {Balance} from '@yoroi/types' import {useEffect, useState} from 'react' -import {YoroiWallet} from '../yoroi-wallets/cardano/types' -import {CATALYST, isHaskellShelley} from '../yoroi-wallets/cardano/utils' -import {useBalances} from '../yoroi-wallets/hooks' -import {Amounts, Quantities} from '../yoroi-wallets/utils' +import {YoroiWallet} from '../../yoroi-wallets/cardano/types' +import {CATALYST, isHaskellShelley} from '../../yoroi-wallets/cardano/utils' +import {useBalances} from '../../yoroi-wallets/hooks' +import {Amounts, Quantities} from '../../yoroi-wallets/utils' export const useCanVote = (wallet: YoroiWallet) => { const balances = useBalances(wallet) diff --git a/apps/wallet-mobile/src/Catalyst/index.ts b/apps/wallet-mobile/src/legacy/Catalyst/index.ts similarity index 100% rename from apps/wallet-mobile/src/Catalyst/index.ts rename to apps/wallet-mobile/src/legacy/Catalyst/index.ts diff --git a/apps/wallet-mobile/src/Dashboard/Dashboard.stories.tsx b/apps/wallet-mobile/src/legacy/Dashboard/Dashboard.stories.tsx similarity index 90% rename from apps/wallet-mobile/src/Dashboard/Dashboard.stories.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/Dashboard.stories.tsx index ec29d3e602..dfe48d04ba 100644 --- a/apps/wallet-mobile/src/Dashboard/Dashboard.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/Dashboard.stories.tsx @@ -1,10 +1,10 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' -import {QueryProvider} from '../../.storybook/decorators' -import {SelectedWalletProvider} from '../features/WalletManager/context/SelectedWalletContext' -import {YoroiWallet} from '../yoroi-wallets/cardano/types' -import {mocks} from '../yoroi-wallets/mocks' +import {QueryProvider} from '../../../.storybook/decorators' +import {SelectedWalletProvider} from '../../features/WalletManager/context/SelectedWalletContext' +import {YoroiWallet} from '../../yoroi-wallets/cardano/types' +import {mocks} from '../../yoroi-wallets/mocks' import {Dashboard} from './Dashboard' storiesOf('Dashboard', module) diff --git a/apps/wallet-mobile/src/Dashboard/Dashboard.tsx b/apps/wallet-mobile/src/legacy/Dashboard/Dashboard.tsx similarity index 90% rename from apps/wallet-mobile/src/Dashboard/Dashboard.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/Dashboard.tsx index 4ae7747ad2..d09298b57d 100644 --- a/apps/wallet-mobile/src/Dashboard/Dashboard.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/Dashboard.tsx @@ -7,30 +7,30 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {ActivityIndicator, RefreshControl, ScrollView, StyleSheet, View, ViewProps} from 'react-native' -import {Banner, Button, useModal} from '../components' +import {Banner, Button, useModal} from '../../components' +import {Modal} from '../../components/legacy/Modal/Modal' import { useGovernanceStrings, useIsParticipatingInGovernance, WithdrawWarningModal, -} from '../features/Staking/Governance' -import {useIsGovernanceFeatureEnabled} from '../features/Staking/Governance' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' -import globalMessages from '../kernel/i18n/global-messages' -import {DashboardRoutes, useWalletNavigation} from '../kernel/navigation' -import {Modal} from '../legacy/Modal' -import {PoolTransitionNotice} from '../Staking/PoolTransition/PoolTransitionNotice' -import {usePoolTransition} from '../Staking/PoolTransition/usePoolTransition' -import {isEmptyString} from '../utils/utils' -import {getCardanoNetworkConfigById} from '../yoroi-wallets/cardano/networks' -import {getCardanoBaseConfig} from '../yoroi-wallets/cardano/utils' -import {useBalances, useIsOnline, useSync} from '../yoroi-wallets/hooks' -import {Amounts} from '../yoroi-wallets/utils' +} from '../../features/Staking/Governance' +import {useIsGovernanceFeatureEnabled} from '../../features/Staking/Governance' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' +import globalMessages from '../../kernel/i18n/global-messages' +import {DashboardRoutes, useWalletNavigation} from '../../kernel/navigation' +import {isEmptyString} from '../../kernel/utils' +import {getCardanoNetworkConfigById} from '../../yoroi-wallets/cardano/networks' +import {getCardanoBaseConfig} from '../../yoroi-wallets/cardano/utils' +import {useBalances, useIsOnline, useSync} from '../../yoroi-wallets/hooks' +import {Amounts} from '../../yoroi-wallets/utils' import { genCurrentEpochLength, genCurrentSlotLength, genTimeToSlot, genToRelativeSlotNumber, -} from '../yoroi-wallets/utils/timeUtils' +} from '../../yoroi-wallets/utils/timeUtils' +import {PoolTransitionNotice} from '../Staking/PoolTransition/PoolTransitionNotice' +import {usePoolTransition} from '../Staking/PoolTransition/usePoolTransition' import {EpochProgress} from './EpochProgress' import {NotDelegatedInfo} from './NotDelegatedInfo' import {StakePoolInfos, useStakingInfo} from './StakePoolInfos' diff --git a/apps/wallet-mobile/src/Dashboard/DashboardNavigator.tsx b/apps/wallet-mobile/src/legacy/Dashboard/DashboardNavigator.tsx similarity index 86% rename from apps/wallet-mobile/src/Dashboard/DashboardNavigator.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/DashboardNavigator.tsx index 3389864b17..c01cd9c0fc 100644 --- a/apps/wallet-mobile/src/Dashboard/DashboardNavigator.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/DashboardNavigator.tsx @@ -5,13 +5,13 @@ import {useTheme} from '@yoroi/theme' import React from 'react' import {defineMessages, useIntl} from 'react-intl' -import {SettingsButton} from '../components/Button' -import {useGovernanceManagerMaker} from '../features/Staking/Governance' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' -import {DashboardRoutes, defaultStackNavigationOptions, useWalletNavigation} from '../kernel/navigation' +import {SettingsButton} from '../../components/Button' +import {useGovernanceManagerMaker} from '../../features/Staking/Governance' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' +import {DashboardRoutes, defaultStackNavigationOptions, useWalletNavigation} from '../../kernel/navigation' +import {useWalletName} from '../../yoroi-wallets/hooks' import {DelegationConfirmation, FailedTxScreen} from '../Staking' import {StakingCenter} from '../Staking/StakingCenter' -import {useWalletName} from '../yoroi-wallets/hooks' import {Dashboard} from './Dashboard' const Stack = createStackNavigator() diff --git a/apps/wallet-mobile/src/Dashboard/EpochProgress.tsx b/apps/wallet-mobile/src/legacy/Dashboard/EpochProgress.tsx similarity index 95% rename from apps/wallet-mobile/src/Dashboard/EpochProgress.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/EpochProgress.tsx index 0878f741b9..79c9dedb53 100644 --- a/apps/wallet-mobile/src/Dashboard/EpochProgress.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/EpochProgress.tsx @@ -3,8 +3,8 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {StyleSheet, View} from 'react-native' -import {ProgressCircle, Text, TitledCard} from '../components' -import globalMessages from '../kernel/i18n/global-messages' +import {ProgressCircle, Text, TitledCard} from '../../components' +import globalMessages from '../../kernel/i18n/global-messages' type Props = { percentage: number diff --git a/apps/wallet-mobile/src/Dashboard/NotDelegatedInfo.tsx b/apps/wallet-mobile/src/legacy/Dashboard/NotDelegatedInfo.tsx similarity index 93% rename from apps/wallet-mobile/src/Dashboard/NotDelegatedInfo.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/NotDelegatedInfo.tsx index 92e54f0f3f..e410750ce6 100644 --- a/apps/wallet-mobile/src/Dashboard/NotDelegatedInfo.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/NotDelegatedInfo.tsx @@ -3,8 +3,8 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {Image, StyleSheet, View} from 'react-native' -import NotDelegatedImage from '../assets/img/testnet/no-transactions-yet.png' -import {Line, Text} from '../components' +import NotDelegatedImage from '../../assets/img/testnet/no-transactions-yet.png' +import {Line, Text} from '../../components' export const NotDelegatedInfo = () => { const strings = useStrings() diff --git a/apps/wallet-mobile/src/Dashboard/StakePoolInfo.tsx b/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfo.tsx similarity index 93% rename from apps/wallet-mobile/src/Dashboard/StakePoolInfo.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfo.tsx index 02794df372..ecf0291626 100644 --- a/apps/wallet-mobile/src/Dashboard/StakePoolInfo.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfo.tsx @@ -4,11 +4,11 @@ import {defineMessages, useIntl} from 'react-intl' import {ActivityIndicator, Linking, StyleSheet, View} from 'react-native' import {useQuery, UseQueryOptions} from 'react-query' -import {Button, CopyButton, Text, TitledCard} from '../components' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' -import {isEmptyString} from '../utils/utils' -import {YoroiWallet} from '../yoroi-wallets/cardano/types' -import {StakePoolInfoAndHistory} from '../yoroi-wallets/types' +import {Button, CopyButton, Text, TitledCard} from '../../components' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' +import {isEmptyString} from '../../kernel/utils' +import {YoroiWallet} from '../../yoroi-wallets/cardano/types' +import {StakePoolInfoAndHistory} from '../../yoroi-wallets/types' export const StakePoolInfo = ({stakePoolId}: {stakePoolId: string}) => { const strings = useStrings() diff --git a/apps/wallet-mobile/src/Dashboard/StakePoolInfos.stories.tsx b/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.stories.tsx similarity index 93% rename from apps/wallet-mobile/src/Dashboard/StakePoolInfos.stories.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.stories.tsx index 1bb75b26e4..f7682eeaf4 100644 --- a/apps/wallet-mobile/src/Dashboard/StakePoolInfos.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.stories.tsx @@ -2,9 +2,9 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' import {QueryClient, QueryClientProvider} from 'react-query' -import {SelectedWalletProvider} from '../features/WalletManager/context/SelectedWalletContext' -import {YoroiWallet} from '../yoroi-wallets/cardano/types' -import {mocks} from '../yoroi-wallets/mocks' +import {SelectedWalletProvider} from '../../features/WalletManager/context/SelectedWalletContext' +import {YoroiWallet} from '../../yoroi-wallets/cardano/types' +import {mocks} from '../../yoroi-wallets/mocks' import {StakePoolInfos} from './StakePoolInfos' storiesOf('StakePoolInfos', module) diff --git a/apps/wallet-mobile/src/Dashboard/StakePoolInfos.tsx b/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.tsx similarity index 91% rename from apps/wallet-mobile/src/Dashboard/StakePoolInfos.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.tsx index 9c881189e9..3ea5d1dadb 100644 --- a/apps/wallet-mobile/src/Dashboard/StakePoolInfos.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.tsx @@ -4,10 +4,10 @@ import React from 'react' import {ActivityIndicator, StyleSheet, View} from 'react-native' import {useQuery, useQueryClient, UseQueryOptions} from 'react-query' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' -import {YoroiWallet} from '../yoroi-wallets/cardano/types' -import {StakingInfo, YoroiUnsignedTx} from '../yoroi-wallets/types' -import {Quantities} from '../yoroi-wallets/utils' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' +import {YoroiWallet} from '../../yoroi-wallets/cardano/types' +import {StakingInfo, YoroiUnsignedTx} from '../../yoroi-wallets/types' +import {Quantities} from '../../yoroi-wallets/utils' import {StakePoolInfo} from './StakePoolInfo' export const StakePoolInfos = () => { diff --git a/apps/wallet-mobile/src/Dashboard/UserSummary.tsx b/apps/wallet-mobile/src/legacy/Dashboard/UserSummary.tsx similarity index 92% rename from apps/wallet-mobile/src/Dashboard/UserSummary.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/UserSummary.tsx index e60a226442..63562fb638 100644 --- a/apps/wallet-mobile/src/Dashboard/UserSummary.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/UserSummary.tsx @@ -4,12 +4,12 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {StyleSheet, View} from 'react-native' -import {Button, Icon, Text, TitledCard} from '../components' -import {usePrivacyMode} from '../features/Settings/PrivacyMode/PrivacyMode' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' -import globalMessages from '../kernel/i18n/global-messages' -import {formatAdaWithText} from '../legacy/format' -import {asQuantity} from '../yoroi-wallets/utils' +import {Button, Icon, Text, TitledCard} from '../../components' +import {usePrivacyMode} from '../../features/Settings/PrivacyMode/PrivacyMode' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' +import globalMessages from '../../kernel/i18n/global-messages' +import {asQuantity} from '../../yoroi-wallets/utils' +import {formatAdaWithText} from '../../yoroi-wallets/utils/format' const ICON_DIM = 44 diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTx.tsx b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTx.tsx similarity index 87% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTx.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTx.tsx index e943e72364..84b4fbf78d 100644 --- a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTx.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTx.tsx @@ -1,7 +1,7 @@ import React from 'react' -import {YoroiWallet} from '../../../yoroi-wallets/cardano/types' -import {YoroiUnsignedTx} from '../../../yoroi-wallets/types' +import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' +import {YoroiUnsignedTx} from '../../../../yoroi-wallets/types' import {ConfirmTxWithHW} from './ConfirmTxWithHW' import {ConfirmTxWithOS} from './ConfirmTxWithOS' import {ConfirmTxWithPassword} from './ConfirmTxWithPassword' diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.stories.tsx b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.stories.tsx similarity index 95% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.stories.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.stories.tsx index ec9cd241d7..bc37007d38 100644 --- a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.stories.tsx @@ -2,9 +2,9 @@ import {action} from '@storybook/addon-actions' import {storiesOf} from '@storybook/react-native' import React from 'react' -import {WithModal} from '../../../../.storybook/decorators' -import {Boundary} from '../../../components' -import {mocks} from '../../../yoroi-wallets/mocks' +import {WithModal} from '../../../../../.storybook/decorators' +import {Boundary} from '../../../../components' +import {mocks} from '../../../../yoroi-wallets/mocks' import {ConfirmTxWithHW} from './ConfirmTxWithHW' storiesOf('ConfirmWithdrawalTx/HW', module) diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.tsx b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.tsx similarity index 84% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.tsx index 43dd0ac279..949a36a49b 100644 --- a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithHW.tsx @@ -1,14 +1,14 @@ import React from 'react' import {useIntl} from 'react-intl' -import {Boundary, TwoActionView} from '../../../components' -import {walletManager} from '../../../features/WalletManager/common/walletManager' +import {Boundary, TwoActionView} from '../../../../components' +import {walletManager} from '../../../../features/WalletManager/common/walletManager' +import {confirmationMessages, txLabels} from '../../../../kernel/i18n/global-messages' +import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' +import {useSignWithHwAndSubmitTx} from '../../../../yoroi-wallets/hooks' +import {DeviceId, DeviceObj, withBLE, withUSB} from '../../../../yoroi-wallets/hw' +import {YoroiUnsignedTx} from '../../../../yoroi-wallets/types' import {LedgerConnect, LedgerTransportSwitch} from '../../../HW' -import {confirmationMessages, txLabels} from '../../../kernel/i18n/global-messages' -import {YoroiWallet} from '../../../yoroi-wallets/cardano/types' -import {useSignWithHwAndSubmitTx} from '../../../yoroi-wallets/hooks' -import {DeviceId, DeviceObj, withBLE, withUSB} from '../../../yoroi-wallets/hw' -import {YoroiUnsignedTx} from '../../../yoroi-wallets/types' import {TransferSummary} from '../TransferSummary' type Props = { diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.stories.tsx b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.stories.tsx similarity index 90% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.stories.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.stories.tsx index 668347174a..59e440a947 100644 --- a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.stories.tsx @@ -2,9 +2,9 @@ import {action} from '@storybook/addon-actions' import {storiesOf} from '@storybook/react-native' import React from 'react' -import {WithModal} from '../../../../.storybook/decorators' -import {Boundary} from '../../../components' -import {mocks} from '../../../yoroi-wallets/mocks' +import {WithModal} from '../../../../../.storybook/decorators' +import {Boundary} from '../../../../components' +import {mocks} from '../../../../yoroi-wallets/mocks' import {ConfirmTxWithOS} from './ConfirmTxWithOS' storiesOf('ConfirmWithdrawalTx/OS', module) diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.tsx b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.tsx similarity index 74% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.tsx index 026b969eb5..483ff9bce6 100644 --- a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithOS.tsx @@ -1,13 +1,13 @@ import React from 'react' import {useIntl} from 'react-intl' -import {TwoActionView} from '../../../components' -import {LoadingOverlay} from '../../../components/LoadingOverlay' -import {useAuthOsWithEasyConfirmation} from '../../../features/Auth/common/hooks' -import {confirmationMessages, txLabels} from '../../../kernel/i18n/global-messages' -import {YoroiWallet} from '../../../yoroi-wallets/cardano/types' -import {useSignAndSubmitTx} from '../../../yoroi-wallets/hooks' -import {YoroiUnsignedTx} from '../../../yoroi-wallets/types' +import {TwoActionView} from '../../../../components' +import {LoadingOverlay} from '../../../../components/LoadingOverlay' +import {useAuthOsWithEasyConfirmation} from '../../../../features/Auth/common/hooks' +import {confirmationMessages, txLabels} from '../../../../kernel/i18n/global-messages' +import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' +import {useSignAndSubmitTx} from '../../../../yoroi-wallets/hooks' +import {YoroiUnsignedTx} from '../../../../yoroi-wallets/types' import {TransferSummary} from '../TransferSummary' type Props = { diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.stories.tsx b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.stories.tsx similarity index 85% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.stories.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.stories.tsx index c5c85b9eae..5f24727c31 100644 --- a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.stories.tsx @@ -2,11 +2,11 @@ import {action} from '@storybook/addon-actions' import {storiesOf} from '@storybook/react-native' import React from 'react' -import {WithModal} from '../../../../.storybook/decorators' -import {Boundary} from '../../../components' -import {YoroiWallet} from '../../../yoroi-wallets/cardano/types' -import {mocks} from '../../../yoroi-wallets/mocks' -import {YoroiUnsignedTx} from '../../../yoroi-wallets/types' +import {WithModal} from '../../../../../.storybook/decorators' +import {Boundary} from '../../../../components' +import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' +import {mocks} from '../../../../yoroi-wallets/mocks' +import {YoroiUnsignedTx} from '../../../../yoroi-wallets/types' import {ConfirmTxWithPassword} from './ConfirmTxWithPassword' storiesOf('ConfirmWithdrawalTx/Password', module) diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.tsx b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.tsx similarity index 83% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.tsx index 6ce48b8a21..7ebe30b4b7 100644 --- a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/ConfirmTxWithPassword.tsx @@ -2,12 +2,12 @@ import React from 'react' import {useIntl} from 'react-intl' import {ActivityIndicator, View} from 'react-native' -import {TextInput, TwoActionView} from '../../../components' -import {debugWalletInfo, features} from '../../../features' -import {confirmationMessages, txLabels} from '../../../kernel/i18n/global-messages' -import {YoroiWallet} from '../../../yoroi-wallets/cardano/types' -import {useSignWithPasswordAndSubmitTx} from '../../../yoroi-wallets/hooks' -import {YoroiUnsignedTx} from '../../../yoroi-wallets/types' +import {TextInput, TwoActionView} from '../../../../components' +import {debugWalletInfo, features} from '../../../../features' +import {confirmationMessages, txLabels} from '../../../../kernel/i18n/global-messages' +import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' +import {useSignWithPasswordAndSubmitTx} from '../../../../yoroi-wallets/hooks' +import {YoroiUnsignedTx} from '../../../../yoroi-wallets/types' import {TransferSummary} from '../TransferSummary' type Props = { diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/index.ts b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/index.ts similarity index 100% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/ConfirmTx/index.ts rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/ConfirmTx/index.ts diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.stories.tsx b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.stories.tsx similarity index 90% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.stories.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.stories.tsx index 7a7e6526e1..b3bbbe9fd6 100644 --- a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.stories.tsx @@ -1,9 +1,9 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' -import {QueryProvider} from '../../../../.storybook/decorators' -import {Boundary} from '../../../components' -import {mocks} from '../../../yoroi-wallets/mocks' +import {QueryProvider} from '../../../../../.storybook/decorators' +import {Boundary} from '../../../../components' +import {mocks} from '../../../../yoroi-wallets/mocks' import {TransferSummary} from './TransferSummary' storiesOf('TransferSummary', module) diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx similarity index 93% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx index 67620063c3..253888597a 100644 --- a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx @@ -4,12 +4,12 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {Linking, StyleSheet, TouchableOpacity, View, ViewProps} from 'react-native' -import {Text} from '../../../components' -import {confirmationMessages, txLabels} from '../../../kernel/i18n/global-messages' -import {formatTokenWithText} from '../../../legacy/format' -import {YoroiWallet} from '../../../yoroi-wallets/cardano/types' -import {YoroiStaking, YoroiUnsignedTx} from '../../../yoroi-wallets/types' -import {Amounts, Entries} from '../../../yoroi-wallets/utils' +import {Text} from '../../../../components' +import {confirmationMessages, txLabels} from '../../../../kernel/i18n/global-messages' +import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' +import {YoroiStaking, YoroiUnsignedTx} from '../../../../yoroi-wallets/types' +import {Amounts, Entries} from '../../../../yoroi-wallets/utils' +import {formatTokenWithText} from '../../../../yoroi-wallets/utils/format' export const TransferSummary = ({wallet, unsignedTx}: {wallet: YoroiWallet; unsignedTx: YoroiUnsignedTx}) => { const strings = useStrings() diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/TransferSummary/index.ts b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/index.ts similarity index 100% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/TransferSummary/index.ts rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/index.ts diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.stories.tsx b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.stories.tsx similarity index 98% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.stories.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.stories.tsx index 4514802c1f..404c864c5b 100644 --- a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.stories.tsx @@ -2,8 +2,8 @@ import {action} from '@storybook/addon-actions' import {storiesOf} from '@storybook/react-native' import React from 'react' -import {WithModal} from '../../../.storybook/decorators' -import {mocks} from '../../yoroi-wallets/mocks' +import {WithModal} from '../../../../.storybook/decorators' +import {mocks} from '../../../yoroi-wallets/mocks' import {WithdrawStakingRewards} from './WithdrawStakingRewards' storiesOf('WithdrawStakingRewards', module) diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx similarity index 94% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx index 3509406c9b..d48a2363e8 100644 --- a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx @@ -4,12 +4,12 @@ import {defineMessages, useIntl} from 'react-intl' import {StyleSheet} from 'react-native' import Markdown from 'react-native-markdown-display' -import {Boundary, DangerousAction, PleaseWaitView, Spacer} from '../../components' -import globalMessages, {ledgerMessages} from '../../kernel/i18n/global-messages' -import {YoroiWallet} from '../../yoroi-wallets/cardano/types' -import {useWithdrawalTx} from '../../yoroi-wallets/hooks' -import {YoroiUnsignedTx} from '../../yoroi-wallets/types' -import {Quantities} from '../../yoroi-wallets/utils' +import {Boundary, DangerousAction, PleaseWaitView, Spacer} from '../../../components' +import globalMessages, {ledgerMessages} from '../../../kernel/i18n/global-messages' +import {YoroiWallet} from '../../../yoroi-wallets/cardano/types' +import {useWithdrawalTx} from '../../../yoroi-wallets/hooks' +import {YoroiUnsignedTx} from '../../../yoroi-wallets/types' +import {Quantities} from '../../../yoroi-wallets/utils' import {useStakingInfo} from '../StakePoolInfos' import {ConfirmTx} from './ConfirmTx/ConfirmTx' diff --git a/apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/index.ts b/apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/index.ts similarity index 100% rename from apps/wallet-mobile/src/Dashboard/WithdrawStakingRewards/index.ts rename to apps/wallet-mobile/src/legacy/Dashboard/WithdrawStakingRewards/index.ts diff --git a/apps/wallet-mobile/src/Dashboard/index.ts b/apps/wallet-mobile/src/legacy/Dashboard/index.ts similarity index 100% rename from apps/wallet-mobile/src/Dashboard/index.ts rename to apps/wallet-mobile/src/legacy/Dashboard/index.ts diff --git a/apps/wallet-mobile/src/HW/Instructions/Instructions.stories.tsx b/apps/wallet-mobile/src/legacy/HW/Instructions/Instructions.stories.tsx similarity index 100% rename from apps/wallet-mobile/src/HW/Instructions/Instructions.stories.tsx rename to apps/wallet-mobile/src/legacy/HW/Instructions/Instructions.stories.tsx diff --git a/apps/wallet-mobile/src/HW/Instructions/Instructions.tsx b/apps/wallet-mobile/src/legacy/HW/Instructions/Instructions.tsx similarity index 93% rename from apps/wallet-mobile/src/HW/Instructions/Instructions.tsx rename to apps/wallet-mobile/src/legacy/HW/Instructions/Instructions.tsx index 1c8242fcb9..9345f78d7b 100644 --- a/apps/wallet-mobile/src/HW/Instructions/Instructions.tsx +++ b/apps/wallet-mobile/src/legacy/HW/Instructions/Instructions.tsx @@ -2,8 +2,8 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {Platform, StyleSheet, Text, View} from 'react-native' -import {BulletPointItem} from '../../components' -import {ledgerMessages} from '../../kernel/i18n/global-messages' +import {BulletPointItem} from '../../../components' +import {ledgerMessages} from '../../../kernel/i18n/global-messages' type Props = { useUSB?: boolean diff --git a/apps/wallet-mobile/src/HW/Instructions/index.ts b/apps/wallet-mobile/src/legacy/HW/Instructions/index.ts similarity index 100% rename from apps/wallet-mobile/src/HW/Instructions/index.ts rename to apps/wallet-mobile/src/legacy/HW/Instructions/index.ts diff --git a/apps/wallet-mobile/src/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx b/apps/wallet-mobile/src/legacy/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx similarity index 92% rename from apps/wallet-mobile/src/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx rename to apps/wallet-mobile/src/legacy/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx index cffaa861a1..c4ebffaad2 100644 --- a/apps/wallet-mobile/src/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx +++ b/apps/wallet-mobile/src/legacy/HW/LedgerConnect/DeviceItem/DeviceItem.stories.tsx @@ -2,7 +2,7 @@ import {action} from '@storybook/addon-actions' import {storiesOf} from '@storybook/react-native' import React from 'react' -import {Device} from '../../../yoroi-wallets/types' +import {Device} from '../../../../yoroi-wallets/types' import {DeviceItem} from './DeviceItem' const device: Device = { diff --git a/apps/wallet-mobile/src/HW/LedgerConnect/DeviceItem/DeviceItem.tsx b/apps/wallet-mobile/src/legacy/HW/LedgerConnect/DeviceItem/DeviceItem.tsx similarity index 96% rename from apps/wallet-mobile/src/HW/LedgerConnect/DeviceItem/DeviceItem.tsx rename to apps/wallet-mobile/src/legacy/HW/LedgerConnect/DeviceItem/DeviceItem.tsx index b33c86448f..0a0fbd6938 100644 --- a/apps/wallet-mobile/src/HW/LedgerConnect/DeviceItem/DeviceItem.tsx +++ b/apps/wallet-mobile/src/legacy/HW/LedgerConnect/DeviceItem/DeviceItem.tsx @@ -2,7 +2,7 @@ import {useTheme} from '@yoroi/theme' import React from 'react' import {ActivityIndicator, StyleSheet, Text, TouchableOpacity} from 'react-native' -import {Device} from '../../../yoroi-wallets/types' +import {Device} from '../../../../yoroi-wallets/types' type Props = { device: Device diff --git a/apps/wallet-mobile/src/HW/LedgerConnect/DeviceItem/index.ts b/apps/wallet-mobile/src/legacy/HW/LedgerConnect/DeviceItem/index.ts similarity index 100% rename from apps/wallet-mobile/src/HW/LedgerConnect/DeviceItem/index.ts rename to apps/wallet-mobile/src/legacy/HW/LedgerConnect/DeviceItem/index.ts diff --git a/apps/wallet-mobile/src/HW/LedgerConnect/LedgerConnect.stories.tsx b/apps/wallet-mobile/src/legacy/HW/LedgerConnect/LedgerConnect.stories.tsx similarity index 92% rename from apps/wallet-mobile/src/HW/LedgerConnect/LedgerConnect.stories.tsx rename to apps/wallet-mobile/src/legacy/HW/LedgerConnect/LedgerConnect.stories.tsx index 3454a35dc2..639f4b9ec9 100644 --- a/apps/wallet-mobile/src/HW/LedgerConnect/LedgerConnect.stories.tsx +++ b/apps/wallet-mobile/src/legacy/HW/LedgerConnect/LedgerConnect.stories.tsx @@ -1,8 +1,8 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' -import {WithModalProps} from '../../../.storybook/decorators' -import {Modal} from '../../legacy/Modal' +import {WithModalProps} from '../../../../.storybook/decorators' +import {Modal} from '../../../components/legacy/Modal/Modal' import {LedgerConnect} from './LedgerConnect' const devices = [ diff --git a/apps/wallet-mobile/src/HW/LedgerConnect/LedgerConnect.tsx b/apps/wallet-mobile/src/legacy/HW/LedgerConnect/LedgerConnect.tsx similarity index 96% rename from apps/wallet-mobile/src/HW/LedgerConnect/LedgerConnect.tsx rename to apps/wallet-mobile/src/legacy/HW/LedgerConnect/LedgerConnect.tsx index 9266766592..662232eb5b 100644 --- a/apps/wallet-mobile/src/HW/LedgerConnect/LedgerConnect.tsx +++ b/apps/wallet-mobile/src/legacy/HW/LedgerConnect/LedgerConnect.tsx @@ -9,14 +9,14 @@ import type {IntlShape} from 'react-intl' import {defineMessages, useIntl} from 'react-intl' import {ActivityIndicator, Alert, FlatList, Image, RefreshControl, ScrollView, StyleSheet, View} from 'react-native' -import bleImage from '../../assets/img/bluetooth.png' -import usbImage from '../../assets/img/ledger-nano-usb.png' -import {BulletPointItem, Button, Text} from '../../components' -import globalMessages, {confirmationMessages, ledgerMessages} from '../../kernel/i18n/global-messages' -import LocalizableError from '../../kernel/i18n/LocalizableError' -import {logger} from '../../kernel/logger/logger' -import {BluetoothDisabledError, DeviceId, DeviceObj, RejectedByUserError} from '../../yoroi-wallets/hw' -import {Device} from '../../yoroi-wallets/types' +import bleImage from '../../../assets/img/bluetooth.png' +import usbImage from '../../../assets/img/ledger-nano-usb.png' +import {BulletPointItem, Button, Text} from '../../../components' +import globalMessages, {confirmationMessages, ledgerMessages} from '../../../kernel/i18n/global-messages' +import LocalizableError from '../../../kernel/i18n/LocalizableError' +import {logger} from '../../../kernel/logger/logger' +import {BluetoothDisabledError, DeviceId, DeviceObj, RejectedByUserError} from '../../../yoroi-wallets/hw' +import {Device} from '../../../yoroi-wallets/types/hw' import {DeviceItem} from './DeviceItem' type Props = { diff --git a/apps/wallet-mobile/src/HW/LedgerConnect/index.ts b/apps/wallet-mobile/src/legacy/HW/LedgerConnect/index.ts similarity index 100% rename from apps/wallet-mobile/src/HW/LedgerConnect/index.ts rename to apps/wallet-mobile/src/legacy/HW/LedgerConnect/index.ts diff --git a/apps/wallet-mobile/src/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.stories.tsx b/apps/wallet-mobile/src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.stories.tsx similarity index 88% rename from apps/wallet-mobile/src/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.stories.tsx rename to apps/wallet-mobile/src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.stories.tsx index daa3cb10fa..432fd1c595 100644 --- a/apps/wallet-mobile/src/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.stories.tsx +++ b/apps/wallet-mobile/src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.stories.tsx @@ -1,7 +1,7 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' -import {WithModalProps} from '../../../.storybook/decorators' +import {WithModalProps} from '../../../../.storybook/decorators' import {LedgerTransportSwitchModal} from './LedgerTransportSwitchModal' storiesOf('Ledger Transport Switch Modal', module).add('default', () => ( diff --git a/apps/wallet-mobile/src/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx b/apps/wallet-mobile/src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx similarity index 95% rename from apps/wallet-mobile/src/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx rename to apps/wallet-mobile/src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx index b4321a3665..fbd6bb9d21 100644 --- a/apps/wallet-mobile/src/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx +++ b/apps/wallet-mobile/src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx @@ -3,10 +3,10 @@ import {defineMessages, useIntl} from 'react-intl' import {Alert, Platform, ScrollView, StyleSheet, View} from 'react-native' import DeviceInfo from 'react-native-device-info' -import {Button, Text} from '../../components' -import globalMessages from '../../kernel/i18n/global-messages' -import {Modal} from '../../legacy/Modal' -import {HARDWARE_WALLETS, useLedgerPermissions} from '../../yoroi-wallets/hw' +import {Button, Text} from '../../../components' +import {Modal} from '../../../components/legacy/Modal/Modal' +import globalMessages from '../../../kernel/i18n/global-messages' +import {HARDWARE_WALLETS, useLedgerPermissions} from '../../../yoroi-wallets/hw' type Props = { onSelectUSB: () => void diff --git a/apps/wallet-mobile/src/HW/LedgerTransportSwitchModal/index.ts b/apps/wallet-mobile/src/legacy/HW/LedgerTransportSwitchModal/index.ts similarity index 100% rename from apps/wallet-mobile/src/HW/LedgerTransportSwitchModal/index.ts rename to apps/wallet-mobile/src/legacy/HW/LedgerTransportSwitchModal/index.ts diff --git a/apps/wallet-mobile/src/HW/index.ts b/apps/wallet-mobile/src/legacy/HW/index.ts similarity index 100% rename from apps/wallet-mobile/src/HW/index.ts rename to apps/wallet-mobile/src/legacy/HW/index.ts diff --git a/apps/wallet-mobile/src/legacy/Modal/index.ts b/apps/wallet-mobile/src/legacy/Modal/index.ts deleted file mode 100644 index 8d3bcd7a06..0000000000 --- a/apps/wallet-mobile/src/legacy/Modal/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Modal' diff --git a/apps/wallet-mobile/src/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx b/apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx similarity index 86% rename from apps/wallet-mobile/src/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx rename to apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx index 6e0820762b..373ea7f5ad 100644 --- a/apps/wallet-mobile/src/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx @@ -2,10 +2,10 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' import {QueryClient, QueryClientProvider} from 'react-query' -import {RouteProvider} from '../../../.storybook/decorators' -import {SelectedWalletProvider} from '../../features/WalletManager/context/SelectedWalletContext' -import {StakingCenterRoutes} from '../../kernel/navigation' -import {mocks} from '../../yoroi-wallets/mocks' +import {RouteProvider} from '../../../../.storybook/decorators' +import {SelectedWalletProvider} from '../../../features/WalletManager/context/SelectedWalletContext' +import {StakingCenterRoutes} from '../../../kernel/navigation' +import {mocks} from '../../../yoroi-wallets/mocks' import {DelegationConfirmation} from './DelegationConfirmation' storiesOf('DelegationConfirmation', module) diff --git a/apps/wallet-mobile/src/Staking/DelegationConfirmation/DelegationConfirmation.tsx b/apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.tsx similarity index 90% rename from apps/wallet-mobile/src/Staking/DelegationConfirmation/DelegationConfirmation.tsx rename to apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.tsx index 16052265f4..5de0695a94 100644 --- a/apps/wallet-mobile/src/Staking/DelegationConfirmation/DelegationConfirmation.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.tsx @@ -4,18 +4,18 @@ import React, {useEffect, useState} from 'react' import {defineMessages, useIntl} from 'react-intl' import {Platform, ScrollView, StyleSheet, View, ViewProps} from 'react-native' -import {KeyboardSpacer, Text, ValidatedTextInput} from '../../components' -import {ConfirmTx} from '../../components/ConfirmTx' +import {KeyboardSpacer, Text, ValidatedTextInput} from '../../../components' +import {ConfirmTx} from '../../../components/ConfirmTx' +import {debugWalletInfo, features} from '../../../features' +import {useSelectedWallet} from '../../../features/WalletManager/context/SelectedWalletContext' +import globalMessages, {txLabels} from '../../../kernel/i18n/global-messages' +import {StakingCenterRoutes, useParams, useWalletNavigation} from '../../../kernel/navigation' +import {NETWORKS} from '../../../yoroi-wallets/cardano/networks' +import {NUMBERS} from '../../../yoroi-wallets/cardano/numbers' +import {Amounts, Entries, Quantities} from '../../../yoroi-wallets/utils' +import {formatTokenAmount, formatTokenWithText} from '../../../yoroi-wallets/utils/format' import {useStakePoolInfoAndHistory} from '../../Dashboard/StakePoolInfo' -import {debugWalletInfo, features} from '../../features' -import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' import {Instructions as HWInstructions} from '../../HW' -import globalMessages, {txLabels} from '../../kernel/i18n/global-messages' -import {StakingCenterRoutes, useParams, useWalletNavigation} from '../../kernel/navigation' -import {formatTokenAmount, formatTokenWithText} from '../../legacy/format' -import {NETWORKS} from '../../yoroi-wallets/cardano/networks' -import {NUMBERS} from '../../yoroi-wallets/cardano/numbers' -import {Amounts, Entries, Quantities} from '../../yoroi-wallets/utils' type Params = StakingCenterRoutes['delegation-confirmation'] diff --git a/apps/wallet-mobile/src/Staking/DelegationConfirmation/index.ts b/apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/index.ts similarity index 100% rename from apps/wallet-mobile/src/Staking/DelegationConfirmation/index.ts rename to apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/index.ts diff --git a/apps/wallet-mobile/src/Staking/FailedTx/FailedTxImage.tsx b/apps/wallet-mobile/src/legacy/Staking/FailedTx/FailedTxImage.tsx similarity index 100% rename from apps/wallet-mobile/src/Staking/FailedTx/FailedTxImage.tsx rename to apps/wallet-mobile/src/legacy/Staking/FailedTx/FailedTxImage.tsx diff --git a/apps/wallet-mobile/src/Staking/FailedTx/FailedTxScreen.stories.tsx b/apps/wallet-mobile/src/legacy/Staking/FailedTx/FailedTxScreen.stories.tsx similarity index 100% rename from apps/wallet-mobile/src/Staking/FailedTx/FailedTxScreen.stories.tsx rename to apps/wallet-mobile/src/legacy/Staking/FailedTx/FailedTxScreen.stories.tsx diff --git a/apps/wallet-mobile/src/Staking/FailedTx/FailedTxScreen.tsx b/apps/wallet-mobile/src/legacy/Staking/FailedTx/FailedTxScreen.tsx similarity index 96% rename from apps/wallet-mobile/src/Staking/FailedTx/FailedTxScreen.tsx rename to apps/wallet-mobile/src/legacy/Staking/FailedTx/FailedTxScreen.tsx index 53fcc83ca2..3cf4271035 100644 --- a/apps/wallet-mobile/src/Staking/FailedTx/FailedTxScreen.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/FailedTx/FailedTxScreen.tsx @@ -4,8 +4,8 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {StyleSheet, View} from 'react-native' -import {Button, Spacer, Text} from '../../components' -import {Space} from '../../components/Space/Space' +import {Button, Spacer, Text} from '../../../components' +import {Space} from '../../../components/Space/Space' import {FailedTxImage} from './FailedTxImage' export const FailedTxScreen = () => { diff --git a/apps/wallet-mobile/src/Staking/PoolDetails/PoolDetailScreen.stories.tsx b/apps/wallet-mobile/src/legacy/Staking/PoolDetails/PoolDetailScreen.stories.tsx similarity index 100% rename from apps/wallet-mobile/src/Staking/PoolDetails/PoolDetailScreen.stories.tsx rename to apps/wallet-mobile/src/legacy/Staking/PoolDetails/PoolDetailScreen.stories.tsx diff --git a/apps/wallet-mobile/src/Staking/PoolDetails/PoolDetailScreen.tsx b/apps/wallet-mobile/src/legacy/Staking/PoolDetails/PoolDetailScreen.tsx similarity index 97% rename from apps/wallet-mobile/src/Staking/PoolDetails/PoolDetailScreen.tsx rename to apps/wallet-mobile/src/legacy/Staking/PoolDetails/PoolDetailScreen.tsx index f331d64348..441dc31e28 100644 --- a/apps/wallet-mobile/src/Staking/PoolDetails/PoolDetailScreen.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/PoolDetails/PoolDetailScreen.tsx @@ -3,7 +3,7 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {StyleSheet, View} from 'react-native' -import {Button, Text, TextInput} from '../../components' +import {Button, Text, TextInput} from '../../../components' type Props = { onPressDelegate: (poolHash: string) => void diff --git a/apps/wallet-mobile/src/Staking/PoolDetails/index.ts b/apps/wallet-mobile/src/legacy/Staking/PoolDetails/index.ts similarity index 100% rename from apps/wallet-mobile/src/Staking/PoolDetails/index.ts rename to apps/wallet-mobile/src/legacy/Staking/PoolDetails/index.ts diff --git a/apps/wallet-mobile/src/Staking/PoolTransition/PoolTransitionModal.stories.tsx b/apps/wallet-mobile/src/legacy/Staking/PoolTransition/PoolTransitionModal.stories.tsx similarity index 100% rename from apps/wallet-mobile/src/Staking/PoolTransition/PoolTransitionModal.stories.tsx rename to apps/wallet-mobile/src/legacy/Staking/PoolTransition/PoolTransitionModal.stories.tsx diff --git a/apps/wallet-mobile/src/Staking/PoolTransition/PoolTransitionModal.tsx b/apps/wallet-mobile/src/legacy/Staking/PoolTransition/PoolTransitionModal.tsx similarity index 97% rename from apps/wallet-mobile/src/Staking/PoolTransition/PoolTransitionModal.tsx rename to apps/wallet-mobile/src/legacy/Staking/PoolTransition/PoolTransitionModal.tsx index 003e81bf6a..6df44f901b 100644 --- a/apps/wallet-mobile/src/Staking/PoolTransition/PoolTransitionModal.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/PoolTransition/PoolTransitionModal.tsx @@ -4,9 +4,9 @@ import * as React from 'react' import {Image, StyleSheet, Text, View, ViewProps} from 'react-native' import LinearGradient from 'react-native-linear-gradient' -import {Button, Icon, useModal} from '../../components' -import {Space} from '../../components/Space/Space' -import {formatTimeSpan} from '../../yoroi-wallets/utils' +import {Button, Icon, useModal} from '../../../components' +import {Space} from '../../../components/Space/Space' +import {formatTimeSpan} from '../../../yoroi-wallets/utils' import {useStrings} from './usePoolTransition' export const PoolTransitionModal = ({ diff --git a/apps/wallet-mobile/src/Staking/PoolTransition/PoolTransitionNotice.tsx b/apps/wallet-mobile/src/legacy/Staking/PoolTransition/PoolTransitionNotice.tsx similarity index 92% rename from apps/wallet-mobile/src/Staking/PoolTransition/PoolTransitionNotice.tsx rename to apps/wallet-mobile/src/legacy/Staking/PoolTransition/PoolTransitionNotice.tsx index 3efc1f6403..7f5de45482 100644 --- a/apps/wallet-mobile/src/Staking/PoolTransition/PoolTransitionNotice.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/PoolTransition/PoolTransitionNotice.tsx @@ -2,9 +2,9 @@ import {useTheme} from '@yoroi/theme' import * as React from 'react' import {StyleSheet, Text, View, ViewProps} from 'react-native' -import {Button, Icon} from '../../components' -import {Space} from '../../components/Space/Space' -import {formatTimeSpan} from '../../yoroi-wallets/utils' +import {Button, Icon} from '../../../components' +import {Space} from '../../../components/Space/Space' +import {formatTimeSpan} from '../../../yoroi-wallets/utils' import {usePoolTransition, useStrings} from './usePoolTransition' export const PoolTransitionNotice = () => { diff --git a/apps/wallet-mobile/src/Staking/PoolTransition/usePoolTransition.tsx b/apps/wallet-mobile/src/legacy/Staking/PoolTransition/usePoolTransition.tsx similarity index 95% rename from apps/wallet-mobile/src/Staking/PoolTransition/usePoolTransition.tsx rename to apps/wallet-mobile/src/legacy/Staking/PoolTransition/usePoolTransition.tsx index e64759cbec..f4bb5d6a32 100644 --- a/apps/wallet-mobile/src/Staking/PoolTransition/usePoolTransition.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/PoolTransition/usePoolTransition.tsx @@ -6,11 +6,11 @@ import * as React from 'react' import {defineMessages, useIntl} from 'react-intl' import {useQuery} from 'react-query' +import {features} from '../../../features' +import {useSelectedWallet} from '../../../features/WalletManager/context/SelectedWalletContext' +import {YoroiWallet} from '../../../yoroi-wallets/cardano/types' +import {asQuantity, Quantities} from '../../../yoroi-wallets/utils' import {useStakingInfo} from '../../Dashboard/StakePoolInfos' -import {features} from '../../features' -import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' -import {YoroiWallet} from '../../yoroi-wallets/cardano/types' -import {asQuantity, Quantities} from '../../yoroi-wallets/utils' const createDelegationTx = async (wallet: YoroiWallet, poolId: string) => { const accountStates = await wallet.fetchAccountState() diff --git a/apps/wallet-mobile/src/Staking/PoolTransition/usePoolTransitionModal.tsx b/apps/wallet-mobile/src/legacy/Staking/PoolTransition/usePoolTransitionModal.tsx similarity index 94% rename from apps/wallet-mobile/src/Staking/PoolTransition/usePoolTransitionModal.tsx rename to apps/wallet-mobile/src/legacy/Staking/PoolTransition/usePoolTransitionModal.tsx index eaa793b2c1..db948d2b1e 100644 --- a/apps/wallet-mobile/src/Staking/PoolTransition/usePoolTransitionModal.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/PoolTransition/usePoolTransitionModal.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import {useModal} from '../../components' +import {useModal} from '../../../components' import {PoolTransitionModal} from './PoolTransitionModal' import {usePoolTransition, useStrings} from './usePoolTransition' diff --git a/apps/wallet-mobile/src/Staking/PoolWarningModal/PoolWarningModal.stories.tsx b/apps/wallet-mobile/src/legacy/Staking/PoolWarningModal/PoolWarningModal.stories.tsx similarity index 92% rename from apps/wallet-mobile/src/Staking/PoolWarningModal/PoolWarningModal.stories.tsx rename to apps/wallet-mobile/src/legacy/Staking/PoolWarningModal/PoolWarningModal.stories.tsx index a08abff6c6..e5080511d8 100644 --- a/apps/wallet-mobile/src/Staking/PoolWarningModal/PoolWarningModal.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/PoolWarningModal/PoolWarningModal.stories.tsx @@ -1,7 +1,7 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' -import {WithModalProps} from '../../../.storybook/decorators' +import {WithModalProps} from '../../../../.storybook/decorators' import {PoolWarningModal} from './PoolWarningModal' storiesOf('PoolWarningModal', module) diff --git a/apps/wallet-mobile/src/Staking/PoolWarningModal/PoolWarningModal.tsx b/apps/wallet-mobile/src/legacy/Staking/PoolWarningModal/PoolWarningModal.tsx similarity index 94% rename from apps/wallet-mobile/src/Staking/PoolWarningModal/PoolWarningModal.tsx rename to apps/wallet-mobile/src/legacy/Staking/PoolWarningModal/PoolWarningModal.tsx index 8da1cf8ead..71cbefa56a 100644 --- a/apps/wallet-mobile/src/Staking/PoolWarningModal/PoolWarningModal.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/PoolWarningModal/PoolWarningModal.tsx @@ -3,10 +3,10 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {Image, ScrollView, StyleSheet, TextStyle, View} from 'react-native' -import image from '../../assets/img/mnemonic_explanation.png' -import {Button, Text} from '../../components' -import {confirmationMessages} from '../../kernel/i18n/global-messages' -import {Modal} from '../../legacy/Modal' +import image from '../../../assets/img/mnemonic_explanation.png' +import {Button, Text} from '../../../components' +import {Modal} from '../../../components/legacy/Modal/Modal' +import {confirmationMessages} from '../../../kernel/i18n/global-messages' type Props = { visible: boolean diff --git a/apps/wallet-mobile/src/Staking/PoolWarningModal/index.ts b/apps/wallet-mobile/src/legacy/Staking/PoolWarningModal/index.ts similarity index 100% rename from apps/wallet-mobile/src/Staking/PoolWarningModal/index.ts rename to apps/wallet-mobile/src/legacy/Staking/PoolWarningModal/index.ts diff --git a/apps/wallet-mobile/src/Staking/StakingCenter/StakingCenter.stories.tsx b/apps/wallet-mobile/src/legacy/Staking/StakingCenter/StakingCenter.stories.tsx similarity index 89% rename from apps/wallet-mobile/src/Staking/StakingCenter/StakingCenter.stories.tsx rename to apps/wallet-mobile/src/legacy/Staking/StakingCenter/StakingCenter.stories.tsx index b2ab1f187b..b9429ee33f 100644 --- a/apps/wallet-mobile/src/Staking/StakingCenter/StakingCenter.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/StakingCenter/StakingCenter.stories.tsx @@ -2,8 +2,8 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' import {QueryClient, QueryClientProvider} from 'react-query' -import {SelectedWalletProvider} from '../../features/WalletManager/context/SelectedWalletContext' -import {mocks} from '../../yoroi-wallets/mocks' +import {SelectedWalletProvider} from '../../../features/WalletManager/context/SelectedWalletContext' +import {mocks} from '../../../yoroi-wallets/mocks' import {StakingCenter} from './StakingCenter' storiesOf('StakingCenter', module) diff --git a/apps/wallet-mobile/src/Staking/StakingCenter/StakingCenter.tsx b/apps/wallet-mobile/src/legacy/Staking/StakingCenter/StakingCenter.tsx similarity index 81% rename from apps/wallet-mobile/src/Staking/StakingCenter/StakingCenter.tsx rename to apps/wallet-mobile/src/legacy/Staking/StakingCenter/StakingCenter.tsx index b796357d63..4583b5e480 100644 --- a/apps/wallet-mobile/src/Staking/StakingCenter/StakingCenter.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/StakingCenter/StakingCenter.tsx @@ -5,19 +5,19 @@ import {defineMessages, useIntl} from 'react-intl' import {View} from 'react-native' import {WebView, WebViewMessageEvent} from 'react-native-webview' -import {PleaseWaitModal, Spacer} from '../../components' +import {PleaseWaitModal, Spacer} from '../../../components' +import {features} from '../../../features' +import {useSelectedWallet} from '../../../features/WalletManager/context/SelectedWalletContext' +import {showErrorDialog} from '../../../kernel/dialogs' +import {isDev, isNightly} from '../../../kernel/env' +import {useLanguage} from '../../../kernel/i18n' +import globalMessages from '../../../kernel/i18n/global-messages' +import {logger} from '../../../kernel/logger/logger' +import {useMetrics} from '../../../kernel/metrics/metricsManager' +import {StakingCenterRouteNavigation} from '../../../kernel/navigation' +import {NETWORKS} from '../../../yoroi-wallets/cardano/networks' +import {NotEnoughMoneyToSendError} from '../../../yoroi-wallets/cardano/types' import {useStakingTx} from '../../Dashboard/StakePoolInfos' -import {features} from '../../features' -import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' -import {showErrorDialog} from '../../kernel/dialogs' -import {isDev, isNightly} from '../../kernel/env' -import {useLanguage} from '../../kernel/i18n' -import globalMessages from '../../kernel/i18n/global-messages' -import {logger} from '../../kernel/logger/logger' -import {useMetrics} from '../../kernel/metrics/metricsManager' -import {StakingCenterRouteNavigation} from '../../kernel/navigation' -import {NETWORKS} from '../../yoroi-wallets/cardano/networks' -import {NotEnoughMoneyToSendError} from '../../yoroi-wallets/cardano/types' import {PoolDetailScreen} from '../PoolDetails' export const StakingCenter = () => { diff --git a/apps/wallet-mobile/src/Staking/StakingCenter/index.ts b/apps/wallet-mobile/src/legacy/Staking/StakingCenter/index.ts similarity index 100% rename from apps/wallet-mobile/src/Staking/StakingCenter/index.ts rename to apps/wallet-mobile/src/legacy/Staking/StakingCenter/index.ts diff --git a/apps/wallet-mobile/src/Staking/index.ts b/apps/wallet-mobile/src/legacy/Staking/index.ts similarity index 100% rename from apps/wallet-mobile/src/Staking/index.ts rename to apps/wallet-mobile/src/legacy/Staking/index.ts diff --git a/apps/wallet-mobile/src/TxHistory/ActionsBanner.tsx b/apps/wallet-mobile/src/legacy/TxHistory/ActionsBanner.tsx similarity index 88% rename from apps/wallet-mobile/src/TxHistory/ActionsBanner.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/ActionsBanner.tsx index 01883101ba..11cb713bb5 100644 --- a/apps/wallet-mobile/src/TxHistory/ActionsBanner.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/ActionsBanner.tsx @@ -7,19 +7,19 @@ import {useIntl} from 'react-intl' import {StyleSheet, TouchableOpacity, View} from 'react-native' import Animated, {FadeInDown, FadeOutDown, Layout} from 'react-native-reanimated' -import {useCopy} from '../../src/legacy/useCopy' -import {Icon, Spacer, Text} from '../components' -import {useReceive} from '../features/Receive/common/ReceiveProvider' -import {useMultipleAddressesInfo} from '../features/Receive/common/useMultipleAddressesInfo' -import {useReceiveAddressesStatus} from '../features/Receive/common/useReceiveAddressesStatus' -import {messages as receiveMessages} from '../features/Receive/common/useStrings' -import {useSwapForm} from '../features/Swap/common/SwapFormProvider' -import {useAddressModeManager} from '../features/WalletManager/common/useAddressModeManager' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' -import {actionMessages} from '../kernel/i18n/global-messages' -import {useMetrics} from '../kernel/metrics/metricsManager' -import {TxHistoryRouteNavigation} from '../kernel/navigation' -import {useTokenInfo} from '../yoroi-wallets/hooks' +import {Icon, Spacer, Text} from '../../components' +import {useReceive} from '../../features/Receive/common/ReceiveProvider' +import {useMultipleAddressesInfo} from '../../features/Receive/common/useMultipleAddressesInfo' +import {useReceiveAddressesStatus} from '../../features/Receive/common/useReceiveAddressesStatus' +import {messages as receiveMessages} from '../../features/Receive/common/useStrings' +import {useSwapForm} from '../../features/Swap/common/SwapFormProvider' +import {useAddressModeManager} from '../../features/WalletManager/common/useAddressModeManager' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' +import {useCopy} from '../../hooks/useCopy' +import {actionMessages} from '../../kernel/i18n/global-messages' +import {useMetrics} from '../../kernel/metrics/metricsManager' +import {TxHistoryRouteNavigation} from '../../kernel/navigation' +import {useTokenInfo} from '../../yoroi-wallets/hooks' export const ActionsBanner = ({disabled = false}: {disabled: boolean}) => { const {styles, colors} = useStyles() diff --git a/apps/wallet-mobile/src/TxHistory/AssetList/AssetList.tsx b/apps/wallet-mobile/src/legacy/TxHistory/AssetList/AssetList.tsx similarity index 81% rename from apps/wallet-mobile/src/TxHistory/AssetList/AssetList.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/AssetList/AssetList.tsx index 87a98e2037..9cfb6c5628 100644 --- a/apps/wallet-mobile/src/TxHistory/AssetList/AssetList.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/AssetList/AssetList.tsx @@ -6,14 +6,14 @@ import {Balance} from '@yoroi/types' import React from 'react' import {Linking, StyleSheet, TouchableOpacity, View} from 'react-native' -import {AmountItem, AmountItemProps} from '../../components/AmountItem/AmountItem' -import {Spacer} from '../../components/Spacer' -import {usePrivacyMode} from '../../features/Settings/PrivacyMode/PrivacyMode' -import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' -import {useMetrics} from '../../kernel/metrics/metricsManager' -import {sortTokenInfos} from '../../utils' -import {useBalances, useTokenInfos} from '../../yoroi-wallets/hooks' -import {Amounts} from '../../yoroi-wallets/utils' +import {AmountItem, AmountItemProps} from '../../../components/AmountItem/AmountItem' +import {Spacer} from '../../../components/Spacer' +import {usePrivacyMode} from '../../../features/Settings/PrivacyMode/PrivacyMode' +import {useSelectedWallet} from '../../../features/WalletManager/context/SelectedWalletContext' +import {useMetrics} from '../../../kernel/metrics/metricsManager' +import {useBalances, useTokenInfos} from '../../../yoroi-wallets/hooks' +import {Amounts} from '../../../yoroi-wallets/utils' +import {sortTokenInfos} from '../../../yoroi-wallets/utils/sorting' type ListProps = FlashListProps type Props = Partial & { diff --git a/apps/wallet-mobile/src/TxHistory/AssetList/ChipButton/ChipButton.stories.tsx b/apps/wallet-mobile/src/legacy/TxHistory/AssetList/ChipButton/ChipButton.stories.tsx similarity index 100% rename from apps/wallet-mobile/src/TxHistory/AssetList/ChipButton/ChipButton.stories.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/AssetList/ChipButton/ChipButton.stories.tsx diff --git a/apps/wallet-mobile/src/TxHistory/AssetList/ChipButton/ChipButton.tsx b/apps/wallet-mobile/src/legacy/TxHistory/AssetList/ChipButton/ChipButton.tsx similarity index 100% rename from apps/wallet-mobile/src/TxHistory/AssetList/ChipButton/ChipButton.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/AssetList/ChipButton/ChipButton.tsx diff --git a/apps/wallet-mobile/src/TxHistory/AssetList/ChipButton/index.ts b/apps/wallet-mobile/src/legacy/TxHistory/AssetList/ChipButton/index.ts similarity index 100% rename from apps/wallet-mobile/src/TxHistory/AssetList/ChipButton/index.ts rename to apps/wallet-mobile/src/legacy/TxHistory/AssetList/ChipButton/index.ts diff --git a/apps/wallet-mobile/src/TxHistory/AssetList/ChipButton/placeholder area.png b/apps/wallet-mobile/src/legacy/TxHistory/AssetList/ChipButton/placeholder area.png similarity index 100% rename from apps/wallet-mobile/src/TxHistory/AssetList/ChipButton/placeholder area.png rename to apps/wallet-mobile/src/legacy/TxHistory/AssetList/ChipButton/placeholder area.png diff --git a/apps/wallet-mobile/src/TxHistory/AssetList/FilterBalancesByType.stories.tsx b/apps/wallet-mobile/src/legacy/TxHistory/AssetList/FilterBalancesByType.stories.tsx similarity index 100% rename from apps/wallet-mobile/src/TxHistory/AssetList/FilterBalancesByType.stories.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/AssetList/FilterBalancesByType.stories.tsx diff --git a/apps/wallet-mobile/src/TxHistory/AssetList/FilterBalancesByType.tsx b/apps/wallet-mobile/src/legacy/TxHistory/AssetList/FilterBalancesByType.tsx similarity index 95% rename from apps/wallet-mobile/src/TxHistory/AssetList/FilterBalancesByType.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/AssetList/FilterBalancesByType.tsx index 7b15a40a74..6be4b4f0af 100644 --- a/apps/wallet-mobile/src/TxHistory/AssetList/FilterBalancesByType.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/AssetList/FilterBalancesByType.tsx @@ -2,7 +2,7 @@ import {useTheme} from '@yoroi/theme' import * as React from 'react' import {StyleSheet, View} from 'react-native' -import {Spacer} from '../../components/Spacer' +import {Spacer} from '../../../components/Spacer' import {ChipButton} from './ChipButton' type Props = { diff --git a/apps/wallet-mobile/src/TxHistory/AssetList/ListBalances.tsx b/apps/wallet-mobile/src/legacy/TxHistory/AssetList/ListBalances.tsx similarity index 90% rename from apps/wallet-mobile/src/TxHistory/AssetList/ListBalances.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/AssetList/ListBalances.tsx index 8fa331295e..5c994f984d 100644 --- a/apps/wallet-mobile/src/TxHistory/AssetList/ListBalances.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/AssetList/ListBalances.tsx @@ -7,12 +7,12 @@ import * as React from 'react' import {useIntl} from 'react-intl' import {Linking, StyleSheet, TouchableOpacity, View} from 'react-native' -import {Spacer} from '../../components/Spacer' -import {usePortfolioBalances} from '../../features/Portfolio/common/hooks/usePortfolioBalances' -import {TokenAmountItem, TokenAmountItemProps} from '../../features/Portfolio/common/TokenAmountItem/TokenAmountItem' -import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' -import globalMessages from '../../kernel/i18n/global-messages' -import {useMetrics} from '../../kernel/metrics/metricsManager' +import {Spacer} from '../../../components/Spacer' +import {usePortfolioBalances} from '../../../features/Portfolio/common/hooks/usePortfolioBalances' +import {TokenAmountItem, TokenAmountItemProps} from '../../../features/Portfolio/common/TokenAmountItem/TokenAmountItem' +import {useSelectedWallet} from '../../../features/WalletManager/context/SelectedWalletContext' +import globalMessages from '../../../kernel/i18n/global-messages' +import {useMetrics} from '../../../kernel/metrics/metricsManager' import {FilterBalancesByType} from './FilterBalancesByType' type ListProps = FlashListProps diff --git a/apps/wallet-mobile/src/TxHistory/AssetList/index.ts b/apps/wallet-mobile/src/legacy/TxHistory/AssetList/index.ts similarity index 100% rename from apps/wallet-mobile/src/TxHistory/AssetList/index.ts rename to apps/wallet-mobile/src/legacy/TxHistory/AssetList/index.ts diff --git a/apps/wallet-mobile/src/TxHistory/BalanceBanner.stories.tsx b/apps/wallet-mobile/src/legacy/TxHistory/BalanceBanner.stories.tsx similarity index 88% rename from apps/wallet-mobile/src/TxHistory/BalanceBanner.stories.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/BalanceBanner.stories.tsx index c78abbc85e..7c67851de1 100644 --- a/apps/wallet-mobile/src/TxHistory/BalanceBanner.stories.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/BalanceBanner.stories.tsx @@ -2,9 +2,9 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' import {View} from 'react-native' -import {QueryProvider} from '../../.storybook/decorators' -import {SelectedWalletProvider} from '../features/WalletManager/context/SelectedWalletContext' -import {mocks} from '../yoroi-wallets/mocks' +import {QueryProvider} from '../../../.storybook/decorators' +import {SelectedWalletProvider} from '../../features/WalletManager/context/SelectedWalletContext' +import {mocks} from '../../yoroi-wallets/mocks' import {BalanceBanner} from './BalanceBanner' storiesOf('BalanceBanner', module) diff --git a/apps/wallet-mobile/src/TxHistory/BalanceBanner.tsx b/apps/wallet-mobile/src/legacy/TxHistory/BalanceBanner.tsx similarity index 83% rename from apps/wallet-mobile/src/TxHistory/BalanceBanner.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/BalanceBanner.tsx index 42c2e12a7f..b349aad464 100644 --- a/apps/wallet-mobile/src/TxHistory/BalanceBanner.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/BalanceBanner.tsx @@ -4,12 +4,12 @@ import {Portfolio} from '@yoroi/types' import React from 'react' import {StyleSheet, Text, TouchableOpacity, View} from 'react-native' -import {ResetErrorRef, Spacer} from '../components' -import {Icon} from '../components/Icon' -import {PairedBalance} from '../components/PairedBalance/PairedBalance' -import {usePortfolioPrimaryBalance} from '../features/Portfolio/common/hooks/usePortfolioPrimaryBalance' -import {usePrivacyMode} from '../features/Settings/PrivacyMode/PrivacyMode' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' +import {ResetErrorRef, Spacer} from '../../components' +import {Icon} from '../../components/Icon' +import {PairedBalance} from '../../components/PairedBalance/PairedBalance' +import {usePortfolioPrimaryBalance} from '../../features/Portfolio/common/hooks/usePortfolioPrimaryBalance' +import {usePrivacyMode} from '../../features/Settings/PrivacyMode/PrivacyMode' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' export const BalanceBanner = React.forwardRef((_, ref) => { const wallet = useSelectedWallet() diff --git a/apps/wallet-mobile/src/TxHistory/CollapsibleHeader.tsx b/apps/wallet-mobile/src/legacy/TxHistory/CollapsibleHeader.tsx similarity index 100% rename from apps/wallet-mobile/src/TxHistory/CollapsibleHeader.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/CollapsibleHeader.tsx diff --git a/apps/wallet-mobile/src/TxHistory/LockedDeposit.tsx b/apps/wallet-mobile/src/legacy/TxHistory/LockedDeposit.tsx similarity index 83% rename from apps/wallet-mobile/src/TxHistory/LockedDeposit.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/LockedDeposit.tsx index b0df84d89b..1bb8dfd4a1 100644 --- a/apps/wallet-mobile/src/TxHistory/LockedDeposit.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/LockedDeposit.tsx @@ -4,11 +4,11 @@ import React from 'react' import {useIntl} from 'react-intl' import {StyleSheet, View} from 'react-native' -import {Spacer, Text} from '../components' -import {usePortfolioPrimaryBreakdown} from '../features/Portfolio/common/hooks/usePortfolioPrimaryBreakdown' -import {usePrivacyMode} from '../features/Settings/PrivacyMode/PrivacyMode' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' -import globalMessages from '../kernel/i18n/global-messages' +import {Spacer, Text} from '../../components' +import {usePortfolioPrimaryBreakdown} from '../../features/Portfolio/common/hooks/usePortfolioPrimaryBreakdown' +import {usePrivacyMode} from '../../features/Settings/PrivacyMode/PrivacyMode' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' +import globalMessages from '../../kernel/i18n/global-messages' export const LockedDeposit = ({ignorePrivacy = false}: {ignorePrivacy?: boolean}) => { const wallet = useSelectedWallet() diff --git a/apps/wallet-mobile/src/TxHistory/ModalInfo/ModalInfo.stories.tsx b/apps/wallet-mobile/src/legacy/TxHistory/ModalInfo/ModalInfo.stories.tsx similarity index 86% rename from apps/wallet-mobile/src/TxHistory/ModalInfo/ModalInfo.stories.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/ModalInfo/ModalInfo.stories.tsx index 9a954858f2..67e7c2f2d1 100644 --- a/apps/wallet-mobile/src/TxHistory/ModalInfo/ModalInfo.stories.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/ModalInfo/ModalInfo.stories.tsx @@ -2,7 +2,7 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' import {Text} from 'react-native' -import {WithModalProps} from '../../../.storybook/decorators' +import {WithModalProps} from '../../../../.storybook/decorators' import {ModalInfo} from './ModalInfo' storiesOf('Modal Info', module).add('default', () => ( diff --git a/apps/wallet-mobile/src/TxHistory/ModalInfo/ModalInfo.tsx b/apps/wallet-mobile/src/legacy/TxHistory/ModalInfo/ModalInfo.tsx similarity index 91% rename from apps/wallet-mobile/src/TxHistory/ModalInfo/ModalInfo.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/ModalInfo/ModalInfo.tsx index bc416c6a2e..4cf3f557c2 100644 --- a/apps/wallet-mobile/src/TxHistory/ModalInfo/ModalInfo.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/ModalInfo/ModalInfo.tsx @@ -3,8 +3,8 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {StyleSheet} from 'react-native' -import {Icon, Spacer} from '../../components' -import {Modal} from '../../legacy/Modal' +import {Icon, Spacer} from '../../../components' +import {Modal} from '../../../components/legacy/Modal/Modal' type Props = { visible: boolean diff --git a/apps/wallet-mobile/src/TxHistory/ModalInfo/index.ts b/apps/wallet-mobile/src/legacy/TxHistory/ModalInfo/index.ts similarity index 100% rename from apps/wallet-mobile/src/TxHistory/ModalInfo/index.ts rename to apps/wallet-mobile/src/legacy/TxHistory/ModalInfo/index.ts diff --git a/apps/wallet-mobile/src/TxHistory/SyncErrorBanner.tsx b/apps/wallet-mobile/src/legacy/TxHistory/SyncErrorBanner.tsx similarity index 87% rename from apps/wallet-mobile/src/TxHistory/SyncErrorBanner.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/SyncErrorBanner.tsx index 74c3c2f49f..58a7f1e1e9 100644 --- a/apps/wallet-mobile/src/TxHistory/SyncErrorBanner.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/SyncErrorBanner.tsx @@ -1,8 +1,8 @@ import React from 'react' import {useIntl} from 'react-intl' -import {Banner} from '../components' -import globalMessages from '../kernel/i18n/global-messages' +import {Banner} from '../../components' +import globalMessages from '../../kernel/i18n/global-messages' type Props = { showRefresh: boolean diff --git a/apps/wallet-mobile/src/TxHistory/TxDetails/AssetList.stories.tsx b/apps/wallet-mobile/src/legacy/TxHistory/TxDetails/AssetList.stories.tsx similarity index 90% rename from apps/wallet-mobile/src/TxHistory/TxDetails/AssetList.stories.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/TxDetails/AssetList.stories.tsx index 94d25abef6..cf11b679cf 100644 --- a/apps/wallet-mobile/src/TxHistory/TxDetails/AssetList.stories.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/TxDetails/AssetList.stories.tsx @@ -3,8 +3,8 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' import {QueryClient, QueryClientProvider} from 'react-query' -import {SelectedWalletProvider} from '../../features/WalletManager/context/SelectedWalletContext' -import {mocks} from '../../yoroi-wallets/mocks' +import {SelectedWalletProvider} from '../../../features/WalletManager/context/SelectedWalletContext' +import {mocks} from '../../../yoroi-wallets/mocks' import {AssetList} from './AssetList' import {useSendStyles} from './AssetListSend.style' import {useBaseStyles} from './Base.style' diff --git a/apps/wallet-mobile/src/TxHistory/TxDetails/AssetList.tsx b/apps/wallet-mobile/src/legacy/TxHistory/TxDetails/AssetList.tsx similarity index 83% rename from apps/wallet-mobile/src/TxHistory/TxDetails/AssetList.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/TxDetails/AssetList.tsx index fe6e8de1a0..06b853fef1 100644 --- a/apps/wallet-mobile/src/TxHistory/TxDetails/AssetList.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/TxDetails/AssetList.tsx @@ -2,15 +2,15 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {FlatList, Text, TouchableOpacity, View} from 'react-native' -import {Boundary} from '../../components' -import {usePrivacyMode} from '../../features/Settings/PrivacyMode/PrivacyMode' -import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' -import globalMessages, {txLabels} from '../../kernel/i18n/global-messages' -import {formatTokenAmount} from '../../legacy/format' -import {isEmptyString} from '../../utils' -import {CardanoTypes} from '../../yoroi-wallets/cardano/types' -import {useTokenInfo} from '../../yoroi-wallets/hooks' -import {asQuantity} from '../../yoroi-wallets/utils' +import {Boundary} from '../../../components' +import {usePrivacyMode} from '../../../features/Settings/PrivacyMode/PrivacyMode' +import {useSelectedWallet} from '../../../features/WalletManager/context/SelectedWalletContext' +import globalMessages, {txLabels} from '../../../kernel/i18n/global-messages' +import {isEmptyString} from '../../../kernel/utils' +import {CardanoTypes} from '../../../yoroi-wallets/cardano/types' +import {useTokenInfo} from '../../../yoroi-wallets/hooks' +import {asQuantity} from '../../../yoroi-wallets/utils' +import {formatTokenAmount} from '../../../yoroi-wallets/utils/format' type AssetListProps = { assets: Array diff --git a/apps/wallet-mobile/src/TxHistory/TxDetails/AssetListSend.style.ts b/apps/wallet-mobile/src/legacy/TxHistory/TxDetails/AssetListSend.style.ts similarity index 100% rename from apps/wallet-mobile/src/TxHistory/TxDetails/AssetListSend.style.ts rename to apps/wallet-mobile/src/legacy/TxHistory/TxDetails/AssetListSend.style.ts diff --git a/apps/wallet-mobile/src/TxHistory/TxDetails/AssetListTransaction.style.ts b/apps/wallet-mobile/src/legacy/TxHistory/TxDetails/AssetListTransaction.style.ts similarity index 100% rename from apps/wallet-mobile/src/TxHistory/TxDetails/AssetListTransaction.style.ts rename to apps/wallet-mobile/src/legacy/TxHistory/TxDetails/AssetListTransaction.style.ts diff --git a/apps/wallet-mobile/src/TxHistory/TxDetails/Base.style.ts b/apps/wallet-mobile/src/legacy/TxHistory/TxDetails/Base.style.ts similarity index 100% rename from apps/wallet-mobile/src/TxHistory/TxDetails/Base.style.ts rename to apps/wallet-mobile/src/legacy/TxHistory/TxDetails/Base.style.ts diff --git a/apps/wallet-mobile/src/TxHistory/TxDetails/TxDetails.stories.tsx b/apps/wallet-mobile/src/legacy/TxHistory/TxDetails/TxDetails.stories.tsx similarity index 87% rename from apps/wallet-mobile/src/TxHistory/TxDetails/TxDetails.stories.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/TxDetails/TxDetails.stories.tsx index 78344fc9c9..e0e689ea3d 100644 --- a/apps/wallet-mobile/src/TxHistory/TxDetails/TxDetails.stories.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/TxDetails/TxDetails.stories.tsx @@ -3,10 +3,10 @@ import {storiesOf} from '@storybook/react-native' import {AsyncStorageProvider} from '@yoroi/common' import React from 'react' -import {QueryProvider, RouteProvider} from '../../../.storybook/decorators' -import {SelectedWalletProvider} from '../../features/WalletManager/context/SelectedWalletContext' -import {rootStorage} from '../../kernel/storage/rootStorage' -import {mocks} from '../../yoroi-wallets/mocks' +import {QueryProvider, RouteProvider} from '../../../../.storybook/decorators' +import {SelectedWalletProvider} from '../../../features/WalletManager/context/SelectedWalletContext' +import {rootStorage} from '../../../kernel/storage/rootStorage' +import {mocks} from '../../../yoroi-wallets/mocks' import {TxDetails} from './TxDetails' storiesOf('TxDetails', module) diff --git a/apps/wallet-mobile/src/TxHistory/TxDetails/TxDetails.tsx b/apps/wallet-mobile/src/legacy/TxHistory/TxDetails/TxDetails.tsx similarity index 94% rename from apps/wallet-mobile/src/TxHistory/TxDetails/TxDetails.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/TxDetails/TxDetails.tsx index 5ba255803e..baf7f3a56d 100644 --- a/apps/wallet-mobile/src/TxHistory/TxDetails/TxDetails.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/TxDetails/TxDetails.tsx @@ -10,18 +10,18 @@ import {defineMessages, IntlShape, useIntl} from 'react-intl' import {LayoutAnimation, Linking, StyleSheet, TouchableOpacity, View, ViewProps} from 'react-native' import {ScrollView} from 'react-native-gesture-handler' -import {Banner, Boundary, Button, CopyButton, FadeIn, Icon, Text} from '../../components' -import AddressModal from '../../features/Receive/common/AddressModal/AddressModal' -import {usePrivacyMode} from '../../features/Settings/PrivacyMode/PrivacyMode' -import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' -import globalMessages from '../../kernel/i18n/global-messages' -import {formatDateAndTime, formatTokenWithSymbol} from '../../legacy/format' -import {isEmptyString} from '../../utils/utils' -import {MultiToken} from '../../yoroi-wallets/cardano/MultiToken' -import {CardanoTypes, YoroiWallet} from '../../yoroi-wallets/cardano/types' -import {useTipStatus, useTransactionInfos} from '../../yoroi-wallets/hooks' -import {TransactionInfo} from '../../yoroi-wallets/types' -import {asQuantity} from '../../yoroi-wallets/utils' +import {Banner, Boundary, Button, CopyButton, FadeIn, Icon, Text} from '../../../components' +import AddressModal from '../../../features/Receive/common/AddressModal/AddressModal' +import {usePrivacyMode} from '../../../features/Settings/PrivacyMode/PrivacyMode' +import {useSelectedWallet} from '../../../features/WalletManager/context/SelectedWalletContext' +import globalMessages from '../../../kernel/i18n/global-messages' +import {isEmptyString} from '../../../kernel/utils' +import {MultiToken} from '../../../yoroi-wallets/cardano/MultiToken' +import {CardanoTypes, YoroiWallet} from '../../../yoroi-wallets/cardano/types' +import {useTipStatus, useTransactionInfos} from '../../../yoroi-wallets/hooks' +import {TransactionInfo} from '../../../yoroi-wallets/types' +import {asQuantity} from '../../../yoroi-wallets/utils' +import {formatDateAndTime, formatTokenWithSymbol} from '../../../yoroi-wallets/utils/format' import {AssetList} from './AssetList' import {useAssetListStyles} from './AssetListTransaction.style' diff --git a/apps/wallet-mobile/src/TxHistory/TxDetails/index.ts b/apps/wallet-mobile/src/legacy/TxHistory/TxDetails/index.ts similarity index 100% rename from apps/wallet-mobile/src/TxHistory/TxDetails/index.ts rename to apps/wallet-mobile/src/legacy/TxHistory/TxDetails/index.ts diff --git a/apps/wallet-mobile/src/TxHistory/TxHistory.stories.tsx b/apps/wallet-mobile/src/legacy/TxHistory/TxHistory.stories.tsx similarity index 89% rename from apps/wallet-mobile/src/TxHistory/TxHistory.stories.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/TxHistory.stories.tsx index 0c0758890b..94c611bb28 100644 --- a/apps/wallet-mobile/src/TxHistory/TxHistory.stories.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/TxHistory.stories.tsx @@ -2,9 +2,9 @@ import {storiesOf} from '@storybook/react-native' import {TransferProvider} from '@yoroi/transfer' import React from 'react' -import {QueryProvider} from '../../.storybook/decorators' -import {SelectedWalletProvider} from '../features/WalletManager/context/SelectedWalletContext' -import {mocks} from '../yoroi-wallets/mocks' +import {QueryProvider} from '../../../.storybook/decorators' +import {SelectedWalletProvider} from '../../features/WalletManager/context/SelectedWalletContext' +import {mocks} from '../../yoroi-wallets/mocks' import {TxHistory} from './TxHistory' storiesOf('V2/TxHistory', module) diff --git a/apps/wallet-mobile/src/TxHistory/TxHistory.tsx b/apps/wallet-mobile/src/legacy/TxHistory/TxHistory.tsx similarity index 91% rename from apps/wallet-mobile/src/TxHistory/TxHistory.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/TxHistory.tsx index 36ae13db48..10d27d28fe 100644 --- a/apps/wallet-mobile/src/TxHistory/TxHistory.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/TxHistory.tsx @@ -3,14 +3,14 @@ import * as React from 'react' import {defineMessages, useIntl} from 'react-intl' import {LayoutAnimation, StyleSheet, View} from 'react-native' -import infoIcon from '../assets/img/icon/info-light-green.png' -import {Boundary, Spacer} from '../components' -import {Tab, TabPanel, TabPanels, Tabs} from '../components/Tabs' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' -import {assetMessages, txLabels} from '../kernel/i18n/global-messages' +import infoIcon from '../../assets/img/icon/info-light-green.png' +import {Boundary, Spacer} from '../../components' +import {Tab, TabPanel, TabPanels, Tabs} from '../../components/Tabs' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' +import {assetMessages, txLabels} from '../../kernel/i18n/global-messages' +import {isByron} from '../../yoroi-wallets/cardano/utils' +import {useSync} from '../../yoroi-wallets/hooks' import {usePoolTransitionModal} from '../Staking/PoolTransition/usePoolTransitionModal' -import {isByron} from '../yoroi-wallets/cardano/utils' -import {useSync} from '../yoroi-wallets/hooks' import {ActionsBanner} from './ActionsBanner' import {ListBalances} from './AssetList/ListBalances' import {BalanceBanner} from './BalanceBanner' diff --git a/apps/wallet-mobile/src/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.stories.tsx b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.stories.tsx similarity index 85% rename from apps/wallet-mobile/src/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.stories.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.stories.tsx index 2bf3e202ef..b9972de45c 100644 --- a/apps/wallet-mobile/src/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.stories.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.stories.tsx @@ -2,7 +2,7 @@ import {action} from '@storybook/addon-actions' import {storiesOf} from '@storybook/react-native' import React from 'react' -import {ActionsBanner} from '../ActionsBanner' +import {ActionsBanner} from '.' storiesOf('V2/TxHistoryList/ActionsBanner', module).add('Transactions', () => ( diff --git a/apps/wallet-mobile/src/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.tsx b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.tsx similarity index 93% rename from apps/wallet-mobile/src/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.tsx index e416b1dfbb..e38bc6f66f 100644 --- a/apps/wallet-mobile/src/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/ActionsBanner/ActionsBanner.tsx @@ -2,8 +2,8 @@ import {useTheme} from '@yoroi/theme' import React from 'react' import {StyleSheet, TouchableOpacity, View} from 'react-native' -import {Icon} from '../../../components' -import {features} from '../../../features' +import {Icon} from '../../../../components' +import {features} from '../../../../features' import {LockedDeposit} from '../../LockedDeposit' type Props = { diff --git a/apps/wallet-mobile/src/TxHistory/TxHistoryList/ActionsBanner/index.ts b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/ActionsBanner/index.ts similarity index 100% rename from apps/wallet-mobile/src/TxHistory/TxHistoryList/ActionsBanner/index.ts rename to apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/ActionsBanner/index.ts diff --git a/apps/wallet-mobile/src/TxHistory/TxHistoryList/EmptyHistory.tsx b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/EmptyHistory.tsx similarity index 96% rename from apps/wallet-mobile/src/TxHistory/TxHistoryList/EmptyHistory.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/EmptyHistory.tsx index 62588d9a38..3a45b260c7 100644 --- a/apps/wallet-mobile/src/TxHistory/TxHistoryList/EmptyHistory.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/EmptyHistory.tsx @@ -3,8 +3,8 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {Image, StyleSheet, Text, View} from 'react-native' +import {Spacer} from '../../../components/Spacer' import image from '../../assets/img/no_transactions.png' -import {Spacer} from '../../components/Spacer' export const EmptyHistory = () => { const strings = useStrings() diff --git a/apps/wallet-mobile/src/TxHistory/TxHistoryList/TxHistoryList.tsx b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/TxHistoryList.tsx similarity index 84% rename from apps/wallet-mobile/src/TxHistory/TxHistoryList/TxHistoryList.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/TxHistoryList.tsx index f00c042bf0..a9d3d5b1af 100644 --- a/apps/wallet-mobile/src/TxHistory/TxHistoryList/TxHistoryList.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/TxHistoryList.tsx @@ -5,12 +5,12 @@ import _ from 'lodash' import React from 'react' import {StyleSheet, View} from 'react-native' -import {Spacer} from '../../components' -import {ShowBuyBanner} from '../../features/Exchange/common/ShowBuyBanner/ShowBuyBanner' -import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' -import {useMetrics} from '../../kernel/metrics/metricsManager' -import {useTransactionInfos} from '../../yoroi-wallets/hooks' -import {TransactionInfo} from '../../yoroi-wallets/types' +import {Spacer} from '../../../components' +import {ShowBuyBanner} from '../../../features/Exchange/common/ShowBuyBanner/ShowBuyBanner' +import {useSelectedWallet} from '../../../features/WalletManager/context/SelectedWalletContext' +import {useMetrics} from '../../../kernel/metrics/metricsManager' +import {useTransactionInfos} from '../../../yoroi-wallets/hooks' +import {TransactionInfo} from '../../../yoroi-wallets/types' import {TxHistoryListItem} from './TxHistoryListItem' type Props = Partial> diff --git a/apps/wallet-mobile/src/TxHistory/TxHistoryList/TxHistoryListItem.tsx b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/TxHistoryListItem.tsx similarity index 90% rename from apps/wallet-mobile/src/TxHistory/TxHistoryList/TxHistoryListItem.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/TxHistoryListItem.tsx index 3171b014bc..d762fa2de1 100644 --- a/apps/wallet-mobile/src/TxHistory/TxHistoryList/TxHistoryListItem.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/TxHistoryListItem.tsx @@ -8,18 +8,22 @@ import React from 'react' import {defineMessages, MessageDescriptor, useIntl} from 'react-intl' import {StyleSheet, TouchableOpacity, View, ViewProps} from 'react-native' -import {Spacer, Text} from '../../components' -import {Icon} from '../../components/Icon' -import {usePrivacyMode} from '../../features/Settings/PrivacyMode/PrivacyMode' -import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' -import {TxHistoryRouteNavigation} from '../../kernel/navigation' -import {formatDateRelative, formatTime, formatTokenFractional, formatTokenInteger} from '../../legacy/format' -import utfSymbols from '../../legacy/utfSymbols' -import {isEmptyString} from '../../utils/utils' -import {MultiToken} from '../../yoroi-wallets/cardano/MultiToken' -import {YoroiWallet} from '../../yoroi-wallets/cardano/types' -import {IOData, TransactionAssurance, TransactionDirection, TransactionInfo} from '../../yoroi-wallets/types' -import {asQuantity} from '../../yoroi-wallets/utils' +import {Spacer, Text} from '../../../components' +import {Icon} from '../../../components/Icon' +import {usePrivacyMode} from '../../../features/Settings/PrivacyMode/PrivacyMode' +import {useSelectedWallet} from '../../../features/WalletManager/context/SelectedWalletContext' +import {TxHistoryRouteNavigation} from '../../../kernel/navigation' +import {isEmptyString} from '../../../kernel/utils' +import {MultiToken} from '../../../yoroi-wallets/cardano/MultiToken' +import {YoroiWallet} from '../../../yoroi-wallets/cardano/types' +import {IOData, TransactionAssurance, TransactionDirection, TransactionInfo} from '../../../yoroi-wallets/types' +import {asQuantity} from '../../../yoroi-wallets/utils' +import { + formatDateRelative, + formatTime, + formatTokenFractional, + formatTokenInteger, +} from '../../../yoroi-wallets/utils/format' type Props = { transaction: TransactionInfo @@ -132,7 +136,7 @@ const Amount = ({wallet, transaction}: {wallet: YoroiWallet; transaction: Transa - {`${utfSymbols.NBSP}${wallet.primaryTokenInfo.symbol}`} + {` ${wallet.primaryTokenInfo.symbol}`} ) } diff --git a/apps/wallet-mobile/src/TxHistory/TxHistoryList/index.ts b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/index.ts similarity index 100% rename from apps/wallet-mobile/src/TxHistory/TxHistoryList/index.ts rename to apps/wallet-mobile/src/legacy/TxHistory/TxHistoryList/index.ts diff --git a/apps/wallet-mobile/src/TxHistory/TxHistoryNavigator.tsx b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryNavigator.tsx similarity index 87% rename from apps/wallet-mobile/src/TxHistory/TxHistoryNavigator.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/TxHistoryNavigator.tsx index de32a489b8..2b92a96e0f 100644 --- a/apps/wallet-mobile/src/TxHistory/TxHistoryNavigator.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/TxHistoryNavigator.tsx @@ -18,48 +18,48 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {StyleSheet, Text, TouchableOpacity, TouchableOpacityProps, View, ViewProps} from 'react-native' -import {Boundary, Icon, Spacer} from '../components' -import {claimApiMaker} from '../features/Claim/module/api' -import {ClaimProvider} from '../features/Claim/module/ClaimProvider' -import {ShowSuccessScreen} from '../features/Claim/useCases/ShowSuccessScreen' -import {CreateExchangeOrderScreen} from '../features/Exchange/useCases/CreateExchangeOrderScreen/CreateExchangeOrderScreen' -import {SelectProviderFromListScreen} from '../features/Exchange/useCases/SelectProviderFromListScreen/SelectProviderFromListScreen' -import {ShowExchangeResultOrderScreen} from '../features/Exchange/useCases/ShowExchangeResultOrderScreen/ShowExchangeResultOrderScreen' -import {ReceiveProvider} from '../features/Receive/common/ReceiveProvider' -import {DescribeSelectedAddressScreen} from '../features/Receive/useCases/DescribeSelectedAddressScreen' -import {ListMultipleAddressesScreen} from '../features/Receive/useCases/ListMultipleAddressesScreen' -import {RequestSpecificAmountScreen} from '../features/Receive/useCases/RequestSpecificAmountScreen' -import {CodeScannerButton} from '../features/Scan/common/CodeScannerButton' -import {ScanCodeScreen} from '../features/Scan/useCases/ScanCodeScreen' -import {ShowCameraPermissionDeniedScreen} from '../features/Scan/useCases/ShowCameraPermissionDeniedScreen/ShowCameraPermissionDeniedScreen' -import {ConfirmTxScreen} from '../features/Send/useCases/ConfirmTx/ConfirmTxScreen' -import {FailedTxScreen} from '../features/Send/useCases/ConfirmTx/FailedTx/FailedTxScreen' -import {SubmittedTxScreen} from '../features/Send/useCases/ConfirmTx/SubmittedTx/SubmittedTxScreen' -import {ListAmountsToSendScreen} from '../features/Send/useCases/ListAmountsToSend' -import {SelectTokenFromListScreen} from '../features/Send/useCases/ListAmountsToSend/AddToken/SelectTokenFromListScreen' -import {EditAmountScreen} from '../features/Send/useCases/ListAmountsToSend/EditAmount/EditAmountScreen' -import {StartMultiTokenTxScreen} from '../features/Send/useCases/StartMultiTokenTx/StartMultiTokenTxScreen' -import {SwapFormProvider} from '../features/Swap/common/SwapFormProvider' -import {SwapTabNavigator} from '../features/Swap/SwapNavigator' +import {Boundary, Icon, Spacer} from '../../components' +import {claimApiMaker} from '../../features/Claim/module/api' +import {ClaimProvider} from '../../features/Claim/module/ClaimProvider' +import {ShowSuccessScreen} from '../../features/Claim/useCases/ShowSuccessScreen' +import {CreateExchangeOrderScreen} from '../../features/Exchange/useCases/CreateExchangeOrderScreen/CreateExchangeOrderScreen' +import {SelectProviderFromListScreen} from '../../features/Exchange/useCases/SelectProviderFromListScreen/SelectProviderFromListScreen' +import {ShowExchangeResultOrderScreen} from '../../features/Exchange/useCases/ShowExchangeResultOrderScreen/ShowExchangeResultOrderScreen' +import {ReceiveProvider} from '../../features/Receive/common/ReceiveProvider' +import {DescribeSelectedAddressScreen} from '../../features/Receive/useCases/DescribeSelectedAddressScreen' +import {ListMultipleAddressesScreen} from '../../features/Receive/useCases/ListMultipleAddressesScreen' +import {RequestSpecificAmountScreen} from '../../features/Receive/useCases/RequestSpecificAmountScreen' +import {CodeScannerButton} from '../../features/Scan/common/CodeScannerButton' +import {ScanCodeScreen} from '../../features/Scan/useCases/ScanCodeScreen' +import {ShowCameraPermissionDeniedScreen} from '../../features/Scan/useCases/ShowCameraPermissionDeniedScreen/ShowCameraPermissionDeniedScreen' +import {ConfirmTxScreen} from '../../features/Send/useCases/ConfirmTx/ConfirmTxScreen' +import {FailedTxScreen} from '../../features/Send/useCases/ConfirmTx/FailedTx/FailedTxScreen' +import {SubmittedTxScreen} from '../../features/Send/useCases/ConfirmTx/SubmittedTx/SubmittedTxScreen' +import {ListAmountsToSendScreen} from '../../features/Send/useCases/ListAmountsToSend' +import {SelectTokenFromListScreen} from '../../features/Send/useCases/ListAmountsToSend/AddToken/SelectTokenFromListScreen' +import {EditAmountScreen} from '../../features/Send/useCases/ListAmountsToSend/EditAmount/EditAmountScreen' +import {StartMultiTokenTxScreen} from '../../features/Send/useCases/StartMultiTokenTx/StartMultiTokenTxScreen' +import {SwapFormProvider} from '../../features/Swap/common/SwapFormProvider' +import {SwapTabNavigator} from '../../features/Swap/SwapNavigator' import { ConfirmTxScreen as ConfirmTxSwapScreen, EditSlippageScreen, SelectPoolFromListScreen, ShowFailedTxScreen as FailedTxSwapScreen, ShowSubmittedTxScreen as SubmittedTxSwapScreen, -} from '../features/Swap/useCases' -import {SelectBuyTokenFromListScreen} from '../features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/SelectBuyTokenFromListScreen/SelectBuyTokenFromListScreen' -import {SelectSellTokenFromListScreen} from '../features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/SelectSellTokenFromListScreen/SelectSellTokenFromListScreen' -import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext' -import {unstoppableApiKey} from '../kernel/env' +} from '../../features/Swap/useCases' +import {SelectBuyTokenFromListScreen} from '../../features/Swap/useCases/StartSwapScreen/CreateOrder/EditBuyAmount/SelectBuyTokenFromListScreen/SelectBuyTokenFromListScreen' +import {SelectSellTokenFromListScreen} from '../../features/Swap/useCases/StartSwapScreen/CreateOrder/EditSellAmount/SelectSellTokenFromListScreen/SelectSellTokenFromListScreen' +import {useSelectedWallet} from '../../features/WalletManager/context/SelectedWalletContext' +import {unstoppableApiKey} from '../../kernel/env' import { BackButton, defaultStackNavigationOptions, TxHistoryRouteNavigation, TxHistoryRoutes, useWalletNavigation, -} from '../kernel/navigation' -import {useFrontendFees, useStakingKey, useWalletName} from '../yoroi-wallets/hooks' +} from '../../kernel/navigation' +import {useFrontendFees, useStakingKey, useWalletName} from '../../yoroi-wallets/hooks' import {ModalInfo} from './ModalInfo' import {TxDetails} from './TxDetails' import {TxHistory} from './TxHistory' diff --git a/apps/wallet-mobile/src/TxHistory/WarningBanner.tsx b/apps/wallet-mobile/src/legacy/TxHistory/WarningBanner.tsx similarity index 97% rename from apps/wallet-mobile/src/TxHistory/WarningBanner.tsx rename to apps/wallet-mobile/src/legacy/TxHistory/WarningBanner.tsx index ebc54676a1..7368f09edc 100644 --- a/apps/wallet-mobile/src/TxHistory/WarningBanner.tsx +++ b/apps/wallet-mobile/src/legacy/TxHistory/WarningBanner.tsx @@ -2,7 +2,7 @@ import {useTheme} from '@yoroi/theme' import React from 'react' import {Image, ImageSourcePropType, StyleSheet, TouchableOpacity, View, ViewStyle} from 'react-native' -import {Button, Icon, Text} from '../components' +import {Button, Icon, Text} from '../../components' type Props = { title: string diff --git a/apps/wallet-mobile/src/yoroi-wallets/memos/memosManager.test.ts b/apps/wallet-mobile/src/legacy/TxHistory/common/memos/memosManager.test.ts similarity index 92% rename from apps/wallet-mobile/src/yoroi-wallets/memos/memosManager.test.ts rename to apps/wallet-mobile/src/legacy/TxHistory/common/memos/memosManager.test.ts index 1c95fd78a1..0059dc1837 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/memos/memosManager.test.ts +++ b/apps/wallet-mobile/src/legacy/TxHistory/common/memos/memosManager.test.ts @@ -1,6 +1,6 @@ import AsyncStorage from '@react-native-async-storage/async-storage' -import {rootStorage} from '../../kernel/storage/rootStorage' +import {rootStorage} from '../../../../kernel/storage/rootStorage' import {makeMemosManager} from './memosManager' describe('memos manager', () => { diff --git a/apps/wallet-mobile/src/yoroi-wallets/memos/memosManager.ts b/apps/wallet-mobile/src/legacy/TxHistory/common/memos/memosManager.ts similarity index 100% rename from apps/wallet-mobile/src/yoroi-wallets/memos/memosManager.ts rename to apps/wallet-mobile/src/legacy/TxHistory/common/memos/memosManager.ts diff --git a/apps/wallet-mobile/src/TxHistory/index.ts b/apps/wallet-mobile/src/legacy/TxHistory/index.ts similarity index 100% rename from apps/wallet-mobile/src/TxHistory/index.ts rename to apps/wallet-mobile/src/legacy/TxHistory/index.ts diff --git a/apps/wallet-mobile/src/TxHistory/useOnScroll.ts b/apps/wallet-mobile/src/legacy/TxHistory/useOnScroll.ts similarity index 100% rename from apps/wallet-mobile/src/TxHistory/useOnScroll.ts rename to apps/wallet-mobile/src/legacy/TxHistory/useOnScroll.ts diff --git a/apps/wallet-mobile/src/legacy/utfSymbols.ts b/apps/wallet-mobile/src/legacy/utfSymbols.ts deleted file mode 100644 index 499a87a5ff..0000000000 --- a/apps/wallet-mobile/src/legacy/utfSymbols.ts +++ /dev/null @@ -1,24 +0,0 @@ -export const AUSTRAL = '₳' -export const ERASE_TO_LEFT = '⌫' -export const GEAR = '⚙' -export const X_CROSS = '×' -export const NBSP = '\u00A0' // non-breakable space -export const BOX_UNCHECKED = '☐' -export const BOX_CHECKED = '☑' - -export const ADA = AUSTRAL - -// key should be asset ticker -const CURRENCIES: {[id: string]: string} = { - ADA: AUSTRAL, -} - -export default { - CURRENCIES, - ERASE_TO_LEFT, - GEAR, - X_CROSS, - NBSP, - BOX_UNCHECKED, - BOX_CHECKED, -} diff --git a/apps/wallet-mobile/src/utils/debounceMaker.ts b/apps/wallet-mobile/src/utils/debounceMaker.ts deleted file mode 100644 index 436573610f..0000000000 --- a/apps/wallet-mobile/src/utils/debounceMaker.ts +++ /dev/null @@ -1,22 +0,0 @@ -export const debounceMaker = unknown>(callback: T, delay: number) => { - let timeoutId: NodeJS.Timeout | null = null - - const clear = () => { - if (timeoutId !== null) { - clearTimeout(timeoutId) - } - } - - const call = (...args: Parameters) => { - clear() - - timeoutId = setTimeout(() => { - callback(...args) - }, delay) - } - - return { - clear, - call, - } as const -} diff --git a/apps/wallet-mobile/src/utils/index.ts b/apps/wallet-mobile/src/utils/index.ts deleted file mode 100644 index 7ce21209e7..0000000000 --- a/apps/wallet-mobile/src/utils/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './sorting' -export * from './utils' diff --git a/apps/wallet-mobile/src/utils/utils.ts b/apps/wallet-mobile/src/utils/utils.ts deleted file mode 100644 index 7fa9e27f1a..0000000000 --- a/apps/wallet-mobile/src/utils/utils.ts +++ /dev/null @@ -1,42 +0,0 @@ -import {useFocusEffect} from '@react-navigation/native' -import {isBoolean} from '@yoroi/common' -import {isEmpty} from 'lodash' -import React from 'react' -import {Platform} from 'react-native' - -import {useScreenShareSettingEnabled} from '../features/Settings/ScreenShare' -import {changeScreenShareNativeSettingOnAndroid} from '../features/Settings/ScreenShare/ScreenShare' - -export function isEmptyString(value: string | null | undefined): value is '' | null | undefined { - return isEmpty(value) -} - -export function promiseAny(promises: Promise[]): Promise { - return new Promise((resolve, reject) => { - let rejectedCount = 0 - for (const promise of promises) { - promise.then(resolve).catch(() => { - rejectedCount++ - if (rejectedCount === promises.length) { - reject(new Error('All promises were rejected')) - } - }) - } - }) -} - -export const useAllowScreenshots = () => { - const {data: screenShareSettingEnabled} = useScreenShareSettingEnabled() - const callback = React.useCallback(() => { - if (Platform.OS !== 'android') return - if (!isBoolean(screenShareSettingEnabled) || screenShareSettingEnabled) return - - changeScreenShareNativeSettingOnAndroid(true) - return () => { - changeScreenShareNativeSettingOnAndroid(false) - } - }, [screenShareSettingEnabled]) - useFocusEffect(callback) -} - -export const makeList = (length = 0) => Array.from({length}).fill(1) diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/api/api.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/api/api.ts index 5c99e9151f..85e917b5d5 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/api/api.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/api/api.ts @@ -64,16 +64,6 @@ export const submitTransaction = async (signedTx: string, config: BackendConfig) } } -export const getTransactions = async ( - txids: Array, - config: BackendConfig, -): Promise> => { - const txs = await fetchDefault('v2/txs/get', {txHashes: txids}, config) - const entries: Array<[string, RawTransaction]> = Object.entries(txs) - - return Object.fromEntries(entries) -} - export const getAccountState = (request: AccountStateRequest, config: BackendConfig): Promise => { assert(request.addresses.length <= config.FETCH_UTXOS_MAX_ADDRESSES, 'getAccountState: too many addresses') return fetchDefault('account/state', request, config) diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/api/fetch.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/api/fetch.ts index 71907ebf50..4a05bce950 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/api/fetch.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/api/fetch.ts @@ -90,6 +90,9 @@ export const fetchDefault = >( checkResponse: options?.checkResponse ?? _checkResponse, headers, } + logger.debug(`fetchDefault: API call ${fullPath}`) + // when full request needs to be logged + // logger.debug(`fetchDefault: API call ${fullPath}`, {request}) return checkedFetch(request) } export default fetchDefault diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/api/tokenRegistry.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/api/tokenRegistry.ts index c7f504934a..357a403d19 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/api/tokenRegistry.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/api/tokenRegistry.ts @@ -2,7 +2,6 @@ import {createTypeGuardFromSchema} from '@yoroi/common' import {Balance} from '@yoroi/types' import {z} from 'zod' -import {promiseAny} from '../../../utils' import {BackendConfig} from '../../types' import {checkedFetch} from './fetch' import {getNFT} from './metadata' @@ -101,3 +100,17 @@ const TokenRegistryEntrySchema: z.ZodSchema = z.object({ }) const isTokenRegistryEntry = createTypeGuardFromSchema(TokenRegistryEntrySchema) + +function promiseAny(promises: Promise[]): Promise { + return new Promise((resolve, reject) => { + let rejectedCount = 0 + for (const promise of promises) { + promise.then(resolve).catch(() => { + rejectedCount++ + if (rejectedCount === promises.length) { + reject(new Error('All promises were rejected')) + } + }) + } + }) +} diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/api/utils.test.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/api/utils.test.ts index d934b02c64..44464bcea2 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/api/utils.test.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/api/utils.test.ts @@ -3,7 +3,6 @@ import {Balance} from '@yoroi/types' import {TokenRegistryEntry} from './tokenRegistry' import { fallbackTokenInfo, - hexToUtf8, toDisplayAssetName, tokenInfo, toPolicyId, @@ -94,7 +93,6 @@ describe('api utils', () => { it('hexToAscii/asciiToHex', () => { const hex = '61737365744e616d65' const ascii = 'assetName' - expect(hexToUtf8(hex)).toBe(ascii) expect(utf8ToHex(ascii)).toBe(hex) }) diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/api/utils.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/api/utils.ts index 973a58fe42..cff04c40d7 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/api/utils.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/api/utils.ts @@ -3,7 +3,7 @@ import {AssetNameUtils} from '@emurgo/yoroi-lib/dist/internals/utils/assets' import {Balance} from '@yoroi/types' import {Buffer} from 'memfs/lib/internal/buffer' -import {LegacyToken, YoroiTokenId} from '../../types' +import {LegacyToken} from '../../types' import {TokenRegistryEntry} from './tokenRegistry' export const tokenInfo = (entry: TokenRegistryEntry): Balance.TokenInfo => { @@ -84,12 +84,6 @@ export const toTokenId = (tokenIdentifier: string) => { return `${tokenSubject.slice(0, 56)}.${toAssetNameHex(tokenIdentifier)}` } -export const asTokenId = (tokenIdentifier: string): YoroiTokenId => { - const tokenSubject = toTokenSubject(tokenIdentifier) - return `${tokenSubject.slice(0, 56)}.${toAssetNameHex(tokenIdentifier)}` -} - -export const hexToUtf8 = (hex: string) => Buffer.from(hex, 'hex').toString('utf-8') export const utf8ToHex = (text: string) => Buffer.from(text, 'utf-8').toString('hex') export const toTokenInfo = (token: LegacyToken): Balance.TokenInfo => { diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/byron/ByronWallet.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/byron/ByronWallet.ts index 312bc5aef3..94e0377625 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/byron/ByronWallet.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/byron/ByronWallet.ts @@ -21,8 +21,8 @@ import LocalizableError from '../../../kernel/i18n/LocalizableError' import {logger} from '../../../kernel/logger/logger' import {makeWalletEncryptedStorage, WalletEncryptedStorage} from '../../../kernel/storage/EncryptedStorage' import {Keychain} from '../../../kernel/storage/Keychain' +import {makeMemosManager, MemosManager} from '../../../legacy/TxHistory/common/memos/memosManager' import {HWDeviceInfo} from '../../hw' -import {makeMemosManager, MemosManager} from '../../memos' import { AccountStateResponse, BackendConfig, @@ -45,7 +45,7 @@ import { YoroiSignedTx, YoroiUnsignedTx, } from '../../types' -import {asQuantity, genTimeToSlot, isMainnetNetworkId, Quantities, validatePassword} from '../../utils' +import {asQuantity, genTimeToSlot, Quantities, validatePassword} from '../../utils' import {Cardano, CardanoMobile} from '../../wallets' import * as legacyApi from '../api' import {calcLockedDeposit} from '../assetUtils' @@ -1235,7 +1235,7 @@ export class ByronWallet implements YoroiWallet { const apiUrl = this.getBackendConfig().TOKEN_INFO_SERVICE if (!apiUrl) throw new Error('invalid wallet') - const isMainnet = isMainnetNetworkId(this.networkId) + const isMainnet = this.isMainnet const isTestnet = !isMainnet if ((tokenId === '' || tokenId === 'ADA') && isMainnet) { diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/byron/plate.test.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/byron/plate.test.ts deleted file mode 100644 index a93220ca12..0000000000 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/byron/plate.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {generateByronPlateFromMnemonics} from './plate' - -const mnemonic = [ - 'dry balcony arctic what garbage sort', - 'cart shine egg lamp manual bottom', - 'slide assault bus', -].join(' ') - -const expectedPlate = { - addresses: ['Ae2tdPwUPEZKAx4zt8YLTGxrhX9L6R8QPWNeefZsPgwaigWab4mEw1ECUZ7'], - accountPlate: { - ImagePart: - '61942e0a01bd7eccff636a468e4d04bd05fe2169c2d26f83236ade661860d93e22c07ff007117555c6a15a92ac43f88e453d31c3b7a240dcd11ca3a7eba29321', - TextPart: 'SKBE-5478', - }, -} - -test('Byron plate', async () => { - const plate = await generateByronPlateFromMnemonics(mnemonic, 1) - expect(plate).toStrictEqual(expectedPlate) -}) diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/byron/plate.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/byron/plate.ts deleted file mode 100644 index a2ad556892..0000000000 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/byron/plate.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type {PlateResponse} from '../../types/other' -import {AddressType} from '../formatPath' -import {generateWalletRootKey} from '../mnemonic' -import {legacyWalletChecksum} from '../types' -import {getAccountFromMasterKey, getAddresses} from './util' - -export const generateByronPlateFromMnemonics = async (phrase: string, count: number): Promise => { - const rootKeyPtr = await generateWalletRootKey(phrase) - const rootKey = Buffer.from(await rootKeyPtr.asBytes()).toString('hex') - const account = await getAccountFromMasterKey(rootKey) - const displayAddrType: AddressType = 'External' - - const accountPlate = legacyWalletChecksum(account.root_cached_key) - const addresses = await getAddresses(account, displayAddrType, [...Array(count).keys()]) - return {addresses, accountPlate} -} diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/nfts.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/nfts.ts index 352d01ef02..8847e47467 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/nfts.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/nfts.ts @@ -4,7 +4,7 @@ import {Balance} from '@yoroi/types' import {z} from 'zod' import {features} from '../../features' -import {getAssetFingerprint} from '../../legacy/format' +import {getAssetFingerprint} from '../utils/format' import {toDisplayAssetName} from './api' export const convertNft = (options: { metadata?: unknown @@ -48,10 +48,6 @@ const normalizeProperty = (value: string | string[]): string => { return value } -export const isSvgMediaType = (mediaType: unknown): boolean => { - return mediaType === 'image/svg+xml' -} - export const getNftMainImageMediaType = (nft: Balance.TokenInfo): string | undefined => { const originalMetadata = nft.metadatas.mintNft return hasMediaTypeProperty(originalMetadata) ? normalizeProperty(originalMetadata.mediaType) : undefined diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/shelley/ShelleyWallet.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/shelley/ShelleyWallet.ts index 3fb9032f64..5b97a72bf5 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/shelley/ShelleyWallet.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/shelley/ShelleyWallet.ts @@ -23,8 +23,8 @@ import LocalizableError from '../../../kernel/i18n/LocalizableError' import {logger} from '../../../kernel/logger/logger' import {makeWalletEncryptedStorage, WalletEncryptedStorage} from '../../../kernel/storage/EncryptedStorage' import {Keychain} from '../../../kernel/storage/Keychain' +import {makeMemosManager, MemosManager} from '../../../legacy/TxHistory/common/memos/memosManager' import {HWDeviceInfo} from '../../hw' -import {makeMemosManager, MemosManager} from '../../memos' import type { AccountStateResponse, CurrencySymbol, diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/transactionManager/transactionManager.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/transactionManager/transactionManager.ts index 8960745757..4400962855 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/transactionManager/transactionManager.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/transactionManager/transactionManager.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/no-explicit-any */ -import {isArray, parseSafe} from '@yoroi/common' +import {isArray, parseSafe, PromiseAllLimited} from '@yoroi/common' import {App} from '@yoroi/types' import assert from 'assert' import {fromPairs, mapValues, max} from 'lodash' @@ -147,49 +147,52 @@ export async function syncTxs({ const lastTx = getLatestYoroiTransaction(Object.values(transactions)) // the way the addresses are arranged are make it slower (getting the same tx twice) - const tasks = addressesByChunks.map(async (addrs) => { - const taskResult: Array> = [] - let bestTx: TimeForTx | undefined - let isPaginating = false - let historyPayload = txHistoryPayloadFactory( - addrs, - { - // tip - bestBlockNum: bestBlock.height, - // current - from state txs saved - bestBlockHash: lastTx?.blockHash, - bestTxHash: lastTx?.txHash, - }, - bestBlock.hash!, - ) - - do { - const response = await api.fetchNewTxHistory(historyPayload, backendConfig) - taskResult.push(response.transactions) - - // next payload - isPaginating = !response.isLast - if (isPaginating) { - bestTx = getLatestApiTransaction(response.transactions) - historyPayload = txHistoryPayloadFactory( - addrs, - { - // tip - bestBlockNum: bestBlock.height, - // current - from api txs just received - bestBlockHash: bestTx?.blockHash, - bestTxHash: bestTx?.txHash, - }, - bestBlock.hash!, - ) - } - } while (isPaginating) - - return taskResult + const tasks = addressesByChunks.map((addrs) => { + const promise = async () => { + const taskResult: Array> = [] + let bestTx: TimeForTx | undefined + let isPaginating = false + let historyPayload = txHistoryPayloadFactory( + addrs, + { + // tip + bestBlockNum: bestBlock.height, + // current - from state txs saved + bestBlockHash: lastTx?.blockHash, + bestTxHash: lastTx?.txHash, + }, + bestBlock.hash!, + ) + + do { + const response = await api.fetchNewTxHistory(historyPayload, backendConfig) + taskResult.push(response.transactions) + + // next payload + isPaginating = !response.isLast + if (isPaginating) { + bestTx = getLatestApiTransaction(response.transactions) + historyPayload = txHistoryPayloadFactory( + addrs, + { + // tip + bestBlockNum: bestBlock.height, + // current - from api txs just received + bestBlockHash: bestTx?.blockHash, + bestTxHash: bestTx?.txHash, + }, + bestBlock.hash!, + ) + } + } while (isPaginating) + + return taskResult + } + return promise }) try { - const result = await Promise.all(tasks) + const result = await PromiseAllLimited(tasks, 4) const newTxs = result.flat(2).map((tx) => [tx.hash, toCachedTx(tx)]) // .map((tx) => processTxHistoryData(tx, addressesByChunks.flat(), 0, networkId)) diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/types.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/types.ts index ee81edc453..3843d0c23f 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/types.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/types.ts @@ -69,19 +69,6 @@ export type ServerStatus = { isQueueOnline?: boolean } -export type Block = { - height: number - epoch: number - slot: number - hash: string -} - -export type SignedTxLegacy = { - id: string - encodedTx: Uint8Array - base64: string -} - export type Pagination = { page: number limit: number diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/utils.ts b/apps/wallet-mobile/src/yoroi-wallets/cardano/utils.ts index 6c67870e36..5bb3356216 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/utils.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/utils.ts @@ -7,7 +7,6 @@ import {Buffer} from 'buffer' import {YoroiEntry} from '../types' import { - Addressing, BaseAsset, DERIVATION_TYPES, NetworkId, @@ -30,22 +29,6 @@ import {CardanoHaskellShelleyNetwork} from './networks' import {NUMBERS} from './numbers' import {CardanoTypes, WalletImplementation} from './types' -// need to format shelley addresses as base16 but only legacy addresses as base58 - -export const verifyFromBip44Root = (request: Addressing['addressing']) => { - const accountPosition = request.startLevel - - if (accountPosition !== NUMBERS.BIP44_DERIVATION_LEVELS.PURPOSE) { - throw new Error('verifyFromBip44Root: addressing does not start from root') - } - - const lastLevelSpecified = request.startLevel + request.path.length - 1 - - if (lastLevelSpecified !== NUMBERS.BIP44_DERIVATION_LEVELS.ADDRESS) { - throw new Error('verifyFromBip44Root: incorrect addressing size') - } -} - export const deriveRewardAddressHex = async (accountPubKeyHex: string, networkId: NetworkId): Promise => { const accountPubKeyPtr = await CardanoMobile.Bip32PublicKey.fromBytes(Buffer.from(accountPubKeyHex, 'hex')) const stakingKey = await ( @@ -175,8 +158,6 @@ export const isByron = (id: WalletImplementationId): boolean => id === WALLET_IM export const isHaskellShelley = (id: WalletImplementationId): boolean => id === HASKELL_SHELLEY.WALLET_IMPLEMENTATION_ID || id === HASKELL_SHELLEY_24.WALLET_IMPLEMENTATION_ID -export const isJormun = (id: WalletImplementationId): boolean => id === WALLET_IMPLEMENTATION_REGISTRY.JORMUNGANDR_ITN - export const getWalletConfigById = (id: WalletImplementationId): WalletImplementation => { const idx = Object.values(WALLET_IMPLEMENTATION_REGISTRY).indexOf(id) const walletKey = Object.keys(WALLET_IMPLEMENTATION_REGISTRY)[idx] @@ -288,13 +269,6 @@ export const isTokenInfo = (token: Balance.TokenInfo | DefaultAsset): token is B return !!(token as Balance.TokenInfo).kind } -export const selectFtOrThrow = (token: Balance.TokenInfo): Balance.TokenInfo => { - if (token.kind === 'ft') { - return token - } - throw new Error(`Token type "${token.kind}" is not a fungible token`) -} - export const generateCIP30UtxoCbor = async (utxo: RawUtxo) => { const txHash = await CardanoMobile.TransactionHash.fromBytes(Buffer.from(utxo.tx_hash, 'hex')) if (!txHash) throw new Error('Invalid tx hash') diff --git a/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts b/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts index 73d79b2c9d..70732b1669 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import {Certificate} from '@emurgo/cross-csl-core' import AsyncStorage, {AsyncStorageStatic} from '@react-native-async-storage/async-storage' -import {useNavigation} from '@react-navigation/native' import { mountMMKVStorage, observableStorageMaker, @@ -305,17 +304,6 @@ export const useTokenInfos = ( return results.reduce((result, {data}) => (data ? [...result, data] : result), [] as Array) } -export const useAllTokenInfos = ({wallet}: {wallet: YoroiWallet}) => { - const balances = useBalances(wallet) - - const tokenInfos = useTokenInfos({ - wallet, - tokenIds: Amounts.toArray(balances).map(({tokenId}) => tokenId), - }) - - return tokenInfos -} - export const usePlate = ({networkId, publicKeyHex}: {networkId: NetworkId; publicKeyHex: string}) => { const query = useQuery({ suspense: true, @@ -936,17 +924,6 @@ export const useSaveMemo = ( } } -export const useNfts = (wallet: YoroiWallet, options: UseQueryOptions = {}) => { - const assetIds = useAssetIds(wallet) - const results = useTokenInfosDetailed({wallet, tokenIds: assetIds}, options) - const nfts = results.map((r) => r.data).filter((t): t is Balance.TokenInfo => t?.kind === 'nft') - const isLoading = results.some((r) => r.isLoading) - const isError = results.some((r) => r.isError) - const error = results.find((r) => r.isError)?.error - const refetch = () => results.forEach((r) => r.refetch()) - return {nfts, refetch, error, isLoading, isError} -} - export const useNft = (wallet: YoroiWallet, {id}: {id: string}): Balance.TokenInfo => { const tokenInfo = useTokenInfo({wallet, tokenId: id}, {suspense: true}) @@ -956,19 +933,6 @@ export const useNft = (wallet: YoroiWallet, {id}: {id: string}): Balance.TokenIn return tokenInfo } -export const useIsWalletEmpty = (wallet: YoroiWallet) => { - const balances = useBalances(wallet) - return Amounts.toArray(balances).every(({quantity}) => Quantities.isZero(quantity)) -} -export function useHideBottomTabBar() { - const navigation = useNavigation() - - React.useLayoutEffect(() => { - navigation.getParent()?.setOptions({tabBarStyle: {display: 'none'}, tabBarVisible: false}) - return () => navigation.getParent()?.setOptions({tabBarStyle: true, tabBarVisible: undefined}) - }, [navigation]) -} - const supportedTypes = [ 'img/png', // Yeah, someone minted that 'image/png', @@ -1070,32 +1034,6 @@ export const useNativeAssetImage = ({ } } -type NativeAssetInvalidationRequest = { - networkId: NetworkId - policy: string - name: string -} -export const useNativeAssetInvalidation = ({networkId, policy, name}: NativeAssetInvalidationRequest) => { - const network = networkId === 300 ? 'preprod' : 'mainnet' - const mutation = useMutationWithInvalidations({ - invalidateQueries: [['native-asset-img', policy, name]], - mutationFn: async () => { - const response = await fetch(`https://${network}.processed-media.yoroiwallet.com/invalidate`, { - method: 'POST', - body: JSON.stringify({policy, name}), - }) - if (!response.ok) { - throw new Error(`NativeAsset invalid request body for policy=${policy} name=${name}`) - } - }, - }) - - return { - ...mutation, - invalidate: mutation.mutate, - } -} - export const useCreateGovernanceTx = ( wallet: YoroiWallet, options?: UseMutationOptions, diff --git a/apps/wallet-mobile/src/yoroi-wallets/memos/index.ts b/apps/wallet-mobile/src/yoroi-wallets/memos/index.ts deleted file mode 100644 index 4dd0539acc..0000000000 --- a/apps/wallet-mobile/src/yoroi-wallets/memos/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './memosManager' diff --git a/apps/wallet-mobile/src/yoroi-wallets/mocks/wallet.ts b/apps/wallet-mobile/src/yoroi-wallets/mocks/wallet.ts index a0d2e4ff7f..d7d4db67ef 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/mocks/wallet.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/mocks/wallet.ts @@ -10,7 +10,6 @@ import {noop} from 'lodash' import {Observable} from 'rxjs' import {WalletMeta} from '../../features/WalletManager/common/types' -import {getTokenFingerprint} from '../../legacy/format' import {fallbackTokenInfo, toTokenInfo, utf8ToHex} from '../cardano/api/utils' import * as HASKELL_SHELLEY_TESTNET from '../cardano/constants/testnet/constants' import { @@ -30,6 +29,7 @@ import { YoroiSignedTx, YoroiUnsignedTx, } from '../types' +import {getTokenFingerprint} from '../utils/format' import {CardanoMobile} from '../wallets' import {mockEncryptedStorage} from './storage' import {mockTransactionInfo, mockTransactionInfos} from './transaction' diff --git a/apps/wallet-mobile/src/yoroi-wallets/types/other.ts b/apps/wallet-mobile/src/yoroi-wallets/types/other.ts index e1ab999556..5cdb5e488b 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/types/other.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/types/other.ts @@ -1,6 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import {BigNumber} from 'bignumber.js' - +import {configCurrencies, supportedCurrencies} from '../../kernel/constants' import { WALLET_CONFIG as HASKELL_SHELLEY, WALLET_CONFIG_24 as HASKELL_SHELLEY_24, @@ -26,7 +25,6 @@ export type LegacyAddressing = { index: number } } -export type LegacyAddressedUtxo = RawUtxo & LegacyAddressing export type Addressing = { readonly addressing: { readonly path: Array @@ -48,62 +46,6 @@ export type TransactionInput = LegacyAddressing & { value: string } } -export type PreparedTransactionData = { - changeAddress: string - fee: BigNumber - inputs: Array - outputs: Array -} -export type V1SignedTx = { - cbor_encoded_tx: string - fee: BigNumber - changedUsed: boolean -} - -/** - * Jormungandr-era tx types - */ -// similar to yoroi-frontend's V3UnsignedTxUtxoResponse -export type V3UnsignedTxData = { - senderUtxos: Array - IOs: T - changeAddr: Array< - Addressing & { - address: string - value: void | BigNumber - } - > -} -// similar to yoroi-frontend's V3UnsignedTxAddressedUtxoResponse -export type V3UnsignedTxAddressedUtxoData = { - senderUtxos: Array - IOs: T - changeAddr: Array< - Addressing & { - address: string - value: void | BigNumber - } - > - certificate: void | any -} - -/** - * Haskell-Shelley-era tx types - */ -export type TxOutput = AddressObj & { - amount: MultiToken -} -export type V4UnsignedTxUtxoResponse = { - senderUtxos: Array - txBuilder: CardanoTypes.TransactionBuilder - changeAddr: Array -} -export type V4UnsignedTxAddressedUtxoResponse = { - senderUtxos: Array - txBuilder: CardanoTypes.TransactionBuilder - changeAddr: Array - certificates: ReadonlyArray -} /** * wallet types @@ -111,20 +53,10 @@ export type V4UnsignedTxAddressedUtxoResponse = { export type WalletState = { lastGeneratedAddressIndex: number } -export type EncryptionMethod = 'SYSTEM_PIN' | 'MASTER_PASSWORD' export type PlateResponse = { addresses: Array accountPlate: CardanoTypes.WalletChecksum } -export type ProtocolParameters = { - readonly linearFee: CardanoTypes.LinearFee - readonly minimumUtxoVal: CardanoTypes.BigNum - readonly poolDeposit: CardanoTypes.BigNum - readonly keyDeposit: CardanoTypes.BigNum - readonly networkId: number - readonly maxValueBytes?: number - readonly maxTxBytes?: number -} /** * API-related types @@ -159,26 +91,10 @@ export type AccountStateRequest = { } export type AccountStateResponse = Record -export type RemotePoolMetaFailure = { - error: Record -} export type PoolInfoRequest = { poolIds: Array } -// reputation -export type ReputationObject = { - node_flags?: number // note: could be more metrics that are not handled -} -export type ReputationResponse = Record -// serverstatus -export type ServerStatusResponse = { - isServerOk: boolean - isMaintenance: boolean - serverTime: number - // in milliseconds - isQueueOnline?: boolean -} // bestblock export type BestblockResponse = { height: number @@ -281,63 +197,10 @@ export type TxStatusResponse = { readonly submissionStatus?: Record } // Pricing api -export const supportedCurrencies = Object.freeze({ - ADA: 'ADA', - BRL: 'BRL', - BTC: 'BTC', - CNY: 'CNY', - ETH: 'ETH', - EUR: 'EUR', - JPY: 'JPY', - KRW: 'KRW', - USD: 'USD', -}) -export const supportedThemes = Object.freeze({ - system: 'system', - 'default-light': 'default-light', - 'default-dark': 'default-dark', -}) export type CurrencySymbol = keyof typeof supportedCurrencies export type ConfigCurrencies = typeof configCurrencies -export const configCurrencies = { - [supportedCurrencies.ADA]: { - decimals: 6, - nativeName: 'Cardano', - }, - [supportedCurrencies.BRL]: { - decimals: 2, - nativeName: 'Real', - }, - [supportedCurrencies.BTC]: { - decimals: 4, - nativeName: 'Bitcoin', - }, - [supportedCurrencies.CNY]: { - decimals: 2, - nativeName: '人民币', - }, - [supportedCurrencies.ETH]: { - decimals: 4, - nativeName: 'Ethereum', - }, - [supportedCurrencies.EUR]: { - decimals: 2, - nativeName: 'Euro', - }, - [supportedCurrencies.JPY]: { - decimals: 2, - nativeName: '日本円', - }, - [supportedCurrencies.KRW]: { - decimals: 2, - nativeName: '대한민국 원', - }, - [supportedCurrencies.USD]: { - decimals: 2, - nativeName: 'US Dollar', - }, -} + export type PriceResponse = { error: string | null ticker: { @@ -489,17 +352,3 @@ export type Transaction = { memo: string | null readonly metadata?: TxMetadata } - -export type CommonMetadata = { - readonly numberOfDecimals: number - readonly ticker: null | string - readonly longName: null | string - readonly maxSupply: null | string -} - -export type MultiAssetRequest = { - assets: Array<{ - nameHex: string - policy: string - }> -} diff --git a/apps/wallet-mobile/src/yoroi-wallets/types/staking.ts b/apps/wallet-mobile/src/yoroi-wallets/types/staking.ts index 2c0fe54f66..07a4f508ae 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/types/staking.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/types/staking.ts @@ -51,19 +51,6 @@ export type RemoteCertificate = { poolParams: Record // don't think this is relevant } -export type Certificate = - | 'StakeRegistration' - | 'StakeDeregistration' - | 'StakeDelegation' - | 'PoolRegistration' - | 'PoolRetirement' - | 'MoveInstantaneousRewardsCert' - -export type Withdrawal = { - address: string // hex - amount: string -} - export type RemoteCertificateMeta = | { kind: 'StakeRegistration' diff --git a/apps/wallet-mobile/src/yoroi-wallets/types/tokens.ts b/apps/wallet-mobile/src/yoroi-wallets/types/tokens.ts index 76e7cdbf28..f9f454d7db 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/types/tokens.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/types/tokens.ts @@ -20,16 +20,6 @@ export type Token = { metadata: TokenMetadata } -type SendToken = { - token: Token - amount: string // in lovelaces -} -type SendAllToken = { - token: Token - shouldSendAll: true -} -export type SendTokenList = Array - export type DefaultAssetMetadata = TokenCommonMetadata & { type: 'Cardano' policyId: string // empty string for ADA diff --git a/apps/wallet-mobile/src/yoroi-wallets/utils/amountUtils.test.ts b/apps/wallet-mobile/src/yoroi-wallets/utils/amountUtils.test.ts index 6a391faf75..f0e15ecd2b 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/utils/amountUtils.test.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/utils/amountUtils.test.ts @@ -6,7 +6,6 @@ import { stripAllButFirstDecimalSeparator, stripAllButLastDecimalSeparators, stripCommas, - stripExcessiveDecimals, stripInvalidCharacters, } from './amountUtils' @@ -45,12 +44,6 @@ describe('formatSeparatorWithoutDigits', () => { }) }) -describe('stripExcessiveDecimals', () => { - it('strips all decimal numbers after 6th', () => { - expect(stripExcessiveDecimals('123.12345678')).toBe('123.123456') - }) -}) - describe('stripAllButFirstDecimalSeparator', () => { it('strips all but first decimal separator', () => { expect(stripAllButFirstDecimalSeparator('123.125.67.8')).toBe('123.125678') diff --git a/apps/wallet-mobile/src/yoroi-wallets/utils/amountUtils.ts b/apps/wallet-mobile/src/yoroi-wallets/utils/amountUtils.ts index 2b696f1d5d..0b59487f4c 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/utils/amountUtils.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/utils/amountUtils.ts @@ -1,11 +1,5 @@ import {compose} from 'lodash/fp' -export const stripExcessiveDecimals = (number: string) => { - const separatorIndex = number.indexOf('.') - - return separatorIndex === -1 ? number : number.substring(0, separatorIndex + 1 + 6) -} - export const stripAllButLastDecimalSeparators = (number: string) => { const lastSeparatorIndex = number.lastIndexOf('.') if (lastSeparatorIndex !== -1) { diff --git a/apps/wallet-mobile/src/legacy/format.test.ts b/apps/wallet-mobile/src/yoroi-wallets/utils/format.test.ts similarity index 95% rename from apps/wallet-mobile/src/legacy/format.test.ts rename to apps/wallet-mobile/src/yoroi-wallets/utils/format.test.ts index 3c140805de..4264d2bb8b 100644 --- a/apps/wallet-mobile/src/legacy/format.test.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/utils/format.test.ts @@ -1,5 +1,5 @@ -import {PRIMARY_TOKEN} from '../yoroi-wallets/cardano/constants/mainnet/constants' -import {asQuantity} from '../yoroi-wallets/utils' +import {PRIMARY_TOKEN} from '../cardano/constants/mainnet/constants' +import {asQuantity} from '.' import {formatTokenAmount, formatTokenFractional, formatTokenInteger} from './format' const defaultCardanoAsset = PRIMARY_TOKEN diff --git a/apps/wallet-mobile/src/legacy/format.ts b/apps/wallet-mobile/src/yoroi-wallets/utils/format.ts similarity index 87% rename from apps/wallet-mobile/src/legacy/format.ts rename to apps/wallet-mobile/src/yoroi-wallets/utils/format.ts index 5e08c248ca..e8413b8fd6 100644 --- a/apps/wallet-mobile/src/legacy/format.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/utils/format.ts @@ -5,9 +5,8 @@ import {BigNumber} from 'bignumber.js' import type {IntlShape} from 'react-intl' import {defineMessages} from 'react-intl' -import {isTokenInfo} from '../yoroi-wallets/cardano/utils' -import {DefaultAsset, Token} from '../yoroi-wallets/types' -import utfSymbols from './utfSymbols' +import {isTokenInfo} from '../cardano/utils' +import {DefaultAsset, Token} from '../types' export const getTokenFingerprint = ({policyId, assetNameHex}: {policyId: string; assetNameHex: string}) => { const assetFingerprint = AssetFingerprint.fromParts(Buffer.from(policyId, 'hex'), Buffer.from(assetNameHex, 'hex')) @@ -32,7 +31,7 @@ const getTicker = (token: Balance.TokenInfo | DefaultAsset) => { } const getSymbol = (token: Balance.TokenInfo | DefaultAsset) => { const ticker = getTicker(token) - return (ticker && utfSymbols.CURRENCIES[ticker]) ?? ticker + return ticker } const getName = (token: Balance.TokenInfo | DefaultAsset) => { @@ -84,7 +83,7 @@ const getTokenV2Fingerprint = (token: Balance.TokenInfo | DefaultAsset): string export const formatTokenWithSymbol = (quantity: Balance.Quantity, token: Balance.TokenInfo | DefaultAsset): string => { const denomination = getSymbol(token) ?? getTokenV2Fingerprint(token) - return `${formatTokenAmount(quantity, token)}${utfSymbols.NBSP}${denomination}` + return `${formatTokenAmount(quantity, token)} ${denomination}` } // We assume that tickers are non-localized. If ticker doesn't exist, default // to identifier @@ -97,12 +96,12 @@ export const formatTokenWithText = ( if (isTokenInfo(token)) { switch (token.kind) { case 'nft': - return `${formatTokenAmount(quantity, token)}${utfSymbols.NBSP}${truncateWithEllipsis( + return `${formatTokenAmount(quantity, token)} ${truncateWithEllipsis( token.name || token.fingerprint, maxLength, )}` case 'ft': - return `${formatTokenAmount(quantity, token)}${utfSymbols.NBSP}${truncateWithEllipsis( + return `${formatTokenAmount(quantity, token)} ${truncateWithEllipsis( token.ticker || token.name || token.fingerprint, maxLength, )}` @@ -110,12 +109,7 @@ export const formatTokenWithText = ( } const tickerOrId = getTicker(token) || getName(token) || getTokenV2Fingerprint(token) - return `${formatTokenAmount(quantity, token)}${utfSymbols.NBSP}${tickerOrId}` -} - -export const formatTokenWithTextWhenHidden = (text: string, token: Balance.TokenInfo | DefaultAsset) => { - const tickerOrId = getTicker(token) || getName(token) || getTokenV2Fingerprint(token) - return `${text}${utfSymbols.NBSP}${tickerOrId}` + return `${formatTokenAmount(quantity, token)} ${tickerOrId}` } export const formatTokenInteger = (amount: Balance.Quantity, token: Token | DefaultAsset) => { @@ -157,7 +151,7 @@ const formatAda = (quantity: Balance.Quantity, defaultAsset: DefaultAsset) => { export const formatAdaWithText = (quantity: Balance.Quantity, defaultAsset: DefaultAsset) => { const defaultAssetMeta = defaultAsset.metadata - return `${formatAda(quantity, defaultAsset)}${utfSymbols.NBSP}${defaultAssetMeta.ticker}` + return `${formatAda(quantity, defaultAsset)} ${defaultAssetMeta.ticker}` } export const formatTime = (timestamp: string, intl: IntlShape) => { diff --git a/apps/wallet-mobile/src/yoroi-wallets/utils/index.ts b/apps/wallet-mobile/src/yoroi-wallets/utils/index.ts index 11296380ae..ff61e33984 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/utils/index.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/utils/index.ts @@ -1,5 +1,4 @@ export * from './amountUtils' -export * from './parsing' export * from './timeUtils' export * from './utils' export * from './validators' diff --git a/apps/wallet-mobile/src/yoroi-wallets/utils/parsing.test.ts b/apps/wallet-mobile/src/yoroi-wallets/utils/parsing.test.ts deleted file mode 100644 index 66fec0e955..0000000000 --- a/apps/wallet-mobile/src/yoroi-wallets/utils/parsing.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import {utf8ToHex} from '../cardano/api/utils' -import {PRIMARY_TOKEN} from '../cardano/constants/testnet/constants' -import {NETWORKS} from '../cardano/networks' -import {InvalidAssetAmount, parseAmountDecimal} from './parsing' - -describe('parseAdaDecimal', () => { - // recall: tests run on mainnet (default network) - const defaultAsset = PRIMARY_TOKEN - - it('throw exception on amount equal to 0', () => { - const zeroValues = ['0', '0.0', '0.000000'] - for (const value of zeroValues) { - expect(() => { - parseAmountDecimal(value, defaultAsset) - }).toThrow() - } - }) - - it('throw exception on ADA amount less than MINIMUM_UTXO_VAL', () => { - const minUtxoVal = parseInt(NETWORKS.HASKELL_SHELLEY.MINIMUM_UTXO_VAL, 10) - const numberOfDecimals = defaultAsset.metadata.numberOfDecimals - const values = ['0.1', `${minUtxoVal / numberOfDecimals - 0.1}`, `${minUtxoVal / numberOfDecimals - 0.000001}`] - for (const value of values) { - expect(() => { - parseAmountDecimal(value, defaultAsset) - }).toThrow(InvalidAssetAmount) - } - }) -}) - -describe('asciiToHex', () => { - it('converts "hello" to hex', () => { - const ascii = 'hello' - const hex = utf8ToHex(ascii) - expect(hex).toEqual('68656c6c6f') - }) - - it('converts empty string to empty string', () => { - const ascii = '' - const hex = utf8ToHex(ascii) - expect(hex).toEqual('') - }) -}) diff --git a/apps/wallet-mobile/src/yoroi-wallets/utils/parsing.ts b/apps/wallet-mobile/src/yoroi-wallets/utils/parsing.ts deleted file mode 100644 index b626010001..0000000000 --- a/apps/wallet-mobile/src/yoroi-wallets/utils/parsing.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import {BigNumber} from 'bignumber.js' - -import {isHaskellShelleyNetwork, NETWORKS} from '../cardano/networks' -import {Token} from '../types' - -export class InvalidAssetAmount extends Error { - static ERROR_CODES = { - // general parsing problem or amount is equal to 0 - INVALID_AMOUNT: 'INVALID_AMOUNT', - TOO_MANY_DECIMAL_PLACES: 'TOO_MANY_DECIMAL_PLACES', - TOO_LARGE: 'TOO_LARGE', - TOO_LOW: 'TOO_LOW', - LT_MIN_UTXO: 'LT_MIN_UTXO', - // amount is less than min utxo value allowed - NEGATIVE: 'NEGATIVE', - } - - constructor(public errorCode: (typeof InvalidAssetAmount.ERROR_CODES)[keyof typeof InvalidAssetAmount.ERROR_CODES]) { - super('InvalidAssetAmount') - } -} - -// expects an amount in regular currency units (eg ADA, not Lovelace) -export const parseAmountDecimal = (amount: string, token: Token): BigNumber => { - const assetMeta = token - const numberOfDecimals: number = assetMeta.metadata.numberOfDecimals - const normalizationFactor = Math.pow(10, numberOfDecimals) - const parsed = new BigNumber(amount, 10) - - if (parsed.isNaN()) { - throw new InvalidAssetAmount(InvalidAssetAmount.ERROR_CODES.INVALID_AMOUNT) - } - - try { - const decimals = parsed.decimalPlaces() - if (decimals != null && decimals > numberOfDecimals) { - throw new InvalidAssetAmount(InvalidAssetAmount.ERROR_CODES.TOO_MANY_DECIMAL_PLACES) - } - } catch (_) { - throw new InvalidAssetAmount(InvalidAssetAmount.ERROR_CODES.INVALID_AMOUNT) - } - - const value = parsed.times(normalizationFactor) - - if (isHaskellShelleyNetwork(assetMeta.networkId) && assetMeta.isDefault) { - // ...this is ADA or tADA - const minValue = NETWORKS.HASKELL_SHELLEY.MINIMUM_UTXO_VAL - - if (value.lt(minValue)) { - throw new InvalidAssetAmount(InvalidAssetAmount.ERROR_CODES.LT_MIN_UTXO) - } - } - - if (value.lt(1)) { - throw new InvalidAssetAmount(InvalidAssetAmount.ERROR_CODES.TOO_LOW) - } - - if (value.lt(0)) { - throw new InvalidAssetAmount(InvalidAssetAmount.ERROR_CODES.NEGATIVE) - } - - if (value.eq(0)) { - throw new InvalidAssetAmount(InvalidAssetAmount.ERROR_CODES.INVALID_AMOUNT) - } - - return value -} diff --git a/apps/wallet-mobile/src/utils/sorting.test.ts b/apps/wallet-mobile/src/yoroi-wallets/utils/sorting.test.ts similarity index 100% rename from apps/wallet-mobile/src/utils/sorting.test.ts rename to apps/wallet-mobile/src/yoroi-wallets/utils/sorting.test.ts diff --git a/apps/wallet-mobile/src/utils/sorting.ts b/apps/wallet-mobile/src/yoroi-wallets/utils/sorting.ts similarity index 95% rename from apps/wallet-mobile/src/utils/sorting.ts rename to apps/wallet-mobile/src/yoroi-wallets/utils/sorting.ts index 96814bb664..30bd73b928 100644 --- a/apps/wallet-mobile/src/utils/sorting.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/utils/sorting.ts @@ -1,6 +1,6 @@ import {Balance} from '@yoroi/types' -import {YoroiWallet} from '../yoroi-wallets/cardano/types' +import {YoroiWallet} from '../cardano/types' export const sortTokenInfos = ({ wallet, diff --git a/apps/wallet-mobile/src/yoroi-wallets/utils/timeUtils.ts b/apps/wallet-mobile/src/yoroi-wallets/utils/timeUtils.ts index 9b7d3d218a..622d520466 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/utils/timeUtils.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/utils/timeUtils.ts @@ -3,57 +3,6 @@ export type ToAbsoluteSlotNumberRequest = { slot: number } export type ToAbsoluteSlotNumberResponse = number -export type ToAbsoluteSlotNumberFunc = (request: ToAbsoluteSlotNumberRequest) => ToAbsoluteSlotNumberResponse - -export function genToAbsoluteSlotNumber( - config: Array<{ - StartAt?: number - SlotsPerEpoch?: number - }>, -): ToAbsoluteSlotNumberFunc { - return (request: ToAbsoluteSlotNumberRequest) => { - let SlotsPerEpoch = config[0].SlotsPerEpoch - let slotCount = 0 - let epochsLeft = request.epoch - - // for pairs of config changes (x, x+1), get the time between these pairs - for (let i = 0; i < config.length - 1; i++) { - const start = - config[i].StartAt ?? - (() => { - throw new Error('genToAbsoluteSlotNumber missing start') - })() - const end = - config[i + 1].StartAt ?? - (() => { - throw new Error('genToAbsoluteSlotNumber missing end') - })() - - // queried time is before the next protocol parameter choice - if (end > request.epoch) { - break - } - const numEpochs = end - start - - if (SlotsPerEpoch == null) { - throw new Error('genToAbsoluteSlotNumber missing params') - } - slotCount += SlotsPerEpoch * numEpochs - epochsLeft -= numEpochs - - SlotsPerEpoch = config[i + 1].SlotsPerEpoch ?? SlotsPerEpoch - } - - if (SlotsPerEpoch == null) { - throw new Error('genToAbsoluteSlotNumber missing params') - } - - // find how many slots in the epochs since the last update - slotCount += SlotsPerEpoch * epochsLeft - - return slotCount + request.slot - } -} export type ToRelativeSlotNumberRequest = ToAbsoluteSlotNumberResponse export type ToRelativeSlotNumberResponse = ToAbsoluteSlotNumberRequest @@ -185,6 +134,7 @@ export function genTimeToSlot( } export type CurrentEpochLengthRequest = void + /** slots per epoch */ export type CurrentEpochLengthResponse = number export type CurrentEpochLengthFunc = (request: CurrentEpochLengthRequest) => CurrentEpochLengthResponse @@ -213,96 +163,13 @@ export function genCurrentSlotLength( } } -export type TimeSinceGenesisRequest = { - absoluteSlotNum: number -} -export type TimeSinceGenesisResponse = number /* seconds */ -export type TimeSinceGenesisFunc = (request: TimeSinceGenesisRequest) => TimeSinceGenesisResponse -export function genTimeSinceGenesis( - config: Array<{ - StartAt?: number - GenesisDate?: string - SlotsPerEpoch?: number - SlotDuration?: number - }>, -): TimeSinceGenesisFunc { - return (request: TimeSinceGenesisRequest) => { - let SlotDuration = config[0].SlotDuration - let SlotsPerEpoch = config[0].SlotsPerEpoch - let time = 0 - let slotsLeft = request.absoluteSlotNum - - // for pairs of config changes (x, x+1), get the time between these pairs - for (let i = 0; i < config.length - 1; i++) { - const start = - config[i].StartAt ?? - (() => { - throw new Error('genTimeSinceGenesis missing start') - })() - const end = - config[i + 1].StartAt ?? - (() => { - throw new Error('genTimeSinceGenesis missing end') - })() - const numEpochs = end - start - - if (SlotDuration == null || SlotsPerEpoch == null) { - throw new Error('genTimeSinceGenesis missing params') - } - - // queried time is before the next protocol parameter choice - if (slotsLeft < SlotsPerEpoch * numEpochs) { - break - } - time += SlotsPerEpoch * SlotDuration * numEpochs - slotsLeft -= SlotsPerEpoch * numEpochs - - SlotDuration = config[i + 1].SlotDuration ?? SlotDuration - SlotsPerEpoch = config[i + 1].SlotsPerEpoch ?? SlotsPerEpoch - } - - if (SlotDuration == null || SlotsPerEpoch == null) { - throw new Error('genTimeSinceGenesis:: missing params') - } - - // add seconds into the current update - time += slotsLeft * SlotDuration - - return time - } -} - -export type ToRealTimeRequest = { - absoluteSlotNum: number - timeSinceGenesisFunc: TimeSinceGenesisFunc -} -export type ToRealTimeResponse = Date -export type ToRealTimeFunc = (request: ToRealTimeRequest) => ToRealTimeResponse -export function genToRealTime( - config: Array<{ - GenesisDate?: string - }>, -): ToRealTimeFunc { - return (request: ToRealTimeRequest) => { - const {GenesisDate} = config[0] - if (GenesisDate == null) { - throw new Error('genToRealTime:: missing genesis start date') - } - - const timeSinceGenesis = request.timeSinceGenesisFunc({ - absoluteSlotNum: request.absoluteSlotNum, - }) - const time = new Date(Number.parseInt(GenesisDate, 10)).getTime() + 1000 * timeSinceGenesis - return new Date(time) - } -} - export const delay = (ms: number): Promise => new Promise((resolve) => setTimeout(resolve, ms)) const ms_in_sec = 1000, sec_in_day = 86400, sec_in_hour = 3600, sec_in_min = 60 + export const formatTimeSpan = (ms: number) => { if (ms < 0) return '' diff --git a/apps/wallet-mobile/src/yoroi-wallets/utils/utils.ts b/apps/wallet-mobile/src/yoroi-wallets/utils/utils.ts index c9c92729a2..2d61636fcb 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/utils/utils.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/utils/utils.ts @@ -2,7 +2,7 @@ import {Balance} from '@yoroi/types' import BigNumber from 'bignumber.js' import {NumberLocale} from '../../kernel/i18n/languages' -import {NetworkId, RawUtxo, TokenId, YoroiEntry} from '../types' +import {RawUtxo, TokenId, YoroiEntry} from '../types' export const Entries = { first: (entries: YoroiEntry[]): YoroiEntry => { @@ -227,11 +227,3 @@ export const splitStringInto64CharArray = (inputString: string): string[] => { return resultArray } - -export const isMainnetNetworkId = (networkId: NetworkId) => { - return networkId !== 300 && !isSanchoNetworkId(networkId) -} - -export const isSanchoNetworkId = (networkId: NetworkId) => { - return networkId === 450 -} diff --git a/apps/wallet-mobile/src/yoroi-wallets/utils/validators.ts b/apps/wallet-mobile/src/yoroi-wallets/utils/validators.ts index 5f64b76e16..7698254f19 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/utils/validators.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/utils/validators.ts @@ -1,10 +1,5 @@ -import assert from 'assert' -import {wordlists} from 'bip39' import _ from 'lodash' -import {Token} from '../types' -import {InvalidAssetAmount, parseAmountDecimal} from './parsing' - export type PasswordValidationErrors = { passwordReq?: boolean passwordConfirmationReq?: boolean @@ -18,47 +13,6 @@ export type WalletNameValidationErrors = { mustBeFilled?: boolean } -export type AddressValidationErrors = { - addressIsRequired?: boolean - invalidAddress?: boolean - unsupportedDomain?: boolean - recordNotFound?: boolean - unregisteredDomain?: boolean -} - -export type AmountValidationErrors = { - amountIsRequired?: boolean - invalidAmount?: (typeof InvalidAssetAmount.ERROR_CODES)[keyof typeof InvalidAssetAmount.ERROR_CODES] -} - -export type BalanceValidationErrors = { - insufficientBalance?: boolean - assetOverflow?: boolean -} - -export const INVALID_PHRASE_ERROR_CODES = { - TOO_LONG: 'TOO_LONG', - TOO_SHORT: 'TOO_SHORT', - UNKNOWN_WORDS: 'UNKNOWN_WORDS', - INVALID_CHECKSUM: 'INVALID_CHECKSUM', -} - -export type InvalidPhraseErrorCode = (typeof INVALID_PHRASE_ERROR_CODES)[keyof typeof INVALID_PHRASE_ERROR_CODES] -export type InvalidPhraseError = - | { - code: 'TOO_LONG' | 'TOO_SHORT' | 'INVALID_CHECKSUM' - } - | { - code: 'UNKNOWN_WORDS' - words: Array - lastMightBeUnfinished: boolean - } - -export type RecoveryPhraseErrors = { - invalidPhrase: Array - minLength?: boolean -} - export type PasswordStrength = { isStrong: boolean satisfiesPasswordRequirement?: boolean @@ -119,34 +73,3 @@ export const getWalletNameError = ( return null } } - -export const validateAmount = (value: string, token: Token): AmountValidationErrors => { - if (!value) { - return {amountIsRequired: true} - } - - try { - parseAmountDecimal(value, token) - return Object.freeze({}) - } catch (e) { - if (e instanceof InvalidAssetAmount) { - return {invalidAmount: e.errorCode} - } - throw e - } -} - -wordlists.EN.forEach((word) => { - assert(word === word.toLowerCase(), 'we expect wordlist to contain only lowercase words') -}) - -export const cleanMnemonic = (mnemonic: string) => { - // get rid of common punctuation - mnemonic = mnemonic.replace(/[.,?]/g, ' ') - // normalize whitespace - mnemonic = mnemonic.replace(/\s+/g, ' ') - // dictionary does not contain uppercase characters - mnemonic = mnemonic.toLowerCase() - // remove leading/trailing whitespace - return mnemonic.trim() -} diff --git a/apps/wallet-mobile/translations/messages/src/AppNavigator.json b/apps/wallet-mobile/translations/messages/src/AppNavigator.json index eec183a04e..0abe841e00 100644 --- a/apps/wallet-mobile/translations/messages/src/AppNavigator.json +++ b/apps/wallet-mobile/translations/messages/src/AppNavigator.json @@ -6,12 +6,12 @@ "start": { "line": 219, "column": 17, - "index": 7951 + "index": 7949 }, "end": { "line": 222, "column": 3, - "index": 8041 + "index": 8039 } }, { @@ -21,12 +21,12 @@ "start": { "line": 223, "column": 18, - "index": 8061 + "index": 8059 }, "end": { "line": 226, "column": 3, - "index": 8159 + "index": 8157 } }, { @@ -36,12 +36,12 @@ "start": { "line": 227, "column": 25, - "index": 8186 + "index": 8184 }, "end": { "line": 230, "column": 3, - "index": 8300 + "index": 8298 } }, { @@ -51,12 +51,12 @@ "start": { "line": 231, "column": 27, - "index": 8329 + "index": 8327 }, "end": { "line": 234, "column": 3, - "index": 8450 + "index": 8448 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/Catalyst/ConfirmVotingTx.json b/apps/wallet-mobile/translations/messages/src/Catalyst/ConfirmVotingTx.json index 8f8810b4ab..e47de45214 100644 --- a/apps/wallet-mobile/translations/messages/src/Catalyst/ConfirmVotingTx.json +++ b/apps/wallet-mobile/translations/messages/src/Catalyst/ConfirmVotingTx.json @@ -6,12 +6,12 @@ "start": { "line": 108, "column": 12, - "index": 3538 + "index": 3551 }, "end": { "line": 111, "column": 3, - "index": 3636 + "index": 3649 } }, { @@ -21,12 +21,12 @@ "start": { "line": 112, "column": 15, - "index": 3653 + "index": 3666 }, "end": { "line": 118, "column": 3, - "index": 3898 + "index": 3911 } }, { @@ -36,12 +36,12 @@ "start": { "line": 119, "column": 22, - "index": 3922 + "index": 3935 }, "end": { "line": 122, "column": 3, - "index": 4093 + "index": 4106 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/Catalyst/QrCode.json b/apps/wallet-mobile/translations/messages/src/Catalyst/QrCode.json index 6166628b70..59d31e7970 100644 --- a/apps/wallet-mobile/translations/messages/src/Catalyst/QrCode.json +++ b/apps/wallet-mobile/translations/messages/src/Catalyst/QrCode.json @@ -6,12 +6,12 @@ "start": { "line": 102, "column": 12, - "index": 3106 + "index": 3123 }, "end": { "line": 105, "column": 3, - "index": 3204 + "index": 3221 } }, { @@ -21,12 +21,12 @@ "start": { "line": 106, "column": 15, - "index": 3221 + "index": 3238 }, "end": { "line": 109, "column": 3, - "index": 3343 + "index": 3360 } }, { @@ -36,12 +36,12 @@ "start": { "line": 110, "column": 16, - "index": 3361 + "index": 3378 }, "end": { "line": 115, "column": 3, - "index": 3591 + "index": 3608 } }, { @@ -51,12 +51,12 @@ "start": { "line": 116, "column": 16, - "index": 3609 + "index": 3626 }, "end": { "line": 121, "column": 3, - "index": 3827 + "index": 3844 } }, { @@ -66,12 +66,12 @@ "start": { "line": 122, "column": 8, - "index": 3837 + "index": 3854 }, "end": { "line": 125, "column": 3, - "index": 3985 + "index": 4002 } }, { @@ -81,12 +81,12 @@ "start": { "line": 126, "column": 14, - "index": 4001 + "index": 4018 }, "end": { "line": 129, "column": 3, - "index": 4092 + "index": 4109 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/Catalyst/VotingRegistrationBackupCheckModal.json b/apps/wallet-mobile/translations/messages/src/Catalyst/VotingRegistrationBackupCheckModal.json index 92374c1fa2..0c2814f962 100644 --- a/apps/wallet-mobile/translations/messages/src/Catalyst/VotingRegistrationBackupCheckModal.json +++ b/apps/wallet-mobile/translations/messages/src/Catalyst/VotingRegistrationBackupCheckModal.json @@ -6,12 +6,12 @@ "start": { "line": 59, "column": 15, - "index": 1790 + "index": 1807 }, "end": { "line": 62, "column": 3, - "index": 1961 + "index": 1978 } }, { @@ -21,12 +21,12 @@ "start": { "line": 63, "column": 18, - "index": 1981 + "index": 1998 }, "end": { "line": 66, "column": 3, - "index": 2172 + "index": 2189 } }, { @@ -36,12 +36,12 @@ "start": { "line": 67, "column": 24, - "index": 2198 + "index": 2215 }, "end": { "line": 73, "column": 3, - "index": 2478 + "index": 2495 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/Dashboard/Dashboard.json b/apps/wallet-mobile/translations/messages/src/Dashboard/Dashboard.json index 880a92ebea..6d583392bc 100644 --- a/apps/wallet-mobile/translations/messages/src/Dashboard/Dashboard.json +++ b/apps/wallet-mobile/translations/messages/src/Dashboard/Dashboard.json @@ -6,12 +6,12 @@ "start": { "line": 240, "column": 23, - "index": 7942 + "index": 7960 }, "end": { "line": 243, "column": 3, - "index": 8075 + "index": 8093 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/Dashboard/StakePoolInfo.json b/apps/wallet-mobile/translations/messages/src/Dashboard/StakePoolInfo.json index 67209623a0..72d15da633 100644 --- a/apps/wallet-mobile/translations/messages/src/Dashboard/StakePoolInfo.json +++ b/apps/wallet-mobile/translations/messages/src/Dashboard/StakePoolInfo.json @@ -6,12 +6,12 @@ "start": { "line": 128, "column": 9, - "index": 3542 + "index": 3543 }, "end": { "line": 131, "column": 3, - "index": 3663 + "index": 3664 } }, { @@ -21,12 +21,12 @@ "start": { "line": 132, "column": 11, - "index": 3676 + "index": 3677 }, "end": { "line": 137, "column": 3, - "index": 3911 + "index": 3912 } }, { @@ -36,12 +36,12 @@ "start": { "line": 138, "column": 26, - "index": 3939 + "index": 3940 }, "end": { "line": 141, "column": 3, - "index": 4074 + "index": 4075 } }, { @@ -51,12 +51,12 @@ "start": { "line": 142, "column": 10, - "index": 4086 + "index": 4087 }, "end": { "line": 145, "column": 3, - "index": 4195 + "index": 4196 } }, { @@ -66,12 +66,12 @@ "start": { "line": 146, "column": 15, - "index": 4212 + "index": 4213 }, "end": { "line": 149, "column": 3, - "index": 4331 + "index": 4332 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/Dashboard/UserSummary.json b/apps/wallet-mobile/translations/messages/src/Dashboard/UserSummary.json index fa97545864..eddcae42b3 100644 --- a/apps/wallet-mobile/translations/messages/src/Dashboard/UserSummary.json +++ b/apps/wallet-mobile/translations/messages/src/Dashboard/UserSummary.json @@ -6,12 +6,12 @@ "start": { "line": 164, "column": 9, - "index": 4841 + "index": 4854 }, "end": { "line": 167, "column": 3, - "index": 4943 + "index": 4956 } }, { @@ -21,12 +21,12 @@ "start": { "line": 168, "column": 16, - "index": 4961 + "index": 4974 }, "end": { "line": 171, "column": 3, - "index": 5071 + "index": 5084 } }, { @@ -36,12 +36,12 @@ "start": { "line": 172, "column": 18, - "index": 5091 + "index": 5104 }, "end": { "line": 175, "column": 3, - "index": 5205 + "index": 5218 } }, { @@ -51,12 +51,12 @@ "start": { "line": 176, "column": 23, - "index": 5230 + "index": 5243 }, "end": { "line": 179, "column": 3, - "index": 5342 + "index": 5355 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.json b/apps/wallet-mobile/translations/messages/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.json index ca0cf8e390..ae27558204 100644 --- a/apps/wallet-mobile/translations/messages/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.json +++ b/apps/wallet-mobile/translations/messages/src/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.json @@ -6,12 +6,12 @@ "start": { "line": 175, "column": 13, - "index": 5510 + "index": 5523 }, "end": { "line": 178, "column": 3, - "index": 5623 + "index": 5636 } }, { @@ -21,12 +21,12 @@ "start": { "line": 179, "column": 16, - "index": 5641 + "index": 5654 }, "end": { "line": 182, "column": 3, - "index": 5770 + "index": 5783 } }, { @@ -36,12 +36,12 @@ "start": { "line": 183, "column": 21, - "index": 5793 + "index": 5806 }, "end": { "line": 186, "column": 3, - "index": 5923 + "index": 5936 } }, { @@ -51,12 +51,12 @@ "start": { "line": 187, "column": 25, - "index": 5950 + "index": 5963 }, "end": { "line": 192, "column": 3, - "index": 6185 + "index": 6198 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.json b/apps/wallet-mobile/translations/messages/src/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.json index 477b479581..d3245a1b53 100644 --- a/apps/wallet-mobile/translations/messages/src/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.json +++ b/apps/wallet-mobile/translations/messages/src/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.json @@ -6,12 +6,12 @@ "start": { "line": 99, "column": 9, - "index": 2834 + "index": 2851 }, "end": { "line": 102, "column": 3, - "index": 2952 + "index": 2969 } }, { @@ -21,12 +21,12 @@ "start": { "line": 103, "column": 18, - "index": 2972 + "index": 2989 }, "end": { "line": 108, "column": 3, - "index": 3201 + "index": 3218 } }, { @@ -36,12 +36,12 @@ "start": { "line": 109, "column": 13, - "index": 3216 + "index": 3233 }, "end": { "line": 112, "column": 3, - "index": 3330 + "index": 3347 } }, { @@ -51,12 +51,12 @@ "start": { "line": 113, "column": 25, - "index": 3357 + "index": 3374 }, "end": { "line": 116, "column": 3, - "index": 3500 + "index": 3517 } }, { @@ -66,12 +66,12 @@ "start": { "line": 117, "column": 21, - "index": 3523 + "index": 3540 }, "end": { "line": 120, "column": 3, - "index": 3673 + "index": 3690 } }, { @@ -81,12 +81,12 @@ "start": { "line": 121, "column": 24, - "index": 3699 + "index": 3716 }, "end": { "line": 124, "column": 3, - "index": 3893 + "index": 3910 } }, { @@ -96,12 +96,12 @@ "start": { "line": 125, "column": 19, - "index": 3914 + "index": 3931 }, "end": { "line": 128, "column": 3, - "index": 4040 + "index": 4057 } }, { @@ -111,12 +111,12 @@ "start": { "line": 129, "column": 18, - "index": 4060 + "index": 4077 }, "end": { "line": 132, "column": 3, - "index": 4170 + "index": 4187 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/Staking/DelegationConfirmation/DelegationConfirmation.json b/apps/wallet-mobile/translations/messages/src/Staking/DelegationConfirmation/DelegationConfirmation.json index 96bf0f97b4..8298b7251f 100644 --- a/apps/wallet-mobile/translations/messages/src/Staking/DelegationConfirmation/DelegationConfirmation.json +++ b/apps/wallet-mobile/translations/messages/src/Staking/DelegationConfirmation/DelegationConfirmation.json @@ -6,12 +6,12 @@ "start": { "line": 150, "column": 23, - "index": 5475 + "index": 5488 }, "end": { "line": 153, "column": 3, - "index": 5589 + "index": 5602 } }, { @@ -21,12 +21,12 @@ "start": { "line": 154, "column": 10, - "index": 5601 + "index": 5614 }, "end": { "line": 157, "column": 3, - "index": 5701 + "index": 5714 } }, { @@ -36,12 +36,12 @@ "start": { "line": 158, "column": 22, - "index": 5725 + "index": 5738 }, "end": { "line": 161, "column": 3, - "index": 5895 + "index": 5908 } }, { @@ -51,12 +51,12 @@ "start": { "line": 162, "column": 15, - "index": 5912 + "index": 5925 }, "end": { "line": 165, "column": 3, - "index": 6031 + "index": 6044 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/Staking/PoolWarningModal/PoolWarningModal.json b/apps/wallet-mobile/translations/messages/src/Staking/PoolWarningModal/PoolWarningModal.json index acfc7aa89d..9d0bcf79f1 100644 --- a/apps/wallet-mobile/translations/messages/src/Staking/PoolWarningModal/PoolWarningModal.json +++ b/apps/wallet-mobile/translations/messages/src/Staking/PoolWarningModal/PoolWarningModal.json @@ -6,12 +6,12 @@ "start": { "line": 126, "column": 9, - "index": 3295 + "index": 3312 }, "end": { "line": 129, "column": 3, - "index": 3395 + "index": 3412 } }, { @@ -21,12 +21,12 @@ "start": { "line": 130, "column": 10, - "index": 3407 + "index": 3424 }, "end": { "line": 133, "column": 3, - "index": 3545 + "index": 3562 } }, { @@ -36,12 +36,12 @@ "start": { "line": 134, "column": 14, - "index": 3561 + "index": 3578 }, "end": { "line": 137, "column": 3, - "index": 3723 + "index": 3740 } }, { @@ -51,12 +51,12 @@ "start": { "line": 138, "column": 16, - "index": 3741 + "index": 3758 }, "end": { "line": 141, "column": 3, - "index": 3906 + "index": 3923 } }, { @@ -66,12 +66,12 @@ "start": { "line": 142, "column": 13, - "index": 3921 + "index": 3938 }, "end": { "line": 148, "column": 3, - "index": 4233 + "index": 4250 } }, { @@ -81,12 +81,12 @@ "start": { "line": 149, "column": 11, - "index": 4246 + "index": 4263 }, "end": { "line": 152, "column": 3, - "index": 4392 + "index": 4409 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/TxHistory/ModalInfo/ModalInfo.json b/apps/wallet-mobile/translations/messages/src/TxHistory/ModalInfo/ModalInfo.json index 2cc464d27f..5975b709aa 100644 --- a/apps/wallet-mobile/translations/messages/src/TxHistory/ModalInfo/ModalInfo.json +++ b/apps/wallet-mobile/translations/messages/src/TxHistory/ModalInfo/ModalInfo.json @@ -6,12 +6,12 @@ "start": { "line": 33, "column": 13, - "index": 818 + "index": 835 }, "end": { "line": 36, "column": 3, - "index": 877 + "index": 894 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/TxHistory/TxDetails/AssetList.json b/apps/wallet-mobile/translations/messages/src/TxHistory/TxDetails/AssetList.json index 730841a34c..47e341019b 100644 --- a/apps/wallet-mobile/translations/messages/src/TxHistory/TxDetails/AssetList.json +++ b/apps/wallet-mobile/translations/messages/src/TxHistory/TxDetails/AssetList.json @@ -6,12 +6,12 @@ "start": { "line": 96, "column": 20, - "index": 3418 + "index": 3438 }, "end": { "line": 99, "column": 3, - "index": 3511 + "index": 3531 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/TxHistory/TxDetails/TxDetails.json b/apps/wallet-mobile/translations/messages/src/TxHistory/TxDetails/TxDetails.json index fbb226a473..5b223f771f 100644 --- a/apps/wallet-mobile/translations/messages/src/TxHistory/TxDetails/TxDetails.json +++ b/apps/wallet-mobile/translations/messages/src/TxHistory/TxDetails/TxDetails.json @@ -6,12 +6,12 @@ "start": { "line": 350, "column": 8, - "index": 12239 + "index": 12253 }, "end": { "line": 353, "column": 3, - "index": 12334 + "index": 12348 } }, { @@ -21,12 +21,12 @@ "start": { "line": 354, "column": 12, - "index": 12348 + "index": 12362 }, "end": { "line": 357, "column": 3, - "index": 12451 + "index": 12465 } }, { @@ -36,12 +36,12 @@ "start": { "line": 358, "column": 8, - "index": 12461 + "index": 12475 }, "end": { "line": 361, "column": 3, - "index": 12569 + "index": 12583 } }, { @@ -51,12 +51,12 @@ "start": { "line": 362, "column": 9, - "index": 12580 + "index": 12594 }, "end": { "line": 365, "column": 3, - "index": 12689 + "index": 12703 } }, { @@ -66,12 +66,12 @@ "start": { "line": 369, "column": 24, - "index": 12753 + "index": 12767 }, "end": { "line": 372, "column": 3, - "index": 12854 + "index": 12868 } }, { @@ -81,12 +81,12 @@ "start": { "line": 373, "column": 23, - "index": 12879 + "index": 12893 }, "end": { "line": 376, "column": 3, - "index": 12980 + "index": 12994 } }, { @@ -96,12 +96,12 @@ "start": { "line": 377, "column": 24, - "index": 13006 + "index": 13020 }, "end": { "line": 380, "column": 3, - "index": 13109 + "index": 13123 } }, { @@ -111,12 +111,12 @@ "start": { "line": 381, "column": 7, - "index": 13118 + "index": 13132 }, "end": { "line": 384, "column": 3, - "index": 13201 + "index": 13215 } }, { @@ -126,12 +126,12 @@ "start": { "line": 385, "column": 17, - "index": 13220 + "index": 13234 }, "end": { "line": 388, "column": 3, - "index": 13322 + "index": 13336 } }, { @@ -141,12 +141,12 @@ "start": { "line": 389, "column": 15, - "index": 13339 + "index": 13353 }, "end": { "line": 392, "column": 3, - "index": 13437 + "index": 13451 } }, { @@ -156,12 +156,12 @@ "start": { "line": 393, "column": 8, - "index": 13447 + "index": 13461 }, "end": { "line": 396, "column": 3, - "index": 13530 + "index": 13544 } }, { @@ -171,12 +171,12 @@ "start": { "line": 397, "column": 17, - "index": 13549 + "index": 13563 }, "end": { "line": 400, "column": 3, - "index": 13651 + "index": 13665 } }, { @@ -186,12 +186,12 @@ "start": { "line": 401, "column": 20, - "index": 13673 + "index": 13687 }, "end": { "line": 404, "column": 3, - "index": 13791 + "index": 13805 } }, { @@ -201,12 +201,12 @@ "start": { "line": 405, "column": 17, - "index": 13810 + "index": 13824 }, "end": { "line": 408, "column": 3, - "index": 13959 + "index": 13973 } }, { @@ -216,12 +216,12 @@ "start": { "line": 409, "column": 16, - "index": 13977 + "index": 13991 }, "end": { "line": 412, "column": 3, - "index": 14126 + "index": 14140 } }, { @@ -231,12 +231,12 @@ "start": { "line": 413, "column": 18, - "index": 14146 + "index": 14160 }, "end": { "line": 416, "column": 3, - "index": 14227 + "index": 14241 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/TxHistory/TxHistoryList/TxHistoryListItem.json b/apps/wallet-mobile/translations/messages/src/TxHistory/TxHistoryList/TxHistoryListItem.json index e831b26b87..e199facf2f 100644 --- a/apps/wallet-mobile/translations/messages/src/TxHistory/TxHistoryList/TxHistoryListItem.json +++ b/apps/wallet-mobile/translations/messages/src/TxHistory/TxHistoryList/TxHistoryListItem.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!Fee", "file": "src/TxHistory/TxHistoryList/TxHistoryListItem.tsx", "start": { - "line": 179, + "line": 183, "column": 7, - "index": 6337 + "index": 6296 }, "end": { - "line": 182, + "line": 186, "column": 3, - "index": 6426 + "index": 6385 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!ADA sent", "file": "src/TxHistory/TxHistoryList/TxHistoryListItem.tsx", "start": { - "line": 183, + "line": 187, "column": 23, - "index": 6451 + "index": 6410 }, "end": { - "line": 186, + "line": 190, "column": 3, - "index": 6561 + "index": 6520 } }, { @@ -34,14 +34,14 @@ "defaultMessage": "!!!ADA received", "file": "src/TxHistory/TxHistoryList/TxHistoryListItem.tsx", "start": { - "line": 187, + "line": 191, "column": 27, - "index": 6590 + "index": 6549 }, "end": { - "line": 190, + "line": 194, "column": 3, - "index": 6708 + "index": 6667 } }, { @@ -49,14 +49,14 @@ "defaultMessage": "!!!Intrawallet", "file": "src/TxHistory/TxHistoryList/TxHistoryListItem.tsx", "start": { - "line": 191, + "line": 195, "column": 23, - "index": 6733 + "index": 6692 }, "end": { - "line": 194, + "line": 198, "column": 3, - "index": 6846 + "index": 6805 } }, { @@ -64,14 +64,14 @@ "defaultMessage": "!!!Multiparty", "file": "src/TxHistory/TxHistoryList/TxHistoryListItem.tsx", "start": { - "line": 195, + "line": 199, "column": 24, - "index": 6872 + "index": 6831 }, "end": { - "line": 198, + "line": 202, "column": 3, - "index": 6985 + "index": 6944 } }, { @@ -80,14 +80,14 @@ "defaultMessage": "!!!{cnt} assets", "file": "src/TxHistory/TxHistoryList/TxHistoryListItem.tsx", "start": { - "line": 199, + "line": 203, "column": 10, - "index": 6997 + "index": 6956 }, "end": { - "line": 203, + "line": 207, "column": 3, - "index": 7149 + "index": 7108 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/WalletNavigator.json b/apps/wallet-mobile/translations/messages/src/WalletNavigator.json index bfa8a224ba..90b812ecf9 100644 --- a/apps/wallet-mobile/translations/messages/src/WalletNavigator.json +++ b/apps/wallet-mobile/translations/messages/src/WalletNavigator.json @@ -6,12 +6,12 @@ "start": { "line": 238, "column": 22, - "index": 8054 + "index": 8093 }, "end": { "line": 241, "column": 3, - "index": 8157 + "index": 8196 } }, { @@ -21,12 +21,12 @@ "start": { "line": 242, "column": 14, - "index": 8173 + "index": 8212 }, "end": { "line": 245, "column": 3, - "index": 8272 + "index": 8311 } }, { @@ -36,12 +36,12 @@ "start": { "line": 246, "column": 17, - "index": 8291 + "index": 8330 }, "end": { "line": 249, "column": 3, - "index": 8396 + "index": 8435 } }, { @@ -51,12 +51,12 @@ "start": { "line": 250, "column": 19, - "index": 8417 + "index": 8456 }, "end": { "line": 253, "column": 3, - "index": 8514 + "index": 8553 } }, { @@ -66,12 +66,12 @@ "start": { "line": 254, "column": 18, - "index": 8534 + "index": 8573 }, "end": { "line": 257, "column": 3, - "index": 8629 + "index": 8668 } }, { @@ -81,12 +81,12 @@ "start": { "line": 258, "column": 16, - "index": 8647 + "index": 8686 }, "end": { "line": 261, "column": 3, - "index": 8745 + "index": 8784 } }, { @@ -96,12 +96,12 @@ "start": { "line": 262, "column": 17, - "index": 8764 + "index": 8803 }, "end": { "line": 265, "column": 3, - "index": 8829 + "index": 8868 } }, { @@ -111,12 +111,12 @@ "start": { "line": 266, "column": 14, - "index": 8845 + "index": 8884 }, "end": { "line": 269, "column": 3, - "index": 8939 + "index": 8978 } }, { @@ -126,12 +126,12 @@ "start": { "line": 270, "column": 14, - "index": 8955 + "index": 8994 }, "end": { "line": 273, "column": 3, - "index": 9007 + "index": 9046 } }, { @@ -141,12 +141,12 @@ "start": { "line": 274, "column": 18, - "index": 9027 + "index": 9066 }, "end": { "line": 277, "column": 3, - "index": 9116 + "index": 9155 } }, { @@ -156,12 +156,12 @@ "start": { "line": 278, "column": 31, - "index": 9149 + "index": 9188 }, "end": { "line": 281, "column": 3, - "index": 9258 + "index": 9297 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/components/ErrorModal/ErrorModal.json b/apps/wallet-mobile/translations/messages/src/components/ErrorModal/ErrorModal.json index 477364354c..263112e3cf 100644 --- a/apps/wallet-mobile/translations/messages/src/components/ErrorModal/ErrorModal.json +++ b/apps/wallet-mobile/translations/messages/src/components/ErrorModal/ErrorModal.json @@ -6,12 +6,12 @@ "start": { "line": 151, "column": 13, - "index": 4193 + "index": 4197 }, "end": { "line": 154, "column": 3, - "index": 4293 + "index": 4297 } }, { @@ -21,12 +21,12 @@ "start": { "line": 155, "column": 13, - "index": 4308 + "index": 4312 }, "end": { "line": 158, "column": 3, - "index": 4408 + "index": 4412 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/components/LanguagePicker/LanguagePicker.json b/apps/wallet-mobile/translations/messages/src/components/LanguagePicker/LanguagePicker.json index c3a98c8895..3c730b53c0 100644 --- a/apps/wallet-mobile/translations/messages/src/components/LanguagePicker/LanguagePicker.json +++ b/apps/wallet-mobile/translations/messages/src/components/LanguagePicker/LanguagePicker.json @@ -6,12 +6,12 @@ "start": { "line": 103, "column": 23, - "index": 2799 + "index": 2808 }, "end": { "line": 106, "column": 3, - "index": 2863 + "index": 2872 } }, { @@ -21,12 +21,12 @@ "start": { "line": 107, "column": 24, - "index": 2889 + "index": 2898 }, "end": { "line": 110, "column": 3, - "index": 2952 + "index": 2961 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/Nfts/NftsNavigator.json b/apps/wallet-mobile/translations/messages/src/features/Nfts/NftsNavigator.json new file mode 100644 index 0000000000..c4c1a1cd3f --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/features/Nfts/NftsNavigator.json @@ -0,0 +1,17 @@ +[ + { + "id": "nft.detail.title", + "defaultMessage": "!!!NFT Details", + "file": "src/features/Nfts/NftsNavigator.tsx", + "start": { + "line": 47, + "column": 9, + "index": 1404 + }, + "end": { + "line": 50, + "column": 3, + "index": 1475 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/Nfts/useCases/Nfts.json b/apps/wallet-mobile/translations/messages/src/features/Nfts/useCases/Nfts.json new file mode 100644 index 0000000000..6240229716 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/features/Nfts/useCases/Nfts.json @@ -0,0 +1,122 @@ +[ + { + "id": "nft.gallery.nftCount", + "defaultMessage": "!!!NFT count", + "file": "src/features/Nfts/useCases/Nfts.tsx", + "start": { + "line": 163, + "column": 12, + "index": 4328 + }, + "end": { + "line": 166, + "column": 3, + "index": 4401 + } + }, + { + "id": "nft.gallery.errorTitle", + "defaultMessage": "!!!Oops!", + "file": "src/features/Nfts/useCases/Nfts.tsx", + "start": { + "line": 167, + "column": 14, + "index": 4417 + }, + "end": { + "line": 170, + "column": 3, + "index": 4488 + } + }, + { + "id": "nft.gallery.errorDescription", + "defaultMessage": "!!!Something went wrong.", + "file": "src/features/Nfts/useCases/Nfts.tsx", + "start": { + "line": 171, + "column": 20, + "index": 4510 + }, + "end": { + "line": 174, + "column": 3, + "index": 4603 + } + }, + { + "id": "nft.gallery.reloadApp", + "defaultMessage": "!!!Try to restart the app.", + "file": "src/features/Nfts/useCases/Nfts.tsx", + "start": { + "line": 175, + "column": 13, + "index": 4618 + }, + "end": { + "line": 178, + "column": 3, + "index": 4706 + } + }, + { + "id": "nft.gallery.noNftsFound", + "defaultMessage": "!!!No NFTs found", + "file": "src/features/Nfts/useCases/Nfts.tsx", + "start": { + "line": 179, + "column": 15, + "index": 4723 + }, + "end": { + "line": 182, + "column": 3, + "index": 4803 + } + }, + { + "id": "nft.gallery.noNftsInWallet", + "defaultMessage": "!!!No NFTs added to your wallet yet", + "file": "src/features/Nfts/useCases/Nfts.tsx", + "start": { + "line": 183, + "column": 18, + "index": 4823 + }, + "end": { + "line": 186, + "column": 3, + "index": 4925 + } + }, + { + "id": "nft.navigation.title", + "defaultMessage": "!!!NFT Gallery", + "file": "src/features/Nfts/useCases/Nfts.tsx", + "start": { + "line": 187, + "column": 9, + "index": 4936 + }, + "end": { + "line": 190, + "column": 3, + "index": 5011 + } + }, + { + "id": "nft.navigation.search", + "defaultMessage": "!!!Search NFT", + "file": "src/features/Nfts/useCases/Nfts.tsx", + "start": { + "line": 191, + "column": 10, + "index": 5023 + }, + "end": { + "line": 194, + "column": 3, + "index": 5098 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/Portfolio/common/MediaDetails/MediaDetails.json b/apps/wallet-mobile/translations/messages/src/features/Portfolio/common/MediaDetails/MediaDetails.json index d3b2fd01ee..580fc42b71 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Portfolio/common/MediaDetails/MediaDetails.json +++ b/apps/wallet-mobile/translations/messages/src/features/Portfolio/common/MediaDetails/MediaDetails.json @@ -6,12 +6,12 @@ "start": { "line": 315, "column": 9, - "index": 8860 + "index": 8864 }, "end": { "line": 318, "column": 3, - "index": 8931 + "index": 8935 } }, { @@ -21,12 +21,12 @@ "start": { "line": 319, "column": 12, - "index": 8945 + "index": 8949 }, "end": { "line": 322, "column": 3, - "index": 9016 + "index": 9020 } }, { @@ -36,12 +36,12 @@ "start": { "line": 323, "column": 12, - "index": 9030 + "index": 9034 }, "end": { "line": 326, "column": 3, - "index": 9101 + "index": 9105 } }, { @@ -51,12 +51,12 @@ "start": { "line": 327, "column": 11, - "index": 9114 + "index": 9118 }, "end": { "line": 330, "column": 3, - "index": 9184 + "index": 9188 } }, { @@ -66,12 +66,12 @@ "start": { "line": 331, "column": 13, - "index": 9199 + "index": 9203 }, "end": { "line": 334, "column": 3, - "index": 9270 + "index": 9274 } }, { @@ -81,12 +81,12 @@ "start": { "line": 335, "column": 15, - "index": 9287 + "index": 9291 }, "end": { "line": 338, "column": 3, - "index": 9364 + "index": 9368 } }, { @@ -96,12 +96,12 @@ "start": { "line": 339, "column": 10, - "index": 9376 + "index": 9380 }, "end": { "line": 342, "column": 3, - "index": 9443 + "index": 9447 } }, { @@ -111,12 +111,12 @@ "start": { "line": 343, "column": 15, - "index": 9460 + "index": 9464 }, "end": { "line": 346, "column": 3, - "index": 9537 + "index": 9541 } }, { @@ -126,12 +126,12 @@ "start": { "line": 347, "column": 12, - "index": 9551 + "index": 9555 }, "end": { "line": 350, "column": 3, - "index": 9623 + "index": 9627 } }, { @@ -141,12 +141,12 @@ "start": { "line": 351, "column": 16, - "index": 9641 + "index": 9645 }, "end": { "line": 354, "column": 3, - "index": 9718 + "index": 9722 } }, { @@ -156,12 +156,12 @@ "start": { "line": 355, "column": 16, - "index": 9736 + "index": 9740 }, "end": { "line": 358, "column": 3, - "index": 9816 + "index": 9820 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/Receive/common/AddressModal/AddressModal.json b/apps/wallet-mobile/translations/messages/src/features/Receive/common/AddressModal/AddressModal.json index c5e7867c37..c185eafadf 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Receive/common/AddressModal/AddressModal.json +++ b/apps/wallet-mobile/translations/messages/src/features/Receive/common/AddressModal/AddressModal.json @@ -6,12 +6,12 @@ "start": { "line": 148, "column": 17, - "index": 3847 + "index": 3864 }, "end": { "line": 151, "column": 3, - "index": 3955 + "index": 3972 } }, { @@ -21,12 +21,12 @@ "start": { "line": 152, "column": 13, - "index": 3970 + "index": 3987 }, "end": { "line": 155, "column": 3, - "index": 4066 + "index": 4083 } }, { @@ -36,12 +36,12 @@ "start": { "line": 156, "column": 13, - "index": 4081 + "index": 4098 }, "end": { "line": 159, "column": 3, - "index": 4178 + "index": 4195 } }, { @@ -51,12 +51,12 @@ "start": { "line": 160, "column": 12, - "index": 4192 + "index": 4209 }, "end": { "line": 163, "column": 3, - "index": 4291 + "index": 4308 } }, { @@ -66,12 +66,12 @@ "start": { "line": 164, "column": 11, - "index": 4304 + "index": 4321 }, "end": { "line": 167, "column": 3, - "index": 4401 + "index": 4418 } }, { @@ -81,12 +81,12 @@ "start": { "line": 168, "column": 9, - "index": 4412 + "index": 4429 }, "end": { "line": 171, "column": 3, - "index": 4498 + "index": 4515 } }, { @@ -96,12 +96,12 @@ "start": { "line": 172, "column": 15, - "index": 4515 + "index": 4532 }, "end": { "line": 175, "column": 3, - "index": 4626 + "index": 4643 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.json b/apps/wallet-mobile/translations/messages/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.json index df16fae784..ed60cd8775 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.json +++ b/apps/wallet-mobile/translations/messages/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.json @@ -6,12 +6,12 @@ "start": { "line": 186, "column": 12, - "index": 5913 + "index": 5910 }, "end": { "line": 189, "column": 3, - "index": 5990 + "index": 5987 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/Settings/ChangeWalletName/ChangeWalletName.json b/apps/wallet-mobile/translations/messages/src/features/Settings/ChangeWalletName/ChangeWalletName.json index 2a04598c42..c635ff2a97 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Settings/ChangeWalletName/ChangeWalletName.json +++ b/apps/wallet-mobile/translations/messages/src/features/Settings/ChangeWalletName/ChangeWalletName.json @@ -6,12 +6,12 @@ "start": { "line": 101, "column": 16, - "index": 3387 + "index": 3388 }, "end": { "line": 104, "column": 3, - "index": 3491 + "index": 3492 } }, { @@ -21,12 +21,12 @@ "start": { "line": 105, "column": 24, - "index": 3517 + "index": 3518 }, "end": { "line": 108, "column": 3, - "index": 3629 + "index": 3630 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.json b/apps/wallet-mobile/translations/messages/src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.json index 3e740d0e39..73e2abafb7 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.json +++ b/apps/wallet-mobile/translations/messages/src/features/Settings/EasyConfirmation/EnableEasyConfirmationScreen.json @@ -6,12 +6,12 @@ "start": { "line": 96, "column": 17, - "index": 3420 + "index": 3421 }, "end": { "line": 104, "column": 3, - "index": 3816 + "index": 3817 } }, { @@ -21,12 +21,12 @@ "start": { "line": 105, "column": 17, - "index": 3835 + "index": 3836 }, "end": { "line": 110, "column": 3, - "index": 4072 + "index": 4073 } }, { @@ -36,12 +36,12 @@ "start": { "line": 111, "column": 22, - "index": 4096 + "index": 4097 }, "end": { "line": 114, "column": 3, - "index": 4224 + "index": 4225 } }, { @@ -51,12 +51,12 @@ "start": { "line": 115, "column": 16, - "index": 4242 + "index": 4243 }, "end": { "line": 118, "column": 3, - "index": 4353 + "index": 4354 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/SetupWallet/legacy/ConnectNanoX/ConnectNanoXScreen.json b/apps/wallet-mobile/translations/messages/src/features/SetupWallet/legacy/ConnectNanoX/ConnectNanoXScreen.json index 9d943b97ec..38530c1ac2 100644 --- a/apps/wallet-mobile/translations/messages/src/features/SetupWallet/legacy/ConnectNanoX/ConnectNanoXScreen.json +++ b/apps/wallet-mobile/translations/messages/src/features/SetupWallet/legacy/ConnectNanoX/ConnectNanoXScreen.json @@ -6,12 +6,12 @@ "start": { "line": 82, "column": 13, - "index": 2898 + "index": 2905 }, "end": { "line": 85, "column": 3, - "index": 3070 + "index": 3077 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/SetupWallet/legacy/SaveReadOnlyWallet/SaveReadOnlyWalletScreen.json b/apps/wallet-mobile/translations/messages/src/features/SetupWallet/legacy/SaveReadOnlyWallet/SaveReadOnlyWalletScreen.json index 21bf0c64a1..91821efdc1 100644 --- a/apps/wallet-mobile/translations/messages/src/features/SetupWallet/legacy/SaveReadOnlyWallet/SaveReadOnlyWalletScreen.json +++ b/apps/wallet-mobile/translations/messages/src/features/SetupWallet/legacy/SaveReadOnlyWallet/SaveReadOnlyWalletScreen.json @@ -6,12 +6,12 @@ "start": { "line": 140, "column": 21, - "index": 4124 + "index": 4125 }, "end": { "line": 143, "column": 3, - "index": 4251 + "index": 4252 } }, { @@ -21,12 +21,12 @@ "start": { "line": 144, "column": 17, - "index": 4270 + "index": 4271 }, "end": { "line": 147, "column": 3, - "index": 4384 + "index": 4385 } }, { @@ -36,12 +36,12 @@ "start": { "line": 148, "column": 22, - "index": 4408 + "index": 4409 }, "end": { "line": 151, "column": 3, - "index": 4532 + "index": 4533 } }, { @@ -51,12 +51,12 @@ "start": { "line": 152, "column": 7, - "index": 4541 + "index": 4542 }, "end": { "line": 155, "column": 3, - "index": 4639 + "index": 4640 } }, { @@ -66,12 +66,12 @@ "start": { "line": 156, "column": 18, - "index": 4659 + "index": 4660 }, "end": { "line": 159, "column": 3, - "index": 4780 + "index": 4781 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/SetupWallet/legacy/WalletForm.json b/apps/wallet-mobile/translations/messages/src/features/SetupWallet/legacy/WalletForm.json index c407dbf3aa..4ffbb62e96 100644 --- a/apps/wallet-mobile/translations/messages/src/features/SetupWallet/legacy/WalletForm.json +++ b/apps/wallet-mobile/translations/messages/src/features/SetupWallet/legacy/WalletForm.json @@ -6,12 +6,12 @@ "start": { "line": 146, "column": 24, - "index": 5315 + "index": 5401 }, "end": { "line": 149, "column": 3, - "index": 5423 + "index": 5509 } }, { @@ -21,12 +21,12 @@ "start": { "line": 150, "column": 20, - "index": 5445 + "index": 5531 }, "end": { "line": 153, "column": 3, - "index": 5555 + "index": 5641 } }, { @@ -36,12 +36,12 @@ "start": { "line": 154, "column": 18, - "index": 5575 + "index": 5661 }, "end": { "line": 157, "column": 3, - "index": 5674 + "index": 5760 } }, { @@ -51,12 +51,12 @@ "start": { "line": 158, "column": 31, - "index": 5707 + "index": 5793 }, "end": { "line": 161, "column": 3, - "index": 5848 + "index": 5934 } }, { @@ -66,12 +66,12 @@ "start": { "line": 162, "column": 28, - "index": 5878 + "index": 5964 }, "end": { "line": 165, "column": 3, - "index": 5994 + "index": 6080 } }, { @@ -81,12 +81,12 @@ "start": { "line": 166, "column": 28, - "index": 6024 + "index": 6110 }, "end": { "line": 169, "column": 3, - "index": 6147 + "index": 6233 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/features/Swap/common/AmountCard/AmountCard.json b/apps/wallet-mobile/translations/messages/src/features/Swap/common/AmountCard/AmountCard.json index 80b065fc36..914cd40056 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Swap/common/AmountCard/AmountCard.json +++ b/apps/wallet-mobile/translations/messages/src/features/Swap/common/AmountCard/AmountCard.json @@ -6,12 +6,12 @@ "start": { "line": 137, "column": 15, - "index": 4439 + "index": 4459 }, "end": { "line": 140, "column": 3, - "index": 4522 + "index": 4542 } }, { @@ -21,12 +21,12 @@ "start": { "line": 141, "column": 18, - "index": 4542 + "index": 4562 }, "end": { "line": 144, "column": 3, - "index": 4631 + "index": 4651 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/kernel/i18n/global-messages.json b/apps/wallet-mobile/translations/messages/src/kernel/i18n/global-messages.json index 94b12700e9..d0599e82b4 100644 --- a/apps/wallet-mobile/translations/messages/src/kernel/i18n/global-messages.json +++ b/apps/wallet-mobile/translations/messages/src/kernel/i18n/global-messages.json @@ -6,12 +6,12 @@ "start": { "line": 13, "column": 11, - "index": 413 + "index": 394 }, "end": { "line": 16, "column": 5, - "index": 504 + "index": 485 } }, { @@ -21,12 +21,12 @@ "start": { "line": 17, "column": 13, - "index": 519 + "index": 500 }, "end": { "line": 20, "column": 5, - "index": 635 + "index": 616 } }, { @@ -36,12 +36,12 @@ "start": { "line": 39, "column": 15, - "index": 1091 + "index": 1072 }, "end": { "line": 42, "column": 5, - "index": 1183 + "index": 1164 } }, { @@ -51,12 +51,12 @@ "start": { "line": 830, "column": 10, - "index": 24276 + "index": 24257 }, "end": { "line": 833, "column": 3, - "index": 24339 + "index": 24320 } }, { @@ -66,12 +66,12 @@ "start": { "line": 31, "column": 11, - "index": 875 + "index": 856 }, "end": { "line": 34, "column": 5, - "index": 965 + "index": 946 } }, { @@ -81,12 +81,12 @@ "start": { "line": 35, "column": 13, - "index": 980 + "index": 961 }, "end": { "line": 38, "column": 5, - "index": 1074 + "index": 1055 } }, { @@ -96,12 +96,12 @@ "start": { "line": 49, "column": 19, - "index": 1329 + "index": 1310 }, "end": { "line": 52, "column": 5, - "index": 1436 + "index": 1417 } }, { @@ -111,12 +111,12 @@ "start": { "line": 53, "column": 20, - "index": 1458 + "index": 1439 }, "end": { "line": 56, "column": 5, - "index": 1567 + "index": 1548 } }, { @@ -126,12 +126,12 @@ "start": { "line": 57, "column": 18, - "index": 1587 + "index": 1568 }, "end": { "line": 60, "column": 5, - "index": 1692 + "index": 1673 } }, { @@ -141,12 +141,12 @@ "start": { "line": 61, "column": 16, - "index": 1710 + "index": 1691 }, "end": { "line": 64, "column": 5, - "index": 1811 + "index": 1792 } }, { @@ -156,12 +156,12 @@ "start": { "line": 65, "column": 23, - "index": 1836 + "index": 1817 }, "end": { "line": 68, "column": 5, - "index": 1952 + "index": 1933 } }, { @@ -171,12 +171,12 @@ "start": { "line": 69, "column": 20, - "index": 1974 + "index": 1955 }, "end": { "line": 72, "column": 5, - "index": 2083 + "index": 2064 } }, { @@ -186,12 +186,12 @@ "start": { "line": 78, "column": 29, - "index": 2211 + "index": 2192 }, "end": { "line": 81, "column": 3, - "index": 2323 + "index": 2304 } }, { @@ -201,12 +201,12 @@ "start": { "line": 82, "column": 10, - "index": 2335 + "index": 2316 }, "end": { "line": 85, "column": 3, - "index": 2407 + "index": 2388 } }, { @@ -216,12 +216,12 @@ "start": { "line": 86, "column": 18, - "index": 2427 + "index": 2408 }, "end": { "line": 89, "column": 3, - "index": 2526 + "index": 2507 } }, { @@ -231,12 +231,12 @@ "start": { "line": 90, "column": 13, - "index": 2541 + "index": 2522 }, "end": { "line": 93, "column": 3, - "index": 2629 + "index": 2610 } }, { @@ -246,12 +246,12 @@ "start": { "line": 94, "column": 8, - "index": 2639 + "index": 2620 }, "end": { "line": 97, "column": 3, - "index": 2707 + "index": 2688 } }, { @@ -261,12 +261,12 @@ "start": { "line": 98, "column": 8, - "index": 2717 + "index": 2698 }, "end": { "line": 101, "column": 3, - "index": 2830 + "index": 2811 } }, { @@ -276,12 +276,12 @@ "start": { "line": 102, "column": 12, - "index": 2844 + "index": 2825 }, "end": { "line": 105, "column": 3, - "index": 2929 + "index": 2910 } }, { @@ -291,12 +291,12 @@ "start": { "line": 106, "column": 12, - "index": 2943 + "index": 2924 }, "end": { "line": 109, "column": 3, - "index": 3019 + "index": 3000 } }, { @@ -306,12 +306,12 @@ "start": { "line": 110, "column": 23, - "index": 3044 + "index": 3025 }, "end": { "line": 113, "column": 3, - "index": 3149 + "index": 3130 } }, { @@ -321,12 +321,12 @@ "start": { "line": 114, "column": 16, - "index": 3167 + "index": 3148 }, "end": { "line": 117, "column": 3, - "index": 3261 + "index": 3242 } }, { @@ -336,12 +336,12 @@ "start": { "line": 118, "column": 13, - "index": 3276 + "index": 3257 }, "end": { "line": 121, "column": 3, - "index": 3364 + "index": 3345 } }, { @@ -351,12 +351,12 @@ "start": { "line": 122, "column": 8, - "index": 3374 + "index": 3355 }, "end": { "line": 125, "column": 3, - "index": 3433 + "index": 3414 } }, { @@ -366,12 +366,12 @@ "start": { "line": 126, "column": 6, - "index": 3441 + "index": 3422 }, "end": { "line": 129, "column": 3, - "index": 3550 + "index": 3531 } }, { @@ -381,12 +381,12 @@ "start": { "line": 130, "column": 16, - "index": 3568 + "index": 3549 }, "end": { "line": 133, "column": 3, - "index": 3652 + "index": 3633 } }, { @@ -396,12 +396,12 @@ "start": { "line": 134, "column": 8, - "index": 3662 + "index": 3643 }, "end": { "line": 137, "column": 3, - "index": 3785 + "index": 3766 } }, { @@ -411,12 +411,12 @@ "start": { "line": 138, "column": 15, - "index": 3802 + "index": 3783 }, "end": { "line": 141, "column": 3, - "index": 3884 + "index": 3865 } }, { @@ -426,12 +426,12 @@ "start": { "line": 142, "column": 25, - "index": 3911 + "index": 3892 }, "end": { "line": 145, "column": 3, - "index": 4031 + "index": 4012 } }, { @@ -441,12 +441,12 @@ "start": { "line": 146, "column": 20, - "index": 4053 + "index": 4034 }, "end": { "line": 149, "column": 3, - "index": 4137 + "index": 4118 } }, { @@ -456,12 +456,12 @@ "start": { "line": 154, "column": 20, - "index": 4229 + "index": 4210 }, "end": { "line": 157, "column": 3, - "index": 4351 + "index": 4332 } }, { @@ -471,12 +471,12 @@ "start": { "line": 158, "column": 19, - "index": 4372 + "index": 4353 }, "end": { "line": 164, "column": 3, - "index": 4634 + "index": 4615 } }, { @@ -486,12 +486,12 @@ "start": { "line": 165, "column": 18, - "index": 4654 + "index": 4635 }, "end": { "line": 170, "column": 3, - "index": 4862 + "index": 4843 } }, { @@ -501,12 +501,12 @@ "start": { "line": 171, "column": 22, - "index": 4886 + "index": 4867 }, "end": { "line": 174, "column": 3, - "index": 5054 + "index": 5035 } }, { @@ -516,12 +516,12 @@ "start": { "line": 175, "column": 16, - "index": 5072 + "index": 5053 }, "end": { "line": 178, "column": 3, - "index": 5201 + "index": 5182 } }, { @@ -531,12 +531,12 @@ "start": { "line": 179, "column": 13, - "index": 5216 + "index": 5197 }, "end": { "line": 182, "column": 3, - "index": 5346 + "index": 5327 } }, { @@ -546,12 +546,12 @@ "start": { "line": 184, "column": 19, - "index": 5394 + "index": 5375 }, "end": { "line": 187, "column": 3, - "index": 5492 + "index": 5473 } }, { @@ -561,12 +561,12 @@ "start": { "line": 188, "column": 18, - "index": 5512 + "index": 5493 }, "end": { "line": 191, "column": 3, - "index": 5617 + "index": 5598 } }, { @@ -576,12 +576,12 @@ "start": { "line": 192, "column": 14, - "index": 5633 + "index": 5614 }, "end": { "line": 195, "column": 3, - "index": 5798 + "index": 5779 } }, { @@ -591,12 +591,12 @@ "start": { "line": 196, "column": 20, - "index": 5820 + "index": 5801 }, "end": { "line": 199, "column": 3, - "index": 5980 + "index": 5961 } }, { @@ -606,12 +606,12 @@ "start": { "line": 200, "column": 12, - "index": 5994 + "index": 5975 }, "end": { "line": 203, "column": 3, - "index": 6115 + "index": 6096 } }, { @@ -621,12 +621,12 @@ "start": { "line": 204, "column": 11, - "index": 6128 + "index": 6109 }, "end": { "line": 207, "column": 3, - "index": 6243 + "index": 6224 } }, { @@ -636,12 +636,12 @@ "start": { "line": 208, "column": 15, - "index": 6260 + "index": 6241 }, "end": { "line": 211, "column": 3, - "index": 6389 + "index": 6370 } }, { @@ -651,12 +651,12 @@ "start": { "line": 213, "column": 26, - "index": 6436 + "index": 6417 }, "end": { "line": 216, "column": 3, - "index": 6564 + "index": 6545 } }, { @@ -666,12 +666,12 @@ "start": { "line": 217, "column": 19, - "index": 6585 + "index": 6566 }, "end": { "line": 223, "column": 3, - "index": 6876 + "index": 6857 } }, { @@ -681,12 +681,12 @@ "start": { "line": 224, "column": 25, - "index": 6903 + "index": 6884 }, "end": { "line": 228, "column": 3, - "index": 7098 + "index": 7079 } }, { @@ -696,12 +696,12 @@ "start": { "line": 229, "column": 23, - "index": 7123 + "index": 7104 }, "end": { "line": 232, "column": 3, - "index": 7235 + "index": 7216 } }, { @@ -711,12 +711,12 @@ "start": { "line": 233, "column": 21, - "index": 7258 + "index": 7239 }, "end": { "line": 238, "column": 3, - "index": 7472 + "index": 7453 } }, { @@ -726,12 +726,12 @@ "start": { "line": 239, "column": 20, - "index": 7494 + "index": 7475 }, "end": { "line": 242, "column": 3, - "index": 7594 + "index": 7575 } }, { @@ -741,12 +741,12 @@ "start": { "line": 247, "column": 11, - "index": 7674 + "index": 7655 }, "end": { "line": 250, "column": 5, - "index": 7775 + "index": 7756 } }, { @@ -756,12 +756,12 @@ "start": { "line": 251, "column": 13, - "index": 7790 + "index": 7771 }, "end": { "line": 254, "column": 5, - "index": 7900 + "index": 7881 } }, { @@ -771,12 +771,12 @@ "start": { "line": 257, "column": 11, - "index": 7957 + "index": 7938 }, "end": { "line": 260, "column": 5, - "index": 8120 + "index": 8101 } }, { @@ -786,12 +786,12 @@ "start": { "line": 263, "column": 11, - "index": 8172 + "index": 8153 }, "end": { "line": 266, "column": 5, - "index": 8274 + "index": 8255 } }, { @@ -801,12 +801,12 @@ "start": { "line": 267, "column": 13, - "index": 8289 + "index": 8270 }, "end": { "line": 270, "column": 5, - "index": 8415 + "index": 8396 } }, { @@ -816,12 +816,12 @@ "start": { "line": 273, "column": 11, - "index": 8472 + "index": 8453 }, "end": { "line": 276, "column": 5, - "index": 8582 + "index": 8563 } }, { @@ -831,12 +831,12 @@ "start": { "line": 277, "column": 13, - "index": 8597 + "index": 8578 }, "end": { "line": 280, "column": 5, - "index": 8730 + "index": 8711 } }, { @@ -846,12 +846,12 @@ "start": { "line": 283, "column": 11, - "index": 8787 + "index": 8768 }, "end": { "line": 286, "column": 5, - "index": 8912 + "index": 8893 } }, { @@ -861,12 +861,12 @@ "start": { "line": 287, "column": 13, - "index": 8927 + "index": 8908 }, "end": { "line": 290, "column": 5, - "index": 9087 + "index": 9068 } }, { @@ -876,12 +876,12 @@ "start": { "line": 293, "column": 11, - "index": 9148 + "index": 9129 }, "end": { "line": 296, "column": 5, - "index": 9266 + "index": 9247 } }, { @@ -891,12 +891,12 @@ "start": { "line": 297, "column": 13, - "index": 9281 + "index": 9262 }, "end": { "line": 304, "column": 5, - "index": 9665 + "index": 9646 } }, { @@ -906,12 +906,12 @@ "start": { "line": 307, "column": 11, - "index": 9723 + "index": 9704 }, "end": { "line": 310, "column": 5, - "index": 9840 + "index": 9821 } }, { @@ -921,12 +921,12 @@ "start": { "line": 311, "column": 13, - "index": 9855 + "index": 9836 }, "end": { "line": 318, "column": 5, - "index": 10214 + "index": 10195 } }, { @@ -936,12 +936,12 @@ "start": { "line": 321, "column": 11, - "index": 10269 + "index": 10250 }, "end": { "line": 324, "column": 5, - "index": 10394 + "index": 10375 } }, { @@ -951,12 +951,12 @@ "start": { "line": 325, "column": 13, - "index": 10409 + "index": 10390 }, "end": { "line": 332, "column": 5, - "index": 10753 + "index": 10734 } }, { @@ -966,12 +966,12 @@ "start": { "line": 335, "column": 11, - "index": 10805 + "index": 10786 }, "end": { "line": 338, "column": 5, - "index": 10909 + "index": 10890 } }, { @@ -981,12 +981,12 @@ "start": { "line": 339, "column": 13, - "index": 10924 + "index": 10905 }, "end": { "line": 342, "column": 5, - "index": 11091 + "index": 11072 } }, { @@ -996,12 +996,12 @@ "start": { "line": 345, "column": 11, - "index": 11139 + "index": 11120 }, "end": { "line": 348, "column": 5, - "index": 11235 + "index": 11216 } }, { @@ -1011,12 +1011,12 @@ "start": { "line": 349, "column": 13, - "index": 11250 + "index": 11231 }, "end": { "line": 354, "column": 5, - "index": 11508 + "index": 11489 } }, { @@ -1026,12 +1026,12 @@ "start": { "line": 357, "column": 11, - "index": 11567 + "index": 11548 }, "end": { "line": 360, "column": 5, - "index": 11682 + "index": 11663 } }, { @@ -1041,12 +1041,12 @@ "start": { "line": 361, "column": 13, - "index": 11697 + "index": 11678 }, "end": { "line": 364, "column": 5, - "index": 11837 + "index": 11818 } }, { @@ -1056,12 +1056,12 @@ "start": { "line": 367, "column": 11, - "index": 11905 + "index": 11886 }, "end": { "line": 370, "column": 5, - "index": 12025 + "index": 12006 } }, { @@ -1071,12 +1071,12 @@ "start": { "line": 371, "column": 13, - "index": 12040 + "index": 12021 }, "end": { "line": 374, "column": 5, - "index": 12221 + "index": 12202 } }, { @@ -1086,12 +1086,12 @@ "start": { "line": 377, "column": 11, - "index": 12284 + "index": 12265 }, "end": { "line": 380, "column": 5, - "index": 12399 + "index": 12380 } }, { @@ -1101,12 +1101,12 @@ "start": { "line": 381, "column": 13, - "index": 12414 + "index": 12395 }, "end": { "line": 385, "column": 5, - "index": 12623 + "index": 12604 } }, { @@ -1116,12 +1116,12 @@ "start": { "line": 388, "column": 11, - "index": 12684 + "index": 12665 }, "end": { "line": 391, "column": 5, - "index": 12804 + "index": 12785 } }, { @@ -1131,12 +1131,12 @@ "start": { "line": 392, "column": 13, - "index": 12819 + "index": 12800 }, "end": { "line": 401, "column": 5, - "index": 13299 + "index": 13280 } }, { @@ -1146,12 +1146,12 @@ "start": { "line": 404, "column": 11, - "index": 13352 + "index": 13333 }, "end": { "line": 407, "column": 5, - "index": 13455 + "index": 13436 } }, { @@ -1161,12 +1161,12 @@ "start": { "line": 408, "column": 13, - "index": 13470 + "index": 13451 }, "end": { "line": 411, "column": 5, - "index": 13581 + "index": 13562 } }, { @@ -1176,12 +1176,12 @@ "start": { "line": 414, "column": 11, - "index": 13638 + "index": 13619 }, "end": { "line": 417, "column": 5, - "index": 13750 + "index": 13731 } }, { @@ -1191,12 +1191,12 @@ "start": { "line": 418, "column": 13, - "index": 13765 + "index": 13746 }, "end": { "line": 425, "column": 5, - "index": 14108 + "index": 14089 } }, { @@ -1206,12 +1206,12 @@ "start": { "line": 739, "column": 16, - "index": 22043 + "index": 22024 }, "end": { "line": 742, "column": 3, - "index": 22127 + "index": 22108 } }, { @@ -1221,12 +1221,12 @@ "start": { "line": 432, "column": 13, - "index": 14270 + "index": 14251 }, "end": { "line": 435, "column": 5, - "index": 14447 + "index": 14428 } }, { @@ -1236,12 +1236,12 @@ "start": { "line": 438, "column": 11, - "index": 14499 + "index": 14480 }, "end": { "line": 441, "column": 5, - "index": 14606 + "index": 14587 } }, { @@ -1251,12 +1251,12 @@ "start": { "line": 442, "column": 13, - "index": 14621 + "index": 14602 }, "end": { "line": 445, "column": 5, - "index": 14772 + "index": 14753 } }, { @@ -1266,12 +1266,12 @@ "start": { "line": 448, "column": 11, - "index": 14835 + "index": 14816 }, "end": { "line": 451, "column": 5, - "index": 14953 + "index": 14934 } }, { @@ -1281,12 +1281,12 @@ "start": { "line": 452, "column": 13, - "index": 14968 + "index": 14949 }, "end": { "line": 455, "column": 5, - "index": 15109 + "index": 15090 } }, { @@ -1296,12 +1296,12 @@ "start": { "line": 458, "column": 11, - "index": 15163 + "index": 15144 }, "end": { "line": 461, "column": 5, - "index": 15273 + "index": 15254 } }, { @@ -1311,12 +1311,12 @@ "start": { "line": 462, "column": 13, - "index": 15288 + "index": 15269 }, "end": { "line": 465, "column": 5, - "index": 15438 + "index": 15419 } }, { @@ -1326,12 +1326,12 @@ "start": { "line": 468, "column": 11, - "index": 15491 + "index": 15472 }, "end": { "line": 471, "column": 5, - "index": 15598 + "index": 15579 } }, { @@ -1341,12 +1341,12 @@ "start": { "line": 472, "column": 13, - "index": 15613 + "index": 15594 }, "end": { "line": 476, "column": 5, - "index": 15821 + "index": 15802 } }, { @@ -1356,12 +1356,12 @@ "start": { "line": 479, "column": 11, - "index": 15871 + "index": 15852 }, "end": { "line": 482, "column": 5, - "index": 15972 + "index": 15953 } }, { @@ -1371,12 +1371,12 @@ "start": { "line": 483, "column": 13, - "index": 15987 + "index": 15968 }, "end": { "line": 488, "column": 5, - "index": 16201 + "index": 16182 } }, { @@ -1386,12 +1386,12 @@ "start": { "line": 767, "column": 15, - "index": 22868 + "index": 22849 }, "end": { "line": 770, "column": 3, - "index": 22943 + "index": 22924 } }, { @@ -1401,12 +1401,12 @@ "start": { "line": 500, "column": 9, - "index": 16400 + "index": 16381 }, "end": { "line": 503, "column": 3, - "index": 16474 + "index": 16455 } }, { @@ -1416,12 +1416,12 @@ "start": { "line": 504, "column": 14, - "index": 16490 + "index": 16471 }, "end": { "line": 507, "column": 3, - "index": 16565 + "index": 16546 } }, { @@ -1431,12 +1431,12 @@ "start": { "line": 508, "column": 16, - "index": 16583 + "index": 16564 }, "end": { "line": 511, "column": 3, - "index": 16661 + "index": 16642 } }, { @@ -1446,12 +1446,12 @@ "start": { "line": 512, "column": 13, - "index": 16676 + "index": 16657 }, "end": { "line": 515, "column": 3, - "index": 16748 + "index": 16729 } }, { @@ -1461,12 +1461,12 @@ "start": { "line": 516, "column": 12, - "index": 16762 + "index": 16743 }, "end": { "line": 519, "column": 3, - "index": 16833 + "index": 16814 } }, { @@ -1476,12 +1476,12 @@ "start": { "line": 520, "column": 12, - "index": 16847 + "index": 16828 }, "end": { "line": 523, "column": 3, - "index": 16917 + "index": 16898 } }, { @@ -1491,12 +1491,12 @@ "start": { "line": 524, "column": 8, - "index": 16927 + "index": 16908 }, "end": { "line": 527, "column": 3, - "index": 16989 + "index": 16970 } }, { @@ -1506,12 +1506,12 @@ "start": { "line": 528, "column": 12, - "index": 17003 + "index": 16984 }, "end": { "line": 531, "column": 3, - "index": 17074 + "index": 17055 } }, { @@ -1521,12 +1521,12 @@ "start": { "line": 532, "column": 19, - "index": 17095 + "index": 17076 }, "end": { "line": 535, "column": 3, - "index": 17181 + "index": 17162 } }, { @@ -1536,12 +1536,12 @@ "start": { "line": 536, "column": 14, - "index": 17197 + "index": 17178 }, "end": { "line": 539, "column": 3, - "index": 17272 + "index": 17253 } }, { @@ -1551,12 +1551,12 @@ "start": { "line": 540, "column": 11, - "index": 17285 + "index": 17266 }, "end": { "line": 543, "column": 3, - "index": 17353 + "index": 17334 } }, { @@ -1566,12 +1566,12 @@ "start": { "line": 544, "column": 11, - "index": 17366 + "index": 17347 }, "end": { "line": 547, "column": 3, - "index": 17434 + "index": 17415 } }, { @@ -1581,12 +1581,12 @@ "start": { "line": 548, "column": 16, - "index": 17452 + "index": 17433 }, "end": { "line": 551, "column": 3, - "index": 17531 + "index": 17512 } }, { @@ -1596,12 +1596,12 @@ "start": { "line": 552, "column": 21, - "index": 17554 + "index": 17535 }, "end": { "line": 555, "column": 3, - "index": 17643 + "index": 17624 } }, { @@ -1611,12 +1611,12 @@ "start": { "line": 559, "column": 8, - "index": 17704 + "index": 17685 }, "end": { "line": 562, "column": 3, - "index": 17763 + "index": 17744 } }, { @@ -1626,12 +1626,12 @@ "start": { "line": 563, "column": 11, - "index": 17776 + "index": 17757 }, "end": { "line": 566, "column": 3, - "index": 17841 + "index": 17822 } }, { @@ -1641,12 +1641,12 @@ "start": { "line": 567, "column": 7, - "index": 17850 + "index": 17831 }, "end": { "line": 570, "column": 3, - "index": 17907 + "index": 17888 } }, { @@ -1656,12 +1656,12 @@ "start": { "line": 571, "column": 12, - "index": 17921 + "index": 17902 }, "end": { "line": 574, "column": 3, - "index": 17992 + "index": 17973 } }, { @@ -1671,12 +1671,12 @@ "start": { "line": 575, "column": 11, - "index": 18005 + "index": 17986 }, "end": { "line": 579, "column": 3, - "index": 18288 + "index": 18269 } }, { @@ -1686,12 +1686,12 @@ "start": { "line": 580, "column": 11, - "index": 18301 + "index": 18282 }, "end": { "line": 583, "column": 3, - "index": 18366 + "index": 18347 } }, { @@ -1701,12 +1701,12 @@ "start": { "line": 584, "column": 8, - "index": 18376 + "index": 18357 }, "end": { "line": 587, "column": 3, - "index": 18435 + "index": 18416 } }, { @@ -1716,12 +1716,12 @@ "start": { "line": 723, "column": 14, - "index": 21691 + "index": 21672 }, "end": { "line": 726, "column": 3, - "index": 21763 + "index": 21744 } }, { @@ -1731,12 +1731,12 @@ "start": { "line": 592, "column": 12, - "index": 18531 + "index": 18512 }, "end": { "line": 595, "column": 3, - "index": 18602 + "index": 18583 } }, { @@ -1746,12 +1746,12 @@ "start": { "line": 599, "column": 29, - "index": 18683 + "index": 18664 }, "end": { "line": 602, "column": 3, - "index": 18749 + "index": 18730 } }, { @@ -1761,12 +1761,12 @@ "start": { "line": 603, "column": 29, - "index": 18780 + "index": 18761 }, "end": { "line": 606, "column": 3, - "index": 18846 + "index": 18827 } }, { @@ -1776,12 +1776,12 @@ "start": { "line": 607, "column": 29, - "index": 18877 + "index": 18858 }, "end": { "line": 610, "column": 3, - "index": 18943 + "index": 18924 } }, { @@ -1791,12 +1791,12 @@ "start": { "line": 611, "column": 29, - "index": 18974 + "index": 18955 }, "end": { "line": 614, "column": 3, - "index": 19040 + "index": 19021 } }, { @@ -1806,12 +1806,12 @@ "start": { "line": 615, "column": 29, - "index": 19071 + "index": 19052 }, "end": { "line": 618, "column": 3, - "index": 19137 + "index": 19118 } }, { @@ -1821,12 +1821,12 @@ "start": { "line": 619, "column": 29, - "index": 19168 + "index": 19149 }, "end": { "line": 622, "column": 3, - "index": 19234 + "index": 19215 } }, { @@ -1836,12 +1836,12 @@ "start": { "line": 623, "column": 29, - "index": 19265 + "index": 19246 }, "end": { "line": 626, "column": 3, - "index": 19331 + "index": 19312 } }, { @@ -1851,12 +1851,12 @@ "start": { "line": 627, "column": 29, - "index": 19362 + "index": 19343 }, "end": { "line": 630, "column": 3, - "index": 19428 + "index": 19409 } }, { @@ -1866,12 +1866,12 @@ "start": { "line": 631, "column": 29, - "index": 19459 + "index": 19440 }, "end": { "line": 634, "column": 3, - "index": 19525 + "index": 19506 } }, { @@ -1881,12 +1881,12 @@ "start": { "line": 639, "column": 28, - "index": 19670 + "index": 19651 }, "end": { "line": 642, "column": 3, - "index": 19732 + "index": 19713 } }, { @@ -1896,12 +1896,12 @@ "start": { "line": 643, "column": 37, - "index": 19771 + "index": 19752 }, "end": { "line": 646, "column": 3, - "index": 19831 + "index": 19812 } }, { @@ -1911,12 +1911,12 @@ "start": { "line": 647, "column": 38, - "index": 19871 + "index": 19852 }, "end": { "line": 650, "column": 3, - "index": 19933 + "index": 19914 } }, { @@ -1926,12 +1926,12 @@ "start": { "line": 654, "column": 12, - "index": 19983 + "index": 19964 }, "end": { "line": 657, "column": 3, - "index": 20050 + "index": 20031 } }, { @@ -1941,12 +1941,12 @@ "start": { "line": 658, "column": 14, - "index": 20066 + "index": 20047 }, "end": { "line": 661, "column": 3, - "index": 20137 + "index": 20118 } }, { @@ -1956,12 +1956,12 @@ "start": { "line": 662, "column": 11, - "index": 20150 + "index": 20131 }, "end": { "line": 665, "column": 3, - "index": 20215 + "index": 20196 } }, { @@ -1971,12 +1971,12 @@ "start": { "line": 666, "column": 9, - "index": 20226 + "index": 20207 }, "end": { "line": 669, "column": 3, - "index": 20287 + "index": 20268 } }, { @@ -1986,12 +1986,12 @@ "start": { "line": 670, "column": 7, - "index": 20296 + "index": 20277 }, "end": { "line": 673, "column": 3, - "index": 20353 + "index": 20334 } }, { @@ -2001,12 +2001,12 @@ "start": { "line": 674, "column": 11, - "index": 20366 + "index": 20347 }, "end": { "line": 677, "column": 3, - "index": 20489 + "index": 20470 } }, { @@ -2016,12 +2016,12 @@ "start": { "line": 678, "column": 13, - "index": 20504 + "index": 20485 }, "end": { "line": 681, "column": 3, - "index": 20604 + "index": 20585 } }, { @@ -2031,12 +2031,12 @@ "start": { "line": 682, "column": 12, - "index": 20618 + "index": 20599 }, "end": { "line": 685, "column": 3, - "index": 20686 + "index": 20667 } }, { @@ -2046,12 +2046,12 @@ "start": { "line": 686, "column": 26, - "index": 20714 + "index": 20695 }, "end": { "line": 689, "column": 3, - "index": 20824 + "index": 20805 } }, { @@ -2061,12 +2061,12 @@ "start": { "line": 690, "column": 35, - "index": 20861 + "index": 20842 }, "end": { "line": 693, "column": 3, - "index": 20980 + "index": 20961 } }, { @@ -2076,12 +2076,12 @@ "start": { "line": 694, "column": 31, - "index": 21013 + "index": 20994 }, "end": { "line": 697, "column": 3, - "index": 21106 + "index": 21087 } }, { @@ -2092,12 +2092,12 @@ "start": { "line": 698, "column": 14, - "index": 21122 + "index": 21103 }, "end": { "line": 702, "column": 3, - "index": 21261 + "index": 21242 } }, { @@ -2107,12 +2107,12 @@ "start": { "line": 703, "column": 17, - "index": 21280 + "index": 21261 }, "end": { "line": 706, "column": 3, - "index": 21358 + "index": 21339 } }, { @@ -2122,12 +2122,12 @@ "start": { "line": 707, "column": 7, - "index": 21367 + "index": 21348 }, "end": { "line": 710, "column": 3, - "index": 21440 + "index": 21421 } }, { @@ -2137,12 +2137,12 @@ "start": { "line": 711, "column": 6, - "index": 21448 + "index": 21429 }, "end": { "line": 714, "column": 3, - "index": 21503 + "index": 21484 } }, { @@ -2152,12 +2152,12 @@ "start": { "line": 715, "column": 9, - "index": 21514 + "index": 21495 }, "end": { "line": 718, "column": 3, - "index": 21575 + "index": 21556 } }, { @@ -2167,12 +2167,12 @@ "start": { "line": 719, "column": 18, - "index": 21595 + "index": 21576 }, "end": { "line": 722, "column": 3, - "index": 21675 + "index": 21656 } }, { @@ -2182,12 +2182,12 @@ "start": { "line": 727, "column": 14, - "index": 21779 + "index": 21760 }, "end": { "line": 730, "column": 3, - "index": 21850 + "index": 21831 } }, { @@ -2197,12 +2197,12 @@ "start": { "line": 731, "column": 14, - "index": 21866 + "index": 21847 }, "end": { "line": 734, "column": 3, - "index": 21940 + "index": 21921 } }, { @@ -2212,12 +2212,12 @@ "start": { "line": 735, "column": 13, - "index": 21955 + "index": 21936 }, "end": { "line": 738, "column": 3, - "index": 22025 + "index": 22006 } }, { @@ -2227,12 +2227,12 @@ "start": { "line": 743, "column": 9, - "index": 22138 + "index": 22119 }, "end": { "line": 746, "column": 3, - "index": 22199 + "index": 22180 } }, { @@ -2242,12 +2242,12 @@ "start": { "line": 747, "column": 12, - "index": 22213 + "index": 22194 }, "end": { "line": 750, "column": 3, - "index": 22281 + "index": 22262 } }, { @@ -2257,12 +2257,12 @@ "start": { "line": 751, "column": 17, - "index": 22300 + "index": 22281 }, "end": { "line": 754, "column": 3, - "index": 22387 + "index": 22368 } }, { @@ -2272,12 +2272,12 @@ "start": { "line": 755, "column": 17, - "index": 22406 + "index": 22387 }, "end": { "line": 758, "column": 3, - "index": 22493 + "index": 22474 } }, { @@ -2287,12 +2287,12 @@ "start": { "line": 759, "column": 37, - "index": 22532 + "index": 22513 }, "end": { "line": 762, "column": 3, - "index": 22667 + "index": 22648 } }, { @@ -2302,12 +2302,12 @@ "start": { "line": 763, "column": 34, - "index": 22703 + "index": 22684 }, "end": { "line": 766, "column": 3, - "index": 22851 + "index": 22832 } }, { @@ -2317,12 +2317,12 @@ "start": { "line": 771, "column": 15, - "index": 22960 + "index": 22941 }, "end": { "line": 774, "column": 3, - "index": 23045 + "index": 23026 } }, { @@ -2332,12 +2332,12 @@ "start": { "line": 775, "column": 23, - "index": 23070 + "index": 23051 }, "end": { "line": 781, "column": 3, - "index": 23318 + "index": 23299 } }, { @@ -2347,12 +2347,12 @@ "start": { "line": 782, "column": 8, - "index": 23328 + "index": 23309 }, "end": { "line": 785, "column": 3, - "index": 23388 + "index": 23369 } }, { @@ -2362,12 +2362,12 @@ "start": { "line": 786, "column": 10, - "index": 23400 + "index": 23381 }, "end": { "line": 789, "column": 3, - "index": 23464 + "index": 23445 } }, { @@ -2377,12 +2377,12 @@ "start": { "line": 790, "column": 10, - "index": 23476 + "index": 23457 }, "end": { "line": 793, "column": 3, - "index": 23540 + "index": 23521 } }, { @@ -2392,12 +2392,12 @@ "start": { "line": 794, "column": 13, - "index": 23555 + "index": 23536 }, "end": { "line": 797, "column": 3, - "index": 23625 + "index": 23606 } }, { @@ -2407,12 +2407,12 @@ "start": { "line": 798, "column": 9, - "index": 23636 + "index": 23617 }, "end": { "line": 801, "column": 3, - "index": 23696 + "index": 23677 } }, { @@ -2422,12 +2422,12 @@ "start": { "line": 802, "column": 9, - "index": 23707 + "index": 23688 }, "end": { "line": 805, "column": 3, - "index": 23769 + "index": 23750 } }, { @@ -2437,12 +2437,12 @@ "start": { "line": 806, "column": 7, - "index": 23778 + "index": 23759 }, "end": { "line": 809, "column": 3, - "index": 23835 + "index": 23816 } }, { @@ -2452,12 +2452,12 @@ "start": { "line": 810, "column": 17, - "index": 23854 + "index": 23835 }, "end": { "line": 813, "column": 3, - "index": 23932 + "index": 23913 } }, { @@ -2467,12 +2467,12 @@ "start": { "line": 814, "column": 21, - "index": 23955 + "index": 23936 }, "end": { "line": 817, "column": 3, - "index": 24042 + "index": 24023 } }, { @@ -2482,12 +2482,12 @@ "start": { "line": 818, "column": 12, - "index": 24056 + "index": 24037 }, "end": { "line": 821, "column": 3, - "index": 24123 + "index": 24104 } }, { @@ -2497,12 +2497,12 @@ "start": { "line": 822, "column": 8, - "index": 24133 + "index": 24114 }, "end": { "line": 825, "column": 3, - "index": 24192 + "index": 24173 } }, { @@ -2512,12 +2512,12 @@ "start": { "line": 826, "column": 9, - "index": 24203 + "index": 24184 }, "end": { "line": 829, "column": 3, - "index": 24264 + "index": 24245 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/ConfirmPin.json b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/ConfirmPin.json new file mode 100644 index 0000000000..d7ccd534b6 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/ConfirmPin.json @@ -0,0 +1,32 @@ +[ + { + "id": "components.catalyst.step3.subTitle", + "defaultMessage": "!!!Enter PIN", + "file": "src/legacy/Catalyst/ConfirmPin.tsx", + "start": { + "line": 77, + "column": 12, + "index": 2225 + }, + "end": { + "line": 80, + "column": 3, + "index": 2312 + } + }, + { + "id": "components.catalyst.step3.description", + "defaultMessage": "!!!Please enter the PIN as you will need it every time you want to access the Catalyst Voting app", + "file": "src/legacy/Catalyst/ConfirmPin.tsx", + "start": { + "line": 81, + "column": 15, + "index": 2329 + }, + "end": { + "line": 84, + "column": 3, + "index": 2504 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/ConfirmVotingTx.json b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/ConfirmVotingTx.json new file mode 100644 index 0000000000..53a9c8a264 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/ConfirmVotingTx.json @@ -0,0 +1,47 @@ +[ + { + "id": "components.catalyst.step5.subTitle", + "defaultMessage": "!!!Confirm Registration", + "file": "src/legacy/Catalyst/ConfirmVotingTx.tsx", + "start": { + "line": 108, + "column": 12, + "index": 3578 + }, + "end": { + "line": 111, + "column": 3, + "index": 3676 + } + }, + { + "id": "components.catalyst.step5.description", + "defaultMessage": "!!!Please enter your spending password again to confirm your voting registration and submit the certificate generated in the previous step.", + "file": "src/legacy/Catalyst/ConfirmVotingTx.tsx", + "start": { + "line": 112, + "column": 15, + "index": 3693 + }, + "end": { + "line": 118, + "column": 3, + "index": 3938 + } + }, + { + "id": "components.catalyst.step4.bioAuthInstructions", + "defaultMessage": "!!!Please authenticate so that Yoroi can generate the required certificate for voting", + "file": "src/legacy/Catalyst/ConfirmVotingTx.tsx", + "start": { + "line": 119, + "column": 22, + "index": 3962 + }, + "end": { + "line": 122, + "column": 3, + "index": 4133 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/DisplayPin.json b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/DisplayPin.json new file mode 100644 index 0000000000..15c290f9c9 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/DisplayPin.json @@ -0,0 +1,32 @@ +[ + { + "id": "components.catalyst.step2.subTitle", + "defaultMessage": "!!!Write Down PIN", + "file": "src/legacy/Catalyst/DisplayPin.tsx", + "start": { + "line": 65, + "column": 12, + "index": 1674 + }, + "end": { + "line": 68, + "column": 3, + "index": 1766 + } + }, + { + "id": "components.catalyst.step2.description", + "defaultMessage": "!!!Please write down this PIN as you will need it every time you want to access the Catalyst Voting app", + "file": "src/legacy/Catalyst/DisplayPin.tsx", + "start": { + "line": 69, + "column": 15, + "index": 1783 + }, + "end": { + "line": 73, + "column": 3, + "index": 1970 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/DownloadCatalyst.json b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/DownloadCatalyst.json new file mode 100644 index 0000000000..b579d1a6fb --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/DownloadCatalyst.json @@ -0,0 +1,47 @@ +[ + { + "id": "components.catalyst.step1.subTitle", + "defaultMessage": "!!!Before you begin, make sure to download the Catalyst Voting App.", + "file": "src/legacy/Catalyst/DownloadCatalyst.tsx", + "start": { + "line": 122, + "column": 12, + "index": 3422 + }, + "end": { + "line": 125, + "column": 3, + "index": 3564 + } + }, + { + "id": "components.catalyst.step1.stakingKeyNotRegistered", + "defaultMessage": "!!!Catalyst voting rewards are sent to delegation accounts and your wallet does not seem to have a registered delegation certificate. If you want to receive voting rewards, you need to delegate your funds first.", + "file": "src/legacy/Catalyst/DownloadCatalyst.tsx", + "start": { + "line": 126, + "column": 27, + "index": 3593 + }, + "end": { + "line": 132, + "column": 3, + "index": 3922 + } + }, + { + "id": "components.catalyst.step1.tip", + "defaultMessage": "!!!Tip: Make sure you know how to take a screenshot with your device, so that you can backup your catalyst QR code.", + "file": "src/legacy/Catalyst/DownloadCatalyst.tsx", + "start": { + "line": 133, + "column": 7, + "index": 3931 + }, + "end": { + "line": 138, + "column": 3, + "index": 4133 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/QrCode.json b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/QrCode.json new file mode 100644 index 0000000000..8f8fcbb70b --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/QrCode.json @@ -0,0 +1,92 @@ +[ + { + "id": "components.catalyst.step6.subTitle", + "defaultMessage": "!!!Backup Catalyst Code", + "file": "src/legacy/Catalyst/QrCode.tsx", + "start": { + "line": 102, + "column": 12, + "index": 3135 + }, + "end": { + "line": 105, + "column": 3, + "index": 3233 + } + }, + { + "id": "components.catalyst.step6.description", + "defaultMessage": "!!!Please take a screenshot of this QR code.", + "file": "src/legacy/Catalyst/QrCode.tsx", + "start": { + "line": 106, + "column": 15, + "index": 3250 + }, + "end": { + "line": 109, + "column": 3, + "index": 3372 + } + }, + { + "id": "components.catalyst.step6.description2", + "defaultMessage": "!!!We strongly recommend you to save your Catalyst secret code in plain text too, so that you can re-create your QR code if necessary.", + "file": "src/legacy/Catalyst/QrCode.tsx", + "start": { + "line": 110, + "column": 16, + "index": 3390 + }, + "end": { + "line": 115, + "column": 3, + "index": 3620 + } + }, + { + "id": "components.catalyst.step6.description3", + "defaultMessage": "!!!Then, send the QR code to an external device, as you will need toscan it with your phone using the Catalyst mobile app.", + "file": "src/legacy/Catalyst/QrCode.tsx", + "start": { + "line": 116, + "column": 16, + "index": 3638 + }, + "end": { + "line": 121, + "column": 3, + "index": 3856 + } + }, + { + "id": "components.catalyst.step6.note", + "defaultMessage": "!!!Keep it — you won’t be able to access this code after tapping on Complete.", + "file": "src/legacy/Catalyst/QrCode.tsx", + "start": { + "line": 122, + "column": 8, + "index": 3866 + }, + "end": { + "line": 125, + "column": 3, + "index": 4014 + } + }, + { + "id": "components.catalyst.step6.secretCode", + "defaultMessage": "!!!Secret Code", + "file": "src/legacy/Catalyst/QrCode.tsx", + "start": { + "line": 126, + "column": 14, + "index": 4030 + }, + "end": { + "line": 129, + "column": 3, + "index": 4121 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/VotingBanner.json b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/VotingBanner.json new file mode 100644 index 0000000000..71d368d277 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/VotingBanner.json @@ -0,0 +1,17 @@ +[ + { + "id": "components.catalyst.banner.name", + "defaultMessage": "!!!Catalyst Voting Registration", + "file": "src/legacy/Catalyst/VotingBanner.tsx", + "start": { + "line": 77, + "column": 8, + "index": 2584 + }, + "end": { + "line": 80, + "column": 3, + "index": 2687 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/VotingRegistrationBackupCheckModal.json b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/VotingRegistrationBackupCheckModal.json new file mode 100644 index 0000000000..f57f1c56c6 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Catalyst/VotingRegistrationBackupCheckModal.json @@ -0,0 +1,47 @@ +[ + { + "id": "components.catalyst.catalystbackupcheckmodal.pinCheckbox", + "defaultMessage": "!!!I have written down my Catalyst PIN which I obtained in previous steps.", + "file": "src/legacy/Catalyst/VotingRegistrationBackupCheckModal.tsx", + "start": { + "line": 59, + "column": 15, + "index": 1816 + }, + "end": { + "line": 62, + "column": 3, + "index": 1987 + } + }, + { + "id": "components.catalyst.catalystbackupcheckmodal.qrCodeCheckbox", + "defaultMessage": "!!!I have taken a screenshot of my QR code and saved my Catalyst secret code as a fallback.", + "file": "src/legacy/Catalyst/VotingRegistrationBackupCheckModal.tsx", + "start": { + "line": 63, + "column": 18, + "index": 2007 + }, + "end": { + "line": 66, + "column": 3, + "index": 2198 + } + }, + { + "id": "components.catalyst.catalystbackupcheckmodal.consequencesCheckbox", + "defaultMessage": "!!!I understand that if I did not save my Catalyst PIN and QR code (or secret code) I will not be able to register and vote for Catalystproposals.", + "file": "src/legacy/Catalyst/VotingRegistrationBackupCheckModal.tsx", + "start": { + "line": 67, + "column": 24, + "index": 2224 + }, + "end": { + "line": 73, + "column": 3, + "index": 2504 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/Dashboard.json b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/Dashboard.json new file mode 100644 index 0000000000..c7a0ee83a1 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/Dashboard.json @@ -0,0 +1,17 @@ +[ + { + "id": "components.delegation.delegationnavigationbuttons.stakingCenterButton", + "defaultMessage": "!!!Go to Staking Center", + "file": "src/legacy/Dashboard/Dashboard.tsx", + "start": { + "line": 240, + "column": 23, + "index": 7999 + }, + "end": { + "line": 243, + "column": 3, + "index": 8132 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/DashboardNavigator.json b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/DashboardNavigator.json new file mode 100644 index 0000000000..bed9b665c9 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/DashboardNavigator.json @@ -0,0 +1,17 @@ +[ + { + "id": "components.stakingcenter.title", + "defaultMessage": "!!!Staking Center", + "file": "src/legacy/Dashboard/DashboardNavigator.tsx", + "start": { + "line": 65, + "column": 9, + "index": 2122 + }, + "end": { + "line": 68, + "column": 3, + "index": 2210 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/EpochProgress.json b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/EpochProgress.json new file mode 100644 index 0000000000..5231d309a3 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/EpochProgress.json @@ -0,0 +1,32 @@ +[ + { + "id": "components.delegationsummary.epochProgress.title", + "defaultMessage": "!!!Epoch progress", + "file": "src/legacy/Dashboard/EpochProgress.tsx", + "start": { + "line": 60, + "column": 22, + "index": 1678 + }, + "end": { + "line": 63, + "column": 3, + "index": 1784 + } + }, + { + "id": "components.delegationsummary.epochProgress.endsIn", + "defaultMessage": "!!!Ends in", + "file": "src/legacy/Dashboard/EpochProgress.tsx", + "start": { + "line": 64, + "column": 15, + "index": 1801 + }, + "end": { + "line": 67, + "column": 3, + "index": 1901 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/NotDelegatedInfo.json b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/NotDelegatedInfo.json new file mode 100644 index 0000000000..3937bff680 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/NotDelegatedInfo.json @@ -0,0 +1,32 @@ +[ + { + "id": "components.delegationsummary.notDelegatedInfo.firstLine", + "defaultMessage": "!!!You have not delegated your ADA yet.", + "file": "src/legacy/Dashboard/NotDelegatedInfo.tsx", + "start": { + "line": 66, + "column": 13, + "index": 1531 + }, + "end": { + "line": 69, + "column": 3, + "index": 1666 + } + }, + { + "id": "components.delegationsummary.notDelegatedInfo.secondLine", + "defaultMessage": "!!!Go to Staking center to choose which stake pool you want to delegate in. Note, you may delegate only to one stake pool in this Tesnnet.", + "file": "src/legacy/Dashboard/NotDelegatedInfo.tsx", + "start": { + "line": 70, + "column": 14, + "index": 1682 + }, + "end": { + "line": 74, + "column": 3, + "index": 1923 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/StakePoolInfo.json b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/StakePoolInfo.json new file mode 100644 index 0000000000..5f7aa7e322 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/StakePoolInfo.json @@ -0,0 +1,77 @@ +[ + { + "id": "components.delegationsummary.delegatedStakepoolInfo.title", + "defaultMessage": "!!!Stake pool delegated", + "file": "src/legacy/Dashboard/StakePoolInfo.tsx", + "start": { + "line": 128, + "column": 9, + "index": 3558 + }, + "end": { + "line": 131, + "column": 3, + "index": 3679 + } + }, + { + "id": "components.delegationsummary.delegatedStakepoolInfo.warning", + "defaultMessage": "!!!If you just delegated to a new stake pool it may take a couple of minutes for the network to process your request.", + "file": "src/legacy/Dashboard/StakePoolInfo.tsx", + "start": { + "line": 132, + "column": 11, + "index": 3692 + }, + "end": { + "line": 137, + "column": 3, + "index": 3927 + } + }, + { + "id": "components.delegationsummary.delegatedStakepoolInfo.fullDescriptionButtonLabel", + "defaultMessage": "!!!Go to website", + "file": "src/legacy/Dashboard/StakePoolInfo.tsx", + "start": { + "line": 138, + "column": 26, + "index": 3955 + }, + "end": { + "line": 141, + "column": 3, + "index": 4090 + } + }, + { + "id": "components.delegationsummary.delegatedStakepoolInfo.copied", + "defaultMessage": "!!!Copied!", + "file": "src/legacy/Dashboard/StakePoolInfo.tsx", + "start": { + "line": 142, + "column": 10, + "index": 4102 + }, + "end": { + "line": 145, + "column": 3, + "index": 4211 + } + }, + { + "id": "components.delegationsummary.delegatedStakepoolInfo.unknownPool", + "defaultMessage": "!!!Unknown pool", + "file": "src/legacy/Dashboard/StakePoolInfo.tsx", + "start": { + "line": 146, + "column": 15, + "index": 4228 + }, + "end": { + "line": 149, + "column": 3, + "index": 4347 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/UserSummary.json b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/UserSummary.json new file mode 100644 index 0000000000..027c78cc3f --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/UserSummary.json @@ -0,0 +1,62 @@ +[ + { + "id": "components.delegationsummary.userSummary.title", + "defaultMessage": "!!!Your Summary", + "file": "src/legacy/Dashboard/UserSummary.tsx", + "start": { + "line": 164, + "column": 9, + "index": 4872 + }, + "end": { + "line": 167, + "column": 3, + "index": 4974 + } + }, + { + "id": "components.delegationsummary.userSummary.totalRewards", + "defaultMessage": "!!!Total Rewards", + "file": "src/legacy/Dashboard/UserSummary.tsx", + "start": { + "line": 168, + "column": 16, + "index": 4992 + }, + "end": { + "line": 171, + "column": 3, + "index": 5102 + } + }, + { + "id": "components.delegationsummary.userSummary.totalDelegated", + "defaultMessage": "!!!Total Delegated", + "file": "src/legacy/Dashboard/UserSummary.tsx", + "start": { + "line": 172, + "column": 18, + "index": 5122 + }, + "end": { + "line": 175, + "column": 3, + "index": 5236 + } + }, + { + "id": "components.delegationsummary.userSummary.withdrawButtonTitle", + "defaultMessage": "!!!Withdraw", + "file": "src/legacy/Dashboard/UserSummary.tsx", + "start": { + "line": 176, + "column": 23, + "index": 5261 + }, + "end": { + "line": 179, + "column": 3, + "index": 5373 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.json b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.json new file mode 100644 index 0000000000..90c458117b --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.json @@ -0,0 +1,62 @@ +[ + { + "id": "components.walletinit.restorewallet.upgradeconfirmmodal.fromLabel", + "defaultMessage": "!!!From", + "file": "src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx", + "start": { + "line": 175, + "column": 13, + "index": 5541 + }, + "end": { + "line": 178, + "column": 3, + "index": 5654 + } + }, + { + "id": "components.walletinit.restorewallet.upgradeconfirmmodal.balanceLabel", + "defaultMessage": "!!!Recovered balance", + "file": "src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx", + "start": { + "line": 179, + "column": 16, + "index": 5672 + }, + "end": { + "line": 182, + "column": 3, + "index": 5801 + } + }, + { + "id": "components.walletinit.restorewallet.upgradeconfirmmodal.finalBalanceLabel", + "defaultMessage": "!!!Final balance", + "file": "src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx", + "start": { + "line": 183, + "column": 21, + "index": 5824 + }, + "end": { + "line": 186, + "column": 3, + "index": 5954 + } + }, + { + "id": "components.transfer.transfersummarymodal.unregisterExplanation", + "defaultMessage": "!!!This transaction will unregister one or more staking keys, giving you back your {refundAmount} from your deposit", + "file": "src/legacy/Dashboard/WithdrawStakingRewards/TransferSummary/TransferSummary.tsx", + "start": { + "line": 187, + "column": 25, + "index": 5981 + }, + "end": { + "line": 192, + "column": 3, + "index": 6216 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.json b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.json new file mode 100644 index 0000000000..8a20f22c10 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.json @@ -0,0 +1,137 @@ +[ + { + "id": "components.delegation.withdrawaldialog.warningModalTitle", + "defaultMessage": "!!!Also deregister staking key?", + "file": "src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx", + "start": { + "line": 130, + "column": 21, + "index": 4367 + }, + "end": { + "line": 133, + "column": 3, + "index": 4495 + } + }, + { + "id": "components.delegation.withdrawaldialog.explanation1", + "defaultMessage": "!!!When **withdrawing rewards**, you also have the option to deregister the staking key.", + "file": "src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx", + "start": { + "line": 134, + "column": 16, + "index": 4513 + }, + "end": { + "line": 137, + "column": 3, + "index": 4693 + } + }, + { + "id": "components.delegation.withdrawaldialog.explanation2", + "defaultMessage": "!!!**Keeping the staking key** will allow you to withdraw the rewards, but continue delegating to the same pool.", + "file": "src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx", + "start": { + "line": 138, + "column": 16, + "index": 4711 + }, + "end": { + "line": 143, + "column": 3, + "index": 4932 + } + }, + { + "id": "components.delegation.withdrawaldialog.explanation3", + "defaultMessage": "!!!**Deregistering the staking key** will give you back your deposit and undelegate the key from any pool.", + "file": "src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx", + "start": { + "line": 144, + "column": 16, + "index": 4950 + }, + "end": { + "line": 148, + "column": 3, + "index": 5154 + } + }, + { + "id": "components.delegation.withdrawaldialog.warning1", + "defaultMessage": "!!!You do NOT need to deregister to delegate to a different stake pool. You can change your delegation preference at any time.", + "file": "src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx", + "start": { + "line": 149, + "column": 12, + "index": 5168 + }, + "end": { + "line": 154, + "column": 3, + "index": 5399 + } + }, + { + "id": "components.delegation.withdrawaldialog.warning2", + "defaultMessage": "!!!You should NOT deregister if this staking key is used as a stake pool's reward account, as this will cause all pool operator rewards to be sent back to the reserve.", + "file": "src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx", + "start": { + "line": 155, + "column": 12, + "index": 5413 + }, + "end": { + "line": 161, + "column": 3, + "index": 5696 + } + }, + { + "id": "components.delegation.withdrawaldialog.warning3", + "defaultMessage": "!!!Deregistering means this key will no longer receive rewards until you re-register the staking key (usually by delegating to a pool again)", + "file": "src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx", + "start": { + "line": 162, + "column": 12, + "index": 5710 + }, + "end": { + "line": 167, + "column": 3, + "index": 5955 + } + }, + { + "id": "components.delegation.withdrawaldialog.keepButton", + "defaultMessage": "!!!Keep registered", + "file": "src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx", + "start": { + "line": 168, + "column": 14, + "index": 5971 + }, + "end": { + "line": 171, + "column": 3, + "index": 6079 + } + }, + { + "id": "components.delegation.withdrawaldialog.deregisterButton", + "defaultMessage": "!!!Deregister", + "file": "src/legacy/Dashboard/WithdrawStakingRewards/WithdrawStakingRewards.tsx", + "start": { + "line": 172, + "column": 20, + "index": 6101 + }, + "end": { + "line": 175, + "column": 3, + "index": 6210 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/HW/Instructions/Instructions.json b/apps/wallet-mobile/translations/messages/src/legacy/HW/Instructions/Instructions.json new file mode 100644 index 0000000000..53dedb2964 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/HW/Instructions/Instructions.json @@ -0,0 +1,17 @@ +[ + { + "id": "components.send.confirmscreen.beforeConfirm", + "defaultMessage": "!!!Before tapping on confirm, please follow these instructions:", + "file": "src/legacy/HW/Instructions/Instructions.tsx", + "start": { + "line": 52, + "column": 17, + "index": 1574 + }, + "end": { + "line": 55, + "column": 3, + "index": 1721 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/HW/LedgerConnect/LedgerConnect.json b/apps/wallet-mobile/translations/messages/src/legacy/HW/LedgerConnect/LedgerConnect.json new file mode 100644 index 0000000000..7762ecac4f --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/HW/LedgerConnect/LedgerConnect.json @@ -0,0 +1,62 @@ +[ + { + "id": "components.walletinit.connectnanox.connectnanoxscreen.caption", + "defaultMessage": "!!!Scanning bluetooth devices...", + "file": "src/legacy/HW/LedgerConnect/LedgerConnect.tsx", + "start": { + "line": 317, + "column": 11, + "index": 10113 + }, + "end": { + "line": 320, + "column": 3, + "index": 10247 + } + }, + { + "id": "components.walletinit.connectnanox.connectnanoxscreen.introline", + "defaultMessage": "!!!You'll need to:", + "file": "src/legacy/HW/LedgerConnect/LedgerConnect.tsx", + "start": { + "line": 321, + "column": 13, + "index": 10262 + }, + "end": { + "line": 324, + "column": 3, + "index": 10384 + } + }, + { + "id": "components.ledger.ledgerconnect.usbDeviceReady", + "defaultMessage": "!!!USB device is ready, please tap on Confirm to continue.", + "file": "src/legacy/HW/LedgerConnect/LedgerConnect.tsx", + "start": { + "line": 325, + "column": 18, + "index": 10404 + }, + "end": { + "line": 328, + "column": 3, + "index": 10549 + } + }, + { + "id": "components.walletinit.connectnanox.connectnanoxscreen.error", + "defaultMessage": "!!!An error occurred while trying to connect with your hardware wallet:", + "file": "src/legacy/HW/LedgerConnect/LedgerConnect.tsx", + "start": { + "line": 329, + "column": 9, + "index": 10560 + }, + "end": { + "line": 332, + "column": 3, + "index": 10731 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.json b/apps/wallet-mobile/translations/messages/src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.json new file mode 100644 index 0000000000..02747dab13 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.json @@ -0,0 +1,122 @@ +[ + { + "id": "components.ledger.ledgertransportswitchmodal.title", + "defaultMessage": "!!!Choose Connection Method", + "file": "src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx", + "start": { + "line": 99, + "column": 9, + "index": 2863 + }, + "end": { + "line": 102, + "column": 3, + "index": 2981 + } + }, + { + "id": "components.ledger.ledgertransportswitchmodal.usbExplanation", + "defaultMessage": "!!!Choose this option if you want to connect to a Ledger Nano model X or S using an on-the-go USB cable adaptor:", + "file": "src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx", + "start": { + "line": 103, + "column": 18, + "index": 3001 + }, + "end": { + "line": 108, + "column": 3, + "index": 3230 + } + }, + { + "id": "components.ledger.ledgertransportswitchmodal.usbButton", + "defaultMessage": "!!!Connect with USB", + "file": "src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx", + "start": { + "line": 109, + "column": 13, + "index": 3245 + }, + "end": { + "line": 112, + "column": 3, + "index": 3359 + } + }, + { + "id": "components.ledger.ledgertransportswitchmodal.usbButtonNotSupported", + "defaultMessage": "!!!Connect with USB\n(Not supported)", + "file": "src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx", + "start": { + "line": 113, + "column": 25, + "index": 3386 + }, + "end": { + "line": 116, + "column": 3, + "index": 3529 + } + }, + { + "id": "components.ledger.ledgertransportswitchmodal.usbButtonDisabled", + "defaultMessage": "!!!Connect with USB\n(Blocked by Apple for iOS)", + "file": "src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx", + "start": { + "line": 117, + "column": 21, + "index": 3552 + }, + "end": { + "line": 120, + "column": 3, + "index": 3702 + } + }, + { + "id": "components.ledger.ledgertransportswitchmodal.bluetoothExplanation", + "defaultMessage": "!!!Choose this option if you want to connect to a Ledger Nano model X through Bluetooth:", + "file": "src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx", + "start": { + "line": 121, + "column": 24, + "index": 3728 + }, + "end": { + "line": 124, + "column": 3, + "index": 3922 + } + }, + { + "id": "components.ledger.ledgertransportswitchmodal.bluetoothButton", + "defaultMessage": "!!!Connect with Bluetooth", + "file": "src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx", + "start": { + "line": 125, + "column": 19, + "index": 3943 + }, + "end": { + "line": 128, + "column": 3, + "index": 4069 + } + }, + { + "id": "global.ledgerMessages.bluetoothDisabledError", + "defaultMessage": "!!!Connect with Bluetooth", + "file": "src/legacy/HW/LedgerTransportSwitchModal/LedgerTransportSwitchModal.tsx", + "start": { + "line": 129, + "column": 18, + "index": 4089 + }, + "end": { + "line": 132, + "column": 3, + "index": 4199 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.json b/apps/wallet-mobile/translations/messages/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.json new file mode 100644 index 0000000000..5d7a4932f0 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.json @@ -0,0 +1,62 @@ +[ + { + "id": "components.stakingcenter.confirmDelegation.delegateButtonLabel", + "defaultMessage": "!!!Delegate", + "file": "src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.tsx", + "start": { + "line": 150, + "column": 23, + "index": 5518 + }, + "end": { + "line": 153, + "column": 3, + "index": 5632 + } + }, + { + "id": "components.stakingcenter.confirmDelegation.ofFees", + "defaultMessage": "!!!of fees", + "file": "src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.tsx", + "start": { + "line": 154, + "column": 10, + "index": 5644 + }, + "end": { + "line": 157, + "column": 3, + "index": 5744 + } + }, + { + "id": "components.stakingcenter.confirmDelegation.rewardsExplanation", + "defaultMessage": "!!!Current approximation of rewards that you will receive per epoch:", + "file": "src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.tsx", + "start": { + "line": 158, + "column": 22, + "index": 5768 + }, + "end": { + "line": 161, + "column": 3, + "index": 5938 + } + }, + { + "id": "components.delegationsummary.delegatedStakepoolInfo.unknownPool", + "defaultMessage": "!!!Unknown pool", + "file": "src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.tsx", + "start": { + "line": 162, + "column": 15, + "index": 5955 + }, + "end": { + "line": 165, + "column": 3, + "index": 6074 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Staking/FailedTx/FailedTxScreen.json b/apps/wallet-mobile/translations/messages/src/legacy/Staking/FailedTx/FailedTxScreen.json new file mode 100644 index 0000000000..cd4bd98605 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Staking/FailedTx/FailedTxScreen.json @@ -0,0 +1,62 @@ +[ + { + "id": "components.stakingcenter.failedDelegation.notEnoughFunds", + "defaultMessage": "!!!Not enough funds", + "file": "src/legacy/Staking/FailedTx/FailedTxScreen.tsx", + "start": { + "line": 104, + "column": 18, + "index": 2508 + }, + "end": { + "line": 107, + "column": 3, + "index": 2624 + } + }, + { + "id": "components.stakingcenter.failedDelegation.noFundsToProcess", + "defaultMessage": "!!!Your transaction cannot be processed due to lack of funds on your wallet balance", + "file": "src/legacy/Staking/FailedTx/FailedTxScreen.tsx", + "start": { + "line": 108, + "column": 20, + "index": 2646 + }, + "end": { + "line": 111, + "column": 3, + "index": 2828 + } + }, + { + "id": "components.stakingcenter.failedDelegation.buyAda", + "defaultMessage": "!!!Buy ada", + "file": "src/legacy/Staking/FailedTx/FailedTxScreen.tsx", + "start": { + "line": 112, + "column": 10, + "index": 2840 + }, + "end": { + "line": 115, + "column": 3, + "index": 2939 + } + }, + { + "id": "components.stakingcenter.failedDelegation.goToMain", + "defaultMessage": "!!!Go to main wallet page", + "file": "src/legacy/Staking/FailedTx/FailedTxScreen.tsx", + "start": { + "line": 116, + "column": 12, + "index": 2953 + }, + "end": { + "line": 119, + "column": 3, + "index": 3069 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Staking/PoolDetails/PoolDetailScreen.json b/apps/wallet-mobile/translations/messages/src/legacy/Staking/PoolDetails/PoolDetailScreen.json new file mode 100644 index 0000000000..6d6d56c670 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Staking/PoolDetails/PoolDetailScreen.json @@ -0,0 +1,47 @@ +[ + { + "id": "components.stakingcenter.confirmDelegation.delegateButtonLabel", + "defaultMessage": "!!!Delegate", + "file": "src/legacy/Staking/PoolDetails/PoolDetailScreen.tsx", + "start": { + "line": 81, + "column": 12, + "index": 1848 + }, + "end": { + "line": 84, + "column": 3, + "index": 1962 + } + }, + { + "id": "components.stakingcenter.pooldetailscreen.title", + "defaultMessage": "!!!Nightly delegation", + "file": "src/legacy/Staking/PoolDetails/PoolDetailScreen.tsx", + "start": { + "line": 85, + "column": 9, + "index": 1973 + }, + "end": { + "line": 88, + "column": 3, + "index": 2082 + } + }, + { + "id": "global.staking.stakePoolHash", + "defaultMessage": "!!!Stake pool hash", + "file": "src/legacy/Staking/PoolDetails/PoolDetailScreen.tsx", + "start": { + "line": 89, + "column": 12, + "index": 2096 + }, + "end": { + "line": 92, + "column": 3, + "index": 2183 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Staking/PoolTransition/usePoolTransition.json b/apps/wallet-mobile/translations/messages/src/legacy/Staking/PoolTransition/usePoolTransition.json new file mode 100644 index 0000000000..4f3b4cd2b5 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Staking/PoolTransition/usePoolTransition.json @@ -0,0 +1,197 @@ +[ + { + "id": "components.pooltransition.title", + "defaultMessage": "!!!Upgrade your stake pool", + "file": "src/legacy/Staking/PoolTransition/usePoolTransition.tsx", + "start": { + "line": 105, + "column": 9, + "index": 3653 + }, + "end": { + "line": 108, + "column": 3, + "index": 3751 + } + }, + { + "id": "components.pooltransition.warning", + "defaultMessage": "!!!The current stake pool you're using will soon close. Migrate to the new EMURGO pool to sustain reward generation.", + "file": "src/legacy/Staking/PoolTransition/usePoolTransition.tsx", + "start": { + "line": 109, + "column": 11, + "index": 3764 + }, + "end": { + "line": 113, + "column": 3, + "index": 3960 + } + }, + { + "id": "components.pooltransition.finalWarning", + "defaultMessage": "!!!The current stake pool you're using is decommissioned and NOT generating reward anymore. Update it to continue earning", + "file": "src/legacy/Staking/PoolTransition/usePoolTransition.tsx", + "start": { + "line": 114, + "column": 16, + "index": 3978 + }, + "end": { + "line": 118, + "column": 3, + "index": 4184 + } + }, + { + "id": "components.pooltransition.currentPool", + "defaultMessage": "!!!Current pool", + "file": "src/legacy/Staking/PoolTransition/usePoolTransition.tsx", + "start": { + "line": 119, + "column": 15, + "index": 4201 + }, + "end": { + "line": 122, + "column": 3, + "index": 4294 + } + }, + { + "id": "components.pooltransition.newPool", + "defaultMessage": "!!!New pool", + "file": "src/legacy/Staking/PoolTransition/usePoolTransition.tsx", + "start": { + "line": 123, + "column": 11, + "index": 4307 + }, + "end": { + "line": 126, + "column": 3, + "index": 4392 + } + }, + { + "id": "components.pooltransition.estimatedRoa", + "defaultMessage": "!!!Estimated ROA", + "file": "src/legacy/Staking/PoolTransition/usePoolTransition.tsx", + "start": { + "line": 127, + "column": 16, + "index": 4410 + }, + "end": { + "line": 130, + "column": 3, + "index": 4505 + } + }, + { + "id": "components.pooltransition.fee", + "defaultMessage": "!!!Fee", + "file": "src/legacy/Staking/PoolTransition/usePoolTransition.tsx", + "start": { + "line": 131, + "column": 7, + "index": 4514 + }, + "end": { + "line": 134, + "column": 3, + "index": 4590 + } + }, + { + "id": "components.pooltransition.poolGeneratesRewards", + "defaultMessage": "!!!This pool continues to generate staking rewards", + "file": "src/legacy/Staking/PoolTransition/usePoolTransition.tsx", + "start": { + "line": 135, + "column": 24, + "index": 4616 + }, + "end": { + "line": 138, + "column": 3, + "index": 4753 + } + }, + { + "id": "components.pooltransition.poolNoRewards", + "defaultMessage": "!!!This pool is NOT generating staking rewards anymore", + "file": "src/legacy/Staking/PoolTransition/usePoolTransition.tsx", + "start": { + "line": 139, + "column": 17, + "index": 4772 + }, + "end": { + "line": 142, + "column": 3, + "index": 4906 + } + }, + { + "id": "components.pooltransition.poolWillStopRewards", + "defaultMessage": "!!!This pool will stop generating rewards in", + "file": "src/legacy/Staking/PoolTransition/usePoolTransition.tsx", + "start": { + "line": 143, + "column": 23, + "index": 4931 + }, + "end": { + "line": 146, + "column": 3, + "index": 5061 + } + }, + { + "id": "components.pooltransition.skipNoRewards", + "defaultMessage": "!!!Skip and stop receiving rewards", + "file": "src/legacy/Staking/PoolTransition/usePoolTransition.tsx", + "start": { + "line": 147, + "column": 17, + "index": 5080 + }, + "end": { + "line": 150, + "column": 3, + "index": 5194 + } + }, + { + "id": "components.pooltransition.updateKeepEarning", + "defaultMessage": "!!!Update now and keep earning", + "file": "src/legacy/Staking/PoolTransition/usePoolTransition.tsx", + "start": { + "line": 151, + "column": 21, + "index": 5217 + }, + "end": { + "line": 154, + "column": 3, + "index": 5331 + } + }, + { + "id": "components.pooltransition.update", + "defaultMessage": "!!!Update pool", + "file": "src/legacy/Staking/PoolTransition/usePoolTransition.tsx", + "start": { + "line": 155, + "column": 10, + "index": 5343 + }, + "end": { + "line": 158, + "column": 3, + "index": 5430 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Staking/PoolWarningModal/PoolWarningModal.json b/apps/wallet-mobile/translations/messages/src/legacy/Staking/PoolWarningModal/PoolWarningModal.json new file mode 100644 index 0000000000..2cd6150fc7 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Staking/PoolWarningModal/PoolWarningModal.json @@ -0,0 +1,92 @@ +[ + { + "id": "components.stakingcenter.poolwarningmodal.title", + "defaultMessage": "!!!Attention", + "file": "src/legacy/Staking/PoolWarningModal/PoolWarningModal.tsx", + "start": { + "line": 126, + "column": 9, + "index": 3324 + }, + "end": { + "line": 129, + "column": 3, + "index": 3424 + } + }, + { + "id": "components.stakingcenter.poolwarningmodal.header", + "defaultMessage": "!!!Based on network activity, it seems this pool:", + "file": "src/legacy/Staking/PoolWarningModal/PoolWarningModal.tsx", + "start": { + "line": 130, + "column": 10, + "index": 3436 + }, + "end": { + "line": 133, + "column": 3, + "index": 3574 + } + }, + { + "id": "components.stakingcenter.poolwarningmodal.multiBlock", + "defaultMessage": "!!!Creates multiple blocks in the same slot (purposely causing forks)", + "file": "src/legacy/Staking/PoolWarningModal/PoolWarningModal.tsx", + "start": { + "line": 134, + "column": 14, + "index": 3590 + }, + "end": { + "line": 137, + "column": 3, + "index": 3752 + } + }, + { + "id": "components.stakingcenter.poolwarningmodal.censoringTxs", + "defaultMessage": "!!!Purposely excludes transactions from blocks (censoring the network)", + "file": "src/legacy/Staking/PoolWarningModal/PoolWarningModal.tsx", + "start": { + "line": 138, + "column": 16, + "index": 3770 + }, + "end": { + "line": 141, + "column": 3, + "index": 3935 + } + }, + { + "id": "components.stakingcenter.poolwarningmodal.suggested", + "defaultMessage": "!!!We suggest contacting the pool owner through the stake pool's webpage to ask about their behavior. Remember, you can change your delegation at any time without any interruptions in rewards.", + "file": "src/legacy/Staking/PoolWarningModal/PoolWarningModal.tsx", + "start": { + "line": 142, + "column": 13, + "index": 3950 + }, + "end": { + "line": 148, + "column": 3, + "index": 4262 + } + }, + { + "id": "components.stakingcenter.poolwarningmodal.unknown", + "defaultMessage": "!!!Causes some unknown issue (look online for more info)", + "file": "src/legacy/Staking/PoolWarningModal/PoolWarningModal.tsx", + "start": { + "line": 149, + "column": 11, + "index": 4275 + }, + "end": { + "line": 152, + "column": 3, + "index": 4421 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Staking/StakingCenter/StakingCenter.json b/apps/wallet-mobile/translations/messages/src/legacy/Staking/StakingCenter/StakingCenter.json new file mode 100644 index 0000000000..7340b747a2 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/Staking/StakingCenter/StakingCenter.json @@ -0,0 +1,32 @@ +[ + { + "id": "components.stakingcenter.noPoolDataDialog.title", + "defaultMessage": "!!!Invalid Pool Data", + "file": "src/legacy/Staking/StakingCenter/StakingCenter.tsx", + "start": { + "line": 97, + "column": 9, + "index": 3359 + }, + "end": { + "line": 100, + "column": 3, + "index": 3467 + } + }, + { + "id": "components.stakingcenter.noPoolDataDialog.message", + "defaultMessage": "!!!The data from the stake pool(s) you selected is invalid. Please try again", + "file": "src/legacy/Staking/StakingCenter/StakingCenter.tsx", + "start": { + "line": 101, + "column": 11, + "index": 3480 + }, + "end": { + "line": 104, + "column": 3, + "index": 3646 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/ModalInfo/ModalInfo.json b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/ModalInfo/ModalInfo.json new file mode 100644 index 0000000000..f433ad975a --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/ModalInfo/ModalInfo.json @@ -0,0 +1,17 @@ +[ + { + "id": "global.info", + "defaultMessage": "!!!Info", + "file": "src/legacy/TxHistory/ModalInfo/ModalInfo.tsx", + "start": { + "line": 33, + "column": 13, + "index": 841 + }, + "end": { + "line": 36, + "column": 3, + "index": 900 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxDetails/AssetList.json b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxDetails/AssetList.json new file mode 100644 index 0000000000..d8cb27cdfd --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxDetails/AssetList.json @@ -0,0 +1,17 @@ +[ + { + "id": "utils.format.unknownAssetName", + "defaultMessage": "!!![Unknown asset name]", + "file": "src/legacy/TxHistory/TxDetails/AssetList.tsx", + "start": { + "line": 96, + "column": 20, + "index": 3465 + }, + "end": { + "line": 99, + "column": 3, + "index": 3558 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxDetails/TxDetails.json b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxDetails/TxDetails.json new file mode 100644 index 0000000000..7ff4f82a27 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxDetails/TxDetails.json @@ -0,0 +1,242 @@ +[ + { + "id": "components.txhistory.txdetails.txTypeSent", + "defaultMessage": "!!!Sent funds", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 350, + "column": 8, + "index": 12289 + }, + "end": { + "line": 353, + "column": 3, + "index": 12384 + } + }, + { + "id": "components.txhistory.txdetails.txTypeReceived", + "defaultMessage": "!!!Received funds", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 354, + "column": 12, + "index": 12398 + }, + "end": { + "line": 357, + "column": 3, + "index": 12501 + } + }, + { + "id": "components.txhistory.txdetails.txTypeSelf", + "defaultMessage": "!!!Intrawallet transaction", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 358, + "column": 8, + "index": 12511 + }, + "end": { + "line": 361, + "column": 3, + "index": 12619 + } + }, + { + "id": "components.txhistory.txdetails.txTypeMulti", + "defaultMessage": "!!!Multi-party transaction", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 362, + "column": 9, + "index": 12630 + }, + "end": { + "line": 365, + "column": 3, + "index": 12739 + } + }, + { + "id": "components.txhistory.txdetails.addressPrefixReceive", + "defaultMessage": "!!!/{idx}", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 369, + "column": 24, + "index": 12803 + }, + "end": { + "line": 372, + "column": 3, + "index": 12904 + } + }, + { + "id": "components.txhistory.txdetails.addressPrefixChange", + "defaultMessage": "!!!/change", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 373, + "column": 23, + "index": 12929 + }, + "end": { + "line": 376, + "column": 3, + "index": 13030 + } + }, + { + "id": "components.txhistory.txdetails.addressPrefixNotMine", + "defaultMessage": "!!!not mine", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 377, + "column": 24, + "index": 13056 + }, + "end": { + "line": 380, + "column": 3, + "index": 13159 + } + }, + { + "id": "components.txhistory.txdetails.fee", + "defaultMessage": "!!!Fee:", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 381, + "column": 7, + "index": 13168 + }, + "end": { + "line": 384, + "column": 3, + "index": 13251 + } + }, + { + "id": "components.txhistory.txdetails.fromAddresses", + "defaultMessage": "!!!From Addresses", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 385, + "column": 17, + "index": 13270 + }, + "end": { + "line": 388, + "column": 3, + "index": 13372 + } + }, + { + "id": "components.txhistory.txdetails.toAddresses", + "defaultMessage": "!!!To Addresses", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 389, + "column": 15, + "index": 13389 + }, + "end": { + "line": 392, + "column": 3, + "index": 13487 + } + }, + { + "id": "components.txhistory.txdetails.memo", + "defaultMessage": "!!!Memo", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 393, + "column": 8, + "index": 13497 + }, + "end": { + "line": 396, + "column": 3, + "index": 13580 + } + }, + { + "id": "components.txhistory.txdetails.transactionId", + "defaultMessage": "!!!Transaction ID", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 397, + "column": 17, + "index": 13599 + }, + "end": { + "line": 400, + "column": 3, + "index": 13701 + } + }, + { + "id": "components.txhistory.txdetails.txAssuranceLevel", + "defaultMessage": "!!!Transaction assurance level", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 401, + "column": 20, + "index": 13723 + }, + "end": { + "line": 404, + "column": 3, + "index": 13841 + } + }, + { + "id": "components.txhistory.txdetails.confirmations", + "defaultMessage": "!!!{cnt} {cnt, plural, one {CONFIRMATION} other {CONFIRMATIONS}}", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 405, + "column": 17, + "index": 13860 + }, + "end": { + "line": 408, + "column": 3, + "index": 14009 + } + }, + { + "id": "components.txhistory.txdetails.omittedCount", + "defaultMessage": "!!!+ {cnt} omitted {cnt, plural, one {address} other {addresses}}", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 409, + "column": 16, + "index": 14027 + }, + "end": { + "line": 412, + "column": 3, + "index": 14176 + } + }, + { + "id": "global.openInExplorer", + "defaultMessage": "!!!Open in explorer", + "file": "src/legacy/TxHistory/TxDetails/TxDetails.tsx", + "start": { + "line": 413, + "column": 18, + "index": 14196 + }, + "end": { + "line": 416, + "column": 3, + "index": 14277 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxHistory.json b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxHistory.json new file mode 100644 index 0000000000..3aa2682fc0 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxHistory.json @@ -0,0 +1,32 @@ +[ + { + "id": "components.txhistory.txhistory.warningbanner.title", + "defaultMessage": "!!!Note:", + "file": "src/legacy/TxHistory/TxHistory.tsx", + "start": { + "line": 129, + "column": 9, + "index": 4264 + }, + "end": { + "line": 132, + "column": 3, + "index": 4363 + } + }, + { + "id": "components.txhistory.txhistory.warningbanner.message", + "defaultMessage": "!!!The Shelley protocol upgrade adds a new Shelley wallet type which supports delegation.", + "file": "src/legacy/TxHistory/TxHistory.tsx", + "start": { + "line": 133, + "column": 11, + "index": 4376 + }, + "end": { + "line": 136, + "column": 3, + "index": 4558 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxHistoryList/EmptyHistory.json b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxHistoryList/EmptyHistory.json new file mode 100644 index 0000000000..43ff88b69a --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxHistoryList/EmptyHistory.json @@ -0,0 +1,17 @@ +[ + { + "id": "components.txhistory.txhistory.noTransactions", + "defaultMessage": "!!!No transactions to show yet", + "file": "src/legacy/TxHistory/TxHistoryList/EmptyHistory.tsx", + "start": { + "line": 50, + "column": 18, + "index": 1131 + }, + "end": { + "line": 53, + "column": 3, + "index": 1247 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxHistoryList/TxHistoryListItem.json b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxHistoryList/TxHistoryListItem.json new file mode 100644 index 0000000000..21b5505156 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxHistoryList/TxHistoryListItem.json @@ -0,0 +1,93 @@ +[ + { + "id": "components.txhistory.txhistorylistitem.fee", + "defaultMessage": "!!!Fee", + "file": "src/legacy/TxHistory/TxHistoryList/TxHistoryListItem.tsx", + "start": { + "line": 183, + "column": 7, + "index": 6329 + }, + "end": { + "line": 186, + "column": 3, + "index": 6418 + } + }, + { + "id": "components.txhistory.txhistorylistitem.transactionTypeSent", + "defaultMessage": "!!!ADA sent", + "file": "src/legacy/TxHistory/TxHistoryList/TxHistoryListItem.tsx", + "start": { + "line": 187, + "column": 23, + "index": 6443 + }, + "end": { + "line": 190, + "column": 3, + "index": 6553 + } + }, + { + "id": "components.txhistory.txhistorylistitem.transactionTypeReceived", + "defaultMessage": "!!!ADA received", + "file": "src/legacy/TxHistory/TxHistoryList/TxHistoryListItem.tsx", + "start": { + "line": 191, + "column": 27, + "index": 6582 + }, + "end": { + "line": 194, + "column": 3, + "index": 6700 + } + }, + { + "id": "components.txhistory.txhistorylistitem.transactionTypeSelf", + "defaultMessage": "!!!Intrawallet", + "file": "src/legacy/TxHistory/TxHistoryList/TxHistoryListItem.tsx", + "start": { + "line": 195, + "column": 23, + "index": 6725 + }, + "end": { + "line": 198, + "column": 3, + "index": 6838 + } + }, + { + "id": "components.txhistory.txhistorylistitem.transactionTypeMulti", + "defaultMessage": "!!!Multiparty", + "file": "src/legacy/TxHistory/TxHistoryList/TxHistoryListItem.tsx", + "start": { + "line": 199, + "column": 24, + "index": 6864 + }, + "end": { + "line": 202, + "column": 3, + "index": 6977 + } + }, + { + "id": "global.txLabels.assets", + "description": "The number of assets different assets, not the amount", + "defaultMessage": "!!!{cnt} assets", + "file": "src/legacy/TxHistory/TxHistoryList/TxHistoryListItem.tsx", + "start": { + "line": 203, + "column": 10, + "index": 6989 + }, + "end": { + "line": 207, + "column": 3, + "index": 7141 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxHistoryNavigator.json b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxHistoryNavigator.json new file mode 100644 index 0000000000..05f5f143a9 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/legacy/TxHistory/TxHistoryNavigator.json @@ -0,0 +1,317 @@ +[ + { + "id": "components.receive.receivescreen.title", + "defaultMessage": "!!!Receive", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 433, + "column": 16, + "index": 17011 + }, + "end": { + "line": 436, + "column": 3, + "index": 17100 + } + }, + { + "id": "components.receive.describeselectedaddressscreen.title", + "defaultMessage": "!!!Address details", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 437, + "column": 32, + "index": 17134 + }, + "end": { + "line": 440, + "column": 3, + "index": 17247 + } + }, + { + "id": "swap.swapScreen.swapTitle", + "defaultMessage": "!!!Swap", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 441, + "column": 13, + "index": 17262 + }, + "end": { + "line": 444, + "column": 3, + "index": 17335 + } + }, + { + "id": "swap.swapScreen.swapFrom", + "defaultMessage": "!!!Swap from", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 445, + "column": 17, + "index": 17354 + }, + "end": { + "line": 448, + "column": 3, + "index": 17431 + } + }, + { + "id": "swap.swapScreen.swapTo", + "defaultMessage": "!!!Swap to", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 449, + "column": 15, + "index": 17448 + }, + "end": { + "line": 452, + "column": 3, + "index": 17521 + } + }, + { + "id": "swap.swapScreen.slippageTolerance", + "defaultMessage": "!!!Slippage Tolerance", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 453, + "column": 21, + "index": 17544 + }, + "end": { + "line": 456, + "column": 3, + "index": 17639 + } + }, + { + "id": "swap.swapScreen.selectPool", + "defaultMessage": "!!!Select pool", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 457, + "column": 14, + "index": 17655 + }, + "end": { + "line": 460, + "column": 3, + "index": 17736 + } + }, + { + "id": "components.send.sendscreen.title", + "defaultMessage": "!!!Send", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 461, + "column": 13, + "index": 17751 + }, + "end": { + "line": 464, + "column": 3, + "index": 17831 + } + }, + { + "id": "components.send.addressreaderqr.title", + "defaultMessage": "!!!Scan QR code address", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 465, + "column": 18, + "index": 17851 + }, + "end": { + "line": 468, + "column": 3, + "index": 17952 + } + }, + { + "id": "components.send.selectasset.title", + "defaultMessage": "!!!Select asset", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 469, + "column": 20, + "index": 17974 + }, + "end": { + "line": 472, + "column": 3, + "index": 18063 + } + }, + { + "id": "components.send.listamountstosendscreen.title", + "defaultMessage": "!!!Selected tokens", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 473, + "column": 26, + "index": 18091 + }, + "end": { + "line": 476, + "column": 3, + "index": 18195 + } + }, + { + "id": "components.send.editamountscreen.title", + "defaultMessage": "!!!Edit amount", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 477, + "column": 19, + "index": 18216 + }, + "end": { + "line": 480, + "column": 3, + "index": 18309 + } + }, + { + "id": "components.send.confirmscreen.title", + "defaultMessage": "!!!Confirm", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 481, + "column": 16, + "index": 18327 + }, + "end": { + "line": 484, + "column": 3, + "index": 18413 + } + }, + { + "id": "components.receive.receivescreen.infoText", + "defaultMessage": "!!!Share this address to receive payments. To protect your privacy, new addresses are generated automatically once you use them.", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 485, + "column": 19, + "index": 18434 + }, + "end": { + "line": 491, + "column": 3, + "index": 18672 + } + }, + { + "id": "global.confirmationTransaction", + "defaultMessage": "!!!Confirm transaction", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 492, + "column": 27, + "index": 18701 + }, + "end": { + "line": 495, + "column": 3, + "index": 18794 + } + }, + { + "id": "scan.title", + "defaultMessage": "!!!Please scan a QR code", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 496, + "column": 13, + "index": 18809 + }, + "end": { + "line": 499, + "column": 3, + "index": 18884 + } + }, + { + "id": "claim.showSuccess.title", + "defaultMessage": "!!!Success", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 500, + "column": 25, + "index": 18911 + }, + "end": { + "line": 503, + "column": 3, + "index": 18985 + } + }, + { + "id": "components.receive.receivescreen.specificAmount", + "defaultMessage": "!!!Request specific amount", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 504, + "column": 18, + "index": 19005 + }, + "end": { + "line": 507, + "column": 3, + "index": 19119 + } + }, + { + "id": "rampOnOff.rampOnOffScreen.rampOnOffTitle", + "defaultMessage": "!!!Buy/Sell ADA", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 508, + "column": 28, + "index": 19149 + }, + "end": { + "line": 511, + "column": 3, + "index": 19245 + } + }, + { + "id": "rampOnOff.rampOnOffScreen.exchangeSelectProvider.buy", + "defaultMessage": "!!!Buy provider", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 512, + "column": 29, + "index": 19276 + }, + "end": { + "line": 515, + "column": 3, + "index": 19384 + } + }, + { + "id": "rampOnOff.rampOnOffScreen.exchangeSelectProvider.sell", + "defaultMessage": "!!!Sell provider", + "file": "src/legacy/TxHistory/TxHistoryNavigator.tsx", + "start": { + "line": 516, + "column": 30, + "index": 19416 + }, + "end": { + "line": 519, + "column": 3, + "index": 19526 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/legacy/format.json b/apps/wallet-mobile/translations/messages/src/legacy/format.json index 494f9cb6a0..c430bce95d 100644 --- a/apps/wallet-mobile/translations/messages/src/legacy/format.json +++ b/apps/wallet-mobile/translations/messages/src/legacy/format.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!Today", "file": "src/legacy/format.ts", "start": { - "line": 220, + "line": 219, "column": 9, - "index": 7110 + "index": 6925 }, "end": { - "line": 223, + "line": 222, "column": 3, - "index": 7177 + "index": 6992 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!Yesterday", "file": "src/legacy/format.ts", "start": { - "line": 224, + "line": 223, "column": 13, - "index": 7192 + "index": 7007 }, "end": { - "line": 227, + "line": 226, "column": 3, - "index": 7267 + "index": 7082 } }, { @@ -34,14 +34,14 @@ "defaultMessage": "!!![Unknown asset name]", "file": "src/legacy/format.ts", "start": { - "line": 228, + "line": 227, "column": 20, - "index": 7289 + "index": 7104 }, "end": { - "line": 231, + "line": 230, "column": 3, - "index": 7382 + "index": 7197 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/yoroi-wallets/utils/format.json b/apps/wallet-mobile/translations/messages/src/yoroi-wallets/utils/format.json new file mode 100644 index 0000000000..26672d37f7 --- /dev/null +++ b/apps/wallet-mobile/translations/messages/src/yoroi-wallets/utils/format.json @@ -0,0 +1,47 @@ +[ + { + "id": "utils.format.today", + "defaultMessage": "!!!Today", + "file": "src/yoroi-wallets/utils/format.ts", + "start": { + "line": 214, + "column": 9, + "index": 6667 + }, + "end": { + "line": 217, + "column": 3, + "index": 6734 + } + }, + { + "id": "utils.format.yesterday", + "defaultMessage": "!!!Yesterday", + "file": "src/yoroi-wallets/utils/format.ts", + "start": { + "line": 218, + "column": 13, + "index": 6749 + }, + "end": { + "line": 221, + "column": 3, + "index": 6824 + } + }, + { + "id": "utils.format.unknownAssetName", + "defaultMessage": "!!![Unknown asset name]", + "file": "src/yoroi-wallets/utils/format.ts", + "start": { + "line": 222, + "column": 20, + "index": 6846 + }, + "end": { + "line": 225, + "column": 3, + "index": 6939 + } + } +] \ No newline at end of file diff --git a/apps/wallet-mobile/tsconfig.json b/apps/wallet-mobile/tsconfig.json index ab64ece701..7b0b86692e 100644 --- a/apps/wallet-mobile/tsconfig.json +++ b/apps/wallet-mobile/tsconfig.json @@ -13,5 +13,5 @@ "*.md": ["text-loader"] } }, - "include": ["./.d.ts", "./src", ".storybook/decorators", "src/kernel/logger/logger.ts"] + "include": ["./.d.ts", "./src", ".storybook/decorators"] } diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index 9354d3b531..d24804d39a 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -22,6 +22,7 @@ export * from './utils/monads' export * from './utils/parsers' export * from './utils/predicates' export * from './utils/strings' +export * from './utils/promises' export * from './numbers/to-bigint' export * from './numbers/split-bigint' diff --git a/packages/common/src/utils/promises.test.ts b/packages/common/src/utils/promises.test.ts new file mode 100644 index 0000000000..13e0b8bc71 --- /dev/null +++ b/packages/common/src/utils/promises.test.ts @@ -0,0 +1,74 @@ +import {PromiseAllLimited, runTasks} from './promises' + +describe('runTasks', () => { + it('should run tasks with limited concurrency', async () => { + const taskResults: number[] = [] + const taskIterator = function* () { + for (let i = 1; i <= 5; i++) { + yield async () => { + await new Promise((resolve) => setTimeout(resolve, 100)) + taskResults.push(i) + return i + } + } + } + + const results: number[] = [] + for await (const result of runTasks(taskIterator(), 2)) { + results.push(result) + } + + expect(results).toEqual([1, 2, 3, 4, 5]) + expect(taskResults).toEqual([1, 2, 3, 4, 5]) + }) + + it('should run tasks with limited concurrency (default)', async () => { + const taskResults: number[] = [] + const taskIterator = function* () { + for (let i = 1; i <= 5; i++) { + yield async () => { + await new Promise((resolve) => setTimeout(resolve, 100)) + taskResults.push(i) + return i + } + } + } + + const results: number[] = [] + for await (const result of runTasks(taskIterator())) { + results.push(result) + } + + expect(results).toEqual([1, 2, 3, 4, 5]) + expect(taskResults).toEqual([1, 2, 3, 4, 5]) + }) +}) + +describe('PromiseAllLimited', () => { + const tasks = [ + () => new Promise((resolve) => setTimeout(() => resolve(1), 100)), + () => new Promise((resolve) => setTimeout(() => resolve(2), 100)), + () => new Promise((resolve) => setTimeout(() => resolve(3), 100)), + () => new Promise((resolve) => setTimeout(() => resolve(4), 100)), + () => new Promise((resolve) => setTimeout(() => resolve(5), 100)), + ] + + it('should limit concurrent tasks and resolve with all results', async () => { + const results = await PromiseAllLimited(tasks, 2) + expect(results).toEqual([1, 2, 3, 4, 5]) + }) + + it('should limit with default the tasks and resolve with all results', async () => { + const results = await PromiseAllLimited(tasks) + expect(results).toEqual([1, 2, 3, 4, 5]) + }) + + it('should handle task errors', async () => { + await expect( + PromiseAllLimited( + [() => new Promise((_, reject) => reject(new Error('Task failed')))], + 2, + ), + ).rejects.toThrow('Task failed') + }) +}) diff --git a/packages/common/src/utils/promises.ts b/packages/common/src/utils/promises.ts new file mode 100644 index 0000000000..ef0e101315 --- /dev/null +++ b/packages/common/src/utils/promises.ts @@ -0,0 +1,72 @@ +export async function* runTasks( + taskIterator: Iterable<() => Promise>, + maxConcurrency = initialMaxConcurrency, +): AsyncGenerator { + async function* workerMaker(): AsyncGenerator { + for (const task of taskIterator) { + yield await task() + } + } + + const asyncIterators: AsyncGenerator[] = [] + for (let i = 0; i < maxConcurrency; i++) { + asyncIterators.push(workerMaker()) + } + + yield* raceAsyncIterators(asyncIterators) +} + +async function* raceAsyncIterators( + asyncIterators: AsyncGenerator[], +): AsyncGenerator { + async function nextResultWithItsIterator( + iterator: AsyncGenerator, + ) { + return {result: await iterator.next(), iterator} + } + + const promises = new Map< + AsyncGenerator, + Promise<{ + result: IteratorResult + iterator: AsyncGenerator + }> + >() + for (const iterator of asyncIterators) { + promises.set(iterator, nextResultWithItsIterator(iterator)) + } + + while (promises.size) { + const {result, iterator} = await Promise.race(promises.values()) + if (result.done) { + promises.delete(iterator) + } else { + promises.set(iterator, nextResultWithItsIterator(iterator)) + yield result.value + } + } +} + +export function PromiseAllLimited( + tasks: Array<() => Promise>, + maxConcurrency = initialMaxConcurrency, +): Promise { + return new Promise((resolve, reject) => { + const results: T[] = [] + + const runner = async () => { + try { + for await (const result of runTasks(tasks.values(), maxConcurrency)) { + results.push(result) + } + resolve(results) + } catch (error) { + reject(error) + } + } + + runner() + }) +} + +const initialMaxConcurrency = 3 diff --git a/packages/portfolio/src/adapters/dullahan-api/api-maker.test.ts b/packages/portfolio/src/adapters/dullahan-api/api-maker.test.ts index f62fb48e96..1d9790f6ce 100644 --- a/packages/portfolio/src/adapters/dullahan-api/api-maker.test.ts +++ b/packages/portfolio/src/adapters/dullahan-api/api-maker.test.ts @@ -16,6 +16,8 @@ describe('portfolioApiMaker', () => { const api = portfolioApiMaker({ network: mockNetwork, request: mockRequest, + maxIdsPerRequest: 10, + maxConcurrentRequests: 10, }) expect(Object.isFrozen(api)).toBe(true) @@ -27,6 +29,8 @@ describe('portfolioApiMaker', () => { it('should return a PortfolioApi object with default fetchData (coverage)', () => { const api = portfolioApiMaker({ network: mockNetwork, + maxIdsPerRequest: 10, + maxConcurrentRequests: 10, }) expect(api).toBeDefined() @@ -45,6 +49,8 @@ describe('portfolioApiMaker', () => { const api = portfolioApiMaker({ network: mockNetwork, request: mockRequest, + maxIdsPerRequest: 10, + maxConcurrentRequests: 10, }) const mockTokenIdsWithCache: ReadonlyArray< Api.RequestWithCache @@ -92,6 +98,8 @@ describe('portfolioApiMaker', () => { const api = portfolioApiMaker({ network: mockNetwork, request: mockRequest, + maxIdsPerRequest: 10, + maxConcurrentRequests: 10, }) const mockTokenIdsWithCache: ReadonlyArray< Api.RequestWithCache @@ -151,6 +159,8 @@ describe('portfolioApiMaker', () => { const api = portfolioApiMaker({ network: mockNetwork, request: mockRequest, + maxIdsPerRequest: 10, + maxConcurrentRequests: 10, }) const mockTokenIdsWithCache: ReadonlyArray< Api.RequestWithCache @@ -198,6 +208,8 @@ describe('portfolioApiMaker', () => { const api = portfolioApiMaker({ network: mockNetwork, request: mockRequest, + maxIdsPerRequest: 10, + maxConcurrentRequests: 10, }) const wrong = await api.tokenDiscovery( diff --git a/packages/portfolio/src/adapters/dullahan-api/api-maker.ts b/packages/portfolio/src/adapters/dullahan-api/api-maker.ts index 6b7a0734c2..5f235f34f9 100644 --- a/packages/portfolio/src/adapters/dullahan-api/api-maker.ts +++ b/packages/portfolio/src/adapters/dullahan-api/api-maker.ts @@ -1,4 +1,10 @@ -import {FetchData, fetchData, isLeft, isRight} from '@yoroi/common' +import { + FetchData, + PromiseAllLimited, + fetchData, + isLeft, + isRight, +} from '@yoroi/common' import {Api, Chain, Portfolio} from '@yoroi/types' import {freeze} from 'immer' @@ -13,9 +19,13 @@ import {parseTokenDiscovery} from '../../validators/token-discovery' export const portfolioApiMaker = ({ network, + maxIdsPerRequest, + maxConcurrentRequests, request = fetchData, }: { network: Chain.SupportedNetworks + maxIdsPerRequest: number + maxConcurrentRequests: number request?: FetchData }): Portfolio.Api.Api => { const config = apiConfig[network] @@ -63,31 +73,46 @@ export const portfolioApiMaker = ({ return response }, async tokenInfos(idsWithCache) { - const response = await request< - DullahanApiTokenInfosResponse, - DullahanApiCachedIdsRequest - >({ - method: 'post', - url: config.tokenInfos, - data: toDullahanRequest(idsWithCache), - headers: { - 'Content-Type': 'application/json', - 'Accept': 'application/json', - }, - }) - if (isLeft(response)) return response + const chunks = [] + for (let i = 0; i < idsWithCache.length; i += maxIdsPerRequest) + chunks.push(idsWithCache.slice(i, i + maxIdsPerRequest)) - try { - const transformedResponseData = toSecondaryTokenInfos( - response.value.data, + const tasks = chunks.map( + (ids) => () => + request( + { + method: 'post', + url: config.tokenInfos, + data: toDullahanRequest(ids), + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }, + }, + ), + ) + + const responses = await PromiseAllLimited(tasks, maxConcurrentRequests) + const infos = responses + .filter(isRight) + .reduce( + (acc, {value: {data}}) => Object.assign(acc, data), + {} as DullahanApiTokenInfosResponse, ) + // return with the first error only if none of responses were successful + const firstError = responses.find(isLeft) + if (Object.keys(infos).length === 0 && firstError) return firstError + + try { + const transformedResponseData = toSecondaryTokenInfos(infos) + const transformedResponse: Api.Response = freeze( { tag: 'right', value: { - status: response.value.status, + status: Api.HttpStatusCode.Ok, data: transformedResponseData, }, }, @@ -102,7 +127,7 @@ export const portfolioApiMaker = ({ error: { status: -3, message: 'Failed to transform token infos response', - responseData: response.value.data, + responseData: infos, }, }, true, diff --git a/yarn.lock b/yarn.lock index f4535a9742..13e0f8bfc0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21044,7 +21044,16 @@ 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", "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": + 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: 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== @@ -21157,7 +21166,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm: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== @@ -21185,6 +21194,13 @@ 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" @@ -22797,7 +22813,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@^7.0.0: +"wrap-ansi-cjs@npm: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== @@ -22833,6 +22849,15 @@ 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"