Update market buy handler to use new GPU buy endpoint
Some checks failed
Security Scanning / security-scan (push) Has been cancelled
CLI Tests / test-cli (push) Failing after 3s

This commit is contained in:
aitbc
2026-04-28 18:09:49 +02:00
parent 2b0769d4de
commit 05e5d59b8c

View File

@@ -292,16 +292,17 @@ def handle_market_buy(args, default_coordinator_url, read_password, render_mappi
print("Error: --item and --wallet are required")
sys.exit(1)
# Submit purchase to coordinator API (no blockchain transaction needed for now)
# Submit purchase to coordinator API
purchase_data = {
"item_id": args.item,
"wallet": args.wallet,
"action": "buy"
"buyer_id": args.wallet,
"gpu_id": args.item,
"duration_hours": 1.0,
"payment_method": "blockchain"
}
print(f"Submitting purchase to {coordinator_url}...")
try:
response = requests.post(f"{coordinator_url}/v1/marketplace/buy", json=purchase_data, timeout=30)
response = requests.post(f"{coordinator_url}/v1/marketplace/gpu/buy", json=purchase_data, timeout=30)
if response.status_code in (200, 201):
result = response.json()
print("Purchase submitted successfully")