Skip to content

Commit 9b3a76b

Browse files
committed
more help texts
1 parent 5ad1a3e commit 9b3a76b

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ First you need to download the Convex-API-py package from the python package ind
1313
You can now access the convex network, and get a balance from an existing account on the network by doing the following:
1414

1515
>>> from convex_api import ConvexAPI
16-
>>> convex = ConvexAPI('https://convex.world')
17-
>>> convex.get_balance(9)
16+
>>> convex_api = ConvexAPI('https://convex.world')
17+
>>> convex_api.get_balance(9)
1818
99396961137042
1919

2020
You can create a new emtpy account, with now balance:
@@ -25,7 +25,7 @@ You can create a new emtpy account, with now balance:
2525

2626
You can request some funds to the new account and then get the account information:
2727

28-
>>> convex.request_funds(1000000, account)
28+
>>> convex_api.request_funds(1000000, account)
2929
1000000
3030
>>> convex.get_account_info(account)
3131
{'environment': {}, 'address': 809, 'is_library': False, 'is_actor': False, 'memory_size': 42, 'balance': 1000000, 'allowance': 0, 'sequence': 0, 'type': 'user'}
@@ -52,3 +52,26 @@ To create a new address with the same account keys in your new or imported accou
5252
>>> new_account.address
5353
934
5454

55+
To submit a transaction, use ConvexAPI.send(). This will cost a small about of juice, and reduce your balance
56+
57+
>>> convex_api.request_funds(1000000, account)
58+
1000000
59+
>>> convex_api.send('(map inc [1 2 3 4])', account)
60+
{'value': [2, 3, 4, 5]}
61+
>>> convex_api.get_balance(account)
62+
996360
63+
64+
To query a transaction, this is free and can be performed out by any valid account address.
65+
Get the balance of the new account:
66+
67+
>>> convex_api.query(f'(balance {account.address})', account)
68+
{'value': 996360}
69+
70+
# this is the same as above
71+
>>> convex_api.query(f'(balance {account.address})', account.address)
72+
{'value': 996360}
73+
74+
# get the balance using one of the standard account addresses (#1)
75+
>>> convex_api.query(f'(balance {account.address})', 1)
76+
{'value': 996360}
77+

0 commit comments

Comments
 (0)