v1

latestOpenAPI 3.0.32026-07-26184851.6 MB
Swap

Child Address Execute

This endpoint allows the execution of a swap.

Body Parameters

KeyRequiredTypeDescription
fromAssetIdtruestringThe master wallet asset id to swap from.
toAssetIdtruestringThe master wallet asset id to swap to.
amounttruestringThe amount to swap.
recipientAddressfalsestringThe external address you want to swap to
referencefalsestringThis would be the transaction reference
metadatafalseobjectThis would be atteched to the transaction payload
orderfalsestringeg, FASTEST, CHEAPEST, RECOMMENDED, NO_SLIPPAGE
post/v1/wallets/{walletId}/addresses/{addressId}/swaps/execute

Response

200 - External Recipient Address / 200 - Recipient Master Wallet

messagestring
statusCodenumber

Example response

{
  "data": {
    "amount": "0.5",
    "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,
        "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"
    },
    "blockchain": {
      "createdAt": "2024-05-14T17:53:33.106Z",
      "derivationPath": "m/44'/60'/0'/0",
      "id": "b80d3d5e-16f1-4d99-be5e-6dfcd27f89aa",
      "isActive": true,
      "isEvmCompatible": true,
      "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": "2025-04-01T15:00:28.604Z",
    "id": "59b8f26e-0a5d-4679-8686-f5032e4344d2",
    "network": "mainnet",
    "rate": "0.848566",
    "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",
        "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",
      "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",
      "updatedAt": "2024-11-26T19:04:13.947Z"
    },
    "toWallet": {
      "address": "0xD2b6be31932E0294F2ebD14a008C3f1E05B47BC4",
      "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"
    },
    "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",
        "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,
        "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": [
              "dev@blockradar.co"
            ],
            "toEmails": [
              "dev@blockradar.co"
            ]
          },
          "contact": {
            "email": "testone@one.com"
          },
          "details": {
            "description": "description",
            "website": "https://www.blockradar.co"
          },
          "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": {
          "createdAt": "2024-08-22T15:28:37.522Z",
          "email": "rararo3041@daypey.com",
          "emailVerified": true,
          "firstname": "Test",
          "id": "ad0ad16d-dc56-48e9-85da-a86adabff48e",
          "lastname": "One",
          "twoFactorAuthEnabled": true,
          "updatedAt": "2025-03-27T16:28:26.592Z"
        }
      },
      "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
}