feat: add created_at to parsed zaps
This commit is contained in:
parent
6d0b3a0be5
commit
c98f7ad12d
@ -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",
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user