Quick start
Three calls take a user from a price to coins in their wallet.
- 1Get a priceBoth services are asked, the best amount wins.GET/quote
- 2Start the swapSend the user's address, get a deposit address back.POST/swaps
- 3Follow itAsk for the status until it says finished.GET/swaps/{id}
# 1. price
curl "https://hoppu.io/api/v1/quote?from=btc&to=xmr&amount=0.01"
# 2. start the swap
curl -X POST "https://hoppu.io/api/v1/swaps" \
-H "Content-Type: application/json" \
-d '{"from":"btc","to":"xmr","amount":0.01,
"address":"YOUR_XMR_ADDRESS"}'
# 3. follow it
curl "https://hoppu.io/api/v1/swaps/4f9k2mq8xa"const API = "https://hoppu.io/api/v1";
// 1. price
const quote = await fetch(
`${API}/quote?from=btc&to=xmr&amount=0.01`
).then((r) => r.json());
// 2. start the swap
const swap = await fetch(`${API}/swaps`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
from: "btc", to: "xmr", amount: 0.01,
address: "YOUR_XMR_ADDRESS",
}),
}).then((r) => r.json());
// 3. follow it
const status = await fetch(`${API}/swaps/${swap.id}`)
.then((r) => r.json());import requests
API = "https://hoppu.io/api/v1"
# 1. price
quote = requests.get(f"{API}/quote", params={
"from": "btc", "to": "xmr", "amount": 0.01,
}).json()
# 2. start the swap
swap = requests.post(f"{API}/swaps", json={
"from": "btc", "to": "xmr", "amount": 0.01,
"address": "YOUR_XMR_ADDRESS",
}).json()
# 3. follow it
status = requests.get(f"{API}/swaps/{swap['id']}").json()