UNPKG

@openocean.finance/widget

Version:

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

20 lines 639 B
import { ChainType } from '@openocean.finance/widget-sdk'; import { useBytecode } from 'wagmi'; export const useIsContractAddress = (address, chainId, chainType) => { const { data: contractCode, isLoading, isFetched, } = useBytecode({ address: address, chainId: chainId, query: { refetchInterval: 300000, staleTime: 300000, enabled: Boolean(chainType === ChainType.EVM && chainId), }, }); return { isContractAddress: !!contractCode, contractCode, isLoading, isFetched, }; }; //# sourceMappingURL=useIsContractAddress.js.map