@arcblock/did-ext 1.29.23 → 1.29.25
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/lib/index.js +2 -2
- package/package.json +6 -6
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { HDKey } = require('@scure/bip32');
|
|
2
2
|
const Mcrypto = require('@ocap/mcrypto');
|
|
3
3
|
const { fromSecretKey, WalletType } = require('@ocap/wallet');
|
|
4
4
|
const { isHexStrict, toHex, toBuffer, stripHexPrefix } = require('@ocap/util');
|
|
@@ -32,7 +32,7 @@ const fromAppDid = (appDid, rootSk, type = { role: types.RoleType.ROLE_ACCOUNT }
|
|
|
32
32
|
const n2 = Number.parseInt(Number(`0x${s2}`), 10) & 0x7fffffff;
|
|
33
33
|
|
|
34
34
|
const seedHex = stripHexPrefix(isHexStrict(rootSk) ? rootSk : toHex(rootSk));
|
|
35
|
-
const master =
|
|
35
|
+
const master = HDKey.fromMasterSeed(Buffer.from(seedHex, 'hex'));
|
|
36
36
|
const derivePath = `m/44'/260'/${n1}'/${n2}'/${index}`;
|
|
37
37
|
const child = master.derive(derivePath);
|
|
38
38
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/did-ext",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.25",
|
|
4
4
|
"description": "Extension to work with ArcBlock DID",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arcblock",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"url": "https://github.com/ArcBlock/blockchain/issues"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@arcblock/did": "1.29.
|
|
48
|
-
"@ocap/mcrypto": "1.29.
|
|
49
|
-
"@ocap/util": "1.29.
|
|
50
|
-
"@ocap/wallet": "1.29.
|
|
51
|
-
"@
|
|
47
|
+
"@arcblock/did": "1.29.25",
|
|
48
|
+
"@ocap/mcrypto": "1.29.25",
|
|
49
|
+
"@ocap/util": "1.29.25",
|
|
50
|
+
"@ocap/wallet": "1.29.25",
|
|
51
|
+
"@scure/bip32": "^2.0.1",
|
|
52
52
|
"bn.js": "5.2.3",
|
|
53
53
|
"debug": "^4.4.3",
|
|
54
54
|
"lodash": "^4.17.23"
|