From dd3766242dcdfd334f79367793d2b27bfcc36eb6 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Sun, 30 Jul 2017 19:52:27 -0700 Subject: Adjust dimensions of popup.html and app bar to match --- app/notification.html | 2 +- app/popup.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/notification.html b/app/notification.html index cc485da7f..be38f4aa3 100644 --- a/app/notification.html +++ b/app/notification.html @@ -9,7 +9,7 @@ } - +
diff --git a/app/popup.html b/app/popup.html index d09b09315..471468b13 100644 --- a/app/popup.html +++ b/app/popup.html @@ -5,7 +5,7 @@ MetaMask Plugin - +
-- cgit v1.2.3 From 7ea38523ea8231fa75916f48803abb0eb593f9a2 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Sun, 30 Jul 2017 19:56:11 -0700 Subject: Set font-size on body of popup.html, for responsiveness --- app/popup.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/popup.html b/app/popup.html index 471468b13..a742686c5 100644 --- a/app/popup.html +++ b/app/popup.html @@ -5,7 +5,7 @@ MetaMask Plugin - +
-- cgit v1.2.3 From 3797b9921fc227c1bcf9681cffa73588cc7afb44 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Mon, 31 Jul 2017 20:22:15 -0700 Subject: Adjust popup size to 545x450; refactor wallet view to fit --- app/popup.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/popup.html b/app/popup.html index a742686c5..de0e100a5 100644 --- a/app/popup.html +++ b/app/popup.html @@ -5,7 +5,7 @@ MetaMask Plugin - +
-- cgit v1.2.3 From fce6041dbeb3384badef50467912ab47e51053ff Mon Sep 17 00:00:00 2001 From: sdtsui Date: Mon, 31 Jul 2017 20:44:32 -0700 Subject: Add new fonts from @cjeria: DIN Next and DIN OT --- app/fonts/DIN Next/DIN Next W01 Bold.otf | Bin 0 -> 106032 bytes app/fonts/DIN Next/DIN Next W01 Regular.otf | Bin 0 -> 106580 bytes app/fonts/DIN Next/DIN Next W10 Black.otf | Bin 0 -> 105972 bytes app/fonts/DIN Next/DIN Next W10 Italic.otf | Bin 0 -> 115984 bytes app/fonts/DIN Next/DIN Next W10 Light.otf | Bin 0 -> 108672 bytes app/fonts/DIN Next/DIN Next W10 Medium.otf | Bin 0 -> 105684 bytes app/fonts/DIN_OT/DINOT-2.otf | Bin 0 -> 44144 bytes app/fonts/DIN_OT/DINOT-Bold 2.otf | Bin 0 -> 45564 bytes app/fonts/DIN_OT/DINOT-BoldItalic.otf | Bin 0 -> 49684 bytes app/fonts/DIN_OT/DINOT-Italic 2.otf | Bin 0 -> 47956 bytes app/fonts/DIN_OT/DINOT-Medium 2.otf | Bin 0 -> 44652 bytes app/fonts/DIN_OT/DINOT-MediumItalic 2.otf | Bin 0 -> 47732 bytes 12 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/fonts/DIN Next/DIN Next W01 Bold.otf create mode 100644 app/fonts/DIN Next/DIN Next W01 Regular.otf create mode 100644 app/fonts/DIN Next/DIN Next W10 Black.otf create mode 100644 app/fonts/DIN Next/DIN Next W10 Italic.otf create mode 100644 app/fonts/DIN Next/DIN Next W10 Light.otf create mode 100644 app/fonts/DIN Next/DIN Next W10 Medium.otf create mode 100644 app/fonts/DIN_OT/DINOT-2.otf create mode 100644 app/fonts/DIN_OT/DINOT-Bold 2.otf create mode 100644 app/fonts/DIN_OT/DINOT-BoldItalic.otf create mode 100644 app/fonts/DIN_OT/DINOT-Italic 2.otf create mode 100644 app/fonts/DIN_OT/DINOT-Medium 2.otf create mode 100644 app/fonts/DIN_OT/DINOT-MediumItalic 2.otf (limited to 'app') diff --git a/app/fonts/DIN Next/DIN Next W01 Bold.otf b/app/fonts/DIN Next/DIN Next W01 Bold.otf new file mode 100644 index 000000000..2b78d1ff4 Binary files /dev/null and b/app/fonts/DIN Next/DIN Next W01 Bold.otf differ diff --git a/app/fonts/DIN Next/DIN Next W01 Regular.otf b/app/fonts/DIN Next/DIN Next W01 Regular.otf new file mode 100644 index 000000000..09f6ee297 Binary files /dev/null and b/app/fonts/DIN Next/DIN Next W01 Regular.otf differ diff --git a/app/fonts/DIN Next/DIN Next W10 Black.otf b/app/fonts/DIN Next/DIN Next W10 Black.otf new file mode 100644 index 000000000..08eb73373 Binary files /dev/null and b/app/fonts/DIN Next/DIN Next W10 Black.otf differ diff --git a/app/fonts/DIN Next/DIN Next W10 Italic.otf b/app/fonts/DIN Next/DIN Next W10 Italic.otf new file mode 100644 index 000000000..73f2b9e8c Binary files /dev/null and b/app/fonts/DIN Next/DIN Next W10 Italic.otf differ diff --git a/app/fonts/DIN Next/DIN Next W10 Light.otf b/app/fonts/DIN Next/DIN Next W10 Light.otf new file mode 100644 index 000000000..700450e49 Binary files /dev/null and b/app/fonts/DIN Next/DIN Next W10 Light.otf differ diff --git a/app/fonts/DIN Next/DIN Next W10 Medium.otf b/app/fonts/DIN Next/DIN Next W10 Medium.otf new file mode 100644 index 000000000..b73f2e43f Binary files /dev/null and b/app/fonts/DIN Next/DIN Next W10 Medium.otf differ diff --git a/app/fonts/DIN_OT/DINOT-2.otf b/app/fonts/DIN_OT/DINOT-2.otf new file mode 100644 index 000000000..4a5e13127 Binary files /dev/null and b/app/fonts/DIN_OT/DINOT-2.otf differ diff --git a/app/fonts/DIN_OT/DINOT-Bold 2.otf b/app/fonts/DIN_OT/DINOT-Bold 2.otf new file mode 100644 index 000000000..6ed5b6c3d Binary files /dev/null and b/app/fonts/DIN_OT/DINOT-Bold 2.otf differ diff --git a/app/fonts/DIN_OT/DINOT-BoldItalic.otf b/app/fonts/DIN_OT/DINOT-BoldItalic.otf new file mode 100644 index 000000000..148c90588 Binary files /dev/null and b/app/fonts/DIN_OT/DINOT-BoldItalic.otf differ diff --git a/app/fonts/DIN_OT/DINOT-Italic 2.otf b/app/fonts/DIN_OT/DINOT-Italic 2.otf new file mode 100644 index 000000000..e365e77ab Binary files /dev/null and b/app/fonts/DIN_OT/DINOT-Italic 2.otf differ diff --git a/app/fonts/DIN_OT/DINOT-Medium 2.otf b/app/fonts/DIN_OT/DINOT-Medium 2.otf new file mode 100644 index 000000000..a87a2df37 Binary files /dev/null and b/app/fonts/DIN_OT/DINOT-Medium 2.otf differ diff --git a/app/fonts/DIN_OT/DINOT-MediumItalic 2.otf b/app/fonts/DIN_OT/DINOT-MediumItalic 2.otf new file mode 100644 index 000000000..14eddfc76 Binary files /dev/null and b/app/fonts/DIN_OT/DINOT-MediumItalic 2.otf differ -- cgit v1.2.3 From 9cc461a6c2348ffd1a884e0ca92d74294cce6b4e Mon Sep 17 00:00:00 2001 From: sdtsui Date: Mon, 31 Jul 2017 23:07:25 -0700 Subject: Reset popup to 350x500, old form factor as advised by @Zanibas --- app/popup.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/popup.html b/app/popup.html index de0e100a5..fddf01841 100644 --- a/app/popup.html +++ b/app/popup.html @@ -5,7 +5,7 @@ MetaMask Plugin - +
-- cgit v1.2.3 From 46da924d485cf10be2965f4126609aa55707bfb5 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Wed, 2 Aug 2017 18:24:30 -0700 Subject: Add Ethereum Logo --- app/images/eth_logo.svg | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 app/images/eth_logo.svg (limited to 'app') diff --git a/app/images/eth_logo.svg b/app/images/eth_logo.svg new file mode 100644 index 000000000..894bd70dd --- /dev/null +++ b/app/images/eth_logo.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From 61b4b1f947230a8d5157fab27ee8ec82e0826e02 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Wed, 2 Aug 2017 19:13:17 -0700 Subject: Ensure app-header is rendered in responsive layout --- app/scripts/lib/is-popup-or-notification.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/lib/is-popup-or-notification.js b/app/scripts/lib/is-popup-or-notification.js index 693fa8751..73a812d5f 100644 --- a/app/scripts/lib/is-popup-or-notification.js +++ b/app/scripts/lib/is-popup-or-notification.js @@ -1,6 +1,6 @@ module.exports = function isPopupOrNotification () { const url = window.location.href - if (url.match(/popup.html$/)) { + if (url.match(/popup.html$/) || url.match(/home.html$/)) { return 'popup' } else { return 'notification' -- cgit v1.2.3 From dd4586ee84ea0e6a74ad4cd6b6f058169ddd9129 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Wed, 2 Aug 2017 19:26:46 -0700 Subject: Adjust sidebar transition using @cjeria\'s feedback --- app/scripts/lib/environment-type.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 app/scripts/lib/environment-type.js (limited to 'app') diff --git a/app/scripts/lib/environment-type.js b/app/scripts/lib/environment-type.js new file mode 100644 index 000000000..7966926eb --- /dev/null +++ b/app/scripts/lib/environment-type.js @@ -0,0 +1,10 @@ +module.exports = function environmentType () { + const url = window.location.href + if (url.match(/popup.html$/)) { + return 'popup' + } else if (url.match(/home.html$/)) { + return 'responsive' + } else { + return 'notification' + } +} -- cgit v1.2.3 From f7f9f87ef7850ae94595a5366d269d169139c127 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Fri, 4 Aug 2017 10:11:18 -0700 Subject: Add Roboto without hooking it up via import --- app/fonts/Roboto/Roboto-Black.ttf | Bin 0 -> 142472 bytes app/fonts/Roboto/Roboto-BlackItalic.ttf | Bin 0 -> 149644 bytes app/fonts/Roboto/Roboto-Bold.ttf | Bin 0 -> 135820 bytes app/fonts/Roboto/Roboto-BoldItalic.ttf | Bin 0 -> 144700 bytes app/fonts/Roboto/Roboto-Italic.ttf | Bin 0 -> 148540 bytes app/fonts/Roboto/Roboto-Light.ttf | Bin 0 -> 140276 bytes app/fonts/Roboto/Roboto-LightItalic.ttf | Bin 0 -> 145932 bytes app/fonts/Roboto/Roboto-Medium.ttf | Bin 0 -> 137308 bytes app/fonts/Roboto/Roboto-MediumItalic.ttf | Bin 0 -> 147876 bytes app/fonts/Roboto/Roboto-Regular.ttf | Bin 0 -> 145348 bytes app/fonts/Roboto/Roboto-Thin.ttf | Bin 0 -> 130044 bytes app/fonts/Roboto/Roboto-ThinItalic.ttf | Bin 0 -> 132376 bytes app/fonts/Roboto/RobotoCondensed-Bold.ttf | Bin 0 -> 141796 bytes app/fonts/Roboto/RobotoCondensed-BoldItalic.ttf | Bin 0 -> 145256 bytes app/fonts/Roboto/RobotoCondensed-Italic.ttf | Bin 0 -> 144404 bytes app/fonts/Roboto/RobotoCondensed-Light.ttf | Bin 0 -> 141384 bytes app/fonts/Roboto/RobotoCondensed-LightItalic.ttf | Bin 0 -> 145104 bytes app/fonts/Roboto/RobotoCondensed-Regular.ttf | Bin 0 -> 140396 bytes 18 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/fonts/Roboto/Roboto-Black.ttf create mode 100644 app/fonts/Roboto/Roboto-BlackItalic.ttf create mode 100644 app/fonts/Roboto/Roboto-Bold.ttf create mode 100644 app/fonts/Roboto/Roboto-BoldItalic.ttf create mode 100644 app/fonts/Roboto/Roboto-Italic.ttf create mode 100644 app/fonts/Roboto/Roboto-Light.ttf create mode 100644 app/fonts/Roboto/Roboto-LightItalic.ttf create mode 100644 app/fonts/Roboto/Roboto-Medium.ttf create mode 100644 app/fonts/Roboto/Roboto-MediumItalic.ttf create mode 100644 app/fonts/Roboto/Roboto-Regular.ttf create mode 100644 app/fonts/Roboto/Roboto-Thin.ttf create mode 100644 app/fonts/Roboto/Roboto-ThinItalic.ttf create mode 100644 app/fonts/Roboto/RobotoCondensed-Bold.ttf create mode 100644 app/fonts/Roboto/RobotoCondensed-BoldItalic.ttf create mode 100644 app/fonts/Roboto/RobotoCondensed-Italic.ttf create mode 100644 app/fonts/Roboto/RobotoCondensed-Light.ttf create mode 100644 app/fonts/Roboto/RobotoCondensed-LightItalic.ttf create mode 100644 app/fonts/Roboto/RobotoCondensed-Regular.ttf (limited to 'app') diff --git a/app/fonts/Roboto/Roboto-Black.ttf b/app/fonts/Roboto/Roboto-Black.ttf new file mode 100644 index 000000000..71f01ac2b Binary files /dev/null and b/app/fonts/Roboto/Roboto-Black.ttf differ diff --git a/app/fonts/Roboto/Roboto-BlackItalic.ttf b/app/fonts/Roboto/Roboto-BlackItalic.ttf new file mode 100644 index 000000000..ec309c785 Binary files /dev/null and b/app/fonts/Roboto/Roboto-BlackItalic.ttf differ diff --git a/app/fonts/Roboto/Roboto-Bold.ttf b/app/fonts/Roboto/Roboto-Bold.ttf new file mode 100644 index 000000000..aaf374d2c Binary files /dev/null and b/app/fonts/Roboto/Roboto-Bold.ttf differ diff --git a/app/fonts/Roboto/Roboto-BoldItalic.ttf b/app/fonts/Roboto/Roboto-BoldItalic.ttf new file mode 100644 index 000000000..dcd0f8007 Binary files /dev/null and b/app/fonts/Roboto/Roboto-BoldItalic.ttf differ diff --git a/app/fonts/Roboto/Roboto-Italic.ttf b/app/fonts/Roboto/Roboto-Italic.ttf new file mode 100644 index 000000000..f382c6874 Binary files /dev/null and b/app/fonts/Roboto/Roboto-Italic.ttf differ diff --git a/app/fonts/Roboto/Roboto-Light.ttf b/app/fonts/Roboto/Roboto-Light.ttf new file mode 100644 index 000000000..664e1b2f9 Binary files /dev/null and b/app/fonts/Roboto/Roboto-Light.ttf differ diff --git a/app/fonts/Roboto/Roboto-LightItalic.ttf b/app/fonts/Roboto/Roboto-LightItalic.ttf new file mode 100644 index 000000000..b8f529637 Binary files /dev/null and b/app/fonts/Roboto/Roboto-LightItalic.ttf differ diff --git a/app/fonts/Roboto/Roboto-Medium.ttf b/app/fonts/Roboto/Roboto-Medium.ttf new file mode 100644 index 000000000..aa00de0ef Binary files /dev/null and b/app/fonts/Roboto/Roboto-Medium.ttf differ diff --git a/app/fonts/Roboto/Roboto-MediumItalic.ttf b/app/fonts/Roboto/Roboto-MediumItalic.ttf new file mode 100644 index 000000000..67e25f019 Binary files /dev/null and b/app/fonts/Roboto/Roboto-MediumItalic.ttf differ diff --git a/app/fonts/Roboto/Roboto-Regular.ttf b/app/fonts/Roboto/Roboto-Regular.ttf new file mode 100644 index 000000000..3e6e2e761 Binary files /dev/null and b/app/fonts/Roboto/Roboto-Regular.ttf differ diff --git a/app/fonts/Roboto/Roboto-Thin.ttf b/app/fonts/Roboto/Roboto-Thin.ttf new file mode 100644 index 000000000..d262d1446 Binary files /dev/null and b/app/fonts/Roboto/Roboto-Thin.ttf differ diff --git a/app/fonts/Roboto/Roboto-ThinItalic.ttf b/app/fonts/Roboto/Roboto-ThinItalic.ttf new file mode 100644 index 000000000..63e9f9718 Binary files /dev/null and b/app/fonts/Roboto/Roboto-ThinItalic.ttf differ diff --git a/app/fonts/Roboto/RobotoCondensed-Bold.ttf b/app/fonts/Roboto/RobotoCondensed-Bold.ttf new file mode 100644 index 000000000..48dd63534 Binary files /dev/null and b/app/fonts/Roboto/RobotoCondensed-Bold.ttf differ diff --git a/app/fonts/Roboto/RobotoCondensed-BoldItalic.ttf b/app/fonts/Roboto/RobotoCondensed-BoldItalic.ttf new file mode 100644 index 000000000..ad728646a Binary files /dev/null and b/app/fonts/Roboto/RobotoCondensed-BoldItalic.ttf differ diff --git a/app/fonts/Roboto/RobotoCondensed-Italic.ttf b/app/fonts/Roboto/RobotoCondensed-Italic.ttf new file mode 100644 index 000000000..a232513d5 Binary files /dev/null and b/app/fonts/Roboto/RobotoCondensed-Italic.ttf differ diff --git a/app/fonts/Roboto/RobotoCondensed-Light.ttf b/app/fonts/Roboto/RobotoCondensed-Light.ttf new file mode 100644 index 000000000..a6e368d40 Binary files /dev/null and b/app/fonts/Roboto/RobotoCondensed-Light.ttf differ diff --git a/app/fonts/Roboto/RobotoCondensed-LightItalic.ttf b/app/fonts/Roboto/RobotoCondensed-LightItalic.ttf new file mode 100644 index 000000000..5b2b6ae08 Binary files /dev/null and b/app/fonts/Roboto/RobotoCondensed-LightItalic.ttf differ diff --git a/app/fonts/Roboto/RobotoCondensed-Regular.ttf b/app/fonts/Roboto/RobotoCondensed-Regular.ttf new file mode 100644 index 000000000..65bf32a19 Binary files /dev/null and b/app/fonts/Roboto/RobotoCondensed-Regular.ttf differ -- cgit v1.2.3 From 65d27623466527edfa42e29807e658c073eebcc2 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Tue, 22 Aug 2017 12:47:33 -0700 Subject: Add bolt and info icon vector images --- app/images/mm-bolt.svg | 11 +++++++++++ app/images/mm-info-icon.svg | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 app/images/mm-bolt.svg create mode 100644 app/images/mm-info-icon.svg (limited to 'app') diff --git a/app/images/mm-bolt.svg b/app/images/mm-bolt.svg new file mode 100644 index 000000000..bbf0abcc7 --- /dev/null +++ b/app/images/mm-bolt.svg @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/images/mm-info-icon.svg b/app/images/mm-info-icon.svg new file mode 100644 index 000000000..825f0f200 --- /dev/null +++ b/app/images/mm-info-icon.svg @@ -0,0 +1,11 @@ + + + + + + + -- cgit v1.2.3 From 5facba89ca8a106e7ae964f351ab532d9029e0f5 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 29 Aug 2017 14:11:11 -0230 Subject: Replace Avenir Next with alternative. --- app/fonts/Lato/Lato-Black.ttf | Bin 0 -> 114588 bytes app/fonts/Lato/Lato-BlackItalic.ttf | Bin 0 -> 111616 bytes app/fonts/Lato/Lato-Bold.ttf | Bin 0 -> 121788 bytes app/fonts/Lato/Lato-BoldItalic.ttf | Bin 0 -> 120312 bytes app/fonts/Lato/Lato-Hairline.ttf | Bin 0 -> 115316 bytes app/fonts/Lato/Lato-HairlineItalic.ttf | Bin 0 -> 91460 bytes app/fonts/Lato/Lato-Italic.ttf | Bin 0 -> 118352 bytes app/fonts/Lato/Lato-Light.ttf | Bin 0 -> 122524 bytes app/fonts/Lato/Lato-LightItalic.ttf | Bin 0 -> 91600 bytes app/fonts/Lato/Lato-Regular.ttf | Bin 0 -> 120196 bytes app/fonts/Lato/OFL.txt | 93 +++++++++++++++++++++++++++++++++ 11 files changed, 93 insertions(+) create mode 100755 app/fonts/Lato/Lato-Black.ttf create mode 100755 app/fonts/Lato/Lato-BlackItalic.ttf create mode 100755 app/fonts/Lato/Lato-Bold.ttf create mode 100755 app/fonts/Lato/Lato-BoldItalic.ttf create mode 100755 app/fonts/Lato/Lato-Hairline.ttf create mode 100755 app/fonts/Lato/Lato-HairlineItalic.ttf create mode 100755 app/fonts/Lato/Lato-Italic.ttf create mode 100755 app/fonts/Lato/Lato-Light.ttf create mode 100755 app/fonts/Lato/Lato-LightItalic.ttf create mode 100755 app/fonts/Lato/Lato-Regular.ttf create mode 100755 app/fonts/Lato/OFL.txt (limited to 'app') diff --git a/app/fonts/Lato/Lato-Black.ttf b/app/fonts/Lato/Lato-Black.ttf new file mode 100755 index 000000000..6848db0d1 Binary files /dev/null and b/app/fonts/Lato/Lato-Black.ttf differ diff --git a/app/fonts/Lato/Lato-BlackItalic.ttf b/app/fonts/Lato/Lato-BlackItalic.ttf new file mode 100755 index 000000000..5decf1297 Binary files /dev/null and b/app/fonts/Lato/Lato-BlackItalic.ttf differ diff --git a/app/fonts/Lato/Lato-Bold.ttf b/app/fonts/Lato/Lato-Bold.ttf new file mode 100755 index 000000000..74343694e Binary files /dev/null and b/app/fonts/Lato/Lato-Bold.ttf differ diff --git a/app/fonts/Lato/Lato-BoldItalic.ttf b/app/fonts/Lato/Lato-BoldItalic.ttf new file mode 100755 index 000000000..684aacf5b Binary files /dev/null and b/app/fonts/Lato/Lato-BoldItalic.ttf differ diff --git a/app/fonts/Lato/Lato-Hairline.ttf b/app/fonts/Lato/Lato-Hairline.ttf new file mode 100755 index 000000000..288be2955 Binary files /dev/null and b/app/fonts/Lato/Lato-Hairline.ttf differ diff --git a/app/fonts/Lato/Lato-HairlineItalic.ttf b/app/fonts/Lato/Lato-HairlineItalic.ttf new file mode 100755 index 000000000..c2bfd3353 Binary files /dev/null and b/app/fonts/Lato/Lato-HairlineItalic.ttf differ diff --git a/app/fonts/Lato/Lato-Italic.ttf b/app/fonts/Lato/Lato-Italic.ttf new file mode 100755 index 000000000..3d3b7a298 Binary files /dev/null and b/app/fonts/Lato/Lato-Italic.ttf differ diff --git a/app/fonts/Lato/Lato-Light.ttf b/app/fonts/Lato/Lato-Light.ttf new file mode 100755 index 000000000..a958067a8 Binary files /dev/null and b/app/fonts/Lato/Lato-Light.ttf differ diff --git a/app/fonts/Lato/Lato-LightItalic.ttf b/app/fonts/Lato/Lato-LightItalic.ttf new file mode 100755 index 000000000..5e45ad9a6 Binary files /dev/null and b/app/fonts/Lato/Lato-LightItalic.ttf differ diff --git a/app/fonts/Lato/Lato-Regular.ttf b/app/fonts/Lato/Lato-Regular.ttf new file mode 100755 index 000000000..04ea8efb1 Binary files /dev/null and b/app/fonts/Lato/Lato-Regular.ttf differ diff --git a/app/fonts/Lato/OFL.txt b/app/fonts/Lato/OFL.txt new file mode 100755 index 000000000..dfca0da4b --- /dev/null +++ b/app/fonts/Lato/OFL.txt @@ -0,0 +1,93 @@ +Copyright (c) 2010-2014 by tyPoland Lukasz Dziedzic (team@latofonts.com) with Reserved Font Name "Lato" + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. -- cgit v1.2.3 From bffdde2082a64a78228b58b45778fd7886a0eceb Mon Sep 17 00:00:00 2001 From: Chi Kei Chan Date: Tue, 5 Sep 2017 23:33:41 -0700 Subject: Fix html height --- app/popup.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/popup.html b/app/popup.html index fddf01841..c4e5188e5 100644 --- a/app/popup.html +++ b/app/popup.html @@ -1,11 +1,11 @@ - + MetaMask Plugin - +
-- cgit v1.2.3 From 7eb6dae4185d083ebb967256fdd09203b5092480 Mon Sep 17 00:00:00 2001 From: Chi Kei Chan Date: Tue, 12 Sep 2017 02:22:23 -0700 Subject: Added signTokenTx; Adding token confirmation screen --- app/scripts/popup-core.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app') diff --git a/app/scripts/popup-core.js b/app/scripts/popup-core.js index f1eb394d7..94ba141bc 100644 --- a/app/scripts/popup-core.js +++ b/app/scripts/popup-core.js @@ -1,6 +1,7 @@ const EventEmitter = require('events').EventEmitter const async = require('async') const Dnode = require('dnode') +const Eth = require('ethjs') const EthQuery = require('eth-query') const launchMetamaskUi = require('../../ui') const StreamProvider = require('web3-stream-provider') @@ -34,6 +35,7 @@ function setupWeb3Connection (connectionStream) { providerStream.on('error', console.error.bind(console)) global.ethereumProvider = providerStream global.ethQuery = new EthQuery(providerStream) + global.eth = new Eth(providerStream) } function setupControllerConnection (connectionStream, cb) { @@ -47,6 +49,7 @@ function setupControllerConnection (connectionStream, cb) { }) connectionStream.pipe(accountManagerDnode).pipe(connectionStream) accountManagerDnode.once('remote', function (accountManager) { + console.log({ accountManager }) // setup push events accountManager.on = eventEmitter.on.bind(eventEmitter) cb(null, accountManager) -- cgit v1.2.3 From 8b5f2a95df45c24061c13c51ca874e933e743381 Mon Sep 17 00:00:00 2001 From: Chi Kei Chan Date: Tue, 12 Sep 2017 23:02:51 -0700 Subject: Improve styling in Confirmation Screen; Show decoded send token data --- app/scripts/popup-core.js | 1 - 1 file changed, 1 deletion(-) (limited to 'app') diff --git a/app/scripts/popup-core.js b/app/scripts/popup-core.js index 94ba141bc..2e4334bb1 100644 --- a/app/scripts/popup-core.js +++ b/app/scripts/popup-core.js @@ -49,7 +49,6 @@ function setupControllerConnection (connectionStream, cb) { }) connectionStream.pipe(accountManagerDnode).pipe(connectionStream) accountManagerDnode.once('remote', function (accountManager) { - console.log({ accountManager }) // setup push events accountManager.on = eventEmitter.on.bind(eventEmitter) cb(null, accountManager) -- cgit v1.2.3 From ac4868170f4c61d13291389d01bf1002fe240ed4 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 3 Oct 2017 14:55:52 -0230 Subject: Enables remove token and ensures add/remove update the list without need for refresh. --- app/scripts/controllers/preferences.js | 13 ++++++++++++- app/scripts/metamask-controller.js | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index bc4848421..ecac40481 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -42,7 +42,18 @@ class PreferencesController { } this.store.updateState({ tokens }) - return Promise.resolve() + return Promise.resolve(tokens) + } + + removeToken (rawAddress) { + const address = normalizeAddress(rawAddress) + + const tokens = this.store.getState().tokens + + const updatedTokens = tokens.filter(token => token.address !== rawAddress) + + this.store.updateState({ tokens: updatedTokens }) + return Promise.resolve(updatedTokens) } getTokens () { diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 5b3161bc6..b5c81c348 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -327,6 +327,7 @@ module.exports = class MetamaskController extends EventEmitter { // PreferencesController setSelectedAddress: nodeify(preferencesController.setSelectedAddress, preferencesController), addToken: nodeify(preferencesController.addToken, preferencesController), + removeToken: nodeify(preferencesController.removeToken, preferencesController), setCurrentAccountTab: nodeify(preferencesController.setCurrentAccountTab, preferencesController), setDefaultRpc: nodeify(this.setDefaultRpc, this), setCustomRpc: nodeify(this.setCustomRpc, this), -- cgit v1.2.3 From bbe893a0d8d759ba750ba78ff8aed0f0876a43ff Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 5 Oct 2017 13:14:45 -0230 Subject: UI for send screen container without form rows. --- app/scripts/lib/is-popup-or-notification.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/lib/is-popup-or-notification.js b/app/scripts/lib/is-popup-or-notification.js index 73a812d5f..e2999411f 100644 --- a/app/scripts/lib/is-popup-or-notification.js +++ b/app/scripts/lib/is-popup-or-notification.js @@ -1,6 +1,9 @@ module.exports = function isPopupOrNotification () { const url = window.location.href - if (url.match(/popup.html$/) || url.match(/home.html$/)) { + // if (url.match(/popup.html$/) || url.match(/home.html$/)) { + // Below regexes needed for feature toggles (e.g. see line ~340 in ui/app/app.js) + // Revert below regexes to above commented out regexes before merge to master + if (url.match(/popup.html(?:\?.+)*$/) || url.match(/home.html(?:\?.+)*$/)) { return 'popup' } else { return 'notification' -- cgit v1.2.3 From 81f62a7443d47461b5f9b20f442392562458c79a Mon Sep 17 00:00:00 2001 From: Chi Kei Chan Date: Fri, 13 Oct 2017 02:10:58 -0400 Subject: Adding Account Dropdown V2 --- app/images/.DS_Store | Bin 6148 -> 0 bytes app/images/import-account.svg | 18 +++++++++++++++++ app/images/plus-btn-white.svg | 17 ++++++++++++++++ app/images/settings.svg | 46 ++++++++++++++++++++---------------------- 4 files changed, 57 insertions(+), 24 deletions(-) delete mode 100644 app/images/.DS_Store create mode 100644 app/images/import-account.svg create mode 100644 app/images/plus-btn-white.svg (limited to 'app') diff --git a/app/images/.DS_Store b/app/images/.DS_Store deleted file mode 100644 index d28ef2089..000000000 Binary files a/app/images/.DS_Store and /dev/null differ diff --git a/app/images/import-account.svg b/app/images/import-account.svg new file mode 100644 index 000000000..d6a81b70c --- /dev/null +++ b/app/images/import-account.svg @@ -0,0 +1,18 @@ + + + + import-account + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/images/plus-btn-white.svg b/app/images/plus-btn-white.svg new file mode 100644 index 000000000..2672d39dd --- /dev/null +++ b/app/images/plus-btn-white.svg @@ -0,0 +1,17 @@ + + + + plus-btn-white + Created with Sketch. + + + + + + + + + + + + \ No newline at end of file diff --git a/app/images/settings.svg b/app/images/settings.svg index fe61320a5..cf9b298dd 100644 --- a/app/images/settings.svg +++ b/app/images/settings.svg @@ -1,24 +1,22 @@ - - - - - - + + + + settings + Created with Sketch. + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From 48f348e7296dd323c1cfd6194a88a26b3339042b Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 20 Oct 2017 11:30:56 -0700 Subject: 4.0.1 --- app/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index a0f449c68..e88d8dc11 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "3.11.0", + "version": "4.0.1", "manifest_version": 2, "author": "https://metamask.io", "description": "Ethereum Browser Extension", -- cgit v1.2.3 From a9a841ba01f6bffa29a3e0491e3a88f6aff72ac7 Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 20 Oct 2017 19:33:15 -0700 Subject: 4.0.2 --- app/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index e88d8dc11..33b1ac6e3 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "4.0.1", + "version": "4.0.2", "manifest_version": 2, "author": "https://metamask.io", "description": "Ethereum Browser Extension", -- cgit v1.2.3 From 4401800a42eccbd77f11b332e1052431328401bb Mon Sep 17 00:00:00 2001 From: Chi Kei Chan Date: Tue, 24 Oct 2017 00:13:49 -0700 Subject: Account menu white check mark --- app/images/check-white.svg | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/images/check-white.svg (limited to 'app') diff --git a/app/images/check-white.svg b/app/images/check-white.svg new file mode 100644 index 000000000..0f15667da --- /dev/null +++ b/app/images/check-white.svg @@ -0,0 +1,14 @@ + + + + check-white + Created with Sketch. + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From 311ca1f3ca52ca4a4f45098ba3a0a5750ae9d3c6 Mon Sep 17 00:00:00 2001 From: Chi Kei Chan Date: Wed, 25 Oct 2017 00:10:09 -0700 Subject: Fix styling on notification view --- app/notification.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/notification.html b/app/notification.html index be38f4aa3..f10cbbf41 100644 --- a/app/notification.html +++ b/app/notification.html @@ -1,5 +1,5 @@ - + MetaMask Notification @@ -9,7 +9,7 @@ } - +
-- cgit v1.2.3 From 3d8182f5d54730d3908a210c3deb71b49dd08100 Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Wed, 25 Oct 2017 09:26:05 -0700 Subject: Add Info section --- app/images/info-logo.png | Bin 0 -> 32567 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/images/info-logo.png (limited to 'app') diff --git a/app/images/info-logo.png b/app/images/info-logo.png new file mode 100644 index 000000000..f654ed5b1 Binary files /dev/null and b/app/images/info-logo.png differ -- cgit v1.2.3 From ddf11011c9467209e6b9810dff2df84ea9e4a040 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 25 Oct 2017 21:58:56 -0230 Subject: Signature request fixes. --- app/scripts/lib/notification-manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index 7846ef7f0..98cd3f760 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -1,5 +1,5 @@ const extension = require('extensionizer') -const height = 520 +const height = 610 const width = 360 -- cgit v1.2.3 From fa95303e1efef03db6c44878b89ccca680639598 Mon Sep 17 00:00:00 2001 From: Chi Kei Chan Date: Wed, 25 Oct 2017 18:05:52 -0700 Subject: Sign Typed Request styling fixes --- app/scripts/lib/notification-manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index 98cd3f760..adaf60c65 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -1,5 +1,5 @@ const extension = require('extensionizer') -const height = 610 +const height = 620 const width = 360 -- cgit v1.2.3 From c1d2a1226c5ba4e5cfe1eeae2f52a86b67fc7404 Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 25 Oct 2017 20:13:05 -0700 Subject: 4.0.3 --- app/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index 33b1ac6e3..65d7a4811 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "4.0.2", + "version": "4.0.3", "manifest_version": 2, "author": "https://metamask.io", "description": "Ethereum Browser Extension", -- cgit v1.2.3 From 5a94775b3fa22517a71232ebe229ee83e9debcf1 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 2 Nov 2017 00:00:33 -0230 Subject: Lint fixes for NewUI-flat. --- app/scripts/controllers/preferences.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'app') diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index ecac40481..10004caad 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -46,8 +46,6 @@ class PreferencesController { } removeToken (rawAddress) { - const address = normalizeAddress(rawAddress) - const tokens = this.store.getState().tokens const updatedTokens = tokens.filter(token => token.address !== rawAddress) -- cgit v1.2.3 From 03968ffafe27e64dcdf58764057cee1d67aa4168 Mon Sep 17 00:00:00 2001 From: Chi Kei Chan Date: Wed, 15 Nov 2017 12:23:39 -0800 Subject: Version Bump --- app/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index 65d7a4811..ff595c717 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "4.0.3", + "version": "4.0.4", "manifest_version": 2, "author": "https://metamask.io", "description": "Ethereum Browser Extension", -- cgit v1.2.3 From 90fc4812bc75857581e56eb6d63484dbc5c48cb1 Mon Sep 17 00:00:00 2001 From: "Clark, Jason (Contractor)" Date: Thu, 23 Nov 2017 18:33:44 -0700 Subject: incremental commit --- app/scripts/controllers/preferences.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app') diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 10004caad..c0454f77b 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -14,6 +14,14 @@ class PreferencesController { } // PUBLIC METHODS + toggleUseBlockie () { + this.store.updateState({ useBlockie: !this.useBlockie() }) + } + + getUseBlockie () { + return this.store.getState().useBlockie + } + setSelectedAddress (_address) { return new Promise((resolve, reject) => { const address = normalizeAddress(_address) -- cgit v1.2.3 From fc46a16a329df296cb565e3a0b04f268d2aeceb5 Mon Sep 17 00:00:00 2001 From: Jason Clark Date: Fri, 24 Nov 2017 10:35:17 -0700 Subject: toggle wired up to preferences property store --- app/scripts/controllers/preferences.js | 4 ++-- app/scripts/metamask-controller.js | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index c0454f77b..7ccb0e730 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -14,8 +14,8 @@ class PreferencesController { } // PUBLIC METHODS - toggleUseBlockie () { - this.store.updateState({ useBlockie: !this.useBlockie() }) + setUseBlockie (val) { + this.store.updateState({ useBlockie: val }) } getUseBlockie () { diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index bd71da8e0..3a935d895 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -315,6 +315,7 @@ module.exports = class MetamaskController extends EventEmitter { // etc getState: (cb) => cb(null, this.getState()), setCurrentCurrency: this.setCurrentCurrency.bind(this), + setUseBlockie: this.setUseBlockie.bind(this), markAccountsFound: this.markAccountsFound.bind(this), // coinbase @@ -774,4 +775,13 @@ module.exports = class MetamaskController extends EventEmitter { return rpcTarget } + setUseBlockie(val, cb) { + try { + this.preferencesController.setUseBlockie(val) + cb(null) + } catch (err) { + cb(err) + } + } + } -- cgit v1.2.3 From abefcc9612d75067474e521486d62684dfeae9c7 Mon Sep 17 00:00:00 2001 From: Jason Clark Date: Sat, 25 Nov 2017 15:57:54 -0700 Subject: more eslint fixes --- app/scripts/metamask-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 3a935d895..4dce89e3a 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -775,7 +775,7 @@ module.exports = class MetamaskController extends EventEmitter { return rpcTarget } - setUseBlockie(val, cb) { + setUseBlockie (val, cb) { try { this.preferencesController.setUseBlockie(val) cb(null) -- cgit v1.2.3 From a34362b7765f48d24375c9953fa7c49cf3306491 Mon Sep 17 00:00:00 2001 From: Jason Clark Date: Mon, 27 Nov 2017 08:11:48 -0700 Subject: Fixes changes requested in pullrequestreview-79088534 --- app/scripts/controllers/preferences.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 7ccb0e730..0aed4dbdf 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -9,6 +9,7 @@ class PreferencesController { frequentRpcList: [], currentAccountTab: 'history', tokens: [], + useBlockie: false, }, opts.initState) this.store = new ObservableStore(initState) } -- cgit v1.2.3 From 7f795240706c013dc4a9ece0e9c9e33897c7fc71 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 14 Nov 2017 12:34:55 -0330 Subject: Add UI selection --- app/scripts/controllers/preferences.js | 17 +++++++++++++++++ app/scripts/metamask-controller.js | 1 + app/scripts/popup.js | 1 + 3 files changed, 19 insertions(+) (limited to 'app') diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 0aed4dbdf..0dd9eae1b 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -10,6 +10,7 @@ class PreferencesController { currentAccountTab: 'history', tokens: [], useBlockie: false, + featureFlags: {}, }, opts.initState) this.store = new ObservableStore(initState) } @@ -100,6 +101,22 @@ class PreferencesController { getFrequentRpcList () { return this.store.getState().frequentRpcList } + + setFeatureFlag (feature, activated) { + const currentFeatureFlags = this.store.getState().featureFlags + const updatedFeatureFlags = { + ...currentFeatureFlags, + [feature]: activated, + } + + this.store.updateState({ featureFlags: updatedFeatureFlags }) + console.log(`!!! updatedFeatureFlags`, updatedFeatureFlags); + return Promise.resolve(updatedFeatureFlags) + } + + getFeatureFlags () { + return this.store.getState().featureFlags + } // // PRIVATE METHODS // diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 4dce89e3a..8966ba393 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -341,6 +341,7 @@ module.exports = class MetamaskController extends EventEmitter { addToken: nodeify(preferencesController.addToken, preferencesController), removeToken: nodeify(preferencesController.removeToken, preferencesController), setCurrentAccountTab: nodeify(preferencesController.setCurrentAccountTab, preferencesController), + setFeatureFlag: nodeify(preferencesController.setFeatureFlag, preferencesController), // AddressController setAddressBook: nodeify(addressBookController.setAddressBook, addressBookController), diff --git a/app/scripts/popup.js b/app/scripts/popup.js index 5f17f0651..8cef06931 100644 --- a/app/scripts/popup.js +++ b/app/scripts/popup.js @@ -12,6 +12,7 @@ const notificationManager = new NotificationManager() global.platform = new ExtensionPlatform() // inject css +console.log(`MetaMaskUiCss`, MetaMaskUiCss); const css = MetaMaskUiCss() injectCss(css) -- cgit v1.2.3 From db06e7e649c5bdc98063bfeb7d7cbff999543c32 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 15 Nov 2017 14:09:54 -0330 Subject: Css selected in background based on betaUI state. --- app/scripts/popup.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/scripts/popup.js b/app/scripts/popup.js index 8cef06931..d0952af6a 100644 --- a/app/scripts/popup.js +++ b/app/scripts/popup.js @@ -1,5 +1,6 @@ const injectCss = require('inject-css') -const MetaMaskUiCss = require('../../ui/css') +const OldMetaMaskUiCss = require('../../old-ui/css') +const NewMetaMaskUiCss = require('../../ui/css') const startPopup = require('./popup-core') const PortStream = require('./lib/port-stream.js') const isPopupOrNotification = require('./lib/is-popup-or-notification') @@ -11,11 +12,6 @@ const notificationManager = new NotificationManager() // create platform global global.platform = new ExtensionPlatform() -// inject css -console.log(`MetaMaskUiCss`, MetaMaskUiCss); -const css = MetaMaskUiCss() -injectCss(css) - // identify window type (popup, notification) const windowType = isPopupOrNotification() global.METAMASK_UI_TYPE = windowType @@ -29,8 +25,21 @@ const connectionStream = new PortStream(extensionPort) const container = document.getElementById('app-content') startPopup({ container, connectionStream }, (err, store) => { if (err) return displayCriticalError(err) + + let betaUIState = store.getState().metamask.featureFlags.betaUI + let css = betaUIState ? NewMetaMaskUiCss() : OldMetaMaskUiCss() + let deleteInjectedCss = injectCss(css) + let newBetaUIState + store.subscribe(() => { const state = store.getState() + newBetaUIState = state.metamask.featureFlags.betaUI + if (newBetaUIState !== betaUIState) { + deleteInjectedCss() + betaUIState = newBetaUIState + css = betaUIState ? NewMetaMaskUiCss() : OldMetaMaskUiCss() + deleteInjectedCss = injectCss(css) + } if (state.appState.shouldClose) notificationManager.closePopup() }) }) -- cgit v1.2.3 From 84321b2d9b08a2b0f3e773cfb6f6d11dff9f7d4c Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 16 Nov 2017 15:58:59 -0330 Subject: Lint fix --- app/scripts/controllers/preferences.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 0dd9eae1b..de9006044 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -110,7 +110,7 @@ class PreferencesController { } this.store.updateState({ featureFlags: updatedFeatureFlags }) - console.log(`!!! updatedFeatureFlags`, updatedFeatureFlags); + return Promise.resolve(updatedFeatureFlags) } -- cgit v1.2.3 From ec6c3c33bdbe2d90dc71649d0cc5fb3c07d96af7 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 5 Dec 2017 13:11:59 -0330 Subject: Merge branch 'master' into NewUI-flat-merge-with-master --- app/scripts/background.js | 9 ++++---- app/scripts/controllers/network.js | 2 +- app/scripts/inpage.js | 7 ++++++ app/scripts/lib/inpage-provider.js | 4 +++- app/scripts/metamask-controller.js | 47 ++++++++++++++++++++++++++++++++++---- app/scripts/migrations/020.js | 41 +++++++++++++++++++++++++++++++++ app/scripts/migrations/index.js | 1 + app/scripts/notice-controller.js | 44 +++++++++++++++++++++++------------ 8 files changed, 129 insertions(+), 26 deletions(-) create mode 100644 app/scripts/migrations/020.js (limited to 'app') diff --git a/app/scripts/background.js b/app/scripts/background.js index 3e560d302..da022c490 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -1,10 +1,11 @@ const urlUtil = require('url') const endOfStream = require('end-of-stream') -const pipe = require('pump') +const pump = require('pump') const log = require('loglevel') const extension = require('extensionizer') const LocalStorageStore = require('obs-store/lib/localStorage') const storeTransform = require('obs-store/lib/transform') +const asStream = require('obs-store/lib/asStream') const ExtensionPlatform = require('./platforms/extension') const Migrator = require('./lib/migrator/') const migrations = require('./migrations/') @@ -72,10 +73,10 @@ function setupController (initState) { global.metamaskController = controller // setup state persistence - pipe( - controller.store, + pump( + asStream(controller.store), storeTransform(versionifyData), - diskStore + asStream(diskStore) ) function versionifyData (state) { diff --git a/app/scripts/controllers/network.js b/app/scripts/controllers/network.js index 23afdc12b..045bfcc5d 100644 --- a/app/scripts/controllers/network.js +++ b/app/scripts/controllers/network.js @@ -53,7 +53,7 @@ module.exports = class NetworkController extends EventEmitter { lookupNetwork () { // Prevent firing when provider is not defined. if (!this.ethQuery || !this.ethQuery.sendAsync) { - return + return log.warn('NetworkController - lookupNetwork aborted due to missing ethQuery') } this.ethQuery.sendAsync({ method: 'net_version' }, (err, network) => { if (err) return this.setNetworkState('loading') diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js index b6889b00f..9261e7d64 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -31,6 +31,13 @@ var inpageProvider = new MetamaskInpageProvider(metamaskStream) // setup web3 // +if (typeof window.web3 !== 'undefined') { + throw new Error(`MetaMask detected another web3. + MetaMask will not work reliably with another web3 extension. + This usually happens if you have two MetaMasks installed, + or MetaMask and another web3 extension. Please remove one + and try again.`) +} var web3 = new Web3(inpageProvider) web3.setProvider = function () { log.debug('MetaMask - overrode web3.setProvider') diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index da75c4be2..99cc5d2cf 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -3,6 +3,7 @@ const RpcEngine = require('json-rpc-engine') const createIdRemapMiddleware = require('json-rpc-engine/src/idRemapMiddleware') const createStreamMiddleware = require('json-rpc-middleware-stream') const LocalStorageStore = require('obs-store') +const asStream = require('obs-store/lib/asStream') const ObjectMultiplex = require('obj-multiplex') module.exports = MetamaskInpageProvider @@ -21,9 +22,10 @@ function MetamaskInpageProvider (connectionStream) { // subscribe to metamask public config (one-way) self.publicConfigStore = new LocalStorageStore({ storageKey: 'MetaMask-Config' }) + pump( mux.createStream('publicConfig'), - self.publicConfigStore, + asStream(self.publicConfigStore), (err) => logStreamDisconnectWarning('MetaMask PublicConfigStore', err) ) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 4dce89e3a..a96d20d3b 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -3,6 +3,7 @@ const extend = require('xtend') const pump = require('pump') const Dnode = require('dnode') const ObservableStore = require('obs-store') +const asStream = require('obs-store/lib/asStream') const AccountTracker = require('./lib/account-tracker') const EthQuery = require('eth-query') const RpcEngine = require('json-rpc-engine') @@ -31,6 +32,7 @@ const ConfigManager = require('./lib/config-manager') const nodeify = require('./lib/nodeify') const accountImporter = require('./account-import-strategies') const getBuyEthUrl = require('./lib/buy-eth-url') +const Mutex = require('await-semaphore').Mutex const version = require('../manifest.json').version module.exports = class MetamaskController extends EventEmitter { @@ -38,10 +40,12 @@ module.exports = class MetamaskController extends EventEmitter { constructor (opts) { super() + this.sendUpdate = debounce(this.privateSendUpdate.bind(this), 200) this.opts = opts const initState = opts.initState || {} + this.recordFirstTimeInfo(initState) // platform-specific api this.platform = opts.platform @@ -49,6 +53,9 @@ module.exports = class MetamaskController extends EventEmitter { // observable state store this.store = new ObservableStore(initState) + // lock to ensure only one vault created at once + this.createVaultMutex = new Mutex() + // network store this.networkController = new NetworkController(initState.NetworkController) @@ -144,6 +151,8 @@ module.exports = class MetamaskController extends EventEmitter { // notices this.noticeController = new NoticeController({ initState: initState.NoticeController, + version, + firstVersion: initState.firstTimeInfo.version, }) this.noticeController.updateNoticesList() // to be uncommented when retrieving notices from a remote server. @@ -453,7 +462,7 @@ module.exports = class MetamaskController extends EventEmitter { setupPublicConfig (outStream) { pump( - this.publicConfigStore, + asStream(this.publicConfigStore), outStream, (err) => { if (err) log.error(err) @@ -469,15 +478,34 @@ module.exports = class MetamaskController extends EventEmitter { // Vault Management // - async createNewVaultAndKeychain (password, cb) { - const vault = await this.keyringController.createNewVaultAndKeychain(password) - this.selectFirstIdentity(vault) + async createNewVaultAndKeychain (password) { + const release = await this.createVaultMutex.acquire() + let vault + + try { + const accounts = await this.keyringController.getAccounts() + + if (accounts.length > 0) { + vault = await this.keyringController.fullUpdate() + + } else { + vault = await this.keyringController.createNewVaultAndKeychain(password) + this.selectFirstIdentity(vault) + } + release() + } catch (err) { + release() + throw err + } + return vault } - async createNewVaultAndRestore (password, seed, cb) { + async createNewVaultAndRestore (password, seed) { + const release = await this.createVaultMutex.acquire() const vault = await this.keyringController.createNewVaultAndRestore(password, seed) this.selectFirstIdentity(vault) + release() return vault } @@ -784,4 +812,13 @@ module.exports = class MetamaskController extends EventEmitter { } } + recordFirstTimeInfo (initState) { + if (!('firstTimeInfo' in initState)) { + initState.firstTimeInfo = { + version, + date: Date.now(), + } + } + } + } diff --git a/app/scripts/migrations/020.js b/app/scripts/migrations/020.js new file mode 100644 index 000000000..8159b3e70 --- /dev/null +++ b/app/scripts/migrations/020.js @@ -0,0 +1,41 @@ +const version = 20 + +/* + +This migration ensures previous installations +get a `firstTimeInfo` key on the metamask state, +so that we can version notices in the future. + +*/ + +const clone = require('clone') + +module.exports = { + version, + + migrate: function (originalVersionedData) { + const versionedData = clone(originalVersionedData) + versionedData.meta.version = version + try { + const state = versionedData.data + const newState = transformState(state) + versionedData.data = newState + } catch (err) { + console.warn(`MetaMask Migration #${version}` + err.stack) + } + return Promise.resolve(versionedData) + }, +} + +function transformState (state) { + const newState = state + if ('metamask' in newState && + !('firstTimeInfo' in newState.metamask)) { + newState.metamask.firstTimeInfo = { + version: '3.12.0', + date: Date.now(), + } + } + return newState +} + diff --git a/app/scripts/migrations/index.js b/app/scripts/migrations/index.js index e9cbd7b98..9d0631042 100644 --- a/app/scripts/migrations/index.js +++ b/app/scripts/migrations/index.js @@ -30,4 +30,5 @@ module.exports = [ require('./017'), require('./018'), require('./019'), + require('./020'), ] diff --git a/app/scripts/notice-controller.js b/app/scripts/notice-controller.js index 57aad40c5..db2b8c4f4 100644 --- a/app/scripts/notice-controller.js +++ b/app/scripts/notice-controller.js @@ -1,13 +1,17 @@ const EventEmitter = require('events').EventEmitter +const semver = require('semver') const extend = require('xtend') const ObservableStore = require('obs-store') const hardCodedNotices = require('../../notices/notices.json') +const uniqBy = require('lodash.uniqby') module.exports = class NoticeController extends EventEmitter { constructor (opts) { super() this.noticePoller = null + this.firstVersion = opts.firstVersion + this.version = opts.version const initState = extend({ noticesList: [], }, opts.initState) @@ -30,9 +34,9 @@ module.exports = class NoticeController extends EventEmitter { return unreadNotices[unreadNotices.length - 1] } - setNoticesList (noticesList) { + async setNoticesList (noticesList) { this.store.updateState({ noticesList }) - return Promise.resolve(true) + return true } markNoticeRead (noticeToMark, cb) { @@ -50,12 +54,14 @@ module.exports = class NoticeController extends EventEmitter { } } - updateNoticesList () { - return this._retrieveNoticeData().then((newNotices) => { - var oldNotices = this.getNoticesList() - var combinedNotices = this._mergeNotices(oldNotices, newNotices) - return Promise.resolve(this.setNoticesList(combinedNotices)) - }) + async updateNoticesList () { + const newNotices = await this._retrieveNoticeData() + const oldNotices = this.getNoticesList() + const combinedNotices = this._mergeNotices(oldNotices, newNotices) + const filteredNotices = this._filterNotices(combinedNotices) + const result = this.setNoticesList(filteredNotices) + this._updateMemstore() + return result } startPolling () { @@ -68,22 +74,30 @@ module.exports = class NoticeController extends EventEmitter { } _mergeNotices (oldNotices, newNotices) { - var noticeMap = this._mapNoticeIds(oldNotices) - newNotices.forEach((notice) => { - if (noticeMap.indexOf(notice.id) === -1) { - oldNotices.push(notice) + return uniqBy(oldNotices.concat(newNotices), 'id') + } + + _filterNotices(notices) { + return notices.filter((newNotice) => { + if ('version' in newNotice) { + const satisfied = semver.satisfies(this.version, newNotice.version) + return satisfied + } + if ('firstVersion' in newNotice) { + const satisfied = semver.satisfies(this.firstVersion, newNotice.firstVersion) + return satisfied } + return true }) - return oldNotices } _mapNoticeIds (notices) { return notices.map((notice) => notice.id) } - _retrieveNoticeData () { + async _retrieveNoticeData () { // Placeholder for the API. - return Promise.resolve(hardCodedNotices) + return hardCodedNotices } _updateMemstore () { -- cgit v1.2.3 From 05c6789030791bd1b46434cf89c1817db37e8f38 Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 8 Dec 2017 21:18:08 -0330 Subject: Adds button for opening app in main browser window in extension. --- app/images/open.svg | 15 +++++++++++++++ app/scripts/platforms/extension.js | 5 +++++ 2 files changed, 20 insertions(+) create mode 100644 app/images/open.svg (limited to 'app') diff --git a/app/images/open.svg b/app/images/open.svg new file mode 100644 index 000000000..2957ce43d --- /dev/null +++ b/app/images/open.svg @@ -0,0 +1,15 @@ + + + + open + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index 2f47512eb..f5cc255d1 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -17,6 +17,11 @@ class ExtensionPlatform { return extension.runtime.getManifest().version } + openExtensionInBrowser () { + const extensionURL = extension.runtime.getURL('home.html') + this.openWindow({ url: extensionURL }) + } + getPlatformInfo (cb) { try { extension.runtime.getPlatformInfo((platform) => { -- cgit v1.2.3 From 1f1fc2c49ecbb5c6a0a1d925d5c02cf48f795b2f Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 19 Dec 2017 11:16:11 -0330 Subject: Canceled, edited transactions show edited amount. --- app/scripts/controllers/transactions.js | 5 +++++ app/scripts/metamask-controller.js | 1 + 2 files changed, 6 insertions(+) (limited to 'app') diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js index ce709bd28..0d6b97d51 100644 --- a/app/scripts/controllers/transactions.js +++ b/app/scripts/controllers/transactions.js @@ -189,6 +189,11 @@ module.exports = class TransactionController extends EventEmitter { await this.approveTransaction(txMeta.id) } + async updateAndCancelTransaction (txMeta) { + this.txStateManager.updateTx(txMeta, 'confTx: user rejected transaction') + await this.cancelTransaction(txMeta.id) + } + async approveTransaction (txId) { let nonceLock try { diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 018eb2c76..935a3e76e 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -366,6 +366,7 @@ module.exports = class MetamaskController extends EventEmitter { // txController cancelTransaction: nodeify(txController.cancelTransaction, txController), updateAndApproveTransaction: nodeify(txController.updateAndApproveTransaction, txController), + updateAndCancelTransaction: nodeify(txController.updateAndCancelTransaction, txController), // messageManager signMessage: nodeify(this.signMessage, this), -- cgit v1.2.3 From bf4043c59bb67ea93599207d91cb7a4f4426e75f Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 20 Dec 2017 13:47:16 -0330 Subject: Adds updateTransaction to background and used it to update after editing in send-v2. --- app/scripts/controllers/transactions.js | 9 ++++----- app/scripts/metamask-controller.js | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js index 0d6b97d51..5b687f67a 100644 --- a/app/scripts/controllers/transactions.js +++ b/app/scripts/controllers/transactions.js @@ -184,16 +184,15 @@ module.exports = class TransactionController extends EventEmitter { return await this.txGasUtil.analyzeGasUsage(txMeta) } + async updateTransaction (txMeta) { + this.txStateManager.updateTx(txMeta, 'confTx: user updated transaction') + } + async updateAndApproveTransaction (txMeta) { this.txStateManager.updateTx(txMeta, 'confTx: user approved transaction') await this.approveTransaction(txMeta.id) } - async updateAndCancelTransaction (txMeta) { - this.txStateManager.updateTx(txMeta, 'confTx: user rejected transaction') - await this.cancelTransaction(txMeta.id) - } - async approveTransaction (txId) { let nonceLock try { diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 935a3e76e..a2d584cf9 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -365,8 +365,8 @@ module.exports = class MetamaskController extends EventEmitter { // txController cancelTransaction: nodeify(txController.cancelTransaction, txController), + updateTransaction: nodeify(txController.updateTransaction, txController), updateAndApproveTransaction: nodeify(txController.updateAndApproveTransaction, txController), - updateAndCancelTransaction: nodeify(txController.updateAndCancelTransaction, txController), // messageManager signMessage: nodeify(this.signMessage, this), -- cgit v1.2.3 From a218008adf85dfb5fa8ca93c789e14d9f2090813 Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Fri, 22 Dec 2017 10:43:02 -0800 Subject: Track usage of old and new UI (#2794) [NewUI] Track usage of old and new UI --- app/scripts/config.js | 22 +++++++++++++++++++++ app/scripts/controllers/network.js | 40 ++++++++++++++++++++++++++++++++------ app/scripts/metamask-controller.js | 1 + 3 files changed, 57 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/scripts/config.js b/app/scripts/config.js index 1d4ff7c0d..74c5b576e 100644 --- a/app/scripts/config.js +++ b/app/scripts/config.js @@ -4,6 +4,15 @@ const KOVAN_RPC_URL = 'https://kovan.infura.io/metamask' const RINKEBY_RPC_URL = 'https://rinkeby.infura.io/metamask' const LOCALHOST_RPC_URL = 'http://localhost:8545' +const MAINET_RPC_URL_BETA = 'https://mainnet.infura.io/metamask2' +const ROPSTEN_RPC_URL_BETA = 'https://ropsten.infura.io/metamask2' +const KOVAN_RPC_URL_BETA = 'https://kovan.infura.io/metamask2' +const RINKEBY_RPC_URL_BETA = 'https://rinkeby.infura.io/metamask2' + +const DEFAULT_RPC = 'rinkeby' +const OLD_UI_NETWORK_TYPE = 'network' +const BETA_UI_NETWORK_TYPE = 'networkBeta' + global.METAMASK_DEBUG = 'GULP_METAMASK_DEBUG' module.exports = { @@ -14,9 +23,22 @@ module.exports = { kovan: KOVAN_RPC_URL, rinkeby: RINKEBY_RPC_URL, }, + // Used for beta UI + networkBeta: { + localhost: LOCALHOST_RPC_URL, + mainnet: MAINET_RPC_URL_BETA, + ropsten: ROPSTEN_RPC_URL_BETA, + kovan: KOVAN_RPC_URL_BETA, + rinkeby: RINKEBY_RPC_URL_BETA, + }, networkNames: { 3: 'Ropsten', 4: 'Rinkeby', 42: 'Kovan', }, + enums: { + DEFAULT_RPC, + OLD_UI_NETWORK_TYPE, + BETA_UI_NETWORK_TYPE, + }, } diff --git a/app/scripts/controllers/network.js b/app/scripts/controllers/network.js index 377ba6eca..db1a5b374 100644 --- a/app/scripts/controllers/network.js +++ b/app/scripts/controllers/network.js @@ -7,14 +7,19 @@ const ComposedStore = require('obs-store/lib/composed') const extend = require('xtend') const EthQuery = require('eth-query') const createEventEmitterProxy = require('../lib/events-proxy.js') -const RPC_ADDRESS_LIST = require('../config.js').network -const DEFAULT_RPC = RPC_ADDRESS_LIST['rinkeby'] +const networkConfig = require('../config.js') +const { OLD_UI_NETWORK_TYPE, DEFAULT_RPC } = networkConfig.enums const INFURA_PROVIDER_TYPES = ['ropsten', 'rinkeby', 'kovan', 'mainnet'] module.exports = class NetworkController extends EventEmitter { constructor (config) { super() + + this._networkEndpointVersion = OLD_UI_NETWORK_TYPE + this._networkEndpoints = this.getNetworkEndpoints(OLD_UI_NETWORK_TYPE) + this._defaultRpc = this._networkEndpoints[DEFAULT_RPC] + config.provider.rpcTarget = this.getRpcAddressForType(config.provider.type, config.provider) this.networkStore = new ObservableStore('loading') this.providerStore = new ObservableStore(config.provider) @@ -24,6 +29,23 @@ module.exports = class NetworkController extends EventEmitter { this.on('networkDidChange', this.lookupNetwork) } + async setNetworkEndpoints (version) { + if (version === this._networkEndpointVersion) { + return + } + + this._networkEndpointVersion = version + this._networkEndpoints = this.getNetworkEndpoints(version) + this._defaultRpc = this._networkEndpoints[DEFAULT_RPC] + const { type } = this.getProviderConfig() + + return this.setProviderType(type, true) + } + + getNetworkEndpoints (version = OLD_UI_NETWORK_TYPE) { + return networkConfig[version] + } + initializeProvider (_providerParams) { this._baseProviderParams = _providerParams const { type, rpcTarget } = this.providerStore.getState() @@ -83,10 +105,13 @@ module.exports = class NetworkController extends EventEmitter { return this.getRpcAddressForType(provider.type) } - async setProviderType (type) { + async setProviderType (type, forceUpdate = false) { assert(type !== 'rpc', `NetworkController.setProviderType - cannot connect by type "rpc"`) // skip if type already matches - if (type === this.getProviderConfig().type) return + if (type === this.getProviderConfig().type && !forceUpdate) { + return + } + const rpcTarget = this.getRpcAddressForType(type) assert(rpcTarget, `NetworkController - unknown rpc address for type "${type}"`) this.providerStore.updateState({ type, rpcTarget }) @@ -98,8 +123,11 @@ module.exports = class NetworkController extends EventEmitter { } getRpcAddressForType (type, provider = this.getProviderConfig()) { - if (RPC_ADDRESS_LIST[type]) return RPC_ADDRESS_LIST[type] - return provider && provider.rpcTarget ? provider.rpcTarget : DEFAULT_RPC + if (this._networkEndpoints[type]) { + return this._networkEndpoints[type] + } + + return provider && provider.rpcTarget ? provider.rpcTarget : this._defaultRpc } // diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index e2a911598..b50a04703 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -353,6 +353,7 @@ module.exports = class MetamaskController extends EventEmitter { submitPassword: nodeify(keyringController.submitPassword, keyringController), // network management + setNetworkEndpoints: nodeify(networkController.setNetworkEndpoints, networkController), setProviderType: nodeify(networkController.setProviderType, networkController), setCustomRpc: nodeify(this.setCustomRpc, this), -- cgit v1.2.3