Quick Start
Use the Metamask Developer (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
- python3 version 3.9 up to 3.12.
Installation
via pip
You can install the latest release via pip:
pip install ape-infura
via setuptools
You can clone the repository and use setuptools for the most up-to-date version:
git clone https://github.com/ApeWorX/ape-infura.git
cd ape-infura
python3 setup.py 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:
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:
ape console --network ethereum:sepolia:infura
To connect to Infura from a Python script, use the networks top-level manager:
from ape import networks
with networks.parse_network_choice("ethereum:mainnet:infura") as provider:
# Also, access the websocket URI:
print(provider.ws_uri)
Metadata
Release files for ape-infura 0.8.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ape_infura-0.8.4.tar.gz | 21.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ape_infura-0.8.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.3 kB
Release files / ape_infura-0.8.4.tar.gz
| Download URL | ape_infura-0.8.4.tar.gz |
|---|---|
| Size | 21.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d56eba427b796e22c1e4b26fb648e28ff0c82b3304fd0c74e2f844c040ed38c3
|
|
BLAKE2b-256 checksum How to use checksums |
702b9424f28ea9217a2d50cce3072d759ad01198857a8e92a1c17649ba46c532
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.16
|
Release files / ape_infura-0.8.4-py3-none-any.whl
| Download URL | ape_infura-0.8.4-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
83ac3a946eb23890a1006fefa3a978a3bbee71ffd88f73435328be8eca8afaa5
|
|
BLAKE2b-256 checksum How to use checksums |
344f4393521cca2b88ec4a185240c428fe8ba14b145fb9fa9754e06654cd9dbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.16
|