-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathclient.py
More file actions
127 lines (112 loc) · 2.97 KB
/
client.py
File metadata and controls
127 lines (112 loc) · 2.97 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
from typing import Union
from client.connection import ClientHosts, Connection
from client.api.api_nodes import ApiNodes
from client.api.blockchain import Blockchain
from client.api.blocks import Blocks
from client.api.commits import Commits
from client.api.validators import Validators
from client.api.evm import EVM
from client.api.node import Node
from client.api.peers import Peers
from client.api.receipts import Receipts
from client.api.rounds import Rounds
from client.api.transactions import Transactions
from client.api.votes import Votes
from client.api.wallets import Wallets
class ArkClient(object):
def __init__(self, hosts: Union[str, ClientHosts]):
"""
:param string hosts: hosts of the node
"""
self.connection = Connection(hosts)
@property
def api_nodes(self):
"""
:return: Nodes API
:rtype: client.api.api_nodes.ApiNodes
"""
return ApiNodes(self.connection)
@property
def blockchain(self):
"""
:return: Blockchain API
:rtype: client.api.blockchain.Blockchain
"""
return Blockchain(self.connection)
@property
def blocks(self):
"""
:return: Blocks API
:rtype: client.api.blocks.Blocks
"""
return Blocks(self.connection)
@property
def commits(self):
"""
:return: Commits API
:rtype: client.api.commits.Commits
"""
return Commits(self.connection)
@property
def evm(self):
"""
:return: EVM API
:rtype: client.api.evm.EVM
"""
return EVM(self.connection)
@property
def node(self):
"""
:return: Node API
:rtype: client.api.node.Node
"""
return Node(self.connection)
@property
def peers(self):
"""
:return: Peers API
:rtype: client.api.peers.Peers
"""
return Peers(self.connection)
@property
def receipts(self):
"""
:return: Receipts API
:rtype: client.api.receipts.Receipts
"""
return Receipts(self.connection)
@property
def rounds(self):
"""
:return: Rounds API
:rtype: client.api.rounds.Rounds
"""
return Rounds(self.connection)
@property
def transactions(self):
"""
:return: Transactions API
:rtype: client.api.transactions.Transactions
"""
return Transactions(self.connection)
@property
def validators(self):
"""
:return: Validators API
:rtype: client.api.validators.Validators
"""
return Validators(self.connection)
@property
def votes(self):
"""
:return: Votes API
:rtype: client.api.votes.Votes
"""
return Votes(self.connection)
@property
def wallets(self):
"""
:return: Wallets API
:rtype: client.api.wallets.Wallets
"""
return Wallets(self.connection)