---
title: "Create Bridge Swap Transaction with Approval"
method: POST
path: "/defi/v1/bridge/swap-with-approval"
tags: ["bridge"]
---

# Create Bridge Swap Transaction with Approval

`POST /defi/v1/bridge/swap-with-approval`

## Request

- Base URL: `https://svc.blockdaemon.com`
- URL: `https://svc.blockdaemon.com/defi/v1/bridge/swap-with-approval`
- Auth: API key in header `X-API-Key`

Generates both token approval and swap transactions in a single call with configurable slippage protection.

> 💡 
**Compute Unit Value:** `110` (Fixed)

## Request body

- BridgeSwapwithapprovalRequest: The request body for a /defi/v1/bridge/swap-with-approval
  - `bridgeId` '600' | '300' | '400' | '100' | '500': The unique ID to specify the bridge protocol for routing cross-chain queries or transactions. Find more [here](https://docs.blockdaemon.com/docs/defi-api-supported-protocols#supported-bridges-protocols).
  - `srcChainId` string: The unique chain ID to specify the source chain. Find more [here](https://docs.blockdaemon.com/docs/defi-api-supported-protocols#supported-chains).
  - `dstChainId` string, required: The unique chain ID to specify the destination chain. Find more [here](https://docs.blockdaemon.com/docs/defi-api-supported-protocols#supported-chains).
  - `srcTokenSymbol` string: Symbol of the token to swap.
  - `dstTokenSymbol` string: Symbol of the token to be received after the swap.
  - `srcTokenAddress` string: Contract address of the source (input) token on the source chain. For EVM chains, use a checksummed hex address (e.g., 0x...). Either srcTokenAddress or srcTokenSymbol must be provided.
  - `dstTokenAddress` string: Contract address of the destination (output) token on the destination chain. For EVM chains, use a checksummed hex address (e.g., 0x...). Either dstTokenAddress or dstTokenSymbol must be provided.
  - `amountIn` string, required: Amount of the input token to provide, specified in the token's smallest denomination (base units). Do not send human-readable decimal values. Examples: to swap 1 WETH (18 decimals), use "1000000000000000000"; to swap 1 USDC (6 decimals), use "1000000".
  - `amountOutMin` string: Minimum acceptable output amount in the token's smallest denomination (base units). Provides slippage protection — the transaction reverts if the output falls below this value. Set to "0" to disable slippage protection. Examples: to require at least 0.99 USDC (6 decimals), use "990000"; to require at least 0.99 WETH (18 decimals), use "990000000000000000".
  - `from` string, required: Blockchain address of the token sender. For EVM chains, use a checksummed hex address (e.g., 0xABCDEF...). This address must hold sufficient balance of the input token and will sign the transaction.
  - `to` string, required: Blockchain address of the token recipient. For EVM chains, use a checksummed hex address (e.g., 0xABCDEF...). Output tokens are delivered to this address after the swap.
  - `gasPriority` string: Specifies the priority level for gas fees (e.g., 'low', 'medium', or 'high'), which influences the transaction speed and cost.
  - `slippage` string: Maximum acceptable slippage as a percentage of the swap value. Valid range: 0 to 100 (e.g., 1 = up to 1% slippage). Defaults to 1. The transaction reverts if the output deviates more than this percentage from the quoted price.
  - `enableFee` boolean: Flag to include a basis points fee transaction alongside the main transaction when set to true.
  - `batchOption` 'EIP-5792' | 'EIP-7702': Transaction batching standard to use. Supported values: 'EIP-5792' (wallet-level batching via wallet_sendCalls) or 'EIP-7702' (EOA code delegation via batcherContract). Requires batcherContract when using EIP-7702.
  - `batcherContract` string: The EOA address of the batcher that will be used to execute the transaction when using EIP-7702 batching. If not provided, the default batcher contract for the chain will be used.
  - `simulate` boolean: When true, dry-runs the transaction batch via eth_simulateV1 and returns a simulate field with status and error on each transaction.
  - `gas` string: Maximum number of gas units to allocate for the transaction, as an integer string (e.g., '200000'). If omitted, gas is estimated automatically. Note: this is gas units, not wei or gwei.
  - `srcChainSymbol` string: Symbol of the source chain.

## Response `200`

Successful response

- object
  - `status` number: Numeric status code indicating success or failure of the API call
  - `msg` string: Human-readable message describing the API result or error
  - `data` union
    - object[]
      - `chainId` string, required: Blockchain network identifier (EVM chain ID, Solana chain name, etc.)
      - `from` string, required: Sender's wallet address
      - `to` string, required: Recipient's wallet address
      - `gas` string: Gas limit for the transaction
      - `value` string, required: Amount being transferred or involved in a transaction
      - `data` string, required: Main payload object or array returned by the API
      - `referenceId` string, required: Unique ID for tracking a specific transaction or operation
      - `gasPrice` string: Price per gas unit for the transaction
      - `simulate` object: Present when the request used `simulate: true`; eth_simulateV1 summary (omitted when simulation was not run).
        - `status` 'success' | 'failure', required
        - `error` string, nullable, required: Failure reason when status is failure; null when status is success
    - object
      - `createFeeTxn` object, required
        - `chainId` string, required: Blockchain network identifier (EVM chain ID, Solana chain name, etc.)
        - `from` string, required: Sender's wallet address
        - `to` string, required: Recipient's wallet address
        - `value` string, required: Amount being transferred or involved in a transaction
        - `gasPrice` string: Price per gas unit for the transaction
        - `gas` string: Gas limit for the transaction
        - `simulate` object: Present when the request used `simulate: true` with `enableFee: true`; fee leg eth_simulateV1 summary.
          - `status` 'success' | 'failure', required
          - `error` string, nullable, required: Failure reason when status is failure; null when status is success
      - `swapWithApproveTxn` object[], required
        - `chainId` string, required: Blockchain network identifier (EVM chain ID, Solana chain name, etc.)
        - `from` string, required: Sender's wallet address
        - `to` string, required: Recipient's wallet address
        - `gas` string: Gas limit for the transaction
        - `value` string, required: Amount being transferred or involved in a transaction
        - `data` string, required: Main payload object or array returned by the API
        - `referenceId` string, required: Unique ID for tracking a specific transaction or operation
        - `gasPrice` string: Price per gas unit for the transaction
        - `simulate` object: Present when the request used `simulate: true`; eth_simulateV1 summary (omitted when simulation was not run).
          - `status` 'success' | 'failure', required
          - `error` string, nullable, required: Failure reason when status is failure; null when status is success
    - object
      - `from` string, required
      - `chainId` string, required
      - `referenceId` string, required
      - `methodUsed` 'EIP-5792' | 'EIP-7702', required
      - `calls` object[], required
        - `to` string, required
        - `value` string, required
        - `data` string, required
    - object
      - `from` string, required
      - `chainId` string, required
      - `referenceId` string, required
      - `methodUsed` string, required
      - `to` string, required
      - `data` string, required
      - `value` string, required
      - `batcherContract` string, required

---

[API](https://skmtc.dev/blockdaemon/apis/blockdaemon-defi-api.md) - [All operations](https://skmtc.dev/blockdaemon/apis/blockdaemon-defi-api/llms.txt) - [OpenAPI document](https://skmtc.dev/blockdaemon/apis/blockdaemon-defi-api/revisions/ec053b7c8041?raw)
