> For the complete documentation index, see [llms.txt](https://docs.expand.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.expand.network/integrations/fungible-tokens/weth.md).

# WETH

### /getbalance

Get the balance or number of WETH in the requested public address. Currently available on Ethereum, Binance Smart Chain, Avalanche, Polygon, Cronos, Arbitrum, Fantom, Optimism, Base, and zkSync.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/weth/getbalance`

#### Query Parameters

| Name                                      | Type   | Description                                                  |
| ----------------------------------------- | ------ | ------------------------------------------------------------ |
| rpc                                       | String | Remote procedural call URL                                   |
| chainId                                   | String | Refer to the [Chain ID ](/ids/chain-ids.md)page for details. |
| chainSymbol                               | String | Refer to the [Chain ID ](/ids/chain-ids.md)page for details. |
| address<mark style="color:red;">\*</mark> | String | The public address to get the balance of.                    |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/weth/getbalance/?address=0x6Fb447Ae94F5180254D436A693907a1f57696900
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "balance": "25690185796757697"
    }
}
```

{% endtab %}
{% endtabs %}

### /historical/logs

Retrieves all the logs for WETH events specified in query in the given block range.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/weth/historical/logs`

#### Query Parameters

| Name                                   | Type   | Description                                                           |
| -------------------------------------- | ------ | --------------------------------------------------------------------- |
| chainId                                | String | Refer to the [Chain ID](/ids/chain-ids.md) page for details.          |
| chainSymbol                            | String | Refer to the [Chain ID](/ids/chain-ids.md) page for details.          |
| startBlock                             | String | <p>Starting block of the range.</p><p>by default latestBlock -100</p> |
| endBlock                               | String | <p>Last block of the range.</p><p>by default its latestBlock</p>      |
| type<mark style="color:red;">\*</mark> | String | Deposit/Withdrawal                                                    |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/weth/historical/logs?type=Deposit
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "logs": [
            {
                "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                "topics": [
                    "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c",
                    "0x0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d"
                ],
                "params": {
                    "dst": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
                    "wad": "100000000000000000"
                },
                "data": "0x000000000000000000000000000000000000000000000000016345785d8a0000",
                "blockNumber": "17320569",
                "blockHash": "0xcbc13d3439e115dcb6203a45d82da137b7f546286224f29248192a7e428e29d6",
                "timeStamp": "1684828271",
                "gasPrice": "101893509354",
                "gasUsed": "142805",
                "logIndex": "0",
                "transactionHash": "0xa36d80f70960af4a7f67145670e589795edd3fda2c3334eb7c6fce962f06d99e",
                "transactionIndex": "4"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.expand.network/integrations/fungible-tokens/weth.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
