@oasisprotocol/ionic-ledger-hw-transport-ble
v8.0.0
Published
Ledger Hardware Wallet Bluetooth BLE transport for Ionic
Downloads
773
Readme
ionic-ledger-hw-transport-ble
Ledger Hardware Wallet Bluetooth BLE transport for Ionic.
yarn add @oasisprotocol/ionic-ledger-hw-transport-blePre-requisite
- Install and link library
@capacitor-community/bluetooth-le+ configure your app for Bluetooth permissions (Open the link for documentation) - global.Buffer available. Typically
global.Buffer = require("buffer").Buffer;that can be placed in apolyfill.jsand imported withimport "./polyfill";at first line of the main JavaScript entry file.
Minimal getting started
@oasisprotocol/ionic-ledger-hw-transport-ble works like any of @ledgerhq/hw-transport libraries.
The difference here is that the list() is not implemented, only create().
Create doesn't always scan for devices, it tries to reuse previously selected
device.
Important: you will also have to deal with specifics of Bluetooth BLE, for instance, you need to request the LOCATION permission on Android!
Here is a gist of the most important parts required.
Check for Bluetooth state
import BleTransport from "@oasisprotocol/ionic-ledger-hw-transport-ble";
// Check if @capacitor-community/bluetooth-le is setup
BleTransport.isSupported()
// Check for bluetooth status
BleTransport.isEnabled()Connect to device
const transport = await BleTransport.create()and now we can just use the transport like any other Ledger transport!
