๐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:
X-API-key
base64
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:
tickerIn
String
The ticker symbol of the input currency.
Yes
tickerOut
String
The ticker symbol of the output currency.
Yes
amountIn
String
The amount of the input currency.
Yes
Response:
Error Handling:
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:
sender
String
The UUID or the label of the sender.
No
tickerIn
String
The ticker symbol of the currency to swap from.
Yes
tickerOut
String
The ticker symbol of the currency to swap to.
Yes
amountIn
String
The amount of currency to swap.
Yes
slippage
Integer
The slippage percentage in basis points.
Yes
Response:
Error Handling:
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:
uuid
or label
String
The UUID or the label of the sender.
Yes
page
Integer
The page number for paginated history data.
Yes
Response:
Error Handling:
Unauthorized
User is not logged in or session has expired.
Example Code:
Last updated