Repository navigation
docs(specs): correct v2 §8 discovery fields to match the wire format - #3067
Merged
phdargen merged 1 commit intoAug 31, 2026
Merged
Conversation
§8 was carried over from x402-specification-v1.md and only partly updated — x402-foundation#2094 replaced the `metadata` table row with `extensions` while syncing bazaar discovery across the SDKs, leaving the rest describing the v1 shape. Producers and consumers already agree, so nothing fails today: all six reference facilitators emit an ISO 8601 `lastUpdated` and all three SDK clients declare it a string. Only the document is outside that agreement — fed the 8.1 example, the Go client would fail to unmarshal. The live catalog matches across 2,000 sampled entries including all 12 v1-versioned items, so the example item's `x402Version: 1` does not justify the v1-shaped fields either. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
@onlyarche is attempting to deploy a commit to the Coinbase Team on Vercel. A member of the Team first needs to authorize it. |
phdargen
approved these changes
Aug 31, 2026
phdargen
left a comment
Collaborator
There was a problem hiding this comment.
Good catch, thanks for the fix @onlyarche
CarsonRoscoe
added a commit
to coinbase/x402
that referenced
this pull request
Oct 15, 2026
* examples(python): demonstrate service metadata in the bazaar server example (#2876)
Adds service_name / tags to both RouteConfigs (parity with the TypeScript
advanced bazaar example) and documents the resource-block service metadata
and its indexer caps in the README. Without these fields a discovered
service is catalogued under its raw domain with no name, tags, or icon.
* Add NEAR x402 Facilitator (facilitators table + ecosystem partner entry) (#2941)
* docs: add NEAR x402 Facilitator to the facilitators table
* site: add NEAR x402 Facilitator ecosystem partner entry
* listing: drop ecosystem-page entry (page deprecated per maintainer)
* docs: update clone URL to x402-foundation/x402 (#2949)
The repo moved from coinbase/x402 to x402-foundation/x402; the console
guide's clone command still pointed at the old location.
* fix py fmt (#2946)
* Adds bazaar indexing troubleshooting guide (#2947)
* add facilitator faq
* minor fixes
* docs: update NEAR facilitator for Base support (#2960)
* Fix silent auth drop when createAuthHeaders returns a flat object (#2957)
HTTPFacilitatorClient's `createAuthHeaders` callback must return an object
keyed by facilitator path (`verify`/`settle`/`supported`). Returning a flat
headers object silently indexed to `undefined` and dropped auth on every
request, surfacing as an unexplained 401. Throw a clear error on the wrong
shape and document the expected shape.
Fixes #2762
* feat(py): server-provided recent blockhash in the exact 402 challenge (#2937)
* align ts/go
* add py
* add changeset
* chore: version typescript packages (#2969)
* chore: version python package (#2970)
* chore(go): release (#2971)
* fix: add request timeouts to HTTPFacilitatorClient and guard eager init rejection (#2974)
* fix: add request timeouts to HTTPFacilitatorClient and guard eager init rejection
verify(), settle(), and getSupported() previously called fetch() with no
deadline, so a facilitator that accepted a connection but never completed
the response hung the operation indefinitely — and, through the eagerly
created initPromise shared by the Hono/Express/Fastify/Next middlewares,
wedged every protected route until restart.
- Add FacilitatorConfig.timeoutMs (default 30s, matching the Go and
Python facilitator clients), applied via a fresh AbortSignal.timeout()
per HTTP attempt, covering response headers and body consumption.
- Reject with a typed FacilitatorTimeoutError (a FacilitatorResponseError
subclass the middlewares already surface as 502) instead of a raw
DOMException; settle() timeouts are documented as indeterminate.
- Attach a rejection handler to the eager initPromise in all four
middlewares so an early init failure cannot become an unhandled
rejection; the first protected request still observes it and retries.
Closes #2961
* fix: surface deadline aborts from error-body reads and validate timer-safe timeoutMs
Review follow-ups on #2974:
- getSupported() swallowed a deadline abort raised while reading a non-2xx
error body, reporting it as a generic HTTP failure — which middleware
surfaces as a 500 instead of the typed 502, and which the 429 path would
even retry after the deadline had fired. Abort/timeout rejections from
response.text() are now rethrown so the FacilitatorTimeoutError
conversion applies; statusText remains the fallback for other body-read
failures.
- timeoutMs now requires a positive safe integer of at most 2^31 - 1:
AbortSignal.timeout() throws ERR_OUT_OF_RANGE on non-integers at request
time, and larger values overflow Node's 32-bit timers into an effective
~1ms deadline while reporting the configured duration.
* fix(ts/go/py): always add client buildercodes (#2994)
* fix enrichPaymentPayload
* same for go
* same for py
* fix(go/http): add Cache-Control: no-store to 402 responses (#2956)
* fix(go/http): add Cache-Control: no-store to 402 responses
* add cache-control policy for payment HTTP responses
---------
Co-authored-by: Philippe d'Argent <pdargent@icloud.com>
* fix(ts/py): add cache control, no-store for 402, private for 200 (#2990)
* fix(ts/py): add cache control, no-store for 402, private for 200
* add changeset
* fix: verify eip3009 transfer event in go (#2727)
* docs: fix DEFAULT_ASSETS.md examples and stale file references (#3024)
Three inaccuracies that mislead anyone following the add-a-default-asset
runbook verbatim.
1. The Python snippet used NetworkConfig(...)/AssetInfo(...) constructor
syntax with AssetTransferMethod.PERMIT2. AssetTransferMethod does not
exist anywhere in the Python package, so uncommenting that line raises
NameError; the real value is the literal string "permit2". Every one of
the ~30 entries in NETWORK_CONFIGS is a plain dict literal with
snake_case string keys. Rewritten to match.
2. The Go snippet used ChainID: big.NewInt(YOUR_CHAIN_ID) while every real
entry uses a named constant from the ChainID* var block, so the doc
silently omitted a required step. Now shows the constant declaration.
3. Six comments referenced DEFAULT_ASSET.md; the file is DEFAULT_ASSETS.md.
The TypeScript one also placed it in a nonexistent exact/server/
directory; it lives at the repository root.
Comment- and markdown-only: no behaviour change, so no changelog fragments
per CONTRIBUTING.md.
Co-authored-by: Claude <noreply@anthropic.com>
* feat(evm): add Celo mainnet (42220) and Celo Sepolia (11142220) default stablecoin (#3025)
Celo had no entry in the default-asset registries, so a resource server on
Celo could not write price: "$0.01" — dollar-string pricing resolves through
the per-chain default-stablecoin map and had to fall back to an explicit
TokenAmount with amountInAtomicUnits.
Registry-only change: no new logic, no new files outside changelog fragments.
Network stays an open-ended CAIP-2 string and EVM schemes register on the
wildcard eip155:*, so nothing gated Celo other than the missing map entries.
Default asset (verified on-chain via forno.celo.org and
forno.celo-sepolia.celo-testnet.org):
Celo Mainnet eip155:42220 USDC 0xcebA9300f2b948710d2653dD7B07f33A8B32118C
Celo Sepolia eip155:11142220 USDC 0x01C5C0122039549AD1493B8220cABEdD739BC44E
Both: EIP-712 domain name "USDC", version "2", 6 decimals, EIP-3009
transferWithAuthorization present (authorizationState returns cleanly). Each
domain separator was recomputed from the committed name/version/chainId/address
and byte-matched against the contract's own DOMAIN_SEPARATOR():
42220 0xb2ce31d2838445fa765a491f550e7c78ac7280ab0f3bc9d6063a86df9c3fb578
11142220 0x23f491197bb8c5ea4fe8dd4c2293b600f073553f9814015e7a5eb57724df9578
Asset selection rationale (DEFAULT_ASSETS.md section 4):
- USDC over USDT. Both are EIP-3009-capable 6-decimal tokens on Celo, but
USDT's version() reverts on-chain, so its EIP-712 version cannot be read the
way this table's contract assumes. USDT (0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e)
remains fully usable via an explicit TokenAmount.
- cUSD / USDm (0x765DE816845861e75A25fCA122bb6898B8B1282a) is not viable: Mento
StableTokenV2, 18 decimals, EIP-2612 only, authorizationState reverts. It
would force the Permit2 path.
- Alfajores is excluded — its RPC is unreachable and Circle no longer lists a
USDC there. Celo Sepolia is the live testnet.
Also adds the v1 legacy network name "celo" so that getEvmChainIdV1("celo")
resolves to 42220 instead of throwing. The production Celo facilitator
advertises {"x402Version": 1, "scheme": "exact", "network": "celo"} in its
/supported response, which no SDK could previously resolve. Mainnet only; the
v1 name space has no Celo testnet name.
Decimals are 6 on both networks, so evm/gen/decimals.ts needs no regeneration.
Co-authored-by: Claude <noreply@anthropic.com>
* Update docs/core-concepts/network-and-token-support.mdx (#3026)
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* fix(go): propagate payment response hook errors (#3022)
Returning a response after payment reconciliation fails is misleading, while dropping it without closing its body leaks resources.
* fix(ts/go/py): merge server and client builder-code s arrays (#3027)
* don't clobber client builder codes
* address review
* fixes
* scope only to builder codes
* caps on both sides
* fix go lint
* feat(evm): add Flare mainnet (14) default stablecoin (#3031)
Registers Flare mainnet (eip155:14) with USD0 as the default stablecoin across the TypeScript, Go and Python SDKs, plus the v1 legacy network maps and the support-table docs. Follows DEFAULT_ASSETS.md; no paywall regeneration needed (6 decimals).
EIP-712 domain parameters were verified by RECOMPUTATION rather than read and trusted: hashDomain({name, version: "1", chainId: 14, verifyingContract}) computed from the values as written in each of the three SDK files equals the token's on-chain DOMAIN_SEPARATOR 0x4c53d754dcb2f406ecf83695856d8c10b13296a318d9a481043412bf253d43ae.
EIP-3009 support confirmed on-chain: transferWithAuthorization with a junk signature reverts "TetherToken: invalid signature" (the function exists and validates), and authorizationState(address,bytes32) returns cleanly.
* fix(mcp): re-approve before signing corrective 402 recovery payment (#3033)
The recovery retry previously created a fresh payment payload from a
server-controlled PaymentRequired without re-running abort/approval
hooks, so a corrective 402 could escalate amount/asset/payTo unnoticed.
* fix: wildcard line terminator bypass (#3036)
* fix: match dotAll for line terminators in wildcard regex route
* chore: add changeset versions
* fix: format
* fix: format/lint
* fix: clean up narrative comments
* fix(python): verify Transfer event after exact/eip3009 settle (#3032)
* fix(python): verify Transfer event after exact/eip3009 settle
Parity with Go #2727 and open TS #2385: do not treat receipt.status alone
as proof the expected ERC-20 Transfer occurred.
* style(python): ruff format eip3009 transfer-event verify
Address maintainer review on #3032 (lint-python / formatting).
* style(python): address review on transfer-event settle comments
Shorten facilitator comment; drop TransactionReceipt field commentary
per maintainer feedback on #3032.
* fix(mcp): plumb spend policies through createx402MCPClient factory (#3034)
* fix(mcp): plumb spend policies through createx402MCPClient factory
The documented factory previously built a bare x402Client and dropped
policies/selector. Route through fromConfig so integrators can bound spend.
* docs(mcp): drop old-implementation comments in factory helper
Document current fromConfig/policies behaviour only, per #3034 review.
* Update docs/guides/mcp-server-with-x402.md (#3038)
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* fix(evm): verify Transfer event in receipt after exact/eip3009 settle (#2385)
* fix(evm): verify Transfer event in receipt after exact/eip3009 settle
settleEIP3009 currently treats receipt.status === "success" as proof of a
successful transfer. The receipt's status only tells us the tx did not revert;
it does not tell us that the expected ERC-20 Transfer was emitted from the
expected token contract with the expected (from, to, value).
The EVM batch-settlement facilitator and the Stellar exact facilitator already
perform this kind of receipt-shape check (parseEventLogs over receipt.logs,
filtered by token address, matched against the expected event arguments). This
PR brings exact/eip3009 in line with that pattern.
Behavior: a tx whose status is success but whose receipt logs do not contain a
matching ERC-20 Transfer is now reported as a settlement failure with the new
ErrTransferEventMismatch error code (wire string
invalid_exact_evm_transfer_event_mismatch) instead of being reported as a
successful settle. The happy path is unchanged.
* address review and align Transfer check with go/py
---------
Co-authored-by: Philippe d'Argent <pdargent@icloud.com>
* fix: reject external / in bazaar discovery schema (SSRF) (#3039)
* fix: reject external / in bazaar discovery schema (SSRF)
* chore: clean up spec wording
* fix: format/lint
* Update docs/extensions/bazaar.mdx (#3040)
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* chore: version typescript packages (#3041)
* chore: version python package (#3042)
* chore(go): release (#3043)
* fix: match payment-gated routes on the escaped request path (#3044)
* fix(python): match wildcard routes containing a line feed (#3055)
The compiled route regex expands `*` to `.*?`. Without re.DOTALL, `.`
does not match a line feed, so a request path whose wildcard tail contains
a decoded LF fails to match its own protected route. The route then misses,
requires_payment() returns False, and the middleware serves the protected
resource with no payment verification or settlement.
Compile the route regex with re.DOTALL so wildcard segments match any
character, including a line feed. Adds regression coverage for an LF in a
wildcard tail. Python counterpart of the TypeScript fix in #3036.
Signed-off-by: Viswanadha Pratap Kondoju <kondojuviswanadha@gmail.com>
* Specs(exact): propose Canton exact scheme for x402 (spec-only) (#2634)
* add canton scheme
* Update specs/schemes/exact/scheme_exact_canton.md
Co-authored-by: phdargen <pdargent@icloud.com>
* Update specs/schemes/exact/scheme_exact_canton.md
Co-authored-by: phdargen <pdargent@icloud.com>
* Update specs/schemes/exact/scheme_exact_canton.md
Co-authored-by: phdargen <pdargent@icloud.com>
* Update specs/schemes/exact/scheme_exact_canton.md
Co-authored-by: phdargen <pdargent@icloud.com>
* Update specs/schemes/exact/scheme_exact_canton.md
Co-authored-by: phdargen <pdargent@icloud.com>
* Update specs/schemes/exact/scheme_exact_canton.md
Co-authored-by: phdargen <pdargent@icloud.com>
* Updating scheme with all corrections discussed on June 18, 2026.
* Update specs/schemes/exact/scheme_exact_canton.md
Co-authored-by: phdargen <pdargent@icloud.com>
* Update specs/schemes/exact/scheme_exact_canton.md
Co-authored-by: phdargen <pdargent@icloud.com>
* Applying all corrections discussed on June 19, 2026
* Canton scheme v2 update using TS flow
Updated the payment scheme details to reflect changes in the transaction process, including the new allocation method and adjustments to the protocol flow.
* Scheme refactoring
* Revise exact payment scheme documentation
Updated the exact payment scheme documentation for Canton Network, clarifying the transaction process and requirements for the `TransferFactory_Transfer` and `TransferPreapproval`. Adjusted details regarding transaction execution and error handling.
* Add metadata.json for FTP Team Canton Facilitator
* Add files via upload
* Rename logo ftp.png to ftptech.png
* Delete typescript/site/public/logos/ftptech.png
* Add files via upload
* Delete typescript/site/app/ecosystem/partners-data/ftp directory
* Delete typescript/site/public/logos/ftptech.png
* Enhance memo handling and funds sufficiency description
Added memo requirement for transfer metadata and clarified funds sufficiency handling.
* Remove payer field from exact canton scheme
Removed payer field from payload and updated related explanations.
* Update specs/schemes/exact/scheme_exact_canton.md
Co-authored-by: phdargen <pdargent@icloud.com>
* Refactor payment submission and error handling
Updated the payment submission structure to include transaction and signature instead of submissionRef and preparedTxHash. Adjusted error handling and sufficiency checks accordingly.
* Removing Rule 13
Updated the payment submission process to include 'submissionRef' and 'preparedTxHash' instead of 'transaction' in the payload. Revised the validation rules for proof presence and signature verification accordingly.
* Revise scheme_exact_canton.md for clarity and details
Updated the exact payment scheme documentation for the Canton Network, clarifying the payload structure and facilitator independence.
* Specify minimum PAYMENT-SIGNATURE header size
Added requirements for minimum PAYMENT-SIGNATURE header size to support payloads.
---------
Co-authored-by: phdargen <pdargent@icloud.com>
* feat(ts): payment flow handlers (#3053)
* add payment flow handlers
* update spec
* rename to authorization
* spec fixes
* pr review
* handle charged-but-failed requests
* fix verify hooks
* improve test converage
* startup validation
* pr feedback
* harden enrichment
* pr review
* Document payment flows and settle phases (#3088)
* Update docs/advanced-concepts/lifecycle-hooks.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/schemes/overview.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
---------
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* fix(go): compile route patterns with (?s) so wildcards match line feeds (#3100)
normalizePath decodes %0A to a raw LF inside a segment, and RE2's . does
not match LF, so a wildcard route missed such a path while routers still
dispatched it to the protected handler, skipping payment verification.
Go counterpart of #3036 (TS dotAll) and #3055 (Python re.DOTALL).
* fix(evm): correct Monad USDC EIP-712 domain name to "USDC" (#3102) (#3105)
The Monad (eip155:143) USDC token at
0x754704Bc059F8C67012fEd69BC8A327a5aafb603 uses the EIP-712 domain name
"USDC" on-chain, not "USD Coin". Its DOMAIN_SEPARATOR() (selector 0x3644e515)
returns
0xfe22123edc0dd4aeb912eb7948c5f0e531592c2053b3067612f427db342c93c6, which is
reproduced by EIP712Domain name="USDC" (version "2", chainId 143, that
address) and not by "USD Coin".
The Go, Python, and TypeScript default-asset tables hardcoded "USD Coin" for
this entry, so SDK-signed transferWithAuthorization payloads carried the wrong
EIP-712 domain and failed on-chain signature recovery. Correct the domain name
in all three SDKs.
Signed-off-by: AlgoVoi <chopmob@gmail.com>
* Update docs/core-concepts/network-and-token-support.mdx (#3108)
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* label networks in prs (#3090)
* fix(ts/py): path normalization (#3073)
* fix path norm
* fix fmt
* E2e refactor (#2976)
* refactor networks
* passing tests
Co-authored-by: Cursor <cursoragent@cursor.com>
* refactor shared logic
* align mcp
* clean up
* fix next
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(svm): make facilitator transaction limits operator-configurable (#3120)
* feat(svm): make facilitator transaction limits operator-configurable
The facilitator pays the transaction fee, so the payer chooses a priority
fee the facilitator pays. The static path capped the compute unit price at
a hardcoded 5,000,000 microlamports, did not cap the compute unit limit at
all, and never checked the signature count. At the current ceiling a single
transaction can direct 1,400,000 CU x 5,000,000 uLamports = 0.007 SOL of
priority fee, ~1400x the base fee, for a payment that may be worth a
fraction of a cent.
Adds maxPriorityFeeMicroLamports, maxComputeUnits, and maxRequiredSignatures
to ExactSvmSchemeOptions, mirroring the existing smartWallet* options. All
three default to current behavior, so this is opt-in.
The signature check runs before path dispatch: it bounds the base fee
regardless of which path accepts the transaction, and must not be
recoverable through the Path 2 fallthrough.
* fix(svm): validate configurable limits at construction
NaN and Infinity reach these options easily via parseInt on an unset env
var, and each degrades differently and silently: a NaN compute-unit or
signature ceiling makes every comparison false, so the limit disappears;
a NaN priority fee makes BigInt() throw, rejecting every payment under a
misleading reason code.
Validate all three with Number.isSafeInteger and a lower bound when the
scheme is constructed, so a limit that cannot function as one fails loudly
instead of silently. maxRequiredSignatures requires >= 1 because the fee
payer alone always needs one signature.
* fix(svm): reject zero compute unit limits
* fix(ts): escape backslashes in normalizePath instead of folding them to "/" (#3116)
normalizePath rewrote every "\" to "/" after decoding, so a backslash in a
:param segment split the middleware's view of the path while the framework
router still dispatched the request to the protected handler. The :param
regex ([^/]+) missed, getRouteConfig returned undefined, and the paywall
failed open onto the paid handler with nothing settled.
Reachable two ways, because adapters differ in how much they decode before
handing the path over:
Express GET /api/report/a\b -> 200, paid handler ran (raw backslash;
req.path is the escaped path)
Hono GET /api/report/a%5Cb -> 200, paid handler ran (c.req.path is
already decodeURI'd)
#2372 closed the %2F/%5C token case by treating those two escapes as opaque,
but left the "\" -> "/" rewrite in place, so a backslash arriving in any
other form still reached it.
Decode percent-escapes one segment at a time and re-escape any separator the
decode yields, so a decoded byte can never create a segment boundary the
router did not see. This matches what the Go (#3044) and Python (#3073) SDKs
already do; neither was affected.
Adds core unit coverage for raw backslashes and end-to-end regression tests
driving real Express and Hono request pipelines.
Co-authored-by: Claude <noreply@anthropic.com>
* Update docs/schemes/exact.mdx (#3127)
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* chore(go): release (#3130)
* chore: version python package (#3129)
* chore: version typescript packages (#3128)
* fix(ts): require TransferChecked discriminator in svm exact (#3132)
* require TransferChecked discriminator
* changeset
* feat(ts): svm upto paymentflow (#3094)
* feat(svm): add usage-based upto payment scheme
* add examples
* spec fixes: settle payload, receiverAuth and withdrawdelay
* align with spec
* revert back to payload.authorizedSigner; extend toFacilitatorSvmSigner; do full sim before broadcasting open
* auto refund client when route handler fails
* make verify and settle stateless and independent
* add rent cleanup manager
* working examples
* add dynamicExtraFields
* rent cleanup must not race in-flight settle
* minor fixes
* add settlement cache
* pr review
* fix(svm): satisfy CI formatting checks
* align with payment flow
* update spec + README
* pr review
* add e2e tests
* align mcp
* reject already open
* open layout hardening
* allow lighthouse+memo
* add delete to settle cache and move upsertChannelStorage before broadcast
* enforce maxChannelLifetimSecs at deposit
---------
Co-authored-by: Ludo Galabru <ludo.galabru@solana.org>
* Document upto SVM payment scheme (#3135)
* Update docs/schemes/upto.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/schemes/upto.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/schemes/upto.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/sdk-features.md
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
---------
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* feat(go): payment flows for go sdk (#3115)
* add payment flow
* core plumbing for svm upto
* align mcp
* pr feedback 1-3
* pr feedback 4-6
* Update docs/advanced-concepts/lifecycle-hooks.mdx (#3139)
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* fix(ts): bind SIWX client challenge to the request origin (#3133)
* siwx: bind client challenges to the request origin
* removed resources origin check
* Document SIWX origin binding: required requestUrl argument (#3143)
* Update docs/extensions/sign-in-with-x.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/extensions/sign-in-with-x.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
---------
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* feat(TS): spend controls (#3124)
* add spendControls
* add svm stablecoins
* refactor svm assets
* make non-default assets optin
* pr review
* Document spendControls client safety feature (#3147)
* Update docs/getting-started/quickstart-for-buyers.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/advanced-concepts/lifecycle-hooks.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/sdk-features.md
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
---------
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* fix(evm): correct Monad USDC v1 EIP-712 domain name to "USDC" (#3153)
* fix(evm): correct Monad USDC v1 EIP-712 domain name to "USDC"
#3105 corrected the v2 default-asset tables but left the legacy v1
network tables in the Go and Python SDKs on "USD Coin". The v1 exact
client reads these tables to build the EIP-3009 signing domain, so v1
payments on Monad still fail on-chain signature recovery. TypeScript
needs no change; its v1 path resolves through the already-fixed shared
table.
* chore: changelog fragments for the v1 Monad USDC domain fix
* feat(ts): add ComputeBudget instructions to svm upto transactions (#3155)
* feat(ts): add ComputeBudget instructions to svm upto transactions
Without a SetComputeUnitLimit, the runtime derives 200k CU per non-builtin
instruction (SIMD-0170), so every upto transaction reserved 400-403k CU
while consuming 2-50k. Block and per-account cost accounting charge the
reserved amount, and priority fees are charged on the requested limit.
- Client open builder: prefix SetComputeUnitLimit (default 90k, ~2x
observed consumption) + SetComputeUnitPrice (default 1 microlamport/CU),
overridable or removable via BuildOpenArgs / UptoClientSvmConfig. The
default prefix passes verifyOpenTransaction under the default caps.
- Facilitator submitSettle (claim, cancel, cleanup close + reclaim
batches): derive the limit from a pre-broadcast simulation (2x
unitsConsumed + 25k headroom, clamped to the 1.4M per-tx max), falling
back to 400k when simulation is unavailable so a sim outage is never
riskier than the previous behavior. Attach a configurable
SetComputeUnitPrice (UptoSvmFacilitatorConfig /
UptoSvmRentCleanupManagerConfig, default 1).
* refactor(ts): size svm upto settlement compute statically instead of via simulation
Per review discussion: static limits keep the time-critical claim free of
an extra RPC round-trip, a stale-blockhash window, and a fallback code
path, while the current upto shape (single-recipient distribution,
standard SPL Token mints) makes the worst case predictable.
- submitSettle: SetComputeUnitLimit defaults to
DEFAULT_SETTLE_COMPUTE_UNIT_LIMIT (100k; measured warm-ATA claim ~21.6k
+ ~25k for a recreated recipient ATA), overridable per call and via
settleComputeUnitLimit on UptoSvmFacilitatorConfig and
UptoSvmRentCleanupManagerConfig.
- Reclaim batches size per channel: 25k + 5k x batch (measured ~320
CU/reclaim, mint-independent), clamped to the per-tx max.
- Defaults assume standard SPL Token behavior; compute-heavy Token-2022
extension mints (e.g. transfer hooks) need explicit overrides — same
assumption documented on the client open default.
* docs(migration): use real Solana genesis-hash CAIP-2 ids (#3179)
The v1-to-v2 network mapping table listed `solana:devnet` and
`solana:mainnet`. Neither is a valid CAIP-2 identifier: the solana
namespace uses the first 32 characters of the base58 genesis hash, and
normalizeNetwork() in typescript/packages/mechanisms/svm/src/constants.ts
throws "Unsupported SVM network" for anything outside the supported set.
Replace them with the values V1_TO_V2_NETWORK_MAP actually holds
(constants.ts:53-54), which the Go and Python SDKs and the e2e config
also use, and which every other docs page already documents.
* fix(ts): handle missing accepted requirements (#3180)
* feat(svm): allow injecting an RPC client into the upto facilitator (#3183)
UptoSvmFacilitatorConfig.rpc (and the rent cleanup manager's config) now
accept a pre-built RPC client, preferred over constructing one from
rpcUrl. Lets a facilitator route channel claim/cleanup sends through its
own paced/instrumented transport instead of an unmanaged raw client.
* feat: add solana upto to go sdk (+ typescript parity fixes) (#3141)
* feat: add solana upto core work to go sdk
* feat: added client implementation
* feat: added server implementation
* feat: added facilitator implementation
* feat: added integration tests
* feat: update .mds
* feat: add client examples
* feat: add server examples
* feat: add facilitator example
* feat: add e2e integration
* feat: add changeset fragments
* fix: add typescript bug fixes
* feat: AI PR review
Correctness:
- ResolveTokenProgram no longer routes a registry lookup through
MustPublicKeyFromBase58, and GetStablecoinTokenProgram honors its documented
SPL Token default when a symbol is registered without a program. Same in TS,
where the gap surfaced as undefined.
- The TS upto client validates extra.tokenProgram through the shared parser the
facilitator already uses, so a broken challenge fails naming the field rather
than after a round trip. Go already did this.
- A reclaim batch that fails to broadcast reports every channel in it through
onError, not just the first. Both SDKs.
- Cleanup returns on a canceled context instead of walking the remaining records
over a dead connection during Stop.
Clean-up:
- Collapse VerifiedOpenChannel onto the channel keys it duplicated, drop the six
fields nothing read, and project settlement inputs through a method instead of
respelling the key set at each call site.
- Rename SettlementSimChannel to settlementChannel: it builds the real claim too.
- Unexport the facilitator plumbing types; nothing outside the package uses them.
- Name the ComputeBudget instruction discriminators and the remaining channel
account offsets, and correct the offsets' rationale.
- Delete Channel.DerivePDA and ErrReceiverAuthorizerMissing, both unused.
Tests:
- Canceled cleanup pass, failed reclaim batch reporting, incomplete-registry
token program fallback, a second payment-channels open smuggled after the
canonical one, and the TS client rejecting an unsupported tokenProgram.
- The integration rent-cleanup case now asserts the deferral it actually checks
and is named for it.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: retry temporarily missing SVM upto channels
RPC providers can report an open transaction as confirmed before the same
channel account is visible from the replica serving account reads. Retry only
missing confirmed accounts with bounded backoff in Go and TypeScript while
keeping existing invalid state terminal.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: fail SVM upto deposit settle before broadcast on storage failure
An open transaction broadcast without a durable channel index can never be
found by rent cleanup, permanently stranding the facilitator's rent. Persist
the pre-broadcast index and fail closed (dedup key released, nothing
broadcast) when it cannot be written, in both the Go and TypeScript SDKs.
Post-confirmation bookkeeping on the claim path remains fail-open.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: budget SVM upto rent cleanup reclaims per signer, add resumable scan
Reclaim transactions were budgeted from one MaxTxsPerRun pool shared across
every rent-payer group, so adding managed signer keys split a fixed budget
instead of adding throughput. Give each group its own budget. Also remember
where a budget-limited scan stopped and resume there next pass, so a backlog
bigger than the budget cannot permanently starve records ordered later in
storage.List/list().
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat: add spec §6 onchain discovery for SVM upto rent cleanup
Add DiscoverChannelsByRentPayer / discoverChannelsByRentPayer: a
getProgramAccounts sweep by rent_payer, independently validated against
account owner, discriminator, and rederived channel PDA rather than trusting
the RPC provider's filter. This recovers Distributed channels missing from
offchain storage. Add matching TypeScript unit tests (previously untested)
and bring its owner check to parity with the Go implementation.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* test: add golden serialization gate for SVM upto reclaim batch size
Build the exact instruction set submitReclaimGroup submits (N
BuildReclaimInstruction calls sharing one rent-payer fee payer) and assert
the serialized transaction stays under Solana's PACKET_DATA_SIZE, deriving
the largest safe batch size from the measured per-reclaim byte cost. This
gates raising MaxReclaimsPerTx in facilitator configs: 16 reclaims serialize
to 776 bytes, well under the 1232 byte limit, with room up to ~28.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: update svm test import after rebase onto upstream stablecoin registry
USDC_DEVNET_ADDRESS/USDC_MAINNET_ADDRESS moved from constants.ts to
defaultAssets.ts on upstream main. Vitest doesn't type-check, so the stale
import silently resolved to undefined and getChannelDistributionHash hashed
an undefined recipient instead of failing at compile time.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore: consolidate SVM upto changelog fragments
Six Go changelog entries and five TypeScript changesets had accumulated
across the branch's individual fix commits, all describing hardening to a
scheme that has not shipped in either SDK yet. Drop them: Go keeps the two
original entries (the upto scheme itself, and the stablecoin registry, which
is not upto-specific). TypeScript's upto is still unreleased, so the existing
svm-upto-scheme.md changeset already covers it and needs no addition.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: wire findDefaultAsset into the SVM upto client scheme
Client spend controls decide whether an asset is a recognized default
by calling scheme.findDefaultAsset(). Every other client scheme (SVM
exact, EVM exact/upto/batch-settlement) wires this in; the SVM upto
client scheme never did, so spend controls rejected canonical
devnet/mainnet USDC as a non-default asset unless callers explicitly
configured allowedAssets.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: move SVM upto ComputeBudget overrides onto shared ClientSvmConfig
Removes UptoClientSvmConfig / UptoClientConfig (TS/Go), a scheme-specific
intersection type introduced alongside the upto ComputeBudget work, in favor
of extending the shared ClientSvmConfig / ClientConfig that every SVM client
scheme already takes. exact's client now honors the same
computeUnitLimit / computeUnitPriceMicroLamports overrides instead of always
using the scheme's hardcoded defaults, matching upto's client. Both are still
unreleased on this branch, so this is a pre-release API consolidation, not a
breaking change.
Also updates the svm-upto-compute-budget changeset to describe the
consolidated config surface.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: drop unused assertLimit min parameter to satisfy unparam lint
Every call site passed 1 for min (unsigned config fields already make 0 the
only unusable floor for the fields that need no check), so unparam correctly
flagged it as dead. Renamed to assertPositive with the floor hardcoded.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(svm): split upto rent discovery from cleanup and inject RPC clients
Address review feedback on the upto rent cleanup manager in both SDKs, and
bring Go to parity with the TypeScript RPC injection from #3183.
The getProgramAccounts recovery sweep no longer rides the short cleanup
interval: it is a public discover() on its own interval that writes the
Distributed channels it finds into storage for cleanup to reclaim. stop() now
waits for the in-flight pass instead of leaving a broadcast settle orphaned.
maxTxsPerRun only bounds the storage scan; per-rent-payer reclaim moves to
maxTxsPerSigner so a reclaim backlog cannot starve the scan. The scan sorts by
channel id before applying its resume cursor, since storage.list promises no
order.
The client compute-unit overrides are gone: 0 meant "omit" on upto and "use
zero" on exact, which is not a coherent shared config, and no caller needed
them. An empty extra.memo is now unset rather than a required empty memo.
Go gains RPC *rpc.Client on the facilitator Config and RentCleanupConfig,
preferred over building one from the URL, so operators can route sends through
their own instrumented transport.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: harden SVM upto facilitator and rent cleanup after audit review
Address must-fix and should-fix findings from a Go/TypeScript parity audit:
clamp reclaim batch size to a serialization-proven ceiling, reject malformed
tokenProgram/amount inputs instead of silently mishandling or throwing, drop
dead code, DRY up a duplicated constant, and distinguish a settlement
confirmation timeout from a definite onchain rejection so a retry cannot
race a transaction that may still land.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: gofmt struct literal alignment in upto SVM client scheme
BuildOpenArgs field values were over-aligned (stale spacing from a
previously longer field name), which check-format-go's `make fmt` +
git-diff check flags as unformatted even though a bare `go fmt` run
against gofmt's cached/previous output looked clean locally.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add settlement pending state (#3083)
* implement settlement_pending
* add upto support across sdks
* fixes
* fixes
* update supporting documentation
* cleanup
* fixes
* add batch_settlement support
* fixes
* fixes
* fix batch erc20 deposit and export python error
* fixes
* more fixes
* cleanup
* fix lint
* fixes
* fix failing lint
* more fixes
* update to optional so changes are backwards-compatible
* restore old error
* revert starknet changes
* fix: treat post-broadcast receipt-processing errors as settlement_pending
* feat: pr review
* fix: pr review
* refactor: move EVM receipt-wait timeout from scheme config to signer
Per review feedback, configuring confirmationTimeoutMs on every scheme
config was inconsistent with the other SDKs: Python bounds the wait on
FacilitatorWeb3Signer and Go bounds it via the settle ctx.
toFacilitatorEvmSigner now accepts { confirmationTimeoutMs } (default
180_000, matching viem's own) and wraps waitForTransactionReceipt so the
returned signer applies the bound to every receipt wait. An explicit
per-call timeout still wins.
This reverts the confirmationTimeoutMs threading from EvmFacilitatorConfig,
ExactEvmSchemeConfig, EIP3009FacilitatorConfig, Permit2FacilitatorConfig,
UptoPermit2FacilitatorConfig (and UptoEvmScheme's constructor),
BatchSettlementEvmSchemeConfig, ExactEvmSchemeV1Config, the ten private
handler signatures, shared/settleReceipt.ts, and the mirrored
Erc20ApprovalGasSponsoringSigner interface in @x402/extensions.
Every receipt wait in @x402/evm goes through a FacilitatorEvmSigner -- the
shared settle helper, v1's two waits, and the ERC-6492 deploy waits in
eip3009.ts and deposit.ts -- so all of them inherit the bound with no
per-call-site threading. The ERC-20-approval extension path waits on the
extension's own signer, which the config approach never reached.
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: trim receipt-timeout surface to what is used
Drop the speculative API added alongside the signer bound:
- unexport DEFAULT_CONFIRMATION_TIMEOUT_MS and FacilitatorEvmSignerOptions
and remove them from the barrel; nothing consumed either. The constant is
now module-private, matching _DEFAULT_TX_GAS_LIMIT in the Python signer,
and the options shape is inlined on the parameter.
- drop the per-call timeout override. No caller passes one, so
`args.timeout ?? bound` was an untaken branch; the signer owns the bound
outright.
- drop the settleReceipt test for a signer-configured bound expiring. It
asserted the same thing as the existing receipt-wait-failure test.
Also trim narration: the four-line README bullet, the three-paragraph
option docs, and the Python constant/docstring comments.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: register scheme server in settlement-pending mechanism-error test
Upstream main's GetPaymentFlow now requires a registered scheme server
to resolve a payment flow; add the missing WithSchemeServer option so
TestProcessSettlement_MechanismErrorPreservesReasonAndTransaction
matches its sibling tests after rebasing onto main.
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: pr review
* fix: format/lint
* fix: drop stale terminal-settle-failure test reintroduced during main rebase
The rebase onto x402-foundation/main resurrected a test removed in an earlier
PR review pass (transaction-hash stripping moved out of core's resource
server). Re-delete it so core stays aligned with that decision.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Ethan Oroshiba <ethan.oroshiba@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* Go SDK now supports upto SVM scheme (#3190)
* Update docs/sdk-features.md
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/schemes/upto.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/getting-started/quickstart-for-sellers.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
---------
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* Update docs/core-concepts/facilitator.md (#3191)
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* feat(py): add spend controls (#3154)
* add spend controls
* align mcp
* review feedback
* add test
* unify money coversion
* add guard
* rebase
* Update docs/getting-started/quickstart-for-buyers.mdx (#3195)
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* feat(go): spend controls (#3156)
* spend controls go
* Address review: share EVM money conversion and document MCP spend-control options.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Apply MCP spend-control Options in NewX402MCPClient as well as FromConfig.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Remove unused ExactEvmScheme.ConvertToTokenAmount that collided with the package helper.
Co-authored-by: Cursor <cursoragent@cursor.com>
* clean up dead code
* revert duplicated mcp wrapper options
* unify money parser
* add guard
* rebase
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Document Go spend controls support (#3196)
* Update docs/sdk-features.md
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/getting-started/quickstart-for-buyers.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
---------
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* py port (#3192)
* go port (#3193)
* Update Go SDK feature parity for onPaymentRequired hook (#3198)
* Update docs/sdk-features.md
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/sdk-features.md
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
---------
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* chore: version typescript packages (#3200)
* chore: version python package (#3202)
* chore(go): release (#3201)
* bump gh-action-pypi-publish (#3204)
* docs: add fireblocks facilitator (#3194)
* docs(svm): add `batch-settlement` SVM scheme specification (#2698)
* docs(svm): add `batch-settlement` SVM scheme specification
SVM profile of the network-agnostic `batch-settlement` scheme: high-throughput
channel payments where a client deposits once, signs cumulative Ed25519 vouchers
verified off-chain, and the operator redeems the latest voucher per channel
on-chain in batches. The multi-voucher generalization of `upto`.
* docs(svm/batch): cascade upto role-model + cleanups to batch-settlement
Mirrors the upto spec revision, adapted for batch's client-signed cumulative
vouchers:
- Role model: the operator is the channel `payee` (the program requires the
`settle_and_finalize` merchant == `channel.payee`), as well as fee payer and
`rentPayer`; `authorizedSigner` stays the payer (client signs vouchers). `payTo`
is realized as the payee (self-facilitating, `operator == payTo`) or a
`distributionSplits` entry (separate facilitator). Added the self-facilitating
reference-status note and set `payee = operator` / `rentPayer = operator` at open.
- Cleanups (match upto): dropped the `pay-kit`-controlled / `CHNLxY` program-id /
"program we control" references.
- Clarified that `expiresAt` is a genuine *client* commitment here (the client
signs each voucher), unlike upto's operator-attested field.
Deliberately NOT cascaded: `deposit == maxAmount` — batch's deposit is a
multi-request escrow, so the ceiling is `cumulativeAmount ≤ deposit`, not equality.
* docs(svm/batch): address review feedback (security, conformance, clarity)
Resolves @notorious-d-e-v's review on PR #2698 (verified against the
payment-channels program where relevant):
- Voucher replay (#8): the cumulativeAmount is the per-request nonce — a new
request needs a strict increment (watermark + amount); an equal voucher is only
an idempotent retry that replays the response cached at that cumulative, never a
fresh serve.
- Async expiry (#9): expires_at is re-checked on-chain at settle (not just
settleAndFinalize), so vouchers must use expiresAt == 0 or a TTL outlasting the
redemption window (grace + buffer).
- Fee-payer guard (#7): validate the full compiled open tx (ALT resolution,
allowed-instruction-set only, fee payer never an authority/source/writable
except fees), per the exact SVM scheme.
- State ownership (#3): the watermark/ChannelStore is the resource server's state;
a separate facilitator stays stateless.
- Response shape (#6): nest chargedAmount/channelState under extra, amount
optional (core SettleResponse + EVM batch companion).
- asset is the concrete mint, not a symbol (#5); dropped SDK function names (#1);
added a grace buffer SHOULD (#2); genericized the per-tx settle cap (#10).
* docs(svm): align batch-settlement spec with channels
* docs(svm): align batch settlement wire contract
* docs(svm): refine batch settlement lifecycle
* docs(svm): add batch refund authorization
* docs(svm): define batch refund fallback
Make payer-signed request_close the portable refund path, with facilitator-funded initiation and asynchronous finalization after a bounded grace period. Keep authenticated cooperative close as an optional fast path and align setup validation with the current SVM upto profile.
Co-authored-by: Ludo Galabru <ludo.galabru@solana.org>
Signed-off-by: Ludo Galabru <ludo.galabru@solana.org>
* docs(svm): drop block height hint
Co-authored-by: Ludo Galabru <ludo.galabru@solana.org>
Signed-off-by: Ludo Galabru <ludo.galabru@solana.org>
* docs(svm): batch-settlement review follow-ups
- switch the scheme to the protocol-default authorization payment flow:
read-only verify before the handler, voucher commit and deposit
broadcast in the post-handler settle
- clarify that the 900-2592000 withdrawDelay range is an x402
conformance bound enforced by facilitators, not a program constraint
- quantify the voucher-expiry settlement buffer via an advertised
extra.settlementBufferSeconds (default 60) so clients can compute a
passing expiresAt from the 402 alone
- require clients to verify the corrective 402 voucherState signature
before adopting chargedCumulativeAmount
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs(svm): add settlement-buffer error code
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs(svm): make non-expiring vouchers normative
Voucher expiry added a second clock the server had to beat on top of the
forced-close grace period, and a nonzero expiresAt could make an accepted
voucher unredeemable while the channel was still open. The client MUST now
sign expiresAt = 0, the server and facilitator MUST reject nonzero values,
and extra.settlementBufferSeconds is dropped along with the expiry-window
bound.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Signed-off-by: Ludo Galabru <ludo.galabru@solana.org>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* Update docs/schemes/batch-settlement.mdx (#3222)
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* docs(specs): refresh the contributing guide and impl template (#3235)
The chain-implementation template still asks for an `X-Payment` header
payload, which is v1. A contributor following it today writes a spec against a
header the v2 transport does not use; the real names are `PAYMENT-REQUIRED`
and `PAYMENT-SIGNATURE` (specs/transports-v2/http.md).
specs/CONTRIBUTING.md has drifted the same way: its directory diagram points at
x402-specification.md and transports/, neither of which exists, and it lists
`exact` as the only scheme when upto, auth-capture and batch-settlement have
since merged. The extensions/ directory is missing from the diagram entirely.
Docs only; no normative change.
* feat(evm): add Sei default stablecoins (#3227)
Enable dollar-string pricing and paywall faucet support on Sei mainnet and testnet across all SDKs.
* docs(ts): align contributor prerequisites with workspace (#3254)
* fix(mcp-ts): handle facilitator failure before resource delivery (#3246)
* fix(mcp-ts): handle facilitator failure before resource delivery
* add changeset
* fix(ts/go/py): Validate batch settlement response (#3251)
* batch-settlement response validation
* harden checks
* add go/py patches
* feat(py): payment flow (#3247)
* feat(py): payment flow
* add missing files
* pr feedback
* Python payment flow handlers: phase examples & MCP hook parity (#3255)
* Update docs/advanced-concepts/lifecycle-hooks.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/sdk-features.md
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
---------
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* fix(svm): validate smart wallet limits (#3122)
* fix(go/py): align default asset declaration with ts (#3241)
* fix(go/py): align default asset declaration with ts
* restore network config
* fix(go/py/ts): restore ethereum/avalanche defaults and SVM network checks
Put USDC back on eip155:1 and eip155:43114 in the shared default-asset tables, and reject unsupported Solana networks in EnhancePaymentRequirements when an explicit asset is set.
Co-authored-by: Cursor <cursoragent@cursor.com>
* test: drop tautological ethereum/avalanche default-asset lookups
Table round-trips do not cover behavior; parse_price and SVM network rejection tests remain.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Update docs/core-concepts/network-and-token-support.mdx (#3257)
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* feat: settlement pending auto-recovery (#3214)
* feat(ts): implement settlement-pending behavior in facilitator
* feat(ts): implement settlement-pending behavior in server
* feat(ts): add tests
* feat(go): implement settlement-pending behavior in facilitator
* feat(go): implement settlement-pending behavior in server
* feat(go): add tests
* feat(py): implement settlement-pending behavior in facilitator
* feat(py): implement settlement-pending behavior in server
* feat(py): add tests
* feat: pr cleanup
* feat: more pr cleanup
* fix: address pr review feedback
* fix: py format
* chore: sync e2e Python lockfiles to x402 2.20.0
Update editable x402 version metadata in e2e uv.lock files after the
python package bump on this branch.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: address settlement-pending PR review feedback
Distinguish terminal onchain confirmation failures from confirm-timeouts
(TransactionOnchainFailureError) across SVM exact/upto settle paths so only
timeouts stay settlement_pending; terminal failures now clear both caches
and return transaction_failed. Run verifyPostSettlement during smart-wallet
pending-settlement reconciliation to keep TOCTOU coverage on retries. Key
upto deposit pending-settlement entries by transaction message hash (like
exact) instead of channelId alone. Fall back to an optimistic channelState
snapshot in batch-settlement deposit reconciliation when the post-confirm
read fails, per spec.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Update docs/core-concepts/facilitator.md (#3259)
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* Auth-capture spec update: v1.1 (#3197)
* update auth-capture spec
* sync vs async
* improve backward compat
* spec review 2
* refinements
* clarify facilitator captureAuthorizer
* feat(ts/go): upfront paymentflow for exact mechanism (#3240)
* update spec
* add upfront to evm/svm
* add other networks
* add go
* add upfront to py
* Document upfront payment flow for exact scheme (#3267)
* Update docs/schemes/overview.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/schemes/exact.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/schemes/exact.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
---------
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* feat(Ts/Go): avoid fee-payer signing svm exact /verify + Go smart wallet support (#3263)
* verify without feePayer signature
* wire into e2e
* fix e2e
* align error codes
* pr feedback
* Update docs/schemes/exact.mdx (#3272)
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* feat(evm): add Upto-only deployment entrypoint (#3199)
* feat(evm): add Upto-only deployment entrypoint
* docs(evm): clarify deployment signer naming
* fix: upto proxy canonical address (#3276)
* fix(evm): restore x402UptoPermit2Proxy canonical deployment address
* fix: upto init code used in vanity miner
* fix(ts/go): refactor svm upto rpc config (#3274)
* fix slot sync
* align go
* pr feedback
* Fix SVM upto facilitator RPC configuration examples (#3277)
* Update docs/schemes/upto.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/schemes/upto.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
---------
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* feat(ts/go): auth-capture client v1.1 (#3283)
* feat(ts/go): auth-capture client v1.1
* change to main v1.1
* fix tests
* chore: version typescript packages (#3287)
* chore: version python package (#3288)
* chore(go): release (#3289)
* Update docs/sdk-features.md (#3286)
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* disable spend controls in stellar integration test (#3290)
* fix(e2e): scope EVM/SVM client signer derivation to selected families (#3228)
createE2EClient() derived EVM and SVM signers unconditionally at the
top of the function, ahead of any --families scoping, while every
other family below it (Aptos, Hedera, Keeta, Stellar, AVM, TVM, Near,
XRPL) already only derives when its own CLIENT_* credential is set.
A single-family run against a non-EVM/SVM network crashed here
regardless of --families, unless unrelated EVM/SVM credentials
happened to be set too.
Made EVM and SVM signer derivation conditional on their own
CLIENT_EVM_PRIVATE_KEY/CLIENT_SVM_PRIVATE_KEY, matching the pattern
every other family already follows. batchSettlementScheme (EVM-only)
is now BatchSettlementEvmScheme | undefined; runClientScenario throws
a clear config error if EVM_BATCH_SETTLEMENT_PHASE is set without EVM
creds, instead of a bare "Cannot read properties of undefined" once
the refund path is actually reached.
Second, separate gap: the harness's own preflight validation only
ever checked facilitator env vars (uniqueFacilitators), printing
"All required environment variables are present" without having
looked at client env at all. A family-scoped run could pass that
check cleanly and still crash deep inside a client for exactly this
reason. Extended the same validation loop to also cover uniqueClients
against each client's own catalog-declared config.environment.required.
Verified with real code run, not just reasoning: built the full
typescript workspace and called the actual createE2EClient() under
five scenarios (no client creds, EVM-only, SVM-only using a real
generated Ed25519 keypair, both, and the batch-settlement-without-EVM
guard), all passing, including the exact reported crash scenario.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* fix(go): use maxTimeoutSeconds for EIP-3009 validBefore (#3282)
* fix(go): use maxTimeoutSeconds for EIP-3009 validBefore
* update changelog
* feat(python): make facilitator gas limit configurable (#3233)
* feat(python): make facilitator gas limit configurable
Facilitators need an explicit gas cap that can accommodate different settlement calls without modifying SDK internals.
* chore(python): name changelog fragment for PR #3233
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: ni <243717149+nniiovoo@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* docs(specs): correct v2 §8 discovery fields to match the wire format (#3067)
§8 was carried over from x402-specification-v1.md and only partly
updated — #2094 replaced the `metadata` table row with `extensions`
while syncing bazaar discovery across the SDKs, leaving the rest
describing the v1 shape.
Producers and consumers already agree, so nothing fails today: all six
reference facilitators emit an ISO 8601 `lastUpdated` and all three SDK
clients declare it a string. Only the document is outside that
agreement — fed the 8.1 example, the Go client would fail to unmarshal.
The live catalog matches across 2,000 sampled entries including all 12
v1-versioned items, so the example item's `x402Version: 1` does not
justify the v1-shaped fields either.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(go): prevent settlement override percent overflow (#2962)
* e2e: add script to check wallet balances (#3297)
* e2e: check wallet funds
* fix near
* Fix e2e warnings (#3308)
* fix(e2e): startup validation
* fix scenario selection
* add changeset
* fix: improve facilitator evm latency (#3312)
* fix(py): add server-only extension_responses sidechannel (#3306)
* validate builder-code app attribution on (#3313)
* fix #3019 (#3309)
* Document builder-code `a` field validation and v1 behavior (#3315)
* Update docs/extensions/builder-code.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/extensions/builder-code.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
---------
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* Update withX402 docs for keyed route patterns (#3316)
* Update docs/getting-started/quickstart-for-sellers.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
* Update docs/extensions/bazaar.mdx
Generated-By: mintlify-agent
Mintlify-Source: dashboard-editor
---------
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* fix(core): server-only extensionResponses sidechannel (#3278)
Align TypeScript HTTPFacilitatorClient with Python #3306: decode
EXTENSION-RESPONSES into VerifyResponse/SettleResponse.extensionResponses
(server-internal) instead of merging into extensions. encodePaymentResponseHeader
strips extensionResponses so it never leaks to buyers via PAYMENT-RESPONSE.
Fixes #3270.
Majority of this change was drafted by an AI agent under human direction
and is intended for human review before merge (CONTRIBUTING AI-assisted).
* fix(e2e): svm smart wallet config (#3319)
* fix(core): throw when no scheme server is registered (#3051)
* fix(core): throw when no scheme server is registered
buildPaymentRequirements() logged a console.warn and resolved with an
empty array when no scheme server matched the requested scheme/network,
so callers relying on a thrown error built a 402 response with an empty
accepts list instead of failing. It now throws, matching the adjacent
guard for an unsupported facilitator scheme/network.
Closes #2760
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(http): register scheme servers in routing tests
The throw added in the previous commit surfaced as a 500 in the express,
fastify, hono and next routing tests. Each built an x402ResourceServer
without registering a scheme server and relied on the former empty
accepts array to still reach a 402.
Register the exact scheme and a stub facilitator in those tests so they
assert a real 402 rather than an under-configured server, and raise the
changeset for @x402/core from patch to major: a call that previously
resolved with an empty array now rejects, which is breaking for callers.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Update typescript/.changeset/resource-server-throw-on-unregistered-scheme.md
Co-authored-by: phdargen <pdargent@icloud.com>
* test(http): register payment flows in middleware test scheme servers
Upstream main added construct-time route validation
(x402HTTPResourceServer.validateRouteConfiguration) that requires every
registered scheme server to declare defaultAssetTransferMethod and a
paymentFlows table. The middleware test stubs only implemented
parsePrice/enhancePaymentRequirements, so after merging main the
constructor threw and 21 tests across express, fastify, hono and next
failed.
Also registers the exact scheme in the express and hono
encodedPathBypass tests, which still relied on the lenient
no-scheme-registered path that this PR removes from core.
* chore: trigger CI after signing key update
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: phdargen <pdargent@icloud.com>
* docs(ts/mcp): update README for current API and payment shapes (#3089)
* docs(ts/mcp): update README to reflect current API and payment flow
- Rename createX402MCPClient to createx402MCPClient
- Update MCP SDK limitation section for structuredContent format
- Update PaymentWrapperConfig to new accepts-based schema
- Remove X402MCPServerConfig table and server hooks section
Co-Authored-By: CatDesk
* docs(ts/mcp): add supported PaymentRequired shapes table
Co-Authored-By: CatDesk
* fix(e2e): HTTP-only swig-setup RPC with devnet fallback (#3327)
* fix(e2e): fall back to devnet RPC when SVM_TESTNET_RPC_URL is unset
CI exported an empty SVM_RPC_URL when the secret was missing, which made
swig-setup construct a WebSocket with an invalid URL. Treat blank RPC env
as unset …
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.
Description
§8 Discovery still describes the v1 response. #2094 synced part of the 8.3 table to the SDKs (
metadatarow →extensions) but left the rest as it was copied fromx402-specification-v1.md.lastUpdatedis anumber(Unix timestamp)string, ISO 8601metadataobjectextensionsx402Version: 1, but itsacceptsuses the v2amountfield and a CAIP-2 network2One table row and three lines of the example. Spec-only.
Evidence
e2e/facilitators/*andexamples/*/facilitator/advanced/*writelastUpdatedas ISO 8601 (toISOString()/RFC3339/isoformat()). None emits a Unix timestamp; none branches on item version.facilitatorClient.ts:108,facilitator_client.go:82,facilitator_client.py:90). Producers and consumers therefore agree with each other and only the document sits outside that agreement, which is why nothing fails in practice. Fed the 8.1 example the wayfacilitator_client.go:228reads a response, Go would fail:cannot unmarshal number into Go struct field DiscoveryResource.items.lastUpdated of type string. TypeScript and Python would accept it silently and carry a value whose runtime type contradicts the declaration.lastUpdateda string 2000/2000,metadata0/2000, and 0 items combiningx402Version: 1withaccepts.amount. The 12 v1-versioned items all carry an ISOlastUpdatedand usemaxAmountRequired— so "it's a v1 item, v1 shapes are correct for it" does not explain any of the three defects.Nothing is broken today; the cost falls on the next person who implements §8.3 as written — and on #2776, which would turn the spec into executable conformance vectors.
For
lastUpdatedthis ratifies shipped behavior rather than correcting a typo — please redirect me if the Foundation intends the spec to lead here.Out of scope
description/mimeType/serviceName/tags/iconUrlare modelled on the discovery item by all three SDKs, but the spec defines them onResourceInfo(:132-139), theresourceobject of a 402 response, while a discovery item'sresourceis a plain string (:572). Nothing describes lifting them across. That is a normative addition rather than a correction — separate issue to follow.x402-specification-v1.mdis unchanged, and 8.1'soffsetparameter is correct as written.Tests
Docs-only. The 8.1 example parses with
json.loadsand its field set matches the 8.3 table. The Go and Python round-trips above were run against the SDK type declarations, with a real catalog page as control.Checklist
CONTRIBUTING.md;specs/is outside the release toolingDrafted with Claude Code; claims verified against the cited files, this repo's Go and Python clients, and the live catalog before submission.