@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/node/index.cjs
CHANGED
|
@@ -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
|
-
|
|
1066
|
-
case "
|
|
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
|
|
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 "
|
|
1162
|
-
case "
|
|
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,12 @@ function getVisionPortfolioQueryOptions(username) {
|
|
|
3055
3068
|
}
|
|
3056
3069
|
|
|
3057
3070
|
// src/modules/wallets/queries/use-get-account-wallet-list-query.ts
|
|
3071
|
+
var BASIC_TOKENS = [
|
|
3072
|
+
"POINTS" /* Points */,
|
|
3073
|
+
"HIVE" /* Hive */,
|
|
3074
|
+
"HP" /* HivePower */,
|
|
3075
|
+
"HBD" /* HiveDollar */
|
|
3076
|
+
];
|
|
3058
3077
|
function getAccountWalletListQueryOptions(username) {
|
|
3059
3078
|
return reactQuery.queryOptions({
|
|
3060
3079
|
queryKey: ["ecency-wallets", "list", username],
|
|
@@ -3062,39 +3081,54 @@ function getAccountWalletListQueryOptions(username) {
|
|
|
3062
3081
|
queryFn: async () => {
|
|
3063
3082
|
const portfolioQuery = getVisionPortfolioQueryOptions(username);
|
|
3064
3083
|
const queryClient = sdk.getQueryClient();
|
|
3084
|
+
const accountQuery = sdk.getAccountFullQueryOptions(username);
|
|
3085
|
+
let account;
|
|
3086
|
+
try {
|
|
3087
|
+
account = await queryClient.fetchQuery(accountQuery);
|
|
3088
|
+
} catch {
|
|
3089
|
+
}
|
|
3090
|
+
const tokenVisibility = /* @__PURE__ */ new Map();
|
|
3091
|
+
account?.profile?.tokens?.forEach((token) => {
|
|
3092
|
+
const symbol = token.symbol?.toUpperCase?.();
|
|
3093
|
+
if (!symbol) {
|
|
3094
|
+
return;
|
|
3095
|
+
}
|
|
3096
|
+
const showValue = token?.meta?.show;
|
|
3097
|
+
if (typeof showValue === "boolean") {
|
|
3098
|
+
tokenVisibility.set(symbol, showValue);
|
|
3099
|
+
}
|
|
3100
|
+
});
|
|
3101
|
+
const isTokenVisible = (symbol) => {
|
|
3102
|
+
const normalized = symbol?.toUpperCase();
|
|
3103
|
+
if (!normalized) {
|
|
3104
|
+
return false;
|
|
3105
|
+
}
|
|
3106
|
+
if (BASIC_TOKENS.includes(normalized)) {
|
|
3107
|
+
return true;
|
|
3108
|
+
}
|
|
3109
|
+
return tokenVisibility.get(normalized) === true;
|
|
3110
|
+
};
|
|
3065
3111
|
try {
|
|
3066
3112
|
const portfolio = await queryClient.fetchQuery(portfolioQuery);
|
|
3067
3113
|
const tokensFromPortfolio = portfolio.wallets.map(
|
|
3068
3114
|
(asset) => asset.info.name
|
|
3069
3115
|
);
|
|
3070
3116
|
if (tokensFromPortfolio.length > 0) {
|
|
3071
|
-
|
|
3117
|
+
const visibleTokens = tokensFromPortfolio.map((token) => token?.toUpperCase?.()).filter((token) => Boolean(token)).filter(isTokenVisible);
|
|
3118
|
+
if (visibleTokens.length > 0) {
|
|
3119
|
+
return Array.from(new Set(visibleTokens));
|
|
3120
|
+
}
|
|
3072
3121
|
}
|
|
3073
3122
|
} catch {
|
|
3074
3123
|
}
|
|
3075
|
-
const accountQuery = sdk.getAccountFullQueryOptions(username);
|
|
3076
|
-
await queryClient.fetchQuery({
|
|
3077
|
-
queryKey: accountQuery.queryKey
|
|
3078
|
-
});
|
|
3079
|
-
const account = queryClient.getQueryData(
|
|
3080
|
-
accountQuery.queryKey
|
|
3081
|
-
);
|
|
3082
3124
|
if (account?.profile?.tokens instanceof Array) {
|
|
3083
3125
|
const list = [
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
"HP" /* HivePower */,
|
|
3087
|
-
"HBD" /* HiveDollar */,
|
|
3088
|
-
...account.profile.tokens.filter(({ meta }) => !!meta?.show).map((token) => token.symbol)
|
|
3126
|
+
...BASIC_TOKENS,
|
|
3127
|
+
...account.profile.tokens.map((token) => token.symbol).filter(isTokenVisible)
|
|
3089
3128
|
];
|
|
3090
3129
|
return Array.from(new Set(list).values());
|
|
3091
3130
|
}
|
|
3092
|
-
return [
|
|
3093
|
-
"POINTS" /* Points */,
|
|
3094
|
-
"HIVE" /* Hive */,
|
|
3095
|
-
"HP" /* HivePower */,
|
|
3096
|
-
"HBD" /* HiveDollar */
|
|
3097
|
-
];
|
|
3131
|
+
return [...BASIC_TOKENS];
|
|
3098
3132
|
}
|
|
3099
3133
|
});
|
|
3100
3134
|
}
|