import {Fragment, h} from 'preact' import {useSelector, useActions} from '../../../helpers/connect' import actions from '../../../actions' import printAda from '../../../helpers/printAda' import { totalWalletBalanceSelector, totalRewardsBalanceSelector, hasStakingKey, } from '../../../selectors' import {AdaIcon} from '../../common/svg' import Alert from '../../common/alert' import {visitNufiTooltip} from '../../common/tooltip' import NufiPageLink from '../../common/nufiPageLink' import AccountTile from './accountTile' import {Lovelace} from '../../../../frontend/types' import Conversions from '../../common/conversions' import {shouldDisableSendingButton} from '../../../helpers/common' const AccountsDashboard = () => { const {debouncedReloadWalletInfo} = useActions(actions) const { accountsInfo, maxAccountIndex, totalWalletBalance, totalRewardsBalance, conversionRates, walletOperationStatusType, } = useSelector((state) => ({ accountsInfo: state.accountsInfo, maxAccountIndex: state.maxAccountIndex, activeAccountIndex: state.activeAccountIndex, // TODO: refactor to get .data elsewhere conversionRates: state.conversionRates && state.conversionRates.data, totalWalletBalance: totalWalletBalanceSelector(state), totalRewardsBalance: totalRewardsBalanceSelector(state), walletOperationStatusType: state.walletOperationStatusType, })) const InfoAlert = () => (

Accounts offer the possibility to split the funds on your wallet. You can delegate to different stakepool from each account. Each account has its own balance, set of addresses and keys.

Please read our{' '} comprehensive guide to accounts {' '} and make sure you understand how it works before using this feature.

Click Activate/Explore button to load data for related account. If you are using a hardware wallet, you will be requested to export public key. Note that content on all tabs corresponds to currently active account.

Click Transfer to move funds from one account to another. Select the source and the destination accounts, amount of ADA and tranfer your funds.

) return (

Wallet available balance

{printAda(totalWalletBalance as Lovelace)}
{conversionRates && ( )}

Wallet rewards balance

{printAda(totalRewardsBalance as Lovelace)}
{conversionRates && ( )}
{visitNufiTooltip({ content: ( Manage accounts more easily with ), tooltipMessage: 'Rename accounts, hide accounts you don’t use, and display your portfolio in 25+ supported currencies. Plus, log in to your wallet quickly using a password instead of entering a seed phrase or connecting a hardware wallet device.', })}
{accountsInfo.map((accountInfo) => ( ))} {accountsInfo[accountsInfo.length - 1].isUsed && accountsInfo.length - 1 < maxAccountIndex && ( )}
) } export default AccountsDashboard