Skip to content

S8.7 — Make a missing 1Click credential legible and prove one in one command #159

Open

Description

@MFrancis-dev

The S8.4 blocker is the 1Click partner JWT. Re-measured live on 2026-11-10:

  • a dry POST /v0/quote answers 200 with no credential;
  • the non-dry quote that carries depositAddress answers 400 {"message":"Internal server error"} without one, and 401 Invalid token with a bogus one;
  • /v0/tokens answers either way; the vendor docs say unauthenticated quotes pay +25 bps but an address needs a partner credential.

Two consequences this task fixes:

  1. The app mapped that 400 to upstream_rejected ("1Click rejected the request"), blaming the caller's body. A non-dry quote on a deployment with no ONECLICK_JWT now fails closed with server_misconfigured before the upstream call; dry previews stay open.
  2. There was no way to prove a token the moment it arrived. pnpm oneclick:check does a dry preview; --real <near-account> asks for a deposit address once (10.5 USDC on NEAR into itself, no deposit, expires on its own).

Docs corrected: README, ARCHITECTURE §3.2, DEPLOY env table + an "Obtaining the 1Click credential" section, LAUNCH §1.

Test: route test with a fake client whose hasJwt is false — 500 server_misconfigured, zero upstream quote calls, preview still 200.

Landing note: merged via PR (issues stay open as the roadmap).

Activity

  1. MFrancis-dev commented on Nov 10, 2026

    @MFrancis-dev
    OwnerAuthor

    Landed as #160 (0bcb949), merged with all CI green and mergeStateStatus: CLEAN. This issue stays open because the credential itself is still human-only.

    What changed

    • A real quote without ONECLICK_JWT now answers 500 server_misconfigured with a sentence that names the deployment, instead of forwarding the vendor's 400 Internal server error as if the client's request were wrong. Dry previews and demo mode are untouched (two route tests pin both).
    • pnpm oneclick:check reports the state in one command and never prints the token. With a token: pnpm oneclick:check prints status, base units, fee, signature verdict and deposit-address presence for a real EXACT_OUTPUT 10.5 USDC→USDC quote; --real <near-account> validates the address and proves the address-issuing path without moving funds.

    Measured 2026-11-10 (re-check of the earlier record): a dry POST /v0/quote answers 200 unauthenticated; the non-dry quote that carries depositAddress answers 400 {"message":"Internal server error"} without a credential and 401 Invalid token with a bogus bearer; /v0/tokens answers either way.

    Still 👤: the partner portal signs in through WorkOS (email/SSO), so the key has to be copied by a person — steps are in DEPLOY.md "Obtaining the 1Click credential". After that: .env.local → pnpm oneclick:check --real <near-account> → vercel env add ONECLICK_JWT production → redeploy, and S8.4 (#72) still needs a funded signer, a two-process host and a seller payout address.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions