Skip to content

Commit 1bb490c

Browse files
committed
add simple startup instructions
1 parent e4368b8 commit 1bb490c

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,37 @@
44

55
[Documentation](https://convex-dev.github.io/convex-api-py)
66

7+
### Quick Start
8+
9+
First you need to download the Convex-API-py package from the python package index PyPi.
10+
11+
```
12+
pip install convex-api
13+
```
14+
15+
You can now access the convex network using the following python commands.
16+
17+
```python
18+
>>> from convex_api import ConvexAPI
19+
>>> convex = ConvexAPI('https://convex.world')
20+
>>> convex.get_balance('0x7E66429CA9c10e68eFae2dCBF1804f0F6B3369c7164a3187D6233683c258710f')
21+
524786120
22+
```
23+
24+
You can create a new account by doing the following:
25+
26+
```python
27+
>>> from convex_api import Account
28+
>>> account = Account.create_new()
29+
>>> print(account.address_checksum)
30+
0x6F0e5f252B31Dc78d460Dd301ab571F47f8Bb0d7557Afff8D26A12655Dc2F6aF
31+
```
32+
33+
You can request some funds to the new account and see the account information:
34+
35+
```python
36+
>>> convex.request_funds(1000000, account)
37+
1000000
38+
>>> convex.get_account_info(account)
39+
{'environment': {}, 'address': '6f0e5f252b31dc78d460dd301ab571f47f8bb0d7557afff8d26a12655dc2f6af', 'is_library': False, 'is_actor': False, 'memory_size': 8, 'balance': 1000000, 'allowance': 0, 'sequence': 0, 'type': 'user'}
40+
```

0 commit comments

Comments
 (0)