From 0b1df04a82aa330fe4ade4e3824ede59e088e524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 2 Oct 2015 11:27:17 -0300 Subject: [PATCH 01/15] paper wallet in advanced options --- bower.json | 4 +- public/views/modals/paperWallet.html | 73 ++++++++++++++ public/views/paperWallet.html | 41 ++++++++ public/views/preferencesAdvanced.html | 5 + src/js/controllers/paperWallet.js | 82 +++++++++++++++ src/js/controllers/preferencesAdvanced.js | 3 +- src/js/routes.js | 117 ++++++++++++---------- 7 files changed, 269 insertions(+), 56 deletions(-) create mode 100644 public/views/modals/paperWallet.html create mode 100644 public/views/paperWallet.html create mode 100644 src/js/controllers/paperWallet.js diff --git a/bower.json b/bower.json index 703866c7a..74dd674a8 100644 --- a/bower.json +++ b/bower.json @@ -8,7 +8,7 @@ ], "dependencies": { "angular": "1.4.6", - "angular-bitcore-wallet-client": "0.4.4", + "angular-bitcore-wallet-client": "0.6.4", "angular-foundation": "0.7.0", "angular-gettext": "2.1.0", "angular-moment": "0.10.1", @@ -23,4 +23,4 @@ "ng-lodash": "0.2.3", "qrcode-decoder-js": "*" } -} +} \ No newline at end of file diff --git a/public/views/modals/paperWallet.html b/public/views/modals/paperWallet.html new file mode 100644 index 000000000..19a3fdf90 --- /dev/null +++ b/public/views/modals/paperWallet.html @@ -0,0 +1,73 @@ + + + +
+
+
+
+ + + Not valid + + + + +
+
+ +
+ + + {{unitName}} +
+
+
+ + +
+ +
+
+
+ +
+ \ No newline at end of file diff --git a/public/views/paperWallet.html b/public/views/paperWallet.html new file mode 100644 index 000000000..9a0c8b178 --- /dev/null +++ b/public/views/paperWallet.html @@ -0,0 +1,41 @@ +
+
+ +
+
+
+
+ + {{paperWallet.error}} +
+
+ + +
+ +
+ + +
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+
diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index da39f5c3d..974df100a 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -16,6 +16,11 @@
  • Scan addresses for funds
  • + +
  • + + Scan Paper Wallet +
  • diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js new file mode 100644 index 000000000..42f18e365 --- /dev/null +++ b/src/js/controllers/paperWallet.js @@ -0,0 +1,82 @@ +angular.module('copayApp.controllers').controller('paperWalletController', + function($scope, $http, profileService, addressService) { + + self = this; + var fc = profileService.focusedClient; + var rawTx; + + self.onQrCodeScanned = function(data) { + $scope.privateKey = data; + console.log(data); + } + + self.createTx = function(privateKey, passphrase) { + console.log("entro"); + console.log(privateKey); + console.log(passphrase); + if (!privateKey) self.error = "Enter privateKey or scann for one"; + this.getRawTx(privateKey, passphrase, function(err, rawTx, utxos) { + console.log(utxos); + console.log("creada"); + if (err) self.error = err.toString(); + else { + self.balance = (utxos / 1e8).toFixed(8); + rawTx = rawTx; + } + }); + }; + + self.getRawTx = function(privateKey, passphrase, cb) { + if (privateKey.charAt(0) == 6) { + fc.decryptBIP38PrivateKey(privateKey, passphrase, null, function(err, privateKey) { + if (err) return cb(err); + + fc.getBalanceFromPrivateKey(privateKey, function(err, utxos) { + if (err) return cb(err); + + addressService.getAddress(fc.credentials.walletId, true, function(err, destinationAddress) { + if (err) return cb(err); + + fc.buildTxFromPrivateKey(privateKey, destinationAddress, null, function(err, tx) { + if (err) return cb(err); + console.log(tx.serialize()); + return cb(null, tx.serialize(), utxos); + }); + }); + }); + }); + } else { + fc.getBalanceFromPrivateKey(privateKey, function(err, utxos) { + if (err) return cb(err) + + addressService.getAddress(fc.credentials.walletId, true, function(err, destinationAddress) { + if (err) return cb(err); + + fc.buildTxFromPrivateKey(privateKey, destinationAddress, null, function(err, tx) { + if (err) return cb(err); + console.log(tx.serialize()); + return cb(null, tx.serialize(), utxos); + }); + }); + }); + } + }; + + self.transaction = function() { + + self.doTransaction(rawTx).then(function(response) { + console.log(response); //mostrar pantalla de sent successfully + }, + function(err) { + self.error = err; + console.log(err); //mostrar mensaje de error en la pantalla + }); + }; + + self.doTransaction = function(rawTx) { + return $http.post('https://insight.bitpay.com/api/tx/send', { + rawtx: rawTx + }); + }; + + }); \ No newline at end of file diff --git a/src/js/controllers/preferencesAdvanced.js b/src/js/controllers/preferencesAdvanced.js index 5cd7dca3c..30616e803 100644 --- a/src/js/controllers/preferencesAdvanced.js +++ b/src/js/controllers/preferencesAdvanced.js @@ -2,4 +2,5 @@ angular.module('copayApp.controllers').controller('preferencesAdvancedController', function($scope) { - }); + + }); \ No newline at end of file diff --git a/src/js/routes.js b/src/js/routes.js index b5542771c..f6d58c84e 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -44,7 +44,7 @@ angular v = JSON.stringify(v); } // Trim output in mobile - if ( window.cordova ) { + if (window.cordova) { v = v.toString(); if (v.length > 1000) { v = v.substr(0, 997) + '...'; @@ -85,7 +85,7 @@ angular } }); - $stateProvider + $stateProvider .state('translators', { url: '/translators', walletShouldBeComplete: true, @@ -275,27 +275,27 @@ angular }) .state('preferencesGlidera', { - url: '/preferencesGlidera', - walletShouldBeComplete: true, - needProfile: true, - views: { - 'main': { - templateUrl: 'views/preferencesGlidera.html' - }, - } - }) + url: '/preferencesGlidera', + walletShouldBeComplete: true, + needProfile: true, + views: { + 'main': { + templateUrl: 'views/preferencesGlidera.html' + }, + } + }) .state('preferencesAdvanced', { - url: '/preferencesAdvanced', - templateUrl: 'views/preferencesAdvanced.html', - walletShouldBeComplete: true, - needProfile: true, - views: { - 'main': { - templateUrl: 'views/preferencesAdvanced.html' - }, - } - }) + url: '/preferencesAdvanced', + templateUrl: 'views/preferencesAdvanced.html', + walletShouldBeComplete: true, + needProfile: true, + views: { + 'main': { + templateUrl: 'views/preferencesAdvanced.html' + }, + } + }) .state('preferencesColor', { url: '/preferencesColor', templateUrl: 'views/preferencesColor.html', @@ -309,16 +309,16 @@ angular }) .state('preferencesAltCurrency', { - url: '/preferencesAltCurrency', - templateUrl: 'views/preferencesAltCurrency.html', - walletShouldBeComplete: true, - needProfile: true, - views: { - 'main': { - templateUrl: 'views/preferencesAltCurrency.html' - }, - } - }) + url: '/preferencesAltCurrency', + templateUrl: 'views/preferencesAltCurrency.html', + walletShouldBeComplete: true, + needProfile: true, + views: { + 'main': { + templateUrl: 'views/preferencesAltCurrency.html' + }, + } + }) .state('preferencesAlias', { url: '/preferencesAlias', templateUrl: 'views/preferencesAlias.html', @@ -376,18 +376,18 @@ angular }, } }) - - .state('about', { - url: '/about', - templateUrl: 'views/preferencesAbout.html', - walletShouldBeComplete: true, - needProfile: true, - views: { - 'main': { - templateUrl: 'views/preferencesAbout.html' - }, - } - }) + + .state('about', { + url: '/about', + templateUrl: 'views/preferencesAbout.html', + walletShouldBeComplete: true, + needProfile: true, + views: { + 'main': { + templateUrl: 'views/preferencesAbout.html' + }, + } + }) .state('logs', { url: '/logs', templateUrl: 'views/preferencesLogs.html', @@ -410,6 +410,17 @@ angular }, } }) + .state('paperWallet', { + url: '/paperWallet', + templateUrl: 'views/paperWallet.html', + walletShouldBeComplete: true, + needProfile: true, + views: { + 'main': { + templateUrl: 'views/paperWallet.html' + }, + } + }) .state('backup', { url: '/backup', templateUrl: 'views/backup.html', @@ -435,14 +446,14 @@ angular }) .state('add', { - url: '/add', - needProfile: true, - views: { - 'main': { - templateUrl: 'views/add.html' - }, - } - }) + url: '/add', + needProfile: true, + views: { + 'main': { + templateUrl: 'views/add.html' + }, + } + }) .state('cordova', { url: '/cordova/:status/:isHome', views: { @@ -450,7 +461,7 @@ angular controller: function($rootScope, $state, $stateParams, $timeout, go, isCordova) { switch ($stateParams.status) { case 'resume': - $rootScope.$emit('Local/Resume'); + $rootScope.$emit('Local/Resume'); break; case 'backbutton': if (isCordova && $stateParams.isHome == 'true' && !$rootScope.modalOpened) { @@ -534,4 +545,4 @@ angular }, 50); } }); - }); + }); \ No newline at end of file From 0835f91a42b6c17d76ac04b1458ebd49916b417e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 2 Oct 2015 11:34:01 -0300 Subject: [PATCH 02/15] deleting wrong modal paperWallet.html --- public/views/modals/paperWallet.html | 73 ---------------------------- 1 file changed, 73 deletions(-) delete mode 100644 public/views/modals/paperWallet.html diff --git a/public/views/modals/paperWallet.html b/public/views/modals/paperWallet.html deleted file mode 100644 index 19a3fdf90..000000000 --- a/public/views/modals/paperWallet.html +++ /dev/null @@ -1,73 +0,0 @@ - - - -
    -
    -
    -
    - - - Not valid - - - - -
    -
    - -
    - - - {{unitName}} -
    -
    -
    - - -
    - -
    -
    -
    - -
    - \ No newline at end of file From df45a22f18a6acd15f3a168e6a7549e41e399182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 2 Oct 2015 11:58:20 -0300 Subject: [PATCH 03/15] fixing delay in render second button --- public/views/paperWallet.html | 9 +++++---- public/views/preferencesAdvanced.html | 2 +- src/js/controllers/paperWallet.js | 26 ++++++++++++-------------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/public/views/paperWallet.html b/public/views/paperWallet.html index 9a0c8b178..11e706256 100644 --- a/public/views/paperWallet.html +++ b/public/views/paperWallet.html @@ -1,7 +1,7 @@
    + ng-init="titleSection='Sweep paper wallet'; goBackToState = 'preferencesAdvanced';">
    @@ -24,17 +24,18 @@
    - + + Funds will be transfered to the wallet: {{index.alias}}
    - +
    diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index 974df100a..a7d41335e 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -19,7 +19,7 @@
  • - Scan Paper Wallet + Sweep paper wallet
  • diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index 42f18e365..070126fbe 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -1,5 +1,5 @@ angular.module('copayApp.controllers').controller('paperWalletController', - function($scope, $http, profileService, addressService) { + function($scope, $http, $timeout, profileService, go, addressService) { self = this; var fc = profileService.focusedClient; @@ -7,22 +7,19 @@ angular.module('copayApp.controllers').controller('paperWalletController', self.onQrCodeScanned = function(data) { $scope.privateKey = data; - console.log(data); } self.createTx = function(privateKey, passphrase) { - console.log("entro"); - console.log(privateKey); - console.log(passphrase); if (!privateKey) self.error = "Enter privateKey or scann for one"; - this.getRawTx(privateKey, passphrase, function(err, rawTx, utxos) { - console.log(utxos); - console.log("creada"); + self.getRawTx(privateKey, passphrase, function(err, rawtx, utxos) { if (err) self.error = err.toString(); else { self.balance = (utxos / 1e8).toFixed(8); - rawTx = rawTx; + rawTx = rawtx; } + $timeout(function() { + $scope.$apply(); + }, 1); }); }; @@ -39,7 +36,6 @@ angular.module('copayApp.controllers').controller('paperWalletController', fc.buildTxFromPrivateKey(privateKey, destinationAddress, null, function(err, tx) { if (err) return cb(err); - console.log(tx.serialize()); return cb(null, tx.serialize(), utxos); }); }); @@ -54,7 +50,6 @@ angular.module('copayApp.controllers').controller('paperWalletController', fc.buildTxFromPrivateKey(privateKey, destinationAddress, null, function(err, tx) { if (err) return cb(err); - console.log(tx.serialize()); return cb(null, tx.serialize(), utxos); }); }); @@ -64,15 +59,18 @@ angular.module('copayApp.controllers').controller('paperWalletController', self.transaction = function() { - self.doTransaction(rawTx).then(function(response) { - console.log(response); //mostrar pantalla de sent successfully + self.doTransaction(rawTx).then(function(err, response) { + self.goHome(); }, function(err) { self.error = err; - console.log(err); //mostrar mensaje de error en la pantalla }); }; + self.goHome = function() { + go.walletHome(); + }; + self.doTransaction = function(rawTx) { return $http.post('https://insight.bitpay.com/api/tx/send', { rawtx: rawTx From 9438683db16d275bfd6ee8a2cb5f0439f7ec5b84 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 2 Oct 2015 13:24:43 -0300 Subject: [PATCH 04/15] adding spinner --- public/views/paperWallet.html | 31 +++++++++++++++++++++--- src/js/controllers/paperWallet.js | 40 ++++++++++++++++++------------- 2 files changed, 51 insertions(+), 20 deletions(-) diff --git a/public/views/paperWallet.html b/public/views/paperWallet.html index 11e706256..1912e6db4 100644 --- a/public/views/paperWallet.html +++ b/public/views/paperWallet.html @@ -7,6 +7,20 @@
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + Scanning wallet funds... +
    +
    +
    {{paperWallet.error}} @@ -31,11 +45,22 @@
    - - Funds will be transfered to the wallet: {{index.alias}} + + Funds will be transfered to the wallet: {{index.alias || index.walletName}}
    - +
    diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index 070126fbe..fcb1ffc84 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -1,6 +1,5 @@ angular.module('copayApp.controllers').controller('paperWalletController', - function($scope, $http, $timeout, profileService, go, addressService) { - + function($scope, $http, $timeout, $rootScope, profileService, go, addressService, isCordova, gettext) { self = this; var fc = profileService.focusedClient; var rawTx; @@ -10,17 +9,26 @@ angular.module('copayApp.controllers').controller('paperWalletController', } self.createTx = function(privateKey, passphrase) { - if (!privateKey) self.error = "Enter privateKey or scann for one"; - self.getRawTx(privateKey, passphrase, function(err, rawtx, utxos) { - if (err) self.error = err.toString(); - else { - self.balance = (utxos / 1e8).toFixed(8); - rawTx = rawtx; - } - $timeout(function() { - $scope.$apply(); - }, 1); - }); + self.error = null; + self.scanning = true; + + $timeout(function() { + self.getRawTx(privateKey, passphrase, function(err, rawtx, utxos) { + self.scanning = false; + + if (err) + self.error = err.toString(); + else { + self.balance = (utxos / 1e8).toFixed(8); + rawTx = rawtx; + } + + $timeout(function() { + $scope.$apply(); + }, 1); + + }); + }, 100); }; self.getRawTx = function(privateKey, passphrase, cb) { @@ -58,12 +66,11 @@ angular.module('copayApp.controllers').controller('paperWalletController', }; self.transaction = function() { - self.doTransaction(rawTx).then(function(err, response) { self.goHome(); }, function(err) { - self.error = err; + self.error = err.toString(); }); }; @@ -76,5 +83,4 @@ angular.module('copayApp.controllers').controller('paperWalletController', rawtx: rawTx }); }; - - }); \ No newline at end of file + }); From a779405aad14d58fc3376ce6ea3f1a94a0424dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 2 Oct 2015 14:42:40 -0300 Subject: [PATCH 05/15] message in ios and android device --- public/views/paperWallet.html | 1 + src/js/controllers/paperWallet.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/public/views/paperWallet.html b/public/views/paperWallet.html index 1912e6db4..e3ee4a219 100644 --- a/public/views/paperWallet.html +++ b/public/views/paperWallet.html @@ -36,6 +36,7 @@
    +

    {{paperWallet.message}}

    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - Scanning wallet funds... -
    +
    +
    +
    +
    +
    +
    +
    +
    - -
    + Scanning wallet funds... +
    +
    +
    +
    +
    - {{paperWallet.error}} + {{paperWallet.error|translate}}
    - +
    - -
    -

    {{paperWallet.message}}

    -
    - -
    + +

    {{paperWallet.message}}

    +
    +
    +

    Funds founds

    +
    + {{paperWallet.balance}} BTC +
    +
    + - Funds will be transfered to the wallet: {{index.alias || index.walletName}} +
    +
    Funds will be transfered to
    + {{index.alias || index.walletName}} +
    -
    -
    -
    - - {{paperWallet.error|translate}} -
    -
    +
    + + {{paperWallet.error|translate}} +
    +
    +
    +
    @@ -33,12 +33,21 @@ Passphrase (if you have one): -

    {{paperWallet.message}}

    +

    + Decrypting a paper wallet could take around 5 minutes on this device. please be patient and keep the app open. +

    +
    -
    -
    +
    +

    Funds founds

    @@ -52,20 +61,11 @@ ng-click="paperWallet.transaction()" translate>sweep wallet -
    +
    Funds will be transfered to
    {{index.alias || index.walletName}}
    -
    - -
    diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index 2b5b83ab9..6caeb671f 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -1,9 +1,9 @@ angular.module('copayApp.controllers').controller('paperWalletController', - function($scope, $http, $timeout, profileService, go, addressService) { + function($scope, $http, $timeout, profileService, go, addressService, isCordova) { self = this; var fc = profileService.focusedClient; var rawTx; - if (isCordova) self.message = "Decrypting a paper wallet could take around 5 minutes on this device. please be patient and keep the app open." + self.isCordova = !isCordova; self.onQrCodeScanned = function(data) { $scope.privateKey = data; @@ -82,4 +82,4 @@ angular.module('copayApp.controllers').controller('paperWalletController', rawtx: rawTx }); }; - }); \ No newline at end of file + }); From ba4e63b582a293ec5f17a149c72299b4a1c78582 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 2 Oct 2015 15:25:22 -0300 Subject: [PATCH 08/15] Typo --- public/views/paperWallet.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/views/paperWallet.html b/public/views/paperWallet.html index f4b954f98..46c959980 100644 --- a/public/views/paperWallet.html +++ b/public/views/paperWallet.html @@ -30,7 +30,7 @@

    From eb73411ea5a1643856fb05fdce017bbdb590dd42 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 2 Oct 2015 15:29:08 -0300 Subject: [PATCH 09/15] . --- src/js/controllers/paperWallet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index 6caeb671f..2eecf1432 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -3,7 +3,7 @@ angular.module('copayApp.controllers').controller('paperWalletController', self = this; var fc = profileService.focusedClient; var rawTx; - self.isCordova = !isCordova; + self.isCordova = isCordova; self.onQrCodeScanned = function(data) { $scope.privateKey = data; From 36b73f5567bac381e5a228586bc14d3fee6edab8 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 2 Oct 2015 15:33:43 -0300 Subject: [PATCH 10/15] Missing translate --- public/views/paperWallet.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/views/paperWallet.html b/public/views/paperWallet.html index 46c959980..e0f145c14 100644 --- a/public/views/paperWallet.html +++ b/public/views/paperWallet.html @@ -24,7 +24,7 @@

    - +
    From 50a0c8ffd4677e1a84feb91bc32f7c201b0dc0b9 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 2 Oct 2015 15:56:59 -0300 Subject: [PATCH 11/15] add private key creation control --- src/js/controllers/paperWallet.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index 2eecf1432..44135aa1c 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -1,15 +1,22 @@ angular.module('copayApp.controllers').controller('paperWalletController', - function($scope, $http, $timeout, profileService, go, addressService, isCordova) { + function($scope, $http, $timeout, $rootScope, profileService, go, addressService, isCordova, gettext, bitcore) { self = this; var fc = profileService.focusedClient; var rawTx; - self.isCordova = isCordova; + + if (isCordova) self.message = "Decrypting a paper wallet could take around 5 minutes on this device. please be patient and keep the app open." self.onQrCodeScanned = function(data) { $scope.privateKey = data; } self.createTx = function(privateKey, passphrase) { + if (privateKey.charAt(0) != 6) { + var isValidPrivateKey = self.checkPrivateKey(privateKey); + + if (isValidPrivateKey != true) return self.error = isValidPrivateKey; + } + self.error = null; self.scanning = true; $timeout(function() { @@ -30,6 +37,15 @@ angular.module('copayApp.controllers').controller('paperWalletController', }, 100); }; + self.checkPrivateKey = function(privateKey) { + try { + new bitcore.PrivateKey(privateKey, 'livenet'); + } catch (err) { + return err.toString(); + } + return true; + } + self.getRawTx = function(privateKey, passphrase, cb) { if (privateKey.charAt(0) == 6) { fc.decryptBIP38PrivateKey(privateKey, passphrase, null, function(err, privateKey) { From 10ae7b61d7a168658649a78c1c35ef4f917a3b81 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 2 Oct 2015 16:04:11 -0300 Subject: [PATCH 12/15] Disable button while sending funds --- public/views/paperWallet.html | 8 +++++--- src/js/controllers/paperWallet.js | 11 ++++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/public/views/paperWallet.html b/public/views/paperWallet.html index e0f145c14..332094c19 100644 --- a/public/views/paperWallet.html +++ b/public/views/paperWallet.html @@ -5,7 +5,7 @@
    -
    +
    @@ -14,7 +14,8 @@
    - Scanning wallet funds... + Scanning wallet funds... + Sending funds...
    @@ -56,10 +57,11 @@
    Funds will be transfered to
    diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index 44135aa1c..85d839259 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -81,12 +81,21 @@ angular.module('copayApp.controllers').controller('paperWalletController', }; self.transaction = function() { - self.doTransaction(rawTx).then(function(err, response) { + self.error = null; + self.sending = true; + $timeout(function() { + self.doTransaction(rawTx).then(function(err, response) { + self.sending = false; self.goHome(); }, function(err) { + self.sending = false; self.error = err.toString(); + $timeout(function() { + $scope.$apply(); + }, 1); }); + }, 100); }; self.goHome = function() { From cb98f4ce831f490e5e85f1cb12b46ab9cb28c7f4 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 2 Oct 2015 16:14:09 -0300 Subject: [PATCH 13/15] Fix conflict --- src/js/controllers/paperWallet.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index 85d839259..29d45a73f 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -1,10 +1,9 @@ angular.module('copayApp.controllers').controller('paperWalletController', - function($scope, $http, $timeout, $rootScope, profileService, go, addressService, isCordova, gettext, bitcore) { + function($scope, $http, $timeout, profileService, go, addressService, isCordova, bitcore) { self = this; var fc = profileService.focusedClient; var rawTx; - - if (isCordova) self.message = "Decrypting a paper wallet could take around 5 minutes on this device. please be patient and keep the app open." + self.isCordova = isCordova; self.onQrCodeScanned = function(data) { $scope.privateKey = data; From f8ab99272e1cb0bb8f2c17742c839791eda834d4 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 2 Oct 2015 16:30:10 -0300 Subject: [PATCH 14/15] Updates isCordova variable --- public/views/paperWallet.html | 2 +- src/js/controllers/paperWallet.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/public/views/paperWallet.html b/public/views/paperWallet.html index 332094c19..9f45ea91e 100644 --- a/public/views/paperWallet.html +++ b/public/views/paperWallet.html @@ -34,7 +34,7 @@ Passphrase (if you have one) -

    +

    Decrypting a paper wallet could take around 5 minutes on this device. please be patient and keep the app open.