-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat(tangle-dapp): Use TX relayer for EVM accounts with no balance #2758
Conversation
✅ Deploy Preview for tangle-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for tangle-cloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for tangle-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for tangle-cloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
What's left here:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we use useWalletClient
from and usePublicClient
from wagmi
out of curiosity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is integrated with useNetworkStore
's active network, so that when the active network is changed, this also reflects the changes. Is it the same for useWalletClient
& usePublicClient
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can pass the chain id as the parameter into those hooks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would you obtain that chain id? Something like this would be needed wherever we use useWalletClient
& usePublicClient
:
import {useWalletClient} from "wagmi"
const MyComponent = () => {
const {network} = useNetworkStore()
// ... check if the current network has an evm id ...
const client = useWalletClient({ chainId: network.evmChainId, ... other config ... })
}
If that's the case, then that would be exactly why the custom useViemWalletClient
hook is useful: It saves you the time to having to repeat all those checks wherever you'd use the wagmi
variant.
@yurixander after depositing does your balance instantly update or not in that tooltip display? |
Cause if not we're just leaving more "BUG"s that @monaiuu is going to have us point out. Remember these features don't exist in a vacuum we have to be implementing updates for all the effects they trigger. |
@drewstone It does not instantly update after depositing, the reason likely being that the code fetches the balances periodically. It is not fixed in this PR because this one is solely intended to implement the TX relayer feature though. |
Ok, is this bug reported anywhere? |
I think if we don't change this culture of how we build where we're so focused on implementing a feature and not in a way that fixes things in the process or addressing all aspects of the work, we will continue to have issues like this. |
Yes: #2780 |
Summary of changes
Provide a detailed description of proposed changes.
useContractRead
andusePolling
hooks.Proposed area of change
Put an
x
in the boxes that apply.apps/tangle-dapp
apps/tangle-cloud
libs/tangle-shared-ui
libs/webb-ui-components
Associated issue(s)
Specify any issues that can be closed from these changes (e.g.
Closes #233
).Screen Recording
If possible provide screenshots and/or a screen recording of proposed change.
Screenshot.2025-01-28.at.23.23.17.mp4