# Quick Start
Use the [Alchemy](https://alchemy.com/?r=jk3NDM0MTIwODIzM) provider plugin to interact with blockchains via APIs.
The `ape-alchemy` plugin supports the following ecosystems:
- Abstract
- ApeChain
- Arbitrum
- Astar
- Avalanche
- Base
- Berachain
- Blast
- BSC (including opBNB)
- CrossFi
- Ethereum
- Fantom
- Flow EVM
- Geist
- Gnosis
- Lens
- Linea
- Lumia
- Mantle
- Metis
- Optimism
- Polygon
- Polygon-ZkEVM
- Rootstock
- Scroll
- Shape
- Soneium
- Unichain
- XMTP
- World-Chain
- zetachain
- ZkSync
- Zora
## Dependencies
- [python3](https://www.python.org/downloads) version 3.9 up to 3.12.
## Installation
### via `pip`
You can install the latest release via [`pip`](https://pypi.org/project/pip/):
```bash
pip install ape-alchemy
```
### via `setuptools`
You can clone the repository and use [`setuptools`](https://github.com/pypa/setuptools) for the most up-to-date version:
```bash
git clone https://github.com/ApeWorX/ape-alchemy.git
cd ape-alchemy
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_ALCHEMY_PROJECT_ID`
- `WEB3_ALCHEMY_API_KEY`
- `WEB3_<ecosystem>_<network>_ALCHEMY_PROJECT_ID`
- `WEB3_<ecosystem>_<network>_ALCHEMY_PROJECT_ID`
For example, to use both Arbitrum and Ethereum in the same session, you could set both `WEB3_ARBITRUM_MAINNET_ALCHEMY_PROJECT_ID` and `WEB3_ETHEREUM_MAINNET_ALCHEMY_PROJECT_ID`.
**NOTE**: If using non-Ethereum networks, take care to install the correct plugins, such as `ape-arbitrum`, `ape-optimism`, etc:
```bash
ape plugins install arbitrum
```
Then, either in your current terminal session or in your root RC file (e.g. `.bashrc`), add the following:
```bash
export WEB3_ALCHEMY_PROJECT_ID=MY_API_TOKEN=<value-of-secret-key>
```
To use the Alchemy provider plugin in most commands, set it via the `--network` option:
```bash
ape console --network ethereum:sepolia:alchemy
```
To connect to Alchemy from a Python script, use the `networks` top-level manager:
```python
from ape import networks
with networks.parse_network_choice("ethereum:mainnet:alchemy") as provider:
...
```
### Transaction Traces
If you are using a paid tier of Alchemy, you have access to both Geth and Parity style traces.
Parity traces are faster and thus are the ones uses in Ethereum receipts' `show_trace()` method:
```python
from ape import networks
alchemy = networks.provider # Assuming connected to Alchemy
txn_hash = "0x053cba5c12172654d894f66d5670bab6215517a94189a9ffc09bc40a589ec04d"
receipt = alchemy.get_transaction(txn_hash)
receipt.show_trace() # Prints the Transaction trace
```
To access the raw `CallTree`, do:
```python
from ape import networks
alchemy = networks.provider # Assuming connected to Alchemy
txn_hash = "0x053cba5c12172654d894f66d5670bab6215517a94189a9ffc09bc40a589ec04d"
call_tree = alchemy.get_call_tree(txn_hash)
```
To learn more about transaction traces, view [Ape's transaction guide](https://docs.apeworx.io/ape/stable/userguides/transactions.html#traces).
Raw data
{
"_id": null,
"home_page": "https://github.com/ApeWorX/ape-alchemy",
"name": "ape-alchemy",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.9",
"maintainer_email": null,
"keywords": "ethereum",
"author": "ApeWorX Ltd.",
"author_email": "admin@apeworx.io",
"download_url": "https://files.pythonhosted.org/packages/59/f5/3d2205f34f28f3131fd6616e9a2336d6e6e2f722d9bc995aa526ee1edd27/ape_alchemy-0.8.7.tar.gz",
"platform": null,
"description": "# Quick Start\n\nUse the [Alchemy](https://alchemy.com/?r=jk3NDM0MTIwODIzM) provider plugin to interact with blockchains via APIs.\nThe `ape-alchemy` plugin supports the following ecosystems:\n\n- Abstract\n- ApeChain\n- Arbitrum\n- Astar\n- Avalanche\n- Base\n- Berachain\n- Blast\n- BSC (including opBNB)\n- CrossFi\n- Ethereum\n- Fantom\n- Flow EVM\n- Geist\n- Gnosis\n- Lens\n- Linea\n- Lumia\n- Mantle\n- Metis\n- Optimism\n- Polygon\n- Polygon-ZkEVM\n- Rootstock\n- Scroll\n- Shape\n- Soneium\n- Unichain\n- XMTP\n- World-Chain\n- zetachain\n- ZkSync\n- Zora\n\n## Dependencies\n\n- [python3](https://www.python.org/downloads) version 3.9 up to 3.12.\n\n## Installation\n\n### via `pip`\n\nYou can install the latest release via [`pip`](https://pypi.org/project/pip/):\n\n```bash\npip install ape-alchemy\n```\n\n### via `setuptools`\n\nYou can clone the repository and use [`setuptools`](https://github.com/pypa/setuptools) for the most up-to-date version:\n\n```bash\ngit clone https://github.com/ApeWorX/ape-alchemy.git\ncd ape-alchemy\npython3 setup.py install\n```\n\n## Quick Usage\n\nFirst, make sure you have one of the following environment variables set (it doesn't matter which one):\n\n- `WEB3_ALCHEMY_PROJECT_ID`\n- `WEB3_ALCHEMY_API_KEY`\n- `WEB3_<ecosystem>_<network>_ALCHEMY_PROJECT_ID`\n- `WEB3_<ecosystem>_<network>_ALCHEMY_PROJECT_ID`\n\nFor example, to use both Arbitrum and Ethereum in the same session, you could set both `WEB3_ARBITRUM_MAINNET_ALCHEMY_PROJECT_ID` and `WEB3_ETHEREUM_MAINNET_ALCHEMY_PROJECT_ID`.\n\n**NOTE**: If using non-Ethereum networks, take care to install the correct plugins, such as `ape-arbitrum`, `ape-optimism`, etc:\n\n```bash\nape plugins install arbitrum\n```\n\nThen, either in your current terminal session or in your root RC file (e.g. `.bashrc`), add the following:\n\n```bash\nexport WEB3_ALCHEMY_PROJECT_ID=MY_API_TOKEN=<value-of-secret-key>\n```\n\nTo use the Alchemy provider plugin in most commands, set it via the `--network` option:\n\n```bash\nape console --network ethereum:sepolia:alchemy\n```\n\nTo connect to Alchemy from a Python script, use the `networks` top-level manager:\n\n```python\nfrom ape import networks\n\nwith networks.parse_network_choice(\"ethereum:mainnet:alchemy\") as provider:\n ...\n```\n\n### Transaction Traces\n\nIf you are using a paid tier of Alchemy, you have access to both Geth and Parity style traces.\nParity traces are faster and thus are the ones uses in Ethereum receipts' `show_trace()` method:\n\n```python\nfrom ape import networks\n\nalchemy = networks.provider # Assuming connected to Alchemy\ntxn_hash = \"0x053cba5c12172654d894f66d5670bab6215517a94189a9ffc09bc40a589ec04d\"\nreceipt = alchemy.get_transaction(txn_hash)\nreceipt.show_trace() # Prints the Transaction trace\n```\n\nTo access the raw `CallTree`, do:\n\n```python\nfrom ape import networks\n\nalchemy = networks.provider # Assuming connected to Alchemy\ntxn_hash = \"0x053cba5c12172654d894f66d5670bab6215517a94189a9ffc09bc40a589ec04d\"\ncall_tree = alchemy.get_call_tree(txn_hash)\n```\n\nTo learn more about transaction traces, view [Ape's transaction guide](https://docs.apeworx.io/ape/stable/userguides/transactions.html#traces).\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "ape-alchemy: Alchemy provider plugins",
"version": "0.8.7",
"project_urls": {
"Homepage": "https://github.com/ApeWorX/ape-alchemy"
},
"split_keywords": [
"ethereum"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e6b5132fe7b1e32d6b05505bf537f85740cdf3fe971b66047e439a9a7f6a6702",
"md5": "cca552d65c01a973ceaa78548088ed6f",
"sha256": "451fe5d6040bfb1fb76d3e9eaf35f3e0d17ed1c08063a2b13df970540baac3b1"
},
"downloads": -1,
"filename": "ape_alchemy-0.8.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cca552d65c01a973ceaa78548088ed6f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.9",
"size": 15155,
"upload_time": "2025-01-06T18:23:10",
"upload_time_iso_8601": "2025-01-06T18:23:10.267346Z",
"url": "https://files.pythonhosted.org/packages/e6/b5/132fe7b1e32d6b05505bf537f85740cdf3fe971b66047e439a9a7f6a6702/ape_alchemy-0.8.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "59f53d2205f34f28f3131fd6616e9a2336d6e6e2f722d9bc995aa526ee1edd27",
"md5": "0c7ebd09a22143af5cb99e511a3e2f4a",
"sha256": "ccff72b3ac7d841d7e51face4c30d3aebac52f53554c1cc4facb3c9363bee45e"
},
"downloads": -1,
"filename": "ape_alchemy-0.8.7.tar.gz",
"has_sig": false,
"md5_digest": "0c7ebd09a22143af5cb99e511a3e2f4a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.9",
"size": 30156,
"upload_time": "2025-01-06T18:23:12",
"upload_time_iso_8601": "2025-01-06T18:23:12.612180Z",
"url": "https://files.pythonhosted.org/packages/59/f5/3d2205f34f28f3131fd6616e9a2336d6e6e2f722d9bc995aa526ee1edd27/ape_alchemy-0.8.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-06 18:23:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ApeWorX",
"github_project": "ape-alchemy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ape-alchemy"
}