diff --git a/src/boot/core.ts b/src/boot/core.ts
index d49ddb10..431a12c9 100644
--- a/src/boot/core.ts
+++ b/src/boot/core.ts
@@ -6,7 +6,8 @@ export default boot(({ app }) => {
initCore(app);
const defaultNetwork = Object.keys(evmSettings)[0];
- let network = new URLSearchParams(window.location.search).get('network');
+ let network = new URLSearchParams(window.location.search).get('network') ?? process.env.NETWORK_EVM_NAME;
+ console.log('Multichain initMultichain()', { network, NETWORK_EVM_NAME: process.env.NETWORK_EVM_NAME });
if (network) {
const exists = Object.keys(evmSettings).some(key => evmSettings[key].getNetwork() === network);
if (!exists) {
diff --git a/src/components/InternalTransactionFlatTable.vue b/src/components/InternalTransactionFlatTable.vue
index e7202153..a91892a8 100644
--- a/src/components/InternalTransactionFlatTable.vue
+++ b/src/components/InternalTransactionFlatTable.vue
@@ -217,7 +217,7 @@ export default {
let processedTransactions = 0;
let lastTransactionHash = '';
const totalEntries = [];
- result.results.forEach((internalTrx) => {
+ result.data.results.forEach((internalTrx) => {
if (internalTrx.transactionHash !== lastTransactionHash) {
processedTransactions++;
lastTransactionHash = internalTrx.transactionHash;
@@ -250,9 +250,9 @@ export default {
const filter = Object.assign({}, this.filter ? this.filter : {});
if (this.address) {
- path = `/address/${this.address}/internal?limit=${limit}`;
+ path = `v1/address/${this.address}/internal?limit=${limit}`;
} else {
- path = `/internal?limit=${limit}`;
+ path = `v1/internal?limit=${limit}`;
}
if (filter.block) {
diff --git a/src/components/LoginModal.vue b/src/components/LoginModal.vue
index 4ceb2b2f..5eb31527 100644
--- a/src/components/LoginModal.vue
+++ b/src/components/LoginModal.vue
@@ -5,7 +5,6 @@ import { useStore } from 'vuex';
import { useI18n } from 'vue-i18n';
import detectEthereumProvider from '@metamask/detect-provider';
import { Authenticator } from 'universal-authenticator-library';
-
import {
LOGIN_EVM,
LOGIN_NATIVE,
diff --git a/src/components/header/AppHeaderLinks.vue b/src/components/header/AppHeaderLinks.vue
index d2b7fd62..79c2cf83 100644
--- a/src/components/header/AppHeaderLinks.vue
+++ b/src/components/header/AppHeaderLinks.vue
@@ -4,15 +4,11 @@ import { useRoute, useRouter } from 'vue-router';
import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n';
-import {
- TELOSCAN_MAINNET_URL,
- TELOSCAN_TESTNET_URL,
-} from 'src/lib/chain-utils';
-
import LanguageSwitcherModal from 'components/header/LanguageSwitcherModal.vue';
import OutlineButton from 'components/OutlineButton.vue';
import { useChainStore } from 'src/core';
import { HeaderMenuEntry } from 'src/core/types';
+import { chains, multichainSelectedNetwork, switchChain } from 'src/lib/multichain-utils';
const $route = useRoute();
const $router = useRouter();
@@ -24,17 +20,6 @@ defineProps<{
}>();
const emit = defineEmits(['close-menu']);
-const networksMenuItems = {
- mainnet: [{
- url: TELOSCAN_MAINNET_URL,
- label: 'Telos Mainnet',
- }],
- testnet: [{
- url: TELOSCAN_TESTNET_URL,
- label: 'Telos Testnet',
- }],
-};
-
const blockchainMenuExpandedMobile = ref(false);
const developersMenuExpandedMobile = ref(false);
const moreMenuExpandedMobile = ref(false);
@@ -105,28 +90,6 @@ function toggleDarkMode() {
$q.dark.toggle();
localStorage.setItem('darkModeEnabled', $q.dark.isActive.toString());
}
-
-function getIsCurrentNetworkMenuItem(url: string) {
- networksMenuItems.mainnet.forEach((item) => {
- if (item.url === url) {
- return true;
- }
- });
- return false;
-}
-
-function goTo(to: string | { name: string }) {
- blurActiveElement();
- closeAllMenus();
-
- const httpsRegex = /^https/;
- if (typeof to === 'string' && httpsRegex.test(to)) {
- window.open(to, '_blank');
- return;
- }
-
- $router.push(to);
-}
@@ -249,35 +212,18 @@ function goTo(to: string | { name: string }) {
}"
>
- {{ item.label }}
-
-
-
-
-
- {{ item.label }}
+ {{ chain.settings.getDisplay() }}
diff --git a/src/components/header/AppHeaderTopBar.vue b/src/components/header/AppHeaderTopBar.vue
index 7e02acd4..a082b714 100644
--- a/src/components/header/AppHeaderTopBar.vue
+++ b/src/components/header/AppHeaderTopBar.vue
@@ -4,24 +4,22 @@ import {
onBeforeMount,
onBeforeUnmount,
onMounted,
- ref,
- watch,
} from 'vue';
import { useQuasar } from 'quasar';
import { useStore } from 'vuex';
import { useI18n } from 'vue-i18n';
import { formatUnits } from 'ethers/lib/utils';
-import { useRoute, useRouter } from 'vue-router';
-import { TeloscanEVMChainSettings, evmSettings, useChainStore } from 'src/core';
+import { useRoute } from 'vue-router';
+import { useChainStore } from 'src/core';
import AppHeaderWallet from 'components/header/AppHeaderWallet.vue';
import OutlineButton from 'components/OutlineButton.vue';
import AppSearch from 'components/AppSearch.vue';
-import { CURRENT_CONTEXT } from 'src/core/mocks';
+import { chains, multichainSelectedNetwork, switchChain } from 'src/lib/multichain-utils';
const $route = useRoute();
-const $router = useRouter();
+
const $q = useQuasar();
const $store = useStore();
const $i18n = useI18n();
@@ -90,57 +88,6 @@ function toggleDarkMode() {
localStorage.setItem('darkModeEnabled', $q.dark.isActive.toString());
}
-
-// Multichain
-interface ChainOption {
- network: string;
- settings: TeloscanEVMChainSettings;
-}
-
-const chains = [
- {
- network: 'telos-evm',
- settings: evmSettings['telos-evm'],
- },
- {
- network: 'telos-evm-testnet',
- settings: evmSettings['telos-evm-testnet'],
- },
-] as ChainOption[];
-
-const selectedNetwork = ref(undefined);
-const switchChain = (network: ChainOption) => {
- selectedNetwork.value = network;
-};
-
-onMounted(() => {
- const defaultNetwork = Object.keys(evmSettings)[0];
- let network = new URLSearchParams(window.location.search).get('network');
- if (network) {
- const exists = Object.keys(evmSettings).some(key => evmSettings[key].getNetwork() === network);
- if (!exists) {
- network = defaultNetwork;
- }
- } else {
- network = defaultNetwork;
- }
- $router.replace({ query: { ...$route.query, network } });
- selectedNetwork.value = chains.find(chain => chain.network === network);
-});
-
-watch(selectedNetwork, () => {
- if (selectedNetwork.value) {
- chainStore.setChain(CURRENT_CONTEXT, selectedNetwork.value.network);
- // replace the url to reflect the network
- $router.replace({ query: { ...$route.query, network: selectedNetwork.value.network } });
- }
-});
-
-watch(() => chainStore.currentChain, (currentChain) => {
- selectedNetwork.value = chains.find(chain => chain.network === currentChain.settings.getNetwork());
-});
-
-
@@ -189,28 +136,6 @@ watch(() => chainStore.currentChain, (currentChain) => {
-
-
chainStore.currentChain, (currentChain) => {
@click="switchChain(chain)"
@keydown.enter="switchChain(chain)"
>
-
+