Metadata-Version: 2.1
Name: ape-starknet
Version: 0.2.0a1
Summary: ape-starknet: An ape plugin for the StarkNet networks
Home-page: https://github.com/ApeWorX/ape-starknet
Author: ApeWorX Ltd.
Author-email: admin@apeworx.io
License: Apache-2.0
Keywords: ethereum
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
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.7
Classifier: Programming Language :: Python :: 3.8
Requires-Python: >=3.7.2,<3.9
Description-Content-Type: text/markdown
Requires-Dist: ecdsa
Requires-Dist: fastecdsa
Requires-Dist: sympy
Requires-Dist: cairo-lang
Requires-Dist: hexbytes (<1.0.0,>=0.2.2)
Requires-Dist: pytest (<7.0,>=6.0)
Requires-Dist: pytest-asyncio
Requires-Dist: click (<8.2,>=8.1.0)
Requires-Dist: hexbytes (<0.3,>=0.2.2)
Requires-Dist: pydantic (<2.0,>=1.9.0)
Requires-Dist: eth-ape (<0.3.0,>=0.2.4)
Requires-Dist: ethpm-types
Requires-Dist: starknet.py (<0.2.4,>=0.2.3a0)
Requires-Dist: starknet-devnet (>=0.2.1)
Requires-Dist: importlib-metadata ; python_version < "3.8"
Provides-Extra: dev
Requires-Dist: pytest (<7.0,>=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: ape-cairo ; extra == 'dev'
Requires-Dist: black (<23.0,>=22.3.0) ; extra == 'dev'
Requires-Dist: mypy (<1.0,>=0.950) ; extra == 'dev'
Requires-Dist: flake8 (<4.0,>=3.9.2) ; extra == 'dev'
Requires-Dist: isort (<6.0,>=5.10.1) ; extra == 'dev'
Requires-Dist: types-pkg-resources (<0.2,>=0.1.3) ; extra == 'dev'
Requires-Dist: setuptools ; extra == 'dev'
Requires-Dist: wheel ; extra == 'dev'
Requires-Dist: twine ; extra == 'dev'
Requires-Dist: commitizen (<2.20,>=2.19) ; 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 (<23.0,>=22.3.0) ; extra == 'lint'
Requires-Dist: mypy (<1.0,>=0.950) ; extra == 'lint'
Requires-Dist: flake8 (<4.0,>=3.9.2) ; extra == 'lint'
Requires-Dist: isort (<6.0,>=5.10.1) ; extra == 'lint'
Requires-Dist: types-pkg-resources (<0.2,>=0.1.3) ; 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 (<7.0,>=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'
Requires-Dist: ape-cairo ; extra == 'test'

# Ape StarkNet

Plugins for the [StarkNet Ethereum L2 networks](https://starkware.co/starknet/).

## Dependencies

* [python3](https://www.python.org/downloads) version 3.7 or greater, python3-dev

## Installation

### via `pip`

You can install the latest release via [`pip`](https://pypi.org/project/pip/):

```bash
pip install ape-starknet
```

### 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-starknet.git
cd ape-starknet
python3 setup.py install
```

## Quick Usage

### Account Management

Deploy a new account:

```bash
ape starknet accounts create <ALIAS> --network starknet:testnet
```

You can deploy the same account to multiple networks.

```bash
ape starknet accounts create <ALIAS> --network starknet:mainnet
```

See your accounts and all of their deployment addresses:

```bash
ape starknet accounts list
```

shows:

```bash
Alias                      - <ALIAS>
Public key                 - 0x123444444d716666dd88882bE2e99991555DE1c7
Contract address (testnet) - 0x6b7111AA4111e5B2229c3332B66696888164440A773333143333B383333a183
Contract address (mainnet) - 0x7873113A4111e5B2229c3332B66696388163440A373333143333B3833332122
```

Import an existing account:

```bash
ape starknet accounts import <ALIAS> --address 0x6b7111AA4111e5B2229c3332B66696888164440A773333143333B383333a183 --network starknet:testnet
```

You can also import an account by key-file, including a key-file you exported from your [Argent-X browser wallet](https://www.argent.xyz/argent-x/):

```bash
ape starknet accounts import <ALIAS> --keyfile path/to/keyfile.json
```

You can also delete accounts:

```bash
ape starknet accounts delete <ALIAS> --network starknet:testnet
```

**NOTE**: You don't have to specify the network if your account is only deployed to a single network.

### Mainnet Alpha Whitelist Deployment Token

Currently, to deploy to Alpha-Mainnet, your contract needs to be whitelisted.
You can provide your WL token in a variety of ways.

Via Python code:

```python
my_contract = project.MyContract.deploy(token="MY_TOKEN")
```

Via an Environment Variable:

```bash
export ALPHA_MAINNET_WL_DEPLOY_TOKEN="MY_TOKEN"
```

Or, via the `--token` flag when deploying an account:

```bash
ape starknet accounts create MY_ACCOUNT --token MY_TOKEN
```

### Contracts

First, deploy your contract:

```python
from ape import project

contract = project.MyContract.deploy()
```

The ``deploy`` method returns a contract instance from which you can call methods on:

```python
receipt = contract.my_mutable_method(123)
value = contract.my_view_method()
```

Include a sender to delegate the transaction to an account contract:

```python
from ape import accounts

account = accounts.load("my_account")
receipt = contract.my_mutable_method(123, sender=account)
```

**NOTE**: Currently, to pass in arrays as arguments, you have to also include the array size beforehand:

```python
receipt = contract.store_my_list(3, [1, 2, 3])
```

## Development

This project is in development and should be considered a beta.
Things might not be in their final state and breaking changes may occur.
Comments, questions, criticisms and pull requests are welcomed.

## License

This project is licensed under the [Apache 2.0](LICENSE).


