From 32e70498643155f9dd7cae6d9354c422eec19c80 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 7 Aug 2019 14:40:59 +0300 Subject: [PATCH 1/9] DEXW-2008: save --- package-lock.json | 14 +-- package.json | 2 +- src/modules/import/templates/import.html | 9 +- .../restore/controllers/RestoreCtrl.js | 86 ++++++++++++++++--- src/modules/restore/less/restore.less | 34 +++++++- src/modules/restore/templates/restore.html | 85 ++++++++++++------ 6 files changed, 179 insertions(+), 51 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5eedcf4439..a333e1eb3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -890,9 +890,9 @@ } }, "@waves/ts-lib-crypto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@waves/ts-lib-crypto/-/ts-lib-crypto-1.0.1.tgz", - "integrity": "sha512-aeB3I5DYE1j5gMbM4tzoHdaOVTJj73MldrJ0LNa5zmOAAWz8cFpELjVTChVj+6qzm0EuQD8I0kTcEfdwmHR/jw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@waves/ts-lib-crypto/-/ts-lib-crypto-1.1.1.tgz", + "integrity": "sha512-rU4NOa2agwpQmDAomnU2NSbnla3XvEL8PJB4hn8pKWqVxnfcyL4OwxgSUPhLZsV4SQgWasDqBpaLB3mVYf/QRA==", "requires": { "node-forge": "^0.8.5" } @@ -919,12 +919,12 @@ } }, "@waves/waves-transactions": { - "version": "3.14.3", - "resolved": "https://registry.npmjs.org/@waves/waves-transactions/-/waves-transactions-3.14.3.tgz", - "integrity": "sha512-wmyZZa+bIYbYxsqg6NipcO+d7yrfnhIJXrcl7QH0B4wzaVgUiMTedrPLDlGaxgq7yPMFyH3DALIjd+NBXtJYhw==", + "version": "3.16.3", + "resolved": "https://registry.npmjs.org/@waves/waves-transactions/-/waves-transactions-3.16.3.tgz", + "integrity": "sha512-PDk9/AC1ZNzRqb0K8AGDX2iGsZo2/LibW82rBZ6J6jvpKwkg0VFE/ly7kLh1bFJC5oHmlE34bFB0YqnWYGfutw==", "requires": { "@waves/marshall": "^0.8.0", - "@waves/ts-lib-crypto": "^1.0.1", + "@waves/ts-lib-crypto": "^1.1.1", "axios": "^0.19.0" } }, diff --git a/package.json b/package.json index 8242f33504..3bc2528837 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "@waves/signature-adapter": "^5.1.11", "@waves/ts-types": "0.0.2", "@waves/waves-browser-bus": "^0.1.5", - "@waves/waves-transactions": "^3.14.3", + "@waves/waves-transactions": "^3.16.3", "angular": "1.6.6", "angular-animate": "1.6.6", "angular-aria": "1.6.6", diff --git a/src/modules/import/templates/import.html b/src/modules/import/templates/import.html index f3e5684986..00ec810b9f 100644 --- a/src/modules/import/templates/import.html +++ b/src/modules/import/templates/import.html @@ -14,8 +14,9 @@ w-analytics event="'Import Backup Click'" event-target="'ui'">
-
-
+
+
-
+
@@ -31,7 +32,7 @@
-
+
diff --git a/src/modules/restore/controllers/RestoreCtrl.js b/src/modules/restore/controllers/RestoreCtrl.js index eaae7c2cd6..0ca1f5598a 100644 --- a/src/modules/restore/controllers/RestoreCtrl.js +++ b/src/modules/restore/controllers/RestoreCtrl.js @@ -2,6 +2,12 @@ 'use strict'; const analytics = require('@waves/event-sender'); + const { validators } = require('@waves/waves-transactions'); + const { isPublicKey } = validators; + const TABS = { + seed: 'seed', + key: 'key' + }; /** * @param Base @@ -17,32 +23,34 @@ constructor() { super($scope); + $scope.TABS = TABS; this.seedForm = null; + this.keyForm = null; /** * @type {string} */ - this.address = ''; + this.seed = ''; /** * @type {string} */ - this.seed = ''; + this.key = ''; /** * @type {string} */ - this.name = ''; + this.address = ''; /** * @type {string} */ - this.encryptedSeed = ''; + this.name = ''; /** * @type {string} */ - this.password = ''; + this.encryptedSeed = ''; /** * @type {string} */ - this.restoreType = ''; + this.password = ''; /** * @type {boolean} */ @@ -51,11 +59,24 @@ * @type {number} */ this.activeStep = 0; + /** + * @type {string[]} + */ + this.tabs = Object.keys(TABS).map(key => TABS[key]); + /** + * @type {string} + */ + this.activeTab = TABS.seed; this.observe('seed', this._onChangeSeed); this.observeOnce('seedForm', () => { this.receive(utils.observe(this.seedForm, '$valid'), this._onChangeSeed, this); }); + this.observe('key', this._onChangeKey); + this.observeOnce('keyForm', () => { + this.receive(utils.observe(this.keyForm, '$valid'), this._onChangeKey, this); + }); + this.observe('activeTab', this._onChangeActiveTab); } showTutorialModals() { @@ -63,18 +84,18 @@ } restore() { - if (!this.saveUserData) { this.password = Date.now().toString(); } else { analytics.send({ name: 'Import Backup Protect Your Account Continue Click', target: 'ui' }); } - const encryptedSeed = new ds.Seed(this.seed, window.WavesApp.network.code).encrypt(this.password); + const { phrase, type } = this._getPhraseAndType(); + const encryptedSeed = new ds.Seed(phrase, window.WavesApp.network.code).encrypt(this.password); const userSettings = user.getDefaultUserSettings({ termsAccepted: false }); const newUser = { - userType: this.restoreType, + userType: type, address: this.address, name: this.name, password: this.password, @@ -116,17 +137,62 @@ return modalManager.showImportAccountsModal(); } + /** + * @param {string} tab + */ + setActiveTab(tab) { + this.activeTab = tab; + } + /** * @private */ _onChangeSeed() { - if (this.seedForm.$valid) { + if (this.seedForm && this.seedForm.$valid) { this.address = new ds.Seed(this.seed, window.WavesApp.network.code).address; } else { this.address = ''; } } + /** + * @private + */ + _onChangeKey() { + if (this.keyForm && this.keyForm.$valid && isPublicKey(this.key)) { + this.address = new ds.Seed(this.key, window.WavesApp.network.code).address; + } else { + this.address = ''; + } + } + + /** + * @private + */ + _onChangeActiveTab() { + const tab = this.activeTab[0].toUpperCase() + this.activeTab.substring(1); + this[`_onChange${tab}`](); + } + + /** + * @return {{phrase: string, type: string}} + * @private + */ + _getPhraseAndType() { + switch (this.activeTab) { + case TABS.key: + return ({ + phrase: this.key, + type: 'privateKey' + }); + default: + return ({ + phrase: this.seed, + type: 'seed' + }); + } + } + } return new RestoreCtrl(); diff --git a/src/modules/restore/less/restore.less b/src/modules/restore/less/restore.less index e5e5c7b40f..944899683b 100644 --- a/src/modules/restore/less/restore.less +++ b/src/modules/restore/less/restore.less @@ -70,6 +70,38 @@ body.restore { margin-right: 10px; } } + + .restore { + &-tabs { + display: flex; + justify-content: center; + flex-direction: row; + } + &-tab { + width: 130px; + height: 42px; + font-size: 15px; + text-align: center; + color: @color-basic-700; + cursor: pointer; + padding: 11px 23px; + border: 1px solid @color-basic-200; + margin-right: -1px; + &:first-child { + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + } + &:last-child { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + margin-right: 0px; + } + &.active { + background-color: @color-white; + color: @color-submit-400; + } + } + } } } @@ -105,4 +137,4 @@ body.restore { } } } -} \ No newline at end of file +} diff --git a/src/modules/restore/templates/restore.html b/src/modules/restore/templates/restore.html index 889b998100..aa71d99521 100644 --- a/src/modules/restore/templates/restore.html +++ b/src/modules/restore/templates/restore.html @@ -7,15 +7,26 @@ -
-
- +
+
+
-
+
+
+
+ +
+
-
-
+
+ -
- -
-
-
-
- {{$ctrl.address}} -
+ +
+ +
+
+ +
+
+
+
+ {{$ctrl.address}}
+
+ -
- - -
-
-
-
-
- - - - +
+ + +
+
+
+
+
+
+
+
+
+ + + From 888cfb597aace08b6b738a1e40f75edc895a24e9 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 7 Aug 2019 16:24:56 +0300 Subject: [PATCH 2/9] DEXW-2008: fix address update --- src/modules/restore/controllers/RestoreCtrl.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/restore/controllers/RestoreCtrl.js b/src/modules/restore/controllers/RestoreCtrl.js index 0ca1f5598a..596ab359f6 100644 --- a/src/modules/restore/controllers/RestoreCtrl.js +++ b/src/modules/restore/controllers/RestoreCtrl.js @@ -70,11 +70,19 @@ this.observe('seed', this._onChangeSeed); this.observeOnce('seedForm', () => { - this.receive(utils.observe(this.seedForm, '$valid'), this._onChangeSeed, this); + this.receive(utils.observe(this.seedForm, '$valid'), () => { + if (this.activeTab === TABS.seed) { + this._onChangeSeed(); + } + }); }); this.observe('key', this._onChangeKey); this.observeOnce('keyForm', () => { - this.receive(utils.observe(this.keyForm, '$valid'), this._onChangeKey, this); + this.receive(utils.observe(this.keyForm, '$valid'), () => { + if (this.activeTab === TABS.key) { + this._onChangeKey(); + } + }); }); this.observe('activeTab', this._onChangeActiveTab); } From 1d59635a6c1557d414eaeb17853d825eae596119 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Thu, 8 Aug 2019 10:16:17 +0300 Subject: [PATCH 3/9] DEXW-2008: add encryptPrivateKey --- package-lock.json | 2 +- .../restore/controllers/RestoreCtrl.js | 30 ++++++++++++------- src/modules/signIn/controllers/SignInCtrl.js | 4 ++- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index a333e1eb3d..055fbf2db4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "waves-client", - "version": "1.3.14", + "version": "1.3.16", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/modules/restore/controllers/RestoreCtrl.js b/src/modules/restore/controllers/RestoreCtrl.js index 596ab359f6..2e299e5b5a 100644 --- a/src/modules/restore/controllers/RestoreCtrl.js +++ b/src/modules/restore/controllers/RestoreCtrl.js @@ -2,8 +2,9 @@ 'use strict'; const analytics = require('@waves/event-sender'); - const { validators } = require('@waves/waves-transactions'); + const { validators, libs } = require('@waves/waves-transactions'); const { isPublicKey } = validators; + const { address, publicKey } = libs.crypto; const TABS = { seed: 'seed', key: 'key' @@ -98,8 +99,7 @@ analytics.send({ name: 'Import Backup Protect Your Account Continue Click', target: 'ui' }); } - const { phrase, type } = this._getPhraseAndType(); - const encryptedSeed = new ds.Seed(phrase, window.WavesApp.network.code).encrypt(this.password); + const { encrypted, type } = this._getEncryptedAndType(); const userSettings = user.getDefaultUserSettings({ termsAccepted: false }); const newUser = { @@ -111,7 +111,7 @@ path: this.userPath, settings: userSettings, saveToStorage: this.saveUserData, - encryptedSeed + ...encrypted }; const api = ds.signature.getDefaultSignatureApi(newUser); @@ -156,7 +156,7 @@ * @private */ _onChangeSeed() { - if (this.seedForm && this.seedForm.$valid) { + if (this.seedForm.$valid) { this.address = new ds.Seed(this.seed, window.WavesApp.network.code).address; } else { this.address = ''; @@ -167,8 +167,9 @@ * @private */ _onChangeKey() { - if (this.keyForm && this.keyForm.$valid && isPublicKey(this.key)) { - this.address = new ds.Seed(this.key, window.WavesApp.network.code).address; + if (this.keyForm.$valid && isPublicKey(this.key)) { + const pubKey = publicKey({ privateKey: this.key }); + this.address = address({ publicKey: pubKey }, window.WavesApp.network.code); } else { this.address = ''; } @@ -183,19 +184,26 @@ } /** - * @return {{phrase: string, type: string}} + * @return {{encrypted: {encryptedSeed: string}, type: string}| + * {encrypted: {encryptedPrivateKey: string}, type: string}} * @private */ - _getPhraseAndType() { + _getEncryptedAndType() { switch (this.activeTab) { case TABS.key: return ({ - phrase: this.key, + encrypted: { + encryptedPrivateKey: new ds.Seed(this.key, window.WavesApp.network.code) + .encrypt(this.password) + }, type: 'privateKey' }); default: return ({ - phrase: this.seed, + encrypted: { + encryptedSeed: new ds.Seed(this.seed, window.WavesApp.network.code) + .encrypt(this.password) + }, type: 'seed' }); } diff --git a/src/modules/signIn/controllers/SignInCtrl.js b/src/modules/signIn/controllers/SignInCtrl.js index c9fcdaef11..06b95fb3c9 100644 --- a/src/modules/signIn/controllers/SignInCtrl.js +++ b/src/modules/signIn/controllers/SignInCtrl.js @@ -187,7 +187,9 @@ _updateActiveUserAddress() { if (this.userList.length) { this.activeUserAddress = this.userList[0].address; - this.needPassword = !this.userList[0].userType || this.userList[0].userType === 'seed'; + this.needPassword = !this.userList[0].userType || + this.userList[0].userType === 'seed' || + this.userList[0].userType === 'privateKey'; } else { this.activeUserAddress = null; this.needPassword = true; From aa7eeadda64686d863d1acd9bc3edd9ff858a67d Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Thu, 8 Aug 2019 13:25:25 +0300 Subject: [PATCH 4/9] DEXW-2008: add private key import --- src/modules/app/services/User.js | 7 +++++++ src/modules/restore/controllers/RestoreCtrl.js | 4 ---- .../saveSeed/controllers/SaveSeedCtrl.js | 17 ++++++++++++++--- src/modules/signIn/controllers/SignInCtrl.js | 17 ++++++++++++++--- .../confirmDeleteUser.modal.html | 6 ++++-- .../confirmDeleteUser/confirmDeleteUserCtrl.js | 1 + .../modals/signDeviceError/SignDeviceError.js | 1 + .../modals/signDeviceError/signDeviceError.html | 13 +++++++++++++ 8 files changed, 54 insertions(+), 12 deletions(-) diff --git a/src/modules/app/services/User.js b/src/modules/app/services/User.js index 0ec6b3f0d4..09dd20657e 100644 --- a/src/modules/app/services/User.js +++ b/src/modules/app/services/User.js @@ -89,6 +89,10 @@ * @type {string} */ encryptedSeed; + /** + * @type {string} + */ + encryptedPrivateKey; /** * @type {string} */ @@ -362,6 +366,7 @@ * @param {string} data.name * @param {string} data.id * @param {string} data.encryptedSeed + * @param {string} data.encryptedPrivateKey * @param {string} data.publicKey * @param {string} data.password * @param {string} data.userType @@ -384,6 +389,7 @@ name: data.name, userType: data.userType, encryptedSeed: data.encryptedSeed, + encryptedPrivateKey: data.encryptedPrivateKey, publicKey: data.publicKey, settings: { termsAccepted: false, @@ -597,6 +603,7 @@ this.name = null; this.publicKey = null; this.encryptedSeed = null; + this.encryptedPrivateKey = null; this.userType = null; this.settings = Object.create(null); this.lastLogin = Date.now(); diff --git a/src/modules/restore/controllers/RestoreCtrl.js b/src/modules/restore/controllers/RestoreCtrl.js index 2e299e5b5a..8aa98a3ce6 100644 --- a/src/modules/restore/controllers/RestoreCtrl.js +++ b/src/modules/restore/controllers/RestoreCtrl.js @@ -44,10 +44,6 @@ * @type {string} */ this.name = ''; - /** - * @type {string} - */ - this.encryptedSeed = ''; /** * @type {string} */ diff --git a/src/modules/saveSeed/controllers/SaveSeedCtrl.js b/src/modules/saveSeed/controllers/SaveSeedCtrl.js index fb26475c00..7b66589001 100644 --- a/src/modules/saveSeed/controllers/SaveSeedCtrl.js +++ b/src/modules/saveSeed/controllers/SaveSeedCtrl.js @@ -86,7 +86,7 @@ let canLoginPromise; - if (this._isSeedAdapter(api)) { + if (this._isSeedAdapter(api) || this._isPrivateKey(api)) { canLoginPromise = adapterAvailablePromise.then(() => api.getAddress()) .then(address => address === activeUser.address ? true : Promise.reject('Wrong address!')); } else { @@ -142,6 +142,15 @@ return api.type && api.type === 'seed'; } + /** + * @param {Adapter} api + * @return boolean + * @private + */ + _isPrivateKey(api) { + return api.type && api.type === 'privateKey'; + } + /** * @private */ @@ -172,7 +181,8 @@ _updateActiveUserAddress() { if (this.userList.length) { this.activeUserAddress = this.userList[0].address; - this.needPassword = !this.userList[0].userType || this.userList[0].userType === 'seed'; + this.needPassword = !this.userList[0].userType || this.userList[0].userType === 'seed' || + this.userList[0].userType === 'privateKey'; } else { this.activeUserAddress = null; this.needPassword = true; @@ -211,7 +221,8 @@ }); this._activeUserIndex = index; - this.needPassword = !this.userList[index].userType || this.userList[index].userType === 'seed'; + this.needPassword = !this.userList[index].userType || this.userList[index].userType === 'seed' || + this.userList[index].userType === 'privateKey'; } } diff --git a/src/modules/signIn/controllers/SignInCtrl.js b/src/modules/signIn/controllers/SignInCtrl.js index 06b95fb3c9..07a339733f 100644 --- a/src/modules/signIn/controllers/SignInCtrl.js +++ b/src/modules/signIn/controllers/SignInCtrl.js @@ -91,7 +91,7 @@ let canLoginPromise; - if (this._isSeedAdapter(api)) { + if (this._isSeedAdapter(api) || this._isPrivateKeyAdapter(api)) { canLoginPromise = adapterAvailablePromise.then(() => api.getAddress()) .then(address => address === activeUser.address ? true : Promise.reject('Wrong address!')); } else { @@ -106,7 +106,7 @@ address: activeUser.address }); }, () => { - if (!this._isSeedAdapter(api)) { + if (!this._isSeedAdapter(api) && !this._isPrivateKeyAdapter(api)) { const errorData = { error: 'load-user-error', userType: api.type, @@ -147,6 +147,15 @@ return api.type && api.type === 'seed'; } + /** + * @param {Adapter} api + * return boolean + * @private + */ + _isPrivateKeyAdapter(api) { + return api.type && api.type === 'privateKey'; + } + /** * @private */ @@ -228,7 +237,9 @@ }); this._activeUserIndex = index; - this.needPassword = !this.userList[index].userType || this.userList[index].userType === 'seed'; + this.needPassword = !this.userList[index].userType || + this.userList[index].userType === 'seed' || + this.userList[index].userType === 'privateKey'; } } diff --git a/src/modules/utils/modals/confirmDeleteUser/confirmDeleteUser.modal.html b/src/modules/utils/modals/confirmDeleteUser/confirmDeleteUser.modal.html index 9c0e347c57..e790750355 100644 --- a/src/modules/utils/modals/confirmDeleteUser/confirmDeleteUser.modal.html +++ b/src/modules/utils/modals/confirmDeleteUser/confirmDeleteUser.modal.html @@ -7,6 +7,7 @@

+

@@ -14,8 +15,9 @@

-
-
+
+
+
+
+
+

+
+
+ +
+
+ + + +
+

From 18f74f61cedc8bbbfa9827e4848e8f87555d3e02 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Thu, 8 Aug 2019 15:30:38 +0300 Subject: [PATCH 5/9] DEXW-2008: remove warning plate and device modal for private key import --- src/modules/restore/templates/restore.html | 5 ----- src/modules/utils/services/utils.js | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/modules/restore/templates/restore.html b/src/modules/restore/templates/restore.html index aa71d99521..70f7d3cb2c 100644 --- a/src/modules/restore/templates/restore.html +++ b/src/modules/restore/templates/restore.html @@ -71,11 +71,6 @@
-
-
-
-
diff --git a/src/modules/utils/services/utils.js b/src/modules/utils/services/utils.js index 9f44c4b4ae..08455d3fb8 100644 --- a/src/modules/utils/services/utils.js +++ b/src/modules/utils/services/utils.js @@ -1888,7 +1888,7 @@ */ const modalManager = $injector.get('modalManager'); - if (user.userType === 'seed') { + if (user.userType === 'seed' || user.userType === 'privateKey') { return signable.addMyProof() .then(() => signable); } From d9eea6d19710d23d9ab69b061add7908ed5e53c4 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Thu, 8 Aug 2019 16:14:54 +0300 Subject: [PATCH 6/9] DEXW-2008: layout fix --- src/modules/restore/less/restore.less | 2 +- .../utils/modals/confirmDeleteUser/confirmDeleteUser.modal.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/restore/less/restore.less b/src/modules/restore/less/restore.less index 944899683b..896f1dfd2f 100644 --- a/src/modules/restore/less/restore.less +++ b/src/modules/restore/less/restore.less @@ -78,7 +78,7 @@ body.restore { flex-direction: row; } &-tab { - width: 130px; + min-width: 130px; height: 42px; font-size: 15px; text-align: center; diff --git a/src/modules/utils/modals/confirmDeleteUser/confirmDeleteUser.modal.html b/src/modules/utils/modals/confirmDeleteUser/confirmDeleteUser.modal.html index e790750355..5b75f9789b 100644 --- a/src/modules/utils/modals/confirmDeleteUser/confirmDeleteUser.modal.html +++ b/src/modules/utils/modals/confirmDeleteUser/confirmDeleteUser.modal.html @@ -17,7 +17,7 @@

-
+
Date: Fri, 9 Aug 2019 11:00:21 +0300 Subject: [PATCH 7/9] DEXW-2008: up signature-adapter version --- package-lock.json | 26 ++++---------------------- package.json | 2 +- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 055fbf2db4..4d8c339fe1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -845,9 +845,9 @@ "integrity": "sha512-1qxL22a8LRA38xxzmmJktdVdGTfz2d9SXr9SI2gPpCJSKYrKb7SNGbOE3TgIyCRY0fquOHMtkwXuKGRw+LsJoA==" }, "@waves/signature-adapter": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@waves/signature-adapter/-/signature-adapter-5.1.11.tgz", - "integrity": "sha512-NzMZRcUQ2j1spq5ZilekcqGV3zLQph0KRDxlJmjHpaB+3Wpzp8lBMG0KcRj108ZggDRjlv3vkvhrUUsUpjx4TA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@waves/signature-adapter/-/signature-adapter-5.2.0.tgz", + "integrity": "sha512-Euk9djG9yOkase45mehIDGAgkBe3iiHxSGUhzk8Yl6IPhfZl4022Nf8+Ylu4ieQUDTXhYcjnOiyeGYNdZAfFyA==", "requires": { "@types/ramda": "^0.25.46", "@waves/bignumber": "^0.0.1", @@ -855,7 +855,7 @@ "@waves/ledger": "^3.4.0", "@waves/money-like-to-node": "0.0.10", "@waves/ts-types": "^0.2.0", - "@waves/waves-transactions": "^3.14.6", + "@waves/waves-transactions": "^3.16.3", "ramda": "^0.25.0" }, "dependencies": { @@ -864,28 +864,10 @@ "resolved": "https://registry.npmjs.org/@types/ramda/-/ramda-0.25.51.tgz", "integrity": "sha512-xcmtfHIgF9SYjhGdsZR1nQslxG4hu0cIpFfLQ4CWdw3KzHvl7ki1AzFLQUkbDTG42ZN3ZsQfdRzXRlkAvbIy5Q==" }, - "@waves/ts-lib-crypto": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@waves/ts-lib-crypto/-/ts-lib-crypto-1.0.2.tgz", - "integrity": "sha512-sauJe9pS5rGeXHxOV6HMU7osHIGwer3gLfERiEz/JGpl594/Yc4v5h0UaUYs6iEd5ASr08STHvcSX/vi/FPPww==", - "requires": { - "node-forge": "^0.8.5" - } - }, "@waves/ts-types": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@waves/ts-types/-/ts-types-0.2.0.tgz", "integrity": "sha512-mJOovPtwTyFV6fgI+KKFJ8IeqWSTXdKPOwgcCX9vT7wwMNwiJS2dMboAW2acR8YLiPy7LzZ5t41JCxvGLU+ZSA==" - }, - "@waves/waves-transactions": { - "version": "3.16.1", - "resolved": "https://registry.npmjs.org/@waves/waves-transactions/-/waves-transactions-3.16.1.tgz", - "integrity": "sha512-aVvOJR4UnQI8jgzXvEMTQZ28/WqxGu3znCXh3kgNkdnYBg8P/8Q45Cn7v5p2PVyLy57EOJk6zdzFw1Tb2Er15g==", - "requires": { - "@waves/marshall": "^0.8.0", - "@waves/ts-lib-crypto": "^1.0.2", - "axios": "^0.19.0" - } } } }, diff --git a/package.json b/package.json index 3bc2528837..f24bec058f 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "@waves/ledger": "^3.4.0", "@waves/marshall": "^0.8.0", "@waves/oracle-data": "^0.0.6", - "@waves/signature-adapter": "^5.1.11", + "@waves/signature-adapter": "^5.2.0", "@waves/ts-types": "0.0.2", "@waves/waves-browser-bus": "^0.1.5", "@waves/waves-transactions": "^3.16.3", From eab7d1dfc0422b3315b61a29fe2cdfe89e908aed Mon Sep 17 00:00:00 2001 From: ekomarovskaya Date: Fri, 9 Aug 2019 12:25:59 +0300 Subject: [PATCH 8/9] DEXW-2008: dexw-2008 styled tab button --- src/modules/restore/less/restore.less | 64 ++++++++++++---------- src/modules/restore/templates/restore.html | 4 +- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/src/modules/restore/less/restore.less b/src/modules/restore/less/restore.less index 896f1dfd2f..9abcf11b0c 100644 --- a/src/modules/restore/less/restore.less +++ b/src/modules/restore/less/restore.less @@ -46,7 +46,7 @@ body.restore { .avatar-img { width: 100%; height: 100%; - } + } } } @@ -70,36 +70,42 @@ body.restore { margin-right: 10px; } } + } - .restore { - &-tabs { - display: flex; - justify-content: center; - flex-direction: row; + .tab { + display: flex; + margin: 0 auto 20px; + max-width: 320px; + + &__item { + height: 42px; + .body-2; + color: @color-basic-700; + cursor: pointer; + padding: 0 10px; + align-items: center; + justify-content: center; + display: inline-flex; + flex: 1 0; + white-space: nowrap; + border: 1px solid @color-basic-200; + margin-right: -1px; + transition: background 0.5s; + + &:first-child { + border-top-left-radius: @border-radius; + border-bottom-left-radius: @border-radius; } - &-tab { - min-width: 130px; - height: 42px; - font-size: 15px; - text-align: center; - color: @color-basic-700; - cursor: pointer; - padding: 11px 23px; - border: 1px solid @color-basic-200; - margin-right: -1px; - &:first-child { - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; - } - &:last-child { - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - margin-right: 0px; - } - &.active { - background-color: @color-white; - color: @color-submit-400; - } + + &:last-child { + border-top-right-radius: @border-radius; + border-bottom-right-radius: @border-radius; + margin-right: 0; + } + + &.active { + background-color: @color-white; + color: @color-submit-400; } } } diff --git a/src/modules/restore/templates/restore.html b/src/modules/restore/templates/restore.html index 70f7d3cb2c..499658969d 100644 --- a/src/modules/restore/templates/restore.html +++ b/src/modules/restore/templates/restore.html @@ -12,9 +12,9 @@
-
+
From 07ad094ab00a74e42fcac3b7bfd91ac643346388 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 12 Aug 2019 11:41:00 +0300 Subject: [PATCH 9/9] DEXW-2008: refactor --- src/modules/restore/controllers/RestoreCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/restore/controllers/RestoreCtrl.js b/src/modules/restore/controllers/RestoreCtrl.js index 8aa98a3ce6..a68aead60b 100644 --- a/src/modules/restore/controllers/RestoreCtrl.js +++ b/src/modules/restore/controllers/RestoreCtrl.js @@ -59,7 +59,7 @@ /** * @type {string[]} */ - this.tabs = Object.keys(TABS).map(key => TABS[key]); + this.tabs = Object.values(TABS); /** * @type {string} */