diff --git a/api/nostr.py b/api/nostr.py index c2241fe96..dbfd418fe 100644 --- a/api/nostr.py +++ b/api/nostr.py @@ -41,6 +41,10 @@ async def send_order_event(self, order): def get_robot_name(self, order): return order.maker.username + @sync_to_async + def get_robot_currency(self, order): + return order.currency + def generate_tags(self, order, robot_name): hashed_id = hashlib.md5( f"{config("COORDINATOR_ALIAS", cast=str)}{order.id}".encode("utf-8") @@ -50,21 +54,21 @@ def generate_tags(self, order, robot_name): ["d", uuid.UUID(hashed_id)], ["name", robot_name], ["k", "sell" if order.type == Order.Types.SELL else "buy"], - ["f", order.currency], + ["f", self.get_robot_currency(order)], ["s", self.get_status_tag(order)], ["amt", "0"], ["fa", order.amount], ["pm", order.payment_method.split(" ")], - ["premium", order.premium_percentile * 100], + ["premium", order.premium * 100], [ "source", f"{config("HOST_NAME")}/{config("COORDINATOR_ALIAS")}/order/{order.id}", ], ["expiration", order.expires_at.timestamp()], ["y", "robosats", config("COORDINATOR_ALIAS", cast=str)], - ["n", order.network], + ["n", str(config("NETWORK"))], ["layer", self.get_layer_tag(order)], - ["bond", order.bond], + ["bond", order.bond_size], ["z", "order"], ]