diff --git a/browser/ui/webui/brave_wallet/common_handler/wallet_handler.cc b/browser/ui/webui/brave_wallet/common_handler/wallet_handler.cc index ea16ebe38e56..4e2395a46cfc 100644 --- a/browser/ui/webui/brave_wallet/common_handler/wallet_handler.cc +++ b/browser/ui/webui/brave_wallet/common_handler/wallet_handler.cc @@ -39,7 +39,8 @@ void WalletHandler::GetWalletInfo(GetWalletInfoCallback callback) { keyring_service->IsWalletCreatedSync(), keyring_service->IsLockedSync(), keyring_service->IsWalletBackedUpSync(), IsBitcoinEnabled(), IsBitcoinImportEnabled(), IsBitcoinLedgerEnabled(), IsZCashEnabled(), - IsAnkrBalancesEnabled(), IsTransactionSimulationsEnabled())); + IsAnkrBalancesEnabled(), IsTransactionSimulationsEnabled(), + IsZCashShieldedTransactionsEnabled())); } } // namespace brave_wallet diff --git a/components/brave_wallet/browser/brave_wallet_constants.h b/components/brave_wallet/browser/brave_wallet_constants.h index 94e7c571b134..d9fcb2ffc641 100644 --- a/components/brave_wallet/browser/brave_wallet_constants.h +++ b/components/brave_wallet/browser/brave_wallet_constants.h @@ -1584,7 +1584,15 @@ inline constexpr webui::LocalizedString kLocalizedStrings[] = { {"braveWalletFilters", IDS_BRAVE_WALLET_FILTERS}, {"braveWalletClearFilters", IDS_BRAVE_WALLET_CLEAR_FILTERS}, {"braveWalletShowMore", IDS_BRAVE_WALLET_SHOW_MORE}, - {"braveWalletDetails", IDS_BRAVE_WALLET_DETAILS}}; + {"braveWalletDetails", IDS_BRAVE_WALLET_DETAILS}, + {"braveWalletSwitchToShieldedAccount", + IDS_BRAVE_WALLET_SWITCH_TO_SHIELDED_ACCOUNT}, + {"braveWalletShieldAccount", IDS_BRAVE_WALLET_SHIELD_ACCOUNT}, + {"braveWalletAccountNotShieldedDescription", + IDS_BRAVE_WALLET_ACCOUNT_NOT_SHIELDED_DESCRIPTION}, + {"braveWalletAccountShieldedDescription", + IDS_BRAVE_WALLET_ACCOUNT_SHIELDED_DESCRIPTION}, + {"braveWalletShielded", IDS_BRAVE_WALLET_SHIELDED}}; // 0x swap constants inline constexpr char kZeroExSepoliaBaseAPIURL[] = diff --git a/components/brave_wallet/common/brave_wallet.mojom b/components/brave_wallet/common/brave_wallet.mojom index ce2b99865ab4..8374623908a8 100644 --- a/components/brave_wallet/common/brave_wallet.mojom +++ b/components/brave_wallet/common/brave_wallet.mojom @@ -981,6 +981,7 @@ struct WalletInfo { bool is_z_cash_enabled; bool is_ankr_balances_feature_enabled; bool is_transaction_simulations_feature_enabled; + bool is_z_cash_shielded_transactions_enabled; }; // Browser-side handler for common panel / page things diff --git a/components/brave_wallet_ui/common/async/__mocks__/bridge.ts b/components/brave_wallet_ui/common/async/__mocks__/bridge.ts index 44ed694fac8a..a0a139452b05 100644 --- a/components/brave_wallet_ui/common/async/__mocks__/bridge.ts +++ b/components/brave_wallet_ui/common/async/__mocks__/bridge.ts @@ -1288,7 +1288,8 @@ export class MockedWalletApiProxy { isWalletCreated: true, isWalletLocked: false, isAnkrBalancesFeatureEnabled: false, - isTransactionSimulationsFeatureEnabled: true + isTransactionSimulationsFeatureEnabled: true, + isZCashShieldedTransactionsEnabled: false } } } diff --git a/components/brave_wallet_ui/common/selectors/wallet-selectors.ts b/components/brave_wallet_ui/common/selectors/wallet-selectors.ts index 5cb425023c54..db034dc74215 100644 --- a/components/brave_wallet_ui/common/selectors/wallet-selectors.ts +++ b/components/brave_wallet_ui/common/selectors/wallet-selectors.ts @@ -24,6 +24,8 @@ export const isAnkrBalancesFeatureEnabled = ({ wallet }: State) => wallet.isAnkrBalancesFeatureEnabled export const isRefreshingNetworksAndTokens = ({ wallet }: State) => wallet.isRefreshingNetworksAndTokens +export const isZCashShieldedTransactionsEnabled = ({ wallet }: State) => + wallet.isZCashShieldedTransactionsEnabled // unsafe selectors (will cause re-render if not strictly equal "===") (objects // and lists) diff --git a/components/brave_wallet_ui/common/slices/api-base.slice.ts b/components/brave_wallet_ui/common/slices/api-base.slice.ts index 4ea6781a0fb6..5a7846fce688 100644 --- a/components/brave_wallet_ui/common/slices/api-base.slice.ts +++ b/components/brave_wallet_ui/common/slices/api-base.slice.ts @@ -75,7 +75,8 @@ export function createWalletApiBase() { 'PinnableNftIds', 'PendingSignMessageRequests', 'PendingSignMessageErrors', - 'ActiveOrigin' + 'ActiveOrigin', + 'ZCashAccountInfo' ], endpoints: ({ mutation, query }) => ({}) }) diff --git a/components/brave_wallet_ui/common/slices/api.slice.ts b/components/brave_wallet_ui/common/slices/api.slice.ts index 7b98cceacb46..8be8fe6d91c1 100644 --- a/components/brave_wallet_ui/common/slices/api.slice.ts +++ b/components/brave_wallet_ui/common/slices/api.slice.ts @@ -49,6 +49,7 @@ import { swapEndpoints } from './endpoints/swap.endpoints' import { encryptionEndpoints } from './endpoints/encryption.endpoints' import { signingEndpoints } from './endpoints/signing.endpoints' import { dappRadarEndpoints } from './endpoints/dapp_radar.endpoints' +import { zcashEndpoints } from './endpoints/zcash.endpoints' export function createWalletApi() { // base to add endpoints to @@ -157,6 +158,8 @@ export function createWalletApi() { .injectEndpoints({ endpoints: signingEndpoints }) // dApp Radar Endpoints .injectEndpoints({ endpoints: dappRadarEndpoints }) + // zcash endpoints + .injectEndpoints({ endpoints: zcashEndpoints }) ) } @@ -253,6 +256,7 @@ export const { useGetTransactionsQuery, useGetUserTokensRegistryQuery, useGetWalletsToImportQuery, + useGetZCashAccountInfoQuery, useHideNetworksMutation, useImportAccountFromJsonMutation, useImportAccountMutation, @@ -290,7 +294,9 @@ export const { useLazyGetTokensRegistryQuery, useLazyGetTransactionsQuery, useLazyGetUserTokensRegistryQuery, + useLazyGetZCashAccountInfoQuery, useLockWalletMutation, + useMakeAccountShieldedMutation, useNewUnapprovedTxAddedMutation, useOpenPanelUIMutation, usePrefetch, diff --git a/components/brave_wallet_ui/common/slices/endpoints/zcash.endpoints.ts b/components/brave_wallet_ui/common/slices/endpoints/zcash.endpoints.ts new file mode 100644 index 000000000000..bd5a76807eb3 --- /dev/null +++ b/components/brave_wallet_ui/common/slices/endpoints/zcash.endpoints.ts @@ -0,0 +1,74 @@ +// Copyright (c) 2024 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +// Types +import { BraveWallet } from '../../../constants/types' + +// Utils +import { handleEndpointError } from '../../../utils/api-utils' +import { WalletApiEndpointBuilderParams } from '../api-base.slice' + +export const zcashEndpoints = ({ + query, + mutation +}: WalletApiEndpointBuilderParams) => { + return { + makeAccountShielded: mutation({ + queryFn: async (args, { endpoint }, _extraOptions, baseQuery) => { + try { + const { zcashWalletService } = baseQuery(undefined).data + + const { errorMessage } = await zcashWalletService.makeAccountShielded( + args + ) + + if (errorMessage) { + return handleEndpointError( + endpoint, + 'Error making account shielded: ', + errorMessage + ) + } + + return { + data: true + } + } catch (error) { + return handleEndpointError( + endpoint, + 'Error making account shielded: ', + error + ) + } + }, + invalidatesTags: ['ZCashAccountInfo'] + }), + getZCashAccountInfo: query< + BraveWallet.ZCashAccountInfo | null, + BraveWallet.AccountId + >({ + queryFn: async (args, { endpoint }, _extraOptions, baseQuery) => { + try { + const { zcashWalletService } = baseQuery(undefined).data + + const { accountInfo } = await zcashWalletService.getZCashAccountInfo( + args + ) + + return { + data: accountInfo + } + } catch (error) { + return handleEndpointError( + endpoint, + 'Error getting ZCash account info: ', + error + ) + } + }, + providesTags: ['ZCashAccountInfo'] + }) + } +} diff --git a/components/brave_wallet_ui/common/slices/wallet.slice.ts b/components/brave_wallet_ui/common/slices/wallet.slice.ts index b52ca9427ad4..67455cf92ef7 100644 --- a/components/brave_wallet_ui/common/slices/wallet.slice.ts +++ b/components/brave_wallet_ui/common/slices/wallet.slice.ts @@ -33,7 +33,8 @@ const defaultState: WalletState = { passwordAttempts: 0, assetAutoDiscoveryCompleted: true, isAnkrBalancesFeatureEnabled: false, - isRefreshingNetworksAndTokens: false + isRefreshingNetworksAndTokens: false, + isZCashShieldedTransactionsEnabled: false } // async actions @@ -81,6 +82,8 @@ export const createWalletSlice = (initialState: WalletState = defaultState) => { state.isWalletLocked = payload.walletInfo.isWalletLocked state.isAnkrBalancesFeatureEnabled = payload.walletInfo.isAnkrBalancesFeatureEnabled + state.isZCashShieldedTransactionsEnabled = + payload.walletInfo.isZCashShieldedTransactionsEnabled }, setAssetAutoDiscoveryCompleted( diff --git a/components/brave_wallet_ui/components/desktop/account-list-item/index.tsx b/components/brave_wallet_ui/components/desktop/account-list-item/index.tsx index 89376597e3c2..9b137ac1ca89 100644 --- a/components/brave_wallet_ui/components/desktop/account-list-item/index.tsx +++ b/components/brave_wallet_ui/components/desktop/account-list-item/index.tsx @@ -4,6 +4,9 @@ // you can obtain one at https://mozilla.org/MPL/2.0/. import * as React from 'react' +import { skipToken } from '@reduxjs/toolkit/query/react' +import Label from '@brave/leo/react/label' +import Icon from '@brave/leo/react/icon' // redux import { useDispatch } from 'react-redux' @@ -32,8 +35,11 @@ import { getEntitiesListFromEntityState } from '../../../utils/entities.utils' import { useOnClickOutside } from '../../../common/hooks/useOnClickOutside' // Selectors -import { UISelectors } from '../../../common/selectors' -import { useSafeUISelector } from '../../../common/hooks/use-safe-selector' +import { UISelectors, WalletSelectors } from '../../../common/selectors' +import { + useSafeUISelector, + useSafeWalletSelector +} from '../../../common/hooks/use-safe-selector' // Queries import { @@ -42,7 +48,8 @@ import { import { useGetDefaultFiatCurrencyQuery, useGetRewardsInfoQuery, - useGetUserTokensRegistryQuery + useGetUserTokensRegistryQuery, + useGetZCashAccountInfoQuery } from '../../../common/slices/api.slice' // types @@ -68,6 +75,9 @@ import { import { TokenIconsStack } from '../../shared/icon-stacks/token-icons-stack' import LoadingSkeleton from '../../shared/loading-skeleton' import { RewardsLogin } from '../rewards_login/rewards_login' +import { + ShieldZCashAccountModal // +} from '../popup-modals/shield_zcash_account/shield_zcash_account' // style import { @@ -114,10 +124,20 @@ export const AccountListItem = ({ // selectors const isPanel = useSafeUISelector(UISelectors.isPanel) + // redux + const isZCashShieldedTransactionsEnabled = useSafeWalletSelector( + WalletSelectors.isZCashShieldedTransactionsEnabled + ) // queries const { data: defaultFiatCurrency = 'usd' } = useGetDefaultFiatCurrencyQuery() const { data: userTokensRegistry } = useGetUserTokensRegistryQuery() + const { data: zCashAccountInfo } = useGetZCashAccountInfoQuery( + isZCashShieldedTransactionsEnabled && + account.accountId.coin === BraveWallet.CoinType.ZEC + ? account.accountId + : skipToken + ) const { data: { @@ -130,6 +150,8 @@ export const AccountListItem = ({ // state const [showAccountMenu, setShowAccountMenu] = React.useState(false) + const [showShieldAccountModal, setShowShieldAccountModal] = + React.useState(false) // refs const accountMenuRef = React.useRef(null) @@ -174,6 +196,10 @@ export const AccountListItem = ({ onRemoveAccount() return } + if (id === 'shield') { + setShowShieldAccountModal(true) + return + } onShowAccountsModal(id) }, [onSelectAccount, onRemoveAccount, onShowAccountsModal] @@ -291,6 +317,12 @@ export const AccountListItem = ({ ].includes(account.accountId.coin) && account.accountId.kind !== BraveWallet.AccountKind.kHardware + const canShieldAccount = + isZCashShieldedTransactionsEnabled && + account.accountId.coin === BraveWallet.CoinType.ZEC && + zCashAccountInfo && + !zCashAccountInfo.accountShieldBirthday + let options = [...AccountButtonOptions] if (!canRemove) { @@ -299,132 +331,154 @@ export const AccountListItem = ({ if (!canExportPrivateKey) { options = options.filter((option) => option.id !== 'privateKey') } + if (!canShieldAccount) { + options = options.filter((option) => option.id !== 'shield') + } return options - }, [account]) + }, [account, isZCashShieldedTransactionsEnabled, zCashAccountInfo]) // render return ( - - - - - - - - - {account.name} - - - {isRewardsAccount && ( - <> - - - {getLocale('braveWalletBraveRewardsTitle')} - - - + <> + + + + + + + + + {account.name} + + + {zCashAccountInfo && + zCashAccountInfo.accountShieldBirthday && ( + + )} + {isRewardsAccount && ( + <> + + + {getLocale('braveWalletBraveRewardsTitle')} + + + + )} + + {account.address && !isRewardsAccount && ( + + {reduceAddress(account.address)} + )} - - {account.address && !isRewardsAccount && ( - - {reduceAddress(account.address)} - - )} - - {isRewardsAccount - ? getRewardsTokenDescription(externalProvider ?? null) - : getAccountTypeDescription(account.accountId)} - - - - - {!isDisconnectedRewardsAccount && ( - - {!isPanel && !accountsFiatValue.isZero() ? ( - tokensWithBalances.length ? ( - - ) : ( + + {isRewardsAccount + ? getRewardsTokenDescription(externalProvider ?? null) + : getAccountTypeDescription(account.accountId)} + + + + + {!isDisconnectedRewardsAccount && ( + + {!isPanel && !accountsFiatValue.isZero() ? ( + tokensWithBalances.length ? ( + + ) : ( + <> + + + + ) + ) : null} + + {accountsFiatValue.isUndefined() ? ( <> - + - ) - ) : null} + ) : ( + <> + + {accountsFiatValue.formatAsFiat(defaultFiatCurrency)} + + + )} + + )} + - {accountsFiatValue.isUndefined() ? ( - <> - - - - ) : ( + {!isDisconnectedRewardsAccount && ( + + setShowAccountMenu((prev) => !prev)} + > + + + {showAccountMenu && ( <> - - {accountsFiatValue.formatAsFiat(defaultFiatCurrency)} - + {isRewardsAccount ? ( + + ) : ( + + )} )} - + )} - - - {!isDisconnectedRewardsAccount && ( - - setShowAccountMenu((prev) => !prev)} - > - - - {showAccountMenu && ( - <> - {isRewardsAccount ? ( - - ) : ( - - )} - - )} - - )} - - {isDisconnectedRewardsAccount && ( - - + {isDisconnectedRewardsAccount && ( + + + + )} + + {showShieldAccountModal && ( + { + setShowShieldAccountModal(false) + }} + /> )} - + ) } diff --git a/components/brave_wallet_ui/components/desktop/popup-modals/shield_zcash_account/shield_zcash_account.stories.tsx b/components/brave_wallet_ui/components/desktop/popup-modals/shield_zcash_account/shield_zcash_account.stories.tsx new file mode 100644 index 000000000000..cdb418d2991e --- /dev/null +++ b/components/brave_wallet_ui/components/desktop/popup-modals/shield_zcash_account/shield_zcash_account.stories.tsx @@ -0,0 +1,29 @@ +// Copyright (c) 2024 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +import * as React from 'react' + +import { + WalletPageStory // +} from '../../../../stories/wrappers/wallet-page-story-wrapper' +import { ShieldZCashAccountModal } from './shield_zcash_account' +import { mockAccount } from '../../../../common/constants/mocks' + +export const _ShieldZCashAccountModal = { + render: () => { + return ( + + alert('close')} + /> + + ) + } +} + +export default { + component: ShieldZCashAccountModal +} diff --git a/components/brave_wallet_ui/components/desktop/popup-modals/shield_zcash_account/shield_zcash_account.style.ts b/components/brave_wallet_ui/components/desktop/popup-modals/shield_zcash_account/shield_zcash_account.style.ts new file mode 100644 index 000000000000..53c53623ad29 --- /dev/null +++ b/components/brave_wallet_ui/components/desktop/popup-modals/shield_zcash_account/shield_zcash_account.style.ts @@ -0,0 +1,38 @@ +// Copyright (c) 2024 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. +import styled from 'styled-components' +import * as leo from '@brave/leo/tokens/css/variables' +import Icon from '@brave/leo/react/icon' + +// Shared Styled +import { Column, Row } from '../../../shared/style' + +export const StyledWrapper = styled(Column)` + overflow: hidden; +` + +export const AccountRow = styled(Row)` + border-radius: ${leo.radius.xl}; + background-color: ${leo.color.container.highlight}; +` + +export const ShieldIconWrapper = styled.div` + display: flex; + align-items: center; + justify-content: center; + width: 40px; + height: 40px; + border-radius: 100%; + background-color: ${leo.color.systemfeedback.successBackground}; + position: absolute; + left: -20px; +` + +export const ShieldIcon = styled(Icon).attrs({ + name: 'shield-done-filled' +})` + --leo-icon-size: 24px; + color: ${leo.color.systemfeedback.successIcon}; +` diff --git a/components/brave_wallet_ui/components/desktop/popup-modals/shield_zcash_account/shield_zcash_account.tsx b/components/brave_wallet_ui/components/desktop/popup-modals/shield_zcash_account/shield_zcash_account.tsx new file mode 100644 index 000000000000..2d8152aabee6 --- /dev/null +++ b/components/brave_wallet_ui/components/desktop/popup-modals/shield_zcash_account/shield_zcash_account.tsx @@ -0,0 +1,133 @@ +// Copyright (c) 2024 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. +import * as React from 'react' + +// Slices +import { useMakeAccountShieldedMutation } from '../../../../common/slices/api.slice' + +// Types +import { BraveWallet } from '../../../../constants/types' + +// Utils +import { getLocale } from '../../../../../common/locale' + +// Components +import { PopupModal } from '../../popup-modals/index' +import { + CreateAccountIcon // +} from '../../../shared/create-account-icon/create-account-icon' + +// Styles +import { + AccountRow, + ShieldIconWrapper, + ShieldIcon +} from './shield_zcash_account.style' +import { Column, Text, Row, LeoSquaredButton } from '../../../shared/style' + +interface Props { + account: BraveWallet.AccountInfo + onClose: () => void +} + +export const ShieldZCashAccountModal = (props: Props) => { + const { account, onClose } = props + + // State + const [isShielding, setIsShielding] = React.useState(false) + + // mutations + const [shieldAccount] = useMakeAccountShieldedMutation() + + const onShieldAccount = React.useCallback(async () => { + if (!account.accountId) { + return + } + setIsShielding(true) + await shieldAccount(account.accountId) + setIsShielding(false) + onClose() + }, [shieldAccount, account, onClose]) + + return ( + + + + + + + + + + {account.name} + + + ZCash + + + + + {getLocale('braveWalletAccountNotShieldedDescription')} + + + {getLocale('braveWalletAccountShieldedDescription')} + + + + + {getLocale('braveWalletButtonCancel')} + + + {getLocale('braveWalletShieldAccount')} + + + + ) +} diff --git a/components/brave_wallet_ui/components/desktop/wallet-menus/account-actions-menu.tsx b/components/brave_wallet_ui/components/desktop/wallet-menus/account-actions-menu.tsx index f900e3e7bbc4..078124c61174 100644 --- a/components/brave_wallet_ui/components/desktop/wallet-menus/account-actions-menu.tsx +++ b/components/brave_wallet_ui/components/desktop/wallet-menus/account-actions-menu.tsx @@ -37,8 +37,12 @@ export const AccountActionsMenu = (props: Props) => { onClick(option.id)} + minWidth={250} > - + {getLocale(option.name)} ))} @@ -48,8 +52,12 @@ export const AccountActionsMenu = (props: Props) => { onClick(option.id)} + minWidth={250} > - + {getLocale(option.name)} ))} diff --git a/components/brave_wallet_ui/components/desktop/wallet-menus/wellet-menus.style.ts b/components/brave_wallet_ui/components/desktop/wallet-menus/wellet-menus.style.ts index deba9157ba5d..1a2876225e83 100644 --- a/components/brave_wallet_ui/components/desktop/wallet-menus/wellet-menus.style.ts +++ b/components/brave_wallet_ui/components/desktop/wallet-menus/wellet-menus.style.ts @@ -6,6 +6,11 @@ import styled from 'styled-components' import * as leo from '@brave/leo/tokens/css/variables' import Icon from '@brave/leo/react/icon' + +// Types +import { AccountModalTypes } from '../../../constants/types' + +// Shared Styles import { WalletButton, Row } from '../../shared/style' import { layoutPanelWidth, @@ -64,9 +69,12 @@ export const PopupButtonText = styled.span` color: ${leo.color.text.primary}; ` -export const ButtonIcon = styled(Icon)` +export const ButtonIcon = styled(Icon)<{ id?: AccountModalTypes }>` --leo-icon-size: 18px; - color: ${leo.color.icon.default}; + color: ${(p) => + p.id === 'shield' + ? leo.color.systemfeedback.successIcon + : leo.color.icon.default}; margin-right: 16px; ` diff --git a/components/brave_wallet_ui/constants/types.ts b/components/brave_wallet_ui/constants/types.ts index 53bff8dcae92..6fdb9a6564c9 100644 --- a/components/brave_wallet_ui/constants/types.ts +++ b/components/brave_wallet_ui/constants/types.ts @@ -201,6 +201,7 @@ export interface WalletState { assetAutoDiscoveryCompleted: boolean isAnkrBalancesFeatureEnabled: boolean isRefreshingNetworksAndTokens: boolean + isZCashShieldedTransactionsEnabled: boolean } export interface PanelState { @@ -845,6 +846,7 @@ export type AccountModalTypes = | 'remove' | 'buy' | 'explorer' + | 'shield' export interface AccountButtonOptionsObjectType { name: string diff --git a/components/brave_wallet_ui/options/account-list-button-options.ts b/components/brave_wallet_ui/options/account-list-button-options.ts index f0d63f6f1cf5..c3b4f15f4637 100644 --- a/components/brave_wallet_ui/options/account-list-button-options.ts +++ b/components/brave_wallet_ui/options/account-list-button-options.ts @@ -39,5 +39,10 @@ export const AccountButtonOptions: AccountButtonOptionsObjectType[] = [ id: 'remove', name: 'braveWalletAccountsRemove', icon: 'trash' + }, + { + id: 'shield', + name: 'braveWalletSwitchToShieldedAccount', + icon: 'shield-done' } ] diff --git a/components/brave_wallet_ui/stories/locale.ts b/components/brave_wallet_ui/stories/locale.ts index 7fbc559faed1..31eb01b0b469 100644 --- a/components/brave_wallet_ui/stories/locale.ts +++ b/components/brave_wallet_ui/stories/locale.ts @@ -1489,5 +1489,14 @@ provideStrings({ braveWalletFilters: 'Filters', braveWalletClearFilters: 'Clear filters', braveWalletShowMore: 'Show more', - braveWalletDetails: 'Details' + braveWalletDetails: 'Details', + + // ZCash + braveWalletSwitchToShieldedAccount: 'Switch to shielded account', + braveWalletShieldAccount: 'Shield account', + braveWalletAccountNotShieldedDescription: + 'Currently this account supports transparent transactions which means they are visible to everyone on the blockchain.', + braveWalletAccountShieldedDescription: + 'Upgrading to shielded account means that these transactions hide the sender, receiver and amount details.', + braveWalletShielded: 'Shielded' }) diff --git a/components/brave_wallet_ui/stories/mock-data/mock-wallet-state.ts b/components/brave_wallet_ui/stories/mock-data/mock-wallet-state.ts index a67c2f363d36..4da4f297d238 100644 --- a/components/brave_wallet_ui/stories/mock-data/mock-wallet-state.ts +++ b/components/brave_wallet_ui/stories/mock-data/mock-wallet-state.ts @@ -55,5 +55,6 @@ export const mockWalletState: WalletState = { isWalletLocked: false, passwordAttempts: 0, assetAutoDiscoveryCompleted: false, - isRefreshingNetworksAndTokens: false + isRefreshingNetworksAndTokens: false, + isZCashShieldedTransactionsEnabled: false } diff --git a/components/resources/wallet_strings.grdp b/components/resources/wallet_strings.grdp index 1e5d66c8ae39..70f70db170b0 100644 --- a/components/resources/wallet_strings.grdp +++ b/components/resources/wallet_strings.grdp @@ -1128,6 +1128,11 @@ Clear filters Show more Details + Switch to shielded account + Shield account + Currently this account supports transparent transactions which means they are visible to everyone on the blockchain. + Upgrading to shielded account means that these transactions hide the sender, receiver and amount details. + Shielded Retry Transaction preview failed. Estimated balance change