feat: add created_at to parsed zaps
This commit is contained in:
parent
6d0b3a0be5
commit
c98f7ad12d
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@snort/system",
|
"name": "@snort/system",
|
||||||
"version": "1.1.5",
|
"version": "1.1.6",
|
||||||
"description": "Snort nostr system package",
|
"description": "Snort nostr system package",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
@ -52,6 +52,7 @@ export function parseZap(zapReceipt: NostrEvent): ParsedZap {
|
|||||||
errors: [],
|
errors: [],
|
||||||
pollOption: pollOpt ? Number(pollOpt) : undefined,
|
pollOption: pollOpt ? Number(pollOpt) : undefined,
|
||||||
targetEvents: NostrLink.fromTags(zapRequest.tags),
|
targetEvents: NostrLink.fromTags(zapRequest.tags),
|
||||||
|
created_at: zapRequest.created_at,
|
||||||
};
|
};
|
||||||
if (findTag(zapRequest, "p") !== findTag(zapReceipt, "p")) {
|
if (findTag(zapRequest, "p") !== findTag(zapReceipt, "p")) {
|
||||||
ret.valid = false;
|
ret.valid = false;
|
||||||
@ -77,6 +78,7 @@ export function parseZap(zapReceipt: NostrEvent): ParsedZap {
|
|||||||
anonZap: false,
|
anonZap: false,
|
||||||
errors: ["invalid zap, parsing failed"],
|
errors: ["invalid zap, parsing failed"],
|
||||||
targetEvents: [],
|
targetEvents: [],
|
||||||
|
created_at: zapReceipt.created_at,
|
||||||
} as ParsedZap;
|
} as ParsedZap;
|
||||||
if (!ret.valid) {
|
if (!ret.valid) {
|
||||||
Log("Invalid zap %O", ret);
|
Log("Invalid zap %O", ret);
|
||||||
@ -98,6 +100,7 @@ export interface ParsedZap {
|
|||||||
content?: string;
|
content?: string;
|
||||||
sender?: string;
|
sender?: string;
|
||||||
pollOption?: number;
|
pollOption?: number;
|
||||||
|
created_at: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of targets this zap is zapping
|
* A list of targets this zap is zapping
|
||||||
|
Loading…
Reference in New Issue
Block a user