From 2c7b4964dc46cb4642a993fee275c57752f1ec41 Mon Sep 17 00:00:00 2001 From: thomas-portkey Date: Thu, 6 Feb 2025 00:44:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20update=20eoa=20change=20?= =?UTF-8?q?pin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hooks/hooks-eoa/wallet/index.ts | 43 +++++++++--- .../js/hooks/securityLock/index.ts | 3 +- .../js/pages/Home/HomeTab/index.tsx | 4 ++ .../My/AccountSettings/Biometric/index.tsx | 70 +++++++------------ .../js/pages/My/Security/index.tsx | 34 ++++++--- .../js/pages/Pin/CheckPin/index.tsx | 69 ------------------ .../js/pages/Pin/ConfirmPin/index.tsx | 45 ++++++------ .../js/pages/Pin/SetBiometrics/index.tsx | 61 ++++++++++++---- .../mobile-aelf/js/pages/Pin/SetPin/index.tsx | 9 ++- packages/mobile-aelf/js/pages/Pin/index.ts | 2 - .../js/pages/SecurityLock/index.tsx | 11 ++- packages/mobile-aelf/js/store/user/actions.ts | 2 +- packages/store/store-eoa/wallet/actions.ts | 4 ++ packages/store/store-eoa/wallet/slice.ts | 34 ++++----- packages/store/store-eoa/wallet/type.ts | 2 - 15 files changed, 198 insertions(+), 195 deletions(-) delete mode 100644 packages/mobile-aelf/js/pages/Pin/CheckPin/index.tsx diff --git a/packages/hooks/hooks-eoa/wallet/index.ts b/packages/hooks/hooks-eoa/wallet/index.ts index f6a62676b2..af9d53f7e8 100644 --- a/packages/hooks/hooks-eoa/wallet/index.ts +++ b/packages/hooks/hooks-eoa/wallet/index.ts @@ -8,12 +8,12 @@ import { addWallet, resetWallet, setHideAssetsAction, + updateWalletList, } from '@portkey-wallet/store/store-eoa/wallet/actions'; import { TAccountInfo, TWalletInfo } from '@portkey-wallet/types/types-eoa/wallet'; import aes from '@portkey-wallet/utils/aes'; import { useCurrentNetwork, useIsMainnet } from '../network'; import { ChainId } from '@portkey-wallet/types'; -import { changeNetworkType } from '@portkey-wallet/store/store-eoa/wallet/slice'; import { useChainList } from '../network/chain'; export const useWalletState = () => useAppEOASelector(state => state.wallet); @@ -53,7 +53,7 @@ export const useAddWallet = () => { } const wallet = formatWalletInfoV2(walletInfo, pin, `Wallet ${walletListLength + 1}`); - console.log('after: formatWalletInfoV2: ', wallet, walletList); + if (!wallet) { return { success: false, @@ -67,7 +67,7 @@ export const useAddWallet = () => { message: 'Wallet already exists', }; } - console.log('wallet======', JSON.stringify(wallet)); + dispatch( addWallet({ wallet, @@ -252,12 +252,35 @@ export const useChainIdList = () => { }, [chainList, isMainnet]); }; -export const useSwitchNetworkType = () => { +export const useUpdateWalletAES = () => { + const walletList = useWalletListState(); const dispatch = useAppCommonDispatch(); - const networkType = useCurrentNetwork(); - const switchNetwork = useCallback(() => { - const switchedNetwork = networkType === 'MAINNET' ? 'TESTNET' : 'MAINNET'; - dispatch(changeNetworkType(switchedNetwork)); - }, [dispatch, networkType]); - return switchNetwork; + + return useCallback( + (oldPin: string, newPin: string) => { + const newWalletList = walletList.map(wallet => { + const newWallet: TWalletInfo = { ...wallet }; + const isPrivate = newWallet.AESEncryptMnemonic === ''; + if (!isPrivate) { + const mnemonic = aes.decrypt(newWallet.AESEncryptMnemonic, oldPin); + if (!mnemonic) throw 'Error Pin mnemonic'; + newWallet.AESEncryptMnemonic = aes.encrypt(mnemonic, newPin); + } + newWallet.accountList = newWallet.accountList.map(account => { + const newAccount: TAccountInfo = { ...account }; + const privateKey = aes.decrypt(newAccount.AESEncryptPrivateKey, oldPin); + if (!privateKey) throw 'Error Pin privateKey'; + newAccount.AESEncryptPrivateKey = aes.encrypt(privateKey, newPin); + return newAccount; + }); + return newWallet; + }); + dispatch( + updateWalletList({ + walletList: newWalletList, + }), + ); + }, + [dispatch, walletList], + ); }; diff --git a/packages/mobile-aelf/js/hooks/securityLock/index.ts b/packages/mobile-aelf/js/hooks/securityLock/index.ts index def7204d7c..108b165d88 100644 --- a/packages/mobile-aelf/js/hooks/securityLock/index.ts +++ b/packages/mobile-aelf/js/hooks/securityLock/index.ts @@ -10,11 +10,12 @@ export const useCheckSecurityLock = () => { const dispatch = useAppDispatch(); return useCallback( - async (callback?: () => void) => { + async (callback?: () => void, isBackAllow = false) => { if (!biometrics) { navigationService.push('SecurityLock', { isCheck: true, checkCallback: callback, + isBackAllow, }); return; } diff --git a/packages/mobile-aelf/js/pages/Home/HomeTab/index.tsx b/packages/mobile-aelf/js/pages/Home/HomeTab/index.tsx index 8292c53f3e..da131720ab 100644 --- a/packages/mobile-aelf/js/pages/Home/HomeTab/index.tsx +++ b/packages/mobile-aelf/js/pages/Home/HomeTab/index.tsx @@ -135,6 +135,10 @@ const HomeTab: React.FC = ({ _ }) => { Switch Network + navigationService.push('Security')} style={{ marginTop: 20 }}> + Security + + navigationService.push('Home')} style={{ marginTop: 20 }}> Home diff --git a/packages/mobile-aelf/js/pages/My/AccountSettings/Biometric/index.tsx b/packages/mobile-aelf/js/pages/My/AccountSettings/Biometric/index.tsx index d1aba20085..7f0cce4ec3 100644 --- a/packages/mobile-aelf/js/pages/My/AccountSettings/Biometric/index.tsx +++ b/packages/mobile-aelf/js/pages/My/AccountSettings/Biometric/index.tsx @@ -1,8 +1,7 @@ import React, { useCallback } from 'react'; import PageContainer from 'components/PageContainer'; -import { touchAuth } from '@portkey-wallet/utils/mobile/authentication'; import CommonToast from 'components/CommonToast'; -import useBiometricsReady, { useSetBiometrics } from 'hooks/useBiometrics'; +import { useSetBiometrics } from 'hooks/useBiometrics'; import navigationService from 'utils/navigationService'; import { View } from 'react-native'; import { checkPin } from 'utils/redux'; @@ -10,21 +9,21 @@ import fonts from 'assets/theme/fonts'; import useEffectOnce from 'hooks/useEffectOnce'; import { useLanguage } from 'i18n/hooks'; import i18n from 'i18n'; -import { useUser } from 'hooks/store'; +import { usePin, useUser } from 'hooks/store'; import { TextL, TextM } from 'components/CommonText'; import CommonSwitch from 'components/CommonSwitch'; -import ActionSheet from 'components/ActionSheet'; import { setSecureStoreItem } from '@portkey-wallet/utils/mobile/biometric'; import myEvents from 'utils/deviceEvent'; import { changeCanLock } from 'utils/LockManager'; import { makeStyles } from '@rneui/themed'; import { pTd } from 'utils/unit'; +import { useCheckSecurityLock } from 'hooks/securityLock'; +import { SetBiometricsTypeEnum } from 'pages/Pin/SetBiometrics'; export default function Biometric() { const styles = getStyles(); const { biometrics } = useUser(); const setBiometrics = useSetBiometrics(); - const biometricsReady = useBiometricsReady(); const { t } = useLanguage(); const openBiometrics = useCallback( async (pin: string) => { @@ -46,55 +45,38 @@ export default function Biometric() { const listener = myEvents.openBiometrics.addListener(openBiometrics); return () => listener.remove(); }); + + const checkSecurityLock = useCheckSecurityLock(); + const pin = usePin(); const onValueChange = useCallback( async (value: boolean) => { - if (value) { - // const result = await authenticationReady(); - // if (!result) return CommonToast.fail('This device does not currently support biometrics'); - navigationService.navigate('CheckPin', { openBiometrics: true }); - } else { - ActionSheet.alert({ - title2: 'Disable fingerprint login?', - buttons: [ - { type: 'outline', title: 'Cancel' }, - { - type: 'primary', - title: 'Confirm', - onPress: async () => { - changeCanLock(false); - try { - const enrolled = await touchAuth(); - if (enrolled.success) { - await setBiometrics(value); - } else { - CommonToast.fail(enrolled.warning || enrolled.error); - } - } catch (error) { - CommonToast.failError(error, i18n.t('Failed to enable biometrics')); - } - changeCanLock(true); - }, - }, - ], - }); - } + checkSecurityLock(() => { + if (value) { + navigationService.pop(1); + navigationService.push('SetBiometrics', { + type: SetBiometricsTypeEnum.update, + }); + } else { + navigationService.push('SetPin', { + oldPin: pin, + }); + } + }, true); }, - [setBiometrics], + [checkSecurityLock, pin], ); return ( - {biometricsReady && ( - - - Biometric authentication - - - Enable biometric authentication to quickly unlock the device. + + + Biometric authentication + - )} + Enable biometric authentication to quickly unlock the device. + ); } diff --git a/packages/mobile-aelf/js/pages/My/Security/index.tsx b/packages/mobile-aelf/js/pages/My/Security/index.tsx index 2067a2acab..71925e02d1 100644 --- a/packages/mobile-aelf/js/pages/My/Security/index.tsx +++ b/packages/mobile-aelf/js/pages/My/Security/index.tsx @@ -1,6 +1,6 @@ import PageContainer from 'components/PageContainer'; import { useLanguage } from 'i18n/hooks'; -import React, { useEffect } from 'react'; +import React, { useCallback, useEffect } from 'react'; import { pTd } from 'utils/unit'; import { ScrollView, View } from 'react-native'; import GStyles from 'assets/theme/GStyles'; @@ -10,6 +10,8 @@ import { useAppDispatch } from 'store/hooks'; import { getCaHolderInfoAsync } from '@portkey-wallet/store/store-ca/wallet/actions'; import { StyleSheet } from 'react-native'; import useBiometricsReady from 'hooks/useBiometrics'; +import { usePin, useUser } from 'hooks/store'; +import { useCheckSecurityLock } from 'hooks/securityLock'; interface SecurityProps { name?: string; @@ -24,6 +26,20 @@ const Security: React.FC = () => { appDispatch(getCaHolderInfoAsync()); }, [appDispatch]); + const pin = usePin(); + const checkSecurityLock = useCheckSecurityLock(); + + const changePin = useCallback(() => { + checkSecurityLock(() => { + navigationService.pop(1); + navigationService.push('SetPin', { + oldPin: pin, + }); + }, true); + }, [checkSecurityLock, pin]); + + const { biometrics } = useUser(); + return ( = () => { size={pTd(24)} /> )} - navigationService.navigate('CheckPin')} - title={t('Change PIN')} - icon="my-pin" - size={pTd(24)} - /> + {!biometrics && ( + + )} diff --git a/packages/mobile-aelf/js/pages/Pin/CheckPin/index.tsx b/packages/mobile-aelf/js/pages/Pin/CheckPin/index.tsx deleted file mode 100644 index 05795f679c..0000000000 --- a/packages/mobile-aelf/js/pages/Pin/CheckPin/index.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import React, { useCallback, useRef } from 'react'; -import PageContainer from 'components/PageContainer'; -import { DigitInputInterface } from 'components/DigitInput'; -import navigationService from 'utils/navigationService'; -import { PIN_SIZE } from '@portkey-wallet/constants/misc'; -import useRouterParams from '@portkey-wallet/hooks/useRouterParams'; -import { checkPin } from 'utils/redux'; -import { PinErrorMessage } from '@portkey-wallet/utils/wallet/types'; -import myEvents from 'utils/deviceEvent'; -import { useFocusEffect } from '@react-navigation/native'; -import PinContainer from 'components/PinContainer'; -import { makeStyles } from '@rneui/themed'; -import { VERIFY_INVALID_TIME } from '@portkey-wallet/constants/constants-ca/wallet'; -import { useErrorMessage } from '@portkey-wallet/hooks/hooks-ca/misc'; - -export default function CheckPin() { - const styles = getStyles(); - const { openBiometrics } = useRouterParams<{ openBiometrics?: boolean }>(); - const pinRef = useRef(); - useFocusEffect( - useCallback(() => { - pinRef.current?.reset(); - }, []), - ); - - const { error: textError, setError: setTextError } = useErrorMessage(); - const onChangeText = useCallback( - (pin: string) => { - if (pin.length === PIN_SIZE) { - if (!checkPin(pin)) { - pinRef.current?.reset(); - setTextError(PinErrorMessage.invalidPin, VERIFY_INVALID_TIME); - return; - } - if (openBiometrics) { - myEvents.openBiometrics.emit(pin); - navigationService.goBack(); - } else { - navigationService.navigate('SetPin', { oldPin: pin }); - } - } else if (textError.isError) { - setTextError(); - } - }, - [openBiometrics, setTextError, textError.isError], - ); - return ( - - - - ); -} - -const getStyles = makeStyles(_theme => ({ - container: { - flex: 1, - }, -})); diff --git a/packages/mobile-aelf/js/pages/Pin/ConfirmPin/index.tsx b/packages/mobile-aelf/js/pages/Pin/ConfirmPin/index.tsx index 27f7c5ffbb..31cd629133 100644 --- a/packages/mobile-aelf/js/pages/Pin/ConfirmPin/index.tsx +++ b/packages/mobile-aelf/js/pages/Pin/ConfirmPin/index.tsx @@ -16,6 +16,7 @@ import { useErrorMessage } from '@portkey-wallet/hooks/hooks-ca/misc'; import { usePreventHardwareBack } from '@portkey-wallet/hooks/mobile'; import CommonToast from 'components/CommonToast'; import { useSetBiometrics } from 'hooks/useBiometrics'; +import { useUpdateWalletAES } from '@portkey-wallet/hooks/hooks-eoa/wallet'; type RouterParams = { pin?: string; @@ -34,6 +35,7 @@ export default function ConfirmPin() { const dispatch = useAppDispatch(); const setBiometrics = useSetBiometrics(); + const updateWalletAES = useUpdateWalletAES(); const onChangePin = useCallback( async (newPin: string) => { if (!oldPin) { @@ -41,42 +43,43 @@ export default function ConfirmPin() { } changeCanLock(false); try { - // TODO: eoa update Pin need reEncrypt - // dispatch(changePin({ pin: oldPin, newPin })); + updateWalletAES(oldPin, newPin); dispatch(setCredentials({ pin: newPin })); + await setBiometrics(false); CommonToast.success('PIN updated'); + navigationService.pop(1); + navigationService.goBack(); } catch (error) { CommonPrompt.failError(error); } changeCanLock(true); - // navigationService.reset('PrepareWallet', { pin, _inner_mnemonics, _inner_privateKey }); - navigationService.reset('PrepareWallet', { pin }); }, - [dispatch, oldPin, pin], + [dispatch, oldPin, setBiometrics, updateWalletAES], ); const { error: textError, setError: setTextError } = useErrorMessage(); const onChangeText = useCallback( async (confirmPin: string) => { - if (confirmPin.length !== PIN_SIZE) { - if (textError.isError) { - setTextError(); + try { + if (confirmPin.length !== PIN_SIZE) { + if (textError.isError) { + setTextError(); + } + return; } - return; - } - - if (confirmPin !== pin) { - pinRef.current?.reset(); - setTextError('Incorrect PIN, please try again.', VERIFY_INVALID_TIME); - return; - } - if (oldPin) { - return onChangePin(confirmPin); - } + if (confirmPin !== pin) { + pinRef.current?.reset(); + setTextError('Incorrect PIN, please try again.', VERIFY_INVALID_TIME); + return; + } - await setBiometrics(false); - navigationService.reset('PrepareWallet', { pin: confirmPin, mnemonics, privateKey }); + if (oldPin) { + return onChangePin(confirmPin); + } + await setBiometrics(false); + navigationService.reset('PrepareWallet', { pin: confirmPin, mnemonics, privateKey }); + } catch (error) {} }, [pin, oldPin, setBiometrics, textError.isError, setTextError, onChangePin, mnemonics, privateKey], ); diff --git a/packages/mobile-aelf/js/pages/Pin/SetBiometrics/index.tsx b/packages/mobile-aelf/js/pages/Pin/SetBiometrics/index.tsx index e491142eb1..33a8d9c0f8 100644 --- a/packages/mobile-aelf/js/pages/Pin/SetBiometrics/index.tsx +++ b/packages/mobile-aelf/js/pages/Pin/SetBiometrics/index.tsx @@ -1,4 +1,4 @@ -import React, { useCallback } from 'react'; +import React, { useCallback, useMemo } from 'react'; import { TextH1 } from 'components/CommonText'; import PageContainer from 'components/PageContainer'; import CommonButton from 'components/CommonButton'; @@ -17,6 +17,8 @@ import { useAppDispatch } from 'store/hooks'; import { setCredentials } from 'store/user/actions'; import useRouterParams from '@portkey-wallet/hooks/useRouterParams'; import navigationService from 'utils/navigationService'; +import { usePin } from 'hooks/store'; +import { useUpdateWalletAES } from '@portkey-wallet/hooks/hooks-eoa/wallet'; export enum SetBiometricsTypeEnum { 'create' = 'CREATE', @@ -30,30 +32,57 @@ type TRouterParams = { }; const ScrollViewProps = { disabled: true }; + export default function SetBiometrics() { const styles = getStyles(); const { theme } = useTheme(); usePreventHardwareBack(); - // const { type = SetBiometricsTypeEnum.create, mnemonics, privateKey } = useRouterParams(); - const { mnemonics, privateKey } = useRouterParams(); + const { type = SetBiometricsTypeEnum.create, mnemonics, privateKey } = useRouterParams(); + + const isCreate = useMemo(() => type === SetBiometricsTypeEnum.create, [type]); const setBiometrics = useSetBiometrics(); const dispatch = useAppDispatch(); + + const createBiometrics = useCallback(async () => { + const newPin = randomId(); + await setSecureStoreItem('Pin', newPin); + dispatch(setCredentials({ pin: newPin })); + await setBiometrics(true); + navigationService.reset('PrepareWallet', { pin: newPin, mnemonics, privateKey }); + }, [dispatch, setBiometrics, mnemonics, privateKey]); + + const pin = usePin(); + const updateWalletAES = useUpdateWalletAES(); + + const updateBiometrics = useCallback(async () => { + if (!pin) { + return; + } + const newPin = randomId(); + updateWalletAES(pin, newPin); + await setSecureStoreItem('Pin', newPin); + dispatch(setCredentials({ pin: newPin })); + await setBiometrics(true); + navigationService.goBack(); + }, [dispatch, pin, setBiometrics, updateWalletAES]); + const openBiometrics = useCallback(async () => { changeCanLock(false); try { - const pin = randomId(); - await setSecureStoreItem('Pin', pin); - dispatch(setCredentials({ pin })); - await setBiometrics(true); - navigationService.reset('PrepareWallet', { pin, mnemonics, privateKey }); + if (isCreate) { + await createBiometrics(); + } else { + await updateBiometrics(); + } } catch (error) { CommonPrompt.failError(error, 'Failed To Verify'); } changeCanLock(true); - }, [dispatch, setBiometrics, mnemonics, privateKey]); + }, [isCreate, createBiometrics, updateBiometrics]); + const onSkip = useCallback(async () => { try { await setBiometrics(false); @@ -68,21 +97,23 @@ export default function SetBiometrics() { return ( {'Enable biometrics authentication'} - + {'Set up now'} - + {isCreate && ( + + )} ); @@ -101,6 +132,6 @@ const getStyles = makeStyles(_theme => ({ marginBottom: pTd(120), }, buttonWrap: { - marginBottom: pTd(24), + marginTop: pTd(24), }, })); diff --git a/packages/mobile-aelf/js/pages/Pin/SetPin/index.tsx b/packages/mobile-aelf/js/pages/Pin/SetPin/index.tsx index f5fe415886..df8ebbe709 100644 --- a/packages/mobile-aelf/js/pages/Pin/SetPin/index.tsx +++ b/packages/mobile-aelf/js/pages/Pin/SetPin/index.tsx @@ -1,4 +1,4 @@ -import React, { useRef } from 'react'; +import React, { useCallback, useRef } from 'react'; import PageContainer from 'components/PageContainer'; import { DigitInputInterface } from 'components/DigitInput'; import navigationService from 'utils/navigationService'; @@ -6,6 +6,7 @@ import useRouterParams from '@portkey-wallet/hooks/useRouterParams'; import PinContainer from 'components/PinContainer'; import { makeStyles } from '@rneui/themed'; import { usePreventHardwareBack } from '@portkey-wallet/hooks/mobile'; +import { useFocusEffect } from '@react-navigation/native'; type TRouterParams = { oldPin?: string; @@ -24,6 +25,12 @@ export default function SetPin() { const digitInput = useRef(); usePreventHardwareBack(); + useFocusEffect( + useCallback(() => { + digitInput?.current?.reset(); + }, []), + ); + return ( void; + isBackAllow?: boolean; }; export default function SecurityLock() { @@ -33,7 +34,7 @@ export default function SecurityLock() { const navigation = useNavigation(); const locked = useRef(false); - const { isCheck, checkCallback } = useRouterParams(); + const { isCheck, checkCallback, isBackAllow = false } = useRouterParams(); const handleRouter = useThrottleCallback( () => { @@ -84,8 +85,14 @@ export default function SecurityLock() { }, [textError.isError, handlePassword, setTextError], ); + return ( - + ('wallet/removeAccount'); +export const updateWalletList = createAction<{ + walletList: TWalletInfo[]; +}>('wallet/updateWalletList'); + export const setHideAssetsAction = createAction>('wallet/setHideAssetsAction'); diff --git a/packages/store/store-eoa/wallet/slice.ts b/packages/store/store-eoa/wallet/slice.ts index 7ca828aba5..54e409cc2b 100644 --- a/packages/store/store-eoa/wallet/slice.ts +++ b/packages/store/store-eoa/wallet/slice.ts @@ -1,37 +1,30 @@ -import { createSlice, PayloadAction } from '@reduxjs/toolkit'; +import { createSlice } from '@reduxjs/toolkit'; import { TWalletState } from './type'; -import { addAccount, addWallet, removeAccount, removeWallet, resetWallet, setHideAssetsAction } from './actions'; +import { + addAccount, + addWallet, + removeAccount, + removeWallet, + resetWallet, + setHideAssetsAction, + updateWalletList, +} from './actions'; import { getNextBIP44Path } from '@portkey-wallet/utils/wallet'; -import { NetworkType } from '@portkey-wallet/types'; const initialState: TWalletState = { walletList: [], privateKeyAccountList: [], currentAccountAddress: undefined, - networkType: 'MAINNET', hideAssets: false, }; export const walletSlice = createSlice({ name: 'wallet', initialState, - reducers: { - changeNetworkType: (state, action: PayloadAction) => { - state.networkType = action.payload; - }, - }, + reducers: {}, extraReducers: builder => { builder .addCase(addWallet, (state, action) => { const { wallet } = action.payload; - console.log('wallet======2', JSON.stringify(wallet)); - console.log( - 'wallet======3', - JSON.stringify({ - ...state, - walletList: [...state.walletList, wallet], - currentAccountAddress: wallet.accountList[0]?.address, - }), - ); return { ...state, walletList: [...state.walletList, wallet], @@ -79,6 +72,10 @@ export const walletSlice = createSlice({ walletList, }; }) + .addCase(updateWalletList, (state, action) => { + const { walletList } = action.payload; + state.walletList = walletList; + }) .addCase(setHideAssetsAction, (state, action) => { const { hideAssets } = action.payload; state.hideAssets = hideAssets; @@ -86,4 +83,3 @@ export const walletSlice = createSlice({ .addCase(resetWallet, () => ({ ...initialState })); }, }); -export const { changeNetworkType } = walletSlice.actions; diff --git a/packages/store/store-eoa/wallet/type.ts b/packages/store/store-eoa/wallet/type.ts index 750b79d347..fe095a0d54 100644 --- a/packages/store/store-eoa/wallet/type.ts +++ b/packages/store/store-eoa/wallet/type.ts @@ -1,11 +1,9 @@ -import { NetworkType } from '@portkey-wallet/types'; import { TAccountInfo, TWalletInfo } from '@portkey-wallet/types/types-eoa/wallet'; export type TWalletState = { walletList: TWalletInfo[]; privateKeyAccountList: TAccountInfo[]; currentAccountAddress?: TAccountInfo['address']; - networkType: NetworkType; hideAssets: boolean; };