assembly/composables/useLink.ts

26 lines
864 B
TypeScript
Raw Normal View History

2021-08-31 19:23:47 +00:00
import { computed } from "@nuxtjs/composition-api";
import { useNetwork } from "./useNetwork";
2021-07-24 23:40:30 +00:00
export function useLink() {
2021-08-31 19:23:47 +00:00
const { activeNetworkId } = useNetwork();
2021-07-24 23:40:30 +00:00
const addressDetailsLink = computed(() => {
2021-08-31 19:23:47 +00:00
if (activeNetworkId.value === "polygon") {
return "https://polygonscan.com/address";
2021-07-24 23:40:30 +00:00
}
2021-08-31 19:23:47 +00:00
return "https://etherscan.io/address";
});
2021-07-24 23:40:30 +00:00
2021-08-31 19:23:47 +00:00
return { addressDetailsLink };
2021-07-24 23:40:30 +00:00
}
2021-08-31 19:23:47 +00:00
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 getTenderlyLink = simulationId =>
`https://dashboard.tenderly.co/public/InstaDApp/dsa-simulations/fork-simulation/${simulationId}?hideSidebar=true`;