calculateTrade
Returns exchange rate and details for a specific currency pair
POST
/trades/calculateTrade
Headers
Body
Name
Type
Description
send_name
string
Currency being sent
send_network
string
Network of currency being sent
get_name
string
Currency being received
get_network
string
Network of currency being received
send_value
optional
number
Amount to send. If provided, get_value and available will be included in the response
commission
optional
float
Additional commission in percent, which is considered your profit (default 0.5)
Response
{
"send": {
"name": "Monero",
"precision": 8,
"min_deposit": 0.001
},
"get": {
"name": "Litecoin",
"precision": 8,
"min_withdraw": 0.0198,
"network_fee": 0.006
},
"pair": {
"min_deposit": 0.00397993,
"min_withdraw": 0.01980001,
"network_fee": 0.006,
"rate": 6.4825359,
"get_value": 0.00696507,
"available": false
}
}
Example
const options = {
method: "POST",
headers: {
"Content-Type": "application/json",
Y_API_KEY: "Your API Key",
Signature: "02fe657ed8405c521fb3d5e3fd9ef7ff92f849c9ab976dcbe25e6ec4aacae0ed",
},
body: '{"send_name":"XMR","send_network":"XMR","get_name":"LTC","get_network":"LTC","send_value":0.002}',
};
fetch("https://api.yellowchanger.com/trades/calculateTrade", options)
.then((e) => e.json())
.then((e) => console.log(e))
.catch((e) => console.error(e));