import { useQueryClient } from '@tanstack/react-query';
import { getBytecodeQueryKey } from '@wagmi/core/query';
import { useEffect } from 'react';
export const useRefetchCodeOnReceipt = (address, chainId, receipt) => {
    const queryClient = useQueryClient();
    useEffect(() => {
        if (receipt) {
            queryClient.invalidateQueries({
                queryKey: getBytecodeQueryKey({ address, chainId }),
            });
        }
    }, [receipt]);
};
