ape-infura: Infura Provider plugins for Ethereum-based networks
Project description
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ape_infura-0.8.4.tar.gz.
File metadata
- Download URL: ape_infura-0.8.4.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d56eba427b796e22c1e4b26fb648e28ff0c82b3304fd0c74e2f844c040ed38c3
|
|
| MD5 |
afebece656f96ef8701c7814cefd90de
|
|
| BLAKE2b-256 |
702b9424f28ea9217a2d50cce3072d759ad01198857a8e92a1c17649ba46c532
|
File details
Details for the file ape_infura-0.8.4-py3-none-any.whl.
File metadata
- Download URL: ape_infura-0.8.4-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83ac3a946eb23890a1006fefa3a978a3bbee71ffd88f73435328be8eca8afaa5
|
|
| MD5 |
c37a9bedf9bf7e6e70eec930ab7ff32b
|
|
| BLAKE2b-256 |
344f4393521cca2b88ec4a185240c428fe8ba14b145fb9fa9754e06654cd9dbd
|