curl --request POST \
--url https://api.blockradar.co/v1/wallets/{walletId}/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}"
'{
"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
}This endpoint allows you to retrieve a quote for swapping assets.
| 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 |
curl --request POST \
--url https://api.blockradar.co/v1/wallets/{walletId}/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}"
'{
"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
}"YOUR_WALLET_ID"