@paylobster/cli 4.0.0
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.
- package/BUILD_SUMMARY.md +429 -0
- package/CHANGELOG.md +78 -0
- package/CONTRIBUTING.md +368 -0
- package/EXAMPLES.md +432 -0
- package/LICENSE +21 -0
- package/QUICKSTART.md +189 -0
- package/README.md +377 -0
- package/TEST_REPORT.md +191 -0
- package/bin/plob.js +9 -0
- package/bin/plob.ts +9 -0
- package/demo.sh +154 -0
- package/dist/bin/plob.d.ts +7 -0
- package/dist/bin/plob.d.ts.map +1 -0
- package/dist/bin/plob.js +10 -0
- package/dist/bin/plob.js.map +1 -0
- package/dist/src/commands/auth.d.ts +3 -0
- package/dist/src/commands/auth.d.ts.map +1 -0
- package/dist/src/commands/auth.js +75 -0
- package/dist/src/commands/auth.js.map +1 -0
- package/dist/src/commands/config.d.ts +3 -0
- package/dist/src/commands/config.d.ts.map +1 -0
- package/dist/src/commands/config.js +79 -0
- package/dist/src/commands/config.js.map +1 -0
- package/dist/src/commands/escrow.d.ts +3 -0
- package/dist/src/commands/escrow.d.ts.map +1 -0
- package/dist/src/commands/escrow.js +193 -0
- package/dist/src/commands/escrow.js.map +1 -0
- package/dist/src/commands/mandate.d.ts +8 -0
- package/dist/src/commands/mandate.d.ts.map +1 -0
- package/dist/src/commands/mandate.js +54 -0
- package/dist/src/commands/mandate.js.map +1 -0
- package/dist/src/commands/pay.d.ts +6 -0
- package/dist/src/commands/pay.d.ts.map +1 -0
- package/dist/src/commands/pay.js +77 -0
- package/dist/src/commands/pay.js.map +1 -0
- package/dist/src/commands/register.d.ts +3 -0
- package/dist/src/commands/register.d.ts.map +1 -0
- package/dist/src/commands/register.js +51 -0
- package/dist/src/commands/register.js.map +1 -0
- package/dist/src/commands/reputation.d.ts +3 -0
- package/dist/src/commands/reputation.d.ts.map +1 -0
- package/dist/src/commands/reputation.js +116 -0
- package/dist/src/commands/reputation.js.map +1 -0
- package/dist/src/commands/status.d.ts +3 -0
- package/dist/src/commands/status.d.ts.map +1 -0
- package/dist/src/commands/status.js +82 -0
- package/dist/src/commands/status.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +59 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/config.d.ts +26 -0
- package/dist/src/lib/config.d.ts.map +1 -0
- package/dist/src/lib/config.js +91 -0
- package/dist/src/lib/config.js.map +1 -0
- package/dist/src/lib/contracts.d.ts +18798 -0
- package/dist/src/lib/contracts.d.ts.map +1 -0
- package/dist/src/lib/contracts.js +361 -0
- package/dist/src/lib/contracts.js.map +1 -0
- package/dist/src/lib/display.d.ts +83 -0
- package/dist/src/lib/display.d.ts.map +1 -0
- package/dist/src/lib/display.js +293 -0
- package/dist/src/lib/display.js.map +1 -0
- package/dist/src/lib/types.d.ts +49 -0
- package/dist/src/lib/types.d.ts.map +1 -0
- package/dist/src/lib/types.js +3 -0
- package/dist/src/lib/types.js.map +1 -0
- package/dist/src/lib/wallet.d.ts +30 -0
- package/dist/src/lib/wallet.d.ts.map +1 -0
- package/dist/src/lib/wallet.js +143 -0
- package/dist/src/lib/wallet.js.map +1 -0
- package/jest.config.js +15 -0
- package/package.json +55 -0
- package/src/__tests__/cli.test.ts +38 -0
- package/src/commands/auth.ts +75 -0
- package/src/commands/config.ts +84 -0
- package/src/commands/escrow.ts +222 -0
- package/src/commands/mandate.ts +56 -0
- package/src/commands/pay.ts +96 -0
- package/src/commands/register.ts +57 -0
- package/src/commands/reputation.ts +84 -0
- package/src/commands/status.ts +91 -0
- package/src/index.ts +63 -0
- package/src/lib/config.ts +90 -0
- package/src/lib/contracts.ts +392 -0
- package/src/lib/display.ts +265 -0
- package/src/lib/types.ts +57 -0
- package/src/lib/wallet.ts +146 -0
- package/tsconfig.json +21 -0
package/README.md
ADDED
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
# 🦞 PayLobster CLI (`plob`)
|
|
2
|
+
|
|
3
|
+
Command-line interface for PayLobster - Payment infrastructure for AI agents.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🔐 **Wallet Management** - Secure keystore or environment variable authentication
|
|
8
|
+
- 🆔 **Agent Registration** - Register your agent identity on-chain
|
|
9
|
+
- 💰 **Payments & Escrow** - Create, list, and release escrow payments
|
|
10
|
+
- ⭐ **Reputation** - Check agent reputation scores
|
|
11
|
+
- 📊 **Status Dashboard** - View balances, credit, and account status
|
|
12
|
+
- 🛠️ **Network Support** - Base Mainnet and Sepolia testnet
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### From npm (when published)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g @paylobster/cli
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### From source
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
git clone https://github.com/itsGustav/Pay-Lobster.git
|
|
26
|
+
cd Pay-Lobster/cli
|
|
27
|
+
npm install
|
|
28
|
+
npm run build
|
|
29
|
+
npm link
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick Start
|
|
33
|
+
|
|
34
|
+
### 1. Configure Network
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Use Sepolia testnet (default)
|
|
38
|
+
plob config set network sepolia
|
|
39
|
+
|
|
40
|
+
# Or use mainnet
|
|
41
|
+
plob config set network mainnet
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. Set Up Wallet
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Option 1: Use environment variable (recommended for production)
|
|
48
|
+
export PRIVATE_KEY="0x..."
|
|
49
|
+
plob auth --env PRIVATE_KEY
|
|
50
|
+
|
|
51
|
+
# Option 2: Save to encrypted keystore (development)
|
|
52
|
+
plob auth --private-key 0x...
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 3. Register Your Agent
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
plob register --name "my-coding-agent" --capabilities "code-review,bug-fix"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 4. Check Status
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
plob status
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Output:
|
|
68
|
+
```
|
|
69
|
+
🦞 PayLobster Agent Status
|
|
70
|
+
────────────────────────────
|
|
71
|
+
Name: my-coding-agent
|
|
72
|
+
Address: 0x742d...3f8a
|
|
73
|
+
────────────────────────────
|
|
74
|
+
Network: Base Sepolia
|
|
75
|
+
Registered: ✅
|
|
76
|
+
Agent ID: 42
|
|
77
|
+
|
|
78
|
+
💰 Balances
|
|
79
|
+
USDC: 125.50 USDC
|
|
80
|
+
ETH: 0.05 ETH
|
|
81
|
+
|
|
82
|
+
💳 Credit
|
|
83
|
+
Limit: 1000 USDC
|
|
84
|
+
Available: 750 USDC
|
|
85
|
+
In Use: 250 USDC
|
|
86
|
+
|
|
87
|
+
⭐ Reputation: ★★★★☆ 85
|
|
88
|
+
📦 Escrows: 3 total
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Commands
|
|
92
|
+
|
|
93
|
+
### `plob auth`
|
|
94
|
+
|
|
95
|
+
Configure wallet authentication.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Use private key (saved to keystore)
|
|
99
|
+
plob auth --private-key 0x...
|
|
100
|
+
|
|
101
|
+
# Use environment variable
|
|
102
|
+
plob auth --env PRIVATE_KEY
|
|
103
|
+
|
|
104
|
+
# Check current wallet
|
|
105
|
+
plob auth
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### `plob config`
|
|
109
|
+
|
|
110
|
+
Manage CLI configuration.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Show current config
|
|
114
|
+
plob config show
|
|
115
|
+
|
|
116
|
+
# Set network
|
|
117
|
+
plob config set network sepolia
|
|
118
|
+
plob config set network mainnet
|
|
119
|
+
|
|
120
|
+
# Set custom RPC
|
|
121
|
+
plob config set rpcUrl https://your-rpc.com
|
|
122
|
+
|
|
123
|
+
# Reset to defaults
|
|
124
|
+
plob config reset
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### `plob register`
|
|
128
|
+
|
|
129
|
+
Register your agent identity on-chain.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
plob register \
|
|
133
|
+
--name "my-agent" \
|
|
134
|
+
--capabilities "code-review,bug-fix,testing"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### `plob status`
|
|
138
|
+
|
|
139
|
+
View your agent status, balances, and reputation.
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# Pretty output
|
|
143
|
+
plob status
|
|
144
|
+
|
|
145
|
+
# JSON output
|
|
146
|
+
plob status --json
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### `plob escrow create`
|
|
150
|
+
|
|
151
|
+
Create a new escrow payment.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
plob escrow create \
|
|
155
|
+
--to 0x9a3c...7b21 \
|
|
156
|
+
--amount 50 \
|
|
157
|
+
--description "Code review for PR #123"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### `plob escrow list`
|
|
161
|
+
|
|
162
|
+
List your escrows.
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
plob escrow list
|
|
166
|
+
plob escrow list --json
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### `plob escrow get`
|
|
170
|
+
|
|
171
|
+
Get escrow details.
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
plob escrow get <escrow-id>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### `plob escrow release`
|
|
178
|
+
|
|
179
|
+
Release funds from an escrow (sender only).
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# With confirmation prompt
|
|
183
|
+
plob escrow release <escrow-id>
|
|
184
|
+
|
|
185
|
+
# Skip confirmation
|
|
186
|
+
plob escrow release <escrow-id> --yes
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### `plob pay`
|
|
190
|
+
|
|
191
|
+
Quick payment (creates escrow).
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
plob pay \
|
|
195
|
+
--to 0x9a3c...7b21 \
|
|
196
|
+
--amount 25 \
|
|
197
|
+
--description "Bug fix payment"
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### `plob reputation`
|
|
201
|
+
|
|
202
|
+
Check reputation score.
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Check your reputation
|
|
206
|
+
plob reputation
|
|
207
|
+
|
|
208
|
+
# Check someone else's reputation
|
|
209
|
+
plob reputation 0x9a3c...7b21
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### `plob mandate`
|
|
213
|
+
|
|
214
|
+
Manage payment mandates _(coming soon)_.
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
plob mandate create --agent 0x... --limit 100 --duration 30
|
|
218
|
+
plob mandate list
|
|
219
|
+
plob mandate revoke <id>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Configuration
|
|
223
|
+
|
|
224
|
+
Configuration is stored in `~/.plob/config.json`.
|
|
225
|
+
|
|
226
|
+
Default configuration:
|
|
227
|
+
```json
|
|
228
|
+
{
|
|
229
|
+
"network": "sepolia",
|
|
230
|
+
"indexerUrl": "https://api.thegraph.com/subgraphs/name/paylobster/registry"
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Wallet Security
|
|
235
|
+
|
|
236
|
+
### Environment Variable (Recommended for Production)
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
export PRIVATE_KEY="0x..."
|
|
240
|
+
plob status
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Keystore File (Development)
|
|
244
|
+
|
|
245
|
+
Private keys are stored in `~/.plob/keystore/` with restricted permissions (0600).
|
|
246
|
+
|
|
247
|
+
⚠️ **Warning**: The current keystore implementation is **not encrypted**. For production use:
|
|
248
|
+
- Use environment variables
|
|
249
|
+
- Use hardware wallets
|
|
250
|
+
- Implement proper key encryption
|
|
251
|
+
|
|
252
|
+
## Networks
|
|
253
|
+
|
|
254
|
+
### Base Sepolia (Testnet)
|
|
255
|
+
- Chain ID: 84532
|
|
256
|
+
- RPC: https://sepolia.base.org
|
|
257
|
+
- Block Explorer: https://sepolia.basescan.org
|
|
258
|
+
|
|
259
|
+
### Base Mainnet
|
|
260
|
+
- Chain ID: 8453
|
|
261
|
+
- RPC: https://mainnet.base.org
|
|
262
|
+
- Block Explorer: https://basescan.org
|
|
263
|
+
|
|
264
|
+
## Error Handling
|
|
265
|
+
|
|
266
|
+
The CLI provides clean error messages and proper exit codes:
|
|
267
|
+
|
|
268
|
+
- Exit code `0`: Success
|
|
269
|
+
- Exit code `1`: Error
|
|
270
|
+
|
|
271
|
+
### Common Issues
|
|
272
|
+
|
|
273
|
+
**"No wallet configured"**
|
|
274
|
+
```bash
|
|
275
|
+
# Solution: Set up authentication
|
|
276
|
+
plob auth --private-key 0x...
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
**"Insufficient balance"**
|
|
280
|
+
```bash
|
|
281
|
+
# Solution: Fund your wallet with USDC
|
|
282
|
+
# Bridge USDC to Base or buy from an exchange
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**"Agent already registered"**
|
|
286
|
+
```bash
|
|
287
|
+
# You can only register once per address
|
|
288
|
+
plob status # Check current registration
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
## JSON Output
|
|
292
|
+
|
|
293
|
+
All commands support `--json` flag for machine-readable output:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
plob status --json
|
|
297
|
+
plob escrow list --json
|
|
298
|
+
plob reputation --json
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Example JSON output:
|
|
302
|
+
```json
|
|
303
|
+
{
|
|
304
|
+
"name": "my-agent",
|
|
305
|
+
"address": "0x742d...",
|
|
306
|
+
"registered": true,
|
|
307
|
+
"balance": {
|
|
308
|
+
"usdc": "125.50",
|
|
309
|
+
"eth": "0.05"
|
|
310
|
+
},
|
|
311
|
+
"reputation": 85
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## Development
|
|
316
|
+
|
|
317
|
+
### Build
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
npm run build
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Run without building
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
npm run dev -- status
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Link locally
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
npm run link
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Test
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
npm test
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## Contract Addresses
|
|
342
|
+
|
|
343
|
+
### Base Mainnet
|
|
344
|
+
- Identity: `0xA174f250380c4B5C37F6709bBa719E662b77E662`
|
|
345
|
+
- Reputation: `0x02bb4c4cd10EeaCD04DF7631c81d6E7c1d0c4b29`
|
|
346
|
+
- Credit: `0xD924B81F2d8EFF3E0A3Bf0a4b9D77d37CC0980E1`
|
|
347
|
+
- Escrow: `0x49Ed7003C6941a033E7dD8b44552e4E18cf28806`
|
|
348
|
+
- USDC: `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`
|
|
349
|
+
|
|
350
|
+
### Base Sepolia
|
|
351
|
+
- Identity: `0x3dfA02Ed4F0e4F10E8031d7a4cB8Ea0bBbFbCB8c`
|
|
352
|
+
- Reputation: `0xb0033901e3b94f4F36dA0b3e59A1F4AD9f4f1697`
|
|
353
|
+
- Credit: `0xBA64e2b2F2a80D03A4B13b3396942C1e78205C7d`
|
|
354
|
+
- Escrow: `0x78D1f50a1965dE34f6b5a3D3546C94FE1809Cd82`
|
|
355
|
+
- USDC: `0x036CbD53842c5426634e7929541eC2318f3dCF7e`
|
|
356
|
+
|
|
357
|
+
## Resources
|
|
358
|
+
|
|
359
|
+
- **Website**: https://paylobster.com
|
|
360
|
+
- **Docs**: https://docs.paylobster.com
|
|
361
|
+
- **GitHub**: https://github.com/itsGustav/Pay-Lobster
|
|
362
|
+
- **Discord**: https://discord.gg/paylobster
|
|
363
|
+
|
|
364
|
+
## License
|
|
365
|
+
|
|
366
|
+
MIT © PayLobster Team
|
|
367
|
+
|
|
368
|
+
## Support
|
|
369
|
+
|
|
370
|
+
Need help?
|
|
371
|
+
- Open an issue on GitHub
|
|
372
|
+
- Join our Discord
|
|
373
|
+
- Email: dev@paylobster.com
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
Built with ❤️ by the PayLobster team
|
package/TEST_REPORT.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# PayLobster CLI - Base Sepolia E2E Test Report
|
|
2
|
+
|
|
3
|
+
**Date**: 2026-02-10
|
|
4
|
+
**Network**: Base Sepolia Testnet
|
|
5
|
+
**Wallet**: 0x19D3B7A92295eAa3Cf81C2538cbB68d58E34b436
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🎯 Summary
|
|
10
|
+
|
|
11
|
+
**Build Status**: ✅ **SUCCESS**
|
|
12
|
+
**Critical Issues Found**: 2
|
|
13
|
+
**Issues Fixed**: 5
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 🐛 Issues Found & Fixed
|
|
18
|
+
|
|
19
|
+
### 1. TypeScript Target Too Old (FIXED ✅)
|
|
20
|
+
- **Issue**: `tsconfig.json` had `target: "ES2020"` but `ox` library needs ES2022 for Error.cause
|
|
21
|
+
- **Fix**: Updated to `target: "ES2022"` and `lib: ["ES2022", "DOM"]`
|
|
22
|
+
- **Impact**: Build was failing with 17+ TypeScript errors
|
|
23
|
+
|
|
24
|
+
### 2. Wrong viem Import (FIXED ✅)
|
|
25
|
+
- **Issue**: `wallet.ts` imported `privateKeyToAccount` from `viem` instead of `viem/accounts`
|
|
26
|
+
- **Fix**: Updated import to `import { privateKeyToAccount } from 'viem/accounts';`
|
|
27
|
+
- **Impact**: TypeScript error, would fail at runtime
|
|
28
|
+
|
|
29
|
+
### 3. Missing Chain Parameter (FIXED ✅)
|
|
30
|
+
- **Issue**: All `writeContract` calls were missing the required `chain` parameter
|
|
31
|
+
- **Affected Functions**:
|
|
32
|
+
- `registerAgent()` in contracts.ts
|
|
33
|
+
- `createEscrow()` - both approve and createEscrow calls
|
|
34
|
+
- `releaseEscrow()` in contracts.ts
|
|
35
|
+
- **Fix**: Added `chain` parameter to all writeContract calls
|
|
36
|
+
- **Impact**: Viem v2.45.3 requires explicit chain for write operations
|
|
37
|
+
|
|
38
|
+
### 4. Wrong EIP-55 Checksums (FIXED ✅)
|
|
39
|
+
- **Issue**: Contract addresses had incorrect checksumming
|
|
40
|
+
- **Fixed Addresses**:
|
|
41
|
+
- Identity: `0x3dfA02Ed...` → `0x3DFA02ed4F0E4F10e8031D7A4CB8Ea0BbbFBcB8C`
|
|
42
|
+
- Credit: `0xBA64e2b2...` → `0xBa64E2B2f2a80d03A4B13b3396942C1e78205c7d`
|
|
43
|
+
- Escrow: `0x78D1f50a...` → `0x78D1f50a1965de34f6b5a3D3546C94fe1809CD82`
|
|
44
|
+
- **Impact**: viem would reject all contract calls with "invalid address" error
|
|
45
|
+
|
|
46
|
+
### 5. Invalid Reputation Contract Address (CRITICAL ⚠️)
|
|
47
|
+
- **Issue**: Provided address `0xb0033901e3b94f4F36dA0b3e396942C1e78205C7d` has **41 hex characters** (should be 40)
|
|
48
|
+
- **Status**: Temporarily using `0x0000...0000` as placeholder with TODO comment
|
|
49
|
+
- **Impact**: Reputation commands will fail until correct address is provided
|
|
50
|
+
- **Action Required**: ⚠️ **Need correct 40-character Reputation contract address**
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## ✅ Commands Tested - What Works
|
|
55
|
+
|
|
56
|
+
### Basic Commands (No Wallet Required)
|
|
57
|
+
- ✅ `plob --help` - Displays CLI help
|
|
58
|
+
- ✅ `plob config show` - Shows current configuration
|
|
59
|
+
- ✅ `plob config set network sepolia` - Sets network
|
|
60
|
+
- ✅ `plob auth --help` - Shows auth options
|
|
61
|
+
- ✅ `plob register --help` - Shows register options
|
|
62
|
+
- ✅ `plob escrow --help` - Shows escrow commands
|
|
63
|
+
- ✅ `plob pay --help` - Shows payment options
|
|
64
|
+
|
|
65
|
+
### Configuration
|
|
66
|
+
```bash
|
|
67
|
+
$ node dist/bin/plob.js config show
|
|
68
|
+
┌────────────┬─────────────────────────────────────────────────────────────┐
|
|
69
|
+
│ Setting │ Value │
|
|
70
|
+
├────────────┼─────────────────────────────────────────────────────────────┤
|
|
71
|
+
│ network │ Base Sepolia │
|
|
72
|
+
│ rpcUrl │ default │
|
|
73
|
+
│ indexerUrl │ https://api.thegraph.com/subgraphs/name/paylobster/registry │
|
|
74
|
+
│ wallet │ env │
|
|
75
|
+
└────────────┴─────────────────────────────────────────────────────────────┘
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## ❌ Commands Tested - Known Issues
|
|
81
|
+
|
|
82
|
+
### 1. `plob status` (BROKEN ⚠️)
|
|
83
|
+
```bash
|
|
84
|
+
$ PRIVATE_KEY=0x... node dist/bin/plob.js status
|
|
85
|
+
❌ Failed to fetch status: The contract function "getUserTransactionCount" returned no data
|
|
86
|
+
```
|
|
87
|
+
**Issue**: Contract ABI mismatch - deployed Escrow V3 doesn't have `getUserTransactionCount` function
|
|
88
|
+
**Cause**: ABI in `contracts.ts` doesn't match deployed contract
|
|
89
|
+
**Impact**: Cannot check agent status or transaction counts
|
|
90
|
+
|
|
91
|
+
### 2. `plob reputation <address>` (BROKEN ⚠️)
|
|
92
|
+
```bash
|
|
93
|
+
$ node dist/bin/plob.js reputation 0x...
|
|
94
|
+
❌ Failed to fetch reputation: The contract function "getReputation" returned no data
|
|
95
|
+
```
|
|
96
|
+
**Issue**: Using placeholder address (0x000...000) because provided Reputation address is invalid
|
|
97
|
+
**Impact**: Cannot check reputation scores until correct contract address is provided
|
|
98
|
+
|
|
99
|
+
### 3. Write Operations (UNTESTED ⚠️)
|
|
100
|
+
The following commands build successfully but couldn't be tested without:
|
|
101
|
+
- Testnet ETH for gas
|
|
102
|
+
- Testnet USDC for payments
|
|
103
|
+
- Properly deployed/verified contracts
|
|
104
|
+
|
|
105
|
+
**Untested Commands**:
|
|
106
|
+
- `plob register --name "..." --capabilities "..."`
|
|
107
|
+
- `plob escrow create --to <addr> --amount <amount> --desc "..."`
|
|
108
|
+
- `plob escrow release <id>`
|
|
109
|
+
- `plob pay --to <addr> --amount <amount>`
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 📋 Contract Addresses (Base Sepolia)
|
|
114
|
+
|
|
115
|
+
| Contract | Address | Status |
|
|
116
|
+
|------------|---------|--------|
|
|
117
|
+
| Identity | `0x3DFA02ed4F0E4F10e8031D7A4CB8Ea0BbbFBcB8C` | ✅ Valid checksum |
|
|
118
|
+
| Reputation | ⚠️ **INVALID** (41 chars) | ❌ Need correct address |
|
|
119
|
+
| Credit | `0xBa64E2B2f2a80d03A4B13b3396942C1e78205c7d` | ✅ Valid checksum |
|
|
120
|
+
| Escrow V3 | `0x78D1f50a1965de34f6b5a3D3546C94fe1809CD82` | ✅ Valid checksum |
|
|
121
|
+
| USDC | `0x036CbD53842c5426634e7929541eC2318f3dCF7e` | ✅ Valid checksum |
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 🔧 Files Modified
|
|
126
|
+
|
|
127
|
+
1. **tsconfig.json** (already fixed in previous commit)
|
|
128
|
+
- Updated target and lib to ES2022
|
|
129
|
+
- Added DOM lib for ox library compatibility
|
|
130
|
+
|
|
131
|
+
2. **src/lib/wallet.ts** (already fixed in previous commit)
|
|
132
|
+
- Fixed privateKeyToAccount import
|
|
133
|
+
|
|
134
|
+
3. **src/lib/contracts.ts** (committed in this test)
|
|
135
|
+
- Fixed contract address checksums
|
|
136
|
+
- Added chain parameter to all writeContract calls
|
|
137
|
+
- Added TODO for invalid Reputation address
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 🚀 Next Steps
|
|
142
|
+
|
|
143
|
+
### Critical (Block Production Use)
|
|
144
|
+
1. ⚠️ **Get correct Reputation contract address** (40 hex chars, not 41)
|
|
145
|
+
2. ⚠️ **Verify Escrow V3 ABI** - deployed contract doesn't match ABI in code
|
|
146
|
+
3. Test actual write operations with testnet funds
|
|
147
|
+
|
|
148
|
+
### Optional Improvements
|
|
149
|
+
4. Add better error handling for "contract not deployed" scenarios
|
|
150
|
+
5. Add `--address` flag to `status` command for checking other addresses (read-only)
|
|
151
|
+
6. Add dry-run mode for testing without spending gas
|
|
152
|
+
7. Add contract verification check on startup
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 📊 Test Environment
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
Node.js: v25.6.0
|
|
160
|
+
TypeScript: Latest (via tsc)
|
|
161
|
+
Viem: 2.45.3
|
|
162
|
+
Network: Base Sepolia (chainId: 84532)
|
|
163
|
+
RPC: Default (viem built-in)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## ✅ Git Commit
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
commit 75af2896...
|
|
172
|
+
fix: CLI contract addresses — proper checksums + invalid Reputation address
|
|
173
|
+
|
|
174
|
+
- Fix EIP-55 checksumming for Identity, Credit, Escrow addresses
|
|
175
|
+
- Document invalid Reputation address (41 hex chars instead of 40)
|
|
176
|
+
- Add chain parameter to all writeContract calls
|
|
177
|
+
- Tested against Base Sepolia testnet
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 🎓 Lessons Learned
|
|
183
|
+
|
|
184
|
+
1. **Viem v2 is strict** - Requires proper checksums and explicit chain parameter
|
|
185
|
+
2. **Contract ABIs drift** - Need verification that deployed contract matches ABI
|
|
186
|
+
3. **Address validation** - Always validate addresses have exactly 40 hex characters
|
|
187
|
+
4. **TypeScript targets matter** - Modern libraries need ES2022+
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
**End of Report**
|
package/bin/plob.js
ADDED