Skip to content

feat: integrate OneKey hardware wallet over BLE (hd-ble-sdk)#6900

Open
wabicai wants to merge 3 commits into
KeeperCommunity:sprintfrom
wabicai:feat/onekey-hd-ble-integration
Open

feat: integrate OneKey hardware wallet over BLE (hd-ble-sdk)#6900
wabicai wants to merge 3 commits into
KeeperCommunity:sprintfrom
wabicai:feat/onekey-hd-ble-integration

Conversation

@wabicai

@wabicai wabicai commented Feb 12, 2026

Copy link
Copy Markdown

Summary

Add OneKey hardware wallet support via Bluetooth Low Energy (BLE) for Bitcoin Keeper.

Architecture

Modal-based Interaction (OneKeyBleModal)

All primary OneKey flows use OneKeyBleModal - a self-contained modal component:

  • Setup: Scan → Select device → Connect → Import keys
  • Health Check: Direct connect via stored bleConnectId → Verify fingerprint
  • Verify Address: Direct connect → Show address on device → Compare

Dedicated Screens (transaction flows)

  • SignWithOneKeyBle - PSBT signing (auto-connects via stored connectId)
  • SignMessageOneKeyBle - Message signing (auto-connects via stored connectId)

SDK UI Event System

  • onekeyUIEmitter (DeviceEventEmitter) forwards SDK UI events to components
  • PIN request → "Please enter PIN on your OneKey device"
  • Button confirm → "Please confirm on your OneKey device"
  • Passphrase → "Please enter passphrase on your OneKey device"
  • Events auto-clear after each operation completes

Device Reconnection

  • bleConnectId stored in signer.extraData during setup
  • All subsequent flows use stored connectId for direct connection
  • Brief BLE scan before connect (required by BLE protocol)
  • 30s timeout on all BLE operations

Dependencies

  • @onekeyfe/hd-ble-sdk - BLE transport for React Native
  • @onekeyfe/hd-core - SDK core (UI_EVENT, UI_REQUEST, UI_RESPONSE)
  • @onekeyfe/hd-shared - Shared types and error codes
  • @onekeyfe/hd-transport-react-native - RN transport layer

Signer Naming

  • signerName: Device type (e.g. "OneKey Pro")
  • signerDescription: BLE name (e.g. "Pro 04DD")
  • extraData.bleConnectId: Stored for reconnection

Error Handling

  • PIN incorrect (code 801) → friendly toast
  • PIN cancelled (code 802) → friendly toast
  • BLE timeout (30s) → "Device not found"
  • No stored connectId → "Please re-add this device"

Smoke Test Checklist

Setup

  • Hardware Keys → OneKey → "Setting up OneKey" modal with illustration
  • Proceed → Scan finds devices with correct images and BLE names
  • Tap device → PIN prompt if needed → Keys imported
  • Keys page shows "OneKey Pro" + "Pro 04DD" with green icon

Health Check

  • Keys → OneKey device → Details → Health Check
  • Verify OneKey modal → Proceed → Direct connect (no device list)
  • Loading: Connecting → Verifying → Success toast

Address Verification

  • Vault → Receive → Verify Address → Select OneKey signer
  • Modal → Direct connect → Address shown on device → Match result

Transaction Signing

  • Vault → Send → Sign → OneKey → Auto-connects → Signs PSBT

Message Signing

  • Details → Sign Message → Auto-connects → Signs → Returns signature

Shop Page

  • Shop for Hardware Wallets → OneKey card with device photo
  • "Made in: HK and Japan" with both flags
  • Buy Now opens onekey.so

Error Cases

  • Bluetooth off → Toast prompt
  • Wrong PIN → "PIN is incorrect" toast
  • Device not found → 30s timeout → Error toast
  • No stored connectId → "Please re-add" toast

@wabicai wabicai closed this Feb 24, 2026
@wabicai wabicai reopened this Feb 25, 2026
@wabicai wabicai closed this Feb 25, 2026
@wabicai wabicai reopened this Mar 27, 2026
@wabicai wabicai marked this pull request as ready for review April 7, 2026 07:36
@wabicai wabicai force-pushed the feat/onekey-hd-ble-integration branch from 6be9bf9 to c976d6e Compare April 13, 2026 07:42
@wabicai wabicai force-pushed the feat/onekey-hd-ble-integration branch from 0dfaf23 to 24e142e Compare June 8, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant