mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 02:21:35 +00:00
Better tags
This commit is contained in:
parent
a6c2130846
commit
c597cc8129
10
api/nostr.py
10
api/nostr.py
@ -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"]
|
||||||
|
Loading…
Reference in New Issue
Block a user