Repository navigation
Rename the x402 mode to per-call, experimental, with apiKey optional - #6
Merged
Merged
Conversation
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.
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.
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'sprepaid-debitscheme. Changes:payment: "per-call", marked@experimentalin 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.keylessis removed: in per-call mode,apiKeyis optional, and a missing or empty one calls with no key. The default (delegate) mode still requires a key.payment: "x402"is now refused withpayment 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.scripts/acceptance-per-call.ts, the npm scriptsacceptance:per-callandacceptance:per-call:fresh, the nightly jobper-calland its artifact, andtest/per-call.test.ts.Checks: typecheck, 63/63 tests, and build pass.
acceptance:per-call:freshpassed on testnet with noapiKey: job 1600, the concurrent call refused with a 429, and the fresh wallet swept back.