UNPKG

@ledgerhq/types-live

Version:
314 lines 7.12 kB
/// <reference types="node" /> /// <reference types="node" /> import type { DeviceModelId } from "@ledgerhq/types-devices"; import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets"; export type Id = number; /** * */ export type LedgerScriptParams = { firmware: string; firmwareKey: string; delete?: string; deleteKey?: string; targetId?: string | number; hash: string; perso: string; }; /** * */ export type DeviceInfo = { mcuVersion: string; version: string; majMin: string; targetId: string | number; isBootloader: boolean; isRecoveryMode?: boolean; isOSU: boolean; providerName: string | null | undefined; managerAllowed: boolean; pinValidated: boolean; seVersion?: string; mcuBlVersion?: string; mcuTargetId?: number; seTargetId?: number; onboarded?: boolean; hasDevFirmware?: boolean; bootloaderVersion?: string; hardwareVersion?: number; languageId?: number; seFlags: Buffer; charonState?: Buffer; }; /** * */ export type DeviceModelInfo = { modelId: DeviceModelId; deviceInfo: DeviceInfo; apps: Array<{ name: string; version: string; }>; }; /** * */ export type DeviceVersion = { id: Id; name: string; display_name: string; target_id: string; description: string; device: Id; providers: Array<Id>; mcu_versions: Array<Id>; se_firmware_final_versions: Array<Id>; osu_versions: Array<Id>; application_versions: Array<Id>; date_creation: string; date_last_modified: string; }; /** * */ export type McuVersion = { id: Id; mcu: Id; name: string; description: string | null | undefined; providers: Array<Id>; from_bootloader_version: string; device_versions: Array<Id>; se_firmware_final_versions: Array<Id>; date_creation: string; date_last_modified: string; }; /** * */ export declare enum SeedPhraseType { Twelve = "12-words", Eighteen = "18-words", TwentyFour = "24-words" } export type SeedOriginType = "new_seed" | "restore_seed" | "recover_seed" | "restore_charon"; /** * */ export type FirmwareInfo = { isBootloader: boolean; rawVersion: string; targetId: number; seVersion?: string; mcuVersion: string; mcuBlVersion?: string; mcuTargetId?: number; seTargetId?: number; flags: Buffer; bootloaderVersion?: string; hardwareVersion?: number; languageId?: number; recoverState?: Buffer; charonState?: Buffer; }; type BaseFirmware = { id: Id; name: string; description: string | null | undefined; display_name: string | null | undefined; notes: string | null | undefined; perso: string; firmware: string; firmware_key: string; hash: string; date_creation: string; date_last_modified: string; device_versions: Array<Id>; providers: Array<Id>; }; /** * */ export type OsuFirmware = BaseFirmware & { next_se_firmware_final_version: Id; previous_se_firmware_final_version: Array<Id>; }; /** * */ export type FinalFirmware = BaseFirmware & { version: string; se_firmware: Id; osu_versions: Array<OsuFirmware>; mcu_versions: Array<Id>; application_versions: Array<Id>; bytes?: number; updateAvailable?: FirmwareUpdateContext | null | undefined; }; /** * */ export type FirmwareUpdateContext = { osu: OsuFirmware; final: FinalFirmware; shouldFlashMCU: boolean; }; /** * */ export type ApplicationVersion = { id: Id; name: string; version: string; app: Id; description: string | null | undefined; display_name: string; icon: string; notes: string | null | undefined; perso: string; hash: string; firmware: string; firmware_key: string; delete: string; delete_key: string; device_versions: Array<Id>; se_firmware_final_versions: Array<Id>; providers: Array<Id>; date_creation: string; date_last_modified: string; type?: AppType; bytes: number | null | undefined; warning: string | null | undefined; currency?: CryptoCurrency; }; /** * */ export type Application = { id: Id; name: string; description: string | null | undefined; application_versions: Array<ApplicationVersion>; providers: Array<Id>; category: Id; publisher: Id | null | undefined; date_creation: string; date_last_modified: string; currencyId: string | null | undefined; authorName: string | null | undefined; supportURL: string | null | undefined; contactURL: string | null | undefined; sourceURL: string | null | undefined; }; export type ApplicationV2 = { versionId: Id; versionName: string; versionDisplayName: string; version: string; currencyId: string; description: string; applicationType: AppType; dateModified: string; icon: string; authorName: string; supportURL: string; contactURL: string; sourceURL: string; hash: string; perso: string; parentName: string | null; firmware: string; firmwareKey: string; delete: string; deleteKey: string; bytes: number; warning: string | null; isDevTools: boolean; }; /** * */ export declare enum AppType { app = "app",// NB Legacy from v1, drop after we default to v2. currency = "currency", plugin = "plugin", tool = "tool", swap = "swap" } /** App is higher level on top of Application and ApplicationVersion with all fields Live needs and in normalized form (but still serializable) */ export type App = { id: Id; name: string; displayName: string; version: string; currencyId: string | null | undefined; description: string | null | undefined; dateModified: string; icon: string; authorName: string | null | undefined; supportURL: string | null | undefined; contactURL: string | null | undefined; sourceURL: string | null | undefined; hash: string; perso: string; firmware: string; firmware_key: string; delete: string; delete_key: string; dependencies: string[]; bytes: number | null | undefined; warning: string | null | undefined; indexOfMarketCap: number; isDevTools: boolean; type: AppType; }; /** * */ export type Category = { id: Id; name: string; description: string | null | undefined; providers: Array<Id>; applications: Array<Id>; date_creation: string; date_last_modified: string; }; /** * */ export type SocketEvent = { type: "bulk-progress"; progress: number; index: number; total: number; } | { type: "result"; payload: any; } | { type: "warning"; message: string; } | { type: "device-permission-requested"; } | { type: "device-permission-granted"; } | { type: "exchange-before"; nonce: number; apdu: Buffer; } | { type: "exchange"; nonce: number; apdu: Buffer; data: Buffer; status: number; } | { type: "opened"; } | { type: "closed"; }; export {}; //# sourceMappingURL=manager.d.ts.map