Junaidb commited on
Commit
fb7d059
·
verified ·
1 Parent(s): 79344b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -37,23 +37,24 @@ class Payment(BaseModel):
37
  instruction:str
38
 
39
 
40
-
41
  def load_keypair(agent):
42
 
43
- documents=coll.find_one({"owner":"system"})
44
- keypair=None
45
-
46
- for doc in documents:
47
- if doc["agent_id"]==agent:
48
- keypair=doc["secret_key"]
 
 
49
 
50
  secret_key_bytes =bytes.fromhex(keypair)
51
- keypair = Keypair.from_bytes(secret_key)
52
 
53
  print(f"✅ Keypair loaded from {path}")
54
  print(f"📍 Public Key: {keypair.pubkey()}")
55
 
56
- return keypair.pubkey()
57
 
58
 
59
 
@@ -79,7 +80,7 @@ async def PaymentInstruction(request:Payment):
79
  return {"status_":output}
80
 
81
  except error:
82
- return {"status_":False}
83
 
84
 
85
 
 
37
  instruction:str
38
 
39
 
 
40
  def load_keypair(agent):
41
 
42
+ document=coll.find_one({"owner":"system"})
43
+ keypair=None
44
+ agents=document.get("agents")
45
+ print(agents)
46
+
47
+ for doc in agents:
48
+ if doc["agent_id"]==agent:
49
+ keypair=doc["secret_key"]
50
 
51
  secret_key_bytes =bytes.fromhex(keypair)
52
+ keypair = Keypair.from_bytes(secret_key_bytes)
53
 
54
  print(f"✅ Keypair loaded from {path}")
55
  print(f"📍 Public Key: {keypair.pubkey()}")
56
 
57
+ return keypair
58
 
59
 
60
 
 
80
  return {"status_":output}
81
 
82
  except error:
83
+ return {"status_":False}
84
 
85
 
86