@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
13 lines • 540 B
JavaScript
import { getAccountCurrency } from "@ledgerhq/coin-framework/account/helpers";
import { useMemo } from "react";
import { useFetchCurrencyFrom } from "./v5";
export function useSwapableAccounts({ accounts }) {
const { data: currenciesFrom } = useFetchCurrencyFrom();
return useMemo(() => accounts.map(account => {
return {
...account,
disabled: !currenciesFrom?.includes(getAccountCurrency(account).id),
};
}), [currenciesFrom, accounts]);
}
//# sourceMappingURL=useSwapableAccounts.js.map