@ecency/wallets 1.4.33 → 1.4.35
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 +15 -3
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +15 -3
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +15 -3
- package/dist/node/index.mjs.map +1 -1
- package/package.json +19 -14
package/dist/node/index.cjs
CHANGED
|
@@ -3068,6 +3068,17 @@ function getVisionPortfolioQueryOptions(username) {
|
|
|
3068
3068
|
}
|
|
3069
3069
|
|
|
3070
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
|
+
}
|
|
3071
3082
|
var BASIC_TOKENS = [
|
|
3072
3083
|
"POINTS" /* Points */,
|
|
3073
3084
|
"HIVE" /* Hive */,
|
|
@@ -3088,7 +3099,8 @@ function getAccountWalletListQueryOptions(username) {
|
|
|
3088
3099
|
} catch {
|
|
3089
3100
|
}
|
|
3090
3101
|
const tokenVisibility = /* @__PURE__ */ new Map();
|
|
3091
|
-
account?.profile?.tokens
|
|
3102
|
+
const accountTokens = normalizeAccountTokens(account?.profile?.tokens);
|
|
3103
|
+
accountTokens.forEach((token) => {
|
|
3092
3104
|
const symbol = token.symbol?.toUpperCase?.();
|
|
3093
3105
|
if (!symbol) {
|
|
3094
3106
|
return;
|
|
@@ -3121,10 +3133,10 @@ function getAccountWalletListQueryOptions(username) {
|
|
|
3121
3133
|
}
|
|
3122
3134
|
} catch {
|
|
3123
3135
|
}
|
|
3124
|
-
if (
|
|
3136
|
+
if (accountTokens.length > 0) {
|
|
3125
3137
|
const list = [
|
|
3126
3138
|
...BASIC_TOKENS,
|
|
3127
|
-
...
|
|
3139
|
+
...accountTokens.map((token) => token.symbol).filter(isTokenVisible)
|
|
3128
3140
|
];
|
|
3129
3141
|
return Array.from(new Set(list).values());
|
|
3130
3142
|
}
|