Compare commits

...

46 commits

Author SHA1 Message Date
Jean-Baptiste Dominguez
63693362c4
Merge pull request #366 from Bitcoin-com/wallet/dev
5.1-rc4
2018-09-26 21:47:03 +02:00
Jean-Baptiste Dominguez
e14ab5dab3
Update appConfig.json
rc4
2018-09-26 21:46:07 +02:00
Jean-Baptiste Dominguez
77de49ca89
Merge pull request #365 from Bitcoin-com/wallet/sprint/21
Wallet/sprint/21
2018-09-26 21:44:39 +02:00
Jean-Baptiste Dominguez
464ed67ed5
Merge pull request #364 from Bitcoin-com/wallet/task/546
546 - Handle shapeshift error
2018-09-26 21:44:12 +02:00
Jean-Baptiste Dominguez
dd61e72bcf Fix go back anyway 2018-09-26 21:42:35 +02:00
Jean-Baptiste Dominguez
6c0cf4d622 Add a link to shapeshift in case it doesn't work 2018-09-26 21:35:30 +02:00
Jean-Baptiste Dominguez
b0283cee18
Merge pull request #363 from Bitcoin-com/wallet/task/546
546 - Fixes lost after the merge + fix send flow
2018-09-26 21:07:22 +02:00
Jean-Baptiste Dominguez
8f67fde60b Fix - init wallet list 2018-09-26 21:02:03 +02:00
Jean-Baptiste Dominguez
621c60a2ce Set thirdParty on the sendflow 2018-09-26 20:15:25 +02:00
Jean-Baptiste Dominguez
7a78eb1261
Merge branch 'wallet/sprint/21' into wallet/task/546 2018-09-26 15:35:00 +02:00
Jean-Baptiste Dominguez
4f7004f5a3 Set variables before enter in the screen. (Fix lost after merging) 2018-09-26 15:31:48 +02:00
Jean-Baptiste Dominguez
390f8b2427 Solved conflicts 2018-09-26 15:09:14 +02:00
Jean-Baptiste Dominguez
b9a4e11e69
Merge pull request #361 from Bitcoin-com/wallet/task/500
500 - Now handles URIs beginning with 'bch:'.
2018-09-26 12:01:55 +02:00
Brendon Duncan
eacf207b2c Merge with origin. 2018-09-26 16:33:01 +12:00
Brendon Duncan
a426a5abc0 Now handles URIs that begin with 'bch:'. 2018-09-26 16:27:47 +12:00
Brendon Duncan
a9b84f3942 IIFE to reduce conflicts for merging. 2018-09-26 15:39:12 +12:00
Brendon Duncan
6bf0de9974 Remove debug logging and other cleanup. 2018-09-26 15:31:29 +12:00
Brendon Duncan
5b7eb57d76 Fix for sending ShapeShift transaction to Shapeshift deposit address, rather than own wallet. 2018-09-26 15:12:37 +12:00
Brendon Duncan
c657cc5bfb Naming anonymous functions for easier debugging. 2018-09-26 15:11:35 +12:00
Jean-Baptiste Dominguez
fac91ff4f3 Merge branch 'wallet/task/546' of https://github.com/Bitcoin-com/Wallet into wallet/task/546 2018-09-25 16:48:57 +02:00
Jean-Baptiste Dominguez
b5cd9faca7 Shapeshift, return address should be verified with the coin out 2018-09-25 16:48:42 +02:00
Sebastiaan Pasma
c3043e6824
Merge remote-tracking branch 'origin/wallet/prod' into wallet/prod 2018-09-24 17:54:11 +02:00
Sebastiaan Pasma
f0d020f538
config version update 2018-09-24 17:49:37 +02:00
Sebastiaan Pasma
d410acbba2
Merge remote-tracking branch 'origin/wallet/sprint/21' into wallet/dev 2018-09-24 17:45:38 +02:00
Sebastiaan Pasma
acacb5660b
Merge pull request #359 from Bitcoin-com/wallet/task/593
593 - Fix when the cache is empty
2018-09-24 17:25:15 +02:00
Sebastiaan Pasma
fb41fca601
Also apply fix to addLatestTransactions function 2018-09-24 17:13:28 +02:00
Jean-Baptiste Dominguez
8039ea26da Merge branch 'wallet/task/593' of https://github.com/Bitcoin-com/Wallet into wallet/task/593 2018-09-24 16:54:53 +02:00
Jean-Baptiste Dominguez
5401bf9a09 Fix the case where the cache is empty 2018-09-24 16:54:40 +02:00
Sebastiaan Pasma
0598a07af7
Merge pull request #354 from Bitcoin-com/wallet/task/593
593 - Bugfix for Confirmation-changes not applied to unconfirmed transactions
2018-09-24 14:06:02 +02:00
Jean-Baptiste Dominguez
9f904bb098
Merge pull request #358 from Bitcoin-com/wallet/sprint/21
android fix
2018-09-24 12:32:56 +02:00
Jean-Baptiste Dominguez
37596c3a25
Merge pull request #355 from Bitcoin-com/wallet/task/595
595 - Get Android build working again
2018-09-24 12:29:24 +02:00
Jean-Baptiste Dominguez
dbe920a67b
Merge pull request #357 from Bitcoin-com/wallet/task/546
546 - Bugfix for crashing when scanning BitPay invoice URL
2018-09-24 11:47:16 +02:00
Brendon Duncan
d2178d670f Fix identification of BitPay. 2018-09-23 21:05:26 -07:00
Brendon Duncan
8f8027d573 Reverse out bugfix. 2018-09-23 20:56:15 -07:00
Brendon Duncan
babdc8a13b Restored production setting for page size. 2018-09-23 20:14:42 -07:00
Brendon Duncan
6452a0c7f4 Handling JSON exception. 2018-09-23 13:06:36 -07:00
Brendon Duncan
1b0541a7b5 Return error from Shapeshift when pairs are unavailable. 2018-09-22 22:22:06 -07:00
Brendon Duncan
c661798cd1 Android Debug and release builds work when Gradle 3.3 is in PATH. 2018-09-22 17:45:19 -07:00
Brendon Duncan
a5a1d3edb6 Remove debug logging. 2018-09-22 11:07:24 -07:00
Brendon Duncan
0ba4db83e0 Handling confirmation updates correctly for early transactions. 2018-09-22 11:03:26 -07:00
Jean-Baptiste Dominguez
10b9b0c5c9
Merge pull request #353 from Bitcoin-com/wallet/dev
Wallet/dev
2018-09-22 12:01:47 +02:00
Jean-Baptiste Dominguez
9e01303f37
Fix erase from a merge 2018-09-22 12:00:58 +02:00
Jean-Baptiste Dominguez
e3a82a1118
Reactivate shapeshift 2018-09-22 12:00:10 +02:00
Jean-Baptiste Dominguez
ef8e7ac501
Fix RC version 2018-09-22 11:59:18 +02:00
Jean-Baptiste Dominguez
3b0b85f234
Merge pull request #352 from Bitcoin-com/wallet/prod
Wallet/prod
2018-09-22 11:58:39 +02:00
Jean-Baptiste Dominguez
5d1ed16ab5
Merge pull request #348 from Bitcoin-com/master
Merge the hotfixes
2018-09-22 11:01:14 +02:00
14 changed files with 104 additions and 76 deletions

View file

@ -57,7 +57,7 @@ module.exports = function(grunt) {
command: 'node ./util/buildExternalServices.js'
},
get_nwjs_for_pkg: {
command: 'if [ ! -d ./cache/0.19.5-pkg/osx64/nwjs.app ]; then cd ./cache; curl https://dl.nwjs.io/v0.19.5-mas-beta/nwjs-mas-v0.19.5-osx-x64.zip --output nwjs.zip; unzip nwjs.zip; mkdir -p ./0.19.5-pkg/osx64; cp -R ./nwjs-mas-v0.19.5-osx-x64/nwjs.app ./0.19.5-pkg/osx64/; fi'
command: 'if [ ! -d ./cache/0.19.4/osx64/nwjs.app ]; then mkdir -p ./cache/0.19.4/osx64; curl https://dl.nwjs.io/v0.19.5-mas-beta/nwjs-mas-v0.19.5-osx-x64.zip --output ./cache/nwjs.zip; unzip ./cache/nwjs.zip -d ./cache; cp -R ./cache/nwjs-mas-v0.19.5-osx-x64/nwjs.app ./cache/0.19.4/osx64/; fi'
},
log_android: {
command: 'adb logcat | grep chromium',
@ -71,7 +71,7 @@ module.exports = function(grunt) {
sign_android: {
// When the build log outputs "Built the following apk(s):", it seems to need the filename to start with "android-release".
// It looks like it simply lists all apk files starting with "android-release"
command: 'rm -f platforms/android/build/outputs/apk/android-release-signed-*.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/bitcoin-com-wallet-<%= pkg.fullVersion %>-android-signed-aligned.apk',
command: 'rm -f platforms/android/build/outputs/apk/release/*-android-signed-aligned.apk; jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../bitcoin-com-release-key.jks -signedjar platforms/android/build/outputs/apk/release/android-release-signed.apk platforms/android/build/outputs/apk/release/android-release-unsigned.apk bitcoin-com && zipalign -v 4 platforms/android/build/outputs/apk/release/android-release-signed.apk platforms/android/build/outputs/apk/release/bitcoin-com-wallet-<%= pkg.fullVersion %>-android-signed-aligned.apk',
stdin: true,
},
sign_desktop_dist: {

View file

@ -24,9 +24,9 @@
"windowsAppId": "804636ee-b017-4cad-8719-e58ac97ffa5c",
"pushSenderId": "1036948132229",
"description": "A Secure Bitcoin Wallet",
"version": "5.1.3",
"fullVersion": "5.1-rc2",
"androidVersion": "501003",
"version": "5.1.5",
"fullVersion": "5.1-rc4",
"androidVersion": "501500",
"_extraCSS": "",
"_enabledExtensions": {
"coinbase": false,

View file

@ -77,7 +77,7 @@
</plugin>
<!-- Supported Platforms -->
<engine name="ios" spec="~4.5.3" />
<engine name="android" spec="~6.3.0" />
<engine name="android" spec="~6.4.0" />
<engine name="windows" spec="~5.0.0" />
<!-- Platform Specific Settings -->

View file

@ -1,5 +1,6 @@
ext {
ANDROID_SUPPORT_V4_VERSION = '26.1.0'
ANDROID_SUPPORT_ANNOTATIONS_VERSION = '26.1.0'
}
configurations.all {

View file

@ -30,7 +30,7 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory,
vm.sendableFunds = '';
vm.showSendMaxButton = false;
vm.showSendLimitMaxButton = false;
vm.thirdParty = false;
vm.thirdParty = null;
vm.unit = '';
// Functions
@ -88,11 +88,16 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory,
sendFlowService.state.pop();
}
initCurrencies();
passthroughParams = sendFlowService.state.getClone();
console.log('amount onBeforeEnter after back sendflow ', passthroughParams);
// Init thirdParty, should be done for all the variable
vm.thirdParty = null;
vm.fromWalletId = passthroughParams.fromWalletId;
vm.toWalletId = passthroughParams.toWalletId;
vm.minAmount = parseFloat(passthroughParams.minAmount);

View file

@ -6,7 +6,7 @@ angular
.module('copayApp.controllers')
.controller('reviewController', reviewController);
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) {
function reviewController(addressbookService, externalLinkService, 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 = '';
@ -49,7 +49,7 @@ angular
vm.sendingTitle = gettextCatalog.getString('You are sending');
vm.sendStatus = '';
vm.showAddress = true;
vm.thirdParty = false;
vm.thirdParty = null;
vm.wallet = null;
vm.memoExpanded = false;
@ -79,20 +79,16 @@ angular
$scope.$on("$ionicView.beforeEnter", onBeforeEnter);
function onBeforeEnter(event, data) {
console.log('review onBeforeEnter sendflow ', sendFlowService.state);
$log.debug('reviewController onBeforeEnter sendflow ', sendFlowService.state);
// Reset from last time
vm.memo = '';
vm.thirdParty = null;
defaults = configService.getDefaults();
sendFlowData = sendFlowService.state.getClone();
originWalletId = sendFlowData.fromWalletId;
if (typeof sendFlowData.amount === 'string') {
satoshis = parseInt(sendFlowData.amount, 10);
} else {
satoshis = sendFlowData.amount;
}
toAddress = sendFlowData.toAddress;
destinationWalletId = sendFlowData.toWalletId;
@ -105,11 +101,14 @@ angular
vm.thirdParty = sendFlowData.thirdParty;
switch (vm.thirdParty.id) {
case 'shapeshift':
initShapeshift(function (err) {
initShapeshift(function onInitShapeshift(err) {
if (err) {
// Error stop here
ongoingProcess.set('connectingShapeshift', false);
popupService.showAlert(gettextCatalog.getString('Shapeshift Error'), err.toString(), function () {
popupService.showConfirm(gettextCatalog.getString('Shapeshift Error'), err.toString(), gettextCatalog.getString('Open') + " Shapeshift", gettextCatalog.getString('Go Back'), function onConfirm(hasConfirm) {
if (hasConfirm) {
externalLinkService.open("https://shapeshift.io");
}
$ionicHistory.goBack();
});
} else {
@ -135,7 +134,6 @@ angular
config = configCache;
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;
}
updateSendAmounts();
@ -152,18 +150,18 @@ angular
if (!tx || !vm.originWallet) return;
if (vm.paymentExpired) {
popupService.showAlert(null, gettextCatalog.getString('This bitcoin payment request has expired.', function () {
popupService.showAlert(null, gettextCatalog.getString('This bitcoin payment request has expired.', function onAlert() {
$ionicHistory.goBack();
}));
vm.sendStatus = '';
$timeout(function() {
$timeout(function onTimeout() {
$scope.$apply();
});
return;
}
ongoingProcess.set('creatingTx', true, statusChangeHandler);
getTxp(lodash.clone(tx), vm.originWallet, false, function(err, txp) {
getTxp(lodash.clone(tx), vm.originWallet, false, function onGetTxp(err, txp) {
ongoingProcess.set('creatingTx', false, statusChangeHandler);
if (err) return;
@ -180,12 +178,12 @@ angular
if (!vm.originWallet.canSign() && !vm.originWallet.isPrivKeyExternal()) {
$log.info('No signing proposal: No private key');
return walletService.onlyPublish(vm.originWallet, txp, function(err) {
return walletService.onlyPublish(vm.originWallet, txp, function onOnlyPublish(err) {
if (err) setSendError(err);
}, statusChangeHandler);
}
walletService.publishAndSign(vm.originWallet, txp, function(err, txp) {
walletService.publishAndSign(vm.originWallet, txp, function onPublishAndSign(err, txp) {
if (err) return setSendError(err);
if (config.confirmedTxsNotifications && config.confirmedTxsNotifications.enabled) {
txConfirmNotification.subscribe(vm.originWallet, {
@ -199,7 +197,7 @@ angular
confirmTx(function(nok) {
if (nok) {
vm.sendStatus = '';
$timeout(function() {
$timeout(function onTimeout() {
$scope.$apply();
});
return;
@ -256,7 +254,6 @@ angular
};
function createVanityTransaction(data) {
console.log('createVanityTransaction()');
var configFeeLevel = config.wallet.settings.feeLevel ? config.wallet.settings.feeLevel : 'normal';
// Grab stateParams
@ -280,6 +277,9 @@ angular
txp: {},
};
if (vm.thirdParty && vm.thirdParty.id === "shapeshift") {
tx.toAddress = vm.thirdParty.toAddress;
}
if (data.stateParams.requiredFeeRate) {
vm.usingMerchantFee = true;
@ -293,29 +293,35 @@ angular
var B = tx.coin === 'bch' ? bitcoreCash : bitcore;
var networkName;
try {
if (vm.destination.kind === 'wallet') { // This is a wallet-to-wallet transfer
// Final destination is a wallet, but this transaction must go to an address for the first stage of the exchange.
if (sendFlowData.thirdParty && sendFlowData.thirdParty.id === 'shapeshift') {
networkName = (new B.Address(tx.toAddress)).network.name;
tx.network = networkName;
setupTx(tx);
} else if (vm.destination.kind === 'wallet') { // This is a wallet-to-wallet transfer
ongoingProcess.set('generatingNewAddress', true);
var toWallet = profileService.getWallet(destinationWalletId);
// We need an address to send to, so we ask the walletService to create a new address for the toWallet.
console.log('Getting address for wallet...');
walletService.getAddress(toWallet, true, function onWalletAddress(err, addr) {
console.log('getAddress cb called', err);
if (err) {
$log.error('Error getting address for wallet.', err);
throw new Error(err.message);
}
ongoingProcess.set('generatingNewAddress', false);
tx.toAddress = addr;
networkName = (new B.Address(tx.toAddress)).network.name;
tx.network = networkName;
console.log('calling setupTx() for wallet.');
setupTx(tx);
});
} else { // This is a Wallet-to-address transfer
networkName = (new B.Address(tx.toAddress)).network.name;
tx.network = networkName;
console.log('calling setupTx() for address.');
setupTx(tx);
}
} catch (e) {
console.error('Error setting up tx', e);
$log.error('Error setting up tx', e);
var message = gettextCatalog.getString('Invalid address');
popupService.showAlert(null, message, function () {
$ionicHistory.nextViewOptions({
@ -385,7 +391,7 @@ angular
}
txp.excludeUnconfirmedUtxos = !tx.spendUnconfirmed;
txp.dryRun = dryRun;
walletService.createTx(wallet, txp, function(err, ctxp) {
walletService.createTx(wallet, txp, function onCreateTx(err, ctxp) {
if (err) {
setSendError(err);
return cb(err);
@ -405,7 +411,7 @@ angular
var walletStatus = null;
if (wallet.status && wallet.status.isValid) {
walletStatus = wallet.status;
} else if (wallet.cachedStatus.isValid) {
} else if (wallet.cachedStatus && wallet.cachedStatus.isValid) {
walletStatus = wallet.cachedStatus;
}
@ -444,7 +450,7 @@ angular
}
// Check if the recipient is a contact
addressbookService.get(originCoin + address, function(err, contact) {
addressbookService.get(originCoin + address, function onGetContact(err, contact) {
if (!err && contact) {
handleDestinationAsAddressOfContact(contact);
} else {
@ -517,7 +523,6 @@ angular
vm.destination.color = toWallet.color;
vm.destination.currency = toWallet.coin.toUpperCase();
ongoingProcess.set('connectingShapeshift', true);
walletService.getAddress(vm.originWallet, false, function onReturnWalletAddress(err, returnAddr) {
if (err) {
@ -535,9 +540,8 @@ angular
if (err) {
return cb(err);
} else {
vm.destination.kind = 'shapeshift';
vm.destination.address = toAddress;
tx.toAddress = shapeshiftData.toAddress;
// Want it to appear like a wallet-to-wallet transfer, so don't set the main toAddress.
vm.thirdParty.toAddress = shapeshiftData.toAddress;
vm.memo = 'ShapeShift Order:\nhttps://www.shapeshift.io/#/status/' + shapeshiftData.orderId;
vm.memoExpanded = !!vm.memo;
ongoingProcess.set('connectingShapeshift', false);
@ -572,7 +576,6 @@ angular
}, 1000);
function setExpirationTime() {
console.log('setExpirationTime()');
var now = Math.floor(Date.now() / 1000);
if (now > expirationTime) {
@ -690,7 +693,7 @@ angular
$timeout(function() {
$scope.$apply();
});
popupService.showAlert(gettextCatalog.getString('Error at confirm'), bwcError.msg(msg), function () {
popupService.showAlert(gettextCatalog.getString('Error at confirm'), bwcError.msg(msg), function onAlert() {
$ionicHistory.goBack();
});
};
@ -702,7 +705,7 @@ angular
tx.displayAddress = tx.toAddress;
}
addressbookService.get(tx.coin+tx.toAddress, function(err, addr) { // Check if the recipient is a contact
addressbookService.get(tx.coin+tx.toAddress, function onGetContact(err, addr) { // Check if the recipient is a contact
if (!err && addr) {
tx.toName = addr.name;
tx.toEmail = addr.email;
@ -721,7 +724,7 @@ angular
updateTx(tx, vm.originWallet, {
dryRun: true
}, function(err) {
$timeout(function() {
$timeout(function onTimeout() {
$scope.$apply();
}, 10);
@ -848,7 +851,7 @@ angular
// refresh();
var feeServiceLevel = usingMerchantFee && vm.originWallet.coin == 'btc' ? 'urgent' : tx.feeLevel;
feeService.getFeeRate(vm.originWallet.coin, tx.network, feeServiceLevel, function(err, feeRate) {
feeService.getFeeRate(vm.originWallet.coin, tx.network, feeServiceLevel, function onGetFeeRate(err, feeRate) {
if (err) {
ongoingProcess.set('calculatingFee', false);
return cb(err);
@ -867,7 +870,7 @@ angular
tx.feeRate = feeRate;
}
getSendMaxInfo(lodash.clone(tx), wallet, function(err, sendMaxInfo) {
getSendMaxInfo(lodash.clone(tx), wallet, function onGetSendmaxInfo(err, sendMaxInfo) {
if (err) {
ongoingProcess.set('calculatingFee', false);
var msg = gettextCatalog.getString('Error getting SendMax information');
@ -881,7 +884,7 @@ angular
if (tx.sendMax && sendMaxInfo.amount == 0) {
ongoingProcess.set('calculatingFee', false);
setNotReady(gettextCatalog.getString('Insufficient confirmed funds'));
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Not enough funds for fee'), function () {
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Not enough funds for fee'), function onAlert() {
$ionicHistory.goBack();
});
return cb('no_funds');
@ -906,8 +909,7 @@ angular
return cb();
}
console.log('calling getTxp() from getSendMaxInfo cb.');
getTxp(lodash.clone(tx), wallet, opts.dryRun, function(err, txp) {
getTxp(lodash.clone(tx), wallet, opts.dryRun, function onGetTxp(err, txp) {
ongoingProcess.set('calculatingFee', false);
if (err) {
if (err.message == 'Insufficient funds') {
@ -919,7 +921,7 @@ angular
}
txp.feeStr = txFormatService.formatAmountStr(wallet.coin, txp.fee);
txFormatService.formatAlternativeStr(wallet.coin, txp.fee, function(v) {
txFormatService.formatAlternativeStr(wallet.coin, txp.fee, function onFormatAlternativeStr(v) {
// txp.alternativeFeeStr = v;
// if (txp.alternativeFeeStr.substring(0, 4) == '0.00')
// txp.alternativeFeeStr = '< ' + txp.alternativeFeeStr;
@ -929,8 +931,6 @@ angular
vm.feeLessThanACent = true;
}
console.log("fiat", vm.feeFiat);
});
var per = (txp.fee / (txp.amount + txp.fee) * 100);
@ -939,14 +939,11 @@ angular
txp.feeToHigh = per > FEE_TOO_HIGH_LIMIT_PERCENTAGE;
vm.feeCrypto = (unitFromSat * txp.fee).toFixed(8);
vm.feeIsHigh = txp.feeToHigh;
console.log("crypto", vm.feeCrypto);
tx.txp[wallet.id] = txp;
$log.debug('Confirm. TX Fully Updated for wallet:' + wallet.id, tx);
vm.readyToSend = true;
updateSendAmounts();
console.log('readyToSend:', vm.readyToSend);
$scope.$apply();
return cb();

View file

@ -52,9 +52,6 @@ angular
$scope.specificAmount = $scope.specificAlternativeAmount = '';
$scope.isPaymentRequest = true;
}
if ($scope.params.thirdParty) {
$scope.thirdParty = $scope.params.thirdParty;
}
};
function onEnter (event, data) {
@ -62,7 +59,7 @@ angular
$scope.selectedPriceDisplay = config.wallet.settings.priceDisplay;
});
if ($scope.thirdParty) {
if ($scope.params.thirdParty) {
// Third party services specific logic
handleThirdPartyIfShapeshift();
}
@ -102,8 +99,8 @@ angular
}
function handleThirdPartyIfShapeshift() {
console.log($scope.thirdParty, $scope.coin);
if ($scope.thirdParty.id === 'shapeshift' && $scope.type === 'destination') { // Shapeshift wants to know the
console.log($scope.params.thirdParty, $scope.coin);
if ($scope.params.thirdParty.id === 'shapeshift' && $scope.type === 'destination') { // Shapeshift wants to know the
$scope.coin = profileService.getWallet(fromWalletId).coin;
if ($scope.coin === 'bch') {
$scope.coin = 'btc';
@ -117,6 +114,8 @@ angular
var walletsAll = [];
var walletsSufficientFunds = [];
$scope.walletsInsufficientFunds = []; // For origin screen
$scope.walletsBtc = [];
$scope.walletsBch = [];
if ($scope.type === 'origin') {
$scope.headerTitle = gettextCatalog.getString('Choose a wallet to send from');

View file

@ -151,6 +151,7 @@
hasPassphrase: false,
type: 1,
},
isTestnet: false,
isValid: false,
label: '',
message: '',
@ -170,7 +171,6 @@
"req-param0": '',
"req-param1": ''
},
testnet: false,
url: '' // For BIP70
}
@ -204,7 +204,13 @@
} else if (/^(?:bitcoincash)|(?:bitcoin-cash)$/.test(preColonLower)) {
parsed.coin = 'bch';
parsed.test = false;
parsed.isTestnet = false;
addressAndParams = colonSplit[2].trim();
console.log('Is bch');
} else if (/^(?:bch)$/.test(preColonLower)) {
parsed.coin = 'bch';
parsed.isTestnet = false;
addressAndParams = colonSplit[2].trim();
console.log('Is bch');

View file

@ -30,7 +30,7 @@ describe('bitcoinUriService', function() {
expect(parsed.isValid).toBe(true);
expect(parsed.coin).toBe('bch');
expect(parsed.publicAddress).toBeUndefined();
expect(parsed.isTestnet).toBeUndefined();
expect(parsed.isTestnet).toBe(false);
expect(parsed.url).toBe('https://bitpay.com/i/SmHdie5dvBnG5kouZzEPzu');
});
@ -171,6 +171,16 @@ describe('bitcoinUriService', function() {
expect(parsed.isTestnet).toBe(false);
});
it('legacy address with bch prefix', function() {
var parsed = bitcoinUriService.parse('bch:19yUdM2H7sADrabR6Afu9zTpmwqr6WYprX');
expect(parsed.isValid).toBe(true);
expect(parsed.coin).toBe('bch');
expect(parsed.publicAddress.legacy).toBe('19yUdM2H7sADrabR6Afu9zTpmwqr6WYprX');
expect(parsed.isTestnet).toBe(false);
});
it('cashAddr testnet with prefix', function() {
var parsed = bitcoinUriService.parse('bchtest:qpcz6pmurq9ctg5848trzz9zmuuygj4q5qam7ph3gt');
@ -191,6 +201,16 @@ describe('bitcoinUriService', function() {
expect(parsed.isTestnet).toBe(false);
});
it('cashAddr with bch prefix', function() {
var parsed = bitcoinUriService.parse('bch:qpqzqtjqqc00nsxj0e3kevz65ujg4yt5z5w99jap5f');
expect(parsed.isValid).toBe(true);
expect(parsed.coin).toBe('bch');
expect(parsed.publicAddress.cashAddr).toBe('qpqzqtjqqc00nsxj0e3kevz65ujg4yt5z5w99jap5f');
expect(parsed.isTestnet).toBe(false);
});
it('cashAddr with dash', function() {
var parsed = bitcoinUriService.parse('bitcoin-cash:qpshfu3dk5s3e7zdcgdcun6xgxtra6uyxs7g580js0');

View file

@ -52,7 +52,7 @@ angular
// Detect some merchant that we know
if (payProData.memo.indexOf('eGifter') > -1) {
name = 'eGifter'
} else if (paymentUrl.indexOf('https://bitpay.com') > -1) {
} else if (payProData.url.indexOf('https://bitpay.com') > -1) {
name = 'BitPay';
}

View file

@ -5,7 +5,7 @@ angular.module('copayApp.services').factory('servicesService', function(configSe
name: 'shapeshift',
title: 'Shapeshift',
icon: 'icon-shapeshift',
href: 'https://shapeshift.io/'
sref: 'tabs.shapeshift'
}];
root.register = function(serviceInfo) {

View file

@ -24,7 +24,7 @@ var ShapeShift = (function() {
var parsedResponse = JP(xmlhttp.responseText);
cb.apply(null, [parsedResponse]);
} else {
cb.apply(null, [new Error('Request Failed')])
cb.apply(null, [new Error('Request Failed')]);
}
}
};

View file

@ -63,6 +63,7 @@ angular
} else if (amount > service.marketData.maxLimit) {
cb(new Error(gettextCatalog.getString('Amount is above the limit')));
} else {
// Init service data
service.withdrawalAddress = withdrawalAddress;
service.returnAddress = returnAddress;
@ -72,7 +73,7 @@ angular
// Check the address
shapeshiftApiService
.ValidateAddress(withdrawalAddress, coinOut)
.ValidateAddress(returnAddress, coinOut)
.then(function onSuccess(response) {
if (response && response.isvalid) {
// Prepare the transaction shapeshift side

View file

@ -7,8 +7,8 @@
.factory('walletHistoryService', walletHistoryService);
function walletHistoryService(configService, storageService, lodash, $log, txFormatService) {
//var PAGE_SIZE = 50;
var PAGE_SIZE = 20; // For dev only
var PAGE_SIZE = 50;
//var PAGE_SIZE = 20; // For dev only
// How much to overlap on each end of the page, for mitigating inconsistent sort order.
var PAGE_OVERLAP_FRACTION = 0.2;
var PAGE_OVERLAP = Math.floor(PAGE_SIZE * PAGE_OVERLAP_FRACTION);
@ -28,8 +28,8 @@
function addEarlyTransactions(walletId, cachedTxs, newTxs) {
var cachedTxIndexFromId = {};
cachedTxs.forEach(function forCachedTx(tx){
cachedTxIndexFromId[tx.txid] = true;
cachedTxs.forEach(function forCachedTx(tx, txIndex){
cachedTxIndexFromId[tx.txid] = txIndex;
});
var confirmationsUpdated = false;
@ -49,8 +49,9 @@
var overlappingTxFraction = overlappingTxsCount / Math.min(cachedTxs.length, PAGE_OVERLAP);
console.log('overlappingTxFraction:', overlappingTxFraction);
console.log('overlappingTxsCount:', overlappingTxsCount);
if (overlappingTxFraction >= MIN_KNOWN_TX_OVERLAP_FRACTION) { // We are good
if (overlappingTxFraction >= MIN_KNOWN_TX_OVERLAP_FRACTION || (someTransactionsWereNew && overlappingTxsCount === 0)) { // We are good
if (someTransactionsWereNew) {
saveTxHistory(walletId, cachedTxs);
} else if (confirmationsUpdated) {
@ -93,7 +94,7 @@
var overlappingTxFraction = overlappingTxsCount / Math.min(cachedTxs.length, PAGE_OVERLAP);
if (overlappingTxFraction >= MIN_KNOWN_TX_OVERLAP_FRACTION) { // We are good
if (overlappingTxFraction >= MIN_KNOWN_TX_OVERLAP_FRACTION || (someTransactionsWereNew && overlappingTxsCount === 0)) { // We are good
if (someTransactionsWereNew) {
var allTxs = uniqueNewTxs.concat(cachedTxs);
saveTxHistory(walletId, allTxs);
@ -147,7 +148,6 @@
* @param {function(error, txs)} cb - txs is always an array, may be empty
*/
function getCachedTxHistory(walletId, cb) {
console.log('txhistory updateLocalTxHistoryByPage()');
storageService.getTxHistory(walletId, function onGetTxHistory(err, txHistoryString){
if (err) {
return cb(err, []);
@ -230,7 +230,6 @@
}
function updateLocalTxHistoryByPage(wallet, getLatest, flushCacheOnNew, cb) {
console.log('txhistory updaetLocalTxHistoryByPage()');
if (flushCacheOnNew) {
fetchTxHistoryByPage(wallet, 0, function onFetchTxHistory(err, txs){
if (err) {