Merge branch 'master' of github.com:BlueWallet/BlueWallet

This commit is contained in:
Overtorment 2019-04-22 20:26:59 +01:00
commit b0ec261267
25 changed files with 304 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import LightningSettings from './screen/settings/lightningSettings';
import WalletsList from './screen/wallets/list';
import WalletTransactions from './screen/wallets/transactions';
import AddWallet from './screen/wallets/add';
import PleaseBackup from './screen/wallets/pleaseBackup';
import ImportWallet from './screen/wallets/import';
import WalletDetails from './screen/wallets/details';
import WalletExport from './screen/wallets/export';
@ -183,6 +184,9 @@ const CreateWalletStackNavigator = createStackNavigator({
ImportWallet: {
screen: ImportWallet,
},
PleaseBackup: {
screen: PleaseBackup,
},
});
const LightningScanInvoiceStackNavigator = createStackNavigator({

View File

@ -220,4 +220,10 @@ module.exports = {
placeholder: 'Invoice',
sameWalletAsInvoiceError: 'You can not pay an invoice with the same wallet used to create it.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -219,4 +219,10 @@ module.exports = {
refill: 'Genopfyld',
withdraw: 'Træk coins tilbage',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -224,4 +224,10 @@ module.exports = {
sameWalletAsInvoiceError:
'Du kannst nicht die Rechnung mit der Wallet begleichen, die du für die Erstellung dieser Rechnung verwendet hast.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -223,4 +223,10 @@ module.exports = {
placeholder: 'Τιμολόγιο',
sameWalletAsInvoiceError: 'Δεν μπορείς να εξοφλήσεις ένα τιμολόγιο από το ίδιο πορτοφόλι με το οποίο δημιουργήθηκε.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -221,4 +221,10 @@ module.exports = {
placeholder: 'Invoice',
sameWalletAsInvoiceError: 'You can not pay an invoice with the same wallet used to create it.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -224,4 +224,10 @@ module.exports = {
expired: 'Expirado',
sameWalletAsInvoiceError: 'You can not pay an invoice with the same wallet used to create it.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -223,4 +223,10 @@ module.exports = {
placeholder: 'Lasku',
sameWalletAsInvoiceError: 'Et voi maksaa laskua samalla lompakolla, jolla se on luotu.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -223,4 +223,10 @@ module.exports = {
expired: 'Expiré',
sameWalletAsInvoiceError: 'Vous ne pouvez pas payer une facture avec le même portefeuille utilisé pour la créer.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -218,4 +218,10 @@ module.exports = {
expired: 'Isteklo',
sameWalletAsInvoiceError: 'Buraz! Ne možeš platiti račun s istim voletom s kojim si račun stvorio, ono.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -220,4 +220,10 @@ module.exports = {
expired: 'Kadaluarsa',
sameWalletAsInvoiceError: 'Kamu tidak bisa membayar invoice dengan dompet yang sama yang dipakai untuk membuat invoice.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -223,4 +223,10 @@ module.exports = {
placeholder: 'Fattura',
sameWalletAsInvoiceError: 'Non puoi pagare una fattura con lo stesso portafoglio utilizzato per crearla.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -222,4 +222,10 @@ module.exports = {
expired: '失効',
sameWalletAsInvoiceError: '以前作成したウォレットと同じウォレットへの支払いはできません。',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -221,4 +221,10 @@ module.exports = {
placeholder: 'Faktura',
sameWalletAsInvoiceError: 'Du kan ikke betale en faktura med samme lommebok som brukes til å lage den.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -224,4 +224,10 @@ module.exports = {
placeholder: 'Invoice',
sameWalletAsInvoiceError: 'U kunt geen factuur betalen met dezelfde portemonnee die is gebruikt om de factuur te maken.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -225,4 +225,10 @@ module.exports = {
expired: 'Vencido',
sameWalletAsInvoiceError: 'Você não pode pagar uma fatura com a mesma carteira que a criou.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -224,4 +224,10 @@ module.exports = {
expired: 'Expired',
sameWalletAsInvoiceError: 'You can not pay an invoice with the same wallet used to create it.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -225,4 +225,10 @@ module.exports = {
placeholder: 'Invoice',
sameWalletAsInvoiceError: 'Ты не можешь оплатить счет тем же кошельком, который ты использовал для его создания.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -221,4 +221,10 @@ module.exports = {
placeholder: 'Faktura',
sameWalletAsInvoiceError: 'Du kan inte betala en faktura från samma plånbok som användes för att skapa den.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -221,4 +221,10 @@ module.exports = {
expired: 'หมดอายุแล้ว',
sameWalletAsInvoiceError: 'คุณไม่สามารถจ่ายใบแจ้งหนี้นี้ด้วยกระเป๋าสตางค์อันเดียวกันกับที่ใช้สร้างมัน.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -221,4 +221,10 @@ module.exports = {
placeholder: 'Fatura',
sameWalletAsInvoiceError: 'Bir faturayı, oluştururken kullandığınız cüzdan ile ödeyemezsiniz.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -225,4 +225,10 @@ module.exports = {
expired: 'Expired',
sameWalletAsInvoiceError: 'You can not pay an invoice with the same wallet used to create it.',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -215,4 +215,10 @@ module.exports = {
expired: '超时',
sameWalletAsInvoiceError: '你不能用创建账单的钱包去支付该账单',
},
pleasebackup: {
title: 'Your wallet is created...',
text:
"Please take a moment to write down this mnemonic phrase on a piece of paper. It's your backup you can use to restore the wallet on other device. You can use Electrum wallet on desktop (https://electrum.org/) to restore the same wallet.",
ok: 'OK, I wrote this down!',
},
};

View File

@ -260,7 +260,13 @@ export default class WalletsAdd extends Component {
EV(EV.enum.WALLETS_COUNT_CHANGED);
A(A.ENUM.CREATED_WALLET);
ReactNativeHapticFeedback.trigger('notificationSuccess', false);
this.props.navigation.dismiss();
if (w.type === HDSegwitP2SHWallet.type) {
this.props.navigation.navigate('PleaseBackup', {
secret: w.getSecret(),
});
} else {
this.props.navigation.dismiss();
}
}
},
1,

View File

@ -0,0 +1,161 @@
import React, { Component } from 'react';
import { ActivityIndicator, View, BackHandler } from 'react-native';
import { BlueSpacing20, SafeBlueArea, BlueNavigationStyle, BlueText, BlueButton } from '../../BlueComponents';
import PropTypes from 'prop-types';
import Privacy from '../../Privacy';
let loc = require('../../loc');
export default class PleaseBackup extends Component {
static navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: loc.pleasebackup.title,
headerLeft: null,
headerRight: null,
});
constructor(props) {
super(props);
this.state = {
isLoading: true,
words: props.navigation.state.params.secret.split(' '),
};
BackHandler.addEventListener('hardwareBackPress', this.handleBackButton.bind(this));
}
handleBackButton() {
this.props.navigation.dismiss();
return true;
}
componentDidMount() {
Privacy.enableBlur();
this.setState({
isLoading: false,
});
}
componentWillUnmount() {
Privacy.disableBlur();
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButton.bind(this));
}
render() {
if (this.state.isLoading) {
return (
<View style={{ flex: 1, paddingTop: 20 }}>
<ActivityIndicator />
</View>
);
}
return (
<SafeBlueArea style={{ flex: 1, paddingTop: 20 }}>
<BlueText style={{ padding: 20 }}>{loc.pleasebackup.text}</BlueText>
<View style={{ flex: 0.5, alignItems: 'center', justifyContent: 'center', padding: 20 }}>
<View style={{ flex: 1, alignSelf: 'stretch', flexDirection: 'row' }}>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[0]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[1]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[2]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[3]}</BlueText>
</View>
</View>
<View style={{ flex: 1, alignSelf: 'stretch', flexDirection: 'row' }}>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[4]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[5]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[6]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[7]}</BlueText>
</View>
</View>
<View style={{ flex: 1, alignSelf: 'stretch', flexDirection: 'row' }}>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[8]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[9]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[10]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[11]}</BlueText>
</View>
</View>
<View style={{ flex: 1, alignSelf: 'stretch', flexDirection: 'row' }}>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[12]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[13]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[14]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[15]}</BlueText>
</View>
</View>
<View style={{ flex: 1, alignSelf: 'stretch', flexDirection: 'row' }}>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[16]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[17]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[18]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[19]}</BlueText>
</View>
</View>
<View style={{ flex: 1, alignSelf: 'stretch', flexDirection: 'row' }}>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[20]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[21]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[22]}</BlueText>
</View>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueText>{this.state.words[23]}</BlueText>
</View>
</View>
<View style={{ flex: 1, alignSelf: 'stretch', flexDirection: 'row' }}>
<View style={{ flex: 1, alignSelf: 'stretch' }}>
<BlueSpacing20 />
<BlueButton onPress={() => this.props.navigation.dismiss()} title={loc.pleasebackup.ok} />
</View>
</View>
</View>
</SafeBlueArea>
);
}
}
PleaseBackup.propTypes = {
navigation: PropTypes.shape({
state: PropTypes.shape({
params: PropTypes.shape({
secret: PropTypes.string,
}),
}),
dismiss: PropTypes.func,
}),
};