Child Address Get Quote
curl --request POST \
--url https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
"{\n \"amount\": \"1000\",\n \"fromAssetId\": \"eda105b9-9471-4149-adb3-7dbf285ec0ab\",\n \"toAssetId\": \"84c8ad33-1450-4d61-9f8f-f0505039f2ec\",\n \"order\": \"RECOMMENDED\" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE\n}"
'import requests
url = "https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote"
payload = "{
\"amount\": \"1000\",
\"fromAssetId\": \"eda105b9-9471-4149-adb3-7dbf285ec0ab\",
\"toAssetId\": \"84c8ad33-1450-4d61-9f8f-f0505039f2ec\",
\"order\": \"RECOMMENDED\" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE
}"
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify('{\n "amount": "1000",\n "fromAssetId": "eda105b9-9471-4149-adb3-7dbf285ec0ab",\n "toAssetId": "84c8ad33-1450-4d61-9f8f-f0505039f2ec",\n "order": "RECOMMENDED" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE\n}')
};
fetch('https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('{
"amount": "1000",
"fromAssetId": "eda105b9-9471-4149-adb3-7dbf285ec0ab",
"toAssetId": "84c8ad33-1450-4d61-9f8f-f0505039f2ec",
"order": "RECOMMENDED" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE
}'),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote"
payload := strings.NewReader("\"{\\n \\\"amount\\\": \\\"1000\\\",\\n \\\"fromAssetId\\\": \\\"eda105b9-9471-4149-adb3-7dbf285ec0ab\\\",\\n \\\"toAssetId\\\": \\\"84c8ad33-1450-4d61-9f8f-f0505039f2ec\\\",\\n \\\"order\\\": \\\"RECOMMENDED\\\" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE\\n}\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("\"{\\n \\\"amount\\\": \\\"1000\\\",\\n \\\"fromAssetId\\\": \\\"eda105b9-9471-4149-adb3-7dbf285ec0ab\\\",\\n \\\"toAssetId\\\": \\\"84c8ad33-1450-4d61-9f8f-f0505039f2ec\\\",\\n \\\"order\\\": \\\"RECOMMENDED\\\" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE\\n}\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "\"{\\n \\\"amount\\\": \\\"1000\\\",\\n \\\"fromAssetId\\\": \\\"eda105b9-9471-4149-adb3-7dbf285ec0ab\\\",\\n \\\"toAssetId\\\": \\\"84c8ad33-1450-4d61-9f8f-f0505039f2ec\\\",\\n \\\"order\\\": \\\"RECOMMENDED\\\" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE\\n}\""
response = http.request(request)
puts response.read_body{
"data": {
"amount": "999.208698",
"estimatedArrivalTime": 30,
"impact": "-0.08",
"impactInUSD": "-0.791264",
"minAmount": "989.208",
"nativeBalance": "0.000857699568686543",
"nativeBalanceInUSD": "1.56912705292928295678",
"networkFee": "0.000090678936279694",
"networkFeeInUSD": "0.16589348676624898524",
"rate": "0.999208698",
"slippage": "1.00",
"transactionFee": 0
},
"message": "Swap quote fetched successfully",
"statusCode": 200
}Child Address Get Quote
This endpoint allows you to retrieve a quote for swapping assets.
Body Parameters
| Key | Required | Type | Description |
|---|---|---|---|
| fromAssetId | true | string | The master wallet asset id to swap from. |
| toAssetId | true | string | The master wallet asset id to swap to. |
| amount | true | string | The amount to swap. |
| recipientAddress | false | string | The external address you want to swap to |
| order | false | string | eg, FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE |
POST
/
v1
/
wallets
/
{walletId}
/
addresses
/
{addressId}
/
swaps
/
quote
Child Address Get Quote
curl --request POST \
--url https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
"{\n \"amount\": \"1000\",\n \"fromAssetId\": \"eda105b9-9471-4149-adb3-7dbf285ec0ab\",\n \"toAssetId\": \"84c8ad33-1450-4d61-9f8f-f0505039f2ec\",\n \"order\": \"RECOMMENDED\" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE\n}"
'import requests
url = "https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote"
payload = "{
\"amount\": \"1000\",
\"fromAssetId\": \"eda105b9-9471-4149-adb3-7dbf285ec0ab\",
\"toAssetId\": \"84c8ad33-1450-4d61-9f8f-f0505039f2ec\",
\"order\": \"RECOMMENDED\" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE
}"
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify('{\n "amount": "1000",\n "fromAssetId": "eda105b9-9471-4149-adb3-7dbf285ec0ab",\n "toAssetId": "84c8ad33-1450-4d61-9f8f-f0505039f2ec",\n "order": "RECOMMENDED" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE\n}')
};
fetch('https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('{
"amount": "1000",
"fromAssetId": "eda105b9-9471-4149-adb3-7dbf285ec0ab",
"toAssetId": "84c8ad33-1450-4d61-9f8f-f0505039f2ec",
"order": "RECOMMENDED" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE
}'),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote"
payload := strings.NewReader("\"{\\n \\\"amount\\\": \\\"1000\\\",\\n \\\"fromAssetId\\\": \\\"eda105b9-9471-4149-adb3-7dbf285ec0ab\\\",\\n \\\"toAssetId\\\": \\\"84c8ad33-1450-4d61-9f8f-f0505039f2ec\\\",\\n \\\"order\\\": \\\"RECOMMENDED\\\" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE\\n}\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("\"{\\n \\\"amount\\\": \\\"1000\\\",\\n \\\"fromAssetId\\\": \\\"eda105b9-9471-4149-adb3-7dbf285ec0ab\\\",\\n \\\"toAssetId\\\": \\\"84c8ad33-1450-4d61-9f8f-f0505039f2ec\\\",\\n \\\"order\\\": \\\"RECOMMENDED\\\" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE\\n}\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "\"{\\n \\\"amount\\\": \\\"1000\\\",\\n \\\"fromAssetId\\\": \\\"eda105b9-9471-4149-adb3-7dbf285ec0ab\\\",\\n \\\"toAssetId\\\": \\\"84c8ad33-1450-4d61-9f8f-f0505039f2ec\\\",\\n \\\"order\\\": \\\"RECOMMENDED\\\" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE\\n}\""
response = http.request(request)
puts response.read_body{
"data": {
"amount": "999.208698",
"estimatedArrivalTime": 30,
"impact": "-0.08",
"impactInUSD": "-0.791264",
"minAmount": "989.208",
"nativeBalance": "0.000857699568686543",
"nativeBalanceInUSD": "1.56912705292928295678",
"networkFee": "0.000090678936279694",
"networkFeeInUSD": "0.16589348676624898524",
"rate": "0.999208698",
"slippage": "1.00",
"transactionFee": 0
},
"message": "Swap quote fetched successfully",
"statusCode": 200
}Authorizations
Path Parameters
Example:
"YOUR_WALLET_ID"
Example:
"ADDRESS_ID"
⌘I

