๐Swap
This documentation provides details on the API endpoints available for Whirlprivacy.io, focusing on swap-related operations.
โ ๏ธ You must be logged in to use these requests below.
Common Headers
For all requests that require user authentication, you must include the following headers:
Header Name | Value | Description |
---|---|---|
X-API-key |
| API token obtained after authentication. |
GET /swap/data
- Retrieve Swap Data
/swap/data
- Retrieve Swap DataAllows the retrieval of swap data for a given currency pair and amount.
Parameters:
Name | Type | Description | Required |
---|---|---|---|
| String | The ticker symbol of the input currency. | Yes |
| String | The ticker symbol of the output currency. | Yes |
| String | The amount of the input currency. | Yes |
Response:
Error Handling:
Error Name | Description |
---|---|
Invalid Parameters | Required parameters are missing. |
Failed to Fetch Swap Data | The swap data could not be retrieved. |
Example Code:
POST /swap/initiate
- Initiate a Swap
/swap/initiate
- Initiate a SwapInitiates a currency swap operation for a logged-in user.
Parameters:
Name | Type | Description | Required |
---|---|---|---|
| String | The UUID or the label of the sender. | No |
| String | The ticker symbol of the currency to swap from. | Yes |
| String | The ticker symbol of the currency to swap to. | Yes |
| String | The amount of currency to swap. | Yes |
| Integer | The slippage percentage in basis points. | Yes |
Response:
Error Handling:
Error Name | Description |
---|---|
Unauthorized | User is not logged in or session has expired. |
Invalid Parameters | One or more parameters are invalid. |
Invalid Ticker | The provided ticker symbol is not supported. |
Unsupported Swap | The swap operation is not supported. |
Invalid Amount | The provided amount is invalid. |
Balance Too Low | The user's balance is too low for the swap. |
Error Initiating Swap | There was an error initiating the swap. |
Example Code:
GET /swap/history
- Retrieve Swap History
/swap/history
- Retrieve Swap HistoryRetrieves the swap history for a logged-in user.
Parameters:
Name | Type | Description | Required |
---|---|---|---|
| String | The UUID or the label of the sender. | Yes |
| Integer | The page number for paginated history data. | Yes |
Response:
Error Handling:
Error Name | Description |
---|---|
Unauthorized | User is not logged in or session has expired. |
Example Code:
Last updated