()
| 23 | import { CreateTransactionTarget } from '../../class/wallets/types'; |
| 24 | |
| 25 | const SendCreate = () => { |
| 26 | const { |
| 27 | fee, |
| 28 | recipients, |
| 29 | memo = '', |
| 30 | satoshiPerByte, |
| 31 | psbt, |
| 32 | showAnimatedQr, |
| 33 | tx, |
| 34 | } = useRoute<RouteProp<SendDetailsStackParamList, 'CreateTransaction'>>().params; |
| 35 | const transaction = bitcoin.Transaction.fromHex(tx); |
| 36 | const size = transaction.virtualSize(); |
| 37 | const { isPrivacyBlurEnabled } = useSettings(); |
| 38 | const { colors } = useTheme(); |
| 39 | const { setOptions } = useNavigation(); |
| 40 | |
| 41 | const styleHooks = StyleSheet.create({ |
| 42 | transactionDetailsTitle: { |
| 43 | color: colors.feeText, |
| 44 | }, |
| 45 | transactionDetailsSubtitle: { |
| 46 | color: colors.foregroundColor, |
| 47 | }, |
| 48 | separator: { |
| 49 | backgroundColor: colors.inputBorderColor, |
| 50 | }, |
| 51 | root: { |
| 52 | backgroundColor: colors.elevated, |
| 53 | }, |
| 54 | cardText: { |
| 55 | color: colors.foregroundColor, |
| 56 | }, |
| 57 | }); |
| 58 | |
| 59 | const { enableScreenProtect, disableScreenProtect } = useScreenProtect(); |
| 60 | |
| 61 | useEffect(() => { |
| 62 | console.log('send/create - useEffect'); |
| 63 | if (isPrivacyBlurEnabled) { |
| 64 | enableScreenProtect(); |
| 65 | } |
| 66 | return () => { |
| 67 | disableScreenProtect(); |
| 68 | }; |
| 69 | }, [isPrivacyBlurEnabled, enableScreenProtect, disableScreenProtect]); |
| 70 | |
| 71 | const exportTXN = useCallback(async () => { |
| 72 | const fileName = `${Date.now()}.txn`; |
| 73 | if (Platform.OS === 'ios') { |
| 74 | const filePath = RNFS.TemporaryDirectoryPath + `/${fileName}`; |
| 75 | await RNFS.writeFile(filePath, tx); |
| 76 | Share.open({ |
| 77 | url: 'file://' + filePath, |
| 78 | saveToFiles: isDesktop, |
| 79 | }) |
| 80 | .catch(error => { |
| 81 | console.log(error); |
| 82 | }) |
nothing calls this directly
no test coverage detected