From ae5da1b862c4f10a624e46e3a071385b46232bca Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Thu, 21 Nov 2019 19:07:34 +0300 Subject: [PATCH 01/59] DEXW-2442: save progress --- src/modules/app/initialize/AppRun.js | 6 +- .../components/dexwLocked/dexwLocked.html | 17 ++ .../components/dexwLocked/dexwLocked.js | 45 +++ .../welcome/controllers/WelcomeCtrl.js | 9 +- src/modules/welcome/templates/welcome.html | 262 +++++++++--------- 5 files changed, 207 insertions(+), 132 deletions(-) create mode 100644 src/modules/welcome/components/dexwLocked/dexwLocked.html create mode 100644 src/modules/welcome/components/dexwLocked/dexwLocked.js diff --git a/src/modules/app/initialize/AppRun.js b/src/modules/app/initialize/AppRun.js index 1f703a61c9..35a961c2be 100644 --- a/src/modules/app/initialize/AppRun.js +++ b/src/modules/app/initialize/AppRun.js @@ -407,7 +407,7 @@ const START_STATES = WavesApp.stateTree.where({ noLogin: true }) .map((item) => WavesApp.stateTree.getPath(item.id).join('.')); - const DEXW_LOCKED_STATES = ['migration']; + const DEXW_LOCKED_STATES = ['welcome']; const offInitialTransitions = $transitions.onStart({}, transition => { const DEXW_LOCKED = configService.get('DEXW_LOCKED'); @@ -418,7 +418,7 @@ let tryDesktop; if (DEXW_LOCKED && DEXW_LOCKED_STATES.indexOf(toState.name) === -1) { - return $state.target('migration'); + return $state.target(DEXW_LOCKED_STATES[0]); } if (START_STATES.indexOf(toState.name) === -1) { @@ -492,7 +492,7 @@ const DEXW_LOCKED = configService.get('DEXW_LOCKED'); if (DEXW_LOCKED && DEXW_LOCKED_STATES.indexOf(toState.name) === -1) { - return $state.target('migration'); + return $state.target(DEXW_LOCKED_STATES[0]); } if (START_STATES.indexOf(toState.name) !== -1 && !custom.logout && !DEXW_LOCKED) { diff --git a/src/modules/welcome/components/dexwLocked/dexwLocked.html b/src/modules/welcome/components/dexwLocked/dexwLocked.html new file mode 100644 index 0000000000..dafff53e81 --- /dev/null +++ b/src/modules/welcome/components/dexwLocked/dexwLocked.html @@ -0,0 +1,17 @@ +
+
+
+
Old Desktop
+
New Desktop
+
MultiAccount Desktop
+
+
+ +
+
+
Old Web
+
New Web
+
MultiAccount Web
+
+
+
diff --git a/src/modules/welcome/components/dexwLocked/dexwLocked.js b/src/modules/welcome/components/dexwLocked/dexwLocked.js new file mode 100644 index 0000000000..89de1083f9 --- /dev/null +++ b/src/modules/welcome/components/dexwLocked/dexwLocked.js @@ -0,0 +1,45 @@ +(() => { + 'use strict'; + + class DexwLockedCtrl { + + static $inject = ['$scope', 'user']; + + /** + * @type {boolean} + */ + isDesktop = false; + /** + * @type {'new' | 'old' | 'multiAccount'} + */ + userType = 'new'; + + constructor($scope, user) { + this.$scope = $scope; + this.user = user; + } + + $onInit() { + this.isDesktop = WavesApp.isDesktop(); + Promise.all([ + this.user.getMultiAccountUsers(), + this.user.getFilteredUserList() + ]).then(([multiAccountUsers, userList]) => { + if (userList && userList.length && (!multiAccountUsers || multiAccountUsers.length === 0)) { + this.userType = 'old'; + } else if (multiAccountUsers && multiAccountUsers.length) { + this.userType = 'multiAccount'; + } else { + this.userType = 'new'; + } + this.$scope.$apply(); + }); + } + + } + + angular.module('app.welcome').component('wDexwLocked', { + templateUrl: 'modules/welcome/components/dexwLocked/dexwLocked.html', + controller: DexwLockedCtrl + }); +})(); diff --git a/src/modules/welcome/controllers/WelcomeCtrl.js b/src/modules/welcome/controllers/WelcomeCtrl.js index 5a88de7ffe..f96856071c 100644 --- a/src/modules/welcome/controllers/WelcomeCtrl.js +++ b/src/modules/welcome/controllers/WelcomeCtrl.js @@ -12,6 +12,7 @@ * @param {JQuery} $element * @param {Waves} waves * @param {Matcher} matcher + * @param {ConfigService} configService * @return {WelcomeCtrl} */ const controller = function ( @@ -24,7 +25,8 @@ $element, ChartFactory, storage, - matcher + matcher, + configService ) { const ds = require('data-service'); @@ -125,6 +127,8 @@ constructor() { super($scope); + this.locked = configService.get('DEXW_LOCKED'); + this._initDeviceTypes(); user.getMultiAccountData().then(data => { @@ -293,7 +297,8 @@ '$element', 'ChartFactory', 'storage', - 'matcher' + 'matcher', + 'configService' ]; angular.module('app.welcome') diff --git a/src/modules/welcome/templates/welcome.html b/src/modules/welcome/templates/welcome.html index fcc7270835..1e20436115 100644 --- a/src/modules/welcome/templates/welcome.html +++ b/src/modules/welcome/templates/welcome.html @@ -1,148 +1,156 @@ - +
+
+ -
-
-
-
-
-

-
-
- - - - - - - - - - - - -
-
-
-
-
- - -
-
-
-
-
-

-
-
-
-
-
-
-

-
-
-
-
-
-
-

-
-
-
-
-
-
-

-
+
+
+
+
+
+

+
+
+ + + + + + + + + + + + +
+
-
-
-
-

-
+
+ + +
+
+
+
+
+

+
+
+
+
+
+
+

+
+
+
+
+
+
+

+
+
+
+
+
+
+

+
+
+
+
+
+
+

+
+
+
+
+
+
+

+
+
+
-
-
-
-
-

-
+
+ +
+
+
-
-
- + -
-
- -
-
+
+
-
-
+

+
-

-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+ {{pair.amountAsset.ticker || pair.amountAsset.displayName }} / {{pair.priceAsset.ticker || pair.priceAsset.displayName}} +
+
+ +  /  + +  $ + +
+
{{pair.change24}}%
+
+ +
+
+ +
+
+ +
+
+
-
-
- {{pair.amountAsset.ticker || pair.amountAsset.displayName }} / {{pair.priceAsset.ticker || pair.priceAsset.displayName}}
-
- -  /  - -  $ - -
-
{{pair.change24}}%
-
- -
-
- -
-
- + +
+
-
+
+
+

+
+
+ -
- -
-
-
- -
-

-
- +
- +
- +
+ +
From 231b737ac3938ad660e4703b049b792ce7c72c35 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 22 Nov 2019 11:12:38 +0300 Subject: [PATCH 02/59] DEXW-2442: new user landing --- src/modules/app/services/User.js | 2 +- .../welcome/components/dexwLocked/dexwLocked.html | 7 ++++++- .../welcome/components/dexwLocked/dexwLocked.js | 12 ++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/modules/app/services/User.js b/src/modules/app/services/User.js index b26e9c447f..b10b491343 100644 --- a/src/modules/app/services/User.js +++ b/src/modules/app/services/User.js @@ -313,7 +313,7 @@ */ getMultiAccountUsersCount() { return storage.load('multiAccountUsers').then(users => { - return Object.keys(users).length; + return users ? Object.keys(users).length : 0; }); } diff --git a/src/modules/welcome/components/dexwLocked/dexwLocked.html b/src/modules/welcome/components/dexwLocked/dexwLocked.html index dafff53e81..209f99344c 100644 --- a/src/modules/welcome/components/dexwLocked/dexwLocked.html +++ b/src/modules/welcome/components/dexwLocked/dexwLocked.html @@ -10,7 +10,12 @@
Old Web
-
New Web
+
+
+
Sorry, we are no longer working
+ Waves.Exchange +
+
MultiAccount Web
diff --git a/src/modules/welcome/components/dexwLocked/dexwLocked.js b/src/modules/welcome/components/dexwLocked/dexwLocked.js index 89de1083f9..2e1fa5f9c0 100644 --- a/src/modules/welcome/components/dexwLocked/dexwLocked.js +++ b/src/modules/welcome/components/dexwLocked/dexwLocked.js @@ -13,6 +13,10 @@ * @type {'new' | 'old' | 'multiAccount'} */ userType = 'new'; + /** + * @type {string} + */ + wavesExchangeLink = WavesApp.network.wavesExchangeLink; constructor($scope, user) { this.$scope = $scope; @@ -22,12 +26,12 @@ $onInit() { this.isDesktop = WavesApp.isDesktop(); Promise.all([ - this.user.getMultiAccountUsers(), + this.user.getMultiAccountUsersCount(), this.user.getFilteredUserList() - ]).then(([multiAccountUsers, userList]) => { - if (userList && userList.length && (!multiAccountUsers || multiAccountUsers.length === 0)) { + ]).then(([multiAccountCount, userList]) => { + if (userList && userList.length && multiAccountCount === 0) { this.userType = 'old'; - } else if (multiAccountUsers && multiAccountUsers.length) { + } else if (multiAccountCount) { this.userType = 'multiAccount'; } else { this.userType = 'new'; From 40eef6bda2583b709df47be0b3359ac19515433f Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 22 Nov 2019 15:57:19 +0300 Subject: [PATCH 03/59] DEXW-2442: save multiAcc user --- src/modules/app/initialize/AppRun.js | 5 +- .../components/signInForm/signInForm.html | 2 +- .../components/signInForm/signInForm.js | 5 +- .../components/dexwLocked/dexwLocked.html | 23 ++- .../components/dexwLocked/dexwLocked.js | 89 +++++++++- .../welcome/controllers/WelcomeCtrl.js | 2 +- src/modules/welcome/templates/welcome.html | 157 +----------------- 7 files changed, 123 insertions(+), 160 deletions(-) diff --git a/src/modules/app/initialize/AppRun.js b/src/modules/app/initialize/AppRun.js index 35a961c2be..a8458c2548 100644 --- a/src/modules/app/initialize/AppRun.js +++ b/src/modules/app/initialize/AppRun.js @@ -407,7 +407,10 @@ const START_STATES = WavesApp.stateTree.where({ noLogin: true }) .map((item) => WavesApp.stateTree.getPath(item.id).join('.')); - const DEXW_LOCKED_STATES = ['welcome']; + const DEXW_LOCKED_STATES = [ + 'welcome', + 'desktopUpdate' + ]; const offInitialTransitions = $transitions.onStart({}, transition => { const DEXW_LOCKED = configService.get('DEXW_LOCKED'); diff --git a/src/modules/signIn/components/signInForm/signInForm.html b/src/modules/signIn/components/signInForm/signInForm.html index 86f0435179..4806c21095 100644 --- a/src/modules/signIn/components/signInForm/signInForm.html +++ b/src/modules/signIn/components/signInForm/signInForm.html @@ -25,7 +25,7 @@
-
+
Old Web
+
-
MultiAccount Web
+ +
+ + +
Sorry, we are no longer working
+ Waves Exchange + +
+ + + + + + +
Waves.Exchange redirected
+
+
+
diff --git a/src/modules/welcome/components/dexwLocked/dexwLocked.js b/src/modules/welcome/components/dexwLocked/dexwLocked.js index 2e1fa5f9c0..e01ae2d31d 100644 --- a/src/modules/welcome/components/dexwLocked/dexwLocked.js +++ b/src/modules/welcome/components/dexwLocked/dexwLocked.js @@ -1,9 +1,17 @@ (() => { 'use strict'; + const ds = require('data-service'); + class DexwLockedCtrl { - static $inject = ['$scope', 'user']; + static $inject = [ + '$scope', + '$state', + 'user', + 'exportStorageService', + 'storage' + ]; /** * @type {boolean} @@ -17,10 +25,17 @@ * @type {string} */ wavesExchangeLink = WavesApp.network.wavesExchangeLink; + /** + * @type {number} + */ + step = 0; - constructor($scope, user) { + constructor($scope, $state, user, exportStorageService, storage) { this.$scope = $scope; + this.$state = $state; this.user = user; + this.exportStorageService = exportStorageService; + this.storage = storage; } $onInit() { @@ -40,6 +55,76 @@ }); } + onSign() { + this.moving(); + } + + moving() { + analytics.send({ + name: 'Start migration', + target: 'all' + }); + + if (this.isDesktop) { + this.$state.go('desktopUpdate'); + } else { + this._export(); + } + } + + _export() { + const connectProvider = this._getConnectProvider(); + + this.step = this.step + 1; + + this.exportStorageService.export({ + provider: connectProvider, + attempts: 20, + timeout: 2000 + }); + + this.exportStorageService.onData().then(result => { + if (result.payload === 'ok') { + this.step = this.step + 1; + this.$scope.$apply(); + + analytics.send({ + name: 'End migration', + target: 'all' + }); + + return this.storage.save('migrationSuccess', true); + } else { + analytics.send({ + name: 'Bad migration', + target: 'all' + }); + + this.step = this.step - 1; + this.$scope.$apply(); + + return this.storage.save('migrationSuccess', false); + } + }); + } + + /** + * @returns {ConnectProvider} + */ + _getConnectProvider() { + const origins = WavesApp.isProduction() ? + WavesApp.network.migration.origins : + '*'; + + const childWindow = window.open(WavesApp.network.migration.webUrl); + + return new ds.connect.PostMessageConnectProvider({ + win: childWindow, + mode: 'export', + origins + }); + } + } angular.module('app.welcome').component('wDexwLocked', { diff --git a/src/modules/welcome/controllers/WelcomeCtrl.js b/src/modules/welcome/controllers/WelcomeCtrl.js index f96856071c..d1e9f7d6d3 100644 --- a/src/modules/welcome/controllers/WelcomeCtrl.js +++ b/src/modules/welcome/controllers/WelcomeCtrl.js @@ -127,7 +127,7 @@ constructor() { super($scope); - this.locked = configService.get('DEXW_LOCKED'); + this.locked = !!configService.get('DEXW_LOCKED'); this._initDeviceTypes(); diff --git a/src/modules/welcome/templates/welcome.html b/src/modules/welcome/templates/welcome.html index 1e20436115..ad027bc2a9 100644 --- a/src/modules/welcome/templates/welcome.html +++ b/src/modules/welcome/templates/welcome.html @@ -1,156 +1,7 @@ -
-
- - -
-
-
-
-
-

-
-
- - - - - - - - - - - - -
-
-
-
-
- - -
-
-
-
-
-

-
-
-
-
-
-
-

-
-
-
-
-
-
-

-
-
-
-
-
-
-

-
-
-
-
-
-
-

-
-
-
-
-
-
-

-
-
-
-
-
- -
-
- -
-
- -
-
- -

-
- -
-
-
-
-
-
-
-
-
-
- -
-
- {{pair.amountAsset.ticker || pair.amountAsset.displayName }} / {{pair.priceAsset.ticker || pair.priceAsset.displayName}} -
-
- -  /  - -  $ - -
-
{{pair.change24}}%
-
- -
-
- -
-
- -
-
-
- -
- -
- -
-
-
- -
-

-
- -
-
- - -
-
- -
- -
+ +
+
+ From 9d766a4cdcec41bdbfa86cfce0418099ae74bf50 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 22 Nov 2019 16:17:17 +0300 Subject: [PATCH 04/59] DEXW-2442: old user --- src/index.hbs | 2 -- .../welcome/components/dexwLocked/dexwLocked.html | 11 ++++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/index.hbs b/src/index.hbs index 3999387384..e6419256ac 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -524,8 +524,6 @@
- -
diff --git a/src/modules/welcome/components/dexwLocked/dexwLocked.html b/src/modules/welcome/components/dexwLocked/dexwLocked.html index 733ed0454a..de912d4466 100644 --- a/src/modules/welcome/components/dexwLocked/dexwLocked.html +++ b/src/modules/welcome/components/dexwLocked/dexwLocked.html @@ -9,7 +9,16 @@
-
Old Web
+
+
Sorry, we are no longer working
+ Waves.Exchange + + Start moving + +
From d66dfab624cb0062abdd9882c19edd46e0852415 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 22 Nov 2019 16:41:06 +0300 Subject: [PATCH 05/59] DEXW-2442: delete signUp and signIn pages --- src/index.hbs | 16 --- src/modules/app/app.js | 2 - src/modules/signIn/controllers/SignInCtrl.js | 130 ------------------ src/modules/signIn/less/signIn.less | 127 ----------------- src/modules/signIn/signIn.js | 5 - src/modules/signIn/templates/signIn.html | 24 ---- src/modules/signUp/controllers/SignUpCtrl.js | 87 ------------ src/modules/signUp/signUp.js | 5 - src/modules/signUp/templates/signUp.html | 108 --------------- .../components/signInForm/signInForm.html | 0 .../components/signInForm/signInForm.js | 4 +- 11 files changed, 2 insertions(+), 506 deletions(-) delete mode 100644 src/modules/signIn/controllers/SignInCtrl.js delete mode 100644 src/modules/signIn/less/signIn.less delete mode 100644 src/modules/signIn/signIn.js delete mode 100644 src/modules/signIn/templates/signIn.html delete mode 100644 src/modules/signUp/controllers/SignUpCtrl.js delete mode 100644 src/modules/signUp/signUp.js delete mode 100644 src/modules/signUp/templates/signUp.html rename src/modules/{signIn => welcome}/components/signInForm/signInForm.html (100%) rename src/modules/{signIn => welcome}/components/signInForm/signInForm.js (95%) diff --git a/src/index.hbs b/src/index.hbs index e6419256ac..bd63d27fbc 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -612,22 +612,6 @@ WavesApp.stateTree = new tsUtils.Tree({ id: 'root', children: [ - { - id: 'signUp', - data: { - url: '/sign-up', - noLogin: true, - views: [{ name: 'main' }] - } - }, - { - id: 'signIn', - data: { - url: '/sign-in', - noLogin: true, - views: [{ name: 'main' }] - } - }, { id: 'switch', data: { diff --git a/src/modules/app/app.js b/src/modules/app/app.js index 18b4154a20..c1c368907b 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -102,8 +102,6 @@ 'app.utils', 'app.ui', 'app.welcome', - 'app.signUp', - 'app.signIn', 'app.migrate', 'app.switch', 'app.create', diff --git a/src/modules/signIn/controllers/SignInCtrl.js b/src/modules/signIn/controllers/SignInCtrl.js deleted file mode 100644 index f1d763f88c..0000000000 --- a/src/modules/signIn/controllers/SignInCtrl.js +++ /dev/null @@ -1,130 +0,0 @@ -(() => { - 'use strict'; - - const analytics = require('@waves/event-sender'); - - /** - * @param {typeof Base} Base - * @param {ng.IScope} $scope - * @param {*} $state - * @param {User} user - * @param {ModalManager} modalManager - * @param {ConfigService} configService - * @param {Storage} storage - * @returns {SignInCtrl} - */ - const controller = function (Base, $scope, $state, user, modalManager, configService, storage) { - - class SignInCtrl extends Base { - - /** - * @type {Array|null} - */ - legacyUserList = null; - /** - * @type {Array} - * @private - */ - _onLoginHandlers = []; - - constructor() { - super($scope); - - analytics.send({ name: 'Onboarding Sign In Show', target: 'ui', params: { from: 'sign-in' } }); - - Promise.all([ - user.getMultiAccountData(), - user.getFilteredUserList() - ]).then(([multiAccountData, userList]) => { - if (!multiAccountData) { - $state.go('signUp'); - } else { - this.legacyUserList = userList; - } - }); - - this._onLoginHandlers.push(this._showMigrateModal); - - user.onLogin().then(() => { - this._onLoginHandlers.forEach((handler) => handler()); - }); - } - - $onDestroy() { - super.$onDestroy(); - this._onLoginHandlers = []; - } - - onLogin() { - Promise.all([ - user.getMultiAccountUsers(), - user.getMultiAccountSettings() - ]).then(([multiAccountUsers, commonSettings]) => { - const [firstUser] = multiAccountUsers; - - user.setMultiAccountSettings(commonSettings); - - if (firstUser) { - user.login(firstUser).then(() => { - user.goToActiveState(); - }); - } else if (this.legacyUserList && this.legacyUserList.length) { - $state.go('migrate'); - } else { - $state.go('create'); - } - }).catch(() => { - return null; - }); - } - - onResetPassword() { - $state.go('signUp'); - } - - showForgotPasswordModal() { - modalManager.showForgotPasswordModal().then(() => { - $state.go('signUp'); - }); - } - - _login(userData) { - user.login(userData).then(() => { - const DEXW_LOCKED = configService.get('DEXW_LOCKED'); - - if (DEXW_LOCKED) { - $state.go('migration'); - } else { - user.goToActiveState(); - } - }); - } - - _showPasswordError() { - this.password = ''; - this.showPasswordError = true; - } - - _updatePassword() { - if (this.password) { - this.showPasswordError = false; - } - } - - _showMigrateModal = () => { - storage.load('notAutoOpenMigrationModal').then((notAutoOpenMigrationModal) => { - if (!notAutoOpenMigrationModal) { - modalManager.showMigrateModal(); - } - }); - }; - - } - - return new SignInCtrl(); - }; - - controller.$inject = ['Base', '$scope', '$state', 'user', 'modalManager', 'configService', 'storage']; - - angular.module('app.signIn').controller('SignInCtrl', controller); -})(); diff --git a/src/modules/signIn/less/signIn.less b/src/modules/signIn/less/signIn.less deleted file mode 100644 index a638373282..0000000000 --- a/src/modules/signIn/less/signIn.less +++ /dev/null @@ -1,127 +0,0 @@ -@import (reference) 'config'; -@import (reference) 'icons'; -@import (reference) '../../app/less/typography'; -@import (reference) '../../app/less/app'; - -body.signIn { - .signIn-hidden { - display: none; - } - - .user-list { - .avatar-container { - width: 30px; - height: 30px; - position: relative; - flex-shrink: 0; - - .avatar { - position: absolute; - } - } - - w-input-container { - display: block; - } - - .icon-remove-user { - position: absolute; - top: 50%; - right: 5px; - transform: translateY(-50%); - width: 30px; - height: 30px; - background-size: 10px 10px; - background-position: center; - } - - .select { - .select__list { - max-height: 300px; - overflow: auto; - } - - .select__title-content .icon-remove-user { - display: none; - } - - .select__title-content, .option { - display: flex; - flex-direction: row; - align-items: center; - } - } - - .select.one-item { - .select__title-content .icon-remove-user { - display: inline-block; - } - .select__title { - padding: 0 0 0 15px; - } - } - - .input-like { - display: flex; - flex-direction: row; - align-items: center; - position: relative; - } - - .input-like, - .select { - .has-name { - .address { - color: @color-basic-500; - line-height: 1em; - } - .name { - line-height: 1em; - margin: 0 0 4px 0; - } - } - } - - .password-placeholder { - position: relative; - - a.caption-1 { - position: absolute; - right: 0; - bottom: 0; - } - } - - a.add-account { - .body-2(); - width: 100%; - cursor: pointer; - display: flex; - align-items: center; - padding: 8px 35px 8px 15px; - margin: 0; - - &:hover { - background: @color-basic-50; - - &::before { - background: @color-white; - } - } - - &::before { - font-size: 19px; - width: 30px; - height: 30px; - background: @color-basic-50; - display: inline-block; - margin-right: 10px; - line-height: 30px; - text-align: center; - content: '+'; - border-radius: 50%; - color: @color-submit-300; - } - } - } -} \ No newline at end of file diff --git a/src/modules/signIn/signIn.js b/src/modules/signIn/signIn.js deleted file mode 100644 index 32498ff5e4..0000000000 --- a/src/modules/signIn/signIn.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.signIn', []); -})(); diff --git a/src/modules/signIn/templates/signIn.html b/src/modules/signIn/templates/signIn.html deleted file mode 100644 index 9564755fab..0000000000 --- a/src/modules/signIn/templates/signIn.html +++ /dev/null @@ -1,24 +0,0 @@ - - -
-
-
-
-
- -
- -
- -
-
- - -
-
-
- - diff --git a/src/modules/signUp/controllers/SignUpCtrl.js b/src/modules/signUp/controllers/SignUpCtrl.js deleted file mode 100644 index d1a1c9dfbf..0000000000 --- a/src/modules/signUp/controllers/SignUpCtrl.js +++ /dev/null @@ -1,87 +0,0 @@ -(() => { - 'use strict'; - - /** - * @param {typeof Base} Base - * @param {ng.IScope} $scope - * @param {*} $state - * @param {MultiAccount} multiAccount - * @param {User} user - * @param {app.Storage} storage - * @return {SignUpCtrl} - */ - const controller = function (Base, $scope, $state, multiAccount, user, storage) { - - class SignUpCtrl extends Base { - - /** - * @type {ng.IFormController|null} - */ - form = null; - password = ''; - confirmPassword = ''; - termsAgreement = false; - - activeStep = 0; - hasLegacyUsers = false; - termsAccepted = false; - - get invalid() { - return this.form.$invalid || ( - !this.termsAccepted && - !this.termsAgreement - ); - } - - constructor() { - super($scope); - - Promise.all([ - user.getMultiAccountData(), - user.getFilteredUserList(), - storage.load('termsAccepted') - ]).then(([multiAccountData, userList, termsAccepted]) => { - this.termsAccepted = termsAccepted; - - if (multiAccountData) { - if (user.isAuthorised) { - $state.go(user.getActiveState('wallet')); - } else { - $state.go('signIn'); - } - } else { - this.hasLegacyUsers = userList && userList.length > 0; - this.activeStep = this.hasLegacyUsers ? 0 : 1; - } - }); - } - - nextStep() { - this.activeStep += 1; - } - - onSubmit() { - multiAccount.signUp( - this.password, - user.getSetting('encryptionRounds') - ).then(data => Promise.all([ - user.saveMultiAccount(data), - storage.save('termsAccepted', true) - ])).then(() => { - if (this.hasLegacyUsers) { - $state.go('migrate'); - } else { - $state.go('create'); - } - }); - } - - } - - return new SignUpCtrl(); - }; - - controller.$inject = ['Base', '$scope', '$state', 'multiAccount', 'user', 'storage']; - - angular.module('app.signUp').controller('SignUpCtrl', controller); -})(); diff --git a/src/modules/signUp/signUp.js b/src/modules/signUp/signUp.js deleted file mode 100644 index 85e011eec4..0000000000 --- a/src/modules/signUp/signUp.js +++ /dev/null @@ -1,5 +0,0 @@ -(() => { - 'use strict'; - - angular.module('app.signUp', []); -})(); diff --git a/src/modules/signUp/templates/signUp.html b/src/modules/signUp/templates/signUp.html deleted file mode 100644 index bac9692fae..0000000000 --- a/src/modules/signUp/templates/signUp.html +++ /dev/null @@ -1,108 +0,0 @@ - - -
-
- - -
-
- -
- -
- -
- - -
-
-
-
- - -
-
- -
- -
- -
-
- -
- -
- -
- - - - - - - - - - - - - - - - - -
- - -
- -
- - - - - - -
- -
- - -
- - -
-
-
-
-
-
-
- - diff --git a/src/modules/signIn/components/signInForm/signInForm.html b/src/modules/welcome/components/signInForm/signInForm.html similarity index 100% rename from src/modules/signIn/components/signInForm/signInForm.html rename to src/modules/welcome/components/signInForm/signInForm.html diff --git a/src/modules/signIn/components/signInForm/signInForm.js b/src/modules/welcome/components/signInForm/signInForm.js similarity index 95% rename from src/modules/signIn/components/signInForm/signInForm.js rename to src/modules/welcome/components/signInForm/signInForm.js index 9d5f56e052..fa6a0f2be3 100644 --- a/src/modules/signIn/components/signInForm/signInForm.js +++ b/src/modules/welcome/components/signInForm/signInForm.js @@ -95,8 +95,8 @@ } - angular.module('app.signIn').component('wSignInForm', { - templateUrl: 'modules/signIn/components/signInForm/signInForm.html', + angular.module('app.welcome').component('wSignInForm', { + templateUrl: 'modules/welcome/components/signInForm/signInForm.html', controller: SignInFormCtrl, bindings: { onSuccess: '&', From 5472c0cf21252dd5e04f825bb68c61d37fc2f55b Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 22 Nov 2019 17:10:02 +0300 Subject: [PATCH 06/59] DEXW-2442: delete migrate page and module --- src/index.hbs | 7 - src/modules/app/app.js | 1 - .../migrate/controllers/MigrateCtrl.js | 214 ------------------ src/modules/migrate/migrate.js | 5 - src/modules/migrate/migrate.less | 79 ------- src/modules/migrate/templates/migrate.html | 127 ----------- 6 files changed, 433 deletions(-) delete mode 100644 src/modules/migrate/controllers/MigrateCtrl.js delete mode 100644 src/modules/migrate/migrate.js delete mode 100644 src/modules/migrate/migrate.less delete mode 100644 src/modules/migrate/templates/migrate.html diff --git a/src/index.hbs b/src/index.hbs index bd63d27fbc..e9951a17b7 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -620,13 +620,6 @@ views: [{ name: 'main' }] } }, - { - id: 'migrate', - data: { - url: '/migrate?id', - views: [{ name: 'main' }] - } - }, { id: 'unavailable', data: { diff --git a/src/modules/app/app.js b/src/modules/app/app.js index c1c368907b..4fd5f7f7e0 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -102,7 +102,6 @@ 'app.utils', 'app.ui', 'app.welcome', - 'app.migrate', 'app.switch', 'app.create', 'app.restore', diff --git a/src/modules/migrate/controllers/MigrateCtrl.js b/src/modules/migrate/controllers/MigrateCtrl.js deleted file mode 100644 index 4757fa0b3a..0000000000 --- a/src/modules/migrate/controllers/MigrateCtrl.js +++ /dev/null @@ -1,214 +0,0 @@ -(() => { - 'use strict'; - - const analytics = require('@waves/event-sender'); - const ds = require('data-service'); - const { libs } = require('@waves/waves-transactions'); - const { base58Decode } = libs.crypto; - - /** - * @param {typeof Base} Base - * @param {ng.IScope} $scope - * @param {*} $state - * @param {MultiAccount} multiAccount - * @param {User} user - * @return {SignUpCtrl} - */ - const controller = function (Base, $scope, $state, multiAccount, user) { - - class MigrateCtrl extends Base { - - migrateForm = null; - migratePassword = ''; - activeStep = 0; - userListLocked = []; - userListUnlocked = []; - userToMigrate = null; - showPasswordError = false; - - constructor() { - super($scope); - - Promise.all([ - user.getFilteredUserList(), - user.getMultiAccountUsers() - ]).then(([userList, multiAccountUsers]) => { - const { id } = $state.params; - this.activeStep = userList && userList.length ? 0 : 1; - this.userListLocked = userList; - this.userListUnlocked = multiAccountUsers; - - const migrateWithoutPass = userList.filter(lockedUser => ( - lockedUser.userType && - lockedUser.userType !== 'seed' && - lockedUser.userType !== 'privateKey' - )); - - this.migrateUsersWithoutPassword(migrateWithoutPass).then(() => { - if (id) { - - const autoMigrate = migrateWithoutPass.length && - migrateWithoutPass.some(user => multiAccount.hash(user.address) === id); - - if (autoMigrate) { - this.prevStep(); - return null; - } - - const lockedUserByHash = this.userListLocked.find(lockedUser => ( - multiAccount.hash(lockedUser.address) === id - )); - - if (lockedUserByHash) { - this.startMigrate(lockedUserByHash); - } - } - }); - }); - } - - nextStep() { - this.activeStep += 1; - } - - prevStep() { - const { id } = $state.params; - - if (id) { - user.getMultiAccountUsers().then((mUsers = []) => { - const userToLogin = mUsers.find(mUser => ( - multiAccount.hash(mUser.address) === id - )); - - if (userToLogin) { - user.login(userToLogin); - } - - $state.go(user.getActiveState('wallet')); - }); - } else { - this.activeStep -= 1; - } - } - - startMigrate(userToMigrate) { - this.userToMigrate = userToMigrate; - this.nextStep(); - } - - migrateUser(userData) { - return multiAccount.addUser(userData) - .then(data => Promise.all([ - user.saveMultiAccount(data), - user.migrateUser(this.userToMigrate, data.userHash) - ])) - .then(() => user.getMultiAccountUsers()) - .then(multiAccountUsers => { - this.userListLocked = this.userListLocked.filter(lockedUser => ( - lockedUser.address !== this.userToMigrate.address - )); - - this.userListUnlocked = multiAccountUsers; - this.userToMigrate = null; - }); - } - - async migrateUsersWithoutPassword(usersWithoutPassword) { - for (const legacyUser of usersWithoutPassword) { - const { userType, id, publicKey, address } = legacyUser; - const networkByte = base58Decode(address)[1]; - - this.userToMigrate = legacyUser; - - // eslint-disable-next-line no-await-in-loop - await this.migrateUser({ - userType, - networkByte, - id, - publicKey - }); - } - } - - checkSeed(seed, publicKey) { - return publicKey === libs.crypto.publicKey(seed); - } - - checkPK(privateKey, publicKey) { - return libs.crypto.publicKey({ privateKey }) === publicKey; - } - - onSubmit() { - try { - this._hidePasswordError(); - - const { id, publicKey, address, settings = {} } = this.userToMigrate; - const encryptionRounds = settings.encryptionRounds || 5000; - const userType = userType || 'seed'; - const networkByte = base58Decode(address)[1]; - const seed = userType === 'seed' ? - ds.Seed.decryptSeedPhrase( - this.userToMigrate.encryptedSeed, - this.migratePassword, - encryptionRounds - ) : - undefined; - const privateKey = userType === 'privateKey' ? - ds.Seed.decryptSeedPhrase( - this.userToMigrate.encryptedPrivateKey, - this.migratePassword - ) : - undefined; - - if (seed && !this.checkSeed(seed, publicKey)) { - throw new Error('Incorrect seed'); - } - - if (privateKey && !this.checkPK(privateKey, publicKey)) { - throw new Error('Incorrect private key'); - } - - this.migrateUser({ - userType, - networkByte, - seed, - id, - privateKey, - publicKey - }).then(() => { - this.migratePassword = ''; - this.prevStep(); - analytics.send({ name: 'Successfully Unlocked' }); - }); - } catch (e) { - this._showPasswordError(); - analytics.send({ name: 'Failed Unlock' }); - } - } - - finish() { - const [firstUser] = this.userListUnlocked; - - user.login(firstUser).then(() => { - $state.go(user.getActiveState('wallet')); - }); - } - - _showPasswordError() { - this.migratePassword = ''; - this.showPasswordError = true; - } - - _hidePasswordError() { - this.showPasswordError = false; - } - - } - - return new MigrateCtrl(); - }; - - controller.$inject = ['Base', '$scope', '$state', 'multiAccount', 'user']; - - angular.module('app.migrate').controller('MigrateCtrl', controller); -})(); diff --git a/src/modules/migrate/migrate.js b/src/modules/migrate/migrate.js deleted file mode 100644 index 46d042f843..0000000000 --- a/src/modules/migrate/migrate.js +++ /dev/null @@ -1,5 +0,0 @@ -(() => { - 'use strict'; - - angular.module('app.migrate', []); -})(); diff --git a/src/modules/migrate/migrate.less b/src/modules/migrate/migrate.less deleted file mode 100644 index a6496af7c9..0000000000 --- a/src/modules/migrate/migrate.less +++ /dev/null @@ -1,79 +0,0 @@ -@import (reference) 'config'; -@import (reference) 'icons'; -@import (reference) "../app/less/app-icons"; -@import (reference) '../app/less/typography'; - -.migrate { - &__account { - width: 400px; - height: 54px; - padding: 8px 20px; - display: flex; - align-items: center; - border-radius: @border-radius; - background: @color-white; - box-shadow: 0 1px 4px 0 rgba(58,78,136,.1); - cursor: pointer; - margin-bottom: 10px; - - @media screen and (max-width: 860px) { - width: 100%; - height: 42px; - padding: 5px 12px; - } - - &-info { - flex: 1; - } - - &-address { - color: @color-basic-500; - } - } - - &__avatar { - display: block; - - @media screen and (max-width: 860px) { - transform: scale(.85); - } - - &-container { - height: 30px; - width: 30px; - margin-right: 10px; - } - } - - &__icon { - &-lock { - background-image: @migrate-lock-icon; - } - - &-unlock { - background-image: @migrate-success-icon; - } - } - - &__subtitle { - margin-bottom: 5px; - color: @color-basic-700; - } - - &__list_unlocked { - .migrate__account { - background: transparent; - border: 1px solid @color-basic-200; - box-shadow: none; - cursor: default; - } - - .migrate__subtitle { - margin-top: -10px; - - @media screen and (max-width: 860px) { - margin-top: 0; - } - } - } -} \ No newline at end of file diff --git a/src/modules/migrate/templates/migrate.html b/src/modules/migrate/templates/migrate.html deleted file mode 100644 index d04c299eb4..0000000000 --- a/src/modules/migrate/templates/migrate.html +++ /dev/null @@ -1,127 +0,0 @@ - - -
- -
- - -
-
- -
- -
- -
-
- -
-
- -
- - -
- -
-
- -
- - -
- - -
-
- - -
- - -
-
- -
- -
- - -
-
- -
- -
- -
- - -
- - -
- -
- - - - - - - -
- - -
-
-
-
-
-
-
- - From 687e7f4a19a5a3c30375f0a342b320d533cb6f17 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 22 Nov 2019 17:19:17 +0300 Subject: [PATCH 07/59] DEXW-2442: delete saveSeed page and module --- src/index.hbs | 7 - src/modules/app/app.js | 1 - .../saveSeed/controllers/SaveSeedCtrl.js | 237 ------------------ src/modules/saveSeed/less/saveSeed.less | 129 ---------- src/modules/saveSeed/saveSeed.js | 5 - src/modules/saveSeed/templates/saveSeed.html | 6 - .../saveSeed/templates/saveSeedHasUsers.html | 100 -------- .../saveSeed/templates/saveSeedNoUsers.html | 17 -- 8 files changed, 502 deletions(-) delete mode 100644 src/modules/saveSeed/controllers/SaveSeedCtrl.js delete mode 100644 src/modules/saveSeed/less/saveSeed.less delete mode 100644 src/modules/saveSeed/saveSeed.js delete mode 100644 src/modules/saveSeed/templates/saveSeed.html delete mode 100644 src/modules/saveSeed/templates/saveSeedHasUsers.html delete mode 100644 src/modules/saveSeed/templates/saveSeedNoUsers.html diff --git a/src/index.hbs b/src/index.hbs index e9951a17b7..7953727dde 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -635,13 +635,6 @@ views: [{ name: 'main' }] } }, - { - id: 'saveSeed', - data: { - url: '/save-seed', - views: [{ name: 'main' }] - } - }, // { // id: 'sessions', // data: { diff --git a/src/modules/app/app.js b/src/modules/app/app.js index 4fd5f7f7e0..ea6754f735 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -105,7 +105,6 @@ 'app.switch', 'app.create', 'app.restore', - 'app.saveSeed', 'app.desktop', 'app.desktopUpdate', 'app.ledger', diff --git a/src/modules/saveSeed/controllers/SaveSeedCtrl.js b/src/modules/saveSeed/controllers/SaveSeedCtrl.js deleted file mode 100644 index 7b66589001..0000000000 --- a/src/modules/saveSeed/controllers/SaveSeedCtrl.js +++ /dev/null @@ -1,237 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param Base - * @param $scope - * @param $state - * @param user - * @param modalManager - * @return {SaveSeedCtrl} - */ - const controller = function (Base, $scope, $state, user, modalManager, utils) { - - const ds = require('data-service'); - const PATH = 'modules/saveSeed/templates'; - - class SaveSeedCtrl extends Base { - - /** - * @type {boolean} - */ - networkError = false; - /** - * @type {string} - */ - password = ''; - /** - * @type {null} - */ - loginForm = null; - /** - * @type {string} - */ - activeUserAddress = null; - /** - * @type {boolean} - */ - needPassword = true; - /** - * @type {number} - * @private - */ - _activeUserIndex = null; - /** - * @type {boolean} - * @public - */ - isVisibleSeed = false; - - get user() { - return this.userList[this._activeUserIndex]; - } - - get encryptedSeed() { - return this.user.encryptedSeed; - } - - constructor() { - super($scope); - - this.observe('activeUserAddress', this._calculateActiveIndex); - this.observe('password', this._updatePassword); - - this._initUserList(); - } - - - /** - * @private - */ - _updatePassword() { - if (this.password) { - this.showPasswordError = false; - this.networkError = false; - } - } - - showSeed() { - try { - this.networkError = false; - this.showPasswordError = false; - const userSettings = user.getSettingsByUser(this.user); - const activeUser = { ...this.user, password: this.password, settings: userSettings }; - const api = ds.signature.getDefaultSignatureApi(activeUser); - const adapterAvailablePromise = api.isAvailable(true); - - let canLoginPromise; - - if (this._isSeedAdapter(api) || this._isPrivateKey(api)) { - canLoginPromise = adapterAvailablePromise.then(() => api.getAddress()) - .then(address => address === activeUser.address ? true : Promise.reject('Wrong address!')); - } else { - canLoginPromise = modalManager.showLoginByDevice(adapterAvailablePromise, api.type); - } - - return canLoginPromise.then(() => { - this.isVisibleSeed = true; - ds.app.login(activeUser.address, api); - ds.signature.getSignatureApi().getSeed().then(seed => { - this.seed = seed; - }); - }, () => { - if (!this._isSeedAdapter(api)) { - const errorData = { - error: 'load-user-error', - userType: api.type, - address: activeUser.address - }; - return modalManager.showSignDeviceError(errorData) - .catch(() => Promise.resolve()); - } else { - this._showPasswordError(); - } - }); - } catch (e) { - this._showPasswordError(); - } - } - - /** - * @public - */ - backToUsersList() { - this.password = ''; - this.isVisibleSeed = false; - ds.app.logOut(); - } - - /** - * @public - */ - clickCopySeed() { - analytics.send({ name: 'Migration Import Continue Click', target: 'ui' }); - } - - /** - * @param {Adapter} api - * @return boolean - * @private - */ - _isSeedAdapter(api) { - return api.type && api.type === 'seed'; - } - - /** - * @param {Adapter} api - * @return boolean - * @private - */ - _isPrivateKey(api) { - return api.type && api.type === 'privateKey'; - } - - /** - * @private - */ - _showPasswordError() { - this.password = ''; - this.showPasswordError = true; - this.networkError = this.user.networkError; - } - - - /** - * @private - */ - _initUserList() { - user.getFilteredUserList().then(list => { - this.userList = list; - this.pendingRestore = false; - this._updateActiveUserAddress(); - utils.postDigest($scope).then(() => { - $scope.$apply(); - }); - }); - } - - /** - * @private - */ - _updateActiveUserAddress() { - if (this.userList.length) { - this.activeUserAddress = this.userList[0].address; - this.needPassword = !this.userList[0].userType || this.userList[0].userType === 'seed' || - this.userList[0].userType === 'privateKey'; - } else { - this.activeUserAddress = null; - this.needPassword = true; - } - this._updatePageUrl(); - } - - /** - * @private - */ - _updatePageUrl() { - if (this.userList.length) { - this.pageUrl = `${PATH}/saveSeedHasUsers.html`; - } else { - this.pageUrl = `${PATH}/saveSeedNoUsers.html`; - } - } - - /** - * @private - */ - _calculateActiveIndex() { - const activeAddress = this.activeUserAddress; - let index = null; - - if (!activeAddress) { - return null; - } - - this.userList.some(({ address }, i) => { - if (address === activeAddress) { - index = i; - return true; - } - return false; - }); - - this._activeUserIndex = index; - this.needPassword = !this.userList[index].userType || this.userList[index].userType === 'seed' || - this.userList[index].userType === 'privateKey'; - } - - } - - return new SaveSeedCtrl(); - }; - - controller.$inject = ['Base', '$scope', '$state', 'user', 'modalManager', 'utils']; - - angular.module('app.saveSeed') - .controller('SaveSeedCtrl', controller); -})(); diff --git a/src/modules/saveSeed/less/saveSeed.less b/src/modules/saveSeed/less/saveSeed.less deleted file mode 100644 index 240207862c..0000000000 --- a/src/modules/saveSeed/less/saveSeed.less +++ /dev/null @@ -1,129 +0,0 @@ -@import (reference) 'config'; -@import (reference) 'icons'; -@import (reference) '../../app/less/typography'; -@import (reference) '../../app/less/app'; - -body.saveSeed { - .signIn-hidden, - .get-started-link, - .create-hidden, - .signIn-hidden { - display: none; - } - .user-list { - .avatar-container { - width: 30px; - height: 30px; - position: relative; - flex-shrink: 0; - - .avatar { - position: absolute; - } - } - - w-input-container { - display: block; - } - - .icon-remove-user { - position: absolute; - top: 50%; - right: 5px; - transform: translateY(-50%); - width: 30px; - height: 30px; - background-size: 10px 10px; - background-position: center; - } - - .select { - .select__list { - max-height: 300px; - overflow: auto; - } - - .select__title-content .icon-remove-user { - display: none; - } - - .select__title-content, .option { - display: flex; - flex-direction: row; - align-items: center; - } - } - - .select.one-item { - .select__title-content .icon-remove-user { - display: inline-block; - } - .select__title { - padding: 0 0 0 15px; - } - } - - .input-like { - display: flex; - flex-direction: row; - align-items: center; - position: relative; - } - - .input-like, - .select { - .has-name { - .address { - color: @color-basic-500; - line-height: 1em; - } - .name { - line-height: 1em; - margin: 0 0 4px 0; - } - } - } - - .password-placeholder { - position: relative; - - a.caption-1 { - position: absolute; - right: 0; - bottom: 0; - } - } - - a.add-account { - .body-2(); - width: 100%; - cursor: pointer; - display: flex; - align-items: center; - padding: 8px 35px 8px 15px; - margin: 0; - - &:hover { - background: @color-basic-50; - - &::before { - background: @color-white; - } - } - - &::before { - font-size: 19px; - width: 30px; - height: 30px; - background: @color-basic-50; - display: inline-block; - margin-right: 10px; - line-height: 30px; - text-align: center; - content: '+'; - border-radius: 50%; - color: @color-submit-300; - } - } - } -} \ No newline at end of file diff --git a/src/modules/saveSeed/saveSeed.js b/src/modules/saveSeed/saveSeed.js deleted file mode 100644 index 26b616c5fe..0000000000 --- a/src/modules/saveSeed/saveSeed.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.saveSeed', []); -})(); diff --git a/src/modules/saveSeed/templates/saveSeed.html b/src/modules/saveSeed/templates/saveSeed.html deleted file mode 100644 index 93c3750482..0000000000 --- a/src/modules/saveSeed/templates/saveSeed.html +++ /dev/null @@ -1,6 +0,0 @@ - -
- - -
- \ No newline at end of file diff --git a/src/modules/saveSeed/templates/saveSeedHasUsers.html b/src/modules/saveSeed/templates/saveSeedHasUsers.html deleted file mode 100644 index e8a34638a9..0000000000 --- a/src/modules/saveSeed/templates/saveSeedHasUsers.html +++ /dev/null @@ -1,100 +0,0 @@ -
- -
-
-
- -
-
- -
- - - - -
- -
- -
-
{{::user.name}}
-
{{::user.address}}
-
-
-
- -
-
-
-
- - - - - - - - - - - - - - - -
- -
- -
-
-
- -
- -
- - -
- -
- -
- - - -
- - - -
-
- -
diff --git a/src/modules/saveSeed/templates/saveSeedNoUsers.html b/src/modules/saveSeed/templates/saveSeedNoUsers.html deleted file mode 100644 index 41a7e59558..0000000000 --- a/src/modules/saveSeed/templates/saveSeedNoUsers.html +++ /dev/null @@ -1,17 +0,0 @@ - \ No newline at end of file From 2df0deb4533e5d9a705925c6b02bfc02dd278dd3 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 22 Nov 2019 17:22:09 +0300 Subject: [PATCH 08/59] DEXW-2442: delete sessions page and module --- src/index.hbs | 7 -- .../sessions/controller/SessionsCtrl.js | 38 ----------- src/modules/sessions/less/sessions.less | 67 ------------------- src/modules/sessions/sessions.js | 5 -- src/modules/sessions/templates/sessions.html | 45 ------------- 5 files changed, 162 deletions(-) delete mode 100644 src/modules/sessions/controller/SessionsCtrl.js delete mode 100644 src/modules/sessions/less/sessions.less delete mode 100644 src/modules/sessions/sessions.js delete mode 100644 src/modules/sessions/templates/sessions.html diff --git a/src/index.hbs b/src/index.hbs index 7953727dde..f4e6cedd8a 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -635,13 +635,6 @@ views: [{ name: 'main' }] } }, - // { - // id: 'sessions', - // data: { - // noLogin: true, - // views: [{ name: 'main' }] - // } - // }, { id: 'create', data: { diff --git a/src/modules/sessions/controller/SessionsCtrl.js b/src/modules/sessions/controller/SessionsCtrl.js deleted file mode 100644 index 956db57fb7..0000000000 --- a/src/modules/sessions/controller/SessionsCtrl.js +++ /dev/null @@ -1,38 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param Base - * @param $scope - * @param {SessionBridge} sessionBridge - * @return {SessionsCtrl} - */ - const controller = function (Base, $scope, sessionBridge) { - - class SessionsCtrl extends Base { - - constructor() { - super($scope); - this.sessions = sessionBridge.getSessionsData(); - this.receive(sessionBridge.signals.changeSessions, (sessions) => { - this.sessions = sessions; - $scope.$digest(); - }); - } - - /** - * @param {ISessionUserData} session - */ - chooseSession(session) { - sessionBridge.login(session.id); - } - - } - - return new SessionsCtrl(); - }; - - controller.$inject = ['Base', '$scope', 'sessionBridge']; - - angular.module('app.sessions').controller('SessionsCtrl', controller); -})(); diff --git a/src/modules/sessions/less/sessions.less b/src/modules/sessions/less/sessions.less deleted file mode 100644 index a9b8c38c60..0000000000 --- a/src/modules/sessions/less/sessions.less +++ /dev/null @@ -1,67 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../app/less/typography'; - -.sessions { - width: 460px; - margin: auto; - text-align: center; - - .sessions-holder { - list-style-type: none; - padding: 0; - margin: 60px 0 30px 0; - - .select, - .input-like { - display: flex; - flex-direction: row; - align-items: center; - position: relative; - cursor: pointer; - - .has-name { - display: flex; - flex-direction: column; - - .session-address { - .footnote-1(); - color: @color-basic-500; - line-height: 1em; - } - .session-name { - .body-2(); - line-height: 1em; - margin: 0 0 4px 0; - } - } - - .icon-remove-user { - position: absolute; - top: 50%; - right: 5px; - transform: translateY(-50%); - width: 30px; - height: 30px; - background-size: 10px 10px; - background-position: center; - } - - .select__title-content .icon-remove-user { - display: none; - } - - .select__title-content, - .option { - display: flex; - flex-direction: row; - align-items: center; - } - } - } -} - -@media screen and (max-width: 480px) { - .sessions { - width: calc(100% ~'- 20px'); - } -} diff --git a/src/modules/sessions/sessions.js b/src/modules/sessions/sessions.js deleted file mode 100644 index ffbe3da91b..0000000000 --- a/src/modules/sessions/sessions.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.sessions', []); -})(); diff --git a/src/modules/sessions/templates/sessions.html b/src/modules/sessions/templates/sessions.html deleted file mode 100644 index 6cb2555804..0000000000 --- a/src/modules/sessions/templates/sessions.html +++ /dev/null @@ -1,45 +0,0 @@ -
- -
- -
- -
- -
- -
    -
  • - -
    - {{::session.name}} - {{::session.address}} -
    - -
  • -
- -
- - - -
- {{::session.name}} - {{::session.address}} -
- -
-
-
- -
- -
- - - - - -
From 0f59bac27cbb6ccb9df67b75af42874397808dae Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 22 Nov 2019 17:37:08 +0300 Subject: [PATCH 09/59] DEXW-2442: delete create page and module --- src/index.hbs | 6 - src/modules/app/app.js | 1 - src/modules/create/controllers/CreateCtrl.js | 211 ------------------ src/modules/create/create.js | 5 - src/modules/create/less/backup-seed.less | 16 -- src/modules/create/less/confirm-backup.less | 2 - src/modules/create/less/create-account.less | 33 --- src/modules/create/less/create.less | 28 --- .../create/less/no-backup-no-money.less | 64 ------ src/modules/create/templates/backupSeed.html | 34 --- .../create/templates/confirmBackup.html | 40 ---- src/modules/create/templates/create.html | 5 - .../create/templates/createAccount.html | 82 ------- .../create/templates/createAccountData.html | 18 -- .../create/templates/noBackupNoMoney.html | 31 --- .../templates/noBackupNoMoney.modal.html | 19 -- .../directives/seed/SeedBase.js | 2 +- .../directives/seed/SeedRead.js | 4 +- .../directives/seed/SeedService.js | 2 +- .../directives/seed/SeedWrite.js | 2 +- .../{create => ui}/directives/seed/seed.html | 0 .../{create => ui}/directives/seed/seed.less | 0 22 files changed, 5 insertions(+), 600 deletions(-) delete mode 100644 src/modules/create/controllers/CreateCtrl.js delete mode 100644 src/modules/create/create.js delete mode 100644 src/modules/create/less/backup-seed.less delete mode 100644 src/modules/create/less/confirm-backup.less delete mode 100644 src/modules/create/less/create-account.less delete mode 100644 src/modules/create/less/create.less delete mode 100644 src/modules/create/less/no-backup-no-money.less delete mode 100644 src/modules/create/templates/backupSeed.html delete mode 100644 src/modules/create/templates/confirmBackup.html delete mode 100644 src/modules/create/templates/create.html delete mode 100644 src/modules/create/templates/createAccount.html delete mode 100644 src/modules/create/templates/createAccountData.html delete mode 100644 src/modules/create/templates/noBackupNoMoney.html delete mode 100644 src/modules/create/templates/noBackupNoMoney.modal.html rename src/modules/{create => ui}/directives/seed/SeedBase.js (98%) rename src/modules/{create => ui}/directives/seed/SeedRead.js (96%) rename src/modules/{create => ui}/directives/seed/SeedService.js (85%) rename src/modules/{create => ui}/directives/seed/SeedWrite.js (99%) rename src/modules/{create => ui}/directives/seed/seed.html (100%) rename src/modules/{create => ui}/directives/seed/seed.less (100%) diff --git a/src/index.hbs b/src/index.hbs index f4e6cedd8a..fcf053af06 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -635,12 +635,6 @@ views: [{ name: 'main' }] } }, - { - id: 'create', - data: { - views: [{ name: 'main' }] - } - }, { id: 'restore', data: { diff --git a/src/modules/app/app.js b/src/modules/app/app.js index ea6754f735..c8b1433c83 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -103,7 +103,6 @@ 'app.ui', 'app.welcome', 'app.switch', - 'app.create', 'app.restore', 'app.desktop', 'app.desktopUpdate', diff --git a/src/modules/create/controllers/CreateCtrl.js b/src/modules/create/controllers/CreateCtrl.js deleted file mode 100644 index ef7c0ff645..0000000000 --- a/src/modules/create/controllers/CreateCtrl.js +++ /dev/null @@ -1,211 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {typeof Base} Base - * @param {ng.IScope} $scope - * @param {ng.IQService} $q - * @param {*} $state - * @param {User} user - * @param {ModalManager} modalManager - * @param {ISeedService} seedService - * @return {CreateCtrl} - */ - const controller = function (Base, $scope, $q, $state, user, modalManager, seedService) { - - const analytics = require('@waves/event-sender'); - const PATH = 'modules/create/templates'; - const ORDER_LIST = [ - 'createAccount', - 'createAccountData' - ]; - - const STATE_HASH = { - CREATE_ACCOUNT: 0, - CREATE_ACCOUNT_DATA: 1, - SHOW_NO_BACKUP_NOW_MONEY: 2, - BACKUP: 3, - CONFIRM_BACKUP: 4 - }; - - class CreateCtrl extends Base { - - constructor() { - super($scope); - - this.invitationStep = 0; - this.stepIndex = 0; - this.name = ''; - this.seed = ''; - this.address = ''; - this.seedList = []; - this.seedIsValid = false; - this.seedConfirmWasFilled = false; - this.saveUserData = true; - - this.resetAddress(); - } - - onSeedConfirmFulfilled(isValid) { - this.seedIsValid = isValid; - this.seedConfirmWasFilled = true; - - this.observeOnce('stepIndex', this.clearSeedConfirm); - } - - seedOnTouch() { - this.seedConfirmWasFilled = false; - } - - clearSeedConfirm() { - seedService.clear.dispatch(); - this.seedIsValid = false; - this.seedConfirmWasFilled = false; - } - - setActiveSeed(item) { - const old = tsUtils.find(this.seedList, { active: true }); - if (old) { - old.active = false; - } - item.active = true; - this.seed = item.seed; - this.address = item.address; - } - - getStepUrl() { - return `${PATH}/${ORDER_LIST[this.stepIndex]}.html`; - } - - create() { - analytics.send({ name: 'Create Confirm Phrase Confirm Click' }); - - return this._create(true); - } - - createWithoutBackup() { - analytics.send({ name: 'Create Do It Later Click' }); - - return this._create(false); - } - - clickCopySeed() { - analytics.send({ name: 'Create Backup Phrase Copy Click' }); - } - - /** - * @param {number} [index] - */ - next(index) { - - if (!index) { - index = this.stepIndex + 1; - } - - if (index < 0) { - index = this.stepIndex + index; - } - - if (index === STATE_HASH.CREATE_ACCOUNT_DATA) { - analytics.send({ name: 'Create Protect Your Account Show' }); - } - if (this.stepIndex === STATE_HASH.CREATE_ACCOUNT_DATA && index > this.stepIndex) { - analytics.send({ name: 'Create Protect Your Account Continue Click' }); - } - if (index === STATE_HASH.SHOW_NO_BACKUP_NOW_MONEY) { - analytics.send({ name: 'Create No Backup Show' }); - } - if (this.stepIndex === STATE_HASH.SHOW_NO_BACKUP_NOW_MONEY && index > this.stepIndex) { - analytics.send({ name: 'Create Back Up Now Click' }); - } - if (index === STATE_HASH.BACKUP) { - analytics.send({ name: 'Create Backup Phrase Show' }); - } - if (this.stepIndex === STATE_HASH.BACKUP && index > this.stepIndex) { - analytics.send({ name: 'Create Backup Phrase I Written Click' }); - } - if (index === STATE_HASH.CONFIRM_BACKUP) { - analytics.send({ name: 'Create Confirm Phrase Show' }); - } - - if (!ORDER_LIST[index]) { - throw new Error('Wrong order list index!'); - } else { - return this.checkNext() - .then(() => { - this.stepIndex = index; - if (index === STATE_HASH.BACKUP) { - analytics.send({ name: 'Create Backup Phrase Show' }); - } - if (index === STATE_HASH.CONFIRM_BACKUP) { - analytics.send({ name: 'Create Confirm Phrase Show' }); - } - }); - } - } - - nextInvitationStep() { - this.invitationStep += 1; - } - - checkNext() { - const step = ORDER_LIST[this.stepIndex]; - if (step === 'noBackupNoMoney') { - analytics.send({ name: 'Create Warning Show' }); - return this.showBackupWarningPopup() - .then(() => { - analytics.send({ name: 'Create Warning I Understand Click' }); - }); - } - return $q.when(); - } - - resetAddress() { - const list = []; - for (let i = 0; i < 5; i++) { - const phrase = ds.Seed.create().phrase; - const seedData = new ds.Seed(phrase, window.WavesApp.network.code); - list.push({ seed: seedData.phrase, address: seedData.address }); - } - - this.setActiveSeed(list[0]); - this.seedList = list; - } - - showBackupWarningPopup() { - return modalManager.showCustomModal({ - templateUrl: 'modules/create/templates/noBackupNoMoney.modal.html', - clickOutsideToClose: false, - escapeToClose: false - }); - } - - /** - * @param hasBackup - * @return {Promise} - * @private - */ - _create(hasBackup) { - const newUser = { - userType: 'seed', - networkByte: WavesApp.network.code.charCodeAt(0), - name: this.name, - seed: this.seed - }; - - return user.create(newUser, hasBackup).then(() => { - $state.go(user.getActiveState('wallet')); - }); - } - - } - - return new CreateCtrl(); - }; - - controller.$inject = [ - 'Base', '$scope', '$q', '$state', 'user', 'modalManager', 'seedService' - ]; - - angular.module('app.create').controller('CreateCtrl', controller); -})(); diff --git a/src/modules/create/create.js b/src/modules/create/create.js deleted file mode 100644 index 7d5ffcaf83..0000000000 --- a/src/modules/create/create.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.create', []); -})(); diff --git a/src/modules/create/less/backup-seed.less b/src/modules/create/less/backup-seed.less deleted file mode 100644 index 0e70ae5fbb..0000000000 --- a/src/modules/create/less/backup-seed.less +++ /dev/null @@ -1,16 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../app/less/app'; - -.backup-seed { - w-seed-read { - display: block; - margin: 5px 0 30px 0; - } -} - -md-dialog-content { - .backup-seed, - .confirm-backup { - margin-top: 60px; - } -} \ No newline at end of file diff --git a/src/modules/create/less/confirm-backup.less b/src/modules/create/less/confirm-backup.less deleted file mode 100644 index 139597f9cb..0000000000 --- a/src/modules/create/less/confirm-backup.less +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/modules/create/less/create-account.less b/src/modules/create/less/create-account.less deleted file mode 100644 index 76d47469d6..0000000000 --- a/src/modules/create/less/create-account.less +++ /dev/null @@ -1,33 +0,0 @@ -@import (reference) 'config'; -@import (reference) 'icons'; -@import (reference) '../../app/less/app'; - -@createAvatarBorder: 4px; -@createAvatarSize: 50px; -@createAvatarHoverSize: 60px; -@createAvatarSizePhone: @createAvatarSize - 10px; -@createAvatarHoverSizePhone: @createAvatarHoverSize - 10px; -@createAvatarWrapperSize: @createAvatarHoverSize + @createAvatarBorder * 2; -@createAvatarWrapperSizePhone: @createAvatarHoverSizePhone + @createAvatarBorder * 2; - -.avatars { - &-list { - flex-direction: row; - overflow: hidden; - display: flex; - - &-wrap { // .avatar__wrap - display: flex; - align-items: center; - justify-content: center; - width: 20% !important; - padding: 20px 0; - flex-shrink: 0; - } - } - - &-scroll { - display: flex; - flex-direction: column; - } -} diff --git a/src/modules/create/less/create.less b/src/modules/create/less/create.less deleted file mode 100644 index 8d074a7309..0000000000 --- a/src/modules/create/less/create.less +++ /dev/null @@ -1,28 +0,0 @@ -@import (reference) 'config'; - -.create { - .create-hidden { - display: none; - } - - md-dialog-content { - padding: 20px 40px 40px; - } - - .create-account { - .input-like { - background-color: @color-basic-50; - } - - } -} - -.create-account__checkbox { - margin: 20px 0 30px; -} - -@media screen and (max-width: 480px) { - .create-account__checkbox { - margin: 15px 0 20px; - } -} \ No newline at end of file diff --git a/src/modules/create/less/no-backup-no-money.less b/src/modules/create/less/no-backup-no-money.less deleted file mode 100644 index 72e36b315d..0000000000 --- a/src/modules/create/less/no-backup-no-money.less +++ /dev/null @@ -1,64 +0,0 @@ -@import (reference) 'icons'; -@import (reference) '../../app/less/app'; - -.no-backup-no-money { - .icon { - background: @slide-backup-icon no-repeat center center; - background-size: cover; - width: 260px; - height: 216px; - margin: 0 auto 25px; - } -} - -.no-backup-no-money-modal { - padding: 40px 50px 0 50px; - display: flex; - flex-direction: column; - justify-content: flex-start; - text-align: center; - - //FF ignores padding bottom fix - &::after { - content: ''; - min-height: 40px; - display: block; - position: relative; - width: 100%; - } - - .icon { - background: @slide-seed-icon no-repeat center center; - width: 106px; - height: 106px; - min-height: 106px; - margin: 0 auto 30px; - } - - w-button { - width: 224px; - margin: 40px auto 0; - } -} - -@media screen and (max-width: 480px) { - .no-backup-no-money-modal { - padding: 20px; - min-height: calc(100vh ~'- 20px'); - min-width: calc(100vw ~'- 20px'); - - //FF ignores padding bottom fix - &::after { - min-height: 20px; - } - } -} - -@media screen and (max-width: 768px) { - .no-backup-no-money { - .icon { - width: 240px; - height: 200px; - } - } -} \ No newline at end of file diff --git a/src/modules/create/templates/backupSeed.html b/src/modules/create/templates/backupSeed.html deleted file mode 100644 index 60c77f0b7f..0000000000 --- a/src/modules/create/templates/backupSeed.html +++ /dev/null @@ -1,34 +0,0 @@ -
-
- -
- -
- - -
- -
- -   -   - - - -
- - - -
- -
- -
- - - -
- -
diff --git a/src/modules/create/templates/confirmBackup.html b/src/modules/create/templates/confirmBackup.html deleted file mode 100644 index bc05b9a3f9..0000000000 --- a/src/modules/create/templates/confirmBackup.html +++ /dev/null @@ -1,40 +0,0 @@ -
- -
- -
- -
- - -
- - - -
- -
- - - -
- -
- - -
- - - - - -
diff --git a/src/modules/create/templates/create.html b/src/modules/create/templates/create.html deleted file mode 100644 index 72f0128732..0000000000 --- a/src/modules/create/templates/create.html +++ /dev/null @@ -1,5 +0,0 @@ - -
- -
- diff --git a/src/modules/create/templates/createAccount.html b/src/modules/create/templates/createAccount.html deleted file mode 100644 index cfb6bb0827..0000000000 --- a/src/modules/create/templates/createAccount.html +++ /dev/null @@ -1,82 +0,0 @@ - diff --git a/src/modules/create/templates/createAccountData.html b/src/modules/create/templates/createAccountData.html deleted file mode 100644 index d3d2438da6..0000000000 --- a/src/modules/create/templates/createAccountData.html +++ /dev/null @@ -1,18 +0,0 @@ - diff --git a/src/modules/create/templates/noBackupNoMoney.html b/src/modules/create/templates/noBackupNoMoney.html deleted file mode 100644 index 80ae04f9ed..0000000000 --- a/src/modules/create/templates/noBackupNoMoney.html +++ /dev/null @@ -1,31 +0,0 @@ -
- -
- -
-
- -
- -
- -
- -
- - - -
- - - -
- - - -
-
- -
diff --git a/src/modules/create/templates/noBackupNoMoney.modal.html b/src/modules/create/templates/noBackupNoMoney.modal.html deleted file mode 100644 index db2fc3cd93..0000000000 --- a/src/modules/create/templates/noBackupNoMoney.modal.html +++ /dev/null @@ -1,19 +0,0 @@ - -
-
- -
- -
- -
-
-
-
-
- - - - -
-
diff --git a/src/modules/create/directives/seed/SeedBase.js b/src/modules/ui/directives/seed/SeedBase.js similarity index 98% rename from src/modules/create/directives/seed/SeedBase.js rename to src/modules/ui/directives/seed/SeedBase.js index 2f5ccd0966..ee0d915b03 100644 --- a/src/modules/create/directives/seed/SeedBase.js +++ b/src/modules/ui/directives/seed/SeedBase.js @@ -105,5 +105,5 @@ factory.$inject = ['Base', '$q']; - angular.module('app.create').factory('SeedBase', factory); + angular.module('app.ui').factory('SeedBase', factory); })(); diff --git a/src/modules/create/directives/seed/SeedRead.js b/src/modules/ui/directives/seed/SeedRead.js similarity index 96% rename from src/modules/create/directives/seed/SeedRead.js rename to src/modules/ui/directives/seed/SeedRead.js index 70ed9d844d..9601761a2d 100644 --- a/src/modules/create/directives/seed/SeedRead.js +++ b/src/modules/ui/directives/seed/SeedRead.js @@ -111,12 +111,12 @@ controller.$inject = ['SeedBase', 'seedService', '$element', 'user', 'utils']; - angular.module('app.create').component('wSeedRead', { + angular.module('app.ui').component('wSeedRead', { bindings: { type: '@', seed: '@' }, controller: controller, - templateUrl: 'modules/create/directives/seed/seed.html' + templateUrl: 'modules/ui/directives/seed/seed.html' }); })(); diff --git a/src/modules/create/directives/seed/SeedService.js b/src/modules/ui/directives/seed/SeedService.js similarity index 85% rename from src/modules/create/directives/seed/SeedService.js rename to src/modules/ui/directives/seed/SeedService.js index e68bb062bd..747dfcabba 100644 --- a/src/modules/create/directives/seed/SeedService.js +++ b/src/modules/ui/directives/seed/SeedService.js @@ -11,7 +11,7 @@ factory.$inject = []; - angular.module('app.create').factory('seedService', factory); + angular.module('app.ui').factory('seedService', factory); })(); /** diff --git a/src/modules/create/directives/seed/SeedWrite.js b/src/modules/ui/directives/seed/SeedWrite.js similarity index 99% rename from src/modules/create/directives/seed/SeedWrite.js rename to src/modules/ui/directives/seed/SeedWrite.js index 7cf8e6d9fc..78b2508d2c 100644 --- a/src/modules/create/directives/seed/SeedWrite.js +++ b/src/modules/ui/directives/seed/SeedWrite.js @@ -226,7 +226,7 @@ controller.$inject = ['SeedBase', '$element', 'seedService', '$scope', 'createPromise']; - angular.module('app.create').component('wSeedWrite', { + angular.module('app.ui').component('wSeedWrite', { bindings: { seed: '@', onFulfilled: '&', diff --git a/src/modules/create/directives/seed/seed.html b/src/modules/ui/directives/seed/seed.html similarity index 100% rename from src/modules/create/directives/seed/seed.html rename to src/modules/ui/directives/seed/seed.html diff --git a/src/modules/create/directives/seed/seed.less b/src/modules/ui/directives/seed/seed.less similarity index 100% rename from src/modules/create/directives/seed/seed.less rename to src/modules/ui/directives/seed/seed.less From fafd4df296a1a05935aad06994deb653e6bafaad Mon Sep 17 00:00:00 2001 From: Vusal Gakhramanov Date: Fri, 22 Nov 2019 17:38:28 +0300 Subject: [PATCH 10/59] DEXW-2442: new user --- configs/mainnet.json | 2 +- mocks/waves-client-config/master/config.json | 2 +- src/img/icons/closed.svg | 17 +++++++++++ .../components/dexwLocked/dexwLocked.html | 13 +++++---- .../components/dexwLocked/dexwLocked.less | 28 +++++++++++++++++++ src/themeConfig/black/icons.less | 3 +- src/themeConfig/default/icons.less | 3 +- 7 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 src/img/icons/closed.svg create mode 100644 src/modules/welcome/components/dexwLocked/dexwLocked.less diff --git a/configs/mainnet.json b/configs/mainnet.json index 64be05cd35..80204cb1ea 100644 --- a/configs/mainnet.json +++ b/configs/mainnet.json @@ -24,7 +24,7 @@ "tokensNameListUrl": "https://raw.githubusercontent.com/wavesplatform/waves-community/master/Prominent%20token%20name%20list.csv", "scamListUrl": "https://raw.githubusercontent.com/wavesplatform/waves-community/master/Scam%20tokens%20according%20to%20the%20opinion%20of%20Waves%20Community.csv", "origin": "https://client.wavesplatform.com", - "featuresConfigUrl": "https://raw.githubusercontent.com/wavesplatform/waves-client-config/master/config.json", + "featuresConfigUrl": "https://localhost:8081/wavesplatform/waves-client-config/master/config.json", "feeConfigUrl": "https://raw.githubusercontent.com/wavesplatform/waves-client-config/master/fee.json", "migration": { "webUrl": "https://waves.exchange/migration", diff --git a/mocks/waves-client-config/master/config.json b/mocks/waves-client-config/master/config.json index a3e753fbda..0043ecb956 100644 --- a/mocks/waves-client-config/master/config.json +++ b/mocks/waves-client-config/master/config.json @@ -80,5 +80,5 @@ "GATEWAYS_SOON": [ "5dJj4Hn9t2Ve3tRpNGirUHy4yBK6qdJRAJYV21yPPuGz" ], - "DEXW_LOCKED": false + "DEXW_LOCKED": true } diff --git a/src/img/icons/closed.svg b/src/img/icons/closed.svg new file mode 100644 index 0000000000..40b37bdb03 --- /dev/null +++ b/src/img/icons/closed.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/modules/welcome/components/dexwLocked/dexwLocked.html b/src/modules/welcome/components/dexwLocked/dexwLocked.html index 209f99344c..b7bed78435 100644 --- a/src/modules/welcome/components/dexwLocked/dexwLocked.html +++ b/src/modules/welcome/components/dexwLocked/dexwLocked.html @@ -8,12 +8,15 @@
-
+
Old Web
-
-
-
Sorry, we are no longer working
- Waves.Exchange +
+
+
+

Sorry, we are no longer working

+
To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to + Waves.Exchange. +
MultiAccount Web
diff --git a/src/modules/welcome/components/dexwLocked/dexwLocked.less b/src/modules/welcome/components/dexwLocked/dexwLocked.less new file mode 100644 index 0000000000..50fab33905 --- /dev/null +++ b/src/modules/welcome/components/dexwLocked/dexwLocked.less @@ -0,0 +1,28 @@ +@import (reference) 'config'; +@import (reference) 'icons'; + +.new-user { + padding: 40px; + text-align: center; + width: 540px; + background: @color-white; + border-radius: @border-radius; + + &__img { + height: 100px; + width: 100px; + background: @dex-closed-icon; + margin: 0 auto 20px; + } + + &__title { + margin-bottom: 20px; + color: @color-basic-700; + } + + &__desc { + color: @color-basic-500; + line-height: 20px; + padding: 0 40px; + } +} \ No newline at end of file diff --git a/src/themeConfig/black/icons.less b/src/themeConfig/black/icons.less index 2cc6544545..693fd850cf 100644 --- a/src/themeConfig/black/icons.less +++ b/src/themeConfig/black/icons.less @@ -163,4 +163,5 @@ @logo-tokenomica-icon: url(/img/icons/logotype.svg); @warning-icon-700: url(/img/icons/warning-basic-700.svg); @info-icon-300: url(/img/icons/info-basic-300.svg); -@migrate-lock-icon: url(/img/icons/lock-40-disabled-700.svg); \ No newline at end of file +@migrate-lock-icon: url(/img/icons/lock-40-disabled-700.svg); +@dex-closed-icon: url(/img/icons/closed.svg); \ No newline at end of file diff --git a/src/themeConfig/default/icons.less b/src/themeConfig/default/icons.less index 2b20044efb..8ab473220d 100644 --- a/src/themeConfig/default/icons.less +++ b/src/themeConfig/default/icons.less @@ -163,4 +163,5 @@ @logo-tokenomica-icon: url(/img/icons/logotype.svg); @warning-icon-700: url(/img/icons/warning-basic-700.svg); @info-icon-300: url(/img/icons/info-basic-300.svg); -@migrate-lock-icon: url(/img/icons/lock-40-basic-200.svg); \ No newline at end of file +@migrate-lock-icon: url(/img/icons/lock-40-basic-200.svg); +@dex-closed-icon: url(/img/icons/closed.svg); \ No newline at end of file From f02c8f92ee8e3eb58a2cd7dc7275113e7605398d Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 22 Nov 2019 17:39:59 +0300 Subject: [PATCH 11/59] DEXW-2442: delete restore page and module --- src/index.hbs | 7 - src/modules/app/app.js | 1 - .../restore/controllers/RestoreCtrl.js | 295 ------------------ src/modules/restore/less/restore.less | 171 ---------- src/modules/restore/restore.js | 5 - src/modules/restore/templates/restore.html | 111 ------- 6 files changed, 590 deletions(-) delete mode 100644 src/modules/restore/controllers/RestoreCtrl.js delete mode 100644 src/modules/restore/less/restore.less delete mode 100644 src/modules/restore/restore.js delete mode 100644 src/modules/restore/templates/restore.html diff --git a/src/index.hbs b/src/index.hbs index fcf053af06..dce8643fa7 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -635,13 +635,6 @@ views: [{ name: 'main' }] } }, - { - id: 'restore', - data: { - url: '/import/restore', - views: [{ name: 'main' }] - } - }, { id: 'fromBackup', data: { diff --git a/src/modules/app/app.js b/src/modules/app/app.js index c8b1433c83..d0db8b9831 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -103,7 +103,6 @@ 'app.ui', 'app.welcome', 'app.switch', - 'app.restore', 'app.desktop', 'app.desktopUpdate', 'app.ledger', diff --git a/src/modules/restore/controllers/RestoreCtrl.js b/src/modules/restore/controllers/RestoreCtrl.js deleted file mode 100644 index 50ec117753..0000000000 --- a/src/modules/restore/controllers/RestoreCtrl.js +++ /dev/null @@ -1,295 +0,0 @@ -(function () { - 'use strict'; - - const analytics = require('@waves/event-sender'); - const { validators, libs } = require('@waves/waves-transactions'); - const { isPublicKey } = validators; - const { address, publicKey, base58Decode } = libs.crypto; - const TABS = { - seed: 'seed', - encodedSeed: 'encodedSeed', - key: 'key' - }; - - /** - * @param Base - * @param {ng.IScope} $scope - * @param {*} $state - * @param {User} user - * @param {app.utils} utils - * @param {ModalManager} modalManager - * @return {RestoreCtrl} - */ - const controller = function (Base, $scope, $state, user, utils, modalManager) { - - class RestoreCtrl extends Base { - - constructor() { - super($scope); - $scope.TABS = TABS; - - this.seedForm = null; - this.encodedSeedForm = null; - this.keyForm = null; - /** - * @type {string} - */ - this.seed = ''; - /** - * @type {string} - */ - this.encodedSeed = ''; - /** - * @type {string} - */ - this.key = ''; - /** - * @type {string} - */ - this.address = ''; - /** - * @type {string} - */ - this.name = ''; - /** - * @type {boolean} - */ - this.saveUserData = true; - /** - * @type {number} - */ - this.activeStep = 0; - /** - * @type {string[]} - */ - this.tabs = Object.values(TABS); - /** - * @type {string} - */ - this.activeTab = TABS.seed; - /** - * @type {boolean} - */ - this.isPriorityUserTypeExists = false; - /** - * @type {object | null} - */ - this.userExisted = Object.create(null); - /** - * @type {Array} - * @private - */ - this._usersInStorage = []; - /** - * @type {object} - * @private - */ - this._priorityMap = utils.getImportPriorityMap(); - - Promise.all([ - user.getFilteredUserList(), - user.getMultiAccountUsers() - ]).then(([legacyUsers = [], users = []]) => { - this._usersInStorage = [...legacyUsers, ...users]; - }); - - this._setFormObservers(); - - this.observe('address', this._onChangeAddress); - this.observe('activeTab', this._onChangeActiveTab); - } - - showTutorialModals() { - return modalManager.showTutorialModals(); - } - - restore() { - if (this.saveUserData) { - analytics.send({ name: 'Import Backup Protect Your Account Continue Click', target: 'ui' }); - } - - const { keyOrSeed, type } = this._getEncryptedAndType(); - - const newUser = { - userType: type, - name: this.name, - networkByte: WavesApp.network.code.charCodeAt(0), - ...keyOrSeed - }; - - return user.create(newUser, true, true).then(() => { - $state.go(user.getActiveState('wallet')); - }); - } - - resetNameAndPassword() { - this.name = ''; - this.password = ''; - } - - nextStep() { - analytics.send({ - name: 'Import Backup Continue Click', - params: { guestMode: !this.saveUserData }, - target: 'ui' - }); - if (!this.saveUserData) { - return this.restore(); - } - this.activeStep++; - analytics.send({ name: 'Import Backup Protect Your Account Show', target: 'ui' }); - } - - importAccounts() { - return modalManager.showImportAccountsModal(); - } - - /** - * @param {string} tab - */ - setActiveTab(tab) { - this.activeTab = tab; - } - - /** - * @private - */ - _setFormObservers() { - this.observe('seed', this._onChangeSeed); - this.observeOnce('seedForm', () => { - this.receive(utils.observe(this.seedForm, '$valid'), () => { - if (this.activeTab === TABS.seed) { - this._onChangeSeed(); - } - }); - }); - - this.observe('encodedSeed', this._onChangeEncodedSeed); - this.observeOnce('encodedSeedForm', () => { - this.receive(utils.observe(this.encodedSeedForm, '$valid'), () => { - if (this.activeTab === TABS.encodedSeed) { - this._onChangeEncodedSeed(); - } - }); - }); - - this.observe('key', this._onChangeKey); - this.observeOnce('keyForm', () => { - this.receive(utils.observe(this.keyForm, '$valid'), () => { - if (this.activeTab === TABS.key) { - this._onChangeKey(); - } - }); - }); - } - - /** - * @private - */ - _onChangeSeed() { - if (this.seedForm.$valid) { - this.address = new ds.Seed(this.seed, window.WavesApp.network.code).address; - } else { - this.address = ''; - } - } - - /** - * @private - */ - _onChangeEncodedSeed() { - if (this.encodedSeedForm.$valid && RestoreCtrl._isEncoded(this.encodedSeed)) { - try { - this.address = new ds.Seed(base58Decode(this.encodedSeed), WavesApp.network.code).address; - } catch (e) { - this.address = ''; - } - } else { - this.address = ''; - } - } - - /** - * @private - */ - _onChangeAddress() { - this.userExisted = this._usersInStorage.find(user => user.address === this.address) || null; - this.isPriorityUserTypeExists = - !!this.userExisted && - this._priorityMap[this.activeTab] <= this._priorityMap[this.userExisted.userType]; - } - - /** - * @private - */ - _onChangeKey() { - 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 = ''; - } - } - - /** - * @private - */ - _onChangeActiveTab() { - const tab = this.activeTab[0].toUpperCase() + this.activeTab.substring(1); - this[`_onChange${tab}`](); - } - - /** - * @return {{keyOrSeed: {seed: string}, type: string}| - * {keyOrSeed: {encodedSeed: string}, type: string}| - * {keyOrSeed: {privateKey: string}, type: string}} - * @private - */ - _getEncryptedAndType() { - switch (this.activeTab) { - case TABS.key: - return ({ - keyOrSeed: { - privateKey: this.key - }, - type: 'privateKey' - }); - case TABS.encodedSeed: - return ({ - keyOrSeed: { - seed: `base58:${this.encodedSeed}`, - publicKey: publicKey(base58Decode(this.encodedSeed)) - }, - type: 'seed' - }); - default: - return ({ - keyOrSeed: { - seed: this.seed - }, - type: 'seed' - }); - } - } - - /** - * @private - * @param seed - */ - static _isEncoded(seed) { - try { - return !!base58Decode(seed); - } catch (e) { - return false; - } - } - - } - - return new RestoreCtrl(); - }; - - controller.$inject = ['Base', '$scope', '$state', 'user', 'utils', 'modalManager']; - - angular.module('app.restore').controller('RestoreCtrl', controller); -})(); diff --git a/src/modules/restore/less/restore.less b/src/modules/restore/less/restore.less deleted file mode 100644 index ccceca5196..0000000000 --- a/src/modules/restore/less/restore.less +++ /dev/null @@ -1,171 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../app/less/app'; - -body.restore { - .restore-content { - .seed-block { - border-radius: @border-radius; - border: 1px solid @color-basic-200; - - w-input textarea { - border-radius: @border-radius; - border: none; - padding: 16px; - min-height: 86px; - max-height: 150px; - resize: vertical; - } - - .address { - &-block { - width: calc(100% ~'- 45px'); - - .address { - overflow: hidden; - text-overflow: ellipsis; - font-size: 15px; - - &.empty { - position: relative; - top: 3px; - height: 8px; - border-radius: 100px; - background-color: @color-basic-100; - } - } - - &-avatar { // .address-block-avatar - margin-right: 10px; - width: 36px; - height: 36px; - } - } - - &-block-info { - background-color: @color-basic-50; - border-top: 1px solid @color-basic-200; - height: 76px; - display: flex; - flex-direction: row; - align-items: center; - padding: 0 14px; - } - } - - .avatar-fake { - width: 36px; - height: 36px; - border-radius: 100%; - background-color: @color-basic-100; - flex-shrink: 0; - margin-right: 10px; - } - } - - .avatar__wrap { - width: 100% !important; - height: 100% !important; - } - - &__checkbox { - margin: 20px 0 30px; - } - - .restore-selects { - display: none; - } - } - - .tab { - display: flex; - margin: 0 auto 20px; - - &__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; - } - - &: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; - } - } - } -} - -@media screen and (max-width: 768px) { - body.restore { - .restore-content { - .seed-block { - w-input textarea { - padding: @padding-control-big-responsive-horizontal; - } - - .avatar-fake { - width: 32px; - height: 32px; - } - - .address-block { - .address { - &.empty { - height: 6px; - } - } - - &-avatar { - width: 32px; - height: 32px; - } - } - - .address-block-info { - height: 67px; - } - } - - &__checkbox { - margin: 15px 0 30px; - } - } - } -} - -@media screen and (max-width: 480px) { - body.restore { - .restore-content { - .restore-tabs { - display: none; - } - - .restore-selects { - display: block; - - .select__title { - height: 42px; - } - } - } - } -} \ No newline at end of file diff --git a/src/modules/restore/restore.js b/src/modules/restore/restore.js deleted file mode 100644 index ded15bc706..0000000000 --- a/src/modules/restore/restore.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.restore', []); -})(); diff --git a/src/modules/restore/templates/restore.html b/src/modules/restore/templates/restore.html deleted file mode 100644 index 7b60c252d7..0000000000 --- a/src/modules/restore/templates/restore.html +++ /dev/null @@ -1,111 +0,0 @@ - - -
-
-
- - -
-
- -
- -
-
-
- - - -
-
-
- -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- {{$ctrl.address}} -
-
-
-
- -
-
-
-
- - - - -
- - -
-
- - -
- - - - - - - -
-
- -
-
-
- From ba758e0f9fcd75990d49f69d365dcce811994c43 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 22 Nov 2019 17:42:10 +0300 Subject: [PATCH 12/59] DEXW-2442: delete fromBackup page and module --- src/index.hbs | 7 - src/modules/app/app.js | 1 - .../fromBackup/controllers/FromBackupCtrl.js | 347 ------------------ src/modules/fromBackup/fromBackup.js | 5 - src/modules/fromBackup/less/fromBackup.less | 168 --------- .../fromBackup/templates/fromBackup.html | 119 ------ 6 files changed, 647 deletions(-) delete mode 100644 src/modules/fromBackup/controllers/FromBackupCtrl.js delete mode 100644 src/modules/fromBackup/fromBackup.js delete mode 100644 src/modules/fromBackup/less/fromBackup.less delete mode 100644 src/modules/fromBackup/templates/fromBackup.html diff --git a/src/index.hbs b/src/index.hbs index dce8643fa7..1229f473aa 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -635,13 +635,6 @@ views: [{ name: 'main' }] } }, - { - id: 'fromBackup', - data: { - url: '/import/fromBackup', - views: [{ name: 'main' }] - } - }, { id: 'ledger', data: { diff --git a/src/modules/app/app.js b/src/modules/app/app.js index d0db8b9831..93e9e842e4 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -107,7 +107,6 @@ 'app.desktopUpdate', 'app.ledger', 'app.keeper', - 'app.fromBackup', 'app.import', 'app.wallet', 'app.dex', diff --git a/src/modules/fromBackup/controllers/FromBackupCtrl.js b/src/modules/fromBackup/controllers/FromBackupCtrl.js deleted file mode 100644 index 9d18ccdc63..0000000000 --- a/src/modules/fromBackup/controllers/FromBackupCtrl.js +++ /dev/null @@ -1,347 +0,0 @@ -(function () { - 'use strict'; - - const networkByte = (WavesApp.network.code || 'W').charCodeAt(0); - const { libs } = require('@waves/waves-transactions'); - - const getName = (names, name) => { - let index = 0; - - do { - name = `${name}_${index}`; - index++; - } while (names.includes(name)); - - return name; - }; - - /** - * @param {typeof Base} Base - * @param {ng.IScope} $scope - * @param {*} $state - * @param {User} user - * @param {app.utils} utils - * @param {INotification} notification - * @return {FromBackupCtrl} - */ - const controller = function (Base, $scope, $state, user, utils, notification) { - - const analytics = require('@waves/event-sender'); - - class FromBackupCtrl extends Base { - - /** - * @type {number} - */ - step = 0; - - /** - * @type {string} - */ - password = ''; - - /** - * @type {boolean} - */ - passwordError = false; - - /** - * @type {boolean} - */ - emptyError = false; - - /** - * @type {{}} - */ - checkedHash = {}; - - /** - * @type {{}} - */ - decryptedData = {}; - - /** - * @type {boolean} - */ - hasSelected = false; - - /** - * @type {boolean} - */ - selectIsVisible = true; - - /** - * @type {boolean} - */ - exportError = false; - - /** - * @type {Array} - */ - originalUsers = []; - - constructor() { - super($scope); - this.selectIsVisible = true; - analytics.send({ name: 'Import From Backup Click', target: 'ui' }); - } - - static parseUsers(data) { - const backup = JSON.parse(data); - - if (!backup || (backup.type !== 'wavesBackup' || !backup.lastOpenVersion)) { - throw new Error('wrongFile'); - } - - const dataObject = JSON.parse( - libs.crypto.bytesToString(libs.crypto.base64Decode(backup.data)) - ); - - const hashSum = dataObject.hashSum; - - delete dataObject.hashSum; - - const savedDataHash = libs.crypto.base58Encode( - libs.crypto.sha256(libs.crypto.stringToBytes(JSON.stringify(dataObject))) - ); - - if (savedDataHash !== hashSum) { - throw new Error('Fail is corrupted'); - } - - return { - ...dataObject, - type: backup.type, - lastOpenVersion: backup.lastOpenVersion - }; - } - - toggleSelect(address) { - this.checkedHash[address] = !this.checkedHash[address]; - this.onSelect(); - } - - onSelect() { - const total = (this.decryptedData.saveUsers || []).length; - const selected = Object.values(this.checkedHash).filter(Boolean).length; - this.hasSelected = !!selected; - this.selectIsVisible = total !== selected; - } - - selectAll() { - (this.decryptedData.saveUsers || []).forEach((user) => { - this.checkedHash[user.address] = true; - }); - this.onSelect(); - } - - unselectAll() { - (this.decryptedData.saveUsers || []).forEach((user) => { - this.checkedHash[user.address] = false; - }); - this.onSelect(); - } - - next() { - if (this.step === 0 && this.backup && this.backup.encrypted) { - user.getMultiAccountUsers().then(users => { - this.originalUsers = users; - this.password = ''; - this.step = 1; - utils.safeApply($scope); - }); - } else if (this.step === 0 && this.backup && !this.backup.encrypted) { - this.password = ''; - this.decryptedData = { ...this.backup }; - this.decryptedData.saveUsers = typeof this.decryptedData.saveUsers === 'string' ? - JSON.parse(this.decryptedData.saveUsers) : - this.decryptedData.saveUsers; - this.remapUsers(); - this.filterUsers(); - this.selectFirst(); - if (!this.emptyError) { - this.step = 2; - } else { - this.step = 0; - } - } else if (this.step === 1 && this.password) { - const saveUsers = this.decryptData(); - if (!this.passwordError) { - this.decryptedData = { - ...this.backup, - saveUsers - }; - this.remapUsers(); - this.filterUsers(); - this.selectFirst(); - if (!this.emptyError) { - this.step = 2; - } else { - this.step = 0; - } - } - } - } - - filterUsers() { - this.decryptedData.saveUsers = this.decryptedData.saveUsers || []; - const isDesktop = WavesApp.isDesktop(); - if (isDesktop) { - this.decryptedData.saveUsers = this.decryptedData.saveUsers - .filter((user) => user.userType !== 'wavesKeeper'); - } - - this.decryptedData.saveUsers = this.decryptedData.saveUsers - .filter((user) => user.networkByte === networkByte); - - if (!this.decryptedData.saveUsers || this.decryptedData.saveUsers.length === 0) { - this.emptyError = true; - } - } - - selectFirst() { - const user = (this.decryptedData.saveUsers || [])[0]; - if (!user) { - return; - } - this.checkedHash = { - [user.address]: true - }; - this.onSelect(); - } - - login(newUser) { - user.login(newUser); - notification.info({ - ns: 'app.ui', - title: { literal: 'importSuccess' } - }); - $state.go(user.getActiveState('wallet')); - } - - decryptData() { - try { - const data = { ...this.backup }; - const users = JSON.parse( - libs.crypto.decryptSeed(data.saveUsers, this.password, data.encryptionRounds) - ); - this.passwordError = !Array.isArray(users); - return users; - } catch (e) { - this.passwordError = true; - } - } - - $onDestroy() { - super.$onDestroy(); - } - - onFileChange(event) { - const reader = new FileReader(); - this.emptyError = false; - if (event.target.files && event.target.files.length > 0) { - const file = event.target.files[0]; - this.filename = file.name || ''; - reader.readAsDataURL(file); - - const userListPromise = user.getMultiAccountUsers().then(users => { - this.originalUsers = users; - }); - - const readerPromise = new Promise((resolve, reject) => { - reader.onload = resolve; - reader.onerror = reject; - }); - - Promise.all([userListPromise, readerPromise]).then( - () => { - const fileData = libs.crypto - .bytesToString(libs.crypto.base64Decode(reader.result.split(',')[1])); - - this.backup = FromBackupCtrl.parseUsers(fileData); - this.readError = null; - } - ).catch(() => { - this.readError = 'wrongFile'; - }).then(() => { - utils.safeApply($scope); - }); - - } - } - - remapUsers() { - const fromBackup = this.decryptedData.saveUsers || []; - const originalUsers = this.originalUsers.reduce((acc, user) => { - acc.names[user.name] = user; - acc.addresses[user.address] = user; - acc.publicKeys[user.publicKey] = user; - return acc; - }, { names: {}, addresses: {}, publicKeys: {} }); - - this.decryptedData.saveUsers = fromBackup.map( - (user) => { - const originalUser = originalUsers.addresses[user.address]; - if (originalUser) { - return null; - } - - if (originalUsers.names[user.name]) { - user.name = getName(Object.keys(originalUsers.names), user.name); - } - - return user; - } - ) - .filter(Boolean); - } - - onSubmit() { - const users = Object.entries(this.checkedHash) - .filter(item => item[1]) - .map( - ([address]) => this.decryptedData.saveUsers.find(user => user.address === address) - ); - const promises = []; - users.reduce( - (acc, newUser) => { - const userPromise = acc.then(() => user.addUser(newUser, true, true)); - promises.push(userPromise); - return userPromise; - }, - Promise.resolve() - ); - - Promise.all(promises) - .then(users => this.login(users[0])) - .catch(() => { - this.exportError = true; - }); - } - - } - - return new FromBackupCtrl(); - }; - - controller.$inject = ['Base', '$scope', '$state', 'user', 'utils', 'notification']; - - angular.module('app.fromBackup').controller('FromBackupCtrl', controller); - angular.module('app.fromBackup').directive('fileChange', ['$parse', function ($parse) { - - return { - require: 'ngModel', - restrict: 'A', - link: function ($scope, element, attrs) { - - const attrHandler = $parse(attrs.fileChange); - const handler = function (e) { - $scope.$apply(function () { - attrHandler($scope, { $event: e, files: e.target.files }); - }); - }; - element[0].addEventListener('change', handler, false); - } - }; - }]); -})(); diff --git a/src/modules/fromBackup/fromBackup.js b/src/modules/fromBackup/fromBackup.js deleted file mode 100644 index 22e110eec4..0000000000 --- a/src/modules/fromBackup/fromBackup.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.fromBackup', []); -})(); diff --git a/src/modules/fromBackup/less/fromBackup.less b/src/modules/fromBackup/less/fromBackup.less deleted file mode 100644 index f782dca349..0000000000 --- a/src/modules/fromBackup/less/fromBackup.less +++ /dev/null @@ -1,168 +0,0 @@ -@import (reference) 'config'; -@import (reference) 'icons'; -@import (reference) '../../app/less/app'; - -.fromBackup { - &__icon { - height: 80px; - width: 80px; - margin: 0 auto 30px; - background-size: 100% 100%; - - &_keystore { - background: @importBackupFile-icon; - } - - &_password { - background: @importBackupPassword-icon; - } - } - - input[type=file] { - opacity: 0; - position: absolute; - top: -6px; - left: 0; - bottom: 0; - width: 120px; - font-size: 0; - cursor: pointer; - } - - input[type=password], - input[type=text] { - margin-bottom: 0; - } - - &__input { - &-wrap { - display: flex; - align-items: center; - position: relative; - margin-bottom: 30px; - } - - &-btnWrap { - overflow: hidden; - margin-right: 10px; - position: relative; - } - - &-file { - background: @color-submit-100; - color: @color-submit-400; - padding: 9px 27px; - border-radius: @border-radius / 2; - display: block; - white-space: nowrap; - cursor: pointer; - } - } - - &__subtitle { - display: flex; - justify-content: space-between; - margin-bottom: 5px; - color: @color-basic-900; - } - - &__list { - overflow: hidden; - overflow-y: auto; - max-height: 230px; - - &-wrap { - background: @color-white; - border-radius: @border-radius; - overflow: hidden; - max-height: 240px; - padding: 5px; - border: 1px solid @color-basic-200; - margin-bottom: 30px; - } - - &::-webkit-scrollbar-track { - -webkit-box-shadow: none; - } - } - - &__user { - display: flex; - align-items: center; - justify-content: space-between; - padding: 9px 20px 9px 10px; - width: 100%; - cursor: pointer; - border-radius: @border-radius; - - &:hover { - background: @color-basic-50; - } - - &:first-child { - padding-top: 5px; - } - - &:last-child { - padding-bottom: 5px; - } - - &-content { - display: flex; - width: calc(100% ~"- 30px"); - overflow: hidden; - } - - &-info { - width: calc(100% ~"- 50px"); - } - - .checkbox-submit { - margin-right: 0; - } - } - - &__address { - color: @color-basic-500; - text-overflow: ellipsis; - width: 100%; - overflow: hidden; - } - - &__avatar { - margin-right: 10px; - } - - &__helper .help-icon__content { - width: 60%; - } - - &__errorPass { - position: absolute; - top: calc(100% ~"+ 5px"); - } -} - -@media screen and (max-width: 480px) { - .fromBackup { - &__icon { - margin-bottom: 15px; - } - - &__input { - &-wrap { - margin-bottom: 15px; - flex-wrap: wrap; - } - - &-file { - margin-bottom: 5px; - } - } - - &__errorPass { - top: 99%; - font-size: 11px; - } - } -} \ No newline at end of file diff --git a/src/modules/fromBackup/templates/fromBackup.html b/src/modules/fromBackup/templates/fromBackup.html deleted file mode 100644 index 3774006d5c..0000000000 --- a/src/modules/fromBackup/templates/fromBackup.html +++ /dev/null @@ -1,119 +0,0 @@ - - -
-
-
- - - -
-
-

-
-
- - -
-
-
- - -
- {{$ctrl.filename}} - - - -
- - - - - -
- - -
-
-

-
-
- - -
- -
- - - - -
- - - - - - - - - -
- -
-

-
-
- - -
- -
-
- - -
- -
-
-
-
- - - -
- -
-
-
- - -
-
-
-
- - - -
-
-
- - From d78099440322d466c8f09cdda70162d1ac819ea1 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 22 Nov 2019 17:54:20 +0300 Subject: [PATCH 13/59] DEXW-2442: delete ledger page and module --- src/index.hbs | 7 - src/modules/app/app.js | 1 - src/modules/ledger/controllers/LedgerCtrl.js | 419 ------------------- src/modules/ledger/ledger.js | 5 - src/modules/ledger/less/ledger.less | 97 ----- src/modules/ledger/templates/ledger.html | 147 ------- 6 files changed, 676 deletions(-) delete mode 100644 src/modules/ledger/controllers/LedgerCtrl.js delete mode 100644 src/modules/ledger/ledger.js delete mode 100644 src/modules/ledger/less/ledger.less delete mode 100644 src/modules/ledger/templates/ledger.html diff --git a/src/index.hbs b/src/index.hbs index 1229f473aa..37962e20d2 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -635,13 +635,6 @@ views: [{ name: 'main' }] } }, - { - id: 'ledger', - data: { - url: '/import/ledger', - views: [{ name: 'main' }] - } - }, { id: 'keeper', data: { diff --git a/src/modules/app/app.js b/src/modules/app/app.js index 93e9e842e4..a0ff2240cc 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -105,7 +105,6 @@ 'app.switch', 'app.desktop', 'app.desktopUpdate', - 'app.ledger', 'app.keeper', 'app.import', 'app.wallet', diff --git a/src/modules/ledger/controllers/LedgerCtrl.js b/src/modules/ledger/controllers/LedgerCtrl.js deleted file mode 100644 index 4c0d325bc4..0000000000 --- a/src/modules/ledger/controllers/LedgerCtrl.js +++ /dev/null @@ -1,419 +0,0 @@ -(function () { - 'use strict'; - - const signatureAdapter = require('@waves/signature-adapter'); - - const USERS_COUNT = 5; - const PRELOAD_USERS_COUNT = 5; - const MAX_USER_COUNT = 2147483647; - - /** - * @param {typeof Base} Base - * @param {ng.IScope} $scope - * @param {*} $state - * @param {User} user - * @param {ModalManager} modalManager - * @param {app.utils} utils - * @return {LedgerCtrl} - */ - const controller = function (Base, $scope, $state, user, modalManager, utils) { - - const analytics = require('@waves/event-sender'); - - class LedgerCtrl extends Base { - - constructor() { - super($scope); - /** - * @type {LedgerAdapter} - */ - this.adapter = signatureAdapter.LedgerAdapter; - /** - * @type {boolean} - */ - this.loading = false; - /** - * @type {boolean} - */ - this.error = false; - /** - * @type {Array} - */ - this.visibleUsers = []; - /** - * @type {null} - */ - this.selectedUser = null; - /** - * @type {number} - */ - this.offset = 0; - /** - * @type {boolean} - */ - this.isInit = false; - /** - * @type {boolean} - */ - this.disabledLogin = true; - /** - * @type {boolean} - */ - this.disabledRight = true; - /** - * @type {boolean} - */ - this.disabledLeft = true; - /** - * @type {boolean} - */ - this.selectDefault = false; - /** - * @type {boolean} - */ - this.saveUserData = true; - /** - * @type {string} - */ - this.id = ''; - /** - * @type {string} - */ - this.name = ''; - /** - * @type {string} - * @private - */ - this._runLedgerCommand = ''; - /** - * @type {Object} - * @private - */ - this._users = {}; - /** - * @type {Array} - * @private - */ - this._usersInStorage = []; - /** - * @type {boolean} - */ - this.isPriorityUserTypeExists = false; - /** - * @type {string} - * @private - */ - this._type = 'ledger'; - /** - * @type {object | null} - */ - this.userExisted = Object.create(null); - /** - * @type {object} - * @private - */ - this._priorityMap = utils.getImportPriorityMap(); - - Promise.all([ - user.getFilteredUserList(), - user.getMultiAccountUsers() - ]).then(([legacyUsers = [], users = []]) => { - this._usersInStorage = [...legacyUsers, ...users]; - }); - - this.observe('selectDefault', this._onChangeSelectDefault); - this.getUsers(PRELOAD_USERS_COUNT); - this.observe('selectedUser', this._onSelectUser); - this.observe('name', this._onChangeName); - analytics.send({ name: 'Import Ledger Click', target: 'ui' }); - } - - /** - * @param {number} count - * @return {Promise} - */ - getUsers(count) { - this._runLedgerCommand = 'getUsers'; - this.loading = true; - this.error = false; - - const countUsers = (count || USERS_COUNT) - 1; - const promise = utils.timeoutPromise(this.adapter.getUserList(this.offset, countUsers), 25000); - - const modalPromise = this.isInit ? - Promise.resolve() : - modalManager.showLoginByDevice(promise, this.adapter.type); - - return Promise.all([promise, modalPromise]) - .then(([users]) => { - this.isInit = true; - this.loading = false; - this.error = false; - - (users || []).forEach(curUser => { - this._users[curUser.id] = curUser; - }); - - this.showVisibleUsers(); - this.selectUser(); - $scope.$digest(); - }) - .catch((err = {}) => { - const error = { ...err, count }; - this.loading = false; - this.error = error; - - if (err instanceof RangeError) { - this.offset = 0; - this.id = ''; - } - - $scope.$digest(); - throw error; - }); - } - - /** - * {void} - */ - retryGetUsers() { - this[this._runLedgerCommand](this.error && this.error.count); - } - - /** - * @param [user] - * @param user.id - * @param user.path - * @param user.address - * @param user.publicKey - * @return {null} - */ - selectUser(user) { - if (this.selectDefault) { - return null; - } - - if (!user && !this.selectedUser && this._users[0]) { - this.selectedUser = this._users[0]; - } else if (user) { - this.selectedUser = user; - } - - this._calculateDisabled(); - - } - - /** - * @return {void} - */ - stepLeft() { - if (this.selectDefault || this.disabledLeft) { - return; - } - - this.offset = this._normalizeOffset(this.offset - USERS_COUNT); - - if (this._hasUsersInCache(this.offset, this.offset + USERS_COUNT - 1)) { - this.showVisibleUsers(); - } else { - if (this.loading) { - return; - } - - this.getUsers(); - } - - this._calculateDisabled(); - } - - /** - * @return {void} - */ - stepRight() { - if (this.selectDefault || this.disabledRight) { - return; - } - - this.offset = this._normalizeOffset(this.offset + USERS_COUNT); - - if (this._hasUsersInCache(this.offset, this.offset + USERS_COUNT - 1)) { - this.showVisibleUsers(); - } else { - if (this.loading) { - return; - } - - this.getUsers(); - } - - this._calculateDisabled(); - } - - /** - * {void} - */ - showVisibleUsers() { - const tmp = []; - - for (let i = this.offset; i < this.offset + USERS_COUNT; i++) { - tmp.push(this._users[i]); - } - - this.visibleUsers = tmp; - } - - /** - * @return {void} - */ - login() { - this._runLedgerCommand = 'login'; - - const newUser = { - ...this.selectedUser, - userType: this.adapter.type, - name: this.name, - networkByte: WavesApp.network.code.charCodeAt(0) - }; - - this._calculateDisabled(true); - - return user.create(newUser, true, true).then(() => { - $state.go(user.getActiveState('wallet')); - }).catch(() => { - this.error = true; - $scope.$digest(); - }); - } - - /** - * @param {number} index - * @return {boolean} - */ - isUserDisable(index) { - return index !== 0 && this.selectDefault; - } - - /** - * @public - */ - onChangeId() { - let id = parseInt(this.selectDefault ? this.selectedUser.id : this.id, 10); - - if (isNaN(id) || id < 0) { - id = 0; - } - - if (id > MAX_USER_COUNT) { - id = MAX_USER_COUNT; - } - - this.id = String(id); - - this.offset = this._normalizeOffset(id - Math.floor(USERS_COUNT / 2)); - - if (this._hasUsersInCache(this.offset, this.offset + USERS_COUNT - 1)) { - this.showVisibleUsers(); - this.selectUser(this._users[id]); - } else { - this.getUsers().then(() => { - this.selectUser(this._users[id]); - }); - } - } - - _calculateDisabled(disable) { - this.disabledLogin = ( - disable || - this.loading || - !this.selectedUser - ); - - this.disabledRight = ( - disable || - this.selectDefault || - this.loading || - this.offset === MAX_USER_COUNT - (USERS_COUNT - 1) - ); - - this.disabledLeft = ( - disable || - this.selectDefault || - this.loading || - this.offset === 0 - ); - } - - _onChangeSelectDefault() { - if (this.selectDefault) { - this.offset = 0; - this.selectedUser = this._users[0]; - this.id = this.selectedUser.id; - } - - this._calculateDisabled(); - this.showVisibleUsers(); - } - - /** - * @private - */ - _onSelectUser() { - this.id = this.selectedUser.id; - this.userExisted = - this._usersInStorage.find(user => user.address === this.selectedUser.address) || - null; - this.isPriorityUserTypeExists = - !!this.userExisted && - this._priorityMap[this._type] <= this._priorityMap[this.userExisted.userType]; - } - - /** - * @private - */ - _onChangeName() { - const isUnique = this._usersInStorage.some(user => { - return user.name === this.name && user.address !== this.selectedUser.address; - }); - this.importForm.userName.$setValidity('isUnique', !isUnique); - } - - /** - * @private - * @param {number} from - * @param {number} to - */ - _hasUsersInCache(from, to) { - for (let i = from; i <= to; i++) { - if (!this._users[i]) { - return false; - } - } - - return true; - } - - /** - * @private - * @param {number} offset - */ - _normalizeOffset(offset) { - if (offset > MAX_USER_COUNT - (USERS_COUNT - 1)) { - return MAX_USER_COUNT - (USERS_COUNT - 1); - } - - if (offset < 0) { - return 0; - } - - return offset; - } - - } - - return new LedgerCtrl(); - }; - - controller.$inject = ['Base', '$scope', '$state', 'user', 'modalManager', 'utils']; - - angular.module('app.ledger').controller('LedgerCtrl', controller); -})(); diff --git a/src/modules/ledger/ledger.js b/src/modules/ledger/ledger.js deleted file mode 100644 index 74864d4449..0000000000 --- a/src/modules/ledger/ledger.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.ledger', []); -})(); diff --git a/src/modules/ledger/less/ledger.less b/src/modules/ledger/less/ledger.less deleted file mode 100644 index 0821f36618..0000000000 --- a/src/modules/ledger/less/ledger.less +++ /dev/null @@ -1,97 +0,0 @@ -@import (reference) 'config'; -@import (reference) 'icons'; -@import (reference) '../../app/less/app'; - -body.ledger { - .import-wrapper { - .step { - &-left, - &-right { - position: relative; - } - } - - .icon { - &-left, - &-right { - height: 18px; - width: 18px; - cursor: pointer; - position: absolute; - top: 44px; - } - - &-left { - background: @arrow-left-icon; - left: -20px; - } - - &-right { - background: @arrow-right-icon; - right: -20px; - } - } - - .step-left.disabled .icon-left, - .step-right.disabled .icon-right { - cursor: default; - opacity: 0.3; - } - - .input-like { - background: @color-basic-50; - } - } - - .loader-error-wrapper { - display: flex; - flex-direction: column; - align-items: center; - } - - .loader-wrapper { - position: relative; - top: 50%; - width: 100px; - margin: 0 auto; - height: 107px; - transform: translate(0); - left: 0; - .loader { - margin-top:2px; - } - } -} - -.ledger__checkbox { - margin: 20px 0 30px; -} - -@media screen and (max-width: 480px) { - body.ledger { - .import-wrapper { - .icon { - &-left, - &-right { - top: 34px; - } - - &-left { - left: -15px; - } - - &-right { - right: -15px; - } - } - } - - .loader-wrapper { - height: 87px; - } - } - - .ledger__checkbox { - margin: 15px 0 20px; - } -} \ No newline at end of file diff --git a/src/modules/ledger/templates/ledger.html b/src/modules/ledger/templates/ledger.html deleted file mode 100644 index f8c24ab760..0000000000 --- a/src/modules/ledger/templates/ledger.html +++ /dev/null @@ -1,147 +0,0 @@ - - -
-
-
- -
-
- -

- -
-
- -
-
- - -
-
- - -
- -
-
-
- -
-
-
-
-
-
-
-
-
- -
-
- -
-
- -
- -
-
-
-
-
- {{$ctrl.selectedUser.address}} -
-
- -
-
-
-
- - -
-
-
- - - - - -
- -
- - - -
- -
-
- - - - - - - - -
-
-
- -
- - - - - -
-
-
-
-
- From 853f1059ce6a7889bc101aa99ed89446e8d08ba7 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 22 Nov 2019 18:05:42 +0300 Subject: [PATCH 14/59] DEXW-2442: delete keeper page and module --- src/index.hbs | 7 - src/modules/app/app.js | 1 - src/modules/keeper/controllers/KeeperCtrl.js | 245 ------------------- src/modules/keeper/keeper.js | 5 - src/modules/keeper/less/keeper.less | 30 --- src/modules/keeper/templates/keeper.html | 125 ---------- 6 files changed, 413 deletions(-) delete mode 100644 src/modules/keeper/controllers/KeeperCtrl.js delete mode 100644 src/modules/keeper/keeper.js delete mode 100644 src/modules/keeper/less/keeper.less delete mode 100644 src/modules/keeper/templates/keeper.html diff --git a/src/index.hbs b/src/index.hbs index 37962e20d2..0153ace079 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -635,13 +635,6 @@ views: [{ name: 'main' }] } }, - { - id: 'keeper', - data: { - url: '/import/waveskeeper', - views: [{ name: 'main' }] - } - }, { id: 'import', data: { diff --git a/src/modules/app/app.js b/src/modules/app/app.js index a0ff2240cc..97c21678d6 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -105,7 +105,6 @@ 'app.switch', 'app.desktop', 'app.desktopUpdate', - 'app.keeper', 'app.import', 'app.wallet', 'app.dex', diff --git a/src/modules/keeper/controllers/KeeperCtrl.js b/src/modules/keeper/controllers/KeeperCtrl.js deleted file mode 100644 index f917bcf702..0000000000 --- a/src/modules/keeper/controllers/KeeperCtrl.js +++ /dev/null @@ -1,245 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {typeof Base} Base - * @param {ng.IScope} $scope - * @param {*} $state - * @param {User} user - * @param {app.utils} utils - * @return {KeeperCtrl} - */ - const controller = function (Base, $scope, $state, user, utils) { - - const signatureAdapter = require('@waves/signature-adapter'); - const analytics = require('@waves/event-sender'); - - class KeeperCtrl extends Base { - - /** - * @type {boolean} - */ - isInit = false; - /** - * @type {boolean} - */ - noKeeper = false; - /** - * @type {boolean} - */ - noKeeperPermission = false; - /** - * @type {boolean} - */ - noKeeperAccounts = false; - /** - * @type {boolean} - */ - incorrectKeeperNetwork = false; - /** - * @type {boolean} - */ - lockedKeeper = false; - /** - * @type {WavesKeeperAdapter} - */ - adapter = signatureAdapter.WavesKeeperAdapter; - /** - * @type {boolean} - */ - loading = false; - /** - * @type {boolean} - */ - error = false; - /** - * @type {user} - */ - selectedUser = Object.create(null); - /** - * @type {boolean} - */ - saveUserData = true; - /** - * @type {string} - */ - name = ''; - /** - * @type {boolean} - */ - isPriorityUserTypeExists = false; - /** - * @type {object | null} - */ - userExisted = Object.create(null); - /** - * @type {Array} - * @private - */ - _usersInStorage = []; - /** - * @type {string} - * @private - */ - _type = 'wavesKeeper'; - /** - * @type {object} - * @private - */ - _priorityMap = utils.getImportPriorityMap(); - - constructor() { - super($scope); - - this.observe('selectedUser', this._onSelectUser); - this.adapter.onUpdate(this._onUpdateAdapter); - - Promise.all([ - user.getFilteredUserList(), - user.getMultiAccountUsers() - ]).then(([legacyUsers = [], users = []]) => { - this._usersInStorage = [...legacyUsers, ...users]; - }); - analytics.send({ name: 'Import Keeper Click', target: 'ui' }); - this.getUsers(); - } - - $onDestroy() { - super.$onDestroy(); - this.adapter.offUpdate(this._onUpdateAdapter); - } - - /** - * @return {Promise} - */ - isAvilableAdapter() { - return this.adapter.isAvailable(); - } - - onError(error) { - - const { code } = error; - - switch (code) { - case 0: - this.noKeeper = true; - break; - case 1: - this.noKeeperPermission = true; - break; - case 2: - this.noKeeperAccounts = true; - break; - case 3: - this.incorrectKeeperNetwork = true; - break; - case 'locked': - this.lockedKeeper = true; - break; - default: - } - - this.error = true; - } - - onUpdateState() { - if (this.loading) { - return; - } - clearTimeout(this._time); - this._time = setTimeout(() => this.getUsers(), 500); - } - - /** - * @return {void} - */ - getUsers() { - this.loading = true; - this.error = false; - this.noKeeper = false; - this.noKeeperPermission = false; - this.noKeeperAccounts = false; - this.incorrectKeeperNetwork = false; - this.lockedKeeper = false; - - this.isAvilableAdapter() - .then(() => this.adapter.getUserList()) - .then(([user]) => { - if (!user) { - return Promise.reject({ code: 'locked' }); - } - this.selectedUser = user; - this.receive(utils.observe(this.selectedUser, 'name'), this._onChangeName, this); - delete this.selectedUser.type; - }) - .catch((e) => this.onError(e)) - .finally(() => { - this.isInit = true; - this.loading = false; - $scope.$apply(); - this._onSelectUser(); - }); - } - - /** - * @return {void} - */ - login() { - const newUser = { - ...this.selectedUser, - userType: this.adapter.type, - networkByte: WavesApp.network.code.charCodeAt(0) - }; - - return user.create(newUser, true, true).then(() => { - $state.go(user.getActiveState('wallet')); - }).catch(() => { - this.error = true; - $scope.$digest(); - }); - } - - /** - * @private - */ - _onSelectUser() { - this._onChangeAddress(); - this._onChangeName(); - } - - /** - * @private - */ - _onChangeAddress() { - this.userExisted = - this._usersInStorage.find(user => user.address === this.selectedUser.address) || - null; - this.isPriorityUserTypeExists = - !!this.userExisted && - this._priorityMap[this._type] <= this._priorityMap[this.userExisted.userType]; - } - - /** - * @private - */ - _onChangeName() { - const isUnique = this._usersInStorage.some(user => { - return user.name === this.selectedUser.name && user.address !== this.selectedUser.address; - }); - - if (this.importForm) { - this.importForm.userName.$setValidity('isUnique', !isUnique); - } - } - - _onUpdateAdapter = (state) => this.onUpdateState(state); - - } - - return new KeeperCtrl(); - }; - - controller.$inject = ['Base', '$scope', '$state', 'user', 'utils']; - - angular.module('app.keeper').controller('KeeperCtrl', controller); -})(); diff --git a/src/modules/keeper/keeper.js b/src/modules/keeper/keeper.js deleted file mode 100644 index 2fb1d85f7f..0000000000 --- a/src/modules/keeper/keeper.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.keeper', []); -})(); diff --git a/src/modules/keeper/less/keeper.less b/src/modules/keeper/less/keeper.less deleted file mode 100644 index fe601d883a..0000000000 --- a/src/modules/keeper/less/keeper.less +++ /dev/null @@ -1,30 +0,0 @@ -@import (reference) 'config'; -@import (reference) 'icons'; -@import (reference) '../../app/less/app'; - -body.keeper { - .address { - align-items: center; - } - .avatar { - margin-right: 10px; - } - - .error-icon, - .keeper-icon { - height: 80px; - width: 80px; - margin: 0 auto 30px auto; - background-repeat: no-repeat; - background-position: center center; - background-size: contain; - } - - .keeper-icon { - background-image: @keeper-icon; - } - - .error-icon { - background-image: @error-circle-icon; - } -} \ No newline at end of file diff --git a/src/modules/keeper/templates/keeper.html b/src/modules/keeper/templates/keeper.html deleted file mode 100644 index c5803f0812..0000000000 --- a/src/modules/keeper/templates/keeper.html +++ /dev/null @@ -1,125 +0,0 @@ - -
-
-
-
-
-
- -
- -
-

- -
- -
- -
-

-
- -
-
- -
- -

-
- - -
-
- -
- -

-
- -
- -
- -
- -

-
- - -
-
-
- -
- -
-
- -
{{$ctrl.selectedUser.address}}
-
- -
-
-
- - - - - - - -
-
- -
-
- - - -
- -
- -
-
-
- - From 930390dbc6e3f47a9815f8e5c6aa1144ab3866d3 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 25 Nov 2019 10:40:36 +0300 Subject: [PATCH 15/59] DEXW-2442: delete import page and module --- src/index.hbs | 6 -- src/modules/app/app.js | 1 - src/modules/import/controllers/ImportCtrl.js | 30 ------- src/modules/import/import.js | 5 -- src/modules/import/less/import-page.less | 84 -------------------- src/modules/import/templates/import.html | 58 -------------- 6 files changed, 184 deletions(-) delete mode 100644 src/modules/import/controllers/ImportCtrl.js delete mode 100644 src/modules/import/import.js delete mode 100644 src/modules/import/less/import-page.less delete mode 100644 src/modules/import/templates/import.html diff --git a/src/index.hbs b/src/index.hbs index 0153ace079..6d6070d7d8 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -635,12 +635,6 @@ views: [{ name: 'main' }] } }, - { - id: 'import', - data: { - views: [{ name: 'main' }] - } - }, { id: 'stand', data: { diff --git a/src/modules/app/app.js b/src/modules/app/app.js index 97c21678d6..aa797259c3 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -105,7 +105,6 @@ 'app.switch', 'app.desktop', 'app.desktopUpdate', - 'app.import', 'app.wallet', 'app.dex', 'app.tokens', diff --git a/src/modules/import/controllers/ImportCtrl.js b/src/modules/import/controllers/ImportCtrl.js deleted file mode 100644 index 30eaf48424..0000000000 --- a/src/modules/import/controllers/ImportCtrl.js +++ /dev/null @@ -1,30 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {typeof Base} Base - * @param {ng.IScope} $scope - * @param {User} user - * @return {ImportCtrl} - */ - const controller = function (Base, $scope, user) { - - class ImportCtrl extends Base { - - constructor() { - super($scope); - } - - backState() { - return user.getLastState(); - } - - } - - return new ImportCtrl(); - }; - - controller.$inject = ['Base', '$scope', 'user']; - - angular.module('app.import').controller('ImportCtrl', controller); -})(); diff --git a/src/modules/import/import.js b/src/modules/import/import.js deleted file mode 100644 index a8e554dfde..0000000000 --- a/src/modules/import/import.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.import', []); -})(); diff --git a/src/modules/import/less/import-page.less b/src/modules/import/less/import-page.less deleted file mode 100644 index cea36b1055..0000000000 --- a/src/modules/import/less/import-page.less +++ /dev/null @@ -1,84 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../app/less/app'; - -.import-content-ledger { - .getStartedContentWidth(@getStartedContentPadding); - margin: auto; -} - -@media screen and (max-width: 480px) { - .import-content-ledger { - .import-modal__block, - .import-modal__block-w { - flex-direction: row; - display: flex; - } - - .import-modal__content { - text-align: left; - margin-left: 11px; - - &-title { // .import-modal__content-title - font-size: 13px; - margin-bottom: 0; - } - - &-text { - font-size: 12px; - line-height: 16px; - } - } - - .import-modal__icon { - margin: 0; - width: 42px; - height: 42px; - } - } - - .import-modal { - &__block { - flex-basis: 100%; - max-width: 100%; - width: 100%; - } - - w-help-icon { - .help-icon__content { - right: 0; - left: 0; - width: 100%; - } - } - } -} - -@media screen and (min-width: 480px) { - .import-content-ledger { - .getStartedContentWidthDesktop(); - - .import-modal { - &__block { - margin: 0 0 10px 0; - padding: 20px 10px 20px 20px; - width: 100%; - display: flex; - align-items: center; - min-height: 80px; - } - } - } - - .import-footer { - max-width: @getStartedContentWidth; - margin: auto; - text-align: center; - } -} - -.import-content-ledger { - w-web-only.import-modal__block > div { - display: flex; - align-items: center; - } -} \ No newline at end of file diff --git a/src/modules/import/templates/import.html b/src/modules/import/templates/import.html deleted file mode 100644 index c5e88543bc..0000000000 --- a/src/modules/import/templates/import.html +++ /dev/null @@ -1,58 +0,0 @@ - - -
-
-
-
-
- -
- -
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
- -
-
-
-
-
-
-
- - -
-
-
-
-
-
-
- - -
-
-
- - From 8fa2ee8dfc1af69b57ab10da2b50dc8ec88e61a5 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 25 Nov 2019 10:45:20 +0300 Subject: [PATCH 16/59] DEXW-2442: delete desktop page and module --- src/index.hbs | 7 - src/modules/app/app.js | 1 - .../desktop/controllers/DesktopCtrl.js | 51 ----- src/modules/desktop/desktop.js | 5 - src/modules/desktop/less/desktop.less | 23 -- src/modules/desktop/less/electron.less | 201 ------------------ src/modules/desktop/templates/desktop.html | 30 --- 7 files changed, 318 deletions(-) delete mode 100644 src/modules/desktop/controllers/DesktopCtrl.js delete mode 100644 src/modules/desktop/desktop.js delete mode 100644 src/modules/desktop/less/desktop.less delete mode 100644 src/modules/desktop/less/electron.less delete mode 100644 src/modules/desktop/templates/desktop.html diff --git a/src/index.hbs b/src/index.hbs index 6d6070d7d8..8ee1714e30 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -642,13 +642,6 @@ views: [{ name: 'main' }] } }, - { - id: 'desktop', - data: { - noLogin: true, - views: [{ name: 'main' }] - } - }, { id: 'desktopUpdate', data: { diff --git a/src/modules/app/app.js b/src/modules/app/app.js index aa797259c3..a285a5e956 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -103,7 +103,6 @@ 'app.ui', 'app.welcome', 'app.switch', - 'app.desktop', 'app.desktopUpdate', 'app.wallet', 'app.dex', diff --git a/src/modules/desktop/controllers/DesktopCtrl.js b/src/modules/desktop/controllers/DesktopCtrl.js deleted file mode 100644 index 9dcfa8dcfb..0000000000 --- a/src/modules/desktop/controllers/DesktopCtrl.js +++ /dev/null @@ -1,51 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {ModalManager} modalManager - * @param {*} $state - */ - const controller = function (modalManager, $state, Base, storage) { - - class DesktopCtrl extends Base { - - get openLinkViaDesktop() { - return this.openClientMode === 'desktop'; - } - - set openLinkViaDesktop(value) { - if (value) { - this.openClientMode = 'desktop'; - } else { - this.openClientMode = null; - } - storage.save('openClientMode', this.openClientMode); - } - - openClientMode = null; - - constructor() { - super(); - - storage.load('openClientMode').then(mode => { - this.openClientMode = mode; - }); - } - - showTutorialModals() { - return modalManager.showTutorialModals(); - } - - openMainPage() { - return $state.go('welcome'); - } - - } - - return new DesktopCtrl(); - }; - - controller.$inject = ['modalManager', '$state', 'Base', 'storage']; - - angular.module('app.desktop').controller('DesktopCtrl', controller); -})(); diff --git a/src/modules/desktop/desktop.js b/src/modules/desktop/desktop.js deleted file mode 100644 index cd6e285c4e..0000000000 --- a/src/modules/desktop/desktop.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.desktop', []); -})(); diff --git a/src/modules/desktop/less/desktop.less b/src/modules/desktop/less/desktop.less deleted file mode 100644 index b5938a49c0..0000000000 --- a/src/modules/desktop/less/desktop.less +++ /dev/null @@ -1,23 +0,0 @@ -@import (reference) "icons"; - -body.web.desktop { - .login-buttons { - display: none; - } -} - -.desktop-page { - &__icon { - width: 100%; - height: 209px; - background: @desktop-page-icon no-repeat center bottom; - } - - &__checkbox { - margin: 20px 0 30px; - - @media screen and (max-width: 480px) { - margin: 15px 0 20px; - } - } -} diff --git a/src/modules/desktop/less/electron.less b/src/modules/desktop/less/electron.less deleted file mode 100644 index 9687b3c2fa..0000000000 --- a/src/modules/desktop/less/electron.less +++ /dev/null @@ -1,201 +0,0 @@ -@import (reference) 'config'; -@import (reference) "icons"; -@import (reference) '../../app/less/typography'; - - -body.desktop:not(.web) { - w-web-only { - &:empty { - display: none; - } - } - - .import-modal__blocks-wrapper { - flex-direction: column; - max-width: @getStartedContentWidth; - margin: auto; - margin-top: 40px; - } - - .import-modal__block { - padding: 20px; - margin: 0 0 10px; - display: flex; - flex-direction: row; - } - - .import-modal__icon { - margin: 0; - width: 40px; - height: 40px; - } - - .import-modal__content { - text-align: left; - margin-left: 20px; - - &-title { - margin-bottom: 4px; - } - } - - ui-view[name="main"] { - display: flex; - flex-direction: column; - } - - .main-container { - min-height: calc(100vh ~'- 136px'); - - &-wrapper { - min-height: auto; - @media screen and (max-height: 768px) { - min-height: 700px; - } - } - } - - div.wrapper { - display: flex; - flex-direction: column; - background: @color-white; - } - - .section-contest { - display: none; - } - - .footer { - background: @color-info-50; - width: 100%; - - &__wrap { - display: flex; - flex-direction: row; - align-items: center; - padding: 20px; - color: @color-basic-500; - font-size: 13px; - } - - &__left { - margin-left: auto; - flex-direction: row-reverse; - display: flex; - align-items: center; - - &-item { - white-space: nowrap; - .footnote-1(); - color: @color-basic-500; - margin-left: 15px; - margin-bottom: 0; - } - } - - &-actions { - display: flex; - } - - &-action { - align-items: center; - display: inline-flex; - - &:not(:first-child) { - margin-left: 10px; - - &:before { - content: ''; - height: 14px; - width: 1px; - margin-right: 10px; - background: @color-basic-300; - } - } - } - - &-copyright { - white-space: nowrap; - .footnote-1(); - color: @color-basic-500; - margin-left: 15px; - margin-bottom: 0; - } - - .select .select__wrap .select__title { - background: transparent; - - &:after { - width: 10px; - height: 10px; - background: @select-arrow-icon; - } - } - - .lng-item span { - color: @color-basic-700; - } - } - - .section-welcome { - padding: 40px 0; - height: auto; - min-height: calc(~'100%' - 76px); - margin: auto; - display: flex; - - .dex-screenshot { - display: none; - } - - .left-side { - max-width: 600px; - display: flex; - flex-direction: column; - text-align: center; - align-items: center; - margin: auto; - } - - .welcome-text { - font-size: 38px; - } - - &__wrapper { - justify-content: center; - text-align: center; - } - } - - &.welcome { - .footer { - background: @color-white; - } - } - - .logo-header { - margin: auto; - } - - @media screen and (max-width: 1440px) { - .section-wrapper { - padding-left: 20px; - padding-right: 20px; - } - } -} - - - -body.desktopUpdate:not(.web) { - .main-container { - min-height: 100vh; - - &-wrapper { - min-height: auto; - @media screen and (max-height: 768px) { - min-height: 700px; - } - } - } -} \ No newline at end of file diff --git a/src/modules/desktop/templates/desktop.html b/src/modules/desktop/templates/desktop.html deleted file mode 100644 index b7b917b289..0000000000 --- a/src/modules/desktop/templates/desktop.html +++ /dev/null @@ -1,30 +0,0 @@ - -
- -
-
-
- -
- -

- -
- -
- - -
- - - - -
-
-
-
- - From 089e161f9622b52d3a693502b360af4bfa2e8d6c Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 25 Nov 2019 11:05:45 +0300 Subject: [PATCH 17/59] DEXW-2442: delete wallet page and module --- src/index.hbs | 17 - .../wallet/controllers/WalletHeaderCtrl.js | 9 - src/modules/wallet/modules/assets/assets.js | 5 - .../modules/assets/controllers/AssetsCtrl.js | 448 ------------ .../modules/assets/directives/asset/Asset.js | 68 -- .../assets/directives/asset/asset.html | 67 -- .../assets/directives/asset/asset.less | 232 ------ .../wallet/modules/assets/less/assets.less | 220 ------ .../assets/less/toaster-tokenomica.less | 129 ---- .../modules/assets/services/AssetsData.js | 60 -- .../modules/assets/templates/assets.html | 129 ---- .../leasing/controllers/LeasingCtrl.js | 191 ----- .../directives/leasingBlock/LeasingBlock.js | 35 - .../directives/leasingBlock/leasingBlock.html | 4 - .../directives/leasingBlock/leasingBlock.less | 43 -- src/modules/wallet/modules/leasing/leasing.js | 5 - .../wallet/modules/leasing/less/leasing.less | 170 ----- .../modules/leasing/templates/leasing.html | 77 -- .../portfolio/controllers/PortfolioCtrl.js | 452 ------------ .../directives/portfolioRow/PortfolioRow.js | 677 ------------------ .../portfolioRow/portfolio-row.less | 85 --- .../portfolio/directives/portfolioRow/row.hbs | 212 ------ .../modules/portfolio/less/portfolio.less | 110 --- .../wallet/modules/portfolio/portfolio.js | 5 - .../portfolio/templates/portfolio.html | 45 -- .../controllers/TransactionsCtrl.js | 187 ----- .../transactions/less/transactions.less | 60 -- .../services/TransactionsCsvGen.js | 150 ---- .../transactions/templates/transactions.html | 74 -- .../modules/transactions/transactions.js | 5 - src/modules/wallet/wallet.js | 11 - 31 files changed, 3982 deletions(-) delete mode 100644 src/modules/wallet/controllers/WalletHeaderCtrl.js delete mode 100644 src/modules/wallet/modules/assets/assets.js delete mode 100644 src/modules/wallet/modules/assets/controllers/AssetsCtrl.js delete mode 100644 src/modules/wallet/modules/assets/directives/asset/Asset.js delete mode 100644 src/modules/wallet/modules/assets/directives/asset/asset.html delete mode 100644 src/modules/wallet/modules/assets/directives/asset/asset.less delete mode 100644 src/modules/wallet/modules/assets/less/assets.less delete mode 100644 src/modules/wallet/modules/assets/less/toaster-tokenomica.less delete mode 100644 src/modules/wallet/modules/assets/services/AssetsData.js delete mode 100644 src/modules/wallet/modules/assets/templates/assets.html delete mode 100644 src/modules/wallet/modules/leasing/controllers/LeasingCtrl.js delete mode 100644 src/modules/wallet/modules/leasing/directives/leasingBlock/LeasingBlock.js delete mode 100644 src/modules/wallet/modules/leasing/directives/leasingBlock/leasingBlock.html delete mode 100644 src/modules/wallet/modules/leasing/directives/leasingBlock/leasingBlock.less delete mode 100644 src/modules/wallet/modules/leasing/leasing.js delete mode 100644 src/modules/wallet/modules/leasing/less/leasing.less delete mode 100644 src/modules/wallet/modules/leasing/templates/leasing.html delete mode 100644 src/modules/wallet/modules/portfolio/controllers/PortfolioCtrl.js delete mode 100644 src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js delete mode 100644 src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less delete mode 100644 src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs delete mode 100644 src/modules/wallet/modules/portfolio/less/portfolio.less delete mode 100644 src/modules/wallet/modules/portfolio/portfolio.js delete mode 100644 src/modules/wallet/modules/portfolio/templates/portfolio.html delete mode 100644 src/modules/wallet/modules/transactions/controllers/TransactionsCtrl.js delete mode 100644 src/modules/wallet/modules/transactions/less/transactions.less delete mode 100644 src/modules/wallet/modules/transactions/services/TransactionsCsvGen.js delete mode 100644 src/modules/wallet/modules/transactions/templates/transactions.html delete mode 100644 src/modules/wallet/modules/transactions/transactions.js delete mode 100644 src/modules/wallet/wallet.js diff --git a/src/index.hbs b/src/index.hbs index 8ee1714e30..8dc4a7231e 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -665,23 +665,6 @@ views: [{ name: 'main', templateUrl: 'modules/app/templates/main.html' }] }, children: [ - { - id: 'wallet', - data: { - views: [{ - name: 'mainContent', - noController: true, - template: '' - }], - redirectTo: 'main.wallet.assets' - }, - children: [ - { id: 'assets', data: { views: [{ name: 'content' }] } }, - { id: 'portfolio', data: { views: [{ name: 'content' }] } }, - { id: 'transactions', data: { views: [{ name: 'content' }] } }, - { id: 'leasing', data: { views: [{ name: 'content' }] } } - ] - }, { id: 'dex', data: { diff --git a/src/modules/wallet/controllers/WalletHeaderCtrl.js b/src/modules/wallet/controllers/WalletHeaderCtrl.js deleted file mode 100644 index c2989e08af..0000000000 --- a/src/modules/wallet/controllers/WalletHeaderCtrl.js +++ /dev/null @@ -1,9 +0,0 @@ -(function () { - 'use strict'; - - const controller = function () { - // TODO - }; - - angular.module('app.wallet').controller('WalletHeaderCtrl', controller); -})(); diff --git a/src/modules/wallet/modules/assets/assets.js b/src/modules/wallet/modules/assets/assets.js deleted file mode 100644 index 0fe1914fc0..0000000000 --- a/src/modules/wallet/modules/assets/assets.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.wallet.assets', []); -})(); diff --git a/src/modules/wallet/modules/assets/controllers/AssetsCtrl.js b/src/modules/wallet/modules/assets/controllers/AssetsCtrl.js deleted file mode 100644 index 89da48dd26..0000000000 --- a/src/modules/wallet/modules/assets/controllers/AssetsCtrl.js +++ /dev/null @@ -1,448 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {Waves} waves - * @param {AssetsData} assetsData - * @param {$rootScope.Scope} $scope - * @param {app.utils} utils - * @param {Base} Base - * @param {User} user - * @param {ModalManager} modalManager - * @param {IPollCreate} createPoll - * @param {BalanceWatcher} balanceWatcher - * @return {Assets} - */ - const controller = function ( - waves, - assetsData, - $scope, - utils, - Base, - user, - modalManager, - createPoll, - balanceWatcher, - storage - ) { - - const { date } = require('ts-utils'); - const ds = require('data-service'); - const analytics = require('@waves/event-sender'); - - - /** - * @class Assets - * @extends Base - */ - class Assets extends Base { - - - /** - * @type {string[]} - */ - pinnedAssetIdList = null; - /** - * @type {Money[]} - */ - pinnedAssetBalances = null; - - chartMode = null; - total = null; - - interval = null; - intervalCount = null; - - data = null; - options = assetsData.getGraphOptions(); - mirrorId = null; - - /** - * @type {boolean} - */ - invalid = true; - /** - * @type {Moment} - * @private - */ - _startDate = null; - /** - * @type {string} - */ - activeChartAssetId = null; - /** - * @type {Money} - */ - activeChartBalance = null; - /** - * @type {string[]} - */ - chartAssetIdList = null; - /** - * @type {Asset[]} - */ - chartAssetList = null; - /** - * @type {string} - */ - change = '0.00'; - /** - * @type {string} - */ - changePercent = '0.00'; - /** - * @type {boolean} - */ - advancedMode = false; - /** - * @type {string} - */ - theme = 'default'; - - dateToHours = date('hh:mm'); - dateToDates = date('DD/MM'); - - constructor() { - super($scope); - - storage.load('hideTokenomicaToast').then(() => { - // this.toastTokenomikaVisible = !flag; - this.toastTokenomikaVisible = false; // выключено на вермя миграции - }); - - this.options.axes.x.tickFormat = (date) => { - if (this.chartMode === 'hour' || this.chartMode === 'day') { - return this.dateToHours(date); - } else { - return this.dateToDates(date); - } - }; - - this.observe('activeChartAssetId', this._onChangeChartAssetId); - - this.syncSettings({ - activeChartAssetId: 'wallet.assets.activeChartAssetId', - chartAssetIdList: 'wallet.assets.chartAssetIdList', - chartMode: 'wallet.assets.chartMode', - pinnedAssetIdList: 'pinnedAssetIdList', - advancedMode: 'advancedMode', - theme: 'theme' - }); - - this.mirrorId = user.getSetting('baseAssetId'); - this._onChangeMode(); - - this.updateGraph = createPoll(this, this._getGraphData, 'data', 15000, { $scope }); - - this.theme = user.getSetting('theme'); - this._setChartOptions(); - - ds.api.assets.get(this.chartAssetIdList).then(assets => { - this.chartAssetList = assets; - utils.safeApply($scope); - }); - - balanceWatcher.ready.then(() => { - this.receive(balanceWatcher.change, this._updateBalances, this); - this._updateBalances(); - }); - - this.observe('chartMode', this._onChangeMode); - this.observe('_startDate', this._onChangeInterval); - this.observe('pinnedAssetIdList', this._updateBalances); - - this.observe(['interval', 'intervalCount', 'activeChartAssetId'], this._onChangeInterval); - this.observe('theme', this._onThemeChange); - } - - openScriptModal() { - return modalManager.showScriptModal(); - } - - openAnyTxModal() { - return modalManager.showAnyTx(null); - } - - abs(num) { - return Math.abs(num); - } - - onAssetActionClick(event, asset, action) { - event.preventDefault(); - if (action === 'send') { - return this.showSend(asset); - } - - if (action === 'info') { - return this.showAsset(asset); - } - - if (action === 'receive') { - return this.showReceivePopup(asset); - } - - throw new Error('Wrong action'); - } - - /** - * @param {Asset} asset - */ - unpin(asset) { - analytics.send({ name: 'Wallet Assets Unpin', params: { Currency: asset.id }, target: 'ui' }); - this.pinnedAssetIdList = this.pinnedAssetIdList.filter((fAsset) => fAsset !== asset.id); - } - - newAssetOnClick() { - modalManager.showPinAsset().then(({ selected }) => { - if (selected) { - $scope.$digest(); - } - }); - } - - showReceivePopup(asset) { - analytics.send({ - name: 'Wallet Assets Receive Click', - params: { Currency: asset ? asset.id : 'All' }, - target: 'ui' - }); - return modalManager.showReceiveModal(asset); - } - - showSeedBackupModals() { - return modalManager.showSeedBackupModal(); - } - - /** - * @param {Asset} asset - */ - showAsset(asset) { - return modalManager.showAssetInfo(asset); - } - - /** - * @param {Asset} asset - */ - showSend(asset) { - analytics.send({ - name: 'Wallet Assets Send Click', - params: { Currency: asset ? asset.id : 'All' }, - target: 'ui' - }); - return modalManager.showSendAsset({ assetId: asset && asset.id || null }); - } - - /** - * @param {Asset} asset - */ - showDeposit(asset) { - return modalManager.showDepositAsset(user, asset); - } - - /** - * @param {Asset} asset - */ - showSepa(asset) { - return modalManager.showSepaAsset(user, asset); - } - - onMouse(chartData) { - const id = chartData.id; - const { xValue, yValue } = chartData.point; - - const date = new Date(xValue.toNumber()); - this.chartEvent = { - ...chartData, - id, - price: yValue.toFormat(2), - date: Assets._localDate(date, true), - time: this.dateToHours(date) - }; - utils.safeApply($scope); - } - - /** - * @param value - * @private - */ - _onChangeChartAssetId({ value }) { - waves.node.assets.balance(value) - .then((asset) => { - this.activeChartBalance = asset; - }); - } - - /** - * @private - */ - _updateBalances() { - const hash = utils.toHash(balanceWatcher.getFullBalanceList(), 'asset.id'); - const balances = this.pinnedAssetIdList.reduce((acc, assetId) => { - return acc.then(list => { - if (hash[assetId]) { - list.push(hash[assetId]); - return list; - } - return balanceWatcher.getFullBalanceByAssetId(assetId).then(balance => { - list.push(balance); - return list; - }); - }); - }, Promise.resolve([])); - - balances.then(list => { - this.pinnedAssetBalances = list; - utils.safeApply($scope); - }); - } - - /** - * @private - */ - _onChangeInterval() { - this.updateGraph.restart(); - } - - /** - * @return {Promise} - * @private - */ - _getGraphData() { - const from = this.activeChartAssetId; - const to = this.mirrorId; - const precisionPromise = waves.node.assets.getAsset(this.mirrorId) - .then(({ precision }) => precision); - const valuesPromise = waves.utils.getRateHistory(from, to, this._startDate); - - return Promise.all([precisionPromise, valuesPromise]) - .then(([precision, values]) => { - const first = values[0].rate; - const last = values[values.length - 1].rate; - this.change = (last - first).toFixed(precision); - this.changePercent = ((last - first) / first * 100).toFixed(precision); - return ({ - rate: values - }); - }); - } - - /** - * @private - */ - _onChangeMode() { - switch (this.chartMode) { - case 'hour': - this._startDate = utils.moment() - .add() - .hour(-1); - break; - case 'day': - this._startDate = utils.moment() - .add() - .day(-1); - break; - case 'week': - this._startDate = utils.moment() - .add() - .day(-7); - break; - case 'month': - this._startDate = utils.moment() - .add() - .month(-1); - break; - case 'year': - this._startDate = utils.moment() - .add() - .year(-1); - break; - default: - throw new Error('Wrong chart mode!'); - } - } - - /** - * @private - */ - _onThemeChange() { - utils.wait(1000).then(() => this._setChartOptions()); - } - - /** - * @private - */ - _setChartOptions() { - this.chartOptions = - { - axisX: 'timestamp', - axisY: 'rate', - marginBottom: 46, - hasDates: true, - checkWidth: 2000, - heightFactor: 0.7, - view: { - rate: this._getViewOptions() - } - }; - } - - /** - * @return {{fillColor: string, gradientColor: string[], lineColor: string}} - * @private - */ - _getViewOptions() { - switch (this.theme) { - case 'black': - return ({ - lineColor: '#5a81ea', - fillColor: '#2d2d2d', - gradientColor: ['#334375', '#2d2d2d'], - lineWidth: 4 - }); - default: - return ({ - lineColor: '#1f5af6', - fillColor: '#fff', - gradientColor: ['#eaf0fe', '#fff'], - lineWidth: 4 - }); - } - } - - /** - * @param date @type {Date} - * @param hasYear @type {boolean} - * @return {string} - * @private - */ - static _localDate(date, hasYear = false) { - return hasYear ? tsUtils.date('DD.MM.YYYY')(date) : tsUtils.date('DD.MM')(date); - } - - hideTokenomicaToast() { - storage.save('hideTokenomicaToast', true).then(() => { - this.toastTokenomikaVisible = false; - }); - } - - } - - return new Assets(); - }; - - controller.$inject = [ - 'waves', - 'assetsData', - '$scope', - 'utils', - 'Base', - 'user', - 'modalManager', - 'createPoll', - 'balanceWatcher', - 'storage' - ]; - - angular.module('app.wallet.assets') - .controller('AssetsCtrl', controller); -})(); diff --git a/src/modules/wallet/modules/assets/directives/asset/Asset.js b/src/modules/wallet/modules/assets/directives/asset/Asset.js deleted file mode 100644 index c203fb941a..0000000000 --- a/src/modules/wallet/modules/assets/directives/asset/Asset.js +++ /dev/null @@ -1,68 +0,0 @@ -(function () { - 'use strict'; - - /** - * @return {Asset} - */ - const controller = function (Base, utils, createPoll, $scope) { - - class Asset extends Base { - - constructor() { - super($scope); - /** - * @type {IBalanceDetails} - */ - this.balance = null; - /** - * @type {number} - */ - this.rating = null; - } - - $postLink() { - const { isVerified, isGateway, isTokenomica } = utils.getDataFromOracles(this.balance.asset.id); - this.isVerified = isVerified; - this.isGateway = isGateway; - this.isTokenomica = isTokenomica; - if (!this.isGateway) { - createPoll(this, this._getTokenRating, this._setTokenRating, 60 * 1000); - } - } - - isUnpinned() { - return !WavesApp.ALWAYS_PINNED_ASSETS.includes(this.balance.asset.id); - } - - _getTokenRating() { - return ds.api.rating.getAssetsRating(this.balance.asset.id) - .then(assetList => assetList) - .catch(() => null); - } - - _setTokenRating(assetList) { - if (!assetList || assetList.length === 0) { - return null; - } - - this.rating = assetList[0].rating; - $scope.$apply(); - } - - } - - return new Asset(); - }; - - controller.$inject = ['Base', 'utils', 'createPoll', '$scope']; - - angular.module('app.wallet.assets').component('wAsset', { - bindings: { - balance: '<', - onClick: '&', - onUnpinClick: '&' - }, - templateUrl: 'modules/wallet/modules/assets/directives/asset/asset.html', - controller - }); -})(); diff --git a/src/modules/wallet/modules/assets/directives/asset/asset.html b/src/modules/wallet/modules/assets/directives/asset/asset.html deleted file mode 100644 index 3c4a893bd1..0000000000 --- a/src/modules/wallet/modules/assets/directives/asset/asset.html +++ /dev/null @@ -1,67 +0,0 @@ -
-
-
-
- -
-
- {{::$ctrl.balance.asset.name}} - -
- -
-
-
-
- -
-
-
-
-
-
-
-
- -
- -
-
-
-
- -
diff --git a/src/modules/wallet/modules/assets/directives/asset/asset.less b/src/modules/wallet/modules/assets/directives/asset/asset.less deleted file mode 100644 index 25c53045ca..0000000000 --- a/src/modules/wallet/modules/assets/directives/asset/asset.less +++ /dev/null @@ -1,232 +0,0 @@ -@import (reference) 'config'; -@import (reference) 'icons'; - -@asset-block-narrow: calc(~"25% - " @padding-main-layout); -@asset-block-wide: calc(~"33.3% - " @padding-main-layout); -@asset-block-wide50: calc(~"50% - " @padding-main-layout); -@asset-block-full: calc(~"100% - " @padding-main-layout); - -.asset { - &__wrapper { - display: flex; - align-items: center; - - @media screen and (max-width: 768px) { - flex-direction: row; - } - } -} - -.new-asset, -w-asset { - box-sizing: border-box; - min-height: 182px; - transition: all 0.3s; - box-shadow: @shadow-type-1; - flex-basis: @asset-block-narrow; - max-width: @asset-block-narrow; - @media screen and (max-width: 1300px) { - flex-basis: @asset-block-wide; - max-width: @asset-block-wide; - } - @media screen and (max-width: 1024px) { - flex-basis: @asset-block-wide50; - max-width: @asset-block-wide50; - } - @media screen and (max-width: 560px) { - flex-basis: @asset-block-full; - max-width: @asset-block-full; - } - - border-radius: @border-radius; - background-color: @color-white; - position: relative; - display: flex; - flex-direction: column; - padding: 20px; - margin: @padding-main-layout /2; - - &:hover { - transform: translate3d(0,-3px,0); - box-shadow: @shadow-main-hover; - z-index: 3; - } - - & > div { - display: flex; - flex-direction: column; - height: 100%; - } - - &:hover .settings { - display: flex; - } - - .hr { - border: none; - width: 100%; - margin: 0 0 8px 0; - border-bottom: 1px dashed @color-disabled-200; - } -} - -.new-asset { - cursor: pointer; - display: flex; - align-items: center; - justify-content: center; - - span { - display: inline-block; - width: 30px; - height: 30px; - background-image: @add-asset-icon; - background-position: left top; - background-repeat: no-repeat; - background-color: @color-white; - } - - &:hover { - span { - background-position: right top; - } - } -} - -.asset { - display: flex; - flex-direction: column; - width: 100%; - height: 108px; - - &__wrapper { - .rating-stars-wrapper { - margin-top: 8px; - } - } - - &__balance { - &-leasing { - cursor: pointer; - } - - w-balance > span { - word-wrap: break-word; - } - .decimal { - font-family: @font-roboto-light; - } - } - - &__name { - flex-grow: 0; - display: flex; - font-size: 15px; - } - - &__top { - display: flex; - align-items: center; - justify-content: space-between; - - .asset { - &__name { - font-weight: 500; - font-size: 17px; - flex-direction: row; - align-items: center; - cursor: pointer; - - span { - word-break: break-all; - } - } - } - } - - &__middle { - min-height: 82px; - - .asset__balance { - cursor: pointer; - padding-top: 15px; - font-size: 24px; - line-height: 28px; - } - } - - &__footer { - color: @color-basic-500; - display: flex; - white-space: nowrap; - flex-wrap: nowrap; - - .btn-icon { - display: inline-block; - margin-top: 10px; - margin-right: 20px; - cursor: pointer; - font-size: 15px; - transition: .3s; - - &:last-child { - svg { - transform: rotate(180deg); - } - } - - svg { - transition: .3s; - vertical-align: middle; - margin-right: 6px; - margin-top: -3px; - fill: @color-basic-500; - } - - &:hover { - color: @color-basic-700; - svg { - fill: @color-basic-700; - } - } - } - } -} - -.unpin { - width: 18px; - height: 30px; - cursor: pointer; - margin-left: 7px; - - &__icon { - display: inline-block; - width: 18px; - height: 18px; - background-image: @unpin-asset-icon; - background-repeat: no-repeat; - background-position: 0 0; - } - - &:hover & { - &__icon { - background-position: 100% 0; - } - } - - &__wrapper { - position: relative; - width: 100%; - height: 30px; - display: flex; - justify-content: center; - align-items: center; - - &:hover { - .tooltip_unpin { - visibility: visible; - } - } - } -} - diff --git a/src/modules/wallet/modules/assets/less/assets.less b/src/modules/wallet/modules/assets/less/assets.less deleted file mode 100644 index 78431d2645..0000000000 --- a/src/modules/wallet/modules/assets/less/assets.less +++ /dev/null @@ -1,220 +0,0 @@ -@import (reference) 'config'; -@import (reference) 'icons'; - -.main.wallet.assets { - .content { - overflow-x: hidden; - height: auto; - - .toolbar { - width: 100%; - position: relative; - height: 42px; - margin-bottom: 10px; - - .select__title-content { - height: 36px; - } - } - - .btn-json { - position: absolute; - right: 0; - width: 140px; - @media screen and (max-width: 480px) { - width: 60px; - font-size: 0; - } - } - - .assets-list { - width: calc(~"100% + " @padding-main-layout); - position: relative; - left: @padding-main-layout * -1 / 2; - margin: @padding-main-layout / 2 0 -@padding-main-layout / 2; - - .asset-logo__logo { - margin-right: 6px; - } - } - - .chart-rate { - box-sizing: border-box; - background-color: @color-white; - position: relative; - border-radius: 4px; - box-shadow: @shadow-type-1; - - .toggler { - display: none; - } - - .toolbar { - position: relative; - display: flex; - flex-direction: row; - justify-content: space-between; - margin: 0; - padding: 0 20px; - height: @assets-toolbar-height; - - &::after { - content: ''; - position: absolute; - margin: auto; - left: 20px; - right: 20px; - bottom: 0; - height: 1px; - background-color: @color-disabled-100; - } - } - - .chart-info { - min-height: 95px; - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - - & > div:not(:last-child) { - text-align: center; - margin-right: 42px; - padding-right: 42px; - border-right: 1px solid @color-disabled-100; - } - - h1 { - margin: 0 0 5px; - text-align: center; - font-weight: normal; - } - } - - .chart-wrapper { - height: 279px; - //padding: 0 10px; - } - .chart-tooltip { - background: @white-btn-bg; - box-shadow: @shadow-type-2; - } - } - - .assets-list { - display: flex; - flex-direction: row; - flex-wrap: wrap; - } - } - - .show-fader + .main-header__header { - padding-right: 24px; - } -} - -.chart-prices-toggle { - display: none; -} - -.toolbar-balance-select { - margin-top: 10px; - display: none; -} - -i.toggler { - width: 100%; - height: 28px; - background: @dropdown-icon center center no-repeat; - position: absolute; - bottom: 0; - left: 0; - display: block; - cursor: pointer; -} - -.assets-wrapper { - height: 100%; - min-height: 210px; -} - -@media screen and (max-width: 768px) { - .toolbar-balance-radio { - display: none; - } - - .toolbar-balance-select { - display: block; - } - - .main.wallet.assets { - .content .assets-list { - margin-bottom: 0; - } - - .content .toolbar { - width: 100%; - } - - .content .chart-rate { - height: auto; - padding-bottom: 28px; - - .toggler { - display: block; - } - - .chart-info, - .chart-wrapper { - display: none; - } - - &.active { - - .chart-info { - display: flex; - } - - .chart-wrapper { - display: block; - } - - .toggler { - transform: rotate(180deg); - } - } - - .chart-info { - - & > div:not(:last-child) { - margin-right: 10px; - padding-right: 10px; - border-right: 0 none; - } - - .tag-1 { - font-size: 11px; - } - - h1 { - white-space: nowrap; - font-size: 24px; - } - - .rate { - position: relative; - } - - .change { - display: none; - } - } - - } - } - - .assets-wrapper { - max-height: 100%; - overflow: visible; - } -} diff --git a/src/modules/wallet/modules/assets/less/toaster-tokenomica.less b/src/modules/wallet/modules/assets/less/toaster-tokenomica.less deleted file mode 100644 index 7be7854bf3..0000000000 --- a/src/modules/wallet/modules/assets/less/toaster-tokenomica.less +++ /dev/null @@ -1,129 +0,0 @@ -@import (reference) 'config'; -@import (reference) 'icons'; - -.toaster-tokenomica { - display: none; - position: fixed; - bottom: 0; - left: 0; - justify-content: space-between; - background: @color-black; - padding: 25px 32px; - width: 100%; - z-index: 5; - transform: translateY(0); - transition: transform 0.2s; - - &__link { - display: flex; - flex: 1 0; - justify-content: space-between; - align-items: center; - } - - &__logo { - background: @logo-tokenomica-icon center no-repeat; - background-size: 100%; - width: 184px; - height: 40px; - flex-shrink: 0; - margin-right: 16px; - } - - &__text { - font-size: 20px; - color: @color-white; - line-height: 18px; - } - - &__text-wrapper { - display: flex; - flex: 1 0; - justify-content: space-between; - align-items: center; - margin-left: 80px; - } - - &__button { - button { - border-radius: 0; - } - - .button__content { - font-size: 20px; - font-weight: bold; - } - } - - &__close { - display: flex; - align-items: center; - margin-left: 36px; - - &-icon { - background: @close-tokenomica-icon center no-repeat; - border: 0; - width: 16px; - height: 16px; - - &:hover { - opacity: .5; - } - } - } - - &.hidden-toaster { - transform: translateY(100%); - } - - @media screen and (max-width: 768px) { - padding: 24px; - border-radius: 16px 16px 0 0; - align-items: flex-start; - - &__link { - flex-direction: column; - align-items: flex-start; - } - - &__logo { - margin: 0 0 16px 0; - width: 109px; - height: 24px; - } - - &__text-wrapper { - flex-direction: column; - align-items: flex-start; - width: 100%; - margin-left: 0; - } - - &__text { - font-size: 14px; - margin: 0 0 16px 0; - line-height: 20px; - width: 100%; - } - - &__button { - width: 100%; - - .button { - width: 100%; - } - - .button__content { - font-size: 16px; - } - } - - &__close { - margin: -6px; - } - } -} - -.toaster_tokenomica_visible { - display: flex; -} \ No newline at end of file diff --git a/src/modules/wallet/modules/assets/services/AssetsData.js b/src/modules/wallet/modules/assets/services/AssetsData.js deleted file mode 100644 index e33e76c622..0000000000 --- a/src/modules/wallet/modules/assets/services/AssetsData.js +++ /dev/null @@ -1,60 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {User} user - * @param {app.utils.decorators} decorators - * @return {AssetsData} - */ - const factory = function (user, decorators) { - - class AssetsData { - - getGraphOptions() { - return { - grid: { - x: false, - y: false - }, - series: [ - { - dataset: 'values', - key: 'rate', - label: 'Rate', - color: '#5a81ea', - type: ['line', 'area'] - } - ], - axes: { - x: { - key: 'timestamp', - type: 'date', - ticks: 4 - }, - y: { - ticks: 4, - padding: { - max: 4 - } - } - } - }; - } - - @decorators.cachable(2) - _loadData() { - return ds.fetch('/api/assets-total/balance.json') - .then((r) => r.json()) - .then((data) => data.map((item) => ({ x: new Date(item.x), y: item.y }))); - } - - } - - return new AssetsData(); - }; - - factory.$inject = ['user', 'decorators', 'waves', 'utils']; - - angular.module('app.wallet.assets') - .factory('assetsData', factory); -})(); diff --git a/src/modules/wallet/modules/assets/templates/assets.html b/src/modules/wallet/modules/assets/templates/assets.html deleted file mode 100644 index d302b1a291..0000000000 --- a/src/modules/wallet/modules/assets/templates/assets.html +++ /dev/null @@ -1,129 +0,0 @@ -
- - - - - - - - - - - - - - - - -
- -
-
- -
-
- - - {{::asset.name}} - $ - - - - - - - {{::asset.name}} - - -
- -
- - - - - - - - - - - -
-
- - - -
-
-

- $  -

-
- -
-
-
-

{{$ctrl.change > 0 ? '+' : '-'}}$ {{$ctrl.abs($ctrl.change)}}

-
-  (USD) -
-
-
-

{{$ctrl.change > 0 ? '+' : '-'}}{{$ctrl.abs($ctrl.changePercent)}}%

-
-  (%) -
-
-
- -
- - -
-
$ {{$ctrl.chartEvent.price}}
-
- {{$ctrl.chartEvent.date}} - {{$ctrl.chartEvent.time}} -
-
-
-
- -
-
- -
- - -
- -
-
- - - -
diff --git a/src/modules/wallet/modules/leasing/controllers/LeasingCtrl.js b/src/modules/wallet/modules/leasing/controllers/LeasingCtrl.js deleted file mode 100644 index 78cc7a6698..0000000000 --- a/src/modules/wallet/modules/leasing/controllers/LeasingCtrl.js +++ /dev/null @@ -1,191 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param Base - * @param {$rootScope.Scope} $scope - * @param {app.utils} utils - * @param {Waves} waves - * @param {ModalManager} modalManager - * @param {IPollCreate} createPoll - * @param {BalanceWatcher} balanceWatcher - * @return {LeasingCtrl} - */ - const controller = function (Base, $scope, utils, waves, modalManager, createPoll, balanceWatcher) { - - const { pathEq } = require('ramda'); - - class LeasingCtrl extends Base { - - get pendingAllLeasing() { - return !this.pending && this.allActiveLeasing == null; - } - - /** - * @type {string} - */ - filter; - /** - * @type {ITransaction[]} - * @private - */ - _txList = null; - /** - * @type {ITransaction[]} - */ - allActiveLeasing = null; - /** - * @type {ITransaction[]} - */ - transactions = []; - /** - * @type {string} - */ - nodeListLink = ''; - - - constructor() { - super($scope); - - this.syncSettings({ filter: 'wallet.leasing.filter' }); - this.pending = true; - this.chartOptions = { - items: { - available: { - color: '#66bf00', - radius: 80 - }, - leased: { - color: '#ffebc0', - radius: 64 - }, - leasedIn: { - color: '#bacaf5', - radius: 75 - } - }, - center: 34, - direction: true, - startFrom: Math.PI / 2 - }; - - this.nodeListLink = WavesApp.network.nodeList; - - waves.node.transactions.getActiveLeasingTx().then((txList) => { - this.allActiveLeasing = txList; - $scope.$apply(); - }); - - createPoll(this, this._getTransactions, this._setTxList, 3000, { isBalance: true }); - - this.receive(balanceWatcher.change, this._updateLeasingData, this); - this.observe(['_txList', 'allActiveLeasing', 'filter'], this._currentLeasingList); - - this._updateLeasingData(); - } - - /** - * @return {object} - * @public - */ - startLeasing() { - return modalManager.showStartLeasing(); - } - - /** - * @private - */ - _getTransactions() { - return waves.node.transactions.list(500); - } - - /** - * @private - */ - _updateLeasingData() { - const waves = balanceWatcher.getFullBalanceList().find(pathEq(['asset', 'id'], 'WAVES')); - - if (!waves) { - return null; - } - - const { available, leasedOut, leasedIn } = waves; - - this.available = available; - this.leased = leasedOut; - this.leasedIn = leasedIn; - this.total = available.add(leasedOut); - - this.chartData = [ - { id: 'available', value: available }, - { id: 'leased', value: leasedOut }, - { id: 'leasedIn', value: leasedIn } - ]; - utils.safeApply($scope); - } - - /** - * @param {ITransaction[]} txList - * @private - */ - _setTxList(txList) { - const AVAILABLE_TYPES_HASH = { - [waves.node.transactions.TYPES.LEASE_IN]: true, - [waves.node.transactions.TYPES.LEASE_OUT]: true, - [waves.node.transactions.TYPES.CANCEL_LEASING]: true - }; - - this._txList = txList.filter(({ typeName }) => AVAILABLE_TYPES_HASH[typeName]); - $scope.$apply(); - } - - /** - * @private - */ - _currentLeasingList() { - const txList = this._txList; - const allActiveLeasing = this.allActiveLeasing; - - if (!txList) { - return null; - } - - this.pending = !txList.length && !allActiveLeasing; - - const idHash = utils.toHash(txList, 'id'); - const result = txList.slice(); - - if (allActiveLeasing && allActiveLeasing.length) { - allActiveLeasing.forEach((tx) => { - if (!idHash[tx.id]) { - result.push(tx); - } - }); - } - - this.transactions = result; - this._filterLeasingList(); - } - - /* - * @private - */ - _filterLeasingList() { - const filter = this.filter; - if (filter === 'active') { - this.transactions = this.transactions.filter(tx => tx.status === 'active'); - } else if (filter === 'canceled') { - this.transactions = this.transactions - .filter(tx => tx.status !== 'active' || tx.typeName === 'cancel-leasing'); - } - } - - } - - return new LeasingCtrl(); - }; - - controller.$inject = ['Base', '$scope', 'utils', 'waves', 'modalManager', 'createPoll', 'balanceWatcher']; - - angular.module('app.wallet.leasing').controller('LeasingCtrl', controller); -})(); diff --git a/src/modules/wallet/modules/leasing/directives/leasingBlock/LeasingBlock.js b/src/modules/wallet/modules/leasing/directives/leasingBlock/LeasingBlock.js deleted file mode 100644 index ae97a51118..0000000000 --- a/src/modules/wallet/modules/leasing/directives/leasingBlock/LeasingBlock.js +++ /dev/null @@ -1,35 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param Base - * @param {app.i18n} i18n - * @param $attrs - * @return {LeasingBlock} - */ - const controller = function (Base, i18n, $attrs, $element) { - - class LeasingBlock extends Base { - - constructor() { - super(); - this.titleLiteral = $attrs.titleLocale; - i18n.translateField(this, 'titleLiteral', 'title', i18n.getNs($element)); - } - - } - - return new LeasingBlock(); - }; - - controller.$inject = ['Base', 'i18n', '$attrs', '$element']; - - angular.module('app.wallet.leasing').component('wLeasingBlock', { - bindings: { - titleLocale: '@' - }, - templateUrl: 'modules/wallet/modules/leasing/directives/leasingBlock/leasingBlock.html', - transclude: true, - controller - }); -})(); diff --git a/src/modules/wallet/modules/leasing/directives/leasingBlock/leasingBlock.html b/src/modules/wallet/modules/leasing/directives/leasingBlock/leasingBlock.html deleted file mode 100644 index f2c54b7d0c..0000000000 --- a/src/modules/wallet/modules/leasing/directives/leasingBlock/leasingBlock.html +++ /dev/null @@ -1,4 +0,0 @@ -
-
{{::$ctrl.title}}
-
-
diff --git a/src/modules/wallet/modules/leasing/directives/leasingBlock/leasingBlock.less b/src/modules/wallet/modules/leasing/directives/leasingBlock/leasingBlock.less deleted file mode 100644 index 754141d35f..0000000000 --- a/src/modules/wallet/modules/leasing/directives/leasingBlock/leasingBlock.less +++ /dev/null @@ -1,43 +0,0 @@ -@import (reference) '../../../../../app/less/typography'; -@import (reference) 'config'; - -w-leasing-block { - display: block; - - .leasing-block { - display: block; - width: 100%; - border-radius: @border-radius; - background-color: @color-white; - box-shadow: @shadow-type-1; - - &__title { - height: 20px; - display: flex; - align-items: center; - padding: 0 20px; - z-index: 2; - position: relative; - color: @color-basic-900; - font-family: @font-roboto-medium; - } - - &__content { - padding: 0 20px 20px; - - .balance-container { - font-size: 28px; - line-height: 34px; - font-weight: normal; - - .int { - font-family: @font-roboto-regular; - } - - .decimal { - font-family: @font-roboto-light; - } - } - } - } -} diff --git a/src/modules/wallet/modules/leasing/leasing.js b/src/modules/wallet/modules/leasing/leasing.js deleted file mode 100644 index 3539133e60..0000000000 --- a/src/modules/wallet/modules/leasing/leasing.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.wallet.leasing', []); -})(); diff --git a/src/modules/wallet/modules/leasing/less/leasing.less b/src/modules/wallet/modules/leasing/less/leasing.less deleted file mode 100644 index cd9ca30052..0000000000 --- a/src/modules/wallet/modules/leasing/less/leasing.less +++ /dev/null @@ -1,170 +0,0 @@ -@import (reference) "../../../../app/less/app-icons"; -@import (reference) 'config'; -@import (reference) 'icons'; - -@leftPanelWidth: 330px; -@leftPanelRightMargin: 10px; - -.leasing-page { - display: flex; - flex-direction: row; - width: 100%; - height: 100%; - max-height: calc(~'100vh - 90px'); - - w-transaction { - .transaction { - padding-left: 10px; - } - } - - .left-panel { - height: 100%; - max-height: calc(~'100vh - 90px'); - overflow-y: auto; - width: @leftPanelWidth; - margin-right: @leftPanelRightMargin; - } - - .btn-wrap.btn-group { - justify-content: flex-start; - padding: 0; - align-items: center; - height: 42px; - } - - w-scroll-box { - border-radius: 0 0 @border-radius @border-radius; - height: calc(~'100vh - ' 130px); - display: flex; - flex-direction: column; - overflow: auto; - - .scroll-list { - height: 100%; - } - } - - .transaction-item > .date { - display: none; - } - - .transactions-container { - width: calc(~'100% - '@leftPanelWidth + @leftPanelRightMargin); - position: relative; - } - - .chart-wrapper { - display: flex; - width: 100%; - justify-content: center; - } - - .legend-container { - .legend-item { - position: relative; - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - padding-bottom: 10px; - - &:not(:first-child) { - margin-top: 10px; - } - - .part { - display: flex; - align-items: center; - - .legend-color { - width: 12px; - height: 12px; - border-radius: 100%; - } - } - - &::after { - content: ''; - position: absolute; - width: 100%; - bottom: 0; - height: 0; - border-bottom: 1px dashed @color-basic-200; - } - } - } - - .description-split { - margin: 30px 0; - height: 0; - border-bottom: 1px dashed @color-basic-100; - } - - .icon-description { - position: relative; - padding-left: 60px; - - &::before { - content: ''; - position: absolute; - left: 0; - top: 0; - width: 50px; - height: 48px; - background-image: @leasing-note-icon; - } - } -} - -@media screen and (max-width: @width-media-normal) { - .transaction-item .locale-address { - display: none; - } -} - -@media screen and (max-width: 768px) { - .leasing-page { - height: auto; - display: block; - overflow: visible; - - w-scroll-box { - margin-bottom: 10px; - min-height: 300px; - } - - .left-panel { - width: 100%; - max-height: 100%; - overflow-y: visible; - } - - .transactions-container { - width: 100%; - } - - w-transaction .transaction { - height: auto; - min-height: 74px; - } - } - - .expandable-block { - margin-bottom: 10px; - } -} - -@media screen and (max-height: 355px) { - .leasing-page { - max-height: 100%; - - .left-panel { - min-height: 263px; - } - - w-scroll-box { - min-height: 223px; - } - } -} diff --git a/src/modules/wallet/modules/leasing/templates/leasing.html b/src/modules/wallet/modules/leasing/templates/leasing.html deleted file mode 100644 index 145146abd2..0000000000 --- a/src/modules/wallet/modules/leasing/templates/leasing.html +++ /dev/null @@ -1,77 +0,0 @@ -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- -
-
- -
-
-
- - - - - -
-
- - -
-
-
-
-
- - - -
- -
-
-
- - - - - - - - - - - -
- -
- -
- -
-
-
-
-
diff --git a/src/modules/wallet/modules/portfolio/controllers/PortfolioCtrl.js b/src/modules/wallet/modules/portfolio/controllers/PortfolioCtrl.js deleted file mode 100644 index 3eda1d13d0..0000000000 --- a/src/modules/wallet/modules/portfolio/controllers/PortfolioCtrl.js +++ /dev/null @@ -1,452 +0,0 @@ -(function () { - 'use strict'; - - const { get } = require('ts-utils'); - - const { splitEvery, flatten } = require('ramda'); - - const searchByNameAndId = ($scope, key, list) => { - const query = $scope[key]; - if (!query) { - return list; - } - - return list.filter((item) => { - const name = get({ item }, 'item.asset.name'); - const id = get({ item }, 'item.asset.id'); - return String(name).toLowerCase().indexOf(query.toLowerCase()) !== -1 || String(id) === query; - }); - }; - - const ds = require('data-service'); - - /** - * @param {Base} Base - * @param {$rootScope.Scope} $scope - * @param {Waves} waves - * @param {app.utils} utils - * @param {ModalManager} modalManager - * @param {User} user - * @param {GatewayService} gatewayService - * @param {$state} $state - * @param {STService} stService - * @param {VisibleService} visibleService - * @param {BalanceWatcher} balanceWatcher - * @param {INotification} notification - * @return {PortfolioCtrl} - */ - const controller = function (Base, $scope, waves, utils, modalManager, user, - gatewayService, $state, - stService, visibleService, balanceWatcher, notification) { - - class PortfolioCtrl extends Base { - - constructor() { - super($scope); - /** - * @type {string} - */ - this.mirrorId = user.getSetting('baseAssetId'); - /** - * @type {Asset} - */ - this.mirror = null; - /** - * @type {string[]} - */ - this.pinned = []; - /** - * @type {string} - */ - this.address = user.address; - /** - * @type {Array} - */ - this.spam = []; - /** - * @type {PortfolioCtrl.IBalances} - */ - this.details = null; - /** - * @type {Array} - */ - this.balanceList = []; - /** - * @type {string} - */ - this.filter = null; - /** - * @type {Moment} - */ - this.chartStartDate = utils.moment().add().day(-7); - /** - * @type {boolean} - */ - this.pending = true; - /** - * @type {boolean} - */ - this.dontShowSpam = user.getSetting('dontShowSpam'); - - waves.node.assets.getAsset(this.mirrorId) - .then((mirror) => { - this.mirror = mirror; - /** - * @type {Array} - */ - this.tableHeaders = [ - { - id: 'name', - title: { literal: 'list.name' }, - valuePath: 'item.asset.name', - sort: true, - search: searchByNameAndId, - placeholder: 'portfolio.filter' - }, - { - id: 'balance', - title: { literal: 'list.balance' }, - valuePath: 'item.available', - sort: true - }, - { - id: 'inOrders', - title: { literal: 'list.inOrders' }, - valuePath: 'item.inOrders', - sort: true - }, - { - id: 'mirror', - title: { literal: 'list.mirror', params: { currency: mirror.displayName } } - }, - { - id: 'rate', - title: { literal: 'list.rate', params: { currency: mirror.displayName } } - }, - { - id: 'change24', - title: { literal: 'list.change' } - }, - { - id: 'controls' - } - ]; - - $scope.$digest(); - }); - - this.syncSettings({ - pinned: 'pinnedAssetIdList', - spam: 'wallet.portfolio.spam', - filter: 'wallet.portfolio.filter', - dontShowSpam: 'dontShowSpam' - }); - - balanceWatcher.ready - .then(() => { - const onChange = () => { - this._updateBalances(); - visibleService.updateSort(); - }; - - this.receive(balanceWatcher.change, onChange); - this.receive(utils.observe(user, 'scam'), onChange); - this.observe(['pinned', 'spam', 'dontShowSpam'], onChange); - - this._updateBalances(); - }); - - balanceWatcher.ready.then(() => { - this.pending = false; - this.observe('details', this._onChangeDetails); - this.observe('filter', this._onChangeDetails); - - // this._onChangeDetails(); - utils.safeApply($scope); - }); - - this.receive(stService.sort, () => { - visibleService.updateSort(); - }); - - waves.node.assets.getNft(1).then(list => { - if (list.length) { - const id = `n-${Date.now()}`; - notification.info({ - id, - ns: 'app.wallet.portfolio', - title: { - literal: 'hasNftToken', - params: { address: user.address } - } - }, -1); - this.signals.destroy.once(() => { - notification.remove(id); - }); - } - }); - } - - /** - * @param {Asset} asset - */ - showAsset(asset) { - modalManager.showAssetInfo(asset); - } - - /** - * @param {Asset} asset - */ - showSend(asset) { - return modalManager.showSendAsset({ assetId: asset && asset.id }); - } - - /** - * @param {Asset} asset - */ - showReceivePopup(asset) { - return modalManager.showReceiveModal(asset); - } - - /** - * @param {Asset} asset - */ - showDeposit(asset) { - return modalManager.showDepositAsset(user, asset); - } - - /** - * @param {Asset} asset - */ - showSepa(asset) { - return modalManager.showSepaAsset(user, asset); - } - - showBurn(assetId) { - return modalManager.showBurnModal(assetId); - } - - showReissue(assetId) { - return modalManager.showReissueModal(assetId); - } - - canShowDex(balance) { - return balance.isPinned || - balance.asset.isMyAsset || - balance.asset.id === WavesApp.defaultAssets.WAVES || - gatewayService.getPurchasableWithCards()[balance.asset.id] || - gatewayService.getCryptocurrencies()[balance.asset.id] || - gatewayService.getFiats()[balance.asset.id]; - } - - /** - * @param {Asset} asset - */ - openDex(asset) { - $state.go('main.dex', this.getSrefParams(asset)); - } - - /** - * @param {Asset} asset - */ - getSrefParams(asset) { - utils.openDex(asset.id); - } - - /** - * @param {Asset} asset - * @param {boolean} [state] - */ - togglePin(asset, state) { - user.togglePinAsset(asset.id, state); - this.poll.restart(); - } - - /** - * @param {Asset} asset - * @param {boolean} [state] - */ - toggleSpam(asset, state) { - user.toggleSpamAsset(asset.id, state); - this.poll.restart(); - } - - isDepositSupported(asset) { - const isWaves = asset.id === WavesApp.defaultAssets.WAVES; - - return gatewayService.hasSupportOf(asset, 'deposit') || isWaves; - } - - isSepaSupported(asset) { - return gatewayService.hasSupportOf(asset, 'sepa'); - } - - /** - * @private - */ - _onChangeDetails() { - const details = this.details; - let balanceList; - - switch (this.filter) { - case 'active': - balanceList = details.active.slice(); - break; - case 'pinned': - balanceList = details.pinned.slice(); - break; - case 'spam': - balanceList = details.spam.slice(); - break; - case 'my': - balanceList = details.my.slice(); - break; - case 'verified': - balanceList = details.verified.slice(); - break; - default: - throw new Error('Wrong filter name!'); - } - - this.balanceList = balanceList; - } - - _addRating(balanceList) { - return Promise.all(splitEvery(25, balanceList).map(block => { - return ds.api.rating.getAssetsRating(block.map(balanceItem => balanceItem.asset.id)); - })).then(list => { - const listHash = utils.toHash(flatten(list), 'assetId'); - return balanceList.map(balanceItem => { - balanceItem.rating = listHash[balanceItem.asset.id] ? - listHash[balanceItem.asset.id].rating : - null; - return balanceItem; - }); - }) - .catch(() => { - return balanceList; - }); - } - - /** - * @private - */ - _updateBalances() { - const balanceList = balanceWatcher.getFullBalanceList(); - - this._addRating(balanceList).then(balanceListWithRating => { - this.details = balanceListWithRating - .map(item => { - const isPinned = this._isPinned(item.asset.id); - const isSpam = this._isSpam(item.asset.id); - const isOnScamList = user.scam[item.asset.id]; - return { - available: item.available, - asset: item.asset, - inOrders: item.inOrders, - isPinned, - isSpam, - isOnScamList, - rating: item.rating || null, - minSponsoredAssetFee: item.asset.minSponsoredAssetFee, - sponsorBalance: item.asset.sponsorBalance, - leasedOut: item.leasedOut - }; - }) - .reduce((acc, item) => { - const oracleData = ds.dataManager.getOraclesAssetData(item.asset.id); - const spam = item.isOnScamList || item.isSpam; - - if (oracleData && oracleData.status > 0) { - acc.verified.push(item); - } - - if (spam) { - if (!this.dontShowSpam) { - if (item.asset.sender === user.address) { - acc.my.push(item); - } - acc.spam.push(item); - acc.active.push(item); - } - } else { - if (item.asset.sender === user.address) { - acc.my.push(item); - } - acc.active.push(item); - } - - return acc; - }, { spam: [], my: [], active: [], verified: [] }); - - - utils.safeApply($scope); - }); - } - - /** - * @param assetId - * @return {boolean} - * @private - */ - _isPinned(assetId) { - return this.pinned.includes(assetId); - } - - /** - * @param assetId - * @return {boolean} - * @private - */ - _isSpam(assetId) { - return this.spam.includes(assetId); - } - - } - - return new PortfolioCtrl(); - }; - - controller.$inject = [ - 'Base', - '$scope', - 'waves', - 'utils', - 'modalManager', - 'user', - 'gatewayService', - '$state', - 'stService', - 'visibleService', - 'balanceWatcher', - 'notification' - ]; - - angular.module('app.wallet.portfolio') - .controller('PortfolioCtrl', controller); -})(); - -/** - * @name PortfolioCtrl - */ - -/** - * @typedef {object} PortfolioCtrl#IPortfolioBalanceDetails - * @property {boolean} isPinned - * @property {boolean} isSpam - * @property {boolean} isOnScamList - * @property {Asset} asset - * @property {Money} available - * @property {Money} inOrders - * @property {Money|void} minSponsoredAssetFee - * @property {Money|void} sponsorBalance - */ - -/** - * @typedef {object} PortfolioCtrl#IBalances - * @property {Array} active - * @property {Array} pinned // TODO when available assets store - * @property {Array} spam - * @property {Array} my - * @property {Array} verified - */ diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js b/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js deleted file mode 100644 index 38c94ad37c..0000000000 --- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js +++ /dev/null @@ -1,677 +0,0 @@ -(function () { - 'use strict'; - - const Handlebars = require('handlebars'); - const { STATUS_LIST } = require('@waves/oracle-data'); - const { path } = require('ramda'); - const { SIGN_TYPE } = require('@waves/signature-adapter'); - const analytics = require('@waves/event-sender'); - const { BigNumber } = require('@waves/bignumber'); - - const TEMPLATE_PATH = 'modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs'; - const SELECTORS = { - AVAILABLE: 'js-balance-available', - SPONSORED: 'js-sponsored-asset', - IN_RESERVED: 'js-balance-in-reserved', - BASE_ASSET_BALANCE: 'js-balance-in-base-asset', - EXCHANGE_RATE: 'js-exchange-rate', - CHANGE_24: 'js-change-24', - CHART_CONTAINER: 'js-chart-container', - STARS_CONTAINER: 'js-stars-container', - BUTTONS: { - SEND: 'js-button-send', - RECEIVE: 'js-button-receive', - DEX: 'js-button-open-in-dex', - TOGGLE_SPAM: 'js-button-toggle-spam' - }, - ACTION_BUTTONS: { - ASSET_INFO: 'js-action-button-asset-info', - SEND: 'js-action-button-send', - RECEIVE: 'js-action-button-receive', - BURN: 'js-action-button-burn', - REISSUE: 'js-action-button-reissue', - DEX: 'js-action-button-dex', - TOGGLE_SPAM: 'js-action-button-toggle-spam', - SPONSORSHIP_CREATE: 'js-action-button-sponsorship_create', - SPONSORSHIP_EDIT: 'js-action-button-sponsorship_edit', - SPONSORSHIP_STOP: 'js-action-button-cancel-sponsorship', - SET_ASSET_SCRIPT: 'js-action-button-set-asset-script' - }, - SUSPICIOUS_LABEL: 'js-suspicious-label' - }; - - const i18next = require('i18next'); - const ds = require('data-service'); - /** - * @param Base - * @param {$rootScope.Scope} $scope - * @return {PortfolioRow} - */ - const controller = function (Base, - $templateRequest, - $element, - utils, - waves, - user, - modalManager, - $state, - ChartFactory, - RatingStarsFactory, - i18n, - $scope, - gatewayService, - createPoll) { - - class PortfolioRow extends Base { - - /** - * @type {typeof ChartFactory} - */ - ChartFactory = null; - /** - * @type {$state} - */ - $state = null; - /** - * @type {$rootScope.Scope} - */ - $scope = null; - /** - * @type {app.i18n} - */ - i18n = null; - /** - * @type {ModalManager} - */ - modalManager = null; - /** - * @type {JQuery} - */ - $node = null; - /** - * @type {HTMLElement} - */ - node = null; - /** - * @type {PortfolioCtrl.IPortfolioBalanceDetails} - */ - balance = null; - /** - * @type {app.utils} - */ - utils = null; - /** - * @type {Waves} - */ - waves = null; - /** - * @type {User} - */ - user = null; - /** - * @type {boolean} - */ - canShowDex = null; - /** - * @type {gatewayService} - */ - gatewayService = null; - /** - * @param {IPollCreate} createPoll - */ - createPoll = null; - /** - * @type {boolean} - */ - isSmart = false; - /** - * @type {boolean} - * @private - */ - _isMyAsset = false; - /** - * @type {Function} - */ - changeLanguageHandler = () => this._onChangeLanguage(); - - - constructor() { - super(); - this.ChartFactory = ChartFactory; - this.$state = $state; - this.$scope = $scope; - this.i18n = i18n; - this.modalManager = modalManager; - this.$node = $element; - this.node = $element.get(0); - this.utils = utils; - this.waves = waves; - this.user = user; - this.gatewayService = gatewayService; - this.createPoll = createPoll; - - if (!PortfolioRow.templatePromise) { - PortfolioRow.templatePromise = $templateRequest(TEMPLATE_PATH) - .then((html) => Handlebars.compile(html)); - } - - this.chartOptions = { - axisX: 'timestamp', - axisY: 'rate', - view: { - rate: { - lineColor: 'rgba(90, 129, 234)', - fillColor: 'rgba(90, 129, 234, .3)', - lineWidth: 1 - } - } - }; - } - - $postLink() { - this._isWaves = this.balance.asset.id === WavesApp.defaultAssets.WAVES; - this._isMyAsset = this.balance.asset.sender === this.user.address; - this.canShowDex = this._getCanShowDex(); - const canStopSponsored = this._getCanStopSponsored(); - - Promise.all([ - this.waves.node.getFeeList({ type: SIGN_TYPE.TRANSFER }), - PortfolioRow.templatePromise - ]).then(([list, template]) => { - - let balance = this.balance; - - this.isSmart = balance.asset.hasScript; - const firstAssetChar = this.balance.asset.name.slice(0, 1); - const canPayFee = list.find(item => item.asset.id === this.balance.asset.id) && !this._isWaves; - const { - isVerified, isGateway, - isTokenomica, logo, isGatewaySoon - } = utils.getDataFromOracles(this.balance.asset.id); - - this.isGateway = isGateway; - this.isWEST = this.balance.asset.id === WavesApp.defaultAssets.WEST; - - this.isVerifiedOrGateway = isVerified || isGateway; - - const html = template({ - canSetAssetScript: this._isMyAsset && this.isSmart, - isSmart: this.isSmart, - isVerified: this.isVerified, - isGateway: isGateway, - isTokenomica: isTokenomica, - isWEST: this.isWEST, - isGatewaySoon: isGatewaySoon, - assetIconPath: logo || - this.utils.getAssetLogo(this.balance.asset.id), - firstAssetChar, - canBurn: !this._isWaves, - canReissue: this._isMyAsset && this.balance.asset.reissuable, - charColor: this.utils.getAssetLogoBackground(this.balance.asset.id), - assetName: this.balance.asset.name, - SELECTORS: { ...SELECTORS }, - canShowDex: this.canShowDex, - canShowToggleSpam: this._canShowToggleSpam(), - canSponsored: this._isMyAsset, - canPayFee, - canStopSponsored - }); - - this.node.innerHTML = html; - - Object.defineProperty(this, 'balance', { - get: () => balance, - set: (value) => { - if (this.balance.asset.id !== value.asset.id || - !this.balance.available.getTokens().eq(value.available.getTokens()) || - !this.balance.inOrders.getTokens().eq(value.inOrders.getTokens()) || - this.balance.isOnScamList !== value.isOnScamList - ) { - balance = value; - this._onUpdateBalance(); - } - // TODO Optimize this - this._initSponsorShips(); - } - }); - /** - * @type {Poll} - * @private - */ - this._poll = createPoll(this, this._initSponsorShips, angular.noop, 5000); - this._onUpdateBalance(); - this._setHandlers(); - this.changeLanguageHandler(); - }); - } - - $onDestroy() { - super.$onDestroy(); - this.$node.off(); - } - - /** - * @private - */ - _onChangeLanguage() { - const nodeList = this.node.querySelectorAll('[w-i18n-literal]'); - this._updateBalances(); - - Array.prototype.forEach.call(nodeList, element => { - element.innerHTML = this.i18n.translate( - element.getAttribute('w-i18n-literal'), - 'app.wallet.portfolio'); - }); - } - - /** - * @return {boolean} - * @private - */ - _getCanStopSponsored() { - return this._isMyAsset && ds.utils.getTransferFeeList() - .find(item => item.asset.id === this.balance.asset.id); - } - - /** - * @return {boolean} - * @private - */ - _getCanShowDex() { - const statusPath = ['assets', this.balance.asset.id, 'status']; - const isAssetLockedInDex = utils.isLockedInDex(this.balance.asset.id); - return !isAssetLockedInDex && - (this.balance.isPinned || - this._isMyAsset || - this.balance.asset.isMyAsset || - this.balance.asset.id === WavesApp.defaultAssets.WAVES || - this.gatewayService.getPurchasableWithCards()[this.balance.asset.id] || - this.gatewayService.getCryptocurrencies()[this.balance.asset.id] || - this.gatewayService.getFiats()[this.balance.asset.id] || - path(statusPath, ds.dataManager.getOracleData('oracleWaves')) === STATUS_LIST.VERIFIED); - - } - - /** - * @private - */ - _onUpdateBalance() { - this._updateBalances(); - this._initSpamState(); - - const balance = this.balance; - - if (balance.isOnScamList) { - this.node.querySelector(`.${SELECTORS.CHANGE_24}`).innerHTML = '—'; - this.node.querySelector(`.${SELECTORS.BASE_ASSET_BALANCE}`).innerHTML = '—'; - this.node.querySelector(`.${SELECTORS.EXCHANGE_RATE}`).innerHTML = '—'; - this.node.querySelector(`.${SELECTORS.SUSPICIOUS_LABEL}`).classList.remove('hidden'); - - return null; - } - - const suspiciousSelector = this.node.querySelector(`.${SELECTORS.SUSPICIOUS_LABEL}`); - if (suspiciousSelector) { - suspiciousSelector.classList.add('hidden'); - } - - const baseAssetId = this.user.getSetting('baseAssetId'); - const change24Node = this.node.querySelector(`.${SELECTORS.CHANGE_24}`); - - if (baseAssetId === balance.asset.id) { - change24Node.innerHTML = '—'; - change24Node.classList.remove('minus'); - change24Node.classList.remove('plus'); - } else { - const baseChange24AssetId = WavesApp.defaultAssets.WAVES === balance.asset.id ? - baseAssetId : - WavesApp.defaultAssets.WAVES; - this.waves.utils.getChange(balance.asset.id, baseChange24AssetId) - .then(change24 => { - const change24BN = new BigNumber(change24); - const isMoreZero = change24BN.gt(0); - const isLessZero = change24BN.lt(0); - change24Node.classList.toggle('minus', isLessZero); - change24Node.classList.toggle('plus', isMoreZero); - change24Node.innerHTML = `${change24.toFixed(2)}%`; - }, () => { - change24Node.innerHTML = '0.00%'; - }); - } - - if (baseAssetId === balance.asset.id) { - this.node.querySelector(`.${SELECTORS.EXCHANGE_RATE}`).innerHTML = '—'; - this.node.querySelector(`.${SELECTORS.BASE_ASSET_BALANCE}`).innerHTML = '—'; - } else { - this.waves.utils.getRate(balance.asset.id, baseAssetId) - .then(rate => { - const baseAssetBalance = balance.available.getTokens().mul(rate).toFormat(2); - this.node.querySelector(`.${SELECTORS.EXCHANGE_RATE}`).innerHTML = rate.toFixed(2); - this.node.querySelector(`.${SELECTORS.BASE_ASSET_BALANCE}`).innerHTML = baseAssetBalance; - }) - .catch(() => null); - - const startDate = this.utils.moment().add().day(-7); - this.waves.utils.getRateHistory(balance.asset.id, baseAssetId, startDate).then(values => { - const chartData = { - rate: values.map(item => ({ ...item, rate: Number(item.rate.toFixed()) })) - }; - this.chart = new this.ChartFactory( - this.$node.find(`.${SELECTORS.CHART_CONTAINER}`), - this.chartOptions, - chartData - ); - }).catch(() => null); - - const hasRate = balance.rating !== null; - - if (hasRate && !this.isGateway && balance.asset.id !== WavesApp.defaultAssets.WAVES) { - new RatingStarsFactory({ - $container: this.$node.find(`.${SELECTORS.STARS_CONTAINER}`), - rating: balance.rating, - size: 's' - }); - } - } - - } - - /** - * @private - */ - _initActions() { - let expanded = false; - - const $wrapper = this.$node.find('.actions__container'); - - const toggleExpanded = () => { - expanded = !expanded; - const conteiner = this.$node.find('.actions__container'); - const conteinerNode = conteiner.get(0); - conteiner.toggleClass('expanded', expanded); - - if (expanded) { - $(document).on('mousedown', _handler); - const dropDownPosition = conteinerNode.getBoundingClientRect(); - const bodyPosition = document.body.getBoundingClientRect(); - conteinerNode.classList.toggle('to-up', dropDownPosition.bottom > bodyPosition.bottom); - return; - } - - $(document).off('mousedown', _handler); - conteinerNode.classList.remove('to-up'); - }; - - const _handler = e => { - if ($(e.target).closest($wrapper).length === 0) { - toggleExpanded(); - } - }; - - this.$node.find('.actions__click').on('click', () => { - toggleExpanded(); - }); - - this.$scope.$on('$destroy', () => { - $(document).off('mousedown', _handler); - }); - } - - /** - * @private - */ - _setHandlers() { - this._initActions(); - - this.listenEventEmitter(i18next, 'languageChanged', this.changeLanguageHandler); - - this.$node.on('click', `.${SELECTORS.BUTTONS.SEND}`, () => { - analytics.send({ - name: 'Transfer Click', - params: { Currency: this.balance.asset.id }, - target: 'ui' - }); - this.modalManager.showSendAsset({ assetId: this.balance.asset.id }); - }); - - this.$node.on('click', `.${SELECTORS.BUTTONS.DEX}`, () => { - analytics.send({ - name: 'Wallet Portfolio Open in DEX Click', - params: { Currency: this.balance.asset.id }, - target: 'ui' - }); - this.$state.go('main.dex', this._getSrefParams(this.balance.asset)); - }); - - this.$node.on('click', `.${SELECTORS.BUTTONS.RECEIVE}`, () => { - analytics.send({ - name: 'Transfer Click', - params: { Currency: this.balance.asset.id }, - target: 'ui' - }); - this.modalManager.showReceiveModal(this.balance.asset); - }); - - this.$node.on('click', `.${SELECTORS.BUTTONS.TOGGLE_SPAM}`, () => { - this.user.toggleSpamAsset(this.balance.asset.id); - this._initSpamState(); - }); - - this.$node.on('click', `.${SELECTORS.ACTION_BUTTONS.ASSET_INFO}`, () => { - this.modalManager.showAssetInfo(this.balance.asset); - }); - - this.$node.on('click', `.${SELECTORS.ACTION_BUTTONS.SEND}`, () => { - analytics.send({ - name: 'Transfer Click', - params: { Currency: this.balance.asset.id }, - target: 'ui' - }); - this.modalManager.showSendAsset({ assetId: this.balance.asset.id }); - }); - - this.$node.on('click', `.${SELECTORS.ACTION_BUTTONS.RECEIVE}`, () => { - analytics.send({ - name: 'Transfer Click', - params: { Currency: this.balance.asset.id }, - target: 'ui' - }); - this.modalManager.showReceiveModal(this.balance.asset); - }); - - this.$node.on('click', `.${SELECTORS.ACTION_BUTTONS.BURN}`, () => { - analytics.send({ - name: 'Burn Token Click', - params: { Currency: this.balance.asset.id }, - target: 'ui' - }); - this.modalManager.showBurnModal(this.balance.asset.id); - }); - - this.$node.on('click', `.${SELECTORS.ACTION_BUTTONS.REISSUE}`, () => { - analytics.send({ - name: 'Reissue Token Click', - params: { Currency: this.balance.asset.id }, - target: 'ui' - }); - this.modalManager.showReissueModal(this.balance.asset.id); - }); - - this.$node.on('click', `.${SELECTORS.ACTION_BUTTONS.DEX}`, () => { - analytics.send({ - name: 'Wallet Portfolio Open in DEX Click', - params: { Currency: this.balance.asset.id }, - target: 'ui' - }); - this.$state.go('main.dex', this._getSrefParams(this.balance.asset)); - }); - - this.$node.on('click', `.${SELECTORS.ACTION_BUTTONS.SPONSORSHIP_CREATE}`, () => { - analytics.send({ - name: 'Enable Sponsorship Click', - params: { Currency: this.balance.asset.id }, - target: 'ui' - }); - this.modalManager.showSponsorshipModal(this.balance.asset.id); - }); - - this.$node.on('click', `.${SELECTORS.ACTION_BUTTONS.SET_ASSET_SCRIPT}`, () => { - analytics.send({ - name: 'Update Script Click', - params: { Currency: this.balance.asset.id }, - target: 'ui' - }); - this.modalManager.showSetAssetScriptModal(this.balance.asset.id); - }); - - this.$node.on('click', `.${SELECTORS.ACTION_BUTTONS.SPONSORSHIP_EDIT}`, () => { - analytics.send({ - name: 'Change Sponsorship Click', - params: { Currency: this.balance.asset.id }, - target: 'ui' - }); - this.modalManager.showSponsorshipModal(this.balance.asset.id, true); - }); - - this.$node.on('click', `.${SELECTORS.ACTION_BUTTONS.SPONSORSHIP_STOP}`, () => { - analytics.send({ - name: 'Disable Sponsorship Click', - params: { Currency: this.balance.asset.id }, - target: 'ui' - }); - this.modalManager.showSponsorshipStopModal(this.balance.asset.id); - }); - - this.$node.on('click', `.${SELECTORS.ACTION_BUTTONS.TOGGLE_SPAM}`, () => { - this.user.toggleSpamAsset(this.balance.asset.id); - this._initSpamState(); - }); - } - - /** - * @private - */ - _initSpamState() { - if (!this._canShowToggleSpam()) { - return null; - } - - const spam = this.user.getSetting('wallet.portfolio.spam') || []; - const isSpam = spam.includes(this.balance.asset.id); - - const elements = [ - this.node.querySelector(`.${SELECTORS.BUTTONS.TOGGLE_SPAM}`), - this.node.querySelector(`.${SELECTORS.ACTION_BUTTONS.TOGGLE_SPAM}`) - ]; - elements.forEach(toggleSpam => { - if (toggleSpam) { - toggleSpam.classList.toggle('icon-hide', !isSpam); - toggleSpam.classList.toggle('icon-show', isSpam); - } - }); - } - - /** - * @param list - * @private - */ - _initSponsorShips(list) { - const canStopSponsored = !!this._getCanStopSponsored(); - const canSponsored = !!this._isMyAsset; - const isSmart = this.isSmart; - - const btnCreate = this.node.querySelector(`.${SELECTORS.ACTION_BUTTONS.SPONSORSHIP_CREATE}`); - const btnEdit = this.node.querySelector(`.${SELECTORS.ACTION_BUTTONS.SPONSORSHIP_EDIT}`); - const btnStop = this.node.querySelector(`.${SELECTORS.ACTION_BUTTONS.SPONSORSHIP_STOP}`); - const icon = this.node.querySelector(`.${SELECTORS.SPONSORED} .asset-logo__marker`); - - btnCreate.classList.toggle('hidden', isSmart || !(canSponsored && !canStopSponsored)); - btnEdit.classList.toggle('hidden', !(canSponsored && canStopSponsored)); - btnStop.classList.toggle('hidden', isSmart || !canStopSponsored); - - Promise.resolve(list || this.waves.node.getFeeList({ type: SIGN_TYPE.TRANSFER })) - .then((list) => { - const canPayFee = list.find(item => item.asset.id === this.balance.asset.id) && !this._isWaves; - icon.classList.toggle('asset-logo__marker_sponsored', !!canPayFee); - }); - } - - /** - * @param {Asset} asset - * @private - */ - _getSrefParams(asset) { - this.utils.openDex(asset.id); - - } - - /** - * @private - */ - _updateBalances() { - const asset = this.balance.asset; - const available = this.balance.available.getTokens(); - const inOrders = this.balance.inOrders.getTokens(); - const leasedOut = this.balance.leasedOut.getTokens(); - const availableHtml = this.utils.getNiceNumberTemplate(available, asset.precision, true); - const inReservedHtml = this.utils.getNiceNumberTemplate(inOrders.add(leasedOut), asset.precision); - this.node.querySelector(`.${SELECTORS.AVAILABLE}`).innerHTML = availableHtml; - this.node.querySelector(`.${SELECTORS.IN_RESERVED}`).innerHTML = inReservedHtml; - } - - /** - * @returns {boolean} - * @private - */ - _canShowToggleSpam() { - if (this._isMyAsset) { - return false; - } - - return !this.isVerifiedOrGateway && !this.user.scam[this.balance.asset.id]; - } - - } - - return new PortfolioRow($templateRequest, - $element, - utils, - waves, - user, - modalManager, - $state, - ChartFactory, - RatingStarsFactory, - i18n, - $scope, - gatewayService, - createPoll); - }; - - controller.$inject = [ - 'Base', - '$templateRequest', - '$element', - 'utils', - 'waves', - 'user', - 'modalManager', - '$state', - 'ChartFactory', - 'RatingStarsFactory', - 'i18n', - '$scope', - 'gatewayService', - 'createPoll' - ]; - - angular.module('app.wallet.portfolio').component('wPortfolioRow', { - controller, - bindings: { - balance: '<', - canShowDex: '<' - }, - scope: false - }); - -})(); diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less b/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less deleted file mode 100644 index b19b718608..0000000000 --- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/portfolio-row.less +++ /dev/null @@ -1,85 +0,0 @@ -@import (reference) 'config'; - -w-portfolio-row { - display: flex; - width: 100%; - - .asset { - &__logo { - position: relative; - left: 0; - } - - &__marker { - display: none; - position: absolute; - bottom: calc(50% ~'- 16px'); - - &_smart, - &_sponsored { - display: block; - } - } - &__marker { - display: none; - } - } - - .spam & &__marker { - background-color: @color-basic-200 !important; - } - - .spam & .asset__marker { - background-color: @color-basic-200 !important; - } - - .smart-table { - &__chart-wrap { - .cell { - position: relative; - width: 84px; - padding-right: 10px; - float: right; - - .chart-asset-rate { - position: absolute; - bottom: 0; - width: 84px; - height: 25px; - opacity: .3; - right: 0; - } - } - } - } - - .actions__wrapper { - .action-item { - &.icon-hide { - .unspam { - display: none; - } - } - - &.icon-show { - .tospam { - display: none; - } - } - } - } - - .spam & { - color: @color-basic-500; - } -} - -.spam { - w-portfolio-row { - .asset-logo { - &__logo, &__marker { - background-color: @color-basic-200 !important; - } - } - } -} diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs b/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs deleted file mode 100644 index 4618eb16f4..0000000000 --- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs +++ /dev/null @@ -1,212 +0,0 @@ -
-
- {{#if assetIconPath}} - - {{else}} - - {{/if}} -
-
-
{{assetName}}
- {{#if isVerified}} - - {{/if}} - {{#if isGateway}} - - {{/if}} - {{#if isTokenomica}} - - {{/if}} - {{#if isGatewaySoon}} - - {{/if}} - -
-
-
-
-
-
-
-
-
- {{assetName}} -
-
-
-
- - {{#if isVerified}} - - {{/if}} -
-
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
-
- -
-
-
-
- - - - - - - - - - - - - - - {{#if canShowDex}} - - - - - - - {{/if}} - {{#if canShowToggleSpam}} - - - - - - - - - - - {{/if}} - -
-
-
-
-
-
-
-
-
-
-
- -
- -
- -
- -
- -
- -
- - {{#if canBurn}} -
- -
- {{/if}} - - {{#if canReissue}} -
- -
- {{/if}} - -
- -
- -
- -
- -
- -
- - {{#if canSetAssetScript}} -
- -
- {{/if}} - - {{#if canShowDex}} -
- -
- {{/if}} - - {{#if canShowToggleSpam}} -
- - -
- {{/if}} -
-
-
-
-
-
diff --git a/src/modules/wallet/modules/portfolio/less/portfolio.less b/src/modules/wallet/modules/portfolio/less/portfolio.less deleted file mode 100644 index b5edc4b8e2..0000000000 --- a/src/modules/wallet/modules/portfolio/less/portfolio.less +++ /dev/null @@ -1,110 +0,0 @@ -@import (reference) "../../../../app/less/app-icons"; -@import (reference) '../../../../app/less/typography'; -@import (reference) '../../../../ui/directives/smartTable/less/smart-table'; -@import (reference) 'config'; -@import (reference) 'icons'; - -.main.wallet.portfolio { - .w-visible { - flex-wrap: wrap; - @media screen and (min-width: 769px) { - height: 65px !important; - } - } - - .mobiles-only { - display: none; - } - - .portfolio-wrapper { - display: flex; - flex-direction: column; - height: 100%; - - .smart-table__cell:first-child { - padding-left: 10px; - - @media screen and (max-width: 768px) { - padding-left: 0; - } - } - } - - .toolbar { - position: relative; - display: flex; - flex-direction: row; - margin-bottom: 10px; - } - - .btn-icon { - font-family: @font-roboto-medium; - } - - .part { - display: inline-block; - } -} - -//tablet -@media screen and (min-width: 660px) and (max-width: 768px) { - body { - &.portfolio { - .portfolio-list { - w-scroll-box { - min-height: calc(100vh ~'- 130px'); - max-height: 100%; - } - } - } - } -} - -//mobile -@media screen and (max-width: 769px) { - .portfolio-wrapper { - padding: 10px 0 10px 10px; - - .smart-table__row .smart-table__cell { - border: 0; - } - } - - .main.wallet.portfolio { - .mobile-flex { - display: flex; - align-items: center; - } - - .asset__text-mobile { - .js-stars-container { - margin-left: 6px; - margin-top: 2px; - } - } - - .asset__text { - .js-stars-container { - display: none; - } - } - - .asset__wrapper-desktop { - display: none; - } - - .mobiles-only { - display: flex; - align-items: center; - font-family: @font-roboto-regular; - } - - .main-content .content { - padding: 0; - } - - .toolbar { - width: calc(100% ~'- 10px'); - } - } -} diff --git a/src/modules/wallet/modules/portfolio/portfolio.js b/src/modules/wallet/modules/portfolio/portfolio.js deleted file mode 100644 index e013d2b5ef..0000000000 --- a/src/modules/wallet/modules/portfolio/portfolio.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.wallet.portfolio', []); -})(); diff --git a/src/modules/wallet/modules/portfolio/templates/portfolio.html b/src/modules/wallet/modules/portfolio/templates/portfolio.html deleted file mode 100644 index 60f39ffda9..0000000000 --- a/src/modules/wallet/modules/portfolio/templates/portfolio.html +++ /dev/null @@ -1,45 +0,0 @@ -
- -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - -
diff --git a/src/modules/wallet/modules/transactions/controllers/TransactionsCtrl.js b/src/modules/wallet/modules/transactions/controllers/TransactionsCtrl.js deleted file mode 100644 index 81b90f8a6f..0000000000 --- a/src/modules/wallet/modules/transactions/controllers/TransactionsCtrl.js +++ /dev/null @@ -1,187 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {User} user - * @param Base - * @param {$rootScope.Scope} $scope - * @param {TransactionsCsvGen} transactionsCsvGen - * @param {Waves} waves - * @param {IPollCreate} createPoll - * @param {INotification} notification - * @return {TransactionsCtrl} - */ - const controller = function (user, Base, $scope, transactionsCsvGen, waves, createPoll, notification) { - - const analytics = require('@waves/event-sender'); - - class TransactionsCtrl extends Base { - - constructor() { - super($scope); - /** - * @type {ITransaction[]} - */ - this.transactions = []; - /** - * @type {boolean} - */ - this.pending = true; - /** - * @type {string} - */ - this.filter = null; - /** - * @type {ITransaction[]} - * @private - */ - this.txList = []; - /** - * @type {number} - */ - this.limit = 100; - - this.observe(['filter'], this._sendAnalytics); - - this.syncSettings({ filter: 'wallet.transactions.filter' }); - - const poll = createPoll(this, this._getTxList, this._setTxList, 4000, { isBalance: true }); - - this.observe(['txList', 'filter'], this._applyTransactionList); - this.observe('limit', () => poll.restart()); - } - - exportTransactions(maxTransactions = 10000) { - // analytics.push('TransactionsPage', `TransactionsPage.CSV.${WavesApp.type}`, 'download'); - analytics.send({ name: 'Transactions Export Click', target: 'ui' }); - const MAX_LIMIT = 1000; - - const getSeriesTransactions = async ({ allTransactions = [], after = '' } = {}) => { - let transactions; - let downloadError = false; - - try { - transactions = await waves.node.transactions.list(MAX_LIMIT, after); - } catch (e) { - downloadError = true; - if (!allTransactions.length) { - notification.error({ - ns: 'app.wallet.transactions', - title: { literal: 'errors.download.title' }, - body: { literal: 'errors.download.body' } - }); - return []; - } - - transactions = []; - notification.error({ - ns: 'app.wallet.transactions', - title: { literal: 'errors.complete.title' }, - body: { literal: 'errors.complete.body' } - }); - - } - - if (user.getSetting('dontShowSpam')) { - transactions = transactions.filter(el => !user.scam[el.assetId]); - } - allTransactions = allTransactions.concat(transactions); - - if (transactions.length < MAX_LIMIT || allTransactions.length > maxTransactions) { - return { allTransactions, downloadError }; - } else { - return getSeriesTransactions({ - allTransactions, - after: transactions[transactions.length - 1].id - }); - } - }; - - const promiseGetTransactions = getSeriesTransactions(); - promiseGetTransactions.then(({ allTransactions, downloadError }) => { - if (allTransactions.length) { - transactionsCsvGen.generate(allTransactions); - } else if (!downloadError) { - notification.error({ - ns: 'app.wallet.transactions', - title: { literal: 'errors.empty.title' }, - body: { literal: 'errors.empty.body' } - }); - } - }); - return promiseGetTransactions; - } - - _getTxList() { - return waves.node.transactions.list(this.limit); - } - - /** - * @private - */ - _applyTransactionList() { - const filter = this.filter; - const list = this.txList; - const availableTypes = filter.split(',') - .map((type) => type.trim()) - .reduce((result, type) => { - result[type] = true; - return result; - }, Object.create(null)); - - if (filter === 'all') { - this.transactions = list.slice(); - } else { - this.transactions = list.filter(({ typeName }) => availableTypes[typeName]); - } - } - - /** - * @private - */ - _sendAnalytics() { - let actionName; - switch (this.filter) { - case 'all': - actionName = 'Transactions All Show'; - break; - case 'send,mass-send': - actionName = 'Transactions Sent Show'; - break; - case 'receive,mass-receive,sponsorship-fee': - actionName = 'Transactions Received Show'; - break; - case 'exchange-buy,exchange-sell': - actionName = 'Transactions Exchanged Show'; - break; - case 'lease-in,lease-out,cancel-leasing': - actionName = 'Transactions Leased Show'; - break; - case 'issue,reissue,burn,sponsorship-stop,sponsorship-start': - actionName = 'Transactions Issued Show'; - break; - default: - break; - } - analytics.send({ name: actionName, target: 'ui' }); - } - - /** - * @param {ITransaction[]} transactions - * @private - */ - _setTxList(transactions) { - this.pending = false; - this.txList = transactions; - $scope.$digest(); - } - - } - - return new TransactionsCtrl(); - }; - - controller.$inject = ['user', 'Base', '$scope', 'transactionsCsvGen', 'waves', 'createPoll', 'notification']; - - angular.module('app.wallet.transactions').controller('TransactionsCtrl', controller); -})(); diff --git a/src/modules/wallet/modules/transactions/less/transactions.less b/src/modules/wallet/modules/transactions/less/transactions.less deleted file mode 100644 index ab1cd830e3..0000000000 --- a/src/modules/wallet/modules/transactions/less/transactions.less +++ /dev/null @@ -1,60 +0,0 @@ -@import (reference) 'config'; -@import (reference) 'icons'; - -.transactions { - - w-radio-wrap { - flex-grow: 1; - } - - .transactions-content { - display: flex; - flex-direction: column; - height: 100%; - - .controls { - display: flex; - flex-direction: row; - justify-content: space-between; - min-height: 42px; - margin-bottom: 10px; - z-index: 1; - background: @app-background; - - .btn-wrap.btn-group { - justify-content: flex-start; - padding: 0; - align-items: center; - height: 42px; - } - } - } - - button.download { - flex-grow: 0; - } -} - -@media screen and (max-width: 1024px) { - .transactions { - w-radio-wrap.split-mode { - display: none; - } - - w-button { - & > *.interface svg { - margin-left: 0; - margin-right: 0; - } - button.download { - width: 42px; - height: 42px; - padding: 0; - background-position: center; - span { - display: none; - } - } - } - } -} diff --git a/src/modules/wallet/modules/transactions/services/TransactionsCsvGen.js b/src/modules/wallet/modules/transactions/services/TransactionsCsvGen.js deleted file mode 100644 index 68a93c3602..0000000000 --- a/src/modules/wallet/modules/transactions/services/TransactionsCsvGen.js +++ /dev/null @@ -1,150 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {app.i18n} i18n - * @param {app.utils} utils - * @returns {TransactionsCsvGen} - */ - const factory = function (i18n, utils) { - - const Papa = require('papaparse'); - - const HEADERS = [ - { name: 'csv.date', id: 'timestamp' }, - { name: 'csv.id', id: 'id' }, - { name: 'csv.type', id: 'typeName' }, - { name: 'csv.transactionType', id: 'type' }, - { name: 'csv.price.ticker', id: 'priceTicker' }, - { name: 'csv.price.name', id: 'priceName' }, - { name: 'csv.price.value', id: 'priceValue' }, - { name: 'csv.price.id', id: 'priceId' }, - { name: 'csv.amount.ticker', id: 'amountTicker' }, - { name: 'csv.amount.name', id: 'amountName' }, - { name: 'csv.amount.value', id: 'amountValue' }, - { name: 'csv.amount.id', id: 'amountId' }, - { name: 'csv.fee.ticker', id: 'feeTicker' }, - { name: 'csv.fee.name', id: 'feeName' }, - { name: 'csv.fee.value', id: 'feeValue' }, - { name: 'csv.fee.id', id: 'feeId' }, - { name: 'csv.sender', id: 'sender' }, - { name: 'csv.recipient', id: 'recipient' }, - { name: 'csv.attachment', id: 'attachment' }, - { name: 'csv.height', id: 'height' }, - { name: 'csv.alias', id: 'alias' }, - { name: 'csv.description', id: 'description' }, - { name: 'csv.name', id: 'name' }, - { name: 'csv.reissuable.name', id: 'reissuable' }, - { name: 'csv.precision', id: 'precision' } - ]; - - const NS = 'app.wallet.transactions'; - - class TransactionsCsvGen { - - generate(transactionList) { - const fileName = 'transactions.csv'; - - const fields = HEADERS.map((item) => i18n.translate(item.name, NS)); - /* eslint complexity: ["off"] */ - const data = transactionList.map((tx) => HEADERS.map((header) => { - const id = header.id; - const value = tx[id]; - - try { - switch (id) { - case 'timestamp': - return value && utils.moment(value).format('DD.MM.YYYY hh:mm:ss') || value; - case 'reissuable': - return value != null && i18n.translate(`csv.reissuable.${value}`, NS) || value; - case 'priceTicker': - return tx.price && tx.price.asset.ticker || ''; - case 'priceName': - return tx.price && tx.price.asset.name || ''; - case 'priceValue': - return tx.price && tx.price.toFormat() || ''; - case 'priceId': - return tx.price && tx.price.asset.id || ''; - case 'amountTicker': - return tx.amount && tx.amount.asset.ticker || ''; - case 'amountName': - return tx.amount && tx.amount.asset.name || ''; - case 'amountValue': - return tx.amount && tx.amount.toFormat() || ''; - case 'amountId': - return tx.amount && tx.amount.asset.id || ''; - case 'feeTicker': - return tx.fee && tx.fee.asset.ticker || ''; - case 'feeName': - return tx.fee && tx.fee.asset.name || ''; - case 'feeValue': - return tx.fee && tx.fee.toFormat() || ''; - case 'feeId': - return tx.fee && tx.fee.asset.id || ''; - default: - return value == null ? '' : String(value); - } - } catch (e) { - return ''; - } - })); - - const csv = Papa.unparse({ - fields, - data - }); - - if (WavesApp.isDesktop()) { - transfer('download', { - fileContent: csv, - fileName: fileName - }); - } else { - TransactionsCsvGen._download(csv, fileName); - } - } - - /** - * @param {string} csv - * @param {string} name - * @private - */ - static _download(csv, name) { - if (window.navigator && typeof window.navigator.msSaveOrOpenBlob === 'function') { - this._downloadInMsEdge(csv, name); - } else { - const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' }); - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.setAttribute('href', url); - link.setAttribute('download', name); - link.setAttribute('target', '_blank'); - link.style.position = 'absolute'; - link.style.opacity = '0'; - document.body.appendChild(link); - link.click(); - requestAnimationFrame(() => { - document.body.removeChild(link); - }); - } - } - - /** - * @param {string} csv - * @param {string} name - * @private - */ - static _downloadInMsEdge(csv, name) { - const blob = new Blob([csv], { type: 'text/csv' }); - window.navigator.msSaveOrOpenBlob(blob, name); - } - - } - - return new TransactionsCsvGen(); - }; - - factory.$inject = ['i18n', 'utils']; - - angular.module('app.wallet.transactions').factory('transactionsCsvGen', factory); -})(); diff --git a/src/modules/wallet/modules/transactions/templates/transactions.html b/src/modules/wallet/modules/transactions/templates/transactions.html deleted file mode 100644 index 32a29e3123..0000000000 --- a/src/modules/wallet/modules/transactions/templates/transactions.html +++ /dev/null @@ -1,74 +0,0 @@ -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
diff --git a/src/modules/wallet/modules/transactions/transactions.js b/src/modules/wallet/modules/transactions/transactions.js deleted file mode 100644 index b3f67ab9a3..0000000000 --- a/src/modules/wallet/modules/transactions/transactions.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.wallet.transactions', []); -})(); diff --git a/src/modules/wallet/wallet.js b/src/modules/wallet/wallet.js deleted file mode 100644 index 8a461583ca..0000000000 --- a/src/modules/wallet/wallet.js +++ /dev/null @@ -1,11 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.wallet', [ - 'app.wallet.assets', - 'app.wallet.portfolio', - 'app.wallet.transactions', - 'app.wallet.leasing' - ]); - -})(); From 8daf8bf5bf64098e74c4ca0ad5a8b17fd4ae02ec Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 25 Nov 2019 11:08:59 +0300 Subject: [PATCH 18/59] DEXW-2442: delete wallet module --- src/modules/app/app.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/app/app.js b/src/modules/app/app.js index a285a5e956..f501dd354f 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -104,7 +104,6 @@ 'app.welcome', 'app.switch', 'app.desktopUpdate', - 'app.wallet', 'app.dex', 'app.tokens', 'app.unavailable', From 17ff08106cc5ce7dc671492c2390de72a66aad92 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 25 Nov 2019 11:18:54 +0300 Subject: [PATCH 19/59] DEXW-2442: delete dex, dex-demo page and module --- src/index.hbs | 18 - src/modules/app/app.js | 1 - src/modules/dex/controllers/DexCtrl.js | 286 ----- src/modules/dex/dex.js | 5 - .../dex/directives/createOrder/CreateOrder.js | 1057 ----------------- .../directives/createOrder/createOrder.html | 277 ----- .../directives/createOrder/createOrder.less | 406 ------- .../directives/createOrder/expiration.less | 50 - .../dex/directives/dexBlock/DexBlock.js | 109 -- .../dex/directives/dexBlock/dexBlock.html | 28 - .../dex/directives/dexBlock/dexBlock.less | 78 -- .../dexCandleChart/DexCandleChart.js | 314 ----- .../dexCandleChart/dex-candle-chart.html | 15 - .../dexCandleChart/dexCandleChart.less | 46 - .../dex/directives/dexMyOrders/DexMyOrders.js | 613 ---------- .../dexMyOrders/header-control-cell.html | 10 - .../dex/directives/dexMyOrders/myOrders.html | 106 -- .../dex/directives/dexMyOrders/myOrders.less | 141 --- .../dexMyOrders/order-status-bar.less | 112 -- .../directives/dexWatchlist/DexWatchlist.html | 114 -- .../directives/dexWatchlist/DexWatchlist.less | 226 ---- .../dexWatchlist/FavouritesColumnHeader.html | 6 - .../dex/directives/dexWatchlist/WatchList.js | 867 -------------- .../layout/DexLayoutSideBarToggle.html | 9 - .../layout/DexLayoutSideBarToggle.js | 42 - src/modules/dex/directives/layout/layout.html | 36 - src/modules/dex/directives/layout/layout.js | 222 ---- .../directives/layout/less/dex-layout.less | 319 ----- .../less/dex-layout__column_candlechart.less | 78 -- .../less/dex-layout__column_createorder.less | 240 ---- .../less/dex-layout__column_orderbook.less | 244 ---- .../less/dex-layout__column_tradehistory.less | 167 --- .../less/dex-layout__column_watchlist.less | 143 --- .../layout/less/tradehistory-fullscreen.less | 60 - .../dex/directives/myBalance/MyBalance.js | 215 ---- .../myBalance/header-control-cell.html | 3 - .../dex/directives/myBalance/myBalance.html | 51 - .../dex/directives/myBalance/myBalance.less | 14 - .../dex/directives/orderBook/OrderBook.js | 465 -------- .../dex/directives/orderBook/OrderList.js | 166 --- .../dex/directives/orderBook/OrderListItem.js | 257 ---- .../dex/directives/orderBook/orderBook.html | 35 - .../dex/directives/orderBook/orderBook.less | 47 - .../dex/directives/tradeGraph/TradeGraph.js | 379 ------ .../dex/directives/tradeGraph/tradeGraph.html | 20 - .../dex/directives/tradeGraph/tradeGraph.less | 34 - .../directives/tradeHistory/TradeHistory.js | 261 ---- .../directives/tradeHistory/tradeHistory.html | 52 - .../directives/tradeHistory/tradeHistory.less | 22 - src/modules/dex/less/dex.less | 325 ----- src/modules/dex/services/CandlesService.js | 194 --- src/modules/dex/services/DexDataService.js | 38 - src/modules/dex/services/SymbolInfoService.js | 86 -- src/modules/dex/templates/dex.html | 48 - 54 files changed, 9157 deletions(-) delete mode 100644 src/modules/dex/controllers/DexCtrl.js delete mode 100644 src/modules/dex/dex.js delete mode 100644 src/modules/dex/directives/createOrder/CreateOrder.js delete mode 100644 src/modules/dex/directives/createOrder/createOrder.html delete mode 100644 src/modules/dex/directives/createOrder/createOrder.less delete mode 100644 src/modules/dex/directives/createOrder/expiration.less delete mode 100644 src/modules/dex/directives/dexBlock/DexBlock.js delete mode 100644 src/modules/dex/directives/dexBlock/dexBlock.html delete mode 100644 src/modules/dex/directives/dexBlock/dexBlock.less delete mode 100644 src/modules/dex/directives/dexCandleChart/DexCandleChart.js delete mode 100644 src/modules/dex/directives/dexCandleChart/dex-candle-chart.html delete mode 100644 src/modules/dex/directives/dexCandleChart/dexCandleChart.less delete mode 100644 src/modules/dex/directives/dexMyOrders/DexMyOrders.js delete mode 100644 src/modules/dex/directives/dexMyOrders/header-control-cell.html delete mode 100644 src/modules/dex/directives/dexMyOrders/myOrders.html delete mode 100644 src/modules/dex/directives/dexMyOrders/myOrders.less delete mode 100644 src/modules/dex/directives/dexMyOrders/order-status-bar.less delete mode 100644 src/modules/dex/directives/dexWatchlist/DexWatchlist.html delete mode 100644 src/modules/dex/directives/dexWatchlist/DexWatchlist.less delete mode 100644 src/modules/dex/directives/dexWatchlist/FavouritesColumnHeader.html delete mode 100644 src/modules/dex/directives/dexWatchlist/WatchList.js delete mode 100644 src/modules/dex/directives/layout/DexLayoutSideBarToggle.html delete mode 100644 src/modules/dex/directives/layout/DexLayoutSideBarToggle.js delete mode 100644 src/modules/dex/directives/layout/layout.html delete mode 100644 src/modules/dex/directives/layout/layout.js delete mode 100644 src/modules/dex/directives/layout/less/dex-layout.less delete mode 100644 src/modules/dex/directives/layout/less/dex-layout__column_candlechart.less delete mode 100644 src/modules/dex/directives/layout/less/dex-layout__column_createorder.less delete mode 100644 src/modules/dex/directives/layout/less/dex-layout__column_orderbook.less delete mode 100644 src/modules/dex/directives/layout/less/dex-layout__column_tradehistory.less delete mode 100644 src/modules/dex/directives/layout/less/dex-layout__column_watchlist.less delete mode 100644 src/modules/dex/directives/layout/less/tradehistory-fullscreen.less delete mode 100644 src/modules/dex/directives/myBalance/MyBalance.js delete mode 100644 src/modules/dex/directives/myBalance/header-control-cell.html delete mode 100644 src/modules/dex/directives/myBalance/myBalance.html delete mode 100644 src/modules/dex/directives/myBalance/myBalance.less delete mode 100644 src/modules/dex/directives/orderBook/OrderBook.js delete mode 100644 src/modules/dex/directives/orderBook/OrderList.js delete mode 100644 src/modules/dex/directives/orderBook/OrderListItem.js delete mode 100644 src/modules/dex/directives/orderBook/orderBook.html delete mode 100644 src/modules/dex/directives/orderBook/orderBook.less delete mode 100644 src/modules/dex/directives/tradeGraph/TradeGraph.js delete mode 100644 src/modules/dex/directives/tradeGraph/tradeGraph.html delete mode 100644 src/modules/dex/directives/tradeGraph/tradeGraph.less delete mode 100644 src/modules/dex/directives/tradeHistory/TradeHistory.js delete mode 100644 src/modules/dex/directives/tradeHistory/tradeHistory.html delete mode 100644 src/modules/dex/directives/tradeHistory/tradeHistory.less delete mode 100644 src/modules/dex/less/dex.less delete mode 100644 src/modules/dex/services/CandlesService.js delete mode 100644 src/modules/dex/services/DexDataService.js delete mode 100644 src/modules/dex/services/SymbolInfoService.js delete mode 100644 src/modules/dex/templates/dex.html diff --git a/src/index.hbs b/src/index.hbs index 8dc4a7231e..e590aa11b2 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -665,24 +665,6 @@ views: [{ name: 'main', templateUrl: 'modules/app/templates/main.html' }] }, children: [ - { - id: 'dex', - data: { - url: '/dex?assetId1&assetId2', - reloadOnSearch: false, - views: [{ name: 'mainContent' }] - } - }, - { - id: 'dex-demo', - data: { - noLogin: true, - controller: 'Dex', - url: '/dex-demo?assetId1&assetId2', - reloadOnSearch: false, - views: [{ name: 'mainContent', templateUrl: 'modules/dex/templates/dex.html' }] - } - }, { id: 'tokens', data: { diff --git a/src/modules/app/app.js b/src/modules/app/app.js index f501dd354f..0053e4b3c3 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -104,7 +104,6 @@ 'app.welcome', 'app.switch', 'app.desktopUpdate', - 'app.dex', 'app.tokens', 'app.unavailable', 'app.stand', diff --git a/src/modules/dex/controllers/DexCtrl.js b/src/modules/dex/controllers/DexCtrl.js deleted file mode 100644 index 82ad6288cf..0000000000 --- a/src/modules/dex/controllers/DexCtrl.js +++ /dev/null @@ -1,286 +0,0 @@ -(function () { - 'use strict'; - - const ds = require('data-service'); - - /** - * @param {Base} Base - * @param {JQuery} $element - * @param {$state} $state - * @param {$location} $location - * @param {User} user - * @param {$rootScope.Scope} $scope - * @param {IPollCreate} createPoll - * @param {Waves} waves - * @param {utils} utils - * @param {ModalManager} modalManager - * @return {DexCtrl} - */ - const controller = function ( - Base, - $element, - $state, - $location, - user, - $scope, - createPoll, - waves, - utils, - modalManager) { - - const analytics = require('@waves/event-sender'); - - const ANALYTICS_TABS_NAMES = { - myOpenOrders: 'My Open Orders', - myTradeHistory: 'My Trade History', - tradeHistory: 'Trade History', - myBalance: 'My Balance' - }; - - class DexCtrl extends Base { - - /** - * @type {string} - */ - _titleTxt; - - constructor() { - super($scope); - /** - * @type {boolean} - */ - this.ready = false; - /** - * @type {boolean} - */ - this.isLogined = !!user.address; - /** - * @type {boolean} - * @private - */ - this._leftHidden = false; - /** - * @type {boolean} - * @private - */ - this._rightHidden = false; - /** - * @type {{price: string, amount: string}} - * @private - */ - this._assetIdPair = null; - - this.observe('tab', this._onChangeTab); - - this.syncSettings({ - tab: 'dex.layout.bottomleft.tab', - _leftHidden: 'dex.layout.leftColumnState', - _rightHidden: 'dex.layout.rightColumnState', - _assetIdPair: 'dex.assetIdPair' - }); - - if (!this.isLogined) { - this.tab = 'tradeHistory'; - } - - const matcherSign = () => { - return user.address ? user.addMatcherSign() : Promise.resolve(); - }; - - matcherSign() - .catch(() => Promise.resolve()) - .then(() => { - this._initializePair().then(() => { - this.ready = true; - $scope.$apply(); - }); - }); - - createPoll(this, this._getLastPrice, '_titleTxt', 1000); - - this.observe('_assetIdPair', this._onChangePair); - this.observe('_titleTxt', this._setTitle); - this.observe(['_leftHidden', '_rightHidden'], this._onChangeProperty); - } - - $onDestroy() { - super.$onDestroy(); - window.document.title = 'Waves DEX'; - } - - // hide and show graph to force its resize - toggleColumn(column) { - this[`_${column}Hidden`] = !this[`_${column}Hidden`]; - } - - /** - * @private - */ - async _onChangePair() { - const userAssetIdPair = user.getSetting('dex.assetIdPair'); - if (utils.isLockedInDex(userAssetIdPair.amount, userAssetIdPair.price)) { - return this._showModalAndRedirect(userAssetIdPair.amount, userAssetIdPair.price); - } - const pair = await this._getPair(); - $location.search('assetId2', pair.amountAsset.id); - $location.search('assetId1', pair.priceAsset.id); - } - - /** - * @return {Promise} - * @private - */ - _showModalAndRedirect(amountAssetId, priceAssetId) { - Promise.all([ - waves.node.assets.getAsset(amountAssetId), - waves.node.assets.getAsset(priceAssetId) - ]).then(([priceAsset, amountAsset]) => { - const amountAssetName = amountAsset.ticker || amountAsset.displayName; - const priceAssetName = priceAsset.ticker || priceAsset.displayName; - - const findUnlocked = assetId => assetId !== 'WAVES' && !utils.isLockedInDex(assetId); - - const unLockedAsset = utils.isLockedInDex(WavesApp.defaultAssets.BTC) ? - Object.values(WavesApp.defaultAssets).find(findUnlocked) : - WavesApp.defaultAssets.BTC; - - - user.setSetting('dex.assetIdPair', { - amount: WavesApp.defaultAssets.WAVES, - price: unLockedAsset - }); - - return modalManager.showLockPairWarning(amountAssetName, priceAssetName) - .then(() => { - $location.search('assetId2', WavesApp.defaultAssets.WAVES); - $location.search('assetId1', unLockedAsset); - this._initializePair(); - }); - }); - } - - /** - * @private - */ - _onChangeTab() { - if (ANALYTICS_TABS_NAMES[this.tab]) { - analytics.send({ name: `DEX ${ANALYTICS_TABS_NAMES[this.tab]} Show`, target: 'ui' }); - } - } - - /** - * @return {Promise} - * @private - */ - _getLastPrice() { - return this._getPair().then(pair => { - const pairText = `| ${pair.amountAsset.displayName}/${pair.priceAsset.displayName}`; - return waves.matcher.getLastPrice(pair).then(data => { - const priceText = data.price.getTokens().isNaN() ? '-' : data.price.toFormat(); - return `${priceText} ${pairText}`; - }, () => { - return `- ${pairText}`; - }); - }); - } - - /** - * @return {Promise} - * @private - */ - _initializePair() { - return new Promise((resolve) => { - setTimeout(() => { - const urlPair = this._getPairFromState(); - if (urlPair) { - return this._getPair(urlPair) - .catch(() => this._getPair({ - amount: WavesApp.defaultAssets.WAVES, - price: WavesApp.defaultAssets.BTC - })) - .then(({ amountAsset, priceAsset }) => { - const activeTab = user.getSetting('dex.watchlist.activeTab'); - - if (activeTab !== 'all' && - activeTab !== amountAsset.id && - activeTab !== priceAsset.id) { - user.setSetting('dex.watchlist.activeTab', 'all'); - } - - this._assetIdPair = { - amount: amountAsset.id, - price: priceAsset.id - }; - }) - .then(resolve); - } else { - this._onChangePair(); - resolve(); - } - }, 200); - }); - } - - /** - * @private - */ - _getPair(pair = this._assetIdPair) { - if (pair) { - return ds.api.pairs.get(pair.amount, pair.price); - } else { - return ds.api.pairs.get(WavesApp.defaultAssets.WAVES, WavesApp.defaultAssets.BTC); - } - } - - /** - * @private - */ - _getPairFromState() { - if (!($state.params.assetId1 && $state.params.assetId2)) { - return null; - } - - return { - amount: $state.params.assetId1, - price: $state.params.assetId2 - }; - } - - /** - * @private - */ - _onChangeProperty() { - const $graphWrapper = $element.find('.graph-wrapper'); - $graphWrapper.hide(); - setTimeout(() => $graphWrapper.show(), 100); - } - - /** - * @private - */ - _setTitle() { - window.document.title = this._titleTxt; - } - - } - - return new DexCtrl(); - }; - - - controller.$inject = [ - 'Base', - '$element', - '$state', - '$location', - 'user', - '$scope', - 'createPoll', - 'waves', - 'utils', - 'modalManager' - ]; - - angular.module('app.dex') - .controller('DexCtrl', controller); -})(); diff --git a/src/modules/dex/dex.js b/src/modules/dex/dex.js deleted file mode 100644 index 406d20839f..0000000000 --- a/src/modules/dex/dex.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.dex', []); -})(); diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js deleted file mode 100644 index b122b1c4aa..0000000000 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ /dev/null @@ -1,1057 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param Base - * @param {Waves} waves - * @param {User} user - * @param {app.utils} utils - * @param {IPollCreate} createPoll - * @param {$rootScope.Scope} $scope - * @param {JQuery} $element - * @param {INotification} notification - * @param {DexDataService} dexDataService - * @param {Ease} ease - * @param {$state} $state - * @param {ModalManager} modalManager - * @param {BalanceWatcher} balanceWatcher - * @param {Transactions} transactions - * @return {CreateOrder} - */ - const controller = function (Base, waves, user, utils, createPoll, $scope, $element, notification, - dexDataService, ease, $state, modalManager, balanceWatcher, transactions) { - - const { without, keys, last } = require('ramda'); - const { Money } = require('@waves/data-entities'); - const { BigNumber } = require('@waves/bignumber'); - const ds = require('data-service'); - const analytics = require('@waves/event-sender'); - - class CreateOrder extends Base { - - - /** - * @return {string} - */ - get priceDisplayName() { - return this.priceBalance && this.priceBalance.asset.displayName || ''; - } - - /** - * @return {string} - */ - get amountDisplayName() { - return this.amountBalance && this.amountBalance.asset.displayName || ''; - } - - get loaded() { - return this.amountBalance && this.priceBalance && this.fee; - } - - /** - * Max amount (with fee) - * @type {Money} - */ - maxAmountBalance = null; - /** - * Has price balance for buy amount - * @type {boolean} - */ - canBuyOrder = true; - /** - * Amount asset balance - * @type {Money} - */ - amountBalance = null; - /** - * Price asset balance - * @type {Money} - */ - priceBalance = null; - /** - * Order type - * @type {string} - */ - type = 'buy'; - /** - * Max balance in price asset - * @type {Money} - */ - maxPriceBalance = null; - /** - * Total price (amount multiply price) - * @type {Money} - */ - total = null; - /** - * @type {Money} - */ - amount = null; - /** - * @type {Money} - */ - price = null; - /** - * @type {boolean} - */ - loadingError = false; - /** - * @type {boolean} - */ - idDemo = !user.address; - /** - * @type {number} - */ - ERROR_DISPLAY_INTERVAL = 3; - /** - * @type {{amount: string, price: string}} - * @private - */ - _assetIdPair = null; - /** - * @type string - * @private - */ - analyticsPair = null; - /** - * @type {Money} - * @private - */ - lastTradePrice = null; - /** - * @type {Array} - */ - changedInputName = []; - /** - * @type {boolean} - */ - _silenceNow = false; - /** - * @type {Array} - */ - _userList = []; - /** - * - * @type {boolean} - */ - expirationValues = [ - { name: '5min', value: () => utils.moment().add().minute(5).getDate().getTime() }, - { name: '30min', value: () => utils.moment().add().minute(30).getDate().getTime() }, - { name: '1hour', value: () => utils.moment().add().hour(1).getDate().getTime() }, - { name: '1day', value: () => utils.moment().add().day(1).getDate().getTime() }, - { name: '1week', value: () => utils.moment().add().week(1).getDate().getTime() }, - { name: '30day', value: () => utils.moment().add().day(29).getDate().getTime() } - ]; - /** - * @type {Money} - */ - maxAmount = null; - /** - * @type {Array} - */ - feeList = []; - /** - * @type {Object} - */ - matcherSettings = {}; - /** - * @type {Poll} - */ - feePoll = null; - - - constructor() { - super(); - - this.observe(['type', 'amount', 'price', 'amountBalance', 'fee'], this._currentMaxAmount); - - this.receive(dexDataService.chooseOrderBook, ({ type, price, amount }) => { - this.expand(type); - switch (type) { - case 'buy': - this._onClickBuyOrder(price, amount); - break; - case 'sell': - this._onClickSellOrder(price, amount); - break; - default: - throw new Error('Wrong order type!'); - } - $scope.$digest(); - }); - - this.syncSettings({ - _assetIdPair: 'dex.assetIdPair', - expiration: 'dex.createOrder.expirationName' - }); - - this.analyticsPair = `${this._assetIdPair.amount} / ${this._assetIdPair.price}`; - - /** - * @type {Poll} - */ - let lastTraderPoll; - /** - * @type {Poll} - */ - const spreadPoll = createPoll(this, this._getData, this._setData, 1000); - /** - * @type {Poll} - */ - - const onChangeBalanceWatcher = () => { - this._updateBalances(); - if (this.matcherSettings.mode === 'dynamic') { - this._updateFeeList(); - } - }; - this.receive(balanceWatcher.change, onChangeBalanceWatcher, this); - this._updateBalances(); - - const lastTradePromise = new Promise((resolve) => { - balanceWatcher.ready.then(() => { - lastTraderPoll = createPoll(this, this._getLastPrice, 'lastTradePrice', 1000); - resolve(); - }); - }); - - Promise.all([ - ds.api.pairs.get(this._assetIdPair.amount, this._assetIdPair.price), - lastTradePromise, - spreadPoll.ready - ]).then(([pair]) => { - this.amount = new Money(0, pair.amountAsset); - if (this.lastTradePrice && this.lastTradePrice.getTokens().gt(0)) { - this.price = this.lastTradePrice; - } else { - this.price = this._getCurrentPrice(); - } - }); - - this.observe(['amountBalance', 'type', 'fee', 'priceBalance'], this._updateMaxAmountOrPriceBalance); - - this.observe('_assetIdPair', () => { - this.amount = null; - this.price = null; - this.total = null; - this.bid = null; - this.ask = null; - this._updateBalances(); - spreadPoll.restart(); - const form = this.order; - form.$setUntouched(); - form.$setPristine(); - if (lastTraderPoll) { - lastTraderPoll.restart(); - } - - this.isLockedPair = utils.isLockedInDex(this._assetIdPair.amount, this._assetIdPair.price); - - this.analyticsPair = `${this._assetIdPair.amount} / ${this._assetIdPair.price}`; - this.observeOnce(['bid', 'ask'], utils.debounce(() => { - if (this.type) { - this.amount = this.amountBalance.cloneWithTokens('0'); - this.price = this._getCurrentPrice(); - this.total = this.priceBalance.cloneWithTokens('0'); - $scope.$apply(); - } - })); - this._setMatcherSettings(); - }); - - this.observe(['priceBalance', 'total', 'maxPriceBalance'], this._setIfCanBuyOrder); - - this.observe('amount', () => ( - !this._silenceNow && this._updateField({ amount: this.amount }) - )); - - this.observe('price', () => ( - !this._silenceNow && this._updateField({ price: this.price }) - )); - - this.observe('total', () => ( - !this._silenceNow && this._updateField({ total: this.total }) - )); - - // TODO Add directive for stop propagation (catch move for draggable) - $element.on('mousedown touchstart', '.body', (e) => { - e.stopPropagation(); - }); - - user.getMultiAccountUsers().then(list => { - this._userList = list; - }); - - this._setMatcherSettings(); - this.observe('matcherSettings', () => { - if (this.matcherSettings.feeMode === 'dynamic') { - this._updateFeeList(); - if (!this.feePoll) { - this.feePoll = createPoll(this, this._getFeeRates, this._updateFeeList, 20000); - } - } else { - this.fee = this.matcherSettings.fee; - this.feeList = []; - if (this.feePoll) { - this.feePoll.destroy(); - this.feePoll = null; - } - } - $scope.$apply(); - }); - } - - /** - * @param {number} factor - * @return {boolean} - */ - isActiveBalanceButton(factor) { - const amount = this.amount; - - if (!amount || amount.getTokens().eq(0)) { - return false; - } - - return this.maxAmount.cloneWithTokens(this.maxAmount.getTokens().mul(factor)).eq(amount); - } - - /** - * @param {number} factor - */ - setAmountByBalance(factor) { - const amount = this.maxAmount.cloneWithTokens(this.maxAmount.getTokens().mul(factor)); - this._updateField({ amount }); - return Promise.resolve(); - } - - /** - * @return {boolean} - */ - hasBalance() { - return !this.maxAmount.getTokens().isZero(); - } - - - expand(type) { - this.type = type; - if (!this.price || this.price.getTokens().eq('0')) { - this.price = this._getCurrentPrice(); - } - - // todo: refactor after getting rid of Layout-DEX coupling. - $element.parent().parent().parent().parent().parent().addClass('expanded'); - } - - closeCreateOrder() { - // todo: refactor after getting rid of Layout-DEX coupling. - $element.parent().parent().parent().parent().parent().removeClass('expanded'); - } - - /** - * @returns {boolean} - */ - isAmountInvalid() { - return this.isDirtyAndInvalid(this.order.amount); - } - - /** - * @returns {boolean} - */ - isPriceInvalid() { - return this.isDirtyAndInvalid(this.order.price); - } - - /** - * @returns {boolean} - */ - isTotalInvalid() { - return this.isDirtyAndInvalid(this.order.total); - } - - /** - * @param field - * @returns {boolean} - */ - isDirtyAndInvalid(field) { - return field.$touched && field.$invalid; - } - - setMaxAmount() { - const amount = this.maxAmount; - this._updateField({ amount }); - } - - setMaxPrice() { - const amount = this.maxAmount; - const total = this.priceBalance.cloneWithTokens( - this.price.getTokens().mul(amount.getTokens()) - ); - const price = this.price; - this._updateField({ amount, total, price }); - } - - setBidPrice() { - const price = this.priceBalance.cloneWithTokens(String(this.bid.price)); - this._updateField({ price }); - } - - setAskPrice() { - const price = this.priceBalance.cloneWithTokens(String(this.ask.price)); - this._updateField({ price }); - } - - setLastPrice() { - const price = this.lastTradePrice; - this._updateField({ price }); - } - - /** - * @public - * @param field {string} - */ - setChangedInput(field) { - if (last(this.changedInputName) === field) { - return null; - } - if (this.changedInputName.length === 2) { - this.changedInputName.shift(); - } - this.changedInputName.push(field); - } - - /** - * @return {*} - */ - createOrder($event) { - if (this.idDemo) { - return this._showDemoModal(); - } - - const form = this.order; - $event.preventDefault(); - const notify = $element.find('.js-order-notification'); - notify.removeClass('success').removeClass('error'); - - return ds.fetch(ds.config.get('matcher')) - .then((matcherPublicKey) => { - form.$setUntouched(); - $scope.$apply(); - - const data = { - orderType: this.type, - price: this.price, - amount: this.amount, - matcherFee: this.fee, - matcherPublicKey - }; - - this._checkScriptAssets() - .then(() => this._checkOrder(data)) - .then(() => this._sendOrder(data)) - .then(data => { - if (!data) { - return null; - } - - notify.addClass('success'); - this.createOrderFailed = false; - analytics.send({ - name: `DEX ${this.type} Order Transaction Success`, - params: this.analyticsPair - }); - dexDataService.createOrder.dispatch(); - CreateOrder._animateNotification(notify); - }) - .catch(() => { - this.createOrderFailed = true; - notify.addClass('error'); - analytics.send({ - name: `DEX ${this.type} Order Transaction Error`, - params: this.analyticsPair - }); - $scope.$apply(); - CreateOrder._animateNotification(notify); - }); - }); - } - - /** - * @param data - * @return {*|Promise} - * @private - */ - _sendOrder(data) { - const expiration = ds.utils.normalizeTime( - this.expirationValues.find(el => el.name === this.expiration).value() - ); - const clone = { ...data, expiration }; - - return utils.createOrder(clone); - } - - - /** - * @return {Promise} - * @private - */ - _checkScriptAssets() { - if (user.getSetting('tradeWithScriptAssets')) { - return Promise.resolve(); - } - - const scriptAssets = [ - this.amountBalance.asset, - this.priceBalance.asset - ].filter(asset => asset.hasScript); - - if (scriptAssets.length > 0) { - return modalManager.showDexScriptedPair(scriptAssets); - } else { - return Promise.resolve(); - } - } - - /** - * @param orderData - * @private - */ - _checkOrder(orderData) { - const isBuy = orderData.orderType === 'buy'; - const factor = isBuy ? 1 : -1; - const limit = 1 + factor * (Number(user.getSetting('orderLimit')) || 0); - const price = (new BigNumber(isBuy ? this.ask.price : this.bid.price)).mul(limit); - const orderPrice = orderData.price.getTokens(); - - if (price.isNaN() || price.eq(0)) { - return Promise.resolve(); - } - - /** - * @type {BigNumber} - */ - const delta = isBuy ? orderPrice.sub(price) : price.sub(orderPrice); - - if (delta.isNegative()) { - return Promise.resolve(); - } - - return modalManager.showConfirmOrder({ - ...orderData, - orderLimit: Number(user.getSetting('orderLimit')) * 100 - }).catch(() => { - throw new Error('You have cancelled the creation of this order'); - }); - } - - /** - * @return {Promise} - * @private - */ - _showDemoModal() { - return modalManager.showDialogModal({ - iconClass: 'open-main-dex-account-info', - message: { literal: 'modal.createOrder.message' }, - buttons: [ - { - success: false, - classes: 'big', - text: { literal: 'modal.createOrder.cancel' }, - click: () => $state.go('create') - }, - { - success: true, - classes: 'big submit', - text: { literal: 'modal.createOrder.ok' }, - click: () => $state.go(`${this._userList.length > 0 ? 'signIn' : 'welcome'}`) - } - ] - }) - .catch(() => null) - .then(() => { - const form = this.order; - this.amount = null; - form.$setUntouched(); - form.$setPristine(); - }); - } - - /** - * @param {string} priceStr - * @param {string} amountStr - * @private - */ - _onClickBuyOrder(priceStr, amountStr) { - this.changedInputName = ['price']; - const price = this.priceBalance.cloneWithTokens(priceStr); - const maxAmount = this.amountBalance.cloneWithTokens(this.priceBalance.getTokens().div(priceStr)); - const amount = Money.min(this.amountBalance.cloneWithTokens(amountStr), maxAmount); - this._updateField({ amount, price }); - } - - /** - * @param {string} priceStr - * @param {string} amountStr - * @private - */ - _onClickSellOrder(priceStr, amountStr) { - this.changedInputName = ['price']; - const price = this.priceBalance.cloneWithTokens(priceStr); - const amountMoney = this.amountBalance.cloneWithTokens(amountStr); - const amount = Money.min(amountMoney, this.maxAmount); - this._updateField({ amount, price }); - } - - /** - * @return {Money} - * @private - */ - _getMaxAmountForSell() { - const fee = this.fee; - const balance = this.amountBalance; - return balance.safeSub(fee).toNonNegative(); - } - - - /** - * @return {Money} - * @private - */ - _getMaxAmountForBuy() { - const fee = this.fee; - - if (!fee || !this.price || this.price.getTokens().eq(0)) { - return this.amountBalance.cloneWithTokens('0'); - } - - return this.amountBalance.cloneWithTokens( - this.priceBalance.safeSub(fee) - .toNonNegative() - .getTokens() - .div(this.price.getTokens()) - .roundTo(this.amountBalance.asset.precision) - ); - } - - _currentMaxAmount() { - if (this.type === 'buy') { - this.maxAmount = this._getMaxAmountForBuy(); - } else { - this.maxAmount = this._getMaxAmountForSell(); - } - } - - /** - * @return {Promise} - * @private - */ - _getLastPrice() { - return transactions.getExchangeTxList({ - amountAsset: this._assetIdPair.amount, - priceAsset: this._assetIdPair.price, - limit: 1 - }).then(([tx]) => tx && tx.price || null).catch(() => (this.loadingError = false)); - } - - /** - * @private - */ - _updateMaxAmountOrPriceBalance() { - if (!this.amountBalance || !this.fee || !this.priceBalance) { - return null; - } - - if (this.type === 'sell') { - this.maxAmountBalance = this._getMaxAmountForSell(); - this.maxPriceBalance = null; - } else { - this.maxAmountBalance = null; - this.maxPriceBalance = this.priceBalance.safeSub(this.fee).toNonNegative(); - } - } - - /** - * @return {Money} - * @private - */ - _getCurrentPrice() { - switch (this.type) { - case 'sell': - return this.priceBalance.cloneWithTokens(String(this.bid && this.bid.price || 0)); - case 'buy': - return this.priceBalance.cloneWithTokens(String(this.ask && this.ask.price || 0)); - default: - throw new Error('Wrong type'); - } - } - - /** - * @return {Promise} - * @private - */ - _updateBalances() { - if (!this.idDemo) { - return ds.api.pairs.get(this._assetIdPair.amount, this._assetIdPair.price).then(pair => { - this.amountBalance = balanceWatcher.getBalanceByAsset(pair.amountAsset); - this.priceBalance = balanceWatcher.getBalanceByAsset(pair.priceAsset); - utils.safeApply($scope); - }); - } else { - return ds.api.pairs.get(this._assetIdPair.amount, this._assetIdPair.price).then(pair => { - this.amountBalance = Money.fromTokens(10, pair.amountAsset); - this.priceBalance = Money.fromTokens(10, pair.priceAsset); - utils.safeApply($scope); - }); - } - } - - - /** - * @param {object} newState - * @private - */ - _updateField(newState) { - if (this.loaded) { - this._setSilence(() => { - this._applyState(newState); - - const inputKeys = ['price', 'total', 'amount']; - const changingValues = without(keys(newState), inputKeys); - - let changingValue; - if (changingValues.length === 1) { - changingValue = changingValues[0]; - } else { - if (this.changedInputName.length === 0) { - this.changedInputName.push('price'); - } - - if (changingValues.some(el => el === last(this.changedInputName))) { - changingValue = changingValues.find(el => el !== last(this.changedInputName)); - } else { - changingValue = without(this.changedInputName, changingValues)[0]; - } - } - - this._calculateField(changingValue); - this._setIfCanBuyOrder(); - }); - } - } - - /** - * @param {object} newState - * @private - */ - _applyState(newState) { - keys(newState).forEach(key => { - this[key] = newState[key]; - }); - this.order.$setDirty(); - } - - - /** - * @param {function} cb - * @private - */ - _setSilence(cb) { - this._silenceNow = true; - cb(); - this._silenceNow = false; - } - - - /** - * @param {string} fieldName - * @private - */ - _calculateField(fieldName) { - switch (fieldName) { - case 'total': - this._calculateTotal(); - break; - case 'price': - this._calculatePrice(); - break; - case 'amount': - this._calculateAmount(); - break; - default: - break; - } - } - - /** - * @private - */ - _calculateTotal() { - if (!this.price || !this.amount) { - return null; - } - const price = this._validPrice(); - const amount = this._validAmount(); - this._setDirtyField('total', this.priceBalance.cloneWithTokens( - price.mul(amount) - )); - this._silenceNow = true; - } - - /** - * @private - */ - _calculatePrice() { - if (!this.total || !this.amount) { - return null; - } - const total = this._validTotal(); - const amount = this._validAmount(); - this._setDirtyField('price', this.priceBalance.cloneWithTokens( - total.div(amount) - )); - this._silenceNow = true; - } - - /** - * @private - */ - _calculateAmount() { - if (!this.total || !this.price) { - return null; - } - const total = this._validTotal(); - const price = this._validPrice(); - - this._setDirtyField('amount', this.amountBalance.cloneWithTokens( - total.div(price) - )); - this._silenceNow = true; - } - - /** - * @private - */ - _validTotal() { - return this.order.total.$viewValue === '' ? - this.priceBalance.cloneWithTokens('0').getTokens() : - this.total.getTokens(); - } - - /** - * @private - */ - _validPrice() { - return this.order.price.$viewValue === '' ? - this.amountBalance.cloneWithTokens('0').getTokens() : - this.price.getTokens(); - } - - /** - * @private - */ - _validAmount() { - return this.order.amount.$viewValue === '' ? - this.amountBalance.cloneWithTokens('0').getTokens() : - this.amount.getTokens(); - } - - /** - * @private - */ - _setIfCanBuyOrder() { - if (this.type === 'buy' && - this.total && - this.priceBalance && - this.total.asset.id === this.priceBalance.asset.id) { - - if (this.maxPriceBalance) { - this.canBuyOrder = ( - this.total.lte(this.maxPriceBalance) && this.maxPriceBalance.getTokens().gt(0) - ); - } - } else { - this.canBuyOrder = true; - } - } - - /** - * @private - */ - _getData() { - this.loadingError = false; - return waves.matcher.getOrderBook(this._assetIdPair.amount, this._assetIdPair.price) - .then(({ bids, asks, spread }) => { - const [lastAsk] = asks; - const [firstBid] = bids; - - return { lastAsk, firstBid, spread }; - }).catch(() => (this.loadingError = true)); - } - - /** - * @param lastAsk - * @param firstBid - * @param spread - * @private - */ - _setData({ lastAsk, firstBid }) { - this.bid = firstBid || { price: 0 }; - this.ask = lastAsk || { price: 0 }; - - const sell = Number(this.bid.price); - const buy = Number(this.ask.price); - - this.spreadPercent = buy ? (((buy - sell) * 100 / buy) || 0).toFixed(2) : '0.00'; - $scope.$digest(); - } - - /** - * Set only non-zero amount values - * @param {string} field - * @param {Money} value - * @private - */ - _setDirtyField(field, value) { - if (value.getTokens().isNaN() || !value.getTokens().isFinite()) { - return null; - } - this[field] = value; - this.order.$setDirty(); - } - - /** - * - * @return {Promise} - * @private - */ - _updateFeeList() { - return this._getFeeRates() - .then(list => { - const assetsId = this._getOrderedCustomFeeAssetsList(list); - Promise.all( - assetsId.map(id => balanceWatcher.getBalanceByAssetId(id)) - ).then(balances => { - const { basedCustomFee } = this.matcherSettings; - - const feeList = balances - .map(balance => { - const { id } = balance.asset; - const rate = new BigNumber(list[id]); - return balance.cloneWithCoins( - rate.mul(basedCustomFee[id]).roundTo(0, 2) - ); - }); - - const filteredFeeList = feeList.filter((fee, i) => { - return fee.lte(balances[i]) || fee.asset.id === WavesApp.defaultAssets.WAVES; - }); - - if (!filteredFeeList.length) { - this.fee = feeList[0]; - this.feeList = []; - } else if (filteredFeeList.length === 1) { - this.fee = filteredFeeList[0]; - this.feeList = []; - } else { - this.fee = filteredFeeList[0]; - this.feeList = filteredFeeList; - } - }); - - }) - .catch(() => { - this.feeList = []; - }); - } - - /** - * @return {Promise} - * @private - */ - _getFeeRates() { - return waves.matcher.getFeeRates(); - } - - /** - * @return {Promise} - * @private - */ - _setMatcherSettings() { - return Promise.all([ - ds.api.pairs.get(this._assetIdPair.amount, this._assetIdPair.price), - ds.fetch(ds.config.get('matcher')) - ]).then(([pair, matcherPublicKey]) => { - waves.matcher.getCreateOrderSettings(pair, matcherPublicKey) - .then(data => { - this.matcherSettings = data; - }) - .catch(() => null); - }); - } - - /** - * @param {object} list - * @return {string[]} - * @private - */ - _getOrderedCustomFeeAssetsList(list) { - const currentFeeAsset = (this.fee && this.fee.asset.id) || WavesApp.defaultAssets.WAVES; - const { currentFee, otherFee } = Object.keys(list).reduce((acc, id) => { - if (id === currentFeeAsset) { - acc.currentFee.push(id); - } else { - acc.otherFee.push(id); - } - return acc; - }, { currentFee: [], otherFee: [] }); - return [...currentFee, ...otherFee]; - } - - static _animateNotification($element) { - return utils.animate($element, { t: 100 }, { - duration: 1200, - step: function (tween) { - const progress = ease.bounceOut(tween / 100); - $element.css('transform', `translate(0, ${-100 + progress * 100}%)`); - } - }) - .then(() => utils.wait(700)) - .then(() => { - return utils.animate($element, { t: 0 }, { - duration: 500, - step: function (tween) { - const progress = ease.linear(tween / 100); - $element.css('transform', `translate(0, ${(-((1 - progress) * 100))}%)`); - } - }); - }); - } - - } - - return new CreateOrder(); - }; - - controller.$inject = [ - 'Base', - 'waves', - 'user', - 'utils', - 'createPoll', - '$scope', - '$element', - 'notification', - 'dexDataService', - 'ease', - '$state', - 'modalManager', - 'balanceWatcher', - 'transactions' - ]; - - angular.module('app.dex').component('wCreateOrder', { - bindings: {}, - templateUrl: 'modules/dex/directives/createOrder/createOrder.html', - transclude: false, - controller - }); -})(); diff --git a/src/modules/dex/directives/createOrder/createOrder.html b/src/modules/dex/directives/createOrder/createOrder.html deleted file mode 100644 index dab60f5cd7..0000000000 --- a/src/modules/dex/directives/createOrder/createOrder.html +++ /dev/null @@ -1,277 +0,0 @@ - - -
- -
-
-
{{$ctrl.amountDisplayName}} / {{$ctrl.priceDisplayName}}
-
-
- -
- -
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
{{$ctrl.spreadPercent}}%
-
-
-
-
-
-
- -
-
- -
-
- -
-
- - -
- -
-
diff --git a/src/modules/dex/directives/createOrder/createOrder.less b/src/modules/dex/directives/createOrder/createOrder.less deleted file mode 100644 index fe3a9065a3..0000000000 --- a/src/modules/dex/directives/createOrder/createOrder.less +++ /dev/null @@ -1,406 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../../app/less/typography'; -@import (reference) 'icons'; - -w-button.inactive-order-button { - width: 100%; - - & > *:not(.transparent) { - width: 100%; - background-color: @color-basic-50; - border: 0 none; - cursor: default; - color: @color-basic-500; - - &:hover { - color: @color-basic-500; - } - } -} - -w-create-order { - display: block; - width: 100%; - max-height: 100%; - overflow: hidden; - - .plate-note { - padding: 6px 14px; - } - - .split-half { - display: flex; - justify-content: space-between; - align-items: center; - - .flex { - display: flex; - justify-content: flex-end; - - & > span { - margin-left: 20px; - height: 13px; - } - } - } - - .amount { - .underline-dashed { - font-family: @font-roboto-medium; - } - } - - .underline { - cursor: pointer; - - &::after { - content: ''; - border-bottom: 1px solid @color-basic-200; - display: block; - position: relative; - top: -1px; - } - } - - .underline-dashed { - cursor: pointer; - position: relative; - - &:hover { - &::after { - content: ''; - border-bottom: 1px dashed @color-disabled-400; - display: block; - position: absolute; - bottom: 0; - width: 100%; - height: 1px; - } - } - } - - .icon-close { - position: absolute; - top: 0; - display: none; - height: 30px; - width: 30px; - right: 15px; - background-size: 10px; - background-position: center; - } -} - -.create-order { - position: relative; - - w-input { - .w-input-wrap { - input { - color: @color-disabled-900; - background: @color-white; - - &[type="text"].tiny { - padding: 0 16px; - } - } - } - } - .head { - align-items: center; - width: 100%; - padding: 0 16px; - height: 30px; - position: relative; - display: none; - border-bottom: 1px solid @color-disabled-100; - } - - .body { - .choice { - display: none; - flex-direction: row; - position: relative; - z-index: 2; - text-transform: uppercase; - background-color: @color-white; - - .choose { - width: 50%; - flex-grow: 1; - height: 50px; - padding-top: 8px; - text-align: center; - cursor: pointer; - color: @white-only; - - .name { - font-size: @font-size-caption-2; - text-transform: uppercase; - } - - .price { - .footnote-2(); - } - - &.sell { - background: @color-error-400; - } - - &.buy { - background: @color-submit-400; - } - - &.inactive { - background: black; - } - } - - .middle { - width: 70px; - padding-top: 15px; - text-align: center; - } - } - - .making-order { - .create-order-notification { - z-index: 1; - } - - .areas { - display: flex; - flex-direction: row; - position: relative; - z-index: 3; - - .area { - width: 50%; - flex-grow: 1; - height: 38px; - color: @color-disabled-400; - border-bottom: 1px solid @color-basic-100; - cursor: pointer; - background: @color-white; - text-align: center; - border-top: 2px solid @color-white; - - .name { - line-height: 32px; - text-transform: uppercase; - } - - &:first-child { - border-right: 1px solid @color-basic-100; - } - - .spread { - position: absolute; - left: 50%; - transform: translate(-50%, 50px); - margin-top: -12px; - - span { - display: block; - text-align: center; - } - - .spread-label { - font-size: 9px; - } - } - } - } - - .fields { - padding: 6px 25px 17px; - background: @color-white; - - .field-label { - margin-top: 8px; - padding-bottom: 4px; - } - - .field-fee { - margin: 13px 0; - - span:last-child { - margin-left: 5px; - } - } - - w-input-container.invalid { - .input-like { - border: 1px solid @color-error-200; - } - } - - .input-like { - padding: 0; - display: flex; - align-items: center; - border-radius: @border-radius / 2; - - w-input { - display: block; - width: 50%; - - input { - height: 28px; - border: none; - } - } - - .asset-name-wrap { - position: relative; - height: 100%; - width: 50%; - padding: 6px 11px; - background-color: @color-basic-50; - border-top-right-radius: @border-radius / 2; - border-bottom-right-radius: @border-radius / 2; - text-align: right; - } - } - - .summary { - display: flex; - padding-top: 14px; - padding-bottom: 25px; - justify-content: space-between; - } - - .place-order { - width: 100%; - color: @white-only; - border: none; - height: 36px; - box-shadow: none; - border-radius: @border-radius / 2; - } - } - - button.micro { - &[disabled] { - border: 1px solid @color-accent-50; - color: @color-basic-500; - } - } - - &.buy { - .areas .area.buy { - border-top: 2px solid @color-submit-400; - border-bottom: 1px solid @color-white; - cursor: default; - opacity: 1; - } - - button.place-order { - background: @color-submit-400; - &:hover { - background: @color-submit-600; - } - &:active { - background: @color-submit-700; - } - &[disabled] { - background: @color-submit-400; - opacity: 0.3; - } - } - } - - &.sell { - .areas .area.sell { - border-top: 2px solid @color-error-400; - border-bottom: 1px solid @color-white; - cursor: default; - opacity: 1; - } - - button.place-order { - background: @color-error-400; - &:hover { - background: @color-error-600; - } - &:active { - background: @color-error-700; - } - &[disabled] { - background: @color-error-400; - opacity: 0.3; - } - } - } - - .price { - font-size: @font-size-caption-2; - line-height: 12px; - - span.link { - color: @color-disabled-900; - font-size: @font-size-caption-2; - line-height: 13px; - height: auto; - - &.active { - color: @color-disabled-600; - } - } - } - } - } -} - -.amount { - .field-buttons { - display: flex; - justify-content: space-between; - margin-top: 7px; - - w-button { - width: ~'calc(25% - 6px)'; - - > * { - box-shadow: none; - } - } - } -} - -@media screen and (max-width: 1024px) { - w-create-order { - .create-order { - .body { - .making-order { - .create-order-notification { - z-index: 1; - } - - .choice { - display: flex; - - .price { - span { - color: @white-only; - } - } - } - - .areas { - display: none; - } - } - } - - .expandable { - display: block; - } - - .head { - display: flex; - } - - } - } -} diff --git a/src/modules/dex/directives/createOrder/expiration.less b/src/modules/dex/directives/createOrder/expiration.less deleted file mode 100644 index 75a5ac1365..0000000000 --- a/src/modules/dex/directives/createOrder/expiration.less +++ /dev/null @@ -1,50 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../../app/less/typography'; -@import (reference) 'icons'; - -.create-order { - .expiration { - display: flex; - justify-content: space-between; - margin: 7px 0; - - &__item { - display: flex; - flex: 1 0; - max-width: 50%; - white-space: nowrap; - align-items: center; - position: relative; - font-size: @font-size-caption-2; - - &-acting { - justify-content: flex-end; - } - } - - &__label { - color: @color-basic-500; - max-width: 50%; - overflow: hidden; - text-overflow: ellipsis; - } - - &__value { - margin-left: 5px; - } - - w-option { - .option { - display: block; - text-align: right; - overflow: hidden; - width: 100%; - text-overflow: ellipsis; - padding: 2px 12px; - line-height: 20px; - font-size: @font-size-caption-2; - color: @color-basic-900; - } - } - } -} diff --git a/src/modules/dex/directives/dexBlock/DexBlock.js b/src/modules/dex/directives/dexBlock/DexBlock.js deleted file mode 100644 index 77c561e3e5..0000000000 --- a/src/modules/dex/directives/dexBlock/DexBlock.js +++ /dev/null @@ -1,109 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param Base - * @param {JQuery} $element - * @param {app.utils} utils - * @param {app.i18n} i18n - * @param {DexDataService} dexDataService - * @return {DexBlock} - */ - const controller = function (Base, $element, utils, i18n, dexDataService) { - - const analytics = require('@waves/event-sender'); - - class DexBlock extends Base { - - constructor() { - super(); - /** - * For find assets in watchlist - * @type {string} - */ - this.search = ''; - /** - * Literal for i18n - * @type {string} - */ - this.titleLiteral = null; - /** - * @type {boolean} - */ - this.collapsed = false; - /** - * For find assets in watchlist - * @type {boolean} - */ - this.focused = false; - /** - * @type {string} - */ - this.block = null; - /** - * @type {Layout} - * @private - */ - this._parent = null; - - i18n.translateField(this, 'titleLiteral', 'title', 'app.dex'); - } - - scrollToSpread() { - dexDataService.showSpread.dispatch(); - } - - $postLink() { - - this.syncSettings({ - collapsed: `dex.layout.${this.block}.collapsed` - }); - - this._parent.collapseBlock(this.block, this.collapsed); - this._parent.registerItem($element, this); - } - - toggleCollapse() { - const collapsed = this.collapsed; - if (collapsed) { - this.collapsed = !collapsed; - utils.wait(100) - .then(() => { - analytics.send({ name: `${this.analyticsText} Show`, target: 'ui' }); - this._parent.collapseBlock(this.block, this.collapsed); - }); - } else { - this._parent.collapseBlock(this.block, !this.collapsed); - utils.wait(300) - .then(() => { - analytics.send({ name: `${this.analyticsText} Hide`, target: 'ui' }); - this.collapsed = !collapsed; - }); - } - } - - } - - return new DexBlock(); - }; - - controller.$inject = ['Base', '$element', 'utils', 'i18n', 'dexDataService']; - - angular.module('app.dex') - .component('wDexBlock', { - require: { - _parent: '^wLayout' - }, - bindings: { - titleLiteral: '@titleName', - block: '@', - hasSearch: '@', - canCollapse: '@', - analyticsText: '<', - isActiveScroll: '<' - }, - templateUrl: 'modules/dex/directives/dexBlock/dexBlock.html', - transclude: true, - controller - }); -})(); diff --git a/src/modules/dex/directives/dexBlock/dexBlock.html b/src/modules/dex/directives/dexBlock/dexBlock.html deleted file mode 100644 index 4fdc74899f..0000000000 --- a/src/modules/dex/directives/dexBlock/dexBlock.html +++ /dev/null @@ -1,28 +0,0 @@ -
-
- -
- {{$ctrl.title}} -
-
-
- -
-
-
-
diff --git a/src/modules/dex/directives/dexBlock/dexBlock.less b/src/modules/dex/directives/dexBlock/dexBlock.less deleted file mode 100644 index 69161133a4..0000000000 --- a/src/modules/dex/directives/dexBlock/dexBlock.less +++ /dev/null @@ -1,78 +0,0 @@ -@import (reference) "../../../app/less/app-icons"; -@import (reference) 'config'; -@import (reference) 'icons'; - -.dex-block { - display: block; - width: 100%; - height: 100%; - - .block-title { - position: relative; - padding: 0 4px 0 16px; - display: flex; - align-items: center; - justify-content: space-between; - height: 38px; - background-color: @color-white; - border-bottom: 1px solid @color-basic-100; - flex-shrink: 0; - } - - .block-wrapper { - width: 100%; - height: 100%; - background-color: @color-white; - display: flex; - flex-direction: column; - - .dex-block-top-btn { - padding: 6px; - width: 32px; - height: 32px; - vertical-align: middle; - - i.collapse { - display: block; - width: 20px; - height: 20px; - cursor: pointer; - transition: transform 0.3s ease-in-out, all 0.3s; - border-radius: @border-radius / 2; - .icon-dex-arrow(); - background-color: @color-basic-50; - } - i.collapse:hover { - background-color: @color-basic-100; - } - - i.tospread { - display: block; - width: 20px; - height: 20px; - cursor: pointer; - transition: transform 0.3s ease-in-out, all 0.3s; - border-radius: @border-radius / 2; - .icon-dex-tospread(); - background-color: @color-basic-50; - } - i.tospread:hover { - background-color: @color-basic-100; - } - - &.active { - cursor: default; - i.tospread { - background: @color-submit-400; - .icon-dex-tospread-active(); - } - } - } - - .dex-block-content { - height: 100%; - display: flex; - flex-direction: column; - } - } -} diff --git a/src/modules/dex/directives/dexCandleChart/DexCandleChart.js b/src/modules/dex/directives/dexCandleChart/DexCandleChart.js deleted file mode 100644 index f9d00295ad..0000000000 --- a/src/modules/dex/directives/dexCandleChart/DexCandleChart.js +++ /dev/null @@ -1,314 +0,0 @@ -/* eslint-disable no-console */ -(function () { - 'use strict'; - - const DISABLED_FEATURES = [ - 'header_screenshot', - 'header_symbol_search', - 'symbol_search_hot_key', - 'display_market_status', - 'control_bar', - 'timeframes_toolbar', - 'volume_force_overlay', - 'header_compare' - ]; - - // TODO : added in version 1.12 - // const ENABLED_FEATURES = [ - // 'hide_left_toolbar_by_default' - // ]; - - function getOverrides(candleUpColor, candleDownColor) { - return { - 'mainSeriesProperties.candleStyle.upColor': candleUpColor, - 'mainSeriesProperties.candleStyle.downColor': candleDownColor, - 'mainSeriesProperties.candleStyle.drawBorder': false, - 'mainSeriesProperties.hollowCandleStyle.upColor': candleUpColor, - 'mainSeriesProperties.hollowCandleStyle.downColor': candleDownColor, - 'mainSeriesProperties.hollowCandleStyle.drawBorder': false, - 'mainSeriesProperties.barStyle.upColor': candleUpColor, - 'mainSeriesProperties.barStyle.downColor': candleDownColor, - 'mainSeriesProperties.haStyle.upColor': candleUpColor, - 'mainSeriesProperties.haStyle.downColor': candleDownColor, - 'mainSeriesProperties.haStyle.drawBorder': false, - 'mainSeriesProperties.lineStyle.color': candleUpColor, - 'mainSeriesProperties.areaStyle.color1': candleUpColor, - 'mainSeriesProperties.areaStyle.color2': candleUpColor, - 'mainSeriesProperties.areaStyle.linecolor': candleUpColor, - 'volumePaneSize': 'medium' - }; - } - - function getStudiesOverrides({ volume0, volume1 }) { - return { - 'volume.volume.color.0': volume0, - 'volume.volume.color.1': volume1 - }; - } - - let counter = 0; - - /** - * - * @param {Base} Base - * @param candlesService - * @param {$rootScope.Scope} $scope - * @param {app.themes} themes - * @return {DexCandleChart} - */ - const controller = function (Base, candlesService, $scope, themes, user) { - - class DexCandleChart extends Base { - - constructor() { - super(); - /** - * @type {string} - */ - this.elementId = `tradingview${counter++}`; - /** - * @type {boolean} - */ - this.notLoaded = false; - /** - * @type {TradingView} - * @private - */ - this._chart = null; - /** - * @type {boolean} - * @private - */ - this._chartReady = false; - /** - * @type {boolean} - * @private - */ - this._assetIdPairWasChanged = false; - /** - * @type {boolean} - * @private - */ - this._changeTheme = true; - /** - * @type {{price: string, amount: string}} - */ - this._assetIdPair = null; - /** - * @type {boolean} - * @private - */ - this.loadingTradingView = true; - /** - * @type {string} - * @private - */ - this.theme = user.getSetting('theme'); - /** - * @type {string} - * @private - */ - this.candle = user.getSetting('candle'); - - this.observe('_assetIdPair', this._onChangeAssetPair); - this.observe('theme', () => { - this._changeTheme = true; - this._resetTradingView(); - }); - this.observe('candle', this._refreshTradingView); - this.syncSettings({ _assetIdPair: 'dex.assetIdPair' }); - this.syncSettings({ theme: 'theme' }); - this.syncSettings({ candle: 'candle' }); - } - - $postLink() { - controller.load() - .then(() => { - this._createTradingView(); - this.listenEventEmitter(i18next, 'languageChanged', this._changeLangHandler.bind(this)); - }, () => { - console.warn('Error 403!'); - this.notLoaded = true; - }) - .then(() => { - $scope.$apply(); - }); - } - - $onDestroy() { - super.$onDestroy(); - this._removeTradingView(); - } - - /** - * @private - */ - _onChangeAssetPair() { - if (this._chartReady) { - this._setChartPair(); - } else { - this._assetIdPairWasChanged = true; - } - } - - /** - * @return {*} - * @private - */ - _resetTradingView() { - try { - return this._removeTradingView() - ._createTradingView(); - } catch (e) { - // Trading view not loaded - } - } - - /** - * @return {DexCandleChart} - * @private - */ - _removeTradingView() { - candlesService.unsubscribeBars(); - try { - if (this._chart) { - this._chart.remove(); - } - } catch (e) { - // Can't remove _chart - } - this._chart = null; - return this; - } - - /** - * @private - */ - _refreshTradingView() { - if (!this._chart) { - return null; - } - const { up, down, volume0, volume1 } = themes.getCurrentCandleSColor(this.candle); - const overrides = getOverrides(up, down); - const studiesOverrides = getStudiesOverrides({ volume0, volume1 }); - this._chart.applyOverrides(overrides); - this._chart.applyStudiesOverrides(studiesOverrides); - } - - /** - * @return {DexCandleChart} - * @private - */ - _createTradingView() { - this.loadingTradingView = true; - - const { up, down, volume0, volume1 } = themes.getCurrentCandleSColor(this.candle); - const themeConf = themes.getTradingViewConfig(this.theme); - const overrides = { ...getOverrides(up, down), ...themeConf.OVERRIDES }; - const studies_overrides = { - ...getStudiesOverrides({ volume0, volume1 }), - ...themeConf.STUDIES_OVERRIDES - }; - const toolbar_bg = themeConf.toolbarBg; - const custom_css_url = themeConf.customCssUrl; - - this._chart = new TradingView.widget({ - // debug: true, - locale: DexCandleChart._remapLanguageCode(i18next.language), - symbol: `${this._assetIdPair.amount}/${this._assetIdPair.price}`, - interval: user.getSetting('lastInterval'), - container_id: this.elementId, - datafeed: candlesService, - library_path: 'trading-view/', - autosize: true, - toolbar_bg, - disabled_features: DISABLED_FEATURES, - // enabled_features: ENABLED_FEATURES, - overrides, - studies_overrides, - custom_css_url, - timezone: Intl.DateTimeFormat().resolvedOptions().timeZone - }); - - this._chart.onChartReady(() => { - if (this._changeTheme) { - this._chart.applyOverrides(overrides); - this._chart.applyStudiesOverrides(studies_overrides); - } - - this._changeTheme = false; - this.loadingTradingView = false; - - if (this._assetIdPairWasChanged) { - this._setChartPair(); - this._assetIdPairWasChanged = false; - this._chartReady = true; - } - - this._chart.subscribe('onIntervalChange', (e) => { - user.setSetting('lastInterval', e); - }); - }); - this._chart.options.datafeed.onLoadError = () => { - this.notLoaded = true; - }; - return this; - } - - /** - * @private - */ - _setChartPair() { - this._chart.symbolInterval(({ interval }) => { - this._chart.setSymbol(`${this._assetIdPair.amount}/${this._assetIdPair.price}`, interval); - }); - } - - /** - * @private - */ - _changeLangHandler() { - return this._resetTradingView(); - } - - static _remapLanguageCode(code) { - switch (code) { - case 'hi_IN': - return 'en'; - case 'id': - return 'en'; - case 'zh_CN': - return 'zh'; - case 'pt_BR': - return 'pt'; - default: - return code; - } - } - - } - - return new DexCandleChart(); - }; - - controller.$inject = ['Base', 'candlesService', '$scope', 'themes', 'user']; - - controller.load = function () { - const script = document.createElement('script'); - script.src = '/trading-view/charting_library.min.js'; - const promise = new Promise((resolve, reject) => { - script.onload = resolve; - script.onerror = reject; - document.head.appendChild(script); - }); - controller.load = () => promise; - return promise; - }; - - angular.module('app.dex').component('wDexCandleChart', { - bindings: {}, - templateUrl: 'modules/dex/directives/dexCandleChart/dex-candle-chart.html', - transclude: false, - controller - }); -})(); diff --git a/src/modules/dex/directives/dexCandleChart/dex-candle-chart.html b/src/modules/dex/directives/dexCandleChart/dex-candle-chart.html deleted file mode 100644 index 83f9516687..0000000000 --- a/src/modules/dex/directives/dexCandleChart/dex-candle-chart.html +++ /dev/null @@ -1,15 +0,0 @@ -
- -
-
- - -
-
- -
- -
-
diff --git a/src/modules/dex/directives/dexCandleChart/dexCandleChart.less b/src/modules/dex/directives/dexCandleChart/dexCandleChart.less deleted file mode 100644 index 1cf9ac3c73..0000000000 --- a/src/modules/dex/directives/dexCandleChart/dexCandleChart.less +++ /dev/null @@ -1,46 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../../app/less/typography'; -@import (reference) 'icons'; - -.dex-candle-chart { - display: block; - width: 100%; - height: 100%; - - .candle-chart-wrapper { - width: 100%; - transition: .3s; - height: 100%; - - &.error { - display: flex; - - & > div { - text-align: center; - display: flex; - margin: auto; - - div:first-child { - .body-1(); - margin: 0 auto 5px auto; - color: @color-basic-700; - - &::before { - background-image: url(/img/icons/icon-empty.svg); - background-repeat: no-repeat; - width: 50px; - height: 52px; - margin: 0 auto 20px; - display: block; - content: ''; - } - } - - div:last-child { - color: @color-basic-500; - padding: 0 140px; - } - } - } - } -} diff --git a/src/modules/dex/directives/dexMyOrders/DexMyOrders.js b/src/modules/dex/directives/dexMyOrders/DexMyOrders.js deleted file mode 100644 index d56b5ba31b..0000000000 --- a/src/modules/dex/directives/dexMyOrders/DexMyOrders.js +++ /dev/null @@ -1,613 +0,0 @@ -(function () { - 'use strict'; - - const { SIGN_TYPE } = require('@waves/signature-adapter'); - const { filter, whereEq, uniqBy, prop, where, gt, pick, __, map } = require('ramda'); - const ds = require('data-service'); - const analytics = require('@waves/event-sender'); - const { BigNumber } = require('@waves/bignumber'); - const MAX_EXCHANGE_COUNT = 2000; - const { Money } = require('@waves/data-entities'); - - /** - * @param Base - * @param {Waves} waves - * @param {User} user - * @param {IPollCreate} createPoll - * @param {INotification} notification - * @param {app.utils} utils - * @param {$rootScope.Scope} $scope - * @param {DexDataService} dexDataService - * @param {ModalManager} modalManager - * @param {PermissionManager} permissionManager, - * @param {Ease} ease - * @param {JQuery} $element - * @param {Transactions} transactions - * @return {DexMyOrders} - */ - const controller = function ( - Base, - waves, - user, - createPoll, - notification, - utils, - $scope, - dexDataService, - modalManager, - permissionManager, - ease, - $element, - transactions - ) { - - /** - * @class - */ - class DexMyOrders extends Base { - - /** - * @type {{amount: string, price: string}} - * @private - */ - _assetIdPair; - /** - * @type {Promise} - * @private - */ - _matcherPublicKeyPromise = ds.fetch(user.getSetting('network.matcher')); - /** - * @type {Array} - */ - orders = []; - /** - * @type {boolean} - */ - isDemo = !user.address; - /** - * @type {boolean} - */ - pending = !!user.address; - /** - * @type {boolean} - */ - loadingError = false; - /** - * @type {boolean} - */ - showAnimations = false; - /** - * @type {boolean} - */ - isActiveOrders = false; - /** - * @type {Array} - */ - userList = []; - - - constructor() { - super(); - - this.syncSettings({ - _assetIdPair: 'dex.assetIdPair', - _matcherUrl: 'network.matcher' - }); - - this.observe('_matcherUrl', () => { - this._matcherPublicKeyPromise = ds.fetch(user.getSetting('network.matcher')); - }); - - user.getMultiAccountUsers().then(list => { - this.userList = list; - }); - } - - $postLink() { - this.headers = [ - { - id: 'pair', - valuePath: 'item.pair', - search: true, - placeholder: 'directives.filter' - }, - { - id: 'type', - title: { literal: 'directives.myOrders.type' }, - valuePath: 'item.type', - sort: true - }, - { - id: 'time', - title: { literal: 'directives.myOrders.time' }, - valuePath: 'item.timestamp', - sort: true, - sortActive: true, - isAsc: false - }, - { - id: 'amount', - title: { literal: 'directives.myOrders.amount' }, - valuePath: 'item.amount', - sort: true - }, - { - id: 'price', - title: { literal: 'directives.myOrders.price' }, - valuePath: 'item.price', - sort: true - }, - { - id: 'average', - title: { literal: 'directives.myOrders.average' }, - valuePath: 'item.average', - sort: true - }, - { - id: 'total', - title: { literal: 'directives.myOrders.total' }, - valuePath: 'item.total', - sort: true - }, - { - id: 'filled', - title: { literal: 'directives.myOrders.filled' }, - valuePath: 'item.filledTotal', - sort: true - }, - { - id: 'fee', - title: { literal: 'directives.myOrders.tableTitle.fee' }, - valuePath: 'item.userFee', - sort: true - }, - { - id: 'status', - title: { literal: 'directives.myOrders.status' }, - valuePath: 'item.progress', - sort: true - }, - this.isActiveOrders && { - id: 'controls', - templatePath: 'modules/dex/directives/dexMyOrders/header-control-cell.html', - scopeData: { - cancelAllOrdersClick: () => { - this.cancelAllOrders(); - }, - $ctrl: this - } - } || null - ].filter(Boolean); - - if (!this.isDemo) { - const poll = createPoll(this, this._getAllOrders, this._setOrders, 1000); - poll.ready.then(() => { - this.pending = false; - }); - this.receive(dexDataService.createOrder, () => poll.restart()); - this.poll = poll; - } - } - - /** - * @param {IOrder} order - */ - setPair(order) { - if (this.isLockedPair(order.assetPair.amountAsset.id, order.assetPair.priceAsset.id)) { - return null; - } - user.setSetting('dex.assetIdPair', { - amount: order.assetPair.amountAsset.id, - price: order.assetPair.priceAsset.id - }); - } - - cancelAllOrders() { - if (!permissionManager.isPermitted('CAN_CANCEL_ORDER')) { - const $notify = $element.find('.js-order-notification'); - DexMyOrders._animateNotification($notify); - return null; - } - - ds.cancelAllOrders({ - sender: user.publicKey, - timestamp: user.matcherSign.timestamp, - signature: user.matcherSign.signature - }) - .then(() => { - analytics.send({ name: 'Cancel All Orders', target: 'all' }); - - notification.info({ - ns: 'app.dex', - title: { literal: 'directives.myOrders.notifications.canceledAll' } - }); - - if (this.poll) { - this.poll.restart(); - } - }) - .catch(e => { - const error = utils.parseError(e); - notification.error({ - ns: 'app.dex', - title: { literal: 'directives.myOrders.notifications.somethingWentWrong' }, - body: { literal: error && error.message || error } - }); - }); - } - - /** - * @param data - * @return {number} - */ - round(data) { - return Math.round(Number(data)); - } - - /** - * @param {IOrder} order - * @return boolean - */ - isSelected(order) { - return this._assetIdPair.amount === order.amount.asset.id && - this._assetIdPair.price === order.price.asset.id; - } - - isLockedPair(amountAssetId, priceAssetId) { - return utils.isLockedInDex(amountAssetId, priceAssetId); - } - - /** - * - * @param order - * @return {Promise} - */ - dropOrderGetSignData(order) { - const { id } = order; - const data = { id }; - const signable = ds.signature.getSignatureApi().makeSignable({ - type: SIGN_TYPE.CANCEL_ORDER, - data - }); - - return utils.signMatcher(signable, order) - .then(signable => signable.getDataForApi()); - } - - /** - * @param order - */ - dropOrder(order) { - if (!permissionManager.isPermitted('CAN_CANCEL_ORDER')) { - const $notify = $element.find('.js-order-notification'); - DexMyOrders._animateNotification($notify); - return null; - } - - const dataPromise = this.dropOrderGetSignData(order); - - const classNameToOrder = (className, isRemove = false) => { - const $row = $element.find(`.order_${order.id}`).closest('.order-row'); - - if (isRemove) { - $row.removeClass(className); - } else { - $row.addClass(className); - } - }; - - classNameToOrder('pre-leave'); - - dataPromise - .then((signedTxData) => ds.cancelOrder(signedTxData, order.amount.asset.id, order.price.asset.id)) - .then(() => { - analytics.send({ name: 'Cancel Order', target: 'all' }); - - classNameToOrder('force-leave'); - const canceledOrder = this.orders.find(whereEq({ id: order.id })); - canceledOrder.state = 'Canceled'; - notification.info({ - ns: 'app.dex', - title: { literal: 'directives.myOrders.notifications.isCanceled' } - }); - - if (this.poll) { - this.poll.restart(); - } - }) - .catch(e => { - classNameToOrder('pre-leave', true); - const error = utils.parseError(e); - notification.error({ - ns: 'app.dex', - title: { literal: 'directives.myOrders.notifications.somethingWentWrong' }, - body: { literal: error && error.message || error } - }); - }); - } - - /** - * @param {Array} orders - * @private - */ - _setOrders(orders) { - let needApply = false; - - orders.forEach(order => { - const isNew = DexMyOrders._isNewOrder(order.timestamp.getTime()); - needApply = needApply || isNew !== order.isNew; - order.isNew = isNew; - }); - - if (needApply) { - $scope.$apply(); - } - - this.orders = orders; - - this.showAnimations = true; - } - - /** - * @return {Promise>} - * @private - */ - _getAllOrders() { - return waves.matcher.getOrders({ isActive: this.isActiveOrders }) - .then(filter(whereEq({ isActive: this.isActiveOrders }))) - .then(map(order => ({ ...order, isCancelled: order.status === 'Cancelled' }))) - .then(orders => { - if (this._isEqualOrders(orders) && this._isAllPartialFilledOrdersHasTransactions()) { - return this.orders; - } - - return this._matcherPublicKeyPromise - .then(matcherPublicKey => - Promise.all(orders.map(DexMyOrders._remapOrders(matcherPublicKey))) - ) - .then(result => { - const lastOrder = result.slice().reverse().find(where({ progress: gt(__, 0) })); - const exchanges = lastOrder ? - DexMyOrders._loadTransactions(lastOrder.timestamp.getTime()) : - Promise.resolve([]); - - return exchanges.then(txList => { - const hash = DexMyOrders._getTransactionsByOrderIdHash(txList); - this.loadingError = false; - return result.map(order => { - if (!hash[order.id]) { - hash[order.id] = []; - } - order.exchange = hash[order.id]; - order.average = - DexMyOrders._getAveragePriceByExchange(order, order.exchange); - order.filledTotal = order.price.cloneWithTokens( - order.average.getTokens().mul(order.filled.getTokens()) - ); - - return order; - }); - }).catch(() => result); - }); - }) - .catch(() => { - this.loadingError = true; - return []; - }); - } - - /** - * @param {Array} newOrders - * @return {boolean} - * @private - */ - _isEqualOrders(newOrders) { - return this.orders.length === newOrders.length && this.orders - .every((item, i) => whereEq(pick(['id', 'progress'], item), newOrders[i])); - } - - /** - * @return {boolean} - * @private - */ - _isAllPartialFilledOrdersHasTransactions() { - const minTimestamp = DexMyOrders._getMinTimestamp(); - let exchangeCount = 0; - return this.orders - .filter(where({ - progress: gt(__, 0), - timestamp: gt(__, minTimestamp) - })) - .every(order => { - exchangeCount += order.exchange.length; - return order.exchange.length && - order.filled.eq( - order.exchange - .map(tx => tx.amount) - .reduce((acc, amount) => acc.add(amount)) - ) || exchangeCount >= MAX_EXCHANGE_COUNT; - }); - } - - /** - * @param {IOrder} order - * @param {Array} exchangeList - * @private - */ - static _getAveragePriceByExchange(order, exchangeList) { - if (!exchangeList.length) { - return order.price; - } - - const sum = exchangeList - .map(tx => ({ - amount: tx.amount.getTokens(), - total: tx.total.getTokens() - })) - .reduce((acc, item) => ({ - amount: acc.amount.add(item.amount), - total: acc.total.add(item.total) - }), { - amount: new BigNumber(0), - total: new BigNumber(0) - }); - - return order.price.cloneWithTokens(sum.total.div(sum.amount)); - } - - /** - * @param $element - * @return {Promise} - * @private - */ - static _animateNotification($element) { - return utils.animate($element, { t: 100 }, { - duration: 1200, - step: function (tween) { - const progress = ease.bounceOut(tween / 100); - $element.css('transform', `translate(0, ${-100 + progress * 100}%)`); - } - }) - .then(() => utils.wait(700)) - .then(() => { - return utils.animate($element, { t: 0 }, { - duration: 500, - step: function (tween) { - const progress = ease.linear(tween / 100); - $element.css('transform', `translate(0, ${(-((1 - progress) * 100))}%)`); - } - }); - }); - } - - /** - * @param txList - * @return {Record} - * @private - */ - static _getTransactionsByOrderIdHash(txList) { - const uniqueList = uniqBy(prop('id'), txList); - const transactionsByOrderHash = Object.create(null); - uniqueList.forEach((tx) => { - ['order1', 'order2'].forEach((orderFieldName) => { - if (!transactionsByOrderHash[tx[orderFieldName].id]) { - transactionsByOrderHash[tx[orderFieldName].id] = []; - } - transactionsByOrderHash[tx[orderFieldName].id].push(DexMyOrders._remapTx(tx)); - }); - }); - return transactionsByOrderHash; - } - - static _remapTx(tx) { - const fee = (tx, order) => order.orderType === 'sell' ? tx.sellMatcherFee : tx.buyMatcherFee; - const userFee = [tx.order1, tx.order2] - .reduce((acc, order) => { - acc[order.orderType] = fee(tx, order); - return acc; - }, Object.create(null)); - - return { ...tx, userFee }; - } - - /** - * @param {IOrder} order - * @private - */ - static _remapOrders(matcherPublicKey) { - return order => { - const assetPair = order.assetPair; - const pair = `${assetPair.amountAsset.displayName} / ${assetPair.priceAsset.displayName}`; - const isNew = DexMyOrders._isNewOrder(order.timestamp.getTime()); - const percent = new BigNumber(order.progress * 100).toFixed(2); - const feeAsset = order.feeAsset || order.matcherFeeAssetId || 'WAVES'; - const matcherFee = order.fee || order.matcherFee; - if (matcherFee) { - if (matcherFee instanceof Money) { - return Promise.resolve({ ...order, isNew, percent, pair, fee: matcherFee }); - } - - return ds.api.assets.get(feeAsset).then(asset => { - const fee = new Money(matcherFee, asset); - return { ...order, isNew, percent, pair, fee }; - }); - } - - return waves.matcher.getCreateOrderFee({ ...order, matcherPublicKey }) - .then(fee => ({ ...order, isNew, percent, pair, fee })); - }; - } - - /** - * @param {number} timestamp - * @return {boolean} - * @private - */ - static _isNewOrder(timestamp) { - return ds.utils.normalizeTime(Date.now()) < timestamp + 1000 * 8; - } - - /** - * @param {number} lastTime - * @return {Promise>} - * @private - */ - static _loadTransactions(lastTime) { - const minTime = DexMyOrders._getMinTimestamp(); - return transactions.getExchangeTxList({ - sender: user.address, - timeStart: ds.utils.normalizeTime(minTime < lastTime ? lastTime : minTime) - }, { getAll: true, limit: MAX_EXCHANGE_COUNT }); - } - - /** - * @return {number} - * @private - */ - static _getMinTimestamp() { - const today = new Date(); - return new Date( - today.getFullYear(), - today.getMonth() - 2, - today.getDate(), - today.getHours(), - today.getMinutes() - ).getTime(); - } - - } - - return new DexMyOrders(); - }; - - controller.$inject = [ - 'Base', - 'waves', - 'user', - 'createPoll', - 'notification', - 'utils', - '$scope', - 'dexDataService', - 'modalManager', - 'permissionManager', - 'ease', - '$element', - 'transactions' - ]; - - angular.module('app.dex').component('wDexMyOrders', { - bindings: { - isActiveOrders: '<' - }, - templateUrl: 'modules/dex/directives/dexMyOrders/myOrders.html', - controller - }); -})(); - -/** - * @typedef {IOrder} IDexOrders - * @property {boolean} isNew - * @property {string} pair - * @property {Array} exchange - */ diff --git a/src/modules/dex/directives/dexMyOrders/header-control-cell.html b/src/modules/dex/directives/dexMyOrders/header-control-cell.html deleted file mode 100644 index 9e01dc21fa..0000000000 --- a/src/modules/dex/directives/dexMyOrders/header-control-cell.html +++ /dev/null @@ -1,10 +0,0 @@ - -
- -
-
diff --git a/src/modules/dex/directives/dexMyOrders/myOrders.html b/src/modules/dex/directives/dexMyOrders/myOrders.html deleted file mode 100644 index 25f3d8cbc7..0000000000 --- a/src/modules/dex/directives/dexMyOrders/myOrders.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - -
- -
- - - - - - -
- - - - {{::order.pair}} - - - - - - - - {{ ::order.timestamp | date:'MM-dd HH:mm:ss' }} - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- {{$ctrl.round(order.percent)}}% - -
-
-
-
-
-
- {{$ctrl.round(order.percent)}}% -
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
diff --git a/src/modules/dex/directives/dexMyOrders/myOrders.less b/src/modules/dex/directives/dexMyOrders/myOrders.less deleted file mode 100644 index 4ba804990d..0000000000 --- a/src/modules/dex/directives/dexMyOrders/myOrders.less +++ /dev/null @@ -1,141 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../../app/less/typography'; - -.dex-my-orders { - display: block; - width: 100%; - height: 100%; - overflow: hidden; - overflow-x: auto; - - /* ngRepeat animation*/ - - .repeatItemTransition.ng-enter, - .repeatItemTransition.ng-leave { - transition: ease-in-out 0.4s; - } - - - .repeatItemTransition.ng-enter, - .repeatItemTransition.ng-leave.ng-leave-active { - opacity: 0; - max-height: 0; - } - - .repeatItemTransition.ng-leave, - .repeatItemTransition.ng-enter.ng-enter-active { - opacity: 1; - max-height: 30px; - pointer-events: none; - - &.pre-leave { - opacity: 0.3; - } - - @media screen and (max-width: 1024px) { - max-height: 69px; - } - } - - .repeatItemTransition.pre-leave { - transition: opacity 0.4s; - opacity: 0.3; - max-height: 30px; - pointer-events: none; - - @media screen and (max-width: 1024px) { - max-height: 69px; - } - - &.force-leave { - transition: ease-in-out 0.4s; - opacity: 0; - max-height: 0; - @media screen and (max-width: 1024px) { - max-height: 0 !important; - } - } - } - - //end - .centered { - position: absolute; - width: 100%; - top: 50%; - left: 50%; - padding: 0 20px; - text-align: center; - transform: translate(-50%, -50%); - z-index: 1; - color: @color-basic-500; - } - - .order-side { - &.sell { - color: @color-error-400; - } - - &.buy { - color: @color-submit-400; - } - } - - w-input.orders-filter { - .w-input-wrap { - input[type="text"] { - padding: 0 8px 2px 21px; - background-image: url(/img/icons/input-search-icon.svg); - background-repeat: no-repeat; - background-size: 12px 12px; - background-position: 0 center; - font-size: 11px; - height: 27px; - line-height: 25px; - border: 0 none; - border-radius: 0; - width: 100%; - max-width: 110px; - } - } - } -} - -.tab_myOrderHistory { - .smart-table_dex-my-orders { - .smart-table__cell { - .decimal-muted { - color: @color-basic-900; - } - - &:not(:first-child):nth-child(odd) { - &, - .decimal-muted { - color: @color-basic-600; - } - } - } - } -} - -@media screen and (max-width: 1440px) { - .tab_myOpenOrders { - .smart-table_dex-my-orders { - .smart-table { - &__cell[data-column-id="average"], - &__cell[data-column-id="filled"] { - display: none; - } - } - } - } -} - -@media screen and (max-width: 1190px) { - .tab_myOrderHistory { - .smart-table_dex-my-orders { - .smart-table__tbody .smart-table__row { - padding-right: 14px; - } - } - } -} diff --git a/src/modules/dex/directives/dexMyOrders/order-status-bar.less b/src/modules/dex/directives/dexMyOrders/order-status-bar.less deleted file mode 100644 index bc9526d809..0000000000 --- a/src/modules/dex/directives/dexMyOrders/order-status-bar.less +++ /dev/null @@ -1,112 +0,0 @@ -@import (reference) '../../../app/less/typography'; -@import (reference) 'config'; - -.circle-holder { - position: absolute; - - .circle-loader { - display: none; - position: relative; - padding: 0; - width: 30px; - height: 30px; - border-radius: 50%; - line-height: 30px; - - &::after { - border: none; - position: absolute; - top: 2px; - left: 2px; - text-align: center; - display: block; - border-radius: 50%; - width: 26px; - height: 26px; - background-color: @color-white; - content: ''; - } - - span { - position: absolute; - line-height: 30px; - font-size: @font-size-caption-4; - width: 30px; - text-align: center; - display: block; - z-index: 2; - } - - .left-half-clipper { - border-radius: 50%; - width: 31px; - height: 31px; - position: absolute; - clip: rect(0, 30px, 30px, 15px); - } - - &.over50 .left-half-clipper { - clip: rect(auto, auto, auto, auto); - } - - .value-bar { - position: absolute; - clip: rect(0, 15px, 30px, 0); - width: 30px; - height: 30px; - border-radius: 50%; - box-sizing: border-box; - } - - &.over50 .first50-bar { - position: absolute; - clip: rect(0, 30px, 30px, 15px); - border-radius: 50%; - width: 30px; - height: 30px; - } - - &:not(.over50) .first50-bar { - display: none; - } - } -} - -// colors -.sell { - .circle-loader { - background-color: @circle-loader-bg-sell; // bg color - - .value-bar, - &.over50 .first50-bar { - border: 2px solid @color-error-500; // line color - } - - span { - color: @color-error-500; // text color - } - } -} - -.buy { - .circle-loader { - background-color: @circle-loader-bg-buy; // bg color - - .value-bar, - &.over50 .first50-bar { - border: 2px solid @color-submit-400; // line color - } - - span { - color: @color-submit-400; // text color - } - } -} - -@media screen and (max-width: 1190px) { - .circle-holder { - .circle-loader { - display: block; - } - } -} diff --git a/src/modules/dex/directives/dexWatchlist/DexWatchlist.html b/src/modules/dex/directives/dexWatchlist/DexWatchlist.html deleted file mode 100644 index 4f6bb5d0be..0000000000 --- a/src/modules/dex/directives/dexWatchlist/DexWatchlist.html +++ /dev/null @@ -1,114 +0,0 @@ -
- -
-
- -
- - - - {{::option.name}} - - -
-
- -
- - - - - -
-
-
- - -
-
- - -
-
-
- / - -
-
-
-
- - - -
- -
- - - - - - {{::pair.pairNames}} - - - - {{pair.lastPrice.toFormat() || '—'}} - - - {{ pair.change24.toFormat() }}{{ pair.change24 ? '%' : '—' }} - - - - -
- - {{$ctrl.volumeAsset.displayName}} -
-
- - - {{::pair.priceAsset.id}} - -
-
-
-
diff --git a/src/modules/dex/directives/dexWatchlist/DexWatchlist.less b/src/modules/dex/directives/dexWatchlist/DexWatchlist.less deleted file mode 100644 index db99e90e8c..0000000000 --- a/src/modules/dex/directives/dexWatchlist/DexWatchlist.less +++ /dev/null @@ -1,226 +0,0 @@ -@import (reference) 'config'; -@import (reference) "../../../app/less/typography"; -@import (reference) 'icons'; - -.dex-watchlist { - display: flex; - width: 100%; - height: 100%; - - &__wrapper { - width: 100%; - height: 100%; - position: relative; - display: flex; - flex-direction: column; - - @media screen and (max-width: 659px) { - min-height: 320px; - } - } - - .input-container { - position: relative; - display: inline-block; - width: 100%; - z-index: 4; - height: 32px; - min-height: 32px; - - w-help-icon { - position: absolute; - top: 50%; - right: 10px; - z-index: 10; - transform: translate(0, -50%); - - .help-icon { - &__content { - left: 0; - margin-top: 7px; - padding: 12px 12px 8px; - min-width: 235px; - transform: translate(calc(-50% ~'+ 15px'), 16px); - box-shadow: @shadow-tooltip-confirm; - @media screen and (max-width: 1024px) { - transform: translate(calc(-100% ~'+ 30px'), 16px); - } - } - } - } - } - - .search-input { - border-bottom-color: @color-basic-100; - - &:focus { - position: relative; - border-color: @color-submit-300; - z-index: 2; - } - - &.searching { - background-image: url(/img/icons/searching.svg); - } - } - - .not-found { - font-size: @font-size-caption-2; - margin: 14px 0 0 12px; - } - - .titles-wrap { - display: flex; - flex-direction: row; - justify-content: flex-start; - height: 40px; - background-color: @color-white; - box-sizing: border-box; - padding: 0; - position: relative; - border-bottom: 1px solid @color-basic-100; - - &::after { - display: none; - } - - .select { - w-option { - font-size: @font-size-caption-2; - color: @color-basic-700; - background: @color-white; - font-family: @font-roboto-medium; - - .option { - padding: 4px 35px 4px 15px; - color: @color-basic-700; - } - } - } - } - - div.title { - font-size: @font-size-caption-2; - color: @color-basic-700; - font-family: @font-roboto-medium; - display: block; - box-sizing: border-box; - line-height: 40px; - padding: 0 16px; - text-transform: uppercase; - position: relative; - z-index: 1; - margin: 0; - border: 1px solid transparent; - border-top: 0 none; - border-left: 1px solid transparent; - border-right: 1px solid transparent; - - &:not(.active) { - cursor: pointer; - } - - &.active { - border-bottom: 0 none; - position: relative; - border-left: 1px solid @color-basic-100; - border-right: 1px solid @color-basic-100; - - &::after { - display: block; - position: absolute; - top: 0; - left: -1px; - width: calc(100% ~'+ 2px'); - height: 2px; - content: ''; - background: @color-submit-400; - } - - &:first-child { - border-left: 1px solid transparent; - } - - &::before { - position: absolute; - bottom: -2px; - height: 2px; - width: 100%; - top: auto; - left: 0; - content: ''; - display: block; - z-index: 1; - background: @color-white; - } - } - } - - .select-hover { - position: absolute; - width: 50px; - height: 36px; - left: 179px; - z-index: 7; - top: 3px; - } - - i.icon-fav { - cursor: pointer; - margin-top: -3px; - display: inline-block; - vertical-align: middle; - background: @dex-star-icon center no-repeat; - width: 24px; - height: 24px; - float: right; - margin-right: 3px; - - &.active { - background: @dex-star-active-icon center no-repeat; - } - } - - div[data-block="watchlist"] { - w-dex-block { - .block-wrapper { - .dex-block-content { - overflow: visible; - } - } - } - } -} - -@media screen and (min-width: 2400px) { - .dex-watchlist { - &__wrapper a.title { - .titles-wrap { - height: 42px; - } - font-size: 13px; - } - - .wrapper { - .titles-wrap .select__wrap a.select__title { - font-size: 13px; - } - } - } - - - .dex-layout { - &__watchlist { - max-height: calc(100% ~'- 445px'); - width: 360px; - } - - &__watchlist-collapsed { - .dex-layout { - &__candlechart { - width: calc(100% ~'- 365px'); - } - } - } - } -} diff --git a/src/modules/dex/directives/dexWatchlist/FavouritesColumnHeader.html b/src/modules/dex/directives/dexWatchlist/FavouritesColumnHeader.html deleted file mode 100644 index 12a7bfdd60..0000000000 --- a/src/modules/dex/directives/dexWatchlist/FavouritesColumnHeader.html +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/src/modules/dex/directives/dexWatchlist/WatchList.js b/src/modules/dex/directives/dexWatchlist/WatchList.js deleted file mode 100644 index e8697d2285..0000000000 --- a/src/modules/dex/directives/dexWatchlist/WatchList.js +++ /dev/null @@ -1,867 +0,0 @@ -(function () { - 'use strict'; - - const TRADING_ASSETS = WavesApp.tradingPairs; - const DROP_DOWN_ORDER_LIST = ['ETH', 'BCH', 'LTC', 'USD', 'EUR', 'BSV']; - const DROP_DOWN_LIST = []; - - DROP_DOWN_ORDER_LIST.forEach((name) => { - DROP_DOWN_LIST.push({ name, id: WavesApp.defaultAssets[name] }); - }); - Object.keys(WavesApp.defaultAssets).forEach((name) => { - if (!DROP_DOWN_ORDER_LIST.includes(name) && name !== 'WAVES' && name !== 'BTC') { - DROP_DOWN_LIST.push({ name, id: WavesApp.defaultAssets[name] }); - } - }); - - /** - * @param Base - * @param {$rootScope.Scope} $scope - * @param {app.utils} utils - * @param {Waves} waves - * @param {STService} stService - * @param {PromiseControl} PromiseControl - * @param {IPollCreate} createPoll - * @param {JQuery} $element - * @param {ModalManager} modalManager - * @param {ConfigService} configService - * @param {Matcher} matcher - * @returns {WatchList} - */ - const controller = function (Base, $scope, utils, waves, stService, PromiseControl, createPoll, $element, - modalManager, configService, matcher) { - - const { - equals, uniq, not, - find, propEq, filter, - whereEq, uniqBy, prop, - path, flatten, splitEvery - } = require('ramda'); - - const ds = require('data-service'); - const { BigNumber } = require('@waves/bignumber'); - - $scope.WavesApp = WavesApp; - - class WatchList extends Base { - - /** - * @type {boolean} - */ - pending = false; - /** - * @type {boolean} - */ - loadingError = false; - /** - * @type {null} - */ - dropDownId = null; - /** - * @type {Array} - */ - dropDown = DROP_DOWN_LIST; - /** - * @type {boolean} - */ - isActiveSelect = false; - /** - * @type {PromiseControl} - */ - searchRequest = null; - /** - * @type {{name: string, value: string}[]} - */ - tabs = [ - { name: 'directives.watchlist.all', value: 'all' }, - { name: 'WAVES', value: WavesApp.defaultAssets.WAVES }, - { name: 'BTC', value: WavesApp.defaultAssets.BTC } - ]; - /** - * @type {string} - */ - search = ''; - /** - * @type {boolean} - */ - searchInProgress = false; - /** - * @type {string} - */ - activeTab = 'all'; - /** - * @type {boolean} - */ - showOnlyFavorite = false; - /** - * @type {Array} - */ - pairDataList = null; // TODO Remove disgusting hack - /** - * @type {boolean} - * @private - */ - _isSelfSetPair = false; - /** - * @type {Array} - * @private - */ - _searchAssets = []; - /** - * @type {Object} - * @private - */ - _searchAssetsHash = Object.create(null); - // /** - // * @type {Array} - // * @private - // */ - // _lastUserBalanceIdList = []; - /** - * @type {Array} - * @private - */ - _favourite = []; - /** - * @type {Object} - * @private - */ - _favoriteHash = Object.create(null); - /** - * @type {{amount: string, price: string}} - * @private - */ - _assetIdPair; - /** - * @type {Poll} - * @private - */ - _poll; - - /** - * @type {array} - * @private - */ - _lockedPairs = []; - - - constructor() { - super($scope); - /** - * @type {function} - * @private - */ - this._cache = utils.cache( - controller.storage, - WatchList._loadDataByPairs, - WatchList._getKeyByPair, - 1000 * 30, - pair => list => list.find(p => equals(p.pairIdList.slice().sort(), pair.slice().sort())) - ); - /** - * @type {*[]} - */ - this.headers = [ - { - id: 'favourite', - templatePath: 'modules/dex/directives/dexWatchlist/FavouritesColumnHeader.html', - scopeData: { - toggleOnlyFavourite: () => { - this.showOnlyFavorite = !this.showOnlyFavorite; - WatchList._renderSmartTable(); - }, - $ctrl: this - } - }, - { - id: 'pair', - title: { literal: 'directives.watchlist.pair' }, - sort: this._getComparatorByPath('pairNames') - }, - { - id: 'price', - title: { literal: 'directives.watchlist.price' }, - sort: this._getComparatorByPath('lastPrice') - }, - { - id: 'change', - title: { literal: 'directives.watchlist.chg' }, - sort: this._getComparatorByPath('change24') - }, - { - id: 'volume', - title: { literal: 'directives.watchlist.volume' }, - sortActive: true, - isAsc: false, - sort: this._getComparatorByPath('volume') - }, - { - id: 'info' - } - ]; - /** - * @type {SmartTable.ISmartTableOptions} - */ - this.tableOptions = { - filter: this._getTableFilter() - }; - } - - $postLink() { - // this._lastUserBalanceIdList = WatchList._getUserBalanceAssetIdList(); - - // this.receive(balanceWatcher.change, this._onChangeUserBalances, this); - this.observe('dropDownId', this._onChangeDropDown); - this.observe('_favourite', this._updateFavoriteHash); - this.observe('_searchAssets', this._updateSearchAssetHash); - this.observe('search', this._onChangeSearch); - - this.syncSettings({ - activeTab: 'dex.watchlist.activeTab', - showOnlyFavorite: 'dex.watchlist.showOnlyFavorite', - _favourite: 'dex.watchlist.favourite', - _assetIdPair: 'dex.assetIdPair' - }); - - this._initializeActiveTab(); - - this.observe('_assetIdPair', this._onChangeChosenPair); - this.observe('activeTab', this._onChangeActiveTab); - - stService.draw.once(WatchList._onRenderTable); - - this.pending = true; - this._poll = createPoll(this, this._getPairData, 'pairDataList', 1000 * 30, { $scope }); - - this._poll.ready.then(() => { - this.pending = false; - }); - } - - showAssetInfo(event, asset) { - event.preventDefault(); - event.stopPropagation(); - return modalManager.showAssetInfo(asset); - } - - /** - * @param {WatchList.IPairDataItem} pairData - * @return boolean - */ - isChosen(pairData) { - return this._assetIdPair.amount === pairData.amountAsset.id && - this._assetIdPair.price === pairData.priceAsset.id; - } - - isLockedPair(amountAssetId, priceAssetId) { - return utils.isLockedInDex(amountAssetId, priceAssetId); - } - - /** - * @param {WatchList.IPairDataItem} pairData - */ - choosePair(pairData) { - const pair = { - amount: pairData.amountAsset.id, - price: pairData.priceAsset.id - }; - if (this.isLockedPair(pair.amount, pair.price)) { - return null; - } - this._isSelfSetPair = true; - this._assetIdPair = pair; - this._isSelfSetPair = false; - } - - chooseTrading() { - this.isActiveSelect = false; - this.activeTab = 'trading'; - } - - chooseSelect() { - this.isActiveSelect = true; - this.activeTab = this.dropDownId; - } - - /** - * @param {string} id - */ - chooseTab(id) { - this.isActiveSelect = false; - this.activeTab = id; - } - - /** - * @param {JQueryEventObject} $event - * @param pair - */ - toggleFavourite($event, pair) { - $event.stopPropagation(); - - const key = WatchList._getKeyByPair(pair.pairIdList); - const favorite = this._favourite.slice(); - - if (this._favoriteHash[key]) { - const isEqualPair = p => equals(p, pair.pairIdList) || equals(p, pair.pairIdList.reverse()); - const predicate = p => not(isEqualPair(p)); - this._favourite = favorite.filter(predicate); - } else { - favorite.push(pair.pairIdList); - this._favourite = uniq(favorite); - } - WatchList._renderSmartTable(); - } - - /** - * @param pair - * @returns {boolean} - */ - isFavourite(pair) { - return !!this._favoriteHash[WatchList._getKeyByPair(pair.pairIdList)]; - } - - /** - * @return {boolean} - * @private - */ - _isActiveTrading() { - return this.activeTab === 'trading'; - } - - /** - * @private - */ - _initializeActiveTab() { - const isActiveSelect = !find(propEq('value', this.activeTab), this.tabs); - - if (isActiveSelect && !this._isActiveTrading()) { - this.isActiveSelect = true; - this.dropDownId = this.activeTab; - } - } - - /** - * @private - */ - _onChangeChosenPair() { - const pair = this._assetIdPair; - const id = [pair.amount, pair.price].sort().join(); - - if (!this._favoriteHash[id] && this.showOnlyFavorite) { - this.showOnlyFavorite = false; - } - - if (!find(propEq('id', id), this.pairDataList)) { - this._cache([id.split(',')]).then(([item]) => { - this.pairDataList.push(item); - WatchList._renderSmartTable(); - }); - } else { - WatchList._renderSmartTable(); - } - - if (!this._isSelfSetPair) { - this.activeTab = 'all'; - stService.draw.once(WatchList._onRenderTable); - } - } - - /** - * @private - */ - _onChangeDropDown() { - if (this.isActiveSelect) { - this.activeTab = this.dropDownId; - } - } - - /** - * @return {Promise} - * @private - */ - _getPairData() { - const pairs = this._getPairList(); - return Promise.all([ - this._getTabRate(), - this._cache(pairs) - ]) - .then(([rate, pairs]) => { - this.loadingError = false; - return pairs.map(WatchList._addRateForPair(rate)); - }) - .catch(() => { - this.loadingError = true; - }); - } - - /** - * @return {*} - * @private - */ - _getTabRate() { - const activeTab = this.activeTab; - - if (this._isActiveTrading()) { - return Promise.resolve(new BigNumber(1)); - } - - return waves.node.assets.getAsset(activeTab === 'all' ? WavesApp.defaultAssets.WAVES : activeTab) - .then((asset) => { - this.volumeAsset = asset; - - if (activeTab === 'all') { - return Promise.resolve(new BigNumber(1)); - } else { - return waves.utils.getRate(WavesApp.defaultAssets.WAVES, activeTab); - } - }); - } - - /** - * @returns {function (list: Array): Array} - * @private - */ - _getTableFilter() { - return list => { - const hasSearch = this.search !== ''; - if (hasSearch) { - return list.filter((item) => { - return this._filterDataItemByTab(item) && this._filterDataItemByQuery(item); - }); - } else { - return list.filter((item) => { - return this._filterDataItemByTab(item); - }); - } - }; - } - - /** - * @param {WatchList.IPairDataItem} item - * @returns {boolean} - * @private - */ - _filterDataItemByTab(item) { - - if (this._isActiveTrading()) { - return true; - } - - const canShow = this.showOnlyFavorite ? this.isFavourite(item) : true; - - if (this.activeTab === 'all') { - return canShow; - } - return canShow && ( - item.amountAsset.id === this.activeTab || - item.priceAsset.id === this.activeTab - ); - } - - /** - * @param {WatchList.IPairDataItem} item - * @returns {boolean} - * @private - */ - _filterDataItemByQuery(item) { - const query = this.search; - - const amountSearch = { - success: false, - names: [ - item.amountAsset.name.toLowerCase(), - item.amountAsset.ticker && item.amountAsset.ticker.toLowerCase() || null - ].filter(Boolean) - }; - - const priceSearch = { - success: false, - names: [ - item.priceAsset.name.toLowerCase(), - item.priceAsset.ticker && item.priceAsset.ticker.toLowerCase() || null - ].filter(Boolean) - }; - - const searchPair = [amountSearch, priceSearch]; - - function search(query) { - const queryList = query.split('/').map(q => q.trim()); - - if (queryList.length === 1) { - const q = query.toLowerCase(); - - if (WatchList._isId(query)) { - return item.pairIdList.includes(query); - } else { - return filter(whereEq({ success: false }), searchPair).some((searchItem) => { - searchItem.success = searchItem.names.some(n => n.indexOf(q) === 0); - return searchItem.success; - }); - } - } - - if (queryList[0] && queryList[1] === '') { - const q = queryList[0].toLowerCase(); - - if (WatchList._isId(queryList[0])) { - return item.pairIdList.includes(queryList[0]); - } else { - return searchPair.some((searchItem) => { - if (!searchItem.success) { - searchItem.success = searchItem.names.some(n => n === q); - } - return searchItem.success; - }); - } - } - - if (!queryList[0] && queryList[1]) { - return search(query.replace('/', '')); - } - - return search(queryList[0].trim()) && search(queryList[1].trim()); - } - - return search(query.trim()); - } - - /** - * @private - */ - _onChangeSearch() { - if (this.searchRequest) { - this.searchRequest.drop(); - this.searchInProgress = false; - this.pending = false; - this.searchRequest = null; - } - - const query = this.search; - this._searchAssets = []; - - const queryParts = query.split('/') - .slice(0, 2) - .map(q => q.replace(/[:()^]/g, '').trim()) - .filter(Boolean); - - if (!queryParts.length) { - WatchList._renderSmartTable(); - return null; - } - - this.searchInProgress = true; - this.pending = true; - this.loadingError = false; - - this.searchRequest = new PromiseControl(Promise.all(queryParts.map(waves.node.assets.search))) - .then(([d1 = [], d2 = []]) => { - this._searchAssets = uniqBy(prop('id'), d1.concat(d2)); - return this._poll.restart().then(() => { - this.searchInProgress = false; - this.pending = false; - this.searchRequest = null; - this.showOnlyFavorite = false; - $scope.$apply(); - }); - }) - .catch(() => { - this.searchInProgress = false; - this.pending = false; - this.searchRequest = null; - $scope.$apply(); - }); - } - - /** - * @private - */ - _updateFavoriteHash() { - this._favoriteHash = this._favourite.reduce((acc, pair) => { - acc[WatchList._getKeyByPair(pair)] = pair; - return acc; - }, Object.create(null)); - } - - /** - * @private - */ - _updateSearchAssetHash() { - this._searchAssetsHash = this._searchAssets.reduce((acc, asset) => { - acc[asset.id] = asset; - return acc; - }, Object.create(null)); - } - - /** - * @private - */ - _onChangeActiveTab() { - this.pending = true; - this.loadingError = false; - this._poll.restart().then(() => { - this.pending = false; - $scope.$apply(); - }); - } - - /** - * @return {Array>} - * @private - */ - _getTradingPairList() { - const assetsIds = TRADING_ASSETS; - return WatchList._uniqPairs(WatchList._getAllCombinations(assetsIds)); - } - - /** - * @private - */ - _getPairList() { - - if (this._isActiveTrading()) { - return this._getTradingPairList(); - } - const defaultAssets = configService.get('SETTINGS.DEX.WATCH_LIST_PAIRS') || []; - const favorite = (this._favourite || []) - .filter(item => item && item.filter(Boolean).length === 2) - .map(p => p.sort()); - const chosen = [this._assetIdPair.amount, this._assetIdPair.price].sort(); - const searchIdList = Object.keys(this._searchAssetsHash); - // const userBalances = this._lastUserBalanceIdList; - const assetsIds = Object.values(WavesApp.defaultAssets); - const idList = uniq(assetsIds.concat(searchIdList, defaultAssets)); - const other = WatchList._getAllCombinations(idList); - return WatchList._uniqPairs(favorite.concat(other, [chosen])); - } - - /** - * @param {string} dataPath - * @returns {function(list: Array, isAsc: boolean): Array} - * @private - */ - _getComparatorByPath(dataPath) { - return (list, isAsc) => { - const method = isAsc ? 'asc' : 'desc'; - const favorite = []; - const other = []; - const comparator = utils.comparators.process(path(dataPath.split('.'))).smart[method]; - - list.forEach((item) => { - if (this.isFavourite(item)) { - favorite.push(item); - } else { - other.push(item); - } - }); - - favorite.sort(comparator); - other.sort(comparator); - - return favorite.concat(other); - }; - } - - static _addRateForPair(rate) { - return pair => { - if (!pair.volume) { - return pair; - } - - const currentVolume = pair.volume.getTokens() - .mul(rate) - .roundTo(3, BigNumber.ROUND_MODE.ROUND_HALF_UP); - - return { ...pair, currentVolume }; - }; - } - - static _renderSmartTable() { - stService.render('watchlist'); - } - - static _onRenderTable(name) { - if (name !== 'watchlist') { - return null; - } - - setTimeout(function loop() { - const $chosen = $element.find('.chosen'); - - if (!$chosen.length) { - return null; - } - - const $body = $element.find('.smart-table__tbody'); - const scroll = $body.scrollTop(); - const chosenOffset = $chosen.offset().top; - const bodyOffset = $body.offset().top; - - const top = chosenOffset - bodyOffset + scroll - $body.height() / 2 + $chosen.height() / 2; - - $element.find('.smart-table__tbody').animate({ - scrollTop: top - }, 300); - }, 300); - } - - /** - * @param {string} query - * @returns {boolean} - * @private - */ - static _isId(query) { - return WatchList._getBytes(query) > 16 || query === 'WAVES'; - } - - /** - * @param {string} str - * @returns {number} - * @private - */ - static _getBytes(str) { - return new Blob([str], { type: 'text/plain' }).size; - } - - static _getAssetsFromPairs(pairs) { - return pairs.reduce((acc, item) => { - ['amountAsset', 'priceAsset'].forEach((propertyName) => { - if (!acc.hash[item.pair[propertyName].id]) { - acc.assets.push(item.pair[propertyName]); - acc.hash[item.pair[propertyName].id] = true; - } - }); - return acc; - }, { assets: [], hash: {} }).assets; - } - - /** - * @param {Array} pair - * @return string - * @private - */ - static _getKeyByPair(pair) { - return pair.sort().join(); - } - - /** - * @param pairs - * @private - */ - static _loadDataByPairs(pairs) { - const ids = flatten(pairs); - return ds.api.assets.get(ids) - .then(() => { - const promiseList = pairs.filter(p => p.length === 2) - .map(([assetId1, assetId2]) => ds.api.pairs.get(assetId1, assetId2)); - return Promise.all(promiseList); - }) - .then((pairs) => { - const promiseList = splitEvery(20, pairs).map((pairs) => { - return ds.api.pairs.info(matcher.currentMatcherAddress, pairs) - .then(infoList => infoList.map((data, i) => ({ - ...data, - pairNames: - `${pairs[i].amountAsset.displayName} / ${pairs[i].priceAsset.displayName}`, - pairIdList: [pairs[i].amountAsset.id, pairs[i].priceAsset.id] - }))) - .catch(() => pairs.map(WatchList._getEmptyPairData)); - }); - - return Promise.all(promiseList); - }) - .then(flatten); - } - - static _getEmptyPairData(pair) { - return { - amountAsset: pair.amountAsset, - priceAsset: pair.priceAsset, - pairNames: `${pair.amountAsset.displayName} / ${pair.priceAsset.displayName}`, - pairIdList: [pair.amountAsset.id, pair.priceAsset.id], - id: [pair.amountAsset.id, pair.priceAsset.id].sort().join(), - lastPrice: null, - firstPrice: null, - volume: null, - change24: null - }; - } - - /** - * @param {Array} assetIdList - * @return {Array>} - * @private - */ - static _getAllCombinations(assetIdList) { - const pairs = []; - - assetIdList.forEach((assetId, index) => { - assetIdList - .slice(index + 1) - .forEach((anotherAssetId) => { - pairs.push([assetId, anotherAssetId].sort(utils.comparators.asc)); - }); - }); - - return pairs; - } - - /** - * @param {Array>} pairs - * @return {Array>} - * @private - */ - static _uniqPairs(pairs) { - return Object.values(pairs.reduce((acc, pair) => { - acc[pair.join(',')] = pair; - return acc; - }, {})); - } - - // static _getUserBalanceAssetIdList() { - // return Object.keys(balanceWatcher.getBalance()) - // .filter(id => !user.scam[id]) - // .sort(utils.comparators.asc); - // } - - } - - return new WatchList(); - }; - - controller.storage = Object.create(null); - - controller.$inject = [ - 'Base', - '$scope', - 'utils', - 'waves', - 'stService', - 'PromiseControl', - 'createPoll', - '$element', - 'modalManager', - 'configService', - 'matcher' - ]; - - angular.module('app.dex') - .component('wDexWatchlist', { - templateUrl: 'modules/dex/directives/dexWatchlist/DexWatchlist.html', - controller - }); -})(); - -/** - * @name WatchList - */ - -/** - * @typedef {object} WatchList#IPairDataItem - * @property {string} id - * @property {AssetPair} pair - * @property {boolean} isFavorite - * @property {string} pairNames - * @property {Array} pairIdList - * @property {BigNumber} change24 - * @property {BigNumber} volume - */ diff --git a/src/modules/dex/directives/layout/DexLayoutSideBarToggle.html b/src/modules/dex/directives/layout/DexLayoutSideBarToggle.html deleted file mode 100644 index 30aad8e09a..0000000000 --- a/src/modules/dex/directives/layout/DexLayoutSideBarToggle.html +++ /dev/null @@ -1,9 +0,0 @@ -
-
-
\ No newline at end of file diff --git a/src/modules/dex/directives/layout/DexLayoutSideBarToggle.js b/src/modules/dex/directives/layout/DexLayoutSideBarToggle.js deleted file mode 100644 index 9e493241eb..0000000000 --- a/src/modules/dex/directives/layout/DexLayoutSideBarToggle.js +++ /dev/null @@ -1,42 +0,0 @@ -(function () { - 'use strict'; - - function controller() { - - class Controller { - - constructor() { - /** - * @type {Function} - */ - this.handleClick = angular.noop; - - /** - * @type {boolean} - */ - this.isHovered = false; - } - - setHovered() { - this.isHovered = true; - } - - setNotHovered() { - this.isHovered = false; - } - - } - - return new Controller(); - } - - angular.module('app.dex') - .component('wDexLayoutSideBarToggle', { - bindings: { - handleClick: '&', - side: '@' - }, - templateUrl: 'modules/dex/directives/layout/DexLayoutSideBarToggle.html', - controller - }); -})(); diff --git a/src/modules/dex/directives/layout/layout.html b/src/modules/dex/directives/layout/layout.html deleted file mode 100644 index ad20e974fc..0000000000 --- a/src/modules/dex/directives/layout/layout.html +++ /dev/null @@ -1,36 +0,0 @@ -
- -
-
-
- -
- -
- -
- -
- -
-
-
- -
-
-
-
- -
-
-
-
- - -
diff --git a/src/modules/dex/directives/layout/layout.js b/src/modules/dex/directives/layout/layout.js deleted file mode 100644 index 45f5049da6..0000000000 --- a/src/modules/dex/directives/layout/layout.js +++ /dev/null @@ -1,222 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {typeof Base} Base - * @param {ng.IQService} $q - * @param {ng.IAugmentedJQuery} $element - * @param {app.utils} utils - * @param {ng.IRootScopeService} $rootScope - * @param {VisibleService} visibleService - * @param {app.utils.decorators} decorators - * @return {Layout} - */ - const controller = function (Base, $q, $element, utils, $rootScope, visibleService, decorators) { - - class Layout extends Base { - - constructor() { - super(); - /** - * @type {Deferred} - * @private - */ - this._ready = $q.defer(); - /** - * @type {IDexLayoutDomContainer} - * @private - */ - this._dom = null; - this._children = { - watchlist: null, - candlechart: null, - orderbook: null, - tradehistory: null, - createorder: null, - tradevolume: null - }; - /** - * @type {JQuery} - * @private - */ - this._node = null; - /** - * - * @type {boolean} - * @private - */ - this._watchlistCollapsed = null; - /** - * - * @type {boolean} - * @private - */ - this._orderbookCollapsed = null; - - this.isPhone = $rootScope.isPhone; - this.isTablet = $rootScope.isTablet; - this.isDesktop = $rootScope.isDesktop; - this.isNotPhone = $rootScope.isNotPhone; - this.isNotDesktop = $rootScope.isNotDesktop; - - this.syncSettings({ - _watchlistCollapsed: 'dex.layout.watchlist.collapsed', - _orderbookCollapsed: 'dex.layout.orderbook.collapsed' - }); - - this.observe(['_watchlistCollapsed', '_orderbookCollapsed'], this._onChangeCollapsed); - } - - $postLink() { - this._node = $element.find('.dex-layout'); - this._dom = { - watchlist: Layout._getColumn('watchlist'), - candlechart: Layout._getColumn('candlechart'), - orderbook: Layout._getColumn('orderbook'), - tradehistory: Layout._getColumn('tradehistory'), - createorder: Layout._getColumn('createorder'), - tradevolume: Layout._getColumn('tradevolume') - }; - - const watchlistCollapsed = this._watchlistCollapsed; - const orderbookCollapsed = this._orderbookCollapsed; - const base = 'dex-layout'; - - this._node.get(0).className = 'dex-layout'; - this._node.toggleClass(`${base}_watchlist-collapsed`, watchlistCollapsed); - this._node.toggleClass(`${base}_orderbook-collapsed`, orderbookCollapsed); - this._dom.watchlist.$slider.toggleClass(`${base}__sidebar-toggle-open`, !watchlistCollapsed); - this._dom.orderbook.$slider.toggleClass(`${base}__sidebar-toggle-open`, !orderbookCollapsed); - - this._ready.resolve(); - } - - /** - * @param {JQuery} $element - * @param {DexBlock} item - */ - registerItem($element, item) { - const { block } = item; - - if (!block) { - throw new Error('Wrong item address!'); - } - - this._ready.promise.then(() => { - if (!this._children[block]) { - this._children[block] = item; - this._dom[block].$container.append($element); - } else { - throw new Error('Duplicate child block!'); - } - }); - } - - /** - * @param $event - */ - closeCreateOrder($event) { - angular.element($event.delegateTarget).parent().removeClass('expanded'); - } - - collapseBlock(block, collapsed) { - this._node.toggleClass(`dex-layout_${block}-collapsed`, collapsed); - } - - toggleColumn(column) { - switch (column) { - case 'watchlist': - this._watchlistCollapsed = !this._watchlistCollapsed; - break; - case 'orderbook': - this._orderbookCollapsed = !this._orderbookCollapsed; - break; - default: - throw new Error('Wrong column name!'); - } - } - - @decorators.async(300) - updateVisible() { - visibleService.updateSort(); - } - - _onChangeCollapsed() { - const watchlist = this._watchlistCollapsed; - const orderbook = this._orderbookCollapsed; - const base = 'dex-layout'; - - utils.animateByClass(this._dom.candlechart.$wrapper, 'ghost', true, 'opacity') - .then(() => { - this._dom.candlechart.$wrapper.hide(); - this._dom.watchlist.$slider.toggleClass(`${base}__sidebar-toggle-open`, !watchlist); - this._dom.orderbook.$slider.toggleClass(`${base}__sidebar-toggle-open`, !orderbook); - - const endCollapseAnimations = utils.whenAll([ - utils.animateByClass(this._node, `${base}_watchlist-collapsed`, watchlist, 'transform'), - utils.animateByClass(this._node, `${base}_orderbook-collapsed`, orderbook, 'transform') - ]); - - const notWorking = new Promise((resolve, reject) => { - setTimeout(reject, 3000); - }); - - return Promise.race([endCollapseAnimations, notWorking]) - .catch(() => { - /* eslint no-console: "off" */ - console.warn('Not working css animation end event!'); - }); - }) - .then(() => { - this._dom.candlechart.$wrapper.show(); - return utils.wait(0); - }) - .then(() => { - utils.animateByClass(this._dom.candlechart.$wrapper, 'ghost', false, 'opacity'); - }); - } - - /** - * @param {string} type - * @return {IDexLayoutDomContainerItem} - * @private - */ - static _getColumn(type) { - const $container = $element.find(`[data-block="${type}"]`); - const $wrapper = $container.parent(); - const $slider = $wrapper.find('[data-slider]'); - - return { $wrapper, $container, $slider }; - } - - } - - return new Layout(); - }; - - controller.$inject = ['Base', '$q', '$element', 'utils', '$rootScope', 'visibleService', 'decorators']; - - angular.module('app.dex') - .component('wLayout', { - scope: false, - bindings: {}, - templateUrl: 'modules/dex/directives/layout/layout.html', - transclude: true, - controller - }); -})(); - -/** - * @typedef {object} IDexLayoutDomContainerItem - * @property {JQuery} $wrapper - * @property {JQuery} $container - * @property {JQuery} $slider - * @property {DexBlock} child - */ - -/** - * @typedef {object} IDexLayoutDomContainer - * @property {IDexLayoutDomContainerItem} left - * @property {IDexLayoutDomContainerItem} center - * @property {IDexLayoutDomContainerItem} right - */ diff --git a/src/modules/dex/directives/layout/less/dex-layout.less b/src/modules/dex/directives/layout/less/dex-layout.less deleted file mode 100644 index 3e07e33b99..0000000000 --- a/src/modules/dex/directives/layout/less/dex-layout.less +++ /dev/null @@ -1,319 +0,0 @@ -@import (reference) "../../../../app/less/typography"; -@import (reference) 'config'; -@import (reference) 'icons'; - -.layout { - width: 100%; - height: 100%; - display: flex; -} - -.dex-layout { - width: 100%; - height: 100%; - min-height: 500px; - position: relative; - overflow: hidden; - - &__column { - background: @color-white; - height: 100%; - position: absolute; - transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; - } - - &__block { - height: 100%; - width: 100%; - } - - &_tradevolume-collapsed { - .dex-layout { - &__column_orderbook { - .dex-layout { - &__block[data-block="orderbook"] { - height: calc(100% ~'- 38px'); - } - - &__block[data-block="tradevolume"] { - height: 37px; - overflow: hidden; - - .block-title i { - transform: rotate(-180deg); - } - } - } - } - } - } - - .dex-layout-side-bar-toggle { - width: 19px; - position: relative; - - &[side="left"] { - .dex-layout { - &__sidebar-toggle { - left: 0; - border-right: 1px solid @color-basic-100; - } - } - } - - &[side="right"] { - .dex-layout { - &__sidebar-toggle { - right: 0; - border-left: 1px solid @color-basic-100; - } - } - } - } - - &__sidebar-toggle { - height: 100%; - width: 19px; - min-width: 19px; - z-index: 1; - bottom: 0; - left: 0; - position: absolute; - - &.active { - background: @color-basic-50; - div { - &::after { - background: url(/img/icons/dex-toggle-active.svg) center no-repeat; - } - } - } - - div { - position: relative; - top: 50%; - left: 0; - cursor: pointer; - width: 100%; - height: 40px; - margin-top: -20px; - - &::after { - content: ""; - display: block; - margin: -7px auto 0 auto; - right: 0; - left: 0; - top: 50%; - position: absolute; - height: 15px; - width: 15px; - background: @dex-toggle-icon center no-repeat; - } - } - - &-left { - transition: .3s; - div { - &::after { - transform: rotate(90deg); - } - } - } - - &-right { - transition: .3s; - div { - &::after { - transform: rotate(-90deg); - } - } - } - } - - .empty-block, - .error-block { - position: absolute; - transform: translate(-50%, -50%); - top: 50%; - left: 50%; - - .icon { - margin-top: 0; - } - } - - .tooltip-dex { - max-width: 300px; - display: none; - position: absolute; - padding: 0 10px; - top: 25px; - right: 149px; - transform-origin: center; - color: @color-white; - font-size: @font-size-caption-2; - line-height: 25px; - cursor: pointer; - text-shadow: 0 1px 6px rgba(78, 92, 110, 0.6); - z-index: 10; - width: auto; - text-align: center; - white-space: nowrap; - - span { - overflow: hidden; - text-overflow: ellipsis; - display: inline-block; - text-align: center; - } - - &::before { - position: absolute; - content: ''; - z-index: -1; - top: -5px; - right: 10px; - opacity: .8; - width: 0; - height: 0; - border: 5px solid transparent; - border-bottom-color: @color-basic-700; - border-top: 0 none; - transform: translate(0); - } - - &::after { - opacity: .8; - border-radius: @border-radius; - position: absolute; - background: @color-basic-700; - width: 100%; - height: 26px; - content: ''; - left: 0; - top: 0; - z-index: -1; - } - - &.right { - right: 10px; - } - } - - .order-permission-error, - .create-order-notification { - will-change: transform; - position: absolute; - transform: translate(0, -100%); - color: @white-only; - z-index: 10; - width: 100%; - padding: 10px 0; - text-align: center; - display: flex; - justify-content: center; - align-items: center; - background-color: @color-submit-400; - font-family: @font-roboto-medium; - - i.icon { - margin-right: 5px; - display: inline-block; - width: 13px; - height: 13px; - vertical-align: middle; - } - - &.success { - background-color: @color-submit-400; - i.icon { - background: url(/img/icons/checkbox-icon.svg) no-repeat center center; - } - } - - &.error { - background-color: @color-error-400; - i.icon { - background: url(/img/icons/white-cancel-icon.svg) no-repeat center center; - } - } - } -} - -//hi-res -@media screen and (min-width: 2400px) { - .dex-layout { - &__column { - min-width: 360px; - } - - &__block { - min-width: 360px; - } - - &__row { - font-size: 12px; - } - - .dex-block .block-title { - height: 42px; - } - - .tabs .titles-wrap { - height: 42px; - - a.title { - height: 42px; - } - } - - .caption-2 { - font-size: 12px; - } - - &_tradevolume-collapsed { - .dex-layout__column_orderbook { - .dex-layout__block[data-block="tradevolume"] { - height: 41px; - } - } - } - } -} - -// responsive -@media screen and (min-width: 660px) and (max-width: 1024px) { - .dex-layout { - overflow: visible; - } -} - -@media screen and (max-width: 659px) { - .dex-layout { - overflow: visible; - height: auto; - display: flex; - flex-direction: column; - justify-content: space-between; - - &__column { - position: relative; - } - - .dex-layout-side-bar-toggle { - display: none; - } - - &_tradevolume-collapsed { - .dex-layout { - &__column_orderbook { - w-scroll-box { - min-height: 293px; - } - } - } - } - } -} - diff --git a/src/modules/dex/directives/layout/less/dex-layout__column_candlechart.less b/src/modules/dex/directives/layout/less/dex-layout__column_candlechart.less deleted file mode 100644 index 660026ca02..0000000000 --- a/src/modules/dex/directives/layout/less/dex-layout__column_candlechart.less +++ /dev/null @@ -1,78 +0,0 @@ -@import (reference) "../../../../app/less/typography"; -@import (reference) 'config'; -@import (reference) 'icons'; - -.dex-layout { - &__column_candlechart { - width: calc(~'100%' - (@dexLayoutWatchlist + @dexLayoutOrderBook + @dexLayoutGap * 2)); - max-height: calc(100% ~'- 325px'); - position: absolute; - border-radius: @border-radius / 2; - display: flex; - transition: .3s; - transform: translateX((@dexLayoutWatchlist + @dexLayoutGap)); - - .block-title { - display: none; - } - } -} - -@media screen and (min-width: 2400px) { - .dex-layout { - &__column_candlechart { - max-height: calc(100% ~'- 445px'); - width: calc(100% ~'- 730px'); - transform: translateX(365px); - } - } -} - -@media screen and (min-width: 660px) and (max-width: 1024px) { - .dex-layout { - &__column_candlechart { - width: calc(50% ~' - 2px'); - min-width: 320px; - max-height: calc(50% ~ '- 45px'); - transform: translate(0); - right: 0px; - - .dex-layout { - &__sidebar-toggle-right { - display: none; - } - } - - .dex-layout-side-bar-toggle[side="right"] { - display: none; - } - } - } -} - -@media screen and (max-width: 659px) { - .dex-layout { - &__column_candlechart { - min-width: 100%; - max-height: 320px; - min-height: 320px; - height: 320px; - transform: translateX(0); - margin-bottom: 5px; - order: 1; - border-radius: @border-radius/2; - position: relative; - - .dex-layout { - - &__block { - border: 0 none; - } - - &__sidebar-toggle { - display: none; - } - } - } - } -} diff --git a/src/modules/dex/directives/layout/less/dex-layout__column_createorder.less b/src/modules/dex/directives/layout/less/dex-layout__column_createorder.less deleted file mode 100644 index fd28b2fcb5..0000000000 --- a/src/modules/dex/directives/layout/less/dex-layout__column_createorder.less +++ /dev/null @@ -1,240 +0,0 @@ -@import (reference) "../../../../app/less/typography"; -@import (reference) 'config'; -@import (reference) 'icons'; - -.dex-layout { - &__column_createorder { - max-height: 320px; - min-height: 320px; - bottom: 0; - right: 0; - width: @dexLayoutCreateOrder; - background-color: transparent; - border-radius: @border-radius / 2; - - .block-title { - display: none; - } - - .mask { - background: @mask-default; - position: absolute; - left: 0; - right: 0; - bottom: 0; - opacity: .5; - height: 100%; - z-index: 5; - display: none; - } - } -} - -@media screen and (min-width: 2400px) { - .dex-layout { - &__column_createorder { - max-height: 440px; - width: 360px; - - .body .making-order { - .fields { - padding: 15px 25px 15px; - } - - .expiration { - margin: 10px 0; - } - - .areas .area { - height: 42px; - line-height: 38px; - } - - .fields { - .input-like { - height: 42px; - - .asset-name-wrap div { - line-height: 28px; - } - } - - .field-label { - margin-top: 15px; - padding-bottom: 4px; - } - - .place-order { - height: 42px; - } - - .input input { - height: 42px; - } - } - } - } - } -} - -@media screen and (max-width: 1024px) { - .dex-layout { - &__column_createorder { - margin-left: -5px; - margin-right: -5px; - width: calc(100% ~'+ 10px'); - height: 80px; - max-height: none; - min-height: auto; - position: absolute; - bottom: 0; - z-index: 7; - box-shadow: @shadow-dex-open; - - .dex-layout { - &__block { - width: 100%; - position: absolute; - z-index: 8; - bottom: 0; - height: 80px; - } - } - - &.expanded { - z-index: 10; - height: calc(100% ~'+ 10px'); - top: -5px; - - .dex-layout { - &__block { - height: 386px; - } - } - - .mask { - display: block; - } - - .head { - .icon-close { - display: block; - } - } - - .body { - .making-order { - - .areas { - display: none; - } - - .choice { - display: flex; - border-bottom: 1px solid @color-disabled-100; - - .buy { - background: @color-white; - flex-basis: 50%; - text-align: left; - padding-left: 25px; - } - - .sell { - background: @color-white; - flex-basis: 50%; - text-align: right; - padding-right: 25px; - } - - .middle { - position: absolute; - left: 50%; - top: 0; - color: @color-submit-400; - height: 49px; - width: 80px; - transform: translate(-50%, 0); - } - - } - - &.buy { - .buy { - background: rgba(31, 90, 245, 0.1); - - .price { - span { - color: @color-submit-400; - } - } - - .name { - color: @color-submit-400; - } - } - - .sell { - .price { - span { - color: @color-basic-900; - } - } - - .name { - color: @color-basic-500; - } - } - } - - &.sell { - .buy { - .price { - span { - color: @color-basic-900; - } - } - - .name { - color: @color-basic-500; - } - } - - .sell { - background: rgba(239, 72, 41, 0.1); - - .price { - span { - color: @color-error-500; - } - } - - .name { - color: @color-error-500; - } - } - - .middle { - color: @color-error-500; - } - } - } - } - } - } - } -} - -@media screen and (max-width: 659px) { - .dex-layout { - &__column_createorder { - position: fixed; - box-shadow: @shadow-create-order; - - &.expanded { - bottom: 0; - top: auto; - } - } - } -} diff --git a/src/modules/dex/directives/layout/less/dex-layout__column_orderbook.less b/src/modules/dex/directives/layout/less/dex-layout__column_orderbook.less deleted file mode 100644 index 19e7ef9fcc..0000000000 --- a/src/modules/dex/directives/layout/less/dex-layout__column_orderbook.less +++ /dev/null @@ -1,244 +0,0 @@ -@import (reference) "../../../../app/less/typography"; -@import (reference) 'config'; -@import (reference) 'icons'; - -.dex-layout { - &__column_orderbook { - width: @dexLayoutOrderBook; - max-height: calc(100% ~'- 325px'); - right: 0; - transition: .3s; - margin-left: 5px; - border-radius: @border-radius / 2; - background: @color-white; - display: flex; - flex-shrink: 0; - - .dex-layout { - &__sidebar-toggle { - position: absolute; - display: none; - left: 1px; - border-right: 1px solid @color-basic-100; - } - } - - .dex-layout { - &__block[data-block="orderbook"] { - transition: .3s; - height: calc(100% ~'- 200px'); - - .block-wrapper, - .scroll-box { - background: none transparent; - } - } - - &__block[data-block="tradevolume"] { - transition: .3s; - height: 186px; - bottom: 0; - position: absolute; - z-index: 6; - - .block-title { - border-top: 1px solid @color-basic-100; - } - - .dex-block-top-btn:last-child { - display: none; - } - } - } - - .table__row { - &:hover { - .tooltip-dex.active { - display: flex; - } - } - } - } - - &_orderbook-collapsed { - .dex-layout { - &__column_orderbook { - transform: translateX(100%); - } - - &__column_candlechart { - width: calc(~'100%' - (@dexLayoutWatchlist + @dexLayoutGap)); - - .dex-layout { - &__sidebar-toggle-right div::after { - transform: rotate(90deg); - } - } - } - } - } -} - -@media screen and (min-width: 2400px) { - .dex-layout { - &__column_orderbook { - width: 360px; - max-height: calc(100% ~'- 445px') !important; - - .row { - font-size: 12px; - } - - .info { - font-size: 11px; - } - } - - &__orderbook-collapsed { - .dex-layout { - &__candlechart { - width: calc(100% ~'- 365px'); - } - } - } - } -} - -@media screen and (min-width: 660px) and (max-width: 1024px) { - .dex-layout { - &__column_orderbook { - width: calc(50% ~' - 2px'); - min-width: 320px; - min-height: calc(50% ~'- 40px'); - max-height: calc(50% ~'- 40px'); - height: calc(50% ~'- 40px'); - right: 0; - bottom: 80px; - transform: translate(0); - padding-left: 19px; - - .dex-layout { - &__sidebar-toggle-left { - display: block; - border-radius: 2px 0 0 2px; - - div::after { - transform: rotate(270deg); - } - } - - &__block-top { - height: 100%; - } - - &__block-bottom { - display: none; - } - - &__block[data-block="tradevolume"] { - width: calc(100% ~'- 21px'); - height: 211px; - } - } - - .dex-layout-side-bar-toggle[side="left"] { - .dex-layout { - &__sidebar-toggle { - left: -19px; - } - } - } - } - - &_orderbook-collapsed { - .dex-layout { - &__column_orderbook { - background: none transparent; - min-width: 20px; - width: 20px; - right: 19px; - - .dex-layout-side-bar-toggle { - position: absolute; - height: 100%; - width: 19px; - left: 0; - background: #fff; - border-radius: 0 2px 2px 0; - - .dex-layout { - &__sidebar-toggle { - border-right: 0 none; - border-left: 1px solid @color-basic-100; - left: 0; - div::after { - transform: rotate(-270deg); - } - } - } - } - - .dex-layout { - &__block { - min-width: 0; - display: none; - } - } - } - - &__column_tradehistory { - border-radius: 2px 0 0 2px; - width: calc(100% ~' - 19px'); - } - - &__block-orderbook-bottom-collapsed { - .dex-layout { - &__orderbook { - .dex-layout__block-top { - height: 100%; - } - } - } - } - - &__column_candlechart { - width: calc(50% ~'- 3px') - } - } - } - } -} - -@media screen and (min-width: 1024px) { - .dex-layout__column_orderbook { - .dex-layout-side-bar-toggle[side="left"] { - width: 0; - } - } -} - -@media screen and (max-width: 659px) { - .dex-layout { - &__column_orderbook { - width: 100%; - max-height: 420px; - margin-left: 0; - order: 2; - margin-bottom: 5px; - - .dex-layout { - &__block[data-block="tradevolume"] { - height: 176px; - } - } - } - - &_orderbook-collapsed { - .dex-layout { - &__column_orderbook { - transform: translate(0px); - } - } - } - } -} diff --git a/src/modules/dex/directives/layout/less/dex-layout__column_tradehistory.less b/src/modules/dex/directives/layout/less/dex-layout__column_tradehistory.less deleted file mode 100644 index 5e74dc5822..0000000000 --- a/src/modules/dex/directives/layout/less/dex-layout__column_tradehistory.less +++ /dev/null @@ -1,167 +0,0 @@ -@import (reference) "../../../../app/less/typography"; -@import (reference) 'config'; -@import (reference) 'icons'; - -.dex-layout { - &__column_tradehistory { - max-height: 320px; - min-height: 320px; - bottom: 0; - left: 0; - width: calc(~'100%' - (@dexLayoutOrderBook + @dexLayoutGap)); - border-radius: @border-radius / 2; - transition: .3s !important; - - .block-title { - display: none; - } - - .sign-in-message { - position: absolute; - display: inline-block; - text-align: center; - max-width: 90%; - width: 100%; - top: 50%; - transform: translate(5%, -50%); - color: @color-basic-500; - } - - .tabs { - ::-webkit-scrollbar { - height: 0; - } - - :hover::-webkit-scrollbar { - height: 0; - } - - ::-webkit-scrollbar-thumb { - height: 0; - } - - ::-webkit-scrollbar-thumb:window-inactive { - height: 0; - } - - .tab-tem { - overflow-x: auto; - } - - .tab-body-wrap { - height: calc(100% ~'- 39px'); - } - - .titles-wrap { - overflow-y: hidden; - overflow-x: auto; - height: 39px; - padding: 0; - display: flex; - position: relative; - - &::before { - display: none; - } - - &:after { - content: ''; - display: block; - position: absolute; - width: 100%; - height: 1px; - left: 0; - bottom: 0; - background: @color-basic-100; - } - - .title { - color: @color-basic-700; - height: 38px; - font-size: 13px; - margin: 0; - padding: 0 20px; - line-height: 40px; - border: 0 none; - font-family: @font-roboto-medium; - position: relative; - border-left: 1px solid transparent; - border-right: 1px solid transparent; - white-space: nowrap; - - &.active:first-child { - border-left: 1px solid @color-white; - } - - &.active { - color: @color-basic-700; - background: @color-white; - border-bottom: 1px solid @color-white; - border-right: 1px solid @color-disabled-200; - border-left: 1px solid @color-disabled-200; - - &::before { - display: block; - position: absolute; - top: 0; - left: 0; - width: 100%; - content: ''; - height: 2px; - background: @color-submit-400; - } - - &:after { - position: absolute; - bottom: -2px; - height: 2px; - width: 100%; - left: 0; - content: ''; - display: block; - z-index: 1; - background: @color-white; - } - } - } - } - } - } -} - -@media screen and (min-width: 2400px) { - .dex-layout { - &__column_tradehistory { - max-height: 440px; - width: calc(100% ~'- 365px'); - } - } -} - -@media screen and (min-width: 660px) and (max-width: 1024px) { - .dex-layout { - &__column_tradehistory { - width: calc(50% ~' - 3px'); - min-width: 320px; - min-height: calc(50% ~'- 40px'); - max-height: calc(50% ~'- 40px'); - height: calc(50% ~'- 40px'); - left: 0; - bottom: 80px; - } - } -} - -@media screen and (max-width: 659px) { - .dex-layout { - &__column_tradehistory { - width: 100%; - margin-bottom: 5px; - order: 3; - - .dex-layout__block { - height: 304px; - } - } - } -} diff --git a/src/modules/dex/directives/layout/less/dex-layout__column_watchlist.less b/src/modules/dex/directives/layout/less/dex-layout__column_watchlist.less deleted file mode 100644 index 9fccc9d8d7..0000000000 --- a/src/modules/dex/directives/layout/less/dex-layout__column_watchlist.less +++ /dev/null @@ -1,143 +0,0 @@ -@import (reference) "../../../../app/less/typography"; -@import (reference) 'config'; -@import (reference) 'icons'; - -.dex-layout { - &__column_watchlist { - transition: .3s; - width: @dexLayoutWatchlist; - max-height: calc(100% ~'- 325px'); - border-radius: @border-radius / 2; - overflow: visible; - - .block-title { - display: none; - } - - .dex-block-title { - line-height: 17px; - border-bottom: 1px dashed @color-submit-400; - cursor: pointer; - } - - .tabs { - .title { - text-transform: uppercase; - } - } - } - - &_watchlist-collapsed { - .dex-layout { - &__column_watchlist { - transform: translateX(-100%); - } - - &__column_candlechart { - transform: translateX(0); - width: calc(~'100%' - (@dexLayoutWatchlist + @dexLayoutGap)); - - .dex-layout { - &__sidebar-toggle-left div::after { - transform: rotate(-90deg); - } - } - } - } - - &.dex-layout_orderbook-collapsed { - .dex-layout { - &__column_watchlist { - overflow: hidden; - margin-right: 0; - transform: translateX(-100%); - } - - &__column_candlechart { - width: 100%; - flex-grow: 1; - transform: translate(0); - } - - &__column_orderbook { - overflow: hidden; - margin-left: 0; - transform: translateX(100%); - } - } - } - } -} - -@media screen and (min-width: 660px) and (max-width: 1024px) { - .dex-layout { - &__column_watchlist { - width: calc(50% ~' - 3px'); - min-width: 320px; - max-height: calc(50% ~ '- 45px'); - } - - &_watchlist-collapsed { - .dex-layout { - &__column_watchlist { - transform: translateX(-100%); - left: -5px; - } - - &__column_candlechart { - transform: translateX(0); - width: 100%; - - .dex-layout { - &__sidebar-toggle-left div::after { - transform: rotate(-90deg); - } - } - } - } - } - } -} - -@media screen and (min-width: 2400px) { - .dex-layout { - &__column_watchlist { - max-height: calc(100% ~ '- 445px'); - width: 360px; - } - } -} - -@media screen and (max-width: 659px) { - .dex-layout { - &__column_watchlist { - width: 100%; - max-height: 320px; - min-height: 320px; - margin-bottom: 5px; - order: 0; - } - - &_watchlist-collapsed { - .dex-layout { - &__column_watchlist { - transform: translateX(0); - left: 0; - } - } - } - - &_watchlist-collapsed.dex-layout_orderbook-collapsed { - .dex-layout { - &__column_watchlist { - transform: translateX(0); - left: 0; - } - - &__column_orderbook { - transform: translateX(0); - } - } - } - } -} diff --git a/src/modules/dex/directives/layout/less/tradehistory-fullscreen.less b/src/modules/dex/directives/layout/less/tradehistory-fullscreen.less deleted file mode 100644 index f1451dce60..0000000000 --- a/src/modules/dex/directives/layout/less/tradehistory-fullscreen.less +++ /dev/null @@ -1,60 +0,0 @@ -@import (reference) "../../../../app/less/typography"; -@import (reference) 'config'; -@import (reference) 'icons'; - -.tradehistory-fullscreen-toggler { - display: none; - position: absolute; - right: 10px; - top: 10px; - width: 20px; - height: 20px; - border-radius: 2px; - background-image: @dex-fullscreen-icon; - background-repeat: no-repeat; - background-position: center center; - background-color: @color-basic-50; - transition: all 0.3s; - z-index: 10; - cursor: pointer; - - &:hover { - background-color: @color-basic-100; - } -} - -.tradehistory-fullscreen { - .tradehistory-fullscreen-toggler { - background-image: @dex-fullscreenclose-icon; - } -} - -.tradehistory-fullscreen { - .dex-layout__column:not(.dex-layout__column_tradehistory) { - transition: .3s; - opacity: 0.1; - } - - .dex-layout__column_tradehistory { - width: 100%; - border-radius: 2px; - z-index: 9; - height: 100%; - max-height: 100%; - transition: .3s; - } -} - -@media screen and (min-width: 1024px) { - .tradehistory-fullscreen { - .dex-my-balance .smart-table w-copy-wrap .container { - max-width: 300px; - width: 300px; - } - } - - .tradehistory-fullscreen-toggler { - display: block; - } -} - diff --git a/src/modules/dex/directives/myBalance/MyBalance.js b/src/modules/dex/directives/myBalance/MyBalance.js deleted file mode 100644 index 211c18b6fd..0000000000 --- a/src/modules/dex/directives/myBalance/MyBalance.js +++ /dev/null @@ -1,215 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param Base - * @param {$rootScope.Scope} $scope - * @param {User} user - * @param {ModalManager} modalManager - * @param {BalanceWatcher} balanceWatcher - * @param {app.utils} utils - * @param {STService} stService - * @param {VisibleService} visibleService - * @return {MyBalance} - */ - const controller = function (Base, $scope, user, modalManager, balanceWatcher, utils, stService, visibleService) { - - class MyBalance extends Base { - - /** - * @type {Array} - */ - balanceList = []; - /** - * @type {boolean} - */ - isDemo = !user.address; - /** - * @type {boolean} - */ - pending = !!user.address; - /** - * @type {*[]} - */ - headers = [ - { - id: 'asset', - search: (key, value, list) => { - const serchValue = (key[value] || '').trim(); - const serachTxt = serchValue.toLowerCase(); - - if (!serachTxt) { - return list; - } - - return list.filter(item => { - if (item.asset.id === serchValue) { - return true; - } - - const name = ( - (item.asset.ticker || '') + - (item.asset.name || '') - ).toLowerCase(); - - return name.includes(serachTxt); - }); - }, - sort: true, - placeholder: 'directives.filter', - valuePath: 'item.asset.displayName' - }, - { - id: 'assetId', - sort: false, - title: { literal: 'directives.balance.assetId' }, - valuePath: 'item.assetId' - }, - { - id: 'available', - sort: true, - title: { literal: 'directives.balance.available' }, - valuePath: 'item.available' - }, - { - id: 'inOrders', - sort: true, - title: { literal: 'directives.balance.inOrdersFull' }, - valuePath: 'item.inOrders' - }, - { - id: 'total', - sort: true, - title: { literal: 'directives.balance.total' }, - valuePath: 'item.regular' - } - ]; - - /** - * @type {Array} - */ - userList = []; - - constructor() { - super(); - - this.syncSettings({ - _assetIdPair: 'dex.assetIdPair' - }); - - if (!this.isDemo) { - - this.balanceList = MyBalance._getBalanceList(); - this.receive(balanceWatcher.change, this._onChangeBalance, this); - this.pending = true; - - utils.when(balanceWatcher.ready).then(() => { - this.pending = false; - }); - - } - - user.getMultiAccountUsers().then(list => { - this.userList = list; - }); - - this.receive(stService.draw, this._updateVisible, this); - } - - static _getBalanceList() { - return balanceWatcher.getFullBalanceList().filter(MyBalance._isNotScam()); - } - - /** - * @private - */ - static _isNotScam() { - const spamHash = (user.getSetting('wallet.portfolio.spam') || []) - .reduce((r, id) => { - r[id] = true; - return r; - }, Object.create(null)); - return item => !user.scam[item.asset.id] && !spamHash[item.asset.id]; - } - - showAssetInfo(asset) { - return modalManager.showAssetInfo(asset); - } - - /** - * @param {Asset} asset - * @return boolean - */ - isSelected(asset) { - return this._assetIdPair.amount === asset.id || - this._assetIdPair.price === asset.id; - } - - /** - * @public - * @param assetID - */ - isLockedPair(assetID) { - return utils.isLockedInDex(assetID); - } - - /** - * @param {string} assetId - */ - setPair(assetId) { - if (this.isLockedPair(assetId)) { - return null; - } - const wavesId = WavesApp.defaultAssets.WAVES; - const btcId = WavesApp.defaultAssets.BTC; - const assetId2 = assetId === wavesId ? btcId : wavesId; - - ds.api.pairs.get(assetId, assetId2).then((pair) => { - user.setSetting('dex.assetIdPair', { - amount: pair.amountAsset.id, - price: pair.priceAsset.id - }); - }); - } - - /** - * @private - * @param {string} name - */ - _updateVisible(name) { - if (name === 'balanceList') { - visibleService.updateSort(); - } - } - - /** - * @private - */ - _onChangeBalance() { - this.balanceList = MyBalance._getBalanceList(); - $scope.$apply(); - } - - } - - return new MyBalance(); - }; - - controller.$inject = [ - 'Base', - '$scope', - 'user', - 'modalManager', - 'balanceWatcher', - 'utils', - 'stService', - 'visibleService' - ]; - - angular.module('app.dex').component('wDexMyBalance', { - bindings: {}, - templateUrl: 'modules/dex/directives/myBalance/myBalance.html', - transclude: false, - controller - }); -})(); diff --git a/src/modules/dex/directives/myBalance/header-control-cell.html b/src/modules/dex/directives/myBalance/header-control-cell.html deleted file mode 100644 index 12c3ea4454..0000000000 --- a/src/modules/dex/directives/myBalance/header-control-cell.html +++ /dev/null @@ -1,3 +0,0 @@ - -
-
diff --git a/src/modules/dex/directives/myBalance/myBalance.html b/src/modules/dex/directives/myBalance/myBalance.html deleted file mode 100644 index a5957dc56f..0000000000 --- a/src/modules/dex/directives/myBalance/myBalance.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - {{::balance.asset.name}} - - - - - - - {{::balance.asset.id}} - - - - - - - - - - - - - - - - - - - - - diff --git a/src/modules/dex/directives/myBalance/myBalance.less b/src/modules/dex/directives/myBalance/myBalance.less deleted file mode 100644 index 4bd2fa07f8..0000000000 --- a/src/modules/dex/directives/myBalance/myBalance.less +++ /dev/null @@ -1,14 +0,0 @@ -@import (reference) 'config'; -@import (reference) 'icons'; -@import (reference) "../../../app/less/typography"; - -.dex-my-balance { - .visible-row-container { - min-height: 30px; - } - - w-asset-logo { - margin-right: 10px; - cursor: pointer; - } -} diff --git a/src/modules/dex/directives/orderBook/OrderBook.js b/src/modules/dex/directives/orderBook/OrderBook.js deleted file mode 100644 index 435dd0fcc5..0000000000 --- a/src/modules/dex/directives/orderBook/OrderBook.js +++ /dev/null @@ -1,465 +0,0 @@ -(function () { - 'use strict'; - - /** - * - * @param {Base} Base - * @param {IPollCreate} createPoll - * @param {JQuery} $element - * @param {Waves} waves - * @param {DexDataService} dexDataService - * @param {app.utils} utils - * @param {$rootScope.Scope} $scope - * @param {app.i18n} i18n - * @param {typeof OrderList} OrderList - * @param {Transactions} transactions - * @return {OrderBook} - */ - const controller = function (Base, - createPoll, - $element, - waves, - dexDataService, - utils, - $scope, - i18n, - OrderList, - transactions) { - - const SECTIONS = { - ASKS: '.table__asks', - INFO: '.table__info', - BIDS: '.table__bids', - SCROLLBOX: 'w-scroll-box', - LAST_PRICE: '.table__last-price', - SPREAD: '.spread' - }; - - const CLASSES = { - SELL: 'sell', - BUY: 'buy' - }; - - const ds = require('data-service'); - const { BigNumber } = require('@waves/bignumber'); - const { AssetPair } = require('@waves/data-entities'); - - class OrderBook extends Base { - - constructor() { - super(); - /** - * @type {object} - */ - this.orders = null; - /** - * @type {Asset} - */ - this.amountAsset = null; - /** - * @type {Asset} - */ - this.priceAsset = null; - /** - * @type {boolean} - */ - this.pending = true; - /** - * @type {boolean} - */ - this.hasOrderBook = false; - /** - * @type {boolean} - */ - this.loadingError = false; - /** - * @type {{amount: string, price: string}} - * @private - */ - this._assetIdPair = null; - /** - * @type {*} - * @private - */ - this._lastResponse = null; - /** - * @type {boolean} - * @private - */ - this._showSpread = true; - /** - * @type {boolean} - * @private - */ - this._noRender = false; - /** - * @type {number} - * @private - */ - this._orderBookCropRate = null; - /** - * @private - */ - this._dom = null; - /** - * @type {boolean} - * @public - */ - this.isScrolled = false; - - this.receive(dexDataService.showSpread, () => { - this._dom.$box.stop().animate({ scrollTop: this._getSpreadScrollPosition() }, 300); - }); - - this.syncSettings({ - _assetIdPair: 'dex.assetIdPair', - _orderBookCropRate: 'dex.chartCropRate' - }); - - this.observe(['hasOrderBook'], this._onChangeVisibleElements); - - this._onChangeVisibleElements(); - this._updateAssetData(); - } - - $postLink() { - this._dom = Object.create(null); - - Object.defineProperties(this._dom, { - $box: { get: () => $element.find(SECTIONS.SCROLLBOX) }, - $bids: { get: () => this._dom.$box.find(SECTIONS.BIDS) }, - $asks: { get: () => this._dom.$box.find(SECTIONS.ASKS) }, - $info: { get: () => this._dom.$box.find(SECTIONS.INFO) }, - $lastPrice: { get: () => this._dom.$info.find(SECTIONS.LAST_PRICE) }, - $spread: { get: () => this._dom.$info.find(SECTIONS.SPREAD) } - }); - - this._dom.$box.on('scroll', () => { - const scrollPos = this._dom.$box[0].scrollTop; - const spreadPos = this._getSpreadScrollPosition(); - this.isScrolled = Math.abs(scrollPos - spreadPos) >= 2; - }); - - - const poll = createPoll(this, this._getOrders, this._setOrders, 1000, { $scope }); - - this.observe('_assetIdPair', () => { - this._showSpread = true; - this.pending = true; - this.hasOrderBook = false; - this.loadingError = false; - this._updateAssetData(); - poll.restart(); - }); - - $element.on('mousedown touchstart', 'w-scroll-box w-row', () => { - this._noRender = true; - }); - - $element.on('mouseup touchend', 'w-scroll-box w-row', () => { - this._noRender = false; - if (this._lastResponse) { - this._render(this._lastResponse); - this._lastResponse = null; - } - }); - - this._asks = new OrderList({ - node: this._dom.$asks.get(0), - fillColor: 'rgba(229,73,77,0.1)' - }); - this._bids = new OrderList({ - node: this._dom.$bids.get(0), - fillColor: 'rgba(90,129,234,0.1)' - }); - - this.signals.destroy.once(() => { - this._asks.$onDestroy(); - this._bids.$onDestroy(); - }); - } - - nothingFound() { - return !(this.hasOrderBook || this.pending || this.loadingError); - } - - /** - * @private - */ - _updateAssetData() { - ds.api.assets.get([this._assetIdPair.price, this._assetIdPair.amount]) - .then(([priceAsset, amountAsset]) => { - this.priceAsset = priceAsset; - this.amountAsset = amountAsset; - this.pair = new AssetPair(amountAsset, priceAsset); - }); - } - - /** - * @return {Promise<{bids, spread, asks}>} - * @private - */ - _getOrders() { - const amountAsset = this._assetIdPair.amount; - const priceAsset = this._assetIdPair.price; - const limit = 1; - - return Promise.all([ - waves.matcher.getOrderBook(amountAsset, priceAsset), - waves.matcher.getOrders().catch(() => null), - ds.api.pairs.get(amountAsset, priceAsset) - .then(waves.matcher.getLastPrice) - .catch(() => null) - .then(lastPrice => { - const tokens = lastPrice.price.getTokens(); - if (tokens.isNaN()) { - return transactions - .getExchangeTxList({ amountAsset, priceAsset, limit }) - .then(([tx]) => ({ price: tx.price, lastSide: tx.exchangeType })) - .catch(() => null); - } - return lastPrice; - }) - .then(lastPrice => lastPrice) - .catch(() => null) - ]) - .then(([orderbook, orders, lastPrice]) => { - this.loadingError = false; - return this._remapOrderBook(orderbook, orders, lastPrice); - }) - .catch(() => { - this.loadingError = true; - this.hasOrderBook = false; - $scope.$digest(); - }); - } - - /** - * @private - */ - _onChangeVisibleElements() { - $element.toggleClass('has-order-book', this.hasOrderBook); - } - - /** - * @param {OrderBook.OrdersData} data - * @private - */ - _setOrders(data) { - this.pending = false; - this._render(data); - } - - /** - * - * @param {Matcher.IOrderBookResult} orderbook - * @param {Array} orders - * @param {Array<{price: Money, lastSide: string}>} lastPrice - * @return {OrderBook.OrdersData} - * @private - */ - _remapOrderBook(orderbook, orders = [], lastPrice) { - - const dataBids = orderbook.bids.slice(0, OrderList.ROWS_COUNT); - const dataAsks = orderbook.asks.slice(0, OrderList.ROWS_COUNT); - - const crop = utils.getOrderBookRangeByCropRate({ - bids: dataBids, - asks: dataAsks, - chartCropRate: this._orderBookCropRate - }); - - const priceHash = orders.reduce((result, item) => { - if (item.isActive) { - if (item.amount.asset.id === orderbook.pair.amountAsset.id && - item.price.asset.id === orderbook.pair.priceAsset.id) { - result[item.price.getTokens().toFixed(item.price.asset.precision)] = true; - } - } - return result; - }, Object.create(null)); - - const lastTrade = lastPrice; - const bids = OrderBook._sumAllOrders(dataBids, 'sell'); - const asks = OrderBook._sumAllOrders(dataAsks, 'buy').reverse(); - - const maxAmount = OrderBook._getMaxAmount(bids, asks, crop); - - return { - bids, - maxAmount, - priceHash, - crop, - lastTrade, - spread: orderbook.spread && orderbook.spread.percent, - asks - }; - } - - /** - * @param {OrderBook.OrdersData} data - * @private - */ - _render(data) { - if (!data) { - return null; - } - - if (this._noRender) { - this._lastResponse = data; - return null; - } - - this.hasOrderBook = Boolean(data.bids.length || data.asks.length); - - if (data.lastTrade) { - const isBuy = data.lastTrade.lastSide === 'buy'; - const isSell = data.lastTrade.lastSide === 'sell'; - this._dom.$lastPrice.toggleClass(CLASSES.BUY, isBuy) - .toggleClass(CLASSES.SELL, isSell) - .text(data.lastTrade.price.toFormat()); - } else { - this._dom.$lastPrice.removeClass(CLASSES.BUY) - .removeClass(CLASSES.SELL) - .text(0); - } - this._dom.$spread.text(data.spread && data.lastTrade ? data.spread.toFixed(2) : ''); - - const pair = new AssetPair(this.amountAsset, this.priceAsset); - - const toLength = (list, len) => { - const count = len - list.length; - return new Array(count).fill(null).concat(list); - }; - - const length = OrderList.ROWS_COUNT; - this._asks.render(toLength(data.asks, length), data.crop, data.priceHash, data.maxAmount, pair); - this._bids.render(data.bids, data.crop, data.priceHash, data.maxAmount, pair); - - if (this._showSpread) { - this._showSpread = false; - const box = this._dom.$box.get(0); - box.scrollTop = this._getSpreadScrollPosition(); - } - } - - /** - * @return {number} - * @private - */ - _getSpreadScrollPosition() { - const box = this._dom.$box.get(0); - const info = this._dom.$info.get(0); - return info.offsetTop - box.offsetTop - box.clientHeight / 2 + info.clientHeight / 2; - } - - /** - * @param {Array} list - * @param {'buy'|'sell'} type - * @return Array - * @private - */ - static _sumAllOrders(list, type) { - let total = new BigNumber(0); - let amountTotal = new BigNumber(0); - - return list.map((item) => { - total = total.add(item.total); - amountTotal = amountTotal.add(item.amount); - return { - type, - amount: new BigNumber(item.amount), - price: new BigNumber(item.price), - total, - totalAmount: amountTotal - }; - }); - } - - /** - * @param {OrderBook.IOrder[]} bids - * @param {OrderBook.IOrder[]} asks - * @param {OrderBook.ICrop} crop - * @return {BigNumber} - * @private - */ - static _getMaxAmount(bids, asks, crop) { - const croppedBids = OrderBook._cropFilterOrders(bids, crop); - const croppedAsks = OrderBook._cropFilterOrders(asks, crop); - - const orders = [...croppedBids, ...croppedAsks].sort((a, b) => a.amount.gt(b.amount) ? 1 : -1); - - if (!orders.length) { - return new BigNumber(0); - } else { - const percentile = 0.9; - return orders[Math.floor(orders.length * percentile)].amount; - } - } - - /** - * @param {OrderBook.IOrder[]} list - * @param {OrderBook.ICrop} crop - * @return {OrderBook.IOrder[]} - * @private - */ - static _cropFilterOrders(list, crop) { - return list.filter((o) => o.price.gte(crop.min) && o.price.lte(crop.max)); - } - - } - - return new OrderBook(); - }; - - controller.$inject = [ - 'Base', - 'createPoll', - '$element', - 'waves', - 'dexDataService', - 'utils', - '$scope', - 'i18n', - 'OrderList', - 'transactions' - ]; - - angular.module('app.dex').component('wDexOrderBook', { - templateUrl: 'modules/dex/directives/orderBook/orderBook.html', - bindings: { - isScrolled: '=' - }, - controller - }); -})(); - -/** - * @name OrderBook - */ - -/** - * @typedef {object} OrderBook#IOrder - * @property {BigNumber} price - * @property {BigNumber} amount - * @property {BigNumber} total - * @property {BigNumber} totalAmount - * @property {'sell'|'buy'} type - */ - -/** - * @typedef {object} OrderBook#ICrop - * @property {BigNumber} min - * @property {BigNumber} max - */ - -/** - * @typedef {object} OrderBook#OrdersData - * @property {Array} bids - * @property {Array} asks - * @property {BigNumber} maxAmount - * @property {OrderBook.ICrop} crop - * @property {Record} priceHash - * @property {{price: Money, lastSide: string}} lastTrade - * @property {BigNumber} spread - */ diff --git a/src/modules/dex/directives/orderBook/OrderList.js b/src/modules/dex/directives/orderBook/OrderList.js deleted file mode 100644 index d234cbb5b8..0000000000 --- a/src/modules/dex/directives/orderBook/OrderList.js +++ /dev/null @@ -1,166 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {typeof Base} Base - * @param {typeof OrderListItem} OrderListItem - */ - const service = function (Base, OrderListItem) { - - const SCALE = devicePixelRatio || 1; - - /** - * @class OrderList - */ - class OrderList extends Base { - - static ROWS_COUNT = 80; - /** - * @type {Array} - * @private - */ - _rows = []; - /** - * @type {HTMLElement} - * @private - */ - _root = null; - /** - * @type {HTMLCanvasElement} - * @private - */ - _canvas; - /** - * @type {CanvasRenderingContext2D} - * @private - */ - _ctx; - /** - * @type {string} - * @private - */ - _fillColor; - - - constructor(params) { - super(); - this._fillColor = params.fillColor; - this._createCanvas(params.node); - this._createLines(params.node); - } - - /** - * @param {Array} data - * @param {OrderBook.ICrop} crop - * @param {Record} priceHash - * @param {BigNumber} maxAmount - * @param {AssetPair} pair - */ - render(data, crop, priceHash, maxAmount, pair) { - const widthList = []; - - this._rows.forEach((row, index) => { - const item = data[index]; - row.render(item, crop, priceHash, pair); - widthList[index] = item && item.amount.div(maxAmount).mul(100).toFixed(2); - }); - - this._drawCanvas(widthList); - } - - $onDestroy() { - super.$onDestroy(); - this._rows.forEach(row => { - row.$onDestroy(); - }); - } - - /** - * @param node - * @private - */ - _createLines(node) { - for (let i = 0; i < OrderList.ROWS_COUNT; i++) { - this._rows.push(new OrderListItem(node)); - } - } - - /** - * @param node - * @private - */ - _createCanvas(node) { - this._canvas = document.createElement('canvas'); - this._canvas.style.position = 'absolute'; - this._canvas.style.left = '0'; - this._canvas.style.top = '0'; - this._ctx = this._canvas.getContext('2d'); - node.style.position = 'relative'; - node.appendChild(this._canvas); - } - - /** - * @return {number} - * @private - */ - _getLineHeight() { - const height = this._rows[0].getHeight(); - if (height) { - this._getLineHeight = () => height; - } - return height; - } - - /** - * @private - */ - _drawCanvas(widthList) { - this._initSize(); - - const height = this._getLineHeight(); - const rate = this._canvas.width / 100; - - this._clearCanvas(); - - if (!height) { - return null; - } - - this._ctx.fillStyle = this._fillColor; - - widthList.forEach((width, index) => { - this._ctx.fillRect(0, index * height * SCALE, width * rate, height * SCALE); - }); - - this._ctx.stroke(); - } - - _clearCanvas() { - this._canvas.width = this._canvas.width; - } - - /** - * @private - */ - _initSize() { - const width = this._canvas.parentElement.clientWidth; - const height = this._canvas.parentElement.clientHeight; - this._canvas.width = width * SCALE; - this._canvas.height = height * SCALE; - this._canvas.style.width = `${width}px`; - this._canvas.style.height = `${height}px`; - - if (width && height) { - this._initSize = () => undefined; - } - } - - } - - return OrderList; - }; - - service.$inject = ['Base', 'OrderListItem']; - - angular.module('app.dex').service('OrderList', service); -})(); diff --git a/src/modules/dex/directives/orderBook/OrderListItem.js b/src/modules/dex/directives/orderBook/OrderListItem.js deleted file mode 100644 index 0b627833be..0000000000 --- a/src/modules/dex/directives/orderBook/OrderListItem.js +++ /dev/null @@ -1,257 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {typeof Base} Base - * @param {app.utils} utils - * @param {app.i18n} i18n - * @param {DexDataService} dexDataService - */ - const service = function (Base, utils, i18n, dexDataService) { - - /** - * @class OrderListItem - * @extends Base - */ - class OrderListItem extends Base { - - /** - * @type {OrderBook.IOrder} - * @private - */ - _data = null; - /** - * @type {HTMLElement} - * @private - */ - _root = OrderListItem._createElement('w-row', 'table__row'); - /** - * @type {HTMLElement} - * @private - */ - _parent; - /** - * @type {HTMLElement} - * @private - */ - _amountNode; - /** - * @type {HTMLElement} - * @private - */ - _priceNode; - /** - * @type {HTMLElement} - * @private - */ - _totalNode; - /** - * @type {HTMLElement} - * @private - */ - _tooltipSell; - /** - * @type {HTMLElement} - * @private - */ - _tooltipBuy; - /** - * @type {AssetPair} - * @private - */ - _pair; - - - constructor(parent) { - super(); - this._parent = parent; - this._parent.appendChild(this._root); - this._createDom(); - this._setHandlers(); - this._draw(); - } - - /** - * @return {OrderBook.IOrder} - */ - getData() { - return this._data; - } - - /** - * @param {OrderBook.IOrder} data - * @param {OrderBook.ICrop} crop - * @param {Record} priceHash - * @param {AssetPair} pair - */ - render(data, crop, priceHash, pair) { - if (OrderListItem._isEqual(this._data, data)) { - return null; - } - - this._pair = pair; - this._data = data; - this._draw(crop, priceHash, pair); - } - - /** - * @return {number} - */ - getHeight() { - return this._root.clientHeight; - } - - /** - * @param {OrderBook.ICrop} [crop] - * @param {Record} [priceHash] - * @param {AssetPair} [pair] - * @private - */ - _draw(crop, priceHash, pair) { - if (this._data) { - this._amountNode.innerHTML = - utils.getNiceNumberTemplate(this._data.amount, pair.amountAsset.precision, true); - this._priceNode.innerHTML = - utils.getNiceNumberTemplate(this._data.price, pair.priceAsset.precision, 100000); - this._totalNode.innerHTML = - utils.getNiceNumberTemplate(this._data.total, pair.priceAsset.precision, true); - - const hasOrder = !!priceHash[this._data.price.toFixed(pair.priceAsset.precision)]; - const inRange = this._data.price.gte(crop.min) && this._data.price.lte(crop.max); - - this._tooltip.classList.toggle('active', true); - this._root.classList.toggle('active', hasOrder); - this._root.classList.toggle('no-market-price', !inRange); - } else { - this._amountNode.innerText = '—'; - this._priceNode.innerText = '—'; - this._totalNode.innerText = '—'; - this._tooltip.classList.toggle('active', false); - this._root.classList.toggle('active', false); - this._root.classList.toggle('no-market-price', false); - } - this._root.classList.toggle('isEmpty', !this._data); - } - - /** - * @private - */ - _setHandlers() { - this.listenEventEmitter(this._root, 'mouseenter', () => { - this._onHoverIn(); - }, Base.DOM_EVENTS_METHODS); - this.listenEventEmitter(this._root, 'click', () => { - OrderListItem._onClickRow(this); - }, Base.DOM_EVENTS_METHODS); - } - - /** - * @private - */ - _onHoverIn() { - if (!this._pair || !this._data) { - return null; - } - const sellTooltip = i18n.translate('orderbook.ask.tooltipText', 'app.dex', { - amountAsset: this._pair.amountAsset.displayName, - priceAsset: this._pair.priceAsset.displayName, - price: this._data.price.toFormat(this._pair.priceAsset.precision) - }); - - const buyTooltip = i18n.translate('orderbook.bid.tooltipText', 'app.dex', { - amountAsset: this._pair.amountAsset.displayName, - priceAsset: this._pair.priceAsset.displayName, - price: this._data.price.toFormat(this._pair.priceAsset.precision) - }); - - this._tooltipSell.innerText = sellTooltip; - this._tooltipBuy.innerText = buyTooltip; - } - - /** - * @private - */ - _createDom() { - this._root.appendChild( - OrderListItem._createElement('div', 'table__row-wrap', [ - this._tooltip = OrderListItem._createElement('div', 'tooltip-dex', [ - this._tooltipSell = OrderListItem._createElement('span', 'tooltip-ask'), - this._tooltipBuy = OrderListItem._createElement('span', 'tooltip-bid') - ]), - OrderListItem._createElement('w-cell', 'table__cell cell-0', [ - this._amountNode = OrderListItem._createElement('div', 'table__cell-wrap') - ]), - OrderListItem._createElement('w-cell', 'table__cell cell-1', [ - this._priceNode = OrderListItem._createElement('div', 'table__cell-wrap') - ]), - OrderListItem._createElement('w-cell', 'table__cell cell-2', [ - this._totalNode = OrderListItem._createElement('div', 'table__cell-wrap') - ]) - ]) - ); - } - - /** - * @param {OrderBook.IOrder} a - * @param {OrderBook.IOrder} b - * @return {boolean} - * @private - */ - static _isEqual(a, b) { - return (!a && !b) || - (a && b && Object.entries(a).every(([key, value]) => utils.isEqual(value, b[key]))); - } - - /** - * @param {string} tagName - * @param {string} className - * @param {Array} [children] - * @return {HTMLElement} - * @private - */ - static _createElement(tagName, className, children) { - const element = document.createElement(tagName); - className.split(' ').forEach(name => { - element.classList.add(name); - }); - - if (children && children.length) { - children.forEach(child => { - element.appendChild(child); - }); - } - - return element; - } - - /** - * @param {OrderListItem} item - * @private - */ - static _onClickRow(item) { - const order = item.getData(); - - if (!order) { - return null; - } - - dexDataService.chooseOrderBook.dispatch({ - amount: order.totalAmount.toFixed(2), - price: order.price.toFixed(), - type: order.type - }); - } - - } - - return OrderListItem; - }; - - service.$inject = ['Base', 'utils', 'i18n', 'dexDataService']; - - angular.module('app.dex').service('OrderListItem', service); -})(); - -/** - * @name OrderListItem - */ diff --git a/src/modules/dex/directives/orderBook/orderBook.html b/src/modules/dex/directives/orderBook/orderBook.html deleted file mode 100644 index b46ebd95b4..0000000000 --- a/src/modules/dex/directives/orderBook/orderBook.html +++ /dev/null @@ -1,35 +0,0 @@ -
- - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - -
-
-
-
-
-
-
diff --git a/src/modules/dex/directives/orderBook/orderBook.less b/src/modules/dex/directives/orderBook/orderBook.less deleted file mode 100644 index 63e7843988..0000000000 --- a/src/modules/dex/directives/orderBook/orderBook.less +++ /dev/null @@ -1,47 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../../app/less/typography'; -@import (reference) 'icons'; - -.dex-order-book { - display: block; - width: 100%; - height: 100%; - text-align: right; - - .table { - display: none; - } - - - &__wrapper { - width: 100%; - height: 100%; - position: relative - } - - &.has-order-book { - .empty-block, - .error-block { - display: none; - } - .table { - display: block; - } - } -} - -@media screen and (max-width: 659px) { - .dex-order-book { - min-height: 360px; - - &__wrapper { - min-height: 322px; - } - - w-scroll-box { - max-height: 155px; - overflow-y: auto; - overflow-x: hidden; - } - } -} diff --git a/src/modules/dex/directives/tradeGraph/TradeGraph.js b/src/modules/dex/directives/tradeGraph/TradeGraph.js deleted file mode 100644 index 2c19482c10..0000000000 --- a/src/modules/dex/directives/tradeGraph/TradeGraph.js +++ /dev/null @@ -1,379 +0,0 @@ -(function () { - 'use strict'; - - const ORDERS_TYPES = { - asks: 'asks', - bids: 'bids' - }; - const ORDER_LIST_STUB = [{ amount: 0, price: 0 }]; - const THRESHOLD_VALUES = { - asks: 2, - bids: 2 - }; - const COLORS = { - default: { - lineColor: { - asks: '#e5494d', - bids: '#1f5af6' - }, - fillColor: { - asks: '#ffe4e4', - bids: '#eaf0fe' - } - }, - black: { - lineColor: { - asks: '#e5494d', - bids: '#5a81ea' - }, - fillColor: { - asks: 'rgba(229, 73, 77, 0.15)', - bids: 'rgba(90, 129, 234, 0.15)' - } - } - }; - - const { Signal } = require('ts-utils'); - const { BigNumber } = require('@waves/bignumber'); - - /** - * @param Base - * @param utils - * @param {Waves} waves - * @param {IPollCreate} createPoll - * @param {$rootScope.Scope} $scope - * @param {app.utils} utils - * @param {User} user - * @return {TradeGraph} - */ - const controller = function (Base, utils, waves, createPoll, $scope, user) { - - /** - * @class TradeGraph - * @extends Base - */ - class TradeGraph extends Base { - - /** - * @type {boolean} - */ - loadingError = false; - /** - * @type {{amount: string, price: string}} - * @private - */ - _assetIdPair = null; - - /** - * @type {number} - * @private - */ - _chartCropRate = null; - /** - * @type {Signal} - * @private - */ - _setDataSignal = new Signal(); - - /** - * @type {boolean} - * @private - */ - canShowGraph = false; - /** - * @type {boolean} - */ - pending = true; - /** - * @type {TChartOptions} - */ - options = { - axisX: 'price', - axisY: 'amount', - marginBottom: 0, - hasDates: false, - checkWidth: true, - view: { - asks: { - lineColor: COLORS.default.lineColor.asks, - fillColor: COLORS.default.fillColor.asks, - lineWidth: 4 - }, - bids: { - lineColor: COLORS.default.lineColor.bids, - fillColor: COLORS.default.fillColor.bids, - lineWidth: 4 - } - } - }; - /** - * @type {object} - */ - chartPlateOptions = {}; - /** - * @type {string} - */ - theme = 'default'; - /** - * @type {object} - */ - data = { - asks: ORDER_LIST_STUB, - bids: ORDER_LIST_STUB - }; - - constructor() { - super(); - - this.syncSettings({ - _assetIdPair: 'dex.assetIdPair', - _chartCropRate: 'dex.chartCropRate', - theme: 'theme' - }); - this.observe(['_assetIdPair', '_chartCropRate'], this._onChangeAssets); - /** - * @type {Poll} - * @private - */ - this._poll = createPoll(this, this._getOrderBook, this._setOrderBook, 1000, { $scope }); - this._resetPending(); - - this.theme = user.getSetting('theme'); - this._setChartPlateOptions(); - this._setChartOptionsView(); - this.observe('theme', this._onThemeChange); - } - - onMouse(chartData) { - const id = chartData.id; - const { xValue, yValue } = chartData.point; - - this.chartEvent = { - ...chartData, - id: `${id[0].toUpperCase()}${id.substring(1)}`, - amount: new BigNumber(yValue).toFormat(), - price: new BigNumber(xValue).toFormat() - }; - } - - /** - * @param {boolean} noRestart - * @private - */ - _onChangeAssets(noRestart) { - if (!noRestart) { - this._poll.restart(); - this._resetPending(); - } - } - - /** - * @private - */ - _resetPending() { - this.pending = true; - this.receiveOnce(this._setDataSignal, () => { - this.pending = false; - }); - } - - /** - * @private - */ - _getOrderBook() { - return waves.matcher.getOrderBook(this._assetIdPair.amount, this._assetIdPair.price) - .then((orderBook) => this._cutOffOutlyingOrdersIfNecessary(orderBook)) - .then(TradeGraph._buildCumulativeOrderBook) - .then(data => { - this.loadingError = false; - return data; - }) - .catch(() => { - this.loadingError = true; - this.pending = false; - $scope.$apply(); - }); - } - - _setOrderBook(orderBook) { - this._updateGraphAccordingToOrderBook(orderBook); - this.data = { - asks: orderBook.asks, - bids: orderBook.bids - }; - - this._setDataSignal.dispatch(); - - $scope.$digest(); - } - - _cutOffOutlyingOrdersIfNecessary(orderBook) { - if (TradeGraph._isLackOfAsks(orderBook) || TradeGraph._isLackOfBids(orderBook)) { - return orderBook; - } - - const filteredOrderBook = utils.filterOrderBookByCharCropRate({ - chartCropRate: this._chartCropRate, - asks: orderBook.asks, - bids: orderBook.bids - }); - - if (TradeGraph._areEitherAsksOrBids(filteredOrderBook)) { - return filteredOrderBook; - } - - return orderBook; - } - - _updateGraphAccordingToOrderBook(orderBook) { - this.canShowGraph = !!TradeGraph._areEitherAsksOrBids(orderBook); - return orderBook; - } - - _setChartOptionsView() { - this.options = { - ...this.options, - view: this._getViewOptions() - }; - } - - _getViewOptions() { - switch (this.theme) { - case 'black': - return ({ - asks: { - lineColor: COLORS[this.theme].lineColor.asks, - fillColor: COLORS[this.theme].fillColor.asks, - lineWidth: 2 - }, - bids: { - lineColor: COLORS[this.theme].lineColor.bids, - fillColor: COLORS[this.theme].fillColor.bids, - lineWidth: 2 - } - }); - default: - return ({ - asks: { - lineColor: COLORS.default.lineColor.asks, - fillColor: COLORS.default.fillColor.asks, - lineWidth: 4 - }, - bids: { - lineColor: COLORS.default.lineColor.bids, - fillColor: COLORS.default.fillColor.bids, - lineWidth: 4 - } - }); - } - } - - _setChartPlateOptions() { - switch (this.theme) { - case 'black': - this.chartPlateOptions = { - ...this.chartPlateOptions, - markerColors: COLORS[this.theme].lineColor - }; - break; - default: - this.chartPlateOptions = { - ...this.chartPlateOptions, - markerColors: COLORS.default.lineColor - }; - } - - } - - _onThemeChange() { - utils.wait(1000).then(() => { - this._setChartOptionsView(); - this._setChartPlateOptions(); - }); - } - - static _areEitherAsksOrBids(orderBook) { - return TradeGraph._areEnoughAsks(orderBook) || TradeGraph._areEnoughBids(orderBook); - } - - static _areEnoughAsks(orderBook) { - return !TradeGraph._isLackOfAsks(orderBook); - } - - static _areEnoughBids(orderBook) { - return !TradeGraph._isLackOfBids(orderBook); - } - - static _isLackOfAsks(orderBook) { - return TradeGraph._isLackOf(orderBook, ORDERS_TYPES.asks); - } - - static _isLackOfBids(orderBook) { - return TradeGraph._isLackOf(orderBook, ORDERS_TYPES.bids); - } - - static _isLackOf(orderBook, ordersType) { - return orderBook[ordersType].length < THRESHOLD_VALUES[ordersType]; - } - - static _buildCumulativeOrderBook({ asks, bids }) { - return { - asks: TradeGraph._buildCumulativeOrderList(asks), - bids: TradeGraph._buildCumulativeOrderList(bids) - }; - } - - static _buildCumulativeOrderList(list) { - let amount = new BigNumber(0); - - return list.reduce((result, item) => { - amount = amount.add(new BigNumber(item.amount)); - result.push({ - amount: Number(amount.toFixed(this._chartCropRate)), - price: Number(item.price) - }); - - return result; - }, []); - } - - } - - return new TradeGraph(); - }; - - controller.$inject = ['Base', 'utils', 'waves', 'createPoll', '$scope', 'user']; - - angular.module('app.dex') - .component('wDexTradeGraph', { - templateUrl: 'modules/dex/directives/tradeGraph/tradeGraph.html', - controller - }); -})(); - -/** - * @typedef {object} TChartOptions - * @property {string} axisX - * @property {string} axisY - * @property {number} marginBottom - * @property {boolean} hasDates - * @property {boolean | number} checkWidth - * @property {TView} view - */ - -/** - * @typedef {Object} TView - */ - -/** - * @typedef {object} IView - * @property {string} fillColor - * @property {string} lineColor - * @property {number} lineWidth - */ - -/** - * @typedef {object} TChartData - * @property {number} amount - * @property {number} price - */ diff --git a/src/modules/dex/directives/tradeGraph/tradeGraph.html b/src/modules/dex/directives/tradeGraph/tradeGraph.html deleted file mode 100644 index e646cd4602..0000000000 --- a/src/modules/dex/directives/tradeGraph/tradeGraph.html +++ /dev/null @@ -1,20 +0,0 @@ -
- - - -
-
{{$ctrl.chartEvent.price}}
-
- {{$ctrl.chartEvent.id}} - {{$ctrl.chartEvent.amount}} -
-
-
-
- - - -
diff --git a/src/modules/dex/directives/tradeGraph/tradeGraph.less b/src/modules/dex/directives/tradeGraph/tradeGraph.less deleted file mode 100644 index 760561bb47..0000000000 --- a/src/modules/dex/directives/tradeGraph/tradeGraph.less +++ /dev/null @@ -1,34 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../../app/less/typography'; - -.dex-trade-graph { - display: block; - width: 100%; - position: relative; - - .graph-wrapper { - background-color: @color-white; - height: 100%; - } - - .empty-block, - .error-block { - margin: 0 auto; - position: relative; - - &__icon { - margin: 15px auto 0; - background-size: 90%; - } - - .footnote-1 { - font-size: @font-size-caption-1; - line-height: 16px; - } - } - - .chart-tooltip { - background: @white-btn-bg; - box-shadow: @shadow-type-2; - } -} diff --git a/src/modules/dex/directives/tradeHistory/TradeHistory.js b/src/modules/dex/directives/tradeHistory/TradeHistory.js deleted file mode 100644 index fdddaf2937..0000000000 --- a/src/modules/dex/directives/tradeHistory/TradeHistory.js +++ /dev/null @@ -1,261 +0,0 @@ -/* global tsApiValidator */ -(function () { - 'use strict'; - - const { propEq, uniqBy, map, pipe, prop, find } = require('ramda'); - - /** - * @param {Base} Base - * @param {$rootScope.Scope} $scope - * @param {IPollCreate} createPoll - * @param {User} user - * @param {utils} utils - * @param {Transactions} transactions - * @return {TradeHistory} - */ - const controller = function (Base, $scope, createPoll, user, utils, transactions) { - - const PAIR_COLUMN_DATA = { - id: 'pair', - valuePath: 'item.pair', - search: true, - placeholder: 'directives.filter' - }; - - const FEE_COLUMN_DATA = { - id: 'fee', - title: { literal: 'directives.tradeHistory.tableTitle.fee' }, - valuePath: 'item.userFee', - sort: true - }; - - const HEADER_COLUMNS = [ - { - id: 'type', - title: { literal: 'directives.tradeHistory.tableTitle.type' }, - valuePath: 'item.exchangeType', - sort: true - }, - { - id: 'time', - title: { literal: 'directives.tradeHistory.tableTitle.date' }, - valuePath: 'item.timestamp', - sort: true, - sortActive: true, - isAsc: false - }, - { - id: 'price', - title: { literal: 'directives.tradeHistory.tableTitle.price' }, - valuePath: 'item.price', - sort: true - }, - { - id: 'amount', - title: { literal: 'directives.tradeHistory.tableTitle.size' }, - valuePath: 'item.amount', - sort: true - }, - { - id: 'total', - title: { literal: 'directives.tradeHistory.tableTitle.total' }, - valuePath: 'item.total', - sort: true - } - ]; - - class TradeHistory extends Base { - - /** - * @private - */ - userList = []; - - constructor() { - super(); - /** - * @type {{amount: string, price: string}} - * @private - */ - this._assetIdPair = null; - /** - * @type {boolean} - */ - this.isMy = false; - /** - * @type {IExchangeTransaction[]} - */ - this.history = []; - /** - * @type {function(tx: IExchangeTransaction[], [index]: number): boolean} - */ - this.remapTransactions = TradeHistory._remapTxList(); - /** - * @type {boolean} - */ - this.pending = true; - /** - * @type {boolean} - */ - this.isDemo = false; - - this.headers = []; - - this.syncSettings({ - _assetIdPair: 'dex.assetIdPair' - }); - - user.getMultiAccountUsers().then(list => { - this.userList = list; - }); - } - - $postLink() { - this.headers = this.isMy ? [PAIR_COLUMN_DATA].concat(HEADER_COLUMNS, FEE_COLUMN_DATA) : HEADER_COLUMNS; - /** - * @type {boolean} - */ - this.isDemo = this.isMy && !user.address; - this._initializePoll(); - this.observe('_assetIdPair', this._onChangeAssets); - } - - /** - * @param {IExchange} tx - * @return boolean - */ - isSelected(tx) { - return this._assetIdPair.amount === tx.amount.asset.id && - this._assetIdPair.price === tx.price.asset.id; - } - - /** - * @param {IExchange} tx - */ - setPair(tx) { - const isLocked = this.isLockedPair(tx); - if (isLocked) { - return null; - } - user.setSetting('dex.assetIdPair', { - amount: tx.amount.asset.id, - price: tx.price.asset.id - }); - } - - /** - * @param tx - * @public - */ - isLockedPair(tx) { - return utils.isLockedInDex(tx.amount.asset.id, tx.price.asset.id); - } - - /** - * @private - */ - _initializePoll() { - if (this.isMy && this.isDemo) { - return null; - } - - /** - * @type {Poll} - */ - this.poll = createPoll(this, this._getTradeHistory, this._setTradeHistory, 1000); - this.poll.ready.then(() => { - this.pending = false; - }); - } - - /** - * @private - */ - _onChangeAssets() { - if (!this.isMy) { - this.pending = true; - this.history = []; - this.poll.restart().then(() => { - this.pending = false; - }); - } - } - - /** - * @return {Promise} - * @private - */ - _getTradeHistory() { - return transactions.getExchangeTxList(this._getTransactionsFilter()) - .then(this.remapTransactions); - } - - /** - * @param {IExchangeTransaction[]} history - * @private - */ - _setTradeHistory(history) { - const isEqual = this.history.length === history.length && - this.history.every((item, i) => propEq('id', item, this.history[i])); - - if (isEqual) { - return null; - } - - this.history = history; - $scope.$apply(); - } - - /** - * @return {*} - * @private - */ - _getTransactionsFilter() { - if (this.isMy) { - return { sender: user.address }; - } - return { - amountAsset: this._assetIdPair.amount, - priceAsset: this._assetIdPair.price - }; - } - - /** - * @return {function(tx: IExchangeTransaction[], [index]: number): boolean} - * @private - */ - static _remapTxList() { - const filter = uniqBy(prop('id')); - const mapFunc = map(TradeHistory._remapTx); - return pipe(filter, mapFunc); - } - - static _remapTx(tx) { - const amount = tx => tx.amount.asset.displayName; - const price = tx => tx.price.asset.displayName; - const fee = order => order.orderType === 'sell' ? tx.sellMatcherFee : tx.buyMatcherFee; - const pair = `${amount(tx)} / ${price(tx)}`; - const userFee = pipe( - find(order => order.orderType === tx.exchangeType), - fee - )([tx.order1, tx.order2]); - - return { ...tx, pair, userFee }; - } - - } - - return new TradeHistory(); - }; - - controller.$inject = ['Base', '$scope', 'createPoll', 'user', 'utils', 'transactions']; - - angular.module('app.dex') - .component('wDexTradeHistory', { - bindings: { - isMy: '<' - }, - templateUrl: 'modules/dex/directives/tradeHistory/tradeHistory.html', - controller - }); -})(); diff --git a/src/modules/dex/directives/tradeHistory/tradeHistory.html b/src/modules/dex/directives/tradeHistory/tradeHistory.html deleted file mode 100644 index 20ff4ca79a..0000000000 --- a/src/modules/dex/directives/tradeHistory/tradeHistory.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - {{::tx.pair}} - - - - - - - - - {{::tx.timestamp | date:'MM-dd HH:mm:ss'}} - - - - - - - - - - - - - - - - - - - diff --git a/src/modules/dex/directives/tradeHistory/tradeHistory.less b/src/modules/dex/directives/tradeHistory/tradeHistory.less deleted file mode 100644 index 2a069a38cf..0000000000 --- a/src/modules/dex/directives/tradeHistory/tradeHistory.less +++ /dev/null @@ -1,22 +0,0 @@ -@import (reference) 'config'; -@import (reference) "../../../app/less/typography"; - -.dex-trade-history { - display: block; - width: 100%; - height: 100%; - - .decimal-muted { - color: @color-disabled-500; - } - - .order-side { - &.sell { - color: @color-error-400; - } - - &.buy { - color: @color-submit-400; - } - } -} diff --git a/src/modules/dex/less/dex.less b/src/modules/dex/less/dex.less deleted file mode 100644 index e4e1216fc8..0000000000 --- a/src/modules/dex/less/dex.less +++ /dev/null @@ -1,325 +0,0 @@ -@import (reference) 'config'; -@import (reference) 'icons'; -@import (reference) '../../app/less/typography'; - -@dex-lower-block-height: 50%; - -body.dex, -body.dex-demo { - background-color: @dex-background; - color: @color-basic-900; - - .main-content { - min-height: 466px; - - .content { - max-width: 100%; - padding: 5px; - } - } - - input::placeholder { - color: @color-basic-500; - opacity: 1; - } - - .ghost { - background: @color-white; - } - - .toggler { - display: none; - position: absolute; - right: 5px; - top: 10px; - z-index: 1; - } - - .input-container { - .input-error .error { - padding: 12px; - } - } - - .block-title { - .input-wrap input { - padding: 6px 8px 6px 21px; - background: url(/img/icons/icon-search-dex.svg) 0 center no-repeat; - background-size: 12px 12px; - font-size: @font-size-caption-2; - height: 29px; - border: 0 none; - border-radius: 0; - width: 100%; - } - - .has-search { - width: 50%; - margin-left: 20px; - position: relative; - - &::before { - width: 1px; - height: 37px; - content: ''; - background: @color-basic-100; - display: block; - position: absolute; - left: -10px; - top: -4px; - } - } - } - - .search-item { - font-size: @font-size-caption-1; - cursor: pointer; - - &.has-ticker { - font-weight: bold; - } - } - - .input-clear { - display: block; - position: absolute; - right: 1px; - top: 50%; - margin-top: -1px; - transform: translateY(-50%); - width: 30px; - height: 30px; - z-index: 2; - cursor: pointer; - background-image: url(/img/icons/order_cancel.svg); - background-size: 8px 8px; - background-repeat: no-repeat; - background-position: center; - } -} - -.dex-trade-graph { - height: 100%; - max-height: 100%; -} - -.dex-loader, -.loading { - opacity: 0; -} - -.dex-loader { - position: absolute; - z-index: 0; -} - -.dex-loader.loading { - opacity: 1; - position: absolute; - z-index: 1; - display: inline-block; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); -} - -@media screen and (min-width: 2400px) { - .dex, - .dex-demo { - .dex-watchlist { - .titles-wrap { - height: 42px; - - .select__wrap { - .select__list { - height: 42px; - font-size: 13px; - } - - .option { - font-size: 13px; - } - - .select__title { - height: 41px; - font-size: 13px; - } - } - - .title { - height: 42px; - font-size: 13px; - - &.active { - background: @color-white; - } - } - } - } - - .create-order { - .create-order { - .body .making-order .areas .area .name { - line-height: 36px; - } - } - } - - .dex-layout { - &__tradehistory .tabs { - .titles-wrap { - height: 42px; - - .title { - height: 42px; - } - } - - .tab-tem { - overflow-x: auto; - } - - .tabs-myOrderHistory { - .smart-table { - &__cell { - .decimal-muted { - color: @color-basic-900; - } - } - } - } - } - } - } - - w-dex-trade-graph { - height: 100%; - max-height: 100%; - } - - .candle-chart-wrapper.error { - display: flex; - - & > div { - text-align: center; - display: flex; - margin: auto; - - div:first-child { - .body-1(); - margin: 0 auto 5px auto; - color: @color-basic-700; - - &::before { - background-image: url(/img/icons/icon-empty.svg); - background-repeat: no-repeat; - width: 50px; - height: 52px; - margin: 0 auto 20px; - display: block; - content: ''; - } - } - } - } -} - -@media screen and (max-width: 1024px) { - .dex, - .dex-demo { - .content { - height: 100%; - width: 100%; - padding: 5px; - right: 0; - bottom: 0; - } - - .dex-candle-chart { - border-radius: 0 0 2px 0; - } - - .tabs { - .tab-body-wrap { - height: calc(100% ~'- 48px'); - } - - .titles-wrap { - height: 48px; - box-shadow: @shadow-menu-top; - position: relative; - z-index: 6; - - &::after { - display: none; - } - - .title { - height: 48px; - line-height: 48px; - - &.active { - border: 0 none; - border-bottom: 1px solid @color-submit-400; - - &::after, - &::before { - display: none; - } - } - } - } - } - - .tabs, - .dex-watchlist { - .table { - .t-head { - display: none; - } - } - } - } -} - -@media screen and (min-width: 660px) and (max-width: 1024px) { - .dex, - .dex-demo { - min-width: 645px; - width: 100%; - min-height: 100%; - - .content { - position: relative; - margin-top: 0; - overflow: auto; - } - } -} - -@media screen and (max-width: 659px) { - .dex, - .dex-demo { - min-width: 100%; - - .content { - width: 100%; - padding: 5px; - right: 0; - bottom: 0; - height: 100%; - max-height: calc(100% ~' - 80px'); - overflow: auto; - } - - - .tabs { - w-scroll-box { - height: 392px; - width: 100%; - overflow-y: auto; - overflow-x: hidden; - } - } - } -} \ No newline at end of file diff --git a/src/modules/dex/services/CandlesService.js b/src/modules/dex/services/CandlesService.js deleted file mode 100644 index d16944a283..0000000000 --- a/src/modules/dex/services/CandlesService.js +++ /dev/null @@ -1,194 +0,0 @@ -/* eslint-disable no-console */ -(function () { - 'use strict'; - - const { config } = require('data-service'); - const { flatten, pipe, prop, map } = require('ramda'); - const POLL_DELAY = 800; - - /** - * @param {app.utils} utils - * @param {TimeLine} timeLine - * @param {SymbolInfoService} symbolInfoService - * @param {Waves} waves - * @param {Matcher} matcher - * @return {CandlesService} - */ - const factory = function (utils, timeLine, symbolInfoService, waves, matcher) { - - class CandlesService { - - constructor() { - this._lastTime = 0; - this._subscriber = null; - this.onLoadError = angular.noop; - } - - static _getAndHandleCandles(symbolInfo, from, to, resolution, handleCandles, handleError = angular.noop) { - CandlesService - ._getCandles( - symbolInfo, - from, - to, - resolution - ) - .then(handleCandles) - .catch(handleError); - } - - /** - * @param {string} symbolInfo - * @param {number} from - * @param {number} to - * @param {number} interval - * @return {Promise} - * @private - */ - static _getCandles(symbolInfo, from, to, interval) { - from = from || to; - const amountId = symbolInfo._wavesData.amountAsset.id; - const priceId = symbolInfo._wavesData.priceAsset.id; - const { options, config: candleConfig } = utils.getValidCandleOptions(from, to, interval); - const promises = options.map(option => config.getDataService().getCandles(amountId, priceId, { - matcher: matcher.currentMatcherAddress, - ...option - })); - - const convertBigNumber = num => (num.isNaN() ? null : Number(num.toFixed())); - - const candles = Promise.all(promises) - .then(pipe(map(prop('data')), flatten)) - .then(list => list - .map(candle => ({ - txsCount: candle.txsCount || 0, - high: convertBigNumber(candle.high), - low: convertBigNumber(candle.low), - close: convertBigNumber(candle.close), - open: convertBigNumber(candle.open), - volume: convertBigNumber(candle.volume), - time: new Date(candle.time).getTime() - }))); - - const lastTrade = ds.api.pairs.get(amountId, priceId) - .then(pair => waves.matcher.getLastPrice(pair) - .catch(() => null)); - - return Promise.all([candles, lastTrade]) - .then(([candles, lastTrade]) => { - if (candles.length === 1 && lastTrade) { - candles[candles.length - 1].close = Number(lastTrade.price.toTokens()); - } else { - candles = candleConfig.converter(candles); - } - return candles - .filter(candle => candle.open != null); - }).catch(() => utils.wait(5000).then(() => [])); - } - - static convertToMilliseconds(seconds) { - return Number(seconds) ? seconds * 1000 : Date.now(); - } - - onReady(callback) { - setTimeout(() => callback({ - supported_resolutions: WavesApp.dex.resolutions, - supports_time: true, - supports_marks: false, - supports_timescale_marks: false - }), 0); - } - - resolveSymbol(symbolName, resolve, reject) { - if (symbolName.match(/^DEX:/)) { - return; - } - - symbolInfoService.get(symbolName) - .then(resolve) - .catch(() => { - this.onLoadError(); - reject(); - }); // TODO - } - - getBars(symbolInfo, resolution, from, to, onHistoryCallback, onErrorCallback) { - from = CandlesService.convertToMilliseconds(from); - to = CandlesService.convertToMilliseconds(to); - const handleCandles = (candles) => { - if (candles.length) { - this._updateLastTime(candles); - onHistoryCallback(candles); - } else { - onHistoryCallback([], { - noData: true - }); - } - }; - - CandlesService._getAndHandleCandles( - symbolInfo, - from, - to, - resolution, - handleCandles, - onErrorCallback - ); - } - - subscribeBars(symbolInfo, resolution, onRealtimeCallback, subscriberUID, onResetCacheNeededCallback) { - this._subscriber = subscriberUID; - - const to = Date.now(); - const from = this._lastTime; - - const handleCandles = (candles) => { - if (this._subscriber !== subscriberUID) { - return; - } - - this.subscribeBars( - symbolInfo, - resolution, - onRealtimeCallback, - subscriberUID, - onResetCacheNeededCallback - ); - - if (candles.length) { - this._updateLastTime(candles); - candles.forEach(onRealtimeCallback); - } - }; - - timeLine.timeout(() => { - CandlesService._getAndHandleCandles( - symbolInfo, - from, - to, - resolution, - handleCandles - ); - }, POLL_DELAY); - } - - unsubscribeBars() { - this._subscriber = null; - } - - _updateLastTime(candles) { - const lastTime = candles[candles.length - 1].time; - if (this._lastTime && this._lastTime >= lastTime) { - return false; - } - this._lastTime = lastTime; - } - - } - - return new CandlesService(); - }; - - factory.$inject = ['utils', 'timeLine', 'symbolInfoService', 'waves', 'matcher']; - - angular.module('app.dex').factory('candlesService', factory); -})(); diff --git a/src/modules/dex/services/DexDataService.js b/src/modules/dex/services/DexDataService.js deleted file mode 100644 index 4eef990230..0000000000 --- a/src/modules/dex/services/DexDataService.js +++ /dev/null @@ -1,38 +0,0 @@ -(function () { - 'use strict'; - - const tsUtils = require('ts-utils'); - - const factory = function (Base) { - - /** - * @class - */ - class DexDataService extends Base { - - constructor() { - super(); - /** - * @type {Signal} - */ - this.chooseOrderBook = new tsUtils.Signal(); - /** - * @type {Signal} - */ - this.showSpread = new tsUtils.Signal(); - /** - * @type {Signal} - */ - this.createOrder = new tsUtils.Signal(); - } - - } - - - return new DexDataService(); - }; - - factory.$inject = ['Base']; - - angular.module('app.dex').factory('dexDataService', factory); -})(); diff --git a/src/modules/dex/services/SymbolInfoService.js b/src/modules/dex/services/SymbolInfoService.js deleted file mode 100644 index 50526e157d..0000000000 --- a/src/modules/dex/services/SymbolInfoService.js +++ /dev/null @@ -1,86 +0,0 @@ -(function () { - 'use strict'; - - const DEFAULT_SYMBOL_INFO = { - session: '24x7', - exchange: 'DEX', - listed_exchange: 'DEX', - timezone: 'Europe/London', // TODO - - minmov: 1, - - // TODO : check all that - has_intraday: true, - // intraday_multipliers: ['5'], - supported_resolutions: WavesApp.dex.resolutions, - has_seconds: false, - // seconds_multipliers: ['5'], - has_daily: false, - has_weekly_and_monthly: false, - has_empty_bars: true, - force_session_rebuild: false, - has_no_volume: false, - data_status: 'pulsed' - }; - - /** - * @param {Waves} waves - * @param {app.utils.decorators} decorators - * @return {SymbolInfoService} - */ - const factory = function (waves, decorators) { - - class SymbolInfoService { - - get(symbolName) { - const [partOne, partTwo] = symbolName.split('/'); - - if (!partOne || !partTwo) { - return Promise.reject(); - } else { - return this._createSymbolInfo(partOne, partTwo); - } - } - - @decorators.cachable(1440) // TODO : make it persistent when cachable is limited in size - _createSymbolInfo(assetOneId, assetTwoId) { - return ds.api.pairs.get(assetOneId, assetTwoId).then((pair) => { - const amount = pair.amountAsset; - const price = pair.priceAsset; - - // TODO : remove when Waves.Asset is created via factory - return Promise.all([ - waves.node.assets.getAsset(amount.id), - waves.node.assets.getAsset(price.id) - ]).then(([amountInfo, priceInfo]) => { - const amountName = amountInfo.ticker ? amountInfo.ticker : amountInfo.name; - const priceName = priceInfo.ticker ? priceInfo.ticker : priceInfo.name; - - const ticker = `${amountInfo.id}/${priceInfo.id}`; - const symbolName = `${amountName}/${priceName}`; - - return { - ...DEFAULT_SYMBOL_INFO, - pricescale: Math.pow(10, price.precision), - volume_precision: amount.precision, - description: symbolName, - name: symbolName, - ticker, - _wavesData: { - amountAsset: amountInfo, - priceAsset: priceInfo - } - }; - }); - }); - } - - } - - return new SymbolInfoService(); - }; - - factory.$inject = ['waves', 'decorators']; - - angular.module('app.dex').factory('symbolInfoService', factory); -})(); diff --git a/src/modules/dex/templates/dex.html b/src/modules/dex/templates/dex.html deleted file mode 100644 index 1ceb79761c..0000000000 --- a/src/modules/dex/templates/dex.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 1928249caf3b36c8a37211bd66be799ee32c9dfb Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 25 Nov 2019 11:21:33 +0300 Subject: [PATCH 20/59] DEXW-2442: delete tokens page and module --- src/index.hbs | 9 +- src/modules/app/app.js | 1 - src/modules/tokens/controllers/TokensCtrl.js | 367 ------------------- src/modules/tokens/less/generate-form.less | 37 -- src/modules/tokens/less/preview-token.less | 46 --- src/modules/tokens/less/token-info.less | 34 -- src/modules/tokens/less/tokens.less | 67 ---- src/modules/tokens/less/tokens.modal.less | 47 --- src/modules/tokens/templates/tokens.html | 255 ------------- src/modules/tokens/tokens.js | 5 - 10 files changed, 1 insertion(+), 867 deletions(-) delete mode 100644 src/modules/tokens/controllers/TokensCtrl.js delete mode 100644 src/modules/tokens/less/generate-form.less delete mode 100644 src/modules/tokens/less/preview-token.less delete mode 100644 src/modules/tokens/less/token-info.less delete mode 100644 src/modules/tokens/less/tokens.less delete mode 100644 src/modules/tokens/less/tokens.modal.less delete mode 100644 src/modules/tokens/templates/tokens.html delete mode 100644 src/modules/tokens/tokens.js diff --git a/src/index.hbs b/src/index.hbs index e590aa11b2..e5d0af549c 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -664,14 +664,7 @@ abstract: true, views: [{ name: 'main', templateUrl: 'modules/app/templates/main.html' }] }, - children: [ - { - id: 'tokens', - data: { - views: [{ name: 'mainContent' }] - } - } - ] + children: [] } ] }); diff --git a/src/modules/app/app.js b/src/modules/app/app.js index 0053e4b3c3..62395423ac 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -104,7 +104,6 @@ 'app.welcome', 'app.switch', 'app.desktopUpdate', - 'app.tokens', 'app.unavailable', 'app.stand', 'app.migration' diff --git a/src/modules/tokens/controllers/TokensCtrl.js b/src/modules/tokens/controllers/TokensCtrl.js deleted file mode 100644 index c38a134d6b..0000000000 --- a/src/modules/tokens/controllers/TokensCtrl.js +++ /dev/null @@ -1,367 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {typeof Base} Base - * @param {$rootScope.Scope} $scope - * @param {ModalManager} modalManager - * @param {Waves} waves - * @param {BalanceWatcher} balanceWatcher - * @param {User} user - * @param {app.utils} utils - * @param {PromiseControl} PromiseControl - */ - const controller = function (Base, $scope, modalManager, waves, balanceWatcher, user, utils, PromiseControl) { - - const { SIGN_TYPE, WAVES_ID } = require('@waves/signature-adapter'); - const { BigNumber } = require('@waves/bignumber'); - const ds = require('data-service'); - const $ = require('jquery'); - const BASE_64_PREFIX = 'base64:'; - - class TokensCtrl extends Base { - - /** - * @type {boolean} - */ - focusName = false; - - /** - * @type {PromiseControl} - */ - _findNamePC = null; - - /** - * @type {boolean} - */ - agreeConditions = false; - - /** - * @type {boolean} - */ - nameWarning = false; - - /** - * Link to angular form object - * @type {form.FormController} - */ - createForm = null; - /** - * @type {string} - */ - assetId = ''; - /** - * Token name - * @type {string} - */ - name = ''; - /** - * Token description - * @type {string} - */ - description = ''; - /** - * Can reissue this token - * @type {boolean} - */ - issue = true; - /** - * Count of generated tokens - * @type {BigNumber} - */ - count = null; - /** - * Precision of token - * @type {number} - */ - precision = 0; - /** - * @type {BigNumber} - */ - maxCoinsCount = WavesApp.maxCoinsCount; - /** - * Has money for fee - * @type {boolean} - */ - invalid = false; - /** - * @type {string} - */ - script = ''; - /** - * @type {boolean} - */ - isValidScript = true; - /** - * @type {boolean} - */ - scriptPending = false; - /** - * @type {Money} - */ - fee = null; - /** - * @type {boolean} - */ - hasAssetScript = false; - /** - * @type {Signable} - */ - signable = null; - /** - * @type {JQueryXHR | null} - * @private - */ - _scriptValidationXHR = null; - /** - * @type {Money} - * @private - */ - _balance; - /** - * @type {boolean} - */ - isNFT = false; - /** - * @type {args} - */ - signPending = false; - /** - * @type {Array} - * @private - */ - _listeners = []; - - - constructor() { - super($scope); - - this.receive(balanceWatcher.change, this._onChangeBalance, this); - - this.observe('precision', this._onChangePrecision); - this.observe('script', this._onChangeScript); - this.observe([ - 'name', - 'count', - 'script', - 'precision', - 'description', - 'issue', - 'hasAssetScript', - 'fee' - ], this.createSignable); - - this.observe([ - 'count', - 'precision', - 'issue' - ], this._setIsNFT); - - this._getFee(); - this.observe('isNFT', this._getFee); - - this.observeOnce('createForm', () => { - this.receive(utils.observe(this.createForm, '$valid'), this.createSignable, this); - }); - - const signPendingListener = $scope.$on('signPendingChange', (event, data) => { - this.signPending = data; - }); - - this._listeners.push(signPendingListener); - } - - $onDestroy() { - super.$onDestroy(); - this._listeners.forEach(listener => listener()); - } - - /** - * @param {boolean} focus - */ - onNameFocus(focus) { - this.focusName = !!focus; - } - - generate(signable) { - return modalManager.showConfirmTx(signable) - .then(() => this._reset()); - } - - sendAnalytics() { - analytics.send({ name: 'Token Generation Info Show', target: 'ui' }); - } - - getSignable() { - return this.signable; - } - - createSignable() { - this._verifyName().then( - res => { - this.nameWarning = res; - $scope.$apply(); - } - ); - - if (!this.name || !this.createForm || !this.createForm.$valid) { - this.assetId = ''; - return null; - } - - const precision = Number(this.precision.toString()); - const quantity = (this.count || new BigNumber(0)).mul(Math.pow(10, precision)); - const script = this.hasAssetScript && this.script ? `${BASE_64_PREFIX}${this.script}` : ''; - - const tx = waves.node.transactions.createTransaction({ - type: SIGN_TYPE.ISSUE, - name: this.name, - description: this.description, - reissuable: this.issue, - quantity, - precision, - script, - fee: this.fee - }); - - this.signable = ds.signature.getSignatureApi().makeSignable({ type: tx.type, data: tx }); - - this.signable.getId().then(id => { - this.assetId = id; - utils.safeApply($scope); - }); - } - - /** - * @return {*} - * @private - */ - _verifyName() { - if (this._findNamePC != null) { - this._findNamePC.abort(); - } - this._findNamePC = new PromiseControl(utils.wait(1000)); - return this._findNamePC - .then(() => utils.assetNameWarning(this.name)); - } - - /** - * @return {null} - * @private - */ - _onChangeScript() { - if (this._scriptValidationXHR) { - this._scriptValidationXHR.abort(); - this.scriptPending = false; - } - const script = this.script.replace(BASE_64_PREFIX, ''); - - if (!script) { - this.isValidScript = true; - this.scriptPending = false; - return null; - } - - this.isValidScript = true; - this.scriptPending = true; - this._scriptValidationXHR = $.ajax({ - method: 'POST', - url: `${user.getSetting('network.node')}/utils/script/estimate`, - data: script - }); - - this._scriptValidationXHR - .then(() => { - this.isValidScript = true; - }) - .catch(() => { - this.isValidScript = false; - }) - .always(() => { - this.scriptPending = false; - $scope.$apply(); - }); - } - - /** - * @param {BigNumber} value - * @private - */ - _onChangePrecision({ value }) { - if (value && value <= 8) { - this.maxCoinsCount = WavesApp.maxCoinsCount.div(Math.pow(10, Number(value))); - } - } - - /** - * Current can i send transaction (balance gt fee) - * @private - */ - _onChangeBalance() { - this._balance = balanceWatcher.getBalance()[WAVES_ID]; - - this.invalid = (!this.fee || !this._balance) || - this._balance.getTokens().lt(this.fee.getTokens()); - - $scope.$apply(); - } - - /** - * @private - */ - _reset() { - - this.name = ''; - this.description = ''; - this.issue = true; - this.count = new BigNumber(0); - this.precision = 0; - this.maxCoinsCount = WavesApp.maxCoinsCount; - this.script = ''; - this.hasAssetScript = false; - - this.createForm.$setPristine(); - this.createForm.$setUntouched(); - - $scope.$apply(); - } - - /** - * @private - */ - _setIsNFT() { - const { count, precision, issue } = this; - const nftCount = count && count.eq(1); - const nftPrecision = precision === 0; - this.isNFT = !issue && nftCount && nftPrecision; - } - - /** - * @private - */ - _getFee() { - waves.node.getFee({ - type: SIGN_TYPE.ISSUE, - reissue: this.issue, - precision: this.precision, - quantity: this.count - }) - .then(money => { - this.fee = money; - this._onChangeBalance(); - $scope.$apply(); - }); - } - - } - - return new TokensCtrl(); - }; - - controller.$inject = ['Base', '$scope', 'modalManager', - 'waves', 'balanceWatcher', 'user', 'utils', 'PromiseControl']; - - angular.module('app.tokens') - .controller('TokensCtrl', controller); -})(); - diff --git a/src/modules/tokens/less/generate-form.less b/src/modules/tokens/less/generate-form.less deleted file mode 100644 index 29e1e18093..0000000000 --- a/src/modules/tokens/less/generate-form.less +++ /dev/null @@ -1,37 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../app/less/typography'; - -.generate-form { - &__row { - margin-top: 20px; - - &_script { - margin-top: 10px; - - textarea { - min-height: 77px; - max-height: 300px; - } - } - } - - &__label { - align-items: center; - } - - &__preview { - border-radius: @border-radius; - background-color: @color-disabled-50; - border: 1px solid @color-basic-100; - height: 72px; - } - - &__textarea { - min-height: 77px; - max-height: 300px; - } - - w-help-icon { - z-index: auto; - } -} \ No newline at end of file diff --git a/src/modules/tokens/less/preview-token.less b/src/modules/tokens/less/preview-token.less deleted file mode 100644 index fc0ee975cf..0000000000 --- a/src/modules/tokens/less/preview-token.less +++ /dev/null @@ -1,46 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../app/less/typography'; - -.preview-token { - display: flex; - flex-direction: row; - align-items: center; - width: 100%; - - &__avatar { - display: flex; - width: 30px; - height: 30px; - margin: 0 16px; - border-radius: 100%; - background-color: @color-basic-100; - position: relative; - } - - &__logo { - cursor: pointer; - - &:hover + .preview-token__tooltip .tooltip { - display: flex; - } - - .asset-logo__marker { - display: none; - } - } - - &__tooltip { - top: -8px; - left: 50%; - position: absolute; - - .information-icon { - display: none; - } - - .tooltip { - align-items: center; - transform: translateX(-50%); - } - } -} diff --git a/src/modules/tokens/less/token-info.less b/src/modules/tokens/less/token-info.less deleted file mode 100644 index 31c42b2128..0000000000 --- a/src/modules/tokens/less/token-info.less +++ /dev/null @@ -1,34 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../app/less/typography'; - -.token-info { - display: flex; - flex: 1 0; - flex-direction: column; - justify-content: center; - - &.empty { - .token-info__line { - &_name { - margin-bottom: 12px; - - &::after { - width: 50%; - } - } - - &_value::after { - width: 80%; - } - - &_name::after, - &_value::after { - content: ''; - display: block; - height: 8px; - border-radius: 100px; - background-color: @color-basic-100; - } - } - } -} \ No newline at end of file diff --git a/src/modules/tokens/less/tokens.less b/src/modules/tokens/less/tokens.less deleted file mode 100644 index 30a77d5263..0000000000 --- a/src/modules/tokens/less/tokens.less +++ /dev/null @@ -1,67 +0,0 @@ -@import (reference) 'config'; -@import (reference) '../../app/less/typography'; - -.tokens { - .main-content .content { - overflow: inherit; - max-width: 100%; - height: auto; - } - - .show-fader + .main-header__header { - padding-right: 24px; - } -} - -.tokens-page { - .nameHelper { - display: none; - - &.showNameHelper { - display: block; - } - } - - &__wrapper { - background-color: @color-white; - border-radius: @border-radius; - box-shadow: @shadow-type-1; - max-width: 540px; - margin: auto; - } - - &__content { - overflow: auto; - padding: 0 40px 40px; - } - - &__title { - display: flex; - align-items: center; - padding: 0 40px; - height: 60px; - border-bottom: 1px solid @color-basic-200; - } -} - -@media screen and (max-width: 768px) { - .tokens-page { - .byte-validator__help { - position: relative; - top: 4px; - } - - &__content, - &__title { - padding: 0 20px; - } - - &__content { - padding-bottom: 20px; - } - - &__title { - height: 50px; - } - } -} diff --git a/src/modules/tokens/less/tokens.modal.less b/src/modules/tokens/less/tokens.modal.less deleted file mode 100644 index 20c8455b7c..0000000000 --- a/src/modules/tokens/less/tokens.modal.less +++ /dev/null @@ -1,47 +0,0 @@ -@import (reference) "../../app/less/app-icons"; -@import (reference) 'config'; -@import (reference) 'icons'; - -md-dialog.tokens-generate-modal { - - .icon { - &.confirm-icon { - .icon-tx-issue(); - width: 100%; - height: 76px; - background-size: 80px 76px; - background-position: center center; - background-repeat: no-repeat; - } - - &.icon-success { - width: 80px; - height: 80px; - margin: 30px auto 20px; - background-image: url(/img/icons/check.svg); - background-repeat: no-repeat; - background-position: center; - } - } - - .description { - margin-top: 5px; - padding: 13px 16px; - background-color: @color-basic-50; - border: 1px dashed @color-basic-200; - border-radius: @border-radius; - } - - .fee { - display: flex; - border-bottom: 1px solid @color-basic-200; - padding-bottom: 13px; - justify-content: space-between; - align-items: center; - } - - w-button { - margin: auto; - width: 224px; - } -} diff --git a/src/modules/tokens/templates/tokens.html b/src/modules/tokens/templates/tokens.html deleted file mode 100644 index 7710d43950..0000000000 --- a/src/modules/tokens/templates/tokens.html +++ /dev/null @@ -1,255 +0,0 @@ -
-
-
-
-
-
- -
-
- -
-
- - - - -
-
-
- - - - - - - - - - -
-
- -
-
- - - - - - - -
- -
-
- - -
- -
-
-
-
-
- -
- - - - - - - - - - -
- - - - - - - - - - - - - -
-
- -
-
- - -
- -
-
-
- -
- -
-
-
-
-
-
- -
-
- - -
-
-
- -
-
-
- -
- - - -
-
-
- -
- - - - - - - - - - - -
-
-
-
-
-
-
-
-
- -
-
-
-
- - - - -
-
-
- {{$ctrl.name}} -
-
- -
-
-
-
- -
-
-
-
- -
- - -
- -
-
-
-
- -
-
- -
- - - - - -
-
-
-
diff --git a/src/modules/tokens/tokens.js b/src/modules/tokens/tokens.js deleted file mode 100644 index dc966f50c0..0000000000 --- a/src/modules/tokens/tokens.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.tokens', []); -})(); From 128b97bd48cba4e01c063dd7e51b990ba8192565 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 25 Nov 2019 11:27:47 +0300 Subject: [PATCH 21/59] DEXW-2442: delete main route state, stateManager service in header --- src/index.hbs | 8 -------- src/modules/ui/directives/mainHeader/MainHeader.js | 3 --- 2 files changed, 11 deletions(-) diff --git a/src/index.hbs b/src/index.hbs index e5d0af549c..08cc3294d9 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -657,14 +657,6 @@ url: '/migration', views: [{ name: 'main' }] } - }, - { - id: 'main', - data: { - abstract: true, - views: [{ name: 'main', templateUrl: 'modules/app/templates/main.html' }] - }, - children: [] } ] }); diff --git a/src/modules/ui/directives/mainHeader/MainHeader.js b/src/modules/ui/directives/mainHeader/MainHeader.js index 6a7ca218df..95f568685c 100644 --- a/src/modules/ui/directives/mainHeader/MainHeader.js +++ b/src/modules/ui/directives/mainHeader/MainHeader.js @@ -12,7 +12,6 @@ /** * @param Base - * @param {stateManager} stateManager * @param {ModalManager} modalManager * @param {app.utils} utils * @param {ng.IScope} $scope @@ -26,7 +25,6 @@ */ const controller = function ( Base, - stateManager, modalManager, user, $state, @@ -494,7 +492,6 @@ controller.$inject = [ 'Base', - 'stateManager', 'modalManager', 'user', '$state', From 49e7a2a7ecb06000e48b52f0ee569d607ed8fb38 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 25 Nov 2019 11:46:16 +0300 Subject: [PATCH 22/59] DEXW-2442: welcome page delete useless --- .../welcome/controllers/WelcomeCtrl.js | 234 +----------------- 1 file changed, 6 insertions(+), 228 deletions(-) diff --git a/src/modules/welcome/controllers/WelcomeCtrl.js b/src/modules/welcome/controllers/WelcomeCtrl.js index d1e9f7d6d3..7955e5c720 100644 --- a/src/modules/welcome/controllers/WelcomeCtrl.js +++ b/src/modules/welcome/controllers/WelcomeCtrl.js @@ -2,122 +2,22 @@ 'use strict'; /** - * @param {typeof Base} Base * @param {ng.IScope} $scope * @param {User} user - * @param {ModalManager} modalManager - * @param {app.utils.Storage} storage - * @param {ChartFactory} ChartFactory * @param {app.utils} utils - * @param {JQuery} $element - * @param {Waves} waves - * @param {Matcher} matcher - * @param {ConfigService} configService + * @param {app.utils.Storage} storage * @return {WelcomeCtrl} */ const controller = function ( - Base, $scope, user, - modalManager, utils, - waves, - $element, - ChartFactory, - storage, - matcher, - configService + storage ) { - const ds = require('data-service'); - const { Money } = require('@waves/data-entities'); - const { flatten, uniqBy } = require('ramda'); - const { BigNumber } = require('@waves/bignumber'); - - const WCT_ID = WavesApp.network.code === 'T' ? - WavesApp.defaultAssets.TRY : - 'DHgwrRvVyqJsepd32YbBqUeDH4GJ1N984X8QoekjgH8J'; - - const PAIRS_IN_SLIDER = [ - { - amount: WavesApp.defaultAssets.WEST, - price: 'WAVES' - }, - { - amount: WavesApp.defaultAssets.BTC, - price: 'WAVES' - }, - { - amount: WCT_ID, - price: 'WAVES' - }, - { - amount: WavesApp.defaultAssets.DASH, - price: WavesApp.defaultAssets.BTC - }, - { - amount: WavesApp.defaultAssets.ETH, - price: WavesApp.defaultAssets.BTC - }, - { - amount: WavesApp.defaultAssets.BCH, - price: WavesApp.defaultAssets.BTC - }, - { - amount: WavesApp.defaultAssets.ETH, - price: 'WAVES' - }, - { - amount: 'WAVES', - price: WavesApp.defaultAssets.USD - }, - { - amount: WavesApp.defaultAssets.ZEC, - price: 'WAVES' - }, - { - amount: WavesApp.defaultAssets.XMR, - price: WavesApp.defaultAssets.BTC - } - ]; - - - const chartOptions = { - red: { - axisX: 'timestamp', - axisY: 'rate', - view: { - rate: { - lineColor: '#ef4829', - fillColor: '#FFF', - gradientColor: ['#FEEFEC', '#FFF'], - lineWidth: 4 - } - } - }, - blue: { - axisX: 'timestamp', - axisY: 'rate', - view: { - rate: { - lineColor: '#1f5af6', - fillColor: '#FFF', - gradientColor: ['#EAF0FE', '#FFF'], - lineWidth: 4 - } - } - } - }; - - const whenHeaderGetFix = 60; + const { uniqBy } = require('ramda'); - class WelcomeCtrl extends Base { - - /** - * @type {Array} - * @public - */ - pairsInfoList = []; + class WelcomeCtrl { /** * @type {boolean} @@ -125,16 +25,11 @@ hasMultiAccount = false; constructor() { - super($scope); - - this.locked = !!configService.get('DEXW_LOCKED'); - - this._initDeviceTypes(); user.getMultiAccountData().then(data => { this.hasMultiAccount = !!data; - if (!this.hasMultiAccount && this.isWeb) { + if (!this.hasMultiAccount && WavesApp.isWeb()) { storage.load('accountImportComplete').then(complete => { if (!complete) { this._loadUserListFromOldOrigin(); @@ -142,116 +37,6 @@ }); } }); - - this._initPairs(); - } - - /** - * @private - */ - _addScrollHandler() { - const scrolledView = $element.find('.scrolled-view'); - const header = $element.find('w-main-header'); - - scrolledView.on('scroll', () => { - header.toggleClass('fixed', scrolledView.scrollTop() > whenHeaderGetFix); - header.toggleClass('unfixed', scrolledView.scrollTop() <= whenHeaderGetFix); - }); - } - - /** - * @public - */ - showTutorialModals() { - return modalManager.showTutorialModals(); - } - - /** - * @public - */ - goToDexDemo(pairAssets) { - utils.openDex(pairAssets.assetId1, pairAssets.assetId2, 'dex-demo'); - } - - /** - * @private - */ - _initPairs() { - const FAKE_RATE_HISTORY = [{ - rate: new BigNumber(0), - timestamp: ds.utils.normalizeTime(Date.now()) - }]; - - const startDate = utils.moment().add().day(-7); - Promise.all(PAIRS_IN_SLIDER.map(pair => ds.api.pairs.get(pair.amount, pair.price))) - .then(pairs => Promise.all(pairs.map( - pair => ds.api.pairs.info(matcher.currentMatcherAddress, [pair]))) - ) - .then(infoList => { - const flattenInfoList = flatten(infoList); - - Promise.all( - PAIRS_IN_SLIDER - .map(({ amount, price }) => waves.utils.getRateHistory(amount, price, startDate)) - .map(promise => promise.catch(() => FAKE_RATE_HISTORY)) - ) - .then(rateHistory => { - this.pairsInfoList = rateHistory.map(WelcomeCtrl._fillValues(flattenInfoList)); - }) - .then(() => { - utils.safeApply($scope); - this._insertCharts(); - this._addScrollHandler(); - }); - }); - } - - /** - * @param {array} infoList - * @static - */ - static _fillValues(infoList) { - return (rateHistory, i) => { - const info = infoList[i]; - const volume = info.volume || new Money(0, info.priceAsset); - return { - ...info, - ticker: info.ticker || info.displayName, - change24: info.change24 || new BigNumber(0), - high: info.high || new Money(0, info.priceAsset), - lastPrice: info.lastPrice || new Money(0, info.priceAsset), - low: info.low || new Money(0, info.priceAsset), - volume, - rateHistory, - volumeBigNum: volume.getTokens() - }; - }; - } - - /** - * @private - */ - _insertCharts() { - const marketRows = $element.find('.js-table-markets .js-row-content'); - PAIRS_IN_SLIDER.forEach((pair, i) => { - const options = this.pairsInfoList[i].change24.gt(0) ? chartOptions.blue : chartOptions.red; - const chartData = { - rate: this.pairsInfoList[i].rateHistory - }; - new ChartFactory( - marketRows.eq(i).find('.graph'), - options, - chartData - ); - }); - } - - /** - * @private - */ - _initDeviceTypes() { - this.isDesktop = WavesApp.isDesktop(); - this.isWeb = WavesApp.isWeb(); } /** @@ -288,17 +73,10 @@ }; controller.$inject = [ - 'Base', '$scope', 'user', - 'modalManager', 'utils', - 'waves', - '$element', - 'ChartFactory', - 'storage', - 'matcher', - 'configService' + 'storage' ]; angular.module('app.welcome') From 6ce846aa7196950831c34707290b209c3ac41a08 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 25 Nov 2019 11:48:39 +0300 Subject: [PATCH 23/59] DEXW-2442: delete stand page and module --- src/index.hbs | 7 - src/modules/app/app.js | 1 - src/modules/stand/controller/StandCtrl.js | 119 ----- src/modules/stand/less/stand.less | 105 ----- src/modules/stand/stand.js | 5 - src/modules/stand/templates/stand.html | 525 ---------------------- 6 files changed, 762 deletions(-) delete mode 100644 src/modules/stand/controller/StandCtrl.js delete mode 100644 src/modules/stand/less/stand.less delete mode 100644 src/modules/stand/stand.js delete mode 100644 src/modules/stand/templates/stand.html diff --git a/src/index.hbs b/src/index.hbs index 08cc3294d9..5a9f34f7ca 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -635,13 +635,6 @@ views: [{ name: 'main' }] } }, - { - id: 'stand', - data: { - noLogin: true, - views: [{ name: 'main' }] - } - }, { id: 'desktopUpdate', data: { diff --git a/src/modules/app/app.js b/src/modules/app/app.js index 62395423ac..a8583ae955 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -105,7 +105,6 @@ 'app.switch', 'app.desktopUpdate', 'app.unavailable', - 'app.stand', 'app.migration' ]); })(); diff --git a/src/modules/stand/controller/StandCtrl.js b/src/modules/stand/controller/StandCtrl.js deleted file mode 100644 index 615dfccb4b..0000000000 --- a/src/modules/stand/controller/StandCtrl.js +++ /dev/null @@ -1,119 +0,0 @@ -/* eslint-disable max-len */ -(function () { - 'use strict'; - - /** - * @param Base - * @param $scope - * @return {StandCtrl} - */ - const controller = function (Base, $scope, userNotification, notification) { - - class StandCtrl extends Base { - - constructor() { - - super($scope); - - const seed = 'merry evil keep lost fox tech absent trololo both field get input div cosmic'; - /** - * @type {string} - */ - this.tab = 'info'; - this.qrData = 'Keep on waving, we`ll take care of the bad guys'; - this.info = this.dataCopy = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - /** - * @type {boolean} - */ - this.invalid = true; - this.warning = true; - this.success = true; - this.error = true; - this.active = true; - this.inactive = true; - this.seedConfirmWasFilled = false; - this.seedIsValid = false; - /** - * @type {string} - */ - this.seed = seed; - - const loop = (index) => { - userNotification.info({ - body: { - literal: index + 1 - } - }).then(() => loop(index + 1)); - }; - - loop(0); - - const loop2 = (index) => { - userNotification.error({ - body: { - literal: index + 1 - } - }).then(() => loop2(index + 1)); - }; - - loop2(0); - - const loop3 = (index) => { - userNotification.success({ - body: { - literal: index + 1 - } - }).then(() => loop3(index + 1)); - }; - - loop3(0); - - const loop4 = (index) => { - userNotification.warn({ - body: { - literal: index + 1 - } - }).then(() => loop4(index + 1)); - }; - - loop4(0); - - const loop0 = (index) => { - notification.info({ - title: { - literal: 'Title info' - }, - body: { - literal: 'Text body info' - } - }).then(() => loop0(index + 1)); - }; - - loop0(0); - - - const loop5 = (index) => { - notification.error({ - title: { - literal: 'Title error' - }, - body: { - literal: 'Text body error' - } - }).then(() => loop5(index + 1)); - }; - - loop5(0); - - - } - - } - - return new StandCtrl(); - }; - - controller.$inject = ['Base', '$scope', 'userNotification', 'notification']; - - angular.module('app.stand').controller('StandCtrl', controller); -})(); diff --git a/src/modules/stand/less/stand.less b/src/modules/stand/less/stand.less deleted file mode 100644 index 00cd196569..0000000000 --- a/src/modules/stand/less/stand.less +++ /dev/null @@ -1,105 +0,0 @@ -@import (reference) 'config'; - -html body.stand { - .hidden { - display: block !important; - } - - h1 { - color: grey; - } - - w-seed-read[type="read"] { - position: relative; - &:before { - position: absolute; - z-index: 1; - width: 100%; - height: 135px; - content: ''; - opacity: 0; - display: block; - } - } - - w-change-language .select { - position: relative; - top: 0; - right: 0; - } - - .select img { - width: 30px; - height: 30px; - display: block; - margin-right: 10px; - } - - .checkbox-submit { - margin-right: @padding-main-layout; - &__wrap { - width: 300px !important; - } - } - - .error-block { - margin-top: 130px; - } - - .components-wrapper { - display: flex; - width: 100%; - overflow-x: auto; - min-width: 1200px; - } - - .select__list { - margin-bottom: 40px; - } - - .column1, - .column2, - .column3 { - flex-basis: 33.33%; - padding: 20px 80px; - min-height: 100vh; - min-width: 400px; - } - - .column1, - .column2 { - border-right: 1px dashed @color-basic-200; - } - - .column2 { - background: @color-basic-50; - .relative-wrapper { - background: @color-white; - } - } - - .qr-wrapper, - .relative-wrapper { - background: @color-white; - position: relative; - border: 1px dashed @color-basic-200; - min-height: 100px; - padding: 20px 0; - border-radius: @border-radius; - } - - ._internal-error { - display: block !important; - } - - .tabs { - .tab-content { - display: flex; - align-items: center; - font-size: 100px; - padding: 20px; - min-height: 140px; - justify-content: center; - } - } -} diff --git a/src/modules/stand/stand.js b/src/modules/stand/stand.js deleted file mode 100644 index 7b26d76e2c..0000000000 --- a/src/modules/stand/stand.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app.stand', []); -})(); diff --git a/src/modules/stand/templates/stand.html b/src/modules/stand/templates/stand.html deleted file mode 100644 index 84c6993284..0000000000 --- a/src/modules/stand/templates/stand.html +++ /dev/null @@ -1,525 +0,0 @@ -
- -
-
- -

Buttons

- - - - - - - Send - - -
- - - Tiny - - -
- - - Micro - - -
- - - Small - - -
- - - Medium - - - - -
- - - Big button - - -
- - - Big warning - - -
- - - bordered - - -
- -
- Expand button - -
- -
- -

Selects

- - - -
- -
Select title
- - Default - Value 1 - Value 2 - Value 3 - Value 4 - Value 4 - - -
- - - Big - option 2 - option 3 - option 4 - option 5 - - -
- - - Big disabled - option 2 - option 3 - option 4 - option 5 - - -
- - - Interface - option 2 - option 3 - option 4 - option 5 - - -
- - - Interface disabled - option 2 - option 3 - option 4 - option 5 - - -
- -
Select with filter title
- - - Bitcoin - Waves - Bitcoin - Bitcoin - Waves - Waves - Waves - Waves - Waves - Waves - Waves - Waves - Waves - Waves - - -
- -

Inputs

- -
Input title
- - -
- -
Textarea title
- - -
- - - {{$ctrl.dataCopy}} - - - -
- -
- -
- - - - - Value 1 - - - Value 2 - - -
-
-
- -
- -
- - - - - -
- -
- -
- - - -
ON
-
OFF
-
- -
- -

Range

- - - -
- -
-
- -

Errors

- -
- - -
This field is requied
- -
- - - - - This field is requied - - -
- - - - - First error - Second error - Another error - One more error - - -
-
- - - -

Empty block

- - - -
- -

Loader

- -
- -
- -
- -

Tooltip

- -
- Important information - - Hi, I'm Tooltip. I need a relative container - -
- -
- -

Helpers

- -
- Some title - -
Helper header
-
Helper description first row
-
Helper description second row
-
Helper description third row
-
-
- -
- Some title Info - -
Helper header
-
Helper description first row
-
Helper description second row
-
Helper description third row
-
-
- -
- -

QR Code

-
-
Отсканируйте QR код
- -
Нажмите чтобы увеличить/уменьшить
- -
- -
- -

Expandable block

- - - 🙈 - - -
- -

Close modal button

- -
- -
- -
- -
- -

Tags & Labels

- -
- -
SUCCESS
- -
- -
WARNING
- -
- -
ERROR
- -
- - ACTIVE - -
- - INACTIVE - -
- -
- -
SUCCESS
- -
- -
WARNING
- -
- -
ERROR
- -
- - ACTIVE - -
- - INACTIVE - -
- -
-

Plates

- -
-
Plate-transparent
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
-
- -
- -
-
Plate-note
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
-
- -
- -
-
Plate-warningr
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
-
- -
- -
-
Plate-error
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
-
- -
- -

Actions

- -
- - - Action 1 - - - Action 3 - - - Action 4 - -
- - Copy - -
-
-
- -
- -

Seed Backup

- -
Seed previrew
- - -
Seed confirmation
- - - - -
- -

Tabs

- - - -
🙉
-
- -
🙈
-
- -
🙊
-
-
- -
- - -

Search

- -
- - - -
- -
- -

Notifications

- -
-
- -
-
- -
- -
- -
- -
-
-
From c7d1303daef52f43007cc367e74ba4b41c6164f5 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 25 Nov 2019 13:37:49 +0300 Subject: [PATCH 24/59] DEXW-2442: fix user dropdown --- src/modules/app/services/User.js | 8 +------ .../ui/directives/mainHeader/MainHeader.js | 3 ++- .../components/dexwLocked/dexwLocked.js | 24 ++++++++++++++++++- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/modules/app/services/User.js b/src/modules/app/services/User.js index b10b491343..8d0e3cd232 100644 --- a/src/modules/app/services/User.js +++ b/src/modules/app/services/User.js @@ -436,7 +436,7 @@ goToActiveState() { if (!this.initRouteState) { - $state.go(this.getActiveState('wallet')); + $state.go(this.getActiveState('welcome')); } } @@ -805,12 +805,6 @@ this._settings = defaultSettings.create(this.currentUser.settings, commonSettings); this._settings.change.on(() => this._onChangeSettings()); - const states = WavesApp.stateTree.find('main').getChildren(); - this._stateList = states.map((baseTree) => { - const id = baseTree.id; - return new UserRouteState('main', id, this._settings.get(`${id}.activeState`)); - }); - Object.keys(WavesApp.network).forEach((key) => { ds.config.set(key, this._settings.get(`network.${key}`)); }); diff --git a/src/modules/ui/directives/mainHeader/MainHeader.js b/src/modules/ui/directives/mainHeader/MainHeader.js index 95f568685c..af54dda046 100644 --- a/src/modules/ui/directives/mainHeader/MainHeader.js +++ b/src/modules/ui/directives/mainHeader/MainHeader.js @@ -189,7 +189,8 @@ * @public */ logout() { - user.logout('signIn'); + this.closeDropdown(); + user.logout('switch'); } /** diff --git a/src/modules/welcome/components/dexwLocked/dexwLocked.js b/src/modules/welcome/components/dexwLocked/dexwLocked.js index e01ae2d31d..3797229627 100644 --- a/src/modules/welcome/components/dexwLocked/dexwLocked.js +++ b/src/modules/welcome/components/dexwLocked/dexwLocked.js @@ -56,7 +56,29 @@ } onSign() { - this.moving(); + Promise.all([ + this.user.getMultiAccountUsers(), + this.user.getMultiAccountSettings() + ]) + .then(([multiAccountUsers, commonSettings]) => { + const [firstUser] = multiAccountUsers; + + this.user.setMultiAccountSettings(commonSettings); + + if (firstUser) { + return this.user.login(firstUser); + } else { + return Promise.resolve(); + } + + }) + .then(() => { + this.$scope.$apply(); + this.moving(); + }) + .catch(() => { + return null; + }); } moving() { From 72cf97c6c06b61b514dc2aba724a5eba049e138b Mon Sep 17 00:00:00 2001 From: Vusal Gakhramanov Date: Mon, 25 Nov 2019 14:46:06 +0300 Subject: [PATCH 25/59] DEXW-2442: web case --- locale/de/app.migrate.json | 2 +- locale/de/app.signIn.json | 3 + locale/en/app.migrate.json | 2 +- locale/en/app.signIn.json | 3 + locale/es/app.migrate.json | 2 +- locale/es/app.signIn.json | 3 + locale/et_EE/app.migrate.json | 2 +- locale/et_EE/app.signIn.json | 3 + locale/fr/app.migrate.json | 2 +- locale/fr/app.signIn.json | 3 + locale/hi_IN/app.migrate.json | 2 +- locale/hi_IN/app.signIn.json | 3 + locale/id/app.migrate.json | 2 +- locale/id/app.signIn.json | 3 + locale/it/app.migrate.json | 2 +- locale/it/app.signIn.json | 3 + locale/ja/app.migrate.json | 2 +- locale/ja/app.signIn.json | 3 + locale/ko/app.migrate.json | 2 +- locale/ko/app.signIn.json | 3 + locale/nl_NL/app.migrate.json | 18 +- locale/nl_NL/app.signIn.json | 3 + locale/pl/app.migrate.json | 2 +- locale/pl/app.signIn.json | 3 + locale/pt_BR/app.migrate.json | 2 +- locale/pt_BR/app.signIn.json | 3 + locale/pt_PT/app.migrate.json | 2 +- locale/pt_PT/app.signIn.json | 3 + locale/ru/app.signIn.json | 3 + locale/tr/app.migrate.json | 2 +- locale/tr/app.signIn.json | 3 + locale/zh_CN/app.migrate.json | 18 +- locale/zh_CN/app.signIn.json | 3 + src/img/icons/check-lang.svg | 3 + src/modules/app/less/app.less | 6 +- src/modules/app/less/classes.less | 4 + .../changeLanguage/changeLanguage.html | 4 +- .../changeLanguage/changeLanguage.less | 255 +++++++++++++----- src/modules/ui/directives/footer/footer.html | 13 +- src/modules/ui/directives/footer/footer.less | 93 +++---- .../less/largeHeader/largeHeader.less | 2 +- .../mainHeader/templates/largeHeader.html | 96 +------ .../mainHeader/templates/mobileHeader.html | 11 +- .../components/dexwLocked/dexwLocked.html | 31 ++- .../components/dexwLocked/dexwLocked.less | 39 ++- .../components/signInForm/signInForm.html | 4 +- src/modules/welcome/less/page-welcome.less | 4 + src/modules/welcome/templates/welcome.html | 5 +- src/themeConfig/black/icons.less | 3 +- src/themeConfig/default/icons.less | 3 +- 50 files changed, 411 insertions(+), 280 deletions(-) create mode 100644 src/img/icons/check-lang.svg diff --git a/locale/de/app.migrate.json b/locale/de/app.migrate.json index fb387be019..f46a7dbe4e 100644 --- a/locale/de/app.migrate.json +++ b/locale/de/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/de/app.signIn.json b/locale/de/app.signIn.json index 51968269ea..3489f8af37 100644 --- a/locale/de/app.signIn.json +++ b/locale/de/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Sign in", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Welcome Back!" }, "userList": { diff --git a/locale/en/app.migrate.json b/locale/en/app.migrate.json index fb387be019..f46a7dbe4e 100644 --- a/locale/en/app.migrate.json +++ b/locale/en/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/en/app.signIn.json b/locale/en/app.signIn.json index ae466e65e8..11c02fa6fe 100644 --- a/locale/en/app.signIn.json +++ b/locale/en/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Sign in", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Welcome Back!" }, "userList": { diff --git a/locale/es/app.migrate.json b/locale/es/app.migrate.json index c29361cb07..596faface0 100644 --- a/locale/es/app.migrate.json +++ b/locale/es/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/es/app.signIn.json b/locale/es/app.signIn.json index 1d4c55b4c3..96faefcc7e 100644 --- a/locale/es/app.signIn.json +++ b/locale/es/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Iniciar sesión", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "¡Bienvenido de nuevo!" }, "userList": { diff --git a/locale/et_EE/app.migrate.json b/locale/et_EE/app.migrate.json index fb387be019..f46a7dbe4e 100644 --- a/locale/et_EE/app.migrate.json +++ b/locale/et_EE/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/et_EE/app.signIn.json b/locale/et_EE/app.signIn.json index c166abf4e5..90f0eeb908 100644 --- a/locale/et_EE/app.signIn.json +++ b/locale/et_EE/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Sign in", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Welcome Back!" }, "userList": { diff --git a/locale/fr/app.migrate.json b/locale/fr/app.migrate.json index fb387be019..f46a7dbe4e 100644 --- a/locale/fr/app.migrate.json +++ b/locale/fr/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/fr/app.signIn.json b/locale/fr/app.signIn.json index 05937c602c..d040f6cd6d 100644 --- a/locale/fr/app.signIn.json +++ b/locale/fr/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Sign in", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Welcome Back!" }, "userList": { diff --git a/locale/hi_IN/app.migrate.json b/locale/hi_IN/app.migrate.json index fb387be019..f46a7dbe4e 100644 --- a/locale/hi_IN/app.migrate.json +++ b/locale/hi_IN/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/hi_IN/app.signIn.json b/locale/hi_IN/app.signIn.json index 1be1369154..3705900cb8 100644 --- a/locale/hi_IN/app.signIn.json +++ b/locale/hi_IN/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Sign in", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Welcome Back!" }, "userList": { diff --git a/locale/id/app.migrate.json b/locale/id/app.migrate.json index 96a263057b..a4ca2e215c 100644 --- a/locale/id/app.migrate.json +++ b/locale/id/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/id/app.signIn.json b/locale/id/app.signIn.json index 07677a4256..c5b32c5a98 100644 --- a/locale/id/app.signIn.json +++ b/locale/id/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Masuk", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Selamat datang kembali!" }, "userList": { diff --git a/locale/it/app.migrate.json b/locale/it/app.migrate.json index 778e7f2031..573c4696a9 100644 --- a/locale/it/app.migrate.json +++ b/locale/it/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/it/app.signIn.json b/locale/it/app.signIn.json index a6f1c4a0d4..0deee0436d 100644 --- a/locale/it/app.signIn.json +++ b/locale/it/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Accedi", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Ben tornato!" }, "userList": { diff --git a/locale/ja/app.migrate.json b/locale/ja/app.migrate.json index fb387be019..f46a7dbe4e 100644 --- a/locale/ja/app.migrate.json +++ b/locale/ja/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/ja/app.signIn.json b/locale/ja/app.signIn.json index a633d5d475..e288663656 100644 --- a/locale/ja/app.signIn.json +++ b/locale/ja/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Sign in", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Welcome Back!" }, "userList": { diff --git a/locale/ko/app.migrate.json b/locale/ko/app.migrate.json index fb387be019..f46a7dbe4e 100644 --- a/locale/ko/app.migrate.json +++ b/locale/ko/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/ko/app.signIn.json b/locale/ko/app.signIn.json index 62b5d1a2d0..a18012f52e 100644 --- a/locale/ko/app.signIn.json +++ b/locale/ko/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Sign in", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Welcome Back!" }, "userList": { diff --git a/locale/nl_NL/app.migrate.json b/locale/nl_NL/app.migrate.json index 2aac9edece..7dc601b549 100644 --- a/locale/nl_NL/app.migrate.json +++ b/locale/nl_NL/app.migrate.json @@ -7,15 +7,15 @@ "barInstall": "Installeren en uitvoeren", "barSuccess": "Gelukt", "cancelDownloading": "Download annuleren", - "congratulations": "Congratulations!", - "congratulationsText": "You have successfully downloaded the new application. To start using the application, simply do the following:", + "congratulations": "Gefeliciteerd!", + "congratulationsText": "U hebt de nieuwe applicatie met succes gedownload. Ga als volgt te werk om de toepassing te gebruiken:", "connectSupport": "Als dat niet heeft geholpen, neem dan contact op met de Waves.Exchange [support] (https://support.waves.exchange/).", "downloaded": "Ja", "downloadText": "{div.margin-bottom} [Om gebruikers een betere ervaring en een breder scala aan tools te bieden, verhuist de exchange van Waves DEX naar Waves.Exchange.] \n {div.margin-bottom} [Waves DEX stopt met werken op 2 december 2019. Om door te gaan met handelen moet u uw accounts verplaatsen naar de nieuwe exchange. We raden u ten zeerste aan dit van tevoren te doen.] \n {div.margin-bottom} [Het verplaatsen gaat snel, gemakkelijk en absoluut veilig.]", "fail": "Mislukt", "failText": "Zorg ervoor dat u de nieuwe Waves.Exchange-toepassing hebt geïnstalleerd en uitgevoerd.", "haveYouDownloaded": "Heb je de nieuwe desktop-applicatie Waves.Exchange al gedownload?", - "install": "Install the application", + "install": "Installeer de applicatie", "installAndRun": "Installeer en voer de applicatie uit. Heb je het gedaan?", "iUnderstand": "Ik begrijp het", "lookAtFAQ1": "Als je alles goed hebt gedaan en steeds het Fail-resultaat krijgt, kijk dan naar de", @@ -25,11 +25,11 @@ "oops": "Oeps! Er ging iets mis...", "pleaseWait": "Downloaden ...", "return": "Ga terug", - "run": "Run the installed application", - "seconds": "seconds", - "seconds1": "second", - "seconds234": "seconds", - "signInAndMove": "Sign in & Start moving", + "run": "Voer de geïnstalleerde applicatie uit", + "seconds": "seconden", + "seconds1": "seconde", + "seconds234": "seconden", + "signInAndMove": "Aanmelden & Verhuizen", "toFinish": "Om de migratie van uw accounts te voltooien, moet u naar de nieuwe applicatie gaan en het autorisatieproces voltooien.", "tryAgain": "Probeer opnieuw" }, @@ -40,7 +40,7 @@ }, "goHome": "Ga naar homepagina", "text1": "Waves DEX transformeert in een nieuw product, Waves.Exchange. Maak je geen zorgen! Al uw tokens, seed-zinnen en wachtwoorden zijn volkomen veilig.", - "text10": "{div.margin-bottom} [Als u de oude apps gebruikt, DIT KAN NIET MEER:] \n {div.line} [- Accounts maken] \n {div.line} [- Toegang hebben tot de Waves DEX-interface] \n {div.line} [- Bekijk uw portfolio] \n {div.line} [- Maak transacties van welke aard dan ook: overdracht, uitgifte of het burnen van tokens, WAVES leasen of leasing annuleren] \n {div.line} [- Gebruik alle gateways] \n\n {div.margin-bottom} [Vanaf 2 december 2019 kunt u van deze functionaliteit genieten met Waves.Exchange-apps.] \n\n {div.margin-bottom} [Met de oude apps kan dit NOG STEEDS:] \n\n {div.line} [- Meld u aan bij uw accounts] \n {div.line}{div.line} [- Start het migratieproces naar Waves.Exchange] \n {div.line} [- Maak een lokale back-up van uw seed-zinnen] \n\n {div.margin-top} [Als u nog vragen heeft, kunt u een bericht sturen naar onze [officiële Telegram-groep] (https://t.me/wavesexchange) of een ticket maken op de ondersteuningspagina: [https: / /support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom} [Als u de oude apps gebruikt, DIT KAN NIET MEER] \n {div.line} [- Accounts maken] \n {div.line} [- Toegang hebben tot de Waves DEX-interface] \n {div.line} [- Bekijk uw portfolio] \n {div.line} [- Maak transacties van welke aard dan ook: overdracht, uitgifte of het burnen van tokens, WAVES leasen of leasing annuleren] \n {div.line} [- Gebruik alle gateways] \n\n {div.margin-bottom} [Vanaf 2 december 2019 kunt u van deze functionaliteit genieten met Waves.Exchange-apps.] \n\n {div.margin-bottom} [Met de oude apps kan dit NOG STEEDS:] \n\n {div.line} [- Meld u aan bij uw accounts] \n {div.line} [- Start het migratieproces naar Waves.Exchange] \n {div.line} [- Maak een lokale back-up van uw seed-zinnen] \n\n {div.margin-top} [Als u nog vragen heeft, kunt u een bericht sturen naar onze [officiële Telegram-groep] (https://t.me/wavesexchange) of een ticket maken op de ondersteuningspagina: [https: / /support.waves.exchange/](https://support.waves.exchange/)]", "text11": "Nee nooit! Dit zal onder geen enkele omstandigheid gebeuren. Alle seed-zinnen worden nog steeds lokaal op uw apparaten opgeslagen. Het is onmogelijk voor de exchange om toegang te krijgen tot die opslag.", "text12": "Het eigendom van je tokens wordt vastgelegd op de Waves blockchain. Tokens die in uw accounts zijn opgeslagen, zijn alleen toegankelijk met seed zinnen of privésleutels die niet veranderen na de migratie en uw apparaten niet verlaten. Uw bezittingen zijn volkomen veilig!", "text13": "{div.margin-bottom} [We zullen ons best doen om ervoor te zorgen dat het migratieproces voor gebruikers zo soepel mogelijk {div.margin-bottom} . Vanwege wijzigingen in het adres en de persoonlijke sleutel van de matcher kunnen we uw bestellingen niet verplaatsen naar de nieuwe matcher. Daarom is uw volledige transactielgeschiedenis niet langer beschikbaar. Al uw voltooide transacties kunnen nog steeds worden bekeken met Waves Explorer. ] \n\n {div.margin-bottom} [Afgezien van uw transactiegeschiedenis worden al uw actieve orders op 2 december geannuleerd. Dit is een noodzakelijke maatregel die wordt veroorzaakt door de overstap naar een nieuwe matcher. In het geval van succesvolle migratie behoudt u nog steeds:] \n {div.line} [- Een set vastgezette items op uw dashboard] \n {div.line} [- Opgeslagen paren op de uitwisseling] \n {div.line} [- Een lijst met \"verborgen\" {div.line} ] \n {div.line} [- {div.line} ] \n {div.line} [- Accountinformatie ( {div.line} , accountnamen)] \n\n {div.margin-bottom.margin-top} [Houd er rekening mee dat technisch werk zal plaatsvinden op 2 december, waarop toegang tot oude apps wordt beperkt en nieuwe apps worden voorbereid voor lancering. ] \n\n {div.margin-bottom} [Tijdens dit werk verwerken gateways alle transacties (storten en opnemen) zoals normaal, wat volledige beveiliging en is toegang tot uw fondsen garandeerd.] \n\n {div.margin-top} [U blijft niet achter zonder ondersteuning! U kunt altijd een bericht sturen naar onze [officiële Telegram-groep] (https://t.me/wavesexchange) of een ticket maken op de ondersteuningspagina: [https://support.waves.exchange/ 8,5(https:// support.waves.exchange/)]", diff --git a/locale/nl_NL/app.signIn.json b/locale/nl_NL/app.signIn.json index 3558e4f98b..7c59330a20 100644 --- a/locale/nl_NL/app.signIn.json +++ b/locale/nl_NL/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overschrijf alle Waves.Exchange-accounts op dit apparaat" }, "signIn": "Aanmelden", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Welkom terug!" }, "userList": { diff --git a/locale/pl/app.migrate.json b/locale/pl/app.migrate.json index 3a16f4ae02..497d240e4c 100644 --- a/locale/pl/app.migrate.json +++ b/locale/pl/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/pl/app.signIn.json b/locale/pl/app.signIn.json index 3011cfe979..1c31075cbe 100644 --- a/locale/pl/app.signIn.json +++ b/locale/pl/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Zaloguj się", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Witamy z powrotem!" }, "userList": { diff --git a/locale/pt_BR/app.migrate.json b/locale/pt_BR/app.migrate.json index fb387be019..f46a7dbe4e 100644 --- a/locale/pt_BR/app.migrate.json +++ b/locale/pt_BR/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/pt_BR/app.signIn.json b/locale/pt_BR/app.signIn.json index 664040c8ec..63831dbeb5 100644 --- a/locale/pt_BR/app.signIn.json +++ b/locale/pt_BR/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Sign in", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Welcome Back!" }, "userList": { diff --git a/locale/pt_PT/app.migrate.json b/locale/pt_PT/app.migrate.json index fb387be019..f46a7dbe4e 100644 --- a/locale/pt_PT/app.migrate.json +++ b/locale/pt_PT/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/pt_PT/app.signIn.json b/locale/pt_PT/app.signIn.json index ae466e65e8..11c02fa6fe 100644 --- a/locale/pt_PT/app.signIn.json +++ b/locale/pt_PT/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Sign in", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Welcome Back!" }, "userList": { diff --git a/locale/ru/app.signIn.json b/locale/ru/app.signIn.json index 6adc7691b4..fe5c3d17ed 100644 --- a/locale/ru/app.signIn.json +++ b/locale/ru/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Перезаписать все Waves.Exchange аккаунты " }, "signIn": "Войти", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "С возвращением!" }, "userList": { diff --git a/locale/tr/app.migrate.json b/locale/tr/app.migrate.json index fb387be019..f46a7dbe4e 100644 --- a/locale/tr/app.migrate.json +++ b/locale/tr/app.migrate.json @@ -40,7 +40,7 @@ }, "goHome": "Go to HomePage", "text1": "Waves DEX is transforming into a new product, Waves.Exchange. Don’t worry! All of your tokens, seed phrases and passwords are completely safe.", - "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom}[If you are using the old apps, you will NO LONGER BE ABLE TO:]\n{div.line}[- Create accounts]\n{div.line}[- Have access to the Waves DEX interface]\n{div.line}[- View your portfolio]\n{div.line}[- Make transactions of any kind: transfer, issue or burn tokens, lease WAVES or cancel leasing]\n{div.line}[- Use any gateways]\n\n{div.margin-bottom}[As of December 2, 2019, you will be able to enjoy this functionality with Waves.Exchange apps.]\n\n{div.margin-bottom}[However, with the old apps, you will STILL BE ABLE TO:]\n\n{div.line}[- Log into your accounts]\n{div.line}[- Initiate the process of migration to Waves.Exchange]\n{div.line}[- Create a local backup of your seed phrases]\n\n{div.margin-top}[If you still have questions, you can send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", "text11": "No, never! This will not happen under any circumstances. All seed phrases will still be stored locally on your devices. It is impossible for the exchange to gain access to that storage.", "text12": "Ownership of your tokens is recorded on the Waves blockchain. Tokens stored in your accounts can only be accessed with seed phrases or private keys that will not change after the migration and will not leave your devices. Your assets are completely safe!", "text13": "{div.margin-bottom}[We’ll do our best to ensure the migration process is as smooth as possible for users. Because of changes to the matcher’s address and private key, we won’t be able to move your orders to the new matcher. Therefore, your entire order history will no longer be available. All your completed transactions can still be viewed using Waves Explorer. ]\n\n{div.margin-bottom}[Apart from your order history, all your active orders will be cancelled on December 2. This is a necessary measure caused by the switch to a new matcher. In the case of successful migration, you will still retain:]\n{div.line}[– A set of pinned assets on your dashboard]\n{div.line}[– Saved pairs on the exchange]\n{div.line}[– A list of “hidden” assets]\n{div.line}[– Language preferences]\n{div.line}[– Account information (seed phrases, account names)]\n\n{div.margin-bottom.margin-top}[Please keep in mind that technical work will take place on December 2, upon which access to old apps will be restricted and new apps will be prepared for launch. ]\n\n{div.margin-bottom}[During this work, gateways will process all transactions (deposit and withdrawal) as normal, which will ensure full security and access to your funds.]\n\n{div.margin-top}[You won’t be left without support! You can always send a message to our [official Telegram group](https://t.me/wavesexchange) or create a ticket on the support page: [https://support.waves.exchange/](https://support.waves.exchange/)]", diff --git a/locale/tr/app.signIn.json b/locale/tr/app.signIn.json index 051b7e8d80..e40350842d 100644 --- a/locale/tr/app.signIn.json +++ b/locale/tr/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" }, "signIn": "Sign in", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "Welcome Back!" }, "userList": { diff --git a/locale/zh_CN/app.migrate.json b/locale/zh_CN/app.migrate.json index 1ed878e454..e0760e4cca 100644 --- a/locale/zh_CN/app.migrate.json +++ b/locale/zh_CN/app.migrate.json @@ -7,15 +7,15 @@ "barInstall": "安装并运行", "barSuccess": "成功", "cancelDownloading": "取消下载", - "congratulations": "Congratulations!", - "congratulationsText": "You have successfully downloaded the new application. To start using the application, simply do the following:", + "congratulations": "恭喜你!", + "congratulationsText": "您已经成功下载了新应用程序。要开始使用该应用程序,只需执行以下操作:", "connectSupport": "如果这样做没有帮助,请联系Waves.Exchange [support](https://support.waves.exchange/)。", "downloaded": "是", "downloadText": "{div} [为了向用户提供更好的体验和更广泛的工具,该交易所正从Waves DEX转向Waves.Exchange。] \n {div.margin-top} [Waves DEX将于2019年12月2日停止运行。要继续交易,您必须下载新的桌面应用程序。]", "fail": "失败", "failText": "请确保您已经安装并运行新的Waves.Exchange应用程序。", "haveYouDownloaded": "您是否已经下载了新的Waves.Exchange桌面应用程序?", - "install": "Install the application", + "install": "安装应用程序", "installAndRun": "安装并运行该应用程序。你做完了吗?", "iUnderstand": "我明白", "lookAtFAQ1": "如果您正确执行了所有操作并继续获得失败结果,请查看", @@ -25,11 +25,11 @@ "oops": "糟糕!出问题了...", "pleaseWait": "正在下载...", "return": "返回", - "run": "Run the installed application", - "seconds": "seconds", - "seconds1": "second", - "seconds234": "seconds", - "signInAndMove": "Sign in & Start moving", + "run": "运行已安装的应用程序", + "seconds": "秒", + "seconds1": "第二", + "seconds234": "秒", + "signInAndMove": "登录并开始移动", "toFinish": "要完成帐户的迁移,您必须转到新应用程序并完成授权过程。", "tryAgain": "再试一次" }, @@ -40,7 +40,7 @@ }, "goHome": "去首页", "text1": "Waves DEX正在转变为新产品Waves.Exchange。不用担心您所有的令牌,种子短语和密码都是完全安全的。", - "text10": "{div.margin-bottom} [如果您使用的是旧版应用,则将无法再进行以下操作:] \n {div.line} [-创建帐户] \n {div.line} [-可以访问Waves DEX界面] \n {div.line} [-查看您的投资组合] \n {div.line} [-进行任何类型的交易:转让,发行或刻录令牌,租赁WAVES或取消租赁] \n {div.line} [-使用任何网关] \n\n {div.margin-bottom} [自2019年12月2日起,您将可以使用Waves.Exchange应用程序享受此功能。] \n\n {div.margin-bottom} [但是,使用旧版应用程序,您仍然可以:] \n\n {div.line} [-登录您的帐户] \n {div.line}{div.line} [-启动向Waves.Exchange的迁移过程] \n {div.line} [-为种子词组创建本地备份] \n\n {div.margin-top} [如果仍有疑问,您可以将消息发送到我们的[官方电报组](https://t.me/wavesexchange)或在支持页面上创建{div.margin-top} :[https:/ /support.waves.exchange/](https://support.waves.exchange/)]", + "text10": "{div.margin-bottom} [如果您使用的是旧版应用,则将无法再进行以下操作:] \n {div.line} [-创建帐户] \n {div.line} [-可以访问Waves DEX界面] \n {div.line} [-查看您的投资组合] \n {div.line} [-进行任何类型的交易:转让,发行或刻录令牌,租赁WAVES或取消租赁] \n {div.line} [-使用任何网关] \n\n {div.margin-bottom} [自2019年12月2日起,您将可以使用Waves.Exchange应用程序享受此功能。] \n\n {div.margin-bottom} [但是,使用旧版应用程序,您仍然可以:] \n\n {div.line} [-登录您的帐户] \n {div.line}[-启动向Waves.Exchange的迁移过程] \n {div.line} [-为种子词组创建本地备份] \n\n {div.margin-top} [如果仍有疑问,您可以将消息发送到我们的[官方电报组](https://t.me/wavesexchange)或在支持页面上创建{div.margin-top} :[https:/ /support.waves.exchange/](https://support.waves.exchange/)]", "text11": "没有,永不!在任何情况下都不会发生这种情况。所有种子短语仍将存储在本地设备上。交易所不可能访问该存储。", "text12": "您的代币的所有权记录在Waves区块链上。只能使用种子短语或私钥访问存储在您帐户中的令牌,这些种子短语或私钥在迁移后不会更改并且不会离开您的设备。您的资产是完全安全的!", "text13": "{div.margin-bottom} [我们将尽最大努力确保迁移过程对用户来说尽可能顺利。由于匹配者地址和私钥的更改,我们将无法将您的订单移至新匹配者。因此,您的整个订单历史记录将不再可用。您仍然可以使用Waves Explorer查看所有已完成的交易。 ] \n\n {div.margin-bottom} [除了您的订单历史记录之外,所有有效订单都会在12月2日被取消。这是由于切换到新匹配器而引起的必要措施。在成功迁移的情况下,您仍将保留:] \n {div.line} [–仪表板上的一组固定资产] \n {div.line} [–在交易所保存的对] \n {div.line} [–“隐藏”资产列表] \n {div.line} [–语言首选项] \n {div.line} [–帐户信息(种子短语,帐户名)] \n\n {div.margin-bottom.margin-top} [请注意,技术工作将于12月2日进行,届时将限制对旧应用程序的访问,并准备启动新应用程序。 ] \n\n {div.margin-bottom} [在此过程中,网关将正常处理所有交易(存款和取款),这将确保完全的安全性和对您资金的访问。] \n\n {div.margin-top} [您将不会失去支持!您可以随时向我们的[官方电报组](https://t.me/wavesexchange)发送消息,也可以在支持页面上创建故障单:[https://support.waves.exchange/](https:// support.waves.exchange/)]", diff --git a/locale/zh_CN/app.signIn.json b/locale/zh_CN/app.signIn.json index d2ef130cef..fd3b958240 100644 --- a/locale/zh_CN/app.signIn.json +++ b/locale/zh_CN/app.signIn.json @@ -27,6 +27,9 @@ "overwriteDescription": "覆盖此设备上的所有Waves.Exchange帐户" }, "signIn": "登录", + "startMoving": { + "button": "Sign in & Start moving" + }, "welcomeBack": "欢迎回来" }, "userList": { diff --git a/src/img/icons/check-lang.svg b/src/img/icons/check-lang.svg new file mode 100644 index 0000000000..c0a466597f --- /dev/null +++ b/src/img/icons/check-lang.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/modules/app/less/app.less b/src/modules/app/less/app.less index 2dd4e8cb55..aca495c2e3 100644 --- a/src/modules/app/less/app.less +++ b/src/modules/app/less/app.less @@ -80,7 +80,7 @@ body.ledger, body.desktop, body.fromBackup { .main-container { - min-height: calc(100vh ~'- 60px'); + height: calc(100vh ~'- 60px'); flex-shrink: 0; } } @@ -145,10 +145,6 @@ body.portfolio { .ui-view { display: block; height: 100%; - - &_main { - overflow: auto; - } } .logo { diff --git a/src/modules/app/less/classes.less b/src/modules/app/less/classes.less index dce655bbfc..0a2b3947ad 100644 --- a/src/modules/app/less/classes.less +++ b/src/modules/app/less/classes.less @@ -143,4 +143,8 @@ .width-100 { width: 100%; +} + +.height-100 { + height: 100%; } \ No newline at end of file diff --git a/src/modules/ui/directives/changeLanguage/changeLanguage.html b/src/modules/ui/directives/changeLanguage/changeLanguage.html index 50d60f1ba7..cbc507dbcd 100644 --- a/src/modules/ui/directives/changeLanguage/changeLanguage.html +++ b/src/modules/ui/directives/changeLanguage/changeLanguage.html @@ -1,5 +1,5 @@ - - + +
{{ ::lng.name }}
diff --git a/src/modules/ui/directives/changeLanguage/changeLanguage.less b/src/modules/ui/directives/changeLanguage/changeLanguage.less index b401c94774..f543b607d5 100644 --- a/src/modules/ui/directives/changeLanguage/changeLanguage.less +++ b/src/modules/ui/directives/changeLanguage/changeLanguage.less @@ -1,77 +1,186 @@ @import (reference) 'config'; +@import (reference) 'icons'; .web-footer-language { - .select { - width: 200px; - position: relative; - -moz-appearance: none; - -webkit-appearance: none; - font-size: 15px; - padding: 0; - right: 0; - top: 0; - - .select__wrap { - background: @footer-background; - line-height: 40px; - height: 40px; - color: @color-white; - - &.expanded .select__title { - border: 1px solid @changeLang-border-footer; - border-top: 0 none; - border-radius: 0; - - &::after { - transition: .5s; - transform: translateY(-50%) rotate(180deg); - } - } - - } - - .select__title { - border: 1px solid @changeLang-border-footer; - border-radius: 2px; - background: none transparent; - padding: 0 15px; - color: @white-only; - } - - &__list { - background: @footer-background; - border-radius: 4px 4px 0 0; - flex-direction: column-reverse; - border: 1px solid @changeLang-border-footer; - border-bottom: 0 none; - box-shadow: none; - border-top: 1px solid @color-basic-200; - transform: translateY(-100%); - margin-top: -39px; - - w-option.active { - display: none; - } - - .option { - transition: .3s; - padding: 0 15px; - color: @white-only; - - &:hover { - background: @footer-select-bg-hover; - } - } - } - - .lng-item { - display: flex; - align-items: center; - font-size: @font-size-control; - - &::before { - margin-right: 10px; - } - } - } + .select { + width: 200px; + position: relative; + -moz-appearance: none; + -webkit-appearance: none; + font-size: 15px; + padding: 0; + right: 0; + top: 0; + + .select__wrap { + background: @footer-background; + line-height: 40px; + height: 40px; + color: @color-white; + + &.expanded .select__title { + border: 1px solid @changeLang-border-footer; + border-top: 0 none; + border-radius: 0; + + &::after { + transition: .5s; + transform: translateY(-50%) rotate(180deg); + } + } + + } + + .select__title { + border: 1px solid @changeLang-border-footer; + border-radius: 2px; + background: none transparent; + padding: 0 15px; + color: @white-only; + } + + &__list { + background: @footer-background; + border-radius: 4px 4px 0 0; + flex-direction: column-reverse; + border: 1px solid @changeLang-border-footer; + border-bottom: 0 none; + box-shadow: none; + border-top: 1px solid @color-basic-200; + transform: translateY(-100%); + margin-top: -39px; + + w-option.active { + display: none; + } + + .option { + transition: .3s; + padding: 0 15px; + color: @white-only; + + &:hover { + background: @footer-select-bg-hover; + } + } + } + + .lng-item { + display: flex; + align-items: center; + font-size: @font-size-control; + + &::before { + margin-right: 10px; + } + } + } +} + +.change-language.change-language_header { + .select { + &__wrap { + &.expanded { + .select__title { + border: none; + + &::after { + background: @select-arrow-active-icon; + background-size: 100% 100%; + } + + @media screen and (max-width: 860px) { + background: @color-basic-50; + border-radius: 50%; + } + } + } + } + &__title { + border: none; + padding: 0 15px; + + @media screen and (max-width: 860px) { + padding: 0; + + .lng-content { + display: none; + } + } + + &::after { + right: 0; + background: @select-arrow-icon; + background-size: 100% 100%; + + @media screen and (max-width: 860px) { + display: none; + } + } + } + + &_change-lang { + width: auto; + min-width: 110px; + + @media screen and (max-width: 860px) { + width: 30px; + min-width: 30px; + height: 30px; + border-radius: 50%; + + .select__title-content { + .lng-item { + display: flex; + justify-content: center; + align-items: center; + + &::before { + margin-right: 0; + } + } + } + } + } + + &__list { + border: none; + border-radius: @border-radius; + width: 150px; + right: 0; + top: 40px; + padding: 10px; + + w-option { + .option { + padding: 10px; + border-radius: @border-radius; + } + + &.active { + background: @color-white; + + .option::after { + content: ''; + display: block; + width: 14px; + height: 14px; + background: @check-lang; + position: absolute; + top: 50%; + right: 10px; + transform: translateY(-50%); + } + } + } + } + } } + +@media screen and (max-width: 860px) { + .change-language.change-language_header { + .select { + + } + } +} \ No newline at end of file diff --git a/src/modules/ui/directives/footer/footer.html b/src/modules/ui/directives/footer/footer.html index 03f09badaf..3f7811b623 100644 --- a/src/modules/ui/directives/footer/footer.html +++ b/src/modules/ui/directives/footer/footer.html @@ -8,7 +8,12 @@ FAQ -