-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a12561f
commit f37091f
Showing
4 changed files
with
93 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
description: >- | ||
Get notified about swap status updates | ||
--- | ||
|
||
# 🪝 Webhooks | ||
|
||
To get the latest status of your swaps, you can poll the status endpoints of the REST API, subscribe to the WebSocket, | ||
or set a webhook when creating the swap. | ||
|
||
To register a webhook add the following object to the request that creates the swap: | ||
|
||
```json | ||
{ | ||
... | ||
"webhook": { | ||
"url": "<URL that should called>", | ||
"hashSwapId": false | ||
} | ||
} | ||
``` | ||
|
||
`url` will be called on every swap status update with a JSON object structured like this: | ||
|
||
```json | ||
{ | ||
"event": "swap.update", | ||
"data": { | ||
"id": "<swap id>", | ||
"status": "<new status of the swap>" | ||
} | ||
} | ||
``` | ||
|
||
Only HTTPS URLs are allowed for webhooks. | ||
`hashSwapId` is optional and defaults to false. | ||
When it is explicitly set to `true`, the swap id is hashed with SHA256 and encoded as HEX in the webhook call. | ||
That is useful when the webhook is processed by a third party to which you do not want to leak information about your | ||
swaps. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters