Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed useAccountBalance #788

Merged
merged 5 commits into from Mar 27, 2024

Conversation

Hotmanics
Copy link
Contributor

Description

  • Removed useAccountBalance hook.
  • Updated Balance.tsx to replace useAccountBalance by grabbing price from global state. Grabs the balance using useBalance passing in only address property and setting watch to true. Additionally, assigns a variable to the formatted balance and converts the result to a Number, then uses the variable during rendering.
  • Updated FaucetButton.tsx to replace useAccountBalance by grabbing the balance using useBalance passing in the address obtained from useAccount.
  • Updated ~~/hooks/scaffold-eth/index.ts to remove reference to useAccountBalance.

Additional Information

Related Issues

Closes #687

Your ENS/address: JacobHomanics.eth/0xc689c800a7121b186208ea3b182fAb2671B337E7

@Hotmanics
Copy link
Contributor Author

Not sure if we need to force passing in the chainId via targetNetwork.id when calling useBalance. I've omitted it for now.

@technophile-04
Copy link
Collaborator

Thanks @Hotmanics !! Looking great !!

@technophile-04 technophile-04 merged commit 601ca8f into scaffold-eth:main Mar 27, 2024
1 check passed
@@ -2,8 +2,9 @@

import { useState } from "react";
import { Address } from "viem";
import { useAccountBalance } from "~~/hooks/scaffold-eth";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove useAccountBalance hook
5 participants