mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 12:11:35 +00:00
Remove created at
This commit is contained in:
parent
3433f4544d
commit
d79f27b5be
13
api/nostr.py
13
api/nostr.py
@ -3,7 +3,7 @@ import hashlib
|
|||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from asgiref.sync import sync_to_async
|
from asgiref.sync import sync_to_async
|
||||||
from nostr_sdk import Keys, Client, EventBuilder, NostrSigner, Kind, Tag, Timestamp
|
from nostr_sdk import Keys, Client, EventBuilder, NostrSigner, Kind, Tag
|
||||||
from api.models import Order
|
from api.models import Order
|
||||||
from decouple import config
|
from decouple import config
|
||||||
|
|
||||||
@ -30,15 +30,10 @@ class Nostr:
|
|||||||
|
|
||||||
robot_name = await self.get_robot_name(order)
|
robot_name = await self.get_robot_name(order)
|
||||||
currency = await self.get_robot_currency(order)
|
currency = await self.get_robot_currency(order)
|
||||||
created_at = Timestamp.from_secs(int(order.created_at.timestamp()))
|
|
||||||
|
|
||||||
event = (
|
event = EventBuilder(
|
||||||
EventBuilder(
|
Kind(38383), "", self.generate_tags(order, robot_name, currency)
|
||||||
Kind(38383), "", self.generate_tags(order, robot_name, currency)
|
).to_event(keys)
|
||||||
)
|
|
||||||
.custom_created_at(created_at)
|
|
||||||
.to_event(keys)
|
|
||||||
)
|
|
||||||
await client.send_event(event)
|
await client.send_event(event)
|
||||||
print(f"Nostr event sent: {event.as_json()}")
|
print(f"Nostr event sent: {event.as_json()}")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user