2024-05-18 00:34:39 +02:00
|
|
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
2019-09-27 16:49:56 +02:00
|
|
|
import {
|
2024-03-31 21:59:14 +02:00
|
|
|
ActivityIndicator,
|
2019-09-27 16:49:56 +02:00
|
|
|
Alert,
|
2024-03-31 21:59:14 +02:00
|
|
|
I18nManager,
|
|
|
|
InteractionManager,
|
2024-10-12 23:59:26 +02:00
|
|
|
LayoutAnimation,
|
2021-08-03 03:27:54 +02:00
|
|
|
ScrollView,
|
2024-03-31 21:59:14 +02:00
|
|
|
StyleSheet,
|
|
|
|
Switch,
|
|
|
|
Text,
|
|
|
|
TextInput,
|
|
|
|
TouchableOpacity,
|
|
|
|
View,
|
2019-09-27 16:49:56 +02:00
|
|
|
} from 'react-native';
|
2024-05-20 11:54:13 +02:00
|
|
|
import { writeFileAndExport } from '../../blue_modules/fs';
|
2024-03-31 21:59:14 +02:00
|
|
|
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
|
2024-03-16 17:26:52 +01:00
|
|
|
import { BlueCard, BlueLoading, BlueSpacing10, BlueSpacing20, BlueText } from '../../BlueComponents';
|
2021-01-28 13:54:23 +01:00
|
|
|
import {
|
2024-03-31 21:59:14 +02:00
|
|
|
HDAezeedWallet,
|
2021-01-28 13:54:23 +01:00
|
|
|
HDSegwitBech32Wallet,
|
|
|
|
LegacyWallet,
|
2024-03-31 21:59:14 +02:00
|
|
|
MultisigHDWallet,
|
2021-01-28 13:54:23 +01:00
|
|
|
SegwitBech32Wallet,
|
2024-03-31 21:59:14 +02:00
|
|
|
SegwitP2SHWallet,
|
2021-01-28 13:54:23 +01:00
|
|
|
WatchOnlyWallet,
|
|
|
|
} from '../../class';
|
2021-02-04 08:05:37 +01:00
|
|
|
import { AbstractHDElectrumWallet } from '../../class/wallets/abstract-hd-electrum-wallet';
|
2024-03-31 21:59:14 +02:00
|
|
|
import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
|
2024-02-07 20:24:24 +01:00
|
|
|
import presentAlert from '../../components/Alert';
|
2024-03-16 17:26:52 +01:00
|
|
|
import Button from '../../components/Button';
|
2024-03-31 21:59:14 +02:00
|
|
|
import ListItem from '../../components/ListItem';
|
2024-05-20 11:54:13 +02:00
|
|
|
import SaveFileButton from '../../components/SaveFileButton';
|
2024-03-16 17:26:52 +01:00
|
|
|
import { SecondButton } from '../../components/SecondButton';
|
2024-03-31 21:59:14 +02:00
|
|
|
import { useTheme } from '../../components/themes';
|
|
|
|
import prompt from '../../helpers/prompt';
|
2024-06-04 03:54:32 +02:00
|
|
|
import { unlockWithBiometrics, useBiometrics } from '../../hooks/useBiometrics';
|
2024-03-24 15:52:10 +01:00
|
|
|
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
|
2024-03-31 21:59:14 +02:00
|
|
|
import loc, { formatBalanceWithoutSuffix } from '../../loc';
|
|
|
|
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
|
2024-05-31 19:22:22 +02:00
|
|
|
import { useStorage } from '../../hooks/context/useStorage';
|
2024-06-06 19:11:08 +02:00
|
|
|
import { popToTop } from '../../NavigationService';
|
2024-09-14 00:30:01 +02:00
|
|
|
import { useFocusEffect, useRoute, RouteProp } from '@react-navigation/native';
|
|
|
|
import { LightningTransaction, Transaction, TWallet } from '../../class/wallets/types';
|
|
|
|
import { DetailViewStackParamList } from '../../navigation/DetailViewStackParamList';
|
2024-11-11 19:11:59 +01:00
|
|
|
import { unsubscribe } from '../../blue_modules/notifications';
|
2018-01-30 23:42:38 +01:00
|
|
|
|
2024-09-14 00:30:01 +02:00
|
|
|
type RouteProps = RouteProp<DetailViewStackParamList, 'WalletDetails'>;
|
|
|
|
const WalletDetails: React.FC = () => {
|
2024-05-18 00:34:39 +02:00
|
|
|
const { saveToDisk, wallets, deleteWallet, setSelectedWalletID, txMetadata } = useStorage();
|
2024-06-04 03:54:32 +02:00
|
|
|
const { isBiometricUseCapableAndEnabled } = useBiometrics();
|
2024-09-14 00:30:01 +02:00
|
|
|
const { walletID } = useRoute<RouteProps>().params;
|
|
|
|
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
|
|
const [backdoorPressed, setBackdoorPressed] = useState<number>(0);
|
|
|
|
const walletRef = useRef<TWallet | undefined>(wallets.find(w => w.getID() === walletID));
|
|
|
|
const wallet = walletRef.current as TWallet;
|
|
|
|
const [walletUseWithHardwareWallet, setWalletUseWithHardwareWallet] = useState<boolean>(
|
|
|
|
wallet.useWithHardwareWalletEnabled ? wallet.useWithHardwareWalletEnabled() : false,
|
|
|
|
);
|
|
|
|
const [isBIP47Enabled, setIsBIP47Enabled] = useState<boolean>(wallet.isBIP47Enabled ? wallet.isBIP47Enabled() : false);
|
|
|
|
|
|
|
|
const [isContactsVisible, setIsContactsVisible] = useState<boolean>(
|
|
|
|
(wallet.allowBIP47 && wallet.allowBIP47() && wallet.isBIP47Enabled && wallet.isBIP47Enabled()) || false,
|
|
|
|
);
|
|
|
|
|
|
|
|
const [hideTransactionsInWalletsList, setHideTransactionsInWalletsList] = useState<boolean>(
|
2024-10-01 14:29:02 +02:00
|
|
|
wallet.getHideTransactionsInWalletsList ? !wallet.getHideTransactionsInWalletsList() : true,
|
2024-09-14 00:30:01 +02:00
|
|
|
);
|
2024-09-14 16:04:42 +02:00
|
|
|
const { setOptions, navigate, addListener } = useExtendedNavigation();
|
2020-08-09 03:04:11 +02:00
|
|
|
const { colors } = useTheme();
|
2024-09-14 06:23:55 +02:00
|
|
|
const [walletName, setWalletName] = useState<string>(wallet.getLabel());
|
|
|
|
|
2024-09-14 00:30:01 +02:00
|
|
|
const [masterFingerprint, setMasterFingerprint] = useState<string | undefined>();
|
|
|
|
const walletTransactionsLength = useMemo<number>(() => wallet.getTransactions().length, [wallet]);
|
|
|
|
const derivationPath = useMemo<string | null>(() => {
|
2021-09-23 15:05:10 +02:00
|
|
|
try {
|
2024-09-14 00:30:01 +02:00
|
|
|
// @ts-expect-error: Need to fix later
|
|
|
|
if (wallet.getDerivationPath) {
|
|
|
|
// @ts-expect-error: Need to fix later
|
|
|
|
const path = wallet.getDerivationPath();
|
|
|
|
return path.length > 0 ? path : null;
|
|
|
|
}
|
|
|
|
return null;
|
2021-09-23 15:05:10 +02:00
|
|
|
} catch (e) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}, [wallet]);
|
2024-09-14 00:30:01 +02:00
|
|
|
const [isToolTipMenuVisible, setIsToolTipMenuVisible] = useState<boolean>(false);
|
2024-10-12 23:59:26 +02:00
|
|
|
const [isMasterFingerPrintVisible, setIsMasterFingerPrintVisible] = useState<boolean>(false);
|
2024-04-09 18:01:25 +02:00
|
|
|
|
|
|
|
const onMenuWillShow = () => setIsToolTipMenuVisible(true);
|
|
|
|
const onMenuWillHide = () => setIsToolTipMenuVisible(false);
|
2021-09-09 13:00:11 +02:00
|
|
|
|
2024-08-11 11:55:56 +02:00
|
|
|
useEffect(() => {
|
2024-09-14 00:30:01 +02:00
|
|
|
setIsContactsVisible(wallet.allowBIP47 && wallet.allowBIP47() && isBIP47Enabled);
|
|
|
|
}, [isBIP47Enabled, wallet]);
|
2024-08-11 11:55:56 +02:00
|
|
|
|
2024-09-10 23:19:31 +02:00
|
|
|
useFocusEffect(
|
|
|
|
useCallback(() => {
|
|
|
|
const task = InteractionManager.runAfterInteractions(() => {
|
2024-10-12 23:59:26 +02:00
|
|
|
if (isMasterFingerPrintVisible && wallet.allowMasterFingerprint && wallet.allowMasterFingerprint()) {
|
2024-09-14 00:30:01 +02:00
|
|
|
// @ts-expect-error: Need to fix later
|
|
|
|
if (wallet.getMasterFingerprintHex) {
|
|
|
|
// @ts-expect-error: Need to fix later
|
2024-10-12 23:59:26 +02:00
|
|
|
setMasterFingerprint(wallet.getMasterFingerprintHex());
|
2024-09-14 00:30:01 +02:00
|
|
|
}
|
2024-10-12 23:59:26 +02:00
|
|
|
} else {
|
|
|
|
setMasterFingerprint(undefined);
|
2024-09-10 23:19:31 +02:00
|
|
|
}
|
2021-05-04 05:25:18 +02:00
|
|
|
});
|
2024-09-10 23:19:31 +02:00
|
|
|
|
|
|
|
return () => task.cancel();
|
2024-10-12 23:59:26 +02:00
|
|
|
}, [isMasterFingerPrintVisible, wallet]),
|
2024-09-10 23:19:31 +02:00
|
|
|
);
|
2024-09-14 00:30:01 +02:00
|
|
|
|
2020-08-09 03:04:11 +02:00
|
|
|
const stylesHook = StyleSheet.create({
|
|
|
|
textLabel1: {
|
|
|
|
color: colors.feeText,
|
|
|
|
},
|
|
|
|
textLabel2: {
|
|
|
|
color: colors.feeText,
|
|
|
|
},
|
|
|
|
textValue: {
|
|
|
|
color: colors.outputValue,
|
|
|
|
},
|
|
|
|
input: {
|
|
|
|
borderColor: colors.formBorder,
|
|
|
|
borderBottomColor: colors.formBorder,
|
|
|
|
backgroundColor: colors.inputBackgroundColor,
|
|
|
|
},
|
2024-04-09 18:01:25 +02:00
|
|
|
delete: {
|
|
|
|
color: isToolTipMenuVisible ? colors.buttonDisabledTextColor : '#d0021b',
|
2022-03-20 21:57:16 +01:00
|
|
|
},
|
2020-08-09 03:04:11 +02:00
|
|
|
});
|
2018-01-30 23:42:38 +01:00
|
|
|
|
2024-05-05 02:14:46 +02:00
|
|
|
useEffect(() => {
|
2020-10-24 19:20:59 +02:00
|
|
|
setOptions({
|
2024-06-12 23:50:11 +02:00
|
|
|
headerBackTitleVisible: true,
|
2020-10-24 19:20:59 +02:00
|
|
|
});
|
2024-09-14 00:30:01 +02:00
|
|
|
}, [setOptions]);
|
2020-08-09 03:04:11 +02:00
|
|
|
|
2020-11-15 19:19:55 +01:00
|
|
|
useEffect(() => {
|
2023-07-25 15:50:04 +02:00
|
|
|
if (wallets.some(w => w.getID() === walletID)) {
|
2023-11-20 21:02:47 +01:00
|
|
|
setSelectedWalletID(walletID);
|
2021-02-27 01:23:59 +01:00
|
|
|
}
|
2020-11-15 19:19:55 +01:00
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
}, [walletID]);
|
|
|
|
|
2024-11-11 19:11:59 +01:00
|
|
|
const navigateToOverviewAndDeleteWallet = useCallback(async () => {
|
2021-02-25 01:52:55 +01:00
|
|
|
setIsLoading(true);
|
2024-11-11 19:11:59 +01:00
|
|
|
|
2023-01-26 16:50:17 +01:00
|
|
|
try {
|
2024-11-11 19:11:59 +01:00
|
|
|
const externalAddresses = wallet.getAllExternalAddresses();
|
|
|
|
if (externalAddresses.length > 0) {
|
|
|
|
await unsubscribe(externalAddresses, [], []);
|
2024-09-14 00:30:01 +02:00
|
|
|
}
|
2024-11-11 19:11:59 +01:00
|
|
|
deleteWallet(wallet);
|
|
|
|
saveToDisk(true);
|
|
|
|
triggerHapticFeedback(HapticFeedbackTypes.NotificationSuccess);
|
|
|
|
popToTop();
|
|
|
|
} catch (e: unknown) {
|
|
|
|
console.error(e);
|
|
|
|
triggerHapticFeedback(HapticFeedbackTypes.NotificationError);
|
|
|
|
presentAlert({ message: (e as Error).message });
|
|
|
|
setIsLoading(false);
|
|
|
|
}
|
|
|
|
}, [deleteWallet, saveToDisk, wallet]);
|
2021-02-25 01:52:55 +01:00
|
|
|
|
2020-08-09 03:04:11 +02:00
|
|
|
const presentWalletHasBalanceAlert = useCallback(async () => {
|
2023-12-29 12:52:12 +01:00
|
|
|
triggerHapticFeedback(HapticFeedbackTypes.NotificationWarning);
|
2020-10-08 13:16:25 +02:00
|
|
|
try {
|
2024-11-11 19:11:59 +01:00
|
|
|
const balance = formatBalanceWithoutSuffix(wallet.getBalance(), BitcoinUnit.SATS, true);
|
2020-10-08 13:16:25 +02:00
|
|
|
const walletBalanceConfirmation = await prompt(
|
2021-10-15 17:15:25 +02:00
|
|
|
loc.wallets.details_delete_wallet,
|
2024-11-11 19:11:59 +01:00
|
|
|
loc.formatString(loc.wallets.details_del_wb_q, { balance }),
|
2020-10-08 13:16:25 +02:00
|
|
|
true,
|
2024-11-11 19:11:59 +01:00
|
|
|
'numeric',
|
2021-02-25 03:21:25 +01:00
|
|
|
true,
|
2021-10-16 16:37:51 +02:00
|
|
|
loc.wallets.details_delete,
|
2020-10-08 13:16:25 +02:00
|
|
|
);
|
2024-11-11 19:11:59 +01:00
|
|
|
// Remove any non-numeric characters before comparison
|
|
|
|
const cleanedConfirmation = (walletBalanceConfirmation || '').replace(/[^0-9]/g, '');
|
|
|
|
|
|
|
|
if (Number(cleanedConfirmation) === wallet.getBalance()) {
|
|
|
|
await navigateToOverviewAndDeleteWallet();
|
|
|
|
triggerHapticFeedback(HapticFeedbackTypes.NotificationSuccess);
|
2020-10-08 13:16:25 +02:00
|
|
|
} else {
|
2023-12-29 12:52:12 +01:00
|
|
|
triggerHapticFeedback(HapticFeedbackTypes.NotificationError);
|
2020-10-08 13:16:25 +02:00
|
|
|
setIsLoading(false);
|
2024-02-07 20:24:24 +01:00
|
|
|
presentAlert({ message: loc.wallets.details_del_wb_err });
|
2020-10-08 13:16:25 +02:00
|
|
|
}
|
|
|
|
} catch (_) {}
|
2024-11-11 19:11:59 +01:00
|
|
|
}, [navigateToOverviewAndDeleteWallet, wallet]);
|
2019-08-30 06:45:08 +02:00
|
|
|
|
2020-08-09 03:04:11 +02:00
|
|
|
const navigateToWalletExport = () => {
|
2020-11-24 04:15:33 +01:00
|
|
|
navigate('WalletExportRoot', {
|
|
|
|
screen: 'WalletExport',
|
|
|
|
params: {
|
2024-07-13 20:13:41 +02:00
|
|
|
walletID,
|
2020-11-24 04:15:33 +01:00
|
|
|
},
|
2020-06-18 16:59:44 +02:00
|
|
|
});
|
|
|
|
};
|
2020-10-05 23:25:14 +02:00
|
|
|
const navigateToMultisigCoordinationSetup = () => {
|
2020-12-12 07:42:23 +01:00
|
|
|
navigate('ExportMultisigCoordinationSetupRoot', {
|
|
|
|
screen: 'ExportMultisigCoordinationSetup',
|
|
|
|
params: {
|
2024-07-13 20:13:41 +02:00
|
|
|
walletID,
|
2020-12-12 07:42:23 +01:00
|
|
|
},
|
2020-10-05 23:25:14 +02:00
|
|
|
});
|
|
|
|
};
|
2020-10-29 22:13:54 +01:00
|
|
|
const navigateToViewEditCosigners = () => {
|
2020-12-12 01:27:43 +01:00
|
|
|
navigate('ViewEditMultisigCosignersRoot', {
|
|
|
|
screen: 'ViewEditMultisigCosigners',
|
|
|
|
params: {
|
2024-05-08 20:46:47 +02:00
|
|
|
walletID,
|
2020-12-12 01:27:43 +01:00
|
|
|
},
|
2020-10-29 22:13:54 +01:00
|
|
|
});
|
|
|
|
};
|
2020-08-09 03:04:11 +02:00
|
|
|
const navigateToXPub = () =>
|
2020-11-24 04:15:33 +01:00
|
|
|
navigate('WalletXpubRoot', {
|
|
|
|
screen: 'WalletXpub',
|
|
|
|
params: {
|
2021-06-17 23:24:00 +02:00
|
|
|
walletID,
|
2020-11-24 04:15:33 +01:00
|
|
|
},
|
2020-08-09 03:04:11 +02:00
|
|
|
});
|
2021-03-23 13:16:32 +01:00
|
|
|
const navigateToSignVerify = () =>
|
|
|
|
navigate('SignVerifyRoot', {
|
|
|
|
screen: 'SignVerify',
|
|
|
|
params: {
|
2024-07-13 20:13:41 +02:00
|
|
|
walletID,
|
2021-03-23 13:16:32 +01:00
|
|
|
address: wallet.getAllExternalAddresses()[0], // works for both single address and HD wallets
|
|
|
|
},
|
|
|
|
});
|
2020-06-18 16:59:44 +02:00
|
|
|
|
2021-02-04 08:05:37 +01:00
|
|
|
const navigateToAddresses = () =>
|
2021-04-16 16:05:25 +02:00
|
|
|
navigate('WalletAddresses', {
|
2024-07-13 20:13:41 +02:00
|
|
|
walletID,
|
2021-02-04 08:05:37 +01:00
|
|
|
});
|
|
|
|
|
2024-06-11 02:44:05 +02:00
|
|
|
const navigateToContacts = () => navigate('PaymentCodeList', { walletID });
|
2023-03-15 21:42:25 +01:00
|
|
|
|
2020-09-20 10:51:58 +02:00
|
|
|
const exportInternals = async () => {
|
|
|
|
if (backdoorPressed < 10) return setBackdoorPressed(backdoorPressed + 1);
|
|
|
|
setBackdoorPressed(0);
|
|
|
|
if (wallet.type !== HDSegwitBech32Wallet.type) return;
|
|
|
|
const fileName = 'wallet-externals.json';
|
|
|
|
const contents = JSON.stringify(
|
|
|
|
{
|
|
|
|
_balances_by_external_index: wallet._balances_by_external_index,
|
|
|
|
_balances_by_internal_index: wallet._balances_by_internal_index,
|
|
|
|
_txs_by_external_index: wallet._txs_by_external_index,
|
|
|
|
_txs_by_internal_index: wallet._txs_by_internal_index,
|
|
|
|
_utxo: wallet._utxo,
|
|
|
|
next_free_address_index: wallet.next_free_address_index,
|
|
|
|
next_free_change_address_index: wallet.next_free_change_address_index,
|
|
|
|
internal_addresses_cache: wallet.internal_addresses_cache,
|
|
|
|
external_addresses_cache: wallet.external_addresses_cache,
|
|
|
|
_xpub: wallet._xpub,
|
|
|
|
gap_limit: wallet.gap_limit,
|
|
|
|
label: wallet.label,
|
|
|
|
_lastTxFetch: wallet._lastTxFetch,
|
|
|
|
_lastBalanceFetch: wallet._lastBalanceFetch,
|
|
|
|
},
|
|
|
|
null,
|
|
|
|
2,
|
|
|
|
);
|
2024-05-08 20:08:52 +02:00
|
|
|
|
|
|
|
await writeFileAndExport(fileName, contents, false);
|
2020-09-20 10:51:58 +02:00
|
|
|
};
|
|
|
|
|
2020-11-27 17:35:14 +01:00
|
|
|
const purgeTransactions = async () => {
|
|
|
|
if (backdoorPressed < 10) return setBackdoorPressed(backdoorPressed + 1);
|
|
|
|
setBackdoorPressed(0);
|
|
|
|
const msg = 'Transactions purged. Pls go to main screen and back to rerender screen';
|
|
|
|
|
|
|
|
if (wallet.type === HDSegwitBech32Wallet.type) {
|
|
|
|
wallet._txs_by_external_index = {};
|
|
|
|
wallet._txs_by_internal_index = {};
|
2024-02-07 20:24:24 +01:00
|
|
|
presentAlert({ message: msg });
|
2020-11-27 17:35:14 +01:00
|
|
|
}
|
|
|
|
|
2024-09-14 00:30:01 +02:00
|
|
|
// @ts-expect-error: Need to fix later
|
2020-11-27 17:35:14 +01:00
|
|
|
if (wallet._hdWalletInstance) {
|
2024-09-14 00:30:01 +02:00
|
|
|
// @ts-expect-error: Need to fix later
|
2020-11-27 17:35:14 +01:00
|
|
|
wallet._hdWalletInstance._txs_by_external_index = {};
|
2024-09-14 00:30:01 +02:00
|
|
|
// @ts-expect-error: Need to fix later
|
2020-11-27 17:35:14 +01:00
|
|
|
wallet._hdWalletInstance._txs_by_internal_index = {};
|
2024-02-07 20:24:24 +01:00
|
|
|
presentAlert({ message: msg });
|
2020-11-27 17:35:14 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2024-09-14 16:04:42 +02:00
|
|
|
const walletNameTextInputOnBlur = useCallback(async () => {
|
2024-10-01 14:29:02 +02:00
|
|
|
const trimmedWalletName = walletName.trim();
|
|
|
|
if (trimmedWalletName.length === 0) {
|
2020-08-09 03:04:11 +02:00
|
|
|
const walletLabel = wallet.getLabel();
|
|
|
|
setWalletName(walletLabel);
|
2024-10-01 14:29:02 +02:00
|
|
|
} else if (wallet.getLabel() !== trimmedWalletName) {
|
|
|
|
// Only save if the name has changed
|
|
|
|
wallet.setLabel(trimmedWalletName);
|
2024-09-14 00:30:01 +02:00
|
|
|
try {
|
2024-10-01 14:29:02 +02:00
|
|
|
console.warn('saving wallet name:', trimmedWalletName);
|
2024-09-14 00:30:01 +02:00
|
|
|
await saveToDisk();
|
|
|
|
} catch (error) {
|
2024-10-01 14:29:02 +02:00
|
|
|
console.error((error as Error).message);
|
2024-09-14 00:30:01 +02:00
|
|
|
}
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
2024-09-14 16:04:42 +02:00
|
|
|
}, [wallet, walletName, saveToDisk]);
|
|
|
|
|
|
|
|
useEffect(() => {
|
2024-11-11 19:11:59 +01:00
|
|
|
const subscribe = addListener('beforeRemove', () => {
|
2024-09-14 16:04:42 +02:00
|
|
|
walletNameTextInputOnBlur();
|
|
|
|
});
|
|
|
|
|
2024-11-11 19:11:59 +01:00
|
|
|
return subscribe;
|
2024-09-14 16:04:42 +02:00
|
|
|
}, [addListener, walletName, walletNameTextInputOnBlur]);
|
2020-07-20 15:38:46 +02:00
|
|
|
|
2024-03-29 20:07:14 +01:00
|
|
|
const exportHistoryContent = useCallback(() => {
|
|
|
|
const headers = [loc.transactions.date, loc.transactions.txid, `${loc.send.create_amount} (${BitcoinUnit.BTC})`, loc.send.create_memo];
|
2023-11-19 19:01:29 +01:00
|
|
|
if (wallet.chain === Chain.OFFCHAIN) {
|
2024-03-29 20:07:14 +01:00
|
|
|
headers.push(loc.lnd.payment);
|
2023-11-19 19:01:29 +01:00
|
|
|
}
|
|
|
|
|
2024-03-29 20:07:14 +01:00
|
|
|
const rows = [headers.join(',')];
|
2022-10-12 18:39:48 +02:00
|
|
|
const transactions = wallet.getTransactions();
|
|
|
|
|
2024-09-14 00:30:01 +02:00
|
|
|
transactions.forEach((transaction: Transaction & LightningTransaction) => {
|
|
|
|
const value = formatBalanceWithoutSuffix(transaction.value || 0, BitcoinUnit.BTC, true);
|
|
|
|
let hash: string = transaction.hash || '';
|
|
|
|
let memo = (transaction.hash && txMetadata[transaction.hash]?.memo?.trim()) || '';
|
|
|
|
let status = '';
|
2023-03-28 04:54:27 +02:00
|
|
|
|
|
|
|
if (wallet.chain === Chain.OFFCHAIN) {
|
2024-09-14 00:30:01 +02:00
|
|
|
hash = transaction.payment_hash ? transaction.payment_hash.toString() : '';
|
|
|
|
memo = transaction.memo || '';
|
2023-11-19 19:01:29 +01:00
|
|
|
status = transaction.ispaid ? loc._.success : loc.lnd.expired;
|
2024-09-14 00:30:01 +02:00
|
|
|
if (typeof hash !== 'string' && (hash as any)?.type === 'Buffer' && (hash as any)?.data) {
|
|
|
|
hash = Buffer.from((hash as any).data).toString('hex');
|
2023-04-28 12:29:15 +02:00
|
|
|
}
|
2023-03-28 04:54:27 +02:00
|
|
|
}
|
2023-11-19 19:01:29 +01:00
|
|
|
|
2024-09-14 00:30:01 +02:00
|
|
|
const date = transaction.received ? new Date(transaction.received).toString() : '';
|
|
|
|
const data = [date, hash, value, memo];
|
2023-11-19 19:01:29 +01:00
|
|
|
|
|
|
|
if (wallet.chain === Chain.OFFCHAIN) {
|
|
|
|
data.push(status);
|
|
|
|
}
|
|
|
|
|
2024-03-29 20:07:14 +01:00
|
|
|
rows.push(data.join(','));
|
|
|
|
});
|
2022-10-12 18:39:48 +02:00
|
|
|
|
2024-03-29 20:07:14 +01:00
|
|
|
return rows.join('\n');
|
|
|
|
}, [wallet, txMetadata]);
|
2022-10-12 18:39:48 +02:00
|
|
|
|
2020-08-09 03:04:11 +02:00
|
|
|
const handleDeleteButtonTapped = () => {
|
2023-12-29 12:52:12 +01:00
|
|
|
triggerHapticFeedback(HapticFeedbackTypes.NotificationWarning);
|
2020-08-09 03:04:11 +02:00
|
|
|
Alert.alert(
|
|
|
|
loc.wallets.details_delete_wallet,
|
|
|
|
loc.wallets.details_are_you_sure,
|
|
|
|
[
|
|
|
|
{
|
|
|
|
text: loc.wallets.details_yes_delete,
|
|
|
|
onPress: async () => {
|
2024-05-18 00:34:39 +02:00
|
|
|
const isBiometricsEnabled = await isBiometricUseCapableAndEnabled();
|
2020-08-09 03:04:11 +02:00
|
|
|
|
|
|
|
if (isBiometricsEnabled) {
|
2024-05-18 00:34:39 +02:00
|
|
|
if (!(await unlockWithBiometrics())) {
|
2020-08-09 03:04:11 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2024-09-14 00:30:01 +02:00
|
|
|
if (wallet.getBalance && wallet.getBalance() > 0 && wallet.allowSend && wallet.allowSend()) {
|
2020-08-09 03:04:11 +02:00
|
|
|
presentWalletHasBalanceAlert();
|
|
|
|
} else {
|
2021-02-25 01:52:55 +01:00
|
|
|
navigateToOverviewAndDeleteWallet();
|
2020-08-09 03:04:11 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
style: 'destructive',
|
|
|
|
},
|
|
|
|
{ text: loc.wallets.details_no_cancel, onPress: () => {}, style: 'cancel' },
|
|
|
|
],
|
|
|
|
{ cancelable: false },
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2024-03-29 19:57:46 +01:00
|
|
|
const fileName = useMemo(() => {
|
|
|
|
const label = wallet.getLabel().replace(' ', '-');
|
|
|
|
return `${label}-history.csv`;
|
|
|
|
}, [wallet]);
|
|
|
|
|
2024-10-12 23:59:26 +02:00
|
|
|
const onViewMasterFingerPrintPress = () => {
|
|
|
|
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
|
|
setIsMasterFingerPrintVisible(true);
|
|
|
|
};
|
|
|
|
|
2021-05-04 05:25:18 +02:00
|
|
|
return (
|
|
|
|
<ScrollView
|
2024-08-20 21:22:11 +02:00
|
|
|
automaticallyAdjustKeyboardInsets
|
2021-05-04 05:25:18 +02:00
|
|
|
contentInsetAdjustmentBehavior="automatic"
|
2024-09-14 00:30:01 +02:00
|
|
|
automaticallyAdjustContentInsets
|
2021-05-04 05:25:18 +02:00
|
|
|
centerContent={isLoading}
|
|
|
|
testID="WalletDetailsScroll"
|
|
|
|
>
|
|
|
|
{isLoading ? (
|
|
|
|
<BlueLoading />
|
|
|
|
) : (
|
2024-09-14 16:04:42 +02:00
|
|
|
<View>
|
|
|
|
<BlueCard style={styles.address}>
|
|
|
|
{(() => {
|
|
|
|
if (
|
|
|
|
[LegacyWallet.type, SegwitBech32Wallet.type, SegwitP2SHWallet.type].includes(wallet.type) ||
|
|
|
|
(wallet.type === WatchOnlyWallet.type && !wallet.isHd())
|
|
|
|
) {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Text style={[styles.textLabel1, stylesHook.textLabel1]}>{loc.wallets.details_address.toLowerCase()}</Text>
|
|
|
|
<Text style={[styles.textValue, stylesHook.textValue]}>
|
|
|
|
{(() => {
|
|
|
|
// gracefully handling faulty wallets, so at least user has an option to delete the wallet
|
|
|
|
try {
|
|
|
|
return wallet.getAddress ? wallet.getAddress() : '';
|
|
|
|
} catch (error: any) {
|
|
|
|
return error.message;
|
|
|
|
}
|
|
|
|
})()}
|
|
|
|
</Text>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
})()}
|
|
|
|
<Text style={[styles.textLabel2, stylesHook.textLabel2]}>{loc.wallets.add_wallet_name.toLowerCase()}</Text>
|
|
|
|
<View style={[styles.input, stylesHook.input]}>
|
|
|
|
<TextInput
|
|
|
|
value={walletName}
|
|
|
|
onChangeText={(text: string) => {
|
|
|
|
setWalletName(text);
|
|
|
|
}}
|
|
|
|
onChange={event => {
|
|
|
|
const text = event.nativeEvent.text;
|
|
|
|
setWalletName(text);
|
|
|
|
}}
|
|
|
|
onBlur={walletNameTextInputOnBlur}
|
|
|
|
numberOfLines={1}
|
|
|
|
placeholderTextColor="#81868e"
|
|
|
|
style={styles.inputText}
|
|
|
|
editable={!isLoading}
|
|
|
|
underlineColorAndroid="transparent"
|
|
|
|
testID="WalletNameInput"
|
|
|
|
/>
|
|
|
|
</View>
|
|
|
|
<BlueSpacing20 />
|
|
|
|
<Text style={[styles.textLabel1, stylesHook.textLabel1]}>{loc.wallets.details_type.toLowerCase()}</Text>
|
2024-10-01 14:29:02 +02:00
|
|
|
<Text style={[styles.textValue, stylesHook.textValue]} selectable>
|
|
|
|
{wallet.typeReadable}
|
|
|
|
</Text>
|
2024-09-14 16:04:42 +02:00
|
|
|
|
|
|
|
{wallet.type === MultisigHDWallet.type && (
|
|
|
|
<>
|
|
|
|
<Text style={[styles.textLabel2, stylesHook.textLabel2]}>{loc.wallets.details_multisig_type}</Text>
|
|
|
|
<BlueText>
|
|
|
|
{`${wallet.getM()} / ${wallet.getN()} (${
|
|
|
|
wallet.isNativeSegwit() ? 'native segwit' : wallet.isWrappedSegwit() ? 'wrapped segwit' : 'legacy'
|
|
|
|
})`}
|
|
|
|
</BlueText>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
{wallet.type === MultisigHDWallet.type && (
|
|
|
|
<>
|
|
|
|
<Text style={[styles.textLabel2, stylesHook.textLabel2]}>{loc.multisig.how_many_signatures_can_bluewallet_make}</Text>
|
|
|
|
<BlueText>{wallet.howManySignaturesCanWeMake()}</BlueText>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
|
|
|
|
{wallet.type === LightningCustodianWallet.type && (
|
|
|
|
<>
|
|
|
|
<Text style={[styles.textLabel1, stylesHook.textLabel1]}>{loc.wallets.details_connected_to.toLowerCase()}</Text>
|
|
|
|
<BlueText>{wallet.getBaseURI()}</BlueText>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
|
|
|
|
{wallet.type === HDAezeedWallet.type && (
|
|
|
|
<>
|
|
|
|
<Text style={[styles.textLabel1, stylesHook.textLabel1]}>{loc.wallets.identity_pubkey.toLowerCase()}</Text>
|
|
|
|
<BlueText>{wallet.getIdentityPubkey()}</BlueText>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
<BlueSpacing20 />
|
|
|
|
<>
|
|
|
|
<Text onPress={exportInternals} style={[styles.textLabel2, stylesHook.textLabel2]}>
|
|
|
|
{loc.transactions.list_title.toLowerCase()}
|
|
|
|
</Text>
|
|
|
|
<View style={styles.hardware}>
|
|
|
|
<BlueText>{loc.wallets.details_display}</BlueText>
|
|
|
|
<Switch
|
|
|
|
disabled={isToolTipMenuVisible}
|
|
|
|
value={hideTransactionsInWalletsList}
|
|
|
|
onValueChange={async (value: boolean) => {
|
|
|
|
if (wallet.setHideTransactionsInWalletsList) {
|
2024-10-01 14:29:02 +02:00
|
|
|
wallet.setHideTransactionsInWalletsList(!value);
|
2024-10-13 00:03:23 +02:00
|
|
|
triggerHapticFeedback(HapticFeedbackTypes.ImpactLight);
|
2024-10-01 14:29:02 +02:00
|
|
|
setHideTransactionsInWalletsList(!wallet.getHideTransactionsInWalletsList());
|
2024-09-14 16:04:42 +02:00
|
|
|
}
|
|
|
|
try {
|
|
|
|
await saveToDisk();
|
2024-10-12 23:59:26 +02:00
|
|
|
} catch (error: any) {
|
2024-10-13 00:03:23 +02:00
|
|
|
triggerHapticFeedback(HapticFeedbackTypes.NotificationError);
|
|
|
|
console.error(error.message);
|
2024-09-14 16:04:42 +02:00
|
|
|
}
|
2024-09-14 06:23:55 +02:00
|
|
|
}}
|
2024-08-20 21:22:11 +02:00
|
|
|
/>
|
|
|
|
</View>
|
2024-09-14 16:04:42 +02:00
|
|
|
</>
|
|
|
|
<>
|
|
|
|
<Text onPress={purgeTransactions} style={[styles.textLabel2, stylesHook.textLabel2]}>
|
|
|
|
{loc.transactions.transactions_count.toLowerCase()}
|
|
|
|
</Text>
|
|
|
|
<BlueText>{wallet.getTransactions().length}</BlueText>
|
|
|
|
</>
|
|
|
|
|
|
|
|
{wallet.allowBIP47 && wallet.allowBIP47() ? (
|
2021-05-04 05:25:18 +02:00
|
|
|
<>
|
2024-09-14 16:04:42 +02:00
|
|
|
<Text style={[styles.textLabel2, stylesHook.textLabel2]}>{loc.bip47.payment_code}</Text>
|
2021-05-04 05:25:18 +02:00
|
|
|
<View style={styles.hardware}>
|
2024-09-14 16:04:42 +02:00
|
|
|
<BlueText>{loc.bip47.purpose}</BlueText>
|
2024-04-09 18:01:25 +02:00
|
|
|
<Switch
|
2024-09-14 16:04:42 +02:00
|
|
|
value={isBIP47Enabled}
|
2024-09-14 00:30:01 +02:00
|
|
|
onValueChange={async (value: boolean) => {
|
2024-09-14 16:04:42 +02:00
|
|
|
setIsBIP47Enabled(value);
|
|
|
|
if (wallet.switchBIP47) {
|
|
|
|
wallet.switchBIP47(value);
|
2024-10-13 00:03:23 +02:00
|
|
|
triggerHapticFeedback(HapticFeedbackTypes.ImpactLight);
|
2024-09-14 00:30:01 +02:00
|
|
|
}
|
|
|
|
try {
|
|
|
|
await saveToDisk();
|
2024-10-13 00:03:23 +02:00
|
|
|
} catch (error: unknown) {
|
|
|
|
triggerHapticFeedback(HapticFeedbackTypes.NotificationError);
|
|
|
|
console.error((error as Error).message);
|
2024-09-14 00:30:01 +02:00
|
|
|
}
|
|
|
|
}}
|
2024-09-14 16:04:42 +02:00
|
|
|
testID="BIP47Switch"
|
2024-04-09 18:01:25 +02:00
|
|
|
/>
|
2021-05-04 05:25:18 +02:00
|
|
|
</View>
|
|
|
|
</>
|
2024-09-14 16:04:42 +02:00
|
|
|
) : null}
|
2021-05-04 05:25:18 +02:00
|
|
|
|
2024-09-14 16:04:42 +02:00
|
|
|
<View>
|
|
|
|
{wallet.type === WatchOnlyWallet.type && wallet.isHd && wallet.isHd() && (
|
2023-03-15 21:42:25 +01:00
|
|
|
<>
|
2024-09-14 16:04:42 +02:00
|
|
|
<BlueSpacing10 />
|
|
|
|
<Text style={[styles.textLabel2, stylesHook.textLabel2]}>{loc.wallets.details_advanced.toLowerCase()}</Text>
|
2023-03-15 21:42:25 +01:00
|
|
|
<View style={styles.hardware}>
|
2024-09-14 16:04:42 +02:00
|
|
|
<BlueText>{loc.wallets.details_use_with_hardware_wallet}</BlueText>
|
2024-09-14 00:30:01 +02:00
|
|
|
<Switch
|
2024-09-14 16:04:42 +02:00
|
|
|
value={walletUseWithHardwareWallet}
|
2024-09-14 00:30:01 +02:00
|
|
|
onValueChange={async (value: boolean) => {
|
2024-09-14 16:04:42 +02:00
|
|
|
setWalletUseWithHardwareWallet(value);
|
|
|
|
if (wallet.setUseWithHardwareWalletEnabled) {
|
|
|
|
wallet.setUseWithHardwareWalletEnabled(value);
|
2024-10-13 00:03:23 +02:00
|
|
|
triggerHapticFeedback(HapticFeedbackTypes.ImpactLight);
|
2024-09-14 00:30:01 +02:00
|
|
|
}
|
|
|
|
try {
|
|
|
|
await saveToDisk();
|
2024-10-13 00:03:23 +02:00
|
|
|
} catch (error: unknown) {
|
|
|
|
triggerHapticFeedback(HapticFeedbackTypes.NotificationError);
|
|
|
|
console.error((error as Error).message);
|
2024-09-14 00:30:01 +02:00
|
|
|
}
|
|
|
|
}}
|
|
|
|
/>
|
2023-03-15 21:42:25 +01:00
|
|
|
</View>
|
|
|
|
</>
|
2024-09-14 16:04:42 +02:00
|
|
|
)}
|
|
|
|
<View style={styles.row}>
|
|
|
|
{wallet.allowMasterFingerprint && wallet.allowMasterFingerprint() && (
|
|
|
|
<View style={styles.marginRight16}>
|
|
|
|
<Text style={[styles.textLabel2, stylesHook.textLabel2]}>{loc.wallets.details_master_fingerprint.toLowerCase()}</Text>
|
2024-10-12 23:59:26 +02:00
|
|
|
{isMasterFingerPrintVisible ? (
|
|
|
|
<BlueText selectable>{masterFingerprint ?? <ActivityIndicator />}</BlueText>
|
|
|
|
) : (
|
|
|
|
<TouchableOpacity onPress={onViewMasterFingerPrintPress}>
|
|
|
|
<BlueText>{loc.multisig.view}</BlueText>
|
|
|
|
</TouchableOpacity>
|
|
|
|
)}
|
2024-09-14 16:04:42 +02:00
|
|
|
</View>
|
|
|
|
)}
|
2022-12-07 01:56:11 +01:00
|
|
|
|
2024-09-14 16:04:42 +02:00
|
|
|
{derivationPath && (
|
|
|
|
<View>
|
|
|
|
<Text style={[styles.textLabel2, stylesHook.textLabel2]}>{loc.wallets.details_derivation_path}</Text>
|
2024-10-01 14:29:02 +02:00
|
|
|
<BlueText selectable testID="DerivationPath">
|
|
|
|
{derivationPath}
|
|
|
|
</BlueText>
|
2024-09-14 16:04:42 +02:00
|
|
|
</View>
|
2021-05-04 05:25:18 +02:00
|
|
|
)}
|
|
|
|
</View>
|
2024-09-14 16:04:42 +02:00
|
|
|
</View>
|
|
|
|
</BlueCard>
|
|
|
|
{(wallet instanceof AbstractHDElectrumWallet || (wallet.type === WatchOnlyWallet.type && wallet.isHd && wallet.isHd())) && (
|
|
|
|
<ListItem disabled={isToolTipMenuVisible} onPress={navigateToAddresses} title={loc.wallets.details_show_addresses} chevron />
|
|
|
|
)}
|
|
|
|
{isContactsVisible ? (
|
|
|
|
<ListItem disabled={isToolTipMenuVisible} onPress={navigateToContacts} title={loc.bip47.contacts} chevron />
|
|
|
|
) : null}
|
|
|
|
<BlueCard style={styles.address}>
|
|
|
|
<View>
|
|
|
|
<BlueSpacing20 />
|
|
|
|
<Button
|
|
|
|
disabled={isToolTipMenuVisible}
|
|
|
|
onPress={navigateToWalletExport}
|
|
|
|
testID="WalletExport"
|
|
|
|
title={loc.wallets.details_export_backup}
|
|
|
|
/>
|
|
|
|
{walletTransactionsLength > 0 && (
|
|
|
|
<>
|
|
|
|
<BlueSpacing20 />
|
|
|
|
<SaveFileButton
|
|
|
|
onMenuWillHide={onMenuWillHide}
|
|
|
|
onMenuWillShow={onMenuWillShow}
|
|
|
|
fileName={fileName}
|
|
|
|
fileContent={exportHistoryContent()}
|
|
|
|
>
|
|
|
|
<SecondButton title={loc.wallets.details_export_history} />
|
|
|
|
</SaveFileButton>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
{wallet.type === MultisigHDWallet.type && (
|
|
|
|
<>
|
|
|
|
<BlueSpacing20 />
|
|
|
|
<SecondButton
|
|
|
|
disabled={isToolTipMenuVisible}
|
|
|
|
onPress={navigateToMultisigCoordinationSetup}
|
|
|
|
testID="MultisigCoordinationSetup"
|
|
|
|
title={loc.multisig.export_coordination_setup.replace(/^\w/, (c: string) => c.toUpperCase())}
|
|
|
|
/>
|
|
|
|
</>
|
|
|
|
)}
|
2021-05-04 05:25:18 +02:00
|
|
|
|
2024-09-14 16:04:42 +02:00
|
|
|
{wallet.type === MultisigHDWallet.type && (
|
|
|
|
<>
|
|
|
|
<BlueSpacing20 />
|
|
|
|
<SecondButton
|
|
|
|
disabled={isToolTipMenuVisible}
|
|
|
|
onPress={navigateToViewEditCosigners}
|
|
|
|
testID="ViewEditCosigners"
|
|
|
|
title={loc.multisig.view_edit_cosigners}
|
|
|
|
/>
|
|
|
|
</>
|
|
|
|
)}
|
2021-05-04 05:25:18 +02:00
|
|
|
|
2024-09-14 16:04:42 +02:00
|
|
|
{wallet.allowXpub && wallet.allowXpub() && (
|
|
|
|
<>
|
|
|
|
<BlueSpacing20 />
|
|
|
|
<SecondButton
|
|
|
|
disabled={isToolTipMenuVisible}
|
|
|
|
onPress={navigateToXPub}
|
|
|
|
testID="XPub"
|
|
|
|
title={loc.wallets.details_show_xpub}
|
|
|
|
/>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
{wallet.allowSignVerifyMessage && wallet.allowSignVerifyMessage() && (
|
|
|
|
<>
|
|
|
|
<BlueSpacing20 />
|
|
|
|
<SecondButton
|
|
|
|
disabled={isToolTipMenuVisible}
|
|
|
|
onPress={navigateToSignVerify}
|
|
|
|
testID="SignVerify"
|
|
|
|
title={loc.addresses.sign_title}
|
|
|
|
/>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
<BlueSpacing20 />
|
|
|
|
<BlueSpacing20 />
|
|
|
|
<TouchableOpacity
|
|
|
|
disabled={isToolTipMenuVisible}
|
|
|
|
accessibilityRole="button"
|
|
|
|
onPress={handleDeleteButtonTapped}
|
|
|
|
testID="DeleteButton"
|
|
|
|
>
|
|
|
|
<Text textBreakStrategy="simple" style={[styles.delete, stylesHook.delete]}>{`${loc.wallets.details_delete}${' '}`}</Text>
|
|
|
|
</TouchableOpacity>
|
|
|
|
<BlueSpacing20 />
|
|
|
|
<BlueSpacing20 />
|
|
|
|
</View>
|
|
|
|
</BlueCard>
|
|
|
|
</View>
|
2021-05-04 05:25:18 +02:00
|
|
|
)}
|
|
|
|
</ScrollView>
|
2020-08-09 03:04:11 +02:00
|
|
|
);
|
|
|
|
};
|
2018-03-18 03:48:23 +01:00
|
|
|
|
2024-09-14 00:30:01 +02:00
|
|
|
const styles = StyleSheet.create({
|
|
|
|
address: {
|
|
|
|
alignItems: 'center',
|
|
|
|
flex: 1,
|
|
|
|
},
|
|
|
|
textLabel1: {
|
|
|
|
fontWeight: '500',
|
|
|
|
fontSize: 14,
|
|
|
|
marginVertical: 12,
|
|
|
|
writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr',
|
|
|
|
},
|
|
|
|
textLabel2: {
|
|
|
|
fontWeight: '500',
|
|
|
|
fontSize: 14,
|
|
|
|
marginVertical: 16,
|
|
|
|
writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr',
|
|
|
|
},
|
|
|
|
textValue: {
|
|
|
|
fontWeight: '500',
|
|
|
|
fontSize: 14,
|
|
|
|
},
|
|
|
|
input: {
|
|
|
|
flexDirection: 'row',
|
|
|
|
borderWidth: 1,
|
|
|
|
borderBottomWidth: 0.5,
|
|
|
|
minHeight: 44,
|
|
|
|
height: 44,
|
|
|
|
alignItems: 'center',
|
|
|
|
borderRadius: 4,
|
|
|
|
},
|
|
|
|
inputText: {
|
|
|
|
flex: 1,
|
|
|
|
marginHorizontal: 8,
|
|
|
|
minHeight: 33,
|
|
|
|
color: '#81868e',
|
|
|
|
writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr',
|
|
|
|
},
|
|
|
|
hardware: {
|
|
|
|
flexDirection: 'row',
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
},
|
|
|
|
delete: {
|
|
|
|
fontSize: 15,
|
|
|
|
fontWeight: '500',
|
|
|
|
textAlign: 'center',
|
|
|
|
},
|
|
|
|
row: {
|
|
|
|
flexDirection: 'row',
|
|
|
|
},
|
|
|
|
marginRight16: {
|
|
|
|
marginRight: 16,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2020-08-09 03:04:11 +02:00
|
|
|
export default WalletDetails;
|