11# Primer x402
22
3- [ ![ Tests] ( https://github.com/Primer-Systems /x402/actions/workflows/test.yml/badge.svg )] ( https://github.com/Primer-Systems /x402-private /actions/workflows/test.yml )
3+ [ ![ Tests] ( https://github.com/PrimerSystems /x402/actions/workflows/test.yml/badge.svg )] ( https://github.com/PrimerSystems /x402/actions/workflows/test.yml )
44
5- Implementation of the [ x402 payment protocol] ( https://x402.org ) for HTTP 402 payments on Base .
5+ Implementation of the [ x402 payment protocol] ( https://x402.org ) for HTTP 402 payments.
66
77## Components
88
9- - ** sdk/** - JavaScript SDK for payers and payees
9+ - ** sdk-typescript/** - JavaScript/TypeScript SDK for payers and payees
10+ - ** sdk-python/** - Python SDK for payers and payees
1011- ** tools/** - CLI tools for testing and token approval
1112- ** Contracts/** - * Prism* smart contract for ERC-20 settlements
1213
@@ -17,7 +18,8 @@ Implementation of the [x402 payment protocol](https://x402.org) for HTTP 402 pay
1718``` javascript
1819const { createSigner , x402Fetch } = require (' @primersystems/x402' );
1920
20- const signer = await createSigner (' base' , process .env .PRIVATE_KEY );
21+ // Use CAIP-2 network format (eip155:chainId)
22+ const signer = await createSigner (' eip155:8453' , process .env .PRIVATE_KEY );
2123const fetch402 = x402Fetch (fetch, signer, { maxAmount: ' 1.00' });
2224
2325const response = await fetch402 (' https://example.com/api/paywall' );
@@ -32,17 +34,23 @@ app.use(x402Express('0xYourAddress', {
3234 ' /api/paywall' : {
3335 amount: ' 0.01' ,
3436 asset: ' 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' , // USDC on Base
35- network: ' base '
37+ network: ' eip155:8453 ' // CAIP-2 format
3638 }
3739}));
3840```
3941
4042## Supported Networks
4143
42- | Network | Chain ID |
43- | ---------| ----------|
44- | Base | 8453 |
45- | Base Sepolia | 84532 |
44+ Networks use [ CAIP-2] ( https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-2.md ) identifiers.
45+
46+ | Network (CAIP-2) | Chain ID | Name | Default Facilitator |
47+ | ------------------| ----------| ------| ---------------------|
48+ | eip155:8453 | 8453 | Base | ✓ Primer |
49+ | eip155:84532 | 84532 | Base Sepolia | ✓ Primer |
50+ | eip155:1 | 1 | Ethereum | Custom required |
51+ | eip155:42161 | 42161 | Arbitrum | Custom required |
52+ | eip155:10 | 10 | Optimism | Custom required |
53+ | eip155:137 | 137 | Polygon | Custom required |
4654
4755## Token Types
4856
@@ -51,11 +59,15 @@ app.use(x402Express('0xYourAddress', {
5159
5260## Protocol
5361
54- Uses x402 v1 with the ` exact ` scheme. Payments are authorized via EIP-712 signatures and settled by a facilitator service.
62+ Uses ** x402 v2** with the ` exact ` scheme. Payments are authorized via EIP-712 signatures and settled by a facilitator service.
63+
64+ Key v2 features:
65+ - ` x402Version: 2 ` in all payloads
66+ - CAIP-2 network identifiers (e.g., ` eip155:8453 ` instead of ` base ` )
67+ - Multi-chain support
5568
56- ** Facilitator:** ` https://x402.primer.systems `
69+ ** Facilitator:** ` https://x402.primer.systems ` (Base networks only)
5770
5871## License
5972
6073MIT - Primer Systems
61-
0 commit comments