@volr/react 0.1.110 → 0.1.111

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.cjs CHANGED
@@ -20026,6 +20026,7 @@ function useUserBalances() {
20026
20026
  isNative,
20027
20027
  balanceRaw: 0n,
20028
20028
  balance: "0",
20029
+ priceUsd: asset.priceUsd,
20029
20030
  isLoading: true
20030
20031
  };
20031
20032
  });
@@ -20087,7 +20088,12 @@ function useUserBalances() {
20087
20088
  (prev) => prev.map((b) => {
20088
20089
  const result = results.find((r) => r.id === b.id);
20089
20090
  if (result) {
20090
- return { ...b, ...result };
20091
+ let balanceUsd;
20092
+ if (b.priceUsd !== void 0 && result.balanceRaw !== void 0) {
20093
+ const balanceNum = Number(result.balanceRaw) / Math.pow(10, b.decimals);
20094
+ balanceUsd = balanceNum * b.priceUsd;
20095
+ }
20096
+ return { ...b, ...result, balanceUsd };
20091
20097
  }
20092
20098
  return b;
20093
20099
  })