Skip to content

Commit

Permalink
useSubAssetBalance, #5180
Browse files Browse the repository at this point in the history
  • Loading branch information
leocs2417 committed Dec 10, 2024
1 parent 931016e commit 7abf76f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/next-common/components/assets/useSubAssetBalance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import useSubStorage from "next-common/hooks/common/useSubStorage";

export default function useSubAssetBalance(assetId, address) {
const { result, loading } = useSubStorage("assets", "account", [
assetId,
address,
]);

return {
result: result?.toJSON()?.balance || 0,
loading,
};
}

0 comments on commit 7abf76f

Please sign in to comment.