Instant exchange API
Exchange Pair Information
GET:
https://api.pegasusswap.com/api/private/exchange-coin
This API endpoint provides the amount the user will receive, the current exchange 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 exchange from |
coinTo | string | required | Currency to exchange to |
networkFrom | string | optional | Network to exchange from |
networkTo | string | optional | Network to exchange 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 | Exchange pair |
amount | number | Amount sent |
exchangeRate | number | Exchange 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
}