MCPcopy
hub / github.com/BlueWallet/BlueWallet / checkAddress

Function checkAddress

screen/settings/IsItMyAddress.tsx:35–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33 };
34
35 const checkAddress = () => {
36 Keyboard.dismiss();
37 const cleanAddress = address.replace('bitcoin:', '').replace('BITCOIN:', '').replace('bitcoin=', '').split('?')[0];
38 const matching: TWallet[] = [];
39
40 for (const w of wallets) {
41 if (w.weOwnAddress(cleanAddress)) {
42 matching.push(w);
43 }
44 }
45
46 if (matching.length > 0) {
47 setMatchingWallets(matching);
48 setResultCleanAddress(cleanAddress);
49 triggerHapticFeedback(HapticFeedbackTypes.NotificationSuccess);
50 } else {
51 triggerHapticFeedback(HapticFeedbackTypes.NotificationError);
52 presentAlert({
53 message: loc.is_it_my_address.no_wallet_owns_address,
54 buttons: [
55 {
56 text: loc.receive.reset,
57 onPress: () => {
58 clearAddressInput();
59 },
60 style: 'destructive',
61 },
62 {
63 text: loc._.ok,
64 onPress: () => {},
65 style: 'cancel',
66 },
67 ],
68 options: { cancelable: true },
69 });
70 setMatchingWallets([]);
71 setResultCleanAddress(undefined);
72 }
73 };
74
75 const importScan = async () => {
76 const value = await scanQrHelper();

Callers

nothing calls this directly

Calls 4

triggerHapticFeedbackFunction · 0.85
clearAddressInputFunction · 0.85
weOwnAddressMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected