Skip to Content
HardwareBasic APIGet Device State
On this page

Get Device State

Read the unified V1 / V2 device snapshot. Use this instead of deprecated getFeatures.

getFeatures() still runs on Protocol V1 only. Pro 2 and Neo must call getDeviceState() and read payload.identity.deviceId. For firmware/version fields use scope: 'firmware' instead of getOnekeyFeatures.

const res = await HardwareSDK.getDeviceState(connectId);

Params

Optional common params

ParamTypeRequiredNotes
scope'runtime' | 'settings' | 'firmware'NoDefaults to 'runtime'. Scope only chooses which partitions this read refreshes; the payload is still a full snapshot
  • runtime — live lock / PIN / passphrase status (V1 GetFeatures, V2 DeviceStatusGet in application mode)
  • settings — also refresh settings
  • firmware — also refresh identity, versions, and verification info

Bootloader / romloader skips unsupported status commands and returns whatever snapshot is available.

Result

{ success: true, payload: { protocol: 'V1' | 'V2', identity: { deviceId: string | null, // seed lifetime — pass as the second SDK argument serialNo: string, deviceType: string, // ... }, status: { initialized, unlocked, passphraseProtection, attachToPinEnabled, ... }, settings: { language, airgapMode, ... }, versions: { firmware, bootloader, ble, applicationP1, applicationP2, ... }, } }

Read payload.identity.deviceId for the second argument of signing calls. Do not persist firmware session_id from compatibility Features.

The payload does not include firmware wallet session_id or raw protocol messages. Wallet identity comes from openWalletSession.

Error

{ success: false, payload: { error: string, code?: string | number, } }

See Protocol V1 and V2.

Last updated on