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

feat: EOA support for the Checkout component #1937

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

azf20
Copy link

@azf20 azf20 commented Feb 7, 2025

What changed? Why?

This introduces support for sequential approve / call actions as a fallback to the experimental wagmi writeContracts, to enable EOAs to use the component

Currently the component does not work for EOAs, as it relies on experimental wagmi multicall functionality:

  • If an EOA is connected via Coinbase wallet, it will fail trying to checkCapabilities
  • If an EOA is connected in another way (e.g. Metamask), the user will be prompted to connect a Coinbase wallet, rather than leveraging the existing connection

This is confusing and limits the usefulness of the component. By adding support for sequential transactions, this can be used for all account types.

There is a small optimisation to check the allowance before making the "approve" transaction, in case that can be skipped (e.g. if the approve was made already and then the purchase wasn't made for some reason, or if there is an infinite / higher approval).

Notes to reviewers

Currently this only adds the feature (to unblock EthGlobal hackathon progress), but can add tests / docs if there is appetite to merge this upstream.

How has it been tested?

  • Checked / linted / built
  • Tested with Metamask, Coinbase wallet (passkey) and Coinbase wallet (app, EOA)

Copy link

vercel bot commented Feb 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
onchainkit-coverage ❌ Failed (Inspect) Feb 7, 2025 3:29pm
onchainkit-routes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2025 3:29pm

Copy link

vercel bot commented Feb 7, 2025

@azf20 is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

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

Successfully merging this pull request may close these issues.

1 participant