ape-alchemy


Nameape-alchemy JSON
Version 0.8.5 PyPI version JSON
download
home_pagehttps://github.com/ApeWorX/ape-alchemy
Summaryape-alchemy: Alchemy provider plugins
upload_time2024-12-05 18:39:58
maintainerNone
docs_urlNone
authorApeWorX Ltd.
requires_python<4,>=3.9
licenseApache-2.0
keywords ethereum
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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/85/11/28aec34ac4b912ce1953a6fe274cabcb98aa95332e4e9b7a607c39633491/ape_alchemy-0.8.5.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.5",
    "project_urls": {
        "Homepage": "https://github.com/ApeWorX/ape-alchemy"
    },
    "split_keywords": [
        "ethereum"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "af4d09224a0ebd182af96313b9af6ae9fcb63137c49ea81d43f9e59f7d33e298",
                "md5": "20c2fb33dbe0c1d6ce3f1a3d2fa6f0c4",
                "sha256": "745e7dff19989eebc52a7d573950cf7244a675cde9658c1ec67667b5d4ca9571"
            },
            "downloads": -1,
            "filename": "ape_alchemy-0.8.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "20c2fb33dbe0c1d6ce3f1a3d2fa6f0c4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.9",
            "size": 14257,
            "upload_time": "2024-12-05T18:39:56",
            "upload_time_iso_8601": "2024-12-05T18:39:56.281679Z",
            "url": "https://files.pythonhosted.org/packages/af/4d/09224a0ebd182af96313b9af6ae9fcb63137c49ea81d43f9e59f7d33e298/ape_alchemy-0.8.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "851128aec34ac4b912ce1953a6fe274cabcb98aa95332e4e9b7a607c39633491",
                "md5": "929f72865fea006779d4722167280222",
                "sha256": "a679ca2d095ba4b70c9ea376394b8609e52f73b75adc2156f83f1c987d8d3d68"
            },
            "downloads": -1,
            "filename": "ape_alchemy-0.8.5.tar.gz",
            "has_sig": false,
            "md5_digest": "929f72865fea006779d4722167280222",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.9",
            "size": 29062,
            "upload_time": "2024-12-05T18:39:58",
            "upload_time_iso_8601": "2024-12-05T18:39:58.036777Z",
            "url": "https://files.pythonhosted.org/packages/85/11/28aec34ac4b912ce1953a6fe274cabcb98aa95332e4e9b7a607c39633491/ape_alchemy-0.8.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-05 18:39:58",
    "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"
}
        
Elapsed time: 0.50853s