Apply sequential deltas from Nostr

This commit is contained in:
thePR0M3TH3AN
2025-07-24 19:41:35 -04:00
parent 5850b68c9a
commit 24a606fb70
3 changed files with 125 additions and 12 deletions

View File

@@ -594,6 +594,9 @@ class NostrClient:
)
timeout = timedelta(seconds=10)
events = (await self.client.fetch_events(f, timeout)).to_vec()
events.sort(
key=lambda ev: getattr(ev, "created_at", getattr(ev, "timestamp", 0))
)
deltas: list[bytes] = []
for ev in events:
deltas.append(base64.b64decode(ev.content().encode("utf-8")))