@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
10 lines • 442 B
JavaScript
import { useGetCounterValueIdsSortedByMarketCapQuery } from "../counterValues/state-manager/api";
import { sortCurrenciesByIds } from "./sortByMarketcap";
/**
* Sorts the given currencies by marketcap.
*/
export const useCurrenciesByMarketcap = (currencies) => {
const { data: ids } = useGetCounterValueIdsSortedByMarketCapQuery();
return ids ? sortCurrenciesByIds(currencies, ids) : currencies;
};
//# sourceMappingURL=hooks.js.map