@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
15 lines (12 loc) • 548 B
text/typescript
import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
export { groupCurrenciesByAsset } from "./groupCurrenciesByAsset";
export { sortAccountsByFiatValue } from "./sortAccountsByFiatValue";
const getBaseId = (currency: CryptoOrTokenCurrency) =>
currency.type === "CryptoCurrency" ? currency.id : currency.parentCurrency.id;
function belongsToSameNetwork(
elem: CryptoOrTokenCurrency,
network: CryptoOrTokenCurrency,
): boolean {
return getBaseId(elem) === getBaseId(network);
}
export { getBaseId, belongsToSameNetwork };