diff options
Diffstat (limited to 'lib/webhooks.js')
| -rw-r--r-- | lib/webhooks.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/webhooks.js b/lib/webhooks.js index 4741932a..c071eccb 100644 --- a/lib/webhooks.js +++ b/lib/webhooks.js @@ -1,5 +1,5 @@ import config from "$config"; -import wretch from "./wretch"; +import got from "got"; import { l } from "$lib/logging"; export const callWebhook = async (invoice, payment) => { @@ -14,10 +14,9 @@ export const callWebhook = async (invoice, payment) => { let secret = config.webhooks[webhook]; l("calling webhook", webhook, amount, hash, address, text); - let res = await wretch() - .headers({ "x-webhook": secret }) - .url(webhook) - .post({ + let res = await got(webhook, { + headers: { "x-webhook": secret }, + json: { address, amount, asset, @@ -27,8 +26,8 @@ export const callWebhook = async (invoice, payment) => { received, text, webhook - }) - .res(); + } + }).res(); return res; } } catch (e) { |
