mirror of
https://github.com/dergigi/boris.git
synced 2025-12-23 09:34:19 +01:00
chore: upgrade applesauce packages to v4.0.0
- Update all applesauce packages from 3.1.0 to 4.0.0 - Add applesauce-factory dependency - Version 4.0.0 includes app-data helpers needed for NIP-78
This commit is contained in:
37
node_modules/nostr-tools/lib/esm/nip57.js
generated
vendored
37
node_modules/nostr-tools/lib/esm/nip57.js
generated
vendored
@@ -132,41 +132,30 @@ async function getZapEndpoint(metadata) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function makeZapRequest({
|
||||
profile,
|
||||
event,
|
||||
amount,
|
||||
relays,
|
||||
comment = ""
|
||||
}) {
|
||||
if (!amount)
|
||||
throw new Error("amount not given");
|
||||
if (!profile)
|
||||
throw new Error("profile not given");
|
||||
function makeZapRequest(params) {
|
||||
let zr = {
|
||||
kind: 9734,
|
||||
created_at: Math.round(Date.now() / 1e3),
|
||||
content: comment,
|
||||
content: params.comment || "",
|
||||
tags: [
|
||||
["p", profile],
|
||||
["amount", amount.toString()],
|
||||
["relays", ...relays]
|
||||
["p", "pubkey" in params ? params.pubkey : params.event.pubkey],
|
||||
["amount", params.amount.toString()],
|
||||
["relays", ...params.relays]
|
||||
]
|
||||
};
|
||||
if (event && typeof event === "string") {
|
||||
zr.tags.push(["e", event]);
|
||||
}
|
||||
if (event && typeof event === "object") {
|
||||
if (isReplaceableKind(event.kind)) {
|
||||
const a = ["a", `${event.kind}:${event.pubkey}:`];
|
||||
if ("event" in params) {
|
||||
zr.tags.push(["e", params.event.id]);
|
||||
if (isReplaceableKind(params.event.kind)) {
|
||||
const a = ["a", `${params.event.kind}:${params.event.pubkey}:`];
|
||||
zr.tags.push(a);
|
||||
} else if (isAddressableKind(event.kind)) {
|
||||
let d = event.tags.find(([t, v]) => t === "d" && v);
|
||||
} else if (isAddressableKind(params.event.kind)) {
|
||||
let d = params.event.tags.find(([t, v]) => t === "d" && v);
|
||||
if (!d)
|
||||
throw new Error("d tag not found or is empty");
|
||||
const a = ["a", `${event.kind}:${event.pubkey}:${d[1]}`];
|
||||
const a = ["a", `${params.event.kind}:${params.event.pubkey}:${d[1]}`];
|
||||
zr.tags.push(a);
|
||||
}
|
||||
zr.tags.push(["k", params.event.kind.toString()]);
|
||||
}
|
||||
return zr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user