diff options
| author | Adam Soltys <[email protected]> | 2023-01-11 22:09:48 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-01-12 15:44:13 -0800 |
| commit | c3565838644123e77881ff4f8536792f074047b9 (patch) | |
| tree | 96da43fd19940d2f0836e43a511f0a1fb365044d /lib/webhooks.js | |
| parent | ded2c69ce89438326523a512b570be6eee4b23f0 (diff) | |
| download | coinos-server-c3565838644123e77881ff4f8536792f074047b9.tar.gz coinos-server-c3565838644123e77881ff4f8536792f074047b9.zip | |
migrating to redis
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) { |
