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

Bug: Intermittent errors using TransactionButton with CB Browser Wallet #1037

Open
dry-tortuga opened this issue Aug 12, 2024 · 7 comments
Open

Comments

@dry-tortuga
Copy link

dry-tortuga commented Aug 12, 2024

I'm seeing intermittent errors when using the TransactionButton to initiate a new contract call via Coinbase Browser Wallet at songbirdz.cc. See the 2 screenshots below for the specific errors in my console, but it takes me a few times clicking on the button before I can succesfully get Coinbase Browser Wallet to open up with the new contract call.

You can see the relevant code here: https://github.com/dry-tortuga/songbirdz-collection-frontend/blob/main/src/components/BirdIdentificationModal.js#L135

A contributing factor could be that I need to wait for the result of an async API call before I can fully build the contracts=[{ ... }] prop that is passed to Transaction, so wondering if that could be causing an issue?

Any better workarounds for this kind of use case?

Screenshot from 2024-08-12 17-16-09

Screenshot from 2024-08-12 17-15-37

What's the expected behavior?

Clicking on the TransactionButton should initiate the transaction request in the Coinbase Browser Wallet for final confirmation on the first click attempt.

What version of the libraries are you using?

@dry-tortuga
Copy link
Author

It looks like it's using the wallet_sendCalls method which isn't supported in non smart wallets?

@Zizzamia
Copy link
Contributor

Thank you for sharing this information. We are currently adding new listeners to access more lifecycle data from the Transaction component, which should make debugging easier.

I will ping you as soon as it's ready.

@dry-tortuga
Copy link
Author

dry-tortuga commented Aug 14, 2024

Thank you for sharing this information. We are currently adding new listeners to access more lifecycle data from the Transaction component, which should make debugging easier.

I will ping you as soon as it's ready.

Thank you! Yes please let me know as people are running into this error which is blocking them from using the app :)

I ended up just adding a check for now to only use the TransactionButton if they have smart wallet!

@Zizzamia
Copy link
Contributor

With the latest v0.29.1 you will have access to the onStatus hook, which helps listen all status happening inside the Transaction experience.

Now, it needs more polishing, so your case scenario actually is perfect for us, so we can learn more about those edge cases.

Would you mind use the onStatus hook, add a console.log and just report back all the logging you have when you use the Transaction experience.

Something I am looking to learn is, where in the flow things start breaking, and what's the diffence of experience between Smart Wallet and EOA for your app.

@mykcryptodev
Copy link
Contributor

It looks like onchainkit's Transaction component is trying to use wallet_sendCalls regardless if the wallet has that capability or not. If that's the case, using the Transaction button for an EOA isn't possible.

Here is an example where I am attempting to allow an EOA to approve USDC to a contract and it is trying to use wallet_sendCalls for the EOA
Screenshot 2024-08-20 at 1 22 29 PM

@dry-tortuga
Copy link
Author

With the latest v0.29.1 you will have access to the onStatus hook, which helps listen all status happening inside the Transaction experience.

Now, it needs more polishing, so your case scenario actually is perfect for us, so we can learn more about those edge cases.

Would you mind use the onStatus hook, add a console.log and just report back all the logging you have when you use the Transaction experience.

Something I am looking to learn is, where in the flow things start breaking, and what's the diffence of experience between Smart Wallet and EOA for your app.

Sounds good! I'll work on that this week and get back to you.

@Zizzamia
Copy link
Contributor

And @dry-tortuga, just FYI, we did not drop this. We have @abcrane123 pairing with @mykcryptodev in the next few days to keep exploring how to best share the errors when someone uses EOA instead of Smart Wallet.

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

No branches or pull requests

3 participants