@exodus/key-utils
Advanced tools
Comparing version 3.3.0 to 3.4.0
@@ -6,2 +6,11 @@ # Change Log | ||
## [3.4.0](https://github.com/ExodusMovement/exodus-core/compare/@exodus/key-utils@3.3.0...@exodus/key-utils@3.4.0) (2024-06-04) | ||
### Features | ||
* parse full address paths in parseDerivationPath ([#1192](https://github.com/ExodusMovement/exodus-core/issues/1192)) ([a60f288](https://github.com/ExodusMovement/exodus-core/commit/a60f28811c3e8cb223beadf00e2e190c6ad5ffa0)) | ||
## [3.3.0](https://github.com/ExodusMovement/exodus-core/compare/@exodus/key-utils@3.2.1...@exodus/key-utils@3.3.0) (2024-05-07) | ||
@@ -8,0 +17,0 @@ |
{ | ||
"name": "@exodus/key-utils", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"author": "Exodus Movement Inc", | ||
@@ -11,3 +11,3 @@ "description": "Utilities to manage derivation paths and key identifier aspects.", | ||
"homepage": "https://github.com/ExodusMovement/exodus-core/tree/master/packages/key-utils", | ||
"license": "UNLICENSED", | ||
"license": "MIT", | ||
"bugs": { | ||
@@ -36,3 +36,3 @@ "url": "https://github.com/ExodusMovement/exodus-core/issues?q=is%3Aissue+is%3Aopen+label%3Akey-utils" | ||
}, | ||
"gitHead": "4295111dba49d59aeb3304599ba05715fcce7c08" | ||
"gitHead": "3ddbd642d8ea06c744eda85237c27b87973fac8f" | ||
} |
@@ -154,3 +154,6 @@ import BIPPath from 'bip32-path' | ||
export const parseDerivationPath = (path) => { | ||
let [purpose, coinIndex, accountIndex] = BIPPath.fromString(path, true).toPathArray() | ||
let [purpose, coinIndex, accountIndex, chainIndex, addressIndex] = BIPPath.fromString( | ||
path, | ||
true | ||
).toPathArray() | ||
purpose -= HDKey.HARDENED_OFFSET | ||
@@ -160,2 +163,8 @@ coinIndex -= HDKey.HARDENED_OFFSET | ||
// some assets are so naughty | ||
if (chainIndex !== undefined && chainIndex >= HDKey.HARDENED_OFFSET) | ||
chainIndex -= HDKey.HARDENED_OFFSET | ||
if (addressIndex !== undefined && addressIndex >= HDKey.HARDENED_OFFSET) | ||
addressIndex -= HDKey.HARDENED_OFFSET | ||
return { | ||
@@ -165,2 +174,4 @@ purpose, | ||
accountIndex, | ||
chainIndex, | ||
addressIndex, | ||
} | ||
@@ -167,0 +178,0 @@ } |
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
18202
9
0
343