> ## Documentation Index
> Fetch the complete documentation index at: https://cobo.com/products/agentic-wallet/manual/llms.txt
> Use this file to discover all available pages before exploring further.

# Contract calls

> Submit smart-contract calls and estimate fees before execution.

Contract calls follow the same CAW guardrails as transfers, but the runtime is usually operating against specific protocol allowlists and function-level policy controls. This is the core path for DeFi automation, payments, and broader onchain interaction.

## Submit a contract call

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    caw tx call \
      --pact-id <PACT_ID> \
      --contract 0xContract... \
      --calldata 0x... \
      --chain-id BASE_ETH \
      --request-id swap-001
    ```
  </Tab>

  <Tab title="Python SDK">
    ```python theme={null}
    result = await agent_client.contract_call(
        wallet_uuid=WALLET_UUID,
        chain_id="BASE_ETH",
        contract_addr="0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
        calldata="0x38ed1739...",
        value="0",
        request_id="swap-2026-001",
    )
    ```
  </Tab>

  <Tab title="TypeScript SDK">
    ```typescript theme={null}
    const result = (await txApi.contractCall(walletUuid, {
      chain_id: 'BASE_ETH',
      contract_addr: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D',
      calldata: '0x38ed1739...',
      value: '0',
      request_id: 'swap-2026-001',
    })).data.result;
    ```
  </Tab>
</Tabs>

## Estimate fees

Preview the transfer or call cost before submitting:

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    caw tx estimate-call-fee \
      --chain-id BASE_ETH \
      --contract 0x7a250d... \
      --calldata 0x38ed1739... \
      --value 0
    ```
  </Tab>

  <Tab title="Python SDK">
    ```python theme={null}
    fee = await agent_client.estimate_contract_call_fee(
        wallet_uuid=WALLET_UUID,
        chain_id="BASE_ETH",
        contract_addr="0x7a250d...",
        calldata="0x38ed1739...",
        value="0",
    )
    print(fee)
    ```
  </Tab>

  <Tab title="TypeScript SDK">
    ```typescript theme={null}
    const fee = (await txApi.estimateContractCallFee(walletUuid, {
      chain_id: 'BASE_ETH',
      contract_addr: '0x7a250d...',
      calldata: '0x38ed1739...',
      value: '0',
    })).data.result;
    console.log(fee);
    ```
  </Tab>
</Tabs>

## Related toolkit tools

If you are using the framework toolkits or MCP server, the relevant subset is:

* `submit_pact`
* `get_pact`
* `estimate_contract_call_fee`
* `contract_call`
* `get_transaction_record_by_request_id`
* `get_audit_logs`

## Related guides

* [Submit and Manage Pacts](/products/agentic-wallet/manual/developer/pacts)
* [Handle Policy Denial](/products/agentic-wallet/manual/developer/handle-policy-denial)
* [Transaction Tracking](/products/agentic-wallet/manual/developer/transaction-tracking)
