@ecency/wallets 1.4.31 → 1.4.33
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.
- package/dist/browser/index.js +62 -28
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +62 -28
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +62 -28
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -1020,6 +1020,8 @@ function getHiveAssetTransactionsQueryOptions(username, limit = 20, filters = []
|
|
|
1020
1020
|
case "transfer_to_vesting":
|
|
1021
1021
|
case "recurrent_transfer":
|
|
1022
1022
|
return parseAsset(item.amount).symbol === "HIVE";
|
|
1023
|
+
case "transfer_from_savings":
|
|
1024
|
+
return parseAsset(item.amount).symbol === "HIVE";
|
|
1023
1025
|
case "fill_recurrent_transfer":
|
|
1024
1026
|
const asset = parseAsset(item.amount);
|
|
1025
1027
|
return ["HIVE"].includes(asset.symbol);
|
|
@@ -1028,18 +1030,15 @@ function getHiveAssetTransactionsQueryOptions(username, limit = 20, filters = []
|
|
|
1028
1030
|
item.reward_hive
|
|
1029
1031
|
);
|
|
1030
1032
|
return rewardHive.amount > 0;
|
|
1033
|
+
case "curation_reward":
|
|
1031
1034
|
case "cancel_transfer_from_savings":
|
|
1032
1035
|
case "fill_order":
|
|
1033
1036
|
case "limit_order_create":
|
|
1034
1037
|
case "limit_order_cancel":
|
|
1035
|
-
case "interest":
|
|
1036
1038
|
case "fill_convert_request":
|
|
1037
1039
|
case "fill_collateralized_convert_request":
|
|
1038
|
-
|
|
1039
|
-
case "
|
|
1040
|
-
case "comment_payout_update":
|
|
1041
|
-
case "collateralized_convert":
|
|
1042
|
-
case "account_witness_proxy":
|
|
1040
|
+
return true;
|
|
1041
|
+
case "limit_order_create2":
|
|
1043
1042
|
return true;
|
|
1044
1043
|
default:
|
|
1045
1044
|
return false;
|
|
@@ -1051,6 +1050,10 @@ function getHiveAssetTransactionsQueryOptions(username, limit = 20, filters = []
|
|
|
1051
1050
|
}
|
|
1052
1051
|
function getHivePowerAssetTransactionsQueryOptions(username, limit = 20, filters = []) {
|
|
1053
1052
|
const { filterKey } = resolveHiveOperationFilters(filters);
|
|
1053
|
+
const userSelectedOperations = new Set(
|
|
1054
|
+
Array.isArray(filters) ? filters : [filters]
|
|
1055
|
+
);
|
|
1056
|
+
const hasAllFilter = userSelectedOperations.has("") || userSelectedOperations.size === 0;
|
|
1054
1057
|
return infiniteQueryOptions({
|
|
1055
1058
|
...getHiveAssetTransactionsQueryOptions(username, limit, filters),
|
|
1056
1059
|
queryKey: [
|
|
@@ -1097,7 +1100,7 @@ function getHivePowerAssetTransactionsQueryOptions(username, limit = 20, filters
|
|
|
1097
1100
|
case "set_withdraw_vesting_route":
|
|
1098
1101
|
return true;
|
|
1099
1102
|
default:
|
|
1100
|
-
return
|
|
1103
|
+
return hasAllFilter || userSelectedOperations.has(item.type);
|
|
1101
1104
|
}
|
|
1102
1105
|
})
|
|
1103
1106
|
)
|
|
@@ -1128,11 +1131,21 @@ function getHbdAssetTransactionsQueryOptions(username, limit = 20, filters = [])
|
|
|
1128
1131
|
case "transfer_to_vesting":
|
|
1129
1132
|
case "recurrent_transfer":
|
|
1130
1133
|
return parseAsset(item.amount).symbol === "HBD";
|
|
1134
|
+
case "transfer_from_savings":
|
|
1135
|
+
return parseAsset(item.amount).symbol === "HBD";
|
|
1131
1136
|
case "fill_recurrent_transfer":
|
|
1132
1137
|
const asset = parseAsset(item.amount);
|
|
1133
1138
|
return ["HBD"].includes(asset.symbol);
|
|
1134
|
-
case "
|
|
1135
|
-
case "
|
|
1139
|
+
case "cancel_transfer_from_savings":
|
|
1140
|
+
case "fill_order":
|
|
1141
|
+
case "limit_order_create":
|
|
1142
|
+
case "limit_order_cancel":
|
|
1143
|
+
case "fill_convert_request":
|
|
1144
|
+
case "fill_collateralized_convert_request":
|
|
1145
|
+
case "proposal_pay":
|
|
1146
|
+
case "interest":
|
|
1147
|
+
return true;
|
|
1148
|
+
case "limit_order_create2":
|
|
1136
1149
|
return true;
|
|
1137
1150
|
default:
|
|
1138
1151
|
return false;
|
|
@@ -3028,6 +3041,12 @@ function getVisionPortfolioQueryOptions(username) {
|
|
|
3028
3041
|
}
|
|
3029
3042
|
|
|
3030
3043
|
// src/modules/wallets/queries/use-get-account-wallet-list-query.ts
|
|
3044
|
+
var BASIC_TOKENS = [
|
|
3045
|
+
"POINTS" /* Points */,
|
|
3046
|
+
"HIVE" /* Hive */,
|
|
3047
|
+
"HP" /* HivePower */,
|
|
3048
|
+
"HBD" /* HiveDollar */
|
|
3049
|
+
];
|
|
3031
3050
|
function getAccountWalletListQueryOptions(username) {
|
|
3032
3051
|
return queryOptions({
|
|
3033
3052
|
queryKey: ["ecency-wallets", "list", username],
|
|
@@ -3035,39 +3054,54 @@ function getAccountWalletListQueryOptions(username) {
|
|
|
3035
3054
|
queryFn: async () => {
|
|
3036
3055
|
const portfolioQuery = getVisionPortfolioQueryOptions(username);
|
|
3037
3056
|
const queryClient = getQueryClient();
|
|
3057
|
+
const accountQuery = getAccountFullQueryOptions(username);
|
|
3058
|
+
let account;
|
|
3059
|
+
try {
|
|
3060
|
+
account = await queryClient.fetchQuery(accountQuery);
|
|
3061
|
+
} catch {
|
|
3062
|
+
}
|
|
3063
|
+
const tokenVisibility = /* @__PURE__ */ new Map();
|
|
3064
|
+
account?.profile?.tokens?.forEach((token) => {
|
|
3065
|
+
const symbol = token.symbol?.toUpperCase?.();
|
|
3066
|
+
if (!symbol) {
|
|
3067
|
+
return;
|
|
3068
|
+
}
|
|
3069
|
+
const showValue = token?.meta?.show;
|
|
3070
|
+
if (typeof showValue === "boolean") {
|
|
3071
|
+
tokenVisibility.set(symbol, showValue);
|
|
3072
|
+
}
|
|
3073
|
+
});
|
|
3074
|
+
const isTokenVisible = (symbol) => {
|
|
3075
|
+
const normalized = symbol?.toUpperCase();
|
|
3076
|
+
if (!normalized) {
|
|
3077
|
+
return false;
|
|
3078
|
+
}
|
|
3079
|
+
if (BASIC_TOKENS.includes(normalized)) {
|
|
3080
|
+
return true;
|
|
3081
|
+
}
|
|
3082
|
+
return tokenVisibility.get(normalized) === true;
|
|
3083
|
+
};
|
|
3038
3084
|
try {
|
|
3039
3085
|
const portfolio = await queryClient.fetchQuery(portfolioQuery);
|
|
3040
3086
|
const tokensFromPortfolio = portfolio.wallets.map(
|
|
3041
3087
|
(asset) => asset.info.name
|
|
3042
3088
|
);
|
|
3043
3089
|
if (tokensFromPortfolio.length > 0) {
|
|
3044
|
-
|
|
3090
|
+
const visibleTokens = tokensFromPortfolio.map((token) => token?.toUpperCase?.()).filter((token) => Boolean(token)).filter(isTokenVisible);
|
|
3091
|
+
if (visibleTokens.length > 0) {
|
|
3092
|
+
return Array.from(new Set(visibleTokens));
|
|
3093
|
+
}
|
|
3045
3094
|
}
|
|
3046
3095
|
} catch {
|
|
3047
3096
|
}
|
|
3048
|
-
const accountQuery = getAccountFullQueryOptions(username);
|
|
3049
|
-
await queryClient.fetchQuery({
|
|
3050
|
-
queryKey: accountQuery.queryKey
|
|
3051
|
-
});
|
|
3052
|
-
const account = queryClient.getQueryData(
|
|
3053
|
-
accountQuery.queryKey
|
|
3054
|
-
);
|
|
3055
3097
|
if (account?.profile?.tokens instanceof Array) {
|
|
3056
3098
|
const list = [
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
"HP" /* HivePower */,
|
|
3060
|
-
"HBD" /* HiveDollar */,
|
|
3061
|
-
...account.profile.tokens.filter(({ meta }) => !!meta?.show).map((token) => token.symbol)
|
|
3099
|
+
...BASIC_TOKENS,
|
|
3100
|
+
...account.profile.tokens.map((token) => token.symbol).filter(isTokenVisible)
|
|
3062
3101
|
];
|
|
3063
3102
|
return Array.from(new Set(list).values());
|
|
3064
3103
|
}
|
|
3065
|
-
return [
|
|
3066
|
-
"POINTS" /* Points */,
|
|
3067
|
-
"HIVE" /* Hive */,
|
|
3068
|
-
"HP" /* HivePower */,
|
|
3069
|
-
"HBD" /* HiveDollar */
|
|
3070
|
-
];
|
|
3104
|
+
return [...BASIC_TOKENS];
|
|
3071
3105
|
}
|
|
3072
3106
|
});
|
|
3073
3107
|
}
|