The committed @x402/paywall bundle on main was last generated against an
older viem than the lockfile currently pins. pnpm install --frozen-lockfile
resolves viem 2.47.12 (via #2013), but the bundled src/evm/gen/template.ts
(and its Python + Go siblings) were built against an earlier resolution
that pre-dated chain definitions for Mezo, MegaETH, Stable, Radius (each
with a testnet variant), and 33 others. EvmPaywall.tsx throws
"Unsupported chain ID" at init for any eip155:<id> whose chain isn't in
the bundled viem/chains.
This PR:
1. Regenerates all nine auto-generated template files (TypeScript,
Python, and Go for EVM/SVM/AVM) against the current lockfile. No
source changes on any runtime path.
2. Teaches build:paywall to emit output matching the repo's formatters
(prettier / ruff), so generated files stay clean under pnpm run
format + uvx ruff format.
3. Adds a PR-time drift check
(.github/workflows/check_paywall_template.yml) so a future lockfile
or @x402/evm change that invalidates the bundle fails loudly
instead of shipping silently.
Scope is limited to @x402/paywall because it is the only package in this
repo that bakes viem chain definitions into a built artifact.
Verified on a fork-internal test PR running on ubuntu-latest
(Node 24, pnpm 10.7.0): check_format, check_lint, check_go, check_python,
check_package_lock, and the new check_paywall_template drift check all
pass. Additional local evidence:
- Chain-presence in regenerated bundle: Mezo 31612/31611, MegaETH
4326/6343, Stable 988/2201, Radius 723487/72344, Base/Arbitrum/
Polygon all present (mainnet/testnet ordering).
- Cross-platform determinism: a clean-slate rebuild on macOS produces
byte-identical output to ubuntu-latest CI.
- Tarball install into a throwaway consumer: all expected chain IDs
present in the published dist/esm/evm/index.js.
- Browser smoke test (Chrome, served from a local HTTP server):
EvmPaywall mounts without Unsupported-chain throw for
eip155:31611 (Mezo Testnet) and eip155:723487 (Radius); DOM
renders the expected token/chain labels.
Fixes#1971.
* Migrate all code from branch-algorand-v2-typescript-algokit
* Update format and lint pass on core and examples
* Reformat template files
* Update: Coinbase review changes applied
* Fix Paywall builder pattern
* Update: Reverted e2e/legacy, Remove: src/exact/v1 and src/v1
* Add Faucets URLs to AVM README
* Optimizing and shrinking PR
* Remove dead import
* Add optimization changes related unit tests
* Update coinbase review changes applied
* Update avm e2e, rebased to latest, linted and formatted
* Fix avm template format
* Remove python and Go AVM templates, Made AVM optional to facilitator and Add SERVER_ADDRESS
* Lint and format
* Update: made AVM optional in proxy.ts
* Rebased and Replayed some commits
* Reset e2e pnpm-lock.yaml
* Replayed correct updated lockfiles
* Reverted accidentally overwritten files during rebase replay
* Revert accidental overwritten files in examples
* Add Fastify framework adapter for x402 payment middleware
* fix(fastify): preserve settlement response bytes and resource URLs
* chore(fastify): regenerate lockfiles for @x402/fastify workspace package
The pnpm-lock.yaml files in typescript/ and examples/typescript/ were missing
entries for the @x402/fastify package, causing CI to fail with
ERR_PNPM_OUTDATED_LOCKFILE on every workflow.
* feat(fastify): add e2e test server
Adds a Fastify server to the e2e test suite, following the same pattern as
Express and Hono. The test framework auto-discovers it via test.config.json.
Includes all standard endpoints: /protected (EVM), /protected-svm, /protected-aptos,
/protected-permit2, /protected-permit2-erc20, /protected-stellar, /health, /close.
* ci(fastify): add npm publishing workflow
Adds workflow_dispatch publishing workflow for @x402/fastify, matching the
pattern used by @x402/express and @x402/hono.
* Add @x402/stellar mechanism package with exact scheme
Implement Stellar support for the x402 protocol covering:
- Types, constants (network IDs, USDC contracts), and utility functions
- Ed25519 signer with client/facilitator variants
- Soroban transaction simulation and auth entry handling
- Client: builds transfer calls, signs auth entries, serializes XDR
- Server: parses prices, enhances payment requirements
- Facilitator: verify (structure, amounts, signatures, events) and
settle (fee sponsorship, multi-signer round-robin, submission)
* Add unit tests for the Stellar mechanism
Cover signer, constants, utils, shared helpers, client/server
scheme logic, and facilitator verify/settle/getExtra flows.
150 tests across 9 test files.
* Add integration tests for Stellar exact scheme
End-to-end flows against Stellar testnet covering both the core
x402Client/Server/Facilitator and the HTTP middleware variants.
Includes resilience to testnet resets via automatic re-funding.
* Add Stellar README and cross-reference from evm/svm
Document the package API, usage examples, fee sponsorship model,
and multi-signer facilitator setup. Link back from evm and svm.
* Wire up Stellar in the advanced examples
Register Stellar client/server/facilitator schemes alongside EVM
and SVM in the all_networks examples. Guarded by env var presence
so existing setups keep working without Stellar credentials.
* Document Stellar setup in the advanced example READMEs
Add STELLAR_PRIVATE_KEY / STELLAR_ADDRESS env vars to .env-local
templates and update the example READMEs with Stellar usage notes.
* Add Stellar to the e2e test suite
Extend the test framework with Stellar network support, add
protected-stellar endpoints to express/hono/next servers, register
Stellar signers in axios/fetch clients and the TS facilitator.
Includes test configs, lockfile, and the Stellar family in the
test runner. All 8 server×client combos pass against testnet.
* Update e2e docs with Stellar setup and trustline instructions
Add STELLAR env vars to .env-local templates, document the Stellar
testnet account setup process (keypair, USDC trustline, faucet),
and update all server/client/facilitator READMEs.
* Add npm publish workflow for @x402/stellar
Manual-dispatch GitHub Actions workflow to publish the Stellar
package to npm with provenance, matching the pattern used by
the other mechanism packages.
* Add CHANGELOG for @x402/stellar v2.5.0
The lint-python job in check_python.yml only ran `ruff check` (lint)
but never verified formatting with `ruff format --check`. This allowed
unformatted Python code to pass CI and be merged. Add the missing
format check step.
* Add Aptos mechanism implementation for x402
* Revert go changes
* Fix go revert
* Fix e2e imports
* Add aptos to all server e2e tests, make optional
* Make aptos optional on site
* Fix lint / format issues
* Add workflow for x402 aptos package
* Update e2e tests
* Fix facilitator manager
* chore: move packages, examples and e2e clients/servers/facilitators to legacy subfolders
* feat: added @x402/core to /typescript/packages
* feat: added @x402/evm to /typescript/packages/mechanism
* feat: added @x402/svm to /typescript/packages/mechanism
* feat: added @x402/extensions to /typescript/packages
* feat: added @x402/fetch to /typescript/packages/http
* feat: added @x402/axios to /typescript/packages/http
* feat: added @x402/paywall to /typescript/packages/http
* feat: added @x402/express to /typescript/packages/http
* feat: added @x402/hono to /typescript/packages/http
* feat: added @x402/next to /typescript/packages/http
* chore: update /typescript pnpm packaging
* feat: added core files to /go
* feat: added evm mechanism to /go
* feat: added svm mechanism to /go
* feat: added extensions to /go
* feat: added gin to /go/http
* feat: added tests to /go
* feat: rewrote e2e test suite system
* feat: added axios client to e2e suite
* feat: added fetch client to e2e suite
* feat: added go http client to e2e suite
* feat: added express server to e2e suite
* feat: added hono server to e2e suite
* feat: added next server to e2e suite
* feat: added gin server to e2e suite
* feat: added typescript facilitator to e2e suite
* feat: added go facilitator to e2e suite
* feat: added fetch example to examples/typescript/clients
* feat: added axios example to examples/typescript/clients
* feat: added advanced example to examples/typescript/clients
* feat: added custom example to examples/typescript/clients
* feat: added express example to examples/typescript/servers
* feat: added hono example to examples/typescript/servers
* feat: added advanced example to examples/typescript/servers
* feat: added custom example to examples/typescript/servers
* feat: added facilitator example to examples/typescript
* chore: update /examples/typescript pnpm packaging
* feat: added http client to examples/go/clients
* feat: added advanced client to examples/go/clients
* feat: added custom client to examples/go/clients
* feat: added gin server to examples/go/servers
* feat: added advanced server to examples/go/servers
* feat: added custom server to examples/go/servers
* feat: added facilitator to examples/go
* chore: updated github workflows
* fix: typescript examples fotmat/lint
* v2: next example (#706)
* fix legacy example builds
* add next example
* fix format
* upgrade to next 16
* fix legacy build
* fix e2e tests
* V2: next api wrapper (#707)
* add next route wrapper
* add protected api to example page
* add unit tests
* fix missing settle failure check
* added e2e tests for withX402
* add SettleResponse to ProcessSettleResultResponse
* add requirements to payment-header
* feat: add v2 support to x402.org facilitator
* feat: dynamically load bazaar extension in Next only when used
* fix: x402Facilitator in typescript calling onAfterVerify instead on onVerifyFailure on failure
* feat: add ERC1271 and ERC6492 support to Typescript facilitator
* feat: update typescript facilitator example & e2e test for ERC1271/ERC6492 support
* feat: add ERC1271 and ERC6492 support to Go facilitators
* feat: update go facilitator example & e2e test for ERC1271/ERC6492 support
* v2: express fixes + unit tests (#712)
* add express fixes from v1
* add units test for express/hono
* added fetch/axios unit tests
* v2: Clean up paywall (#710)
* Remove cdpClientKey and sessionTokenEndpoint from PaywallConfig
Remove Onramp functionality from EvmPaywall
Remove Coinbase fields from paywall template generation
* Migrate site to @x402/next with v2 protocol support
* Clean up tests
* remove CDP onramp from core paywall
* Update templates and build process
* Format
* Lockfile
* mock templates for CI
* Format
* Generate new templates
* Format
* v2: facilitator sync fix (#716)
* update next/react versions
* update site to next 16, tailwind 4 and fix env vars
* fix initializeOnStart pattern
* security: bump quic-go dependency for security fix GHSA-47m2-4cr7-mhcw
* v2:fix ts advanced/custom examples (#717)
* fix ts examples
* add clients/advanced/preferred-network example
* feat: improved e2e cli for external facilitator testing
* feat: updated evm & svm signer interfaces in go
* feat: updated evm & svm signer interfaces in typescript
* feat: reverted SupportedKind's kinds structure in go
* feat: reverted SupportedKind's kinds structure in typescript
* feat: refactor facilitator SVM signer interface in typescript
* go example fixes (#719)
* feat: cleanup go bazaar extension
* V2: docs update (#729)
* ts example docs
* improve ts package docs
* feat: dynamic bazaar import for all server middleware
* feat: allow dynamic response building for 402 response in typescript
* feat: allow dynamic response building for 402 response in go
* feat: added withBazaar HTTPFacilitatorClient wrapper
* feat: added linting to go
* fix: lint go
* improve go example docs (#733)
* feat: Solana PR review feedback in typescript
* feat: Solana PR review feedback in go
* fix: locks & paywall gen after rebase off main
* fix: format
* docs: improve @x402/extensions README with comprehensive documentation (#731)
* First draft of contributor docs (#738)
Correct ts contributing
Clean up contribution guidelines
* feat: updated specs for v2
* fix: merge with main, fixed lock
* v2: go settlement failure and initOnStart fixes (#720)
* go settlement failure and initOnStart fixes
* update go unit tests
* update readmes
* feat: review & improve examples & READMEs
* v2: add multiple payment options for go (#743)
* add multiple payment options for go
* fix SyncFacilitatorOnStart
* v2: add hooks for advanced go example (#745)
* add hooks for advanced go example
* fix legacy ts deps
* feat: added server initialization validation
* feat: added @x402 package workflows
* v2: add miniapp and mcp examples (#746)
* add miniapp example
* fix format
* add mcp example
* fix format
* v2: add manifest to miniapp example (#751)
* add manifest to miniapp
* fix format
* feat: x402 website redesign (#750)
* port new website to public repo
* chore: update pnpm-lock.yaml with motion dependency
* feat: add x402 V2 launch blog post and update hero code snippet
- Add /writing/x402-v2-launch blog post page
- Add blog images (blog_intro.png, blog_x402_layers.png, homepage_build5.png)
- Enable Writing nav link in NavBar and Footer
- Update hero code snippet to show V2 SDK usage
- Fix CodeSnippet to support multi-line code
* feat: edit nav for mobile
* Revert "feat: edit nav for mobile"
This reverts commit 475999a2a84f1fab875cd0fe2bb74d44dba7e1bd.
* feat: add ecosystem page and minor home page tweaks
* feat: fix typography in ecosystem
* homepage qa fixes
* feat: add ecosystem icons and fix halftone
* cleanup assets
* fix: minor bug on faq
* feat: add hamburger menu to mobile
* Update README (#755)
* Update readme
* Install instructions and typos
* feat: update site sample code & reduce supported networks
* fix: v1 header in README updated to v2
---------
Co-authored-by: phdargen <p.dargent@cern.ch>
Co-authored-by: A. McDermott <amanda.p.mcdermott@gmail.com>
Co-authored-by: Vedant Anand <136731196+VedantAnand17@users.noreply.github.com>
Co-authored-by: Faris Habib <frs@hbb.dev>
Co-authored-by: erikreppel-cb <erik.reppel@coinbase.com>
* Add Meridian to x402 ecosystem website
* fix: Update the x402 bottom image from black front -> white front (#410)
* fix the x402 bottom image with a white font for the text
* chore: v0.6.5 release (#412)
* bumping version to 0.6.5 for release
* fix: Update the x402 bottom image from black front -> white front (#410)
* fix the x402 bottom image with a white font for the text
* fix(ci): correct duplicate steps key in check_python workflow (#324)
The GitHub Actions workflow `.github/workflows/check_python.yml` had
a nested `steps:` key inside the `test-python` job’s `steps` list,
causing a YAML parse error:
(Line: 11, Col: 7): A mapping was not expected
This change removes the redundant `steps:` and ensures all steps are properly listed with `- name:` or `- uses:` entries, restoring workflow syntax validity so the CI pipeline can run.
* fix(bug): fix types export in package.json (#390)
The published x402 package does not contain an index.d.ts file leading to Typescript errors.
e.g.:
```
Could not find a declaration file for module 'x402'. '/Users/dylanfiedler/Documents/ario/ar-io/ar-io-node/node_modules/x402/dist/esm/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/x402` if it exists or add a new declaration (.d.ts) file containing `declare module 'x402';`ts(7016)
```
This PR updates it to use cjs types by default.
fix(package.json): use cjs by default in package.json
* feat: add peaq EVM support (chainId 3338) (#395)
* Revert "Merge branch 'main' into main"
This reverts commit 236d01ceb6515f96c735c85f0b6152cc2afbdc46, reversing
changes made to 1eb9a5e2b8e3a875fb4c621321f87a63318de9f3.
---------
Co-authored-by: fabrice-cheng <fabrice.cheng@coinbase.com>
Co-authored-by: Dennj <dennj.osele@gmail.com>
Co-authored-by: Dylan Fiedler <dtfiedler@users.noreply.github.com>
Co-authored-by: Lovish Arora <46993225+lavish0000@users.noreply.github.com>
The GitHub Actions workflow `.github/workflows/check_python.yml` had
a nested `steps:` key inside the `test-python` job’s `steps` list,
causing a YAML parse error:
(Line: 11, Col: 7): A mapping was not expected
This change removes the redundant `steps:` and ensures all steps are properly listed with `- name:` or `- uses:` entries, restoring workflow syntax validity so the CI pipeline can run.
* first pass implementing gha for publishing packages
* feat: updated core types to align with updated protocol spec
* feat: package/x402 refactor
* feat: restructured x402 core
* feat: x402 refactor in preparation for middleware
* feat: middleware workspace project template
* feat: refactor x402-express into its own package
* feat: x402-express updated to new spec
* feat: express server example
* feat: facilitator express server example
* feat: added axios interceptor
* chore: refactor express server example down a folder
* feat: client script example using axios
* fix: improved env variable handling in examples
* fix: site paths now that site is not within the turbo repo
* fix: parsing of types per updated spec
* fix: tweaked examples
* feat: x402-xios and x402-express unit tests
* feat: added test to turbo commands
* chore: reformat
* chore: docstrings
* chore: updated docstring
* feat: added x402-fetch package and fetch client example
* feat: unit test fetch wrapper
* chore: docstring
* chore: reformat
* chore: updated docstring
* feat: x402-hono and hono server example
* feat: added unit tests
* chore: added docstring
* chore: removed excess comments
* chore: updated docstring
* feat: added lint and format to typescript monorepo
* feat: added check_format, check_lint and check_package_lock workflows
* feat: tighten up and improve linting checks
* chore: lint/format x402
* chore: expand tigthened linting to all packages/examples
* fix: format/lint x402
* fix: format/lint x402-axios
* fix: format/lint x402-express
* fix: format/lint x402-fetch
* fix: format/lint x402-hono
* fix: format/lint middleware-template
* fix: format/lint example facilitator
* fix: format/lint example express server
* fix: format/lint example hono server
* fix: eslint unused var false positives
* fix: format/lint example axios client
* fix: format/lint example fetch client
* fix: format/lint whole project
* fix: added explicit dev dependencies on eslint-plugin
* chore: updated package lock workflow name
* chore: format package.jsons
* fix: added explicit dev dependencies on eslint parser
* fix: define paymentRequirements type from toJsonSafe
* fix: added explicit dev dependencies on eslint plugin import
* feat: README for express and express example
* fix: README code snippet syntax
* chore: unit test github workflow
* fix: test -> test:watch, added new test scripts
* chore: removed build from examples
* fix: added missing dependencies
* fix: renamed unit test workflow
* fix: missing dev dependency on express types in x402-express
* fix: added explicite vite dev dependency, as its a peer dep of vitest
* feat: x402-hono and servers/hono example READMEs (#52)
* feat: x402-hono and servers/hono example READMEs
* fix: updated npm to pnpm in example readme
* feat: refactor server middleware to decode X-PAYMENT header
* feat: middleware returns array of PaymentRequirements
* fix: unit tests
* fix: paywall html takes array of paymentRequirements, but just uses first item in list
* feat: added selector logic for selecting payment requirements client side
* feat: support generic ERC20Permit contracts
* fix: toJsonSafe for arrays
* fix: paywall selector usage
* feat: jwt signing & createAuthHeader
* fix: wrap api keys in auth object and include paths
* fix: route paths updated to specs
* fix: format
* feat: using @coinbase/cdp-sdk/auth for generateJwt
* feat: middleware takes an array to generate auth headers
* feat: change routes to /verify and /settle, change default resource to include /v2/x402
* fix: removed duplicate import
* chore: drop node 18 unit tests
* feat: rename function and descriptions to createAuthHeaders
* fix: pr feedback
* feat: improved default behavior for facilitator auth
* feat: dev demo test changes
* feat: moved cdp logic to separate export
* fix: format/lint
* feat: added x402-next and examples/fullstack/next
* feat: added readmes and updated exported types
* fix: format/lint
* fix: updated next demo to type: module
* fix: format
* fix: updated x402-next to new spec
* fix: demo
* fix: format/lint
* feat: improved handling of default asset
* fix: added missing dependencies
* fix: added explicite vite dev dependency, as its a peer dep of vitest
* feat: migrated site to monorepo subproject
* fix: regenerate lock
* feat: added format/lint
* fix: package type is module
* fix: package type is module
* fix: removed npm from prerequisites
* chore: rebased
* feat: migrated site example to latest spec
* fix: regenerate lock file
* feat: added mcp client demo
* feat: migrated agent client
* feat: Added x402-fetch and clients/fetch example readmes
* feat: rename export to wrapFetchWithPayment
* feat: x402-axios and clients/axios example readmes
* fix: increased node version in readme
* feat: removed packages/typescript
* feat: removed middleware-template
* feat: migrated clients/agent example
* feat: migrated clients/axios example
* feat: migrated clients/fetch example
* feat: migrated clients/mcp example
* feat: migrated facilitator example
* feat: migrated fullstack/next example
* feat: migrated servers/express example
* feat: migrated servers/hono example
* feat: structured dual-workspace for turbo
* feat: deleted example root folder
* fix: removed old package-lock and normalized express types used
* feat: removed x402 dependency on hono
* feat: migrated x402/cdp to @coinbase/x402
* feat: add payerAddress to verify responses
* feat: added README to examples/typescript
* chore: format/lint
* feat: migrate site example to root
* second pass implementing gha for publishing packages
* refinements
* enabling debugging
* disabling git check for publishing dryrun
* package npm token isolation
* removing degugging
* chore: Update Go Middleware Package to Latest Spec
* feat: updated README to spec
* feat: updated exact evm scheme
* fix: updated missed paymentDetails -> paymentRequirements in refactor
* fix: quotes to match our linter
* feat: readded supported
* fix: pr feedback
* fix: pr feedback
* update go fields: accepts, paymentPayload, paymentRequirements
* fix: readme example
* fix: site readme node version
* fix: removed package-lock.json
* feat: added package manager to package json
* fix: json
* feat: moved site back to typescript
* fix: lock file
* feat: updated packageManager
* feat: updated package manager
* testing root package.json
* fix: x402 depedency in site
* feat: added build:vercel script
* fix: github workflow detecting packageManager from package.json
* feat: removed dotenv dependency in x402 for edge compatibility
* feat: inject facilitator url via vercel env vars
* feedback
* pnpm version
* removing debugging
* first pass adding payer to verify response
* feat: initial devx draft
* fix: format/lint
* feat: rename facilitator exported config
* fix: x402-next middleware routing supports verbs
* feat: devx feedback
* feat: updated examples
* fix: removed bad dependency
* feat: regenerated lock after rebase
* fix: pnpm-lock
* fix: middleware resource url fallback
* fix: README 1-liner example for correctness
* feat: updated READMEs
* feat: bump x402 to 0.2.0
* feat: added legacy route support to hosted test facilitator
* fix: moved client definition out of global scope
* feat: rename TokenAmount to ERC20TokenAmount
* fix: remove unused ts-expect-error
* feat: temporarily removed @coinbase/x402 package
* fix: examples
---------
Co-authored-by: Christopher Gerber <csgerber@gmail.com>
Co-authored-by: John Peterson <john.peterson@coinbase.com>