"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useMarketPerformers = void 0;
const api_1 = require("../api");
const queryKeys_1 = require("../utils/queryKeys");
const react_query_1 = require("@tanstack/react-query");
const currencyFormatter_1 = require("../utils/currencyFormatter");
const timers_1 = require("../utils/timers");
const useMarketPerformers = ({ counterCurrency, range, limit = 5, top = 50, sort, supported, refreshRate, }) => (0, react_query_1.useQuery)({
    queryKey: [queryKeys_1.QUERY_KEY.MarketPerformers, counterCurrency, range, sort, limit],
    queryFn: () => (0, api_1.fetchMarketPerformers)({ counterCurrency, range, limit, top, sort, supported }),
    refetchInterval: timers_1.REFETCH_TIME_ONE_MINUTE * Number(refreshRate),
    staleTime: timers_1.REFETCH_TIME_ONE_MINUTE * Number(refreshRate),
    select: data => data.map((currency) => (0, currencyFormatter_1.formatPerformer)(currency)),
});
exports.useMarketPerformers = useMarketPerformers;
//# sourceMappingURL=useMarketPerformers.js.map