feat: add created_at to parsed zaps

This commit is contained in:
Kieran 2023-12-07 14:41:57 +00:00
parent 6d0b3a0be5
commit c98f7ad12d
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 4 additions and 1 deletions

View File

@ -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",

View File

@ -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