Skip to Content
📢 Breaking change: Applications using LedgerJS for transport implementation should migrate to the Device Management Kit (DMK). Learn more.

Device handlers

The device handlers provide methods for handling the physical device, including opening low-level transport and selecting a device in the connected wallet.

Request handlers

”device.close” — Close Device

Closes a transport connection, releasing the BLE or USB lock on the device.

Parameter (in req.params)Required?Note
transportId✅A device’s transport ID.
Wallet handler used
device.close
  • Returns: A promise that resolves with the transport ID.

”device.exchange” — Send a raw APDU command

Sends an APDU hex string to the device and returns the raw hex response. Use this to communicate directly with the device at the transport level.

Parameter (in req.params)Required?Note
transportIdâś…The transport ID returned by device.open.
apduHexâś…Raw APDU command in hexadecimal format.
Wallet handler used
device.exchange
  • Returns: A promise that resolves with responseHex — the raw hex response from the device.

”device.open” — Open Device

Opens a device in the connected wallet.

ParameterRequired?Note
filtersâś…An object containing the parameters to open the device.
Wallet handler used
device.open
  • Returns: A promise that resolves with a transportId.

”device.select”: Select Device

Selects a device in the connected wallet.

ParameterRequired?Note
paramsâś…An object containing the parameters to select and check the device.
Wallet handler used
device.select
  • Returns: A promise that resolves with a deviceId, which you can use with the device.open method.

”device.transport”: Open Low-Level Transport

Opens low-level transport in the connected wallet.

ParameterRequired?Note
deviceIdâś…The device ID to open transport for.
appNameâś…The app to open on the device.
Wallet handler used
device.transport
  • Returns: A promise that resolves with an instance of Transport compatible with @ledgerhq/hw-transport.
Last updated on
Ledger
Copyright © Ledger SAS. All rights reserved. Ledger, Ledger Stax, Ledger Flex, Ledger Nano, Ledger Nano S, Ledger OS, Ledger Wallet, [LEDGER] (logo), [L] (logo) are trademarks owned by Ledger SAS.