@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
19 lines • 731 B
JavaScript
import { isCryptoCurrency, isTokenCurrency } from "../currencies";
import { PlatformCurrencyType, PLATFORM_FAMILIES, } from "./types";
import { includes } from "../helpers";
export function isPlatformSupportedCurrency(currency) {
if (isCryptoCurrency(currency)) {
return includes(PLATFORM_FAMILIES, currency.family);
}
if (isTokenCurrency(currency)) {
return includes(PLATFORM_FAMILIES, currency.parentCurrency.family);
}
return false;
}
export function isPlatformCryptoCurrency(currency) {
return currency.type === PlatformCurrencyType.CryptoCurrency;
}
export function isPlatformERC20TokenCurrency(currency) {
return currency.standard === "ERC20";
}
//# sourceMappingURL=helpers.js.map