MCPcopy
hub / github.com/BlueWallet/BlueWallet / WalletsAddMultisigStep2

Function WalletsAddMultisigStep2

screen/wallets/addMultisigStep2.tsx:45–606  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43const AnimatedFlatList = Animated.createAnimatedComponent(FlatList);
44
45const WalletsAddMultisigStep2 = () => {
46 const { addAndSaveWallet, sleep, currentSharedCosigner, setSharedCosigner } = useStorage();
47 const { enableScreenProtect, disableScreenProtect } = useScreenProtect();
48 const { colors } = useTheme();
49
50 const navigation = useExtendedNavigation();
51 const route = useRoute<RouteProp<{ WalletsAddMultisigStep2: MultisigStep2Params }, 'WalletsAddMultisigStep2'>>();
52 const params = route.params;
53 const { m, n, format, walletLabel } = params;
54 const [cosigners, setCosigners] = useState<CosignerTuple[]>([]); // array of cosigners user provided. if format [cosigner, fp, path]
55 const [isLoading, setIsLoading] = useState(false);
56 const [vaultKeyData, setVaultKeyData] = useState({ keyIndex: 1, xpub: '', seed: '', isLoading: false }); // string rendered in modal
57 const [importText, setImportText] = useState('');
58 const [askPassphrase, setAskPassphrase] = useState(false);
59 const { isPrivacyBlurEnabled, isElectrumDisabled } = useSettings();
60 const data = useRef(new Array(n).fill(null));
61
62 useFocusEffect(
63 useCallback(() => {
64 if (isPrivacyBlurEnabled) {
65 enableScreenProtect();
66 }
67 return () => {
68 disableScreenProtect();
69 };
70 }, [isPrivacyBlurEnabled, enableScreenProtect, disableScreenProtect]),
71 );
72
73 useEffect(() => {
74 console.log(currentSharedCosigner);
75 if (currentSharedCosigner) {
76 (async function () {
77 if (await confirm(loc.multisig.shared_key_detected, loc.multisig.shared_key_detected_question)) {
78 setImportText(currentSharedCosigner);
79 navigation.navigate('WalletsAddMultisigProvideMnemonicsSheet', {
80 importText: currentSharedCosigner,
81 askPassphrase,
82 });
83 setSharedCosigner('');
84 }
85 })();
86 }
87 // eslint-disable-next-line react-hooks/exhaustive-deps
88 }, [currentSharedCosigner]);
89
90 const handleOnHelpPress = useCallback(() => {
91 navigation.navigate('WalletsAddMultisigHelp');
92 }, [navigation]);
93
94 const stylesHook = StyleSheet.create({
95 root: {
96 backgroundColor: colors.elevated,
97 },
98 });
99
100 useLayoutEffect(() => {
101 navigation.setOptions({
102 // eslint-disable-next-line react/no-unstable-nested-components

Callers

nothing calls this directly

Calls 15

getXpubMethod · 0.95
isValidMethod · 0.95
getAllCosignersMethod · 0.95
getPathMethod · 0.95
getFpMethod · 0.95
useStorageFunction · 0.90
useScreenProtectFunction · 0.90
useThemeFunction · 0.90
useExtendedNavigationFunction · 0.90
useSettingsFunction · 0.90
encodeURFunction · 0.90

Tested by

no test coverage detected