Spaces:
Sleeping
Sleeping
Update components/agentcreation.py
Browse files
components/agentcreation.py
CHANGED
|
@@ -63,11 +63,12 @@ async def transfer_sol(from_keypair, to_pubkey, amount_sol):
|
|
| 63 |
def load_keypair(agent):
|
| 64 |
|
| 65 |
document=coll.find_one({"owner":"system"})
|
| 66 |
-
agents=document["agents"]
|
| 67 |
keypair=None
|
|
|
|
| 68 |
print(agents)
|
| 69 |
-
|
| 70 |
-
|
|
|
|
| 71 |
keypair=doc["secret_key"]
|
| 72 |
|
| 73 |
secret_key_bytes =bytes.fromhex(keypair)
|
|
|
|
| 63 |
def load_keypair(agent):
|
| 64 |
|
| 65 |
document=coll.find_one({"owner":"system"})
|
|
|
|
| 66 |
keypair=None
|
| 67 |
+
agents=document.get("agents")
|
| 68 |
print(agents)
|
| 69 |
+
|
| 70 |
+
for doc in agents:
|
| 71 |
+
if doc["agent_id"]==agent:
|
| 72 |
keypair=doc["secret_key"]
|
| 73 |
|
| 74 |
secret_key_bytes =bytes.fromhex(keypair)
|