Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
594a50d
chore: move packages, examples and e2e clients/servers/facilitators t…
CarsonRoscoe Dec 1, 2025
84d5cab
feat: added @x402/core to /typescript/packages
CarsonRoscoe Dec 1, 2025
70de32c
feat: added @x402/evm to /typescript/packages/mechanism
CarsonRoscoe Dec 1, 2025
a79e75b
feat: added @x402/svm to /typescript/packages/mechanism
CarsonRoscoe Dec 1, 2025
ee0673b
feat: added @x402/extensions to /typescript/packages
CarsonRoscoe Dec 1, 2025
26db380
feat: added @x402/fetch to /typescript/packages/http
CarsonRoscoe Dec 1, 2025
6b71bc2
feat: added @x402/axios to /typescript/packages/http
CarsonRoscoe Dec 1, 2025
6b767db
feat: added @x402/paywall to /typescript/packages/http
CarsonRoscoe Dec 1, 2025
2ad3cd3
feat: added @x402/express to /typescript/packages/http
CarsonRoscoe Dec 1, 2025
9375d3d
feat: added @x402/hono to /typescript/packages/http
CarsonRoscoe Dec 1, 2025
d6dfd61
feat: added @x402/next to /typescript/packages/http
CarsonRoscoe Dec 1, 2025
5b453de
chore: update /typescript pnpm packaging
CarsonRoscoe Dec 1, 2025
0e1c92e
feat: added core files to /go
CarsonRoscoe Dec 1, 2025
0061c8f
feat: added evm mechanism to /go
CarsonRoscoe Dec 1, 2025
b87e7d3
feat: added svm mechanism to /go
CarsonRoscoe Dec 1, 2025
6c3b570
feat: added extensions to /go
CarsonRoscoe Dec 1, 2025
4d8844d
feat: added gin to /go/http
CarsonRoscoe Dec 1, 2025
a65d590
feat: added tests to /go
CarsonRoscoe Dec 1, 2025
281bcf0
feat: rewrote e2e test suite system
CarsonRoscoe Dec 1, 2025
a8c1864
feat: added axios client to e2e suite
CarsonRoscoe Dec 1, 2025
b1aa05a
feat: added fetch client to e2e suite
CarsonRoscoe Dec 1, 2025
5ba1107
feat: added go http client to e2e suite
CarsonRoscoe Dec 1, 2025
955af66
feat: added express server to e2e suite
CarsonRoscoe Dec 1, 2025
671ba0a
feat: added hono server to e2e suite
CarsonRoscoe Dec 1, 2025
c692a53
feat: added next server to e2e suite
CarsonRoscoe Dec 1, 2025
0dc0c0d
feat: added gin server to e2e suite
CarsonRoscoe Dec 1, 2025
dc9504a
feat: added typescript facilitator to e2e suite
CarsonRoscoe Dec 1, 2025
c8c85c7
feat: added go facilitator to e2e suite
CarsonRoscoe Dec 1, 2025
c682333
feat: added fetch example to examples/typescript/clients
CarsonRoscoe Dec 1, 2025
157c8ee
feat: added axios example to examples/typescript/clients
CarsonRoscoe Dec 1, 2025
99c88b0
feat: added advanced example to examples/typescript/clients
CarsonRoscoe Dec 1, 2025
2c0f800
feat: added custom example to examples/typescript/clients
CarsonRoscoe Dec 1, 2025
c4c783a
feat: added express example to examples/typescript/servers
CarsonRoscoe Dec 1, 2025
44f59e6
feat: added hono example to examples/typescript/servers
CarsonRoscoe Dec 1, 2025
d90fa01
feat: added advanced example to examples/typescript/servers
CarsonRoscoe Dec 1, 2025
a3f9dd8
feat: added custom example to examples/typescript/servers
CarsonRoscoe Dec 1, 2025
7803f01
feat: added facilitator example to examples/typescript
CarsonRoscoe Dec 1, 2025
0631a2c
chore: update /examples/typescript pnpm packaging
CarsonRoscoe Dec 1, 2025
0064c20
feat: added http client to examples/go/clients
CarsonRoscoe Dec 1, 2025
f6ccf98
feat: added advanced client to examples/go/clients
CarsonRoscoe Dec 1, 2025
fd39437
feat: added custom client to examples/go/clients
CarsonRoscoe Dec 1, 2025
5a861a1
feat: added gin server to examples/go/servers
CarsonRoscoe Dec 1, 2025
d526e4e
feat: added advanced server to examples/go/servers
CarsonRoscoe Dec 1, 2025
fcac0f4
feat: added custom server to examples/go/servers
CarsonRoscoe Dec 1, 2025
7b3b038
feat: added facilitator to examples/go
CarsonRoscoe Dec 1, 2025
69166c5
chore: updated github workflows
CarsonRoscoe Dec 1, 2025
fa69a2d
fix: typescript examples fotmat/lint
CarsonRoscoe Dec 1, 2025
084e91e
v2: next example (#706)
phdargen Dec 1, 2025
a018b28
V2: next api wrapper (#707)
phdargen Dec 2, 2025
28082b8
feat: add v2 support to x402.org facilitator
CarsonRoscoe Dec 2, 2025
82f5857
feat: dynamically load bazaar extension in Next only when used
CarsonRoscoe Dec 2, 2025
73f225a
fix: x402Facilitator in typescript calling onAfterVerify instead on o…
CarsonRoscoe Dec 2, 2025
1c593e9
feat: add ERC1271 and ERC6492 support to Typescript facilitator
CarsonRoscoe Dec 2, 2025
71ebd68
feat: update typescript facilitator example & e2e test for ERC1271/ER…
CarsonRoscoe Dec 2, 2025
d2aee00
feat: add ERC1271 and ERC6492 support to Go facilitators
CarsonRoscoe Dec 2, 2025
9f45389
feat: update go facilitator example & e2e test for ERC1271/ERC6492 su…
CarsonRoscoe Dec 2, 2025
7e78950
v2: express fixes + unit tests (#712)
phdargen Dec 3, 2025
45dda2a
v2: Clean up paywall (#710)
apmcdermott Dec 4, 2025
753d836
v2: facilitator sync fix (#716)
phdargen Dec 4, 2025
028d442
security: bump quic-go dependency for security fix GHSA-47m2-4cr7-mhcw
CarsonRoscoe Dec 4, 2025
ff8194f
v2:fix ts advanced/custom examples (#717)
phdargen Dec 4, 2025
667aed8
feat: improved e2e cli for external facilitator testing
CarsonRoscoe Dec 4, 2025
cd19029
feat: updated evm & svm signer interfaces in go
CarsonRoscoe Dec 4, 2025
cb1c088
feat: updated evm & svm signer interfaces in typescript
CarsonRoscoe Dec 4, 2025
70ac8f6
feat: reverted SupportedKind's kinds structure in go
CarsonRoscoe Dec 5, 2025
cea2358
feat: reverted SupportedKind's kinds structure in typescript
CarsonRoscoe Dec 5, 2025
1736630
feat: refactor facilitator SVM signer interface in typescript
CarsonRoscoe Dec 5, 2025
06e84a0
go example fixes (#719)
phdargen Dec 5, 2025
0d42a3f
feat: cleanup go bazaar extension
CarsonRoscoe Dec 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
52 changes: 0 additions & 52 deletions .github/workflows/publish_npm_coinbase_x402.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/publish_npm_x402.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
pnpm -r --filter=x402 run build
- name: Publish x402 package
working-directory: ./typescript/packages/x402
working-directory: ./typescript/packages/legacy/x402
run: |
# Get package information directly
PACKAGE_NAME=$(node -p "require('./package.json').name")
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_npm_x402_axios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
pnpm -r --filter=x402 --filter=x402-axios run build

- name: Publish x402-axios package
working-directory: ./typescript/packages/x402-axios
working-directory: ./typescript/packages/legacy/x402-axios
run: |
# Get package information directly
PACKAGE_NAME=$(node -p "require('./package.json').name")
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_npm_x402_express.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
pnpm -r --filter=x402 --filter=x402-express run build

- name: Publish x402-express package
working-directory: ./typescript/packages/x402-express
working-directory: ./typescript/packages/legacy/x402-express
run: |
# Get package information directly
PACKAGE_NAME=$(node -p "require('./package.json').name")
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_npm_x402_fetch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
pnpm -r --filter=x402 --filter=x402-fetch run build

- name: Publish x402-fetch package
working-directory: ./typescript/packages/x402-fetch
working-directory: ./typescript/packages/legacy/x402-fetch
run: |
# Get package information directly
PACKAGE_NAME=$(node -p "require('./package.json').name")
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_npm_x402_hono.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
pnpm -r --filter=x402 --filter=x402-hono run build

- name: Publish x402-hono package
working-directory: ./typescript/packages/x402-hono
working-directory: ./typescript/packages/legacy/x402-hono
run: |
# Get package information directly
PACKAGE_NAME=$(node -p "require('./package.json').name")
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_npm_x402_next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
pnpm -r --filter=x402 --filter=x402-next run build
- name: Publish x402-next package
working-directory: ./typescript/packages/x402-next
working-directory: ./typescript/packages/legacy/x402-next
run: |
# Get package information directly
PACKAGE_NAME=$(node -p "require('./package.json').name")
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ proxy
.env
__pycache__/
**/.DS_Store
e2e/facilitators/external-proxies/*
!e2e/facilitators/external-proxies/README.md
7 changes: 7 additions & 0 deletions e2e/.env-local
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# E2E Test Configuration
SERVER_EVM_ADDRESS=
SERVER_SVM_ADDRESS=
CLIENT_EVM_PRIVATE_KEY=
CLIENT_SVM_PRIVATE_KEY=
FACILITATOR_EVM_PRIVATE_KEY=
FACILITATOR_SVM_PRIVATE_KEY=
150 changes: 94 additions & 56 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,87 +2,125 @@

End-to-end test suite for validating client-server-facilitator communication across languages and frameworks.

## Environment Variables
## Setup

Required:
- `ADDRESS`: Server wallet address
- `PRIVATE_KEY`: Client private key (when running single client)
### First Time Setup

## Quick Start
Install all dependencies (TypeScript via pnpm, Go, Python):

```bash
# Full suite
pnpm test # Run all tests
pnpm install:all
```

# Development mode (recommended)
pnpm test -d # Test on testnet
pnpm test -d -v # Test with verbose logging
This will:
1. Install TypeScript dependencies via `pnpm install`
2. Run `install.sh` and `build.sh` for all clients, servers, and facilitators
3. Handle nested directories (like `external-proxies/` and `local/`)

# Language filters
pnpm test -d -ts # Test TypeScript implementations
pnpm test -d -py # Test Python implementations
pnpm test -d -go # Test Go implementations
For legacy (v1) implementations as well:

```bash
pnpm install:all:legacy
```

## Filtering Tests
### Individual Setup

If you only want to set up v2 implementations:

### Implementation Filters
```bash
--client=<name> # Test specific client
--server=<name> # Test specific server
pnpm setup
```

# Available implementations
Clients: httpx, axios, fetch, requests
Servers: express, fastapi, flask, gin, hono, next
Or manually for a specific component:

# Examples
pnpm test -d -ts --client=axios # Test TypeScript axios client
pnpm test -d -py --server=fastapi # Test Python FastAPI server
```bash
cd facilitators/go
bash install.sh
bash build.sh
```

### Language Flags (can combine)
```bash
-ts, --typescript # TypeScript implementations
-py, --python # Python implementations
-go, --go # Go implementations
## Usage

### Interactive Test Mode

# Examples
pnpm test -ts -py # Test TypeScript and Python together
pnpm test -py -go # Test Python and Go together
```bash
pnpm test
```

### Environment Filters
Launches an interactive CLI where you can select:
- **Facilitators** - Payment verification/settlement services (Go, TypeScript)
- **Servers** - Protected endpoints requiring payment (Express, Gin, Hono, Next.js, FastAPI, Flask, etc.)
- **Clients** - Payment-capable HTTP clients (axios, fetch, httpx, requests, etc.)
- **Extensions** - Additional features like Bazaar discovery
- **Protocols** - EVM and/or SVM networks

Every valid combination of your selections will be tested. For example, selecting 2 facilitators, 3 servers, and 2 clients will generate and run all compatible test scenarios.

### Minimized Test Mode

```bash
--network=<name> # base or base-sepolia
--prod=<true|false> # true=CDP facilitator, false=no CDP
pnpm test --min
```

# Examples
pnpm test --prod=true # Test production scenarios
pnpm test --network=base # Test on base network
Same interactive CLI, but with intelligent test minimization:
- **90% fewer tests** compared to full mode
- Each selected component is tested at least once across all variations
- Skips redundant combinations that provide no additional coverage
- Example: `legacy-hono` (v1 only) tests once, while `express` (v1+v2, EVM+SVM) tests all 4 combinations

Perfect for rapid iteration during development while maintaining comprehensive coverage.

### Verbose Logging

```bash
pnpm test -v
pnpm test --min -v
```

### Common Workflows
Add the `-v` flag to any command for verbose output:
- Prints all facilitator logs
- Prints all server logs
- Prints all client logs
- Shows detailed information after each test scenario

Useful for debugging test failures or understanding the payment flow.

## Environment Variables

Required environment variables (set in `.env` file):

```bash
# Local Development
pnpm test -d -ts # TypeScript development
pnpm test -d -py # Python development
pnpm test -d -ts --server=next # Next.js middleware development
pnpm test -d -py --client=httpx # Python httpx client development

# Cross-Language Testing
pnpm test -ts -py # Test TypeScript/Python compatibility
pnpm test -d -py -go # Test Python/Go on testnet

# Production Testing
pnpm test --prod=true -ts # Test TypeScript in production
pnpm test --network=base -py # Test Python on base network
# Client wallets
CLIENT_EVM_PRIVATE_KEY=0x... # EVM private key for client payments
CLIENT_SVM_PRIVATE_KEY=... # Solana private key for client payments

# Server payment addresses
SERVER_EVM_ADDRESS=0x... # Where servers receive EVM payments
SERVER_SVM_ADDRESS=... # Where servers receive Solana payments

# Facilitator wallets (for payment verification/settlement)
FACILITATOR_EVM_PRIVATE_KEY=0x... # EVM private key for facilitator
FACILITATOR_SVM_PRIVATE_KEY=... # Solana private key for facilitator
```

### Environment Options
## Example Session

```bash
-d, --dev # Development mode (testnet, no CDP)
-v, --verbose # Detailed logging
--log-file=<path> # Save output to file
$ pnpm test --min

🎯 Interactive Mode
==================

✔ Select facilitators › go, typescript
✔ Select servers › express, hono, legacy-express
✔ Select clients › axios, fetch, httpx
✔ Select extensions › bazaar
✔ Select protocol families › EVM, SVM

📊 Coverage-Based Minimization
Total scenarios: 156
Selected scenarios: 18 (88.5% reduction)

✅ Passed: 18
❌ Failed: 0
```
Loading
Loading