Metadata-Version: 2.4
Name: ape-infura
Version: 0.8.5
Summary: ape-infura: Infura Provider plugins for Ethereum-based networks
Author-email: "ApeWorX Ltd." <admin@apeworx.io>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/ApeWorX/ape-infura
Keywords: ethereum
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: eth-ape<0.9,>=0.8.1
Requires-Dist: web3<8,>=6.20.1
Requires-Dist: requests<3,>=2.28.1
Dynamic: license-file

# Quick Start

Use the [Metamask Developer](https://developer.metamask.io/) (F.K.A. Infura) provider plugin to interact with blockchains via APIs.
This plugin supports the following ecosystems:

- Arbitrum
- Avalanche
- Base
- Blast
- BSC
- Celo
- Ethereum
- Linea
- Mantle
- Optimism
- Palm
- Polygon
- Scroll
- Starknet
- Unichain
- zkSync

## Dependencies

- [Python 3](https://www.python.org/downloads) version 3.10 or greater.

## Installation

### via `pip`

You can install the latest release via [`pip`](https://pypi.org/project/pip/):

```bash
pip install ape-infura
```

### via source

You can clone the repository and install for development:

```bash
git clone https://github.com/ApeWorX/ape-infura.git
cd ape-infura
uv sync --group dev
uv run prek install
```

## Quick Usage

First, make sure you have one of the following environment variables set (it doesn't matter which one):

- WEB3_INFURA_PROJECT_ID
- WEB3_INFURA_API_KEY

Either in your current terminal session or in your root RC file (e.g. `.bashrc`), add the following:

```bash
export WEB3_INFURA_PROJECT_ID=MY_API_TOKEN

# Multple tokens
export WEB3_INFURA_PROJECT_ID=MY_API_TOKEN1, MY_API_TOKEN2
```

Additionally, if your app requires an API secret as well, use either of the following environment variables:

- WEB3_INFURA_PROJECT_ID
- WEB3_INFURA_API_KEY

And each request will use the secret as a form of authentication.

To use the Infura provider plugin in most commands, set it via the `--network` option:

```bash
ape console --network ethereum:sepolia:infura
```

To connect to Infura from a Python script, use the `networks` top-level manager:

```python
from ape import networks

with networks.parse_network_choice("ethereum:mainnet:infura") as provider:
    # Also, access the websocket URI:
    print(provider.ws_uri)
```
