@cityofzion/bs-multichain 1.1.2 → 1.1.4

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.
@@ -78,21 +78,22 @@ class WalletKitHelper {
78
78
  }
79
79
  static filterSessions(sessions, filters) {
80
80
  const filteredSessions = sessions.filter(session => {
81
- let matched = false;
81
+ let addressMatched = !filters.addresses;
82
+ let chainMatched = !filters.chains;
82
83
  if (filters.addresses) {
83
84
  const sessionAccounts = (0, utils_1.getAccountsFromNamespaces)(session.namespaces);
84
85
  const [address] = (0, utils_1.getAddressesFromAccounts)(sessionAccounts);
85
86
  if (address && filters.addresses.includes(address)) {
86
- matched = true;
87
+ addressMatched = true;
87
88
  }
88
89
  }
89
- if (filters.namespaces && !matched) {
90
- const namespaces = Object.keys(session.namespaces);
91
- if (namespaces.some(namespace => { var _a; return (_a = filters.namespaces) === null || _a === void 0 ? void 0 : _a.includes(namespace); })) {
92
- matched = true;
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;
93
94
  }
94
95
  }
95
- return matched;
96
+ return addressMatched && chainMatched;
96
97
  });
97
98
  return filteredSessions;
98
99
  }
@@ -28,5 +28,5 @@ export type TWalletKitHelperProcessRequestParams<N extends string = string> = {
28
28
  };
29
29
  export type TWalletKitHelperFilterSessionsParams = {
30
30
  addresses?: string[];
31
- namespaces?: string[];
31
+ chains?: string[];
32
32
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-multichain",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",
@@ -13,7 +13,7 @@
13
13
  "axios": "~1.12.2",
14
14
  "@walletconnect/utils": "~2.21.9",
15
15
  "@walletconnect/jsonrpc-utils": "~1.0.8",
16
- "@cityofzion/blockchain-service": "1.22.1"
16
+ "@cityofzion/blockchain-service": "1.22.2"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/node": "~24.5.2",
@@ -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",
30
- "@cityofzion/bs-neox": "1.4.1",
31
- "@cityofzion/bs-neo3": "1.17.1",
32
- "@cityofzion/bs-neo-legacy": "1.13.6"
29
+ "@cityofzion/bs-neo3": "1.17.2",
30
+ "@cityofzion/bs-neo-legacy": "1.13.7",
31
+ "@cityofzion/bs-ethereum": "2.14.2",
32
+ "@cityofzion/bs-neox": "1.4.2"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "rm -rf ./dist && tsc --project tsconfig.build.json",