Don't know what is an App?
You can find more about them on our support page.
- Prerequisite for device communication: @ledgerhq/hw-transport
The Apps store logic provides a set of tools and interfaces to manage your ledger device apps.
You can install, uninstall, update and check your ledger device status.
Holds transport logic to execute App operations on your device and fetch the Apps State.
execWithTransport
executes a given App operation - AppOp on the device
Used to install, uninstall or update device Apps.
Returns Observable<{ progress: number }>
import { execWithTransport } from "@ledgerhq/live-common/lib/apps/hw";
const appOp = { type: "install", name: app.name };
const appsObservable$ = execWithTransport(transport)(appOp, targetId, app);
listApps
is used to retrieve apps data per device.
Available Apps and versions vary from device firmware version and model.
Returns an Observable<ListAppEvents>
import { listApps } from "@ledgerhq/live-common/lib/apps/hw";
const appsObservable$ = listApps(transport, deviceInfo).pipe(
filter(({ type }) => type === "result"),
map(({ result }) => result)
);
Hold the device state logic used by the AppOp runner.
reducer
is used to manage changes in the device State.
distribute
gives the device app storage distribution from a given State
Returns AppsDistribution.
predictOptimisticState
helps retrieve the future State after an AppOp is successfully run on your device.
Holds react specific logic with hooks to manage the device state.
useAppsRunner
react hook to handle a device State with an AppOp dispatcher.
Returns UseAppsRunnerResult
React hooks used to search and filter through a given list of apps.
Transform the device communication during App Operations into the Apps logic State reducer.
runAppOp
executes a given AppOp on the device. Used in useAppsRunner.
Returns an Observable of RunnerEvents.