bittensor-pylon-client 2.1.0__tar.gz → 2.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/PKG-INFO +3 -1
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/_unstable/asynchronous/api.py +63 -1
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/_unstable/sync/api.py +63 -1
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/_unstable/translators.py +61 -1
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/abstract_async.py +198 -3
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/abstract_sync.py +198 -3
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/client/asynchronous/client.py +69 -0
- bittensor_pylon_client-2.3.0/pylon_client/_internal/client/config.py +77 -0
- bittensor_pylon_client-2.3.0/pylon_client/_internal/client/neuron_client.py +355 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/client/sync/client.py +69 -0
- bittensor_pylon_client-2.3.0/pylon_client/_internal/file_backed_neurons.py +132 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/_unstable/bodies.py +10 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/_unstable/endpoints.py +20 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/_unstable/models.py +7 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/_unstable/requests.py +81 -5
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/_unstable/responses.py +47 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/models.py +43 -2
- bittensor_pylon_client-2.3.0/pylon_client/_internal/pylon_commons/settings.py +95 -0
- bittensor_pylon_client-2.3.0/pylon_client/_internal/pylon_commons/types/__init__.py +50 -0
- bittensor_pylon_client-2.1.0/pylon_client/_internal/pylon_commons/types.py → bittensor_pylon_client-2.3.0/pylon_client/_internal/pylon_commons/types/bittensor.py +3 -1
- bittensor_pylon_client-2.3.0/pylon_client/_internal/pylon_commons/types/evm.py +8 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/v1/endpoints.py +4 -3
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/v1/requests.py +2 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/v1/responses.py +2 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/artanis/__init__.py +2 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/artanis/unstable.py +11 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/artanis/v1.py +1 -0
- bittensor_pylon_client-2.3.0/pylon_client/exceptions.py +5 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pyproject.toml +10 -1
- bittensor_pylon_client-2.1.0/pylon_client/_internal/client/config.py +0 -41
- bittensor_pylon_client-2.1.0/pylon_client/_internal/pylon_commons/settings.py +0 -59
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/.gitignore +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/_unstable/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/_unstable/asynchronous/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/_unstable/sync/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/v1/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/v1/asynchronous/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/v1/asynchronous/api.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/v1/sync/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/v1/sync/api.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/api/v1/translators.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/client/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/client/asynchronous/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/client/asynchronous/communicators.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/client/asynchronous/config.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/client/namespace.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/client/sync/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/client/sync/communicators.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/client/sync/config.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/docker_manager.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/_unstable/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/apiver.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/constants.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/currency.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/endpoints.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/exceptions.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/timeout.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/v1/__init__.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/v1/bodies.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/pylon_commons/v1/models.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/_internal/translators.py +0 -0
- {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.3.0}/pylon_client/v1/__init__.py +0 -0
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bittensor-pylon-client
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Bittensor Pylon client library
|
|
5
5
|
Project-URL: homepage, https://github.com/backend-developers-ltd/bittensor-pylon
|
|
6
6
|
Project-URL: repository, https://github.com/backend-developers-ltd/bittensor-pylon
|
|
7
7
|
Author-email: Reef Technologies <opensource@reef.pl>
|
|
8
8
|
Requires-Python: >=3.11
|
|
9
9
|
Requires-Dist: apscheduler
|
|
10
|
+
Requires-Dist: cryptography
|
|
10
11
|
Requires-Dist: docker
|
|
11
12
|
Requires-Dist: httpx
|
|
12
13
|
Requires-Dist: pydantic-settings>=2.0
|
|
13
14
|
Requires-Dist: pydantic>=2.0
|
|
15
|
+
Requires-Dist: pyyaml>=6
|
|
14
16
|
Requires-Dist: tenacity
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import cast
|
|
1
|
+
from typing import Any, cast
|
|
2
2
|
|
|
3
3
|
from pylon_client._internal.api.abstract_async import (
|
|
4
4
|
AbstractAsyncIdentityApi,
|
|
@@ -6,17 +6,24 @@ from pylon_client._internal.api.abstract_async import (
|
|
|
6
6
|
)
|
|
7
7
|
from pylon_client._internal.pylon_commons._unstable.requests import (
|
|
8
8
|
GetAllRevealedCommitmentsRequest,
|
|
9
|
+
GetCertificateRequest,
|
|
9
10
|
GetCommitmentRequest,
|
|
10
11
|
GetCommitmentsRequest,
|
|
11
12
|
GetDrandLastStoredRoundRequest,
|
|
13
|
+
GetEvmLogsRequest,
|
|
12
14
|
GetExtrinsicRequest,
|
|
13
15
|
GetIdentitiesRequest,
|
|
14
16
|
GetLatestBlockInfoRequest,
|
|
17
|
+
GetLatestEvmAssociationsRequest,
|
|
15
18
|
GetLatestNeuronsRequest,
|
|
19
|
+
GetLatestPriceRequest,
|
|
20
|
+
GetLatestPricesRequest,
|
|
16
21
|
GetLatestValidatorsRequest,
|
|
17
22
|
GetNeuronsRequest,
|
|
18
23
|
GetOwnCommitmentRequest,
|
|
19
24
|
GetOwnRevealedCommitmentsRequest,
|
|
25
|
+
GetPriceRequest,
|
|
26
|
+
GetPricesRequest,
|
|
20
27
|
GetRecentNeuronsRequest,
|
|
21
28
|
GetRevealedCommitmentsRequest,
|
|
22
29
|
GetValidatorsRequest,
|
|
@@ -38,6 +45,7 @@ from pylon_client._internal.pylon_commons.types import (
|
|
|
38
45
|
RevealedCommitmentData,
|
|
39
46
|
Weight,
|
|
40
47
|
)
|
|
48
|
+
from pylon_client._internal.pylon_commons.types import evm as evm_types
|
|
41
49
|
|
|
42
50
|
|
|
43
51
|
class AsyncOpenAccessApi(AbstractAsyncOpenAccessApi):
|
|
@@ -76,6 +84,18 @@ class AsyncOpenAccessApi(AbstractAsyncOpenAccessApi):
|
|
|
76
84
|
async def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest:
|
|
77
85
|
return GetLatestBlockInfoRequest()
|
|
78
86
|
|
|
87
|
+
async def _get_latest_prices_request(self) -> GetLatestPricesRequest:
|
|
88
|
+
return GetLatestPricesRequest()
|
|
89
|
+
|
|
90
|
+
async def _get_prices_request(self, block_number: BlockNumber) -> GetPricesRequest:
|
|
91
|
+
return GetPricesRequest(block_number=block_number)
|
|
92
|
+
|
|
93
|
+
async def _get_latest_price_request(self, netuid: NetUid) -> GetLatestPriceRequest:
|
|
94
|
+
return GetLatestPriceRequest(netuid=netuid)
|
|
95
|
+
|
|
96
|
+
async def _get_price_request(self, netuid: NetUid, block_number: BlockNumber) -> GetPriceRequest:
|
|
97
|
+
return GetPriceRequest(netuid=netuid, block_number=block_number)
|
|
98
|
+
|
|
79
99
|
async def _get_extrinsic_request(
|
|
80
100
|
self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
|
|
81
101
|
) -> GetExtrinsicRequest:
|
|
@@ -84,6 +104,26 @@ class AsyncOpenAccessApi(AbstractAsyncOpenAccessApi):
|
|
|
84
104
|
async def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest:
|
|
85
105
|
return GetDrandLastStoredRoundRequest()
|
|
86
106
|
|
|
107
|
+
async def _get_latest_evm_associations_request(self, netuid: NetUid) -> GetLatestEvmAssociationsRequest:
|
|
108
|
+
return GetLatestEvmAssociationsRequest(netuid=netuid)
|
|
109
|
+
|
|
110
|
+
async def _get_evm_logs_request(
|
|
111
|
+
self,
|
|
112
|
+
contract_address: evm_types.Address,
|
|
113
|
+
from_block: evm_types.BlockNumber,
|
|
114
|
+
to_block: evm_types.BlockNumber,
|
|
115
|
+
abi: list[dict[str, Any]],
|
|
116
|
+
) -> GetEvmLogsRequest:
|
|
117
|
+
return GetEvmLogsRequest(
|
|
118
|
+
contract_address=contract_address,
|
|
119
|
+
from_block=from_block,
|
|
120
|
+
to_block=to_block,
|
|
121
|
+
abi=abi,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
async def _get_certificate_request(self, netuid: NetUid, hotkey: Hotkey) -> GetCertificateRequest:
|
|
125
|
+
return GetCertificateRequest(netuid=netuid, hotkey=hotkey)
|
|
126
|
+
|
|
87
127
|
|
|
88
128
|
class AsyncIdentityApi(AbstractAsyncIdentityApi):
|
|
89
129
|
api_version = ApiVersion.UNSTABLE
|
|
@@ -206,6 +246,18 @@ class AsyncIdentityApi(AbstractAsyncIdentityApi):
|
|
|
206
246
|
async def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest:
|
|
207
247
|
return GetLatestBlockInfoRequest()
|
|
208
248
|
|
|
249
|
+
async def _get_latest_prices_request(self) -> GetLatestPricesRequest:
|
|
250
|
+
return GetLatestPricesRequest()
|
|
251
|
+
|
|
252
|
+
async def _get_prices_request(self, block_number: BlockNumber) -> GetPricesRequest:
|
|
253
|
+
return GetPricesRequest(block_number=block_number)
|
|
254
|
+
|
|
255
|
+
async def _get_latest_price_request(self) -> GetLatestPriceRequest:
|
|
256
|
+
return GetLatestPriceRequest(netuid=self.netuid, identity_name=self.identity_name)
|
|
257
|
+
|
|
258
|
+
async def _get_price_request(self, block_number: BlockNumber) -> GetPriceRequest:
|
|
259
|
+
return GetPriceRequest(netuid=self.netuid, identity_name=self.identity_name, block_number=block_number)
|
|
260
|
+
|
|
209
261
|
async def _get_extrinsic_request(
|
|
210
262
|
self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
|
|
211
263
|
) -> GetExtrinsicRequest:
|
|
@@ -213,3 +265,13 @@ class AsyncIdentityApi(AbstractAsyncIdentityApi):
|
|
|
213
265
|
|
|
214
266
|
async def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest:
|
|
215
267
|
return GetDrandLastStoredRoundRequest()
|
|
268
|
+
|
|
269
|
+
async def _get_latest_evm_associations_request(self) -> GetLatestEvmAssociationsRequest:
|
|
270
|
+
return GetLatestEvmAssociationsRequest(netuid=self.netuid, identity_name=self.identity_name)
|
|
271
|
+
|
|
272
|
+
async def _get_certificate_request(self, hotkey: Hotkey) -> GetCertificateRequest:
|
|
273
|
+
return GetCertificateRequest(
|
|
274
|
+
netuid=self.netuid,
|
|
275
|
+
identity_name=self.identity_name,
|
|
276
|
+
hotkey=hotkey,
|
|
277
|
+
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import cast
|
|
1
|
+
from typing import Any, cast
|
|
2
2
|
|
|
3
3
|
from pylon_client._internal.api.abstract_sync import (
|
|
4
4
|
AbstractIdentityApi,
|
|
@@ -6,17 +6,24 @@ from pylon_client._internal.api.abstract_sync import (
|
|
|
6
6
|
)
|
|
7
7
|
from pylon_client._internal.pylon_commons._unstable.requests import (
|
|
8
8
|
GetAllRevealedCommitmentsRequest,
|
|
9
|
+
GetCertificateRequest,
|
|
9
10
|
GetCommitmentRequest,
|
|
10
11
|
GetCommitmentsRequest,
|
|
11
12
|
GetDrandLastStoredRoundRequest,
|
|
13
|
+
GetEvmLogsRequest,
|
|
12
14
|
GetExtrinsicRequest,
|
|
13
15
|
GetIdentitiesRequest,
|
|
14
16
|
GetLatestBlockInfoRequest,
|
|
17
|
+
GetLatestEvmAssociationsRequest,
|
|
15
18
|
GetLatestNeuronsRequest,
|
|
19
|
+
GetLatestPriceRequest,
|
|
20
|
+
GetLatestPricesRequest,
|
|
16
21
|
GetLatestValidatorsRequest,
|
|
17
22
|
GetNeuronsRequest,
|
|
18
23
|
GetOwnCommitmentRequest,
|
|
19
24
|
GetOwnRevealedCommitmentsRequest,
|
|
25
|
+
GetPriceRequest,
|
|
26
|
+
GetPricesRequest,
|
|
20
27
|
GetRecentNeuronsRequest,
|
|
21
28
|
GetRevealedCommitmentsRequest,
|
|
22
29
|
GetValidatorsRequest,
|
|
@@ -38,6 +45,7 @@ from pylon_client._internal.pylon_commons.types import (
|
|
|
38
45
|
RevealedCommitmentData,
|
|
39
46
|
Weight,
|
|
40
47
|
)
|
|
48
|
+
from pylon_client._internal.pylon_commons.types import evm as evm_types
|
|
41
49
|
|
|
42
50
|
|
|
43
51
|
class OpenAccessApi(AbstractOpenAccessApi):
|
|
@@ -76,12 +84,44 @@ class OpenAccessApi(AbstractOpenAccessApi):
|
|
|
76
84
|
def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest:
|
|
77
85
|
return GetLatestBlockInfoRequest()
|
|
78
86
|
|
|
87
|
+
def _get_latest_prices_request(self) -> GetLatestPricesRequest:
|
|
88
|
+
return GetLatestPricesRequest()
|
|
89
|
+
|
|
90
|
+
def _get_prices_request(self, block_number: BlockNumber) -> GetPricesRequest:
|
|
91
|
+
return GetPricesRequest(block_number=block_number)
|
|
92
|
+
|
|
93
|
+
def _get_latest_price_request(self, netuid: NetUid) -> GetLatestPriceRequest:
|
|
94
|
+
return GetLatestPriceRequest(netuid=netuid)
|
|
95
|
+
|
|
96
|
+
def _get_price_request(self, netuid: NetUid, block_number: BlockNumber) -> GetPriceRequest:
|
|
97
|
+
return GetPriceRequest(netuid=netuid, block_number=block_number)
|
|
98
|
+
|
|
79
99
|
def _get_extrinsic_request(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicRequest:
|
|
80
100
|
return GetExtrinsicRequest(block_number=block_number, extrinsic_index=extrinsic_index)
|
|
81
101
|
|
|
82
102
|
def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest:
|
|
83
103
|
return GetDrandLastStoredRoundRequest()
|
|
84
104
|
|
|
105
|
+
def _get_latest_evm_associations_request(self, netuid: NetUid) -> GetLatestEvmAssociationsRequest:
|
|
106
|
+
return GetLatestEvmAssociationsRequest(netuid=netuid)
|
|
107
|
+
|
|
108
|
+
def _get_evm_logs_request(
|
|
109
|
+
self,
|
|
110
|
+
contract_address: evm_types.Address,
|
|
111
|
+
from_block: evm_types.BlockNumber,
|
|
112
|
+
to_block: evm_types.BlockNumber,
|
|
113
|
+
abi: list[dict[str, Any]],
|
|
114
|
+
) -> GetEvmLogsRequest:
|
|
115
|
+
return GetEvmLogsRequest(
|
|
116
|
+
contract_address=contract_address,
|
|
117
|
+
from_block=from_block,
|
|
118
|
+
to_block=to_block,
|
|
119
|
+
abi=abi,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
def _get_certificate_request(self, netuid: NetUid, hotkey: Hotkey) -> GetCertificateRequest:
|
|
123
|
+
return GetCertificateRequest(netuid=netuid, hotkey=hotkey)
|
|
124
|
+
|
|
85
125
|
|
|
86
126
|
class IdentityApi(AbstractIdentityApi):
|
|
87
127
|
api_version = ApiVersion.UNSTABLE
|
|
@@ -202,8 +242,30 @@ class IdentityApi(AbstractIdentityApi):
|
|
|
202
242
|
def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest:
|
|
203
243
|
return GetLatestBlockInfoRequest()
|
|
204
244
|
|
|
245
|
+
def _get_latest_prices_request(self) -> GetLatestPricesRequest:
|
|
246
|
+
return GetLatestPricesRequest()
|
|
247
|
+
|
|
248
|
+
def _get_prices_request(self, block_number: BlockNumber) -> GetPricesRequest:
|
|
249
|
+
return GetPricesRequest(block_number=block_number)
|
|
250
|
+
|
|
251
|
+
def _get_latest_price_request(self) -> GetLatestPriceRequest:
|
|
252
|
+
return GetLatestPriceRequest(netuid=self.netuid, identity_name=self.identity_name)
|
|
253
|
+
|
|
254
|
+
def _get_price_request(self, block_number: BlockNumber) -> GetPriceRequest:
|
|
255
|
+
return GetPriceRequest(netuid=self.netuid, identity_name=self.identity_name, block_number=block_number)
|
|
256
|
+
|
|
205
257
|
def _get_extrinsic_request(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicRequest:
|
|
206
258
|
return GetExtrinsicRequest(block_number=block_number, extrinsic_index=extrinsic_index)
|
|
207
259
|
|
|
208
260
|
def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest:
|
|
209
261
|
return GetDrandLastStoredRoundRequest()
|
|
262
|
+
|
|
263
|
+
def _get_latest_evm_associations_request(self) -> GetLatestEvmAssociationsRequest:
|
|
264
|
+
return GetLatestEvmAssociationsRequest(netuid=self.netuid, identity_name=self.identity_name)
|
|
265
|
+
|
|
266
|
+
def _get_certificate_request(self, hotkey: Hotkey) -> GetCertificateRequest:
|
|
267
|
+
return GetCertificateRequest(
|
|
268
|
+
netuid=self.netuid,
|
|
269
|
+
identity_name=self.identity_name,
|
|
270
|
+
hotkey=hotkey,
|
|
271
|
+
)
|
|
@@ -8,17 +8,24 @@ from pylon_client._internal.pylon_commons._unstable.endpoints import Endpoint as
|
|
|
8
8
|
from pylon_client._internal.pylon_commons._unstable.requests import (
|
|
9
9
|
AuthenticatedPylonRequest,
|
|
10
10
|
GetAllRevealedCommitmentsRequest,
|
|
11
|
+
GetCertificateRequest,
|
|
11
12
|
GetCommitmentRequest,
|
|
12
13
|
GetCommitmentsRequest,
|
|
13
14
|
GetDrandLastStoredRoundRequest,
|
|
15
|
+
GetEvmLogsRequest,
|
|
14
16
|
GetExtrinsicRequest,
|
|
15
17
|
GetIdentitiesRequest,
|
|
16
18
|
GetLatestBlockInfoRequest,
|
|
19
|
+
GetLatestEvmAssociationsRequest,
|
|
17
20
|
GetLatestNeuronsRequest,
|
|
21
|
+
GetLatestPriceRequest,
|
|
22
|
+
GetLatestPricesRequest,
|
|
18
23
|
GetLatestValidatorsRequest,
|
|
19
24
|
GetNeuronsRequest,
|
|
20
25
|
GetOwnCommitmentRequest,
|
|
21
26
|
GetOwnRevealedCommitmentsRequest,
|
|
27
|
+
GetPriceRequest,
|
|
28
|
+
GetPricesRequest,
|
|
22
29
|
GetRecentNeuronsRequest,
|
|
23
30
|
GetRevealedCommitmentsRequest,
|
|
24
31
|
GetValidatorsRequest,
|
|
@@ -63,7 +70,7 @@ class HttpTranslator(AbstractRequestTranslator[Request, HttpCommunicatorT]):
|
|
|
63
70
|
identity_name_=request.identity_name,
|
|
64
71
|
**request.model_dump(exclude={"netuid", "identity_name"}),
|
|
65
72
|
)
|
|
66
|
-
return endpoint.absolute_url(**request.model_dump())
|
|
73
|
+
return endpoint.absolute_url(is_public_=True, **request.model_dump())
|
|
67
74
|
|
|
68
75
|
def _translate_get_neurons(self, request: GetNeuronsRequest, communicator: HttpCommunicatorT) -> Request:
|
|
69
76
|
url = self._build_url(self._endpoint_cls.NEURONS, request)
|
|
@@ -213,6 +220,32 @@ class HttpTranslator(AbstractRequestTranslator[Request, HttpCommunicatorT]):
|
|
|
213
220
|
method=self._endpoint_cls.LATEST_BLOCK_INFO.method, url=url, headers=headers
|
|
214
221
|
)
|
|
215
222
|
|
|
223
|
+
def _translate_get_latest_prices(self, request: GetLatestPricesRequest, communicator: HttpCommunicatorT) -> Request:
|
|
224
|
+
url = self._build_url(self._endpoint_cls.LATEST_PRICES, request)
|
|
225
|
+
headers = self._get_auth_headers(request, communicator)
|
|
226
|
+
return communicator.raw_client.build_request(
|
|
227
|
+
method=self._endpoint_cls.LATEST_PRICES.method, url=url, headers=headers
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
def _translate_get_prices(self, request: GetPricesRequest, communicator: HttpCommunicatorT) -> Request:
|
|
231
|
+
url = self._build_url(self._endpoint_cls.PRICES, request)
|
|
232
|
+
headers = self._get_auth_headers(request, communicator)
|
|
233
|
+
return communicator.raw_client.build_request(method=self._endpoint_cls.PRICES.method, url=url, headers=headers)
|
|
234
|
+
|
|
235
|
+
def _translate_get_latest_price(self, request: GetLatestPriceRequest, communicator: HttpCommunicatorT) -> Request:
|
|
236
|
+
url = self._build_url(self._endpoint_cls.SUBNET_LATEST_PRICE, request)
|
|
237
|
+
headers = self._get_auth_headers(request, communicator)
|
|
238
|
+
return communicator.raw_client.build_request(
|
|
239
|
+
method=self._endpoint_cls.SUBNET_LATEST_PRICE.method, url=url, headers=headers
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
def _translate_get_price(self, request: GetPriceRequest, communicator: HttpCommunicatorT) -> Request:
|
|
243
|
+
url = self._build_url(self._endpoint_cls.SUBNET_PRICE, request)
|
|
244
|
+
headers = self._get_auth_headers(request, communicator)
|
|
245
|
+
return communicator.raw_client.build_request(
|
|
246
|
+
method=self._endpoint_cls.SUBNET_PRICE.method, url=url, headers=headers
|
|
247
|
+
)
|
|
248
|
+
|
|
216
249
|
def _translate_get_extrinsic(self, request: GetExtrinsicRequest, communicator: HttpCommunicatorT) -> Request:
|
|
217
250
|
url = self._build_url(self._endpoint_cls.EXTRINSIC, request)
|
|
218
251
|
headers = self._get_auth_headers(request, communicator)
|
|
@@ -225,3 +258,30 @@ class HttpTranslator(AbstractRequestTranslator[Request, HttpCommunicatorT]):
|
|
|
225
258
|
) -> Request:
|
|
226
259
|
url = self._build_url(self._endpoint_cls.DRAND_LAST_STORED_ROUND, request)
|
|
227
260
|
return communicator.raw_client.build_request(method=self._endpoint_cls.DRAND_LAST_STORED_ROUND.method, url=url)
|
|
261
|
+
|
|
262
|
+
def _translate_get_latest_evm_associations(
|
|
263
|
+
self, request: GetLatestEvmAssociationsRequest, communicator: HttpCommunicatorT
|
|
264
|
+
) -> Request:
|
|
265
|
+
url = self._build_url(self._endpoint_cls.LATEST_EVM_ASSOCIATIONS, request)
|
|
266
|
+
headers = self._get_auth_headers(request, communicator)
|
|
267
|
+
return communicator.raw_client.build_request(
|
|
268
|
+
method=self._endpoint_cls.LATEST_EVM_ASSOCIATIONS.method, url=url, headers=headers
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
def _translate_get_evm_logs(self, request: GetEvmLogsRequest, communicator: HttpCommunicatorT) -> Request:
|
|
272
|
+
url = self._endpoint_cls.EVM_LOGS.absolute_url(contract_address=request.contract_address)
|
|
273
|
+
headers = self._get_auth_headers(request, communicator)
|
|
274
|
+
return communicator.raw_client.build_request(
|
|
275
|
+
method=self._endpoint_cls.EVM_LOGS.method,
|
|
276
|
+
url=url,
|
|
277
|
+
headers=headers,
|
|
278
|
+
params={"from_block": request.from_block, "to_block": request.to_block},
|
|
279
|
+
json=request.model_dump(include={"abi"}),
|
|
280
|
+
)
|
|
281
|
+
|
|
282
|
+
def _translate_get_certificate(self, request: GetCertificateRequest, communicator: HttpCommunicatorT) -> Request:
|
|
283
|
+
url = self._build_url(self._endpoint_cls.CERTIFICATES_HOTKEY, request)
|
|
284
|
+
headers = self._get_auth_headers(request, communicator)
|
|
285
|
+
return communicator.raw_client.build_request(
|
|
286
|
+
method=self._endpoint_cls.CERTIFICATES_HOTKEY.method, url=url, headers=headers
|
|
287
|
+
)
|