Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
feat: support Cairo lang 0.10.1 (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey authored Nov 1, 2022
1 parent 4153d4c commit 92dbe83
Show file tree
Hide file tree
Showing 18 changed files with 759 additions and 376 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 22.10.0
hooks:
- id: black
name: black

- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
rev: 5.0.4
hooks:
- id: flake8

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v0.982
hooks:
- id: mypy
additional_dependencies: [types-PyYAML, types-requests]
Expand Down
51 changes: 35 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,44 +45,63 @@ owner = container.test_accounts[0]

See the section below about [Testing](#Testing) to learn more about test accounts.

However, when using a live network, you have to deploy the accounts yourself.
To deploy a new account:
However, when using a live network, you will have to import or create an account first.

To import an account, use the `import` command:

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

You can deploy the same account to multiple networks.
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 create <ALIAS> --network starknet:mainnet
ape starknet accounts import <ALIAS> --keyfile path/to/keyfile.json
```

See your accounts and all of their deployment addresses:
To create a new account, you will use the `create` command:

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

shows:
The `create` command will first generate the public and private key combination and store a local keyfile for the account.
However, it does not deploy the account automatically.
The reason it does not deploy automatically is that the account needs funding to pay for its deployment and there are several ways to achieve this.
See [this section](https://starknet.io/docs/hello_starknet/account_setup.html#transferring-goerli-eth-to-the-account) of the Starknet official guides for more information.

For convenience purposes, if you already have a Starknet account in Ape, you can use that account to fund the creation of new ones.
To do this, use the `--deployment-funder` flag to specify the funder alias of your other account:

```bash
Alias - <ALIAS>
Public key - 0x123444444d716666dd88882bE2e99991555DE1c7
Contract address (testnet) - 0x6b7111AA4111e5B2229c3332B66696888164440A773333143333B383333a183
Contract address (mainnet) - 0x7873113A4111e5B2229c3332B66696388163440A373333143333B3833332122
ape starknet accounts create <NEW-ALIAS> --network starknet:testnet --deployment-funder <EXISTING-ALIAS>
```

Import an existing account:
Otherwise, after you have funded your newly created account an alternative way, you can use the `deploy` command to deploy it:

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

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/):
You can create the same account in multiple networks by adjusting the `--network` flag:

```bash
ape starknet accounts import <ALIAS> --keyfile path/to/keyfile.json
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
```

You can also delete accounts:
Expand Down
Loading

0 comments on commit 92dbe83

Please sign in to comment.