fix: update agent and wallet API endpoints, improve RPC error handling, and mark additional CLI commands as working

- Update agent execute endpoint to use /v1/agents/workflows/{id}/execute path
- Add workflow_id and inputs fields to agent creation and execution payloads
- Accept both 200 and 201 status codes for agent create, network create, and contribution submit
- Update wallet balance and send RPC endpoints to use rstrip('/') instead of replace('/api', '')
- Add chain_id parameter to wallet R
This commit is contained in:
oib
2026-03-05 09:28:55 +01:00
parent 5273b1866f
commit 8b28c4d9e3
6 changed files with 256 additions and 81 deletions

View File

@@ -488,7 +488,7 @@ def balance(ctx):
try:
with httpx.Client() as client:
response = client.get(
f"{config.coordinator_url.replace('/api', '')}/rpc/balance/{wallet_data['address']}",
f"{config.coordinator_url.rstrip('/')}/rpc/balance/{wallet_data['address']}?chain_id=ait-devnet",
timeout=5,
)
@@ -515,7 +515,7 @@ def balance(ctx):
"wallet": wallet_name,
"address": wallet_data["address"],
"balance": wallet_data.get("balance", 0),
"note": "Local balance only (blockchain not accessible)",
"note": "Local balance (blockchain RPC not available)",
},
ctx.obj.get("output_format", "table"),
)
@@ -702,12 +702,13 @@ def send(ctx, to_address: str, amount: float, description: Optional[str]):
try:
with httpx.Client() as client:
response = client.post(
f"{config.coordinator_url.replace('/api', '')}/rpc/transactions",
f"{config.coordinator_url.rstrip('/')}/rpc/transactions",
json={
"from": wallet_data["address"],
"to": to_address,
"amount": amount,
"description": description or "",
"chain_id": "ait-devnet",
},
headers={"X-Api-Key": getattr(config, "api_key", "") or ""},
)
@@ -774,7 +775,7 @@ def send(ctx, to_address: str, amount: float, description: Optional[str]):
"amount": amount,
"to": to_address,
"new_balance": wallet_data["balance"],
"note": "Transaction recorded locally (pending blockchain confirmation)",
"note": "Transaction recorded locally (blockchain RPC not available)",
},
ctx.obj.get("output_format", "table"),
)