From 8c18995ae0ff6cec3a35cbcf6942b44fc49d6a1c Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Sat, 14 Nov 2015 17:29:45 -0300 Subject: [PATCH 01/17] refactor scan after importing a wallet --- src/js/controllers/create.js | 5 ----- src/js/controllers/index.js | 8 +++----- src/js/controllers/join.js | 5 ----- src/js/services/profileService.js | 27 ++++++++++++++++++++++----- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/src/js/controllers/create.js b/src/js/controllers/create.js index f873625ad..1433ccdb9 100644 --- a/src/js/controllers/create.js +++ b/src/js/controllers/create.js @@ -170,11 +170,6 @@ angular.module('copayApp.controllers').controller('createController', return; } - if (opts.mnemonic || opts.externalSource || opts.extendedPrivateKey) { - if (opts.n == 1) { - $rootScope.$emit('Local/WalletImported', walletId); - } - } }); }, 100); } diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 194c2884c..46d7c2e42 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -923,9 +923,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r } profileService.setWalletClients(); - $timeout(function() { - $rootScope.$emit('Local/WalletImported', self.walletId); - }, 100); + self.startScan(self.walletId); }); }; @@ -1176,10 +1174,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.debouncedUpdate(); }); - $rootScope.$on('Local/BackupDone', function(event) { + $rootScope.$on('Local/BackupDone', function(event, walletId) { self.needsBackup = false; $log.debug('Backup done'); - storageService.setBackupFlag(self.walletId, function(err) { + storageService.setBackupFlag(walletId || self.walletId, function(err) { $log.debug('Backup done stored'); }); }); diff --git a/src/js/controllers/join.js b/src/js/controllers/join.js index 2c5227ecf..a0647c687 100644 --- a/src/js/controllers/join.js +++ b/src/js/controllers/join.js @@ -129,11 +129,6 @@ angular.module('copayApp.controllers').controller('joinController', return; } - $timeout(function() { - var fc = profileService.focusedClient; - if (fc.isComplete() && (opts.mnemonic || opts.externalSource || opts.extendedPrivateKey)) - $rootScope.$emit('Local/WalletImported', fc.credentials.walletId); - }, 2000); }); }, 100); }; diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index f159deeaf..3463318d8 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -276,8 +276,8 @@ angular.module('copayApp.services') // check if exist if (lodash.find(root.profile.credentials, { - 'walletId': walletData.walletId - })) { + 'walletId': walletData.walletId + })) { return cb(gettext('Cannot join the same wallet more that once')); } } catch (ex) { @@ -379,9 +379,26 @@ angular.module('copayApp.services') root.profile.credentials.push(JSON.parse(walletClient.export())); root.setWalletClients(); - root.setAndStoreFocus(walletId, function() { - storageService.storeProfile(root.profile, function(err) { - return cb(err, walletId); + + var handleImport = function(cb) { + var isImport = opts.mnemonic || opts.externalSource || opts.extendedPrivateKey; + + if (!isImport) + return cb(); + + $rootScope.$emit('Local/BackupDone', walletId); + + if (!walletClient.isComplete()) + return cb(); + + storageService.setCleanAndScanAddresses(walletId, cb); + }; + + handleImport(function() { + root.setAndStoreFocus(walletId, function() { + storageService.storeProfile(root.profile, function(err) { + return cb(err, walletId); + }); }); }); }); From e1e79806004e87b2b4c1e82954eb8658d059e704 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Sat, 14 Nov 2015 18:08:04 -0300 Subject: [PATCH 02/17] hide delete is n=1, show err if sign failed --- public/views/modals/txp-details.html | 2 +- src/js/controllers/walletHome.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public/views/modals/txp-details.html b/public/views/modals/txp-details.html index 6224b729c..05d6ead49 100644 --- a/public/views/modals/txp-details.html +++ b/public/views/modals/txp-details.html @@ -156,7 +156,7 @@ -
+
* A payment proposal can be deleted if 1) you are the creator, and no other copayer has signed, or 2) 24 hours have passed since the proposal was created.
diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index ae84e4ba4..9a14d960b 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -271,6 +271,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi $scope.canSign = fc.canSign() || fc.isPrivKeyExternal(); $scope.loading = null; $scope.color = fc.backgroundColor; + $scope.isShared = fc.credentials.n > 1; // ToDo: use tx.customData instead of tx.message if (tx.message === 'Glidera transaction' && isGlidera) { @@ -951,6 +952,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi profileService.signTxProposal(txp, function(err, signedTx) { self.setOngoingProcess(); if (err) { + if (!lodash.isObject(err)) { + err = { message: err}; + } err.message = bwsError.msg(err, gettextCatalog.getString('The payment was created but could not be signed. Please try again from home screen')); return cb(err); } From 6ea88ed2e5aab12d7acb89795fa7e560dcfae24f Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Sat, 14 Nov 2015 18:47:52 -0300 Subject: [PATCH 03/17] WP8: Enable installation on SD --- cordova/wp/Properties/WMAppManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cordova/wp/Properties/WMAppManifest.xml b/cordova/wp/Properties/WMAppManifest.xml index e94cc6d26..1bf77bf18 100644 --- a/cordova/wp/Properties/WMAppManifest.xml +++ b/cordova/wp/Properties/WMAppManifest.xml @@ -8,7 +8,7 @@ - + Assets\icon@2.png From fa13ee3347a4bc523bacbece2f4d4db05bfdaf6b Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Mon, 16 Nov 2015 15:53:09 -0300 Subject: [PATCH 04/17] Removes note: and to: prefix --- public/views/walletHome.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index be1b3adca..4acb4bfd1 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -506,9 +506,9 @@
-
Note: {{btx.message}}
+
{{btx.message}}
- To: {{index.addressbook[btx.addressTo] || btx.addressTo}} + {{index.addressbook[btx.addressTo] || btx.addressTo}}
From 8c2edd3afebf1c60be6234cd70305554a20fcd1c Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 18 Nov 2015 10:20:47 -0300 Subject: [PATCH 05/17] fix isDevel log error --- src/js/routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/routes.js b/src/js/routes.js index 326527899..0753cef94 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -20,7 +20,7 @@ angular $urlRouterProvider.otherwise('/'); $logProvider.debugEnabled(true); - $provide.decorator('$log', ['$delegate', + $provide.decorator('$log', ['$delegate', 'isDevel', function($delegate, isDevel) { var historicLog = historicLogProvider.$get(); From 18ddf8e29858e3de5f81ef084eff5fdb7d2f793d Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 18 Nov 2015 10:24:15 -0300 Subject: [PATCH 06/17] fix Units in history after change --- src/js/controllers/index.js | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 46d7c2e42..0d5902b0c 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -142,7 +142,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r var defaults = configService.getDefaults(); var config = configService.getSync(); - self.usingCustomBWS = config.bwsFor && config.bwsFor[self.walletId] && (config.bwsFor[self.walletId] != defaults.bws.url); + self.usingCustomBWS = config.bwsFor && config.bwsFor[self.walletId] && (config.bwsFor[self.walletId] != defaults.bws.url); }; self.setTab = function(tab, reset, tries, switchState) { @@ -786,11 +786,33 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.updateLocalTxHistory = function(client, cb) { var requestLimit = 6; var walletId = client.credentials.walletId; + var config = configService.getSync().wallet.settings; + + var fixTxsUnit = function(txs) { + if (!txs || !txs[0]) return; + + var cacheUnit = txs[0].amountStr.split(' ')[1]; + console.log('[index.js.794:cacheUnit:]', cacheUnit, config.unitName); //TODO + + if (cacheUnit == config.unitName) + return; + + var name = ' ' + config.unitName; + + $log.debug('Fixing Tx Cache Unit to:' + name) + lodash.each(txs, function(tx) { + + tx.amountStr = profileService.formatAmount(tx.amount, config.unitName) + name; + tx.feeStr = profileService.formatAmount(tx.fees, config.unitName) + name; + }); + }; self.getConfirmedTxs(walletId, function(err, txsFromLocal) { if (err) return cb(err); var endingTxid = txsFromLocal[0] ? txsFromLocal[0].txid : null; + fixTxsUnit(txsFromLocal); + function getNewTxs(newTxs, skip, i_cb) { self.getTxsFromServer(client, skip, endingTxid, requestLimit, function(err, res, shouldContinue) { @@ -807,7 +829,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r return i_cb(null, newTxs); } - if (walletId == profileService.focusedClient.credentials.walletId) + if (walletId == profileService.focusedClient.credentials.walletId) self.txProgress = newTxs.length; $timeout(function() { @@ -822,7 +844,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r var newHistory = lodash.compact(txs.concat(txsFromLocal)); $log.debug('Tx History synced. Total Txs: ' + newHistory.length); - if (walletId == profileService.focusedClient.credentials.walletId) { + if (walletId == profileService.focusedClient.credentials.walletId) { self.completeHistory = newHistory; self.txHistory = newHistory.slice(0, self.historyShowLimit); self.historyShowShowAll = newHistory.length >= self.historyShowLimit; @@ -1137,8 +1159,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r }); $rootScope.$on('Local/UnitSettingUpdated', function(event) { - self.updateAll(); - self.updateTxHistory(); + self.updateAll({ + triggerTxUpdate: true, + }); self.updateRemotePreferences({ saveAll: true }, function() { From 87718ca54c5f6ea510498552dfd66e1881d91300 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 18 Nov 2015 14:39:10 -0300 Subject: [PATCH 07/17] New release v1.5.2 --- cordova/config.xml | 6 +++--- cordova/ios/Copay-Info.plist | 4 ++-- cordova/wp/Package.appxmanifest | 2 +- cordova/wp/Properties/WMAppManifest.xml | 2 +- package.json | 2 +- src/js/controllers/index.js | 1 - webkitbuilds/.desktop | 2 +- webkitbuilds/setup-win32.iss | 2 +- webkitbuilds/setup-win64.iss | 2 +- 9 files changed, 11 insertions(+), 12 deletions(-) diff --git a/cordova/config.xml b/cordova/config.xml index 4a31e8f4a..fa16d75ec 100644 --- a/cordova/config.xml +++ b/cordova/config.xml @@ -1,8 +1,8 @@ + version="1.5.2" + android-versionCode="56" + ios-CFBundleVersion="1.5.2"> Copay A secure bitcoin wallet for friends and companies. diff --git a/cordova/ios/Copay-Info.plist b/cordova/ios/Copay-Info.plist index 592a6e9e8..811f4663d 100644 --- a/cordova/ios/Copay-Info.plist +++ b/cordova/ios/Copay-Info.plist @@ -57,11 +57,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.1 + 1.5.2 CFBundleSignature ???? CFBundleVersion - 1.5.1 + 1.5.2 LSRequiresIPhoneOS NSMainNibFile diff --git a/cordova/wp/Package.appxmanifest b/cordova/wp/Package.appxmanifest index f7a3ebc74..991fbc756 100644 --- a/cordova/wp/Package.appxmanifest +++ b/cordova/wp/Package.appxmanifest @@ -1,6 +1,6 @@  - + Copay Bitcoin Wallet diff --git a/cordova/wp/Properties/WMAppManifest.xml b/cordova/wp/Properties/WMAppManifest.xml index 1bf77bf18..d9b7c4d96 100644 --- a/cordova/wp/Properties/WMAppManifest.xml +++ b/cordova/wp/Properties/WMAppManifest.xml @@ -8,7 +8,7 @@ - + Assets\icon@2.png diff --git a/package.json b/package.json index 272b0dc57..020d931ea 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "copay", "description": "A multisignature wallet", "author": "BitPay", - "version": "1.5.1", + "version": "1.5.2", "keywords": [ "wallet", "copay", diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 0d5902b0c..1299c02c1 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -792,7 +792,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r if (!txs || !txs[0]) return; var cacheUnit = txs[0].amountStr.split(' ')[1]; - console.log('[index.js.794:cacheUnit:]', cacheUnit, config.unitName); //TODO if (cacheUnit == config.unitName) return; diff --git a/webkitbuilds/.desktop b/webkitbuilds/.desktop index b93c2742b..48408a006 100644 --- a/webkitbuilds/.desktop +++ b/webkitbuilds/.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Type=Application -Version=1.5.1 +Version=1.5.2 Name=Copay Comment=A multisignature wallet Exec=copay diff --git a/webkitbuilds/setup-win32.iss b/webkitbuilds/setup-win32.iss index ce171d55e..f46d0e7af 100755 --- a/webkitbuilds/setup-win32.iss +++ b/webkitbuilds/setup-win32.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "Copay" -#define MyAppVersion "1.5.1" +#define MyAppVersion "1.5.2" #define MyAppPublisher "BitPay" #define MyAppURL "https://copay.io" #define MyAppExeName "copay.exe" diff --git a/webkitbuilds/setup-win64.iss b/webkitbuilds/setup-win64.iss index 1f27ec187..16455da88 100755 --- a/webkitbuilds/setup-win64.iss +++ b/webkitbuilds/setup-win64.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "Copay" -#define MyAppVersion "1.5.1" +#define MyAppVersion "1.5.2" #define MyAppPublisher "BitPay" #define MyAppURL "https://copay.io" #define MyAppExeName "copay.exe" From 2e7cd8770c90a0fbb2172336673437d981585953 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 18 Nov 2015 16:37:15 -0300 Subject: [PATCH 08/17] sanitize wallet list --- src/js/controllers/index.js | 1 - src/js/controllers/sidebar.js | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 0d5902b0c..1299c02c1 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -792,7 +792,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r if (!txs || !txs[0]) return; var cacheUnit = txs[0].amountStr.split(' ')[1]; - console.log('[index.js.794:cacheUnit:]', cacheUnit, config.unitName); //TODO if (cacheUnit == config.unitName) return; diff --git a/src/js/controllers/sidebar.js b/src/js/controllers/sidebar.js index 86157cecc..7cf3d57a9 100644 --- a/src/js/controllers/sidebar.js +++ b/src/js/controllers/sidebar.js @@ -28,8 +28,7 @@ angular.module('copayApp.controllers').controller('sidebarController', self.switchWallet = function(selectedWalletId, currentWalletId) { if (selectedWalletId == currentWalletId) return; self.walletSelection = false; - profileService.setAndStoreFocus(selectedWalletId, function() { - }); + profileService.setAndStoreFocus(selectedWalletId, function() {}); }; self.toggleWalletSelection = function() { @@ -40,10 +39,14 @@ angular.module('copayApp.controllers').controller('sidebarController', self.setWallets = function() { if (!profileService.profile) return; + var config = configService.getSync(); config.colorFor = config.colorFor || {}; config.aliasFor = config.aliasFor || {}; - var ret = lodash.map(profileService.profile.credentials, function(c) { + + // Sanitize empty wallets (fixed in BWC 1.8.1, and auto fixed when wallets completes) + var credentials = lodash.filter(profileService.profile.credentials, 'walletName'); + var ret = lodash.map(credentials, function(c) { return { m: c.m, n: c.n, @@ -52,6 +55,7 @@ angular.module('copayApp.controllers').controller('sidebarController', color: config.colorFor[c.walletId] || '#4A90E2', }; }); + self.wallets = lodash.sortBy(ret, 'name'); }; From 1aa3cccff735e7eab7bb9091132517468a578a78 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 18 Nov 2015 20:30:28 -0300 Subject: [PATCH 09/17] rm angular-bitcore-wallet-client deps, replace it with bwc alone --- .gitignore | 3 ++ Gruntfile.js | 45 +++++++++++++------ angular-bitcore-wallet-client/index.js | 62 ++++++++++++++++++++++++++ package.json | 2 + 4 files changed, 99 insertions(+), 13 deletions(-) create mode 100644 angular-bitcore-wallet-client/index.js diff --git a/.gitignore b/.gitignore index 65510bc38..c38187efb 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,8 @@ webkitbuilds/* !webkitbuilds/build-osx.sh !webkitbuilds/Background.png + + # chrome extensions browser-extensions/chrome/copay-chrome-extension browser-extensions/chrome/copay-chrome-extension.zip @@ -51,6 +53,7 @@ build/Release # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- node_modules bower_components +angular-bitcore-wallet-client/angular-bitcore-wallet-client.js # Users Environment Variables .lock-wscript diff --git a/Gruntfile.js b/Gruntfile.js index bff09ff9a..1739815d3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -61,8 +61,8 @@ module.exports = function(grunt) { 'bower_components/angular-qrcode/angular-qrcode.js', 'bower_components/angular-gettext/dist/angular-gettext.js', 'bower_components/angular-touch/angular-touch.js', - 'bower_components/angular-bitcore-wallet-client/angular-bitcore-wallet-client.js', - 'bower_components/angular-ui-switch/angular-ui-switch.js' + 'bower_components/angular-ui-switch/angular-ui-switch.js', + 'angular-bitcore-wallet-client/angular-bitcore-wallet-client.js' ], dest: 'public/lib/angular.js' }, @@ -112,8 +112,8 @@ module.exports = function(grunt) { pot: { files: { 'i18n/po/template.pot': [ - 'public/index.html', - 'public/views/*.html', + 'public/index.html', + 'public/views/*.html', 'public/views/**/*.html', 'src/js/routes.js', 'src/js/services/*.js', @@ -140,10 +140,21 @@ module.exports = function(grunt) { dest: 'public/icons/' }, linux: { - files: [ - {expand: true, cwd: 'webkitbuilds/',src: ['.desktop', '../public/img/icons/favicon.ico', '../public/img/icons/icon-256.png'],dest: 'webkitbuilds/copay/linux32/', flatten: true, filter: 'isFile' }, - {expand: true, cwd: 'webkitbuilds/',src: ['.desktop', '../public/img/icons/favicon.ico', '../public/img/icons/icon-256.png'],dest: 'webkitbuilds/copay/linux64/', flatten: true, filter: 'isFile' }, - ], + files: [{ + expand: true, + cwd: 'webkitbuilds/', + src: ['.desktop', '../public/img/icons/favicon.ico', '../public/img/icons/icon-256.png'], + dest: 'webkitbuilds/copay/linux32/', + flatten: true, + filter: 'isFile' + }, { + expand: true, + cwd: 'webkitbuilds/', + src: ['.desktop', '../public/img/icons/favicon.ico', '../public/img/icons/icon-256.png'], + dest: 'webkitbuilds/copay/linux64/', + flatten: true, + filter: 'isFile' + }, ], } }, karma: { @@ -166,11 +177,11 @@ module.exports = function(grunt) { }, nodewebkit: { options: { - platforms: ['win','osx','linux'], - buildDir: './webkitbuilds', - version: '0.12.2', - macIcns: './public/img/icons/icon.icns', - exeIco: './public/img/icons/icon.ico' + platforms: ['win', 'osx', 'linux'], + buildDir: './webkitbuilds', + version: '0.12.2', + macIcns: './public/img/icons/icon.icns', + exeIco: './public/img/icons/icon.ico' }, src: ['./package.json', './public/**/*'] }, @@ -193,6 +204,13 @@ module.exports = function(grunt) { src: ['**/*'], dest: 'copay-linux64/' } + }, + browserify: { + dist: { + files: { + 'angular-bitcore-wallet-client/angular-bitcore-wallet-client.js': ['angular-bitcore-wallet-client/index.js'] + }, + } } }); @@ -201,6 +219,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-angular-gettext'); + grunt.loadNpmTasks('grunt-browserify'); grunt.loadNpmTasks('grunt-exec'); grunt.loadNpmTasks('grunt-karma'); grunt.loadNpmTasks('grunt-karma-coveralls'); diff --git a/angular-bitcore-wallet-client/index.js b/angular-bitcore-wallet-client/index.js new file mode 100644 index 000000000..ff5dd52eb --- /dev/null +++ b/angular-bitcore-wallet-client/index.js @@ -0,0 +1,62 @@ +var bwcModule = angular.module('bwcModule', []); +var Client = require('../node_modules/bitcore-wallet-client'); + +bwcModule.constant('MODULE_VERSION', '1.0.0'); + +bwcModule.provider("bwcService", function() { + var provider = {}; + + var config = { + baseUrl: 'https://bws.bitpay.com/bws/api', + verbose: null, + transports: null + }; + + provider.setBaseUrl = function(url) { + config.baseUrl = url; + }; + + provider.setVerbose = function(v) { + config.verbose = v ? true : false; + }; + + provider.$get = function() { + var service = {}; + + service.setBaseUrl = function(url) { + config.baseUrl = url; + }; + + service.setTransports = function(transports) { + config.transports = transports; + }; + + service.getBitcore = function() { + return Client.Bitcore; + }; + + service.getSJCL = function() { + return Client.sjcl; + }; + + service.buildTx = Client.buildTx; + + service.getUtils = function() { + return Client.Utils; + }; + + service.getClient = function(walletData) { + var bwc = new Client({ + baseUrl: config.baseUrl, + verbose: config.verbose, + transports: config.transports + }); + if (walletData) + bwc.import(walletData); + return bwc; + }; + return service; + }; + + return provider; +}); diff --git a/package.json b/package.json index 272b0dc57..26eba9f53 100644 --- a/package.json +++ b/package.json @@ -40,10 +40,12 @@ "url": "https://github.com/bitpay/copay/issues" }, "dependencies": { + "bitcore-wallet-client": "1.8.1", "express": "^4.11.2", "fs": "0.0.2", "grunt": "^0.4.5", "grunt-angular-gettext": "^0.2.15", + "grunt-browserify": "^4.0.1", "grunt-cli": "^0.1.13", "grunt-contrib-compress": "^0.13.0", "grunt-contrib-concat": "^0.5.1", From c7bed7dfc9fcd8f75fdfd8e6e19870ccc40cf80f Mon Sep 17 00:00:00 2001 From: bechi Date: Wed, 18 Nov 2015 15:19:47 -0300 Subject: [PATCH 10/17] fix style on history sync --- public/views/walletHome.html | 42 ++++++++++++++++++++---------------- src/css/main.css | 9 ++++++++ 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 4acb4bfd1..3a078ccbf 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -316,7 +316,7 @@
{{index.addressbook[_address] || _address}}
- @@ -450,22 +450,28 @@
-
-
-
-
-
-
-
+
+
+ sync +
+
+ Initial transaction history synchronization can take some minutes for wallets with many transactions. + Please stand by. +
+
+
+
+
+
+
+
+
+
+
+
+ {{index.txProgress}}
+ Transactions Downloaded
-
-
- Initial transaction history synchronization can take some minutes for wallets with many transactions.
- Please stand by. -
-
- {{index.txProgress}} - Transactions
Downloaded
@@ -508,7 +514,7 @@
{{btx.message}}
- {{index.addressbook[btx.addressTo] || btx.addressTo}} + To: {{index.addressbook[btx.addressTo] || btx.addressTo}}
@@ -524,7 +530,7 @@
- +
-
-
- sync -
-
- Initial transaction history synchronization can take some minutes for wallets with many transactions. - Please stand by. -
-
-
-
-
-
-
-
-
-
-
-
- {{index.txProgress}}
- Transactions Downloaded +
+
+
+
+
+
+
+
+ Initial transaction history synchronization can take some minutes for wallets with many transactions.
+ Please stand by. +
+
+ {{index.txProgress}} + Transactions
Downloaded
+
@@ -514,7 +508,7 @@
{{btx.message}}
- To: {{index.addressbook[btx.addressTo] || btx.addressTo}} + {{index.addressbook[btx.addressTo] || btx.addressTo}}
@@ -530,7 +524,7 @@
- +
-
-
-
-
-
-
-
+
+
+ sync +
+
+ Initial transaction history synchronization can take some minutes for wallets with many transactions. + Please stand by. +
+
+
+
+
+
+
+
+
+
+
+
+ {{index.txProgress}}
+ Transactions Downloaded
-
-
- Initial transaction history synchronization can take some minutes for wallets with many transactions.
- Please stand by. -
-
- {{index.txProgress}} - Transactions
Downloaded
@@ -524,7 +530,7 @@
- +
-
-
+
+
sync
From ed8c198da17bd7292ac0319fd05a77eba3f07cec Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 19 Nov 2015 15:51:49 -0300 Subject: [PATCH 15/17] Browserify bitcore-wallet-client before concat --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 1739815d3..2f496e1b3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -226,7 +226,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-node-webkit-builder'); grunt.loadNpmTasks('grunt-contrib-compress'); - grunt.registerTask('default', ['nggettext_compile', 'exec:version', 'concat', 'copy:icons']); + grunt.registerTask('default', ['nggettext_compile', 'exec:version', 'browserify', 'concat', 'copy:icons']); grunt.registerTask('prod', ['default', 'uglify']); grunt.registerTask('translate', ['nggettext_extract']); grunt.registerTask('test', ['karma:unit']); From f2fb9f390c579167172015c51fb36be192260e92 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 20 Nov 2015 10:22:10 -0300 Subject: [PATCH 16/17] Fix join wallet - parseSecret --- angular-bitcore-wallet-client/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/angular-bitcore-wallet-client/index.js b/angular-bitcore-wallet-client/index.js index ff5dd52eb..c45b24438 100644 --- a/angular-bitcore-wallet-client/index.js +++ b/angular-bitcore-wallet-client/index.js @@ -40,6 +40,7 @@ bwcModule.provider("bwcService", function() { }; service.buildTx = Client.buildTx; + service.parseSecret = Client.parseSecret; service.getUtils = function() { return Client.Utils; From 73c2fec6c92a598b4214bb026851594f47e14e6f Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 20 Nov 2015 11:39:59 -0300 Subject: [PATCH 17/17] Fix parse error of TXP. Removes unused variables --- public/views/includes/transaction.html | 2 +- public/views/walletHome.html | 4 ++-- src/js/controllers/index.js | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/public/views/includes/transaction.html b/public/views/includes/transaction.html index cdc76a55e..24093e465 100644 --- a/public/views/includes/transaction.html +++ b/public/views/includes/transaction.html @@ -6,7 +6,7 @@  
-
+
Send {{tx.amountStr}}
diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 34239ae29..6373366fa 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -160,8 +160,8 @@

Payment Proposals

Unsent transactions

-
+
+