@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
19 lines (15 loc) • 491 B
text/typescript
import { Account } from "@ledgerhq/types-live";
import { BigNumber } from "bignumber.js";
export interface AccountBannerState {
stakeProvider: "lido" | "kiln";
}
const ETH_REQUIRED_FOR_KILN = new BigNumber("32000000000000000000");
export function getAccountBannerState(account: Account): AccountBannerState {
const stakeProvider =
account.currency.id === "ethereum" && account.balance.gte(ETH_REQUIRED_FOR_KILN)
? "kiln"
: "lido";
return {
stakeProvider,
};
}