Metadata-Version: 2.4
Name: etharc
Version: 0.1.0
Summary: A modern, fully typed Python SDK for Ethereum and EVM-compatible chains.
Author: Oceanus
Author-email: Oceanus <295322314+oceanus403@users.noreply.github.com>
License-Expression: MIT
Requires-Dist: ens-normalize>=3.0.10
Requires-Dist: eth-abi>=6.0.0
Requires-Dist: eth-account>=0.14.0
Requires-Dist: eth-hash[pycryptodome]>=0.8.0
Requires-Dist: eth-utils>=6.0.0
Requires-Dist: httpx2>=2.16.2
Requires-Dist: websockets>=17.4
Requires-Dist: pyrevm>=0.3.7 ; extra == 'local-evm'
Requires-Dist: coincurve>=21.0.0 ; extra == 'secp256k1'
Requires-Python: >=3.12
Project-URL: Repository, https://github.com/oceanus403/etharc
Project-URL: Documentation, https://oceanus403.github.io/etharc/
Provides-Extra: local-evm
Provides-Extra: secp256k1
Description-Content-Type: text/markdown

<div align="center">

<h1>Etharc</h1>

<p><strong>A modern, fully typed Python SDK for Ethereum and EVM-compatible chains</strong></p>

<p>
A complete Python-native alternative to web3.py: typed clients, ABI,
contracts, tokens, ENS, simulation, tracing, and account abstraction<br>
under one consistent, strongly typed API.
</p>

<p>
<a href="https://pypi.org/project/etharc/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/etharc"></a>
<a href="pyproject.toml"><img alt="Python 3.12+" src="https://img.shields.io/badge/python-3.12%2B-blue"></a>
<a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue"></a>
</p>

<p>
<a href="https://oceanus403.github.io/etharc/"><b>Documentation</b></a>
&nbsp;&middot;&nbsp;
<a href="#capabilities"><b>Capabilities</b></a>
&nbsp;&middot;&nbsp;
<a href="#installation"><b>Installation</b></a>
&nbsp;&middot;&nbsp;
<a href="#usage"><b>Usage</b></a>
&nbsp;&middot;&nbsp;
<a href="https://oceanus403.github.io/etharc/docs/contributing"><b>Contributing</b></a>
</p>

</div>

<br>

## Capabilities

| Family | Covers |
|:--|:--|
| Types & units | `Address`, `Hash`, `Signature`, `Wei`; integer base units, `Decimal` for display |
| RPC & clients | `Client`, `AsyncClient`; HTTP, WebSocket, IPC, batching, retries |
| Chains | Built-in chain definitions, capabilities, chain id validation |
| Accounts & signing | Local accounts, keystores, mnemonics; EIP-191 messages, EIP-712 typed data |
| ABI | Encoding, decoding, selectors, events, custom errors, revert reasons |
| Contracts | Deployment, reading, writing; statically typed bindings from ABIs |
| Transactions | Legacy, EIP-2930, EIP-1559, EIP-4844, EIP-7702; fees, replacement, confirmations |
| Blocks & events | Blocks, receipts, logs, filters, decoding, subscriptions |
| Tokens | ERC-20, ERC-721, ERC-1155, ERC-4626 |
| Fees & multicall | Gas estimation, EIP-1559 fee calculation, Multicall3 batching |
| ENS | Normalization, resolution, reverse resolution, text records |
| Simulation & tracing | Remote and local simulation, structured results, call trees, state diffs |
| Account abstraction | ERC-4337 user operations, bundler client, paymasters |

## Installation

Etharc supports Python 3.12 and newer.

Add it to a uv project:

```sh
uv add etharc
```

To install it in an active Python environment:

```sh
pip install etharc
```

To build from source:

```sh
git clone https://github.com/oceanus403/etharc
cd etharc
uv sync --locked
```

## Usage

```python
from etharc import (
    MAINNET,
    Client,
    ERC20,
    Address,
    create_account,
    parse_ether,
    sign_message,
)

# Read-only: balances and token data need no account.
client = Client.from_chain(MAINNET)
balance = client.get_balance("0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe")
print(balance)  # in wei

usdc = ERC20("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", client)
print(usdc.symbol(), usdc.decimals())  # USDC 6

# Sign locally; nothing is broadcast until you ask for it.
account = create_account()
signature = sign_message(account, "hello etharc")
print(signature.r, signature.s, signature.v)

# Send an EIP-1559 transfer; nonce, gas, and fees are filled in.
from etharc import build_eip1559

tx = build_eip1559(
    Address("0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe"),
    value=parse_ether("0.01"),
    max_fee_per_gas=20_000_000_000,
    max_priority_fee_per_gas=1_000_000_000,
)
tx_hash = client.send_transaction(account, tx)
receipt = client.wait_for_transaction_receipt(tx_hash)
print(receipt.succeeded)
```

## Project status

Etharc 0.1.0 is released. The API may change before 1.0.

## License

MIT. See [LICENSE](LICENSE).
