You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve been building with wagmi on a project called Mycelia, where users can connect and monitor multiple wallets. One use case is displaying the total ETH balance across all their wallets. To support this, I built a custom hook that fetches ETH balances for multiple addresses in parallel. Similar to useBalance, but accepting an array of addresses.
This made me wonder: what if useBalance could also accept an addresses array in addition to a single address?
Instead of creating a separate hook like useBalances, it might feel more natural to allow:
Only when and array of addresses is passed, the return value could follow the current useBalance structure, but with arrays for fields that vary by address:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi wagmi team 👋
I’ve been building with wagmi on a project called Mycelia, where users can connect and monitor multiple wallets. One use case is displaying the total ETH balance across all their wallets. To support this, I built a custom hook that fetches ETH balances for multiple addresses in parallel. Similar to
useBalance, but accepting an array of addresses.This made me wonder: what if
useBalancecould also accept anaddressesarray in addition to a singleaddress?Instead of creating a separate hook like
useBalances, it might feel more natural to allow:Only when and array of addresses is passed, the return value could follow the current
useBalancestructure, but with arrays for fields that vary by address:Each index would match the corresponding input address, and developers could sum the values themselves if needed.
Why this could be useful:
I'm happy to help with the implementation if the idea makes sense for wagmi’s direction.
Would love to hear your thoughts on this!
Thanks for your incredible work, wagmi has been a joy to work with ✨
Beta Was this translation helpful? Give feedback.
All reactions