Better tags

This commit is contained in:
koalasat 2024-07-16 13:16:48 +02:00
parent a6c2130846
commit c597cc8129
No known key found for this signature in database
GPG Key ID: 2F7F61C6146AB157

View File

@ -53,7 +53,7 @@ class Nostr:
["expiration", order.expires_at.timestamp()], ["expiration", order.expires_at.timestamp()],
["y", "robosats", config("COORDINATOR_ALIAS", cast=str)], ["y", "robosats", config("COORDINATOR_ALIAS", cast=str)],
["n", order.network], ["n", order.network],
["layer", "lightning"], ["layer", self.get_layer_tag(order)],
["g", pygeohash.encode(order.latitude, order.longitude)], ["g", pygeohash.encode(order.latitude, order.longitude)],
["bond", order.bond], ["bond", order.bond],
["z", "order"], ["z", "order"],
@ -63,4 +63,10 @@ class Nostr:
if order.status == Order.Status.PUB: if order.status == Order.Status.PUB:
return "pending" return "pending"
else: else:
return "canceled" return "success"
def get_layer_tag(self, order):
if order.type == Order.Types.SELL:
return ["onchain", "lightning"]
else:
return ["lightning"]