MCPcopy
hub / github.com/BlueWallet/BlueWallet / showWallet

Function showWallet

components/DevMenu.tsx:25–63  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

23 const filteredWallets = filterFn ? wallets.filter(filterFn) : wallets;
24
25 const showWallet = (index: number) => {
26 if (index >= filteredWallets.length) return;
27 const wallet = filteredWallets[index];
28
29 if (Platform.OS === 'android') {
30 // Android: Use a limited number of buttons since the alert dialog has a limit
31 Alert.alert(
32 `${title}: ${wallet.getLabel()}`,
33 `${message}\n\nSelected Wallet: ${wallet.getLabel()}\n\nWould you like to select this wallet or see the next one?`,
34 [
35 {
36 text: 'Select This Wallet',
37 onPress: () => onWalletSelected(wallet),
38 },
39 {
40 text: 'Show Next Wallet',
41 onPress: () => showWallet(index + 1),
42 },
43 {
44 text: 'Cancel',
45 style: 'cancel',
46 },
47 ],
48 { cancelable: true },
49 );
50 } else {
51 const options: AlertButton[] = filteredWallets.map(w => ({
52 text: w.getLabel(),
53 onPress: () => onWalletSelected(w),
54 }));
55
56 options.push({
57 text: 'Cancel',
58 style: 'cancel',
59 });
60
61 Alert.alert(title, message, options, { cancelable: true });
62 }
63 };
64
65 if (filteredWallets.length > 0) {
66 showWallet(0);

Callers 1

Calls 2

getLabelMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected