@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
24 lines • 1.04 kB
TypeScript
import type { SyncPhase } from "./useSyncLifecycle";
interface UseBalanceSyncStateParams {
readonly rawBalanceAvailable: boolean;
readonly syncPhase: SyncPhase;
readonly latestBalance: number;
readonly shouldFreezeOnSync: boolean;
}
interface BalanceSyncState {
readonly balanceAvailable: boolean;
readonly displayedBalance: number;
readonly isLoading: boolean;
}
/**
* Shared balance-display logic consumed by both desktop and mobile during sync.
*
* - **Sticky balanceAvailable**: stays `false` while syncing so the skeleton
* covers the entire cycle (Skeleton → Animate balance, no shimmer gap).
* - **Frozen balance**: holds the pre-sync value so `AmountDisplay` can
* animate the delta once the sync settles.
* - **isLoading**: true while `syncPhase` is `"syncing"`.
*/
export declare function useBalanceSyncState({ rawBalanceAvailable, syncPhase, latestBalance, shouldFreezeOnSync, }: UseBalanceSyncStateParams): BalanceSyncState;
export {};
//# sourceMappingURL=useBalanceSyncState.d.ts.map