mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-23 07:15:35 +01:00
Merge branch 'master' into limpbrains-cc
This commit is contained in:
commit
11dfee5124
14 changed files with 90 additions and 46 deletions
|
@ -1644,7 +1644,13 @@ export const BlueTransactionListItem = React.memo(({ item, itemPriceUnit = Bitco
|
|||
[colors.lightBorder],
|
||||
);
|
||||
|
||||
const title = useMemo(() => transactionTimeToReadable(item.received), [item.received]);
|
||||
const title = useMemo(() => {
|
||||
if (item.confirmations === 0) {
|
||||
return loc.transactions.pending;
|
||||
} else {
|
||||
return transactionTimeToReadable(item.received);
|
||||
}
|
||||
}, [item.confirmations, item.received]);
|
||||
const txMemo = txMetadata[item.hash]?.memo ?? '';
|
||||
const subtitle = useMemo(() => {
|
||||
let sub = item.confirmations < 7 ? loc.formatString(loc.transactions.list_conf, { number: item.confirmations }) : '';
|
||||
|
|
|
@ -349,7 +349,7 @@ PODS:
|
|||
- React
|
||||
- RNCAsyncStorage (1.12.1):
|
||||
- React-Core
|
||||
- RNCClipboard (1.4.0):
|
||||
- RNCClipboard (1.5.0):
|
||||
- React-Core
|
||||
- RNCMaskedView (0.1.10):
|
||||
- React
|
||||
|
@ -719,7 +719,7 @@ SPEC CHECKSUMS:
|
|||
RealmJS: 899b4839a8bee46e248bc277995ad58da855e41f
|
||||
RemobileReactNativeQrcodeLocalImage: 57aadc12896b148fb5e04bc7c6805f3565f5c3fa
|
||||
RNCAsyncStorage: cb9a623793918c6699586281f0b51cbc38f046f9
|
||||
RNCClipboard: ce9b77f2881948e9e04af84bd70262ab37adb1c1
|
||||
RNCClipboard: 8f9f12fabf3c06e976f19f87a62c89e28dfedfca
|
||||
RNCMaskedView: f5c7d14d6847b7b44853f7acb6284c1da30a3459
|
||||
RNCPushNotificationIOS: eaf01f848a0b872b194d31bcad94bb864299e01e
|
||||
RNDefaultPreference: 21816c0a6f61a2829ccc0cef034392e9b509ee5f
|
||||
|
|
|
@ -35,7 +35,8 @@ struct WalletData {
|
|||
var balance: Double
|
||||
var latestTransactionTime: Int = 0
|
||||
var formattedBalanceBTC: String {
|
||||
return "\(balance / 100000000) BTC"
|
||||
let value = NSNumber(value: balance / 100000000);
|
||||
return "\(value.decimalValue) BTC"
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,9 +36,8 @@ extension WidgetAPI {
|
|||
if let response = String(bytes: data, encoding: .utf8), let nextBlockResponse = response.components(separatedBy: #"result":"#).last?.components(separatedBy: ",").first, let nextBlockResponseDouble = Double(nextBlockResponse.filter({characterSet.contains($0)}).trimmingCharacters(in: .whitespacesAndNewlines)) {
|
||||
print("Successfully obtained response from Electrum sever")
|
||||
print(userElectrumSettings)
|
||||
let marketData = MarketData(nextBlock: String(format: "%.0f", (nextBlockResponseDouble / 1024) * 100000000), sats: "0", price: "0", rate: 0)
|
||||
client.close()
|
||||
completion(MarketData(nextBlock: String(format: "%.0f", (nextBlockResponseDouble / 1024) * 100000000), sats: "0", price: "0", rate: 0), nil)
|
||||
let marketData = MarketData(nextBlock: String(format: "%.0f", (nextBlockResponseDouble / 1024) * 100000000), sats: "0", price: "0", rate: 0)
|
||||
completion(marketData, nil)
|
||||
} else {
|
||||
client.close()
|
||||
|
|
|
@ -310,8 +310,9 @@
|
|||
"details_title": "Transaction",
|
||||
"details_to": "Output",
|
||||
"details_transaction_details": "Transaction details",
|
||||
"enable_hw": "This wallet is not being used in conjunction with a hardwarde wallet. Would you like to enable hardware wallet use?",
|
||||
"enable_hw": "This wallet is not being used in conjunction with a hardware wallet. Would you like to enable hardware wallet use?",
|
||||
"list_conf": "conf: {number}",
|
||||
"pending": "Pending",
|
||||
"list_title": "transactions",
|
||||
"rbf_explain": "We will replace this transaction with the one with a higher fee, so it should be mined faster. This is called RBF - Replace By Fee.",
|
||||
"rbf_title": "Bump fee (RBF)",
|
||||
|
|
6
package-lock.json
generated
6
package-lock.json
generated
|
@ -6316,9 +6316,9 @@
|
|||
"integrity": "sha512-ael2f1onoPF3vF7YqHGWy7NnafzGu+yp88BbFbP0ydoCP2xGSUzmZVw0zakPTC040Id+JQ9WeFczujMkDy6jYQ=="
|
||||
},
|
||||
"@react-native-community/clipboard": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@react-native-community/clipboard/-/clipboard-1.4.0.tgz",
|
||||
"integrity": "sha512-71P3SgbWxwzQo/i+tHospcLdvjF9iMlPxgjWP2LgIMDY0gbwuSrtYtdnxaCraZ0S/K7FiBI7SmUrY8kl2lTDVg=="
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@react-native-community/clipboard/-/clipboard-1.5.0.tgz",
|
||||
"integrity": "sha512-XoujTQuXhPgQLVLn7HPt7615jBEGzJm1Nhos0COdreBIz3qWIi5noYZth8jBFctf8FG5tpe24XTZNDz5udgqQQ=="
|
||||
},
|
||||
"@react-native-community/eslint-config": {
|
||||
"version": "2.0.0",
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
"@babel/preset-env": "7.12.1",
|
||||
"@react-native-community/async-storage": "1.12.1",
|
||||
"@react-native-community/blur": "3.6.0",
|
||||
"@react-native-community/clipboard": "1.4.0",
|
||||
"@react-native-community/clipboard": "1.5.0",
|
||||
"@react-native-community/geolocation": "2.0.2",
|
||||
"@react-native-community/masked-view": "0.1.10",
|
||||
"@react-native-community/push-notification-ios": "1.7.1",
|
||||
|
|
|
@ -1,5 +1,15 @@
|
|||
import React, { useState, useRef, useEffect, useContext } from 'react';
|
||||
import { Keyboard, KeyboardAvoidingView, Platform, StatusBar, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
||||
import {
|
||||
Keyboard,
|
||||
KeyboardAvoidingView,
|
||||
Platform,
|
||||
StatusBar,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
useWindowDimensions,
|
||||
View,
|
||||
} from 'react-native';
|
||||
import LottieView from 'lottie-react-native';
|
||||
import { Icon } from 'react-native-elements';
|
||||
import { BlueButton, BlueListItem, BlueNavigationStyle, BlueSpacing20 } from '../../BlueComponents';
|
||||
|
@ -21,6 +31,8 @@ const WalletsAddMultisig = () => {
|
|||
const [format, setFormat] = useState(MultisigHDWallet.FORMAT_P2WSH);
|
||||
const { isAdancedModeEnabled } = useContext(BlueStorageContext);
|
||||
const [isAdvancedModeEnabledRender, setIsAdvancedModeEnabledRender] = useState(false);
|
||||
const windowHeight = useWindowDimensions().height;
|
||||
const windowWidth = useWindowDimensions().width;
|
||||
|
||||
const stylesHook = StyleSheet.create({
|
||||
root: {
|
||||
|
@ -101,6 +113,8 @@ const WalletsAddMultisig = () => {
|
|||
Keyboard.dismiss();
|
||||
setIsModalVisible(false);
|
||||
}}
|
||||
deviceHeight={windowHeight}
|
||||
deviceWidth={windowWidth}
|
||||
>
|
||||
<KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'position' : null}>
|
||||
<View style={[styles.modalContentShort, stylesHook.modalContentShort]}>
|
||||
|
|
|
@ -11,6 +11,7 @@ import {
|
|||
StyleSheet,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
useWindowDimensions,
|
||||
View,
|
||||
} from 'react-native';
|
||||
import {
|
||||
|
@ -53,6 +54,8 @@ const staticCache = {};
|
|||
const WalletsAddMultisigStep2 = () => {
|
||||
const { addWallet, saveToDisk, setNewWalletAdded } = useContext(BlueStorageContext);
|
||||
const { colors } = useTheme();
|
||||
const windowHeight = useWindowDimensions().height;
|
||||
const windowWidth = useWindowDimensions().width;
|
||||
|
||||
const navigation = useNavigation();
|
||||
const { m, n, format } = useRoute().params;
|
||||
|
@ -393,7 +396,7 @@ const WalletsAddMultisigStep2 = () => {
|
|||
checked={isChecked}
|
||||
rightButton={{
|
||||
disabled: vaultKeyData.isLoading,
|
||||
text: loc.multisig.view_key,
|
||||
text: loc.multisig.share,
|
||||
onPress: () => {
|
||||
viewKey(cosigners[el.index]);
|
||||
},
|
||||
|
@ -497,7 +500,13 @@ const WalletsAddMultisigStep2 = () => {
|
|||
|
||||
const renderMnemonicsModal = () => {
|
||||
return (
|
||||
<Modal isVisible={isMnemonicsModalVisible} style={styles.bottomModal} onBackdropPress={Keyboard.dismiss}>
|
||||
<Modal
|
||||
deviceHeight={windowHeight}
|
||||
deviceWidth={windowWidth}
|
||||
isVisible={isMnemonicsModalVisible}
|
||||
style={styles.bottomModal}
|
||||
onBackdropPress={Keyboard.dismiss}
|
||||
>
|
||||
<View style={[styles.newKeyModalContent, stylesHook.modalContent]}>
|
||||
<View style={styles.itemKeyUnprovidedWrapper}>
|
||||
<View style={[styles.vaultKeyCircleSuccess, stylesHook.vaultKeyCircleSuccess]}>
|
||||
|
@ -525,6 +534,8 @@ const WalletsAddMultisigStep2 = () => {
|
|||
const renderProvideMnemonicsModal = () => {
|
||||
return (
|
||||
<Modal
|
||||
deviceHeight={windowHeight}
|
||||
deviceWidth={windowWidth}
|
||||
isVisible={isProvideMnemonicsModalVisible}
|
||||
style={styles.bottomModal}
|
||||
onBackdropPress={() => {
|
||||
|
@ -559,6 +570,8 @@ const WalletsAddMultisigStep2 = () => {
|
|||
const renderCosignersXpubModal = () => {
|
||||
return (
|
||||
<Modal
|
||||
deviceHeight={windowHeight}
|
||||
deviceWidth={windowWidth}
|
||||
isVisible={isRenderCosignersXpubModalVisible}
|
||||
style={styles.bottomModal}
|
||||
onBackdropPress={() => {
|
||||
|
@ -619,7 +632,7 @@ const WalletsAddMultisigStep2 = () => {
|
|||
const styles = StyleSheet.create({
|
||||
root: {
|
||||
flex: 1,
|
||||
marginHorizontal: 20,
|
||||
paddingHorizontal: 20,
|
||||
},
|
||||
mainBlock: {
|
||||
height: '100%',
|
||||
|
|
|
@ -475,7 +475,7 @@ const WalletDetails = () => {
|
|||
<BlueSpacing20 />
|
||||
<BlueSpacing20 />
|
||||
<TouchableOpacity onPress={handleDeleteButtonTapped}>
|
||||
<Text style={styles.delete}>{loc.wallets.details_delete}</Text>
|
||||
<Text textBreakStrategy="simple" style={styles.delete}>{`${loc.wallets.details_delete}${' '}`}</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</BlueCard>
|
||||
|
|
|
@ -193,7 +193,9 @@ const WalletsList = () => {
|
|||
const style = { opacity: isLoading ? 1.0 : 0.5 };
|
||||
return (
|
||||
<View style={[styles.listHeaderBack, stylesHook.listHeaderBack]}>
|
||||
<Text style={[styles.listHeaderText, stylesHook.listHeaderText]}>{loc.transactions.list_title}</Text>
|
||||
<Text textBreakStrategy="simple" style={[styles.listHeaderText, stylesHook.listHeaderText]}>
|
||||
{`${loc.transactions.list_title}${' '}`}
|
||||
</Text>
|
||||
{isDesktop && (
|
||||
<TouchableOpacity style={style} onPress={refreshTransactions} disabled={isLoading}>
|
||||
<Icon name="refresh" type="font-awesome" color={colors.feeText} />
|
||||
|
|
|
@ -117,7 +117,19 @@ Coin.propTypes = {
|
|||
|
||||
const Dice = ({ push, sides }) => {
|
||||
const { width } = useWindowDimensions();
|
||||
const { colors } = useTheme();
|
||||
const diceWidth = width / 4;
|
||||
const stylesHook = StyleSheet.create({
|
||||
dice: {
|
||||
borderColor: colors.buttonBackgroundColor,
|
||||
},
|
||||
diceText: {
|
||||
color: colors.foregroundColor,
|
||||
},
|
||||
diceContainer: {
|
||||
backgroundColor: colors.elevated,
|
||||
},
|
||||
});
|
||||
const diceIcon = i => {
|
||||
switch (i) {
|
||||
case 1:
|
||||
|
@ -136,15 +148,15 @@ const Dice = ({ push, sides }) => {
|
|||
};
|
||||
|
||||
return (
|
||||
<ScrollView contentContainerStyle={styles.diceContainer}>
|
||||
<ScrollView contentContainerStyle={[styles.diceContainer, stylesHook.diceContainer]}>
|
||||
{[...Array(sides)].map((_, i) => (
|
||||
<TouchableOpacity key={i} onPress={() => push(getEntropy(i, sides))}>
|
||||
<View style={[styles.diceRoot, { width: diceWidth }]}>
|
||||
{sides === 6 ? (
|
||||
<Icon style={styles.diceIcon} name={diceIcon(i + 1)} size={70} color="grey" type="font-awesome-5" />
|
||||
) : (
|
||||
<View style={styles.dice}>
|
||||
<Text style={styles.diceText}>{i + 1}</Text>
|
||||
<View style={[styles.dice, stylesHook.dice]}>
|
||||
<Text style={stylesHook.diceText}>{i + 1}</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
|
@ -164,13 +176,13 @@ const buttonFontSize =
|
|||
? 22
|
||||
: PixelRatio.roundToNearestPixel(Dimensions.get('window').width / 26);
|
||||
|
||||
const Buttons = ({ pop, save }) => (
|
||||
const Buttons = ({ pop, save, colors }) => (
|
||||
<FContainer>
|
||||
<FButton
|
||||
onPress={pop}
|
||||
icon={
|
||||
<View style={styles.buttonsIcon}>
|
||||
<Icon name="undo" size={buttonFontSize} type="font-awesome" color={BlueCurrentTheme.colors.buttonAlternativeTextColor} />
|
||||
<Icon name="undo" size={buttonFontSize} type="font-awesome" color={colors.buttonAlternativeTextColor} />
|
||||
</View>
|
||||
}
|
||||
text={loc.entropy.undo}
|
||||
|
@ -179,7 +191,7 @@ const Buttons = ({ pop, save }) => (
|
|||
onPress={save}
|
||||
icon={
|
||||
<View style={styles.buttonsIcon}>
|
||||
<Icon name="arrow-down" size={buttonFontSize} type="font-awesome" color={BlueCurrentTheme.colors.buttonAlternativeTextColor} />
|
||||
<Icon name="arrow-down" size={buttonFontSize} type="font-awesome" color={colors.buttonAlternativeTextColor} />
|
||||
</View>
|
||||
}
|
||||
text={loc.entropy.save}
|
||||
|
@ -190,6 +202,7 @@ const Buttons = ({ pop, save }) => (
|
|||
Buttons.propTypes = {
|
||||
pop: PropTypes.func.isRequired,
|
||||
save: PropTypes.func.isRequired,
|
||||
colors: PropTypes.shape.isRequired,
|
||||
};
|
||||
|
||||
const Entropy = () => {
|
||||
|
@ -199,6 +212,17 @@ const Entropy = () => {
|
|||
const [tab, setTab] = useState(1);
|
||||
const [show, setShow] = useState(false);
|
||||
const { colors } = useTheme();
|
||||
const stylesHook = StyleSheet.create({
|
||||
entropy: {
|
||||
backgroundColor: colors.inputBackgroundColor,
|
||||
},
|
||||
entropyText: {
|
||||
color: colors.foregroundColor,
|
||||
},
|
||||
coinBody: {
|
||||
borderColor: colors.lightButton,
|
||||
},
|
||||
});
|
||||
|
||||
const push = v => v && dispatch({ type: 'push', value: v.value, bits: v.bits });
|
||||
const pop = () => dispatch({ type: 'pop' });
|
||||
|
@ -216,8 +240,8 @@ const Entropy = () => {
|
|||
<SafeBlueArea>
|
||||
<BlueSpacing20 />
|
||||
<TouchableOpacity onPress={() => setShow(!show)}>
|
||||
<View style={styles.entropy}>
|
||||
<Text style={styles.entropyText}>{show ? hex : `${bits} of 256 bits`}</Text>
|
||||
<View style={[styles.entropy, stylesHook.entropy]}>
|
||||
<Text style={[styles.entropyText, stylesHook.entropyText]}>{show ? hex : `${bits} of 256 bits`}</Text>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
|
||||
|
@ -241,7 +265,7 @@ const Entropy = () => {
|
|||
{tab === 1 && <Dice sides={6} push={push} />}
|
||||
{tab === 2 && <Dice sides={20} push={push} />}
|
||||
|
||||
<Buttons pop={pop} save={save} />
|
||||
<Buttons pop={pop} save={save} colors={colors} />
|
||||
</SafeBlueArea>
|
||||
);
|
||||
};
|
||||
|
@ -263,7 +287,6 @@ const styles = StyleSheet.create({
|
|||
padding: 5,
|
||||
marginLeft: 10,
|
||||
marginRight: 10,
|
||||
backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
|
||||
borderRadius: 9,
|
||||
minHeight: 49,
|
||||
paddingHorizontal: 8,
|
||||
|
@ -274,7 +297,6 @@ const styles = StyleSheet.create({
|
|||
entropyText: {
|
||||
fontSize: 15,
|
||||
fontFamily: 'Courier',
|
||||
color: BlueCurrentTheme.colors.foregroundColor,
|
||||
},
|
||||
coinRoot: {
|
||||
flex: 1,
|
||||
|
@ -322,9 +344,6 @@ const styles = StyleSheet.create({
|
|||
aspectRatio: 1,
|
||||
borderColor: BlueCurrentTheme.colors.buttonBackgroundColor,
|
||||
},
|
||||
diceText: {
|
||||
color: BlueCurrentTheme.colors.foregroundColor,
|
||||
},
|
||||
diceIcon: {
|
||||
margin: 3,
|
||||
justifyContent: 'center',
|
||||
|
|
|
@ -31,7 +31,6 @@ import HandoffSettings from '../../class/handoff';
|
|||
import Handoff from 'react-native-handoff';
|
||||
import ActionSheet from '../ActionSheet';
|
||||
import loc from '../../loc';
|
||||
import { BlueCurrentTheme } from '../../components/themes';
|
||||
import { FContainer, FButton } from '../../components/FloatButtons';
|
||||
import { getSystemName } from 'react-native-device-info';
|
||||
import { useRoute, useNavigation, useTheme, useFocusEffect } from '@react-navigation/native';
|
||||
|
@ -656,12 +655,7 @@ const WalletTransactions = () => {
|
|||
}}
|
||||
icon={
|
||||
<View style={styles.receiveIcon}>
|
||||
<Icon
|
||||
name="arrow-down"
|
||||
size={buttonFontSize}
|
||||
type="font-awesome"
|
||||
color={BlueCurrentTheme.colors.buttonAlternativeTextColor}
|
||||
/>
|
||||
<Icon name="arrow-down" size={buttonFontSize} type="font-awesome" color={colors.buttonAlternativeTextColor} />
|
||||
</View>
|
||||
}
|
||||
/>
|
||||
|
@ -675,12 +669,7 @@ const WalletTransactions = () => {
|
|||
testID="SendButton"
|
||||
icon={
|
||||
<View style={styles.sendIcon}>
|
||||
<Icon
|
||||
name="arrow-down"
|
||||
size={buttonFontSize}
|
||||
type="font-awesome"
|
||||
color={BlueCurrentTheme.colors.buttonAlternativeTextColor}
|
||||
/>
|
||||
<Icon name="arrow-down" size={buttonFontSize} type="font-awesome" color={colors.buttonAlternativeTextColor} />
|
||||
</View>
|
||||
}
|
||||
/>
|
||||
|
|
|
@ -230,7 +230,7 @@ const ViewEditMultisigCosigners = () => {
|
|||
button={{
|
||||
buttonType: MultipleStepsListItemButtohType.partial,
|
||||
leftText,
|
||||
text: loc.multisig.view_key,
|
||||
text: loc.multisig.share,
|
||||
disabled: vaultKeyData.isLoading,
|
||||
onPress: () => {
|
||||
setVaultKeyData({
|
||||
|
@ -268,7 +268,7 @@ const ViewEditMultisigCosigners = () => {
|
|||
showActivityIndicator={vaultKeyData.keyIndex === el.index + 1 && vaultKeyData.isLoading}
|
||||
button={{
|
||||
leftText,
|
||||
text: loc.multisig.view_key,
|
||||
text: loc.multisig.share,
|
||||
disabled: vaultKeyData.isLoading,
|
||||
buttonType: MultipleStepsListItemButtohType.partial,
|
||||
onPress: () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue