feat(examples): Coinbase on-ramp Next.js example - #16
Closed
mariano-aguero wants to merge 6 commits into
Closed
mariano-aguero wants to merge 6 commits into
mariano-aguero wants to merge 6 commits into
Conversation
Buy USDC on Base into a passkey smart account via Coinbase guest checkout. Phone OTP, embedded payment iframe, and live order-status polling. Uses @jaw.id/core for the account and server-side route handlers so the on-ramp API key never reaches the browser. Listed under the @jaw.id/core section in the root README.
Show inline hints for the phone, amount, and disabled submit so it is obvious why "Continue" stays disabled, and clarify that the OTP code belongs to the next step. Mark the root html with suppressHydrationWarning so browser extensions that mutate <html> before hydration don't trip a hydration mismatch.
- README: note the OTP is mock (000000) locally vs real Twilio SMS in prod, and that status comes from the webhook in prod / live polling locally. - .env.example: add the local proxy base URL hint; un-ignore it in .gitignore so the template is committed like the other examples.
There was a problem hiding this comment.
This PR adds a new nextjs-coinbase-onramp example to the monorepo, demonstrating how to buy USDC on Base into a passkey account via Coinbase guest checkout (phone OTP, payment iframe, and live order status). The changes are mostly additive — a new workspace entry in bun.lock, README updates, and some lockfile deduplication of @solana/codecs-core. Notably, the CI build is failing due to missing example directories (nextjs-quickstart, nextjs-subscription, etc.) that appear to be referenced in the build matrix but don't exist in the repo, which is a pre-existing issue unrelated to this PR.
✅ No blocking issues found by the automated review — this is not a substitute for human review.
The hardcoded matrix listed example directories that no longer exist (renamed/removed), so every build job failed at 'cd examples/<name>' with no such directory, and new examples were never built. Replace it with a discover job that finds example dirs whose package.json declares a build script (covers nested examples like eip7702/* and kms/*, skips node-only ones) and feeds them to the build matrix with fail-fast off.
- Add DOM to the tsc lib so ox's WebAuthn source (shipped as .ts, not skipped by skipLibCheck) resolves window/AuthenticatorAttestationResponse/BufferSource. - eip7702/node-quickstart: assert env vars guaranteed by the boot guard, await getCallStatus (it returns a Promise), and bridge the workspace viem version skew on the LocalAccount signer argument with a typed cast.
- nextjs-wagmi: align with the current SDK shape — permissions use permissionId and a top-level spends array, narrow the account union before reading capabilities, discriminate the SIWE response by signature, and assert the isAddress-validated string. - nextjs-headless-mode: widen the recipient state off the const-literal address; cast the dynamically-built typed-data args past viem's strict generics. - nextjs-reown: declare @wagmi/core (bun doesn't resolve undeclared transitive deps), keeping the storage types compatible with the Reown wagmi adapter. - eip7702/privy-nextjs: stub the optional @farcaster/mini-app-solana connector and render the route dynamically so the Privy provider isn't prerendered.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
examples/nextjs-coinbase-onramp: a Next.js app that buys USDC on Base into a@jaw.id/corepasskey smart account via Coinbase guest checkout (Apple Pay / Google Pay), behind the JustaName proxy on-ramp API.Highlights
app/api/onramp/{start,validate-otp,orders/[id]}), which inject the proxyx-api-keyserver-side — it never reaches the browser.clientIpis forwarded fromx-forwarded-for.embeddable.url) → poll order status toCOMPLETED.Verified
Full browser run against the CDP sandbox: passkey → form → OTP → Apple Pay sandbox → Completed, 2 USDC on Base.
Notes
.env.exampleis committed (placeholders only); fixed the example.gitignoreso the template is tracked like the other examples..env.localstays ignored.000000, sandbox) vs production (Twilio SMS, webhook-driven status) behaviour.