Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
0108446
chore: move packages, examples and e2e clients/servers/facilitators t…
CarsonRoscoe Dec 1, 2025
cffb0fa
feat: added @x402/core to /typescript/packages
CarsonRoscoe Dec 1, 2025
c971e30
feat: added @x402/evm to /typescript/packages/mechanism
CarsonRoscoe Dec 1, 2025
4ee89c3
feat: added @x402/svm to /typescript/packages/mechanism
CarsonRoscoe Dec 1, 2025
67e1ce0
feat: added @x402/extensions to /typescript/packages
CarsonRoscoe Dec 1, 2025
968c52b
feat: added @x402/fetch to /typescript/packages/http
CarsonRoscoe Dec 1, 2025
a4a35ca
feat: added @x402/axios to /typescript/packages/http
CarsonRoscoe Dec 1, 2025
c00bce5
feat: added @x402/paywall to /typescript/packages/http
CarsonRoscoe Dec 1, 2025
d66c97e
feat: added @x402/express to /typescript/packages/http
CarsonRoscoe Dec 1, 2025
b400f50
feat: added @x402/hono to /typescript/packages/http
CarsonRoscoe Dec 1, 2025
fd2088d
feat: added @x402/next to /typescript/packages/http
CarsonRoscoe Dec 1, 2025
0cf5555
chore: update /typescript pnpm packaging
CarsonRoscoe Dec 1, 2025
bfdada0
feat: added core files to /go
CarsonRoscoe Dec 1, 2025
a9eaec4
feat: added evm mechanism to /go
CarsonRoscoe Dec 1, 2025
37b3189
feat: added svm mechanism to /go
CarsonRoscoe Dec 1, 2025
9a6c80f
feat: added extensions to /go
CarsonRoscoe Dec 1, 2025
58e24cb
feat: added gin to /go/http
CarsonRoscoe Dec 1, 2025
013be10
feat: added tests to /go
CarsonRoscoe Dec 1, 2025
851e0a5
feat: rewrote e2e test suite system
CarsonRoscoe Dec 1, 2025
67ee1b9
feat: added axios client to e2e suite
CarsonRoscoe Dec 1, 2025
05cf946
feat: added fetch client to e2e suite
CarsonRoscoe Dec 1, 2025
013255a
feat: added go http client to e2e suite
CarsonRoscoe Dec 1, 2025
84ec2fb
feat: added express server to e2e suite
CarsonRoscoe Dec 1, 2025
2a59fbb
feat: added hono server to e2e suite
CarsonRoscoe Dec 1, 2025
81e3841
feat: added next server to e2e suite
CarsonRoscoe Dec 1, 2025
81bea0e
feat: added gin server to e2e suite
CarsonRoscoe Dec 1, 2025
ad58b32
feat: added typescript facilitator to e2e suite
CarsonRoscoe Dec 1, 2025
6955e7b
feat: added go facilitator to e2e suite
CarsonRoscoe Dec 1, 2025
3b61d5f
feat: added fetch example to examples/typescript/clients
CarsonRoscoe Dec 1, 2025
f40aee2
feat: added axios example to examples/typescript/clients
CarsonRoscoe Dec 1, 2025
c79c0e7
feat: added advanced example to examples/typescript/clients
CarsonRoscoe Dec 1, 2025
3d797d5
feat: added custom example to examples/typescript/clients
CarsonRoscoe Dec 1, 2025
ea7803f
feat: added express example to examples/typescript/servers
CarsonRoscoe Dec 1, 2025
5412909
feat: added hono example to examples/typescript/servers
CarsonRoscoe Dec 1, 2025
db61484
feat: added advanced example to examples/typescript/servers
CarsonRoscoe Dec 1, 2025
b8a1745
feat: added custom example to examples/typescript/servers
CarsonRoscoe Dec 1, 2025
dc0f71a
feat: added facilitator example to examples/typescript
CarsonRoscoe Dec 1, 2025
a3361fb
chore: update /examples/typescript pnpm packaging
CarsonRoscoe Dec 1, 2025
c293aa8
feat: added http client to examples/go/clients
CarsonRoscoe Dec 1, 2025
f026990
feat: added advanced client to examples/go/clients
CarsonRoscoe Dec 1, 2025
967a3dc
feat: added custom client to examples/go/clients
CarsonRoscoe Dec 1, 2025
b9def7b
feat: added gin server to examples/go/servers
CarsonRoscoe Dec 1, 2025
71129a9
feat: added advanced server to examples/go/servers
CarsonRoscoe Dec 1, 2025
7630d3b
feat: added custom server to examples/go/servers
CarsonRoscoe Dec 1, 2025
907814d
feat: added facilitator to examples/go
CarsonRoscoe Dec 1, 2025
24b1e10
chore: updated github workflows
CarsonRoscoe Dec 1, 2025
0207e54
fix: typescript examples fotmat/lint
CarsonRoscoe Dec 1, 2025
8a32aef
v2: next example (#706)
phdargen Dec 1, 2025
595d131
V2: next api wrapper (#707)
phdargen Dec 2, 2025
d32634d
feat: add v2 support to x402.org facilitator
CarsonRoscoe Dec 2, 2025
592ffa1
feat: dynamically load bazaar extension in Next only when used
CarsonRoscoe Dec 2, 2025
174c8c6
fix: x402Facilitator in typescript calling onAfterVerify instead on o…
CarsonRoscoe Dec 2, 2025
c5afbc4
feat: add ERC1271 and ERC6492 support to Typescript facilitator
CarsonRoscoe Dec 2, 2025
c9159e3
feat: update typescript facilitator example & e2e test for ERC1271/ER…
CarsonRoscoe Dec 2, 2025
94cc70f
feat: add ERC1271 and ERC6492 support to Go facilitators
CarsonRoscoe Dec 2, 2025
164b75b
feat: update go facilitator example & e2e test for ERC1271/ERC6492 su…
CarsonRoscoe Dec 2, 2025
d1f0f9c
v2: express fixes + unit tests (#712)
phdargen Dec 3, 2025
07d9350
v2: Clean up paywall (#710)
apmcdermott Dec 4, 2025
83b2572
v2: facilitator sync fix (#716)
phdargen Dec 4, 2025
cd38e0f
security: bump quic-go dependency for security fix GHSA-47m2-4cr7-mhcw
CarsonRoscoe Dec 4, 2025
df75dfa
v2:fix ts advanced/custom examples (#717)
phdargen Dec 4, 2025
8fe9d75
feat: improved e2e cli for external facilitator testing
CarsonRoscoe Dec 4, 2025
ef6fca3
feat: updated evm & svm signer interfaces in go
CarsonRoscoe Dec 4, 2025
6da9f28
feat: updated evm & svm signer interfaces in typescript
CarsonRoscoe Dec 4, 2025
30716d9
fix(java): skip settlement for error responses (4xx/5xx)
madisoncarter1234 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