Bitcoin Cash URI in incoming data now more permissive with the prefix.
This commit is contained in:
parent
89f4328f8e
commit
8a1e3f2297
1 changed files with 8 additions and 10 deletions
|
|
@ -145,6 +145,7 @@ angular.module('copayApp.services').factory('incomingData', function(bitcoinUriS
|
||||||
|
|
||||||
data = sanitizeUri(data);
|
data = sanitizeUri(data);
|
||||||
|
|
||||||
|
var addr = '';
|
||||||
// Bitcoin URL
|
// Bitcoin URL
|
||||||
if (bitcore.URI.isValid(data)) {
|
if (bitcore.URI.isValid(data)) {
|
||||||
var coin = 'btc';
|
var coin = 'btc';
|
||||||
|
|
@ -167,18 +168,18 @@ angular.module('copayApp.services').factory('incomingData', function(bitcoinUriS
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
// Cash URI
|
// Cash URI
|
||||||
} else if (bitcoreCash.URI.isValid(data)) {
|
} else if (allParsed.isValid && allParsed.publicAddress && allParsed.publicAddress.cashAddr) {
|
||||||
var coin = 'bch';
|
var coin = 'bch';
|
||||||
var parsed = new bitcoreCash.URI(data);
|
|
||||||
|
var prefix = allParsed.testnet ? 'bchtest:' : 'bitcoincash:';
|
||||||
var addr = parsed.address ? parsed.address.toString() : '';
|
addr = bitcoinCashJsService.readAddress(prefix + allParsed.publicAddress.cashAddr).legacy;
|
||||||
var message = parsed.message;
|
var message = parsed.message;
|
||||||
|
|
||||||
var amount = parsed.amount ? parsed.amount : '';
|
var amount = parsed.amount ? parsed.amount : '';
|
||||||
|
|
||||||
// paypro not yet supported on cash
|
// paypro not yet supported on cash
|
||||||
if (parsed.r) {
|
if (allParsed.url) {
|
||||||
payproService.getPayProDetails(parsed.r, coin, function(err, details) {
|
payproService.getPayProDetails(allParsed.url, coin, function(err, details) {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (addr && amount)
|
if (addr && amount)
|
||||||
goSend(addr, amount, message, coin, serviceId, serviceData);
|
goSend(addr, amount, message, coin, serviceId, serviceData);
|
||||||
|
|
@ -402,7 +403,7 @@ angular.module('copayApp.services').factory('incomingData', function(bitcoinUriS
|
||||||
|
|
||||||
function handlePayPro(payProData, coin) {
|
function handlePayPro(payProData, coin) {
|
||||||
|
|
||||||
console.log(payProData);
|
console.log('payProData', payProData);
|
||||||
|
|
||||||
var toAddr = payProData.toAddress;
|
var toAddr = payProData.toAddress;
|
||||||
var amount = payProData.amount;
|
var amount = payProData.amount;
|
||||||
|
|
@ -457,9 +458,6 @@ angular.module('copayApp.services').factory('incomingData', function(bitcoinUriS
|
||||||
stateParams.requiredFeeRate = thirdPartyData.requiredFeeRate * 1024;
|
stateParams.requiredFeeRate = thirdPartyData.requiredFeeRate * 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This does not make sense, thirdPartyData gets added by stateParams below
|
|
||||||
//sendFlowService.pushState(thirdPartyData);
|
|
||||||
|
|
||||||
scannerService.pausePreview();
|
scannerService.pausePreview();
|
||||||
$state.go('tabs.send', {}, {
|
$state.go('tabs.send', {}, {
|
||||||
'reload': true,
|
'reload': true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue