You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -29,36 +29,186 @@ Installation varies between operating systems.
29
29
30
30
[See our documentation on complete instructions](https://starknetpy.rtfd.io/en/latest/installation.html)
31
31
32
-
## ▶️ Example usage
33
32
34
-
### Asynchronous API
33
+
## 💨 Quickstart
34
+
### Using FullNodeClient
35
+
A [Client](https://starknetpy.readthedocs.io/en/latest/api/client.html#client) is a facade for interacting with Starknet.
36
+
[FullNodeClient](https://starknetpy.readthedocs.io/en/latest/api/full_node_client.html#module-starknet_py.net.full_node_client) is a client which interacts with a Starknet full nodes like [Pathfinder](https://github.com/eqlabs/pathfinder), [Papyrus](https://github.com/starkware-libs/papyrus) or [Juno](https://github.com/NethermindEth/juno).
37
+
It supports read and write operations, like querying the blockchain state or adding new transactions.
35
38
36
-
This is the recommended way of using the SDK.
37
39
38
40
```python
39
-
from starknet_py.contract import Contract
40
41
from starknet_py.net.full_node_client import FullNodeClient
The default interface is asynchronous. Although it is the recommended way of using starknet.py, you can also use a synchronous version. It might be helpful to play with Starknet directly in python interpreter.
You can check out all of the FullNodeClient’s methods here: [FullNodeClient](https://starknetpy.readthedocs.io/en/latest/api/full_node_client.html#module-starknet_py.net.full_node_client).
56
+
57
+
### Creating Account
58
+
[Account](https://starknetpy.readthedocs.io/en/latest/api/account.html#starknet_py.net.account.account.Account) is the default implementation of [BaseAccount](https://starknetpy.readthedocs.io/en/latest/api/account.html#starknet_py.net.account.base_account.BaseAccount) interface.
59
+
It supports an account contract which proxies the calls to other contracts on Starknet.
60
+
61
+
Account can be created in two ways:
62
+
- By constructor (It is required to provide an `address` and either `key_pair` or `signer`).
63
+
- By static methods `Account.deploy_account_v1` or `Account.deploy_account_v3`
64
+
65
+
Additionally, you can use the [sncast](https://foundry-rs.github.io/starknet-foundry/starknet/index.html) tool to create an account,
66
+
which will automatically be saved to a file.
67
+
There are some examples how to do it:
68
+
```python
69
+
from starknet_py.net.account.account import Account
70
+
from starknet_py.net.full_node_client import FullNodeClient
71
+
from starknet_py.net.models.chains import StarknetChainId
72
+
from starknet_py.net.signer.stark_curve_signer import KeyPair
73
+
from starknet_py.net.signer.stark_curve_signer import StarkCurveSigner
74
+
75
+
# Creates an instance of account which is already deployed
76
+
# Account using transaction version=1 (has __validate__ function)
[Contract](https://starknetpy.readthedocs.io/en/latest/api/contract.html#starknet_py.contract.Contract) makes interacting with contracts deployed on Starknet much easier:
0 commit comments