@cityofzion/bs-multichain 1.1.1 → 1.1.3
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.
|
@@ -77,26 +77,24 @@ class WalletKitHelper {
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
static filterSessions(sessions, filters) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
matched = true;
|
|
89
|
-
}
|
|
80
|
+
const filteredSessions = sessions.filter(session => {
|
|
81
|
+
let addressMatched = !filters.addresses;
|
|
82
|
+
let chainMatched = !filters.chains;
|
|
83
|
+
if (filters.addresses) {
|
|
84
|
+
const sessionAccounts = (0, utils_1.getAccountsFromNamespaces)(session.namespaces);
|
|
85
|
+
const [address] = (0, utils_1.getAddressesFromAccounts)(sessionAccounts);
|
|
86
|
+
if (address && filters.addresses.includes(address)) {
|
|
87
|
+
addressMatched = true;
|
|
90
88
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
}
|
|
90
|
+
if (filters.chains) {
|
|
91
|
+
const chains = (0, utils_1.getChainsFromNamespaces)(session.namespaces);
|
|
92
|
+
if (chains.some(chain => { var _a; return (_a = filters.chains) === null || _a === void 0 ? void 0 : _a.includes(chain); })) {
|
|
93
|
+
chainMatched = true;
|
|
96
94
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
95
|
+
}
|
|
96
|
+
return addressMatched && chainMatched;
|
|
97
|
+
});
|
|
100
98
|
return filteredSessions;
|
|
101
99
|
}
|
|
102
100
|
static isValidURI(uri) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-multichain",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": "https://github.com/CityOfZion/blockchain-services",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"ts-node": "~10.9.2",
|
|
27
27
|
"typescript": "~5.9.2",
|
|
28
28
|
"typed-emitter": "~2.1.0",
|
|
29
|
+
"@cityofzion/bs-ethereum": "2.14.1",
|
|
29
30
|
"@cityofzion/bs-neo3": "1.17.1",
|
|
30
|
-
"@cityofzion/bs-neo-legacy": "1.13.6",
|
|
31
31
|
"@cityofzion/bs-neox": "1.4.1",
|
|
32
|
-
"@cityofzion/bs-
|
|
32
|
+
"@cityofzion/bs-neo-legacy": "1.13.6"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "rm -rf ./dist && tsc --project tsconfig.build.json",
|