diff --git a/apps/wallet-mobile/src/WalletNavigator.tsx b/apps/wallet-mobile/src/WalletNavigator.tsx index ae3eec59e2..93b1053796 100644 --- a/apps/wallet-mobile/src/WalletNavigator.tsx +++ b/apps/wallet-mobile/src/WalletNavigator.tsx @@ -79,7 +79,7 @@ const WalletTabNavigator = () => { // keyboardWillShow keyboardWillHiden dont work on android display: isKeyboardOpen ? 'none' : undefined, }, - tabBarHideOnKeyboard: Platform.OS === 'android', + tabBarHideOnKeyboard: true, }} initialRouteName={initialRoute} backBehavior="initialRoute" diff --git a/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioBalanceManager.ts b/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioBalanceManager.ts index 4cbac672f4..77cfbf6ffe 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioBalanceManager.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioBalanceManager.ts @@ -30,10 +30,10 @@ export const buildPortfolioBalanceManager = ({ network: Chain.Network }) => { const primaryTokenInfo = network === Chain.Network.Main ? primaryTokenInfoMainnet : primaryTokenInfoAnyTestnet - const balanceStorageMounted = mountMMKVStorage({path: `/balance/${walletId}/`}) - const primaryBreakdownStorageMounted = mountMMKVStorage({ - path: `/primary-breakdown/${walletId}/`, - }) + const storage = mountMMKVStorage({path: `/`, id: `${network}.balance-manager`}) + const walletStorage = storage.join(`${walletId}/`) + const balanceStorageMounted = walletStorage.join('secondaries/') + const primaryBreakdownStorageMounted = walletStorage.join('primary/') const balanceStorage = portfolioBalanceStorageMaker({ balanceStorage: observableStorageMaker(balanceStorageMounted), 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 106ac31fea..e2e6652c4e 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioTokenManager.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioTokenManager.ts @@ -9,8 +9,9 @@ export const usePortfolioTokenManager = ({network}: {network: Chain.Network}) => } export const buildPortfolioTokenManager = ({network}: {network: Chain.Network}) => { - const tokenDiscoveryStorageMounted = mountMMKVStorage({path: `${network}/token-discovery/`}) - const tokenInfoStorageMounted = mountMMKVStorage({path: `${network}/token-info/`}) + const networkStorageMounted = mountMMKVStorage({path: '/', id: `${network}.token-manager`}) + const tokenDiscoveryStorageMounted = networkStorageMounted.join('token-discovery/') + const tokenInfoStorageMounted = networkStorageMounted.join('token-info/') const tokenStorage = portfolioTokenStorageMaker({ tokenDiscoveryStorage: observableStorageMaker(tokenDiscoveryStorageMounted), diff --git a/apps/wallet-mobile/src/features/Portfolio/common/transformers/toBalanceManagerSyncArgs.test.ts b/apps/wallet-mobile/src/features/Portfolio/common/transformers/toBalanceManagerSyncArgs.test.ts index ba4c26039a..89cf0764d3 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/transformers/toBalanceManagerSyncArgs.test.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/transformers/toBalanceManagerSyncArgs.test.ts @@ -34,8 +34,8 @@ describe('toBalanceManagerSyncArgs', () => { expect(result.primaryStated.totalFromTxs).toBe(300n) expect(result.primaryStated.lockedAsStorageCost).toBe(10n) - expect(result.secondaryBalances.get(`${policyId}.DEAD`)?.balance).toBe(120n) - expect(result.secondaryBalances.get(`${policyId}.DEADFEED`)?.balance).toBe(30n) - expect(result.secondaryBalances.get(`${policyId}.3031`)?.balance).toBe(80n) + expect(result.secondaryBalances.get(`${policyId}.DEAD`)?.quantity).toBe(120n) + expect(result.secondaryBalances.get(`${policyId}.DEADFEED`)?.quantity).toBe(30n) + expect(result.secondaryBalances.get(`${policyId}.3031`)?.quantity).toBe(80n) }) }) diff --git a/apps/wallet-mobile/src/features/Portfolio/common/transformers/toBalanceManagerSyncArgs.ts b/apps/wallet-mobile/src/features/Portfolio/common/transformers/toBalanceManagerSyncArgs.ts index 3407b3a95c..9bf0023ce6 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/transformers/toBalanceManagerSyncArgs.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/transformers/toBalanceManagerSyncArgs.ts @@ -4,14 +4,14 @@ import {RawUtxo} from '../../../../yoroi-wallets/types' export function toBalanceManagerSyncArgs(rawUtxos: RawUtxo[], lockedAsStorageCost: bigint) { let primaryTokenBalance = 0n - const secondaries = new Map>() + const secondaries = new Map>() for (const utxo of rawUtxos) { primaryTokenBalance += BigInt(utxo.amount) for (const record of utxo.assets) { const tokenId: Portfolio.Token.Id = `${record.policyId}.${record.name}` - const balance = (secondaries.get(tokenId)?.balance ?? 0n) + BigInt(record.amount) + const quantity = (secondaries.get(tokenId)?.quantity ?? 0n) + BigInt(record.amount) secondaries.set(tokenId, { - balance, + quantity, }) } } diff --git a/apps/wallet-mobile/src/features/Portfolio/useCases/PortfolioScreen.tsx b/apps/wallet-mobile/src/features/Portfolio/useCases/PortfolioScreen.tsx index 9cd33d42c8..0f58c27e7d 100644 --- a/apps/wallet-mobile/src/features/Portfolio/useCases/PortfolioScreen.tsx +++ b/apps/wallet-mobile/src/features/Portfolio/useCases/PortfolioScreen.tsx @@ -50,7 +50,7 @@ export const PortfolioScreen = () => { walelt: {walletId} - balance: {wallet.primaryBalance.balance.toString()} + balance: {wallet.primaryBalance.quantity.toString()} locked: {wallet.primaryBreakdown.lockedAsStorageCost.toString()} @@ -62,7 +62,7 @@ export const PortfolioScreen = () => { {item.info.name} - {item.balance.toString()} + {item.quantity.toString()} )} /> diff --git a/apps/wallet-mobile/src/yoroi-wallets/mocks/wallet.ts b/apps/wallet-mobile/src/yoroi-wallets/mocks/wallet.ts index f895f2dc13..1b3e3bf50e 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/mocks/wallet.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/mocks/wallet.ts @@ -89,7 +89,7 @@ const wallet: YoroiWallet = { nfts: [], }, primaryBalance: { - balance: 0n, + quantity: 0n, info: primaryTokenInfoMainnet, }, primaryBreakdown: { diff --git a/apps/wallet-mobile/translations/messages/src/AppNavigator.json b/apps/wallet-mobile/translations/messages/src/AppNavigator.json index 7ac0089c44..c0fc405262 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": 192, "column": 17, - "index": 6653 + "index": 6734 }, "end": { "line": 195, "column": 3, - "index": 6743 + "index": 6824 } }, { @@ -21,12 +21,12 @@ "start": { "line": 196, "column": 18, - "index": 6763 + "index": 6844 }, "end": { "line": 199, "column": 3, - "index": 6861 + "index": 6942 } }, { @@ -36,12 +36,12 @@ "start": { "line": 200, "column": 25, - "index": 6888 + "index": 6969 }, "end": { "line": 203, "column": 3, - "index": 7002 + "index": 7083 } }, { @@ -51,12 +51,12 @@ "start": { "line": 204, "column": 27, - "index": 7031 + "index": 7112 }, "end": { "line": 207, "column": 3, - "index": 7152 + "index": 7233 } } ] \ No newline at end of file diff --git a/apps/wallet-mobile/translations/messages/src/TxHistory/TxHistory.json b/apps/wallet-mobile/translations/messages/src/TxHistory/TxHistory.json index c699b8de78..d7265225ff 100644 --- a/apps/wallet-mobile/translations/messages/src/TxHistory/TxHistory.json +++ b/apps/wallet-mobile/translations/messages/src/TxHistory/TxHistory.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!Note:", "file": "src/TxHistory/TxHistory.tsx", "start": { - "line": 133, + "line": 129, "column": 9, - "index": 4322 + "index": 4195 }, "end": { - "line": 136, + "line": 132, "column": 3, - "index": 4421 + "index": 4294 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!The Shelley protocol upgrade adds a new Shelley wallet type which supports delegation.", "file": "src/TxHistory/TxHistory.tsx", "start": { - "line": 137, + "line": 133, "column": 11, - "index": 4434 + "index": 4307 }, "end": { - "line": 140, + "line": 136, "column": 3, - "index": 4616 + "index": 4489 } } ] \ 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 37b7c7a528..ca4d4ba9bb 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": 247, "column": 22, - "index": 8732 + "index": 8711 }, "end": { "line": 250, "column": 3, - "index": 8835 + "index": 8814 } }, { @@ -21,12 +21,12 @@ "start": { "line": 251, "column": 14, - "index": 8851 + "index": 8830 }, "end": { "line": 254, "column": 3, - "index": 8950 + "index": 8929 } }, { @@ -36,12 +36,12 @@ "start": { "line": 255, "column": 17, - "index": 8969 + "index": 8948 }, "end": { "line": 258, "column": 3, - "index": 9074 + "index": 9053 } }, { @@ -51,12 +51,12 @@ "start": { "line": 259, "column": 19, - "index": 9095 + "index": 9074 }, "end": { "line": 262, "column": 3, - "index": 9192 + "index": 9171 } }, { @@ -66,12 +66,12 @@ "start": { "line": 263, "column": 18, - "index": 9212 + "index": 9191 }, "end": { "line": 266, "column": 3, - "index": 9307 + "index": 9286 } }, { @@ -81,12 +81,12 @@ "start": { "line": 267, "column": 16, - "index": 9325 + "index": 9304 }, "end": { "line": 270, "column": 3, - "index": 9423 + "index": 9402 } }, { @@ -96,12 +96,12 @@ "start": { "line": 271, "column": 17, - "index": 9442 + "index": 9421 }, "end": { "line": 274, "column": 3, - "index": 9507 + "index": 9486 } }, { @@ -111,12 +111,12 @@ "start": { "line": 275, "column": 14, - "index": 9523 + "index": 9502 }, "end": { "line": 278, "column": 3, - "index": 9617 + "index": 9596 } }, { @@ -126,12 +126,12 @@ "start": { "line": 279, "column": 14, - "index": 9633 + "index": 9612 }, "end": { "line": 282, "column": 3, - "index": 9685 + "index": 9664 } }, { @@ -141,12 +141,12 @@ "start": { "line": 283, "column": 18, - "index": 9705 + "index": 9684 }, "end": { "line": 286, "column": 3, - "index": 9794 + "index": 9773 } }, { @@ -156,12 +156,12 @@ "start": { "line": 287, "column": 31, - "index": 9827 + "index": 9806 }, "end": { "line": 290, "column": 3, - "index": 9936 + "index": 9915 } } ] \ No newline at end of file