web ble transport layer for coolwallets.
npm install @coolwallets/transport-web-bleIf you're building a WebApp with CoolWalletS, this is the one you need to use as transport in other api.
``shell`
npm i @coolwallets/transport-web-ble
The listen() method takes in an callback function to handle bluetooth scanning.device
In web-ble, this is when the popup show and the user select the device to pair, so the returned is only one selected device.
`javascript
import WebBleTransport from '@coolwallets/transport-web-ble'
await WebBleTransport.listen(async (error, device) => { // browser shows popup
if (device) {
const transport = await WebBleTransport.connect(device)
/**
* Do something with transport
**/
} else throw error
})
// use transport in other package:
import CoolWallet from '@coolwallets/wallet'
const wallet = new CoolWallet(transport, appPrivateKey, appId)
``