Socket
Book a DemoInstallSign in
Socket

@coolwallet/transport-web-ble

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coolwallet/transport-web-ble

web ble transport layer for coolwallet.

Source
npmnpm
Version
0.1.0-beta.5
Version published
Weekly downloads
5
-44.44%
Maintainers
1
Weekly downloads
 
Created
Source

CoolWallet Web-ble Transport

If you're building a WebApp with CoolWallet, this is the one you need to use as transport in other api.

Install

npm i @coolwallet/transport-web-ble

Usage

The listen() method takes in an callback function to handle bluetooth scanning. In web-ble, this is when the popup show and the user select the device to pair, so the returned device is only one selected device.

import WebBleTransport from '@coolwallet/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 '@coolwallet/wallet'
const wallet = new CoolWallet(transport, appPrivateKey, appId)

FAQs

Package last updated on 03 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts