# 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 ](https://docs.expand.network/ids/chain-ids)page for details. |
| chainSymbol                               | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)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](https://docs.expand.network/ids/chain-ids) page for details. |
| chainSymbol                            | String | Refer to the [Chain ID](https://docs.expand.network/ids/chain-ids) 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 %}
