Metadata-Version: 2.1
Name: ape-quicknode
Version: 0.8.0
Summary: ape-quicknode: QuickNode Provider plugin
Home-page: https://github.com/ApeWorX/ape-quicknode
Author: ApeWorX Ltd.
Author-email: admin@apeworx.io
License: Apache-2.0
Keywords: ethereum
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9,<4
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-xdist; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: hypothesis<7.0,>=6.2.0; extra == "dev"
Requires-Dist: black<25,>=24.4.2; extra == "dev"
Requires-Dist: mypy<2,>=1.10.0; extra == "dev"
Requires-Dist: types-setuptools; extra == "dev"
Requires-Dist: types-requests; extra == "dev"
Requires-Dist: flake8<8,>=7.0.0; extra == "dev"
Requires-Dist: flake8-breakpoint<2,>=1.1.0; extra == "dev"
Requires-Dist: flake8-print<6,>=5.0.0; extra == "dev"
Requires-Dist: isort<6,>=5.13.2; extra == "dev"
Requires-Dist: mdformat>=0.7.17; extra == "dev"
Requires-Dist: mdformat-gfm>=0.3.5; extra == "dev"
Requires-Dist: mdformat-frontmatter>=0.4.1; extra == "dev"
Requires-Dist: mdformat-pyproject>=0.0.1; extra == "dev"
Requires-Dist: setuptools; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: commitizen; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pytest-watch; extra == "dev"
Requires-Dist: IPython; extra == "dev"
Requires-Dist: ipdb; extra == "dev"
Provides-Extra: lint
Requires-Dist: black<25,>=24.4.2; extra == "lint"
Requires-Dist: mypy<2,>=1.10.0; extra == "lint"
Requires-Dist: types-setuptools; extra == "lint"
Requires-Dist: types-requests; extra == "lint"
Requires-Dist: flake8<8,>=7.0.0; extra == "lint"
Requires-Dist: flake8-breakpoint<2,>=1.1.0; extra == "lint"
Requires-Dist: flake8-print<6,>=5.0.0; extra == "lint"
Requires-Dist: isort<6,>=5.13.2; extra == "lint"
Requires-Dist: mdformat>=0.7.17; extra == "lint"
Requires-Dist: mdformat-gfm>=0.3.5; extra == "lint"
Requires-Dist: mdformat-frontmatter>=0.4.1; extra == "lint"
Requires-Dist: mdformat-pyproject>=0.0.1; extra == "lint"
Provides-Extra: release
Requires-Dist: setuptools; extra == "release"
Requires-Dist: wheel; extra == "release"
Requires-Dist: twine; extra == "release"
Provides-Extra: test
Requires-Dist: pytest>=6.0; extra == "test"
Requires-Dist: pytest-xdist; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: hypothesis<7.0,>=6.2.0; extra == "test"


# QuickNode Ape Plugin

Use the [QuickNode](https://www.quicknode.com/) provider plugin to interact with blockchains via QuickNode's APIs.

If you don't have a QuickNode account already, you can create one [here](https://www.quicknode.com/signup?utm_source=internal&utm_campaign=ape-plugin&utm_content=quicknode-ape-plugin).

## Supported Networks

The `ape-quicknode` plugin supports the following ecosystems:

- Ethereum
- Arbitrum
- Base
- Optimism
- Polygon
- Polygon-ZkEVM

## 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-quicknode
```

### via setuptools

You can clone the repository and use setuptools for the most up-to-date version:

```bash
git clone https://github.com/your-username/ape-quicknode.git
cd ape-quicknode
python3 setup.py install
```

## Configuration

To use the QuickNode provider, you need to set up your QuickNode credentials. You can do this by setting environment variables.

### Environment Variables

Set the following environment variables:

```bash
export QUICKNODE_SUBDOMAIN=your-quicknode-subdomain
export QUICKNODE_AUTH_TOKEN=your-quicknode-auth-token
```

## Usage

### Command Line

To use the QuickNode provider plugin in most commands, set it via the --network option:

```bash
ape console --network ethereum:mainnet:quicknode
```

### Python Script

To connect to QuickNode from a Python script, use the networks top-level manager:

```python
from ape import networks

with networks.ethereum.mainnet.use_provider("quicknode") as provider:
    # Your code here
    ...
```

### Transaction Traces

You can access transaction traces using the QuickNode provider:

```python
from ape import networks

quicknode = networks.provider  # Assuming connected to QuickNode
txn_hash = "0x45a8ab098ef27f028afe532f3ca241a3425725093f1302c9bf14a03993891b70"  # Replace the hash with another hash if needed or using another network
trace = quicknode.get_transaction_trace(txn_hash)
print(f"Raw call tree: {trace.get_raw_calltree()}")
```

## Testing

### CLI Testing

You can test the QuickNode provider functionality directly from the Ape console. Here's a step-by-step guide:

1. Initialize the Ape console with QuickNode provider:

```bash
ape console --network ethereum:mainnet:quicknode
```

2. Once in the console, you can make various calls to test the functionality:

```bash
# Get the latest block number
networks.provider.get_block('latest').number

# Get the current network gas price
networks.provider.gas_price

# Get a transaction by its hash
tx_hash = "0x45a8ab098ef27f028afe532f3ca241a3425725093f1302c9bf14a03993891b70" # Replace the hash with another hash if needed or using another network
networks.provider.get_transaction(tx_hash)

# Get a transaction receipt
networks.provider.get_receipt(tx_hash)

# Get a transaction trace
networks.provider.get_transaction_trace(tx_hash).get_raw_calltree()
```

### Unit Tests

To run the unit tests for the QuickNode plugin:

```bash
pytest tests/
```

## Development

To set up the development environment:

1. Clone the repository
2. Install the development dependencies:

```bash
pip install -e ".[dev]"
```

3. Install the pre-commit hooks:

```bash
pre-commit install
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the Apache 2.0 License.
