UNPKG

@lifi/widget

Version:

LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.

15 lines (11 loc) 342 B
import { useMemo } from 'react' import { useAvailableChains } from './useAvailableChains.js' export const useChain = (chainId?: number) => { const { isLoading, getChainById } = useAvailableChains() const chain = useMemo(() => getChainById(chainId), [chainId, getChainById]) return { chain, isLoading, getChainById, } }