Junaidb commited on
Commit
dca2589
·
verified ·
1 Parent(s): 9e73eae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -68
app.py CHANGED
@@ -261,7 +261,7 @@ def SetupAccount(data:Owner):
261
 
262
  "owner":data.owner,
263
  "endpoints":[],
264
- "dynamicendpoints":[]
265
  "agents":[]
266
 
267
  }
@@ -429,73 +429,6 @@ async def RegisterDynamicEndpoint(data:RegisterPayloadDynamic):
429
 
430
 
431
 
432
- @app.post("/register_agent")
433
- def RegisterAgent(data:RegisterAgent):
434
-
435
-
436
- try:
437
-
438
-
439
- document=coll.find_one({'owner':data.owner})
440
- agents=document["agents"]
441
-
442
- if len(agents) > 0:
443
-
444
- for agentobject in agents:
445
-
446
- if agentobject["agents"]==data.agent:
447
- return {"status":False,"message":"agent already present"}
448
-
449
-
450
-
451
- short_id = str(uuid.uuid4())[:5]
452
- short_id_e=short_id+"x402"
453
-
454
-
455
- payload={
456
- "owner":data.owner,
457
- "agent":data.agent,
458
- "meta":data.meta,
459
- "agent_linker":short_id_e,
460
- "price":data.price,
461
- "invoices":[]
462
- #"pay_per_request":data.pay_per_request
463
- }
464
-
465
-
466
-
467
- coll.update_one(
468
- {"owner": data.owner},
469
- {"$push": {"agents": payload}}
470
-
471
- )
472
-
473
- marketpayload={
474
-
475
- "owner":data.owner,
476
- "agent_linker":short_id_e,
477
- "meta":data.meta,
478
- "description":data.description,
479
- "endpoint_method":"",
480
- "price":data.price,
481
- "endpoint_mcp_base":"https://mcpv100-production.up.railway.app/mcp:8080",
482
- "calls":0,
483
- "failures":0
484
-
485
-
486
- }
487
-
488
- saveToMarket(marketpayload)
489
-
490
-
491
- return {"status":True,"x402ify_tag":short_id_e,"message":"done"}
492
-
493
- except Exception as e:
494
- return {"status":False,"x402ify_tag":str(e),"message":"error"}
495
-
496
-
497
-
498
-
499
 
500
 
501
 
 
261
 
262
  "owner":data.owner,
263
  "endpoints":[],
264
+ "dynamicendpoints":[],
265
  "agents":[]
266
 
267
  }
 
429
 
430
 
431
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
432
 
433
 
434