@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
32 lines • 1.5 kB
TypeScript
import { Observable } from "rxjs";
import Transport from "@ledgerhq/hw-transport";
import type { FinalFirmware, OsuFirmware } from "@ledgerhq/types-live";
import type { DeviceInfo } from "@ledgerhq/types-live";
import { UnresponsiveCmdEvent } from "../core";
export type InstallFirmwareCommandRequest = {
targetId: DeviceInfo["targetId"];
firmware: OsuFirmware | FinalFirmware;
};
export type InstallFirmwareCommandEvent = {
type: "progress";
progress: number;
} | {
type: "allowSecureChannelRequested";
} | {
type: "firmwareInstallPermissionRequested";
} | {
type: "firmwareInstallPermissionGranted";
} | UnresponsiveCmdEvent;
/**
* Creates a scriptrunner connection with the /install API endpoint of the HSM in order to install (upload)
* an OSU (operating system updater).
* This is the same endpoint that is used to install applications, however the parameters that are
* passed are different. Besides that, the emitted events are semantically different. This is why
* this is a dedicated command to OSU installations.
*
* @param transport The transport object to contact the device
* @param param1 The firmware details to be installed
* @returns An observable that emits the events according to the progression of the firmware installation
*/
export declare function installFirmwareCommand(transport: Transport, { targetId, firmware }: InstallFirmwareCommandRequest): Observable<InstallFirmwareCommandEvent>;
//# sourceMappingURL=installFirmware.d.ts.map