mirror of
https://github.com/RoboSats/robosats.git
synced 2025-09-13 00:56:22 +00:00
Fix nostr
This commit is contained in:
10
api/nostr.py
10
api/nostr.py
@ -27,7 +27,7 @@ class Nostr:
|
|||||||
keys = Keys.parse(config("NOSTR_NSEC", cast=str))
|
keys = Keys.parse(config("NOSTR_NSEC", cast=str))
|
||||||
client = await self.initialize_client(keys)
|
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)
|
robot_hash_id = await self.get_robot_hash_id(order)
|
||||||
currency = await self.get_robot_currency(order)
|
currency = await self.get_robot_currency(order)
|
||||||
|
|
||||||
@ -53,9 +53,7 @@ class Nostr:
|
|||||||
Tag.parse(
|
Tag.parse(
|
||||||
[
|
[
|
||||||
"order_id",
|
"order_id",
|
||||||
f"{config("COORDINATOR_ALIAS", cast=str)}#{order.id}".encode(
|
f"{config("COORDINATOR_ALIAS", cast=str)}#{order.id}",
|
||||||
"utf-8"
|
|
||||||
),
|
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
Tag.parse(["status", Order.Status(order.status).label]),
|
Tag.parse(["status", Order.Status(order.status).label]),
|
||||||
@ -77,6 +75,10 @@ class Nostr:
|
|||||||
|
|
||||||
return client
|
return client
|
||||||
|
|
||||||
|
@sync_to_async
|
||||||
|
def get_user_name(self, order):
|
||||||
|
return order.maker.username
|
||||||
|
|
||||||
@sync_to_async
|
@sync_to_async
|
||||||
def get_robot_hash_id(self, order):
|
def get_robot_hash_id(self, order):
|
||||||
return order.maker.robot.hash_id
|
return order.maker.robot.hash_id
|
||||||
|
|||||||
Reference in New Issue
Block a user