From c98f7ad12dbbd7862711bb23fa086c92171d1cf1 Mon Sep 17 00:00:00 2001 From: Kieran Date: Thu, 7 Dec 2023 14:41:57 +0000 Subject: [PATCH] feat: add created_at to parsed zaps --- packages/system/package.json | 2 +- packages/system/src/zaps.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/system/package.json b/packages/system/package.json index b83c5fa3..6e030b6d 100644 --- a/packages/system/package.json +++ b/packages/system/package.json @@ -1,6 +1,6 @@ { "name": "@snort/system", - "version": "1.1.5", + "version": "1.1.6", "description": "Snort nostr system package", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/system/src/zaps.ts b/packages/system/src/zaps.ts index 11487482..f8df17f7 100644 --- a/packages/system/src/zaps.ts +++ b/packages/system/src/zaps.ts @@ -52,6 +52,7 @@ export function parseZap(zapReceipt: NostrEvent): ParsedZap { errors: [], pollOption: pollOpt ? Number(pollOpt) : undefined, targetEvents: NostrLink.fromTags(zapRequest.tags), + created_at: zapRequest.created_at, }; if (findTag(zapRequest, "p") !== findTag(zapReceipt, "p")) { ret.valid = false; @@ -77,6 +78,7 @@ export function parseZap(zapReceipt: NostrEvent): ParsedZap { anonZap: false, errors: ["invalid zap, parsing failed"], targetEvents: [], + created_at: zapReceipt.created_at, } as ParsedZap; if (!ret.valid) { Log("Invalid zap %O", ret); @@ -98,6 +100,7 @@ export interface ParsedZap { content?: string; sender?: string; pollOption?: number; + created_at: number; /** * A list of targets this zap is zapping