@lido-sdk/react
Version:
This project is being slowly deprecated and may not receive further updates. Check out [modern Lido SDK](https://github.com/lidofinance/lido-ethereum-sdk/pulls) to access latest functionality. It is actively maintained and is built for interacting with Li
14 lines (11 loc) • 412 B
JavaScript
import { getEtherscanLink, openWindow } from '@lido-sdk/helpers';
import { useCallback } from 'react';
import { useSDK } from './useSDK.js';
const useEtherscanOpen = (hash, entity) => {
const { chainId } = useSDK();
return useCallback(() => {
const link = getEtherscanLink(chainId, hash, entity);
openWindow(link);
}, [chainId, entity, hash]);
};
export { useEtherscanOpen };