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.
| Parameter | Required? | 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.
| Parameter | Required? | 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 thedevice.openmethod.
”device.transport”: Open Low-Level Transport
Opens low-level transport in the connected wallet.
| Parameter | Required? | 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.
Related
Last updated on