Skip to content

Instantly share code, notes, and snippets.

@pavanjoshi914
Last active August 31, 2022 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavanjoshi914/9d81161e7628f7de0cba835d7e2560c4 to your computer and use it in GitHub Desktop.
Save pavanjoshi914/9d81161e7628f7de0cba835d7e2560c4 to your computer and use it in GitHub Desktop.
publishPaymentNotification: (
message: Message,
data: PaymentNotificationData
) => {
let status = "success"; // default. let's hope for success
if ("error" in data.response) {
status = "failed";
}
PubSub.publish(`ln.sendPayment.${status}`, {
response: data.response,
details: data.details,
paymentRequestDetails: data.paymentRequestDetails,
origin: message.origin,
metadata: message.metadata,
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment