> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dzap.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Build Transaction

> Compile a Fuse intent into ready-to-sign transaction calldata.

Takes a quote (or the same params you passed to `/v1/quote`) and returns transaction data ready to sign and submit.

### Body

<ParamField body="srcToken" type="string" required />

<ParamField body="srcChainId" type="integer" required />

<ParamField body="destToken" type="string" required />

<ParamField body="destChainId" type="integer" required />

<ParamField body="amount" type="string" required>Amount in wei.</ParamField>

<ParamField body="recipient" type="string" required />

<ParamField body="refundee" type="string" required>Address to refund if cross-chain settlement fails.</ParamField>

<ParamField body="slippage" type="number" required />

<ParamField body="account" type="string" required />

<ParamField body="permit" type="string">Permit2 / EIP-2612 signature payload, if you signed one.</ParamField>

### Response

<ResponseField name="status" type="string" />

<ResponseField name="data.to" type="string">Contract to call.</ResponseField>

<ResponseField name="data.data" type="string">Hex-encoded calldata.</ResponseField>

<ResponseField name="data.value" type="string">Native value to send (for native-token swaps).</ResponseField>

<ResponseField name="data.gasLimit" type="string">Suggested gas limit.</ResponseField>

<ResponseField name="data.txId" type="string">Bind for status polling.</ResponseField>

### Examples

<RequestExample>
  ```bash curl theme={null}
  curl -X POST https://zap.dzap.io/v1/buildTx \
    -H "Content-Type: application/json" \
    -d '{ "srcToken": "...", "srcChainId": 8453, ... }'
  ```

  ```ts SDK theme={null}
  const tx = await dzap.buildZapTxn({
    srcToken: '0x...',
    srcChainId: 8453,
    destToken: '0x...',
    destChainId: 8453,
    amount: '5000000',
    recipient: '0x...',
    refundee: '0x...',
    slippage: 0.5,
    account: '0x...',
  });

  // Sign + send via your wallet client
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "status": "success",
    "data": {
      "to": "0x1d46863e3592745008b5CbbAC12014F67329A9b8",
      "data": "0x...",
      "value": "0",
      "gasLimit": "350000",
      "txId": "0xabc..."
    }
  }
  ```
</ResponseExample>

<Note>
  Use the `txId` to poll `/v1/status` until the (possibly cross-chain) settlement completes.
</Note>
