Skip to content

S8.7: a missing 1Click credential is a named state, and one command proves a token - #160

Merged
MFrancis-dev merged 1 commit into
mainfrom
feat/s8-7-oneclick-credential
Nov 10, 2026
Merged

MFrancis-dev merged 1 commit into
mainfrom
feat/s8-7-oneclick-credential

Conversation

@MFrancis-dev

Copy link
Copy Markdown
Owner

What

A missing ONECLICK_JWT used to surface as the vendor's 400 Internal server error on a real quote, which the pay page reported as the client's own mistake. It now has a name, and a token can be proven the moment it exists.

  • lib/server/pay.ts: the real-quote branch checks deps.oneClick.hasJwt (after the reuse/conflict checks) and throws 500 server_misconfigured. Dry previews stay open, and demo mode is exempt — its transport mints the address itself and never forwards a real quote.
  • pnpm oneclick:check (scripts/check-oneclick.ts): with no token it exits 1 saying previews still work but an address cannot be issued; with a token it runs a real EXACT_OUTPUT quote for 10.5 USDC→USDC and prints status, base units, fee, signature verdict and whether an address came back. --real <near-account> validates the address and proves the address-issuing path without moving funds. It never prints the JWT.
  • Re-measured the live API: a dry quote answers 200 unauthenticated; a non-dry quote (the one carrying depositAddress) answers 400 without a credential and 401 with a bogus bearer; /v0/tokens answers either way. Corrected the earlier "every quote is refused" record in ARCHITECTURE.md §3.2, README, DEPLOY.md, LAUNCH.md §1 and the S8.2 note.
  • DEPLOY.md: "Obtaining the 1Click credential" (portal → .env.local → check → vercel env add). AGENTS.md §5 gains the two commands. ROADMAP.md tracks S8.7 (Phase 8 67% → 71%, overall 92.0%).

Tests

  • New route test: no credential → 500 server_misconfigured, zero upstream quote calls, dry preview still 200.
  • New route test: demo mode with no credential still gets an address (protects pnpm demo).
  • pnpm typecheck, pnpm lint, pnpm format clean; 673 passing + 1 skipped.
  • E2E_PORT=3217 pnpm e2e → 5/5, including the demo "Get a payment address" step, against a production build.

Closes nothing: #159 stays open as the roadmap entry, recorded by a comment after merge.

A non-dry quote needs the partner JWT; without it the vendor answers
"400 Internal server error", which the pay page would have shown as the
client's own mistake. The real-quote branch now checks the deployment
first and answers 500 server_misconfigured (dry previews and demo mode
untouched). `pnpm oneclick:check` exits 1 saying previews still work when
no token exists, and with a token runs a real EXACT_OUTPUT quote and
reports the signature verdict, the fee and whether an address came back;
`--real` proves the address path without moving funds. Corrects the
earlier "every quote is refused" record in ARCHITECTURE, README, DEPLOY,
LAUNCH and tracks S8.7.
@MFrancis-dev
MFrancis-dev merged commit 0bcb949 into main Nov 10, 2026
6 checks passed
@MFrancis-dev
MFrancis-dev deleted the feat/s8-7-oneclick-credential branch November 10, 2026 07:20
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.

2 participants