mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-18 05:12:47 +01:00
parent
bba96e5308
commit
6193e9bac0
@ -1,13 +1,2 @@
|
||||
arguments=--init-script /var/folders/wp/mctylz615p727_90j3yv0vnc0000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/wp/mctylz615p727_90j3yv0vnc0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
|
||||
auto.sync=false
|
||||
build.scans.enabled=false
|
||||
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
|
||||
connection.project.dir=
|
||||
eclipse.preferences.version=1
|
||||
gradle.user.home=
|
||||
java.home=/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home
|
||||
jvm.arguments=
|
||||
offline.mode=false
|
||||
override.workspace.settings=true
|
||||
show.console.view=true
|
||||
show.executions.view=true
|
||||
eclipse.preferences.version=1
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
||||
<classpathentry kind="output" path="bin/default"/>
|
||||
</classpath>
|
||||
|
@ -1,4 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
|
||||
org.eclipse.jdt.core.compiler.compliance=17
|
||||
org.eclipse.jdt.core.compiler.source=17
|
@ -117,16 +117,8 @@ export type Transaction = {
|
||||
* if known, who is on the other end of the transaction (BIP47 payment code)
|
||||
*/
|
||||
counterparty?: string;
|
||||
memo: string;
|
||||
};
|
||||
|
||||
export interface Transaction {
|
||||
hash: string;
|
||||
memo: string;
|
||||
value: number;
|
||||
// ...other transaction fields...
|
||||
}
|
||||
|
||||
/**
|
||||
* in some cases we add additional data to each tx object so the code that works with that transaction can find the
|
||||
* wallet that owns it etc
|
||||
@ -154,10 +146,4 @@ export type TWallet =
|
||||
| SegwitP2SHWallet
|
||||
| WatchOnlyWallet;
|
||||
|
||||
export interface TWallet {
|
||||
getID: () => string;
|
||||
getTransactions: () => Transaction[];
|
||||
// ...other wallet methods...
|
||||
}
|
||||
|
||||
export type THDWalletForWatchOnly = HDSegwitBech32Wallet | HDSegwitP2SHWallet | HDLegacyP2PKHWallet;
|
||||
|
@ -1,21 +1,4 @@
|
||||
import { useContext } from 'react';
|
||||
import { StorageContext } from '../../components/Context/StorageProvider';
|
||||
|
||||
export const useStorage = () => {
|
||||
const context = useContext(StorageContext);
|
||||
|
||||
const fetchAndSaveWalletTransactions = async (walletID: string) => {
|
||||
// ...existing implementation to fetch and save transactions...
|
||||
};
|
||||
|
||||
const getTransactions = (walletID: string): Transaction[] => {
|
||||
const wallet = wallets.find(w => w.getID() === walletID);
|
||||
return wallet ? wallet.getTransactions() : [];
|
||||
};
|
||||
|
||||
return {
|
||||
...context,
|
||||
fetchAndSaveWalletTransactions,
|
||||
getTransactions,
|
||||
};
|
||||
};
|
||||
export const useStorage = () => useContext(StorageContext);
|
||||
|
@ -13,7 +13,7 @@ PODS:
|
||||
- hermes-engine/Pre-built (= 0.75.4)
|
||||
- hermes-engine/Pre-built (0.75.4)
|
||||
- lottie-ios (4.5.0)
|
||||
- lottie-react-native (7.2.1):
|
||||
- lottie-react-native (7.1.0):
|
||||
- DoubleConversion
|
||||
- glog
|
||||
- hermes-engine
|
||||
@ -1613,7 +1613,7 @@ PODS:
|
||||
- React
|
||||
- RNCAsyncStorage (2.1.0):
|
||||
- React-Core
|
||||
- RNCClipboard (1.16.0):
|
||||
- RNCClipboard (1.15.0):
|
||||
- React-Core
|
||||
- RNCPushNotificationIOS (1.11.0):
|
||||
- React-Core
|
||||
@ -1623,7 +1623,7 @@ PODS:
|
||||
- React-Core
|
||||
- RNFS (2.20.0):
|
||||
- React-Core
|
||||
- RNGestureHandler (2.22.0):
|
||||
- RNGestureHandler (2.21.2):
|
||||
- DoubleConversion
|
||||
- glog
|
||||
- hermes-engine
|
||||
@ -1667,7 +1667,7 @@ PODS:
|
||||
- ReactCommon/turbomodule/bridging
|
||||
- ReactCommon/turbomodule/core
|
||||
- Yoga
|
||||
- RNLocalize (3.4.1):
|
||||
- RNLocalize (3.3.0):
|
||||
- React-Core
|
||||
- RNPermissions (5.2.2):
|
||||
- React-Core
|
||||
@ -1829,7 +1829,7 @@ PODS:
|
||||
- ReactCommon/turbomodule/bridging
|
||||
- ReactCommon/turbomodule/core
|
||||
- Yoga
|
||||
- RNSVG (15.11.1):
|
||||
- RNSVG (15.10.1):
|
||||
- React-Core
|
||||
- RNVectorIcons (10.2.0):
|
||||
- DoubleConversion
|
||||
@ -2209,7 +2209,7 @@ SPEC CHECKSUMS:
|
||||
glog: 69ef571f3de08433d766d614c73a9838a06bf7eb
|
||||
hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0
|
||||
lottie-ios: a881093fab623c467d3bce374367755c272bdd59
|
||||
lottie-react-native: 816fb00189b309b3eee7c152ddfc8d37f56d1865
|
||||
lottie-react-native: 015e84640c4b8dd47049a8c981996fd203001ddf
|
||||
RCT-Folly: 34124ae2e667a0e5f0ea378db071d27548124321
|
||||
RCTDeprecation: 726d24248aeab6d7180dac71a936bbca6a994ed1
|
||||
RCTRequired: a94e7febda6db0345d207e854323c37e3a31d93b
|
||||
@ -2280,15 +2280,15 @@ SPEC CHECKSUMS:
|
||||
ReactNativeCameraKit: e72b838dac4ea2da19b7eb5d00b23125072790fd
|
||||
RealmJS: 9fd51c849eb552ade9f7b11db42a319b4f6cab4c
|
||||
RNCAsyncStorage: c91d753ede6dc21862c4922cd13f98f7cfde578e
|
||||
RNCClipboard: d05e3f409b80d63c6507fd5753846e5992057799
|
||||
RNCClipboard: dbcf25b8f666b4685c02eeb65be981d30198e505
|
||||
RNCPushNotificationIOS: 6c4ca3388c7434e4a662b92e4dfeeee858e6f440
|
||||
RNDefaultPreference: 8a089ee8ce829a66c5453e3c5434f0785499d1c3
|
||||
RNDeviceInfo: ae26ae45db3f9937f038a284bcd0a1db8d70db96
|
||||
RNFS: 89de7d7f4c0f6bafa05343c578f61118c8282ed8
|
||||
RNGestureHandler: 43970f04f34f186b4a5b2057cbf99c3039753c36
|
||||
RNGestureHandler: 5b24d10761754ad271b714e536c457fd89b17c54
|
||||
RNHandoff: bc8af5a86853ff13b033e7ba1114c3c5b38e6385
|
||||
RNKeychain: 4df48b5186ca2b6a99f5ead69ad587154e084a32
|
||||
RNLocalize: 15463c4d79c7da45230064b4adcf5e9bb984667e
|
||||
RNLocalize: d024afa9204c13885e61dc88b8190651bcaabac9
|
||||
RNPermissions: 6f08c623b0c8ca7d95faa71c3956b159b34f25c3
|
||||
RNQrGenerator: 7c604c0eb608af64ff586ab0c040796a04eff247
|
||||
RNQuickAction: c2c8f379e614428be0babe4d53a575739667744d
|
||||
@ -2297,7 +2297,7 @@ SPEC CHECKSUMS:
|
||||
RNReanimated: 000b758cfbcd9c20c15b7ef305f98f036b288feb
|
||||
RNScreens: 35bb8e81aeccf111baa0ea01a54231390dbbcfd9
|
||||
RNShare: 6204e6a1987ba3e7c47071ef703e5449a0e3548a
|
||||
RNSVG: 46769c92d1609e617dbf9326ad8a0cff912d0982
|
||||
RNSVG: 3421710ac15f4f2dc47e5c122f2c2e4282116830
|
||||
RNVectorIcons: 182892e7d1a2f27b52d3c627eca5d2665a22ee28
|
||||
RNWatch: 28fe1f5e0c6410d45fd20925f4796fce05522e3f
|
||||
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
|
||||
|
41
package-lock.json
generated
41
package-lock.json
generated
@ -81,7 +81,6 @@
|
||||
"react-native-permissions": "5.2.2",
|
||||
"react-native-prompt-android": "github:BlueWallet/react-native-prompt-android#ed168d66fed556bc2ed07cf498770f058b78a376",
|
||||
"react-native-push-notification": "8.1.1",
|
||||
"react-native-qrcode-scanner": "^1.5.5",
|
||||
"react-native-qrcode-svg": "6.3.2",
|
||||
"react-native-quick-actions": "0.3.13",
|
||||
"react-native-randombytes": "3.6.1",
|
||||
@ -22149,46 +22148,6 @@
|
||||
"react-native": ">=0.33"
|
||||
}
|
||||
},
|
||||
"node_modules/react-native-qrcode-scanner": {
|
||||
"version": "1.5.5",
|
||||
"resolved": "https://registry.npmjs.org/react-native-qrcode-scanner/-/react-native-qrcode-scanner-1.5.5.tgz",
|
||||
"integrity": "sha512-il79uStkFqUvofqXJQfOL30qgQyU17MUKxj7IGHv6oT2OxIY/vutTwuPPDbsivtv0yTMHP4dGx/79oys4eAuNw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@react-native-async-storage/async-storage": "^1.13.4",
|
||||
"prop-types": "^15.5.10",
|
||||
"react-native-permissions": "^2.0.2"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/react-native-qrcode-scanner"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react-native-camera": ">=1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/react-native-qrcode-scanner/node_modules/@react-native-async-storage/async-storage": {
|
||||
"version": "1.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.24.0.tgz",
|
||||
"integrity": "sha512-W4/vbwUOYOjco0x3toB8QCr7EjIP6nE9G7o8PMguvvjYT5Awg09lyV4enACRx4s++PPulBiBSjL0KTFx2u0Z/g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"merge-options": "^3.0.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react-native": "^0.0.0-0 || >=0.60 <1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-native-qrcode-scanner/node_modules/react-native-permissions": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-2.2.2.tgz",
|
||||
"integrity": "sha512-ihf4shQDSX5Oo9ChQXb9kr13mmyyNem5MaEvOpr3dCjhBOBWyEMztXm9/uPK1Qg5PsNpaYLa1KpcPZDCw87LXg==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.6",
|
||||
"react-native": ">=0.60.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-native-qrcode-svg": {
|
||||
"version": "6.3.2",
|
||||
"resolved": "https://registry.npmjs.org/react-native-qrcode-svg/-/react-native-qrcode-svg-6.3.2.tgz",
|
||||
|
@ -145,7 +145,6 @@
|
||||
"react-native-permissions": "5.2.2",
|
||||
"react-native-prompt-android": "github:BlueWallet/react-native-prompt-android#ed168d66fed556bc2ed07cf498770f058b78a376",
|
||||
"react-native-push-notification": "8.1.1",
|
||||
"react-native-qrcode-scanner": "^1.5.5",
|
||||
"react-native-qrcode-svg": "6.3.2",
|
||||
"react-native-quick-actions": "0.3.13",
|
||||
"react-native-randombytes": "3.6.1",
|
||||
|
@ -2,7 +2,7 @@ import { useFocusEffect, useIsFocused, useNavigation, useRoute } from '@react-na
|
||||
import * as bitcoin from 'bitcoinjs-lib';
|
||||
import createHash from 'create-hash';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { Platform, StyleSheet, TextInput, TouchableOpacity, View } from 'react-native';
|
||||
import { Alert, Platform, StyleSheet, TextInput, TouchableOpacity, View } from 'react-native';
|
||||
import Base43 from '../../blue_modules/base43';
|
||||
import * as fs from '../../blue_modules/fs';
|
||||
import { BlueURDecoder, decodeUR, extractSingleWorkload } from '../../blue_modules/ur';
|
||||
@ -14,8 +14,6 @@ import { isCameraAuthorizationStatusGranted } from '../../helpers/scan-qr';
|
||||
import loc from '../../loc';
|
||||
import { useSettings } from '../../hooks/context/useSettings';
|
||||
import CameraScreen from '../../components/CameraScreen';
|
||||
import SafeArea from '../../components/SafeArea';
|
||||
import presentAlert from '../../components/Alert';
|
||||
|
||||
let decoder = false;
|
||||
|
||||
@ -122,13 +120,20 @@ const ScanQRCode = () => {
|
||||
} catch (error) {
|
||||
console.warn(error);
|
||||
setIsLoading(true);
|
||||
presentAlert({
|
||||
title: loc.send.scan_error,
|
||||
message: loc._.invalid_animated_qr_code_fragment,
|
||||
onPress: () => {
|
||||
setIsLoading(false);
|
||||
},
|
||||
});
|
||||
Alert.alert(
|
||||
loc.send.scan_error,
|
||||
loc._.invalid_animated_qr_code_fragment,
|
||||
[
|
||||
{
|
||||
text: loc._.ok,
|
||||
onPress: () => {
|
||||
setIsLoading(false);
|
||||
},
|
||||
style: 'default',
|
||||
},
|
||||
],
|
||||
{ cancelabe: false },
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -165,14 +170,20 @@ const ScanQRCode = () => {
|
||||
} catch (error) {
|
||||
console.warn(error);
|
||||
setIsLoading(true);
|
||||
|
||||
presentAlert({
|
||||
title: loc.send.scan_error,
|
||||
message: loc._.invalid_animated_qr_code_fragment,
|
||||
onPress: () => {
|
||||
setIsLoading(false);
|
||||
},
|
||||
});
|
||||
Alert.alert(
|
||||
loc.send.scan_error,
|
||||
loc._.invalid_animated_qr_code_fragment,
|
||||
[
|
||||
{
|
||||
text: loc._.ok,
|
||||
onPress: () => {
|
||||
setIsLoading(false);
|
||||
},
|
||||
style: 'default',
|
||||
},
|
||||
],
|
||||
{ cancelabe: false },
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -261,45 +272,22 @@ const ScanQRCode = () => {
|
||||
navigation.goBack();
|
||||
};
|
||||
|
||||
const handleReadCode = event => {
|
||||
onBarCodeRead({ data: event?.nativeEvent?.codeStringValue });
|
||||
};
|
||||
|
||||
const handleBackdoorOkPress = () => {
|
||||
setBackdoorVisible(false);
|
||||
setBackdoorText('');
|
||||
if (backdoorText) onBarCodeRead({ data: backdoorText });
|
||||
};
|
||||
|
||||
// this is an invisible backdoor button on bottom left screen corner
|
||||
// tapping it 10 times fires prompt dialog asking for a string thats gona be passed to onBarCodeRead.
|
||||
// this allows to mock and test QR scanning in e2e tests
|
||||
const handleInvisibleBackdoorPress = async () => {
|
||||
setBackdoorPressed(backdoorPressed + 1);
|
||||
if (backdoorPressed < 5) return;
|
||||
setBackdoorPressed(0);
|
||||
setBackdoorVisible(true);
|
||||
};
|
||||
|
||||
const render = isLoading ? (
|
||||
<BlueLoading />
|
||||
) : (
|
||||
<SafeArea>
|
||||
<>
|
||||
{!cameraStatusGranted ? (
|
||||
<View style={[styles.openSettingsContainer, stylesHook.openSettingsContainer]}>
|
||||
<BlueText>{loc.send.permission_camera_message}</BlueText>
|
||||
<BlueSpacing40 />
|
||||
<Button title={loc.send.open_settings} onPress={openPrivacyDesktopSettings} />
|
||||
<BlueSpacing40 />
|
||||
{showFileImportButton && <Button title={loc.wallets.import_file} onPress={showFilePicker} />}
|
||||
<BlueSpacing40 />
|
||||
<Button title={loc.wallets.list_long_choose} onPress={showFilePicker} />
|
||||
<BlueSpacing40 />
|
||||
<Button title={loc._.cancel} onPress={dismiss} />
|
||||
</View>
|
||||
) : isFocused ? (
|
||||
<CameraScreen
|
||||
onReadCode={handleReadCode}
|
||||
scanBarcode
|
||||
onReadCode={event => onBarCodeRead({ data: event?.nativeEvent?.codeStringValue })}
|
||||
showFrame={false}
|
||||
showFilePickerButton={showFileImportButton}
|
||||
showImagePickerButton={true}
|
||||
@ -332,7 +320,16 @@ const ScanQRCode = () => {
|
||||
value={backdoorText}
|
||||
onChangeText={setBackdoorText}
|
||||
/>
|
||||
<Button title="OK" testID="scanQrBackdoorOkButton" onPress={handleBackdoorOkPress} />
|
||||
<Button
|
||||
title="OK"
|
||||
testID="scanQrBackdoorOkButton"
|
||||
onPress={() => {
|
||||
setBackdoorVisible(false);
|
||||
setBackdoorText('');
|
||||
|
||||
if (backdoorText) onBarCodeRead({ data: backdoorText });
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
<TouchableOpacity
|
||||
@ -340,9 +337,17 @@ const ScanQRCode = () => {
|
||||
accessibilityLabel={loc._.qr_custom_input_button}
|
||||
testID="ScanQrBackdoorButton"
|
||||
style={styles.backdoorButton}
|
||||
onPress={handleInvisibleBackdoorPress}
|
||||
onPress={async () => {
|
||||
// this is an invisible backdoor button on bottom left screen corner
|
||||
// tapping it 10 times fires prompt dialog asking for a string thats gona be passed to onBarCodeRead.
|
||||
// this allows to mock and test QR scanning in e2e tests
|
||||
setBackdoorPressed(backdoorPressed + 1);
|
||||
if (backdoorPressed < 5) return;
|
||||
setBackdoorPressed(0);
|
||||
setBackdoorVisible(true);
|
||||
}}
|
||||
/>
|
||||
</SafeArea>
|
||||
</>
|
||||
);
|
||||
|
||||
return <View style={styles.root}>{render}</View>;
|
||||
|
@ -55,9 +55,7 @@ type WalletTransactionsProps = NativeStackScreenProps<DetailViewStackParamList,
|
||||
type RouteProps = RouteProp<DetailViewStackParamList, 'WalletTransactions'>;
|
||||
|
||||
const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
|
||||
const { selectedWalletID, wallets, fetchAndSaveWalletTransactions } = useStorage();
|
||||
const [transactions, setTransactions] = useState<Transaction[]>([]);
|
||||
const { saveToDisk, setSelectedWalletID } = useStorage();
|
||||
const { wallets, saveToDisk, setSelectedWalletID } = useStorage();
|
||||
const { setReloadTransactionsMenuActionFunction } = useMenuElements();
|
||||
const { isBiometricUseCapableAndEnabled } = useBiometrics();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
Loading…
Reference in New Issue
Block a user