curl --request POST \
--url https://app.digitalsurge.com.au/api/private/swaps/estimate/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"src_asset": "<string>",
"dst_asset": "<string>"
}
'import requests
url = "https://app.digitalsurge.com.au/api/private/swaps/estimate/"
payload = {
"src_asset": "<string>",
"dst_asset": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({src_asset: '<string>', dst_asset: '<string>'})
};
fetch('https://app.digitalsurge.com.au/api/private/swaps/estimate/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"src_asset": "<string>",
"dst_asset": "<string>",
"src_fee": "<string>",
"dst_fee": "<string>",
"estimated_price": "<string>",
"estimated_price_exact": "<string>",
"est_sell_amount": "<string>",
"est_buy_amount": "<string>",
"estimate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slippage": "<string>",
"req_get_amount": "<string>",
"req_spend_amount": "<string>"
}Estimate Swap
Preview the price, fees, and amounts for a swap without placing it.
Inputs: src_asset, dst_asset, and exactly one of
req_spend_amount (how much of src_asset to spend) or
req_get_amount (how much of dst_asset to receive). For
a buy set src_asset="AUD" and dst_asset to the crypto
code; for a sell set src_asset to the crypto code and
dst_asset="AUD".
Returns the estimated price, per-asset fees (src_fee,
dst_fee), estimated amounts, and estimated_price_exact.
No funds are moved.
This is a mandatory preview step before create. Pass the
returned estimated_price_exact as expected_price on
create for slippage protection.
curl --request POST \
--url https://app.digitalsurge.com.au/api/private/swaps/estimate/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"src_asset": "<string>",
"dst_asset": "<string>"
}
'import requests
url = "https://app.digitalsurge.com.au/api/private/swaps/estimate/"
payload = {
"src_asset": "<string>",
"dst_asset": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({src_asset: '<string>', dst_asset: '<string>'})
};
fetch('https://app.digitalsurge.com.au/api/private/swaps/estimate/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"src_asset": "<string>",
"dst_asset": "<string>",
"src_fee": "<string>",
"dst_fee": "<string>",
"estimated_price": "<string>",
"estimated_price_exact": "<string>",
"est_sell_amount": "<string>",
"est_buy_amount": "<string>",
"estimate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slippage": "<string>",
"req_get_amount": "<string>",
"req_spend_amount": "<string>"
}Authorizations
Personal API key, created in the Digital Surge app under Account Settings → API Keys. Send it with every request as Authorization: Bearer <your-api-key>.
Body
A swap quote: the estimated price, per-asset fees, and amounts for a proposed swap. No funds move.
Response
A swap quote: the estimated price, per-asset fees, and amounts for a proposed swap. No funds move.
Net amount, after subtracting the fee
Total amount, incl. the fee