@cranberry-money/shared-types 8.22.469 → 8.22.470

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,54 +2,59 @@
2
2
  * Hardware Wallet Types
3
3
  *
4
4
  * Types for hardware wallet integration (Keystone, Ledger, etc.)
5
- * Used for QR code-based wallet imports and signature verification.
5
+ * Used for QR code-based wallet imports and HD key derivation.
6
+ *
7
+ * HD Wallet Hierarchy:
8
+ * ```
9
+ * m/44'/60'/0' ← Account Key (what hardware wallet exports)
10
+ * │
11
+ * └── /0 ← External Chain Key (parent for deriving addresses)
12
+ * │
13
+ * ├── /0 ← Address Index 0 (first address)
14
+ * ├── /1 ← Address Index 1 (second address)
15
+ * └── /2 ← Address Index 2 (third address)
16
+ * ```
6
17
  */
7
18
  /**
8
19
  * Network type for hardware wallet derivation paths
9
20
  */
10
- export type HardwareWalletNetworkType = 'ETH' | 'BTC' | 'UNKNOWN';
21
+ export type HardwareWalletNetworkType = 'ETH' | 'BTC';
11
22
  /**
12
- * Decoded HD Key from hardware wallet QR code
13
- * Represents the core data extracted from a crypto-hdkey UR type
23
+ * A derived address from a hardware wallet
24
+ * Represents a single blockchain address with its derivation info
14
25
  */
15
- export interface DecodedHDKey {
16
- /** Derived wallet address (0x... for ETH, bc1... for BTC) */
26
+ export interface DerivedAddress {
27
+ /** The blockchain address (0x... for ETH, bc1... for BTC) */
17
28
  address: string;
18
- /** Full BIP44 derivation path (e.g., "m/44'/60'/0'/0/0") */
29
+ /** Index of this address in the derivation sequence (0, 1, 2, ...) */
30
+ addressIndex: number;
31
+ /** Full BIP44 derivation path to this address (e.g., "m/44'/60'/0'/0/0") */
19
32
  derivationPath: string;
20
- /** Master fingerprint for device identification (hex string) */
21
- masterFingerprint: string;
22
- /** Extended public key for address derivation (hex string) */
23
- extendedPublicKey: string;
24
- /** Chain code for HD derivation (hex string) */
25
- chainCode: string;
33
+ /** Network type (ETH or BTC) */
34
+ networkType: HardwareWalletNetworkType;
26
35
  }
27
36
  /**
28
- * Derived account from hardware wallet
29
- * Extends DecodedHDKey with account-specific metadata
37
+ * Parent key data for deriving additional addresses
38
+ * Stored at the "external chain" level (e.g., m/44'/60'/0'/0)
30
39
  */
31
- export interface DerivedAccount extends DecodedHDKey {
32
- /** Index in the derivation sequence */
33
- index: number;
34
- /** Optional balance (for display purposes during selection) */
35
- balance?: string;
36
- /** Network type detected from derivation path */
37
- networkType?: HardwareWalletNetworkType;
40
+ export interface ParentKeyData {
41
+ /** Public key at external chain level (33-byte compressed, hex) */
42
+ parentPublicKey: string;
43
+ /** Chain code at external chain level (32-byte, hex) */
44
+ parentChainCode: string;
45
+ /** Derivation path of the parent key (e.g., "m/44'/60'/0'/0") */
46
+ parentDerivationPath: string;
38
47
  }
39
48
  /**
40
- * List of accounts decoded from hardware wallet QR
41
- * Returned when scanning crypto-multi-accounts or crypto-account UR types
49
+ * Complete hardware wallet import result
50
+ * Contains addresses and parent key data for future derivation
42
51
  */
43
- export interface DecodedAccountList {
44
- /** Array of derived accounts */
45
- accounts: DerivedAccount[];
46
- /** Master fingerprint for the device */
52
+ export interface HardwareWalletImport {
53
+ /** Derived addresses from the hardware wallet */
54
+ addresses: DerivedAddress[];
55
+ /** Master fingerprint identifying the hardware wallet (8-char hex) */
47
56
  masterFingerprint: string;
48
- /** Base derivation path before address indices */
49
- baseDerivationPath: string;
50
- /** Parent extended public key (hex string) */
51
- parentPublicKey: string;
52
- /** Parent chain code (hex string) */
53
- parentChainCode: string;
57
+ /** Parent key data for deriving additional addresses */
58
+ parentKeys: ParentKeyData[];
54
59
  }
55
60
  //# sourceMappingURL=hardware-wallet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hardware-wallet.d.ts","sourceRoot":"","sources":["../../src/domain/hardware-wallet.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,CAAC;A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ACnE,eAAe,EAAE,MAAM,CAAC;IACxB,wDAAwD;IACxD,eAAe,EAAE,MAAM,CAAC;IACxB,iEAAiE;IACjE,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,sEAAsE;IACtE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wDAAwD;IACxD,UAAU,EAAE,aAAa,EAAE,CAAC;CAC7B"}
@@ -2,7 +2,18 @@
2
2
  * Hardware Wallet Types
3
3
  *
4
4
  * Types for hardware wallet integration (Keystone, Ledger, etc.)
5
- * Used for QR code-based wallet imports and signature verification.
5
+ * Used for QR code-based wallet imports and HD key derivation.
6
+ *
7
+ * HD Wallet Hierarchy:
8
+ * ```
9
+ * m/44'/60'/0' ← Account Key (what hardware wallet exports)
10
+ * │
11
+ * └── /0 ← External Chain Key (parent for deriving addresses)
12
+ * │
13
+ * ├── /0 ← Address Index 0 (first address)
14
+ * ├── /1 ← Address Index 1 (second address)
15
+ * └── /2 ← Address Index 2 (third address)
16
+ * ```
6
17
  */
7
18
  export {};
8
19
  //# sourceMappingURL=hardware-wallet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hardware-wallet.js","sourceRoot":"","sources":["../../src/domain/hardware-wallet.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
1
+ {"version":3,"file":"hardware-wallet.js","sourceRoot":"","sources":["../../src/domain/hardware-wallet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
@@ -12,8 +12,18 @@ export interface Wallet extends BaseEntity {
12
12
  nativeBalance: string;
13
13
  marketValue: string;
14
14
  lastSyncedAt?: string;
15
+ /** Full derivation path to this address (e.g., "m/44'/60'/0'/0/0") */
15
16
  derivationPath?: string;
17
+ /** Master fingerprint identifying the hardware wallet (8-char hex) */
16
18
  masterFingerprint?: string;
19
+ /** Index of this address in the derivation sequence (0, 1, 2, ...) */
20
+ addressIndex?: number;
21
+ /** Public key at external chain level for deriving more addresses (33-byte compressed, hex) */
22
+ parentPublicKey?: string;
23
+ /** Chain code at external chain level for deriving more addresses (32-byte, hex) */
24
+ parentChainCode?: string;
25
+ /** Derivation path of the parent key (e.g., "m/44'/60'/0'/0") */
26
+ parentDerivationPath?: string;
17
27
  }
18
28
  /**
19
29
  * Query parameters for wallet endpoints.
@@ -31,8 +41,18 @@ export type CreateWallet = {
31
41
  name?: string;
32
42
  address: string;
33
43
  chain: string;
44
+ /** Full derivation path to this address (e.g., "m/44'/60'/0'/0/0") */
34
45
  derivationPath?: string;
46
+ /** Master fingerprint identifying the hardware wallet (8-char hex) */
35
47
  masterFingerprint?: string;
48
+ /** Index of this address in the derivation sequence (0, 1, 2, ...) */
49
+ addressIndex?: number;
50
+ /** Public key at external chain level for deriving more addresses (33-byte compressed, hex) */
51
+ parentPublicKey?: string;
52
+ /** Chain code at external chain level for deriving more addresses (32-byte, hex) */
53
+ parentChainCode?: string;
54
+ /** Derivation path of the parent key (e.g., "m/44'/60'/0'/0") */
55
+ parentDerivationPath?: string;
36
56
  };
37
57
  export interface SyncBalanceResponse {
38
58
  success: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/domain/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,WAAW,MAAO,SAAQ,UAAU;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,SAAS,GAAG,UAAU,CAAC;IAC3C,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/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oFAAoF;IACpF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cranberry-money/shared-types",
3
- "version": "8.22.469",
3
+ "version": "8.22.470",
4
4
  "description": "Shared TypeScript type definitions for Blueberry platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,7 +29,7 @@
29
29
  "prepublishOnly": "npm run clean && npm run typecheck && npm run build"
30
30
  },
31
31
  "dependencies": {
32
- "@cranberry-money/shared-constants": "^8.15.494",
32
+ "@cranberry-money/shared-constants": "^8.15.495",
33
33
  "@types/react": "^19.1.2"
34
34
  },
35
35
  "devDependencies": {