diff --git a/data-service/classes/DataManager.ts b/data-service/classes/DataManager.ts index 6a753ee9e0..38b2dcd9c7 100644 --- a/data-service/classes/DataManager.ts +++ b/data-service/classes/DataManager.ts @@ -1,15 +1,9 @@ -import { Money } from '@waves/data-entities'; import { path } from 'ramda'; import { IPollAPI, Poll } from '../utils/Poll'; -import { balanceList } from '../api/assets/assets'; -import { getReservedBalance } from '../api/matcher/getOrders'; -import { IBalanceItem } from '../api/assets/interface'; -import { IHash } from '../interface'; import { UTXManager } from './UTXManager'; import { getAliasesByAddress } from '../api/aliases/aliases'; import { PollControl } from './PollControl'; -import { change, get } from '../config'; -import { getOracleData, IOracleData } from '../api/data'; +import { change } from '../config'; import { DATA_PROVIDER_VERSIONS, STATUS_LIST, TProviderAsset } from '@waves/oracle-data'; @@ -50,15 +44,7 @@ export class DataManager { this.pollControl.destroy(); this.transactions.dropAddress(); } - - public getBalances(): Promise> { - return this.pollControl.getPollHash().balance.getDataPromise(); - } - - public getReservedInOrders(): Promise> { - return this.pollControl.getPollHash().orders.getDataPromise(); - } - + public getAliasesPromise(): Promise> { return this.pollControl.getPollHash().aliases.getDataPromise(); } @@ -139,22 +125,6 @@ export class DataManager { return this.pollControl.getPollHash()[oracleName].lastData; } - private _getPollBalanceApi(): IPollAPI> { - const get = () => { - const hash = this.pollControl.getPollHash(); - const inOrdersHash = hash && hash.orders.lastData || Object.create(null); - return balanceList(this._address, Object.create(null), inOrdersHash); - }; - return { get, set: () => null }; - } - - private _getPollOrdersApi(): IPollAPI> { - return { - get: () => getReservedBalance(), - set: () => null - }; - } - private _getPollAliasesApi(): IPollAPI> { return { get: () => getAliasesByAddress(this._address), @@ -162,41 +132,13 @@ export class DataManager { }; } - private _getPollOracleApi(address: string): IPollAPI { - return { - get: () => { - return address ? getOracleData(address) : Promise.resolve({ assets: Object.create(null) }) as any; - }, - set: () => null - }; - } - private _createPolls(): TPollHash { - const balance = new Poll(this._getPollBalanceApi(), 1000); - const orders = new Poll(this._getPollOrdersApi(), 1000); const aliases = new Poll(this._getPollAliasesApi(), 10000); - const oracleWaves = new Poll(this._getPollOracleApi(get('oracleWaves')), 30000); - const oracleTokenomica = new Poll(this._getPollOracleApi(get('oracleTokenomica')), 30000); - - return { balance, orders, aliases, oracleWaves, oracleTokenomica }; + return { aliases }; } } type TPollHash = { - balance: Poll>; - orders: Poll>; aliases: Poll>; - oracleWaves: Poll - oracleTokenomica: Poll -} - -export interface IOracleAsset { - id: string; - status: number; // TODO! Add enum - logo: string; - site: string; - ticker: string; - email: string; - description?: Record; } diff --git a/locale/de/app.migrate.json b/locale/de/app.migrate.json index b46c1fff89..f793c17a5a 100644 --- a/locale/de/app.migrate.json +++ b/locale/de/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", "backToPrevious": "Back to previous", @@ -36,6 +42,18 @@ "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", "tryAgain": "Try again" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/en/app.migrate.json b/locale/en/app.migrate.json index b46c1fff89..f793c17a5a 100644 --- a/locale/en/app.migrate.json +++ b/locale/en/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", "backToPrevious": "Back to previous", @@ -36,6 +42,18 @@ "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", "tryAgain": "Try again" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/es/app.migrate.json b/locale/es/app.migrate.json index cfc2cfdb61..bf5684a6d1 100644 --- a/locale/es/app.migrate.json +++ b/locale/es/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", "backToPrevious": "Back to previous", @@ -36,6 +42,18 @@ "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", "tryAgain": "Try again" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/et_EE/app.migrate.json b/locale/et_EE/app.migrate.json index b46c1fff89..f793c17a5a 100644 --- a/locale/et_EE/app.migrate.json +++ b/locale/et_EE/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", "backToPrevious": "Back to previous", @@ -36,6 +42,18 @@ "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", "tryAgain": "Try again" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/fr/app.create.json b/locale/fr/app.create.json index 5e88c0dbb2..d015bb5c2d 100644 --- a/locale/fr/app.create.json +++ b/locale/fr/app.create.json @@ -28,7 +28,7 @@ "avatarUnique": "Cet avatar est unique. Vous ne pourrez pas le changer plus tard.", "choose": "Choisissez l'avatar de votre adresse", "create": "Créer un nouveau compte", - "createAccount": "Create a new account", + "createAccount": "Créer un nouveau compte", "createDescription": "Rapide et gratuit", "createNewAccount": "Choisissez votre avatar", "description": { @@ -45,7 +45,7 @@ "withBlockchain": "Get Started with Blockchain" }, "import": "Importer des comptes", - "importDescription": "via une Phrase Secrète (SEED), Ledger ou Keeper", + "importDescription": "via Seed ou clé privée, Ledger, fichier Keystore", "protect": "Protéger votre compte avec un mot de passe ou", "protectYourAccount": "Protéger votre compte", "restore": "Restaurez un compte", diff --git a/locale/fr/app.json b/locale/fr/app.json index c2584e7812..706b0e4662 100644 --- a/locale/fr/app.json +++ b/locale/fr/app.json @@ -3,7 +3,7 @@ "button": { "cancel": "Annuler", "continue": "Continuer", - "signIn": "Sign in" + "signIn": "Identifiez-vous" }, "confirmTransaction": { "notPermitted": { diff --git a/locale/fr/app.migrate.json b/locale/fr/app.migrate.json index b46c1fff89..eb2ca903be 100644 --- a/locale/fr/app.migrate.json +++ b/locale/fr/app.migrate.json @@ -1,47 +1,65 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", - "backToPrevious": "Back to previous", - "barDone": "Done", + "backToPrevious": "Retour à la page précédente", + "barDone": "Terminé", "barDownload": "Download", "barInstall": "Install and run", "barSuccess": "Success", "cancelDownloading": "Cancel download", - "congratulations": "Congratulations!", - "congratulationsText": "You have successfully downloaded the new application. To start using the application, simply do the following:", + "congratulations": "Félicitations !", + "congratulationsText": "Vous avez téléchargé avec succès la nouvelle application. Pour commencer à utiliser l'application, procédez comme suit :", "connectSupport": "If that did not help, then contact the Waves.Exchange [support](https://support.waves.exchange/).", - "download": "Download", + "download": "Télécharger", "downloaded": "yes", "downloadText": "{div}[To offer users a better experience and wider range of tools, the exchange is moving from Waves DEX to Waves.Exchange.]\n{div.margin-top}[Waves DEX will stop operating on December 2, 2019. To continue trading you have to download the new desktop application.]", "fail": "Fail", "failText": "Please make sure that you have installed and run the new Waves.Exchange application.", "haveYouDownloaded": "Have you already downloaded the new Waves.Exchange desktop application?", - "install": "Install the application", - "installAndRun": "Install and run the application. Have you done it?", + "install": "Installer l'application", + "installAndRun": "Installez et exécutez l'application. L'avez-vous fait?", "iUnderstand": "I understand", "lookAtFAQ1": "If you did everything properly and keep getting the Fail result, then take a look at the", "lookAtFAQ2": "You might find the answer there.", "movingText": "{div.margin-bottom}[To offer users a better experience and wider range of tools, the exchange is moving from Waves DEX to Waves.Exchange.]\n{div.margin-bottom}[Waves DEX will stop operating on December 2, 2019. To continue trading you have to move your accounts to the new exchange. We strongly recommend that you do this in advance.]\n{div.margin-bottom}[The moving is fast, easy, and absolutely secure.]", - "oldApplication": "Your current application is too old. If you want to trade just right now (before December 2, 2019), you can download our latest Waves DEX desktop application from the [official website](https://dex.wavesplatform.com).", + "oldApplication": "Votre application actuelle est trop ancienne. Si vous souhaitez trader dès maintenant (avant le 2 décembre 2019), vous pouvez télécharger notre dernière application de bureau Waves DEX à partir du [site web officiel] (https://dex.wavesplatform.com).", "oops": "Oops! Something went wrong...", - "password": "Password", - "passwordError": "Wrong Password!", + "password": "Mot de passe", + "passwordError": "Mot de passe erroné !", "pleaseWait": "Downloading...", - "return": "return", - "run": "Run the installed application", - "seconds": "seconds", - "seconds1": "second", - "seconds234": "seconds", - "signInAndMove": "Sign in & Start moving", + "return": "Retour", + "run": "Lancer l'application installée", + "seconds": "secondes", + "seconds1": "seconde", + "seconds234": "secondes", + "signInAndMove": "Connectez-vous et commencez le transfert", "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", - "tryAgain": "Try again" + "tryAgain": "Réessayez" + }, + "dexLocked": { + "multiAccount": { + "desc": "Pour commencer la migration, veuillez vous connecter." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", - "title": "ATTENTION!!! " + "title": "ATTENTION !!!" }, - "goHome": "Go to HomePage", + "goHome": "Aller à la page d'accueil", "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}[- 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.", @@ -58,7 +76,7 @@ "text21": "The launch of the USDT (ERC-20) gateway will have no impact on the operation of wUSD and wEUR. Users will be able to continue trading them as they wish.", "text22": "The new addresses belong to the Waves gateway (not Coinomat). We will constantly be improving these gateways, making transfers faster and more convenient for users.", "text23": "We understand that the migration process may bring some inconvenience for users, so we have prepared a nice surprise! All users who have successfully moved their accounts to the new exchange will receive a glittering avatar, displayed in the app. To receive this, you will need to complete the migration of your accounts from Waves DEX to Waves.Exchange by December 2, and have at least one outgoing transaction of any type in each account to qualify.", - "text24": "We plan to add support for all languages previously available on Waves DEX soon.", + "text24": "Nous prévoyons d'ajouter prochainement la prise en charge de toutes les langues précédemment disponibles sur Waves DEX.", "text3": "Waves.Exchange is developed and run by part of the Waves DEX team, in collaboration with new developers from the Waves community.", "text4": "The migration signifies a new phase in the development of the exchange, the main priority of which will now be user experience. In addition to focusing on the community’s requests, the new team will concentrate on building new trading tools and comprehensive promotion of the product, which was difficult under the previous arrangement.", "text5": "Migration has already begun. As of November 18, 2019, you can move your accounts to the new service. To do that, you’ll need to update Waves DEX’s web version and/or run a desktop app, log into your account and follow the instructions.", @@ -67,7 +85,7 @@ "text8": "We want to give Waves DEX users enough time to prepare for using the new exchange, so that their access to the service is uninterrupted. We hope that the two-week period will be sufficient for the majority of users to complete the migration process.", "text9": "Yes, migration of accounts will also be possible after the launch of Waves.Exchange. However, as of December 2, 2019, some restrictions will apply to Waves DEX’s old apps.", "title1": "What’s going on?", - "title10": "What restrictions will apply to Waves DEX apps as of December 2, 2019?", + "title10": "Quelles restrictions s'appliqueront aux applications Waves DEX à compter du 2 décembre 2019 ?", "title11": "Will the new exchange have access to my seed phrases?", "title12": "What will happen to my tokens?", "title13": "What problems might users face due to the migration?", @@ -75,14 +93,14 @@ "title15": "How can I update my mobile app?", "title16": "Do you plan on introducing KYC procedures? ", "title17": "What changes will the matcher undergo?", - "title18": "What if I have any problems or questions during the migration process?", + "title18": "Que faire si j'ai des problèmes ou des questions pendant le processus de migration ?", "title19": "What will happen to gateway tokens?", "title2": "What is Waves.Exchange?", "title20": "Will leasing still be available after migration? Will leases be cancelled during the migration process?", "title21": "Will Tether USD (USDT) replace wUSD and wEUR?", "title22": "Why have the gateway addresses for receiving BTC and ETH been changed?", "title23": "Why so complicated?", - "title24": "Are there plans to expand language support for the interface of the new exchange?", + "title24": "Est-il prévu d'étendre la prise en charge linguistique de l'interface du nouvel échange ?", "title3": "Who is in charge of developing the new exchange?", "title4": "Why is Waves DEX moving to Waves.Exchange?", "title5": "When will migration begin?", @@ -92,12 +110,12 @@ "title9": "Will it be possible to move accounts after the launch of Waves.Exchange?" }, "migrate": { - "achievementDesc": "You’ve successfully migrated your accounts. To thank you for completing the process, we’re rewarding all your accounts (with at least one outgoing transaction made before December 2, 2019) with glittering avatars!", + "achievementDesc": "Vous avez migré vos comptes avec succès. Pour vous remercier d'avoir terminé le processus, nous récompensons tous vos comptes (avec au moins une transaction sortante effectuée avant le 2 décembre 2019) avec des avatars scintillants !", "achievementTitle": "Congratulations!", "btn": { "unlock": "Unlock" }, - "continue": "Continue", + "continue": "Continuer", "desc": { "almostFinish": "To finish the migration of your accounts, accept the new Terms and Conditions and Privacy Policy.", "enterPassword": "Enter your Waves.Exchange password to continue the migration.", @@ -113,7 +131,7 @@ "headers": { "unlock": "Unlock your accounts", "unlockAccount": "Unlock account", - "unlockAccountExchange": "Unlock your account", + "unlockAccountExchange": "Déverrouiller votre compte", "unlockExchange": "Unlock your accounts" }, "modalButton": { @@ -128,7 +146,7 @@ }, "modalTitle": { "moving": "We're moving!", - "plate": "Don’t worry! All of your tokens, seed phrases and passwords are safe.", + "plate": "Pas d'inquiétude ! Tous vos jetons, phrases secrètes et mots de passe sont en sécurité.", "redirected": "You have been redirected to" }, "signIn": "Sign in", @@ -137,7 +155,7 @@ "pending": "Pending unlock", "pendingExchange": "To unlock, select an account from the list", "pendingUnlockingExchange": "Pending unlocking", - "unlocked": "Unlocked" + "unlocked": "Déverrouillé" }, "title": { "almostThere": "Almost there...", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/fr/app.signIn.json b/locale/fr/app.signIn.json index 05937c602c..a289173d00 100644 --- a/locale/fr/app.signIn.json +++ b/locale/fr/app.signIn.json @@ -8,7 +8,7 @@ "signIn": { "btn": { "cancel": "Cancel", - "overwrite": "Overwrite", + "overwrite": "Écraser", "restore": "Reset all" }, "enterPass": "Please enter your password to continue", @@ -23,8 +23,8 @@ }, "password": { "forgot": "Forgot your password?", - "overwrite": "Overwrite accounts", - "overwriteDescription": "Overwrite all Waves.Exchange accounts on this device" + "overwrite": "Écraser les comptes", + "overwriteDescription": "Ecraser tous les comptes Waves.Exchange sur cet appareil" }, "signIn": "Sign in", "welcomeBack": "Welcome Back!" diff --git a/locale/fr/app.utils.json b/locale/fr/app.utils.json index f867ebcc5d..3a845fb1e9 100644 --- a/locale/fr/app.utils.json +++ b/locale/fr/app.utils.json @@ -920,9 +920,9 @@ } }, "unsuccessfulMigration": { - "checkbox": "Don't show this again", + "checkbox": "Ne plus afficher ce message", "description": "You have started the account migration from Waves DEX to this exchange, but it hasn't been finished. Your accounts haven't been moved. Go back to Waves DEX and start the process from the beginning.", - "title": "Unfinished Migration", + "title": "Migration inachevée", "understand": "Je comprends" } }, @@ -948,10 +948,10 @@ "utils": { "migrationError": "Oops! Your accounts are safe but haven't been moved. Please try again.", "privacyPolicy": "I have read and agree with the [Privacy Policy](https://wavesplatform.com/files/docs/Privacy_Policy_SW.pdf).", - "privacyPolicyText": "Privacy Policy", + "privacyPolicyText": "Politique de confidentialité", "termsAgreement": "I have read and agree with the [Terms and Conditions](https://wavesplatform.com/files/docs/Waves_terms_and_conditions.pdf).", - "termsAgreementText": "Terms and Conditions", - "termsAssign": "I have read and agree with the", + "termsAgreementText": "Conditions générales", + "termsAssign": "J'ai lu et j'accepte les", "whatsNew": { "body": { "1_0_0": "{span.line}[1. Le client Waves est sorti de la version bêta.]{span.line}[2. Vous pouvez maintenant épingler et désépingler n'importe quels actifs sur la page principale.]{span.line}[3. Mode nuit ajouté.]{span.line}[4. Vous pouvez maintenant importer facilement tous vos comptes depuis votre ancien client.]{span.line}[5. Correction de bugs mineurs.]", @@ -1022,10 +1022,10 @@ "day": "d", "dexMoves": "We are moving soon! Stay with us at [Waves.Exchange](https://waves.exchange)", "hour": "h", - "info": "We're moving from Waves DEX to Waves.Exchange. Do you want to move your accounts again?", + "info": "Nous passons de Waves DEX à Waves.Exchange. Voulez-vous à nouveau déplacer vos comptes ?", "min": "m", "notification": "We're moving from Waves DEX to Waves.Exchange. Don't forget to move your accounts!", "sec": "s", - "startMoving": "Safe moving" + "startMoving": "Un déménagement en toute sécurité" } } \ No newline at end of file diff --git a/locale/fr/app.welcome.json b/locale/fr/app.welcome.json index 7fdcdad7b2..dae576887a 100644 --- a/locale/fr/app.welcome.json +++ b/locale/fr/app.welcome.json @@ -245,4 +245,4 @@ "windows": "Windows", "windowsDescription": "Télécharger l'application Windows" } -} \ No newline at end of file +} diff --git a/locale/hi_IN/app.migrate.json b/locale/hi_IN/app.migrate.json index b46c1fff89..f793c17a5a 100644 --- a/locale/hi_IN/app.migrate.json +++ b/locale/hi_IN/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", "backToPrevious": "Back to previous", @@ -36,6 +42,18 @@ "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", "tryAgain": "Try again" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/id/app.migrate.json b/locale/id/app.migrate.json index dad6c61172..7404f8b191 100644 --- a/locale/id/app.migrate.json +++ b/locale/id/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", "backToPrevious": "Back to previous", @@ -36,6 +42,18 @@ "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", "tryAgain": "Try again" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/it/app.migrate.json b/locale/it/app.migrate.json index ecc9163230..972719f405 100644 --- a/locale/it/app.migrate.json +++ b/locale/it/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", "backToPrevious": "Back to previous", @@ -36,6 +42,18 @@ "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", "tryAgain": "Try again" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/ja/app.migrate.json b/locale/ja/app.migrate.json index b46c1fff89..f793c17a5a 100644 --- a/locale/ja/app.migrate.json +++ b/locale/ja/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", "backToPrevious": "Back to previous", @@ -36,6 +42,18 @@ "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", "tryAgain": "Try again" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/ko/app.migrate.json b/locale/ko/app.migrate.json index b46c1fff89..f793c17a5a 100644 --- a/locale/ko/app.migrate.json +++ b/locale/ko/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", "backToPrevious": "Back to previous", @@ -36,6 +42,18 @@ "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", "tryAgain": "Try again" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/nl_NL/app.migrate.json b/locale/nl_NL/app.migrate.json index b0b9b80bf6..a9bbdaaaf2 100644 --- a/locale/nl_NL/app.migrate.json +++ b/locale/nl_NL/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "Om gebruikers een betere ervaring en een breder scala aan tools te bieden, is de uitwisseling verplaatst van Waves DEX naar Waves.Exchange.", + "secondDesc": "Als u de exchange wilt blijven gebruiken, moet u de nieuwe desktoptoepassing downloaden." + } + }, "desktopUpdate": { "almostThere": "Bijna daar ...", "backToPrevious": "Terug naar vorige", @@ -36,6 +42,18 @@ "toFinish": "Om de migratie van uw accounts te voltooien, moet u naar de nieuwe applicatie gaan en het autorisatieproces voltooien.", "tryAgain": "Probeer opnieuw" }, + "dexLocked": { + "multiAccount": { + "desc": "Meld u aan om te beginnen met migreren." + }, + "newUser": { + "desc": "Om gebruikers een betere ervaring en een breder scala aan tools te bieden, is de exchange verplaatst van Waves DEX naar Waves.Exchange." + }, + "oldUser": { + "desc": "Als u wilt blijven werken met uw bestaande accounts, funds en de exchange, moet u uw accounts verplaatsen naar de nieuwe Waves.Exchange. We raden u ten zeerste aan dit zo snel mogelijk te doen. Het migratieproces is snel, eenvoudig en absoluut veilig." + }, + "title": "We gebruiken deze service niet meer" + }, "faq": { "attention": { "text": "{div.margin-top-1} [Het migratieproces voor {div.margin-top-1} is ALLEEN beschikbaar via het {div.margin-top-1} [https://dex.wavesplatform.com] (https://dex.wavesplatform.com/) en [https: //client.wavesplatform.com](https://client.wavesplatform.com/). Om de migratie voor de desktop-client te voltooien, moet u de Waves DEX-desktopapp gebruiken die u al hebt geïnstalleerd.] \n\n {div.margin-top-1} [Gebruik geen andere domeinen voor migratie, {div.margin-top-1} nergens uw seed-zinnen en / of privésleutels in en download geen andere clients behalve de software die is aangegeven voor het migratieproces van uw huidige Waves DEX-client. Voor het migratieproces hoeft u nergens uw seed-zinnen en / of privésleutels in te voeren. Waves Platform of Waves.Exchange-medewerkers zullen u nooit vragen om enige vorm van persoonlijke informatie te verstrekken, inclusief privésleutels en / of seed-zinnen.] \n\n {div.margin-top-1} [Het migratieproces is absoluut gratis en heeft geen invloed op gateways, die alle transacties normaal verwerken. U hoeft niemand te betalen of tokens te sturen om de migratie te voltooien.]", @@ -163,4 +181,4 @@ "title": "Nog twee uur!" } } -} \ No newline at end of file +} diff --git a/locale/pl/app.migrate.json b/locale/pl/app.migrate.json index 6da1f51a14..eec0629b7f 100644 --- a/locale/pl/app.migrate.json +++ b/locale/pl/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", "backToPrevious": "Back to previous", @@ -36,6 +42,18 @@ "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", "tryAgain": "Try again" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/pt_BR/app.migrate.json b/locale/pt_BR/app.migrate.json index b46c1fff89..f793c17a5a 100644 --- a/locale/pt_BR/app.migrate.json +++ b/locale/pt_BR/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", "backToPrevious": "Back to previous", @@ -36,6 +42,18 @@ "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", "tryAgain": "Try again" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/pt_PT/app.migrate.json b/locale/pt_PT/app.migrate.json index b46c1fff89..f793c17a5a 100644 --- a/locale/pt_PT/app.migrate.json +++ b/locale/pt_PT/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", "backToPrevious": "Back to previous", @@ -36,6 +42,18 @@ "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", "tryAgain": "Try again" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/ru/app.migrate.json b/locale/ru/app.migrate.json index c3ed3df731..40c901cda4 100644 --- a/locale/ru/app.migrate.json +++ b/locale/ru/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "Чтобы улучшить пользовательский опыт и предложить более широкий набор инструментов, биржа переехала с Waves DEX на Waves.Exchange.", + "secondDesc": "Чтобы продолжить пользоваться биржей, нужно скачать новое десктопное приложение." + } + }, "desktopUpdate": { "almostThere": "Еще немного...", "backToPrevious": "Назад", @@ -36,6 +42,18 @@ "toFinish": "Чтобы завершить процесс миграции, необходимо открыть новое приложение и пройти авторизацию.", "tryAgain": "Попробовать ещё раз" }, + "dexLocked": { + "multiAccount": { + "desc": "Чтобы начать миграцию, войдите в свой аккаунт. " + }, + "newUser": { + "desc": "Чтобы улучшить пользовательский опыт и предложить более широкий набор инструментов, биржа переехала с Waves DEX на" + }, + "oldUser": { + "desc": "Если Вы хотите продолжить работать со своими аккаунтами, токенами и биржей, перенесите свои аккаунты на Waves.Exchange. Настоятельно рекомендуем сделать это как можно скорее. Процесс миграции – быстрый, простой и абсолютно безопасный." + }, + "title": "Мы больше не поддерживаем этот сервис" + }, "faq": { "attention": { "text": "{div.margin-top-1}[Для веб-кошельков процесс миграции возможен ТОЛЬКО с веб-доменов [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) и [https://client.wavesplatform.com](https://client.wavesplatform.com/). Чтобы провести миграцию из десктопного клиента, нужно использовать уже установленное приложение Waves DEX.]\n\n{div.margin-top-1}[Не используйте для миграции другие домены и нигде не вводите свои seed-фразы и/или приватные ключи, а также не загружайте никаких программ, кроме предложенных в процессе миграции из вашего текущего клиента Waves DEX. Процесс миграции не требует где-либо вводить seed-фразы и/или приватные ключи. Сотрудники Waves Platform или Waves.Exchange никогда не попросят предоставить какую-либо персональную информацию, включая приватные ключи и/или seed-фразы.]\n\n{div.margin-top-1}[Миграция осуществляется абсолютно бесплатно и не повлияет на гейтвеи, которые будут обрабатывать транзакции в штатном режиме. Для осуществления миграции не требуются никакие платежи или отправка токенов кому-либо.]", @@ -146,21 +164,21 @@ }, "modals": { "shutdownNotificationFirst": { - "message1": "Waves DEX will stop operating on December 2, 2019", - "message2": "To proceed to work with the exchange, you have to move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The moving is fast, easy, and absolutely secure.", - "submit": "I understand", - "title": "One day left!" + "message1": "Waves DEX прекратит работу 2 декабря 2019 года.", + "message2": "Если Вы хотите продолжить использовать биржу, перенесите свои аккаунты на Waves.Exchange. Настоятельно рекомендуем сделать это как можно скорее. Процесс миграции – быстрый, простой и абсолютно безопасный.", + "submit": "Больше не показывать", + "title": "Остался один день!" }, "shutdownNotificationLast": { - "message1": "Waves DEX is no longer working. The exchange moved to Waves.Exchange. Don't worry! You are still able to move your accounts from Waves DEX to Waves.Exchange. Thank you for the good times!", - "submit": "I understand", - "title": "Time to move on!" + "message1": "Waves DEX больше не работает. Биржа переехала на Waves.Exchange. \nНе волнуйтесь, Вы все еще можете перенести свои аккаунты на новую биржу. \nСпасибо за хорошие времена!", + "submit": "Больше не показывать", + "title": "Время переехать!" }, "shutdownNotificationSecond": { - "message1": "Waves DEX will stop operating in two hours.", - "message2": "To proceed to work with the exchange, you have to move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The moving is fast, easy, and absolutely secure.", - "submit": "I understand", - "title": "Two hours left!" + "message1": "Waves DEX прекратит работу через два часа.", + "message2": "Если Вы хотите продолжить использовать биржу, перенесите свои аккаунты на Waves.Exchange. Настоятельно рекомендуем сделать это как можно скорее. Процесс миграции – быстрый, простой и абсолютно безопасный.", + "submit": "Больше не показывать", + "title": "Осталось два часа!" } } -} \ No newline at end of file +} diff --git a/locale/tr/app.migrate.json b/locale/tr/app.migrate.json index b46c1fff89..f793c17a5a 100644 --- a/locale/tr/app.migrate.json +++ b/locale/tr/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "Almost there...", "backToPrevious": "Back to previous", @@ -36,6 +42,18 @@ "toFinish": "To finish the migration of your accounts, you have to go to the new application and complete the authorization process.", "tryAgain": "Try again" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1}[The migration process for web wallets is ONLY available from the web domain [https://dex.wavesplatform.com](https://dex.wavesplatform.com/) and [https://client.wavesplatform.com](https://client.wavesplatform.com/). To complete migration for the desktop client you have to use the Waves DEX desktop application you have already installed.]\n\n{div.margin-top-1}[Do not use any other domains for migration, do not input your seed phrases and/or private keys anywhere, and do not download any other clients aside from the software indicated for the migration process from your current Waves DEX client. The migration process does not require you to input your seed phrases and/or private keys anywhere. Waves Platform or Waves.Exchange employees will never ask you to provide any kind of personal information, including private keys and/or seed phrases.]\n\n{div.margin-top-1}[The migration process is absolutely free, and it will not affect any gateways, which will process all transactions as normal. You do not need to pay or send any tokens to anyone to complete migration.]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} diff --git a/locale/zh_CN/app.migrate.json b/locale/zh_CN/app.migrate.json index a9230474fd..3325e8414d 100644 --- a/locale/zh_CN/app.migrate.json +++ b/locale/zh_CN/app.migrate.json @@ -1,4 +1,10 @@ { + "desktopLocked": { + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange moved from Waves DEX to Waves.Exchange.", + "secondDesc": "To continue using the exchange, you should download the new desktop application." + } + }, "desktopUpdate": { "almostThere": "快好了...", "backToPrevious": "返回上一个", @@ -36,6 +42,18 @@ "toFinish": "要完成帐户的迁移,您必须转到新应用程序并完成授权过程。", "tryAgain": "再试一次" }, + "dexLocked": { + "multiAccount": { + "desc": "To start migrating, please sign in." + }, + "newUser": { + "desc": "To offer users a better experience and wider range of tools, the exchange has moved from Waves DEX to" + }, + "oldUser": { + "desc": "To continue working with your existing accounts, assets and the exchange, you should move your accounts to the new Waves.Exchange. We strongly recommend that you do this ASAP. The migration process is fast, easy, and absolutely secure." + }, + "title": "We’re no longer operating this service" + }, "faq": { "attention": { "text": "{div.margin-top-1} [仅可从网络域[https://dex.wavesplatform.com](https://dex.wavesplatform.com/)和[https: //client.wavesplatform.com](https://client.wavesplatform.com/)。要完成桌面客户端的迁移,您必须使用已经安装的Waves DEX桌面应用程序。] \n\n {div.margin-top-1} [请勿使用任何其他域进行迁移,请勿在任何地方输入您的种子短语和/或私钥,也不要从您的迁移过程中指定的软件中下载任何其他客户端当前的Waves DEX客户端。迁移过程不需要您在任何地方输入种子短语和/或私钥。 Waves Platform或Waves.Exchange员工绝不会要求您提供任何类型的个人信息,包括私钥和/或种子短语。] \n\n {div.margin-top-1} [迁移过程是完全免费的,并且不会影响任何网关,因为网关将正常处理所有事务。您无需支付任何费用或将令牌发送给任何人即可完成迁移。]", @@ -163,4 +181,4 @@ "title": "Two hours left!" } } -} \ No newline at end of file +} 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/package-lock.json b/package-lock.json index e8b1bb04be..13c36aaa33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "waves-client", - "version": "1.4.11", + "version": "1.4.15", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -7093,14 +7093,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -7120,8 +7118,7 @@ "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", @@ -7269,7 +7266,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } 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/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/index.hbs b/src/index.hbs index 3999387384..5a9f34f7ca 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -524,8 +524,6 @@ - -
@@ -614,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: { @@ -638,13 +620,6 @@ views: [{ name: 'main' }] } }, - { - id: 'migrate', - data: { - url: '/migrate?id', - views: [{ name: 'main' }] - } - }, { id: 'unavailable', data: { @@ -660,74 +635,6 @@ views: [{ name: 'main' }] } }, - { - id: 'saveSeed', - data: { - url: '/save-seed', - views: [{ name: 'main' }] - } - }, - // { - // id: 'sessions', - // data: { - // noLogin: true, - // views: [{ name: 'main' }] - // } - // }, - { - id: 'create', - data: { - views: [{ name: 'main' }] - } - }, - { - id: 'restore', - data: { - url: '/import/restore', - views: [{ name: 'main' }] - } - }, - { - id: 'fromBackup', - data: { - url: '/import/fromBackup', - views: [{ name: 'main' }] - } - }, - { - id: 'ledger', - data: { - url: '/import/ledger', - views: [{ name: 'main' }] - } - }, - { - id: 'keeper', - data: { - url: '/import/waveskeeper', - views: [{ name: 'main' }] - } - }, - { - id: 'import', - data: { - views: [{ name: 'main' }] - } - }, - { - id: 'stand', - data: { - noLogin: true, - views: [{ name: 'main' }] - } - }, - { - id: 'desktop', - data: { - noLogin: true, - views: [{ name: 'main' }] - } - }, { id: 'desktopUpdate', data: { @@ -743,56 +650,6 @@ url: '/migration', views: [{ name: 'main' }] } - }, - { - id: 'main', - data: { - abstract: true, - 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: { - 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: { - views: [{ name: 'mainContent' }] - } - } - ] } ] }); diff --git a/src/modules/app/app.js b/src/modules/app/app.js index 18b4154a20..a8583ae955 100644 --- a/src/modules/app/app.js +++ b/src/modules/app/app.js @@ -102,24 +102,9 @@ 'app.utils', 'app.ui', 'app.welcome', - 'app.signUp', - 'app.signIn', - 'app.migrate', 'app.switch', - 'app.create', - 'app.restore', - 'app.saveSeed', - 'app.desktop', 'app.desktopUpdate', - 'app.ledger', - 'app.keeper', - 'app.fromBackup', - 'app.import', - 'app.wallet', - 'app.dex', - 'app.tokens', 'app.unavailable', - 'app.stand', 'app.migration' ]); })(); diff --git a/src/modules/app/directives/componentError/ComponentError.js b/src/modules/app/directives/componentError/ComponentError.js deleted file mode 100644 index f7d519877e..0000000000 --- a/src/modules/app/directives/componentError/ComponentError.js +++ /dev/null @@ -1,7 +0,0 @@ -(function () { - 'use strict'; - - angular.module('app').component('wComponentError', { - templateUrl: 'modules/app/directives/componentError/componentError.html' - }); -})(); diff --git a/src/modules/app/directives/componentError/componentError.html b/src/modules/app/directives/componentError/componentError.html deleted file mode 100644 index bf4b8340aa..0000000000 --- a/src/modules/app/directives/componentError/componentError.html +++ /dev/null @@ -1 +0,0 @@ -
diff --git a/src/modules/app/directives/componentWarningPlate/ComponentWarningPlate.js b/src/modules/app/directives/componentWarningPlate/ComponentWarningPlate.js deleted file mode 100644 index 4026ceff7c..0000000000 --- a/src/modules/app/directives/componentWarningPlate/ComponentWarningPlate.js +++ /dev/null @@ -1,151 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {*} $scope - * @param {*} $transitions - * @param {ModalManager} modalManager - * @param {app.utils} utils - * @param {User} user - * @param {Storage} storage - * @param {ng.IAugmentedJQuery} $element - * @return {ComponentWarningPlate} - */ - const controller = function ($scope, $transitions, modalManager, utils, user, storage, $element) { - - class ComponentWarningPlate { - - /** - * @type {number} - */ - days = 0; - /** - * @type {number} - */ - hours = 0; - /** - * @type {number} - */ - minutes = 0; - /** - * @type {number} - */ - seconds = 0; - /** - * @type {boolean} - */ - canMoveAccounts = false; - /** - * @type {boolean} - */ - migrationSuccess = false; - /** - * @type {string} - */ - newDexLink = WavesApp.network.wavesExchangeLink; - /** - * @type {boolean} - */ - isDesktop = WavesApp.isDesktop(); - /** - * @type {boolean} - */ - isOldDesktop = this.isDesktop && utils.isVersionLte('1.4.0'); - /** - * @type {boolean} - */ - isVisible = true; - - constructor() { - this._initCanMoveAccounts(); - this._initMigrationSuccess(); - - storage.change.on(() => { - this._initMigrationSuccess(); - this._initCanMoveAccounts(); - }); - - user.loginSignal.on(this._initCanMoveAccounts, this); - user.logoutSignal.on(this._initCanMoveAccounts, this); - - utils.startTimer({ year: 2019, month: 12, day: 2, hours: 15 }, this._setTime.bind(this), 1000); - - $transitions.onSuccess({ to: 'desktopUpdate' }, () => { - this.isVisible = false; - }); - - $transitions.onSuccess({ from: 'desktopUpdate' }, () => { - this.isVisible = true; - }); - } - - showMovingModal() { - modalManager.showMigrateModal(); - } - - /** - * @param last - * @private - */ - _setTime(last) { - this.days = this._to2Digest(last.days); - this.hours = this._to2Digest(last.hours); - this.minutes = this._to2Digest(last.minutes); - this.seconds = this._to2Digest(last.seconds); - utils.safeApply($scope); - } - - /** - * @param num - * @return {string} - * @private - */ - _to2Digest(num) { - return num < 10 ? `0${num}` : String(num); - } - - /** - * @private - */ - _initCanMoveAccounts() { - Promise.all([ - user.getFilteredUserList(), - user.getMultiAccountData() - ]).then(([userList, multiAccountData]) => { - if ( - (multiAccountData && user.isAuthorised) || - (userList && userList.length && !multiAccountData) - ) { - this.canMoveAccounts = true; - } else { - this.canMoveAccounts = false; - } - $element.toggleClass('warning-timer_active', this.canMoveAccounts); - $scope.$apply(); - }); - } - - /** - * @private - */ - _initMigrationSuccess() { - storage.load('migrationSuccess').then((migrationSuccess) => { - this.migrationSuccess = migrationSuccess; - $scope.$apply(); - }); - } - - } - - return new ComponentWarningPlate(); - - }; - - controller.$inject = ['$scope', '$transitions', 'modalManager', 'utils', 'user', 'storage', '$element']; - - angular.module('app').component('wWarningPlate', { - templateUrl: 'modules/app/directives/componentWarningPlate/componentWarningPlate.html', - transclude: false, - controller - }); -})(); diff --git a/src/modules/app/directives/componentWarningPlate/componentWarningPlate.html b/src/modules/app/directives/componentWarningPlate/componentWarningPlate.html deleted file mode 100644 index 18d994943a..0000000000 --- a/src/modules/app/directives/componentWarningPlate/componentWarningPlate.html +++ /dev/null @@ -1,38 +0,0 @@ -
-
- -
-
- {{$ctrl.days}} - d : -
-
- {{$ctrl.hours}} - h : -
-
- {{$ctrl.minutes}} - m : -
-
- {{$ctrl.seconds}} - s -
-
- -
- - -
-
- - -
- -
-
-
diff --git a/src/modules/app/directives/componentWarningPlate/componentWarningPlate.less b/src/modules/app/directives/componentWarningPlate/componentWarningPlate.less deleted file mode 100644 index 09e4fd5b60..0000000000 --- a/src/modules/app/directives/componentWarningPlate/componentWarningPlate.less +++ /dev/null @@ -1,203 +0,0 @@ -@import (reference) 'config'; -@import (reference) "icons"; - -w-warning-plate { - .warning-plate { - display: block; - - &__content { - display: flex; - flex-direction: row; - background: @color-warning-600; - height: 40px; - justify-content: center; - color: #fff; - font-size: 15px; - line-height: 20px; - padding: 9px; - - &.info { - background: @color-submit-300; - } - - &_no-user { - .warning-plate__text { - margin-right: auto; - } - } - } - - &__button { - cursor: pointer; - border-radius: 4px; - background-color: #fff; - color: @color-warning-600; - padding: 4px 10px; - font-size: 13px; - display: flex; - justify-content: center; - align-items: center; - line-height: 13px; - min-width: 82px; - height: 22px; - margin-right: auto; - font-weight: bold; - - &.info { - color: @color-submit-300; - } - } - - &__text { - margin: 0 15px 0 auto; - display: flex; - align-items: center; - - a { - color: #fff; - text-decoration: underline; - margin-left: 3px; - } - - &-icon { - background: @warning-icon-700; - height: 14px; - width: 14px; - margin-right: 10px; - - &_circle { - background: @info-icon-300; - } - } - } - - &__timer { - display: flex; - flex-direction: row; - padding-left: 20px; - position: relative; - align-items: center; - height: 22px; - font-family: @font-roboto-medium; - - @media screen and (max-width: 1000px) { - display: none; - } - - &::before { - content: ""; - display: block; - height: 14px; - width: 14px; - position: absolute; - top: 4px; - left: 0; - background: @timer-icon; - } - - &-value { - margin-left: 3px; - } - } - } -} - -.warning-timer_active { - position: relative; - z-index: 11; - display: block; - - & + .ui-view { - height: calc(100% ~"- 40px"); - - .main-header_new-user { - top: 40px; - - &.fixed { - .main-header__header { - top: 40px; - } - } - } - } -} - -body.desktopUpdate:not(.web) { - .warning-timer { - & + .ui-view { - height: 100%; - @media screen and (max-width: 860px) { - height: 100%; - } - } - } -} - -@media screen and (max-width: 860px) { - w-warning-plate { - .warning-plate { - &__content { - height: 72px; - justify-content: space-between; - padding: 10px; - flex-wrap: wrap; - transition: all .2s; - - &_no-user { - justify-content: flex-start; - - .warning-plate__text { - max-width: none; - margin: 0; - } - } - } - - - &__text { - text-align: left; - margin-left: 0; - margin-right: 10px; - font-size: 13px; - max-width: calc(100% ~"- 94px"); - line-height: 16px; - - &-icon { - display: none; - } - } - - &__timer { - display: none; - } - - &__button { - margin: 3px 0; - height: 42px; - width: 84px; - } - } - } - - .menu-is-shown { - .warning-plate__content { - transform: translateX(-261px); - } - } - - .warning-timer_active { - & + .ui-view { - height: calc(100% ~"- 72px"); - - .main-header_new-user { - top: 72px; - - &.fixed { - .main-header__header { - top: 72px; - } - } - } - } - } -} \ No newline at end of file diff --git a/src/modules/app/initialize/AppConfig.js b/src/modules/app/initialize/AppConfig.js index 1323476a77..74cc238329 100644 --- a/src/modules/app/initialize/AppConfig.js +++ b/src/modules/app/initialize/AppConfig.js @@ -184,7 +184,7 @@ i18next.on('initialized', () => { const localeData = WavesApp.getLocaleData().separators; - + const lang = localStorage.getItem('lng') || i18next.language; BigNumber.config.set({ ROUNDING_MODE: BigNumber.ROUND_MODE.ROUND_DOWN, FORMAT: tsUtils.merge(Object.create(null), BIG_NUMBER_FORMAT, { @@ -194,7 +194,7 @@ }); if (WavesApp.isDesktop()) { - transfer('setLanguage', i18next.language); + transfer('setLanguage', lang); } i18next.on('languageChanged', () => { diff --git a/src/modules/app/initialize/AppRun.js b/src/modules/app/initialize/AppRun.js index 1f703a61c9..1e3ea948eb 100644 --- a/src/modules/app/initialize/AppRun.js +++ b/src/modules/app/initialize/AppRun.js @@ -6,8 +6,6 @@ // const onContentLoad = new Promise((resolve) => { // document.addEventListener('DOMContentLoaded', resolve); // }); - - const { Money } = require('@waves/data-entities'); const { libs } = require('@waves/waves-transactions'); const { base64Encode, blake2b, stringToBytes } = libs.crypto; @@ -70,12 +68,9 @@ * @param {State} state * @param {ModalManager} modalManager * @param {Storage} storage - * @param {BalanceWatcher} balanceWatcher - * @param {Matcher} matcher * @param {INotification} notification * @param {app.utils.decorators} decorators * @param {MultiAccount} multiAccount - * @param {ModalRouter} ModalRouter * @param {ConfigService} configService * @param {INotification} userNotification * @return {AppRun} @@ -90,12 +85,9 @@ state, modalManager, storage, - balanceWatcher, - matcher, notification, decorators, multiAccount, - ModalRouter, configService, userNotification ) { @@ -143,11 +135,6 @@ * @type {Array} */ this.activeClasses = []; - /** - * @type {ModalRouter} - * @private - */ - this._modalRouter = new ModalRouter(); /** * Configure library generation avatar by address @@ -157,7 +144,6 @@ this._setHandlers(); this._initializeLogin(); this._initializeOutLinks(); - this._openMigrationModal(); if (WavesApp.isDesktop()) { window.listenMainProcessEvent((type, url) => { @@ -234,9 +220,6 @@ return Promise.resolve(true); default: return Promise.resolve(true); - // return modalManager.showTryDesktopModal() - // .then(() => this._runDesktop()) - // .catch(() => true); } }); } @@ -397,8 +380,6 @@ clearInterval(this._notifyTimer); this._notifyTimer = setInterval(() => this._updateUserNotifications(), 10000); }); - - balanceWatcher.change.once(this._onBalanceChange, this); }); } @@ -407,18 +388,21 @@ 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', + 'desktopUpdate', + 'switch' + ]; const offInitialTransitions = $transitions.onStart({}, transition => { - const DEXW_LOCKED = configService.get('DEXW_LOCKED'); const toState = transition.to(); const fromState = transition.from(); const params = transition.params(); let tryDesktop; - if (DEXW_LOCKED && DEXW_LOCKED_STATES.indexOf(toState.name) === -1) { - return $state.target('migration'); + if (DEXW_LOCKED_STATES.indexOf(toState.name) === -1) { + return $state.target(DEXW_LOCKED_STATES[0]); } if (START_STATES.indexOf(toState.name) === -1) { @@ -427,7 +411,6 @@ } if (!multiAccount.isSignedIn) { - user.setInitRouteState(toState.name, params); return $state.target(START_STATES[0]); } } @@ -466,11 +449,7 @@ user.goToActiveState(); } - i18next.changeLanguage(user.getSetting('lng')); - - this._initializeTermsAccepted().then(() => { - this._modalRouter.initialize(); - }); + this._initializeTermsAccepted(); const offInnerTransitions = this._onInnerTransitions( START_STATES.filter(state => state !== 'desktopUpdate'), @@ -488,62 +467,15 @@ _onInnerTransitions(START_STATES, DEXW_LOCKED_STATES) { return $transitions.onStart({}, transition => { const toState = transition.to(); - const { custom } = transition.options(); - const DEXW_LOCKED = configService.get('DEXW_LOCKED'); - if (DEXW_LOCKED && DEXW_LOCKED_STATES.indexOf(toState.name) === -1) { - return $state.target('migration'); - } - - if (START_STATES.indexOf(toState.name) !== -1 && !custom.logout && !DEXW_LOCKED) { - return false; + if (DEXW_LOCKED_STATES.indexOf(toState.name) === -1) { + return $state.target(DEXW_LOCKED_STATES[0]); } else { state.signals.changeRouterStateStart.dispatch(transition); } }); } - _onBalanceChange() { - if (user.getSetting('hasBackup')) { - return; - } - - const balance = balanceWatcher.getBalance(); - const pairs = Object.entries(balance).reduce((acc, [assetId, asset]) => { - if (asset.toTokens() !== '0') { - acc.push([assetId, WavesApp.defaultAssets.USD]); - } - - return acc; - }, []); - - if (pairs.length === 0) { - return; - } - - Promise.all([ - ds.api.assets.get(WavesApp.defaultAssets.USD), - ds.api.matchers.getRates(matcher.currentMatcherAddress, pairs) - ]).then(([usdAsset, rates]) => { - const usd = rates.data.reduce((acc, rate) => { - const amountAsset = balance[rate.amountAsset]; - const amountAssetInUsd = amountAsset.convertTo(usdAsset, rate.data.rate); - - return acc.add(amountAssetInUsd); - }, new Money(0, usdAsset)); - - if (usd.gte(usd.cloneWithTokens(100))) { - modalManager.showTutorialModals(); - - return; - } - - if (usd.gte(usd.cloneWithTokens(1))) { - this._initializeBackupWarning(); - } - }); - } - /** * @return Promise * @private @@ -558,69 +490,6 @@ }); } - /** - * @param {object} [scope] - * @param {boolean} scope.closeByModal - * @private - */ - @decorators.scope({ closeByModal: false }) - _initializeBackupWarning(scope) { - const id = '_hasBackupId'; - - if (!notification.has(id)) { - const changeModalsHandler = (modal) => { - scope.closeByModal = true; - notification.remove(id); - scope.closeByModal = false; - - modal.catch(() => null) - .then(() => { - if (!user.getSetting('hasBackup')) { - this._initializeBackupWarning(); - } - }); - }; - - modalManager.openModal.once(changeModalsHandler); - - analytics.send({ name: 'Create Save Phrase Show', target: 'ui' }); - - notification.error({ - id, - ns: 'app.utils', - title: { - literal: 'notification.backup.title' - }, - body: { - literal: 'notification.backup.body' - }, - action: { - literal: 'notification.backup.action', - callback: () => { - analytics.send({ name: 'Create Save Phrase Yes Click', target: 'ui' }); - modalManager.showSeedBackupModal(); - } - }, - onClose: () => { - analytics.send({ name: 'Create Save Phrase No Click', target: 'ui' }); - - notification.remove(id); - - if (scope.closeByModal || user.getSetting('hasBackup')) { - return null; - } - - modalManager.openModal.off(changeModalsHandler); - - const stop = $transitions.onSuccess({}, () => { - stop(); - this._initializeBackupWarning(); - }); - } - }, -1); - } - } - /** * @param {{name: string}} currentState * @param {boolean} canChangeState @@ -762,21 +631,6 @@ }); } - /** - * @private - */ - _openMigrationModal() { - Promise.all([ - user.getMultiAccountData(), - user.getFilteredUserList(), - storage.load('notAutoOpenMigrationModal') - ]).then(([multiAccountData, userList, notAutoOpenMigrationModal]) => { - if (!notAutoOpenMigrationModal && !multiAccountData && userList && userList.length) { - modalManager.showMigrateModal(); - } - }); - } - /** * @private */ @@ -801,15 +655,11 @@ 'state', 'modalManager', 'storage', - 'balanceWatcher', - 'matcher', 'notification', 'decorators', 'multiAccount', - 'ModalRouter', 'configService', - 'userNotification', - 'whatsNew' + 'userNotification' ]; angular.module('app').run(run); diff --git a/src/modules/app/less/app.less b/src/modules/app/less/app.less index 2dd4e8cb55..f4410683d9 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; } } @@ -143,12 +143,11 @@ body.portfolio { } .ui-view { - display: block; + display: flex; + flex-direction: column; height: 100%; - - &_main { - overflow: auto; - } + overflow: hidden; + overflow-y: 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/app/services/BalanceWatcher.js b/src/modules/app/services/BalanceWatcher.js deleted file mode 100644 index 3734c43d79..0000000000 --- a/src/modules/app/services/BalanceWatcher.js +++ /dev/null @@ -1,208 +0,0 @@ -(function () { - 'use strict'; - - const { Signal } = require('ts-utils'); - const { Money } = require('@waves/data-entities'); - const { not, pathEq } = require('ramda'); - - /** - * @param {User} user - * @param {Poll} Poll - * @param {app.utils} utils - * @param {Waves} waves - */ - const factory = function (user, Poll, utils, waves) { - - class BalanceWatcher { - - /** - * @type {Signal} - */ - change = new Signal(); - /** - * @type {Promise} - */ - ready; - /** - * @type {Array} - * @private - */ - _balance = []; - /** - * @type {Poll} - * @private - */ - _poll = null; - /** - * @type {Function} - * @private - */ - _resolve; - /** - * @type {Function} - * @private - */ - _reject; - - constructor() { - this.ready = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - }); - - user.onLogin().then( - () => this._handleLogin(), - () => this._handleLogout() - ); - } - - /** - * @return {Record} - */ - getBalance() { - return this._getHash(); - } - - /** - * @param {Asset} asset - * @return Money - */ - getBalanceByAsset(asset) { - const hash = this.getBalance(); - return hash[asset.id] ? hash[asset.id] : new Money(0, asset); - } - - /** - * @param {Array} assetList - * @return Array - */ - getBalanceByAssetList(assetList) { - return assetList.map(this.getBalanceByAsset, this); - } - - /** - * @param {string} id - * @return {Promise} - */ - getBalanceByAssetId(id) { - return waves.node.assets.getAsset(id) - .then(this.getBalanceByAsset.bind(this)); - } - - /** - * @param {string} id - * @return {Promise} - */ - getFullBalanceByAssetId(id) { - const balance = this._balance.find(pathEq(['asset', 'id'], id)); - if (balance) { - return Promise.resolve(balance); - } - return waves.node.assets.getAsset(id).then(asset => { - const empty = new Money(0, asset); - return { - asset, - regular: empty, - available: empty, - inOrders: empty, - leasedOut: empty, - leasedIn: empty - }; - }); - } - - /** - * @return {Array} - */ - getFullBalanceList() { - return this._balance.map(item => ({ ...item })); - } - - /** - * @private - */ - _handleLogin() { - this._watch(); - - user.logoutSignal.once(this._handleLogout, this); - } - - /** - * @private - */ - _handleLogout() { - if (this._poll) { - this._poll.destroy(); - } - - user.loginSignal.once(this._handleLogin, this); - } - - /** - * @private - */ - _watch() { - const get = () => BalanceWatcher._getBalanceList(); - const set = list => this._setBalanceList(list); - this._poll = new Poll(get, set, 1000); - this._poll.ready.then(this._resolve, this._reject); - } - - /** - * @private - */ - _dispatch() { - this.change.dispatch(this._getHash()); - } - - /** - * @return {*} - * @private - */ - _getHash() { - return utils.toHash(this._balance.map(item => item.available), 'asset.id'); - } - - /** - * @param {Array} list - * @return {null} - * @private - */ - _setBalanceList(list) { - const dispatch = () => { - this._balance = list; - this._dispatch(); - }; - - if (list.length !== this._balance.length) { - dispatch(); - return null; - } - - - const itemNotEqual = (a, b) => not(utils.isEqual(a.available, b.available)); - const isNeedDispatch = list.length && - list.some((item, i) => itemNotEqual(item, this._balance[i])); - - if (isNeedDispatch) { - dispatch(); - } - } - - /** - * @return {Promise} - * @private - */ - static _getBalanceList() { - return waves.node.assets.userBalances(); - } - - } - - return new BalanceWatcher(); - }; - - factory.$inject = ['user', 'Poll', 'utils', 'waves']; - - angular.module('app').factory('balanceWatcher', factory); -})(); diff --git a/src/modules/app/services/ConfigService.js b/src/modules/app/services/ConfigService.js index 602a02655b..2d786a1ea7 100644 --- a/src/modules/app/services/ConfigService.js +++ b/src/modules/app/services/ConfigService.js @@ -5,7 +5,7 @@ const BaseConfigService = utils.ConfigService; - const factory = function (Base, createPoll) { + const factory = function (Base) { class ConfigService extends Base { @@ -26,7 +26,6 @@ super(); this.change = this.service.change; this.configReadyPromise = this.service.configReady; - this.configReady = createPoll(this, () => this.service.fetchConfig(), () => null, 30000); } /** @@ -48,7 +47,7 @@ return new ConfigService(); }; - factory.$inject = ['Base', 'createPoll']; + factory.$inject = ['Base']; angular.module('app').factory('configService', factory); })(); diff --git a/src/modules/app/services/EventManager.js b/src/modules/app/services/EventManager.js index dc462e6e3b..9714edeb89 100644 --- a/src/modules/app/services/EventManager.js +++ b/src/modules/app/services/EventManager.js @@ -85,21 +85,21 @@ */ _initialize() { this._waves = $injector.get('waves'); - this._waves.node.transactions.listUtx() - .then((list) => { - const events = user.getSetting('events'); - const utxHash = utils.toHash(list, 'id'); - - Object.keys(events).forEach((id) => { - if (!utxHash[id]) { - this._removeEvent(id, true); - } - }); - - if (list && list.length) { - this._resetPoll(); - } - }); + // this._waves.node.transactions.listUtx() + // .then((list) => { + // const events = user.getSetting('events'); + // const utxHash = utils.toHash(list, 'id'); + // + // Object.keys(events).forEach((id) => { + // if (!utxHash[id]) { + // this._removeEvent(id, true); + // } + // }); + // + // if (list && list.length) { + // this._resetPoll(); + // } + // }); } /** diff --git a/src/modules/app/services/SessionBridge.js b/src/modules/app/services/SessionBridge.js deleted file mode 100644 index c1f33c2a0f..0000000000 --- a/src/modules/app/services/SessionBridge.js +++ /dev/null @@ -1,469 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {User} user - * @param {app.utils} utils - * @return {SessionBridge} - */ - const factory = function (user, utils) { - const tsUtils = require('ts-utils'); - - class SessionBridge { - - /** - * @return {string} - * @private - */ - get _sessionListKey() { - return `${this._key}-sessionList`; - } - - constructor() { - /** - * @type {string} - * @private - */ - this._sessionId = `s_${Date.now()}`; - /** - * @type {string} - * @private - */ - this._key = '__sb'; - /** - * @type {any} - * @private - */ - this._messageHash = Object.create(null); - /** - * @type {IBridgeSignals} - */ - this.signals = utils.liteObject({ - changeSessions: new tsUtils.Signal() - }); - - this._api = utils.liteObject({ - getLoginData: (commandData) => this._getLoginData(commandData), - sign: (commandData) => this._sign(commandData), - response: (commandData) => this._onResponse(commandData) - }); - - this._setHandlers(); - - user.onLogin().then( - () => this._handleLogin(), - () => this._handleLogout() - ); - } - - /** - * @return {ISessionUserData[]} - */ - getSessionsData() { - /** - * @type {object} - */ - const userDataHash = this._getOtherSessions().reduce((result, sessionId) => { - const userData = this._getUserDataBySession(sessionId); - if (userData) { - result[userData.address] = userData; - } else { - this._clearCommand(this._getSessionDataKey(sessionId)); - } - return result; - }, Object.create(null)); - return Object.values(userDataHash); - } - - /** - * @param {string} sessionId - * @return Promise - */ - login(sessionId) { - return this._runCommand('getLoginData', sessionId) - .then((response) => { - if (response.status === 'success') { - user.login(response.data); - } else { - // console.error(response); TODO - } - }); - } - - /** - * @param {string} type - * @param {object} tx - */ - sign(type, tx) { - /** - * @type {void|ISessionUserData} - */ - const master = this._getMasterSessionId(user.address); - return this._runCommand('sign', master && master.id, { type, tx }); - } - - _handleLogin() { - this._addSession(); - this._addUserData(); - - user.logoutSignal.once(this._handleLogout, this); - } - - _handleLogout() { - this._destroy(); - - user.loginSignal.once(this._handleLogin, this); - } - - /** - * @param request - * @param {string} request.id - * @param {string} request.referer - * @private - */ - _getLoginData(request) { - return this._setResponseSuccess(request, { - address: user.address - }); - } - - /** - * @param request - * @param {string} request.id - * @param {string} request.referer - * @param {object} request.data - * @param {string} request.data.type - * @param {object} request.data.tx - * @private - */ - _sign(/* request */) { - /** - * @type {ITransactionClass} - */ - // let transaction; - - // switch (request.data.type) { - // case 'order': - // transaction = new Waves.Transactions.Order(request.data.tx); - // break; - // case Waves.constants.ISSUE_TX_NAME: - // transaction = new Waves.Transactions.IssueTransaction(request.data.tx); - // break; - // case Waves.constants.TRANSFER_TX_NAME: - // transaction = new Waves.Transactions.TransferTransaction(request.data.tx); - // break; - // case Waves.constants.REISSUE_TX_NAME: - // transaction = new Waves.Transactions.ReissueTransaction(request.data.tx); - // break; - // case Waves.constants.BURN_TX_NAME: - // transaction = new Waves.Transactions.BurnTransaction(request.data.tx); - // break; - // case Waves.constants.LEASE_TX_NAME: - // transaction = new Waves.Transactions.LeaseTransaction(request.data.tx); - // break; - // case Waves.constants.CANCEL_LEASING_TX_NAME: - // transaction = new Waves.Transactions.CancelLeasingTransaction(request.data.tx); - // break; - // case Waves.constants.CREATE_ALIAS_TX_NAME: - // transaction = new Waves.Transactions.CreateAliasTransaction(request.data.tx); - // break; - // case Waves.constants.MASS_TRANSFER_TX_NAME: - // throw new Error('Unsupported method mass transfer!'); - // default: - // throw new Error('Unknown transaction type!'); - // } - - // user.getSeed() - // .then((seed) => transaction.prepareForAPI(seed.keyPair.privateKey)) - // .then((prepareData) => this._setResponseSuccess(request, prepareData)) - // .catch((e) => { - // this._setResponseError(request, e); - // }); - } - - /** - * @param {object} request - * @param {string} request.id - * @param {string} request.referer - * @param {object} body - * @private - */ - _setResponseSuccess(request, body) { - this._setResponse(request, 'success', { data: body }); - } - - /** - * @param {object} request - * @param {string} request.id - * @param {string} request.referer - * @param {object} body - * @private - */ - _setResponseError(request, message) { - this._setResponse(request, 'error', { message }); - } - - /** - * @param {object} request - * @param {string} request.id - * @param {string} request.referer - * @param {'error'|'success'} status - * @param {object} data - * @private - */ - _setResponse(request, status, data) { - const command = this._getCommandKey(request.referer, 'response'); - this._dispatch(command, { - id: request.id, - referer: this._sessionId, - data: { - status, - ...data - } - }); - setTimeout(() => { - this._clearCommand(command); - }, 100); - } - - /** - * @param {string} apiMethod - * @param {string} targetSessionId - * @param {*} [data] - * @return {Promise} - * @private - */ - _runCommand(apiMethod, targetSessionId, data) { - return new Promise((resolve) => { - const id = tsUtils.uniqueId('cmd__'); - const params = { id, data, referer: this._sessionId }; - const command = this._getCommandKey(targetSessionId, apiMethod); - - this._messageHash[id] = (result) => { - delete this._messageHash[id]; - this._clearCommand(command); - resolve(result); - }; - - this._dispatch(command, params); - - setTimeout(() => { - if (this._messageHash[id]) { - this._messageHash[id]({ - status: 'error', - message: new Error('Timeout limit error!') - }); - } - }, 1000); - }); - } - - /** - * @param {string} storageKey - * @param {ICommandData} data - * @private - */ - _dispatch(storageKey, data) { - localStorage.setItem(storageKey, JSON.stringify(data)); - } - - /** - * @param {string} storageKey - * @private - */ - _clearCommand(storageKey) { - localStorage.removeItem(storageKey); - } - - /** - * @param {ICommandData} commandData - * @private - */ - _onResponse(commandData) { - if (this._messageHash[commandData.id]) { - this._messageHash[commandData.id](commandData.data); - } - } - - /** - * @private - */ - _setHandlers() { - window.addEventListener('storage', (event) => this._onStorageEvent(event), false); - window.addEventListener('unload', () => this._destroy(), false); - } - - /** - * @param {StorageEvent} event - * @private - */ - _onStorageEvent(event) { - if (event.newValue) { - const cmd = this._parseCommand(event.key); - if (cmd && cmd in this._api) { - const commandData = JSON.parse(localStorage.getItem(event.key)); - try { - this._api[cmd](commandData); - } catch (e) { - if (cmd !== 'response') { - this._setResponseError(commandData, e); - } - } - } else if (event.key === this._sessionListKey) { - this.signals.changeSessions.dispatch(this.getSessionsData()); - } - } - } - - /** - * @private - */ - _destroy() { - this._removeSession(); - this._removeUserData(); - } - - /** - * @private - */ - _addSession() { - const sessions = JSON.parse(localStorage.getItem(this._sessionListKey) || '[]'); - sessions.push(this._sessionId); - localStorage.setItem(this._sessionListKey, JSON.stringify(sessions)); - } - - /** - * @private - */ - _removeSession() { - const sessions = JSON.parse(localStorage.getItem(this._sessionListKey) || '[]'); - const index = sessions.indexOf(this._sessionId); - if (index !== -1) { - sessions.splice(index, 1); - localStorage.setItem(this._sessionListKey, JSON.stringify(sessions)); - } - } - - /** - * @private - */ - _addUserData() { - localStorage.setItem(this._getSessionDataKey(), JSON.stringify({ - name: user.name, - address: user.address, - id: this._sessionId, - isMaster: user.isMaster() - })); - } - - /** - * @param {string} address - * @return {void | ISessionUserData} - * @private - */ - _getMasterSessionId(address) { - return tsUtils.find(this.getSessionsData(), { address, isMaster: true }); - } - - /** - * @return {Array} - * @private - */ - _getAllSessions() { - return JSON.parse(localStorage.getItem(this._sessionListKey) || '[]'); - } - - /** - * @return {string[]} - * @private - */ - _getOtherSessions() { - return this._getAllSessions().filter((sessionId) => sessionId !== this._sessionId); - } - - /** - * @param {string} [sessionId] - * @private - */ - _removeUserData(sessionId) { - localStorage.removeItem(this._getSessionDataKey(sessionId)); - } - - /** - * @param {string} sessionId - * @return {ISessionUserData} - * @private - */ - _getUserDataBySession(sessionId) { - return JSON.parse(localStorage.getItem(this._getSessionDataKey(sessionId))); - } - - /** - * @param {string} [sessionId] - * @return {string} - * @private - */ - _getSessionDataKey(sessionId = this._sessionId) { - return `${this._key}-${sessionId}`; - } - - /** - * @param {string} sessionId - * @param {string} cmd - * @return {string} - * @private - */ - _getCommandKey(sessionId, cmd) { - return `${this._getSessionDataKey(sessionId)}-${cmd}-cmd`; - } - - /** - * @param {string} localStorageKey - * @return {string|null} - * @private - */ - _parseCommand(localStorageKey) { - const [sessionId, cmd] = localStorageKey.split('-').slice(1, -1); - if (sessionId && cmd && sessionId === this._sessionId) { - return cmd; - } else { - return null; - } - } - - } - - return new SessionBridge(); - }; - - factory.$inject = ['user', 'utils']; - - angular.module('app').factory('sessionBridge', factory); -})(); - -/** - * @typedef {object} ISessionUserData - * @property {string} name - * @property {string} address - * @property {string} id - * @property {boolean} isMaster - */ - -/** - * @typedef {object} ICommandData - * @property {string} id - * @property {string} referer - * @property {object} data - */ - -/** - * @typedef {object} IResponse - * @property {'error'|'success'} status - * @property {string} [message] - * @property {object} [data] - */ - -/** - * @typedef {object} IBridgeSignals - * @property {Signal} changeSessions - */ diff --git a/src/modules/app/services/StateManager.js b/src/modules/app/services/StateManager.js deleted file mode 100644 index b1a355b4cf..0000000000 --- a/src/modules/app/services/StateManager.js +++ /dev/null @@ -1,87 +0,0 @@ -(function () { - 'use strict'; - - /** - * - * @param {State} state - * @param {User} user - * @param {$state} $state - * @return {StateManager} - */ - const factory = function (state, user, $state) { - - class StateManager { - - constructor() { - this.rootStateList = []; - this.subStateList = []; - - state.signals.changeRouterStateSuccess.on(this._currentStateLists, this); - this.changeRouteState = state.signals.changeRouterStateSuccess; - this._currentStateLists(); - } - - getSrefByState(state) { - return WavesApp.stateTree.getPath(state.id).join('.'); - } - - getStateTree(fromId = 'main') { - const root = WavesApp.stateTree.find(fromId); - return root.getChildren().filter((child) => child.get('noLogin') !== true) - .map(StateManager._remapStateItem); - } - - /** - * @private - */ - _currentStateLists() { - if (!$state.$current || !$state.$current.name) { - return false; - } - - const root = WavesApp.stateTree.find('main'); - const rootPath = WavesApp.stateTree.getPath(root.id).join('.'); - this.rootStateList = root.getChildren() - .map((item) => { - const path = user.getActiveState(item.id); - const base = `${rootPath}.${item.id}`; - return { path, name: item.id, base }; - }); - const idList = $state.$current.name.split('.'); - const parent = idList[idList.length - 2]; - const stateData = WavesApp.stateTree.find(parent); - if (stateData && !stateData.get('abstract')) { - this.subStateList = stateData.getChildren().map((item) => { - const path = WavesApp.stateTree.getPath(item.id).join('.'); - return { name: item.id, path }; - }); - } else { - this.subStateList = []; - } - } - - static _remapStateItem(item) { - const list = item.getChildren().map(StateManager._remapStateItem); - const isLeaf = list.length === 0; - const result = { list, isLeaf, id: item.id }; - - if (list.length) { - Object.defineProperty(result, 'sref', { - get: () => user.getActiveState(item.id) - }); - } else { - result.sref = user.getActiveState(item.id); - } - - return result; - } - - } - - return new StateManager(); - }; - - factory.$inject = ['state', 'user', '$state']; - - angular.module('app').factory('stateManager', factory); -})(); diff --git a/src/modules/app/services/User.js b/src/modules/app/services/User.js index b26e9c447f..d00c3f7110 100644 --- a/src/modules/app/services/User.js +++ b/src/modules/app/services/User.js @@ -164,10 +164,6 @@ return this.currentUser ? this.currentUser.publicKey : null; } - get matcherSign() { - return this.currentUser ? this.currentUser.matcherSign : null; - } - /** * @type {boolean} */ @@ -262,20 +258,6 @@ return list.includes(value); } - getDefaultUserSettings(settings) { - const { common } = this._settings.getSettings(); - - return defaultSettings.create({ ...settings }, { ...common }); - } - - /** - * @param {*} user - * @return {DefaultSettings} - */ - getSettingsByUser(user) { - return this.getDefaultUserSettings(user.settings); - } - /** * @param {string} name * @param {*} value @@ -313,7 +295,7 @@ */ getMultiAccountUsersCount() { return storage.load('multiAccountUsers').then(users => { - return Object.keys(users).length; + return users ? Object.keys(users).length : 0; }); } @@ -349,7 +331,6 @@ [userHash]: { // TODO map user settings to a new schema name: user.name, settings: user.settings, - matcherSign: user.matcherSign, lastLogin: user.lastLogin } })); @@ -412,13 +393,7 @@ } initScriptInfoPolling() { - clearTimeout(this._scriptInfoPollTimeoutId); - this._scriptInfoPollTimeoutId = setTimeout(() => { - if (this._scriptInfoPoll) { - this._scriptInfoPoll.destroy(); - } - this._scriptInfoPoll = new Poll(() => this.updateScriptAccountData(), () => null, 10000); - }, 30000); + this.updateScriptAccountData(); } /** @@ -435,21 +410,7 @@ } goToActiveState() { - if (!this.initRouteState) { - $state.go(this.getActiveState('wallet')); - } - } - - /** - * @param {string} name - * @param {string} params - */ - setInitRouteState(name, params) { - if (this.initRouteState) { - return; - } - this.initRouteState = true; - this.loginSignal.once(() => $state.go(name, params)); + $state.go(this.getActiveState('welcome')); } /** @@ -544,29 +505,21 @@ ds.app.logOut(); clearTimeout(this._scriptInfoPollTimeoutId); - if (this._scriptInfoPoll) { - this._scriptInfoPoll.destroy(); - } - - if (stateName) { - this._resetFields(); - - if (isSwitch) { - $state.go(stateName); + if (!isSwitch) { + if (WavesApp.isDesktop()) { + transfer('reload'); + } else { + window.location.reload(); } + return; + } + this._resetFields(); - this.logoutSignal.dispatch({}); - - if (!isSwitch) { - this.changeTheme(themes.getDefaultTheme(), { dontSave: true }); - multiAccount.signOut(); - $state.go(stateName, undefined, { custom: { logout: true } }); - } - } else if (WavesApp.isDesktop()) { - transfer('reload'); - } else { - window.location.reload(); + if (isSwitch) { + $state.go(stateName || ''); } + + this.logoutSignal.dispatch({}); } resetAll() { @@ -716,18 +669,6 @@ } } - /** - * @returns {Promise<{signature: string, timestamp: number}>} - */ - addMatcherSign() { - return utils.signUserOrders({ - matcherSign: this.matcherSign - }).then(matcherSign => { - this.currentUser.matcherSign = matcherSign; - ds.app.addMatcherSign(matcherSign.timestamp, matcherSign.signature); - }); - } - /** * @private */ @@ -772,7 +713,6 @@ * @param {string} userData.hash * @param {string} [userData.id] * @param {string} [userData.publicKey] - * @param {string} [userData.matcherSign] * @param {object} [userData.settings] * @return {Promise} * @private @@ -786,7 +726,6 @@ publicKey: userData.publicKey, userType: userData.userType, settings: userData.settings, - matcherSign: userData.matcherSign, lastLogin: Date.now() }; @@ -805,12 +744,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}`)); }); @@ -819,14 +752,10 @@ ds.app.login(userData); - return this.addMatcherSign() - .catch(() => Promise.resolve()) - .then(() => { - this.changeTheme(this._settings.get('theme')); - this.changeCandle(); + this.changeTheme(this._settings.get('theme')); + this.changeCandle(); - return this.saveMultiAccountUser(this.currentUser, this.currentUser.hash); - }) + return this.saveMultiAccountUser(this.currentUser, this.currentUser.hash) .then(() => this._logoutTimer()) .then(() => this.updateScriptAccountData()) .then(() => this.loginSignal.dispatch()) @@ -951,5 +880,4 @@ * @property {string} userType * @property {number} lastLogin * @property {object} settings - * @property {object} matcherSign */ diff --git a/src/modules/app/services/waves/Waves.js b/src/modules/app/services/waves/Waves.js index 37a1440c56..47a57bc14c 100644 --- a/src/modules/app/services/waves/Waves.js +++ b/src/modules/app/services/waves/Waves.js @@ -3,12 +3,10 @@ /** * @param {Node} node - * @param {Matcher} matcher - * @param {WavesUtils} wavesUtils * @param {app.utils} utils * @return {Waves} */ - const factory = function (node, matcher, wavesUtils, utils) { + const factory = function (node, utils) { class Waves { @@ -17,14 +15,6 @@ * @type {Node} */ this.node = node; - /** - * @type {Matcher} - */ - this.matcher = matcher; - /** - * @type {WavesUtils} - */ - this.utils = wavesUtils; } } @@ -32,7 +22,7 @@ return utils.bind(new Waves()); }; - factory.$inject = ['node', 'matcher', 'wavesUtils', 'utils']; + factory.$inject = ['node', 'utils']; angular.module('app').factory('waves', factory); })(); diff --git a/src/modules/app/services/waves/WavesUtils.js b/src/modules/app/services/waves/WavesUtils.js deleted file mode 100644 index e66c00e9da..0000000000 --- a/src/modules/app/services/waves/WavesUtils.js +++ /dev/null @@ -1,344 +0,0 @@ -(function () { - 'use strict'; - - /** - * @param {Assets} assets - * @param {app.utils} utils - * @param {app.utils.decorators} decorators - * @param {Transactions} transactions - * @param {Matcher} matcher - * @return {WavesUtils} - */ - const factory = function (assets, utils, decorators, transactions, matcher) { - - const ds = require('data-service'); - const entities = require('@waves/data-entities'); - const { BigNumber } = require('@waves/bignumber'); - const { - flatten, pipe, map, - where, prop, gte, allPass, - lte, filter, length, equals, - __ - } = require('ramda'); - - class WavesUtils { - - @decorators.cachable(5) - searchAsset(userInput) { - return ds.fetch(`${WavesApp.network.api}/assets/search/${userInput}`); - } - - /** - * Get rate (now or from date) - * @param {string|Asset} assetFrom - * @param {string|Asset} assetTo - * @param {Date|number|Moment} [date] timestamp or Date - * @return {Promise} - */ - @decorators.cachable(350) - getRate(assetFrom, assetTo, date) { - const WavesId = WavesApp.defaultAssets.WAVES; - const from = WavesUtils.toId(assetFrom); - const to = WavesUtils.toId(assetTo); - - if (from === to) { - return Promise.resolve(new BigNumber(1)); - } - - if (date) { - // TODO Add rate by date API. Author Tsigel at 22/11/2017 15:04 - } else if (from === WavesId || to === WavesId) { - return this._getRate(from, to); - } else { - return utils.whenAll([ - this._getRate(from, WavesId), - this._getRate(to, WavesId) - ]) - .then(([rateFrom, rateTo]) => { - return rateTo.eq(0) ? rateTo : rateFrom.div(rateTo); - }); - } - } - - /** - * Get api for current balance from another balance - * @param {string|Asset} assetFrom - * @param {string|Asset} assetTo - * @return {Promise} - */ - getRateApi(assetFrom, assetTo) { - return utils.whenAll([ - assets.getAsset(WavesUtils.toId(assetFrom)), - assets.getAsset(WavesUtils.toId(assetTo)), - this.getRate(assetFrom, assetTo) - ]) - .then(([from, to, rate]) => { - return this._generateRateApi(from, to, rate); - }); - } - - /** - * @param {string|Asset} assetFrom - * @param {string|Asset} assetTo - * @param {Date|number|Moment} from - * @param {Date|number|Moment} [to] - * @return {Promise<{rate: BigNumber, timestamp: Date}[]>} - */ - @decorators.cachable(60) - getRateHistory(assetFrom, assetTo, from, to) { - const idFrom = WavesUtils.toId(assetFrom); - const idTo = WavesUtils.toId(assetTo); - const wavesId = WavesApp.defaultAssets.WAVES; - to = to || Date.now(); - - if (idFrom === idTo) { - return Promise.resolve([]); - } else if (idFrom === wavesId || idTo === wavesId) { - return this._getRateHistory(idFrom, idTo, utils.moment(from), utils.moment(to)); - } else { - return Promise.all([ - this._getRateHistory(idFrom, wavesId, utils.moment(from), utils.moment(to)), - this._getRateHistory(idTo, wavesId, utils.moment(from), utils.moment(to)) - ]) - .then(([from, to]) => { - const toHash = function (list) { - return list.reduce((result, item) => { - result[item.timestamp.valueOf()] = item; - return result; - }, Object.create(null)); - }; - - const hash = toHash(to); - - return from.reduce((result, item) => { - if (hash[item.timestamp.valueOf()]) { - item.rate = item.rate.div(hash[item.timestamp.valueOf()].rate); - result.push(item); - } - return result; - }, []); - }); - } - } - - /** - * @param {string|Asset} assetFrom - * @param {string|Asset} assetTo - * @return {Promise} - */ - @decorators.cachable(60) - getChange(assetFrom, assetTo) { - const idFrom = WavesUtils.toId(assetFrom); - const idTo = WavesUtils.toId(assetTo); - - if (idFrom === idTo) { - return Promise.resolve(new BigNumber(0)); - } - - return this._getChange(idFrom, idTo); - } - - /** - * @param pair - * @returns {Promise} - */ - getVolume(pair) { - return this._getVolume(pair, matcher.currentMatcherAddress); - } - - /** - * @param pair - * @param {string} currentMatcherAddress - * @returns {Promise} - */ - @decorators.cachable(60) - _getVolume(pair, currentMatcherAddress) { - return ds.api.pairs.info(currentMatcherAddress, [pair]) - .then((data) => { - const [pair = {}] = data.filter(Boolean); - return pair && String(pair.volume) || '0'; - }); - } - - /** - * @param {string} from - * @param {string} to - * @return {Promise} - * @private - */ - _getChange(from, to) { - const getChange = (open, close) => { - if (open.eq(0)) { - return new BigNumber(0); - } else { - return close.sub(open).div(open).mul(100).roundTo(2); - } - }; - - return ds.api.pairs.get(from, to) - .then(pair => ds.api.pairs.info(matcher.currentMatcherAddress, [pair]) - .then(([data]) => { - - if (!data || data.status === 'error') { - return 0; - } - - const open = data.firstPrice || new entities.Money(0, pair.priceAsset); - const close = data.lastPrice || new entities.Money(0, pair.priceAsset); - const change24 = Number(getChange(open.getTokens(), close.getTokens()).toFixed()); - - if (pair.amountAsset.id === from) { - return change24; - } else { - return -change24; - } - })) - .catch(() => 0); - } - - /** - * @param {string} fromId - * @param {string} toId - * @return {Promise} - * @private - */ - _getRate(fromId, toId) { - - const calculateCurrentRate = function (trades) { - return ( - trades - .reduce((result, item) => { - return result.add(new BigNumber(item.price.getTokens())); - }, new BigNumber(0)) - .div(trades.length) - ); - }; - - const currentRate = (trades) => { - return trades && trades.length ? calculateCurrentRate(trades) : new BigNumber(0); - }; - - return ds.api.pairs.get(fromId, toId) - .then((pair) => { - return transactions.getExchangeTxList({ - limit: 5, - amountAsset: pair.amountAsset, - priceAsset: pair.priceAsset - }) - .then(currentRate) - .then((rate) => { - if (fromId !== pair.priceAsset.id) { - return rate; - } else { - return rate.eq(0) ? rate : new BigNumber(1).div(rate); - } - }) - .catch(() => new BigNumber(0)); - }); - } - - /** - * @param {string} fromId - * @param {string} toId - * @param {Moment} from - * @param {Moment} to - * @return {Promise<{rate: BigNumber, timestamp: Date}[]>} - * @private - */ - _getRateHistory(fromId, toId, from, to) { - const formattedFrom = from.getDate().getTime(); - const formattedTo = to.getDate().getTime(); - - return ds.api.pairs.get(fromId, toId) - .then(pair => { - const amountId = pair.amountAsset.id; - const priceId = pair.priceAsset.id; - const dataService = ds.config.getDataService(); - const int = utils.getMaxInterval(formattedFrom, formattedTo); - const { options } = utils.getValidCandleOptions(formattedFrom, formattedTo, int); - /** - * @type {Array>>} - */ - const promises = options - .map(option => dataService.getCandles(amountId, priceId, option)); - - return Promise.all(promises) - .then(pipe(map(prop('data')), flatten)) - .then(map(item => ({ - close: item.close, - timestamp: new Date(item.time).getTime() - }))) - .then(filter(where({ - close: close => close.gt(0), - timestamp: allPass([gte(__, formattedFrom), lte(__, formattedTo)]) - }))) - .then(list => { - if (equals(length(list), 0)) { - return Promise.reject(new Error(`Nor found by pair ${pair}`)); - } - return list; - }) - .then(map(({ timestamp, close }) => ({ - timestamp: new Date(timestamp), - rate: fromId !== pair.priceAsset.id ? close : new BigNumber(1).div(close) - }))); - }); - } - - /** - * @param {Asset} from - * @param {Asset} to - * @param {BigNumber} rate - * @return {WavesUtils.rateApi} - * @private - */ - _generateRateApi(from, to, rate) { - return { - /** - * @name WavesUtils.rateApi#exchange - * @param {BigNumber} balance - * @return {BigNumber} - */ - exchange(balance) { - return balance.mul(rate.toFixed(8)) - .roundTo(to.precision); - }, - - /** - * @name WavesUtils.rateApi#exchangeReverse - * @param {BigNumber} balance - * @return {BigNumber} - */ - exchangeReverse(balance) { - return (rate ? balance.div(rate) : new BigNumber(0)).roundTo(from.precision); - }, - - /** - * @name WavesUtils.rateApi#rate - */ - rate - }; - } - - /** - * @param {string|Asset} asset - * @return {string} - */ - static toId(asset) { - return typeof asset === 'string' ? asset : asset.id; - } - - } - - return new WavesUtils(); - }; - - factory.$inject = ['assets', 'utils', 'decorators', 'transactions', 'matcher']; - - angular.module('app') - .factory('wavesUtils', factory); -})(); - -/** - * @name WavesUtils.rateApi - */ diff --git a/src/modules/app/services/waves/matcher/Matcher.js b/src/modules/app/services/waves/matcher/Matcher.js deleted file mode 100644 index 6a156c4aa8..0000000000 --- a/src/modules/app/services/waves/matcher/Matcher.js +++ /dev/null @@ -1,458 +0,0 @@ -(function () { - 'use strict'; - - const ds = require('data-service'); - const { Money } = require('@waves/data-entities'); - const { BigNumber } = require('@waves/bignumber'); - const { currentCreateOrderFactory } = require('@waves/signature-adapter'); - const { libs } = require('@waves/waves-transactions'); - const { address } = libs.crypto; - - /** - * @param {app.utils} utils - * @param {app.utils.decorators} decorators - * @param {User} user - * @param {PollCache} PollCache - * @param {ConfigService} configService - * @return {Matcher} - */ - const factory = function (utils, decorators, user, PollCache, configService) { - - /** - * @class - */ - class Matcher { - - /** - * @type {string} - */ - currentMatcherAddress = ''; - - constructor() { - this._orderBookCacheHash = Object.create(null); - - user.onLogin().then( - () => this._handleLogin(), - () => this._handleLogout() - ); - - this._updateCurrentMatcherAddress(); - } - - /** - * @param bids - * @param asks - * @param pair - * @returns {Promise} - * @private - */ - static _remapOrderBook({ bids, asks, pair }) { - return { - pair, - bids: Matcher._remapBidAsks(bids, pair), - asks: Matcher._remapBidAsks(asks, pair) - }; - } - - /** - * @param list - * @param pair - * @returns {Promise<(any[])[]>} - * @private - */ - static _remapBidAsks(list, pair) { - return (list || []).map((item) => { - const amount = item.amount.getTokens(); - const price = item.price.getTokens(); - const total = amount.mul(price); - - return { - amount: amount.toFixed(pair.amountAsset.precision), - price: price.toFixed(pair.priceAsset.precision), - total: total.toFixed(pair.priceAsset.precision) - }; - }); - } - - /** - * @param {Array} bids - * @param {Array} asks - * @returns {Matcher.ISpread} - * @private - */ - static _getSpread(bids, asks) { - const [lastAsk] = asks; - const [firstBid] = bids; - const sell = new BigNumber(firstBid && firstBid.price); - const buy = new BigNumber(lastAsk && lastAsk.price); - const percent = (buy.gt(0)) ? buy.sub(sell).mul(100).div(buy) : new BigNumber(0); - - return firstBid && lastAsk && { - lastAsk, - firstBid, - buy, - sell, - percent - } || null; - } - - /** - * @param options - * @return {Promise>} - */ - getOrders(options) { - return this._getOrders(options, user.address); - } - - /** - * @param {AssetPair} pair - * @return {Promise<{price: Money, lastSide: string}r>} - */ - @decorators.cachable(0.5) - getLastPrice(pair) { - return ds.api.matcher.getLastPrice(pair); - } - - /** - * @param {string} address - * @return {Promise>} - */ - @decorators.cachable(2) - _scriptInfo(address) { - return ds.api.address.getScriptInfo(address); - } - - /** - * @param order - * @return {Promise} - */ - getCreateOrderFee(order) { - const config = configService.getFeeConfig(); - return this.getMinOrderFee() - .then(minFee => { - const currentFee = currentCreateOrderFactory(config, minFee); - const matcherAddress = address({ publicKey: order.matcherPublicKey }, WavesApp.network.code); - - return Promise.all([ - this._scriptInfo(matcherAddress), - ds.api.assets.get('WAVES') - ]).then(([info, asset]) => ({ - asset, - hasScript: info.extraFee.getTokens().gt(0), - currentFee - })); - }) - .then(({ hasScript, currentFee, asset }) => { - const smartAssetIdList = [order.amount.asset, order.price.asset] - .filter(asset => asset.hasScript) - .map(asset => asset.id); - const fee = currentFee({ - assetPair: { - amountAsset: order.amount.asset.id, - priceAsset: order.price.asset.id - }, - matcherPublicKey: order.matcherPublicKey - }, hasScript, smartAssetIdList); - return new Money(fee, asset); - }); - } - - /** - * @param {object} order - * @return {object} - */ - calculateCustomFeeMap(order) { - const smartAssetExtraFee = new BigNumber(configService.getFeeConfig().smart_asset_extra_fee); - const baseFee = new BigNumber(order.baseFee); - const hasScript = order.matcherInfo.extraFee.getTokens().gt(0); - const smartPairAssets = [order.pair.amountAsset, order.pair.priceAsset] - .filter(asset => asset.hasScript); - - const getSmartAssetsQuantity = (feeAsset) => { - const feeIsSmartAndNotInPair = - feeAsset.hasScript && - (smartPairAssets.some(asset => asset.id === feeAsset.id)); - return smartPairAssets.length + Number(feeIsSmartAndNotInPair); - }; - - const feeMap = order.feeAssets.reduce((acc, asset) => { - acc[asset.id] = baseFee - .add(smartAssetExtraFee.mul(getSmartAssetsQuantity(asset))) - .add(smartAssetExtraFee.mul(Number(hasScript))); - return acc; - }, Object.create(null)); - - return feeMap; - - // const feeMap = order.feeAssets.reduce((acc, asset) => { - // acc[asset.id] = baseFee.add(smartAssetExtraFee * getSmartAssetsQuantity(asset)); - // return acc; - // }, Object.create(null)); - // - // return feeMap; - } - - /** - * @return {Promise} - */ - getMinOrderFee() { - return Promise.resolve(new BigNumber(300000)); - } - - /** - * @param {string} asset1 - * @param {string} asset2 - * @return {Promise} - */ - getOrderBook(asset1, asset2) { - return this._getOrderBookCache(asset1, asset2).get(); - } - - /** - * @return {Promise} - */ - @decorators.cachable(5) - getFeeRates() { - return ds.api.matcher.getFeeRates(); - } - - /** - * @return {Promise} - */ - getSettings() { - return ds.api.matcher.getSettings(); - } - - /** - * @param pair - * @param matcherPublicKey - * @return {Promise} - */ - getCreateOrderSettings(pair, matcherPublicKey) { - return this.getSettings() - .then(data => { - const matcherPublicKeyBytes = libs.crypto.base58Decode(matcherPublicKey); - const matcherAddress = libs.crypto.address( - { - publicKey: matcherPublicKeyBytes - }, - ds.config.get('code')); - - if (data.orderFee.dynamic) { - return Promise.all([ - this._scriptInfo(matcherAddress), - ...Object.keys(data.orderFee.dynamic.rates).map(id => ds.api.assets.get(id)) - ]).then(([matcherInfo, ...feeAssets]) => { - if (!feeAssets.length) { - throw new Error('Fee list is empty'); - } - return ({ - basedCustomFee: this.calculateCustomFeeMap({ - pair, - matcherInfo, - feeAssets, - baseFee: data.orderFee.dynamic.baseFee - }), - feeMode: 'dynamic' - }); - }); - } else if (data.orderFee.fixed) { - const feeValue = data.orderFee.fixed['min-fee']; - const feeAsset = data.orderFee.fixed.asset; - return ({ - fee: new Money(feeValue, feeAsset), - feeMode: 'fixed' - }); - } - - throw new Error('Matcher settings are incorrect'); - }) - .catch(() => { - return this.getCreateOrderFee({ - amount: new Money(0, pair.amountAsset), - price: new Money(0, pair.priceAsset), - matcherPublicKey - }).then(fee => { - return ({ - feeMode: 'waves', - fee: fee - }); - }); - }); - } - - /** - * @param {any} [options] - * @param {string} [address] - * @return {Promise>} - * @private - */ - @decorators.cachable(1) - _getOrders(options, address) { - if (address) { - return ds.api.matcher.getOrders(options).then(ds.processOrdersWithStore); - } else { - return Promise.resolve([]); - } - } - - /** - * @param {string} asset1 - * @param {string} asset2 - * @return {Promise<{bids, asks, pair: IAssetPair, spread: {amount: string, price: string, total: string}}>} - * @private - */ - _getOrderBook(asset1, asset2) { - return ds.api.matcher.getOrderBook(asset1, asset2) - .then((orderBook) => Matcher._remapOrderBook(orderBook)) - .then(({ bids, asks, pair }) => ({ - bids, - asks, - pair, - spread: Matcher._getSpread(bids, asks, pair) - })); - } - - /** - * @param {string} asset1 - * @param {string} asset2 - * @return {PollCache} - * @private - */ - _getOrderBookCache(asset1, asset2) { - const hash = this._orderBookCacheHash; - const id = [asset1, asset2].sort(utils.comparators.asc).join('-'); - if (hash[id]) { - clearTimeout(hash[id].timer); - hash[id].timer = setTimeout(() => { - hash[id].cache.destroy(); - delete hash[id]; - }, 2000); - return hash[id].cache; - } else { - hash[id] = { - timer: setTimeout(() => { - hash[id].cache.destroy(); - delete hash[id]; - }, 2000), - cache: new PollCache({ - getData: () => this._getOrderBook(asset1, asset2), - timeout: 1000 - }) - }; - return hash[id].cache; - } - } - - /** - * @private - */ - _updateCurrentMatcherAddress() { - const networkMatcher = user.getSetting('network.matcher'); - - ds.fetch(networkMatcher).then(matcherPublicKey => { - if (matcherPublicKey) { - const matcherPublicKeyBytes = libs.crypto.base58Decode(matcherPublicKey); - const matcherAddress = libs.crypto.address( - { - publicKey: matcherPublicKeyBytes - }, - ds.config.get('code')); - - this.currentMatcherAddress = matcherAddress; - } - }); - } - - /** - * @private - */ - _handleLogin() { - user.changeSetting.on(this._onUserChangeSetting, this); - user.logoutSignal.once(this._handleLogout, this); - } - - /** - * @private - */ - _handleLogout() { - user.changeSetting.off(this._onUserChangeSetting); - user.loginSignal.once(this._handleLogin, this); - } - - _onUserChangeSetting(path) { - if (path === 'network.matcher') { - this._updateCurrentMatcherAddress(); - } - } - - } - - return new Matcher(); - }; - - factory.$inject = ['utils', 'decorators', 'user', 'PollCache', 'configService']; - - angular.module('app').factory('matcher', factory); -})(); - -/** - * @name Matcher - */ - -/** - * @typedef {object} Matcher#IOrderApi - * @property {string} price - * @property {string} amount - */ - -/** - * @typedef {object} Matcher#IOrder - * @property {string} price - * @property {string} amount - * @property {string} total - */ - -/** - * @typedef {object} Matcher#IPair - * @property {string} priceAsset - * @property {string} amountAsset - */ - -/** - * @typedef {object} Matcher#ISpread - * @property {Matcher.IOrderApi} lastAsk - * @property {Matcher.IOrderApi} firstBid - * @property {BigNumber} buy - * @property {BigNumber} sell - * @property {BigNumber} percent - */ - -/** - * @typedef {object} Matcher#IOrderBookResult - * @property {Array} asks - * @property {Array} bids - * @property {Matcher.IPair} pair - * @property {Matcher.ISpread} spread - * @property {number} timestamp - */ - -/** - * @typedef {object} Matcher#IOrder - * @property {string} id - * @property {IAssetPair} assetPair - * @property {Money} filled - * @property {boolean} isActive - * @property {string} pair - * @property {BigNumber} percent - * @property {Money} price - * @property {string} state - * @property {string} status - * @property {Money} total - * @property {string} type - */ - -/** - * @typedef {object} Matcher#IFeeMap - * @property {number} - */ diff --git a/src/modules/app/services/waves/node/content/Assets.js b/src/modules/app/services/waves/node/content/Assets.js index 0059f6d32c..f0f4ddd038 100644 --- a/src/modules/app/services/waves/node/content/Assets.js +++ b/src/modules/app/services/waves/node/content/Assets.js @@ -13,7 +13,7 @@ * @param {IPollCreate} createPoll * @return {Assets} */ - const factory = function (BaseNodeComponent, utils, user, decorators, createPoll) { + const factory = function (BaseNodeComponent, utils, user, decorators) { class Assets extends BaseNodeComponent { @@ -146,23 +146,15 @@ * @return {Promise} */ userBalances() { - return ds.dataManager.getBalances(); + return Promise.resolve([]); } giveMyScamBack() { user.scam = Object.create(null); - if (this._pollScam) { - this._pollScam.destroy(); - this._pollScam = null; - } } giveMyTokensNameBack() { user.tokensName = Object.create(null); - if (this._pollTokensNames) { - this._pollTokensNames.destroy(); - this._pollTokensNames = null; - } } stopScam() { @@ -170,7 +162,6 @@ * @type {Poll} * @private */ - this._pollScam = createPoll(this, this._getScamAssetList, this._setScamAssetList, 15000); } tokensNameList() { @@ -178,32 +169,8 @@ * @type {Poll} * @private */ - this._pollTokensNames = createPoll( - this, - this._getTokensNameList, - hash => user.setTokensNameList(hash), - 20000 - ); } - /** - * @return {Promise>} - * @private - */ - _getTokensNameList() { - return ds.fetch(`${user.getSetting('tokensNameListUrl')}?${WavesApp.version}-${Date.now()}`) - .then((text) => { - const papa = require('papaparse'); - const hash = Object.create(null); - papa.parse(text).data.forEach(([id]) => { - if (id) { - hash[id] = true; - } - }); - return hash; - }) - .catch(() => Object.create(null)); - } /** * @private @@ -272,8 +239,7 @@ 'BaseNodeComponent', 'utils', 'user', - 'decorators', - 'createPoll' + 'decorators' ]; angular.module('app') diff --git a/src/modules/app/services/waves/node/content/Transactions.js b/src/modules/app/services/waves/node/content/Transactions.js index a79d904d0e..bcc6bcc6e5 100644 --- a/src/modules/app/services/waves/node/content/Transactions.js +++ b/src/modules/app/services/waves/node/content/Transactions.js @@ -7,10 +7,9 @@ * @param {Aliases} aliases * @param {app.utils.decorators} decorators * @param {BaseNodeComponent} BaseNodeComponent - * @param {Matcher} matcher * @return {Transactions} */ - const factory = function (user, utils, aliases, decorators, BaseNodeComponent, matcher) { + const factory = function (user, utils, aliases, decorators, BaseNodeComponent) { const tsUtils = require('ts-utils'); const R = require('ramda'); @@ -103,18 +102,6 @@ .then(([utxTxList, txList]) => utxTxList.concat(txList)); } - /** - * @param {ExchangeTxFilters} prams - * @param {IGetExchangeOptions} [options] - * @returns {Promise} - */ - getExchangeTxList(prams, options) { - return ds.api.transactions.getExchangeTxList({ - matcher: matcher.currentMatcherAddress, - ...prams - }, options); - } - createTransaction(txData) { const tx = { sender: user.address, @@ -298,7 +285,7 @@ return utils.bind(new Transactions()); }; - factory.$inject = ['user', 'utils', 'aliases', 'decorators', 'BaseNodeComponent', 'matcher']; + factory.$inject = ['user', 'utils', 'aliases', 'decorators', 'BaseNodeComponent']; angular.module('app') .factory('transactions', factory); 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/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 @@ - -
- -
-
-
- -
- -

- -
- -
- - -
- - - - -
-
-
-
- - diff --git a/src/modules/desktopUpdate/controllers/DesktopUpdateCtrl.js b/src/modules/desktopUpdate/controllers/DesktopUpdateCtrl.js index 481f4e308a..e0143d8a1e 100644 --- a/src/modules/desktopUpdate/controllers/DesktopUpdateCtrl.js +++ b/src/modules/desktopUpdate/controllers/DesktopUpdateCtrl.js @@ -14,6 +14,7 @@ * @param {*} configService * @param {*} modalManager * @param {*} multiAccount + * @param {Base} Base */ const controller = ( $scope, @@ -25,9 +26,10 @@ user, utils, modalManager, - multiAccount + multiAccount, + Base ) => { - class DesktopUpdateCtrl { + class DesktopUpdateCtrl extends Base { /** * @type {'askDownload' | 'downloading' | 'installAndRun' | 'success' | 'fail' } @@ -42,34 +44,40 @@ signInForm = null; password = ''; showPasswordError = false; - isOldDesktop = false; hasUserList = false; _isCanceled = null; _showSteps = false; _timer = 10; downloadDone = false; + hasAccount = false; constructor() { + super(); if (!WavesApp.isDesktop()) { $state.go(user.getActiveState('wallet')); } - this.isOldDesktop = utils.isVersionLte('1.4.0'); - this._showMoving = !this.isOldDesktop; - - storage.load('userList').then(list => { - if (list && list.length > 0) { - this.hasUserList = true; - } - }); - Promise.all([ user.getMultiAccountData(), - user.getMultiAccountHash() - ]).then(([multiAccountData, multiAccountHash]) => { + user.getMultiAccountHash(), + user.getFilteredUserList() + ]).then(([multiAccountData, multiAccountHash, userList]) => { this.multiAccountData = multiAccountData; this.multiAccountHash = multiAccountHash; this.hasMultiAccount = !!multiAccountData; + if (userList && userList.length > 0) { + this.hasUserList = true; + } + this.hasAccount = this.hasMultiAccount || this.hasUserList; + + if (!this.hasAccount) { + this.download(); + this.observe('state', () => { + if (this.state !== 'downloading') { + $state.go('welcome'); + } + }); + } }); } @@ -88,7 +96,7 @@ exportStorageService.export({ provider: connectProvider, attempts: 1000, - timeout: 1500 + timeout: 6000 }); exportStorageService.onData().then(result => { @@ -126,9 +134,7 @@ this.password, undefined, this.multiAccountHash - ).then(() => { - this.toMigration(); - }).catch(() => { + ).catch(() => { this.password = ''; this.showPasswordError = true; }); @@ -213,11 +219,7 @@ } toHome() { - $state.go(user.getActiveState('wallet')); - } - - toMigration() { - this._showMoving = true; + $state.go('welcome'); } _toInstallAndRun() { @@ -280,12 +282,18 @@ ds.utils.abortDownloading(); } + cancelDownloadAndGoWelcome() { + this.cancelDownload(); + $state.go('welcome'); + } + showFAQ() { modalManager.showMigrateFAQ(); } _decreaseTimer() { this._timer = this._timer - 1; + $scope.$apply(); } // @TODO сделать плюризацию @@ -317,7 +325,8 @@ 'user', 'utils', 'modalManager', - 'multiAccount' + 'multiAccount', + 'Base' ]; angular.module('app.desktopUpdate').controller('DesktopUpdateCtrl', controller); diff --git a/src/modules/desktopUpdate/less/desktopUpdate.less b/src/modules/desktopUpdate/less/desktopUpdate.less index 7e8d3384d9..aa01bd4f0e 100644 --- a/src/modules/desktopUpdate/less/desktopUpdate.less +++ b/src/modules/desktopUpdate/less/desktopUpdate.less @@ -326,11 +326,3 @@ margin: auto; font-size: 12px; } - -//.warning-timer + .ui-view { -// height: 100%; -//} -// -//body.desktop:not(.web) .main-container { -// min-height: 100%; -//} diff --git a/src/modules/desktopUpdate/less/electron.less b/src/modules/desktopUpdate/less/electron.less new file mode 100644 index 0000000000..0f14aa4819 --- /dev/null +++ b/src/modules/desktopUpdate/less/electron.less @@ -0,0 +1,214 @@ +@import (reference) 'config'; +@import (reference) "icons"; +@import (reference) '../../app/less/typography'; + + +body.desktop:not(.web) { + w-web-only { + &:empty { + display: none; + } + } + + .dexw-locked { + background: @color-white; + padding: 20px 0; + + &_authorised { + background: transparent; + } + } + + .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; + justify-content: space-between; + padding: 12px; + 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_no-authorised { + background: @color-white; + } + } + + a.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; + background: @color-white; + + @media screen and (max-height: 768px) { + min-height: 700px; + } + } + } +} \ No newline at end of file diff --git a/src/modules/desktopUpdate/templates/desktopUpdate.html b/src/modules/desktopUpdate/templates/desktopUpdate.html index f8d6a6e815..fd8b6ff55e 100644 --- a/src/modules/desktopUpdate/templates/desktopUpdate.html +++ b/src/modules/desktopUpdate/templates/desktopUpdate.html @@ -3,7 +3,11 @@