@ecency/wallets 1.4.32 → 1.4.34

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.
@@ -1047,6 +1047,8 @@ function getHiveAssetTransactionsQueryOptions(username, limit = 20, filters = []
1047
1047
  case "transfer_to_vesting":
1048
1048
  case "recurrent_transfer":
1049
1049
  return parseAsset(item.amount).symbol === "HIVE";
1050
+ case "transfer_from_savings":
1051
+ return parseAsset(item.amount).symbol === "HIVE";
1050
1052
  case "fill_recurrent_transfer":
1051
1053
  const asset = parseAsset(item.amount);
1052
1054
  return ["HIVE"].includes(asset.symbol);
@@ -1055,18 +1057,15 @@ function getHiveAssetTransactionsQueryOptions(username, limit = 20, filters = []
1055
1057
  item.reward_hive
1056
1058
  );
1057
1059
  return rewardHive.amount > 0;
1060
+ case "curation_reward":
1058
1061
  case "cancel_transfer_from_savings":
1059
1062
  case "fill_order":
1060
1063
  case "limit_order_create":
1061
1064
  case "limit_order_cancel":
1062
- case "interest":
1063
1065
  case "fill_convert_request":
1064
1066
  case "fill_collateralized_convert_request":
1065
- case "proposal_pay":
1066
- case "update_proposal_votes":
1067
- case "comment_payout_update":
1068
- case "collateralized_convert":
1069
- case "account_witness_proxy":
1067
+ return true;
1068
+ case "limit_order_create2":
1070
1069
  return true;
1071
1070
  default:
1072
1071
  return false;
@@ -1078,6 +1077,10 @@ function getHiveAssetTransactionsQueryOptions(username, limit = 20, filters = []
1078
1077
  }
1079
1078
  function getHivePowerAssetTransactionsQueryOptions(username, limit = 20, filters = []) {
1080
1079
  const { filterKey } = resolveHiveOperationFilters(filters);
1080
+ const userSelectedOperations = new Set(
1081
+ Array.isArray(filters) ? filters : [filters]
1082
+ );
1083
+ const hasAllFilter = userSelectedOperations.has("") || userSelectedOperations.size === 0;
1081
1084
  return reactQuery.infiniteQueryOptions({
1082
1085
  ...getHiveAssetTransactionsQueryOptions(username, limit, filters),
1083
1086
  queryKey: [
@@ -1124,7 +1127,7 @@ function getHivePowerAssetTransactionsQueryOptions(username, limit = 20, filters
1124
1127
  case "set_withdraw_vesting_route":
1125
1128
  return true;
1126
1129
  default:
1127
- return false;
1130
+ return hasAllFilter || userSelectedOperations.has(item.type);
1128
1131
  }
1129
1132
  })
1130
1133
  )
@@ -1155,11 +1158,21 @@ function getHbdAssetTransactionsQueryOptions(username, limit = 20, filters = [])
1155
1158
  case "transfer_to_vesting":
1156
1159
  case "recurrent_transfer":
1157
1160
  return parseAsset(item.amount).symbol === "HBD";
1161
+ case "transfer_from_savings":
1162
+ return parseAsset(item.amount).symbol === "HBD";
1158
1163
  case "fill_recurrent_transfer":
1159
1164
  const asset = parseAsset(item.amount);
1160
1165
  return ["HBD"].includes(asset.symbol);
1161
- case "comment_reward":
1162
- case "effective_comment_vote":
1166
+ case "cancel_transfer_from_savings":
1167
+ case "fill_order":
1168
+ case "limit_order_create":
1169
+ case "limit_order_cancel":
1170
+ case "fill_convert_request":
1171
+ case "fill_collateralized_convert_request":
1172
+ case "proposal_pay":
1173
+ case "interest":
1174
+ return true;
1175
+ case "limit_order_create2":
1163
1176
  return true;
1164
1177
  default:
1165
1178
  return false;
@@ -3055,6 +3068,17 @@ function getVisionPortfolioQueryOptions(username) {
3055
3068
  }
3056
3069
 
3057
3070
  // src/modules/wallets/queries/use-get-account-wallet-list-query.ts
3071
+ function normalizeAccountTokens(tokens) {
3072
+ if (Array.isArray(tokens)) {
3073
+ return tokens.filter(Boolean);
3074
+ }
3075
+ if (tokens && typeof tokens === "object") {
3076
+ return Object.values(tokens).flatMap(
3077
+ (value) => Array.isArray(value) ? value.filter(Boolean) : []
3078
+ );
3079
+ }
3080
+ return [];
3081
+ }
3058
3082
  var BASIC_TOKENS = [
3059
3083
  "POINTS" /* Points */,
3060
3084
  "HIVE" /* Hive */,
@@ -3075,7 +3099,8 @@ function getAccountWalletListQueryOptions(username) {
3075
3099
  } catch {
3076
3100
  }
3077
3101
  const tokenVisibility = /* @__PURE__ */ new Map();
3078
- account?.profile?.tokens?.forEach((token) => {
3102
+ const accountTokens = normalizeAccountTokens(account?.profile?.tokens);
3103
+ accountTokens.forEach((token) => {
3079
3104
  const symbol = token.symbol?.toUpperCase?.();
3080
3105
  if (!symbol) {
3081
3106
  return;
@@ -3108,10 +3133,10 @@ function getAccountWalletListQueryOptions(username) {
3108
3133
  }
3109
3134
  } catch {
3110
3135
  }
3111
- if (account?.profile?.tokens instanceof Array) {
3136
+ if (accountTokens.length > 0) {
3112
3137
  const list = [
3113
3138
  ...BASIC_TOKENS,
3114
- ...account.profile.tokens.map((token) => token.symbol).filter(isTokenVisible)
3139
+ ...accountTokens.map((token) => token.symbol).filter(isTokenVisible)
3115
3140
  ];
3116
3141
  return Array.from(new Set(list).values());
3117
3142
  }