aboutsummaryrefslogtreecommitdiffstats
path: root/lib/webhooks.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-06 16:48:13 -0800
committerAdam Soltys <[email protected]>2023-02-06 16:48:13 -0800
commit9c667055c6367e1b2e239686e72f52995679a47e (patch)
tree0b1d4aee51ec2d4e92d08a9d1404ba4e2ecd462a /lib/webhooks.js
parent15294844dbc8e73b4d1e92008a7eebc6b86b9ec5 (diff)
parent6f5602d112b68adb7452abf3047f20c32e7725b6 (diff)
downloadcoinos-server-9c667055c6367e1b2e239686e72f52995679a47e.tar.gz
coinos-server-9c667055c6367e1b2e239686e72f52995679a47e.zip
Merge branch 'master' into test
Diffstat (limited to 'lib/webhooks.js')
-rw-r--r--lib/webhooks.js13
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) {