From c3565838644123e77881ff4f8536792f074047b9 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 11 Jan 2023 22:09:48 -0800 Subject: migrating to redis --- lib/webhooks.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/webhooks.js') 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) { -- cgit v1.2.3