From 6e42c1f66705400335d856bc35b15b8463fab51c Mon Sep 17 00:00:00 2001 From: Overtorment Date: Sat, 27 Oct 2018 16:25:28 +0100 Subject: [PATCH 1/6] OPS --- release-notes.sh | 2 +- up-build-number.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 up-build-number.sh diff --git a/release-notes.sh b/release-notes.sh index 63bab6cbb..6b3b2f493 100755 --- a/release-notes.sh +++ b/release-notes.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash TAG=`git tag | sort | tail -n 1` HASH=`git show-ref -s $TAG` -git log --pretty=format:'%Cred*%Creset %Creset %s %b %Creset' $HASH..HEAD +git log --pretty=format:'* %s %b' $HASH..HEAD diff --git a/up-build-number.sh b/up-build-number.sh new file mode 100755 index 000000000..4d8833f93 --- /dev/null +++ b/up-build-number.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +./release-notes.sh +./release-notes.sh > fastlane/metadata/en-US/release_notes.txt +echo +nodejs up-build-number.js \ No newline at end of file From c1ff80aee910a20c8532c99a5f43ff20185ed2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20V=C3=A9lez?= Date: Sat, 27 Oct 2018 15:38:22 -0400 Subject: [PATCH 2/6] Validate address with bitcoin library (#110) REF: Wrap tx creation in a try catch --- screen/send/details.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/screen/send/details.js b/screen/send/details.js index aa132dd71..16f3192f4 100644 --- a/screen/send/details.js +++ b/screen/send/details.js @@ -151,6 +151,7 @@ export default class SendDetails extends Component { } async createTransaction() { + this.setState({ isLoading: true }); let error = false; let requestedSatPerByte = this.state.fee.toString().replace(/\D/g, ''); @@ -174,7 +175,16 @@ export default class SendDetails extends Component { console.log('validation error'); } + try { + bitcoin.address.toOutputScript(this.state.address); + } catch (err) { + console.log('validation error'); + console.log(err); + error = loc.send.details.address_field_is_not_valid; + } + if (error) { + this.setState({ isLoading: false }); alert(error); return; } @@ -205,14 +215,7 @@ export default class SendDetails extends Component { } let startTime = Date.now(); - try { - tx = this.state.fromWallet.createTx(utxo, this.state.amount, fee, this.state.address, this.state.memo); - } catch (error) { - console.log(error); - alert(loc.send.details.create_tx_error); - this.setState({ isLoading: false }); - return; - } + tx = this.state.fromWallet.createTx(utxo, this.state.amount, fee, this.state.address, this.state.memo); let endTime = Date.now(); console.log('create tx ', (endTime - startTime) / 1000, 'sec'); @@ -246,7 +249,7 @@ export default class SendDetails extends Component { await BlueApp.saveToDisk(); } catch (err) { console.log(err); - alert(loc.send.details.create_tx_error); + alert(err); this.setState({ isLoading: false }); return; } From a0ba0635b2e3d5553ff940be90329a1cdbf0e9d2 Mon Sep 17 00:00:00 2001 From: Overtorment Date: Sat, 27 Oct 2018 20:42:59 +0100 Subject: [PATCH 3/6] REL --- app.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.json b/app.json index c7c104d1c..8982f4261 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,7 @@ "ios" ], "ios": { - "buildNumber": "104", + "buildNumber": "105", "supportsTablet": true, "bundleIdentifier": "io.bluewallet.bluewallet", "infoPlist": { @@ -53,4 +53,4 @@ ] } } -} +} \ No newline at end of file From 8a1c9908f83ce18bf7d724c63f9fef4057573d87 Mon Sep 17 00:00:00 2001 From: Overtorment Date: Sun, 28 Oct 2018 01:11:07 +0100 Subject: [PATCH 4/6] ADD: buy bitcoin with Changelly --- MainBottomTabs.js | 8 ++++++-- loc/en.js | 7 +++++++ loc/es.js | 7 +++++++ loc/pt_BR.js | 7 +++++++ loc/pt_PT.js | 7 +++++++ loc/ru.js | 7 +++++++ loc/ua.js | 7 +++++++ screen/wallets/details.js | 22 ++++++++++++++++++++++ screen/wallets/transactions.js | 20 ++++++++++++++++++++ 9 files changed, 90 insertions(+), 2 deletions(-) diff --git a/MainBottomTabs.js b/MainBottomTabs.js index 0c6613321..d920088e1 100644 --- a/MainBottomTabs.js +++ b/MainBottomTabs.js @@ -10,6 +10,7 @@ import AddWallet from './screen/wallets/add'; import ImportWallet from './screen/wallets/import'; import WalletDetails from './screen/wallets/details'; import WalletExport from './screen/wallets/export'; +import BuyBitcoin from './screen/wallets/buyBitcoin'; import scanQrWif from './screen/wallets/scanQrWif'; import details from './screen/transactions/details'; @@ -85,7 +86,7 @@ const CreateTransactionStackNavigator = createStackNavigator({ }, }); -const Tabs = createStackNavigator( +const MainBottomTabs = createStackNavigator( { Wallets: { screen: WalletsStackNavigator, @@ -112,6 +113,9 @@ const Tabs = createStackNavigator( WalletExport: { screen: WalletExport, }, + BuyBitcoin: { + screen: BuyBitcoin, + }, // SendDetails: { screen: CreateTransactionStackNavigator, @@ -162,4 +166,4 @@ const Tabs = createStackNavigator( }, ); -export default Tabs; +export default MainBottomTabs; diff --git a/loc/en.js b/loc/en.js index ae8e12f2e..e7a11d1d7 100644 --- a/loc/en.js +++ b/loc/en.js @@ -22,6 +22,7 @@ module.exports = { latest_transaction: 'latest transaction', empty_txs1: 'Your transactions will appear here,', empty_txs2: 'none at the moment', + tap_here_to_buy: 'Tap here to buy Bitcoin', }, add: { title: 'add wallet', @@ -51,6 +52,7 @@ module.exports = { no_cancel: 'No, cancel', delete_this_wallet: 'Delete this wallet', export_backup: 'Export / backup', + buy_bitcoin: 'Buy Bitcoin', }, export: { title: 'wallet export', @@ -145,6 +147,11 @@ module.exports = { copiedToClipboard: 'Copied to clipboard.', }, }, + buyBitcoin: { + header: 'Buy Bitcoin', + tap_your_address: 'Tap your address to copy it to clipboard:', + copied: 'Copied to Clipboard!', + }, settings: { header: 'settings', plausible_deniability: 'Plausible deniability...', diff --git a/loc/es.js b/loc/es.js index b0385c10d..83067ce84 100644 --- a/loc/es.js +++ b/loc/es.js @@ -22,6 +22,7 @@ module.exports = { latest_transaction: 'última transacción', empty_txs1: 'Sus transacciones aparecerán aquí,', empty_txs2: 'ninguno por el momento.', + tap_here_to_buy: 'Tap here to buy Bitcoin', }, add: { title: 'Añadir cartera', @@ -51,6 +52,7 @@ module.exports = { no_cancel: 'No, cancelar', delete_this_wallet: 'Eliminar esta carterqa', export_backup: 'Exportar / Guardar', + buy_bitcoin: 'Buy Bitcoin', }, export: { title: 'Exportacion de cartera', @@ -146,6 +148,11 @@ module.exports = { copiedToClipboard: 'Copiado a portapapeles.', }, }, + buyBitcoin: { + header: 'Buy Bitcoin', + tap_your_address: 'Tap your address to copy it to clipboard:', + copied: 'Copied to Clipboard!', + }, settings: { tabBarLabel: 'Ajustes', header: 'Ajustes', diff --git a/loc/pt_BR.js b/loc/pt_BR.js index 5c63fa022..377186578 100644 --- a/loc/pt_BR.js +++ b/loc/pt_BR.js @@ -23,6 +23,7 @@ module.exports = { latest_transaction: 'última transação', empty_txs1: 'Suas transações aparecerão aqui', empty_txs2: 'nenhuma de momento', + tap_here_to_buy: 'Tap here to buy Bitcoin', }, add: { title: 'Adicionar Wallet', @@ -52,6 +53,7 @@ module.exports = { no_cancel: 'Não, cancelar', delete_this_wallet: 'Apagar esta wallet', export_backup: 'Exportar / backup', + buy_bitcoin: 'Buy Bitcoin', }, export: { title: 'Exportar Wallet', @@ -147,6 +149,11 @@ module.exports = { copiedToClipboard: 'copiado para clip board', }, }, + buyBitcoin: { + header: 'Buy Bitcoin', + tap_your_address: 'Tap your address to copy it to clipboard:', + copied: 'Copied to Clipboard!', + }, settings: { tabBarLabel: 'Definições', header: 'definições', diff --git a/loc/pt_PT.js b/loc/pt_PT.js index ed58d75ca..d1c3aa902 100644 --- a/loc/pt_PT.js +++ b/loc/pt_PT.js @@ -22,6 +22,7 @@ module.exports = { latest_transaction: 'últimas transacções', empty_txs1: 'As suas transacções aparecerão aqui,', empty_txs2: 'nenhuma de momento', + tap_here_to_buy: 'Tap here to buy Bitcoin', }, add: { title: 'adicionar wallet', @@ -51,6 +52,7 @@ module.exports = { no_cancel: 'Não, cancelar', delete_this_wallet: 'Apagar esta wallet', export_backup: 'Exportar / backup', + buy_bitcoin: 'Buy Bitcoin', }, export: { title: 'Exportar Wallet', @@ -138,6 +140,11 @@ module.exports = { not_enough_fee: 'Taxa demasiado baixo. Aumente a taxa.', }, }, + buyBitcoin: { + header: 'Buy Bitcoin', + tap_your_address: 'Tap your address to copy it to clipboard:', + copied: 'Copied to Clipboard!', + }, receive: { header: 'receber', details: { diff --git a/loc/ru.js b/loc/ru.js index 89d53fd47..db092bc4a 100644 --- a/loc/ru.js +++ b/loc/ru.js @@ -22,6 +22,7 @@ module.exports = { latest_transaction: 'последняя транзакция', empty_txs1: 'Список транзакций пока пуст', empty_txs2: ' ', + tap_here_to_buy: 'Tap here to buy Bitcoin', }, add: { title: 'добавить кошелек', @@ -51,6 +52,7 @@ module.exports = { no_cancel: 'Нет, отмена', delete_this_wallet: 'Удалить этот кошелек', export_backup: 'Экспорт / резервная копия', + buy_bitcoin: 'Buy Bitcoin', }, export: { title: 'Экспорт Кошелька', @@ -137,6 +139,11 @@ module.exports = { not_enough_fee: 'Слишком маленькая комиссия. Увеличьте комиссию', }, }, + buyBitcoin: { + header: 'Buy Bitcoin', + tap_your_address: 'Tap your address to copy it to clipboard:', + copied: 'Copied to Clipboard!', + }, receive: { header: 'Получить', details: { diff --git a/loc/ua.js b/loc/ua.js index 9e0c41d32..ab839af2b 100644 --- a/loc/ua.js +++ b/loc/ua.js @@ -22,6 +22,7 @@ module.exports = { latest_transaction: 'остання транзакція', empty_txs1: "Транзакціі з'являться тут,", empty_txs2: 'поки що жодноі', + tap_here_to_buy: 'Tap here to buy Bitcoin', }, add: { title: 'Додати Гаманець', @@ -51,6 +52,7 @@ module.exports = { no_cancel: 'Ні, відміна', delete_this_wallet: 'Видалити цей гаманець', export_backup: 'Експорт / резервна копія', + buy_bitcoin: 'Buy Bitcoin', }, export: { title: 'Експорт Гаманця', @@ -145,6 +147,11 @@ module.exports = { copiedToClipboard: 'Зкопіювано', }, }, + buyBitcoin: { + header: 'Buy Bitcoin', + tap_your_address: 'Tap your address to copy it to clipboard:', + copied: 'Copied to Clipboard!', + }, settings: { tabBarLabel: 'Налаштування', header: 'Налаштування', diff --git a/screen/wallets/details.js b/screen/wallets/details.js index ed3d42431..e4d911d9e 100644 --- a/screen/wallets/details.js +++ b/screen/wallets/details.js @@ -155,6 +155,11 @@ export default class WalletDetails extends Component { this.props.navigation.navigate('WalletExport', { address: this.state.wallet.getAddress(), @@ -163,6 +168,23 @@ export default class WalletDetails extends Component { } title={loc.wallets.details.export_backup} /> + + + + + this.props.navigation.navigate('BuyBitcoin', { + address: this.state.wallet.getAddress(), + secret: this.state.wallet.getSecret(), + }) + } + title={loc.wallets.details.buy_bitcoin} + /> ); } diff --git a/screen/wallets/transactions.js b/screen/wallets/transactions.js index 47963e519..a2126fed3 100644 --- a/screen/wallets/transactions.js +++ b/screen/wallets/transactions.js @@ -362,6 +362,26 @@ export default class WalletTransactions extends Component { {(this.isLightning() && '\nTo start using it tap on "manage funds"\nand topup your balance') || loc.wallets.list.empty_txs2} + + + + + + this.props.navigation.navigate('BuyBitcoin', { + address: this.state.wallet.getAddress(), + secret: this.state.wallet.getSecret(), + }) + } + > + {loc.wallets.list.tap_here_to_buy} + } refreshControl={ this.refreshTransactions()} refreshing={this.state.isTransactionsLoading} />} From 7d734f3a00ab645c6e791e584baf425b4dee04f4 Mon Sep 17 00:00:00 2001 From: Overtorment Date: Sun, 28 Oct 2018 01:11:40 +0100 Subject: [PATCH 5/6] OPS --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 8b16f3a22..d51cf750b 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js", "scripts": { "prepare": "./patches/fix_mangle.sh; git apply patches/transaction_builder.js.patch; git apply ./patches/transaction.js.patch; test -f sentry.sh && ./sentry.sh || true", + "clean": "rm -r -f node_modules/", "start": "expo start", "eject": "expo eject", "android": "expo android", From 4bbfc9c4adff3c610468211c21d0d2a3fdd95993 Mon Sep 17 00:00:00 2001 From: Overtorment Date: Sun, 28 Oct 2018 01:12:52 +0100 Subject: [PATCH 6/6] REL --- app.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.json b/app.json index 8982f4261..f7d7baa40 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,7 @@ "ios" ], "ios": { - "buildNumber": "105", + "buildNumber": "106", "supportsTablet": true, "bundleIdentifier": "io.bluewallet.bluewallet", "infoPlist": {