mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 23:08:07 +01:00
wio
This commit is contained in:
parent
70c69eb7ca
commit
bba96e5308
10 changed files with 151 additions and 66 deletions
|
@ -1,2 +1,13 @@
|
||||||
|
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=
|
connection.project.dir=
|
||||||
eclipse.preferences.version=1
|
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
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<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.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
||||||
<classpathentry kind="output" path="bin/default"/>
|
<classpathentry kind="output" path="bin/default"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
4
android/app/.settings/org.eclipse.jdt.core.prefs
Normal file
4
android/app/.settings/org.eclipse.jdt.core.prefs
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
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,8 +117,16 @@ export type Transaction = {
|
||||||
* if known, who is on the other end of the transaction (BIP47 payment code)
|
* if known, who is on the other end of the transaction (BIP47 payment code)
|
||||||
*/
|
*/
|
||||||
counterparty?: string;
|
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
|
* 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
|
* wallet that owns it etc
|
||||||
|
@ -146,4 +154,10 @@ export type TWallet =
|
||||||
| SegwitP2SHWallet
|
| SegwitP2SHWallet
|
||||||
| WatchOnlyWallet;
|
| WatchOnlyWallet;
|
||||||
|
|
||||||
|
export interface TWallet {
|
||||||
|
getID: () => string;
|
||||||
|
getTransactions: () => Transaction[];
|
||||||
|
// ...other wallet methods...
|
||||||
|
}
|
||||||
|
|
||||||
export type THDWalletForWatchOnly = HDSegwitBech32Wallet | HDSegwitP2SHWallet | HDLegacyP2PKHWallet;
|
export type THDWalletForWatchOnly = HDSegwitBech32Wallet | HDSegwitP2SHWallet | HDLegacyP2PKHWallet;
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
import { useContext } from 'react';
|
import { useContext } from 'react';
|
||||||
import { StorageContext } from '../../components/Context/StorageProvider';
|
import { StorageContext } from '../../components/Context/StorageProvider';
|
||||||
|
|
||||||
export const useStorage = () => useContext(StorageContext);
|
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,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
|
@ -13,7 +13,7 @@ PODS:
|
||||||
- hermes-engine/Pre-built (= 0.75.4)
|
- hermes-engine/Pre-built (= 0.75.4)
|
||||||
- hermes-engine/Pre-built (0.75.4)
|
- hermes-engine/Pre-built (0.75.4)
|
||||||
- lottie-ios (4.5.0)
|
- lottie-ios (4.5.0)
|
||||||
- lottie-react-native (7.1.0):
|
- lottie-react-native (7.2.1):
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- glog
|
- glog
|
||||||
- hermes-engine
|
- hermes-engine
|
||||||
|
@ -1613,7 +1613,7 @@ PODS:
|
||||||
- React
|
- React
|
||||||
- RNCAsyncStorage (2.1.0):
|
- RNCAsyncStorage (2.1.0):
|
||||||
- React-Core
|
- React-Core
|
||||||
- RNCClipboard (1.15.0):
|
- RNCClipboard (1.16.0):
|
||||||
- React-Core
|
- React-Core
|
||||||
- RNCPushNotificationIOS (1.11.0):
|
- RNCPushNotificationIOS (1.11.0):
|
||||||
- React-Core
|
- React-Core
|
||||||
|
@ -1623,7 +1623,7 @@ PODS:
|
||||||
- React-Core
|
- React-Core
|
||||||
- RNFS (2.20.0):
|
- RNFS (2.20.0):
|
||||||
- React-Core
|
- React-Core
|
||||||
- RNGestureHandler (2.21.2):
|
- RNGestureHandler (2.22.0):
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- glog
|
- glog
|
||||||
- hermes-engine
|
- hermes-engine
|
||||||
|
@ -1667,7 +1667,7 @@ PODS:
|
||||||
- ReactCommon/turbomodule/bridging
|
- ReactCommon/turbomodule/bridging
|
||||||
- ReactCommon/turbomodule/core
|
- ReactCommon/turbomodule/core
|
||||||
- Yoga
|
- Yoga
|
||||||
- RNLocalize (3.3.0):
|
- RNLocalize (3.4.1):
|
||||||
- React-Core
|
- React-Core
|
||||||
- RNPermissions (5.2.2):
|
- RNPermissions (5.2.2):
|
||||||
- React-Core
|
- React-Core
|
||||||
|
@ -1829,7 +1829,7 @@ PODS:
|
||||||
- ReactCommon/turbomodule/bridging
|
- ReactCommon/turbomodule/bridging
|
||||||
- ReactCommon/turbomodule/core
|
- ReactCommon/turbomodule/core
|
||||||
- Yoga
|
- Yoga
|
||||||
- RNSVG (15.10.1):
|
- RNSVG (15.11.1):
|
||||||
- React-Core
|
- React-Core
|
||||||
- RNVectorIcons (10.2.0):
|
- RNVectorIcons (10.2.0):
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
|
@ -2209,7 +2209,7 @@ SPEC CHECKSUMS:
|
||||||
glog: 69ef571f3de08433d766d614c73a9838a06bf7eb
|
glog: 69ef571f3de08433d766d614c73a9838a06bf7eb
|
||||||
hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0
|
hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0
|
||||||
lottie-ios: a881093fab623c467d3bce374367755c272bdd59
|
lottie-ios: a881093fab623c467d3bce374367755c272bdd59
|
||||||
lottie-react-native: 015e84640c4b8dd47049a8c981996fd203001ddf
|
lottie-react-native: 816fb00189b309b3eee7c152ddfc8d37f56d1865
|
||||||
RCT-Folly: 34124ae2e667a0e5f0ea378db071d27548124321
|
RCT-Folly: 34124ae2e667a0e5f0ea378db071d27548124321
|
||||||
RCTDeprecation: 726d24248aeab6d7180dac71a936bbca6a994ed1
|
RCTDeprecation: 726d24248aeab6d7180dac71a936bbca6a994ed1
|
||||||
RCTRequired: a94e7febda6db0345d207e854323c37e3a31d93b
|
RCTRequired: a94e7febda6db0345d207e854323c37e3a31d93b
|
||||||
|
@ -2280,15 +2280,15 @@ SPEC CHECKSUMS:
|
||||||
ReactNativeCameraKit: e72b838dac4ea2da19b7eb5d00b23125072790fd
|
ReactNativeCameraKit: e72b838dac4ea2da19b7eb5d00b23125072790fd
|
||||||
RealmJS: 9fd51c849eb552ade9f7b11db42a319b4f6cab4c
|
RealmJS: 9fd51c849eb552ade9f7b11db42a319b4f6cab4c
|
||||||
RNCAsyncStorage: c91d753ede6dc21862c4922cd13f98f7cfde578e
|
RNCAsyncStorage: c91d753ede6dc21862c4922cd13f98f7cfde578e
|
||||||
RNCClipboard: dbcf25b8f666b4685c02eeb65be981d30198e505
|
RNCClipboard: d05e3f409b80d63c6507fd5753846e5992057799
|
||||||
RNCPushNotificationIOS: 6c4ca3388c7434e4a662b92e4dfeeee858e6f440
|
RNCPushNotificationIOS: 6c4ca3388c7434e4a662b92e4dfeeee858e6f440
|
||||||
RNDefaultPreference: 8a089ee8ce829a66c5453e3c5434f0785499d1c3
|
RNDefaultPreference: 8a089ee8ce829a66c5453e3c5434f0785499d1c3
|
||||||
RNDeviceInfo: ae26ae45db3f9937f038a284bcd0a1db8d70db96
|
RNDeviceInfo: ae26ae45db3f9937f038a284bcd0a1db8d70db96
|
||||||
RNFS: 89de7d7f4c0f6bafa05343c578f61118c8282ed8
|
RNFS: 89de7d7f4c0f6bafa05343c578f61118c8282ed8
|
||||||
RNGestureHandler: 5b24d10761754ad271b714e536c457fd89b17c54
|
RNGestureHandler: 43970f04f34f186b4a5b2057cbf99c3039753c36
|
||||||
RNHandoff: bc8af5a86853ff13b033e7ba1114c3c5b38e6385
|
RNHandoff: bc8af5a86853ff13b033e7ba1114c3c5b38e6385
|
||||||
RNKeychain: 4df48b5186ca2b6a99f5ead69ad587154e084a32
|
RNKeychain: 4df48b5186ca2b6a99f5ead69ad587154e084a32
|
||||||
RNLocalize: d024afa9204c13885e61dc88b8190651bcaabac9
|
RNLocalize: 15463c4d79c7da45230064b4adcf5e9bb984667e
|
||||||
RNPermissions: 6f08c623b0c8ca7d95faa71c3956b159b34f25c3
|
RNPermissions: 6f08c623b0c8ca7d95faa71c3956b159b34f25c3
|
||||||
RNQrGenerator: 7c604c0eb608af64ff586ab0c040796a04eff247
|
RNQrGenerator: 7c604c0eb608af64ff586ab0c040796a04eff247
|
||||||
RNQuickAction: c2c8f379e614428be0babe4d53a575739667744d
|
RNQuickAction: c2c8f379e614428be0babe4d53a575739667744d
|
||||||
|
@ -2297,7 +2297,7 @@ SPEC CHECKSUMS:
|
||||||
RNReanimated: 000b758cfbcd9c20c15b7ef305f98f036b288feb
|
RNReanimated: 000b758cfbcd9c20c15b7ef305f98f036b288feb
|
||||||
RNScreens: 35bb8e81aeccf111baa0ea01a54231390dbbcfd9
|
RNScreens: 35bb8e81aeccf111baa0ea01a54231390dbbcfd9
|
||||||
RNShare: 6204e6a1987ba3e7c47071ef703e5449a0e3548a
|
RNShare: 6204e6a1987ba3e7c47071ef703e5449a0e3548a
|
||||||
RNSVG: 3421710ac15f4f2dc47e5c122f2c2e4282116830
|
RNSVG: 46769c92d1609e617dbf9326ad8a0cff912d0982
|
||||||
RNVectorIcons: 182892e7d1a2f27b52d3c627eca5d2665a22ee28
|
RNVectorIcons: 182892e7d1a2f27b52d3c627eca5d2665a22ee28
|
||||||
RNWatch: 28fe1f5e0c6410d45fd20925f4796fce05522e3f
|
RNWatch: 28fe1f5e0c6410d45fd20925f4796fce05522e3f
|
||||||
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
|
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
|
||||||
|
|
41
package-lock.json
generated
41
package-lock.json
generated
|
@ -81,6 +81,7 @@
|
||||||
"react-native-permissions": "5.2.2",
|
"react-native-permissions": "5.2.2",
|
||||||
"react-native-prompt-android": "github:BlueWallet/react-native-prompt-android#ed168d66fed556bc2ed07cf498770f058b78a376",
|
"react-native-prompt-android": "github:BlueWallet/react-native-prompt-android#ed168d66fed556bc2ed07cf498770f058b78a376",
|
||||||
"react-native-push-notification": "8.1.1",
|
"react-native-push-notification": "8.1.1",
|
||||||
|
"react-native-qrcode-scanner": "^1.5.5",
|
||||||
"react-native-qrcode-svg": "6.3.2",
|
"react-native-qrcode-svg": "6.3.2",
|
||||||
"react-native-quick-actions": "0.3.13",
|
"react-native-quick-actions": "0.3.13",
|
||||||
"react-native-randombytes": "3.6.1",
|
"react-native-randombytes": "3.6.1",
|
||||||
|
@ -22148,6 +22149,46 @@
|
||||||
"react-native": ">=0.33"
|
"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": {
|
"node_modules/react-native-qrcode-svg": {
|
||||||
"version": "6.3.2",
|
"version": "6.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/react-native-qrcode-svg/-/react-native-qrcode-svg-6.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/react-native-qrcode-svg/-/react-native-qrcode-svg-6.3.2.tgz",
|
||||||
|
|
|
@ -145,6 +145,7 @@
|
||||||
"react-native-permissions": "5.2.2",
|
"react-native-permissions": "5.2.2",
|
||||||
"react-native-prompt-android": "github:BlueWallet/react-native-prompt-android#ed168d66fed556bc2ed07cf498770f058b78a376",
|
"react-native-prompt-android": "github:BlueWallet/react-native-prompt-android#ed168d66fed556bc2ed07cf498770f058b78a376",
|
||||||
"react-native-push-notification": "8.1.1",
|
"react-native-push-notification": "8.1.1",
|
||||||
|
"react-native-qrcode-scanner": "^1.5.5",
|
||||||
"react-native-qrcode-svg": "6.3.2",
|
"react-native-qrcode-svg": "6.3.2",
|
||||||
"react-native-quick-actions": "0.3.13",
|
"react-native-quick-actions": "0.3.13",
|
||||||
"react-native-randombytes": "3.6.1",
|
"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 * as bitcoin from 'bitcoinjs-lib';
|
||||||
import createHash from 'create-hash';
|
import createHash from 'create-hash';
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import { Alert, Platform, StyleSheet, TextInput, TouchableOpacity, View } from 'react-native';
|
import { Platform, StyleSheet, TextInput, TouchableOpacity, View } from 'react-native';
|
||||||
import Base43 from '../../blue_modules/base43';
|
import Base43 from '../../blue_modules/base43';
|
||||||
import * as fs from '../../blue_modules/fs';
|
import * as fs from '../../blue_modules/fs';
|
||||||
import { BlueURDecoder, decodeUR, extractSingleWorkload } from '../../blue_modules/ur';
|
import { BlueURDecoder, decodeUR, extractSingleWorkload } from '../../blue_modules/ur';
|
||||||
|
@ -14,6 +14,8 @@ import { isCameraAuthorizationStatusGranted } from '../../helpers/scan-qr';
|
||||||
import loc from '../../loc';
|
import loc from '../../loc';
|
||||||
import { useSettings } from '../../hooks/context/useSettings';
|
import { useSettings } from '../../hooks/context/useSettings';
|
||||||
import CameraScreen from '../../components/CameraScreen';
|
import CameraScreen from '../../components/CameraScreen';
|
||||||
|
import SafeArea from '../../components/SafeArea';
|
||||||
|
import presentAlert from '../../components/Alert';
|
||||||
|
|
||||||
let decoder = false;
|
let decoder = false;
|
||||||
|
|
||||||
|
@ -120,20 +122,13 @@ const ScanQRCode = () => {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(error);
|
console.warn(error);
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
Alert.alert(
|
presentAlert({
|
||||||
loc.send.scan_error,
|
title: loc.send.scan_error,
|
||||||
loc._.invalid_animated_qr_code_fragment,
|
message: loc._.invalid_animated_qr_code_fragment,
|
||||||
[
|
onPress: () => {
|
||||||
{
|
setIsLoading(false);
|
||||||
text: loc._.ok,
|
},
|
||||||
onPress: () => {
|
});
|
||||||
setIsLoading(false);
|
|
||||||
},
|
|
||||||
style: 'default',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
{ cancelabe: false },
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -170,20 +165,14 @@ const ScanQRCode = () => {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(error);
|
console.warn(error);
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
Alert.alert(
|
|
||||||
loc.send.scan_error,
|
presentAlert({
|
||||||
loc._.invalid_animated_qr_code_fragment,
|
title: loc.send.scan_error,
|
||||||
[
|
message: loc._.invalid_animated_qr_code_fragment,
|
||||||
{
|
onPress: () => {
|
||||||
text: loc._.ok,
|
setIsLoading(false);
|
||||||
onPress: () => {
|
},
|
||||||
setIsLoading(false);
|
});
|
||||||
},
|
|
||||||
style: 'default',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
{ cancelabe: false },
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -272,22 +261,45 @@ const ScanQRCode = () => {
|
||||||
navigation.goBack();
|
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 ? (
|
const render = isLoading ? (
|
||||||
<BlueLoading />
|
<BlueLoading />
|
||||||
) : (
|
) : (
|
||||||
<>
|
<SafeArea>
|
||||||
{!cameraStatusGranted ? (
|
{!cameraStatusGranted ? (
|
||||||
<View style={[styles.openSettingsContainer, stylesHook.openSettingsContainer]}>
|
<View style={[styles.openSettingsContainer, stylesHook.openSettingsContainer]}>
|
||||||
<BlueText>{loc.send.permission_camera_message}</BlueText>
|
<BlueText>{loc.send.permission_camera_message}</BlueText>
|
||||||
<BlueSpacing40 />
|
<BlueSpacing40 />
|
||||||
<Button title={loc.send.open_settings} onPress={openPrivacyDesktopSettings} />
|
<Button title={loc.send.open_settings} onPress={openPrivacyDesktopSettings} />
|
||||||
<BlueSpacing40 />
|
<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} />
|
<Button title={loc._.cancel} onPress={dismiss} />
|
||||||
</View>
|
</View>
|
||||||
) : isFocused ? (
|
) : isFocused ? (
|
||||||
<CameraScreen
|
<CameraScreen
|
||||||
scanBarcode
|
onReadCode={handleReadCode}
|
||||||
onReadCode={event => onBarCodeRead({ data: event?.nativeEvent?.codeStringValue })}
|
|
||||||
showFrame={false}
|
showFrame={false}
|
||||||
showFilePickerButton={showFileImportButton}
|
showFilePickerButton={showFileImportButton}
|
||||||
showImagePickerButton={true}
|
showImagePickerButton={true}
|
||||||
|
@ -320,16 +332,7 @@ const ScanQRCode = () => {
|
||||||
value={backdoorText}
|
value={backdoorText}
|
||||||
onChangeText={setBackdoorText}
|
onChangeText={setBackdoorText}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button title="OK" testID="scanQrBackdoorOkButton" onPress={handleBackdoorOkPress} />
|
||||||
title="OK"
|
|
||||||
testID="scanQrBackdoorOkButton"
|
|
||||||
onPress={() => {
|
|
||||||
setBackdoorVisible(false);
|
|
||||||
setBackdoorText('');
|
|
||||||
|
|
||||||
if (backdoorText) onBarCodeRead({ data: backdoorText });
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
|
@ -337,17 +340,9 @@ const ScanQRCode = () => {
|
||||||
accessibilityLabel={loc._.qr_custom_input_button}
|
accessibilityLabel={loc._.qr_custom_input_button}
|
||||||
testID="ScanQrBackdoorButton"
|
testID="ScanQrBackdoorButton"
|
||||||
style={styles.backdoorButton}
|
style={styles.backdoorButton}
|
||||||
onPress={async () => {
|
onPress={handleInvisibleBackdoorPress}
|
||||||
// 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>;
|
return <View style={styles.root}>{render}</View>;
|
||||||
|
|
|
@ -55,7 +55,9 @@ type WalletTransactionsProps = NativeStackScreenProps<DetailViewStackParamList,
|
||||||
type RouteProps = RouteProp<DetailViewStackParamList, 'WalletTransactions'>;
|
type RouteProps = RouteProp<DetailViewStackParamList, 'WalletTransactions'>;
|
||||||
|
|
||||||
const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
|
const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
|
||||||
const { wallets, saveToDisk, setSelectedWalletID } = useStorage();
|
const { selectedWalletID, wallets, fetchAndSaveWalletTransactions } = useStorage();
|
||||||
|
const [transactions, setTransactions] = useState<Transaction[]>([]);
|
||||||
|
const { saveToDisk, setSelectedWalletID } = useStorage();
|
||||||
const { setReloadTransactionsMenuActionFunction } = useMenuElements();
|
const { setReloadTransactionsMenuActionFunction } = useMenuElements();
|
||||||
const { isBiometricUseCapableAndEnabled } = useBiometrics();
|
const { isBiometricUseCapableAndEnabled } = useBiometrics();
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
Loading…
Add table
Reference in a new issue