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

# Third-Party Transactions

> Use Shield with transactions from any source.

export const date_0 = "2026-04-22"

Shield is source-agnostic. Any valid EVM transaction calldata can be simulated and validated, regardless of where it came from.

## Supported Sources

<CardGroup cols={3}>
  <Card title="DEX Aggregators" icon="right-left">
    1inch, 0x Protocol, Paraswap, Odos, KyberSwap, OpenOcean
  </Card>

  <Card title="DeFi Protocols" icon="vault">
    Aave, Compound, Uniswap, Yearn, Morpho, Maker
  </Card>

  <Card title="Custom Contracts" icon="code">
    Your own smart contracts, multisig wallets, ERC-4337 UserOps
  </Card>
</CardGroup>

## Example: Custom Contract Interaction

Encode a contract call with viem and simulate it with Shield.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { encodeFunctionData, parseAbi } from "viem";

  // Step 1: Encode your contract call
  const data = encodeFunctionData({
    abi: parseAbi(["function deposit(uint256 amount, address receiver) returns (uint256)"]),
    functionName: "deposit",
    args: [1000000000n, "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"],
  });

  // Step 2: Simulate with Shield
  const simulation = await fetch("https://shield.api.enso.build/api/v1/simulate", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${ENSO_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      chainId: 1,
      transaction: {
        data,
        value: "0",
        to: "0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE",
        from: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
      },
      tokenIn: ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"],
      tokenOut: ["0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE"],
      amountIn: ["1000000000"],
    }),
  }).then((res) => res.json());
  ```
</CodeGroup>

## Mapping Transaction Fields

When working with different web3 libraries, here's how to extract the fields Shield expects:

| Shield Field | viem                  | ethers.js v6          | web3.js    |
| ------------ | --------------------- | --------------------- | ---------- |
| `data`       | `tx.data`             | `tx.data`             | `tx.data`  |
| `to`         | `tx.to`               | `tx.to`               | `tx.to`    |
| `from`       | `tx.from`             | `tx.from`             | `tx.from`  |
| `value`      | `tx.value.toString()` | `tx.value.toString()` | `tx.value` |

<Info>
  Shield does not modify your transaction. It only simulates and validates. The transaction you submit on-chain is exactly what you built.
</Info>

<div className="text-right text-xs gray-200 font-semibold w-full" style={{marginTop: '0'}}>
  <p style={{
        color: "#b2b2b2"  
    }}>Updated {date_0}</p>
</div>
