From 8781d15a5b26807ff69da36f5b147b850d7318de Mon Sep 17 00:00:00 2001 From: aitbc Date: Tue, 28 Apr 2026 18:32:50 +0200 Subject: [PATCH] Use existing book endpoint for marketplace buy instead of custom buy endpoint --- cli/handlers/market.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cli/handlers/market.py b/cli/handlers/market.py index 98cedec4..36bde8e7 100644 --- a/cli/handlers/market.py +++ b/cli/handlers/market.py @@ -292,16 +292,14 @@ 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 + # Submit purchase to coordinator API using existing book endpoint purchase_data = { - "buyer_id": args.wallet, - "duration_hours": 1.0, - "payment_method": "blockchain" + "duration_hours": 1.0 } print(f"Submitting purchase to {coordinator_url}...") try: - response = requests.post(f"{coordinator_url}/v1/marketplace/gpu/{args.item}/buy", json=purchase_data, timeout=30) + response = requests.post(f"{coordinator_url}/v1/marketplace/gpu/{args.item}/book", json=purchase_data, timeout=30) if response.status_code in (200, 201): result = response.json() print("Purchase submitted successfully")