import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events'; import * as _onekeyfe_hd_transport from '@onekeyfe/hd-transport'; import { DeviceRebootType, Messages, Transport, TransportCallOptions, OneKeyDeviceCommType, ProtocolInfo, ProtocolV2DeviceInfo, DeviceStatus as DeviceStatus$1, Enum_SafetyCheckLevel, OneKeyDeviceInfo, Success as Success$1, DeviceSessionPinType, LowlevelTransportSharedPlugin, OnboardingStatus, RecoveryDeviceType, ResourceType, NextU2FCounter, SetU2FCounter, CipheredKeyValue as CipheredKeyValue$1, UintType, EthereumPublicKey, EthereumMessageSignature, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, SignedPsbt, PrevInput, TxOutputBinType, TxInput, TxOutputType, TxInputType, StarcoinAddress as StarcoinAddress$1, StarcoinPublicKey as StarcoinPublicKey$1, StarcoinMessageSignature, StarcoinSignedTx, NEMAddress as NEMAddress$1, NEMSignedTx, SolanaAddress as SolanaAddress$1, SolanaSignedTx as SolanaSignedTx$1, SolanaTxExtraInfo, SolanaOffChainMessageVersion, SolanaOffChainMessageFormat, StellarAddress as StellarAddress$1, StellarSignedTx, TronAddress as TronAddress$1, TronResourceCode, TronSignedTx, TronMessageSignature, ConfluxAddress as ConfluxAddress$1, ConfluxMessageSignature, NearAddress as NearAddress$1, NearSignedTx, AptosAddress as AptosAddress$1, AptosMessageSignature as AptosMessageSignature$1, AptosSignedTx as AptosSignedTx$1, AlgorandAddress, AlgorandSignedTx, CosmosAddress as CosmosAddress$1, CosmosSignedTx as CosmosSignedTx$1, SuiAddress as SuiAddress$1, SuiMessageSignature, CardanoAddressParametersType, CardanoMessageSignature, FilecoinAddress as FilecoinAddress$1, FilecoinSignedTx as FilecoinSignedTx$1, PolkadotAddress as PolkadotAddress$1, PolkadotSignedTx as PolkadotSignedTx$1, KaspaAddress as KaspaAddress$1, NervosAddress as NervosAddress$1, NervosSignedTx as NervosSignedTx$1, DnxAddress as DnxAddress$1, TonWalletVersion, TonWorkChain, TonSignedMessage, TonSignedProof, TonSignDataType, TonSignedData, ScdoAddress as ScdoAddress$1, ScdoSignedMessage, ScdoSignedTx as ScdoSignedTx$1, AlephiumMessageSignature, AlephiumSignedTx as AlephiumSignedTx$1, BenfenAddress as BenfenAddress$1, BenfenMessageSignature, SafetyCheckLevel, ChangeOutputScriptType, ProtocolType } from '@onekeyfe/hd-transport'; export { Success as DeviceSuccess, HDNodeType, Messages as PROTO, ResourceType, TonSignDataType, TonWalletVersion } from '@onekeyfe/hd-transport'; import * as _onekeyfe_hd_shared from '@onekeyfe/hd-shared'; import { HardwareConnectProtocol, EFirmwareType, EDeviceType, Deferred } from '@onekeyfe/hd-shared'; interface CommonParams { /** * Keep the transport session after this call instead of releasing it. * This is a Device.run() hold flag, not a wallet identity. It does not replace * `useEmptyPassphrase`, `passphraseState`, or `openWalletSession`. * USB multi-step flows and Electron BLE firmware windows still need this to * avoid dropping the link between calls. */ keepSession?: boolean; /** * polling connect max retry count */ retryCount?: number; /** * polling interval time */ pollIntervalTime?: number; /** * Timeout time for single polling */ timeout?: number; /** * DeviceInfoGet timeout during Protocol V2 initialization. */ protocolV2DeviceInfoTimeoutMs?: number; /** * passphrase state */ passphraseState?: string; /** * Use empty passphrase */ useEmptyPassphrase?: boolean; /** * Every init session */ initSession?: boolean; /** * Use derive cardano */ deriveCardano?: boolean; detectBootloaderDevice?: boolean; /** * Skip web device prompt */ skipWebDevicePrompt?: boolean; /** * Skip passphrase check */ skipPassphraseCheck?: boolean; /** * Only connect device, not initialize device, only ble connect */ onlyConnectBleDevice?: boolean; /** * Use pre-initialized device state (BLE only) */ usePreInitialize?: boolean; /** * Strictly expected transport protocol. The SDK actively verifies this value and * rejects a mismatch. After a successful probe, the cached protocol is also strict. */ connectProtocol?: HardwareConnectProtocol; /** * Ignore a previously bound protocol for this call and actively detect the * protocol again. Intended for the first verified connection or explicit recovery. */ forceProtocolDetection?: boolean; } type Params = CommonParams & T & { bundle?: undefined; }; interface Unsuccessful { success: false; payload: { error: string; code?: string | number; }; } interface Success { success: true; payload: T; } type Response = Promise | Unsuccessful>; declare const safeThrowError: (error: any) => never; type RebootTypeInput = DeviceRebootType | keyof typeof DeviceRebootType | string | number; type DeviceRebootParams = { rebootType?: RebootTypeInput; reboot_type?: RebootTypeInput; }; type PassphrasePromptResponse = { passphrase?: string; passphraseOnDevice?: boolean; attachPinOnDevice?: boolean; cache?: boolean; }; type MessageType = Messages.MessageType; type MessageKey = Extract; type TypedResponseMessage = { type: T; message: MessageType[T]; }; type TypedCallResponseMap = { [K in MessageKey]: TypedResponseMessage; }; type DefaultMessageResponse = TypedCallResponseMap[MessageKey]; /** * The life cycle begins with the acquisition of the device and ends with the disposal device commands * acquire device -> create DeviceCommands -> release device -> dispose DeviceCommands */ declare class DeviceCommands { instanceId: string; currentResponseID?: number; device: Device; transport: Transport; mainId: string; disposed: boolean; private disposalToken?; callPromise?: Promise; constructor(device: Device, mainId: string); dispose(_cancelRequest: boolean): Promise; checkDisposed(): void; cancelDeviceOnOneKeyDevice(): Promise<{ readonly success: false; readonly error: 800; readonly payload: { readonly message: "Device disconnected or acquired by someone else"; }; } | { success: boolean; error: null; payload: { message: string; }; } | { success: boolean; error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902; payload: { message: string; }; } | undefined>; cancelDevice(): Promise<{ readonly success: false; readonly error: 800; readonly payload: { readonly message: "Device disconnected or acquired by someone else"; }; } | { success: boolean; error: null; payload: { message: string; }; } | { success: boolean; error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902; payload: { message: string; }; } | undefined>; cancel(): Promise; call(type: MessageKey, msg?: DefaultMessageResponse['message'], options?: TransportCallOptions): Promise; typedCall(type: T, resType: R, msg?: MessageType[T], options?: TransportCallOptions): Promise; typedCall(type: T, resType: R, msg?: MessageType[T], options?: TransportCallOptions): Promise>; _commonCall(type: MessageKey, msg?: DefaultMessageResponse['message'], options?: TransportCallOptions): Promise; _filterCommonTypes(res: DefaultMessageResponse, callType: MessageKey, options?: TransportCallOptions): Promise; _promptPin(type?: Messages.PinMatrixRequestType): Promise; promptPassphrase(options: PassphraseRequestPayload, promptOptions?: { cancelDeviceOnReject?: boolean; }): Promise; } type ProtocolV2RuntimeMode = 'normal' | 'bootloader' | 'romloader'; type transportEnv = 'node' | 'web' | 'webextension' | 'electron' | 'react-native' | 'webusb' | 'desktop-webusb' | 'desktop-web-ble' | 'emulator' | 'lowlevel' | 'node-usb'; type ConnectSettings = { connectSrc?: string; debug?: boolean; transportReconnect?: boolean; lazyLoad?: boolean; origin?: string; parentOrigin?: string; configSrc: string; iframeSrc: string; version: string; priority: number; trustedHost: boolean; supportedBrowser?: boolean; env: transportEnv; timestamp: number; isFrame?: boolean; preRelease?: boolean; firmwareManifestMode?: 'sdk-managed' | 'external-only'; preloadedConfig?: RemoteConfigResponse; fetchConfig?: boolean; extension?: string; configFetcher?: (url: string) => Promise; }; type IVersionArray = [number, number, number]; type ILocale = 'zh-CN' | 'en-US'; type IProtocolV2FirmwareComponentTarget = 'ROMLOADER' | 'BOOTLOADER' | 'APPLICATION_P1' | 'APPLICATION_P2' | 'COPROCESSOR' | 'SE01' | 'SE02' | 'SE03' | 'SE04'; type IProtocolV2FirmwareComponent = { target: IProtocolV2FirmwareComponentTarget; url: string; /** SHA-256 of the complete okpkg, used after downloading the package. */ fingerprint?: string; /** OKPP payload hash, used to detect same-version package changes. */ payloadHash?: string; expectedSize?: number; version?: IVersionArray; }; type IProtocolV2ResourceSource = { archiveUrl: string; archiveSha256: string; archiveSize: number; }; type IProtocolV2Resources = { source: IProtocolV2ResourceSource; }; /** STM32 firmware config */ type IFirmwareReleaseInfo = { required: boolean; /** Legacy release artifact URL. Protocol V2 releases use component URLs. */ url?: string; /** * Firmware type (bitcoinonly or universal) * This field is not present in the remote config, but will be inferred from the firmware field name */ firmwareType?: EFirmwareType; /** Firmware UI resource */ resource?: string; resourceFingerprint?: string; resourceExpectedSize?: number; /** Firmware full UI resource */ fullResource?: string; fullResourceFingerprint?: string; fullResourceExpectedSize?: number; fullResourceRange?: string[]; bootloaderResource?: string; bootloaderFingerprint?: string; bootloaderExpectedSize?: number; bootloaderVersion?: IVersionArray; displayBootloaderVersion?: IVersionArray; bootloaderRelatedFirmwareVersion?: IVersionArray; upgradeType?: 'payload-package-set' | string; components?: Record; installOrder?: string[]; /** Protocol V2 resources matched to this firmware release. */ resources?: IProtocolV2Resources; bootloaderChangelog?: { [k in ILocale]: string; }; /** Legacy release artifact SHA-256. Protocol V2 releases use component fingerprints. */ fingerprint?: string; expectedSize?: number; version: IVersionArray; changelog: { [k in ILocale]: string; }; }; /** BLE firmware config */ type IBLEFirmwareReleaseInfo = { required: boolean; /** bluetooth dfu version */ url: string; /** stm bluetooth update version */ webUpdate: string; fingerprint: string; fingerprintWeb: string; expectedSize?: number; version: IVersionArray; changelog: { [k in ILocale]: string; }; }; type IKnownDevice = Exclude; type IDeviceReleaseInfo = { firmware?: IFirmwareReleaseInfo[]; /** Protocol V2 payload package set */ 'firmware-v1'?: IFirmwareReleaseInfo[]; 'firmware-v2'?: IFirmwareReleaseInfo[]; 'firmware-v8'?: IFirmwareReleaseInfo[]; 'firmware-btc-v8'?: IFirmwareReleaseInfo[]; ble?: IBLEFirmwareReleaseInfo[]; }; type DeviceTypeMap = { [k in Exclude]: IDeviceReleaseInfo; } & { /** Optional until every remote-config producer publishes a Neo entry. */ neo?: IDeviceReleaseInfo; }; type AssetsMap = { bridge: { version: IVersionArray; linux32Rpm: string; linux64Rpm: string; linux32Deb: string; linux64Deb: string; win: string; mac: string; sha256sumAsc: string; changelog: { [k in ILocale]: string; }; }; }; type RemoteConfigResponse = { bridge: AssetsMap['bridge']; } & DeviceTypeMap; type DeviceStatus = 'available' | 'occupied' | 'used'; declare enum EOneKeyDeviceMode { bootloader = "bootloader", normal = "normal", notInitialized = "notInitialized", backupMode = "backupMode" } type UnavailableCapability = 'no-capability' | 'no-support' | 'update-required' | 'trezor-connect-outdated'; type UnavailableCapabilities = { [key: string]: UnavailableCapability; }; type KnownDevice = { connectId: string | null; /** Protocol family confirmed by the transport's active probe. */ connectProtocol?: HardwareConnectProtocol; /** * Stable physical-device identity. Current SDK responses always include this * value; it remains optional in the type during the uuid compatibility window. */ serialNo?: string; /** @deprecated Use serialNo instead. */ uuid: string; deviceId: string | null; deviceType: IDeviceType | null; commType: OneKeyDeviceCommType | null; path: string; label: string; bleName: string | null; name: string; error?: typeof undefined; /** Current SDK/transport usage state for connection indicators. */ status?: DeviceStatus; mode: EOneKeyDeviceMode; features: Features; /** Unified SDK device-state snapshot; features remains a legacy projection. */ state?: DeviceState; unavailableCapabilities: UnavailableCapabilities; bleFirmwareVersion: IVersionArray | null; firmwareVersion: IVersionArray | null; instanceId?: string; sdkInstanceId?: string; createdAt?: number; }; type SearchDevice = { connectId: string | null; /** Protocol family confirmed by the transport's active probe. */ connectProtocol?: HardwareConnectProtocol; /** * Available after device initialization. BLE discovery does not connect to the * device, so it returns null until a later initialized device response. Current * SDK responses always include the field; it remains optional in the type during * the uuid compatibility window. */ serialNo?: string | null; /** * @deprecated Ambiguous legacy identifier. Use serialNo for hardware identity * and connectId for transport routing. Empty during BLE discovery until the * physical serial number is available after initialization. */ uuid: string; deviceId: string | null; deviceType: IDeviceType; name: string; commType: OneKeyDeviceCommType; }; type Device$1 = KnownDevice; type DeviceFeaturesProtocol = 'V1' | 'V2' | 'unknown'; type DeviceFeaturesMode = 'normal' | 'bootloader' | 'romloader' | 'notInitialized' | 'backupMode' | 'unknown'; type DeviceFeaturesVerify = { firmwareBuildId?: string; firmwareHash?: string; applicationP1BuildId?: string; applicationP1Hash?: string; applicationP2BuildId?: string; applicationP2Hash?: string; bootloaderBuildId?: string; bootloaderHash?: string; boardBuildId?: string; boardHash?: string; bleBuildId?: string; bleHash?: string; se01BuildId?: string; se01Hash?: string; se02BuildId?: string; se02Hash?: string; se03BuildId?: string; se03Hash?: string; se04BuildId?: string; se04Hash?: string; se01BootBuildId?: string; se01BootHash?: string; se02BootBuildId?: string; se02BootHash?: string; se03BootBuildId?: string; se03BootHash?: string; se04BootBuildId?: string; se04BootHash?: string; }; type DeviceFeaturesRaw = { protocolV1Features?: Messages.Features; protocolV1OneKeyFeatures?: OnekeyFeatures; protocolV2ProtocolInfo?: ProtocolInfo; protocolV2DeviceInfo?: ProtocolV2DeviceInfo; protocolV2DeviceStatus?: DeviceStatus$1; }; type DeviceFeaturesRawPatch = { [Key in keyof DeviceFeaturesRaw]?: DeviceFeaturesRaw[Key] | null; }; type DeviceStateProtocol = DeviceFeaturesProtocol; type DeviceStateMode = DeviceFeaturesMode; type DeviceStateSection = 'identity' | 'status' | 'settings' | 'versions' | 'verification'; type DeviceStateUpdateSource = 'initialize' | 'device-info' | 'device-status' | 'settings-read' | 'settings-write' | 'change-pin' | 'lock' | 'unlock' | 'passphrase' | 'session-clear' | 'firmware-update' | 'transport-reconnect' | 'compatibility'; type DeviceStateIdentity = { deviceType: IDeviceType; firmwareType: EFirmwareType; model: string | null; vendor: string | null; deviceId: string | null; serialNo: string; label: string | null; bleName: string | null; }; type DeviceStateStatus = { mode: DeviceStateMode; initialized: boolean | null; unlocked: boolean | null; firmwarePresent: boolean | null; backupRequired: boolean | null; noBackup: boolean | null; unfinishedBackup: boolean | null; recoveryMode: boolean | null; passphraseProtection: boolean | null; pinProtection: boolean | null; /** `attach_to_pin_enabled`:是否至少存在一个 Attach PIN 绑定。 */ attachToPinEnabled: boolean | null; /** `unlocked_by_attach_to_pin`:本次解锁是否由 Attach PIN 完成。 */ unlockedAttachPin: boolean | null; }; type DeviceStateSettings = { language: string | null; bleEnabled: boolean | null; sdCardPresent: boolean | null; sdProtection: boolean | null; wipeCodeProtection: boolean | null; passphraseAlwaysOnDevice: boolean | null; safetyChecks: Enum_SafetyCheckLevel | null; autoLockDelayMs: number | null; autoShutdownDelayMs: number | null; displayRotation: number | null; experimentalFeatures: boolean | null; wallpaperPath: string | null; brightness: number | null; animationEnabled: boolean | null; tapToWake: boolean | null; hapticFeedback: boolean | null; deviceNameDisplayEnabled: boolean | null; airgapMode: boolean | null; fidoEnabled: boolean | null; usbLockEnabled: boolean | null; randomKeypad: boolean | null; }; type DeviceStateVersions = { firmware: string | null; applicationP1?: string | null; applicationP2?: string | null; bootloader: string | null; board: string | null; ble: string | null; /** @deprecated Kept for legacy consumers; new code should read se01. */ se?: string | null; se01?: string | null; se02?: string | null; se03?: string | null; se04?: string | null; se01Boot?: string | null; se02Boot?: string | null; se03Boot?: string | null; se04Boot?: string | null; }; type DeviceStateSecurityElement = { type: string | null; state: string | null; }; type DeviceStateSecurityElements = Partial>; type DeviceStateSecurityElementsPatch = Partial>>; type DeviceState = { schemaVersion: 1; revision: number; updatedAt: number; protocol: DeviceStateProtocol; /** Device-message protocol version, independent of the SDK V1/V2 protocol family. */ protocolVersion: number | null; identity: DeviceStateIdentity; status: DeviceStateStatus; settings: DeviceStateSettings; versions: DeviceStateVersions; /** Secure-element metadata exposed by the unified firmware information read. */ securityElements?: DeviceStateSecurityElements; capabilities: Array; verification?: Partial; }; type DeviceStatePatch = { protocol?: DeviceStateProtocol; protocolVersion?: number | null; identity?: Partial; status?: Partial; settings?: Partial; versions?: Partial; securityElements?: DeviceStateSecurityElementsPatch; capabilities?: Array; verification?: DeviceFeaturesVerify; raw?: DeviceFeaturesRawPatch; }; type DeviceStateEvent = { connectId: string | null; state: DeviceState; revision: number; source: DeviceStateUpdateSource; changedKeys: string[]; }; type NormalizedFeatures = { protocol: DeviceFeaturesProtocol; protocolVersion?: number | null; deviceType: IDeviceType; firmwareType: EFirmwareType; model: string | null; vendor: string | null; deviceId: string | null; serialNo: string; label: string | null; bleName: string | null; capabilities: Array; mode: DeviceFeaturesMode; initialized: boolean | null; bootloaderMode: boolean | null; unlocked: boolean | null; firmwarePresent: boolean | null; passphraseProtection: boolean | null; pinProtection: boolean | null; backupRequired: boolean | null; noBackup: boolean | null; unfinishedBackup: boolean | null; recoveryMode: boolean | null; language: string | null; bleEnabled: boolean | null; sdCardPresent: boolean | null; sdProtection: boolean | null; wipeCodeProtection: boolean | null; passphraseAlwaysOnDevice: boolean | null; /** `attach_to_pin_enabled`:是否至少存在一个 Attach PIN 绑定。 */ attachToPinEnabled?: boolean | null; safetyChecks: Enum_SafetyCheckLevel | null; autoLockDelayMs: number | null; autoShutdownDelayMs: number | null; displayRotation: number | null; experimentalFeatures: boolean | null; wallpaperPath: string | null; brightness: number | null; animationEnabled: boolean | null; tapToWake: boolean | null; hapticFeedback: boolean | null; deviceNameDisplayEnabled: boolean | null; airgapMode: boolean | null; fidoEnabled: boolean | null; usbLockEnabled: boolean | null; randomKeypad: boolean | null; firmwareVersion: string | null; bootloaderVersion: string | null; boardVersion: string | null; bleVersion: string | null; se01Version?: string | null; se02Version?: string | null; se03Version?: string | null; se04Version?: string | null; se01BootVersion?: string | null; se02BootVersion?: string | null; se03BootVersion?: string | null; se04BootVersion?: string | null; seVersion?: string | null; verify?: DeviceFeaturesVerify; sessionId: string | null; passphraseState?: string; unlockedAttachPin?: boolean; raw?: DeviceFeaturesRaw; }; type Features = NormalizedFeatures & Partial> & Partial>; type OnekeyFeatures = Messages.OnekeyFeatures; type IDeviceType = EDeviceType.Unknown | EDeviceType.Classic | EDeviceType.Classic1s | EDeviceType.ClassicPure | EDeviceType.Mini | EDeviceType.Touch | EDeviceType.Pro | EDeviceType.Pro2 | EDeviceType.Neo; /** * model_classic: 'classic' | 'classic1s' | 'classicpure' * model_mini: 'classic' | 'classic1s' | 'classicpure' | 'mini' * model_touch: 'touch' | 'pro' * model_pro2: 'pro2' | 'neo' */ type IDeviceModel = 'model_classic' | 'model_mini' | 'model_touch' | 'model_classic1s' | 'model_pro2'; declare const DeviceModelToTypes: { [deviceModel in IDeviceModel]: IDeviceType[]; }; declare const DeviceTypeToModels: { [deviceType in IDeviceType]: IDeviceModel[]; }; type IDeviceFirmwareStatus = 'valid' | 'outdated' | 'required' | 'unknown' | 'none'; type IDeviceBLEFirmwareStatus = 'valid' | 'outdated' | 'required' | 'unknown' | 'none'; type ITransportStatus = 'valid' | 'outdated'; type IVersionRange = { min: string; max?: string; }; type DeviceFirmwareRange = { [deviceType in IDeviceType | IDeviceModel]?: IVersionRange; }; type FeaturesNarrowing = { major_version: 2; fw_major: null; fw_minor: null; fw_patch: null; bootloader_mode: true; firmware_present: false; } | { major_version: 2; fw_major: null; fw_minor: null; fw_patch: null; bootloader_mode: null; firmware_present: null; } | { major_version: 2; fw_major: 2; fw_minor: number; fw_patch: number; bootloader_mode: true; firmware_present: true; } | { major_version: 1; fw_major: null; fw_minor: null; fw_patch: null; bootloader_mode: true; firmware_present: false; } | { major_version: 1; fw_major: null; fw_minor: null; fw_patch: null; bootloader_mode: true; firmware_present: true; }; type StrictFeatures = Features & FeaturesNarrowing; type SupportFeatureType = { support: boolean; require?: string; }; type SupportFeatures = { inputPinOnSoftware: SupportFeatureType; modifyHomescreen: SupportFeatureType; }; type DeviceStateScope = 'runtime' | 'settings' | 'firmware'; type GetDeviceStateParams = CommonParams & { scope?: DeviceStateScope; }; /** Internal state-read options, not part of the public CoreApi. */ type DeviceStateReadOptions = { refreshSections?: DeviceStateSection[]; includeRaw?: boolean; }; declare function getDeviceState(connectId?: string, params?: GetDeviceStateParams): Response; type DeviceDescriptorDiff = { didUpdate: boolean; connected: OneKeyDeviceInfo[]; disconnected: OneKeyDeviceInfo[]; changedSessions: OneKeyDeviceInfo[]; changedDebugSessions: OneKeyDeviceInfo[]; acquired: OneKeyDeviceInfo[]; debugAcquired: OneKeyDeviceInfo[]; released: OneKeyDeviceInfo[]; debugReleased: OneKeyDeviceInfo[]; descriptors: OneKeyDeviceInfo[]; }; declare class DeviceConnector { transport?: Transport; listenTimestamp: number; current: OneKeyDeviceInfo[] | null; upcoming: OneKeyDeviceInfo[]; listening: boolean; constructor(); private getActiveTransport; enumerate(): Promise; listen(): Promise; stop(): void; acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean, expectedProtocol?: HardwareConnectProtocol, protocolHint?: HardwareConnectProtocol, forceProtocolDetection?: boolean, skipProtocolProbe?: boolean): Promise; release(session: string, onclose: boolean, keepSession?: boolean): Promise; disconnect(session: string | undefined | null): Promise; promptDeviceAccess(): Promise; _reportDevicesChange(): void; } type InitOptions = { initSession?: boolean; deviceId?: string; passphraseState?: string; deriveCardano?: boolean; connectProtocol?: HardwareConnectProtocol; forceProtocolDetection?: boolean; protocolV2DeviceInfoTimeoutMs?: number; /** Refresh Protocol V2 runtime state before returning discovery results. */ refreshRuntimeState?: boolean; /** * Protocol V1 Initialize response timeout override. Reboot-wait polling passes a * short value so an unanswered probe settles before the next poll tick. */ timeoutMs?: number; }; type RunOptions = { keepSession?: boolean; skipInitialize?: boolean; } & InitOptions; interface DeviceEvents { [DEVICE.PIN]: [Device, Messages.PinMatrixRequestType | undefined, (err: any, pin: string) => void]; [DEVICE.PIN_ON_DEVICE]: [Device, DeviceSessionPinType, ProtocolV2UiEventMetadata?]; [DEVICE.PIN_ON_DEVICE_COMPLETE]: [Device, HardwareUiInteractionMeta]; [DEVICE.PASSPHRASE_ON_DEVICE]: [Device, PassphraseRequestPayload?]; [DEVICE.ATTACH_PIN_ON_DEVICE]: [Device, PassphraseRequestPayload?]; [DEVICE.BUTTON]: [Device, DeviceButtonRequestPayload]; [DEVICE.FEATURES]: [Device, DeviceFeaturesPayload]; [DEVICE.STATE]: [Device, DeviceStateEvent]; [DEVICE.PASSPHRASE]: [ Device, PassphraseRequestPayload, (response: PassphrasePromptResponse, error?: Error) => void ]; [DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE]: [ Device, (err: any, deviceId: string) => void ]; [DEVICE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE]: [ Device, (err: any, deviceId: string) => void ]; } /** * Pre-populate the device session cache with a known session ID. * * This allows short-lived processes (e.g. CLI) to restore a previously * obtained session, avoiding the need to re-enter passphrase on every * invocation. The session must have been obtained from a prior * wallet-session call on the same device. This compatibility hook is intended * for a trusted CLI process restoring its own OS-keychain entry. * * @param deviceId - The device's device_id (from features) * @param passphraseState - The passphrase state token * @param sessionId - The session_id to cache (from features.session_id) */ declare function preloadSessionCache(deviceId: string, passphraseState: string, sessionId: string): void; interface Device { on(type: K, listener: (...event: DeviceEvents[K]) => void): this; off(type: K, listener: (...event: DeviceEvents[K]) => void): this; emit(type: K, ...args: DeviceEvents[K]): boolean; } declare class Device extends EventEmitter { /** * 设备标识对象 */ originalDescriptor: OneKeyDeviceInfo; sdkInstanceId?: string; /** * 设备实例唯一标识 */ instanceId: string; createdAt: number; /** * 设备主 ID * 蓝牙连接时是设备的 UUID * USB连接时是设备的 sessionID */ mainId?: string | null; /** * 通信管道,向设备发送请求 */ deviceConnector?: DeviceConnector | null; /** * 固件命令 */ commands: DeviceCommands; /** * 可取消的操作 */ private cancelableAction?; /** * 设备是否被占用 */ private deviceAcquired; /** * Connection-attempt generation. interruptionFromUser() pins the current * attempt so a late acquire cannot finish, while the next public connect * increments this and is allowed to proceed. */ private connectionAttempt; private interruptedAttempt; /** Canonical device-state cache; legacy Features is a compatibility projection. */ private stateStore; /** Force the next initialization to reload DeviceInfo after reconnect or reboot. */ private protocolV2StateNeedsReload; /** Runtime context negotiated once per active Protocol V2 link. */ private protocolV2RuntimeContext?; /** Coalesces concurrent first-use runtime negotiation on the same active link. */ private protocolV2RuntimeContextPromise?; /** Invalidates an in-flight runtime-context response without adding a transport epoch. */ private protocolV2RuntimeContextRequestToken?; private protocolV2UiInteraction?; private protocolV2UiInteractionCounter; get state(): (DeviceState & { raw?: DeviceFeaturesRaw | undefined; }) | undefined; get features(): Features | undefined; set features(features: Features | undefined); runPromise?: Deferred | null; /** Resolves only after the active run has completed its release path. */ private runCleanupPromise?; private userInterruption?; externalState: string[]; unavailableCapabilities: UnavailableCapabilities; instance: number; internalState: string[]; needReloadDevice: boolean; /** * 执行 API 方法后是否保留 SessionID */ keepSession: boolean; passphraseState: string | undefined; pendingCallbackPromise?: Deferred; /** Pre-initialize timestamp (ms) */ private preInitializedAt?; /** Pre-initialize context, used to verify state consistency before skipping */ private preInitializeMeta?; /** Last Initialize duration (ms), reported as "saved" when a skip happens */ private lastInitializeDurationMs?; constructor(descriptor: OneKeyDeviceInfo, sdkInstanceId?: string); static fromDescriptor(originalDescriptor: OneKeyDeviceInfo, sdkInstanceId?: string): Device; toMessageObject(): Device$1 | null; /** * Device connect * @returns {Promise} */ connect(connectProtocol?: HardwareConnectProtocol, options?: { forceProtocolDetection?: boolean; }): Promise; acquire(expectedProtocol?: HardwareConnectProtocol, options?: { throwOnRunPromiseError?: boolean; forceProtocolDetection?: boolean; }): Promise; release(): Promise; /** * Pre-initialize: connect + Initialize ahead of the sign. */ preInitialize(initOptions?: InitOptions): Promise; markPreInitialized(meta?: { passphraseState?: string; }): void; clearPreInitialized(): void; isPreInitializeMetaMatch(payload?: { passphraseState?: string; }): boolean; isPreInitializedValid(ttlMs: number): boolean; setLastInitializeDuration(durationMs: number): void; getLastInitializeDuration(): number | undefined; getCommands(): DeviceCommands; /** * Canonical protocol discriminator. * * descriptor.protocolType is established by active probing; V2 features are mapped * from DeviceInfoGet. All protocol branches must use this method instead of reading * originalDescriptor.protocolType directly or inferring a protocol from features. */ getProtocol(): 'V1' | 'V2'; isProtocolV2(): boolean; getCurrentDeviceType(): IDeviceType; getCurrentDeviceId(): string | undefined; getCurrentSerialNo(): string; getConnectId(): string; getCurrentBleName(): string | null; getCurrentLabel(): string | null; getCurrentDisplayName(): string | null; getCurrentPassphraseProtection(): boolean | null | undefined; getCurrentFirmwareType(): EFirmwareType; getCurrentFirmwareVersionString(): string; getCurrentBLEFirmwareVersionString(): string | undefined; getCurrentBootloaderVersionString(): string | undefined; getCurrentSafetyChecks(): _onekeyfe_hd_transport.Enum_SafetyCheckLevel | null | undefined; getCurrentMethodVersionRange(getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined): IVersionRange | undefined; supportNewPassphrase(): SupportFeatureType; supportInputPinOnSoftware(): SupportFeatureType; supportModifyHomescreen(): SupportFeatureType; private getSessionCacheDeviceKey; private reconcileSessionCacheDeviceIdentity; getInternalState(_deviceId?: string): string | undefined; getStandardInternalState(_deviceId?: string): { passphraseState: string; sessionId: string; } | undefined; updateInternalState(enablePassphrase: boolean, passphraseState: string | undefined, deviceId: string | undefined, sessionId?: string | null, featuresSessionId?: string | null, walletType?: 'standard' | 'hidden'): void; private setInternalState; clearInternalState(_deviceId?: string): void; clearStandardInternalState(_deviceId?: string): void; initialize(options?: InitOptions): Promise; /** * Device initialization over Protocol V2. * * Protocol V2 bypasses legacy Initialize/GetFeatures and builds its canonical * features state directly from DeviceInfoGet. */ private _initializeProtocolV2; getFeatures(): Promise; getDeviceState(params?: DeviceStateReadOptions): Promise; refreshProtocolV2SettingsAfterMutation(): Promise; _updateFeatures(protoFeatures: Messages.Features | Features, initSession?: boolean): void; updateState(patch: DeviceStatePatch, source: DeviceStateUpdateSource): DeviceState & { raw?: DeviceFeaturesRaw | undefined; }; updateFeaturesPatch(patch: Partial, source: DeviceStateUpdateSource): Features | undefined; ensureProtocolV2RuntimeContext(timeoutMs?: number, options?: { forceRefresh?: boolean; }): Promise; probeProtocolV2RuntimeState(deviceInfo?: ProtocolV2DeviceInfo, timeoutMs?: number, options?: { forceRuntimeContextRefresh?: boolean; }): Promise; updateProtocolV2Features(deviceInfo?: ProtocolV2DeviceInfo, deviceStatus?: DeviceStatus$1 | null, runtimeMode?: ProtocolV2RuntimeMode, protocolInfo?: ProtocolInfo): Features; updateProtocolV2Status(status: DeviceStatus$1): Features; private invalidateProtocolV2RuntimeState; markTransportDisconnected(): void; invalidateAfterWipe(): void; markProtocolV2Reboot(rebootType: DeviceRebootType): void; /** * 暂时只在 acquire 后更新 Session ID * 后续看是否有需要依据 listen 返回结果更新 * @param descriptor */ updateDescriptor(descriptor: OneKeyDeviceInfo, forceUpdate?: boolean): void; updateFromCache(device: Device): void; waitForRunCleanup(): Promise; run(fn?: () => Promise, options?: RunOptions): Promise; _runInner(fn: (() => Promise) | undefined, options: RunOptions, runPromise: Deferred): Promise; interruptionFromOutside(): Promise; interruptionFromUser(): Promise; setCancelableAction(callback: (err?: Error) => Promise): void; clearCancelableAction(): void; getMode(): EOneKeyDeviceMode; getStatus(): "available" | "occupied" | "used"; getFirmwareVersion(): IVersionArray | null; getBLEFirmwareVersion(): IVersionArray | null; isUsed(): boolean; beginConnectionAttempt(): number; wasInterruptedByUser(): boolean; private throwIfInterruptedByUser; /** * Protocol Cancel is only for an acquired session that is already in a * user-facing prompt. Connect, probe and initialize must not send Cancel * and must not re-acquire just to deliver one. */ private shouldSendFallbackProtocolCancel; hasDeviceAcquire(): boolean; isUsedHere(): boolean; isUsedElsewhere(): boolean; isBootloader(): boolean | undefined; isRomloader(): boolean | undefined; isInitialized(): boolean | undefined; isSeedless(): boolean | undefined; isUnacquired(): boolean; hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null; hasUsePassphrase(): boolean; checkDeviceId(deviceId: string): boolean; lockDevice(): Promise; beginProtocolV2UiInteraction(): void; createProtocolV2UiPhaseMetadata(phase: HardwareUiInteractionMeta['phase'], transition: HardwareUiInteractionMeta['transition'], options?: { phaseId?: string; outcome?: HardwareUiInteractionMeta['outcome']; }): HardwareUiInteractionMeta | undefined; completeProtocolV2UiPhase(phase: HardwareUiInteractionMeta, outcome?: HardwareUiInteractionMeta['outcome']): HardwareUiInteractionMeta | undefined; finishProtocolV2UiInteraction(outcome?: HardwareUiInteractionMeta['outcome'], options?: { ensureMetadata?: boolean; }): HardwareUiInteractionMeta | undefined; hasOpenProtocolV2UiInteraction(): boolean; supportUnlockVersionRange(): DeviceFirmwareRange; unlockDevice(pinType?: DeviceSessionPinType, options?: ProtocolV2UiEventMetadata & { emitUiEvent?: boolean; }): Promise; checkPassphraseStateSafety(passphraseState?: string, useEmptyPassphrase?: boolean, skipPassphraseCheck?: boolean, deriveCardano?: boolean, mainPinSelected?: boolean): Promise; } /** * SDK Tracing Utilities * Tracks object instances and request call chains across multiple SDK instances */ /** * Generate SDK instance ID * @returns Format: "SDK--" * @example "SDK-1-123456" */ declare function generateSdkInstanceId(): string; /** * Generate globally unique instance ID * @param type Instance type (Device, DeviceCommands, BaseMethod, etc.) * @param sdkInstanceId SDK instance ID (optional) * @returns Format: .-- * @example "SDK-1.Device-1-123456" or "Device-1-123456" */ declare function generateInstanceId(type: string, sdkInstanceId?: string): string; /** * Request context information */ interface RequestContext { /** Request unique ID (reuses BaseMethod.responseID) */ responseID: number; /** SDK instance ID */ sdkInstanceId?: string; /** API method name */ methodName: string; /** Device connection ID */ connectId?: string; /** Device instance ID */ deviceInstanceId?: string; /** DeviceCommands instance ID */ commandsInstanceId?: string; /** Parent request ID (for nested calls like allNetworkGetAddress) */ parentResponseID?: number; /** Request start time */ startTime: number; /** Request end time */ endTime?: number; /** Request status */ status?: 'pending' | 'running' | 'success' | 'error' | 'cancelled'; /** Error message */ error?: string; } /** * SDK instance tracing context */ interface SdkTracingContext { /** SDK instance ID */ sdkInstanceId: string; /** Creation timestamp */ createdAt: number; /** Active requests */ activeRequests: Map; } /** * Create SDK instance tracing context */ declare function createSdkTracingContext(): SdkTracingContext; /** * Create and register request context * @param responseID Request ID (reuses BaseMethod.responseID) * @param methodName API method name * @param options Additional options */ declare function createRequestContext(responseID: number, methodName: string, options?: { sdkInstanceId?: string; connectId?: string; deviceInstanceId?: string; commandsInstanceId?: string; parentResponseID?: number; }): RequestContext; /** * Update request context */ declare function updateRequestContext(responseID: number, updates: Partial): void; /** * Complete request context */ declare function completeRequestContext(responseID: number, error?: Error): void; /** * Get active requests for specific Device instance */ declare function getActiveRequestsByDeviceInstance(deviceInstanceId: string): RequestContext[]; /** * Format request context for logging */ declare function formatRequestContext(context: RequestContext): string; /** * Cleanup specific SDK instance */ declare function cleanupSdkInstance(sdkInstanceId: string): void; declare class Core extends EventEmitter { private tracingContext; readonly sdkInstanceId: string; private requestQueue; private disposePromise?; private prePendingCallPromises; private methodSynchronize; constructor(); private getCoreContext; handleMessage(message: CoreMessage): Promise; dispose(): Promise; private disposeResources; } declare const init$1: (settings: ConnectSettings, Transport: any, plugin?: LowlevelTransportSharedPlugin) => Promise; declare const switchTransport: ({ env, Transport, plugin, }: { env: ConnectSettings['env']; Transport: any; plugin?: LowlevelTransportSharedPlugin | undefined; }) => void; type UploadPortfolioParams = { packageBase64: string; timeoutMs?: number | string; /** Controls transfer progress UI events. Defaults to `silent`. */ uiMode?: 'silent' | 'progress'; }; declare const PRO2_WALLPAPER_WIDTH = 604; declare const PRO2_WALLPAPER_HEIGHT = 1024; type Pro2WallpaperColorFormat = 'RGB565' | 'RGB565A8'; declare function encodePro2Wallpaper(options: { width: number; height: number; rgba: Uint8Array | ArrayBuffer; }): { data: Uint8Array; colorFormat: Pro2WallpaperColorFormat; }; type DeviceUploadWallpaperParams = { jpegBase64: string; /** * Legacy firmware uses this name for the uploaded `.bin` file. Firmware * 1.0.1+ always consumes the fixed `wallpaper.okpkg` package path. */ fileName?: string; chunkSize?: number; }; type DeviceUploadWallpaperResponse = { /** * Filesystem path sent to `DeviceSettingsSet`. On firmware 1.0.1+ this is * the temporary package path; firmware extracts and persists wallpaper.bin. */ path: string; size: number; colorFormat: Pro2WallpaperColorFormat; message?: string; }; type DeviceUploadNftParams = { imageJpegBase64: string; thumbnailJpegBase64: string; title: string; subtitle: string; timestampMs?: number; chunkSize?: number; paceMs?: number; timeoutMs?: number; }; type DeviceUploadNftResponse = { basename: string; /** Final image path after firmware extracts a host-asset package. */ imagePath: string; /** Final thumbnail path after firmware extracts a host-asset package. */ thumbnailPath: string; /** Final metadata path after firmware extracts a host-asset package. */ metadataPath: string; totalSize: number; nftUpdated: true; message?: string; }; type FileInfo = { path: string; offset: number; total_size: number; data?: Uint8Array; data_hash?: number; processed_byte?: number; chunks?: number; }; type TestProtocolV2PingParams = CommonParams & { /** Firmware diagnostic echo payload, limited to 63 UTF-8 bytes. */ message?: string; }; declare function testProtocolV2Ping(connectId: string, params?: TestProtocolV2PingParams): Response; declare function deviceReboot(connectId: string, params: CommonParams & DeviceRebootParams): Response; declare function deviceGetOnboardingStatus(connectId: string, params?: CommonParams): Response; declare function deviceUploadWallpaper(connectId: string, params: CommonParams & DeviceUploadWallpaperParams): Response; declare function deviceUploadNft(connectId: string, params: CommonParams & DeviceUploadNftParams): Response; declare function uploadPortfolio(connectId: string, params: UploadPortfolioParams): Response; declare const on: any>(type: T, fn: P) => void; declare const off: (type: any, fn: any) => void; declare const removeAllListeners: (type: any) => void; declare function uiResponse(response: UiResponseEvent): void; type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void; interface LowLevelInjectApi { call: CallMethod; eventEmitter: EventEmitter$1; init: CoreApi['init']; dispose: CoreApi['dispose']; uiResponse: CoreApi['uiResponse']; cancel: CoreApi['cancel']; updateSettings: CoreApi['updateSettings']; switchTransport: CoreApi['switchTransport']; addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void; } type LowLevelCoreApi = Omit & { addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void; }; declare function init(settings: Partial, lowLevelApi?: LowLevelCoreApi, pulgin?: LowlevelTransportSharedPlugin): Promise; declare function updateSettings(settings: Partial): Promise; declare function testInitializeDeviceDuration(connectId?: string, params?: CommonParams): Response; declare function preInitialize(connectId: string, params?: CommonParams): Response; declare function getLogs(): Response; type ClearSessionCacheParams = { deviceId?: never; passphraseState?: never; } | { deviceId: string; passphraseState?: string; }; type ClearSessionCachePayload = { cleared: true; }; declare function clearSessionCache(params?: ClearSessionCacheParams): Response; declare function checkBridgeStatus(): Response; type CheckBridgeReleaseResponse = { shouldUpdate: boolean; status: 'outdated' | 'valid'; releaseVersion: string; } | null; declare function checkBridgeRelease(connectId?: string, params?: CommonParams & { willUpdateFirmwareVersion?: string; }): Response; type FirmwareUpdatePlanArtifactRole = 'firmware' | 'ble' | 'bootloader' | 'resource' | 'component' | 'resourceBundle'; type FirmwareUpdatePlanTarget = 'firmware' | 'ble' | 'bootloader' | FirmwareUpdateV4Target; type FirmwareUpdatePlanForceTarget = 'firmware' | 'ble' | 'bootloader' | 'resource'; interface FirmwareUpdatePlanArtifact { artifactId: string; role: FirmwareUpdatePlanArtifactRole; target: FirmwareUpdatePlanTarget; url: string; container: 'raw' | 'zip'; logicalName?: string; expectedSize?: number; expectedSha256?: string; targetVersion?: string; } interface FirmwareUpdatePlan { schemaVersion: 2; planDigest: string; executor: 'v2' | 'v3' | 'v4'; deviceIdentity: string; deviceModel: string; firmwareType: EFirmwareType; platform: 'native' | 'desktop' | 'ext' | 'web' | 'web-embed'; artifacts: FirmwareUpdatePlanArtifact[]; targetsToUpdate: FirmwareUpdatePlanTarget[]; } interface FirmwareUpdatePreparedEntry { entryName: string; artifact: FirmwareArtifactReference; } interface FirmwareUpdatePreparedArtifactInput { artifactId: string; artifact: FirmwareArtifactReference; materializedEntries?: FirmwareUpdatePreparedEntry[]; } interface FirmwareUpdatePreparedArtifact { artifactId: string; role: FirmwareUpdatePlanArtifactRole; target: FirmwareUpdatePlanTarget; container: 'raw' | 'zip'; logicalName?: string; targetVersion?: string; artifact: FirmwareArtifactReference; materializedEntries?: FirmwareUpdatePreparedEntry[]; } interface FirmwareUpdatePreparedPlan { schemaVersion: 2; preparedPlanDigest: string; planDigest: string; networkPolicy: 'forbid'; executor: FirmwareUpdatePlan['executor']; deviceIdentity: string; deviceModel: string; firmwareType: FirmwareUpdatePlan['firmwareType']; platform: FirmwareUpdatePlan['platform']; leaseRef: string; artifacts: FirmwareUpdatePreparedArtifact[]; targetsToUpdate: FirmwareUpdatePlanTarget[]; } declare function prepareFirmwareUpdatePlan(input: { plan: FirmwareUpdatePlan; leaseRef: string; artifacts: FirmwareUpdatePreparedArtifactInput[]; }): FirmwareUpdatePreparedPlan; declare function validateFirmwareUpdatePreparedPlan(value: unknown): FirmwareUpdatePreparedPlan; type IUpdateType = 'firmware' | 'ble'; interface FirmwareArtifactReference { artifactRef: string; size: number; sha256: string; } interface FirmwareArtifactReader { open(input: { artifactRef: string; }): Promise<{ readerId: string; size: number; }>; read(input: { readerId: string; offset: number; length: number; }): Promise<{ data: ArrayBuffer; bytesRead: number; eof: boolean; }>; close(input: { readerId: string; }): Promise; } interface FirmwareUpdateHostBinding { artifactReader: FirmwareArtifactReader; /** 将读取器 generation 绑定到包含 ZIP 条目的完整 PreparedPlan。 */ preparedPlanDigest: string; } interface FirmwareUpdateBinaryParams { binary: ArrayBuffer; updateType: IUpdateType; } interface FirmwareUpdateArtifactParams { preparedPlan: FirmwareUpdatePreparedPlan; hostBindingGeneration: number; /** @deprecated Core derives the component artifact from preparedPlan. */ artifact?: FirmwareArtifactReference; resourceEntries?: Array<{ entryName: string; artifact: FirmwareArtifactReference; }>; updateType: IUpdateType; forcedUpdateRes?: boolean; isUpdateBootloader?: boolean; firmwareType?: EFirmwareType; } interface FirmwareUpdateParams { version?: number[]; updateType: IUpdateType; forcedUpdateRes?: boolean; isUpdateBootloader?: boolean; firmwareType?: EFirmwareType; } declare function firmwareUpdate(connectId: string | undefined, params: Params & { rebootOnSuccess?: boolean; }): Response; declare function firmwareUpdate(connectId: string | undefined, params: Params & { rebootOnSuccess?: boolean; }): Response; type IPlatform = 'native' | 'desktop' | 'ext' | 'web' | 'web-embed'; type Platform = { platform: IPlatform; }; declare function firmwareUpdateV2(connectId: string | undefined, params: Params): Response; declare function firmwareUpdateV2(connectId: string | undefined, params: Params): Response; declare function firmwareUpdateV2(connectId: string | undefined, params: Params): Response; interface FirmwareUpdateV3Params { preparedPlan?: FirmwareUpdatePreparedPlan; hostBindingGeneration?: number; bleVersion?: number[]; bleBinary?: ArrayBuffer; chunkSize?: number; firmwareVersion?: number[]; firmwareBinary?: ArrayBuffer; bootloaderVersion?: number[]; bootloaderBinary?: ArrayBuffer; resourceBinary?: ArrayBuffer; forcedUpdateRes?: boolean; firmwareType?: EFirmwareType; platform: IPlatform; artifactReader?: FirmwareArtifactReader; artifacts?: { ble?: FirmwareArtifactReference; firmware?: FirmwareArtifactReference; bootloader?: FirmwareArtifactReference; resourceEntries?: Array<{ entryName: string; artifact: FirmwareArtifactReference; }>; }; } /** * firmwareUpdateV4 target binaries grouped by DeviceFirmwareTargetType. * Except for romloader, each field maps to a target accepted by bootloader. */ type FirmwareUpdateV4Target = 'boot' /** @deprecated Use resource with resourceArchiveBinary. */ | 'boot_resources' | 'app_v1' | 'app_v2' | 'coprocessor' | 'resource' | 'se01' | 'se02' | 'se03' | 'se04'; interface FirmwareUpdateV4Params { preparedPlan?: FirmwareUpdatePreparedPlan; /** Required whenever preparedPlan is present; Core resolves the reader from this digest-bound host. */ hostBindingGeneration?: number; platform: IPlatform; expectedDeviceId?: string; chunkSize?: number; firmwareType?: EFirmwareType; targetsToUpdate?: FirmwareUpdateV4Target[]; expectedTargetVersions?: Partial>; /** FW_MGMT_TARGET_ROMLOADER = 2; Pro2 cannot install it through firmwareUpdateV4. */ romloaderBinary?: ArrayBuffer; /** FW_MGMT_TARGET_BOOTLOADER = 3 */ bootloaderBinary?: ArrayBuffer; /** FW_MGMT_TARGET_APPLICATION_P1 = 4 */ applicationP1Binary?: ArrayBuffer; /** FW_MGMT_TARGET_APPLICATION_P2 = 5 */ applicationP2Binary?: ArrayBuffer; /** FW_MGMT_TARGET_COPROCESSOR = 6 */ coprocessorBinary?: ArrayBuffer; /** FW_MGMT_TARGET_SE01-04 = 7-10 */ se01Binary?: ArrayBuffer; se02Binary?: ArrayBuffer; se03Binary?: ArrayBuffer; se04Binary?: ArrayBuffer; /** Complete Protocol V2 resource ZIP. Core parses RESC packages and writes only changed files. */ resourceArchiveBinary?: ArrayBuffer; forcedUpdateRes?: boolean; artifactReader?: FirmwareArtifactReader; componentArtifacts?: Partial, FirmwareArtifactReference>>; } declare function registerFirmwareUpdateHostBinding$1(binding: FirmwareUpdateHostBinding): number; declare function unregisterFirmwareUpdateHostBinding$1(generation?: number): boolean; declare function getFirmwareUpdateHostBindingGeneration$1(): number; declare function firmwareUpdateV3(connectId: string | undefined, params: Params): Response<{ bleVersion: string; firmwareVersion: string; bootloaderVersion: string; }>; declare function firmwareUpdateV4(connectId: string | undefined, params: Params): Response<{ bleVersion: string; firmwareVersion: string; bootloaderVersion: string; }>; type ProtocolV2ComponentReleaseInfo = IProtocolV2FirmwareComponent & { protocol: 'V2'; configKey: string; componentTarget: IProtocolV2FirmwareComponentTarget; required: boolean; changelog: IFirmwareReleaseInfo['changelog']; }; type FirmwareReleaseCheckResult = { shouldUpdate?: boolean; status: IDeviceFirmwareStatus; changelog?: { 'zh-CN': string; 'en-US': string; }[]; release: IBLEFirmwareReleaseInfo | IFirmwareReleaseInfo | ProtocolV2ComponentReleaseInfo | undefined; bootloaderMode?: boolean; }; type BridgeReleaseCheckResult = Omit & { release: string | undefined; }; type ProtocolV2FirmwareComponentReleaseStatus = 'valid' | 'outdated' | 'unknown' | 'unsupported'; type ProtocolV2FirmwareReleaseStatus = 'unavailable' | 'valid' | 'unknown' | 'outdated' | 'required'; type ProtocolV2FirmwareComponentRelease = { configKey: string; componentTarget: IProtocolV2FirmwareComponentTarget; updateTarget: FirmwareUpdateV4Target | null; currentVersion: string | null; targetVersion: string | null; status: ProtocolV2FirmwareComponentReleaseStatus; required: boolean; }; type AllFirmwareRelease = { firmware: FirmwareReleaseCheckResult; ble: FirmwareReleaseCheckResult; bootloader?: FirmwareReleaseCheckResult; bridge?: BridgeReleaseCheckResult; features?: Features; protocol?: 'V1' | 'V2'; deviceType?: 'pro2' | 'neo'; firmwareType?: EFirmwareType; status?: ProtocolV2FirmwareReleaseStatus; hasUpgrade?: boolean; required?: boolean; resourceStatus?: 'valid' | 'outdated' | 'unknown'; resourceArchive?: IProtocolV2ResourceSource; currentVersions?: DeviceStateVersions; components?: ProtocolV2FirmwareComponentRelease[]; targetsToUpdate?: FirmwareUpdateV4Target[]; release?: IFirmwareReleaseInfo; firmwareUpdatePlan?: FirmwareUpdatePlan; }; type CheckAllFirmwareReleaseParams = { checkBridgeRelease?: boolean; checkFirmwareHash?: boolean; firmwareType?: EFirmwareType; platform?: 'native' | 'desktop' | 'ext' | 'web' | 'web-embed'; forceUpdateTargets?: FirmwareUpdatePlanForceTarget[]; protocolV2ForceUpdateTargets?: FirmwareUpdateV4Target[]; }; declare function checkAllFirmwareRelease(connectId?: string, params?: CommonParams & CheckAllFirmwareReleaseParams): Response; type CheckBootloaderReleaseResponse = FirmwareReleaseCheckResult | null; type CheckBootloaderReleaseParams = { willUpdateFirmwareVersion?: string; firmwareType?: EFirmwareType; }; declare function checkBootloaderRelease(connectId?: string, params?: CommonParams & CheckBootloaderReleaseParams): Response; type CheckFirmwareTypeAvailableParams = { deviceType: EDeviceType; firmwareType: EFirmwareType; }; declare function checkFirmwareTypeAvailable(params: CheckFirmwareTypeAvailableParams): Response; declare function searchDevices(params?: CommonParams): Response; declare function detectDeviceConnectProtocol(connectId: string): Response; /** * @deprecated Use `getDeviceState` for both Protocol V1 and Protocol V2. * Existing calls still work. Read `payload.identity.deviceId` from `getDeviceState`. */ declare function getFeatures(connectId?: string, params?: CommonParams): Response; /** * @deprecated Use `getDeviceState(connectId, { scope: 'firmware' })`. */ declare function getOnekeyFeatures(connectId?: string, params?: CommonParams): Response; type GetPassphraseStateParams = CommonParams; /** * @deprecated Use `openWalletSession` for both Protocol V1 and Protocol V2. * Existing calls still work. Persist `deviceId + passphraseState`; do not persist firmware `session_id`. */ declare function getPassphraseState(connectId?: string, params?: GetPassphraseStateParams): Response; declare const OpenWalletSessionMode: { readonly Standard: "standard"; readonly SelectHidden: "select-hidden"; }; type OpenWalletSessionModeValue = (typeof OpenWalletSessionMode)[keyof typeof OpenWalletSessionMode]; type OpenWalletSessionParams = { mode: OpenWalletSessionModeValue; deviceId?: never; passphraseState?: never; }; type OpenWalletSessionPayloadBase = { protocol: 'V1' | 'V2'; deviceId: string; resumed: boolean; }; type OpenWalletSessionPayload = OpenWalletSessionPayloadBase & ({ walletType: 'standard'; passphraseState: null; } | { walletType: 'hidden'; passphraseState: string; }); /** * Opens the standard or hidden wallet through a unified Protocol V1/V2 API. * Resume a bound hidden wallet by passing passphraseState on later methods. */ declare function openWalletSession(connectId: string, params: CommonParams & OpenWalletSessionParams): Response; type CheckFirmwareReleaseParams = { firmwareType?: EFirmwareType; }; declare function checkFirmwareRelease(connectId?: string, params?: CheckFirmwareReleaseParams): Response; declare function checkBLEFirmwareRelease(connectId?: string): Response; interface FirmwareUpdateCapabilities { planSchemaVersion: 2; preparedPlanSchemaVersion: 2; hostBindingProtocolVersion: 2; manifestModes: Array<'external-only' | 'sdk-managed'>; supportsArtifactReader: true; } declare function getFirmwareUpdateCapabilities(): FirmwareUpdateCapabilities; declare function promptWebDeviceAccess(options?: { deviceSerialNumberFromUI?: string; }): Response<{ device: KnownDevice | null; }>; type DeviceResetParams = { displayRandom?: boolean; strength?: number; passphraseProtection?: boolean; pinProtection?: boolean; language?: string; label?: string; u2fCounter?: number; skipBackup?: boolean; noBackup?: boolean; backupType?: string | number; }; declare function deviceReset(connectId: string, params: CommonParams & DeviceResetParams): Response; type DeviceRecoveryParams = { wordCount?: number; passphraseProtection?: boolean; pinProtection?: boolean; language?: string; label?: string; enforceWordlist?: boolean; type?: RecoveryDeviceType; u2fCounter?: number; dryRun?: boolean; }; declare function deviceRecovery(connectId: string, params: CommonParams & DeviceRecoveryParams): Response; type DeviceVerifyParams = { dataHex: string; }; type DeviceVerifySignature = { cert: string; signature: string; }; declare function deviceVerify(connectId: string, params: CommonParams & DeviceVerifyParams): Response; declare function deviceWipe(connectId: string): Response; declare function deviceRebootToBootloader(connectId: string): Response; declare function deviceRebootToBoardloader(connectId: string): Response; declare function deviceBackup(connectId: string): Response; type DeviceChangePinParams = { remove?: boolean; }; declare function deviceChangePin(connectId: string, params: CommonParams & DeviceChangePinParams): Response; type DeviceSettingsParams = { language?: string; label?: string; usePassphrase?: boolean; /** Protocol V1 only. */ homescreen?: string; /** Protocol V1 only. */ passphraseSource?: number; autoLockDelayMs?: number; /** Protocol V1 only. */ displayRotation?: number; /** Protocol V1 only. */ passphraseAlwaysOnDevice?: boolean; /** Protocol V1 only. Uses Enum_SafetyCheckLevel numeric values. */ safetyChecks?: Enum_SafetyCheckLevel; /** Protocol V1 only; the current Protocol V2 schema has no matching field. */ experimentalFeatures?: boolean; autoShutdownDelayMs?: number; /** Protocol V1 only; opens the legacy device-side brightness flow. */ changeBrightness?: boolean; /** Protocol V2 only. */ brightness?: number; hapticFeedback?: boolean; bluetoothEnabled?: boolean; /** Protocol V2 only; changed through an on-device confirmation page. */ airgapMode?: boolean; /** Protocol V2 only. */ animationEnabled?: boolean; /** Protocol V2 only. */ tapToWake?: boolean; /** Protocol V2 only. */ deviceNameDisplayEnabled?: boolean; /** Protocol V2 only. */ fidoEnabled?: boolean; /** Protocol V2 only. */ usbLockEnabled?: boolean; /** Protocol V2 only. */ randomKeypad?: boolean; }; declare function deviceSettings(connectId: string, params: CommonParams & DeviceSettingsParams): Response; type DeviceFlagsParams = { flags?: number; }; declare function deviceFlags(connectId: string, params: CommonParams & DeviceFlagsParams): Response; declare function deviceUpdateReboot(connectId: string): Response; type DeviceUploadResourceParams = { suffix: string; dataHex: string; thumbnailDataHex: string; blurDataHex: string; resType: ResourceType; nftMetaData: string; fileNameNoExt?: string; }; type DeviceUploadResourceResponse = Success$1 & { applyScreen?: boolean; }; declare function deviceUploadResource(connectId: string, params: CommonParams & DeviceUploadResourceParams): Response; type DeviceSupportFeatures = SupportFeatures & { device: Device$1 | null; }; declare function deviceSupportFeatures(connectId?: string): Response; declare function deviceFullyUploadResource(connectId: string, params: CommonParams & { binary?: ArrayBuffer; }): Response; type DeviceUpdateBootloaderParams = { preparedPlan?: FirmwareUpdatePreparedPlan; hostBindingGeneration?: number; binary?: ArrayBuffer; /** @deprecated Core derives the bootloader artifact from preparedPlan. */ artifact?: FirmwareArtifactReference; artifactReader?: FirmwareArtifactReader; firmwareType?: EFirmwareType; }; declare function deviceUpdateBootloader(connectId: string, params?: DeviceUpdateBootloaderParams): Response; declare function deviceLock(connectId: string, params: CommonParams): Response; type DeviceUnlockParams = { /** * 限定本次解锁允许使用的 PIN 类型。省略时保持兼容行为,仅允许主 PIN。 */ pinType?: DeviceSessionPinType; }; declare function deviceUnlock(connectId: string, params?: CommonParams & DeviceUnlockParams): Response; declare function deviceCancel(connectId: string, params: CommonParams): Response; declare function getNextU2FCounter(connectId?: string, params?: CommonParams): Response; declare function setU2FCounter(connectId?: string, params?: CommonParams & SetU2FCounter): Response; type CipheredKeyValue = { path: string; } & CipheredKeyValue$1; type CipheredKeyValueParams = { path: string | number[]; key: string; value: string; encrypt?: boolean; askOnEncrypt?: boolean; askOnDecrypt?: boolean; iv?: string; }; declare function cipherKeyValue(connectId: string, deviceId: string, params: CommonParams & CipheredKeyValueParams): Response; declare function cipherKeyValue(connectId: string, deviceId: string, params: CommonParams & { bundle?: CipheredKeyValueParams[]; }): Response>; interface CardanoAddressParameters { addressType: Messages.CardanoAddressType; path?: string | number[]; stakingPath?: string | number[]; stakingKeyHash?: string; certificatePointer?: CardanoCertificatePointer; paymentScriptHash?: string; stakingScriptHash?: string; } interface CardanoCertificatePointer { blockIndex: number; txIndex: number; certificateIndex: number; } interface CardanoToken { assetNameBytes: string; amount?: string; mintAmount?: string; } interface CardanoAssetGroup { policyId: string; tokenAmounts: CardanoToken[]; } interface CardanoDRep { type: Messages.CardanoDRepType; keyHash?: string; scriptHash?: string; } interface CardanoCertificate { type: Messages.CardanoCertificateType; path?: string | number[]; pool?: string; poolParameters?: CardanoPoolParameters; scriptHash?: string; keyHash?: string; deposit?: UintType; dRep?: CardanoDRep; } interface CardanoPoolOwner { stakingKeyPath?: string | number[]; stakingKeyHash?: string; } interface CardanoPoolRelay { type: Messages.CardanoPoolRelayType; ipv4Address?: string; ipv6Address?: string; port?: number; hostName?: string; } interface CardanoPoolMetadata { url: string; hash: string; } interface CardanoPoolMargin { numerator: string; denominator: string; } interface CardanoPoolParameters { poolId: string; vrfKeyHash: string; pledge: string; cost: string; margin: CardanoPoolMargin; rewardAccount: string; owners: CardanoPoolOwner[]; relays: CardanoPoolRelay[]; metadata: CardanoPoolMetadata; } interface CardanoInput { path?: string | number[]; prev_hash: string; prev_index: number; } type CardanoOutput = ({ addressParameters: CardanoAddressParameters; } | { address: string; }) & { amount: string; tokenBundle?: CardanoAssetGroup[]; datumHash?: string; format?: Messages.CardanoTxOutputSerializationFormat; inlineDatum?: string; referenceScript?: string; }; interface CardanoWithdrawal { path?: string | number[]; amount: string; scriptHash?: string; keyHash?: string; } type CardanoMint = CardanoAssetGroup[]; interface CardanoCollateralInput { path?: string | number[]; prev_hash: string; prev_index: number; } interface CardanoRequiredSigner { keyPath?: string | number[]; keyHash?: string; } interface CardanoReferenceInput { prev_hash: string; prev_index: number; } interface CardanoCVoteRegistrationDelegation { votePublicKey: string; weight: number; } interface CardanoCVoteRegistrationParameters { votePublicKey?: string; stakingPath: string | number[]; paymentAddressParameters: CardanoAddressParameters; nonce: string; format?: Messages.CardanoCVoteRegistrationFormat; delegations?: CardanoCVoteRegistrationDelegation[]; votingPurpose?: number; paymentAddress?: string; } interface CardanoAuxiliaryData { hash?: string; cVoteRegistrationParameters?: CardanoCVoteRegistrationParameters; } interface CardanoSignTransaction { inputs: CardanoInput[]; outputs: CardanoOutput[]; fee: string; ttl?: string; certificates?: CardanoCertificate[]; withdrawals?: CardanoWithdrawal[]; validityIntervalStart?: string; auxiliaryData?: CardanoAuxiliaryData; mint?: CardanoMint; scriptDataHash?: string; collateralInputs?: CardanoCollateralInput[]; requiredSigners?: CardanoRequiredSigner[]; collateralReturn?: CardanoOutput; totalCollateral?: string; referenceInputs?: CardanoReferenceInput[]; additionalWitnessRequests?: (string | number[])[]; protocolMagic: number; networkId: number; signingMode: Messages.CardanoTxSigningMode; derivationType?: Messages.CardanoDerivationType; includeNetworkId?: boolean; chunkify?: boolean; tagCborSets?: boolean; } interface CardanoSignedTxWitness { type: Messages.CardanoTxWitnessType; pubKey: string; signature: string; chainCode?: string; } interface CardanoAuxiliaryDataSupplement { type: Messages.CardanoTxAuxiliaryDataSupplementType; auxiliaryDataHash: string; cVoteRegistrationSignature?: string; } interface CardanoSignedTxData { hash: string; witnesses: CardanoSignedTxWitness[]; auxiliaryDataSupplement?: CardanoAuxiliaryDataSupplement; } type INetwork = 'evm' | 'btc' | 'tbtc' | 'doge' | 'neurai' | 'ltc' | 'bch' | 'sol' | 'algo' | 'near' | 'stc' | 'cfx' | 'tron' | 'aptos' | 'xrp' | 'cosmos' | 'ada' | 'sui' | 'fil' | 'dot' | 'kaspa' | 'nexa' | 'dynex' | 'nervos' | 'scdo' | 'ton' | 'alph' | 'nostr' | 'benfen' | 'neo' | 'stellar'; type AllNetworkAddressParams = { path: string | number[]; network: INetwork; chainName?: string; prefix?: string; showOnOneKey?: boolean; includePublicKey?: boolean; group?: string; useTweak?: boolean; }; type AllNetworkAddressPayload = { address: string; pub?: string; /** * @deprecated Use `pub` instead. */ publicKey?: string; npub?: string; } | { addressParameters: CardanoAddressParameters; protocolMagic: number; networkId: number; serializedPath: string; serializedStakingPath: string; address: string; xpub?: string; stakeAddress?: string; } | { node: { depth: number; fingerprint: number; child_num: number; chain_code: string; private_key: string | null; public_key: string; }; xpub: string; root_fingerprint: number; xpubSegwit: string; }; type AllNetworkAddress = AllNetworkAddressParams & { success: boolean; payload?: (AllNetworkAddressPayload & { rootFingerprint: number; }) | { error: string; code: number; connectId?: string; deviceId?: string; params: any; }; }; type AllNetworkGetAddressParams = { bundle: AllNetworkAddressParams[]; }; type AllNetworkGetAddressParamsByLoop = AllNetworkGetAddressParams & { callbackId?: string; callbackIdFinish?: string; onLoopItemResponse: (data?: AllNetworkAddress) => void; onAllItemsResponse: (data?: AllNetworkAddress[], error?: Unsuccessful) => void; }; declare function allNetworkGetAddress(connectId: string, deviceId: string, params: CommonParams & AllNetworkGetAddressParams): Response; declare function allNetworkGetAddressByLoop(connectId: string, deviceId: string, params: CommonParams & AllNetworkGetAddressParamsByLoop): Response; type EVMAddress = { path: string; address: string; }; type EVMGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; chainId?: number; }; declare function evmGetAddress(connectId: string, deviceId: string, params: CommonParams & EVMGetAddressParams): Response; declare function evmGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: EVMGetAddressParams[]; }): Response>; type EVMPublicKey = { path: string; pub: string; /** * @deprecated Use `pub` instead. */ publicKey?: string; } & EthereumPublicKey; type EVMGetPublicKeyParams = { path: string | number[]; showOnOneKey?: boolean; chainId?: number; useBatch?: boolean; }; declare function evmGetPublicKey(connectId: string, deviceId: string, params: CommonParams & EVMGetPublicKeyParams): Response; declare function evmGetPublicKey(connectId: string, deviceId: string, params: CommonParams & { bundle?: EVMGetPublicKeyParams[]; }): Response>; declare function evmGetPublicKey(connectId: string, deviceId: string, params: CommonParams & { bundle?: EVMGetPublicKeyParams[]; }): Response>; type EVMSignMessageParams = { path: string | number[]; messageHex: string; chainId?: number; }; declare function evmSignMessage(connectId: string, deviceId: string, params: CommonParams & EVMSignMessageParams): Response; type EVMSignMessageEIP712Params = { path: string | number[]; domainHash: string; messageHash: string; }; declare function evmSignMessageEIP712(connectId: string, deviceId: string, params: CommonParams & EVMSignMessageEIP712Params): Response; type EVMSignedTx = { v: string; r: string; s: string; authorizationSignatures?: EVMAuthorizationSignature[]; }; type EVMTransaction = { to: string; value: string; gasPrice: string; gasLimit: string; maxFeePerGas?: typeof undefined; maxPriorityFeePerGas?: typeof undefined; nonce: string; data?: string; chainId: number; txType?: number; }; type EVMAccessList = { address: string; storageKeys: string[]; }; type EVMTransactionEIP1559 = { to: string; value: string; gasLimit: string; gasPrice?: typeof undefined; nonce: string; data?: string; chainId: number; maxFeePerGas: string; maxPriorityFeePerGas: string; accessList?: EVMAccessList[]; }; type EVMAuthorizationSignature = { yParity: number; r: string; s: string; }; type EVMAuthorization = { chainId: number; address: string; nonce: string; addressN?: number[]; yParity?: number; r?: string; s?: string; }; type EVMTransactionEIP7702 = { to: string; value: string; gasLimit: string; gasPrice?: typeof undefined; nonce: string; data?: string; chainId: number; maxFeePerGas: string; maxPriorityFeePerGas: string; accessList?: EVMAccessList[]; authorizationList: EVMAuthorization[]; }; type EVMSignTransactionParams = { path: string | number[]; transaction: EVMTransaction | EVMTransactionEIP1559 | EVMTransactionEIP7702; }; declare function evmSignTransaction(connectId: string, deviceId: string, params: CommonParams & EVMSignTransactionParams): Response; type EthereumSignTypedDataTypeProperty = { name: string; type: string; }; type EthereumSignTypedDataTypes = { EIP712Domain: EthereumSignTypedDataTypeProperty[]; [additionalProperties: string]: EthereumSignTypedDataTypeProperty[]; }; type EthereumSignTypedDataMessage = { types: T; primaryType: keyof T; domain: { name?: string; version?: string; chainId?: number; verifyingContract?: string; salt?: ArrayBuffer; }; message: { [fieldName: string]: any; }; }; type EVMSignTypedDataParams = { path: string | number[]; metamaskV4Compat: boolean; data: EthereumSignTypedDataMessage; domainHash?: string; messageHash?: string; chainId?: number; }; declare function evmSignTypedData(connectId: string, deviceId: string, params: CommonParams & EVMSignTypedDataParams): Response; type EVMVerifyMessageParams = { address: string; messageHex: string; signature: string; chainId?: number; }; declare function evmVerifyMessage(connectId: string, deviceId: string, params: CommonParams & EVMVerifyMessageParams): Response; type BTCAddress = { path: string; } & Address; type BTCGetAddressParams = { path: string | number[]; coin?: string; showOnOneKey?: boolean; multisig?: MultisigRedeemScriptType; scriptType?: InputScriptType; }; declare function btcGetAddress(connectId: string, deviceId: string, params: CommonParams & BTCGetAddressParams): Response; declare function btcGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: BTCGetAddressParams[]; }): Response>; type BTCPublicKey = { path: string; xpubSegwit?: string; } & PublicKey; type BTCGetPublicKeyParams = { path: string | number[]; coin?: string; showOnOneKey?: boolean; scriptType?: InputScriptType; }; declare function btcGetPublicKey(connectId: string, deviceId: string, params: CommonParams & BTCGetPublicKeyParams): Response; declare function btcGetPublicKey(connectId: string, deviceId: string, params: CommonParams & { bundle?: BTCGetPublicKeyParams[]; }): Response>; type BTCSignMessageParams = { path: string | number[]; messageHex: string; coin?: string; noScriptType?: boolean; dAppSignType?: 'ecdsa' | 'bip322-simple'; }; declare function btcSignMessage(connectId: string, deviceId: string, params: CommonParams & BTCSignMessageParams): Response; type BTCSignPsbtParams = { psbt: string; coin?: string; }; declare function btcSignPsbt(connectId: string, deviceId: string, params: CommonParams & BTCSignPsbtParams): Response; type SignedTransaction = { signatures: string[]; serializedTx: string; txid?: string; }; type TransactionOptions = { version?: number; lock_time?: number; expiry?: number; overwintered?: boolean; version_group_id?: number; timestamp?: number; branch_id?: number; }; type RefTransaction = { hash: string; version: number; inputs: PrevInput[]; bin_outputs: TxOutputBinType[]; outputs?: typeof undefined; lock_time: number; extra_data?: string; expiry?: number; overwintered?: boolean; version_group_id?: number; timestamp?: number; branch_id?: number; } | { hash: string; version: number; inputs: TxInput[]; bin_outputs?: typeof undefined; outputs: TxOutputType[]; lock_time: number; extra_data?: string; expiry?: number; overwintered?: boolean; version_group_id?: number; timestamp?: number; branch_id?: number; }; type AccountAddress = { address: string; path: string; transfers?: number; balance?: string; sent?: string; received?: string; }; type AccountAddresses = { change: AccountAddress[]; used: AccountAddress[]; unused: AccountAddress[]; }; type BTCSignTransactionParams = { coin: string; inputs: TxInputType[]; outputs: TxOutputType[]; refTxs: RefTransaction[]; account?: { addresses: AccountAddresses; }; locktime?: number; version?: number; expiry?: number; overwintered?: boolean; versionGroupId?: number; branchId?: number; timestamp?: number; }; declare function btcSignTransaction(connectId: string, deviceId: string, params: CommonParams & BTCSignTransactionParams): Response; type BTCVerifyMessageParams = { address: string; messageHex: string; signature: string; coin: string; }; declare function btcVerifyMessage(connectId: string, deviceId: string, params: CommonParams & BTCVerifyMessageParams): Response; type StarcoinAddress = { path: string; } & StarcoinAddress$1; type StarcoinGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function starcoinGetAddress(connectId: string, deviceId: string, params: CommonParams & StarcoinGetAddressParams): Response; declare function starcoinGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: StarcoinGetAddressParams[]; }): Response>; type StarcoinPublicKey = { path: string; } & StarcoinPublicKey$1; type StarcoinGetPublicKeyParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function starcoinGetPublicKey(connectId: string, deviceId: string, params: CommonParams & StarcoinGetPublicKeyParams): Response; declare function starcoinGetPublicKey(connectId: string, deviceId: string, params: CommonParams & { bundle?: StarcoinGetPublicKeyParams[]; }): Response>; type StarcoinSignMessageParams = { path: string | number[]; messageHex: string; }; declare function starcoinSignMessage(connectId: string, deviceId: string, params: CommonParams & StarcoinSignMessageParams): Response; type StarcoinSignTransactionParams = { path: string | number[]; rawTx: string; }; declare function starcoinSignTransaction(connectId: string, deviceId: string, params: CommonParams & StarcoinSignTransactionParams): Response; type StarcoinVerifyMessageParams = { publicKey: string; messageHex: string; signature: string; }; declare function starcoinVerifyMessage(connectId: string, deviceId: string, params: CommonParams & StarcoinVerifyMessageParams): Response; type NEMAddress = { path: string; } & NEMAddress$1; type NEMGetAddressParams = { path: string | number[]; network?: number; showOnOneKey?: boolean; }; declare function nemGetAddress(connectId: string, deviceId: string, params: CommonParams & NEMGetAddressParams): Response; declare function nemGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: NEMGetAddressParams[]; }): Response>; type MosaicID = { namespaceId: string; name: string; }; type MosaicDefinition = { levy?: { type?: number; fee?: number; recipient?: string; mosaicId?: MosaicID; }; id: MosaicID; description: string; properties?: Array<{ name: 'divisibility' | 'initialSupply' | 'supplyMutable' | 'transferable'; value: string; }>; }; type NEMMosaic = { mosaicId: MosaicID; quantity: number; }; type Modification = { modificationType: number; cosignatoryAccount: string; }; type Message = { payload?: string; type?: number; publicKey?: string; }; type TransactionCommon = { version: number; timeStamp: number; fee: number; deadline?: number; signer?: string; }; type NEMTransferTransaction = TransactionCommon & { type: 0x0101; recipient: string; amount: number | string; mosaics?: NEMMosaic[]; message?: Message; }; type NEMImportanceTransaction = TransactionCommon & { type: 0x0801; importanceTransfer: { mode: number; publicKey: string; }; }; type NEMAggregateModificationTransaction = TransactionCommon & { type: 0x1001; modifications?: Modification[]; minCosignatories: { relativeChange: number; }; }; type NEMProvisionNamespaceTransaction = TransactionCommon & { type: 0x2001; newPart?: string; parent?: string; rentalFeeSink?: string; rentalFee?: number; }; type NEMMosaicCreationTransaction = TransactionCommon & { type: 0x4001; mosaicDefinition: MosaicDefinition; creationFeeSink?: string; creationFee?: number; }; type NEMSupplyChangeTransaction = TransactionCommon & { type: 0x4002; mosaicId: MosaicID; supplyType: number; delta?: number; }; type Transaction = NEMTransferTransaction | NEMImportanceTransaction | NEMAggregateModificationTransaction | NEMProvisionNamespaceTransaction | NEMMosaicCreationTransaction | NEMSupplyChangeTransaction; type NEMMultisigTransaction = TransactionCommon & { type: 0x0102 | 0x1002 | 0x1004; otherTrans: Transaction; }; type NEMTransaction = Transaction | NEMMultisigTransaction; type NEMSignTransactionParams = { path: string | number[]; transaction: NEMTransaction; }; declare function nemSignTransaction(connectId: string, deviceId: string, params: CommonParams & NEMSignTransactionParams): Response; type SolanaAddress = { path: string; } & SolanaAddress$1; type SolanaGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function solGetAddress(connectId: string, deviceId: string, params: CommonParams & SolanaGetAddressParams): Response; declare function solGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: SolanaGetAddressParams[]; }): Response>; type SolanaSignedTx = { path: string; } & SolanaSignedTx$1; type SolanaSignTransactionParams = { path: string | number[]; rawTx?: string; extraInfo?: SolanaTxExtraInfo; }; declare function solSignTransaction(connectId: string, deviceId: string, params: CommonParams & SolanaSignTransactionParams): Response; declare function solSignTransaction(connectId: string, deviceId: string, params: CommonParams & { bundle?: SolanaSignTransactionParams[]; }): Response>; type SolSignOffchainMessageResponse = { signature: string; pub?: string; }; type SolSignOffchainMessageParams = { path: string | number[]; messageHex: string; messageVersion?: SolanaOffChainMessageVersion; messageFormat?: SolanaOffChainMessageFormat; applicationDomainHex?: string; /** 32-byte public keys encoded as hex, strictly sorted and unique. */ requiredSigners?: string[]; }; declare function solSignOffchainMessage(connectId: string, deviceId: string, params: CommonParams & SolSignOffchainMessageParams): Response; type SolSignMessageResponse = { signature: string; pub?: string; }; type SolSignMessageParams = { path: string | number[]; messageHex: string; }; declare function solSignMessage(connectId: string, deviceId: string, params: CommonParams & SolSignMessageParams): Response; type StellarAddress = { path: string; } & StellarAddress$1; type StellarGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function stellarGetAddress(connectId: string, deviceId: string, params: CommonParams & StellarGetAddressParams): Response; declare function stellarGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: StellarGetAddressParams[]; }): Response>; type StellarAsset = { type: 0 | 1 | 2; code: string; issuer?: string; }; type StellarCreateAccountOperation = { type: 'createAccount'; source?: string; destination: string; startingBalance: string; }; type StellarPaymentOperation = { type: 'payment'; source?: string; destination: string; asset?: StellarAsset | typeof undefined; amount: string; }; type StellarPathPaymentOperation = { type: 'pathPayment'; source?: string; sendAsset: StellarAsset; sendMax: string; destination: string; destAsset: StellarAsset; destAmount: string; path?: StellarAsset[]; }; type StellarPassiveOfferOperation = { type: 'createPassiveOffer'; source?: string; buying: StellarAsset; selling: StellarAsset; amount: string; price: { n: number; d: number; }; }; type StellarManageOfferOperation = { type: 'manageOffer'; source?: string; buying: StellarAsset; selling: StellarAsset; amount: string; offerId?: string; price: { n: number; d: number; }; }; type StellarSetOptionsOperation = { type: 'setOptions'; source?: string; signer?: { type: 0 | 1 | 2; key: string | Buffer; weight?: number; }; inflationDest?: string; clearFlags?: number; setFlags?: number; masterWeight?: number | string; lowThreshold?: number | string; medThreshold?: number | string; highThreshold?: number | string; homeDomain?: string; }; type StellarChangeTrustOperation = { type: 'changeTrust'; source?: string; line: StellarAsset; limit?: string; }; type StellarAllowTrustOperation = { type: 'allowTrust'; source?: string; trustor: string; assetCode: string; assetType: number; authorize?: boolean | typeof undefined; }; type StellarAccountMergeOperation = { type: 'accountMerge'; source?: string; destination: string; }; type StellarManageDataOperation = { type: 'manageData'; source?: string; name: string; value?: Buffer | string; }; type StellarBumpSequenceOperation = { type: 'bumpSequence'; source?: string; bumpTo: string; }; type StellarInflationOperation = { type: 'inflation'; source?: string; }; type StellarPathPaymentStrictReceiveOperation = { type: 'pathPaymentStrictReceive'; source?: string; sendAsset: StellarAsset; sendMax: string; destination: string; destAsset: StellarAsset; destAmount: string; path?: StellarAsset[]; }; type StellarPathPaymentStrictSendOperation = { type: 'pathPaymentStrictSend'; source?: string; sendAsset: StellarAsset; sendAmount: string; destination: string; destAsset: StellarAsset; destMin: string; path?: StellarAsset[]; }; type StellarInvokeHostFunctionOperation = { type: 'invokeHostFunctionOneKey'; source?: string; contract: string; functionName: string; callArgsXDRHex: string; sorobanAuthXDRHex: string; }; type StellarOperation = StellarCreateAccountOperation | StellarPaymentOperation | StellarPathPaymentOperation | StellarPassiveOfferOperation | StellarManageOfferOperation | StellarSetOptionsOperation | StellarChangeTrustOperation | StellarAllowTrustOperation | StellarAccountMergeOperation | StellarInflationOperation | StellarManageDataOperation | StellarBumpSequenceOperation | StellarPathPaymentStrictReceiveOperation | StellarPathPaymentStrictSendOperation | StellarInvokeHostFunctionOperation; type StellarTransaction = { source: string; fee: number; sequence: string | number; timebounds?: { minTime: number; maxTime: number; }; memo?: { type: 0 | 1 | 2 | 3 | 4; id?: string; text?: string; hash?: string | Buffer; }; operations: StellarOperation[]; sorobanDataXDR?: string; }; type StellarSignTransactionParams = { path: string | number[]; networkPassphrase: string; transaction: StellarTransaction; }; declare function stellarSignTransaction(connectId: string, deviceId: string, params: CommonParams & StellarSignTransactionParams): Response; type TronAddress = { path: string; } & TronAddress$1; type TronGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function tronGetAddress(connectId: string, deviceId: string, params: CommonParams & TronGetAddressParams): Response; declare function tronGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: TronGetAddressParams[]; }): Response>; type TronTransferContract = { toAddress?: string; amount?: UintType; }; type TronTriggerSmartContract = { contractAddress?: string; callValue?: number; data?: string; callTokenValue?: number; assetId?: number; }; type TronFreezeBalanceV2Contract = { frozenBalance?: number; resource?: TronResourceCode; }; type TronUnfreezeBalanceV2Contract = { resource?: TronResourceCode; unfreezeBalance?: number; }; type TronDelegateResourceContract = { resource?: TronResourceCode; balance?: number; receiverAddress?: string; lock?: boolean; lockPeriod?: number; }; type TronUnDelegateResourceContract = { resource?: TronResourceCode; balance?: number; receiverAddress?: string; }; type TronWithdrawBalanceContract = { ownerAddress?: string; }; type TronWithdrawExpireUnfreezeContract = undefined; type TronVoteWitnessContract = { votes?: { voteAddress?: string; voteCount?: number; }[]; support?: boolean; }; type TronCancelAllUnfreezeV2Contract = undefined; type TronTransactionContract = { transferContract?: TronTransferContract; triggerSmartContract?: TronTriggerSmartContract; freezeBalanceV2Contract?: TronFreezeBalanceV2Contract; unfreezeBalanceV2Contract?: TronUnfreezeBalanceV2Contract; cancelAllUnfreezeV2Contract?: TronCancelAllUnfreezeV2Contract; delegateResourceContract?: TronDelegateResourceContract; unDelegateResourceContract?: TronUnDelegateResourceContract; withdrawBalanceContract?: TronWithdrawBalanceContract; withdrawExpireUnfreezeContract?: TronWithdrawExpireUnfreezeContract; voteWitnessContract?: TronVoteWitnessContract; }; type TronTransaction = { refBlockBytes: string; refBlockHash: string; expiration: number; data?: string; contract: TronTransactionContract; timestamp: number; feeLimit?: number; }; type TronSignTransactionParams = { path: string | number[]; transaction: TronTransaction; }; declare function tronSignTransaction(connectId: string, deviceId: string, params: CommonParams & TronSignTransactionParams): Response; type TronSignMessageParams = { path: string | number[]; messageHex: string; messageType?: 'V1' | 'V2'; }; declare function tronSignMessage(connectId: string, deviceId: string, params: CommonParams & TronSignMessageParams): Response; type ConfluxAddress = { path: string; } & ConfluxAddress$1; type ConfluxGetAddressParams = { path: string | number[]; chainId?: number; showOnOneKey?: boolean; }; declare function confluxGetAddress(connectId: string, deviceId: string, params: CommonParams & ConfluxGetAddressParams): Response; declare function confluxGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: ConfluxGetAddressParams[]; }): Response>; type ConfluxSignMessageParams = { path: string | number[]; messageHex: string; }; declare function confluxSignMessage(connectId: string, deviceId: string, params: CommonParams & ConfluxSignMessageParams): Response; type ConfluxSignMessageCIP23Params = { path: string | number[]; domainHash: string; messageHash: string; }; declare function confluxSignMessageCIP23(connectId: string, deviceId: string, params: CommonParams & ConfluxSignMessageCIP23Params): Response; type ConfluxSignedTx = { v: string; r: string; s: string; }; type ConfluxTransaction = { to: string; value: string; gasLimit: string; gasPrice: string; nonce: string; epochHeight: string; storageLimit: string; chainId?: number; data?: string; data_initial_chunk?: string; data_length?: string; }; type ConfluxSignTransactionParams = { path: string | number[]; transaction: ConfluxTransaction; }; declare function confluxSignTransaction(connectId: string, deviceId: string, params: CommonParams & ConfluxSignTransactionParams): Response; type NearAddress = { path: string; } & NearAddress$1; type NearGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function nearGetAddress(connectId: string, deviceId: string, params: CommonParams & NearGetAddressParams): Response; declare function nearGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: NearGetAddressParams[]; }): Response>; type NearSignTransactionParams = { path: string | number[]; rawTx: string; }; declare function nearSignTransaction(connectId: string, deviceId: string, params: CommonParams & NearSignTransactionParams): Response; type AptosAddress = { path: string; pub?: string; /** * @deprecated Use `pub` instead. */ publicKey?: string; } & AptosAddress$1; type AptosGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function aptosGetAddress(connectId: string, deviceId: string, params: CommonParams & AptosGetAddressParams): Response; declare function aptosGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: AptosGetAddressParams[]; }): Response>; type AptosPublicKey = { path: string; pub: string; /** * @deprecated Use `pub` instead. */ publicKey?: string; }; type AptosGetPublicKeyParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function aptosGetPublicKey(connectId: string, deviceId: string, params: CommonParams & AptosGetPublicKeyParams): Response; declare function aptosGetPublicKey(connectId: string, deviceId: string, params: CommonParams & { bundle?: AptosGetPublicKeyParams[]; }): Response>; type AptosMessageSignature = { path: string; fullMessage: string; } & AptosMessageSignature$1; declare type AptosMessagePayload = { address?: string; chainId?: string; application?: string; nonce: string; message: string; }; type AptosSignMessageParams = { path: string | number[]; payload: AptosMessagePayload; }; declare function aptosSignMessage(connectId: string, deviceId: string, params: CommonParams & AptosSignMessageParams): Response; type AptosSignInMessageSignature = { path: string; } & AptosMessageSignature$1; type AptosSignInMessageParams = { path: string | number[]; payload: string; }; declare function aptosSignInMessage(connectId: string, deviceId: string, params: CommonParams & AptosSignInMessageParams): Response; type AptosSignedTx = { path: string; } & AptosSignedTx$1; type AptosSignTransactionParams = { path: string; rawTx?: string; transactionType?: number; }; declare function aptosSignTransaction(connectId: string, deviceId: string, params: CommonParams & AptosSignTransactionParams): Response; type AlgoAddress = { path: string; } & AlgorandAddress; type AlgoGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function algoGetAddress(connectId: string, deviceId: string, params: CommonParams & AlgoGetAddressParams): Response; declare function algoGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: AlgoGetAddressParams[]; }): Response>; type AlgoSignedTx = { path: string; } & AlgorandSignedTx; type AlgoSignTransactionParams = { path: string | number[]; rawTx?: string; }; declare function algoSignTransaction(connectId: string, deviceId: string, params: CommonParams & AlgoSignTransactionParams): Response; type CosmosAddress = { path: string; } & CosmosAddress$1; type CosmosGetAddressParams = { path: string | number[]; hrp?: string; showOnOneKey?: boolean; }; declare function cosmosGetAddress(connectId: string, deviceId: string, params: CommonParams & CosmosGetAddressParams): Response; declare function cosmosGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: CosmosGetAddressParams[]; }): Response>; type CosmosPublicKey = { path: string; pub: string; /** * @deprecated Use `pub` instead. */ publicKey?: string; }; type CosmosGetPublicKeyParams = { path: string | number[]; curve?: string; showOnOneKey?: boolean; }; declare function cosmosGetPublicKey(connectId: string, deviceId: string, params: CommonParams & CosmosGetPublicKeyParams): Response; declare function cosmosGetPublicKey(connectId: string, deviceId: string, params: CommonParams & { bundle?: CosmosGetPublicKeyParams[]; }): Response>; type CosmosSignedTx = { path: string; } & CosmosSignedTx$1; type CosmosSignTransactionParams = { path: string | number[]; rawTx?: string; }; declare function cosmosSignTransaction(connectId: string, deviceId: string, params: CommonParams & CosmosSignTransactionParams): Response; type XrpAddress = { path: string; pub?: string; /** * @deprecated Use `pub` instead. */ publicKey?: string; address: string; }; type XrpGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function xrpGetAddress(connectId: string, deviceId: string, params: CommonParams & XrpGetAddressParams): Response; declare function xrpGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: XrpGetAddressParams[]; }): Response; type XrpSignTransactionResponse = { serializedTx: string; signature: string; }; type XrpPayment = { amount: string; destination: string; destinationTag?: number; }; type XrpTransaction = { fee: string; flags?: number; sequence: number; maxLedgerVersion?: number; payment: XrpPayment; }; declare function xrpSignTransaction(connectId: string, deviceId: string, params: CommonParams & XrpTransaction): Response; type SuiAddress = { path: string; pub?: string; /** * @deprecated Use `pub` instead. */ publicKey?: string; } & SuiAddress$1; type SuiGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function suiGetAddress(connectId: string, deviceId: string, params: CommonParams & SuiGetAddressParams): Response; declare function suiGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: SuiGetAddressParams[]; }): Response>; type SuiPublicKey = { path: string; pub: string; /** * @deprecated Use `pub` instead. */ publicKey?: string; }; type SuiGetPublicKeyParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function suiGetPublicKey(connectId: string, deviceId: string, params: CommonParams & SuiGetPublicKeyParams): Response; declare function suiGetPublicKey(connectId: string, deviceId: string, params: CommonParams & { bundle?: SuiGetPublicKeyParams[]; }): Response>; type SuiSignMessageParams = { path: string | number[]; messageHex: string; }; declare function suiSignMessage(connectId: string, deviceId: string, params: CommonParams & SuiSignMessageParams): Response; type SuiSignedTx = { path: string; } & AptosSignedTx$1; type SuiSignTransactionParams = { path: string | number[]; rawTx?: string; }; declare function suiSignTransaction(connectId: string, deviceId: string, params: CommonParams & SuiSignTransactionParams): Response; type CardanoGetAddressMethodParams = { addressParameters: CardanoAddressParameters; networkId: number; /** * Testnet cip34:0-1097911063 * Mainnet cip34:1-764824073 */ protocolMagic: number; derivationType: number; address?: string; isCheck?: boolean; showOnOneKey: boolean; }; type CardanoGetAddressParams = { address_parameters: CardanoAddressParametersType; network_id: number; protocol_magic: number; derivation_type: number; address: string; show_display: boolean; }; type CardanoAddress = { addressParameters: CardanoAddressParameters; protocolMagic: number; networkId: number; serializedPath: string; serializedStakingPath: string; address: string; xpub?: string; stakeAddress?: string; }; declare function cardanoGetAddress(connectId: string, deviceId: string, params: CommonParams & CardanoGetAddressMethodParams): Response; declare function cardanoGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: CardanoGetAddressMethodParams[]; }): Response; type CardanoPublicKey = { path: number[]; serializedPath: string; xpub: string; node: Messages.HDNodeType; }; type CardanoPublicKeyMethodParams = { path: string | number[]; derivationType?: number; showOnOneKey?: boolean; }; declare function cardanoGetPublicKey(connectId: string, deviceId: string, params: CommonParams & CardanoPublicKeyMethodParams): Response; declare function cardanoGetPublicKey(connectId: string, deviceId: string, params: CommonParams & { bundle?: CardanoPublicKeyMethodParams[]; }): Response; declare function cardanoSignTransaction(connectId: string, deviceId: string, params: CommonParams & CardanoSignTransaction): Response; type CardanoSignMessageParams = { address_n: number[]; message: string; derivation_type: number; network_id: number; address_type: number; protocol_magic?: number; }; type CardanoSignMessageMethodParams = { path: string; message: string; derivationType: number; networkId: number; addressType?: Messages.CardanoAddressType; /** * Testnet cip34:0-1097911063 * Mainnet cip34:1-764824073 */ protocolMagic?: number; }; declare function cardanoSignMessage(connectId: string, deviceId: string, params: CommonParams & CardanoSignMessageMethodParams): Response; type FilecoinAddress = { path: string; } & FilecoinAddress$1; type FilecoinGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; isTestnet?: boolean; }; declare function filecoinGetAddress(connectId: string, deviceId: string, params: CommonParams & FilecoinGetAddressParams): Response; declare function filecoinGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: FilecoinGetAddressParams[]; }): Response>; type FilecoinSignedTx = { path: string; } & FilecoinSignedTx$1; type FilecoinSignTransactionParams = { path: string | number[]; rawTx?: string; isTestnet?: boolean; }; declare function filecoinSignTransaction(connectId: string, deviceId: string, params: CommonParams & FilecoinSignTransactionParams): Response; declare function filecoinSignTransaction(connectId: string, deviceId: string, params: CommonParams & { bundle?: FilecoinSignTransactionParams[]; }): Response>; type PolkadotAddress = { path: string; pub: string; /** * @deprecated Use `pub` instead. */ publicKey?: string; } & PolkadotAddress$1; type PolkadotGetAddressParams = { path: string | number[]; prefix: number; network: string; showOnOneKey?: boolean; }; declare function polkadotGetAddress(connectId: string, deviceId: string, params: CommonParams & PolkadotGetAddressParams): Response; declare function polkadotGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: PolkadotGetAddressParams[]; }): Response>; type PolkadotSignedTx = { path: string; } & PolkadotSignedTx$1; type PolkadotSignTransactionParams = { path: string | number[]; network: string; prefix: number; rawTx?: string; }; declare function polkadotSignTransaction(connectId: string, deviceId: string, params: CommonParams & PolkadotSignTransactionParams): Response; type KaspaAddress = { path: string; } & KaspaAddress$1; type KaspaGetAddressParams = { path: string | number[]; prefix?: string; scheme?: string; showOnOneKey?: boolean; useTweak?: boolean; }; declare function kaspaGetAddress(connectId: string, deviceId: string, params: CommonParams & KaspaGetAddressParams): Response; declare function kaspaGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: KaspaGetAddressParams[]; }): Response>; declare enum SignatureType { SIGHASH_ALL = 1, SIGHASH_NONE = 2, SIGHASH_SINGLE = 3, SIGHASH_FORKID = 64, SIGHASH_ANYONECANPAY = 128 } type KaspaSignature = { index: number; signature: string; }; type KaspaSignInputParams = { path: string | number[]; prevTxId: string; outputIndex: number; sequenceNumber: number | string; output: { satoshis: number | string; script?: string; }; sigOpCount?: number; }; type KaspaSignOutputParams = { satoshis: number | string; address?: string; addressN?: string | number[]; script?: string; scriptVersion?: number; }; type KaspaStreamingSignInputParams = Omit & { output: { satoshis: number | string; script?: string; }; }; type KaspaStreamingSignOutputParams = { satoshis: number | string; address?: string; addressN?: string | number[]; script?: string; scriptVersion?: number; }; type KaspaRefTransactionInput = { prevTxId: string; outputIndex: number; sequenceNumber: number | string; }; type KaspaRefTransactionOutput = { satoshis: number | string; scriptVersion?: number; script: string; }; type KaspaRefTransaction = { txId: string; version: number; inputs: KaspaRefTransactionInput[]; outputs: KaspaRefTransactionOutput[]; lockTime?: number | string; subNetworkID?: string; gas?: number | string; payload?: string; }; type KaspaSignTransactionParams = { version: number; inputs: Array; outputs: Array; lockTime: number | string; sigHashType?: SignatureType; sigOpCount?: number; subNetworkID?: string; payload?: string; gas?: number | string; refTxs?: KaspaRefTransaction[]; scheme?: string; prefix?: string; useTweak?: boolean; }; declare function kaspaSignTransaction(connectId: string, deviceId: string, params: CommonParams & KaspaSignTransactionParams): Response; type NexaAddress = { path: string; pub: string; address: string; }; type NexaGetAddressParams = { path: string | number[]; prefix?: string; scheme?: string; showOnOneKey?: boolean; }; declare function nexaGetAddress(connectId: string, deviceId: string, params: CommonParams & NexaGetAddressParams): Response; declare function nexaGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: NexaGetAddressParams[]; }): Response>; type NexaSignature = { index: number; signature: string; }; type NexaSignInputParams = { path: string; message: string; prefix: string; }; type NexaSignOutputParams = { satoshis: number | string; script: string; scriptVersion: number; }; type NexaSignTransactionParams = { inputs: NexaSignInputParams[]; }; declare function nexaSignTransaction(connectId: string, deviceId: string, params: CommonParams & NexaSignTransactionParams): Response; type NostrPublicKey = { npub?: string; pub?: string; /** * @deprecated Use `pub` instead. */ publicKey?: string; path: string; }; interface NostrPublicKeyParams { path: string | number[]; showOnOneKey?: boolean; } declare function nostrGetPublicKey(connectId: string, deviceId: string, params: CommonParams & NostrPublicKeyParams): Response; declare function nostrGetPublicKey(connectId: string, deviceId: string, params: CommonParams & { bundle?: NostrPublicKeyParams[]; }): Response>; declare enum EventKind { Metadata = 0, Text = 1, RelayRec = 2, Contacts = 3, DM = 4, Deleted = 5, Reaction = 7, BadgeAward = 8, ChannelCreation = 40, ChannelMetadata = 41, ChannelMessage = 42, ChannelHideMessage = 43, Reporting = 1984, ZapRequest = 9734, Zap = 9735, RelayListMetadata = 10002, ClientAuthentication = 22242, NostrConnect = 24133, ProfileBadges = 30008, BadgeDefinition = 30009, LongFormContent = 30023, ApplicationSpecificData = 30078 } type NostrEvent = { id?: string; kind: EventKind; pubkey?: string; content: string; tags: string[][]; created_at: number; sig?: string; }; type NostrSignedEvent = { path: string; event: NostrEvent; }; interface NostrSignEventParams { path: string | number[]; event: NostrEvent; } declare function nostrSignEvent(connectId: string, deviceId: string, params: CommonParams & NostrSignEventParams): Response; interface NostrEncryptMessageParams { path: string | number[]; pubkey: string; plaintext: string; showOnOneKey?: boolean; } type NostrEncryptedMessageResponse = { path: string; pubkey: string; plaintext: string; encryptedMessage: string; }; declare function nostrEncryptMessage(connectId: string, deviceId: string, params: CommonParams & NostrEncryptMessageParams): Response; interface NostrDecryptMessageParams { path: string | number[]; pubkey: string; ciphertext: string; showOnOneKey?: boolean; } type NostrDecryptedMessageResponse = { path: string; pubkey: string; ciphertext: string; decryptedMessage: string; }; declare function nostrDecryptMessage(connectId: string, deviceId: string, params: CommonParams & NostrDecryptMessageParams): Response; interface NostrSignSchnorrParams { path: string | number[]; hash: string; } type NostrSignedSchnorrResponse = { path: string; rawHash: string; signature: string; }; declare function nostrSignSchnorr(connectId: string, deviceId: string, params: CommonParams & NostrSignSchnorrParams): Response; interface LnurlAuth { pub?: string; /** * @deprecated Use `pub` instead. */ publickey?: string; path?: string; signature?: string; } interface LnurlAuthParams { domain: string; k1: string; } declare function lnurlAuth(connectId: string, deviceId: string, params: CommonParams & LnurlAuthParams): Response; type NervosAddress = { path: string; } & NervosAddress$1; type NervosGetAddressParams = { path: string | number[]; network: string; showOnOneKey?: boolean; }; declare function nervosGetAddress(connectId: string, deviceId: string, params: CommonParams & NervosGetAddressParams): Response; declare function nervosGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: NervosGetAddressParams[]; }): Response>; type NervosSignedTx = { path: string; } & NervosSignedTx$1; type NervosSignTransactionParams = { path: string | number[]; network: string; rawTx: string; witnessHex: string; }; declare function nervosSignTransaction(connectId: string, deviceId: string, params: CommonParams & NervosSignTransactionParams): Response; type DnxAddress = { path: string; } & DnxAddress$1; type DnxGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function dnxGetAddress(connectId: string, deviceId: string, params: CommonParams & DnxGetAddressParams): Response; declare function dnxGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: DnxGetAddressParams[]; }): Response>; type DnxTxKey = { ephemeralTxSecKey: string; ephemeralTxPubKey: string; }; type DnxSignTransactionParams = { path: string | number[]; inputs: { prevIndex: number; globalIndex: number; txPubkey: string; prevOutPubkey: string; amount: UintType; }[]; toAddress: string; amount: UintType; fee: UintType; paymentIdHex?: string; }; type DnxSignature = { path: string; txKey: DnxTxKey; computedKeyImages: string[]; signatures: string[]; outputKeys: string[]; }; declare function dnxSignTransaction(connectId: string, deviceId: string, params: CommonParams & DnxSignTransactionParams): Response; type TonAddress = { path: string; pub: string; /** * @deprecated Use `pub` instead. */ publicKey?: string; address: string; }; type TonGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; walletVersion?: TonWalletVersion; isBounceable?: boolean; isTestnetOnly?: boolean; workchain?: TonWorkChain; walletId?: number; }; declare function tonGetAddress(connectId: string, deviceId: string, params: CommonParams & TonGetAddressParams): Response; declare function tonGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: TonGetAddressParams[]; }): Response>; type TonSignMessageParams = { path: string | number[]; destination: string; jettonMasterAddress?: string; jettonWalletAddress?: string; tonAmount: UintType; jettonAmount?: UintType; fwdFee?: UintType; comment?: string; isRawData?: boolean; mode?: number; seqno: number; expireAt: UintType; walletVersion?: TonWalletVersion; walletId?: number; workchain?: TonWorkChain; isBounceable?: boolean; isTestnetOnly?: boolean; extDestination?: string[]; extTonAmount?: UintType[]; extPayload?: string[]; initState?: string; signingMessageRepr?: string; }; type TonSignedMessageResponse = { skip_validate: boolean; } & TonSignedMessage; declare function tonSignMessage(connectId: string, deviceId: string, params: CommonParams & TonSignMessageParams): Response; type TonSignProofParams = { path: string | number[]; appdomain: string; comment?: string; expireAt: UintType; walletVersion?: TonWalletVersion; walletId?: number; workchain?: TonWorkChain; isBounceable?: boolean; isTestnetOnly?: boolean; }; declare function tonSignProof(connectId: string, deviceId: string, params: CommonParams & TonSignProofParams): Response; type TonSignDataParams = { path: string | number[]; type: TonSignDataType; payload: string; schema?: string; appdomain: string; timestamp: UintType; fromAddress?: string; walletVersion?: TonWalletVersion; walletId?: number; workchain?: TonWorkChain; isBounceable?: boolean; isTestnetOnly?: boolean; }; declare function tonSignData(connectId: string, deviceId: string, params: CommonParams & TonSignDataParams): Response; type ScdoAddress = { path: string; } & ScdoAddress$1; type ScdoGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function scdoGetAddress(connectId: string, deviceId: string, params: CommonParams & ScdoGetAddressParams): Response; declare function scdoGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: ScdoGetAddressParams[]; }): Response>; type ScdoSignMessageParams = { path: string | number[]; messageHex: string; }; declare function scdoSignMessage(connectId: string, deviceId: string, params: CommonParams & ScdoSignMessageParams): Response; type ScdoSignedTx = { path: string; } & ScdoSignedTx$1; type ScdoSignTransactionParams = { path: string | number[]; nonce: string; gasPrice: string; gasLimit: string; to: string; value: string; timestamp?: string; data?: string; txType?: number; }; declare function scdoSignTransaction(connectId: string, deviceId: string, params: CommonParams & ScdoSignTransactionParams): Response; type AlephiumAddress = { path: string; /** * @deprecated Use `pub` instead. */ publicKey?: string; pub?: string; address: string; derivedPath: string; }; type AlephiumGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; includePublicKey?: boolean; group: number | undefined | null; }; declare function alephiumGetAddress(connectId: string, deviceId: string, params: CommonParams & AlephiumGetAddressParams): Response; declare function alephiumGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: AlephiumGetAddressParams[]; }): Response>; type AlephiumSignMessageParams = { path: string | number[]; messageHex: string; messageType: 'alephium' | 'sha256' | 'blake2b' | 'identity'; }; declare function alephiumSignMessage(connectId: string, deviceId: string, params: CommonParams & AlephiumSignMessageParams): Response; type AlephiumSignedTx = { path: string; } & AlephiumSignedTx$1; type AlephiumSignTransactionParams = { path: string | number[]; rawTx: string; scriptOpt?: string; }; declare function alephiumSignTransaction(connectId: string, deviceId: string, params: CommonParams & AlephiumSignTransactionParams): Response; type BenfenAddress = { path: string; pub?: string; } & BenfenAddress$1; type BenfenGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function benfenGetAddress(connectId: string, deviceId: string, params: CommonParams & BenfenGetAddressParams): Response; declare function benfenGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: BenfenGetAddressParams[]; }): Response>; type BenfenPublicKey = { path: string; pub: string; }; type BenfenGetPublicKeyParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function benfenGetPublicKey(connectId: string, deviceId: string, params: CommonParams & BenfenGetPublicKeyParams): Response; declare function benfenGetPublicKey(connectId: string, deviceId: string, params: CommonParams & { bundle?: BenfenGetPublicKeyParams[]; }): Response>; type BenfenSignedTx = { path: string; coinType?: string; } & AptosSignedTx$1; type BenfenSignTransactionParams = { path: string | number[]; coinType?: string; rawTx?: string; }; declare function benfenSignTransaction(connectId: string, deviceId: string, params: CommonParams & BenfenSignTransactionParams): Response; type BenfenSignMessageParams = { path: string | number[]; messageHex: string; }; declare function benfenSignMessage(connectId: string, deviceId: string, params: CommonParams & BenfenSignMessageParams): Response; type NeoAddress = { path: string; address: string; pub: string; }; type NeoGetAddressParams = { path: string | number[]; showOnOneKey?: boolean; }; declare function neoGetAddress(connectId: string, deviceId: string, params: CommonParams & NeoGetAddressParams): Response; declare function neoGetAddress(connectId: string, deviceId: string, params: CommonParams & { bundle?: NeoGetAddressParams[]; }): Response>; type NeoUnsignedTx = { path: string; rawTx: string; magicNumber?: number; }; type NeoSignedTx = { publicKey: string; signature: string; }; declare function neoSignTransaction(connectId: string, deviceId: string, params: CommonParams & NeoUnsignedTx): Response; type CoreApi = { /** * Inject function */ init: typeof init; on: typeof on; off: typeof off; emit: (event: string, ...args: any[]) => void; removeAllListeners: typeof removeAllListeners; dispose: () => void | Promise; call: (params: any) => Promise; /** * Bind a protocol that has already been verified for one transport endpoint. * Every later SDK call for the same connectId uses it as a strict expectation. */ setDeviceConnectProtocol: (connectId: string, connectProtocol: HardwareConnectProtocol | undefined) => void; uiResponse: typeof uiResponse; cancel: (connectId?: string) => void; updateSettings: typeof updateSettings; switchTransport: (env: ConnectSettings['env']) => Promise<{ success: boolean; }>; getLogs: typeof getLogs; clearSessionCache: typeof clearSessionCache; /** * Test function */ testInitializeDeviceDuration: typeof testInitializeDeviceDuration; testProtocolV2Ping: typeof testProtocolV2Ping; preInitialize: typeof preInitialize; /** * Core function */ checkAllFirmwareRelease: typeof checkAllFirmwareRelease; checkBridgeStatus: typeof checkBridgeStatus; checkBridgeRelease: typeof checkBridgeRelease; checkBootloaderRelease: typeof checkBootloaderRelease; checkFirmwareTypeAvailable: typeof checkFirmwareTypeAvailable; /** * Device function */ searchDevices: typeof searchDevices; detectDeviceConnectProtocol: typeof detectDeviceConnectProtocol; promptWebDeviceAccess: typeof promptWebDeviceAccess; getFeatures: typeof getFeatures; getDeviceState: typeof getDeviceState; getOnekeyFeatures: typeof getOnekeyFeatures; getPassphraseState: typeof getPassphraseState; openWalletSession: typeof openWalletSession; deviceBackup: typeof deviceBackup; deviceChangePin: typeof deviceChangePin; deviceFlags: typeof deviceFlags; deviceRebootToBoardloader: typeof deviceRebootToBoardloader; deviceRebootToBootloader: typeof deviceRebootToBootloader; deviceRecovery: typeof deviceRecovery; deviceReset: typeof deviceReset; deviceSettings: typeof deviceSettings; deviceUpdateReboot: typeof deviceUpdateReboot; deviceUploadResource: typeof deviceUploadResource; deviceSupportFeatures: typeof deviceSupportFeatures; deviceVerify: typeof deviceVerify; deviceWipe: typeof deviceWipe; deviceFullyUploadResource: typeof deviceFullyUploadResource; deviceUpdateBootloader: typeof deviceUpdateBootloader; deviceLock: typeof deviceLock; deviceUnlock: typeof deviceUnlock; deviceCancel: typeof deviceCancel; getNextU2FCounter: typeof getNextU2FCounter; setU2FCounter: typeof setU2FCounter; checkFirmwareRelease: typeof checkFirmwareRelease; checkBLEFirmwareRelease: typeof checkBLEFirmwareRelease; firmwareUpdate: typeof firmwareUpdate; firmwareUpdateV2: typeof firmwareUpdateV2; firmwareUpdateV3: typeof firmwareUpdateV3; firmwareUpdateV4: typeof firmwareUpdateV4; registerFirmwareUpdateHostBinding: typeof registerFirmwareUpdateHostBinding$1; unregisterFirmwareUpdateHostBinding: typeof unregisterFirmwareUpdateHostBinding$1; getFirmwareUpdateHostBindingGeneration: typeof getFirmwareUpdateHostBindingGeneration$1; getFirmwareUpdateCapabilities: typeof getFirmwareUpdateCapabilities; prepareFirmwareUpdatePlan: typeof prepareFirmwareUpdatePlan; validateFirmwareUpdatePreparedPlan: typeof validateFirmwareUpdatePreparedPlan; cipherKeyValue: typeof cipherKeyValue; /** * Pro2 business API */ deviceReboot: typeof deviceReboot; deviceGetOnboardingStatus: typeof deviceGetOnboardingStatus; deviceUploadNft: typeof deviceUploadNft; deviceUploadWallpaper: typeof deviceUploadWallpaper; uploadPortfolio: typeof uploadPortfolio; /** * All network function */ allNetworkGetAddress: typeof allNetworkGetAddress; allNetworkGetAddressByLoop: typeof allNetworkGetAddressByLoop; /** * EVM function */ evmGetAddress: typeof evmGetAddress; evmGetPublicKey: typeof evmGetPublicKey; evmSignMessage: typeof evmSignMessage; evmSignMessageEIP712: typeof evmSignMessageEIP712; evmSignTransaction: typeof evmSignTransaction; evmSignTypedData: typeof evmSignTypedData; evmVerifyMessage: typeof evmVerifyMessage; /** * BTC function */ btcGetAddress: typeof btcGetAddress; btcGetPublicKey: typeof btcGetPublicKey; btcSignMessage: typeof btcSignMessage; btcSignPsbt: typeof btcSignPsbt; btcSignTransaction: typeof btcSignTransaction; btcVerifyMessage: typeof btcVerifyMessage; /** * Starcoin function */ starcoinGetAddress: typeof starcoinGetAddress; starcoinGetPublicKey: typeof starcoinGetPublicKey; starcoinSignMessage: typeof starcoinSignMessage; starcoinSignTransaction: typeof starcoinSignTransaction; starcoinVerifyMessage: typeof starcoinVerifyMessage; /** * Nem function */ nemGetAddress: typeof nemGetAddress; nemSignTransaction: typeof nemSignTransaction; /** * Solana function */ solGetAddress: typeof solGetAddress; solSignTransaction: typeof solSignTransaction; solSignOffchainMessage: typeof solSignOffchainMessage; solSignMessage: typeof solSignMessage; /** * Stellar function */ stellarGetAddress: typeof stellarGetAddress; stellarSignTransaction: typeof stellarSignTransaction; /** * Tron function */ tronGetAddress: typeof tronGetAddress; tronSignMessage: typeof tronSignMessage; tronSignTransaction: typeof tronSignTransaction; /** * Conflux function */ confluxGetAddress: typeof confluxGetAddress; confluxSignMessage: typeof confluxSignMessage; confluxSignMessageCIP23: typeof confluxSignMessageCIP23; confluxSignTransaction: typeof confluxSignTransaction; /** * Near function */ nearGetAddress: typeof nearGetAddress; nearSignTransaction: typeof nearSignTransaction; /** * Aptos function */ aptosGetAddress: typeof aptosGetAddress; aptosGetPublicKey: typeof aptosGetPublicKey; aptosSignMessage: typeof aptosSignMessage; aptosSignInMessage: typeof aptosSignInMessage; aptosSignTransaction: typeof aptosSignTransaction; /** * Algo function */ algoGetAddress: typeof algoGetAddress; algoSignTransaction: typeof algoSignTransaction; /** * Cosmos function */ cosmosGetAddress: typeof cosmosGetAddress; cosmosGetPublicKey: typeof cosmosGetPublicKey; cosmosSignTransaction: typeof cosmosSignTransaction; /** * XRP function */ xrpGetAddress: typeof xrpGetAddress; xrpSignTransaction: typeof xrpSignTransaction; /** * SUI function */ suiGetAddress: typeof suiGetAddress; suiGetPublicKey: typeof suiGetPublicKey; suiSignMessage: typeof suiSignMessage; suiSignTransaction: typeof suiSignTransaction; /** * Cardano function */ cardanoGetAddress: typeof cardanoGetAddress; cardanoGetPublicKey: typeof cardanoGetPublicKey; cardanoSignTransaction: typeof cardanoSignTransaction; cardanoSignMessage: typeof cardanoSignMessage; /** * Filecoin function */ filecoinGetAddress: typeof filecoinGetAddress; filecoinSignTransaction: typeof filecoinSignTransaction; /** * Polkadot function */ polkadotGetAddress: typeof polkadotGetAddress; polkadotSignTransaction: typeof polkadotSignTransaction; /** * Kaspa function */ kaspaGetAddress: typeof kaspaGetAddress; kaspaSignTransaction: typeof kaspaSignTransaction; /** * nexa function */ nexaGetAddress: typeof nexaGetAddress; nexaSignTransaction: typeof nexaSignTransaction; /** * Nostr function */ nostrGetPublicKey: typeof nostrGetPublicKey; nostrSignEvent: typeof nostrSignEvent; nostrEncryptMessage: typeof nostrEncryptMessage; nostrDecryptMessage: typeof nostrDecryptMessage; nostrSignSchnorr: typeof nostrSignSchnorr; /** * Lightning Network */ lnurlAuth: typeof lnurlAuth; /** * Nervos Network */ nervosGetAddress: typeof nervosGetAddress; nervosSignTransaction: typeof nervosSignTransaction; /** * Dnx Network */ dnxGetAddress: typeof dnxGetAddress; dnxSignTransaction: typeof dnxSignTransaction; /** * TON Network */ tonGetAddress: typeof tonGetAddress; tonSignMessage: typeof tonSignMessage; tonSignProof: typeof tonSignProof; tonSignData: typeof tonSignData; /** * SCDO Network */ scdoGetAddress: typeof scdoGetAddress; scdoSignMessage: typeof scdoSignMessage; scdoSignTransaction: typeof scdoSignTransaction; /** * Alephium Network */ alephiumGetAddress: typeof alephiumGetAddress; alephiumSignMessage: typeof alephiumSignMessage; alephiumSignTransaction: typeof alephiumSignTransaction; /** * Benfen Network */ benfenGetAddress: typeof benfenGetAddress; benfenGetPublicKey: typeof benfenGetPublicKey; benfenSignTransaction: typeof benfenSignTransaction; benfenSignMessage: typeof benfenSignMessage; /** * Neo Network */ neoGetAddress: typeof neoGetAddress; neoSignTransaction: typeof neoSignTransaction; }; interface FirmwareRange { '1': { min: string; max: string; }; '2': { min: string; max: string; }; } type MajorVersion = 1 | 2; type VersionArray = [MajorVersion, number, number]; type FirmwareRelease = { required: boolean; url: string; fingerprint: string; changelog: string; min_bridge_version: [number, number, number]; version: VersionArray; min_firmware_version: VersionArray; min_bootloader_version: VersionArray; bootloader_version?: VersionArray; url_bitcoinonly?: string; fingerprint_bitcoinonly?: string; notes?: string; rollout?: number; channel?: string; }; type ReleaseInfo = { changelog: FirmwareRelease[] | null; release: FirmwareRelease; isLatest: boolean; latest: FirmwareRelease; isRequired: boolean | null; isNewer: boolean | null; }; type TransportReleaseStatus = 'valid' | 'outdated'; type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; type MessageFactoryFn = UnionToIntersection { event: Group; type: Event['type']; payload: Event['payload']; } : (type: Event['type'], payload?: undefined) => { event: Group; type: Event['type']; payload: undefined; } : never>; declare const DEVICE_EVENT = "DEVICE_EVENT"; declare const DEVICE: { readonly CONNECT: "device-connect"; readonly CONNECT_UNACQUIRED: "device-connect_unacquired"; readonly DISCONNECT: "device-disconnect"; readonly CHANGED: "device-changed"; readonly ACQUIRE: "device-acquire"; readonly RELEASE: "device-release"; readonly ACQUIRED: "device-acquired"; readonly RELEASED: "device-released"; readonly USED_ELSEWHERE: "device-used_elsewhere"; readonly UNREADABLE: "unreadable-device"; readonly LOADING: "device-loading"; readonly BUTTON: "button"; readonly PIN: "pin"; readonly PIN_ON_DEVICE: "pin_on_device"; readonly PIN_ON_DEVICE_COMPLETE: "pin_on_device_complete"; readonly PASSPHRASE: "passphrase"; readonly PASSPHRASE_ON_DEVICE: "passphrase_on_device"; readonly ATTACH_PIN_ON_DEVICE: "attach_pin_on_device"; readonly WORD: "word"; readonly SUPPORT_FEATURES: "support_features"; readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "select_device_in_bootloader_for_web_device"; readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "select_device_for_switch_firmware_web_device"; readonly FEATURES: "features"; readonly STATE: "state"; }; interface DeviceConnnectRequest { type: typeof DEVICE.CONNECT; payload: { device: KnownDevice; }; } interface DeviceDisconnnectRequest { type: typeof DEVICE.DISCONNECT; payload: { device: KnownDevice; }; } interface DeviceButtonRequestPayload extends Omit { code?: Messages.ButtonRequest['code'] | 'ButtonRequest_FirmwareUpdate'; } type PassphraseRequestPayload = { existsAttachPinUser?: boolean; deviceOnly?: boolean; source?: 'wallet-session-coordinator'; reason?: 'open-wallet' | 'session-recovery'; expectedPassphraseState?: string; interaction?: HardwareUiInteractionMeta; }; interface DeviceButtonRequest { type: typeof DEVICE.BUTTON; payload: DeviceButtonRequestPayload & { device: KnownDevice | null; }; } type DeviceFeaturesPayload = Features; interface DeviceSendFeatures { type: typeof DEVICE.FEATURES; payload: DeviceFeaturesPayload; } interface DeviceSendState { type: typeof DEVICE.STATE; payload: DeviceStateEvent; } type DeviceSupportFeaturesPayload = SupportFeatures & { device: KnownDevice | null; }; interface DeviceSendSupportFeatures { type: typeof DEVICE.SUPPORT_FEATURES; payload: DeviceSupportFeaturesPayload; } type DeviceEvent = DeviceButtonRequest | DeviceSendState | DeviceSendFeatures | DeviceSendSupportFeatures | DeviceDisconnnectRequest | DeviceConnnectRequest; type DeviceEventMessage = DeviceEvent & { event: typeof DEVICE_EVENT; }; type DeviceEventListenerFn = (type: typeof DEVICE_EVENT, cb: (event: DeviceEventMessage) => void) => void; declare const createDeviceMessage: MessageFactoryFn; declare const UI_RESPONSE: { readonly RECEIVE_PIN: "ui-receive_pin"; readonly RECEIVE_PASSPHRASE: "ui-receive_passphrase"; readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "ui-receive_select-device-in-bootloader-for-web-device"; readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "ui-receive_select-device-for-switch-firmware-web-device"; }; interface UiResponseCorrelation { interactionId: string; deviceId: string; } interface UiResponseCorrelationFields { interactionId?: string; deviceId?: string; } interface UiResponsePin extends UiResponseCorrelationFields { type: typeof UI_RESPONSE.RECEIVE_PIN; payload: string; } interface UiResponsePassphrase extends UiResponseCorrelationFields { type: typeof UI_RESPONSE.RECEIVE_PASSPHRASE; payload: { value: string; passphraseOnDevice?: boolean; attachPinOnDevice?: boolean; save?: boolean; }; } interface UiResponseSelectDeviceInBootloaderForWebDevice { type: typeof UI_RESPONSE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE; payload: { deviceId: string; }; } interface UiResponseSelectDeviceForSwitchFirmwareWebDevice { type: typeof UI_RESPONSE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE; payload: { deviceId: string; }; } type UiResponseEvent = UiResponsePin | UiResponsePassphrase | UiResponseSelectDeviceInBootloaderForWebDevice | UiResponseSelectDeviceForSwitchFirmwareWebDevice; type UiResponseMessage = UiResponseEvent & { event: typeof UI_EVENT; }; declare const createUiResponse: MessageFactoryFn; declare const UI_EVENT = "UI_EVENT"; declare const UI_REQUEST: { readonly REQUEST_PIN: "ui-request_pin"; readonly INVALID_PIN: "ui-invalid_pin"; readonly REQUEST_BUTTON: "ui-button"; readonly REQUEST_PASSPHRASE: "ui-request_passphrase"; readonly REQUEST_PASSPHRASE_ON_DEVICE: "ui-request_passphrase_on_device"; readonly REQUEST_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "ui-request_select_device_in_bootloader_for_web_device"; readonly REQUEST_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "ui-request_select_device_for_switch_firmware_web_device"; readonly CLOSE_UI_WINDOW: "ui-close_window"; readonly CLOSE_UI_PIN_WINDOW: "ui-close_pin_window"; readonly DEVICE_PROGRESS: "ui-device_progress"; readonly BLUETOOTH_PERMISSION: "ui-bluetooth_permission"; readonly BLUETOOTH_UNSUPPORTED: "ui-bluetooth_unsupported"; readonly BLUETOOTH_POWERED_OFF: "ui-bluetooth_powered_off"; readonly BLUETOOTH_CHARACTERISTIC_NOTIFY_CHANGE_FAILURE: "ui-bluetooth_characteristic_notify_change_failure"; readonly LOCATION_PERMISSION: "ui-location_permission"; readonly LOCATION_SERVICE_PERMISSION: "ui-location_service_permission"; readonly FIRMWARE_PROCESSING: "ui-firmware-processing"; readonly FIRMWARE_PROGRESS: "ui-firmware-progress"; readonly FIRMWARE_TIP: "ui-firmware-tip"; readonly PREVIOUS_ADDRESS_RESULT: "ui-previous_address_result"; readonly WEB_DEVICE_PROMPT_ACCESS_PERMISSION: "ui-web_device_prompt_access_permission"; readonly BOOTLOADER: "ui-device_bootloader_mode"; readonly NOT_IN_BOOTLOADER: "ui-device_not_in_bootloader_mode"; readonly REQUIRE_MODE: "ui-device_require_mode"; readonly NOT_INITIALIZE: "ui-device_not_initialized"; readonly SEEDLESS: "ui-device_seedless"; readonly FIRMWARE_OLD: "ui-device_firmware_old"; readonly FIRMWARE_NOT_SUPPORTED: "ui-device_firmware_unsupported"; readonly FIRMWARE_NOT_COMPATIBLE: "ui-device_firmware_not_compatible"; readonly FIRMWARE_NOT_INSTALLED: "ui-device_firmware_not_installed"; readonly NOT_USE_ONEKEY_DEVICE: "ui-device_please_use_onekey_device"; }; type ProtocolV2UiEventSource = 'unlock-coordinator' | 'wallet-session-coordinator' | 'method-lifecycle'; type ProtocolV2UiCompletion = 'page-accepted' | 'operation-completed'; type HardwareUiInteractionMeta = { interactionId: string; phaseId: string; sequence: number; phase: 'pin' | 'passphrase' | 'passphrase-on-device' | 'button' | 'processing'; transition: 'start' | 'complete' | 'finish'; outcome?: 'submitted' | 'succeeded' | 'failed' | 'cancelled' | 'disconnected'; protocol: 'V2'; device?: Device$1; }; type ProtocolV2UiEventMetadata = { source?: ProtocolV2UiEventSource; reason?: string; deviceOnly?: boolean; completion?: ProtocolV2UiCompletion; method?: string; page?: string | number; operation?: string; interaction?: HardwareUiInteractionMeta; }; type UiRequestWindowClose = { type: typeof UI_REQUEST.CLOSE_UI_WINDOW; payload: HardwareUiInteractionMeta; } | { type: typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW; payload: HardwareUiInteractionMeta; } | { type: typeof UI_REQUEST.CLOSE_UI_WINDOW; payload?: undefined; } | { type: typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW; payload?: undefined; }; interface UiRequestWithoutPayload { type: typeof UI_REQUEST.BLUETOOTH_PERMISSION | typeof UI_REQUEST.BLUETOOTH_UNSUPPORTED | typeof UI_REQUEST.BLUETOOTH_POWERED_OFF | typeof UI_REQUEST.BLUETOOTH_CHARACTERISTIC_NOTIFY_CHANGE_FAILURE | typeof UI_REQUEST.LOCATION_PERMISSION | typeof UI_REQUEST.LOCATION_SERVICE_PERMISSION | typeof UI_REQUEST.FIRMWARE_PROCESSING | typeof UI_REQUEST.WEB_DEVICE_PROMPT_ACCESS_PERMISSION; payload?: typeof undefined; } interface UiRequestFirmwareProgressing { type: typeof UI_REQUEST.FIRMWARE_PROCESSING; payload: { type: 'firmware' | 'ble' | 'bootloader' | 'resource'; }; } type UiRequestDeviceAction = { type: typeof UI_REQUEST.REQUEST_PIN; payload: ProtocolV2UiEventMetadata & { device: Device$1; type?: Messages.PinMatrixRequestType | 'ButtonRequest_PinEntry' | 'ButtonRequest_AttachPin'; responseCorrelation?: UiResponseCorrelation; }; }; interface UiRequestButton { type: typeof UI_REQUEST.REQUEST_BUTTON; payload: DeviceButtonRequest['payload'] & ProtocolV2UiEventMetadata; } interface UiRequestPassphrase { type: typeof UI_REQUEST.REQUEST_PASSPHRASE; payload: { device: Device$1; passphraseState?: string; existsAttachPinUser?: boolean; deviceOnly?: boolean; source?: 'wallet-session-coordinator'; reason?: 'open-wallet' | 'session-recovery'; expectedPassphraseState?: string; interaction?: HardwareUiInteractionMeta; responseCorrelation?: UiResponseCorrelation; }; } interface UiRequestPassphraseOnDevice { type: typeof UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE; payload: { device: Device$1; passphraseState?: string; source?: 'wallet-session-coordinator'; reason?: 'open-wallet' | 'session-recovery'; interaction?: HardwareUiInteractionMeta; }; } interface UiRequestSelectDeviceInBootloaderForWebDevice { type: typeof UI_REQUEST.REQUEST_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE; payload: { device: Device$1; }; } interface UiRequestSelectDeviceForSwitchFirmwareWebDevice { type: typeof UI_REQUEST.REQUEST_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE; payload: { device: Device$1; }; } interface FirmwareProcessing { type: typeof UI_REQUEST.FIRMWARE_PROCESSING; payload: { type: 'firmware' | 'ble' | 'bootloader' | 'resource'; }; } type IFirmwareUpdateProgressType = 'transferData' | 'installingFirmware'; interface FirmwareProgress { type: typeof UI_REQUEST.FIRMWARE_PROGRESS; payload: { device: Device$1; progress: number; progressType: IFirmwareUpdateProgressType; transferredBytes?: number; totalBytes?: number; rateBytesPerSecond?: number; elapsedMs?: number; installTargetId?: number; installPhase?: 'prepare' | 'install' | 'verify'; installPhaseProgress?: number; }; } interface FirmwareTip { type: typeof UI_REQUEST.FIRMWARE_TIP; payload: { device: Device$1; data: { message: string; }; }; } interface DeviceProgress { type: typeof UI_REQUEST.DEVICE_PROGRESS; payload: { progress?: number; transferredBytes?: number; totalBytes?: number; rateBytesPerSecond?: number; elapsedMs?: number; }; } interface PreviousAddressResult { type: typeof UI_REQUEST.PREVIOUS_ADDRESS_RESULT; payload: { device: Device$1; data: { address?: string; path?: string; }; }; } type UiEvent = UiRequestWithoutPayload | UiRequestWindowClose | UiRequestDeviceAction | UiRequestButton | UiRequestPassphraseOnDevice | UiRequestPassphrase | UiRequestSelectDeviceInBootloaderForWebDevice | UiRequestSelectDeviceForSwitchFirmwareWebDevice | FirmwareProcessing | UiRequestSelectDeviceInBootloaderForWebDevice | FirmwareProgress | FirmwareTip | DeviceProgress | PreviousAddressResult; declare enum FirmwareUpdateTipMessage { CheckLatestUiResource = "CheckLatestUiResource", StartDownloadFirmware = "StartDownloadFirmware", FinishDownloadFirmware = "FinishDownloadFirmware", DownloadLatestUiResource = "DownloadLatestUiResource", DownloadFirmware = "DownloadFirmware", DownloadBleFirmware = "DownloadBleFirmware", DownloadLatestBootloaderResource = "DownloadLatestBootloaderResource", DownloadLatestUiResourceSuccess = "DownloadLatestUiResourceSuccess", DownloadFirmwareSuccess = "DownloadFirmwareSuccess", DownloadBleFirmwareSuccess = "DownloadBleFirmwareSuccess", DownloadLatestBootloaderResourceSuccess = "DownloadLatestBootloaderResourceSuccess", AutoRebootToBootloader = "AutoRebootToBootloader", GoToBootloaderSuccess = "GoToBootloaderSuccess", SelectDeviceInBootloaderForWebDevice = "SelectDeviceInBootloaderForWebDevice", SwitchFirmwareReconnectDevice = "SwitchFirmwareReconnectDevice", ConfirmOnDevice = "ConfirmOnDevice", FirmwareEraseSuccess = "FirmwareEraseSuccess", StartTransferData = "StartTransferData", InstallingFirmware = "InstallingFirmware", UpdateBootloader = "UpdateBootloader", UpdateBootloaderSuccess = "UpdateBootloaderSuccess", UpdateSysResource = "UpdateSysResource", UpdateSysResourceSuccess = "UpdateSysResourceSuccess", FirmwareUpdating = "FirmwareUpdating", FirmwareUpdateCompleted = "FirmwareUpdateCompleted" } type IFirmwareUpdateTipMessage = `${FirmwareUpdateTipMessage}`; type UiEventMessage = UiEvent & { event: typeof UI_EVENT; }; declare const createUiMessage: MessageFactoryFn; declare const IFRAME: { readonly INIT: "iframe-init"; readonly INIT_BRIDGE: "iframe-init-bridge"; readonly CALL: "iframe-call"; readonly CANCEL: "iframe-cancel"; readonly SWITCH_TRANSPORT: "iframe-switch-transport"; readonly CALLBACK: "iframe-callback"; }; interface IFrameInit { type: typeof IFRAME.INIT; payload: { settings: ConnectSettings; }; } interface IFrameBridge { type: typeof IFRAME.INIT_BRIDGE; payload: unknown; } interface IFrameSwitchTransport { type: typeof IFRAME.SWITCH_TRANSPORT; payload: { env: ConnectSettings['env']; }; } interface IFrameCallback { type: typeof IFRAME.CALLBACK; payload: { callbackId: string; data?: any; error?: any; finished?: boolean; }; } type IFrameEvent = IFrameInit | IFrameBridge | IFrameSwitchTransport | IFrameCallback; type IFrameEventMessage = IFrameEvent & { event: typeof UI_EVENT; }; declare const createIFrameMessage: MessageFactoryFn; type UnwrappedResponse = T extends Promise ? R extends { success: true; payload: infer P; } ? P : never : void; type OverloadedMethod> = T extends { (params: infer P1): infer R1; (params: infer P2): infer R2; } ? ((params: P1 & E) => R1) | ((params: P2 & E) => R2) : T extends (...args: infer P) => infer R ? (params: E & P[0]) => R : never; type UnwrappedMethod> = T extends () => infer R ? (params: M & CommonParams) => R : OverloadedMethod; type IsMethodCallable = T extends (...args: any[]) => infer R ? R extends Promise<{ success: boolean; }> ? R : never : never; type CallApi = { [K in keyof CoreApi]: IsMethodCallable extends never ? never : UnwrappedMethod; }; type CallMethodUnion = CallApi[keyof CallApi]; type CallMethodPayload = Parameters[0]; type CallMethodResponse = UnwrappedResponse>; type CallMethodAnyResponse = ReturnType; type CallMethod = (params: CallMethodPayload) => Promise; interface IFrameCallMessage { event: typeof IFRAME.CALL; type: typeof IFRAME.CALL; payload: CallMethodPayload; } interface IFrameCancelMessage { event: typeof IFRAME.CANCEL; type: typeof IFRAME.CANCEL; payload: { connectId?: string; }; } interface IFrameSwitchTransportMessage { event: typeof IFRAME.SWITCH_TRANSPORT; type: typeof IFRAME.SWITCH_TRANSPORT; payload: { env: ConnectSettings['env']; }; } interface IFrameCallbackMessage { event: typeof IFRAME.CALLBACK; type: typeof IFRAME.CALLBACK; payload: { callbackId: string; data?: any; error?: any; }; } declare const RESPONSE_EVENT = "RESPONSE_EVENT"; interface MethodResponseMessage { event: typeof RESPONSE_EVENT; type: typeof RESPONSE_EVENT; id: number; success: boolean; payload: any; } declare const createResponseMessage: (id: number, success: boolean, payload: any) => MethodResponseMessage; type CallMethodKeys = keyof CoreApi; declare const LOG_EVENT = "LOG_EVENT"; declare const LOG: { readonly OUTPUT: "log-output"; }; interface LogOutput { type: typeof LOG.OUTPUT; payload: any; } type LogEvent = LogOutput; type LogEventMessage = LogEvent & { event: typeof LOG_EVENT; }; declare const createLogMessage: MessageFactoryFn; declare const getFirmwareReleaseInfo: (features: Features, firmwareType: EFirmwareType) => { status: IDeviceFirmwareStatus; changelog: { "en-US": string; "zh-CN": string; }[]; release: IFirmwareReleaseInfo | undefined; bootloaderMode: boolean; }; declare const getBleFirmwareReleaseInfo: (features: Features) => { status: IDeviceBLEFirmwareStatus; changelog: { "en-US": string; "zh-CN": string; }[]; release: IBLEFirmwareReleaseInfo | undefined; bootloaderMode: boolean; }; declare const FIRMWARE_EVENT = "FIRMWARE_EVENT"; declare const FIRMWARE: { readonly RELEASE_INFO: "firmware-release-info"; readonly BLE_RELEASE_INFO: "ble-firmware-release-info"; }; type ReleaseInfoPayload = ReturnType & { device?: KnownDevice | null; }; interface ReleaseInfoEvent { type: typeof FIRMWARE.RELEASE_INFO; payload: ReleaseInfoPayload; } type BleReleaseInfoPayload = ReturnType & { device?: KnownDevice | null; }; interface BleReleaseInfoEvent { type: typeof FIRMWARE.BLE_RELEASE_INFO; payload: BleReleaseInfoPayload; } type FirmwareEvent = ReleaseInfoEvent | BleReleaseInfoEvent; type FirmwareMessage = FirmwareEvent & { event: typeof FIRMWARE_EVENT; }; declare const createFirmwareMessage: MessageFactoryFn; declare const CORE_EVENT = "CORE_EVENT"; type CoreMessage = { id?: string; success?: true | false; } & (IFrameEventMessage | IFrameCallMessage | IFrameCancelMessage | IFrameSwitchTransportMessage | IFrameCallbackMessage | UiResponseMessage | UiEventMessage | DeviceEventMessage | LogEventMessage | FirmwareMessage); type PostMessageEvent = MessageEvent; declare const parseMessage: (messageData: any) => CoreMessage; declare const createErrorMessage: (error: Error & { code?: string | number; }) => Unsuccessful; type UiPromiseResponse = UiResponseEvent | { type: typeof DEVICE.DISCONNECT; payload?: undefined; }; type UiPromise = Deferred, T, Device> & { responseCorrelation?: UiResponseCorrelation; }; declare const LogBlockEvent: Set; declare function getLogBlockLabel(message: unknown): string | undefined; declare function getSafeLogPayload(value: unknown, blockLabel?: string): unknown; declare function formatLogMethodLabel(label: string, methodName?: string): string; declare const executeCallback: (id: string, ...args: any[]) => void; declare const cleanupCallback: (id: string) => void; interface InjectApi { call: CallMethod; eventEmitter: EventEmitter$1; init: CoreApi['init']; updateSettings: CoreApi['updateSettings']; dispose: CoreApi['dispose']; uiResponse: CoreApi['uiResponse']; cancel: CoreApi['cancel']; switchTransport: CoreApi['switchTransport']; } interface TopLevelInjectApi { init: CoreApi['init']; call: CoreApi['call']; } type LogMessage = { level: string; prefix: string; message: any[]; timestamp: number; }; declare class Log { prefix: string; enabled: boolean; messages: LogMessage[]; constructor(prefix: string, enabled: boolean); addMessage(level: string, prefix: string, ...args: any[]): void; log(...args: any[]): void; error(...args: any[]): void; warn(...args: any[]): void; debug(...args: any[]): void; } declare const enableLog: (enabled?: boolean) => void; declare const getLog: () => LogMessage[]; declare const setLoggerPostMessage: (postMessageFn: (message: CoreMessage) => void) => void; declare enum LoggerNames { Core = "@onekey/hd-core", Transport = "Transport", Device = "Device", DeviceCommands = "DeviceCommands", DeviceConnector = "DeviceConnector", DeviceList = "DeviceList", DevicePool = "DevicePool", HdCommonConnectSdk = "@onekey/common-connect-sdk", HdBleSdk = "@onekey/hd-ble-sdk", HdTransportHttp = "@onekey/hd-transport-http", HdTransportLowLevel = "@onekey/hd-transport-lowlevel", HdBleTransport = "@onekey/hd-ble-transport", HdWebBleTransport = "@onekey/hd-web-ble-transport", HdTransportWebUsb = "@onekey/hd-transport-webusb", HdTransportNodeUsb = "@onekey/hd-transport-node-usb", Connect = "@onekey/connect", Iframe = "IFrame", SendMessage = "[SendMessage]", Method = "[Method]" } declare const getLogger: (key: LoggerNames) => Log; type HttpRequestOptions = { /** Additional request headers, such as a byte range for package metadata reads. */ headers?: Record; /** Axios adapter-defined request timeout retained for existing opt-in callers. */ timeoutMs?: number; /** Deadline for DNS, connection, TLS, redirects, and the first response-body progress. */ connectTimeoutMs?: number; /** Maximum idle interval between response-body progress events. */ readTimeoutMs?: number; /** Wall-clock deadline across all attempts and retry backoff. */ overallTimeoutMs?: number; maxRetries?: number; retryDelayMs?: number; }; declare const httpRequest: (url: string, type: string, options?: HttpRequestOptions) => any; declare const getTimeStamp: () => number; /** * Validates version string * @param {string} version Version string * @returns {boolean} True if version string is valid, false if not */ declare const isValidVersionString: (version: string) => boolean; /** * Validates a version array * @param {number[]} version Version array * @returns {boolean} True if version array is valid, false if not */ declare const isValidVersionArray: (version: number[]) => boolean; /** * Fills the missing version numbers with zeros (ie: [1, 2] will become [1, 2, 0]) * @param {number[]} version Version array * @returns {number[]} Version array with all positions filled */ declare const normalizeVersionArray: (version: number[]) => number[]; /** * Returns a valid version array from a version string * @param {string} version Version string * @returns {number[]} Version array */ declare const versionSplit: (version: string) => number[]; /** * Compares two versions and returns if the version is newer (1), older (-1) or equal (0). * @param {string | number[]} a Version to compare from * @param {string | number[]} b Version to compare with * @returns {number} Returns 1 if newer, -1 if older and 0 if equal */ declare const versionCompare: (a: string | number[], b: string | number[]) => 0 | 1 | -1; declare function patchFeatures(response: DefaultMessageResponse): TypedResponseMessage<"DeviceStatus"> | TypedResponseMessage<"DeviceSession"> | TypedResponseMessage<"Success"> | TypedResponseMessage<"PassphraseState"> | TypedResponseMessage<"Address"> | TypedResponseMessage<"DeviceFirmwareUpdateStatus"> | TypedResponseMessage<"AptosMessagePayload"> | TypedResponseMessage<"BinanceInputOutput"> | TypedResponseMessage<"BinanceCoin"> | TypedResponseMessage<"HDNodePathType"> | TypedResponseMessage<"HDNodeType"> | TypedResponseMessage<"MultisigRedeemScriptType"> | TypedResponseMessage<"TxRequestDetailsType"> | TypedResponseMessage<"TxRequestSerializedType"> | TypedResponseMessage<"TxInputType"> | TypedResponseMessage<"TxOutputBinType"> | TypedResponseMessage<"TxOutputType"> | TypedResponseMessage<"TxAckInputWrapper"> | TypedResponseMessage<"TxAckOutputWrapper"> | TypedResponseMessage<"PrevTx"> | TypedResponseMessage<"TxAckPrevInputWrapper"> | TypedResponseMessage<"PrevInput"> | TypedResponseMessage<"TxAckPrevOutputWrapper"> | TypedResponseMessage<"PrevOutput"> | TypedResponseMessage<"TxAckPrevExtraDataWrapper"> | TypedResponseMessage<"BIP32Address"> | TypedResponseMessage<"CardanoNativeScript"> | TypedResponseMessage<"CardanoBlockchainPointerType"> | TypedResponseMessage<"CardanoAddressParametersType"> | TypedResponseMessage<"CardanoPoolMetadataType"> | TypedResponseMessage<"CardanoPoolParametersType"> | TypedResponseMessage<"CardanoDRep"> | TypedResponseMessage<"CardanoCVoteRegistrationDelegation"> | TypedResponseMessage<"CardanoCVoteRegistrationParametersType"> | TypedResponseMessage<"IdentityType"> | TypedResponseMessage<"Path"> | TypedResponseMessage<"DnxTxKey"> | TypedResponseMessage<"DnxComputedKeyImage"> | TypedResponseMessage<"EmmcFile"> | TypedResponseMessage<"EosTxHeader"> | TypedResponseMessage<"EosActionCommon"> | TypedResponseMessage<"EosActionTransfer"> | TypedResponseMessage<"EosActionDelegate"> | TypedResponseMessage<"EosActionUndelegate"> | TypedResponseMessage<"EosActionRefund"> | TypedResponseMessage<"EosActionBuyRam"> | TypedResponseMessage<"EosActionBuyRamBytes"> | TypedResponseMessage<"EosActionSellRam"> | TypedResponseMessage<"EosActionVoteProducer"> | TypedResponseMessage<"EosActionUpdateAuth"> | TypedResponseMessage<"EosActionDeleteAuth"> | TypedResponseMessage<"EosActionLinkAuth"> | TypedResponseMessage<"EosActionUnlinkAuth"> | TypedResponseMessage<"EosActionNewAccount"> | TypedResponseMessage<"EosActionUnknown"> | TypedResponseMessage<"EosPermissionLevel"> | TypedResponseMessage<"EosAuthorizationKey"> | TypedResponseMessage<"EosAuthorizationAccount"> | TypedResponseMessage<"EosAuthorizationWait"> | TypedResponseMessage<"EosAsset"> | TypedResponseMessage<"EosAuthorization"> | TypedResponseMessage<"EthereumStructMemberOneKey"> | TypedResponseMessage<"EthereumFieldTypeOneKey"> | TypedResponseMessage<"EthereumDefinitions"> | TypedResponseMessage<"EthereumStructMember"> | TypedResponseMessage<"EthereumFieldType"> | TypedResponseMessage<"EthereumAccessListOneKey"> | TypedResponseMessage<"EthereumAuthorizationOneKey"> | TypedResponseMessage<"EthereumAuthorizationSignature"> | TypedResponseMessage<"EthereumAccessList"> | TypedResponseMessage<"KaspaTxRequestSignature"> | TypedResponseMessage<"KaspaOutpoint"> | TypedResponseMessage<"FileInfo"> | TypedResponseMessage<"MoneroOutputEntry"> | TypedResponseMessage<"MoneroMultisigKLRki"> | TypedResponseMessage<"MoneroRctKeyPublic"> | TypedResponseMessage<"MoneroAccountPublicAddress"> | TypedResponseMessage<"MoneroTransactionData"> | TypedResponseMessage<"MoneroTransactionDestinationEntry"> | TypedResponseMessage<"MoneroTransactionRsigData"> | TypedResponseMessage<"MoneroTransactionSourceEntry"> | TypedResponseMessage<"MoneroRingCtSig"> | TypedResponseMessage<"MoneroSubAddressIndicesList"> | TypedResponseMessage<"MoneroTransferDetails"> | TypedResponseMessage<"MoneroExportedKeyImage"> | TypedResponseMessage<"NEMTransactionCommon"> | TypedResponseMessage<"NEMTransfer"> | TypedResponseMessage<"NEMProvisionNamespace"> | TypedResponseMessage<"NEMMosaicCreation"> | TypedResponseMessage<"NEMMosaicSupplyChange"> | TypedResponseMessage<"NEMAggregateModification"> | TypedResponseMessage<"NEMImportanceTransfer"> | TypedResponseMessage<"NEMMosaic"> | TypedResponseMessage<"NEMMosaicDefinition"> | TypedResponseMessage<"NEMCosignatoryModification"> | TypedResponseMessage<"RipplePayment"> | TypedResponseMessage<"SolanaTxATADetails"> | TypedResponseMessage<"SolanaTxExtraInfo"> | TypedResponseMessage<"StellarAsset"> | TypedResponseMessage<"TezosRevealOp"> | TypedResponseMessage<"TezosTransactionOp"> | TypedResponseMessage<"TezosOriginationOp"> | TypedResponseMessage<"TezosDelegationOp"> | TypedResponseMessage<"TezosProposalOp"> | TypedResponseMessage<"TezosBallotOp"> | TypedResponseMessage<"TezosContractID"> | TypedResponseMessage<"TezosParametersManager"> | TypedResponseMessage<"TezosManagerTransfer"> | TypedResponseMessage<"TronContract"> | TypedResponseMessage<"TronTransferContract"> | TypedResponseMessage<"TronVoteWitnessContract"> | TypedResponseMessage<"TronFreezeBalanceContract"> | TypedResponseMessage<"TronUnfreezeBalanceContract"> | TypedResponseMessage<"TronWithdrawBalanceContract"> | TypedResponseMessage<"TronTriggerSmartContract"> | TypedResponseMessage<"TronFreezeBalanceV2Contract"> | TypedResponseMessage<"TronUnfreezeBalanceV2Contract"> | TypedResponseMessage<"TronWithdrawExpireUnfreezeContract"> | TypedResponseMessage<"TronDelegateResourceContract"> | TypedResponseMessage<"TronUnDelegateResourceContract"> | TypedResponseMessage<"TronCancelAllUnfreezeV2Contract"> | TypedResponseMessage<"Vote"> | TypedResponseMessage<"CoinJoinRequest"> | TypedResponseMessage<"PaymentRequestMemo"> | TypedResponseMessage<"TextMemo"> | TypedResponseMessage<"RefundMemo"> | TypedResponseMessage<"CoinPurchaseMemo"> | TypedResponseMessage<"DeviceSettings"> | TypedResponseMessage<"DeviceCertificate"> | TypedResponseMessage<"DeviceFactoryInfoManufactureTime"> | TypedResponseMessage<"DeviceFactoryInfo"> | TypedResponseMessage<"DeviceFirmwareTarget"> | TypedResponseMessage<"DeviceFirmwareUpdatePhaseInfo"> | TypedResponseMessage<"DeviceFirmwareUpdateRecordFields"> | TypedResponseMessage<"DeviceFirmwareUpdateRecord"> | TypedResponseMessage<"DeviceFirmwareImageInfo"> | TypedResponseMessage<"DeviceInfoTargets"> | TypedResponseMessage<"DeviceInfoTypes"> | TypedResponseMessage<"DeviceHardwareInfo"> | TypedResponseMessage<"DeviceMainMcuInfo"> | TypedResponseMessage<"DeviceCoprocessorInfo"> | TypedResponseMessage<"DeviceSEInfo"> | TypedResponseMessage<"FilesystemFile"> | TypedResponseMessage<"OnboardingSetupStatus"> | TypedResponseMessage<"ViewContentEntry"> | TypedResponseMessage<"ViewAmount"> | TypedResponseMessage<"ViewDetail"> | TypedResponseMessage<"ViewTip"> | TypedResponseMessage<"ViewActionCard"> | TypedResponseMessage<"ViewContentPreview"> | TypedResponseMessage<"ViewCustomField"> | TypedResponseMessage<"AlephiumGetAddress"> | TypedResponseMessage<"AlephiumAddress"> | TypedResponseMessage<"AlephiumSignTx"> | TypedResponseMessage<"AlephiumSignedTx"> | TypedResponseMessage<"AlephiumTxRequest"> | TypedResponseMessage<"AlephiumTxAck"> | TypedResponseMessage<"AlephiumBytecodeRequest"> | TypedResponseMessage<"AlephiumBytecodeAck"> | TypedResponseMessage<"AlephiumSignMessage"> | TypedResponseMessage<"AlephiumMessageSignature"> | TypedResponseMessage<"AlgorandGetAddress"> | TypedResponseMessage<"AlgorandAddress"> | TypedResponseMessage<"AlgorandSignTx"> | TypedResponseMessage<"AlgorandSignedTx"> | TypedResponseMessage<"AptosGetAddress"> | TypedResponseMessage<"AptosAddress"> | TypedResponseMessage<"AptosSignTx"> | TypedResponseMessage<"AptosSignedTx"> | TypedResponseMessage<"AptosSignMessage"> | TypedResponseMessage<"AptosMessageSignature"> | TypedResponseMessage<"AptosSignSIWAMessage"> | TypedResponseMessage<"BenfenGetAddress"> | TypedResponseMessage<"BenfenAddress"> | TypedResponseMessage<"BenfenSignTx"> | TypedResponseMessage<"BenfenSignedTx"> | TypedResponseMessage<"BenfenTxRequest"> | TypedResponseMessage<"BenfenTxAck"> | TypedResponseMessage<"BenfenSignMessage"> | TypedResponseMessage<"BenfenMessageSignature"> | TypedResponseMessage<"BinanceGetAddress"> | TypedResponseMessage<"BinanceAddress"> | TypedResponseMessage<"BinanceGetPublicKey"> | TypedResponseMessage<"BinancePublicKey"> | TypedResponseMessage<"BinanceSignTx"> | TypedResponseMessage<"BinanceTxRequest"> | TypedResponseMessage<"BinanceTransferMsg"> | TypedResponseMessage<"BinanceOrderMsg"> | TypedResponseMessage<"BinanceCancelMsg"> | TypedResponseMessage<"BinanceSignedTx"> | TypedResponseMessage<"GetPublicKey"> | TypedResponseMessage<"PublicKey"> | TypedResponseMessage<"GetAddress"> | TypedResponseMessage<"GetOwnershipId"> | TypedResponseMessage<"OwnershipId"> | TypedResponseMessage<"SignMessage"> | TypedResponseMessage<"MessageSignature"> | TypedResponseMessage<"VerifyMessage"> | TypedResponseMessage<"SignTx"> | TypedResponseMessage<"TxRequest"> | TypedResponseMessage<"TxAck"> | TypedResponseMessage<"TxAckInput"> | TypedResponseMessage<"TxAckOutput"> | TypedResponseMessage<"TxAckPrevMeta"> | TypedResponseMessage<"TxAckPrevInput"> | TypedResponseMessage<"TxAckPrevOutput"> | TypedResponseMessage<"TxAckPrevExtraData"> | TypedResponseMessage<"GetOwnershipProof"> | TypedResponseMessage<"OwnershipProof"> | TypedResponseMessage<"AuthorizeCoinJoin"> | TypedResponseMessage<"GetPublicKeyMultiple"> | TypedResponseMessage<"PublicKeyMultiple"> | TypedResponseMessage<"SignPsbt"> | TypedResponseMessage<"SignedPsbt"> | TypedResponseMessage<"FirmwareErase"> | TypedResponseMessage<"FirmwareRequest"> | TypedResponseMessage<"FirmwareUpload"> | TypedResponseMessage<"SelfTest"> | TypedResponseMessage<"FirmwareErase_ex"> | TypedResponseMessage<"Reboot"> | TypedResponseMessage<"FirmwareUpdateEmmc"> | TypedResponseMessage<"UpgradeFileHeader"> | TypedResponseMessage<"CardanoGetNativeScriptHash"> | TypedResponseMessage<"CardanoNativeScriptHash"> | TypedResponseMessage<"CardanoGetAddress"> | TypedResponseMessage<"CardanoAddress"> | TypedResponseMessage<"CardanoGetPublicKey"> | TypedResponseMessage<"CardanoPublicKey"> | TypedResponseMessage<"CardanoSignTxInit"> | TypedResponseMessage<"CardanoTxInput"> | TypedResponseMessage<"CardanoTxOutput"> | TypedResponseMessage<"CardanoAssetGroup"> | TypedResponseMessage<"CardanoToken"> | TypedResponseMessage<"CardanoTxInlineDatumChunk"> | TypedResponseMessage<"CardanoTxReferenceScriptChunk"> | TypedResponseMessage<"CardanoPoolOwner"> | TypedResponseMessage<"CardanoPoolRelayParameters"> | TypedResponseMessage<"CardanoTxCertificate"> | TypedResponseMessage<"CardanoTxWithdrawal"> | TypedResponseMessage<"CardanoTxAuxiliaryData"> | TypedResponseMessage<"CardanoTxMint"> | TypedResponseMessage<"CardanoTxCollateralInput"> | TypedResponseMessage<"CardanoTxRequiredSigner"> | TypedResponseMessage<"CardanoTxReferenceInput"> | TypedResponseMessage<"CardanoTxItemAck"> | TypedResponseMessage<"CardanoTxAuxiliaryDataSupplement"> | TypedResponseMessage<"CardanoTxWitnessRequest"> | TypedResponseMessage<"CardanoTxWitnessResponse"> | TypedResponseMessage<"CardanoTxHostAck"> | TypedResponseMessage<"CardanoTxBodyHash"> | TypedResponseMessage<"CardanoSignTxFinished"> | TypedResponseMessage<"CardanoSignMessage"> | TypedResponseMessage<"CardanoMessageSignature"> | TypedResponseMessage<"Failure"> | TypedResponseMessage<"ButtonRequest"> | TypedResponseMessage<"ButtonAck"> | TypedResponseMessage<"PinMatrixRequest"> | TypedResponseMessage<"PinMatrixAck"> | TypedResponseMessage<"PassphraseRequest"> | TypedResponseMessage<"PassphraseAck"> | TypedResponseMessage<"Deprecated_PassphraseStateRequest"> | TypedResponseMessage<"Deprecated_PassphraseStateAck"> | TypedResponseMessage<"BixinPinInputOnDevice"> | TypedResponseMessage<"ConfluxGetAddress"> | TypedResponseMessage<"ConfluxAddress"> | TypedResponseMessage<"ConfluxSignTx"> | TypedResponseMessage<"ConfluxTxRequest"> | TypedResponseMessage<"ConfluxTxAck"> | TypedResponseMessage<"ConfluxSignMessage"> | TypedResponseMessage<"ConfluxMessageSignature"> | TypedResponseMessage<"ConfluxSignMessageCIP23"> | TypedResponseMessage<"CosmosGetAddress"> | TypedResponseMessage<"CosmosAddress"> | TypedResponseMessage<"CosmosSignTx"> | TypedResponseMessage<"CosmosSignedTx"> | TypedResponseMessage<"CipherKeyValue"> | TypedResponseMessage<"CipheredKeyValue"> | TypedResponseMessage<"SignIdentity"> | TypedResponseMessage<"SignedIdentity"> | TypedResponseMessage<"GetECDHSessionKey"> | TypedResponseMessage<"ECDHSessionKey"> | TypedResponseMessage<"BatchGetPublickeys"> | TypedResponseMessage<"EcdsaPublicKeys"> | TypedResponseMessage<"DnxGetAddress"> | TypedResponseMessage<"DnxAddress"> | TypedResponseMessage<"DnxSignTx"> | TypedResponseMessage<"DnxInputRequest"> | TypedResponseMessage<"DnxInputAck"> | TypedResponseMessage<"DnxRTSigsRequest"> | TypedResponseMessage<"DnxSignedTx"> | TypedResponseMessage<"EmmcFixPermission"> | TypedResponseMessage<"EmmcPath"> | TypedResponseMessage<"EmmcPathInfo"> | TypedResponseMessage<"EmmcFileRead"> | TypedResponseMessage<"EmmcFileWrite"> | TypedResponseMessage<"EmmcFileDelete"> | TypedResponseMessage<"EmmcDir"> | TypedResponseMessage<"EmmcDirList"> | TypedResponseMessage<"EmmcDirMake"> | TypedResponseMessage<"EmmcDirRemove"> | TypedResponseMessage<"EosGetPublicKey"> | TypedResponseMessage<"EosPublicKey"> | TypedResponseMessage<"EosSignTx"> | TypedResponseMessage<"EosTxActionRequest"> | TypedResponseMessage<"EosTxActionAck"> | TypedResponseMessage<"EosSignedTx"> | TypedResponseMessage<"EthereumNetworkInfo"> | TypedResponseMessage<"EthereumTokenInfo"> | TypedResponseMessage<"EthereumSignTypedDataOneKey"> | TypedResponseMessage<"EthereumGnosisSafeTxRequest"> | TypedResponseMessage<"EthereumGnosisSafeTxAck"> | TypedResponseMessage<"EthereumTypedDataStructRequestOneKey"> | TypedResponseMessage<"EthereumTypedDataStructAckOneKey"> | TypedResponseMessage<"EthereumTypedDataValueRequestOneKey"> | TypedResponseMessage<"EthereumTypedDataValueAckOneKey"> | TypedResponseMessage<"EthereumSignTypedData"> | TypedResponseMessage<"EthereumTypedDataStructRequest"> | TypedResponseMessage<"EthereumTypedDataStructAck"> | TypedResponseMessage<"EthereumTypedDataValueRequest"> | TypedResponseMessage<"EthereumTypedDataValueAck"> | TypedResponseMessage<"EthereumGetPublicKeyOneKey"> | TypedResponseMessage<"EthereumPublicKeyOneKey"> | TypedResponseMessage<"EthereumGetAddressOneKey"> | TypedResponseMessage<"EthereumAddressOneKey"> | TypedResponseMessage<"EthereumSignTxOneKey"> | TypedResponseMessage<"EthereumSignTxEIP1559OneKey"> | TypedResponseMessage<"EthereumSignTxEIP7702OneKey"> | TypedResponseMessage<"EthereumTxRequestOneKey"> | TypedResponseMessage<"EthereumTxAckOneKey"> | TypedResponseMessage<"EthereumSignMessageOneKey"> | TypedResponseMessage<"EthereumMessageSignatureOneKey"> | TypedResponseMessage<"EthereumVerifyMessageOneKey"> | TypedResponseMessage<"EthereumSignTypedHashOneKey"> | TypedResponseMessage<"EthereumTypedDataSignatureOneKey"> | TypedResponseMessage<"EthereumSignMessageEIP712"> | TypedResponseMessage<"EthereumGetPublicKey"> | TypedResponseMessage<"EthereumPublicKey"> | TypedResponseMessage<"EthereumGetAddress"> | TypedResponseMessage<"EthereumAddress"> | TypedResponseMessage<"EthereumSignTx"> | TypedResponseMessage<"EthereumSignTxEIP1559"> | TypedResponseMessage<"EthereumTxRequest"> | TypedResponseMessage<"EthereumTxAck"> | TypedResponseMessage<"EthereumSignMessage"> | TypedResponseMessage<"EthereumMessageSignature"> | TypedResponseMessage<"EthereumVerifyMessage"> | TypedResponseMessage<"EthereumSignTypedHash"> | TypedResponseMessage<"EthereumTypedDataSignature"> | TypedResponseMessage<"FilecoinGetAddress"> | TypedResponseMessage<"FilecoinAddress"> | TypedResponseMessage<"FilecoinSignTx"> | TypedResponseMessage<"FilecoinSignedTx"> | TypedResponseMessage<"KaspaGetAddress"> | TypedResponseMessage<"KaspaAddress"> | TypedResponseMessage<"KaspaSignTx"> | TypedResponseMessage<"KaspaTxInputRequest"> | TypedResponseMessage<"KaspaTxInputAck"> | TypedResponseMessage<"KaspaTxRequest"> | TypedResponseMessage<"KaspaTxAckInput"> | TypedResponseMessage<"KaspaTxAckOutput"> | TypedResponseMessage<"KaspaTxAckPayloadChunk"> | TypedResponseMessage<"KaspaTxAckPrevMeta"> | TypedResponseMessage<"KaspaTxAckPrevInput"> | TypedResponseMessage<"KaspaTxAckPrevOutput"> | TypedResponseMessage<"KaspaSignedTx"> | TypedResponseMessage<"LnurlAuth"> | TypedResponseMessage<"LnurlAuthResp"> | TypedResponseMessage<"Initialize"> | TypedResponseMessage<"GetFeatures"> | TypedResponseMessage<"OnekeyGetFeatures"> | TypedResponseMessage<"Features"> | TypedResponseMessage<"OnekeyFeatures"> | TypedResponseMessage<"LockDevice"> | TypedResponseMessage<"EndSession"> | TypedResponseMessage<"ApplySettings"> | TypedResponseMessage<"ApplyFlags"> | TypedResponseMessage<"ChangePin"> | TypedResponseMessage<"ChangeWipeCode"> | TypedResponseMessage<"SdProtect"> | TypedResponseMessage<"Ping"> | TypedResponseMessage<"Cancel"> | TypedResponseMessage<"GetEntropy"> | TypedResponseMessage<"Entropy"> | TypedResponseMessage<"WipeDevice"> | TypedResponseMessage<"ResetDevice"> | TypedResponseMessage<"BackupDevice"> | TypedResponseMessage<"EntropyRequest"> | TypedResponseMessage<"EntropyAck"> | TypedResponseMessage<"RecoveryDevice"> | TypedResponseMessage<"WordRequest"> | TypedResponseMessage<"WordAck"> | TypedResponseMessage<"SetU2FCounter"> | TypedResponseMessage<"GetNextU2FCounter"> | TypedResponseMessage<"NextU2FCounter"> | TypedResponseMessage<"DoPreauthorized"> | TypedResponseMessage<"PreauthorizedRequest"> | TypedResponseMessage<"CancelAuthorization"> | TypedResponseMessage<"BixinSeedOperate"> | TypedResponseMessage<"BixinMessageSE"> | TypedResponseMessage<"BixinOutMessageSE"> | TypedResponseMessage<"DeviceBackToBoot"> | TypedResponseMessage<"BixinBackupRequest"> | TypedResponseMessage<"BixinBackupAck"> | TypedResponseMessage<"BixinRestoreRequest"> | TypedResponseMessage<"BixinRestoreAck"> | TypedResponseMessage<"BixinVerifyDeviceRequest"> | TypedResponseMessage<"BixinVerifyDeviceAck"> | TypedResponseMessage<"BixinWhiteListRequest"> | TypedResponseMessage<"BixinWhiteListAck"> | TypedResponseMessage<"BixinLoadDevice"> | TypedResponseMessage<"BixinBackupDevice"> | TypedResponseMessage<"BixinBackupDeviceAck"> | TypedResponseMessage<"DeviceInfoSettings"> | TypedResponseMessage<"GetDeviceInfo"> | TypedResponseMessage<"DeviceInfo"> | TypedResponseMessage<"ReadSEPublicKey"> | TypedResponseMessage<"SEPublicKey"> | TypedResponseMessage<"WriteSEPublicCert"> | TypedResponseMessage<"ReadSEPublicCert"> | TypedResponseMessage<"SEPublicCert"> | TypedResponseMessage<"SpiFlashWrite"> | TypedResponseMessage<"SpiFlashRead"> | TypedResponseMessage<"SpiFlashData"> | TypedResponseMessage<"SESignMessage"> | TypedResponseMessage<"SEMessageSignature"> | TypedResponseMessage<"ResourceUpload"> | TypedResponseMessage<"ZoomRequest"> | TypedResponseMessage<"BlurRequest"> | TypedResponseMessage<"ResourceRequest"> | TypedResponseMessage<"ResourceAck"> | TypedResponseMessage<"ResourceUpdate"> | TypedResponseMessage<"NFTWriteInfo"> | TypedResponseMessage<"NFTWriteData"> | TypedResponseMessage<"RebootToBootloader"> | TypedResponseMessage<"RebootToBoardloader"> | TypedResponseMessage<"ListResDir"> | TypedResponseMessage<"FileInfoList"> | TypedResponseMessage<"DeviceEraseSector"> | TypedResponseMessage<"UnLockDevice"> | TypedResponseMessage<"UnLockDeviceResponse"> | TypedResponseMessage<"GetPassphraseState"> | TypedResponseMessage<"MoneroGetAddress"> | TypedResponseMessage<"MoneroAddress"> | TypedResponseMessage<"MoneroGetWatchKey"> | TypedResponseMessage<"MoneroWatchKey"> | TypedResponseMessage<"MoneroTransactionInitRequest"> | TypedResponseMessage<"MoneroTransactionInitAck"> | TypedResponseMessage<"MoneroTransactionSetInputRequest"> | TypedResponseMessage<"MoneroTransactionSetInputAck"> | TypedResponseMessage<"MoneroTransactionInputsPermutationRequest"> | TypedResponseMessage<"MoneroTransactionInputsPermutationAck"> | TypedResponseMessage<"MoneroTransactionInputViniRequest"> | TypedResponseMessage<"MoneroTransactionInputViniAck"> | TypedResponseMessage<"MoneroTransactionAllInputsSetRequest"> | TypedResponseMessage<"MoneroTransactionAllInputsSetAck"> | TypedResponseMessage<"MoneroTransactionSetOutputRequest"> | TypedResponseMessage<"MoneroTransactionSetOutputAck"> | TypedResponseMessage<"MoneroTransactionAllOutSetRequest"> | TypedResponseMessage<"MoneroTransactionAllOutSetAck"> | TypedResponseMessage<"MoneroTransactionSignInputRequest"> | TypedResponseMessage<"MoneroTransactionSignInputAck"> | TypedResponseMessage<"MoneroTransactionFinalRequest"> | TypedResponseMessage<"MoneroTransactionFinalAck"> | TypedResponseMessage<"MoneroKeyImageExportInitRequest"> | TypedResponseMessage<"MoneroKeyImageExportInitAck"> | TypedResponseMessage<"MoneroKeyImageSyncStepRequest"> | TypedResponseMessage<"MoneroKeyImageSyncStepAck"> | TypedResponseMessage<"MoneroKeyImageSyncFinalRequest"> | TypedResponseMessage<"MoneroKeyImageSyncFinalAck"> | TypedResponseMessage<"MoneroGetTxKeyRequest"> | TypedResponseMessage<"MoneroGetTxKeyAck"> | TypedResponseMessage<"MoneroLiveRefreshStartRequest"> | TypedResponseMessage<"MoneroLiveRefreshStartAck"> | TypedResponseMessage<"MoneroLiveRefreshStepRequest"> | TypedResponseMessage<"MoneroLiveRefreshStepAck"> | TypedResponseMessage<"MoneroLiveRefreshFinalRequest"> | TypedResponseMessage<"MoneroLiveRefreshFinalAck"> | TypedResponseMessage<"NearGetAddress"> | TypedResponseMessage<"NearAddress"> | TypedResponseMessage<"NearSignTx"> | TypedResponseMessage<"NearSignedTx"> | TypedResponseMessage<"NEMGetAddress"> | TypedResponseMessage<"NEMAddress"> | TypedResponseMessage<"NEMSignTx"> | TypedResponseMessage<"NEMSignedTx"> | TypedResponseMessage<"NEMDecryptMessage"> | TypedResponseMessage<"NEMDecryptedMessage"> | TypedResponseMessage<"NeoGetAddress"> | TypedResponseMessage<"NeoAddress"> | TypedResponseMessage<"NeoSignTx"> | TypedResponseMessage<"NeoSignedTx"> | TypedResponseMessage<"NervosGetAddress"> | TypedResponseMessage<"NervosAddress"> | TypedResponseMessage<"NervosSignTx"> | TypedResponseMessage<"NervosSignedTx"> | TypedResponseMessage<"NervosTxRequest"> | TypedResponseMessage<"NervosTxAck"> | TypedResponseMessage<"NexaGetAddress"> | TypedResponseMessage<"NexaAddress"> | TypedResponseMessage<"NexaSignTx"> | TypedResponseMessage<"NexaTxInputRequest"> | TypedResponseMessage<"NexaTxInputAck"> | TypedResponseMessage<"NexaSignedTx"> | TypedResponseMessage<"NostrGetPublicKey"> | TypedResponseMessage<"NostrPublicKey"> | TypedResponseMessage<"NostrSignEvent"> | TypedResponseMessage<"NostrSignedEvent"> | TypedResponseMessage<"NostrSignSchnorr"> | TypedResponseMessage<"NostrSignedSchnorr"> | TypedResponseMessage<"NostrEncryptMessage"> | TypedResponseMessage<"NostrEncryptedMessage"> | TypedResponseMessage<"NostrDecryptMessage"> | TypedResponseMessage<"NostrDecryptedMessage"> | TypedResponseMessage<"PolkadotGetAddress"> | TypedResponseMessage<"PolkadotAddress"> | TypedResponseMessage<"PolkadotSignTx"> | TypedResponseMessage<"PolkadotSignedTx"> | TypedResponseMessage<"RippleGetAddress"> | TypedResponseMessage<"RippleAddress"> | TypedResponseMessage<"RippleSignTx"> | TypedResponseMessage<"RippleSignedTx"> | TypedResponseMessage<"ScdoGetAddress"> | TypedResponseMessage<"ScdoAddress"> | TypedResponseMessage<"ScdoSignTx"> | TypedResponseMessage<"ScdoSignedTx"> | TypedResponseMessage<"ScdoTxAck"> | TypedResponseMessage<"ScdoSignMessage"> | TypedResponseMessage<"ScdoSignedMessage"> | TypedResponseMessage<"SolanaGetAddress"> | TypedResponseMessage<"SolanaAddress"> | TypedResponseMessage<"SolanaSignTx"> | TypedResponseMessage<"SolanaSignedTx"> | TypedResponseMessage<"SolanaSignOffChainMessage"> | TypedResponseMessage<"SolanaSignUnsafeMessage"> | TypedResponseMessage<"SolanaMessageSignature"> | TypedResponseMessage<"StarcoinGetAddress"> | TypedResponseMessage<"StarcoinAddress"> | TypedResponseMessage<"StarcoinGetPublicKey"> | TypedResponseMessage<"StarcoinPublicKey"> | TypedResponseMessage<"StarcoinSignTx"> | TypedResponseMessage<"StarcoinSignedTx"> | TypedResponseMessage<"StarcoinSignMessage"> | TypedResponseMessage<"StarcoinMessageSignature"> | TypedResponseMessage<"StarcoinVerifyMessage"> | TypedResponseMessage<"StellarGetAddress"> | TypedResponseMessage<"StellarAddress"> | TypedResponseMessage<"StellarSignTx"> | TypedResponseMessage<"StellarTxOpRequest"> | TypedResponseMessage<"StellarPaymentOp"> | TypedResponseMessage<"StellarCreateAccountOp"> | TypedResponseMessage<"StellarPathPaymentStrictReceiveOp"> | TypedResponseMessage<"StellarPathPaymentStrictSendOp"> | TypedResponseMessage<"StellarManageSellOfferOp"> | TypedResponseMessage<"StellarManageBuyOfferOp"> | TypedResponseMessage<"StellarCreatePassiveSellOfferOp"> | TypedResponseMessage<"StellarSetOptionsOp"> | TypedResponseMessage<"StellarChangeTrustOp"> | TypedResponseMessage<"StellarAllowTrustOp"> | TypedResponseMessage<"StellarAccountMergeOp"> | TypedResponseMessage<"StellarManageDataOp"> | TypedResponseMessage<"StellarBumpSequenceOp"> | TypedResponseMessage<"StellarInvokeHostFunctionOp"> | TypedResponseMessage<"StellarSorobanDataRequest"> | TypedResponseMessage<"StellarSorobanDataAck"> | TypedResponseMessage<"StellarSignedTx"> | TypedResponseMessage<"SuiGetAddress"> | TypedResponseMessage<"SuiAddress"> | TypedResponseMessage<"SuiSignTx"> | TypedResponseMessage<"SuiSignedTx"> | TypedResponseMessage<"SuiTxRequest"> | TypedResponseMessage<"SuiTxAck"> | TypedResponseMessage<"SuiSignMessage"> | TypedResponseMessage<"SuiMessageSignature"> | TypedResponseMessage<"TezosGetAddress"> | TypedResponseMessage<"TezosAddress"> | TypedResponseMessage<"TezosGetPublicKey"> | TypedResponseMessage<"TezosPublicKey"> | TypedResponseMessage<"TezosSignTx"> | TypedResponseMessage<"TezosSignedTx"> | TypedResponseMessage<"TonGetAddress"> | TypedResponseMessage<"TonAddress"> | TypedResponseMessage<"TonSignMessage"> | TypedResponseMessage<"TonTxAck"> | TypedResponseMessage<"TonSignedMessage"> | TypedResponseMessage<"TonSignProof"> | TypedResponseMessage<"TonSignedProof"> | TypedResponseMessage<"TonSignData"> | TypedResponseMessage<"TonSignedData"> | TypedResponseMessage<"TronGetAddress"> | TypedResponseMessage<"TronAddress"> | TypedResponseMessage<"TronSignTx"> | TypedResponseMessage<"TronSignedTx"> | TypedResponseMessage<"TronSignMessage"> | TypedResponseMessage<"TronMessageSignature"> | TypedResponseMessage<"facotry"> | TypedResponseMessage<"TxAckPaymentRequest"> | TypedResponseMessage<"EthereumSignTypedDataQR"> | TypedResponseMessage<"SetBusy"> | TypedResponseMessage<"GetFirmwareHash"> | TypedResponseMessage<"FirmwareHash"> | TypedResponseMessage<"GetNonce"> | TypedResponseMessage<"Nonce"> | TypedResponseMessage<"WriteSEPrivateKey"> | TypedResponseMessage<"UnlockPath"> | TypedResponseMessage<"UnlockedPathRequest"> | TypedResponseMessage<"UiAnimationRequest"> | TypedResponseMessage<"experimental_message"> | TypedResponseMessage<"experimental_field"> | TypedResponseMessage<"ProtocolInfoRequest"> | TypedResponseMessage<"ProtocolInfo"> | TypedResponseMessage<"DeviceReboot"> | TypedResponseMessage<"DeviceSettingsGet"> | TypedResponseMessage<"DeviceSettingsSet"> | TypedResponseMessage<"DeviceSettingsPageShow"> | TypedResponseMessage<"DeviceCertificateWrite"> | TypedResponseMessage<"DeviceCertificateRead"> | TypedResponseMessage<"DeviceCertificateSignature"> | TypedResponseMessage<"DeviceCertificateSign"> | TypedResponseMessage<"DeviceMiscUsbMscControl"> | TypedResponseMessage<"DeviceFindMyTokenUpdate"> | TypedResponseMessage<"DeviceFindMyTokenStateGet"> | TypedResponseMessage<"DeviceFindMyTokenState"> | TypedResponseMessage<"DeviceAnimationControl"> | TypedResponseMessage<"DeviceFactoryInfoSet"> | TypedResponseMessage<"DeviceFactoryInfoGet"> | TypedResponseMessage<"DeviceFactoryPermanentLock"> | TypedResponseMessage<"DeviceFactoryTest"> | TypedResponseMessage<"DeviceFirmwareUpdateStage"> | TypedResponseMessage<"DeviceFirmwareUpdateRequest"> | TypedResponseMessage<"DeviceFirmwareUpdateStatusGet"> | TypedResponseMessage<"DeviceInfoGet"> | TypedResponseMessage<"DeviceSessionGet"> | TypedResponseMessage<"DeviceSessionAskPin"> | TypedResponseMessage<"DeviceSessionAskPassphrase"> | TypedResponseMessage<"DeviceStatusGet"> | TypedResponseMessage<"FilesystemPermissionFix"> | TypedResponseMessage<"FilesystemPathInfo"> | TypedResponseMessage<"FilesystemPathInfoQuery"> | TypedResponseMessage<"FilesystemFileRead"> | TypedResponseMessage<"FilesystemFileWrite"> | TypedResponseMessage<"FilesystemFileDelete"> | TypedResponseMessage<"FilesystemDir"> | TypedResponseMessage<"FilesystemDirList"> | TypedResponseMessage<"FilesystemDirMake"> | TypedResponseMessage<"FilesystemDirRemove"> | TypedResponseMessage<"FilesystemFormat"> | TypedResponseMessage<"InternalMyAddressRequest"> | TypedResponseMessage<"NftUpdate"> | TypedResponseMessage<"OnboardingStatusGet"> | TypedResponseMessage<"OnboardingStatus"> | TypedResponseMessage<"PortfolioUpdate"> | TypedResponseMessage<"ViewContentPage"> | TypedResponseMessage<"ViewSignPage"> | TypedResponseMessage<"ViewWarningPage"> | TypedResponseMessage<"ViewVerifyPage">; type DeviceFeaturesInput = Features | Messages.Features; /** * get device type by features */ declare const getDeviceType: (features?: DeviceFeaturesInput) => IDeviceType; /** * get device type by ble name * @param name Ble name */ declare const getDeviceTypeByBleName: (name?: string) => IDeviceType; /** * Get Connected Device ble name by features * @returns */ declare const getDeviceBleName: (features?: DeviceFeaturesInput) => string | null; /** * Get Connected Device serial number by features */ declare const getDeviceSerialNo: (features?: DeviceFeaturesInput) => string; /** * @deprecated Use getDeviceSerialNo instead. */ declare const getDeviceUUID: (features?: DeviceFeaturesInput) => string; /** * Get Connected Device label by features */ declare const getDeviceLabel: (features?: DeviceFeaturesInput) => string | null; /** * Get firmware version range by features * Type has a higher priority than Model */ declare const getMethodVersionRange: (features: DeviceFeaturesInput | undefined, getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined) => IVersionRange | undefined; declare const getFirmwareType: (features?: DeviceFeaturesInput) => _onekeyfe_hd_shared.EFirmwareType; /** * Get Connected Device version by features */ declare const getDeviceFirmwareVersion: (features?: DeviceFeaturesInput) => IVersionArray; /** * Get Connected Device bootloader version by features */ declare const getDeviceBootloaderVersion: (features?: DeviceFeaturesInput) => IVersionArray; /** * Get Connected Device boardloader/romloader version by features */ declare const getDeviceBoardloaderVersion: (features?: DeviceFeaturesInput) => IVersionArray; /** * Get Connected Device bluetooth firmware version by features */ declare const getDeviceBLEFirmwareVersion: (features?: DeviceFeaturesInput) => IVersionArray; declare const FIRMWARE_FIELDS: readonly ["firmware", "firmware-v1", "firmware-v2", "firmware-v8", "firmware-btc-v8"]; type IFirmwareField = (typeof FIRMWARE_FIELDS)[number]; type ProtocolV1MessageSchema = 'v1CurrentSchema' | 'v1LegacySchema'; type ProtobufMessageSchema = ProtocolV1MessageSchema | 'v2Schema'; declare class DataManager { static deviceMap: DeviceTypeMap & { [k: string]: NonNullable | undefined; }; static assets: AssetsMap | null; static settings: ConnectSettings; static messages: { [schema in ProtobufMessageSchema]: JSON; }; static lastCheckTimestamp: number; static protocolV2ResourcesConfigError: Error | undefined; private static protocolV2NeoResourcesConfigError; static getFirmwareStatus: (features: Features, firmwareType: EFirmwareType) => IDeviceFirmwareStatus; /** * Touch、Pro System UI Resource Update * ** Interval upgrade is not considered ** */ static getSysResourcesLatestRelease: ({ features, forcedUpdateRes, firmwareType, }: { features: Features; forcedUpdateRes?: boolean | undefined; firmwareType: EFirmwareType; }) => string | undefined; /** * Touch、Pro System full UI Resource Update * ** Interval upgrade is not considered ** */ static getSysFullResource: (features: Features, firmwareType: EFirmwareType) => string | undefined; static getBootloaderResource: (features: Features, firmwareType: EFirmwareType) => string | undefined; static getBootloaderTargetVersion: (features: Features, firmwareType: EFirmwareType) => IVersionArray | undefined; static getBootloaderRelatedFirmwareVersion: (features: Features, firmwareType: EFirmwareType) => IVersionArray | undefined; static getFirmwareChangelog: (features: Features, firmwareType: EFirmwareType) => { "en-US": string; "zh-CN": string; }[]; static getFirmwareLatestRelease: (features: Features, firmwareType: EFirmwareType) => IFirmwareReleaseInfo | undefined; static getBLEFirmwareStatus: (features: Features) => IDeviceBLEFirmwareStatus; static getBleFirmwareChangelog: (features: Features) => { "en-US": string; "zh-CN": string; }[]; static getBleFirmwareLatestRelease: (features: Features) => IBLEFirmwareReleaseInfo | undefined; static getTransportStatus: (localVersion: string) => ITransportStatus; static getBridgeChangelog: () => { "en-US": string; "zh-CN": string; } | undefined; private static enrichFirmwareReleaseInfo; private static enrichProtocolV2FirmwareReleaseInfo; static load(settings: ConnectSettings): Promise; private static applyRemoteConfig; static updateEnv(newEnv: ConnectSettings['env']): void; static checkAndReloadData(): Promise; /** Force a fresh remote config before an update is allowed to mutate the device. */ static forceReloadData({ requireResources, resourceDeviceType, }?: { requireResources?: boolean; resourceDeviceType?: EDeviceType.Pro2 | EDeviceType.Neo; }): Promise; static getProtocolV2ResourceSource(release: IFirmwareReleaseInfo | undefined): IProtocolV2ResourceSource | undefined; static getProtobufMessages(schema?: ProtobufMessageSchema): JSON; static getSettings(key?: undefined): ConnectSettings; static getSettings(key: T): ConnectSettings[T]; static isBleConnect: (env: ConnectSettings['env']) => boolean; /** Desktop WebUSB doesn't need browser permission prompt */ static isDesktopWebUsb: (env: ConnectSettings['env']) => boolean; /** Browser WebUSB needs permission prompt */ static isBrowserWebUsb: (env: ConnectSettings['env']) => boolean; } declare const supportInputPinOnSoftware: (features?: Features) => SupportFeatureType; /** * Since 3.5.0, Touch uses the firmware-v3 field to get firmware release info */ declare const getFirmwareUpdateField: ({ features, updateType, targetVersion, firmwareType, }: { features: Features; updateType: 'firmware' | 'ble'; targetVersion?: string | undefined; firmwareType: EFirmwareType; }) => 'ble' | IFirmwareField; /** * Returns the optional firmware version * Used in firmware web update * https://firmware.onekey.so/ */ declare const getFirmwareUpdateFieldArray: (features: Features, updateType: 'firmware' | 'ble' | 'bootloader') => ('ble' | IFirmwareField)[]; declare function checkNeedUpdateBootForTouch(features: Features, firmwareType: EFirmwareType): boolean; declare function checkNeedUpdateBootForClassicAndMini({ features, willUpdateFirmware, firmwareType, }: { features: Features; willUpdateFirmware?: string; firmwareType: EFirmwareType; }): boolean; type DeviceSettingsProtocol = 'V1' | 'V2'; type DeviceSettingsField = keyof DeviceSettingsParams; declare const DEVICE_SETTINGS_SHARED_FIELDS: readonly ["language", "label", "usePassphrase", "autoLockDelayMs", "autoShutdownDelayMs", "hapticFeedback", "bluetoothEnabled"]; declare const DEVICE_SETTINGS_V1_ONLY_FIELDS: readonly ["homescreen", "passphraseSource", "displayRotation", "passphraseAlwaysOnDevice", "safetyChecks", "experimentalFeatures", "changeBrightness"]; declare const DEVICE_SETTINGS_V2_ONLY_FIELDS: readonly ["brightness", "airgapMode", "animationEnabled", "tapToWake", "deviceNameDisplayEnabled", "fidoEnabled", "usbLockEnabled", "randomKeypad"]; declare const DEVICE_SETTINGS_NEVER_TIMEOUT_MS = 268435456; declare const PROTOCOL_V2_NEVER_TIMEOUT_MS = 268435456; declare const normalizeSafetyCheckLevel: (value: SafetyCheckLevel | null | undefined) => Enum_SafetyCheckLevel | null | undefined; declare const getLanguageConfig: (deviceType: IDeviceType) => Record[]; type DeviceSettingsDurationOption = { label: string; valueMs: number; }; type DeviceSettingsValueOption = { label: string; value: T; }; declare const getAutoLockOptions: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsDurationOption[]; declare const getAutoShutDownOptions: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsDurationOption[]; type DeviceSettingsCapabilities = { protocol: DeviceSettingsProtocol; supportedFields: readonly DeviceSettingsField[]; languageOptions: ReadonlyArray>; autoLockDelayOptions: readonly DeviceSettingsDurationOption[]; autoShutdownDelayOptions: readonly DeviceSettingsDurationOption[]; ranges: { brightness?: { min: number; max: number; }; }; safetyCheckOptions: ReadonlyArray>; onDeviceConfirmationFields: readonly DeviceSettingsField[]; }; declare const getDeviceSettingsCapabilities: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsCapabilities; declare const getHDPath: (path: string) => Array; declare const getScriptType: (path: Array) => InputScriptType; declare const getOutputScriptType: (path?: number[]) => ChangeOutputScriptType; declare const getHomeScreenHex: (deviceType: IDeviceType, name: string) => string; declare const getHomeScreenDefaultList: (features: Features) => string[]; type SizeConfig = { width: number; height: number; radius?: number; }; declare const getNftSize: ({ deviceType, thumbnail, }: { deviceType: IDeviceType; thumbnail?: boolean | undefined; }) => SizeConfig | undefined; declare const getHomeScreenSize: ({ deviceType, homeScreenType, thumbnail, }: { deviceType: IDeviceType; homeScreenType: 'WallPaper' | 'Nft'; thumbnail?: boolean | undefined; }) => SizeConfig | undefined; declare const isBleConnect: (env: string) => boolean; declare const wait: (ms: number) => Promise; declare const getSDKVersion: () => any; declare const whitelist: { origin: string; }[]; declare const whitelistExtension: string[]; declare const DEFAULT_PRIORITY = 2; declare global { var ONEKEY_CONNECT_SRC: string; } declare const getEnv: () => "web" | "webextension" | "electron" | "react-native"; declare const corsValidator: (url?: string) => string | undefined; declare const parseConnectSettings: (input?: Partial) => ConnectSettings; type StoredDeviceState = DeviceState & { raw?: DeviceFeaturesRaw; }; declare const projectFeatures: (state: StoredDeviceState) => Features; /** * Read the protocol contract from the same method instance used by the Core dispatcher. * Passing a payload initializes the method first so parameter-dependent contracts, such * as Bitcoin fork support, are evaluated with the actual request. */ declare function getMethodSupportedProtocols(method: string, payload?: Record): readonly ProtocolType[]; declare const registerFirmwareUpdateHostBinding: (binding: FirmwareUpdateHostBinding) => number; declare const unregisterFirmwareUpdateHostBinding: (generation?: number) => boolean; declare const getFirmwareUpdateHostBindingGeneration: () => number; declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel, updateSettings, switchTransport, }: InjectApi) => CoreApi; declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, updateSettings, switchTransport, }: LowLevelInjectApi) => LowLevelCoreApi; declare const HardwareTopLevelSdk: () => CoreApi; export { AccountAddress, AccountAddresses, AlephiumAddress, AlephiumGetAddressParams, AlephiumSignMessageParams, AlephiumSignTransactionParams, AlephiumSignedTx, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AllFirmwareRelease, AllNetworkAddressParams, AllNetworkGetAddressParams, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignInMessageParams, AptosSignInMessageSignature, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BenfenAddress, BenfenGetAddressParams, BenfenGetPublicKeyParams, BenfenPublicKey, BenfenSignMessageParams, BenfenSignTransactionParams, BenfenSignedTx, BleReleaseInfoEvent, BleReleaseInfoPayload, BridgeReleaseCheckResult, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignMessageMethodParams, CardanoSignMessageParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, ClearSessionCacheParams, ClearSessionCachePayload, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DEVICE_SETTINGS_NEVER_TIMEOUT_MS, DEVICE_SETTINGS_SHARED_FIELDS, DEVICE_SETTINGS_V1_ONLY_FIELDS, DEVICE_SETTINGS_V2_ONLY_FIELDS, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesMode, DeviceFeaturesPayload, DeviceFeaturesProtocol, DeviceFeaturesRaw, DeviceFeaturesRawPatch, DeviceFeaturesVerify, DeviceFirmwareRange, DeviceFlagsParams, DeviceModelToTypes, DeviceProgress, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendState, DeviceSendSupportFeatures, DeviceSettingsCapabilities, DeviceSettingsDurationOption, DeviceSettingsField, DeviceSettingsParams, DeviceSettingsProtocol, DeviceSettingsValueOption, DeviceState, DeviceStateEvent, DeviceStateIdentity, DeviceStateMode, DeviceStatePatch, DeviceStateProtocol, DeviceStateScope, DeviceStateSection, DeviceStateSecurityElement, DeviceStateSecurityElements, DeviceStateSecurityElementsPatch, DeviceStateSettings, DeviceStateStatus, DeviceStateUpdateSource, DeviceStateVersions, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceTypeToModels, DeviceUnlockParams, DeviceUploadResourceParams, DeviceUploadResourceResponse, DeviceVerifyParams, DeviceVerifySignature, DnxAddress, DnxGetAddressParams, DnxSignTransactionParams, DnxSignature, DnxTxKey, EOneKeyDeviceMode, EVMAccessList, EVMAddress, EVMAuthorization, EVMAuthorizationSignature, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMTransactionEIP7702, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareArtifactReader, FirmwareArtifactReference, FirmwareEvent, FirmwareMessage, FirmwareProcessing, FirmwareProgress, FirmwareRange, FirmwareRelease, FirmwareReleaseCheckResult, FirmwareTip, FirmwareUpdateArtifactParams, FirmwareUpdateBinaryParams, FirmwareUpdateCapabilities, FirmwareUpdateHostBinding, FirmwareUpdateParams, FirmwareUpdatePlan, FirmwareUpdatePlanArtifact, FirmwareUpdatePlanArtifactRole, FirmwareUpdatePlanForceTarget, FirmwareUpdatePlanTarget, FirmwareUpdatePreparedArtifact, FirmwareUpdatePreparedArtifactInput, FirmwareUpdatePreparedEntry, FirmwareUpdatePreparedPlan, FirmwareUpdateTipMessage, FirmwareUpdateV3Params, FirmwareUpdateV4Params, FirmwareUpdateV4Target, GetDeviceStateParams, GetPassphraseStateParams, HardwareSDKLowLevel, HardwareTopLevelSdk, HardwareUiInteractionMeta, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCallback, IFrameCallbackMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, IFrameSwitchTransport, IFrameSwitchTransportMessage, ILocale, IProtocolV2FirmwareComponent, IProtocolV2FirmwareComponentTarget, IProtocolV2ResourceSource, IProtocolV2Resources, ITransportStatus, IVersionArray, IVersionRange, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KaspaStreamingSignInputParams, KaspaStreamingSignOutputParams, KnownDevice, LOG, LOG_EVENT, LogBlockEvent, LogEvent, LogEventMessage, LogOutput, LoggerNames, LowLevelCoreApi, LowLevelInjectApi, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, NervosAddress, NervosGetAddressParams, NervosSignTransactionParams, NervosSignedTx, NexaAddress, NexaGetAddressParams, NexaSignInputParams, NexaSignOutputParams, NexaSignTransactionParams, NexaSignature, NormalizedFeatures, OnekeyFeatures, OpenWalletSessionMode, OpenWalletSessionModeValue, OpenWalletSessionParams, OpenWalletSessionPayload, PRO2_WALLPAPER_HEIGHT, PRO2_WALLPAPER_WIDTH, PROTOCOL_V2_NEVER_TIMEOUT_MS, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, Pro2WallpaperColorFormat, ProtocolV2ComponentReleaseInfo, ProtocolV2FirmwareComponentRelease, ProtocolV2FirmwareComponentReleaseStatus, ProtocolV2FirmwareReleaseStatus, ProtocolV2UiCompletion, ProtocolV2UiEventMetadata, ProtocolV2UiEventSource, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, RequestContext, Response, ScdoAddress, ScdoGetAddressParams, ScdoSignMessageParams, ScdoSignTransactionParams, ScdoSignedTx, SdkTracingContext, SearchDevice, SignedTransaction, SolSignMessageParams, SolSignMessageResponse, SolSignOffchainMessageParams, SolSignOffchainMessageResponse, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignMessageParams, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TestProtocolV2PingParams, TonAddress, TonGetAddressParams, TonSignDataParams, TonSignMessageParams, TonSignProofParams, TopLevelInjectApi, TransactionOptions, TransportReleaseStatus, TronAddress, TronDelegateResourceContract, TronFreezeBalanceV2Contract, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, TronUnDelegateResourceContract, TronUnfreezeBalanceV2Contract, TronWithdrawBalanceContract, TronWithdrawExpireUnfreezeContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestFirmwareProgressing, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestSelectDeviceForSwitchFirmwareWebDevice, UiRequestSelectDeviceInBootloaderForWebDevice, UiRequestWindowClose, UiRequestWithoutPayload, UiResponseCorrelation, UiResponseCorrelationFields, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UiResponseSelectDeviceForSwitchFirmwareWebDevice, UiResponseSelectDeviceInBootloaderForWebDevice, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBootForClassicAndMini, checkNeedUpdateBootForTouch, cleanupCallback, cleanupSdkInstance, completeRequestContext, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createRequestContext, createResponseMessage, createSdkTracingContext, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, encodePro2Wallpaper, executeCallback, formatLogMethodLabel, formatRequestContext, generateInstanceId, generateSdkInstanceId, getActiveRequestsByDeviceInstance, getAutoLockOptions, getAutoShutDownOptions, getDeviceBLEFirmwareVersion, getDeviceBleName, getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceLabel, getDeviceSerialNo, getDeviceSettingsCapabilities, getDeviceType, getDeviceTypeByBleName, getDeviceUUID, getEnv, getFirmwareType, getFirmwareUpdateField, getFirmwareUpdateFieldArray, getFirmwareUpdateHostBindingGeneration, getHDPath, getHomeScreenDefaultList, getHomeScreenHex, getHomeScreenSize, getLanguageConfig, getLog, getLogBlockLabel, getLogger, getMethodSupportedProtocols, getMethodVersionRange, getNftSize, getOutputScriptType, getSDKVersion, getSafeLogPayload, getScriptType, getTimeStamp, httpRequest, init$1 as initCore, isBleConnect, isValidVersionArray, isValidVersionString, normalizeSafetyCheckLevel, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, preloadSessionCache, projectFeatures as projectDeviceStateFeatures, registerFirmwareUpdateHostBinding, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, transportEnv, unregisterFirmwareUpdateHostBinding, updateRequestContext, versionCompare, versionSplit, wait, whitelist, whitelistExtension };