749 Commits

Author SHA1 Message Date
phdargen
1059e86648
chore(go): release v2.9.0 (#2021)
* remove old changesets

* chore(go): release v2.9.0
npm-@x402/paywall@v2.10.0 npm-@x402/fastify@v2.10.0 npm-@x402/next@v2.10.0 npm-@x402/hono@v2.10.0 npm-@x402/express@v2.10.0 npm-@x402/avm@v2.10.0 npm-@x402/mcp@v2.10.0 npm-@x402/axios@v2.10.0 npm-@x402/fetch@v2.10.0 npm-@x402/svm@v2.10.0 npm-@x402/stellar@v2.10.0 npm-@x402/aptos@v2.10.0 npm-@x402/evm@v2.10.0 npm-@x402/extensions@v2.10.0 npm-@x402/core@v2.10.0 go-x402@v2.9.0 go/v2.9.0
2026-04-14 02:10:33 +09:00
phdargen
db164fee84
chore: version python package (#2020) pypi-x402@v2.7.0 2026-04-14 02:00:05 +09:00
phdargen
f420044dca
chore: version typescript packages (#2019)
* fix workspace settings

* fix avm/fastify changelogs

* chore: version typescript packages
2026-04-14 01:28:36 +09:00
Misha Kolesnik
077b294ce1
feat(svm): implement extra.memo support for exact scheme (#1688)
Implement the spec change from PR #1682, adding optional seller-defined
memo support to the SVM exact scheme across all three SDKs.

Client changes (TypeScript, Go, Python - both v1 and v2):
- When extra.memo is present, use its UTF-8 value as memo instruction data
- When absent, fall back to existing random 16-byte nonce behavior
- Validate memo does not exceed MAX_MEMO_BYTES (256) limit

Facilitator changes (TypeScript, Go, Python - both v1 and v2):
- When extra.memo is present in requirements, verify exactly one memo
  instruction exists and its data matches the expected value
- Return specific error codes: memo_count / memo_mismatch

Constants added:
- MAX_MEMO_BYTES / MaxMemoBytes (256) across all languages
- ERR_MEMO_MISMATCH, ERR_MEMO_COUNT (Python/Go)
- ErrMemoExceedsMaxSize (Go client)

Tests added:
- TypeScript: 4 memo tests in duplicateTx.test.ts
- Go: TestSellerMemo with 4 subtests in duplicate_tx_test.go
- Python: TestSellerMemo class with 4 tests in test_duplicate_tx.py

Closes #1682
2026-04-13 17:32:44 +09:00
Ryan R. Fox
9424291a00
chore(typescript): bump viem to 2.47.12 across all packages (#2013)
All direct viem dependencies now resolve to 2.47.12, adding chain
definitions for Mezo Testnet (31611), MegaETH (4326), Stable (988/2201),
and others that were missing from earlier locked versions.

Lockfile-only change. No package.json range changes — all existing ^2.x
ranges already accept 2.47.12.
2026-04-13 14:33:41 +09:00
0xultravioleta
2fda85136d
Add Ultravioleta DAO facilitator to ecosystem directory (#1780)
- 19 mainnets across 7 blockchain families (EVM, Solana, Sui, Fogo, NEAR, Stellar, Algorand)
- 5 stablecoins: USDC, EURC, USDT, AUSD, PYUSD
- Schemes: exact, commerce, upto
- ERC-8004 reputation integration
- Production endpoint: https://facilitator.ultravioletadao.xyz

Co-authored-by: 0xultravioleta <ultravioletadao@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 11:54:08 +09:00
VIkions
74a9e8e65e
docs(sellers): replace legacy Go import path in Echo example (#2009) 2026-04-13 08:51:53 +09:00
Ryan R. Fox
ea0768cd7e
docs(evm): complete default-asset chain list in Go EVM mechanism README (#1998)
The Go EVM mechanism README (introduced in #1983) listed only 4 chains
under "Networks with default assets configured":

  - Base Mainnet, Base Sepolia, MegaETH Mainnet, Monad Mainnet

But `go/mechanisms/evm/constants.go` configures 10, and the main docs
table at `docs/core-concepts/network-and-token-support.mdx` lists all
10. Restore parity with the constants and the main docs table, in the
same order as the mdx table:

  - Base, Base Sepolia, Polygon, Arbitrum One, Arbitrum Sepolia,
    Monad, Stable, Stable Testnet, MegaETH, Mezo Testnet

All entries verified against `NetworkConfigs` in
`go/mechanisms/evm/constants.go`.

Follow-up to #1983 which introduced this README.
2026-04-11 23:31:28 +09:00
Ryan R. Fox
37b83471b1
fix(paywall): read token name from payment requirements instead of hardcoding USDC (#1973)
The EVM paywall hardcodes "USDC" as the token label in all display
text. The payment requirements already carry the token name in
extra.name (populated by the server from the default asset registry),
but the paywall ignores it.

Read extra.name from the first payment requirement and use it for
all user-facing token text. Falls back to "USDC" when extra.name
is absent (backward compatible with EIP-3009 tokens).

5 display strings updated:
- Header: "please pay $X {tokenName}" (was "USDC")
- Testnet prompt: "Need {tokenName} on {chainName}?" (was "USDC")
- Balance: "$X {tokenName}" (was "USDC")
- Amount row: "$X {tokenName}" (was "USDC")
- Error: "Make sure you have {tokenName} on {chainName}" (was "USDC")

Regenerated Go, Python, and TS paywall templates.
2026-04-11 23:28:54 +09:00
Andrew Barnes
b123f3979e
docs(examples): clarify facilitator signer roles (#1937) 2026-04-11 19:16:08 +09:00
Ryan R. Fox
84a4bce2b9
fix(evm): restore Mezo Testnet default asset dropped in v2.9.0 refactor (#1920) 2026-04-11 18:45:20 +09:00
MG
a25800efed
feat(avm): Add Algorand (AVM) blockchain exact spec implementation and networks support for Typescript (#1560)
* 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
2026-04-11 08:01:20 +09:00
Ash
a51c83c625
Ecosystem page changes (#1992) 2026-04-10 16:00:41 -07:00
Andrew Reder
5ab912da52
feat(bazaar): add MCP resource type support to Go SDK (#1967)
* feat(bazaar): add MCP resource type support to Go SDK

Add MCP tool discovery extensions to the bazaar package, achieving
parity with the TypeScript and Python SDKs. Servers can now declare
MCP tool discovery extensions alongside HTTP resources, and facilitators
can detect and extract them from payment payloads.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: gofmt formatting and gocritic if-else-chain lint

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(bazaar): transport enum, doc examples, inline helper, add negative tests

- Fix transport schema enum to include both valid values (streamable-http,
  sse) instead of only the provided value, matching TypeScript SDK behavior
- Fix doc.go examples to use bazaar.BAZAAR.Key() instead of bazaar.BAZAAR
- Inline createMcpDiscoveryExtension into DeclareMcpDiscoveryExtension
- Add negative validation tests for wrong type and empty toolName
- Add edge case tests for whitespace-only toolName and invalid transport

Co-Authored-By: Claude <noreply@anthropic.com>

* feat(mcp): wire extensions into PaymentWrapper 402 response

Add Extensions field to PaymentWrapperConfig and pass it through to the
PaymentRequired struct in 402 responses. This brings the MCP payment
wrapper to parity with the HTTP middleware's RouteConfig.Extensions
support, enabling bazaar discovery extensions in MCP tool responses.

- Add Extensions map to PaymentWrapperConfig (types.go)
- Set extensions in paymentRequiredResult (server.go)
- Add unit tests for extensions present/absent in 402 (server_test.go)
- Declare bazaar MCP extension in E2E server (main.go)
- Add bazaar extension integration test (mcp_evm_test.go)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat(mcp): wire TS extensions into 402 responses + Go integration tests

Add extensions support to the TS MCP PaymentWrapperConfig and pass it
through to createPaymentRequiredResponse so bazaar discovery metadata
appears in 402 responses. Wire the E2E server with declareDiscoveryExtension
for the get_weather tool. Add Go mocked-transport integration tests
(5 cases) covering the full client↔server payment flow to match TS
mcp-payment-flow.test.ts coverage.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: prettier formatting in MCP test files

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(bazaar): address PR review feedback from @CarsonRoscoe

- Use strings.TrimSpace for toolName validation to reject whitespace-only names
- Allow custom transport values through schema validation (only enum for known transports)
- Fix whitespace toolName test to assert error instead of success
- Remove conditional guard in TS bazaar extension test so assertions always run

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(bazaar): allow custom transport values in TS to match Go behavior

Widen transport type from "streamable-http" | "sse" to string, and only
apply enum constraint in schema for known transport values. This matches
the Go-side fix so custom transports pass validation in both languages.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-10 15:58:29 -07:00
phdargen
cdf3a76c08
improve defaultAsset docs (#1983) 2026-04-10 10:23:46 -07:00
mintlify[bot]
5df77caa01
Add Echo framework documentation (#1783)
* Update docs/sdk-features.md

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.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

* Update docs/getting-started/quickstart-for-sellers.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

* add fastify

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Co-authored-by: Philippe d'Argent <p.dargent@cern.ch>
2026-04-10 10:23:28 -07:00
scaler
cde91514ba
feat(specs): add Keeta exact scheme (#1575)
* feat(specs): add Keeta exact scheme

* feat(schemes/keeta): add transaction simulation to verification step

This adds a few cheap checks to simulate the transaction and catch
invalid blocks early on to prevent the server from doing expensive work
unnecessarily.
2026-04-10 14:56:55 +09:00
caveman.eth
a4e49114e1
chore(extensions): migrate to @signinwithethereum/siwe (#1917)
* Migrate to @signinwithethereum/siwe

Migrate the SIWE dependency to the Ethereum Identity Foundation package. package.json now depends on @signinwithethereum/siwe; evm.ts import was updated to import SiweMessage from the new package. Added a changeset describing the migration. (pnpm lock updated to reflect the dependency change.)

* Add siwe v4.1.0 entries to pnpm-lock

Update examples/typescript/pnpm-lock.yaml to add @signinwithethereum/siwe@4.1.0 and @signinwithethereum/siwe-parser@4.1.0. Adds package resolutions and snapshot entries, registers peerDependencies (ethers and viem marked optional), and removes the older siwe@2.3.2 entry in the importer. This pins the example project to the siwe v4 parser/runtime and records its dependency graph in the lockfile.
2026-04-09 21:19:45 +09:00
Carson Roscoe
5033781a8b
feat: add upto readme and client examples (#1963) 2026-04-09 00:28:06 +09:00
Carson Roscoe
81dba6473f
feat: added upto to docs (#1961) 2026-04-08 23:49:52 +09:00
Ethan Oroshiba
13928348ec
feat: add self-facilitation example (#1942)
* add self-facilitation example

* fix: regenerate examples/typescript lockfile against public npm registry

Lockfile had tarball URLs pointing to internal Coinbase Artifactory, causing
pnpm install to fail with ENOTFOUND in CI where that host is unreachable.
2026-04-06 10:36:26 -07:00
Ethan Oroshiba
af01f26b88
docs(bazaar): clarify EXTENSION-RESPONSES header applies to verify and settle (#1922)
Made-with: Cursor
2026-04-06 09:38:39 -07:00
Carson Roscoe
536b92ea07
feat: updated pypi workflow to use trusted publishing (#1916) 2026-04-02 16:19:28 -07:00
Carson Roscoe
dd4eb584a2
chore: version typescript, python and go packages (#1915)
* chore: version typescript packages

* chore: version python package

* chore: version go package
2026-04-02 13:22:49 -07:00
Carson Roscoe
2250caec83
feat: refactor coinbase/x402 references to x402-foundation/x402 (#1912)
* feat: refactor coinbase/x402 references to x402-foundation/x402

* fix: format

* chore: changeset fragments for typescript, python and go
2026-04-02 12:59:07 -07:00
Carson Roscoe
98bcb653c1
fix: settlement overrides for upto in typescript sdk (#1913) 2026-04-02 12:54:12 -07:00
Carson Roscoe
5c3e60bc6a
docs: add initial x402 foundation charter (#1911) 2026-04-02 09:57:09 -07:00
nico
bff876de23
feat(evm): add Stable testnet (chain ID 2201) network support (#1786)
* feat(evm): add Stable testnet (chain ID 2201) network support

* style(go): fix gofmt alignment for chain ID variable declarations

* fix(python): remove supported_assets from Stable network configs

* style(ts): reorder Stable configs above Polygon/Arbitrum in defaultAssets
2026-03-31 16:59:07 +09:00
Javier Mateos
f6baf26f15
Add Extensions field to Go SettleResponse and VerifyResponse for parity with TypeScript SDK (#1808) 2026-03-31 16:56:14 +09:00
Carson Roscoe
ad2658ac57
fix: evm contract deploys (#1880)
* fix: evm contract deploys

* feat: updated constants in SDKs

* feat: added changeset fragments
2026-03-30 21:06:55 -07:00
Emre Dincoglu
9f52f9cc0e
Added USDC for arbOne and ArbSepolia (#1877) 2026-03-31 00:54:42 +09:00
Andrew Barnes
c76b21d0aa
test(python): add test coverage for MCP server_sync module (#1733)
* test(python): add missing sync test scenarios to existing test_server.py

Add edge case coverage for: missing/malformed _meta, no matching
requirements, MCPToolResult direct return, non-dict handler return,
structuredContent preservation, empty accepts validation, verification
failure without reason, and hook context field verification.

* fix: apply ruff format to test_server.py

* fix formatting: match existing test style, inline data construction, fix import order
2026-03-30 20:54:21 +09:00
Ayush Ojha
c0e39695c4
Fix HTTPFacilitatorClient not following 308 redirects (#1813)
* Fix HTTPFacilitatorClient not following 308 redirects from facilitator

The x402.org/facilitator/supported endpoint returns HTTP 308 before
resolving to 200. HTTPFacilitatorClient did not normalize the base URL
or explicitly request redirect following, causing syncFacilitatorOnStart
to silently fail in some runtimes. When no supported payment kinds are
loaded, the middleware passes all requests through as 200 instead of 402.

- Strip trailing slashes from facilitator URL in constructor to prevent
  unnecessary 308 redirects from trailing-slash normalization
- Explicitly set redirect: "follow" on all fetch calls (verify, settle,
  getSupported) for cross-runtime compatibility
- Add tests for URL normalization and redirect option propagation

Closes #1692

* fix: apply prettier formatting to httpFacilitatorClient test
archive/legacy-v1-examples
2026-03-30 17:02:55 +09:00
kevzzsk
8cf3fca4a1
feat: export hook types (#1811) 2026-03-30 16:58:07 +09:00
Misha Kolesnik
dea5c27f10
fix(mcp): preserve structuredContent in payment wrapper result (#1834)
* fix(mcp): preserve structuredContent in payment wrapper result

createPaymentWrapper was reconstructing the tool result with only
content/isError/_meta, dropping structuredContent. This causes MCP SDK
output schema validation to fail with "Tool has an output schema but
no structured content was provided" for any tool that defines an
outputSchema.

Fix: spread the full handler result instead of cherry-picking fields,
so structuredContent and any future fields are preserved.

Adds test verifying structuredContent survives the payment wrapper.

* fix(mcp): drop result._meta spread to fix TS2698

The index signature on ToolResult makes _meta typed as unknown,
which cannot be spread. The wrapper owns _meta exclusively so
no merge is needed.
2026-03-30 16:38:16 +09:00
Vijaygopal Balasa
8c80edd30e
feat: add Polygon mainnet (chain ID 137) default asset support (#1791)
Add native USDC (0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359) as the
default stablecoin for Polygon mainnet across all three SDKs:

- Go: ChainIDPolygon constant, v2 NetworkConfigs, v1 NetworkConfigs
- TypeScript: v2 stablecoins map in ExactEvmScheme
- Python: v2 NETWORK_CONFIGS with supported_assets

Update Go v1 unit tests that previously used "polygon" as a network
without a default asset config. Replace with "iotex" and add positive
test coverage for Polygon config and asset resolution.

Contract details (verified on-chain via PolygonScan):
- Token: Circle native USDC (FiatTokenV2_2)
- EIP-712 domain: name="USD Coin", version="2"
- EIP-3009: transferWithAuthorization supported
- x402 proxy deployed at canonical CREATE2 address
2026-03-30 16:00:22 +09:00
mintlify[bot]
c6fa51b9cb
Add net/http support to Go SDK docs (#1782)
* Update docs/sdk-features.md

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>
2026-03-30 15:59:28 +09:00
mintlify[bot]
3662a353c3
Update docs/sdk-features.md (#1848)
Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-03-30 15:28:40 +09:00
mintlify[bot]
33de0ea114
Add Fastify adapter documentation (#1788)
* Update docs/getting-started/quickstart-for-sellers.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

* 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>
2026-03-30 15:17:19 +09:00
Carson Roscoe
e233e04479
fix: randomize facilitator signer selection (#1849)
* fix: randomize facilitator signer selection

* fix: test
2026-03-30 15:14:58 +09:00
justin ederer
b76d9339f9
Refresh Augur ecosystem listing copy (#1869) 2026-03-30 15:07:31 +09:00
Carson Roscoe
fc11152c47
feat: add upto to go sdk (#1833)
* feat: add upto to go sdk

* feat: cleanup PR

* feat: added HTTPTransportContext to Go SDK

* fix: ai reviewer feedback

* fix: typescript tests

* fix: header parsing for HTTPTransportContext in Typescript

* feat: cleanup pr

* feat: pr cleanup

* feat: pr review

* feat: update e2e go.mod for upto debs

* fix: lint
2026-03-27 18:19:18 -07:00
Carson Roscoe
6662507403
fix: e2e approve bug (#1803)
* fix: e2e approve bug

* feat: remove new docstring addition

* fix: update Next.js e2e server to /exact/evm/... path structure

The `feat: add upto to typescript sdk` commit reverted proxy.ts and
test.config.json from the improved `/api/exact/evm/...` path structure
back to old `protected-*` paths, without recreating the deleted route
files. Fix this properly by:

- Update proxy.ts route keys and config.matcher to /exact/evm/... paths
- Update test.config.json to /exact/evm/... paths, preserving
  coldstart: true on the two permit2 endpoints
- Add missing proxy route files at new paths:
  exact/evm/eip3009/proxy, exact/evm/permit2/proxy,
  exact/evm/permit2-eip2612GasSponsoring/proxy,
  exact/evm/permit2-erc20ApprovalGasSponsoring/proxy,
  exact/svm/proxy, exact/stellar/proxy, exact/aptos/proxy

Note: route files are in directories named "proxy" which matches a
root .gitignore pattern, so they are tracked with git add -f.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: flatten non-EVM chain routes to /exact/{chain} base path

SVM, Aptos, and Stellar each have a single transfer mechanism with no
variants, so the /proxy sub-path is unnecessary. Move them to the base
level /exact/{chain} pattern, matching EVM's approach of only adding
sub-paths when there are multiple mechanisms or extensions to test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: pr cleanup and review

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 15:27:46 -07:00
Ayush Ojha
1af1f69fc8
Fix race condition in lazy facilitator initialization (#1812)
* Fix race condition in lazy facilitator initialization for FastAPI and Flask middleware

Under concurrent requests, multiple coroutines/threads could see init_done=False
simultaneously and all call http_server.initialize(), causing redundant init calls
and inconsistent error propagation.

- FastAPI: guard with asyncio.Lock using double-checked locking pattern
- Flask: guard with threading.Lock using double-checked locking pattern
- Add concurrency tests proving single-flight initialization for both frameworks
- Add tests verifying failed init does not permanently block retries

Closes #1584

* fix: remove unused variables to pass ruff lint
2026-03-27 11:56:00 -05:00
mintlify[bot]
7afc39f22d
Update docs/extensions/bazaar.mdx (#1836)
Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-03-27 23:37:37 +09:00
Ethan Oroshiba
bb1f2f0225
fix: enforce method in discovery schemas and auto-populate from adapter (#1831)
* fix(go): add omitempty to QueryInput/BodyInput.Method to prevent spurious enum validation failure

When external JSON omits info.input.method (valid when method is not in the schema's
required list), Go zero-initializes the Method field to "" and re-marshaling produces
"method":"", which fails the enum constraint in ValidateDiscoveryExtension.

Adding omitempty ensures absent method fields remain absent after round-trip serialization.

Fixes #1830

Made-with: Cursor

* enforce method is required in TS and Python discovery extension schemas

Per spec, the method field must always be present in a discovery extension's
info.input. Add "method" to the required array in schemas built by the TS
and Python resource service builders, so ValidateDiscoveryExtension rejects
extensions missing method with a clear error.

Also reverts the Go omitempty workaround from the prior commit; the Go SDK
was already producing a validation error for absent method (via the enum
constraint), and the schema-level required enforcement is the correct fix.

Closes #1830

Made-with: Cursor

* style: format resourceService.ts type union per Prettier

Made-with: Cursor

* fix: auto-populate HTTP method from adapter in all SDKs

The SDK entry points (processHTTPRequest, requiresPayment,
processSettlement) now derive the HTTP method from the adapter
when it is not explicitly set on the request context. This ensures
direct x402HTTPResourceServer users do not need to manually assign
the method field — the SDK computes it at runtime, matching the
behavior middleware users already get.

Made-with: Cursor

* test: add declare → enrich → validate flow tests for bazaar extension

Verify the real middleware path: extensions are declared without method,
enrichDeclaration injects method from the HTTP context at request time,
and the enriched extension passes schema validation. Covers GET and
POST in all three SDKs (TypeScript, Go, Python).

Made-with: Cursor
2026-03-26 15:11:48 -05:00
Carson Roscoe
9e50ecbd2e
feat: added EXTENSION-RESPONSES header to spec (#1835)
* feat: added BAZAAR-RESPONSE header to spec

* feat: generalized header
2026-03-26 13:10:49 -07:00
Yahya
c7b4c3ceb2
removing aurracloud facilitator from ecosystem (#1816) 2026-03-26 17:27:47 +09:00
Carson Roscoe
d352574bd5
feat: add upto to typescript sdk (#1773)
* feat(evm): add upto payment scheme TypeScript SDK

Implement the upto payment scheme for EVM, enabling usage-based payments
where a client authorizes a maximum amount via Permit2 and the server
settles for the actual amount used (which may be less).

Covers all three roles:
- Client: creates Permit2 payloads with max authorized amount
- Server: builds payment requirements, forces permit2 transfer method
- Facilitator: verifies permitted >= required, settles actual usage,
  supports zero-settlement path for no-charge responses

Key design decisions:
- Permit2 only (no EIP-3009, per spec)
- Shared Permit2 witness struct with exact scheme
- Re-exports shared utilities from exact (approval helpers, extensions, RPC)
- V2 protocol only

Resolves: CDPAI-714

* chore(evm): add JSDoc descriptions and fix lint errors in upto SDK

Add comprehensive JSDoc descriptions, @param, and @returns tags to all
upto scheme files to satisfy eslint jsdoc rules. Remove unused imports
in facilitator test file.

* refactor(evm): extract shared permit2 helpers to reduce duplication between exact and upto facilitators

* refactor(evm): consolidate client-side createPermit2Payload into shared helper

* refactor(evm): extract shared trySignEip2612Permit and trySignErc20Approval from scheme classes

* refactor(evm): split shared/permit2-helpers into permit2.ts and extensions.ts

* test(evm): add upto server, register, and types tests; expand client and facilitator coverage

Add 3 new test files (server.test.ts, register.test.ts, types.test.ts)
covering upto-specific server behaviors (permit2 forcing, facilitator
address injection, price parsing), registration helpers for all three
roles, and type guard validation. Expand existing client and facilitator
tests with additional edge cases.

Also includes in-progress source changes: shared permit2 helper
refactoring, upto facilitator hardening, spec clarifications, and
defaultAssets extraction.

* fix(evm): resolve lint errors for CI — add missing JSDoc descriptions and fix unused vars

* fix(evm): address PR review — align upto verify flow with exact, update spec, remove createEvmClient

* refactor(evm): move shared utils to shared/, remove upto register pattern

- Move validateErc20ApprovalForPayment to shared/erc20approval.ts
  (was in exact/facilitator/, used by both exact and upto)
- Move RPC utilities to shared/rpc.ts, rename types to drop Exact prefix
  (EvmSchemeConfig, EvmSchemeOptions, etc.) with deprecated aliases
- Remove registerUptoEvmScheme from client, facilitator, and server
  (v1 legacy pattern not needed for v2-only upto scheme)
- Backward-compat re-exports preserved at original paths

* test(e2e): add upto payment scheme e2e test coverage

Add full e2e test suite for the upto payment scheme mirroring exact
permit2 coverage: direct settle, EIP-2612 gas sponsoring, and ERC-20
approval gas sponsoring endpoints.

- Add 3 upto endpoints to Express e2e server with UptoEvmScheme
- Register UptoEvmScheme in TypeScript facilitator
- Register UptoEvmClientScheme in fetch and axios e2e clients
- Add upto Permit2 approve/revoke cycle handling in test runner
- Add upto entry points to @x402/evm tsup.config.ts
- Update test.config.json files for all components

* fix(evm): harden upto type guard, add time window validation, improve settlement comments

- Add validAfter check to isUptoPermit2Payload for stricter exact/upto discrimination
- Add deadline > validAfter guard in client permit2 payload creation
- Default simulateInSettle to true for settlement re-verification
- Expand settlement re-verification comment for reviewer clarity
- Add no-register.ts comments explaining V1 compat is not needed for upto
- Clarify e2e test config description for upto endpoint
- Add tests for validAfter type guard and buildUptoPermit2SettleArgs

* feat: added SettlementOverride

* fix: examples lock

* feat: Added upto to hono/next e2e tests

* feat: update upto tests

* feat: update tests to support fallback facilitator for non-SDK parity testing

* fix: format/lint

* fix: add linting to upto example

---------

Co-authored-by: Fabrice Cheng <fabrice.cheng@coinbase.com>
2026-03-25 16:10:04 -07:00
phdargen
a0ec8e63c3
Monkey-patch fastify's reply.raw write operations and buffere response (#1790)
* Applied monkey-patch on reply.raw write operations and buffered response to prevent content leak from direct raw writes bypassing Fastify's onSend lifecycle

* fix e2e tests
2026-03-25 00:58:17 +09:00