> For the complete documentation index, see [llms.txt](https://whitepaper.aitech.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whitepaper.aitech.io/agentforge/tools/etherscan.md).

# etherscan

[Etherscan](https://etherscan.io/) is a block explorer and API platform for Ethereum and supported EVM networks. It provides transaction details, wallet histories, token transfers, verified contract source code, and contract ABIs.

In Agent Forge, the Etherscan integration allows workflows to retrieve Ethereum on-chain data directly from Etherscan APIs. Use it for transaction monitoring, wallet analysis, token transfer reporting, contract inspection, and agent-powered blockchain research.

### Usage Instructions

Provide an Etherscan API key, select an operation, and pass the required transaction hash, wallet address, or contract address. Advanced fields allow you to set chain ID, block ranges, pagination, result size, and sort order.

### Tools

#### `etherscan_get_tx`

Fetch transaction details by transaction hash.

#### `etherscan_get_address_txs`

Retrieve normal transactions for a wallet address.

#### `etherscan_get_token_txs`

Retrieve token transfer events for an address, optionally filtered by contract address.

#### `etherscan_get_contract_source`

Fetch verified contract source code and metadata.

#### `etherscan_get_contract_abi`

Fetch the verified ABI for a contract address.

### Common Inputs

| Parameter         | Type   | Required           | Description                                  |
| ----------------- | ------ | ------------------ | -------------------------------------------- |
| `apiKey`          | string | Yes                | Etherscan API key                            |
| `txHash`          | string | Operation-specific | Transaction hash                             |
| `address`         | string | Operation-specific | Wallet address                               |
| `contractAddress` | string | Operation-specific | Contract address                             |
| `chainId`         | number | No                 | EVM chain ID, defaulting to Ethereum mainnet |
| `startBlock`      | number | No                 | Starting block number                        |
| `endBlock`        | number | No                 | Ending block number                          |
| `page`            | number | No                 | Page number                                  |
| `offset`          | number | No                 | Results per page                             |
| `sort`            | string | No                 | Sort direction, `asc` or `desc`              |

### Output

| Parameter | Type   | Description                  |
| --------- | ------ | ---------------------------- |
| `data`    | json   | Full Etherscan response data |
| `status`  | string | Etherscan status value       |
| `message` | string | Etherscan response message   |
| `result`  | json   | Etherscan result payload     |

### Notes

* Category: `tools`
* Type: `etherscan`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whitepaper.aitech.io/agentforge/tools/etherscan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
