Instant Swap API
Swap Pair Information
GET:
https://api.pegasusswap.com/api/private/exchange-coin
This API endpoint provides the amount the user will receive, the current swap rate
Parameters:
| Name | Type | Required or optional | Description |
|---|---|---|---|
| amount | string | required | Amount of currency you are going to send or get |
| coinFrom | string | required | Currency to swap from |
| coinTo | string | required | Currency to swap to |
| networkFrom | string | optional | Network to swap from |
| networkTo | string | optional | Network to swap to |
| lastSource | string | required | We transfer the last input where the data is entered, to the deposit input or the receive input ( for example deposit or receive) |
| typeSwap | string | required | 1 - fixed 2 -float |
Successful response fields:
| Name | Type | Description |
|---|---|---|
| pair | string | Swap pair |
| amount | number | Amount sent |
| exchangeRate | number | Swap rate |
| receive | number | Amount you will receive |
| minAmount | number | Min deposit |
| maxAmount | number | Max deposit |
Example request:
GET:
https://api.pegasusswap.com/api/private/exchange-coin?amount=10&coinFrom=eth&coinTo=usdt&lastSource=deposit&typeSwap=1
Example response:
{
"pair": "ETH_USDT",
"amount": "10",
"exchangeRate": 2462.1076313215262,
"receive": 24008.541206617498,
"minAmount": 0.03,
"maxAmount": 2100
}