import { queryClient } from '../commands/_app.js';
import { CHAIN_LIST_URL, fetchSuperchainRegistryChainList, } from '../util/fetchSuperchainRegistryChainList.js';
import { useQuery } from '@tanstack/react-query';
const getQueryParams = (chainListURL) => {
    return {
        queryKey: ['superchainRegistryChainList', chainListURL],
        queryFn: () => fetchSuperchainRegistryChainList(chainListURL),
    };
};
export const querySuperchainRegistryChainList = async (chainListURL = CHAIN_LIST_URL) => {
    return queryClient.fetchQuery(getQueryParams(chainListURL));
};
export const useSuperchainRegistryChainList = () => {
    return useQuery(getQueryParams(CHAIN_LIST_URL));
};
