aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/payments.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/payments.js b/lib/payments.js
index 2d322a15..ee143a82 100644
--- a/lib/payments.js
+++ b/lib/payments.js
@@ -9,6 +9,7 @@ import { fail } from "$lib/utils";
import { callWebhook } from "$lib/webhooks";
import dollarsToWords from "dollars-to-words";
import got from "got";
+import mqtt from "mqtt";
export const types = {
internal: "internal",
@@ -186,6 +187,11 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => {
}
}
+ const client = mqtt.connect('mqtt://ln.coinos.io', config.mqtt);
+ client.on('connect', function () {
+ client.publish('payments', `${p.amount}:${p.tip}:${p.rate}:${p.created}:${p.id}`);
+ });
+
return p;
};