@bze/bze-ui-kit 0.2.0 → 0.2.1
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/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3130,7 +3130,17 @@ import { useCallback as useCallback7, useMemo as useMemo8 } from "react";
|
|
|
3130
3130
|
import BigNumber10 from "bignumber.js";
|
|
3131
3131
|
function useAssetsValue() {
|
|
3132
3132
|
const { assetsMap, usdPricesMap, balancesMap, isLoading: isLoadingPrices } = useAssetsContext();
|
|
3133
|
-
const totalUsdValue =
|
|
3133
|
+
const totalUsdValue = useCallback7((prettyBalances) => {
|
|
3134
|
+
let usdValue = BigNumber10(0);
|
|
3135
|
+
prettyBalances.map((denomBalance) => {
|
|
3136
|
+
const assetPrice = usdPricesMap.get(denomBalance.denom);
|
|
3137
|
+
if (assetPrice && assetPrice.gt(0)) {
|
|
3138
|
+
usdValue = usdValue.plus(assetPrice.multipliedBy(denomBalance.amount));
|
|
3139
|
+
}
|
|
3140
|
+
});
|
|
3141
|
+
return usdValue;
|
|
3142
|
+
}, [usdPricesMap]);
|
|
3143
|
+
const walletTotalUsdValue = useMemo8(() => {
|
|
3134
3144
|
let total = toBigNumber(0);
|
|
3135
3145
|
balancesMap.forEach((balance, denom) => {
|
|
3136
3146
|
const price = usdPricesMap.get(denom);
|
|
@@ -3164,6 +3174,7 @@ function useAssetsValue() {
|
|
|
3164
3174
|
}, [usdPricesMap]);
|
|
3165
3175
|
return {
|
|
3166
3176
|
totalUsdValue,
|
|
3177
|
+
walletTotalUsdValue,
|
|
3167
3178
|
denomUsdValue,
|
|
3168
3179
|
compareValues,
|
|
3169
3180
|
isLoading: isLoadingPrices
|