diff --git a/api/nostr.py b/api/nostr.py index d2e7b4d3..af6d2fd2 100644 --- a/api/nostr.py +++ b/api/nostr.py @@ -27,7 +27,7 @@ class Nostr: keys = Keys.parse(config("NOSTR_NSEC", cast=str)) client = await self.initialize_client(keys) - robot_name = await self.get_robot_name(order) + robot_name = await self.get_user_name(order) robot_hash_id = await self.get_robot_hash_id(order) currency = await self.get_robot_currency(order) @@ -53,9 +53,7 @@ class Nostr: Tag.parse( [ "order_id", - f"{config("COORDINATOR_ALIAS", cast=str)}#{order.id}".encode( - "utf-8" - ), + f"{config("COORDINATOR_ALIAS", cast=str)}#{order.id}", ] ), Tag.parse(["status", Order.Status(order.status).label]), @@ -77,6 +75,10 @@ class Nostr: return client + @sync_to_async + def get_user_name(self, order): + return order.maker.username + @sync_to_async def get_robot_hash_id(self, order): return order.maker.robot.hash_id