diff --git a/src/components/ConnectionStatus.vue b/src/components/ConnectionStatus.vue index 7cf9542fb..9f5971705 100644 --- a/src/components/ConnectionStatus.vue +++ b/src/components/ConnectionStatus.vue @@ -15,9 +15,13 @@ export default { computed: mapState({ message({ onLine, sdk }) { if (!onLine) return { text: this.$t('network.connection-status.offline') }; - if (!sdk) return { text: this.$t('network.connection-status.no-sdk') }; - if (sdk.then) - return { text: this.$t('network.connection-status.connecting'), className: 'connecting' }; + const { networkId } = this.$store.state.sdkSync; + switch (networkId) { + case '_cant-connect': + return { text: this.$t('network.connection-status.cant-connect') }; + case '_connecting': + return { text: this.$t('network.connection-status.connecting'), className: 'connecting' }; + } if (!this.middlewareStatus) { return { text: this.$t('network.connection-status.middleware.unavailable'), @@ -32,7 +36,7 @@ export default { className: 'connecting', }; } - if (process.env.NODE_ENV === 'production' && sdk.getNetworkId() !== 'ae_mainnet') { + if (process.env.NODE_ENV === 'production' && networkId !== 'ae_mainnet') { return { text: this.$t('network.connection-status.connected-to-testnet'), className: 'test-net', diff --git a/src/locales/cn.json b/src/locales/cn.json index f859264ec..4e8602a15 100644 --- a/src/locales/cn.json +++ b/src/locales/cn.json @@ -556,7 +556,7 @@ "network": { "connection-status": { "offline": "您已离线,请检查您的网络连接。", - "no-sdk": "我们无法连接到您选择的节点。", + "cant-connect": "我们无法连接到您选择的节点。", "connecting": "正在连接网络中...", "connected-to-testnet": "您已连接到测试网。", "middleware": { diff --git a/src/locales/en.json b/src/locales/en.json index 6e949ab17..e1eca0f66 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -556,7 +556,7 @@ "network": { "connection-status": { "offline": "You are offline... Please check your connection.", - "no-sdk": "We are unable to connect to the chosen node.", + "cant-connect": "We are unable to connect to the chosen node.", "connecting": "Connecting to the network...", "connected-to-testnet": "You are connected to a testnet.", "middleware": { diff --git a/src/locales/es.json b/src/locales/es.json index eb94b048f..de236242c 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -556,7 +556,7 @@ "network": { "connection-status": { "offline": "Estás desconectado... Comprueba tu conexión", - "no-sdk": "No podemos conectarnos al nodo elegido", + "cant-connect": "No podemos conectarnos al nodo elegido", "connecting": "Conectando a la red...", "connected-to-testnet": "Está conectado a una red de prueba", "middleware": { diff --git a/src/locales/ru.json b/src/locales/ru.json index 3745e2993..ce1f8124c 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -556,7 +556,7 @@ "network": { "connection-status": { "offline": "Вы не в сети... Пожалуйста, проверьте ваше подключение к интернету.", - "no-sdk": "Мы не можем подключиться к выбранному узлу.", + "cant-connect": "Мы не можем подключиться к выбранному узлу.", "connecting": "Подключаемся к сети...", "connected-to-testnet": "Вы подключены к тестовой сети.", "middleware": { diff --git a/src/pages/aens/AuctionBid.vue b/src/pages/aens/AuctionBid.vue index 09db71d90..704741193 100644 --- a/src/pages/aens/AuctionBid.vue +++ b/src/pages/aens/AuctionBid.vue @@ -75,6 +75,7 @@ import { pick, debounce } from 'lodash-es'; import BigNumber from 'bignumber.js'; import { mapGetters } from 'vuex'; +import { Name } from '@aeternity/aepp-sdk-next'; import { MAGNITUDE } from '../../lib/constants'; import blocksToRelativeTime from '../../filters/blocksToRelativeTime'; import Page from '../../components/Page.vue'; @@ -144,7 +145,9 @@ export default { } this.busy = true; try { - await this.$store.state.sdk.aensBid(name, BigNumber(this.amount).shiftedBy(MAGNITUDE)); + await new Name(name, this.$store.getters.sdk.getContext()).aensBid( + BigNumber(this.amount).shiftedBy(MAGNITUDE), + ); this.$store.dispatch('modals/open', { name: 'notification', text: i18n.t('name.new.notification.bid', { name }), diff --git a/src/pages/aens/NameList.vue b/src/pages/aens/NameList.vue index 9f5a59a29..6f122e9e6 100644 --- a/src/pages/aens/NameList.vue +++ b/src/pages/aens/NameList.vue @@ -61,10 +61,7 @@ export default { NamePending, ButtonAddFixed, }, - data: () => ({ - auctions: [], - height: null, - }), + data: () => ({ auctions: [] }), computed: mapState('names', ['owned']), async mounted() { const fetchNames = () => this.$store.dispatch('names/fetchOwned'); @@ -90,17 +87,17 @@ export default { }), ), ); - this.height ??= await this.$store.state.sdk.height(); + const height = await this.$store.getters.sdk.getHeight({ cached: true }); const recentlyClaimedNames = uniq( claims .map(({ data }) => data) .flat() // max auction length is 29760 blocks, but it can be increased multiple times by 120 - .filter(({ blockHeight }) => blockHeight > this.height - 40000) + .filter(({ blockHeight }) => blockHeight > height - 40000) .map(({ tx: { name } }) => name.toLowerCase()) .filter((name) => isNameValid(name) && isAuctionName(name)), ); - const nodeNoRetry = new Node(this.$store.state.sdkUrl, { retryCount: 0 }); + const nodeNoRetry = new Node(this.$store.node.$host, { retryCount: 0 }); this.auctions = ( await Promise.allSettled( recentlyClaimedNames.map((name) => diff --git a/src/pages/aens/NameNew.vue b/src/pages/aens/NameNew.vue index 933326887..7354e9b38 100644 --- a/src/pages/aens/NameNew.vue +++ b/src/pages/aens/NameNew.vue @@ -39,6 +39,7 @@