stablepay-verifier 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stablepay_verifier-0.1.0/LICENSE +21 -0
- stablepay_verifier-0.1.0/PKG-INFO +300 -0
- stablepay_verifier-0.1.0/README.md +265 -0
- stablepay_verifier-0.1.0/pyproject.toml +66 -0
- stablepay_verifier-0.1.0/src/stablepay_verifier/__init__.py +18 -0
- stablepay_verifier-0.1.0/src/stablepay_verifier/__main__.py +6 -0
- stablepay_verifier-0.1.0/src/stablepay_verifier/chains.py +177 -0
- stablepay_verifier-0.1.0/src/stablepay_verifier/cli.py +366 -0
- stablepay_verifier-0.1.0/src/stablepay_verifier/models.py +134 -0
- stablepay_verifier-0.1.0/src/stablepay_verifier/utils.py +179 -0
- stablepay_verifier-0.1.0/src/stablepay_verifier/verifier.py +249 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Okediya
|
|
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,0 +1,300 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stablepay-verifier
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Verify stablecoin payments on-chain. No custody. No fees. Just truth.
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: stablecoin,crypto,payment,verification,blockchain,usdc,polygon
|
|
8
|
+
Author: Okediya
|
|
9
|
+
Author-email: ayobamioluwaseunfunmiokediya@gmail.com
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: httpx (>=0.25.0)
|
|
22
|
+
Requires-Dist: mypy (>=1.0.0) ; extra == "dev"
|
|
23
|
+
Requires-Dist: pre-commit (>=3.0.0) ; extra == "dev"
|
|
24
|
+
Requires-Dist: pydantic (>=2.0.0)
|
|
25
|
+
Requires-Dist: pydantic-settings (>=2.0.0)
|
|
26
|
+
Requires-Dist: pytest (>=7.0.0) ; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest-asyncio (>=0.21.0) ; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-cov (>=4.0.0) ; extra == "dev"
|
|
29
|
+
Requires-Dist: rich (>=13.0.0)
|
|
30
|
+
Requires-Dist: ruff (>=0.1.0) ; extra == "dev"
|
|
31
|
+
Requires-Dist: typer (>=0.9.0)
|
|
32
|
+
Requires-Dist: web3 (>=6.0.0)
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# 🔍 StablePay Verifier
|
|
36
|
+
|
|
37
|
+
> Verify stablecoin payments on-chain. No custody. No fees. Just truth.
|
|
38
|
+
|
|
39
|
+
[](https://pypi.org/project/stablepay-verifier/)
|
|
40
|
+
[](LICENSE)
|
|
41
|
+
[](https://python.org)
|
|
42
|
+
|
|
43
|
+
## Why StablePay?
|
|
44
|
+
|
|
45
|
+
✅ **Read-only** - Never touches your funds
|
|
46
|
+
✅ **Open-source** - Audit every line of code
|
|
47
|
+
✅ **BYO-RPC** - Use your own node for privacy
|
|
48
|
+
✅ **Global** - Works anywhere with internet
|
|
49
|
+
✅ **Simple** - PAID or NOT PAID, that's it
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Install
|
|
55
|
+
pip install stablepay-verifier
|
|
56
|
+
|
|
57
|
+
# Verify a payment
|
|
58
|
+
stablepay verify -a 0x742d35... -m 100
|
|
59
|
+
|
|
60
|
+
# Output
|
|
61
|
+
✅ PAYMENT VERIFIED
|
|
62
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
63
|
+
Status: PAID
|
|
64
|
+
Amount: 100.00 USDC
|
|
65
|
+
Transaction: 0x1234...abcd
|
|
66
|
+
Block: 52345678 (150 confirmations)
|
|
67
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Installation
|
|
71
|
+
|
|
72
|
+
### From PyPI (Recommended)
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pip install stablepay-verifier
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### From Source
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
git clone https://github.com/yourusername/stablepay-verifier.git
|
|
82
|
+
cd stablepay-verifier
|
|
83
|
+
pip install -e .
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### With Poetry
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
git clone https://github.com/yourusername/stablepay-verifier.git
|
|
90
|
+
cd stablepay-verifier
|
|
91
|
+
poetry install
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Usage
|
|
95
|
+
|
|
96
|
+
### Basic Verification
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Verify 100 USDC payment on Polygon (default)
|
|
100
|
+
stablepay verify --address 0x742d35cc6634c0532925a3b844bc9e7595f3a382 --amount 100
|
|
101
|
+
|
|
102
|
+
# Short form
|
|
103
|
+
stablepay verify -a 0x742d35... -m 100
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Different Tokens & Chains
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# USDT on Ethereum
|
|
110
|
+
stablepay verify -a 0x... -m 50 --token USDT --chain ethereum
|
|
111
|
+
|
|
112
|
+
# DAI on Arbitrum
|
|
113
|
+
stablepay verify -a 0x... -m 1000 -t DAI -c arbitrum
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Time Window
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Search last 7 days
|
|
120
|
+
stablepay verify -a 0x... -m 100 --time-window 7d
|
|
121
|
+
|
|
122
|
+
# Search last 1 hour
|
|
123
|
+
stablepay verify -a 0x... -m 100 -w 1h
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Custom RPC (BYO-RPC)
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Use your own RPC endpoint for privacy/reliability
|
|
130
|
+
stablepay verify -a 0x... -m 100 --rpc https://your-rpc-endpoint.com
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### JSON Output (for scripts)
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Get JSON output
|
|
137
|
+
stablepay verify -a 0x... -m 100 --output json
|
|
138
|
+
|
|
139
|
+
# Use with jq
|
|
140
|
+
stablepay verify -a 0x... -m 100 -o json | jq '.status'
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Filter by Sender
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Only count payments from a specific address
|
|
147
|
+
stablepay verify -a 0x... -m 100 --sender 0xabc123...
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Supported Chains & Tokens
|
|
151
|
+
|
|
152
|
+
| Chain | USDC | USDT | DAI |
|
|
153
|
+
|-------|:----:|:----:|:---:|
|
|
154
|
+
| Polygon | ✅ | ✅ | ✅ |
|
|
155
|
+
| Ethereum | ✅ | ✅ | ✅ |
|
|
156
|
+
| Arbitrum | ✅ | ✅ | ❌ |
|
|
157
|
+
| Base | ✅ | ❌ | ❌ |
|
|
158
|
+
| Optimism | ✅ | ✅ | ❌ |
|
|
159
|
+
|
|
160
|
+
Run `stablepay info` to see all supported chains and tokens.
|
|
161
|
+
|
|
162
|
+
## Exit Codes
|
|
163
|
+
|
|
164
|
+
| Code | Status | Meaning |
|
|
165
|
+
|------|--------|---------|
|
|
166
|
+
| 0 | PAID | Payment verified |
|
|
167
|
+
| 1 | NOT_PAID | No matching payment |
|
|
168
|
+
| 2 | PARTIAL | Partial payment |
|
|
169
|
+
| 3 | PENDING | Awaiting confirmations |
|
|
170
|
+
| 10 | ERROR | Invalid input |
|
|
171
|
+
| 11 | RPC_ERROR | Network error |
|
|
172
|
+
|
|
173
|
+
Use exit codes in scripts:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
stablepay verify -a 0x... -m 100 -q && echo "Payment received!"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Configuration
|
|
180
|
+
|
|
181
|
+
### Command Line Options
|
|
182
|
+
|
|
183
|
+
| Flag | Short | Default | Description |
|
|
184
|
+
|------|-------|---------|-------------|
|
|
185
|
+
| `--address` | `-a` | Required | Receiver wallet address |
|
|
186
|
+
| `--amount` | `-m` | Required | Expected payment amount |
|
|
187
|
+
| `--token` | `-t` | USDC | Token symbol |
|
|
188
|
+
| `--chain` | `-c` | polygon | Blockchain network |
|
|
189
|
+
| `--rpc` | `-r` | Auto | Custom RPC endpoint |
|
|
190
|
+
| `--time-window` | `-w` | 24h | Search time window |
|
|
191
|
+
| `--sender` | `-s` | Any | Filter by sender |
|
|
192
|
+
| `--min-confirmations` | | 12 | Required confirmations |
|
|
193
|
+
| `--tolerance` | | 0.01 | Amount tolerance (1%) |
|
|
194
|
+
| `--output` | `-o` | text | Output format |
|
|
195
|
+
| `--quiet` | `-q` | | Minimal output |
|
|
196
|
+
| `--verbose` | `-v` | | Debug info |
|
|
197
|
+
|
|
198
|
+
## Use Cases
|
|
199
|
+
|
|
200
|
+
### Freelancers
|
|
201
|
+
Verify client payments before delivering work:
|
|
202
|
+
```bash
|
|
203
|
+
stablepay verify -a $MY_WALLET -m 500 -w 24h
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### E-commerce Integration
|
|
207
|
+
Check payments in your backend:
|
|
208
|
+
```python
|
|
209
|
+
from stablepay_verifier import verify_payment, VerifyRequest
|
|
210
|
+
|
|
211
|
+
result = verify_payment(VerifyRequest(
|
|
212
|
+
address="0x...",
|
|
213
|
+
amount=99.99,
|
|
214
|
+
token="USDC",
|
|
215
|
+
chain="polygon",
|
|
216
|
+
))
|
|
217
|
+
|
|
218
|
+
if result.is_paid:
|
|
219
|
+
process_order()
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Automated Systems
|
|
223
|
+
Use in CI/CD or cron jobs:
|
|
224
|
+
```bash
|
|
225
|
+
#!/bin/bash
|
|
226
|
+
if stablepay verify -a $WALLET -m $AMOUNT -q; then
|
|
227
|
+
echo "Payment confirmed, proceeding..."
|
|
228
|
+
./next_step.sh
|
|
229
|
+
else
|
|
230
|
+
echo "Payment not found"
|
|
231
|
+
exit 1
|
|
232
|
+
fi
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## BYO-RPC Model
|
|
236
|
+
|
|
237
|
+
Public RPCs have rate limits and privacy concerns. For production use, we recommend using your own RPC endpoint:
|
|
238
|
+
|
|
239
|
+
- [Alchemy](https://www.alchemy.com/) - Free tier available
|
|
240
|
+
- [Infura](https://infura.io/) - Free tier available
|
|
241
|
+
- [QuickNode](https://www.quicknode.com/) - Free tier available
|
|
242
|
+
- Self-hosted node
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
stablepay verify -a 0x... -m 100 --rpc https://polygon-mainnet.g.alchemy.com/v2/YOUR_KEY
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## Development
|
|
249
|
+
|
|
250
|
+
### Setup
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
git clone https://github.com/yourusername/stablepay-verifier.git
|
|
254
|
+
cd stablepay-verifier
|
|
255
|
+
poetry install --with dev
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Run Tests
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
poetry run pytest
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Lint & Format
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
poetry run ruff check .
|
|
268
|
+
poetry run ruff format .
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Type Check
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
poetry run mypy src
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Contributing
|
|
278
|
+
|
|
279
|
+
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
280
|
+
|
|
281
|
+
1. Fork the repository
|
|
282
|
+
2. Create a feature branch
|
|
283
|
+
3. Make your changes
|
|
284
|
+
4. Run tests and linting
|
|
285
|
+
5. Submit a pull request
|
|
286
|
+
|
|
287
|
+
## License
|
|
288
|
+
|
|
289
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
290
|
+
|
|
291
|
+
## Security
|
|
292
|
+
|
|
293
|
+
This tool is **read-only** and never requests private keys or signing capabilities. It only queries public blockchain data.
|
|
294
|
+
|
|
295
|
+
If you find a security issue, please report it privately to security@example.com.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
**Built with ❤️ for the global stablecoin community**
|
|
300
|
+
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# 🔍 StablePay Verifier
|
|
2
|
+
|
|
3
|
+
> Verify stablecoin payments on-chain. No custody. No fees. Just truth.
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/stablepay-verifier/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://python.org)
|
|
8
|
+
|
|
9
|
+
## Why StablePay?
|
|
10
|
+
|
|
11
|
+
✅ **Read-only** - Never touches your funds
|
|
12
|
+
✅ **Open-source** - Audit every line of code
|
|
13
|
+
✅ **BYO-RPC** - Use your own node for privacy
|
|
14
|
+
✅ **Global** - Works anywhere with internet
|
|
15
|
+
✅ **Simple** - PAID or NOT PAID, that's it
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Install
|
|
21
|
+
pip install stablepay-verifier
|
|
22
|
+
|
|
23
|
+
# Verify a payment
|
|
24
|
+
stablepay verify -a 0x742d35... -m 100
|
|
25
|
+
|
|
26
|
+
# Output
|
|
27
|
+
✅ PAYMENT VERIFIED
|
|
28
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
29
|
+
Status: PAID
|
|
30
|
+
Amount: 100.00 USDC
|
|
31
|
+
Transaction: 0x1234...abcd
|
|
32
|
+
Block: 52345678 (150 confirmations)
|
|
33
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
### From PyPI (Recommended)
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install stablepay-verifier
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### From Source
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
git clone https://github.com/yourusername/stablepay-verifier.git
|
|
48
|
+
cd stablepay-verifier
|
|
49
|
+
pip install -e .
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### With Poetry
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
git clone https://github.com/yourusername/stablepay-verifier.git
|
|
56
|
+
cd stablepay-verifier
|
|
57
|
+
poetry install
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
|
|
62
|
+
### Basic Verification
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Verify 100 USDC payment on Polygon (default)
|
|
66
|
+
stablepay verify --address 0x742d35cc6634c0532925a3b844bc9e7595f3a382 --amount 100
|
|
67
|
+
|
|
68
|
+
# Short form
|
|
69
|
+
stablepay verify -a 0x742d35... -m 100
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Different Tokens & Chains
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# USDT on Ethereum
|
|
76
|
+
stablepay verify -a 0x... -m 50 --token USDT --chain ethereum
|
|
77
|
+
|
|
78
|
+
# DAI on Arbitrum
|
|
79
|
+
stablepay verify -a 0x... -m 1000 -t DAI -c arbitrum
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Time Window
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Search last 7 days
|
|
86
|
+
stablepay verify -a 0x... -m 100 --time-window 7d
|
|
87
|
+
|
|
88
|
+
# Search last 1 hour
|
|
89
|
+
stablepay verify -a 0x... -m 100 -w 1h
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Custom RPC (BYO-RPC)
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Use your own RPC endpoint for privacy/reliability
|
|
96
|
+
stablepay verify -a 0x... -m 100 --rpc https://your-rpc-endpoint.com
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### JSON Output (for scripts)
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Get JSON output
|
|
103
|
+
stablepay verify -a 0x... -m 100 --output json
|
|
104
|
+
|
|
105
|
+
# Use with jq
|
|
106
|
+
stablepay verify -a 0x... -m 100 -o json | jq '.status'
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Filter by Sender
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Only count payments from a specific address
|
|
113
|
+
stablepay verify -a 0x... -m 100 --sender 0xabc123...
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Supported Chains & Tokens
|
|
117
|
+
|
|
118
|
+
| Chain | USDC | USDT | DAI |
|
|
119
|
+
|-------|:----:|:----:|:---:|
|
|
120
|
+
| Polygon | ✅ | ✅ | ✅ |
|
|
121
|
+
| Ethereum | ✅ | ✅ | ✅ |
|
|
122
|
+
| Arbitrum | ✅ | ✅ | ❌ |
|
|
123
|
+
| Base | ✅ | ❌ | ❌ |
|
|
124
|
+
| Optimism | ✅ | ✅ | ❌ |
|
|
125
|
+
|
|
126
|
+
Run `stablepay info` to see all supported chains and tokens.
|
|
127
|
+
|
|
128
|
+
## Exit Codes
|
|
129
|
+
|
|
130
|
+
| Code | Status | Meaning |
|
|
131
|
+
|------|--------|---------|
|
|
132
|
+
| 0 | PAID | Payment verified |
|
|
133
|
+
| 1 | NOT_PAID | No matching payment |
|
|
134
|
+
| 2 | PARTIAL | Partial payment |
|
|
135
|
+
| 3 | PENDING | Awaiting confirmations |
|
|
136
|
+
| 10 | ERROR | Invalid input |
|
|
137
|
+
| 11 | RPC_ERROR | Network error |
|
|
138
|
+
|
|
139
|
+
Use exit codes in scripts:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
stablepay verify -a 0x... -m 100 -q && echo "Payment received!"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Configuration
|
|
146
|
+
|
|
147
|
+
### Command Line Options
|
|
148
|
+
|
|
149
|
+
| Flag | Short | Default | Description |
|
|
150
|
+
|------|-------|---------|-------------|
|
|
151
|
+
| `--address` | `-a` | Required | Receiver wallet address |
|
|
152
|
+
| `--amount` | `-m` | Required | Expected payment amount |
|
|
153
|
+
| `--token` | `-t` | USDC | Token symbol |
|
|
154
|
+
| `--chain` | `-c` | polygon | Blockchain network |
|
|
155
|
+
| `--rpc` | `-r` | Auto | Custom RPC endpoint |
|
|
156
|
+
| `--time-window` | `-w` | 24h | Search time window |
|
|
157
|
+
| `--sender` | `-s` | Any | Filter by sender |
|
|
158
|
+
| `--min-confirmations` | | 12 | Required confirmations |
|
|
159
|
+
| `--tolerance` | | 0.01 | Amount tolerance (1%) |
|
|
160
|
+
| `--output` | `-o` | text | Output format |
|
|
161
|
+
| `--quiet` | `-q` | | Minimal output |
|
|
162
|
+
| `--verbose` | `-v` | | Debug info |
|
|
163
|
+
|
|
164
|
+
## Use Cases
|
|
165
|
+
|
|
166
|
+
### Freelancers
|
|
167
|
+
Verify client payments before delivering work:
|
|
168
|
+
```bash
|
|
169
|
+
stablepay verify -a $MY_WALLET -m 500 -w 24h
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### E-commerce Integration
|
|
173
|
+
Check payments in your backend:
|
|
174
|
+
```python
|
|
175
|
+
from stablepay_verifier import verify_payment, VerifyRequest
|
|
176
|
+
|
|
177
|
+
result = verify_payment(VerifyRequest(
|
|
178
|
+
address="0x...",
|
|
179
|
+
amount=99.99,
|
|
180
|
+
token="USDC",
|
|
181
|
+
chain="polygon",
|
|
182
|
+
))
|
|
183
|
+
|
|
184
|
+
if result.is_paid:
|
|
185
|
+
process_order()
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Automated Systems
|
|
189
|
+
Use in CI/CD or cron jobs:
|
|
190
|
+
```bash
|
|
191
|
+
#!/bin/bash
|
|
192
|
+
if stablepay verify -a $WALLET -m $AMOUNT -q; then
|
|
193
|
+
echo "Payment confirmed, proceeding..."
|
|
194
|
+
./next_step.sh
|
|
195
|
+
else
|
|
196
|
+
echo "Payment not found"
|
|
197
|
+
exit 1
|
|
198
|
+
fi
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## BYO-RPC Model
|
|
202
|
+
|
|
203
|
+
Public RPCs have rate limits and privacy concerns. For production use, we recommend using your own RPC endpoint:
|
|
204
|
+
|
|
205
|
+
- [Alchemy](https://www.alchemy.com/) - Free tier available
|
|
206
|
+
- [Infura](https://infura.io/) - Free tier available
|
|
207
|
+
- [QuickNode](https://www.quicknode.com/) - Free tier available
|
|
208
|
+
- Self-hosted node
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
stablepay verify -a 0x... -m 100 --rpc https://polygon-mainnet.g.alchemy.com/v2/YOUR_KEY
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Development
|
|
215
|
+
|
|
216
|
+
### Setup
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
git clone https://github.com/yourusername/stablepay-verifier.git
|
|
220
|
+
cd stablepay-verifier
|
|
221
|
+
poetry install --with dev
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Run Tests
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
poetry run pytest
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Lint & Format
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
poetry run ruff check .
|
|
234
|
+
poetry run ruff format .
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Type Check
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
poetry run mypy src
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Contributing
|
|
244
|
+
|
|
245
|
+
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
246
|
+
|
|
247
|
+
1. Fork the repository
|
|
248
|
+
2. Create a feature branch
|
|
249
|
+
3. Make your changes
|
|
250
|
+
4. Run tests and linting
|
|
251
|
+
5. Submit a pull request
|
|
252
|
+
|
|
253
|
+
## License
|
|
254
|
+
|
|
255
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
256
|
+
|
|
257
|
+
## Security
|
|
258
|
+
|
|
259
|
+
This tool is **read-only** and never requests private keys or signing capabilities. It only queries public blockchain data.
|
|
260
|
+
|
|
261
|
+
If you find a security issue, please report it privately to security@example.com.
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
**Built with ❤️ for the global stablecoin community**
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "stablepay-verifier"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Verify stablecoin payments on-chain. No custody. No fees. Just truth."
|
|
5
|
+
authors = [
|
|
6
|
+
{name = "Okediya", email = "ayobamioluwaseunfunmiokediya@gmail.com"}
|
|
7
|
+
]
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
keywords = ["stablecoin", "crypto", "payment", "verification", "blockchain", "usdc", "polygon"]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 4 - Beta",
|
|
14
|
+
"Environment :: Console",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Programming Language :: Python :: 3.10",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Topic :: Office/Business :: Financial",
|
|
22
|
+
]
|
|
23
|
+
dependencies = [
|
|
24
|
+
"web3>=6.0.0",
|
|
25
|
+
"typer>=0.9.0",
|
|
26
|
+
"rich>=13.0.0",
|
|
27
|
+
"httpx>=0.25.0",
|
|
28
|
+
"pydantic>=2.0.0",
|
|
29
|
+
"pydantic-settings>=2.0.0",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
dev = [
|
|
34
|
+
"pytest>=7.0.0",
|
|
35
|
+
"pytest-asyncio>=0.21.0",
|
|
36
|
+
"pytest-cov>=4.0.0",
|
|
37
|
+
"ruff>=0.1.0",
|
|
38
|
+
"mypy>=1.0.0",
|
|
39
|
+
"pre-commit>=3.0.0",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[project.scripts]
|
|
43
|
+
stablepay = "stablepay_verifier.cli:app"
|
|
44
|
+
|
|
45
|
+
[tool.poetry]
|
|
46
|
+
packages = [{include = "stablepay_verifier", from = "src"}]
|
|
47
|
+
|
|
48
|
+
[build-system]
|
|
49
|
+
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
|
50
|
+
build-backend = "poetry.core.masonry.api"
|
|
51
|
+
|
|
52
|
+
[tool.ruff]
|
|
53
|
+
line-length = 100
|
|
54
|
+
target-version = "py310"
|
|
55
|
+
|
|
56
|
+
[tool.ruff.lint]
|
|
57
|
+
select = ["E", "F", "I", "N", "W", "UP"]
|
|
58
|
+
|
|
59
|
+
[tool.mypy]
|
|
60
|
+
python_version = "3.10"
|
|
61
|
+
strict = true
|
|
62
|
+
|
|
63
|
+
[tool.pytest.ini_options]
|
|
64
|
+
asyncio_mode = "auto"
|
|
65
|
+
testpaths = ["tests"]
|
|
66
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""
|
|
2
|
+
StablePay Verifier - Verify stablecoin payments on-chain.
|
|
3
|
+
|
|
4
|
+
No custody. No fees. Just truth.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
__version__ = "0.1.0"
|
|
8
|
+
__app_name__ = "stablepay"
|
|
9
|
+
|
|
10
|
+
from stablepay_verifier.models import PaymentResult, PaymentStatus, VerifyRequest
|
|
11
|
+
from stablepay_verifier.verifier import verify_payment
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"verify_payment",
|
|
15
|
+
"PaymentResult",
|
|
16
|
+
"PaymentStatus",
|
|
17
|
+
"VerifyRequest",
|
|
18
|
+
]
|