@ecency/wallets 1.4.22 → 1.4.24

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.
@@ -941,12 +941,24 @@ function resolveHiveOperationFilters(filters) {
941
941
  }
942
942
  });
943
943
  }
944
- const filterArgs = utils.makeBitMaskFilter(Array.from(operationIds));
944
+ const filterArgs = makeBitMaskFilter(Array.from(operationIds));
945
945
  return {
946
946
  filterKey,
947
947
  filterArgs
948
948
  };
949
949
  }
950
+ function makeBitMaskFilter(allowedOperations) {
951
+ let low = 0n;
952
+ let high = 0n;
953
+ allowedOperations.forEach((operation) => {
954
+ if (operation < 64) {
955
+ low |= 1n << BigInt(operation);
956
+ } else {
957
+ high |= 1n << BigInt(operation - 64);
958
+ }
959
+ });
960
+ return [low !== 0n ? low.toString() : null, high !== 0n ? high.toString() : null];
961
+ }
950
962
  function getHiveAssetTransactionsQueryOptions(username, limit = 20, filters = []) {
951
963
  const { filterArgs, filterKey } = resolveHiveOperationFilters(filters);
952
964
  return infiniteQueryOptions({
@@ -3665,15 +3677,29 @@ function useWalletOperation(username, asset, operation) {
3665
3677
  },
3666
3678
  onSuccess: () => {
3667
3679
  recordActivity();
3668
- const query = getAccountWalletAssetInfoQueryOptions(username, asset, {
3669
- refetch: true
3680
+ const assetsToRefresh = /* @__PURE__ */ new Set([asset]);
3681
+ if (asset === "HIVE") {
3682
+ assetsToRefresh.add("HP");
3683
+ assetsToRefresh.add("HIVE");
3684
+ }
3685
+ if (asset === "HBD") {
3686
+ assetsToRefresh.add("HBD");
3687
+ }
3688
+ if (asset === "LARYNX" && operation === "power-up" /* PowerUp */) {
3689
+ assetsToRefresh.add("LP");
3690
+ assetsToRefresh.add("LARYNX");
3691
+ }
3692
+ assetsToRefresh.forEach((symbol) => {
3693
+ const query = getAccountWalletAssetInfoQueryOptions(username, symbol, {
3694
+ refetch: true
3695
+ });
3696
+ setTimeout(
3697
+ () => getQueryClient().invalidateQueries({
3698
+ queryKey: query.queryKey
3699
+ }),
3700
+ 5e3
3701
+ );
3670
3702
  });
3671
- setTimeout(
3672
- () => getQueryClient().invalidateQueries({
3673
- queryKey: query.queryKey
3674
- }),
3675
- 5e3
3676
- );
3677
3703
  }
3678
3704
  });
3679
3705
  }