Skip to content

Commit c897d8c

Browse files
Chet ParkerChet Parker
authored andcommitted
v0.3.0 — x402 payment framework for FastAPI (226 tests)
0 parents  commit c897d8c

54 files changed

Lines changed: 6246 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# x402-fastapi-kit configuration
2+
# Copy to .env and fill in your values
3+
4+
# REQUIRED: Your wallet address (EVM hex or Solana base58)
5+
X402_PAY_TO=0xYOUR_WALLET_ADDRESS_HERE
6+
7+
# Network (default: Base Sepolia testnet)
8+
X402_NETWORK=eip155:84532
9+
10+
# Facilitator URL (default: testnet facilitator)
11+
X402_FACILITATOR_URL=https://x402.org/facilitator
12+
13+
# Default price for gated routes
14+
X402_DEFAULT_PRICE=$0.01
15+
16+
# Server
17+
X402_HOST=0.0.0.0
18+
X402_PORT=8000
19+
X402_DEBUG=true
20+
21+
# Optional: Solana address (for dual-chain support)
22+
# X402_SVM_PAY_TO=YourSolanaAddress
23+
24+
# Optional: CDP credentials (for mainnet facilitator)
25+
# X402_CDP_API_KEY_ID=
26+
# X402_CDP_API_KEY_SECRET=
27+
28+
# ── Phase 2: Access Control ──────────────────────────────
29+
30+
# Rate limiting (enabled by default)
31+
X402_RATE_LIMIT_ENABLED=true
32+
X402_RATE_LIMIT_RPM=60
33+
# Per-route limits: path=rpm,path=rpm
34+
# X402_RATE_LIMIT_ROUTES=/weather=30,/forecast=10
35+
36+
# API key fallback auth
37+
X402_API_KEYS_ENABLED=false
38+
# Keys as name=secret,name=secret
39+
# X402_API_KEYS=partner1=sk_live_abc123,internal=sk_agent_xyz
40+
41+
# Wallet allowlist
42+
X402_ALLOWLIST_ENABLED=false
43+
# Comma-separated addresses
44+
# X402_ALLOWLIST_ADDRESSES=0xPartner1...,0xMyAgent...

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
__pycache__/
2+
*.pyc
3+
*.pyo
4+
.env
5+
.venv/
6+
dist/
7+
build/
8+
*.egg-info/
9+
.pytest_cache/
10+
.mypy_cache/
11+
.ruff_cache/
12+
htmlcov/
13+
.coverage

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 x402-fastapi-kit contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)