> ## 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.

# Execute

> Submit a signed gasless intent, or broadcast a signed transaction.

There are two ways to finalize a built transaction, depending on the `gasless` flag you passed to `/v1/buildTx`:

* **Gasless** (`gasless: true`) - the user signs the typed-data payload from the build response; you submit that signature to `/v1/gasless/executeTx` and DZap's relay executes it.
* **Standard** (`gasless: false`) - the user signs the raw transaction from the build response; you submit the signed transaction to `/v1/broadcast`.

## Execute a gasless intent

```
POST https://api.dzap.io/v1/gasless/executeTx
```

### Body

<ParamField body="chainId" type="integer" required>Chain ID the intent targets.</ParamField>

<ParamField body="txId" type="string" required>The `txId` from the gasless `/v1/buildTx` response.</ParamField>

<ParamField body="permit" type="object" required>
  Either an EIP-2612 permit payload or a batch-permit payload, depending on what your wallet signed.

  <Expandable title="permit (EIP-2612)">
    <ParamField body="permitData" type="object[]">Array of `{ token, amount, permit }` - one per token requiring a permit signature.</ParamField>

    <ParamField body="gaslessIntentSignature" type="string">Signature over the gasless intent typed data.</ParamField>

    <ParamField body="gaslessIntentDeadline" type="string">Deadline for the signed intent.</ParamField>

    <ParamField body="gaslessIntentNonce" type="string">Nonce for the signed intent.</ParamField>
  </Expandable>

  <Expandable title="permit (batch)">
    <ParamField body="batchPermitData" type="string">Encoded batch-permit payload.</ParamField>
  </Expandable>
</ParamField>

### Response

<ResponseField name="status" type="string">Transaction status (`success`, `mining`, `error`, etc.).</ResponseField>

<ResponseField name="txnHash" type="string">On-chain transaction hash.</ResponseField>

## Broadcast a signed transaction

```
POST https://api.dzap.io/v1/broadcast
```

### Body

<ParamField body="txId" type="string" required>The `txId` from the non-gasless `/v1/buildTx` response.</ParamField>

<ParamField body="chainId" type="integer" required>Chain ID to broadcast on.</ParamField>

<ParamField body="txData" type="string | object[]" required>
  The signed transaction payload. For most EVM steps this is a raw signed-transaction hex string. For HyperLiquid it's an array of `{ message, primaryType, signatureChainId, signature, account }` typed-data signature objects instead.
</ParamField>

### Response

<ResponseField name="status" type="string">`"success"` or an error status.</ResponseField>

<ResponseField name="txnHash" type="string">On-chain transaction hash. Present when `status` is `"success"`.</ResponseField>

<ResponseField name="message" type="string">Error details. Present when `status` is not `"success"`.</ResponseField>

### Examples

<RequestExample>
  ```bash gasless theme={null}
  curl -X POST https://api.dzap.io/v1/gasless/executeTx \
    -H "Content-Type: application/json" \
    -d '{
      "chainId": 42161,
      "txId": "0xabc...",
      "permit": {
        "permitData": [{ "token": "0xaf88...", "amount": "1000000", "permit": "0x..." }],
        "gaslessIntentSignature": "0x...",
        "gaslessIntentDeadline": "1714200000",
        "gaslessIntentNonce": "1"
      }
    }'
  ```

  ```bash broadcast theme={null}
  curl -X POST https://api.dzap.io/v1/broadcast \
    -H "Content-Type: application/json" \
    -d '{
      "txId": "0xabc...",
      "chainId": 42161,
      "txData": "0x02f8b0..."
    }'
  ```

  ```ts SDK theme={null}
  // Standard flow: sign the build response, then broadcast
  const result = await dzap.broadcastTradeTx({
    txId: '0xabc...',
    chainId: 42161,
    txData: '0x02f8b0...', // signed raw transaction
  });

  // Gasless flow (executeTx has no standalone SDK method - it's called
  // internally by tradeGasless() as part of the sign+submit flow)
  const gaslessResult = await dzap.tradeGasless({ request, signer });
  ```
</RequestExample>

<ResponseExample>
  ```json gasless theme={null}
  {
    "status": "success",
    "txnHash": "0xdef456..."
  }
  ```

  ```json broadcast theme={null}
  {
    "status": "success",
    "txnHash": "0xdef456..."
  }
  ```
</ResponseExample>

<Note>
  Once submitted, poll [`/v1/status`](/api/trade/status) with the resulting `txnHash` and `chainId` to track settlement - especially for cross-chain bridges.
</Note>
