Merged updated sprint/21.

This commit is contained in:
Brendon Duncan 2018-08-20 11:31:49 +12:00
commit bb92f5ec1b
19 changed files with 101 additions and 151 deletions

View file

@ -24,9 +24,9 @@
"windowsAppId": "804636ee-b017-4cad-8719-e58ac97ffa5c",
"pushSenderId": "1036948132229",
"description": "A Secure Bitcoin Wallet",
"version": "4.13.2",
"fullVersion": "4.13-rc3",
"androidVersion": "413200",
"version": "5.0.0",
"fullVersion": "5.0-rc1",
"androidVersion": "500000",
"_extraCSS": "",
"_enabledExtensions": {
"coinbase": false,

View file

@ -119,10 +119,10 @@
"run:android": "cordova run android --device",
"run:android-release": "cordova run android --device --release",
"log:android": "adb logcat | grep chromium",
"sign:android": "rm -f platforms/android/build/outputs/apk/android-release-signed-aligned.apk; jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../bitcoin-com-release-key.jks -signedjar platforms/android/build/outputs/apk/android-release-signed.apk platforms/android/build/outputs/apk/android-release-unsigned.apk bitcoin-com && $ANDROID_HOME/build-tools/27.0.1/zipalign -v 4 platforms/android/build/outputs/apk/android-release-signed.apk platforms/android/build/outputs/apk/android-release-signed-aligned.apk",
"sign:android": "rm -f platforms/android/build/outputs/apk/android-release-signed-aligned.apk; jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../bitcoin-com-release-key.jks -signedjar platforms/android/build/outputs/apk/android-release-signed.apk platforms/android/build/outputs/apk/android-release-unsigned.apk bitcoin-com && zipalign -v 4 platforms/android/build/outputs/apk/android-release-signed.apk platforms/android/build/outputs/apk/android-release-signed-aligned.apk",
"apply:copay": "npm i fs-extra && cd app-template && node apply.js copay && npm i && cordova prepare",
"apply:bitpay": "npm i fs-extra && cd app-template && node apply.js bitpay && npm i && cordova prepare",
"apply:bitcoincom": "npm i fs-extra && cd app-template && node apply.js bitcoincom && npm i && cordova prepare",
"apply:bitcoincom": "npm i fs-extra && cd app-template && node apply.js bitcoincom && npm i && cordova prepare && cd ../ && ./fix-asn1.sh",
"test": "karma start test/karma.conf.js --single-run",
"clean": "trash platforms && trash plugins && cordova prepare",
"unstage-package": "git reset package.json",
@ -141,4 +141,4 @@
"pre-commit": "^1.1.3"
},
"pre-commit": "unstage-package"
}
}

View file

@ -24,6 +24,6 @@
},
"resolutions": {
"angular": "1.5.3",
"ionic": "1b7414faba"
"ionic": "eefba1331b"
}
}

11
fix-asn1.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
firstLine=`awk 'NR < 2 {print}' node_modules/asn1.js-rfc5280/index.js`
if [ "$firstLine" = "try {" ]; then
echo "var asn1 = require('asn1.js');" > node_modules/asn1.js-rfc5280/index.new.js
awk 'NR > 6 {print}' node_modules/asn1.js-rfc5280/index.js >> node_modules/asn1.js-rfc5280/index.new.js
rm node_modules/asn1.js-rfc5280/index.js
mv node_modules/asn1.js-rfc5280/index.new.js node_modules/asn1.js-rfc5280/index.js
echo "node_modules/asn1.js-rfc5280/index.js fixed"
fi

View file

@ -2648,7 +2648,7 @@ msgid "Paste Address"
msgstr ""
#: www/views/tab-send.html:27
msgid "Wallet to Wallet Transfer"
msgid "Transfer between wallets"
msgstr ""
#: www/views/tab-send.html:35
@ -3165,7 +3165,7 @@ msgid "To start the process you need to add funds to your wallet."
msgstr ""
#: www/views/shapeshift.html:30
msgid "he process is fast and you will receive the exchanged amount in your wallet."
msgid "The process is fast and you will receive the exchanged amount in your wallet."
msgstr ""
#: www/views/shapeshift.html:34
@ -3813,7 +3813,7 @@ msgid "Your Bitcoin Wallets are ready!"
msgstr ""
#: src/js/controllers/amount.js:49
msgid "Address doesn\'t contain currency information, please make sure you are sending the correct currency."
msgid "Address does not contain currency information, please make sure you are sending the correct currency."
msgstr ""
#: www/views/review.html:4

View file

@ -1,21 +1,25 @@
ext {
ANDROID_SUPPORT_V4_VERSION = '26.1.0'
}
configurations.all {
resolutionStrategy {
force "com.android.support:support-v4:26.1.0"
force "com.google.android.gms:play-services-auth:11.8.0"
force "com.google.android.gms:play-services-identity:11.8.0"
force "com.google.android.gms:play-services-ads:11.8.0"
force "com.google.android.gms:play-services-base:11.8.0"
force "com.google.android.gms:play-services-gcm:11.8.0"
force "com.google.android.gms:play-services-analytics:11.8.0"
force "com.google.android.gms:play-services-location:11.8.0"
force "com.google.android.gms:play-services-basement:11.8.0"
force "com.google.android.gms:play-services-tagmanager:11.8.0"
force 'com.google.firebase:firebase-core:11.8.0'
force 'com.google.firebase:firebase-crash:11.8.0'
force 'com.google.firebase:firebase-auth:11.8.0'
force 'com.google.firebase:firebase-common:11.8.0'
force 'com.google.firebase:firebase-config:11.8.0'
force 'com.google.firebase:firebase-perf:11.8.0'
force 'com.google.firebase:firebase-messaging:11.8.0'
}
resolutionStrategy {
force "com.android.support:support-v4:26.1.0"
force "com.google.android.gms:play-services-auth:11.8.0"
force "com.google.android.gms:play-services-identity:11.8.0"
force "com.google.android.gms:play-services-ads:11.8.0"
force "com.google.android.gms:play-services-base:11.8.0"
force "com.google.android.gms:play-services-gcm:11.8.0"
force "com.google.android.gms:play-services-analytics:11.8.0"
force "com.google.android.gms:play-services-location:11.8.0"
force "com.google.android.gms:play-services-basement:11.8.0"
force "com.google.android.gms:play-services-tagmanager:11.8.0"
force 'com.google.firebase:firebase-core:11.8.0'
force 'com.google.firebase:firebase-crash:11.8.0'
force 'com.google.firebase:firebase-auth:11.8.0'
force 'com.google.firebase:firebase-common:11.8.0'
force 'com.google.firebase:firebase-config:11.8.0'
force 'com.google.firebase:firebase-perf:11.8.0'
force 'com.google.firebase:firebase-messaging:11.8.0'
}
}

View file

@ -456,6 +456,7 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory,
var confirmData = {
amount: useSendMax ? undefined : satoshis,
displayAddress: passthroughParams.displayAddress,
fromWalletId: passthroughParams.fromWalletId,
sendMax: useSendMax,
toAddress: passthroughParams.toAddress,

View file

@ -4,7 +4,7 @@ angular
.module('copayApp.controllers')
.controller('reviewController', reviewController);
function reviewController(addressbookService, bitcoinCashJsService, bitcore, bitcoreCash, bwcError, configService, feeService, gettextCatalog, $interval, $ionicHistory, $ionicModal, lodash, $log, ongoingProcess, platformInfo, popupService, profileService, $scope, sendFlowService, shapeshiftService, soundService, $state, $timeout, txConfirmNotification, txFormatService, walletService) {
function reviewController(addressbookService, bitcoinCashJsService, bitcore, bitcoreCash, bwcError, clipboardService, configService, feeService, gettextCatalog, $interval, $ionicHistory, $ionicModal, ionicToast, lodash, $log, ongoingProcess, platformInfo, popupService, profileService, $scope, sendFlowService, shapeshiftService, soundService, $state, $timeout, txConfirmNotification, txFormatService, walletService) {
var vm = this;
vm.buttonText = '';
@ -19,6 +19,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
kind: '', // 'address', 'contact', 'wallet'
name: ''
};
vm.displayAddress = '';
vm.feeCrypto = '';
vm.feeFiat = '';
vm.fiatCurrency = '';
@ -52,16 +53,17 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
// Functions
vm.goBack = goBack;
vm.onSuccessConfirm = onSuccessConfirm;
vm.onShareTransaction = onShareTransaction;
var sendFlowData;
var config = null;
var countDown = null;
var defaults = {};
var coin = '';
var countDown = null;
var defaults = {};
var usingCustomFee = false;
var usingMerchantFee = false;
var destinationWalletId = '';
var lastTxId = '';
var originWalletId = '';
var priceDisplayIsFiat = true;
var satoshis = null;
@ -83,7 +85,8 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
satoshis = parseInt(sendFlowData.amount, 10);
toAddress = sendFlowData.toAddress;
destinationWalletId = sendFlowData.toWalletId;
vm.displayAddress = sendFlowData.displayAddress;
vm.originWallet = profileService.getWallet(originWalletId);
vm.origin.currency = vm.originWallet.coin.toUpperCase();
coin = vm.originWallet.coin;
@ -102,7 +105,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
priceDisplayIsFiat = config.wallet.settings.priceDisplay === 'fiat';
vm.origin.currencyColor = (vm.originWallet.coin === 'btc' ? defaults.bitcoinWalletColor : defaults.bitcoinCashWalletColor);
console.log("coin", vm.originWallet.coin, vm.origin.currencyColor, config.bitcoinWalletColor, vm.originWallet.coin === 'btc');
unitFromSat = 1 / config.wallet.settings.unitToSatoshi;
unitFromSat = 1 / config.wallet.settings.unitToSatoshi;
}
updateSendAmounts();
getOriginWalletBalance(vm.originWallet);
@ -156,6 +159,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
txConfirmNotification.subscribe(vm.originWallet, {
txid: txp.txid
});
lastTxId = txp.txid;
}
}, statusChangeHandler);
};
@ -522,6 +526,21 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
}
}
function onShareTransaction() {
var explorerTxUrl = 'https://explorer.bitcoin.com/' + tx.coin + '/tx/' + lastTxId;
if (platformInfo.isCordova) {
var text = gettextCatalog.getString('Take a look at this Bitcoin Cash transaction here: ') + explorerTxUrl;
if (coin === 'btc') {
text = gettextCatalog.getString('Take a look at this Bitcoin transaction here: ') + explorerTxUrl;
}
window.plugins.socialsharing.share(text, null, null, null);
} else {
ionicToast.show(gettextCatalog.getString('Copied to clipboard'), 'bottom', false, 3000);
clipboardService.copyToClipboard(explorerTxUrl);
}
}
function startExpirationTimer(expirationTime) {
vm.paymentExpired = false;
setExpirationTime();

View file

@ -4,6 +4,8 @@ angular.module('copayApp.controllers').controller('shapeshiftController', functi
var walletsBtc = [];
var walletsBch = [];
$scope.showMyAddress = showMyAddress;
function generateAddress(wallet, cb) {
if (!wallet) return;
walletService.getAddress(wallet, false, function(err, addr) {
@ -41,14 +43,6 @@ angular.module('copayApp.controllers').controller('shapeshiftController', functi
$ionicNavBarDelegate.showBar(true);
});
$scope.showFromWalletSelector = function() {
$scope.showFromWallets = true;
};
$scope.showToWalletSelector = function() {
$scope.showToWallets = true;
};
// This could probably be enhanced refactoring the routes abstract states
$scope.createWallet = function() {
$state.go('tabs.home').then(function() {
@ -81,4 +75,11 @@ angular.module('copayApp.controllers').controller('shapeshiftController', functi
});
});
}
function showMyAddress() {
$state.go('tabs.home').then(function() {
$state.go('tabs.receive');
});
}
});

View file

@ -138,7 +138,9 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.paymentReceivedAlternativeAmount = ''; // For when a subsequent payment is received.
txFormatService.formatAlternativeStr($scope.wallet.coin, data.x.out[i].value, function(alternativeStr){
if (alternativeStr) {
$scope.paymentReceivedAlternativeAmount = alternativeStr;
$scope.$apply(function () {
$scope.paymentReceivedAlternativeAmount = alternativeStr;
});
}
});
}

View file

@ -25,11 +25,11 @@ angular.module('copayApp.controllers').controller('walletSelectorController', fu
switch($state.current.name) {
case 'tabs.send.wallet-to-wallet':
$scope.sendFlowTitle = gettextCatalog.getString('Wallet to Wallet Transfer');
$scope.sendFlowTitle = gettextCatalog.getString('Transfer between wallets');
break;
case 'tabs.send.destination':
if ($scope.params.fromWalletId && !$scope.params.thirdParty) {
$scope.sendFlowTitle = gettextCatalog.getString('Wallet to Wallet Transfer');
$scope.sendFlowTitle = gettextCatalog.getString('Transfer between wallets');
}
break;
default:

View file

@ -165,7 +165,6 @@
break;
}
$scope.canShow = true;
$scope.$apply();
};
function getDecimalPlaces(currency) {

View file

@ -11,7 +11,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
root.redir = function(data, serviceId, serviceData) {
var originalAddress = null;
var noPrefixInAddress = 0;
if (data.toLowerCase().indexOf('bitcoin') < 0) {
noPrefixInAddress = 1;
}
@ -83,7 +83,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
// Timeout is required to enable the "Back" button
$timeout(function() {
var params = sendFlowService.getStateClone();
if (amount) {
params.amount = amount;
}
@ -390,6 +390,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
$timeout(function() {
var stateParams = {
toAddress: toAddress,
displayAddress: toAddress,
coin: coin,
noPrefix: 1
};

View file

@ -13,6 +13,7 @@ angular
// even other properties added that this service does not know about. (such as "coin")
state: {
amount: '',
displayAddress: null,
fromWalletId: '',
sendMax: false,
thirdParty: null,
@ -42,6 +43,7 @@ angular
console.log("sendFlow clearCurrent()");
service.state = {
amount: '',
displayAddress: null,
fromWalletId: '',
sendMax: false,
thirdParty: null,

View file

@ -9,8 +9,8 @@
text-overflow: ellipsis;
&.expanded {
white-space: pre-wrap;
word-break: break-all;
white-space: normal;
text-overflow: clip;
}
.prefix {

View file

@ -31,13 +31,13 @@
</p>
</div>
<div ng-show="!showingPaymentReceived" class="amount">
<div ng-show="selectedPriceDisplay=='fiat'">
<div ng-show="selectedPriceDisplay=='crypto'">
<span class="size-36"><formatted-amount value="{{amountUnitStr}}"></formatted-amount></span>
<div class="size-14 amount-alternative">
<formatted-amount value="{{altAmountStr | uppercase}}"></formatted-amount>
</div>
</div>
<div ng-show="selectedPriceDisplay=='crypto'">
<div ng-show="selectedPriceDisplay=='fiat'">
<span class="size-36"><formatted-amount value="{{altAmountStr | uppercase}}"></formatted-amount></span>
<div class="size-14 amount-alternative">
<formatted-amount value="{{amountUnitStr}}"></formatted-amount>

View file

@ -57,7 +57,12 @@
</div>
<div class="item-content item-content-compact" ng-init="addressExpanded = false" ng-if="vm.destination.kind === 'address' && !vm.thirdParty">
<div class="address-frame" ng-class="{ 'expanded': addressExpanded }" ng-click="addressExpanded = !addressExpanded">
<span class="prefix">{{vm.destination.address.substring(0,5)}}</span><span class="mid">{{vm.destination.address.substring(5,vm.destination.address.length-4)}}</span><span class="suffix">{{vm.destination.address.substring(vm.destination.address.length-4)}}</span>
<span ng-if="!vm.displayAddress">
<span class="prefix">{{vm.destination.address.substring(0,5)}}</span><span class="mid">{{vm.destination.address.substring(5,vm.destination.address.length-4)}}</span><span class="suffix">{{vm.destination.address.substring(vm.destination.address.length-4)}}</span>
</span>
<span ng-if="vm.displayAddress">
<span class="prefix">{{vm.displayAddress.substring(0,5)}}</span><span class="mid">{{vm.displayAddress.substring(5,vm.displayAddress.length-4)}}</span><span class="suffix">{{vm.displayAddress.substring(vm.displayAddress.length-4)}}</span>
</span>
</div>
</div>
</div>
@ -111,6 +116,7 @@
<slide-to-accept-success
slide-success-show="vm.sendStatus === 'success'"
slide-success-on-confirm="vm.onSuccessConfirm()"
slide-success-on-share="vm.onShareTransaction"
slide-success-hide-on-confirm="true">
<span ng-show="vm.originWallet.m == 1 && (vm.originWallet.canSign() || vm.originWallet.isPrivKeyExternal())" translate>Payment Sent</span>
<span ng-show="vm.originWallet.m > 1 && (vm.originWallet.canSign() || vm.originWallet.isPrivKeyExternal())" translate>Proposal Created</span>

View file

@ -23,107 +23,11 @@
<div ng-show="!hasWallets" translate>To get started, you'll need to create a bitcoin wallet and get some bitcoin.</div>
<div class="padding buttons">
<button class="button button-standard button-green" ng-click="buyBitcoin()" ng-show="!walletsWithFunds.length" translate>Buy Bitcoin now</button>
<button class="button button-standard button-white" ng-click="showMyAddress()" ng-show="!walletsWithFunds.length" translate>Show my address</button>
<button class="button button-standard button-green" ng-click="createWallet()" ng-show="!hasWallets" translate>Create bitcoin wallet</button>
<button class="button button-standard button-shapeshift track_shapeshift_start_click" ng-click="shapeshift()" ng-show="walletsWithFunds.length" translate>Start ShapeShift</button>
</div>
</div>
</div>
<div class="third-party-notice" translate>This service is provided by the third-party ShapeShift, who will charge a small fee for the service. The fee will be shown before you start the transaction.</div>
<shapeshift-coin-trader class="ng-hide" ng-show="fromWallets.length > 0 && toWallets.length > 0">
<div class="list card">
<div class="item item-heading">
<span translate><strong>From</strong></span>
</div>
<div class="item wallet-selector" ng-click="showFromWalletSelector()" ng-if="fromWallet">
<a ng-if="fromWallet" class="item item-sub item-icon-left item-big-icon-left item-icon-right">
<i class="icon big-icon-svg" ng-include="'views/includes/fromWalletIcon.html'"></i>
<span>
{{fromWallet.name || fromWallet.id}}
</span>
<p>
<span ng-if="!fromWallet.balanceHidden"> {{fromWallet.status.totalBalanceStr}} </span>
<span ng-if="fromWallet.balanceHidden" translate>[Balance Hidden]</span>
<span class="tab-home__wallet__multisig-number" ng-if="fromWallet.n > 1">
{{fromWallet.m}}-of-{{fromWallet.n}}
</span>
<span class="assertive" ng-if="fromWallet.error">{{fromWallet.error}}</span>
&nbsp;
</p>
<i ng-if="!singleFromWallet" class="icon bp-arrow-right"></i>
</a>
</div>
<div class="item item-heading">
<span translate><strong>To</strong></span>
</div>
<div class="item wallet-selector" ng-click="showToWalletSelector()" ng-if="toWallet">
<a ng-if="toWallet" class="item item-sub item-icon-left item-big-icon-left item-icon-right">
<i class="icon big-icon-svg" ng-include="'views/includes/toWalletIcon.html'"></i>
<span>
{{toWallet.name || toWallet.id}}
</span>
<p>
<span ng-if="!toWallet.balanceHidden"> {{toWallet.status.totalBalanceStr}} </span>
<span ng-if="toWallet.balanceHidden" translate>[Balance Hidden]</span>
<span class="tab-home__wallet__multisig-number" ng-if="toWallet.n > 1">
{{toWallet.m}}-of-{{toWallet.n}}
</span>
<span class="assertive" ng-if="toWallet.error">{{toWallet.error}}</span>
&nbsp;
</p>
<i ng-if="!singleToWallet" class="icon bp-arrow-right"></i>
</a>
</div>
<div class="item item-heading">
Rate: {{rateString}}
</div>
</div>
<shapeshift-coin-selector
coins="coins"
label="'Return Address'"
get-market-data="getMarketDataIn"
market-data="marketData"
selected-coin="fromWallet.coin"
coin-address="fromWalletAddress"
wallet-id="fromWallet.id"
amount="amount"
direction="'in'">
</shapeshift-coin-selector>
<br/>
<shapeshift-coin-selector
coins="coins"
label="'Withdrawal Address'"
get-market-data="getMarketDataOut"
selected-coin="toWallet.coin"
coin-address="toWalletAddress"
wallet-id="toWallet.id"
direction="'out'">
</shapeshift-coin-selector>
<shapeshift-coin-error ssError="ssError"></shapeshift-coin-error>
<!--<shapeshift-coin-deposit-info deposit-status="DepositStatus" deposit-info="depositInfo"></shapeshift-coin-deposit-info>-->
<shapeshift-coin-shift-button shift-it="shiftIt" shift-state="ShiftState"></shapeshift-coin-shift-button>
</shapeshift-coin-trader>
</ion-content>
<!--<wallet-selector-->
<!--wallet-selector-title="fromWalletSelectorTitle"-->
<!--wallet-selector-wallets="fromWallets"-->
<!--wallet-selector-selected-wallet="fromWallet"-->
<!--wallet-selector-show="showFromWallets"-->
<!--wallet-selector-on-select="onFromWalletSelect"-->
<!--wallet-selector-always-display-bitcoin-core="true">-->
<!--</wallet-selector>-->
<!--<wallet-selector-->
<!--wallet-selector-title="toWalletSelectorTitle"-->
<!--wallet-selector-wallets="toWallets"-->
<!--wallet-selector-selected-wallet="toWallet"-->
<!--wallet-selector-show="showToWallets"-->
<!--wallet-selector-on-select="onToWalletSelect"-->
<!--wallet-selector-always-display-bitcoin-core="true">-->
<!--</wallet-selector>-->
<!--</ion-view>-->

View file

@ -50,7 +50,7 @@
<div class="col-60">
<button class="button button-standard button-primary button-outline" ng-click="startWalletToWalletTransfer()">
<img src="img/icon-w2w.svg"/><br/>
<span translate>Wallet to Wallet Transfer</span>
<span translate>Transfer between wallets</span>
</button>
</div>
</div>