@talismn/balances 0.0.0-pr2094-20250715164740 → 0.0.0-pr2095-20250715171144
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.
@@ -1504,14 +1504,14 @@ const getRpcQueryPack$ = (connector, networkId, queries, timeout = false) => {
|
|
1504
1504
|
return new rxjs.Observable(subscriber => {
|
1505
1505
|
// first subscription callback includes results for all state keys, but further callbacks will only include the ones that changed
|
1506
1506
|
// => we need to keep all results in memory and update them after each callback, so we can emit the full result set each time
|
1507
|
-
const
|
1507
|
+
const changesCache = {};
|
1508
1508
|
const promUnsub = connector.subscribe(networkId, "state_subscribeStorage", "state_storage", [allStateKeys], (error, result) => {
|
1509
1509
|
if (error) subscriber.error(error);else if (result) {
|
1510
1510
|
// update the cache
|
1511
|
-
for (const [stateKey, encodedResult] of result.changes)
|
1511
|
+
for (const [stateKey, encodedResult] of result.changes) changesCache[stateKey] = encodedResult;
|
1512
1512
|
|
1513
1513
|
// regenerate the full changes array
|
1514
|
-
const changes = lodashEs.toPairs(
|
1514
|
+
const changes = lodashEs.toPairs(changesCache);
|
1515
1515
|
|
1516
1516
|
// decode and emit results for all queries
|
1517
1517
|
subscriber.next(decodeRpcQueryPack(queries, {
|
@@ -1504,14 +1504,14 @@ const getRpcQueryPack$ = (connector, networkId, queries, timeout = false) => {
|
|
1504
1504
|
return new rxjs.Observable(subscriber => {
|
1505
1505
|
// first subscription callback includes results for all state keys, but further callbacks will only include the ones that changed
|
1506
1506
|
// => we need to keep all results in memory and update them after each callback, so we can emit the full result set each time
|
1507
|
-
const
|
1507
|
+
const changesCache = {};
|
1508
1508
|
const promUnsub = connector.subscribe(networkId, "state_subscribeStorage", "state_storage", [allStateKeys], (error, result) => {
|
1509
1509
|
if (error) subscriber.error(error);else if (result) {
|
1510
1510
|
// update the cache
|
1511
|
-
for (const [stateKey, encodedResult] of result.changes)
|
1511
|
+
for (const [stateKey, encodedResult] of result.changes) changesCache[stateKey] = encodedResult;
|
1512
1512
|
|
1513
1513
|
// regenerate the full changes array
|
1514
|
-
const changes = lodashEs.toPairs(
|
1514
|
+
const changes = lodashEs.toPairs(changesCache);
|
1515
1515
|
|
1516
1516
|
// decode and emit results for all queries
|
1517
1517
|
subscriber.next(decodeRpcQueryPack(queries, {
|
@@ -1495,14 +1495,14 @@ const getRpcQueryPack$ = (connector, networkId, queries, timeout = false) => {
|
|
1495
1495
|
return new Observable(subscriber => {
|
1496
1496
|
// first subscription callback includes results for all state keys, but further callbacks will only include the ones that changed
|
1497
1497
|
// => we need to keep all results in memory and update them after each callback, so we can emit the full result set each time
|
1498
|
-
const
|
1498
|
+
const changesCache = {};
|
1499
1499
|
const promUnsub = connector.subscribe(networkId, "state_subscribeStorage", "state_storage", [allStateKeys], (error, result) => {
|
1500
1500
|
if (error) subscriber.error(error);else if (result) {
|
1501
1501
|
// update the cache
|
1502
|
-
for (const [stateKey, encodedResult] of result.changes)
|
1502
|
+
for (const [stateKey, encodedResult] of result.changes) changesCache[stateKey] = encodedResult;
|
1503
1503
|
|
1504
1504
|
// regenerate the full changes array
|
1505
|
-
const changes = toPairs(
|
1505
|
+
const changes = toPairs(changesCache);
|
1506
1506
|
|
1507
1507
|
// decode and emit results for all queries
|
1508
1508
|
subscriber.next(decodeRpcQueryPack(queries, {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@talismn/balances",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-pr2095-20250715171144",
|
4
4
|
"author": "Talisman",
|
5
5
|
"homepage": "https://talisman.xyz",
|
6
6
|
"license": "GPL-3.0-or-later",
|
@@ -34,13 +34,13 @@
|
|
34
34
|
"scale-ts": "^1.6.1",
|
35
35
|
"viem": "^2.27.3",
|
36
36
|
"zod": "^3.25.62",
|
37
|
-
"@talismn/chain-connector": "0.0.0-
|
38
|
-
"@talismn/chain-connector
|
39
|
-
"@talismn/chaindata-provider": "0.0.0-
|
40
|
-
"@talismn/sapi": "0.0.0-
|
41
|
-
"@talismn/util": "0.0.0-
|
42
|
-
"@talismn/
|
43
|
-
"@talismn/
|
37
|
+
"@talismn/chain-connector-evm": "0.0.0-pr2095-20250715171144",
|
38
|
+
"@talismn/chain-connector": "0.0.0-pr2095-20250715171144",
|
39
|
+
"@talismn/chaindata-provider": "0.0.0-pr2095-20250715171144",
|
40
|
+
"@talismn/sapi": "0.0.0-pr2095-20250715171144",
|
41
|
+
"@talismn/util": "0.0.0-pr2095-20250715171144",
|
42
|
+
"@talismn/scale": "0.0.0-pr2095-20250715171144",
|
43
|
+
"@talismn/token-rates": "0.0.0-pr2095-20250715171144"
|
44
44
|
},
|
45
45
|
"devDependencies": {
|
46
46
|
"@polkadot/api-contract": "16.1.2",
|