From 73ad62af8ddfe8e2803f25160ac73f1ad034c90d Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 17 Jun 2019 18:29:46 +0300 Subject: [PATCH 1/5] DEXW-1792: pin fake ergo asset --- data-service/classes/DataManager.ts | 13 +++++++++++++ .../waves-client-config/master/testnet.config.json | 5 ++++- src/index.hbs | 3 ++- src/modules/app/services/DefaultSettings.js | 3 ++- .../ui/directives/assetStatus/AssetStatus.js | 2 ++ .../ui/directives/assetStatus/asset-status.html | 4 ++++ src/modules/utils/services/utils.js | 7 ++++++- .../directives/portfolioRow/PortfolioRow.js | 3 ++- .../portfolio/directives/portfolioRow/row.hbs | 3 +++ ts-scripts/meta.json | 3 ++- 10 files changed, 40 insertions(+), 6 deletions(-) diff --git a/data-service/classes/DataManager.ts b/data-service/classes/DataManager.ts index 257973389e..2cd8a00938 100644 --- a/data-service/classes/DataManager.ts +++ b/data-service/classes/DataManager.ts @@ -79,8 +79,12 @@ export class DataManager { [WavesApp.defaultAssets.DASH]: true, [WavesApp.defaultAssets.XMR]: true, [WavesApp.defaultAssets.VST]: true, + [WavesApp.defaultAssets.ERGO]: true, }; + const gatewaysSoon = (window as any).angular + .element(document.body).injector().get('configService').get('GATEWAYS_SOON') || []; + const descriptionHash = { WAVES: { en: 'Waves is a blockchain ecosystem that offers comprehensive and effective blockchain-based tools for businesses, individuals and developers. Waves Platform offers unprecedented throughput and flexibility. Features include the LPoS consensus algorithm, Waves-NG protocol and advanced smart contract functionality.' } }; @@ -97,10 +101,19 @@ export class DataManager { description: descriptionHash[id] }; + const gatewaySoonAsset = { + ...gatewayAsset, + status: 4 + }; + if (id === 'WAVES') { return { status: STATUS_LIST.VERIFIED, description: descriptionHash.WAVES } as any; } + if (gatewaysSoon.indexOf(id) > -1) { + return gatewaySoonAsset; + } + if (gateways[id]) { return gatewayAsset; } diff --git a/mocks/waves-client-config/master/testnet.config.json b/mocks/waves-client-config/master/testnet.config.json index 105975942c..45e40d26ae 100644 --- a/mocks/waves-client-config/master/testnet.config.json +++ b/mocks/waves-client-config/master/testnet.config.json @@ -51,5 +51,8 @@ ] } }, - "SERVICE_TEMPORARILY_UNAVAILABLE": false + "SERVICE_TEMPORARILY_UNAVAILABLE": false, + "GATEWAYS_SOON": [ + "HqUijJNisUUoSNqUTggHrqUzbB3CBZMP47kevjx4zGCd" + ] } diff --git a/src/index.hbs b/src/index.hbs index c6fbd69687..84f5356aef 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -354,7 +354,8 @@ DASH: config.network.assets.DASH, TRY: config.network.assets.TRY, XMR: config.network.assets.XMR, - VST: config.network.assets.VST + VST: config.network.assets.VST, + ERGO: config.network.assets.ERGO }, ALWAYS_PINNED_ASSETS: ['WAVES'], diff --git a/src/modules/app/services/DefaultSettings.js b/src/modules/app/services/DefaultSettings.js index f5f7a18fca..91b7efd308 100644 --- a/src/modules/app/services/DefaultSettings.js +++ b/src/modules/app/services/DefaultSettings.js @@ -63,7 +63,8 @@ WavesApp.defaultAssets.TRY, WavesApp.defaultAssets.DASH, WavesApp.defaultAssets.XMR, - WavesApp.defaultAssets.VST + WavesApp.defaultAssets.VST, + WavesApp.defaultAssets.ERGO ], wallet: { activeState: 'assets', diff --git a/src/modules/ui/directives/assetStatus/AssetStatus.js b/src/modules/ui/directives/assetStatus/AssetStatus.js index ef398bc28b..7bac0e59a1 100644 --- a/src/modules/ui/directives/assetStatus/AssetStatus.js +++ b/src/modules/ui/directives/assetStatus/AssetStatus.js @@ -35,12 +35,14 @@ isGateway, isTokenomica, isSuspicious, + isGatewaySoon, hasLabel } = utils.getDataFromOracles(this.assetId); this.isGateway = isGateway; this.isTokenomica = isGateway ? false : isTokenomica; this.isVerified = isTokenomica ? false : isVerified; this.isSuspicious = isVerified ? false : isSuspicious; + this.isGatewaySoon = isGateway ? false : isGatewaySoon; this.hasLabel = hasLabel; // TODO: delete after contest diff --git a/src/modules/ui/directives/assetStatus/asset-status.html b/src/modules/ui/directives/assetStatus/asset-status.html index 23f92de8b5..e73c734f29 100644 --- a/src/modules/ui/directives/assetStatus/asset-status.html +++ b/src/modules/ui/directives/assetStatus/asset-status.html @@ -19,3 +19,7 @@ class="status-label-min warning" w-i18n-ns="app.utils" w-i18n="modal.assetInfo.contest"> + diff --git a/src/modules/utils/services/utils.js b/src/modules/utils/services/utils.js index c0a3a2a326..4fc9e51628 100644 --- a/src/modules/utils/services/utils.js +++ b/src/modules/utils/services/utils.js @@ -66,6 +66,7 @@ [WavesApp.defaultAssets.TRY]: '/img/assets/try.svg', [WavesApp.defaultAssets.XMR]: '/img/assets/xmr.svg', [WavesApp.defaultAssets.VST]: '/img/assets/vostok.svg', + [WavesApp.defaultAssets.ERGO]: '/img/assets/vostok.svg', [WavesApp.otherAssetsWithIcons.EFYT]: '/img/assets/efyt.svg', [WavesApp.otherAssetsWithIcons.WNET]: '/img/assets/wnet.svg' }); @@ -1161,7 +1162,10 @@ path(['provider'], dataOracle) !== 'Tokenomica'; const isSuspicious = user.scam[assetId]; - const hasLabel = isVerified || isGateway || isSuspicious || isTokenomica; + + const isGatewaySoon = path(['status'], dataOracle) === 4; + + const hasLabel = isVerified || isGateway || isSuspicious || isTokenomica || isGatewaySoon; const ticker = path(['ticker'], dataOracle); const link = path(['link'], dataOracle); @@ -1175,6 +1179,7 @@ isGateway, isTokenomica, isSuspicious, + isGatewaySoon, hasLabel, ticker, link, diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js b/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js index 7155d71435..3ac0ecc3c0 100644 --- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js +++ b/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js @@ -190,7 +190,7 @@ const firstAssetChar = this.balance.asset.name.slice(0, 1); const canPayFee = list.find(item => item.asset.id === this.balance.asset.id) && !this._isWaves; const { isVerified, isGateway, - isTokenomica, logo } = utils.getDataFromOracles(this.balance.asset.id); + isTokenomica, logo, isGatewaySoon } = utils.getDataFromOracles(this.balance.asset.id); this.isVerifiedOrGateway = isVerified || isGateway; @@ -200,6 +200,7 @@ isVerified: isVerified, isGateway: isGateway, isTokenomica: isTokenomica, + isGatewaySoon: isGatewaySoon, assetIconPath: logo || this.utils.getAssetLogo(this.balance.asset.id) || CONTEST_ASSET_ID_MAP[this.balance.asset.id], diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs b/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs index d196585b47..99cf40ac33 100644 --- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs +++ b/src/modules/wallet/modules/portfolio/directives/portfolioRow/row.hbs @@ -22,6 +22,9 @@ {{#if isTokenomica}} {{/if}} + {{#if isGatewaySoon}} + + {{/if}} diff --git a/ts-scripts/meta.json b/ts-scripts/meta.json index 8a75bdee46..e847cb0bb7 100644 --- a/ts-scripts/meta.json +++ b/ts-scripts/meta.json @@ -238,7 +238,8 @@ "EFYT": "FvKx3cerSVYGfXKFvUgp7koNuTAcLs8DmtmwRrFVCqJv", "WNET": "3P8gkhcLhFQvBkDzMnWeqqwvq3qxkpTNQPs4LUQ95tKD", "XMR": "8oPbSCKFHkXBy1hCGSg9pJkSARE7zhTQTLpc8KZwdtr7", - "VST": "63QkN8KKRMVBpkCM7azV6HiPacJ3T7EP6vmFUNVRsvAX" + "VST": "63QkN8KKRMVBpkCM7azV6HiPacJ3T7EP6vmFUNVRsvAX", + "ERGO": "HqUijJNisUUoSNqUTggHrqUzbB3CBZMP47kevjx4zGCd" } }, "mainnet": { From 373d21638c6e41282b8cb9f590d468d7772384f4 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 19 Jun 2019 10:46:30 +0300 Subject: [PATCH 2/5] DEXW-1792: add ergo assetId --- mocks/waves-client-config/master/config.json | 5 ++++- ts-scripts/meta.json | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mocks/waves-client-config/master/config.json b/mocks/waves-client-config/master/config.json index 315ac896e2..a5cdf8a89b 100644 --- a/mocks/waves-client-config/master/config.json +++ b/mocks/waves-client-config/master/config.json @@ -73,5 +73,8 @@ ] } }, - "SERVICE_TEMPORARILY_UNAVAILABLE": false + "SERVICE_TEMPORARILY_UNAVAILABLE": false, + "GATEWAYS_SOON": [ + "5dJj4Hn9t2Ve3tRpNGirUHy4yBK6qdJRAJYV21yPPuGz" + ] } diff --git a/ts-scripts/meta.json b/ts-scripts/meta.json index c1f7476d94..ac764e132a 100644 --- a/ts-scripts/meta.json +++ b/ts-scripts/meta.json @@ -298,7 +298,8 @@ "EFYT": "725Yv9oceWsB4GsYwyy4A52kEwyVrL5avubkeChSnL46", "WNET": "AxAmJaro7BJ4KasYiZhw7HkjwgYtt2nekPuF2CN9LMym", "XMR": "5WvPKSJXzVE2orvbkJ8wsQmmQKqTv9sGBPksV4adViw3", - "VST": "4LHHvYGNKJUg5hj65aGD5vgScvCBmLpdRFtjokvCjSL8" + "VST": "4LHHvYGNKJUg5hj65aGD5vgScvCBmLpdRFtjokvCjSL8", + "ERGO": "5dJj4Hn9t2Ve3tRpNGirUHy4yBK6qdJRAJYV21yPPuGz" } } } From 576f52afbbfd5f93a62dd2081d8788e4deb4163f Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 19 Jun 2019 11:36:35 +0300 Subject: [PATCH 3/5] DEXW-1792: add ergo logo --- src/img/assets/ergo.svg | 9 +++++++++ src/modules/utils/services/utils.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/img/assets/ergo.svg diff --git a/src/img/assets/ergo.svg b/src/img/assets/ergo.svg new file mode 100644 index 0000000000..c8909b94fa --- /dev/null +++ b/src/img/assets/ergo.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/modules/utils/services/utils.js b/src/modules/utils/services/utils.js index 4fc9e51628..e8f67a316d 100644 --- a/src/modules/utils/services/utils.js +++ b/src/modules/utils/services/utils.js @@ -66,7 +66,7 @@ [WavesApp.defaultAssets.TRY]: '/img/assets/try.svg', [WavesApp.defaultAssets.XMR]: '/img/assets/xmr.svg', [WavesApp.defaultAssets.VST]: '/img/assets/vostok.svg', - [WavesApp.defaultAssets.ERGO]: '/img/assets/vostok.svg', + [WavesApp.defaultAssets.ERGO]: '/img/assets/ergo.svg', [WavesApp.otherAssetsWithIcons.EFYT]: '/img/assets/efyt.svg', [WavesApp.otherAssetsWithIcons.WNET]: '/img/assets/wnet.svg' }); From f4ab41bf4bbbdf118be73714ec68e65a6b13a609 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 19 Jun 2019 11:54:40 +0300 Subject: [PATCH 4/5] DEXW-1792: change ergo logo --- src/img/assets/ergo.svg | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/img/assets/ergo.svg b/src/img/assets/ergo.svg index c8909b94fa..010b09446c 100644 --- a/src/img/assets/ergo.svg +++ b/src/img/assets/ergo.svg @@ -1,9 +1,13 @@ - - - - - + + + + + + + + + From ed025e775d216488ad183a966feb72c674d36e65 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 19 Jun 2019 12:36:13 +0300 Subject: [PATCH 5/5] DEXW-1792: add testnet ergo assetId --- mocks/waves-client-config/master/testnet.config.json | 2 +- ts-scripts/meta.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mocks/waves-client-config/master/testnet.config.json b/mocks/waves-client-config/master/testnet.config.json index 45e40d26ae..4f31c50ca2 100644 --- a/mocks/waves-client-config/master/testnet.config.json +++ b/mocks/waves-client-config/master/testnet.config.json @@ -53,6 +53,6 @@ }, "SERVICE_TEMPORARILY_UNAVAILABLE": false, "GATEWAYS_SOON": [ - "HqUijJNisUUoSNqUTggHrqUzbB3CBZMP47kevjx4zGCd" + "GVWSgVsmEx4KTAZPm31JZDmdehxFTFZBuy7V8gzb8JxE" ] } diff --git a/ts-scripts/meta.json b/ts-scripts/meta.json index a451b91610..885650b554 100644 --- a/ts-scripts/meta.json +++ b/ts-scripts/meta.json @@ -251,7 +251,7 @@ "WNET": "3P8gkhcLhFQvBkDzMnWeqqwvq3qxkpTNQPs4LUQ95tKD", "XMR": "8oPbSCKFHkXBy1hCGSg9pJkSARE7zhTQTLpc8KZwdtr7", "VST": "63QkN8KKRMVBpkCM7azV6HiPacJ3T7EP6vmFUNVRsvAX", - "ERGO": "HqUijJNisUUoSNqUTggHrqUzbB3CBZMP47kevjx4zGCd" + "ERGO": "GVWSgVsmEx4KTAZPm31JZDmdehxFTFZBuy7V8gzb8JxE" } }, "mainnet": {