ape-alchemy


Nameape-alchemy JSON
Version 0.7.3 PyPI version JSON
download
home_pagehttps://github.com/ApeWorX/ape-alchemy
Summaryape-alchemy: Alchemy provider plugins
upload_time2024-05-10 13:20:28
maintainerNone
docs_urlNone
authorApeWorX Ltd.
requires_python<4,>=3.8
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:

- Ethereum
- Arbitrum
- Base
- Optimism
- Polygon

## Dependencies

- [python3](https://www.python.org/downloads) version 3.8 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.8",
    "maintainer_email": null,
    "keywords": "ethereum",
    "author": "ApeWorX Ltd.",
    "author_email": "admin@apeworx.io",
    "download_url": "https://files.pythonhosted.org/packages/a7/64/74c9b20d44c1a8c2a28fd823c78e129de53c0032a02fe11e56e6cdb7f7b1/ape-alchemy-0.7.3.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- Ethereum\n- Arbitrum\n- Base\n- Optimism\n- Polygon\n\n## Dependencies\n\n- [python3](https://www.python.org/downloads) version 3.8 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.7.3",
    "project_urls": {
        "Homepage": "https://github.com/ApeWorX/ape-alchemy"
    },
    "split_keywords": [
        "ethereum"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b5098a263f3b49141740d56542277a9beab69b683791d37a94309cf0a7bfeb5e",
                "md5": "fde165ca5627a451d1d798ac8dc86a10",
                "sha256": "ccfb29652634a33e4c6b20835f440840bed42997379ab4c00a3cea947ff12637"
            },
            "downloads": -1,
            "filename": "ape_alchemy-0.7.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fde165ca5627a451d1d798ac8dc86a10",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.8",
            "size": 12043,
            "upload_time": "2024-05-10T13:20:26",
            "upload_time_iso_8601": "2024-05-10T13:20:26.293898Z",
            "url": "https://files.pythonhosted.org/packages/b5/09/8a263f3b49141740d56542277a9beab69b683791d37a94309cf0a7bfeb5e/ape_alchemy-0.7.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a76474c9b20d44c1a8c2a28fd823c78e129de53c0032a02fe11e56e6cdb7f7b1",
                "md5": "b9f9428aa67cf839512d1ebd5a9ff271",
                "sha256": "dba0aa42db3f476b5cf3a2d5f2b2ae75fce9a02c0393004ec9cce2c56b2b1bec"
            },
            "downloads": -1,
            "filename": "ape-alchemy-0.7.3.tar.gz",
            "has_sig": false,
            "md5_digest": "b9f9428aa67cf839512d1ebd5a9ff271",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.8",
            "size": 62963,
            "upload_time": "2024-05-10T13:20:28",
            "upload_time_iso_8601": "2024-05-10T13:20:28.404018Z",
            "url": "https://files.pythonhosted.org/packages/a7/64/74c9b20d44c1a8c2a28fd823c78e129de53c0032a02fe11e56e6cdb7f7b1/ape-alchemy-0.7.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-10 13:20:28",
    "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.30844s