assembly/composables/useLink.ts
Georges KABBOUCHI d2ef95e5b9 Avalanche Support
closes #23
2021-10-17 15:57:51 +03:00

38 lines
1.3 KiB
TypeScript

import { computed } from "@nuxtjs/composition-api";
import { useNetwork } from "./useNetwork";
export function useLink() {
const { activeNetworkId } = useNetwork();
const addressDetailsLink = computed(() => {
if (activeNetworkId.value === "polygon") {
return "https://polygonscan.com/address";
}
if (activeNetworkId.value === "arbitrum") {
return "https://arbiscan.io/address";
}
if (activeNetworkId.value === "avalanche") {
return "https://cchain.explorer.avax.network/address";
}
return "https://etherscan.io/address";
});
return { addressDetailsLink };
}
export const getEtherscanLink = transactionHash =>
`https://etherscan.io/tx/${transactionHash}`;
export const getMaticLink = transactionHash =>
`https://polygonscan.com/tx/${transactionHash}`;
export const getPolygonLink = transactionHash =>
`https://polygonscan.com/tx/${transactionHash}`;
export const getArbitrumLink = transactionHash =>
`https://arbiscan.io/tx/${transactionHash}`;
export const getAvalancheLink = transactionHash =>
`https://cchain.explorer.avax.network/tx/${transactionHash}`;
export const getTenderlyLink = simulationId =>
`https://dashboard.tenderly.co/public/InstaDApp/dsa-simulations/fork-simulation/${simulationId}?hideSidebar=true`;