UNPKG

@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

18 lines (13 loc) 506 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var helpers = require('@lido-sdk/helpers'); var react = require('react'); var useSDK = require('./useSDK.js'); const useEtherscanOpen = (hash, entity) => { const { chainId } = useSDK.useSDK(); return react.useCallback(() => { const link = helpers.getEtherscanLink(chainId, hash, entity); helpers.openWindow(link); }, [chainId, entity, hash]); }; exports.useEtherscanOpen = useEtherscanOpen;