Skip to content

Commit c1e001e

Browse files
author
Jean-Baptiste Dominguez
authored
Merge pull request #485 from Bitcoin-com/wallet/prod
Release 5.4
2 parents bf3a0a0 + 4e7e2d7 commit c1e001e

File tree

408 files changed

+30731
-4266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

408 files changed

+30731
-4266
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ i18n/crowdin_api_key.txt
44
src/js/translations.js
55

66
package-lock.json
7-
7+
package.json
88

99
# cordova
1010
plugins
@@ -90,6 +90,7 @@ src/sass/*.css
9090
src/sass/app
9191

9292
# copay www
93+
www/css/*
9394
www/lib/*
9495
www/js/app.js
9596

Gruntfile.js

+58-7
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ module.exports = function(grunt) {
105105
'src/js/directives/*.js',
106106
'src/js/filters/*.js',
107107
'src/js/routes.js',
108-
'src/js/services/*.js',
108+
'src/js/services/**/*.js',
109109
'src/js/models/*.js',
110110
'src/js/controllers/**/*.js'
111111
],
@@ -188,8 +188,8 @@ module.exports = function(grunt) {
188188
'src/js/models/*.js',
189189
'!src/js/models/*.spec.js',
190190

191-
'src/js/services/*.js',
192-
'!src/js/services/*.spec.js',
191+
'src/js/services/**/*.js',
192+
'!src/js/services/**/*.spec.js',
193193

194194
'src/js/controllers/**/*.js',
195195
'!src/js/controllers/**/*.spec.js',
@@ -201,7 +201,8 @@ module.exports = function(grunt) {
201201
'src/js/trezor-url.js',
202202
'bower_components/trezor-connect/connect.js',
203203
'node_modules/bezier-easing/dist/bezier-easing.min.js',
204-
'node_modules/cordova-plugin-qrscanner/dist/cordova-plugin-qrscanner-lib.min.js'
204+
'node_modules/cordova-plugin-qrscanner/dist/cordova-plugin-qrscanner-lib.min.js',
205+
'node_modules/cordova-plugin-camera-preview/www/CameraPreview.js'
205206
],
206207
dest: 'www/js/app.js'
207208
}
@@ -261,6 +262,24 @@ module.exports = function(grunt) {
261262
},
262263
},
263264
},
265+
gen_constant_moonpay_dev: {
266+
src: 'src/js/templates/constants/moonpay-config.constant.js',
267+
dest: 'src/js/generated/constants/moonpay-config.constant.js',
268+
options: {
269+
process: function (content, srcpath) {
270+
return processMoonPayConfig(content, 'dev');
271+
},
272+
},
273+
},
274+
gen_constant_moonpay_prod: {
275+
src: 'src/js/templates/constants/moonpay-config.constant.js',
276+
dest: 'src/js/generated/constants/moonpay-config.constant.js',
277+
options: {
278+
process: function (content, srcpath) {
279+
return processMoonPayConfig(content, 'prod');
280+
},
281+
},
282+
},
264283
ionic_fonts: {
265284
expand: true,
266285
flatten: true,
@@ -369,8 +388,8 @@ module.exports = function(grunt) {
369388

370389
grunt.registerTask('default', ['pre-dev', 'main']);
371390
grunt.registerTask('main', ['nggettext_compile', 'exec:appConfig', 'exec:externalServices', 'browserify', 'sass', 'concat', 'copy:ionic_fonts', 'copy:ionic_js']);
372-
grunt.registerTask('pre-dev', ['copy:gen_constant_leanplum_dev']);
373-
grunt.registerTask('prod', ['copy:gen_constant_leanplum_prod', 'main', 'uglify']);
391+
grunt.registerTask('pre-dev', ['copy:gen_constant_leanplum_dev', 'copy:gen_constant_moonpay_dev']);
392+
grunt.registerTask('prod', ['copy:gen_constant_leanplum_prod', 'copy:gen_constant_moonpay_prod', 'main', 'uglify']);
374393
grunt.registerTask('translate', ['nggettext_extract']);
375394
grunt.registerTask('chrome', ['default','exec:chrome']);
376395
grunt.registerTask('cordovaclean', ['exec:cordovaclean']);
@@ -423,7 +442,7 @@ module.exports = function(grunt) {
423442
function processLeanplumConfig(content, env) {
424443
var leanplumConfig = {};
425444
try {
426-
leanplumConfig = grunt.file.readJSON('../leanplum-config.json');
445+
leanplumConfig = grunt.file.readJSON('../wallet-configs/app-v1/leanplum-config.json');
427446
} catch (e) {
428447
// Without this, there is no clue on the console about what happened.
429448
if (env === 'prod') {
@@ -446,4 +465,36 @@ module.exports = function(grunt) {
446465
.replace("key: ''", "key: '" + key + "'");
447466
return newContent;
448467
}
468+
469+
function processMoonPayConfig(content, env) {
470+
var moonPayConfig = {};
471+
try {
472+
moonPayConfig = grunt.file.readJSON('../wallet-configs/app-v1/moonpay-config.json');
473+
} catch (e) {
474+
// Without this, there is no clue on the console about what happened.
475+
if (env === 'prod') {
476+
console.error('Error reading JSON', e);
477+
throw e;
478+
} else { // Allow people to build if they don't care about MoonPay
479+
console.warn('Failed to read MoonPay config JSON', e);
480+
return content;
481+
}
482+
}
483+
484+
var moonPayForEnv = env === 'prod' ? moonPayConfig.prod : moonPayConfig.dev;
485+
var baseUrl = moonPayForEnv.baseUrl;
486+
var pubKey = moonPayForEnv.pubKey;
487+
var secretKey = moonPayForEnv.secretKey;
488+
console.log('MoonPay baseUrl: "' + baseUrl + '"');
489+
console.log('MoonPay pubKey: "' + pubKey + '"');
490+
console.log('MoonPay secretKey: "' + secretKey + '"');
491+
console.log('MoonPay env: "' + env + '"');
492+
493+
var newContent = '// Generated\n' + content
494+
.replace("baseUrl: ''","baseUrl: '" + baseUrl + "'")
495+
.replace("pubKey: ''", "pubKey: '" + pubKey + "'")
496+
.replace("secretKey: ''", "secretKey: '" + secretKey + "'")
497+
.replace("env: ''", "env: '" + env + "'");
498+
return newContent;
499+
}
449500
};

app-template/bitcoincom/appConfig.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
"windowsAppId": "804636ee-b017-4cad-8719-e58ac97ffa5c",
2525
"pushSenderId": "1036948132229",
2626
"description": "A Secure Bitcoin Wallet",
27-
"version": "5.2.4",
28-
"fullVersion": "5.2-hotfix2",
29-
"androidVersion": "502202",
27+
"version": "5.4.3",
28+
"fullVersion": "5.4-rc4",
29+
"androidVersion": "504300",
3030
"_extraCSS": "",
3131
"_enabledExtensions": {
3232
"coinbase": false,
-23 KB
Binary file not shown.
-5.85 KB
Binary file not shown.

app-template/bitcoincom/img/16x16.png

-881 Bytes
Binary file not shown.

app-template/bitcoincom/img/24x24.png

-3.53 KB
Binary file not shown.
-8.59 KB
Binary file not shown.

app-template/bitcoincom/img/32x32.png

-1.26 KB
Binary file not shown.

app-template/bitcoincom/img/48x48.png

-4.27 KB
Binary file not shown.

app-template/bitcoincom/img/64x64.png

-4.6 KB
Binary file not shown.

app-template/bitcoincom/img/96x96.png

-5.37 KB
Binary file not shown.
-14.7 KB
Binary file not shown.

app-template/bitcoincom/img/icon-bitcoin-small.svg

-66
This file was deleted.

app-template/bitcoincom/img/icon-bitcoin-symbol.svg

-55
This file was deleted.

app-template/bitcoincom/img/icon-bitcoin-white.svg

-66
This file was deleted.

0 commit comments

Comments
 (0)