diff options
| author | Adam Soltys <[email protected]> | 2022-10-07 22:28:14 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-07 22:28:14 -0700 |
| commit | 4880d4a5cc0a5af8f74041fea248e653faeb17fc (patch) | |
| tree | 360d6251a05419abaf4549b79067107ac68cd60b /lib | |
| parent | 756017c5bf6b1858c231d39670b217a606f4e454 (diff) | |
| download | coinos-server-4880d4a5cc0a5af8f74041fea248e653faeb17fc.tar.gz coinos-server-4880d4a5cc0a5af8f74041fea248e653faeb17fc.zip | |
prettier
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/webhooks.js | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/lib/webhooks.js b/lib/webhooks.js index 51a9a99e..4741932a 100644 --- a/lib/webhooks.js +++ b/lib/webhooks.js @@ -4,34 +4,34 @@ import { l } from "$lib/logging"; export const callWebhook = async (invoice, payment) => { try { - if (!invoice || !payment) return; + if (!invoice || !payment) return; - let { address, received, text, webhook } = invoice; + let { address, received, text, webhook } = invoice; - if (webhook) { - let { amount, confirmed, hash, memo, account } = payment; - let { asset } = account; - let secret = config.webhooks[webhook]; + if (webhook) { + let { amount, confirmed, hash, memo, account } = payment; + let { asset } = account; + let secret = config.webhooks[webhook]; - l("calling webhook", webhook, amount, hash, address, text); - let res = await wretch() - .headers({ "x-webhook": secret }) - .url(webhook) - .post({ - address, - amount, - asset, - confirmed, - hash, - memo, - received, - text, - webhook - }) - .res() - return res; + l("calling webhook", webhook, amount, hash, address, text); + let res = await wretch() + .headers({ "x-webhook": secret }) + .url(webhook) + .post({ + address, + amount, + asset, + confirmed, + hash, + memo, + received, + text, + webhook + }) + .res(); + return res; + } + } catch (e) { + console.log("problem calling webhook", e); } - } catch(e) { - console.log("problem calling webhook", e) - } }; |
