@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.
- package/dist/domain/hardware-wallet.d.ts +39 -34
- package/dist/domain/hardware-wallet.d.ts.map +1 -1
- package/dist/domain/hardware-wallet.js +12 -1
- package/dist/domain/hardware-wallet.js.map +1 -1
- package/dist/domain/wallet.d.ts +20 -0
- package/dist/domain/wallet.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -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
|
|
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'
|
|
21
|
+
export type HardwareWalletNetworkType = 'ETH' | 'BTC';
|
|
11
22
|
/**
|
|
12
|
-
*
|
|
13
|
-
* Represents
|
|
23
|
+
* A derived address from a hardware wallet
|
|
24
|
+
* Represents a single blockchain address with its derivation info
|
|
14
25
|
*/
|
|
15
|
-
export interface
|
|
16
|
-
/**
|
|
26
|
+
export interface DerivedAddress {
|
|
27
|
+
/** The blockchain address (0x... for ETH, bc1... for BTC) */
|
|
17
28
|
address: string;
|
|
18
|
-
/**
|
|
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
|
-
/**
|
|
21
|
-
|
|
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
|
-
*
|
|
29
|
-
*
|
|
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
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
|
|
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
|
-
*
|
|
41
|
-
*
|
|
49
|
+
* Complete hardware wallet import result
|
|
50
|
+
* Contains addresses and parent key data for future derivation
|
|
42
51
|
*/
|
|
43
|
-
export interface
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
/** Master fingerprint
|
|
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
|
-
/**
|
|
49
|
-
|
|
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
|
|
1
|
+
{"version":3,"file":"hardware-wallet.d.ts","sourceRoot":"","sources":["../../src/domain/hardware-wallet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,KAAK,GAAG,KAAK,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,YAAY,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,cAAc,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,WAAW,EAAE,yBAAyB,CAAC;CACxC;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,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
|
|
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
|
|
1
|
+
{"version":3,"file":"hardware-wallet.js","sourceRoot":"","sources":["../../src/domain/hardware-wallet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
package/dist/domain/wallet.d.ts
CHANGED
|
@@ -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,E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AkB,SAAQ,eAAe;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CAC9C;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+FAA+F;IAC/F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,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.
|
|
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.
|
|
32
|
+
"@cranberry-money/shared-constants": "^8.15.495",
|
|
33
33
|
"@types/react": "^19.1.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|