hyper-multisig 1.0.3 → 2.0.0
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/index.js +2 -3
- package/lib/core.js +4 -2
- package/package.json +2 -3
package/index.js
CHANGED
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
const { EventEmitter } = require('events')
|
|
24
|
-
const cenc = require('compact-encoding')
|
|
25
24
|
const CoreSign = require('hypercore-sign')
|
|
26
25
|
const SignRequest = require('hypercore-signing-request')
|
|
27
26
|
const Hyperdrive = require('hyperdrive')
|
|
@@ -166,7 +165,7 @@ class HyperMultisig {
|
|
|
166
165
|
|
|
167
166
|
const signResponses = []
|
|
168
167
|
for (const response of responses) {
|
|
169
|
-
const res =
|
|
168
|
+
const res = SignRequest.decodeResponse(z32.decode(response))
|
|
170
169
|
await CoreSign.verify(z32.decode(response), z32.decode(request), res.publicKey)
|
|
171
170
|
const publicKeyHex = res.publicKey.toString('hex')
|
|
172
171
|
signResponses[publicKeyHex] = res
|
|
@@ -240,7 +239,7 @@ class HyperMultisig {
|
|
|
240
239
|
|
|
241
240
|
const signResponses = []
|
|
242
241
|
for (const response of responses) {
|
|
243
|
-
const res =
|
|
242
|
+
const res = SignRequest.decodeResponse(z32.decode(response))
|
|
244
243
|
await CoreSign.verify(z32.decode(response), z32.decode(request), res.publicKey)
|
|
245
244
|
const publicKeyHex = res.publicKey.toString('hex')
|
|
246
245
|
signResponses[publicKeyHex] = res
|
package/lib/core.js
CHANGED
|
@@ -23,16 +23,18 @@ const idEnc = require('hypercore-id-encoding')
|
|
|
23
23
|
/**
|
|
24
24
|
* @param {string[]} publicKeys
|
|
25
25
|
* @param {string} namespace
|
|
26
|
+
* @param {{ quorum?: number }} [opts]
|
|
26
27
|
* @return {string}
|
|
27
28
|
*/
|
|
28
|
-
function getCoreKey(publicKeys, namespace) {
|
|
29
|
-
const manifest = getManifest(publicKeys, namespace)
|
|
29
|
+
function getCoreKey(publicKeys, namespace, { quorum } = {}) {
|
|
30
|
+
const manifest = getManifest(publicKeys, namespace, { quorum })
|
|
30
31
|
return Hypercore.key(manifest)
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* @param {string[]} publicKeys
|
|
35
36
|
* @param {string} namespace
|
|
37
|
+
* @param {{ quorum?: number }} [opts]
|
|
36
38
|
* @return {Manifest}
|
|
37
39
|
*/
|
|
38
40
|
function getManifest(publicKeys, namespace, { quorum } = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hyper-multisig",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Multisig hypercore and hyperdrive",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -16,12 +16,11 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"b4a": "^1.7.4",
|
|
18
18
|
"bare-events": "^2.8.2",
|
|
19
|
-
"compact-encoding": "^2.18.0",
|
|
20
19
|
"hypercore": "^11.24.0",
|
|
21
20
|
"hypercore-crypto": "^3.6.1",
|
|
22
21
|
"hypercore-id-encoding": "^1.3.0",
|
|
23
22
|
"hypercore-sign": "^4.0.1",
|
|
24
|
-
"hypercore-signing-request": "^
|
|
23
|
+
"hypercore-signing-request": "^5.1.1",
|
|
25
24
|
"hyperdrive": "^13.2.1",
|
|
26
25
|
"z32": "^1.1.0"
|
|
27
26
|
},
|