@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 CHANGED
@@ -1065,7 +1065,8 @@ declare function useLiquidityPool(poolId: string): {
1065
1065
  };
1066
1066
 
1067
1067
  declare function useAssetsValue(): {
1068
- totalUsdValue: BigNumber;
1068
+ totalUsdValue: (prettyBalances: PrettyBalance[]) => BigNumber;
1069
+ walletTotalUsdValue: BigNumber;
1069
1070
  denomUsdValue: (denom: string, uAmount: BigNumber) => BigNumber;
1070
1071
  compareValues: (a: PrettyBalance, b: PrettyBalance) => 0 | 1 | -1;
1071
1072
  isLoading: boolean;
package/dist/index.d.ts CHANGED
@@ -1065,7 +1065,8 @@ declare function useLiquidityPool(poolId: string): {
1065
1065
  };
1066
1066
 
1067
1067
  declare function useAssetsValue(): {
1068
- totalUsdValue: BigNumber;
1068
+ totalUsdValue: (prettyBalances: PrettyBalance[]) => BigNumber;
1069
+ walletTotalUsdValue: BigNumber;
1069
1070
  denomUsdValue: (denom: string, uAmount: BigNumber) => BigNumber;
1070
1071
  compareValues: (a: PrettyBalance, b: PrettyBalance) => 0 | 1 | -1;
1071
1072
  isLoading: boolean;
package/dist/index.js CHANGED
@@ -3391,7 +3391,17 @@ var import_react10 = require("react");
3391
3391
  var import_bignumber10 = __toESM(require("bignumber.js"));
3392
3392
  function useAssetsValue() {
3393
3393
  const { assetsMap, usdPricesMap, balancesMap, isLoading: isLoadingPrices } = useAssetsContext();
3394
- const totalUsdValue = (0, import_react10.useMemo)(() => {
3394
+ const totalUsdValue = (0, import_react10.useCallback)((prettyBalances) => {
3395
+ let usdValue = (0, import_bignumber10.default)(0);
3396
+ prettyBalances.map((denomBalance) => {
3397
+ const assetPrice = usdPricesMap.get(denomBalance.denom);
3398
+ if (assetPrice && assetPrice.gt(0)) {
3399
+ usdValue = usdValue.plus(assetPrice.multipliedBy(denomBalance.amount));
3400
+ }
3401
+ });
3402
+ return usdValue;
3403
+ }, [usdPricesMap]);
3404
+ const walletTotalUsdValue = (0, import_react10.useMemo)(() => {
3395
3405
  let total = toBigNumber(0);
3396
3406
  balancesMap.forEach((balance, denom) => {
3397
3407
  const price = usdPricesMap.get(denom);
@@ -3425,6 +3435,7 @@ function useAssetsValue() {
3425
3435
  }, [usdPricesMap]);
3426
3436
  return {
3427
3437
  totalUsdValue,
3438
+ walletTotalUsdValue,
3428
3439
  denomUsdValue,
3429
3440
  compareValues,
3430
3441
  isLoading: isLoadingPrices