feat: include targetEvents in parsedZap
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Kieran 2023-11-14 13:55:15 +00:00
parent e398bf8e82
commit e65845af6d
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
3 changed files with 11 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@snort/system-react",
"version": "1.1.3",
"version": "1.1.4",
"description": "React hooks for @snort/system",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@ -16,7 +16,7 @@
],
"dependencies": {
"@snort/shared": "^1.0.9",
"@snort/system": "^1.1.3",
"@snort/system": "^1.1.4",
"react": "^18.2.0"
},
"devDependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@snort/system",
"version": "1.1.3",
"version": "1.1.4",
"description": "Snort nostr system package",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@ -51,6 +51,7 @@ export function parseZap(zapReceipt: NostrEvent): ParsedZap {
content: zapRequest.content,
errors: [],
pollOption: pollOpt ? Number(pollOpt) : undefined,
targetEvents: NostrLink.fromTags(zapRequest.tags),
};
if (findTag(zapRequest, "p") !== findTag(zapReceipt, "p")) {
ret.valid = false;
@ -75,7 +76,8 @@ export function parseZap(zapReceipt: NostrEvent): ParsedZap {
valid: false,
anonZap: false,
errors: ["invalid zap, parsing failed"],
};
targetEvents: [],
} as ParsedZap;
if (!ret.valid) {
Log("Invalid zap %O", ret);
}
@ -96,4 +98,9 @@ export interface ParsedZap {
content?: string;
sender?: string;
pollOption?: number;
/**
* A list of targets this zap is zapping
*/
targetEvents: Array<NostrLink>;
}