Swap Execute
This endpoint allows the execution of a swap.
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 |
reference | false | string | This would be the transaction reference |
metadata | false | string | This would be atteched to the transaction payload |
curl --request POST \
--url https://api.blockradar.co/v1/wallets/{walletId}/swaps/execute \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"amount": "1000",
"fromAssetId": "d2176d80-010e-47fa-aa78-d04d4386c86b",
"toAssetId": "dd46b7c5-3f6a-4fec-b85b-4d6e25708561"
}'
{
"data": {
"addressId": null,
"amlScreening": null,
"amount": "0.5",
"amountPaid": null,
"asset": {
"address": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
"blockchain": {
"createdAt": "2024-05-14T17:53:33.106Z",
"derivationPath": "m/44'/60'/0'/0",
"id": "b80d3d5e-16f1-4d99-be5e-6dfcd27f89aa",
"isActive": true,
"isEvmCompatible": true,
"isL2": false,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/bnb-bnb-logo_e4qdyk.png",
"name": "BNB smart chain",
"slug": "bnb-smart-chain",
"symbol": "bnb",
"tokenStandard": "BEP20",
"updatedAt": "2024-11-26T19:04:13.941Z"
},
"createdAt": "2024-05-14T17:53:33.672Z",
"decimals": 18,
"id": "f31328ee-2db9-43ab-81ea-9a91db72957a",
"isActive": true,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800083/crypto-assets/usd-coin-usdc-logo_fs9mhv.png",
"name": "USD Coin",
"network": "mainnet",
"standard": "BEP20",
"symbol": "USDC",
"updatedAt": "2024-06-15T04:36:43.855Z"
},
"assetSwept": null,
"assetSweptAmount": null,
"assetSweptAt": null,
"assetSweptGasFee": null,
"assetSweptHash": null,
"assetSweptRecipientAddress": null,
"assetSweptResponse": null,
"assetSweptSenderAddress": null,
"blockHash": null,
"blockNumber": null,
"blockchain": {
"createdAt": "2024-05-14T17:53:33.106Z",
"derivationPath": "m/44'/60'/0'/0",
"id": "b80d3d5e-16f1-4d99-be5e-6dfcd27f89aa",
"isActive": true,
"isEvmCompatible": true,
"isL2": false,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/bnb-bnb-logo_e4qdyk.png",
"name": "BNB smart chain",
"slug": "bnb-smart-chain",
"symbol": "bnb",
"tokenStandard": "BEP20",
"updatedAt": "2024-11-26T19:04:13.941Z"
},
"chainId": null,
"confirmations": null,
"confirmed": false,
"createdAt": "2025-04-01T15:00:28.604Z",
"currency": null,
"fee": null,
"feeMetadata": null,
"gasFee": null,
"gasPrice": null,
"gasUsed": null,
"hash": null,
"id": "59b8f26e-0a5d-4679-8686-f5032e4344d2",
"metadata": null,
"network": "mainnet",
"note": null,
"rate": "0.848566",
"reason": null,
"recipientAddress": "0xD2b6be31932E0294F2ebD14a008C3f1E05B47BC4",
"senderAddress": "0xD2b6be31932E0294F2ebD14a008C3f1E05B47BC4",
"status": "PENDING",
"toAmount": "0.424283",
"toAsset": {
"address": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
"blockchain": {
"createdAt": "2024-10-07T22:09:49.784Z",
"derivationPath": "m/44'/60'/0'/0",
"id": "1c9ca9df-325f-4b60-a7ec-b28d2235e0b7",
"isActive": true,
"isEvmCompatible": true,
"isL2": true,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1728312943/crypto-assets/optimism-ethereum-op-logo_h62d1i.png",
"name": "optimism",
"slug": "optimism",
"symbol": "eth",
"tokenStandard": null,
"updatedAt": "2024-11-26T19:04:13.947Z"
},
"createdAt": "2024-10-08T19:12:41.930Z",
"decimals": 6,
"id": "ee7318c8-3a61-4437-88a0-de56b97f2a89",
"isActive": true,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800083/crypto-assets/usd-coin-usdc-logo_fs9mhv.png",
"name": "USD Coin",
"network": "mainnet",
"standard": null,
"symbol": "USDC",
"updatedAt": "2024-10-08T19:12:41.930Z"
},
"toBlockchain": {
"createdAt": "2024-10-07T22:09:49.784Z",
"derivationPath": "m/44'/60'/0'/0",
"id": "1c9ca9df-325f-4b60-a7ec-b28d2235e0b7",
"isActive": true,
"isEvmCompatible": true,
"isL2": true,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1728312943/crypto-assets/optimism-ethereum-op-logo_h62d1i.png",
"name": "optimism",
"slug": "optimism",
"symbol": "eth",
"tokenStandard": null,
"updatedAt": "2024-11-26T19:04:13.947Z"
},
"toWallet": {
"address": "0xD2b6be31932E0294F2ebD14a008C3f1E05B47BC4",
"configurations": null,
"createdAt": "2024-10-08T19:15:28.390Z",
"derivationPath": "m/44'/60'/0'/0/0",
"description": "This is Optimism Wallet",
"id": "f25dfef5-253a-4cb8-ab00-80f2e799f780",
"isActive": true,
"name": "Optimism Wallet",
"network": "mainnet",
"status": "ACTIVE",
"updatedAt": "2024-10-08T19:15:28.390Z"
},
"tokenAddress": null,
"type": "SWAP",
"updatedAt": "2025-04-01T15:00:28.604Z",
"wallet": {
"address": "0xD2b6be31932E0294F2ebD14a008C3f1E05B47BC4",
"apiCredential": {
"createdAt": "2024-08-24T19:49:15.617Z",
"id": "4ecea2c9-2ab7-4e9b-a436-16531233859f",
"isActive": true,
"key": "3OHh9gyDLb7h5ZPml638rXbeHShHb0OYMC34ehZRF6M4yepOR4wUOvrxHEh6lMCj",
"revokedAt": null,
"status": "active",
"type": "api_key",
"updatedAt": "2025-04-01T14:59:22.501Z",
"webhookUrl": "https://webhook.site/dbfbd5fa-d55f-4a31-a1d2-509cc60fa91d"
},
"blockchain": {
"createdAt": "2024-05-14T17:53:33.106Z",
"derivationPath": "m/44'/60'/0'/0",
"id": "b80d3d5e-16f1-4d99-be5e-6dfcd27f89aa",
"isActive": true,
"isEvmCompatible": true,
"isL2": false,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/bnb-bnb-logo_e4qdyk.png",
"name": "BNB smart chain",
"slug": "bnb-smart-chain",
"symbol": "bnb",
"tokenStandard": "BEP20",
"updatedAt": "2024-11-26T19:04:13.941Z"
},
"business": {
"configurations": {
"billing": {
"ccEmails": [
"[email protected]"
],
"toEmails": [
"[email protected]"
]
},
"contact": {
"email": "[email protected]"
},
"details": {
"description": "description",
"website": "https://www.blockradar.co"
},
"hideLogoUrlInResponse": false,
"useCustomWebhookSignatureHeader": true
},
"createdAt": "2024-08-22T15:28:37.522Z",
"id": "4b96c271-35eb-45e8-b558-6a53f95df601",
"name": "Blockradar",
"sector": "infrastructure",
"seedPhrase": "key day angry renew wife suit valve defy dose suspect night mandate friend resist regular entire industry sting trouble pyramid rail bright debate direct",
"status": "ACTIVE",
"testnetSeedPhrase": "around goddess ugly elephant network traffic horror climb dry rally flee city student jeans release fat correct trade miracle demand envelope bamboo orphan volume",
"updatedAt": "2025-03-27T16:28:26.587Z",
"user": {
"configurations": {
"setNewPasswordRequired": false
},
"createdAt": "2024-08-22T15:28:37.522Z",
"email": "[email protected]",
"emailVerified": true,
"firstname": "Test",
"id": "ad0ad16d-dc56-48e9-85da-a86adabff48e",
"lastname": "One",
"twoFactorAuthEnabled": true,
"updatedAt": "2025-03-27T16:28:26.592Z"
}
},
"configurations": null,
"createdAt": "2024-08-24T19:49:15.617Z",
"derivationPath": "m/44'/60'/0'/0/0",
"description": "This is BNB Smart Chain Mainnet Wallet",
"id": "23628012-2b69-4ed7-9627-63fb3f547381",
"isActive": true,
"name": "BNB Smart Chain Mainnet Wallet",
"network": "mainnet",
"status": "ACTIVE",
"updatedAt": "2024-08-24T19:49:15.617Z"
}
},
"message": "Swap transaction created successfully",
"statusCode": 200
}
Authorizations
Path Parameters
"YOUR_WALLET_ID"
Body
"1000"
"d2176d80-010e-47fa-aa78-d04d4386c86b"
"dd46b7c5-3f6a-4fec-b85b-4d6e25708561"
Response
"0.5"
"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"
"2024-05-14T17:53:33.106Z"
"m/44'/60'/0'/0"
"b80d3d5e-16f1-4d99-be5e-6dfcd27f89aa"
true
true
false
"https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/bnb-bnb-logo_e4qdyk.png"
"BNB smart chain"
"bnb-smart-chain"
"bnb"
"BEP20"
"2024-11-26T19:04:13.941Z"
"2024-05-14T17:53:33.672Z"
18
"f31328ee-2db9-43ab-81ea-9a91db72957a"
true
"https://res.cloudinary.com/blockradar/image/upload/v1716800083/crypto-assets/usd-coin-usdc-logo_fs9mhv.png"
"USD Coin"
"mainnet"
"BEP20"
"USDC"
"2024-06-15T04:36:43.855Z"
"2024-05-14T17:53:33.106Z"
"m/44'/60'/0'/0"
"b80d3d5e-16f1-4d99-be5e-6dfcd27f89aa"
true
true
false
"https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/bnb-bnb-logo_e4qdyk.png"
"BNB smart chain"
"bnb-smart-chain"
"bnb"
"BEP20"
"2024-11-26T19:04:13.941Z"
false
"2025-04-01T15:00:28.604Z"
"59b8f26e-0a5d-4679-8686-f5032e4344d2"
"mainnet"
"0.848566"
"0xD2b6be31932E0294F2ebD14a008C3f1E05B47BC4"
"0xD2b6be31932E0294F2ebD14a008C3f1E05B47BC4"
"PENDING"
"0.424283"
"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"
"2024-10-07T22:09:49.784Z"
"m/44'/60'/0'/0"
"1c9ca9df-325f-4b60-a7ec-b28d2235e0b7"
true
true
true
"https://res.cloudinary.com/blockradar/image/upload/v1728312943/crypto-assets/optimism-ethereum-op-logo_h62d1i.png"
"optimism"
"optimism"
"eth"
"2024-11-26T19:04:13.947Z"
"2024-10-08T19:12:41.930Z"
6
"ee7318c8-3a61-4437-88a0-de56b97f2a89"
true
"https://res.cloudinary.com/blockradar/image/upload/v1716800083/crypto-assets/usd-coin-usdc-logo_fs9mhv.png"
"USD Coin"
"mainnet"
"USDC"
"2024-10-08T19:12:41.930Z"
"2024-10-07T22:09:49.784Z"
"m/44'/60'/0'/0"
"1c9ca9df-325f-4b60-a7ec-b28d2235e0b7"
true
true
true
"https://res.cloudinary.com/blockradar/image/upload/v1728312943/crypto-assets/optimism-ethereum-op-logo_h62d1i.png"
"optimism"
"optimism"
"eth"
"2024-11-26T19:04:13.947Z"
"0xD2b6be31932E0294F2ebD14a008C3f1E05B47BC4"
"2024-10-08T19:15:28.390Z"
"m/44'/60'/0'/0/0"
"This is Optimism Wallet"
"f25dfef5-253a-4cb8-ab00-80f2e799f780"
true
"Optimism Wallet"
"mainnet"
"ACTIVE"
"2024-10-08T19:15:28.390Z"
"SWAP"
"2025-04-01T15:00:28.604Z"
"0xD2b6be31932E0294F2ebD14a008C3f1E05B47BC4"
"2024-08-24T19:49:15.617Z"
"4ecea2c9-2ab7-4e9b-a436-16531233859f"
true
"3OHh9gyDLb7h5ZPml638rXbeHShHb0OYMC34ehZRF6M4yepOR4wUOvrxHEh6lMCj"
"active"
"api_key"
"2025-04-01T14:59:22.501Z"
"https://webhook.site/dbfbd5fa-d55f-4a31-a1d2-509cc60fa91d"
"2024-05-14T17:53:33.106Z"
"m/44'/60'/0'/0"
"b80d3d5e-16f1-4d99-be5e-6dfcd27f89aa"
true
true
false
"https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/bnb-bnb-logo_e4qdyk.png"
"BNB smart chain"
"bnb-smart-chain"
"bnb"
"BEP20"
"2024-11-26T19:04:13.941Z"
false
true
"2024-08-22T15:28:37.522Z"
"4b96c271-35eb-45e8-b558-6a53f95df601"
"Blockradar"
"infrastructure"
"key day angry renew wife suit valve defy dose suspect night mandate friend resist regular entire industry sting trouble pyramid rail bright debate direct"
"ACTIVE"
"around goddess ugly elephant network traffic horror climb dry rally flee city student jeans release fat correct trade miracle demand envelope bamboo orphan volume"
"2025-03-27T16:28:26.587Z"
"2024-08-22T15:28:37.522Z"
true
"Test"
"ad0ad16d-dc56-48e9-85da-a86adabff48e"
"One"
true
"2025-03-27T16:28:26.592Z"
"2024-08-24T19:49:15.617Z"
"m/44'/60'/0'/0/0"
"This is BNB Smart Chain Mainnet Wallet"
"23628012-2b69-4ed7-9627-63fb3f547381"
true
"BNB Smart Chain Mainnet Wallet"
"mainnet"
"ACTIVE"
"2024-08-24T19:49:15.617Z"
"Swap transaction created successfully"
200
curl --request POST \
--url https://api.blockradar.co/v1/wallets/{walletId}/swaps/execute \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"amount": "1000",
"fromAssetId": "d2176d80-010e-47fa-aa78-d04d4386c86b",
"toAssetId": "dd46b7c5-3f6a-4fec-b85b-4d6e25708561"
}'
{
"data": {
"addressId": null,
"amlScreening": null,
"amount": "0.5",
"amountPaid": null,
"asset": {
"address": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
"blockchain": {
"createdAt": "2024-05-14T17:53:33.106Z",
"derivationPath": "m/44'/60'/0'/0",
"id": "b80d3d5e-16f1-4d99-be5e-6dfcd27f89aa",
"isActive": true,
"isEvmCompatible": true,
"isL2": false,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/bnb-bnb-logo_e4qdyk.png",
"name": "BNB smart chain",
"slug": "bnb-smart-chain",
"symbol": "bnb",
"tokenStandard": "BEP20",
"updatedAt": "2024-11-26T19:04:13.941Z"
},
"createdAt": "2024-05-14T17:53:33.672Z",
"decimals": 18,
"id": "f31328ee-2db9-43ab-81ea-9a91db72957a",
"isActive": true,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800083/crypto-assets/usd-coin-usdc-logo_fs9mhv.png",
"name": "USD Coin",
"network": "mainnet",
"standard": "BEP20",
"symbol": "USDC",
"updatedAt": "2024-06-15T04:36:43.855Z"
},
"assetSwept": null,
"assetSweptAmount": null,
"assetSweptAt": null,
"assetSweptGasFee": null,
"assetSweptHash": null,
"assetSweptRecipientAddress": null,
"assetSweptResponse": null,
"assetSweptSenderAddress": null,
"blockHash": null,
"blockNumber": null,
"blockchain": {
"createdAt": "2024-05-14T17:53:33.106Z",
"derivationPath": "m/44'/60'/0'/0",
"id": "b80d3d5e-16f1-4d99-be5e-6dfcd27f89aa",
"isActive": true,
"isEvmCompatible": true,
"isL2": false,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/bnb-bnb-logo_e4qdyk.png",
"name": "BNB smart chain",
"slug": "bnb-smart-chain",
"symbol": "bnb",
"tokenStandard": "BEP20",
"updatedAt": "2024-11-26T19:04:13.941Z"
},
"chainId": null,
"confirmations": null,
"confirmed": false,
"createdAt": "2025-04-01T15:00:28.604Z",
"currency": null,
"fee": null,
"feeMetadata": null,
"gasFee": null,
"gasPrice": null,
"gasUsed": null,
"hash": null,
"id": "59b8f26e-0a5d-4679-8686-f5032e4344d2",
"metadata": null,
"network": "mainnet",
"note": null,
"rate": "0.848566",
"reason": null,
"recipientAddress": "0xD2b6be31932E0294F2ebD14a008C3f1E05B47BC4",
"senderAddress": "0xD2b6be31932E0294F2ebD14a008C3f1E05B47BC4",
"status": "PENDING",
"toAmount": "0.424283",
"toAsset": {
"address": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
"blockchain": {
"createdAt": "2024-10-07T22:09:49.784Z",
"derivationPath": "m/44'/60'/0'/0",
"id": "1c9ca9df-325f-4b60-a7ec-b28d2235e0b7",
"isActive": true,
"isEvmCompatible": true,
"isL2": true,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1728312943/crypto-assets/optimism-ethereum-op-logo_h62d1i.png",
"name": "optimism",
"slug": "optimism",
"symbol": "eth",
"tokenStandard": null,
"updatedAt": "2024-11-26T19:04:13.947Z"
},
"createdAt": "2024-10-08T19:12:41.930Z",
"decimals": 6,
"id": "ee7318c8-3a61-4437-88a0-de56b97f2a89",
"isActive": true,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800083/crypto-assets/usd-coin-usdc-logo_fs9mhv.png",
"name": "USD Coin",
"network": "mainnet",
"standard": null,
"symbol": "USDC",
"updatedAt": "2024-10-08T19:12:41.930Z"
},
"toBlockchain": {
"createdAt": "2024-10-07T22:09:49.784Z",
"derivationPath": "m/44'/60'/0'/0",
"id": "1c9ca9df-325f-4b60-a7ec-b28d2235e0b7",
"isActive": true,
"isEvmCompatible": true,
"isL2": true,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1728312943/crypto-assets/optimism-ethereum-op-logo_h62d1i.png",
"name": "optimism",
"slug": "optimism",
"symbol": "eth",
"tokenStandard": null,
"updatedAt": "2024-11-26T19:04:13.947Z"
},
"toWallet": {
"address": "0xD2b6be31932E0294F2ebD14a008C3f1E05B47BC4",
"configurations": null,
"createdAt": "2024-10-08T19:15:28.390Z",
"derivationPath": "m/44'/60'/0'/0/0",
"description": "This is Optimism Wallet",
"id": "f25dfef5-253a-4cb8-ab00-80f2e799f780",
"isActive": true,
"name": "Optimism Wallet",
"network": "mainnet",
"status": "ACTIVE",
"updatedAt": "2024-10-08T19:15:28.390Z"
},
"tokenAddress": null,
"type": "SWAP",
"updatedAt": "2025-04-01T15:00:28.604Z",
"wallet": {
"address": "0xD2b6be31932E0294F2ebD14a008C3f1E05B47BC4",
"apiCredential": {
"createdAt": "2024-08-24T19:49:15.617Z",
"id": "4ecea2c9-2ab7-4e9b-a436-16531233859f",
"isActive": true,
"key": "3OHh9gyDLb7h5ZPml638rXbeHShHb0OYMC34ehZRF6M4yepOR4wUOvrxHEh6lMCj",
"revokedAt": null,
"status": "active",
"type": "api_key",
"updatedAt": "2025-04-01T14:59:22.501Z",
"webhookUrl": "https://webhook.site/dbfbd5fa-d55f-4a31-a1d2-509cc60fa91d"
},
"blockchain": {
"createdAt": "2024-05-14T17:53:33.106Z",
"derivationPath": "m/44'/60'/0'/0",
"id": "b80d3d5e-16f1-4d99-be5e-6dfcd27f89aa",
"isActive": true,
"isEvmCompatible": true,
"isL2": false,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/bnb-bnb-logo_e4qdyk.png",
"name": "BNB smart chain",
"slug": "bnb-smart-chain",
"symbol": "bnb",
"tokenStandard": "BEP20",
"updatedAt": "2024-11-26T19:04:13.941Z"
},
"business": {
"configurations": {
"billing": {
"ccEmails": [
"[email protected]"
],
"toEmails": [
"[email protected]"
]
},
"contact": {
"email": "[email protected]"
},
"details": {
"description": "description",
"website": "https://www.blockradar.co"
},
"hideLogoUrlInResponse": false,
"useCustomWebhookSignatureHeader": true
},
"createdAt": "2024-08-22T15:28:37.522Z",
"id": "4b96c271-35eb-45e8-b558-6a53f95df601",
"name": "Blockradar",
"sector": "infrastructure",
"seedPhrase": "key day angry renew wife suit valve defy dose suspect night mandate friend resist regular entire industry sting trouble pyramid rail bright debate direct",
"status": "ACTIVE",
"testnetSeedPhrase": "around goddess ugly elephant network traffic horror climb dry rally flee city student jeans release fat correct trade miracle demand envelope bamboo orphan volume",
"updatedAt": "2025-03-27T16:28:26.587Z",
"user": {
"configurations": {
"setNewPasswordRequired": false
},
"createdAt": "2024-08-22T15:28:37.522Z",
"email": "[email protected]",
"emailVerified": true,
"firstname": "Test",
"id": "ad0ad16d-dc56-48e9-85da-a86adabff48e",
"lastname": "One",
"twoFactorAuthEnabled": true,
"updatedAt": "2025-03-27T16:28:26.592Z"
}
},
"configurations": null,
"createdAt": "2024-08-24T19:49:15.617Z",
"derivationPath": "m/44'/60'/0'/0/0",
"description": "This is BNB Smart Chain Mainnet Wallet",
"id": "23628012-2b69-4ed7-9627-63fb3f547381",
"isActive": true,
"name": "BNB Smart Chain Mainnet Wallet",
"network": "mainnet",
"status": "ACTIVE",
"updatedAt": "2024-08-24T19:49:15.617Z"
}
},
"message": "Swap transaction created successfully",
"statusCode": 200
}