OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-wallet commits / 2b817f4

Add hyper-wallet-lib as submodule with P2P support
- Extract identity.js and secure-storage.js to shared module - Add @pear marker for P2P submodule cloning - lib files now re-export from hyper-wallet-lib Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2b817f451634eb8f502bad52526ee784b400f346
by plankatron <fleeky@gmail.com> · 2026-01-30T22:31:36.000Z

Changed files (5) +10 -90

.gitmodules +4 -0
……@@ -0,0 +1,4 @@
1[submodule "lib/hyper-wallet-lib"]
2 path = lib/hyper-wallet-lib
3 url = https://7rnx.net/git/fleeky/hyper-wallet-lib.git
4 # @pear: pear://3cf3266a57b3ef069b724a4330200d72b0ad81daea7311b7d2a2369b0469f199/hyper-wallet-lib
lib/hyper-wallet-lib +1 -0
……@@ -0,0 +1 @@
1Subproject commit 4eb36c062547f6852a47b08f2399f2c3e081311d
lib/identity.js +2 -47
……@@ -1,47 +1,2 @@
1// lib/identity.js - Identity Management Wrapper
2//
3// Wraps keet-identity-key for consistent API
4
5import KeetIdentityKey from 'keet-identity-key'
6
7/**
8 * Identity wrapper
9 * Provides consistent API for identity management and exposes mnemonic for WDK
10 */
11class IdentityKey {
12 /**
13 * Create identity from mnemonic
14 * @param {Object} options - { mnemonic }
15 * @returns {IdentityKey} - Identity instance with mnemonic exposed
16 */
17 static async from({ mnemonic }) {
18 const identity = await KeetIdentityKey.from({ mnemonic })
19
20 // Expose mnemonic for WDK (WDK needs the mnemonic to derive keys)
21 identity.mnemonic = mnemonic
22
23 return identity
24 }
25
26 /**
27 * Verify device attestation proof
28 * @param {Buffer} proof - Attestation proof
29 * @returns {Boolean} - True if valid
30 */
31 static verify(proof) {
32 return KeetIdentityKey.verify(proof)
33 }
34
35 /**
36 * Attest new device
37 * @param {Buffer} devicePublicKey - Device public key
38 * @param {Object} signingDevice - Device with signing authority
39 * @param {Buffer} previousProof - Previous attestation proof
40 * @returns {Buffer} - New attestation proof
41 */
42 static attest(devicePublicKey, signingDevice, previousProof) {
43 return KeetIdentityKey.attest(devicePublicKey, signingDevice, previousProof)
44 }
45}
46
47export default IdentityKey
1// Re-export from hyper-wallet-lib
2export { default } from 'hyper-wallet-lib/identity'
lib/secure-storage.js +2 -43
……@@ -1,43 +1,2 @@
1// lib/secure-storage.js - Secure Mnemonic Storage
2//
3// Uses OS keychain for secure mnemonic storage:
4// - macOS: Keychain Access
5// - Linux: libsecret (GNOME Keyring, KDE Wallet)
6// - Windows: Credential Vault
7
8import keytar from 'keytar'
9
10const SERVICE_NAME = 'hyper-wallet'
11const ACCOUNT_NAME = 'mnemonic'
12
13/**
14 * Store mnemonic securely in OS keychain
15 * @param {String} mnemonic - BIP39 mnemonic phrase
16 */
17export async function storeMnemonic(mnemonic) {
18 await keytar.setPassword(SERVICE_NAME, ACCOUNT_NAME, mnemonic)
19}
20
21/**
22 * Retrieve mnemonic from OS keychain
23 * @returns {String|null} - Mnemonic or null if not found
24 */
25export async function loadMnemonic() {
26 return await keytar.getPassword(SERVICE_NAME, ACCOUNT_NAME)
27}
28
29/**
30 * Delete mnemonic from OS keychain
31 */
32export async function deleteMnemonic() {
33 await keytar.deletePassword(SERVICE_NAME, ACCOUNT_NAME)
34}
35
36/**
37 * Check if wallet is initialized (mnemonic exists in keychain)
38 * @returns {Boolean}
39 */
40export async function isInitialized() {
41 const mnemonic = await loadMnemonic()
42 return mnemonic !== null
43}
1// Re-export from hyper-wallet-lib
2export * from 'hyper-wallet-lib/secure-storage'
package.json +1 -0
……@@ -30,6 +30,7 @@
3030 "postinstall": "bash scripts/setup-pear-compat.sh"
3131 },
3232 "dependencies": {
33 "hyper-wallet-lib": "file:lib/hyper-wallet-lib",
3334 "@noble/hashes": "^1.8.0",
3435 "@tetherto/wdk": "^1.0.0-beta.5",
3536 "@tetherto/wdk-wallet-btc": "^1.0.0-beta.4",