feat: message zaps
This commit is contained in:
@ -13,6 +13,7 @@ interface SendZapsProps {
|
||||
lnurl: string;
|
||||
pubkey?: string;
|
||||
aTag?: string;
|
||||
eTag?: string;
|
||||
targetName?: string;
|
||||
onFinish: () => void;
|
||||
button?: ReactNode;
|
||||
@ -22,6 +23,7 @@ function SendZaps({
|
||||
lnurl,
|
||||
pubkey,
|
||||
aTag,
|
||||
eTag,
|
||||
targetName,
|
||||
onFinish,
|
||||
}: SendZapsProps) {
|
||||
@ -57,7 +59,7 @@ function SendZaps({
|
||||
|
||||
const amountInSats = isFiat ? Math.floor((amount / UsdRate) * 1e8) : amount;
|
||||
let zap: NostrEvent | undefined;
|
||||
if (pubkey && aTag) {
|
||||
if (pubkey) {
|
||||
zap = await pub.zap(
|
||||
amountInSats * 1000,
|
||||
pubkey,
|
||||
@ -65,7 +67,13 @@ function SendZaps({
|
||||
undefined,
|
||||
comment,
|
||||
(eb) => {
|
||||
return eb.tag(["a", aTag]);
|
||||
if (aTag) {
|
||||
eb.tag(["a", aTag]);
|
||||
}
|
||||
if (eTag) {
|
||||
eb.tag(["e", eTag]);
|
||||
}
|
||||
return eb;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user