Skip to content

Commit 0546e9d

Browse files
committed
fixup! fix(suite-native): do not include solana staking in balance
1 parent 3b2b75a commit 0546e9d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

suite-native/device/src/selectors.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { selectFiatCurrencyCode, SettingsSliceRootState } from '@suite-native/se
2828
import { BigNumber } from '@trezor/utils';
2929
import { Account, RatesByKey } from '@suite-common/wallet-types';
3030
import { FiatCurrencyCode } from '@suite-common/suite-config';
31+
import { doesCoinSupportStaking } from '@suite-native/staking';
3132

3233
import { isFirmwareVersionSupported } from './utils';
3334

@@ -74,8 +75,8 @@ export const selectDeviceError = (
7475
return device?.error;
7576
};
7677

77-
// FIXME: this function can be removed and substitued with @suite-common/wallet-utils/getTotalFiatBalance when Solana supports staking on mobile.
78-
const getTotalFiatBalance = ({
78+
// FIXME: this function can be removed and substituted with @suite-common/wallet-utils/getTotalFiatBalance when Solana supports staking on mobile.
79+
const getTotalFiatBalanceNative = ({
7980
deviceAccounts,
8081
localCurrency,
8182
rates,
@@ -91,7 +92,7 @@ const getTotalFiatBalance = ({
9192
account: a,
9293
localCurrency,
9394
rates,
94-
shouldIncludeStaking: a.networkType !== 'solana',
95+
shouldIncludeStaking: doesCoinSupportStaking(a.symbol),
9596
}) ?? '0';
9697
instanceBalance = instanceBalance.plus(accountFiatBalance);
9798
});
@@ -102,13 +103,13 @@ const getTotalFiatBalance = ({
102103
export const selectSelectedDeviceTotalFiatBalance = createMemoizedSelector(
103104
[selectDeviceAccounts, selectCurrentFiatRates, selectFiatCurrencyCode],
104105
(deviceAccounts, rates, localCurrency) =>
105-
getTotalFiatBalance({ deviceAccounts, localCurrency, rates }),
106+
getTotalFiatBalanceNative({ deviceAccounts, localCurrency, rates }),
106107
);
107108

108109
export const selectDeviceTotalFiatBalanceByDeviceState = createMemoizedSelector(
109110
[selectAccountsByDeviceState, selectCurrentFiatRates, selectFiatCurrencyCode],
110111
(deviceAccounts, rates, localCurrency) =>
111-
getTotalFiatBalance({ deviceAccounts, localCurrency, rates }),
112+
getTotalFiatBalanceNative({ deviceAccounts, localCurrency, rates }),
112113
);
113114

114115
// Unique symbols for all accounts that are on view only devices (excluding portfolio tracker)

0 commit comments

Comments
 (0)