Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,6 @@ www/img/app
/GoogleService-Info.plist
/google-services.json
src/js/generated

##Intellij
.idea
6 changes: 3 additions & 3 deletions app-template/bitcoincom/appConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"windowsAppId": "804636ee-b017-4cad-8719-e58ac97ffa5c",
"pushSenderId": "1036948132229",
"description": "A Secure Bitcoin Wallet",
"version": "5.2.0",
"fullVersion": "5.2-rc1",
"androidVersion": "502000",
"version": "5.2.1",
"fullVersion": "5.2-hotfix1",
"androidVersion": "502100",
"_extraCSS": "",
"_enabledExtensions": {
"coinbase": false,
Expand Down
6 changes: 3 additions & 3 deletions src/js/controllers/customAmount.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ angular.module('copayApp.controllers').controller('customAmountController', func
}

if ($scope.wallet.coin == 'bch') {
currentAddressSocket = new WebSocket('wss://ws.blockchain.info/bch/inv');
currentAddressSocket = new WebSocket('ws://47.254.143.172:80/v1/address');
} else {
currentAddressSocket = new WebSocket('wss://ws.blockchain.info/inv/');
currentAddressSocket = new WebSocket('ws://47.254.143.172:81/v1/address');
}

paymentSubscriptionObj.addr = address;
Expand All @@ -142,7 +142,7 @@ angular.module('copayApp.controllers').controller('customAmountController', func
var receivedPayment = function(data) {
data = JSON.parse(data);

if (data.op == 'utx') {
if (data) {
$scope.showingPaymentReceived = true;
$scope.$apply();
}
Expand Down
56 changes: 7 additions & 49 deletions src/js/controllers/tab-receive.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi

if ($scope.wallet.coin === 'bch') {
// listen to bch address
currentAddressSocket = new WebSocket('wss://ws.blockchain.info/bch/inv');
currentAddressSocket = new WebSocket('ws://47.254.143.172:80/v1/address');
paymentSubscriptionObj.addr = $scope.addrBchLegacy;
} else {
// listen to btc address
currentAddressSocket = new WebSocket('wss://ws.blockchain.info/inv');
currentAddressSocket = new WebSocket('ws://47.254.143.172:81/v1/address');
paymentSubscriptionObj.addr = $scope.addr;
}

Expand Down Expand Up @@ -109,55 +109,13 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi

var receivedPayment = function(data) {
data = JSON.parse(data);
//example payment data
/*{
"op": "utx",
"x": {
"lock_time": 0,
"ver": 1,
"size": 192,
"inputs": [
{
"sequence": 4294967295,
"prev_out": {
"spent": true,
"tx_index": 99005468,
"type": 0,
"addr": "1BwGf3z7n2fHk6NoVJNkV32qwyAYsMhkWf",
"value": 65574000,
"n": 0,
"script": "76a91477f4c9ee75e449a74c21a4decfb50519cbc245b388ac"
},
"script": "483045022100e4ff962c292705f051c2c2fc519fa775a4d8955bce1a3e29884b2785277999ed02200b537ebd22a9f25fbbbcc9113c69c1389400703ef2017d80959ef0f1d685756c012102618e08e0c8fd4c5fe539184a30fe35a2f5fccf7ad62054cad29360d871f8187d"
}
],
"time": 1440086763,
"tx_index": 99006637,
"vin_sz": 1,
"hash": "0857b9de1884eec314ecf67c040a2657b8e083e1f95e31d0b5ba3d328841fc7f",
"vout_sz": 1,
"relayed_by": "127.0.0.1",
"out": [
{
"spent": false,
"tx_index": 99006637,
"type": 0,
"addr": "1A828tTnkVFJfSvLCqF42ohZ51ksS3jJgX",
"value": 65564000,
"n": 0,
"script": "76a914640cfdf7b79d94d1c980133e3587bd6053f091f388ac"
}
]
}
}*/

if (data.op == "utx") {
if (data) {
var watchAddress = $scope.wallet.coin == 'bch' ? $scope.addrBchLegacy : $scope.addr;
for (var i = 0; i < data.x.out.length; i++) {
if (data.x.out[i].addr == watchAddress) {
$scope.paymentReceivedAmount = txFormatService.formatAmount(data.x.out[i].value, 'full');
for (var i = 0; i < data.outputs.length; i++) {
if (data.outputs[i].address == watchAddress) {
$scope.paymentReceivedAmount = txFormatService.formatAmount(data.outputs[i].value, 'full');
$scope.paymentReceivedAlternativeAmount = ''; // For when a subsequent payment is received.
txFormatService.formatAlternativeStr($scope.wallet.coin, data.x.out[i].value, function(alternativeStr){
txFormatService.formatAlternativeStr($scope.wallet.coin, data.outputs[i].value, function(alternativeStr){
if (alternativeStr) {
$scope.$apply(function () {
$scope.paymentReceivedAlternativeAmount = alternativeStr;
Expand Down