Skip to Content
We're improving our docs. Share your experience and help shape what comes next.

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
transportIdA 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
transportIdThe transport ID returned by device.open.
apduHexRaw 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
filtersAn 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
paramsAn 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
deviceIdThe device ID to open transport for.
appNameThe 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.