BTC to XMR Exchange API - Go Edition
HTTP/2 HTTP/3 TLS 1.3
Check the health status of the API service.
curl http://localhost/api/health
{
"status": "healthy",
"service": "btcflip-exchange",
"timestamp": "2024-01-01T00:00:00Z"
}
Get service information and supported features.
curl http://localhost/api/info
Get minimum and maximum BTC amounts for exchange.
curl http://localhost/api/exchange/minimum
{
"minimum_btc": "0.0005",
"maximum_btc": "100",
"currency_from": "btc",
"currency_to": "xmr"
}
Estimate the XMR amount you'll receive for a given BTC amount.
| Parameter | Type | Description |
|---|---|---|
btc_amount required |
string | Amount of BTC to exchange (e.g., "0.001") |
curl "http://localhost/api/exchange/estimate?btc_amount=0.001"
{
"btc_amount": "0.00100000",
"estimated_xmr_amount": "0.15234567",
"exchange_rate": "152.34567000",
"minimum_amount": "0.00050000",
"maximum_amount": "100.00000000",
"fee_amount": "0.00000500",
"fee_percentage": 0.5,
"net_btc_amount": "0.00099500"
}
Create a new BTC to XMR exchange.
| Parameter | Type | Description |
|---|---|---|
btc_amount required |
string | Amount of BTC to exchange |
xmr_address required |
string | Destination Monero address |
curl -X POST http://localhost/api/exchange/create \
-H "Content-Type: application/json" \
-d '{
"btc_amount": "0.001",
"xmr_address": "4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgYeYTRj5UzqtReoS44qo9mtmXCqY45DJ852K5Jv2684Rge"
}'
{
"exchange_id": "abc123def456",
"btc_deposit_address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
"estimated_xmr_amount": "0.15234567",
"status": "pending",
"created_at": "2024-01-01T00:00:00Z",
"btc_amount": "0.00100000",
"fee_amount": "0.00000500",
"fee_percentage": 0.5,
"net_btc_amount": "0.00099500"
}
Get the current status of an exchange.
| Parameter | Type | Description |
|---|---|---|
id required |
string | Exchange ID from create response |
curl http://localhost/api/exchange/abc123def456/status
{
"exchange_id": "abc123def456",
"status": "completed",
"status_message": "Exchange completed successfully",
"btc_amount": "0.00100000",
"xmr_amount": "0.15234567",
"btc_deposit_address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
"progress_percentage": 100,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:05:00Z",
"completed_at": "2024-01-01T00:05:00Z"
}
Validate a cryptocurrency address.
| Parameter | Type | Description |
|---|---|---|
address required |
string | Cryptocurrency address to validate |
currency optional |
string | Currency type (default: "xmr") |
curl -X POST http://localhost/api/validate/address \
-H "Content-Type: application/json" \
-d '{
"address": "4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgYeYTRj5UzqtReoS44qo9mtmXCqY45DJ852K5Jv2684Rge",
"currency": "xmr"
}'
{
"address": "4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx...",
"currency": "xmr",
"valid": true,
"error_message": ""
}
| Code | Status | Description |
|---|---|---|
200 |
OK | Request successful |
400 |
Bad Request | Invalid parameters or validation error |
404 |
Not Found | Exchange ID not found |
500 |
Internal Server Error | Server error occurred |
| Status | Description |
|---|---|
pending |
Waiting for BTC deposit |
waiting |
Deposit received, awaiting confirmations |
exchanging |
Converting BTC to XMR |
processing |
Processing the exchange |
completed |
Exchange completed, XMR sent |
failed |
Exchange failed |