diff options
| author | Adam Soltys <[email protected]> | 2023-11-23 23:39:15 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-11-23 23:39:19 +0000 |
| commit | 3d38a3656103b117fe1e68fa23aca3c1410fa969 (patch) | |
| tree | 36439ccee411ff8da6699f5ab160d1399065361c /lib | |
| parent | ab44bc3815c233a16586eada624672ff03e51224 (diff) | |
| download | coinos-server-3d38a3656103b117fe1e68fa23aca3c1410fa969.tar.gz coinos-server-3d38a3656103b117fe1e68fa23aca3c1410fa969.zip | |
new printer endpoints
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mqtt.js | 3 | ||||
| -rw-r--r-- | lib/payments.js | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/mqtt.js b/lib/mqtt.js index df87f42e..f8e19c19 100644 --- a/lib/mqtt.js +++ b/lib/mqtt.js @@ -1,4 +1,5 @@ import mqtt from "mqtt"; import config from "$config"; -export default mqtt.connect("mqtt://ln.coinos.io", config.mqtt); +export let mqtt1 = mqtt.connect("mqtt://ln.coinos.io", config.mqtt); +export let mqtt2 = mqtt.connect("mqtt://mqtt.coinos.io", config.mqtt); diff --git a/lib/payments.js b/lib/payments.js index f39e2937..148a6ea1 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -14,7 +14,7 @@ import ffmpeg from "fluent-ffmpeg"; import fs from "fs"; import EventEmitter from "events"; import crc32 from "buffer-crc32"; -import mqtt from "$lib/mqtt"; +import { mqtt1, mqtt2 } from "$lib/mqtt"; export const types = { internal: "internal", @@ -176,7 +176,12 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => { notify(user, `Received ${amount} sats`); callWebhook(invoice, p); - mqtt.publish( + mqtt1.publish( + username, + `pay:${p.amount}:${p.tip}:${p.rate}:${p.created}:${p.id}` + ); + + mqtt2.publish( username, `pay:${p.amount}:${p.tip}:${p.rate}:${p.created}:${p.id}` ); |
