File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed
async/exchange_client/accounts_rpc
sync/exchange_client/accounts_rpc Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ # Copyright 2021 Injective Labs
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+ """Injective Exchange API client for Python. Example only."""
15+
16+ import asyncio
17+ import logging
18+
19+ from pyinjective .async_client import AsyncClient
20+ from pyinjective .constant import Network
21+
22+ async def main () -> None :
23+ network = Network .testnet ()
24+ client = AsyncClient (network , insecure = True )
25+ account_address = "inj13q8u96uftm0d7ljcf6hdp0uj5tyqrwftmxllaq"
26+ epoch = 2
27+ rewards = await client .get_rewards (account_address = account_address , epoch = epoch )
28+ print (rewards )
29+
30+ if __name__ == '__main__' :
31+ logging .basicConfig (level = logging .INFO )
32+ asyncio .get_event_loop ().run_until_complete (main ())
Original file line number Diff line number Diff line change 1+ # Copyright 2021 Injective Labs
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+ """Injective Exchange API client for Python. Example only."""
15+
16+ import asyncio
17+ import logging
18+
19+ from pyinjective .client import Client
20+ from pyinjective .constant import Network
21+
22+ async def main () -> None :
23+ network = Network .testnet ()
24+ client = Client (network , insecure = True )
25+ account_address = "inj13q8u96uftm0d7ljcf6hdp0uj5tyqrwftmxllaq"
26+ epoch = 2
27+ rewards = client .get_rewards (account_address = account_address , epoch = epoch )
28+ print (rewards )
29+
30+ if __name__ == '__main__' :
31+ logging .basicConfig (level = logging .INFO )
32+ asyncio .get_event_loop ().run_until_complete (main ())
You can’t perform that action at this time.
0 commit comments