From cad1a865140f4b5fa0bb365f59419173c7854722 Mon Sep 17 00:00:00 2001 From: koalasat Date: Thu, 8 Aug 2024 00:19:51 +0200 Subject: [PATCH] Fix integer tag --- api/nostr.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/nostr.py b/api/nostr.py index b061b5d7c..7665217e9 100644 --- a/api/nostr.py +++ b/api/nostr.py @@ -3,7 +3,7 @@ import uuid from asgiref.sync import sync_to_async -from nostr_sdk import Keys, Client, EventBuilder, NostrSigner, Kind, Tag +from nostr_sdk import Keys, Client, EventBuilder, NostrSigner, Kind, Tag, Timestamp from api.models import Order from decouple import config @@ -30,12 +30,13 @@ async def send_order_event(self, order): robot_name = await self.get_robot_name(order) currency = await self.get_robot_currency(order) + created_at = Timestamp.from_secs(int(order.created_at.timestamp())) event = ( EventBuilder( Kind(38383), "", self.generate_tags(order, robot_name, currency) ) - .custom_created_at(int(order.created_at.timestamp())) + .custom_created_at(created_at) .to_event(keys) ) output = await client.send_event(event)