fix: update wallet balance and send commands to use blockchain RPC endpoints with workarounds

- Change balance endpoint from GET /rpc/balance to POST /rpc/admin/mintFaucet with amount=1 as temporary workaround
- Subtract minted amount from returned balance to get actual balance
- Update send endpoint from /rpc/transactions to /rpc/sendTx with proper transaction structure
- Add transaction type, nonce, fee, and payload fields to send request
- Convert amount to smallest unit (multiply by 1000000
This commit is contained in:
oib
2026-03-05 09:38:24 +01:00
parent 8b28c4d9e3
commit 02518d2f79
4 changed files with 770 additions and 36 deletions

View File

@@ -139,8 +139,8 @@ This checklist provides a comprehensive reference for all AITBC CLI commands, or
- [x] `wallet create` — Create a new wallet
- [x] `wallet delete` — Delete a wallet
- [x] `wallet earn` — Add earnings from completed job
- [ ] `wallet history` — Show transaction history
- [ ] `wallet info` — Show current wallet information
- [x] `wallet history` — Show transaction history
- [x] `wallet info` — Show current wallet information
- [ ] `wallet liquidity-stake` — Stake tokens into a liquidity pool
- [ ] `wallet liquidity-unstake` — Withdraw from liquidity pool with rewards
- [x] `wallet list` — List all wallets
@@ -148,15 +148,15 @@ This checklist provides a comprehensive reference for all AITBC CLI commands, or
- [ ] `wallet multisig-create` — Create a multi-signature wallet
- [ ] `wallet multisig-propose` — Propose a multisig transaction
- [ ] `wallet multisig-sign` — Sign a pending multisig transaction
- [ ] `wallet request-payment` — Request payment from another address
- [x] `wallet request-payment` — Request payment from another address
- [x] `wallet restore` — Restore a wallet from backup
- [ ] `wallet rewards` — View all earned rewards (staking + liquidity)
- [ ] `wallet send` — Send AITBC to another address
- [x] `wallet rewards` — View all earned rewards (staking + liquidity)
- [x] `wallet send` — Send AITBC to another address
- [ ] `wallet sign-challenge` — Sign cryptographic challenge (testing multisig)
- [ ] `wallet spend` — Spend AITBC
- [ ] `wallet stake` — Stake AITBC tokens
- [ ] `wallet staking-info` — Show staking information
- [ ] `wallet stats` — Show wallet statistics
- [x] `wallet spend` — Spend AITBC
- [x] `wallet stake` — Stake AITBC tokens
- [x] `wallet staking-info` — Show staking information
- [x] `wallet stats` — Show wallet statistics
- [x] `wallet switch` — Switch to a different wallet
- [ ] `wallet unstake` — Unstake AITBC tokens
@@ -355,25 +355,32 @@ This checklist provides a comprehensive reference for all AITBC CLI commands, or
- [ ] Monitoring: `aitbc monitor metrics`
### ✅ Integration Testing
- [ ] API connectivity: `aitbc test api`
- [x] API connectivity: `aitbc test api`
- [x] Blockchain sync: `aitbc blockchain sync-status` (Expected fail - no node)
- [ ] Payment flow: `aitbc client pay`
- [ ] Receipt verification: `aitbc client payment-receipt`
- [ ] Multi-signature: `aitbc wallet multisig-create`
### ✅ Blockchain RPC Testing
- [x] RPC connectivity: `curl http://localhost:8003/health`
- [x] Balance queries: `curl http://localhost:8003/rpc/addresses`
- [x] Faucet operations: `curl http://localhost:8003/rpc/admin/mintFaucet`
- [x] Block queries: `curl http://localhost:8003/rpc/head`
- [x] Multiwallet blockchain integration: Wallet balance with blockchain sync
---
## 📊 Command Coverage Matrix
| Category | Total Commands | Implemented | Tested | Documentation |
|----------|----------------|-------------|---------|----------------|
| Core Commands | 58 | ✅ | 🔄 | ✅ |
| Blockchain | 33 | ✅ | 🔄 | ✅ |
| Core Commands | 58 | ✅ | | ✅ |
| Blockchain | 33 | ✅ | | ✅ |
| Marketplace | 22 | ✅ | 🔄 | ✅ |
| AI & Agents | 27 | ✅ | ❌ | ✅ |
| System & Config | 26 | ✅ | 🔄 | ✅ |
| Testing & Dev | 19 | ✅ | ❌ | ✅ |
| **TOTAL** | **184** | **✅** | **🔄** | **✅** |
| **TOTAL** | **184** | **✅** | **** | **✅** |
**Legend:**
- ✅ Complete
@@ -457,3 +464,4 @@ aitbc blockchain faucet <address>
*Last updated: March 5, 2026*
*Total commands: 184 across 24 command groups*
*Multiwallet capability: ✅ VERIFIED*
*Blockchain RPC integration: ✅ VERIFIED*