curl --request POST \
--url https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/execute \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
"{\n \"amount\": \"1000\",\n \"fromAssetId\": \"d2176d80-010e-47fa-aa78-d04d4386c86b\",\n \"toAssetId\": \"dd46b7c5-3f6a-4fec-b85b-4d6e25708561\",\n \"reference\": \"swap-01\",\n \"metadata\": {\n \"id\": 1\n },\n \"order\": \"RECOMMENDED\" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE\n}"
'This endpoint allows the execution of a swap.
| 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 |
| reference | false | string | This would be the transaction reference |
| metadata | false | object | This would be atteched to the transaction payload |
| order | false | string | eg, FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE |
curl --request POST \
--url https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/swaps/execute \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
"{\n \"amount\": \"1000\",\n \"fromAssetId\": \"d2176d80-010e-47fa-aa78-d04d4386c86b\",\n \"toAssetId\": \"dd46b7c5-3f6a-4fec-b85b-4d6e25708561\",\n \"reference\": \"swap-01\",\n \"metadata\": {\n \"id\": 1\n },\n \"order\": \"RECOMMENDED\" // FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE\n}"
'"YOUR_WALLET_ID"
"ADDRESS_ID"