-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathvalidators.py
More file actions
35 lines (28 loc) · 972 Bytes
/
validators.py
File metadata and controls
35 lines (28 loc) · 972 Bytes
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
from typing import Optional
from client.api.blocks import BlocksQuery
from client.api.wallets import WalletsQuery
from client.resource import Resource
from client.types.validators import ValidatorsQuery
class Validators(Resource):
def all(self, query: Optional[ValidatorsQuery] = None):
return self.with_endpoint('api').request_get('validators', query)
def get(self, validator_id: str):
return self.with_endpoint('api').request_get(
f'validators/{validator_id}'
)
def blocks(
self,
validator_id: str,
query: Optional[BlocksQuery] = None,
):
return self.with_endpoint('api').request_get(
f'validators/{validator_id}/blocks', query
)
def voters(
self,
validator_id: str,
query: Optional[WalletsQuery] = None,
):
return self.with_endpoint('api').request_get(
f'validators/{validator_id}/voters', query
)