Skip to content

feat(examples): Coinbase on-ramp Next.js example - #16

Closed
mariano-aguero wants to merge 6 commits into
mainfrom
feat/new-examples
Closed

mariano-aguero wants to merge 6 commits into
mainfrom
feat/new-examples

Conversation

@mariano-aguero

@mariano-aguero mariano-aguero commented Jun 29, 2026

Copy link
Copy Markdown

What

Adds examples/nextjs-coinbase-onramp: a Next.js app that buys USDC on Base into a @jaw.id/core passkey smart account via Coinbase guest checkout (Apple Pay / Google Pay), behind the JustaName proxy on-ramp API.

Highlights

  • Server-side api-key: the browser calls the example's own Next route handlers (app/api/onramp/{start,validate-otp,orders/[id]}), which inject the proxy x-api-key server-side — it never reaches the browser. clientIp is forwarded from x-forwarded-for.
  • Flow: passkey account (its counterfactual address = destination) → phone/email/amount form → OTP → Coinbase payment iframe (embeddable.url) → poll order status to COMPLETED.
  • Constraints surfaced in the UI: US-only phone (E.164), USDC on Base, $2–$500.

Verified

Full browser run against the CDP sandbox: passkey → form → OTP → Apple Pay sandbox → Completed, 2 USDC on Base.

Notes

  • .env.example is committed (placeholders only); fixed the example .gitignore so the template is tracked like the other examples. .env.local stays ignored.
  • README documents local (mock OTP 000000, sandbox) vs production (Twilio SMS, webhook-driven status) behaviour.

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.

@justalab-agents justalab-agents Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@mariano-aguero mariano-aguero self-assigned this Jun 29, 2026
@mariano-aguero
mariano-aguero requested a review from Ghadi8 June 29, 2026 21:28
@mariano-aguero
mariano-aguero deleted the feat/new-examples branch June 30, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant