applesauce-core 0.0.0-next-20241103143210 → 0.0.0-next-20241106103342
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.
- package/dist/helpers/zap.d.ts +1 -0
- package/dist/helpers/zap.js +2 -1
- package/package.json +1 -1
package/dist/helpers/zap.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const ZapRequestSymbol: unique symbol;
|
|
|
3
3
|
export declare const ZapFromSymbol: unique symbol;
|
|
4
4
|
export declare const ZapInvoiceSymbol: unique symbol;
|
|
5
5
|
export declare const ZapEventPointerSymbol: unique symbol;
|
|
6
|
+
export declare const ZapAddressPointerSymbol: unique symbol;
|
|
6
7
|
export declare function getZapSender(zap: NostrEvent): string;
|
|
7
8
|
export declare function getZapRecipient(zap: NostrEvent): string;
|
|
8
9
|
export declare function getZapPayment(zap: NostrEvent): import("./bolt11.js").ParsedInvoice | undefined;
|
package/dist/helpers/zap.js
CHANGED
|
@@ -8,6 +8,7 @@ export const ZapRequestSymbol = Symbol.for("zap-request");
|
|
|
8
8
|
export const ZapFromSymbol = Symbol.for("zap-from");
|
|
9
9
|
export const ZapInvoiceSymbol = Symbol.for("zap-bolt11");
|
|
10
10
|
export const ZapEventPointerSymbol = Symbol.for("zap-event-pointer");
|
|
11
|
+
export const ZapAddressPointerSymbol = Symbol.for("zap-address-pointer");
|
|
11
12
|
export function getZapSender(zap) {
|
|
12
13
|
return getTagValue(zap, "P") || getZapRequest(zap).pubkey;
|
|
13
14
|
}
|
|
@@ -24,7 +25,7 @@ export function getZapPayment(zap) {
|
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
export function getZapAddressPointer(zap) {
|
|
27
|
-
return getOrComputeCachedValue(zap,
|
|
28
|
+
return getOrComputeCachedValue(zap, ZapAddressPointerSymbol, () => {
|
|
28
29
|
const a = zap.tags.find(isATag);
|
|
29
30
|
return a ? getAddressPointerFromTag(a) : null;
|
|
30
31
|
});
|