Skip to content

Javascript SDK for easily connect OneKey hardware device.

Notifications You must be signed in to change notification settings

OneKeyHQ/hardware-js-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7b0cba7 · Apr 30, 2025
Sep 11, 2024
Dec 18, 2024
Sep 9, 2022
Apr 30, 2025
Sep 29, 2024
Jul 19, 2024
Apr 29, 2025
May 18, 2022
Feb 20, 2024
Dec 18, 2024
Jul 13, 2023
Aug 31, 2022
Dec 18, 2024
Feb 12, 2025
Sep 29, 2024
Sep 1, 2022
Sep 1, 2022
Jun 7, 2022
Apr 23, 2025
Dec 18, 2024
May 19, 2022
May 26, 2022
Apr 23, 2025

Repository files navigation

Hardware-js-sdk

Hardware-js-sdk is designed to allow third-party developers to quickly access the OneKey hardware wallet. The repository structure uses the monorepo to make each module more manageable.

Packages

package description
@onekeyfe/core The core process of hardware wallet connection.
@onekeyfe/hd-web-sdk Using the sdk in the web platform.
@onekeyfe/hd-ble-sdk Using the SDK in BLE communication environment. e.g: iOS / Android
@onekeyfe/hd-common-sdk Using the SDK in a node or web-usb environment
@onekeyfe/hd-transport Data serialization and deserialization of hardware communication data
@onekeyfe/hd-transport-http communication lib for http
@onekeyfe/hd-transport-react-native communication lib for React Native
@onekeyfe/hd-transport-webusb communication lib for WebUSB
@onekeyfe/hd-shared Tools, error definitions, constants

Documentation

See the full documentation on developer.onekey.so.

hardware-js-sdk development

Before you start make sure you have downloaded and installed NVM, Yarn and git with git lfs.

  • git clone git@github.com:OneKeyHQ/hardware-js-sdk.git
  • git submodule update --init --recursive
  • yarn
  • yarn bootstrap

Run a dev build:

  • yarn dev:web (web sdk)
  • yarn dev:ble (react-native sdk)
  • yarn dev:core (core package)
  • yarn dev:transport-http (transport-http package)
  • yarn dev:shared (shared package)

Development with example desktop app (Recommend)

  • yarn bootstrap && yarn build
  • yarn example:desktop

Development with example mobile app

  • yarn bootstrap && yarn build
  • yarn example select ios or android in menu.

Development with example web app

  • Build web sdk
  • Edit connect src in packages/connect-examples/expo-example/src/constants/connect.ts, change CONNECT_SRC to https://localhost:8087/
  • yarn dev:web
  • Open chrome browser, enter https://localhost:8087/, simply type "thisisunsafe" directly on your keyboard (no need to press Enter)
  • Run example app
  • yarn bootstrap && yarn build
  • yarn example select web in menu.

Development onekey-app monorepo

  • Build all packages
  • yarn bootstrap && yarn build
  • Edit .env file, APP_MONOREPO_LOCAL_PATH=/path/to/v5-app-monorepo
  • yarn debug:watcher

Open v5-app-monorepo, run yarn && yarn app:xxxx to start the app.