import { useQueries } from '@tanstack/react-query';
import { useConfig } from 'wagmi';
import { getBytecodeQueryOptions } from 'wagmi/query';
export const useCodeForChains = (address, chainIds) => {
    const wagmiConfig = useConfig();
    const queries = useQueries({
        queries: chainIds.map(chainId => {
            return {
                ...getBytecodeQueryOptions(wagmiConfig, {
                    address,
                    chainId,
                }),
            };
        }),
    });
    const isDeployedToAllChains = queries.every(query => query.data !== null);
    return {
        isDeployedToAllChains,
        queries,
    };
};
