diff --git a/.changeset/bright-cooks-breathe.md b/.changeset/bright-cooks-breathe.md new file mode 100644 index 000000000000..051e0ef6262d --- /dev/null +++ b/.changeset/bright-cooks-breathe.md @@ -0,0 +1,6 @@ +--- +"live-mobile": patch +"@ledgerhq/coin-framework": patch +--- + +fix solana earn on LLm diff --git a/apps/ledger-live-mobile/src/families/solana/accountActions.tsx b/apps/ledger-live-mobile/src/families/solana/accountActions.tsx index 05e4d9a8c6d1..133b6ebdfc37 100644 --- a/apps/ledger-live-mobile/src/families/solana/accountActions.tsx +++ b/apps/ledger-live-mobile/src/families/solana/accountActions.tsx @@ -7,6 +7,7 @@ import { SolanaAccount } from "@ledgerhq/live-common/families/solana/types"; import { NavigatorName, ScreenName } from "~/const"; import type { ActionButtonEvent, NavigationParamsType } from "~/components/FabActions"; import { getStakeLabelLocaleBased } from "~/helpers/getStakeLabelLocaleBased"; +import { isAccountEmpty } from "@ledgerhq/live-common/account/index"; const getMainActions = ({ account, @@ -17,7 +18,7 @@ const getMainActions = ({ parentAccount: Account; parentRoute: RouteProp; }): ActionButtonEvent[] => { - const delegationDisabled = account.solanaResources?.stakes.length > 1; + const delegationDisabled = isAccountEmpty(account); const label = getStakeLabelLocaleBased(); const navigationParams: NavigationParamsType = delegationDisabled diff --git a/libs/coin-framework/src/account/helpers.ts b/libs/coin-framework/src/account/helpers.ts index 3ab46a1eb400..dc1eefa9b359 100644 --- a/libs/coin-framework/src/account/helpers.ts +++ b/libs/coin-framework/src/account/helpers.ts @@ -69,6 +69,9 @@ export const isAccountEmpty = (a: AccountLike): boolean => { (a as any).balance.isZero() ); } + if (a.type === "Account" && a.currency.family === "solana") { + return (a as any).balance.isZero() || (a as any).spendableBalance.isZero(); + } const hasSubAccounts = a.type === "Account" && a.subAccounts && a.subAccounts.length; return a.operationsCount === 0 && a.balance.isZero() && !hasSubAccounts; };