Skip to content

Conversation

@JacobHomanics
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

@JacobHomanics
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.

@carletex carletex requested a review from technophile-04 March 26, 2024 12:38
@technophile-04
Copy link
Collaborator

Thanks @Hotmanics !! Looking great !!

@technophile-04 technophile-04 merged commit 601ca8f into scaffold-eth:main Mar 27, 2024

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