Skip to content

Rename the x402 mode to per-call, experimental, with apiKey optional - #6

Merged
lightchainaidev merged 3 commits into
mainfrom
per-call
Oct 10, 2026
Merged

lightchainaidev merged 3 commits into
mainfrom
per-call

Conversation

@lightchainaidev

Copy link
Copy Markdown
Contributor

Stacked on #4 and #5. Merge those first; this PR's diff then shrinks to the last commit, a52f7b2.

payment: "x402" read as standard x402, but stock x402 clients (@x402/fetch) can't pay LightChain's prepaid-debit scheme. Changes:

  • Rename: the mode is now payment: "per-call", marked @experimental in the types. The README section is "Pay per call (experimental)", with a note that it uses the x402 v2 headers but LightChain's own scheme, so standard x402 clients can't pay it. The wire format is unchanged (headers, scheme string, signatures), so no API or contract change is needed.
  • keyless is removed: in per-call mode, apiKey is optional, and a missing or empty one calls with no key. The default (delegate) mode still requires a key.
  • Old name: payment: "x402" is now refused with payment is "delegate" or "per-call". This is a breaking change for 0.1.0-alpha.0 users, so the next publish should bump the version.
  • Renamed files: scripts/acceptance-per-call.ts, the npm scripts acceptance:per-call and acceptance:per-call:fresh, the nightly job per-call and its artifact, and test/per-call.test.ts.

Checks: typecheck, 63/63 tests, and build pass. acceptance:per-call:fresh passed on testnet with no apiKey: job 1600, the concurrent call refused with a 429, and the fresh wallet swept back.

payment: "x402" read as standard x402, which stock x402 clients can't pay:
the mode is now payment: "per-call", marked experimental, and the README
says it uses x402 v2 headers with LightChain's own scheme. The keyless
option is gone: in per-call mode a missing or empty apiKey calls with no
key. The acceptance script, its npm scripts and the nightly job follow the
new name.
@lightchainaidev
lightchainaidev merged commit c9c87c7 into main Oct 10, 2026
1 check passed
@lightchainaidev
lightchainaidev deleted the per-call branch October 10, 2026 06:05
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