applesauce-wallet 0.0.0-next-20251205152544 → 0.0.0-next-20251209200210

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,21 +19,21 @@ export function getNutzapMint(event) {
19
19
  }
20
20
  export function getNutzapRecipient(event) {
21
21
  const tag = event.tags.find(isPTag);
22
- return tag && getProfilePointerFromPTag(tag);
22
+ return tag ? (getProfilePointerFromPTag(tag) ?? undefined) : undefined;
23
23
  }
24
24
  /** Returns the event ID being nutzapped from a kind:9321 nutzap event */
25
25
  export function getNutzapEventPointer(event) {
26
26
  const tag = event.tags.find((t) => t[0] === "e");
27
27
  if (!tag)
28
28
  return;
29
- return getEventPointerFromETag(tag);
29
+ return getEventPointerFromETag(tag) ?? undefined;
30
30
  }
31
31
  /** Returns the event ID being nutzapped from a kind:9321 nutzap event */
32
32
  export function getNutzapAddressPointer(event) {
33
33
  const tag = event.tags.find((t) => t[0] === "a");
34
34
  if (!tag)
35
35
  return;
36
- return getAddressPointerFromATag(tag);
36
+ return getAddressPointerFromATag(tag) ?? undefined;
37
37
  }
38
38
  /** Returns the EventPointer or AddressPointer from a kind:9321 nutzap event */
39
39
  export function getNutzapPointer(event) {
@@ -1,11 +1,9 @@
1
- import { getReplaceableAddress, isReplaceable } from "applesauce-core/helpers";
2
1
  import { map } from "rxjs";
2
+ import { buildCommonEventRelationFilters } from "applesauce-core/helpers/model";
3
3
  import { getNutzapPointer, isValidNutzap, NUTZAP_KIND } from "../helpers/nutzap.js";
4
4
  /** A model that returns all nutzap events for an event */
5
5
  export function EventNutZapzModel(event) {
6
- return (events) => (isReplaceable(event.kind)
7
- ? events.timeline({ kinds: [NUTZAP_KIND], "#e": [event.id] })
8
- : events.timeline({ kinds: [NUTZAP_KIND], "#a": [getReplaceableAddress(event)] })).pipe(map((events) =>
6
+ return (events) => events.timeline(buildCommonEventRelationFilters({ kinds: [NUTZAP_KIND] }, event)).pipe(map((events) =>
9
7
  // Validate nutzap events
10
8
  events.filter(isValidNutzap)));
11
9
  }
@@ -1,4 +1,4 @@
1
- import { getReplaceableAddress, isAddressPointer, isEvent, isReplaceable } from "applesauce-core/helpers";
1
+ import { isAddressPointer, isEvent, isReplaceable } from "applesauce-core/helpers";
2
2
  import { modifyPublicTags } from "applesauce-core/operations";
3
3
  import { setContent } from "applesauce-core/operations/content";
4
4
  import { addAddressPointerTag, addEventPointerTag, addProfilePointerTag, setSingletonTag, } from "applesauce-core/operations/tag/common";
@@ -20,9 +20,7 @@ export function setRecipient(recipient) {
20
20
  export function setEvent(event) {
21
21
  let operation;
22
22
  if (isEvent(event))
23
- operation = isReplaceable(event.kind)
24
- ? addEventPointerTag(event.id)
25
- : addAddressPointerTag(getReplaceableAddress(event));
23
+ operation = isReplaceable(event.kind) ? addEventPointerTag(event.id) : addAddressPointerTag(event);
26
24
  else if (isAddressPointer(event))
27
25
  operation = addAddressPointerTag(event);
28
26
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "applesauce-wallet",
3
- "version": "0.0.0-next-20251205152544",
3
+ "version": "0.0.0-next-20251209200210",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -75,15 +75,15 @@
75
75
  "@cashu/cashu-ts": "^3.1.1",
76
76
  "@gandlaf21/bc-ur": "^1.1.12",
77
77
  "@noble/hashes": "^1.7.1",
78
- "applesauce-actions": "0.0.0-next-20251205152544",
79
- "applesauce-common": "0.0.0-next-20251205152544",
80
- "applesauce-core": "0.0.0-next-20251205152544",
78
+ "applesauce-actions": "0.0.0-next-20251209200210",
79
+ "applesauce-common": "0.0.0-next-20251209200210",
80
+ "applesauce-core": "0.0.0-next-20251209200210",
81
81
  "rxjs": "^7.8.1"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@hirez_io/observer-spy": "^2.2.0",
85
85
  "@types/debug": "^4.1.12",
86
- "applesauce-signers": "0.0.0-next-20251205152544",
86
+ "applesauce-signers": "0.0.0-next-20251209200210",
87
87
  "rimraf": "^6.0.1",
88
88
  "typescript": "^5.8.3",
89
89
  "vitest": "^4.0.15"