@eluvio/elv-client-js 4.0.59 → 4.0.61
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/ElvClient-min.js +10 -11
- package/dist/src/ElvClient.js +7 -5
- package/dist/src/Utils.js +30 -0
- package/dist/src/client/AccessGroups.js +14 -7
- package/dist/src/client/ContentAccess.js +69 -47
- package/dist/src/client/Files.js +50 -7
- package/dist/src/client/LiveConf.js +33 -20
- package/dist/src/client/LiveStream.js +21 -7
- package/dist/src/walletClient/Notifications.js +5 -4
- package/package.json +3 -2
- package/src/ElvClient.js +13 -10
- package/src/Utils.js +1 -1
- package/src/client/AccessGroups.js +16 -11
package/src/ElvClient.js
CHANGED
|
@@ -20,7 +20,7 @@ const Pako = require("pako");
|
|
|
20
20
|
const {
|
|
21
21
|
ValidatePresence
|
|
22
22
|
} = require("./Validation");
|
|
23
|
-
const CBOR = require("cbor");
|
|
23
|
+
const CBOR = require("cbor-x");
|
|
24
24
|
|
|
25
25
|
const networks = {
|
|
26
26
|
"main": "https://main.net955305.contentfabric.io",
|
|
@@ -595,24 +595,27 @@ class ElvClient {
|
|
|
595
595
|
formatArguments: true
|
|
596
596
|
});
|
|
597
597
|
|
|
598
|
+
let nodeId = this.utils.AddressToNodeId(addr);
|
|
599
|
+
|
|
600
|
+
if(matchNodeId && nodeId !== matchNodeId) {
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
|
|
598
604
|
let locatorsHex = await this.CallContractMethod({
|
|
599
605
|
contractAddress: this.contentSpaceAddress,
|
|
600
606
|
methodName: "activeNodeLocators",
|
|
601
607
|
methodArgs: [bigi]
|
|
602
608
|
});
|
|
603
609
|
|
|
604
|
-
let nodeId = this.utils.AddressToNodeId(addr);
|
|
605
|
-
|
|
606
|
-
if(matchNodeId &&nodeId !== matchNodeId) {
|
|
607
|
-
return;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
610
|
let node = {id: nodeId, endpoints: []};
|
|
611
611
|
|
|
612
612
|
// Parse locators CBOR
|
|
613
|
-
let
|
|
614
|
-
|
|
615
|
-
|
|
613
|
+
let locators = CBOR.decodeMultiple(
|
|
614
|
+
Buffer.from(
|
|
615
|
+
locatorsHex.slice(2, locatorsHex.length),
|
|
616
|
+
"hex"
|
|
617
|
+
)
|
|
618
|
+
);
|
|
616
619
|
|
|
617
620
|
let match = false;
|
|
618
621
|
|
package/src/Utils.js
CHANGED
|
@@ -33,21 +33,26 @@ exports.ListAccessGroups = async function() {
|
|
|
33
33
|
5,
|
|
34
34
|
addresses,
|
|
35
35
|
async address => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
try {
|
|
37
|
+
const id = this.utils.AddressToHash(address);
|
|
38
|
+
const meta = (await this.ContentObjectMetadata({
|
|
39
|
+
libraryId: this.contentSpaceLibraryId,
|
|
40
|
+
objectId: `iq__${id}`
|
|
41
|
+
})) || {};
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
address,
|
|
45
|
+
id: `igrp${id}`,
|
|
46
|
+
meta
|
|
47
|
+
};
|
|
48
|
+
} catch(error) {
|
|
49
|
+
this.Log(error, true);
|
|
50
|
+
}
|
|
47
51
|
}
|
|
48
52
|
);
|
|
49
53
|
|
|
50
54
|
return groups
|
|
55
|
+
.filter(g => g)
|
|
51
56
|
.sort((a, b) => {
|
|
52
57
|
const name1 = (a.meta.public || {}).name || `zz__${a.address}`;
|
|
53
58
|
const name2 = (b.meta.public || {}).name || `zz__${b.address}`;
|