diff --git a/config.xml b/config.xml index 857cb4a30..72534e01f 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + Base æpp aeternity developers diff --git a/package-lock.json b/package-lock.json index e548b4427..40c9c767d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "aepp-base", - "version": "0.10.0", + "version": "0.10.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8274f232c..3f801279c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aepp-base", - "version": "0.10.0", + "version": "0.10.1", "author": "Sascha Hanse ", "private": true, "scripts": { diff --git a/src/assets/onboarding/aepps.svg b/src/assets/onboarding/aepps.svg index 495da333e..64797edad 100644 --- a/src/assets/onboarding/aepps.svg +++ b/src/assets/onboarding/aepps.svg @@ -1,8 +1,8 @@ - - - 73210F5E-DCBD-4259-B44D-227DCAD4B04A - Created with sketchtool. + + + Group 9 + Created with Sketch. @@ -32,57 +32,33 @@ - - Tys - ing - + - - Tys - ing - + - - Tys - ing - + - - Tys - ing - + - - Tys - ing - - - Tys - ing - + + - + - - Tys - ing - + - + - + - - Tys - ing - + @@ -102,38 +78,23 @@ - - oming - - - Tys - oming - + + - - oming - - - Tys - oming - + + - - oming - - - Tys - oming - + + - - + + - - æpp url + + æpp url diff --git a/src/assets/onboarding/phones.svg b/src/assets/onboarding/phones.svg index 57e0ede6d..3b227216d 100644 --- a/src/assets/onboarding/phones.svg +++ b/src/assets/onboarding/phones.svg @@ -1,75 +1,81 @@ - + + + + Group 10 + Created with Sketch. - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - - - Tycesom ing - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + æpp url + - - - - - - oming - - - Tys oming - - - - oming - - - Tys oming - - - - oming - - - Tys oming - - - - - - - - æpp url - diff --git a/src/assets/onboarding/send.svg b/src/assets/onboarding/send.svg index 3818ff6a5..18b0ea457 100644 --- a/src/assets/onboarding/send.svg +++ b/src/assets/onboarding/send.svg @@ -1,119 +1,138 @@ - + + + + Group 3 + Created with Sketch. - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - ··· ··· ··· ··· ··· ··· Q8R cgH P1e - - - - - Daily Account - - - Tn g - - - Tn g - - - - - - - ··· ··· ··· ··· ··· ··· Q8R cgH P1e - - - - - Vault Account - - - Tn g - - - Tn g - - - - - - - ··· ··· ··· ··· ··· ··· Q8R cgH P1e - - - - - Governance Account - - - Tn g - - - Tn g - - - - - - - - - Main Account - - - Tn g - - - Tn g - - - - - + + + + + + + + + + + + + + ··· ··· + ··· + ··· ··· + ··· + Q8R cgH + P1e + + + + + + + Tn + g + + + + + + + + + ··· ··· + ··· + ··· ··· + ··· + Q8R cgH + P1e + + + + + + + Tn + g + + + + + + + + + ··· ··· + ··· + ··· ··· + ··· + Q8R cgH + P1e + + + + + + + Tn + g + + + + + + + + + + + + + Tn + g + + + + + + + diff --git a/src/assets/onboarding/subaccounts.svg b/src/assets/onboarding/subaccounts.svg index 140559993..8225fe29b 100644 --- a/src/assets/onboarding/subaccounts.svg +++ b/src/assets/onboarding/subaccounts.svg @@ -1,80 +1,118 @@ - + + + + Group 10 + Created with Sketch. - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - - - Tycesom ing - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Daily Account + + + Vault Account + + + Governace Account + + + Main Account + + + + + + + + + + + + + diff --git a/src/components/ListItemTransaction.vue b/src/components/ListItemTransaction.vue index 5e463df22..1318caf86 100644 --- a/src/components/ListItemTransaction.vue +++ b/src/components/ListItemTransaction.vue @@ -46,12 +46,11 @@ export default { time: { type: Date, default: null }, peerId: { type: String, default: '' }, tx: { type: Object, required: true }, - type: { type: String, required: true }, convertedAmount: { type: String, default: '' }, }, computed: mapState('names', { peerName(state, { get }) { - if (!this.peerId) return this.type; + if (!this.peerId) return this.$t('transfer.transaction.type')[this.tx.type]; return get(this.peerId); }, }), diff --git a/src/components/mobile/ConfirmTransactionSignModal.vue b/src/components/mobile/ConfirmTransactionSignModal.vue index b7fdbdec0..e865a28c8 100644 --- a/src/components/mobile/ConfirmTransactionSignModal.vue +++ b/src/components/mobile/ConfirmTransactionSignModal.vue @@ -67,6 +67,7 @@ import { mapState } from 'vuex'; import { Crypto } from '@aeternity/aepp-sdk/es'; import { OBJECT_ID_TX_TYPE, TX_TYPE } from '@aeternity/aepp-sdk/es/tx/builder/schema'; +import { AENS_DOMAIN } from '../../lib/constants'; import MobilePage from './Page.vue'; import Guide from '../Guide.vue'; import AeFraction from '../AeFraction.vue'; @@ -165,7 +166,7 @@ export default { render: (createElement, { props: { value } }) => createElement(DetailsField, { attrs: { name: 'Name', - value: Crypto.decodeBase58Check(Crypto.assertedType(value, 'nm')).toString(), + value: Crypto.decodeBase58Check(Crypto.assertedType(value, 'nm')).toString().replace(AENS_DOMAIN, ''), }, }), }, diff --git a/src/components/mobile/IntroModal.vue b/src/components/mobile/IntroModal.vue deleted file mode 100644 index b78d17045..000000000 --- a/src/components/mobile/IntroModal.vue +++ /dev/null @@ -1,49 +0,0 @@ -{{ header }} - -

- {{ body }} -

- - - - - - - diff --git a/src/lib/appsRegistry.js b/src/lib/appsRegistry.js index 9638f16df..1c9d0e543 100644 --- a/src/lib/appsRegistry.js +++ b/src/lib/appsRegistry.js @@ -7,7 +7,7 @@ export { default as DEFAULT_ICON } from '../assets/icons/aepps/default.svg'; const showGraffitiApp = new Date('2019-09-04T22:00:00.000Z').getTime() <= Date.now(); export const aeternityApps = [...showGraffitiApp ? [{ - name: 'Graffiti Aepp', + name: 'Graffiti', path: 'graffiti.aeternity.com', icon: graffitiAeppIcon, }] : [], { diff --git a/src/lib/constants.js b/src/lib/constants.js index a8d937944..8107eac50 100644 --- a/src/lib/constants.js +++ b/src/lib/constants.js @@ -28,3 +28,5 @@ const toMicro = value => value.shiftedBy(-MAGNITUDE_MICRO).toFixed(); export const MIN_SPEND_TX_FEE_MICRO = toMicro(MIN_SPEND_TX_FEE); export const MAX_REASONABLE_FEE_MICRO = toMicro(MAX_REASONABLE_FEE); + +export const AENS_DOMAIN = '.test'; diff --git a/src/lib/utils.js b/src/lib/utils.js index ad84fb253..618d18614 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -2,7 +2,7 @@ import { get } from 'lodash-es'; export const toUrl = url => new URL((/^\w+:\//.test(url) ? '' : 'http://') + url); -export const isAensName = value => value.endsWith('.test'); +export const isAensName = value => !value.includes('.'); // eslint-disable-next-line no-console export const handleUnknownError = error => console.warn('Unknown rejection', error); diff --git a/src/locales/cn.json b/src/locales/cn.json index ac7710684..12fa7ec61 100644 --- a/src/locales/cn.json +++ b/src/locales/cn.json @@ -62,7 +62,7 @@ "mnemonic": "无效助记词", "url_http": "该字段不是有效的HTTP(S) URL", "air_gap_response_url": "这不是有效的同步代码。", - "aens_name": "必须以.test结尾", + "aens_name": "This field must not contain dots", "aens_name_unregistered": "这个名称已被注册", "account": "Invalid AE address or AENS name" }, @@ -90,7 +90,7 @@ }, "aepps": { - "guide": "探索æpps", + "guide": "探索æternity", "note": "让æternity区块链为您的日常生活增添活力。" }, @@ -114,22 +114,17 @@ }, "app": { - "title": "æpps", - - "intro": [{ - "header": "欢迎来到æpps浏览器!", - "body": "æpps是由æternity区块链提供支持的去中心化应用程序。" - }], + "title": "Browse", "list": { - "featured-guide": "精选æpps", - "browse-guide": "浏览æpps", - "bookmarked-guide": "我的æpps", + "featured-guide": "精选", + "browse-guide": "浏览", + "bookmarked-guide": "Bookmarks", "guide": "æpps 浏览器 (beta)", "note": "将运行在æternity区块链上的æpps添加到这里" }, - "url-form-placeholder": "输入æpps链接", + "url-form-placeholder": "输入链接", "browser": { "refresh": "更新", @@ -150,11 +145,11 @@ }, "settings": { - "title": "Aepp帐户访问权限", - "count": "没有aepps,有帐户访问权限| {n} aepp有帐户访问权限| {n} aepps有帐户访问权限", + "title": "帐户访问权限", + "count": "没有,有帐户访问权限| {n} 有帐户访问权限", "list": { - "note": "管理哪些æpps可以访问您的(子)帐户", + "note": "管理哪些可以访问您的(子)帐户", "subtitle": "| 可访问 {n} 账户 | 可访问 {n} 账户(子)" } } @@ -172,8 +167,8 @@ "content": "确认哪个帐户是活动的.帐户和子帐户具有唯一的标识符." }, { "selector": ".transfer .tab-bar .button-plain", - "header": "æpps", - "content": "æpps浏览器探索æternity区块链." + "header": "Browse", + "content": "浏览器探索æternity区块链." }, { "selector": ".transfer .tab-bar .button-plain:nth-child(3)", "header": "切换账户", @@ -412,11 +407,6 @@ "name": { "title": "Names", - "intro": [{ - "header": "欢迎来到 æternity 命名系统(AENS)!", - "body": "AENS允许用户申请一个名称,并与一个或多个æternity帐户关联. 您成功申请后,它会与您的帐户关联. At that point anyone can send tokens by typing the name instead of the account address." - }], - "list": { "note": "为您的账户申请一个名称!", "explanation": "点击“+”按钮来申请并与您的帐号关联.", @@ -449,7 +439,7 @@ "guide": "为 申请一个新名称 ", "unknown-error": "未知错误", "name": "名称", - "name-placeholder": "Name.test", + "name-placeholder": "Name", "register": "注册", "notification":{ diff --git a/src/locales/en.json b/src/locales/en.json index 9426f7f10..84510824c 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -62,7 +62,7 @@ "mnemonic": "Invalid recovery phrase", "url_http": "This field is not a valid HTTP(S) URL", "air_gap_response_url": "This is not a valid sync code.", - "aens_name": "This field must ends with .test", + "aens_name": "This field must not contain dots", "aens_name_unregistered": "This name is already registered", "account": "Invalid AE address or AENS name" }, @@ -90,7 +90,7 @@ }, "aepps": { - "guide": "Explore æpps", + "guide": "Explore æternity", "note": "Bring the power of æternity blockchain to your daily life." }, @@ -114,22 +114,17 @@ }, "app": { - "title": "æpps", - - "intro": [{ - "header": "Welcome to the æpps browser!", - "body": "æpps are decentralized applications powered by the æternity blockchain." - }], + "title": "Browse", "list": { - "featured-guide": "Featured æpps", - "browse-guide": "Browse æpps", - "bookmarked-guide": "My æpps", + "featured-guide": "Featured", + "browse-guide": "Browse", + "bookmarked-guide": "Bookmarks", "guide": "æpps browser (beta)", "note": "æpps running on the æternity blockchain will be added below." }, - "url-form-placeholder": "Enter æpp URL", + "url-form-placeholder": "Enter URL", "browser": { "refresh": "Refresh", @@ -150,11 +145,11 @@ }, "settings": { - "title": "Aepp account access", - "count": "No aepps have account access | {n} aepp have account access | {n} aepps have account access", + "title": "Account access", + "count": "No one have account access | {n} have account access", "list": { - "note": "Manage which æpps can access your (sub)accounts", + "note": "Manage who can access your (sub)accounts", "subtitle": "| can access {n} account | can access {n} accounts" } } @@ -172,8 +167,8 @@ "content": "Recognize which account is active. Accounts & subaccounts have unique identicons." }, { "selector": ".transfer .tab-bar .button-plain", - "header": "æpps", - "content": "Explore æpps powered by the æternity blockchain." + "header": "Browse", + "content": "Browse æternity blockchain." }, { "selector": ".transfer .tab-bar .button-plain:nth-child(3)", "header": "Account Switcher", @@ -412,11 +407,6 @@ "name": { "title": "Names", - "intro": [{ - "header": "Welcome to the æternity Naming System (AENS)!", - "body": "The AENS allows users to claim names and associate them with one or more æternity accounts. After you have successfully claimed a name it is associated with one of your accounts. At that point anyone can send tokens by typing the name instead of the account address." - }], - "list": { "note": "Claim a name for your account!", "explanation": "Tap the “+” button below to claim a name and associate it with one of your accounts.", @@ -449,7 +439,7 @@ "guide": "Claim a name for ", "unknown-error": "Unknown error", "name": "Name", - "name-placeholder": "Name.test", + "name-placeholder": "Name", "register": "Register", "notification":{ diff --git a/src/locales/ru.json b/src/locales/ru.json index 7eb9cc325..f29c42674 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -62,7 +62,7 @@ "mnemonic": "Неверная мнемоническая фраза", "url_http": "Это поле не является допустимым HTTP(S) URL-адресом", "air_gap_response_url": "Это недопустимый код синхронизации.", - "aens_name": "Это поле должно заканчиваться на .test", + "aens_name": "Это поле не должно содержать точек", "aens_name_unregistered": "Это имя уже зарегистрировано", "account": "Неверный AE адрес или AENS имя" }, @@ -90,7 +90,7 @@ }, "aepps": { - "guide": "Изучите æpps", + "guide": "Изучите æternity", "note": "Используйте всю мощь блокчейна æternity в своей повседневной жизни." }, @@ -114,22 +114,17 @@ }, "app": { - "title": "æpps", - - "intro": [{ - "header": "Добро пожаловать в браузер æpps!", - "body": "æpps - децентрализованные приложения, работающие на блокчейне æternity." - }], + "title": "Браузер", "list": { - "featured-guide": "Избранные æpps", - "browse-guide": "Просмотр æpps", - "bookmarked-guide": "Мои æpps", + "featured-guide": "Избранное", + "browse-guide": "Просмотр", + "bookmarked-guide": "Закладки", "guide": "æpps браузер (бета)", "note": "æpps, работающие в блокчейне æternity, будут добавлены ниже." }, - "url-form-placeholder": "Введите æpp URL", + "url-form-placeholder": "Введите URL", "browser": { "refresh": "Обновить", @@ -150,11 +145,11 @@ }, "settings": { - "title": "Доступ приложений к аккаунтам", - "count": "У приложений нет доступа к аккаунту | {n} приложение имеет доступ к аккаунту | {n} приложения имеют доступ к аккаунту | {n} приложений имеют доступ к аккаунту", + "title": "Доступ к аккаунтам", + "count": "Ни у кого нет доступа к аккаунту | {n} имеет доступ к аккаунту | {n} имеют доступ к аккаунту", "list": { - "note": "Управление доступом æpps к вашим (суб)аккаунтам", + "note": "Управление доступом к вашим (суб)аккаунтам", "subtitle": "| имеет доступ к {n} аккаунту | имеет доступ к {n} аккаунтам" } } @@ -172,8 +167,8 @@ "content": "Позволяет определить какой аккаунт активен. Аккаунты и субаккаунты имеют уникальные иконки." }, { "selector": ".transfer .tab-bar .button-plain", - "header": "æpps", - "content": "Браузер æpps, работающих на блокчейне æternity." + "header": "Браузер", + "content": "Браузер, работающий с блокчейном æternity." }, { "selector": ".transfer .tab-bar .button-plain:nth-child(3)", "header": "Переключатель аккаунтов", @@ -412,11 +407,6 @@ "name": { "title": "Имена", - "intro": [{ - "header": "Добро пожаловать в Систему имён (AENS)!", - "body": "AENS позволяет пользователям запрашивать имена и связывать их с одним или несколькими аккаунтами. После того, как вы успешно запросили имя, оно ассоциируется с одним из ваших аккаунтов. В этот момент любой желающий сможет отправить токены, введя ваше имя вместо адреса учетной записи." - }], - "list": { "note": "Запросите имя для своего аккаунта!", "explanation": "Нажмите кнопку «+» ниже, чтобы запросить имя и связать его с одним из ваших аккаунтов.", @@ -449,7 +439,7 @@ "guide": "Запросить имя для ", "unknown-error": "Неизвестная ошибка", "name": "Имя", - "name-placeholder": "Имя.test", + "name-placeholder": "Имя", "register": "Зарегистрировать", "notification": { diff --git a/src/pages/mobile/Apps.vue b/src/pages/mobile/Apps.vue index 31798c29b..80a479e9d 100644 --- a/src/pages/mobile/Apps.vue +++ b/src/pages/mobile/Apps.vue @@ -81,9 +81,6 @@ export default { return this.searchTerm ? this.fuse.search(this.searchTerm) : this.bookmarkedApps; }, }, - async mounted() { - await this.$store.dispatch('intros/ensureRead', 'apps'); - }, }; diff --git a/src/pages/mobile/NameList.vue b/src/pages/mobile/NameList.vue index 2f46d92a9..a0e9d2006 100644 --- a/src/pages/mobile/NameList.vue +++ b/src/pages/mobile/NameList.vue @@ -50,7 +50,6 @@ export default { }, computed: mapState('names', ['owned']), async mounted() { - await this.$store.dispatch('intros/ensureRead', 'names'); const update = () => this.$store.dispatch('names/fetchOwned'); await update(); const id = setInterval(update, 3000); diff --git a/src/pages/mobile/NameNew.vue b/src/pages/mobile/NameNew.vue index 4546d795f..22d35d320 100644 --- a/src/pages/mobile/NameNew.vue +++ b/src/pages/mobile/NameNew.vue @@ -50,6 +50,7 @@ import { mapGetters } from 'vuex'; import { handleUnknownError } from '../../lib/utils'; import { i18n } from '../../store/plugins/ui/languages'; +import { AENS_DOMAIN } from '../../lib/constants'; import MobilePage from '../../components/mobile/Page.vue'; import Guide from '../../components/Guide.vue'; import AeInput from '../../components/AeInput.vue'; @@ -73,9 +74,9 @@ export default { let claimTxHash; try { - const { salt } = await this.$store.state.sdk.aensPreclaim(this.name); + const { salt } = await this.$store.state.sdk.aensPreclaim(this.name + AENS_DOMAIN); claimTxHash = ( - await this.$store.state.sdk.aensClaim(this.name, salt, { waitMined: false }) + await this.$store.state.sdk.aensClaim(this.name + AENS_DOMAIN, salt, { waitMined: false }) ).hash; this.$store.dispatch('modals/open', { diff --git a/src/pages/mobile/TransactionDetails.vue b/src/pages/mobile/TransactionDetails.vue index 13d9f1abd..4786f0a2a 100644 --- a/src/pages/mobile/TransactionDetails.vue +++ b/src/pages/mobile/TransactionDetails.vue @@ -34,7 +34,7 @@ { registerModal({ name: 'confirmAccountAccess', component: ConfirmAccountAccessModal }); registerModal({ name: 'confirmSign', component: ConfirmSignModal, hidePage: true }); registerModal({ name: 'confirmTransactionSign', component: ConfirmTransactionSignModal, hidePage: true }); - registerModal({ name: 'showIntro', component: IntroModal, hidePage: true }); registerModal({ name: 'vaultSign', component: VaultSignModal, hidePage: true }); registerModal({ name: 'notificationMnemonicBackup', component: NotificationMnemonicBackup, ...notificationOptions }); registerModal({ name: 'ensureKnowPassword', component: PasswordModal, hidePage: true }); diff --git a/src/store/index.js b/src/store/index.js index 8e0d0b684..bd9d8133f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -9,7 +9,6 @@ import rootModule from './modules/root'; // eslint-disable-line import/no-cycle import desktopModule from './modules/desktop'; import mobileModule from './modules/mobile'; import accountsModule from './modules/accounts'; -import introsModule from './modules/intros'; import persistState from './plugins/persistState'; import remoteConnection from './plugins/remoteConnection'; import initSdk from './plugins/initSdk'; @@ -27,7 +26,7 @@ const store = new Vuex.Store({ state => state, ({ migrations, sdkUrl, customNetworks, - apps, cachedAppManifests, peerId, languages, currencies, intros, + apps, cachedAppManifests, peerId, languages, currencies, accounts: { list, activeIdx, hdWallet: { encryptedWallet, mnemonicBackedUp } = {} } = {}, mobile: { readSecurityCourses, followers } = {}, desktop: { showGuideOnStartup } = {}, @@ -36,7 +35,6 @@ const store = new Vuex.Store({ peerId, languages, currencies, - intros, sdkUrl, customNetworks, accounts: { @@ -80,7 +78,7 @@ const store = new Vuex.Store({ modules: { ...process.env.RUNNING_IN_POPUP ? {} : { ...process.env.IS_MOBILE_DEVICE - ? { mobile: mobileModule, intros: introsModule } + ? { mobile: mobileModule } : { desktop: desktopModule }, }, accounts: accountsModule, diff --git a/src/store/modules/intros.js b/src/store/modules/intros.js deleted file mode 100644 index d881094bf..000000000 --- a/src/store/modules/intros.js +++ /dev/null @@ -1,38 +0,0 @@ -import Vue from 'vue'; -import { i18n } from '../plugins/ui/languages'; - -export default { - namespaced: true, - - state: { - read: {}, - }, - - getters: { - intros: () => ({ - apps: i18n.t('app.intro'), - names: i18n.t('name.intro'), - }), - }, - - mutations: { - markAsRead({ read }, key) { - Vue.set(read, key, true); - }, - }, - - actions: { - async ensureRead({ - state: { read }, getters: { intros }, commit, dispatch, - }, key) { - if (read[key]) return; - try { - await dispatch('modals/open', { name: 'showIntro', content: intros[key] }, { root: true }); - commit('markAsRead', key); - } catch (error) { - if (error.message === 'User navigated outside') return; - throw error; - } - }, - }, -}; diff --git a/src/store/plugins/ui/names.js b/src/store/plugins/ui/names.js index 790429ae5..adb24a76b 100644 --- a/src/store/plugins/ui/names.js +++ b/src/store/plugins/ui/names.js @@ -1,6 +1,9 @@ /* eslint no-param-reassign: ["error", { "ignorePropertyModificationsFor": ["state"] }] */ import Vue from 'vue'; import { handleUnknownError, isAccountNotFoundError } from '../../../lib/utils'; +import { AENS_DOMAIN } from '../../../lib/constants'; + +const removeDomain = name => name.replace(AENS_DOMAIN, ''); export default (store) => { store.registerModule('names', { @@ -40,7 +43,7 @@ export default (store) => { const sdk = rootState.sdk.then ? await rootState.sdk : rootState.sdk; const names = await sdk.middleware .getActiveNames({ owner: address, limit: 1, page: 1 }); - if (names.length) commit('set', { address, name: names[0].name }); + if (names.length) commit('set', { address, name: removeDomain(names[0].name) }); }, async fetchOwned({ rootState, commit }) { const sdk = rootState.sdk.then ? await rootState.sdk : rootState.sdk; @@ -64,7 +67,9 @@ export default (store) => { owner: tx.accountId, })))(), sdk.middleware.getActiveNames({ owner: address }), - ])).flat(); + ])) + .flat() + .map(({ name, ...other }) => ({ ...other, name: removeDomain(name) })); commit('set', { address, @@ -82,7 +87,8 @@ export default (store) => { subscription.unsubscribe(); }); }); - const { owner: address } = (await rootState.sdk.middleware.namesSearchGet(name)) + const { owner: address } = (await rootState.sdk.middleware + .namesSearchGet(name + AENS_DOMAIN)) .filter(({ expiresAt }) => expiresAt > height) .find(nameDetails => nameDetails.name === name); commit('set', { address, name }); diff --git a/src/store/plugins/ui/observables.js b/src/store/plugins/ui/observables.js index 44e61dc95..29d296252 100644 --- a/src/store/plugins/ui/observables.js +++ b/src/store/plugins/ui/observables.js @@ -12,7 +12,6 @@ import { handleUnknownError, isAccountNotFoundError } from '../../../lib/utils'; import { fetchJson } from '../../utils'; import currencyAmount from '../../../filters/currencyAmount'; import prefixedAmount from '../../../filters/prefixedAmount'; -import { i18n } from './languages'; export default (store) => { // eslint-disable-next-line no-underscore-dangle @@ -69,7 +68,6 @@ export default (store) => { ...amount !== undefined && { amount: BigNumber(amount).shiftedBy(-MAGNITUDE) }, fee: BigNumber(fee).shiftedBy(-MAGNITUDE), }, - type: i18n.t('transfer.transaction.type')[otherTx.type], }); const setTransactionFieldsRelatedToAddress = ({ tx, ...otherTransaction }, currentAddress) => ({ @@ -151,17 +149,22 @@ export default (store) => { ]) .pipe( switchMap(async ([address, height, hash, sdk]) => { - const tx = transactions[hash] - || await normalizeTransaction( + let tx; + if (transactions[hash]) { + tx = transactions[hash]; + } else { + if (!sdk) return null; + tx = await normalizeTransaction( await sdk.api.getTransactionByHash(hash), ); - registerTx(tx); - return ({ + registerTx(tx); + } + return { ...setTransactionFieldsRelatedToAddress(tx, address), confirmationCount: height - tx.blockHeight, - }); + }; }), - switchMap(addConvertedAmount), + switchMap(tx => (tx ? addConvertedAmount(tx) : Promise.resolve(tx))), ); const fetchMdwTransactions = async (address, limit, page) => { @@ -197,8 +200,7 @@ export default (store) => { const getTransactionsByAddress = (address) => { if (!transactionRangeForAddress[address]) return []; const txs = Object.values(transactions) - .filter(({ tx }) => [tx.senderId, tx.accountId, tx.recipientId, tx.ownerId] - .includes(address)); + .filter(({ tx }) => Object.values(tx).includes(address)); const minedTxs = txs .filter(({ pending }) => !pending) .sort((a, b) => b.time - a.time);