forked from ChihuahuaChain/pyCosmicWrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmytest.py
27 lines (19 loc) · 830 Bytes
/
mytest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from pycosmicwrap import CosmicWrap
# create an object with rest api url, rpc url and denom as arguments
osmosis = CosmicWrap(lcd='https://rpc.osmosis.zone',
rpc='https://lcd.osmosis.zone',
denom='uosmo')
# Once the module is imported and the object is created we can start using
# the object to interact with the blockchain
# Let's define an address
my_address = 'osmo1f8rcf47jpqq2thq9vjsap9y0eclzqeqxaxusl2'
# Let's create a variable with your balance
my_address_balance = osmosis.query_balances(my_address)
# or just print it out
print(my_address_balance)
# check all of your delegations
my_delegations = osmosis.query_delegations_by_address(my_address)
# and print them out
print(my_delegations)
# check all of your staking rewards
print(osmosis.query_rewards(my_address))