bittensor-pylon-client 2.0.0__tar.gz → 2.2.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.0.0 → bittensor_pylon_client-2.2.0}/.gitignore +3 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/PKG-INFO +1 -1
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/_unstable/asynchronous/api.py +48 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/_unstable/sync/api.py +48 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/_unstable/translators.py +54 -2
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/abstract_async.py +121 -2
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/abstract_sync.py +121 -2
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/_unstable/endpoints.py +11 -1
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/_unstable/models.py +6 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/_unstable/requests.py +63 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/_unstable/responses.py +36 -2
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/models.py +32 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/types.py +2 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/v1/endpoints.py +4 -1
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/artanis/__init__.py +1 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/artanis/unstable.py +9 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/_unstable/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/_unstable/asynchronous/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/_unstable/sync/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/v1/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/v1/asynchronous/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/v1/asynchronous/api.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/v1/sync/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/v1/sync/api.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/v1/translators.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/asynchronous/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/asynchronous/client.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/asynchronous/communicators.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/asynchronous/config.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/config.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/namespace.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/sync/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/sync/client.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/sync/communicators.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/sync/config.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/docker_manager.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/_unstable/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/_unstable/bodies.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/apiver.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/constants.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/currency.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/endpoints.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/exceptions.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/settings.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/timeout.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/v1/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/v1/bodies.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/v1/models.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/v1/requests.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/v1/responses.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/translators.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/artanis/v1.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/v1/__init__.py +0 -0
- {bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bittensor-pylon-client
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.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
|
|
@@ -12,14 +12,20 @@ from pylon_client._internal.pylon_commons._unstable.requests import (
|
|
|
12
12
|
GetExtrinsicRequest,
|
|
13
13
|
GetIdentitiesRequest,
|
|
14
14
|
GetLatestBlockInfoRequest,
|
|
15
|
+
GetLatestEvmAssociationsRequest,
|
|
15
16
|
GetLatestNeuronsRequest,
|
|
17
|
+
GetLatestPriceRequest,
|
|
18
|
+
GetLatestPricesRequest,
|
|
16
19
|
GetLatestValidatorsRequest,
|
|
17
20
|
GetNeuronsRequest,
|
|
18
21
|
GetOwnCommitmentRequest,
|
|
19
22
|
GetOwnRevealedCommitmentsRequest,
|
|
23
|
+
GetPriceRequest,
|
|
24
|
+
GetPricesRequest,
|
|
20
25
|
GetRecentNeuronsRequest,
|
|
21
26
|
GetRevealedCommitmentsRequest,
|
|
22
27
|
GetValidatorsRequest,
|
|
28
|
+
GetWeightsStatusRequest,
|
|
23
29
|
SetCommitmentRequest,
|
|
24
30
|
SetRevealedCommitmentRequest,
|
|
25
31
|
SetWeightsRequest,
|
|
@@ -75,6 +81,18 @@ class AsyncOpenAccessApi(AbstractAsyncOpenAccessApi):
|
|
|
75
81
|
async def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest:
|
|
76
82
|
return GetLatestBlockInfoRequest()
|
|
77
83
|
|
|
84
|
+
async def _get_latest_prices_request(self) -> GetLatestPricesRequest:
|
|
85
|
+
return GetLatestPricesRequest()
|
|
86
|
+
|
|
87
|
+
async def _get_prices_request(self, block_number: BlockNumber) -> GetPricesRequest:
|
|
88
|
+
return GetPricesRequest(block_number=block_number)
|
|
89
|
+
|
|
90
|
+
async def _get_latest_price_request(self, netuid: NetUid) -> GetLatestPriceRequest:
|
|
91
|
+
return GetLatestPriceRequest(netuid=netuid)
|
|
92
|
+
|
|
93
|
+
async def _get_price_request(self, netuid: NetUid, block_number: BlockNumber) -> GetPriceRequest:
|
|
94
|
+
return GetPriceRequest(netuid=netuid, block_number=block_number)
|
|
95
|
+
|
|
78
96
|
async def _get_extrinsic_request(
|
|
79
97
|
self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
|
|
80
98
|
) -> GetExtrinsicRequest:
|
|
@@ -83,6 +101,9 @@ class AsyncOpenAccessApi(AbstractAsyncOpenAccessApi):
|
|
|
83
101
|
async def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest:
|
|
84
102
|
return GetDrandLastStoredRoundRequest()
|
|
85
103
|
|
|
104
|
+
async def _get_latest_evm_associations_request(self, netuid: NetUid) -> GetLatestEvmAssociationsRequest:
|
|
105
|
+
return GetLatestEvmAssociationsRequest(netuid=netuid)
|
|
106
|
+
|
|
86
107
|
|
|
87
108
|
class AsyncIdentityApi(AbstractAsyncIdentityApi):
|
|
88
109
|
api_version = ApiVersion.UNSTABLE
|
|
@@ -120,6 +141,18 @@ class AsyncIdentityApi(AbstractAsyncIdentityApi):
|
|
|
120
141
|
mechanism_id=mechanism_id,
|
|
121
142
|
)
|
|
122
143
|
|
|
144
|
+
async def _get_weights_status_request(
|
|
145
|
+
self,
|
|
146
|
+
mechanism_id: MechanismId,
|
|
147
|
+
block_number: BlockNumber,
|
|
148
|
+
) -> GetWeightsStatusRequest:
|
|
149
|
+
return GetWeightsStatusRequest(
|
|
150
|
+
netuid=self.netuid,
|
|
151
|
+
identity_name=self.identity_name,
|
|
152
|
+
mechanism_id=mechanism_id,
|
|
153
|
+
block_number=block_number,
|
|
154
|
+
)
|
|
155
|
+
|
|
123
156
|
async def _get_commitments_request(self) -> GetCommitmentsRequest:
|
|
124
157
|
return GetCommitmentsRequest(
|
|
125
158
|
netuid=self.netuid,
|
|
@@ -193,6 +226,18 @@ class AsyncIdentityApi(AbstractAsyncIdentityApi):
|
|
|
193
226
|
async def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest:
|
|
194
227
|
return GetLatestBlockInfoRequest()
|
|
195
228
|
|
|
229
|
+
async def _get_latest_prices_request(self) -> GetLatestPricesRequest:
|
|
230
|
+
return GetLatestPricesRequest()
|
|
231
|
+
|
|
232
|
+
async def _get_prices_request(self, block_number: BlockNumber) -> GetPricesRequest:
|
|
233
|
+
return GetPricesRequest(block_number=block_number)
|
|
234
|
+
|
|
235
|
+
async def _get_latest_price_request(self) -> GetLatestPriceRequest:
|
|
236
|
+
return GetLatestPriceRequest(netuid=self.netuid, identity_name=self.identity_name)
|
|
237
|
+
|
|
238
|
+
async def _get_price_request(self, block_number: BlockNumber) -> GetPriceRequest:
|
|
239
|
+
return GetPriceRequest(netuid=self.netuid, identity_name=self.identity_name, block_number=block_number)
|
|
240
|
+
|
|
196
241
|
async def _get_extrinsic_request(
|
|
197
242
|
self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
|
|
198
243
|
) -> GetExtrinsicRequest:
|
|
@@ -200,3 +245,6 @@ class AsyncIdentityApi(AbstractAsyncIdentityApi):
|
|
|
200
245
|
|
|
201
246
|
async def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest:
|
|
202
247
|
return GetDrandLastStoredRoundRequest()
|
|
248
|
+
|
|
249
|
+
async def _get_latest_evm_associations_request(self) -> GetLatestEvmAssociationsRequest:
|
|
250
|
+
return GetLatestEvmAssociationsRequest(netuid=self.netuid, identity_name=self.identity_name)
|
|
@@ -12,14 +12,20 @@ from pylon_client._internal.pylon_commons._unstable.requests import (
|
|
|
12
12
|
GetExtrinsicRequest,
|
|
13
13
|
GetIdentitiesRequest,
|
|
14
14
|
GetLatestBlockInfoRequest,
|
|
15
|
+
GetLatestEvmAssociationsRequest,
|
|
15
16
|
GetLatestNeuronsRequest,
|
|
17
|
+
GetLatestPriceRequest,
|
|
18
|
+
GetLatestPricesRequest,
|
|
16
19
|
GetLatestValidatorsRequest,
|
|
17
20
|
GetNeuronsRequest,
|
|
18
21
|
GetOwnCommitmentRequest,
|
|
19
22
|
GetOwnRevealedCommitmentsRequest,
|
|
23
|
+
GetPriceRequest,
|
|
24
|
+
GetPricesRequest,
|
|
20
25
|
GetRecentNeuronsRequest,
|
|
21
26
|
GetRevealedCommitmentsRequest,
|
|
22
27
|
GetValidatorsRequest,
|
|
28
|
+
GetWeightsStatusRequest,
|
|
23
29
|
SetCommitmentRequest,
|
|
24
30
|
SetRevealedCommitmentRequest,
|
|
25
31
|
SetWeightsRequest,
|
|
@@ -75,12 +81,27 @@ class OpenAccessApi(AbstractOpenAccessApi):
|
|
|
75
81
|
def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest:
|
|
76
82
|
return GetLatestBlockInfoRequest()
|
|
77
83
|
|
|
84
|
+
def _get_latest_prices_request(self) -> GetLatestPricesRequest:
|
|
85
|
+
return GetLatestPricesRequest()
|
|
86
|
+
|
|
87
|
+
def _get_prices_request(self, block_number: BlockNumber) -> GetPricesRequest:
|
|
88
|
+
return GetPricesRequest(block_number=block_number)
|
|
89
|
+
|
|
90
|
+
def _get_latest_price_request(self, netuid: NetUid) -> GetLatestPriceRequest:
|
|
91
|
+
return GetLatestPriceRequest(netuid=netuid)
|
|
92
|
+
|
|
93
|
+
def _get_price_request(self, netuid: NetUid, block_number: BlockNumber) -> GetPriceRequest:
|
|
94
|
+
return GetPriceRequest(netuid=netuid, block_number=block_number)
|
|
95
|
+
|
|
78
96
|
def _get_extrinsic_request(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicRequest:
|
|
79
97
|
return GetExtrinsicRequest(block_number=block_number, extrinsic_index=extrinsic_index)
|
|
80
98
|
|
|
81
99
|
def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest:
|
|
82
100
|
return GetDrandLastStoredRoundRequest()
|
|
83
101
|
|
|
102
|
+
def _get_latest_evm_associations_request(self, netuid: NetUid) -> GetLatestEvmAssociationsRequest:
|
|
103
|
+
return GetLatestEvmAssociationsRequest(netuid=netuid)
|
|
104
|
+
|
|
84
105
|
|
|
85
106
|
class IdentityApi(AbstractIdentityApi):
|
|
86
107
|
api_version = ApiVersion.UNSTABLE
|
|
@@ -118,6 +139,18 @@ class IdentityApi(AbstractIdentityApi):
|
|
|
118
139
|
mechanism_id=mechanism_id,
|
|
119
140
|
)
|
|
120
141
|
|
|
142
|
+
def _get_weights_status_request(
|
|
143
|
+
self,
|
|
144
|
+
mechanism_id: MechanismId,
|
|
145
|
+
block_number: BlockNumber,
|
|
146
|
+
) -> GetWeightsStatusRequest:
|
|
147
|
+
return GetWeightsStatusRequest(
|
|
148
|
+
netuid=self.netuid,
|
|
149
|
+
identity_name=self.identity_name,
|
|
150
|
+
mechanism_id=mechanism_id,
|
|
151
|
+
block_number=block_number,
|
|
152
|
+
)
|
|
153
|
+
|
|
121
154
|
def _get_commitments_request(self) -> GetCommitmentsRequest:
|
|
122
155
|
return GetCommitmentsRequest(
|
|
123
156
|
netuid=self.netuid,
|
|
@@ -189,8 +222,23 @@ class IdentityApi(AbstractIdentityApi):
|
|
|
189
222
|
def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest:
|
|
190
223
|
return GetLatestBlockInfoRequest()
|
|
191
224
|
|
|
225
|
+
def _get_latest_prices_request(self) -> GetLatestPricesRequest:
|
|
226
|
+
return GetLatestPricesRequest()
|
|
227
|
+
|
|
228
|
+
def _get_prices_request(self, block_number: BlockNumber) -> GetPricesRequest:
|
|
229
|
+
return GetPricesRequest(block_number=block_number)
|
|
230
|
+
|
|
231
|
+
def _get_latest_price_request(self) -> GetLatestPriceRequest:
|
|
232
|
+
return GetLatestPriceRequest(netuid=self.netuid, identity_name=self.identity_name)
|
|
233
|
+
|
|
234
|
+
def _get_price_request(self, block_number: BlockNumber) -> GetPriceRequest:
|
|
235
|
+
return GetPriceRequest(netuid=self.netuid, identity_name=self.identity_name, block_number=block_number)
|
|
236
|
+
|
|
192
237
|
def _get_extrinsic_request(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicRequest:
|
|
193
238
|
return GetExtrinsicRequest(block_number=block_number, extrinsic_index=extrinsic_index)
|
|
194
239
|
|
|
195
240
|
def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest:
|
|
196
241
|
return GetDrandLastStoredRoundRequest()
|
|
242
|
+
|
|
243
|
+
def _get_latest_evm_associations_request(self) -> GetLatestEvmAssociationsRequest:
|
|
244
|
+
return GetLatestEvmAssociationsRequest(netuid=self.netuid, identity_name=self.identity_name)
|
|
@@ -14,14 +14,20 @@ from pylon_client._internal.pylon_commons._unstable.requests import (
|
|
|
14
14
|
GetExtrinsicRequest,
|
|
15
15
|
GetIdentitiesRequest,
|
|
16
16
|
GetLatestBlockInfoRequest,
|
|
17
|
+
GetLatestEvmAssociationsRequest,
|
|
17
18
|
GetLatestNeuronsRequest,
|
|
19
|
+
GetLatestPriceRequest,
|
|
20
|
+
GetLatestPricesRequest,
|
|
18
21
|
GetLatestValidatorsRequest,
|
|
19
22
|
GetNeuronsRequest,
|
|
20
23
|
GetOwnCommitmentRequest,
|
|
21
24
|
GetOwnRevealedCommitmentsRequest,
|
|
25
|
+
GetPriceRequest,
|
|
26
|
+
GetPricesRequest,
|
|
22
27
|
GetRecentNeuronsRequest,
|
|
23
28
|
GetRevealedCommitmentsRequest,
|
|
24
29
|
GetValidatorsRequest,
|
|
30
|
+
GetWeightsStatusRequest,
|
|
25
31
|
PylonRequest,
|
|
26
32
|
SetCommitmentRequest,
|
|
27
33
|
SetRevealedCommitmentRequest,
|
|
@@ -154,15 +160,26 @@ class HttpTranslator(AbstractRequestTranslator[Request, HttpCommunicatorT]):
|
|
|
154
160
|
)
|
|
155
161
|
|
|
156
162
|
def _translate_set_weights(self, request: SetWeightsRequest, communicator: HttpCommunicatorT) -> Request:
|
|
157
|
-
url = self._build_url(self._endpoint_cls.
|
|
163
|
+
url = self._build_url(self._endpoint_cls.SUBNET_MECHANISM_WEIGHTS, request)
|
|
158
164
|
headers = self._get_auth_headers(request, communicator)
|
|
159
165
|
return communicator.raw_client.build_request(
|
|
160
|
-
method=self._endpoint_cls.
|
|
166
|
+
method=self._endpoint_cls.SUBNET_MECHANISM_WEIGHTS.method,
|
|
161
167
|
url=url,
|
|
162
168
|
headers=headers,
|
|
163
169
|
json=request.model_dump(include={"weights"}),
|
|
164
170
|
)
|
|
165
171
|
|
|
172
|
+
def _translate_get_weights_status(
|
|
173
|
+
self, request: GetWeightsStatusRequest, communicator: HttpCommunicatorT
|
|
174
|
+
) -> Request:
|
|
175
|
+
url = self._build_url(self._endpoint_cls.SUBNET_MECHANISM_WEIGHTS_STATUS, request)
|
|
176
|
+
headers = self._get_auth_headers(request, communicator)
|
|
177
|
+
return communicator.raw_client.build_request(
|
|
178
|
+
method=self._endpoint_cls.SUBNET_MECHANISM_WEIGHTS_STATUS.method,
|
|
179
|
+
url=url,
|
|
180
|
+
headers=headers,
|
|
181
|
+
)
|
|
182
|
+
|
|
166
183
|
def _translate_set_commitment(self, request: SetCommitmentRequest, communicator: HttpCommunicatorT) -> Request:
|
|
167
184
|
url = self._build_url(self._endpoint_cls.COMMITMENTS, request)
|
|
168
185
|
headers = self._get_auth_headers(request, communicator)
|
|
@@ -201,6 +218,32 @@ class HttpTranslator(AbstractRequestTranslator[Request, HttpCommunicatorT]):
|
|
|
201
218
|
method=self._endpoint_cls.LATEST_BLOCK_INFO.method, url=url, headers=headers
|
|
202
219
|
)
|
|
203
220
|
|
|
221
|
+
def _translate_get_latest_prices(self, request: GetLatestPricesRequest, communicator: HttpCommunicatorT) -> Request:
|
|
222
|
+
url = self._build_url(self._endpoint_cls.LATEST_PRICES, request)
|
|
223
|
+
headers = self._get_auth_headers(request, communicator)
|
|
224
|
+
return communicator.raw_client.build_request(
|
|
225
|
+
method=self._endpoint_cls.LATEST_PRICES.method, url=url, headers=headers
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
def _translate_get_prices(self, request: GetPricesRequest, communicator: HttpCommunicatorT) -> Request:
|
|
229
|
+
url = self._build_url(self._endpoint_cls.PRICES, request)
|
|
230
|
+
headers = self._get_auth_headers(request, communicator)
|
|
231
|
+
return communicator.raw_client.build_request(method=self._endpoint_cls.PRICES.method, url=url, headers=headers)
|
|
232
|
+
|
|
233
|
+
def _translate_get_latest_price(self, request: GetLatestPriceRequest, communicator: HttpCommunicatorT) -> Request:
|
|
234
|
+
url = self._build_url(self._endpoint_cls.SUBNET_LATEST_PRICE, request)
|
|
235
|
+
headers = self._get_auth_headers(request, communicator)
|
|
236
|
+
return communicator.raw_client.build_request(
|
|
237
|
+
method=self._endpoint_cls.SUBNET_LATEST_PRICE.method, url=url, headers=headers
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
def _translate_get_price(self, request: GetPriceRequest, communicator: HttpCommunicatorT) -> Request:
|
|
241
|
+
url = self._build_url(self._endpoint_cls.SUBNET_PRICE, request)
|
|
242
|
+
headers = self._get_auth_headers(request, communicator)
|
|
243
|
+
return communicator.raw_client.build_request(
|
|
244
|
+
method=self._endpoint_cls.SUBNET_PRICE.method, url=url, headers=headers
|
|
245
|
+
)
|
|
246
|
+
|
|
204
247
|
def _translate_get_extrinsic(self, request: GetExtrinsicRequest, communicator: HttpCommunicatorT) -> Request:
|
|
205
248
|
url = self._build_url(self._endpoint_cls.EXTRINSIC, request)
|
|
206
249
|
headers = self._get_auth_headers(request, communicator)
|
|
@@ -213,3 +256,12 @@ class HttpTranslator(AbstractRequestTranslator[Request, HttpCommunicatorT]):
|
|
|
213
256
|
) -> Request:
|
|
214
257
|
url = self._build_url(self._endpoint_cls.DRAND_LAST_STORED_ROUND, request)
|
|
215
258
|
return communicator.raw_client.build_request(method=self._endpoint_cls.DRAND_LAST_STORED_ROUND.method, url=url)
|
|
259
|
+
|
|
260
|
+
def _translate_get_latest_evm_associations(
|
|
261
|
+
self, request: GetLatestEvmAssociationsRequest, communicator: HttpCommunicatorT
|
|
262
|
+
) -> Request:
|
|
263
|
+
url = self._build_url(self._endpoint_cls.LATEST_EVM_ASSOCIATIONS, request)
|
|
264
|
+
headers = self._get_auth_headers(request, communicator)
|
|
265
|
+
return communicator.raw_client.build_request(
|
|
266
|
+
method=self._endpoint_cls.LATEST_EVM_ASSOCIATIONS.method, url=url, headers=headers
|
|
267
|
+
)
|
|
@@ -12,14 +12,20 @@ from pylon_client._internal.pylon_commons._unstable.requests import (
|
|
|
12
12
|
GetDrandLastStoredRoundRequest,
|
|
13
13
|
GetExtrinsicRequest,
|
|
14
14
|
GetLatestBlockInfoRequest,
|
|
15
|
+
GetLatestEvmAssociationsRequest,
|
|
15
16
|
GetLatestNeuronsRequest,
|
|
17
|
+
GetLatestPriceRequest,
|
|
18
|
+
GetLatestPricesRequest,
|
|
16
19
|
GetLatestValidatorsRequest,
|
|
17
20
|
GetNeuronsRequest,
|
|
18
21
|
GetOwnCommitmentRequest,
|
|
19
22
|
GetOwnRevealedCommitmentsRequest,
|
|
23
|
+
GetPriceRequest,
|
|
24
|
+
GetPricesRequest,
|
|
20
25
|
GetRecentNeuronsRequest,
|
|
21
26
|
GetRevealedCommitmentsRequest,
|
|
22
27
|
GetValidatorsRequest,
|
|
28
|
+
GetWeightsStatusRequest,
|
|
23
29
|
PylonRequest,
|
|
24
30
|
SetCommitmentRequest,
|
|
25
31
|
SetRevealedCommitmentRequest,
|
|
@@ -32,9 +38,13 @@ from pylon_client._internal.pylon_commons._unstable.responses import (
|
|
|
32
38
|
GetDrandLastStoredRoundResponse,
|
|
33
39
|
GetExtrinsicResponse,
|
|
34
40
|
GetLatestBlockInfoResponse,
|
|
41
|
+
GetLatestEvmAssociationsResponse,
|
|
35
42
|
GetNeuronsResponse,
|
|
43
|
+
GetPriceResponse,
|
|
44
|
+
GetPricesResponse,
|
|
36
45
|
GetRevealedCommitmentsResponse,
|
|
37
46
|
GetValidatorsResponse,
|
|
47
|
+
GetWeightsStatusResponse,
|
|
38
48
|
PylonResponse,
|
|
39
49
|
SetCommitmentResponse,
|
|
40
50
|
SetRevealedCommitmentResponse,
|
|
@@ -246,6 +256,30 @@ class AbstractAsyncOpenAccessApi(AbstractAsyncApi, ABC):
|
|
|
246
256
|
"""
|
|
247
257
|
return await self._send_request(await self._get_latest_block_info_request())
|
|
248
258
|
|
|
259
|
+
async def get_latest_prices(self) -> GetPricesResponse:
|
|
260
|
+
"""
|
|
261
|
+
Retrieves alpha prices (rao) for all subnets at the latest block.
|
|
262
|
+
"""
|
|
263
|
+
return await self._send_request(await self._get_latest_prices_request())
|
|
264
|
+
|
|
265
|
+
async def get_prices(self, block_number: BlockNumber) -> GetPricesResponse:
|
|
266
|
+
"""
|
|
267
|
+
Retrieves alpha prices (rao) for all subnets at a given block.
|
|
268
|
+
"""
|
|
269
|
+
return await self._send_request(await self._get_prices_request(block_number))
|
|
270
|
+
|
|
271
|
+
async def get_latest_price(self, netuid: NetUid) -> GetPriceResponse:
|
|
272
|
+
"""
|
|
273
|
+
Retrieves the alpha price (rao) for a single subnet at the latest block.
|
|
274
|
+
"""
|
|
275
|
+
return await self._send_request(await self._get_latest_price_request(netuid))
|
|
276
|
+
|
|
277
|
+
async def get_price(self, netuid: NetUid, block_number: BlockNumber) -> GetPriceResponse:
|
|
278
|
+
"""
|
|
279
|
+
Retrieves the alpha price (rao) for a single subnet at a given block.
|
|
280
|
+
"""
|
|
281
|
+
return await self._send_request(await self._get_price_request(netuid, block_number))
|
|
282
|
+
|
|
249
283
|
async def get_extrinsic(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicResponse:
|
|
250
284
|
"""
|
|
251
285
|
Retrieves a decoded extrinsic from a specific block.
|
|
@@ -263,7 +297,7 @@ class AbstractAsyncOpenAccessApi(AbstractAsyncApi, ABC):
|
|
|
263
297
|
|
|
264
298
|
async def get_drand_last_stored_round(self) -> GetDrandLastStoredRoundResponse:
|
|
265
299
|
"""
|
|
266
|
-
Retrieves the last stored drand round
|
|
300
|
+
Retrieves the last stored drand round.
|
|
267
301
|
|
|
268
302
|
This is a blockchain-level query that does not require subnet context.
|
|
269
303
|
|
|
@@ -272,6 +306,15 @@ class AbstractAsyncOpenAccessApi(AbstractAsyncApi, ABC):
|
|
|
272
306
|
"""
|
|
273
307
|
return await self._send_request(await self._get_drand_last_stored_round_request())
|
|
274
308
|
|
|
309
|
+
async def get_latest_evm_associations(self, netuid: NetUid) -> GetLatestEvmAssociationsResponse:
|
|
310
|
+
"""
|
|
311
|
+
Retrieves the latest EVM key associations in a subnet at the latest available block
|
|
312
|
+
|
|
313
|
+
Returns:
|
|
314
|
+
GetLatestEvmAssociationsResponse: containing data mapping hotkeys to evm key associations.
|
|
315
|
+
"""
|
|
316
|
+
return await self._send_request(await self._get_latest_evm_associations_request(netuid))
|
|
317
|
+
|
|
275
318
|
# Private API
|
|
276
319
|
|
|
277
320
|
@abstractmethod
|
|
@@ -306,6 +349,18 @@ class AbstractAsyncOpenAccessApi(AbstractAsyncApi, ABC):
|
|
|
306
349
|
@abstractmethod
|
|
307
350
|
async def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest: ...
|
|
308
351
|
|
|
352
|
+
@abstractmethod
|
|
353
|
+
async def _get_latest_prices_request(self) -> GetLatestPricesRequest: ...
|
|
354
|
+
|
|
355
|
+
@abstractmethod
|
|
356
|
+
async def _get_prices_request(self, block_number: BlockNumber) -> GetPricesRequest: ...
|
|
357
|
+
|
|
358
|
+
@abstractmethod
|
|
359
|
+
async def _get_latest_price_request(self, netuid: NetUid) -> GetLatestPriceRequest: ...
|
|
360
|
+
|
|
361
|
+
@abstractmethod
|
|
362
|
+
async def _get_price_request(self, netuid: NetUid, block_number: BlockNumber) -> GetPriceRequest: ...
|
|
363
|
+
|
|
309
364
|
@abstractmethod
|
|
310
365
|
async def _get_extrinsic_request(
|
|
311
366
|
self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
|
|
@@ -314,6 +369,9 @@ class AbstractAsyncOpenAccessApi(AbstractAsyncApi, ABC):
|
|
|
314
369
|
@abstractmethod
|
|
315
370
|
async def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest: ...
|
|
316
371
|
|
|
372
|
+
@abstractmethod
|
|
373
|
+
async def _get_latest_evm_associations_request(self, netuid: NetUid) -> GetLatestEvmAssociationsRequest: ...
|
|
374
|
+
|
|
317
375
|
|
|
318
376
|
class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
|
|
319
377
|
"""
|
|
@@ -440,6 +498,14 @@ class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
|
|
|
440
498
|
"""
|
|
441
499
|
return await self._send_identity_request(partial(self._put_weights_request, weights, mechanism_id))
|
|
442
500
|
|
|
501
|
+
async def get_weights_status(
|
|
502
|
+
self, block_number: BlockNumber, mechanism_id: MechanismId = MechanismId(0)
|
|
503
|
+
) -> GetWeightsStatusResponse:
|
|
504
|
+
"""
|
|
505
|
+
response: { weights_set: boolean }
|
|
506
|
+
"""
|
|
507
|
+
return await self._send_identity_request(partial(self._get_weights_status_request, mechanism_id, block_number))
|
|
508
|
+
|
|
443
509
|
async def get_commitments(self) -> GetCommitmentsResponse:
|
|
444
510
|
"""
|
|
445
511
|
Retrieves all commitments for the authenticated identity's subnet at the latest available block.
|
|
@@ -577,6 +643,30 @@ class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
|
|
|
577
643
|
"""
|
|
578
644
|
return await self._send_identity_request(self._get_latest_block_info_request)
|
|
579
645
|
|
|
646
|
+
async def get_latest_prices(self) -> GetPricesResponse:
|
|
647
|
+
"""
|
|
648
|
+
Retrieves alpha prices (rao) for all subnets at the latest block.
|
|
649
|
+
"""
|
|
650
|
+
return await self._send_identity_request(self._get_latest_prices_request)
|
|
651
|
+
|
|
652
|
+
async def get_prices(self, block_number: BlockNumber) -> GetPricesResponse:
|
|
653
|
+
"""
|
|
654
|
+
Retrieves alpha prices (rao) for all subnets at a given block.
|
|
655
|
+
"""
|
|
656
|
+
return await self._send_identity_request(partial(self._get_prices_request, block_number))
|
|
657
|
+
|
|
658
|
+
async def get_latest_price(self) -> GetPriceResponse:
|
|
659
|
+
"""
|
|
660
|
+
Retrieves the alpha price (rao) for the identity's subnet at the latest block.
|
|
661
|
+
"""
|
|
662
|
+
return await self._send_identity_request(self._get_latest_price_request)
|
|
663
|
+
|
|
664
|
+
async def get_price(self, block_number: BlockNumber) -> GetPriceResponse:
|
|
665
|
+
"""
|
|
666
|
+
Retrieves the alpha price (rao) for the identity's subnet at a given block.
|
|
667
|
+
"""
|
|
668
|
+
return await self._send_identity_request(partial(self._get_price_request, block_number))
|
|
669
|
+
|
|
580
670
|
async def get_extrinsic(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicResponse:
|
|
581
671
|
"""
|
|
582
672
|
Retrieves a decoded extrinsic from a specific block.
|
|
@@ -594,7 +684,7 @@ class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
|
|
|
594
684
|
|
|
595
685
|
async def get_drand_last_stored_round(self) -> GetDrandLastStoredRoundResponse:
|
|
596
686
|
"""
|
|
597
|
-
Retrieves the last stored drand round
|
|
687
|
+
Retrieves the last stored drand round.
|
|
598
688
|
|
|
599
689
|
This is a blockchain-level query that does not require subnet context.
|
|
600
690
|
|
|
@@ -603,6 +693,15 @@ class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
|
|
|
603
693
|
"""
|
|
604
694
|
return await self._send_identity_request(self._get_drand_last_stored_round_request)
|
|
605
695
|
|
|
696
|
+
async def get_latest_evm_associations(self) -> GetLatestEvmAssociationsResponse:
|
|
697
|
+
"""
|
|
698
|
+
Retrieves the latest EVM key associations for the authenticated identity's subnet at the latest available block
|
|
699
|
+
|
|
700
|
+
Returns:
|
|
701
|
+
GetLatestEvmAssociationsResponse: containing data mapping hotkeys to evm key associations.
|
|
702
|
+
"""
|
|
703
|
+
return await self._send_identity_request(self._get_latest_evm_associations_request)
|
|
704
|
+
|
|
606
705
|
# Private API
|
|
607
706
|
|
|
608
707
|
@abstractmethod
|
|
@@ -619,6 +718,11 @@ class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
|
|
|
619
718
|
self, weights: dict[Hotkey, Weight], mechanism_id: MechanismId
|
|
620
719
|
) -> SetWeightsRequest: ...
|
|
621
720
|
|
|
721
|
+
@abstractmethod
|
|
722
|
+
async def _get_weights_status_request(
|
|
723
|
+
self, mechanism_id: MechanismId, block_number: BlockNumber
|
|
724
|
+
) -> GetWeightsStatusRequest: ...
|
|
725
|
+
|
|
622
726
|
@abstractmethod
|
|
623
727
|
async def _get_commitments_request(self) -> GetCommitmentsRequest: ...
|
|
624
728
|
|
|
@@ -656,6 +760,18 @@ class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
|
|
|
656
760
|
@abstractmethod
|
|
657
761
|
async def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest: ...
|
|
658
762
|
|
|
763
|
+
@abstractmethod
|
|
764
|
+
async def _get_latest_prices_request(self) -> GetLatestPricesRequest: ...
|
|
765
|
+
|
|
766
|
+
@abstractmethod
|
|
767
|
+
async def _get_prices_request(self, block_number: BlockNumber) -> GetPricesRequest: ...
|
|
768
|
+
|
|
769
|
+
@abstractmethod
|
|
770
|
+
async def _get_latest_price_request(self) -> GetLatestPriceRequest: ...
|
|
771
|
+
|
|
772
|
+
@abstractmethod
|
|
773
|
+
async def _get_price_request(self, block_number: BlockNumber) -> GetPriceRequest: ...
|
|
774
|
+
|
|
659
775
|
@abstractmethod
|
|
660
776
|
async def _get_extrinsic_request(
|
|
661
777
|
self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
|
|
@@ -663,3 +779,6 @@ class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
|
|
|
663
779
|
|
|
664
780
|
@abstractmethod
|
|
665
781
|
async def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest: ...
|
|
782
|
+
|
|
783
|
+
@abstractmethod
|
|
784
|
+
async def _get_latest_evm_associations_request(self) -> GetLatestEvmAssociationsRequest: ...
|
|
@@ -12,14 +12,20 @@ from pylon_client._internal.pylon_commons._unstable.requests import (
|
|
|
12
12
|
GetDrandLastStoredRoundRequest,
|
|
13
13
|
GetExtrinsicRequest,
|
|
14
14
|
GetLatestBlockInfoRequest,
|
|
15
|
+
GetLatestEvmAssociationsRequest,
|
|
15
16
|
GetLatestNeuronsRequest,
|
|
17
|
+
GetLatestPriceRequest,
|
|
18
|
+
GetLatestPricesRequest,
|
|
16
19
|
GetLatestValidatorsRequest,
|
|
17
20
|
GetNeuronsRequest,
|
|
18
21
|
GetOwnCommitmentRequest,
|
|
19
22
|
GetOwnRevealedCommitmentsRequest,
|
|
23
|
+
GetPriceRequest,
|
|
24
|
+
GetPricesRequest,
|
|
20
25
|
GetRecentNeuronsRequest,
|
|
21
26
|
GetRevealedCommitmentsRequest,
|
|
22
27
|
GetValidatorsRequest,
|
|
28
|
+
GetWeightsStatusRequest,
|
|
23
29
|
PylonRequest,
|
|
24
30
|
SetCommitmentRequest,
|
|
25
31
|
SetRevealedCommitmentRequest,
|
|
@@ -32,9 +38,13 @@ from pylon_client._internal.pylon_commons._unstable.responses import (
|
|
|
32
38
|
GetDrandLastStoredRoundResponse,
|
|
33
39
|
GetExtrinsicResponse,
|
|
34
40
|
GetLatestBlockInfoResponse,
|
|
41
|
+
GetLatestEvmAssociationsResponse,
|
|
35
42
|
GetNeuronsResponse,
|
|
43
|
+
GetPriceResponse,
|
|
44
|
+
GetPricesResponse,
|
|
36
45
|
GetRevealedCommitmentsResponse,
|
|
37
46
|
GetValidatorsResponse,
|
|
47
|
+
GetWeightsStatusResponse,
|
|
38
48
|
PylonResponse,
|
|
39
49
|
SetCommitmentResponse,
|
|
40
50
|
SetRevealedCommitmentResponse,
|
|
@@ -245,6 +255,30 @@ class AbstractOpenAccessApi(AbstractApi, ABC):
|
|
|
245
255
|
"""
|
|
246
256
|
return self._send_request(self._get_latest_block_info_request())
|
|
247
257
|
|
|
258
|
+
def get_latest_prices(self) -> GetPricesResponse:
|
|
259
|
+
"""
|
|
260
|
+
Retrieves alpha prices (rao) for all subnets at the latest block.
|
|
261
|
+
"""
|
|
262
|
+
return self._send_request(self._get_latest_prices_request())
|
|
263
|
+
|
|
264
|
+
def get_prices(self, block_number: BlockNumber) -> GetPricesResponse:
|
|
265
|
+
"""
|
|
266
|
+
Retrieves alpha prices (rao) for all subnets at a given block.
|
|
267
|
+
"""
|
|
268
|
+
return self._send_request(self._get_prices_request(block_number))
|
|
269
|
+
|
|
270
|
+
def get_latest_price(self, netuid: NetUid) -> GetPriceResponse:
|
|
271
|
+
"""
|
|
272
|
+
Retrieves the alpha price (rao) for a single subnet at the latest block.
|
|
273
|
+
"""
|
|
274
|
+
return self._send_request(self._get_latest_price_request(netuid))
|
|
275
|
+
|
|
276
|
+
def get_price(self, netuid: NetUid, block_number: BlockNumber) -> GetPriceResponse:
|
|
277
|
+
"""
|
|
278
|
+
Retrieves the alpha price (rao) for a single subnet at a given block.
|
|
279
|
+
"""
|
|
280
|
+
return self._send_request(self._get_price_request(netuid, block_number))
|
|
281
|
+
|
|
248
282
|
def get_extrinsic(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicResponse:
|
|
249
283
|
"""
|
|
250
284
|
Retrieves a decoded extrinsic from a specific block.
|
|
@@ -262,7 +296,7 @@ class AbstractOpenAccessApi(AbstractApi, ABC):
|
|
|
262
296
|
|
|
263
297
|
def get_drand_last_stored_round(self) -> GetDrandLastStoredRoundResponse:
|
|
264
298
|
"""
|
|
265
|
-
Retrieves the last stored drand round
|
|
299
|
+
Retrieves the last stored drand round.
|
|
266
300
|
|
|
267
301
|
This is a blockchain-level query that does not require subnet context.
|
|
268
302
|
|
|
@@ -271,6 +305,15 @@ class AbstractOpenAccessApi(AbstractApi, ABC):
|
|
|
271
305
|
"""
|
|
272
306
|
return self._send_request(self._get_drand_last_stored_round_request())
|
|
273
307
|
|
|
308
|
+
def get_latest_evm_associations(self, netuid: NetUid) -> GetLatestEvmAssociationsResponse:
|
|
309
|
+
"""
|
|
310
|
+
Retrieves the latest EVM key associations in a subnet at the latest available block
|
|
311
|
+
|
|
312
|
+
Returns:
|
|
313
|
+
GetLatestEvmAssociationsResponse: containing data mapping hotkeys to evm key associations.
|
|
314
|
+
"""
|
|
315
|
+
return self._send_request(self._get_latest_evm_associations_request(netuid))
|
|
316
|
+
|
|
274
317
|
# Private API
|
|
275
318
|
|
|
276
319
|
@abstractmethod
|
|
@@ -303,6 +346,18 @@ class AbstractOpenAccessApi(AbstractApi, ABC):
|
|
|
303
346
|
@abstractmethod
|
|
304
347
|
def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest: ...
|
|
305
348
|
|
|
349
|
+
@abstractmethod
|
|
350
|
+
def _get_latest_prices_request(self) -> GetLatestPricesRequest: ...
|
|
351
|
+
|
|
352
|
+
@abstractmethod
|
|
353
|
+
def _get_prices_request(self, block_number: BlockNumber) -> GetPricesRequest: ...
|
|
354
|
+
|
|
355
|
+
@abstractmethod
|
|
356
|
+
def _get_latest_price_request(self, netuid: NetUid) -> GetLatestPriceRequest: ...
|
|
357
|
+
|
|
358
|
+
@abstractmethod
|
|
359
|
+
def _get_price_request(self, netuid: NetUid, block_number: BlockNumber) -> GetPriceRequest: ...
|
|
360
|
+
|
|
306
361
|
@abstractmethod
|
|
307
362
|
def _get_extrinsic_request(
|
|
308
363
|
self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
|
|
@@ -311,6 +366,9 @@ class AbstractOpenAccessApi(AbstractApi, ABC):
|
|
|
311
366
|
@abstractmethod
|
|
312
367
|
def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest: ...
|
|
313
368
|
|
|
369
|
+
@abstractmethod
|
|
370
|
+
def _get_latest_evm_associations_request(self, netuid: NetUid) -> GetLatestEvmAssociationsRequest: ...
|
|
371
|
+
|
|
314
372
|
|
|
315
373
|
class AbstractIdentityApi(AbstractApi, ABC):
|
|
316
374
|
"""
|
|
@@ -435,6 +493,14 @@ class AbstractIdentityApi(AbstractApi, ABC):
|
|
|
435
493
|
"""
|
|
436
494
|
return self._send_identity_request(partial(self._put_weights_request, weights, mechanism_id))
|
|
437
495
|
|
|
496
|
+
def get_weights_status(
|
|
497
|
+
self, block_number: BlockNumber, mechanism_id: MechanismId = MechanismId(0)
|
|
498
|
+
) -> GetWeightsStatusResponse:
|
|
499
|
+
"""
|
|
500
|
+
response: { weights_set: boolean }
|
|
501
|
+
"""
|
|
502
|
+
return self._send_identity_request(partial(self._get_weights_status_request, mechanism_id, block_number))
|
|
503
|
+
|
|
438
504
|
def get_commitments(self) -> GetCommitmentsResponse:
|
|
439
505
|
"""
|
|
440
506
|
Retrieves all commitments for the authenticated identity's subnet at the latest available block.
|
|
@@ -576,6 +642,30 @@ class AbstractIdentityApi(AbstractApi, ABC):
|
|
|
576
642
|
"""
|
|
577
643
|
return self._send_identity_request(self._get_latest_block_info_request)
|
|
578
644
|
|
|
645
|
+
def get_latest_prices(self) -> GetPricesResponse:
|
|
646
|
+
"""
|
|
647
|
+
Retrieves alpha prices (rao) for all subnets at the latest block.
|
|
648
|
+
"""
|
|
649
|
+
return self._send_identity_request(self._get_latest_prices_request)
|
|
650
|
+
|
|
651
|
+
def get_prices(self, block_number: BlockNumber) -> GetPricesResponse:
|
|
652
|
+
"""
|
|
653
|
+
Retrieves alpha prices (rao) for all subnets at a given block.
|
|
654
|
+
"""
|
|
655
|
+
return self._send_identity_request(partial(self._get_prices_request, block_number))
|
|
656
|
+
|
|
657
|
+
def get_latest_price(self) -> GetPriceResponse:
|
|
658
|
+
"""
|
|
659
|
+
Retrieves the alpha price (rao) for the identity's subnet at the latest block.
|
|
660
|
+
"""
|
|
661
|
+
return self._send_identity_request(self._get_latest_price_request)
|
|
662
|
+
|
|
663
|
+
def get_price(self, block_number: BlockNumber) -> GetPriceResponse:
|
|
664
|
+
"""
|
|
665
|
+
Retrieves the alpha price (rao) for the identity's subnet at a given block.
|
|
666
|
+
"""
|
|
667
|
+
return self._send_identity_request(partial(self._get_price_request, block_number))
|
|
668
|
+
|
|
579
669
|
def get_extrinsic(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicResponse:
|
|
580
670
|
"""
|
|
581
671
|
Retrieves a decoded extrinsic from a specific block.
|
|
@@ -593,7 +683,7 @@ class AbstractIdentityApi(AbstractApi, ABC):
|
|
|
593
683
|
|
|
594
684
|
def get_drand_last_stored_round(self) -> GetDrandLastStoredRoundResponse:
|
|
595
685
|
"""
|
|
596
|
-
Retrieves the last stored drand round
|
|
686
|
+
Retrieves the last stored drand round.
|
|
597
687
|
|
|
598
688
|
This is a blockchain-level query that does not require subnet context.
|
|
599
689
|
|
|
@@ -602,6 +692,15 @@ class AbstractIdentityApi(AbstractApi, ABC):
|
|
|
602
692
|
"""
|
|
603
693
|
return self._send_identity_request(self._get_drand_last_stored_round_request)
|
|
604
694
|
|
|
695
|
+
def get_latest_evm_associations(self) -> GetLatestEvmAssociationsResponse:
|
|
696
|
+
"""
|
|
697
|
+
Retrieves the latest EVM key associations for the authenticated identity's subnet at the latest available block
|
|
698
|
+
|
|
699
|
+
Returns:
|
|
700
|
+
GetLatestEvmAssociationsResponse: containing data mapping hotkeys to evm key associations.
|
|
701
|
+
"""
|
|
702
|
+
return self._send_identity_request(self._get_latest_evm_associations_request)
|
|
703
|
+
|
|
605
704
|
# Private API
|
|
606
705
|
|
|
607
706
|
@abstractmethod
|
|
@@ -616,6 +715,11 @@ class AbstractIdentityApi(AbstractApi, ABC):
|
|
|
616
715
|
@abstractmethod
|
|
617
716
|
def _put_weights_request(self, weights: dict[Hotkey, Weight], mechanism_id: MechanismId) -> SetWeightsRequest: ...
|
|
618
717
|
|
|
718
|
+
@abstractmethod
|
|
719
|
+
def _get_weights_status_request(
|
|
720
|
+
self, mechanism_id: MechanismId, block_number: BlockNumber
|
|
721
|
+
) -> GetWeightsStatusRequest: ...
|
|
722
|
+
|
|
619
723
|
@abstractmethod
|
|
620
724
|
def _get_commitments_request(self) -> GetCommitmentsRequest: ...
|
|
621
725
|
|
|
@@ -651,6 +755,18 @@ class AbstractIdentityApi(AbstractApi, ABC):
|
|
|
651
755
|
@abstractmethod
|
|
652
756
|
def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest: ...
|
|
653
757
|
|
|
758
|
+
@abstractmethod
|
|
759
|
+
def _get_latest_prices_request(self) -> GetLatestPricesRequest: ...
|
|
760
|
+
|
|
761
|
+
@abstractmethod
|
|
762
|
+
def _get_prices_request(self, block_number: BlockNumber) -> GetPricesRequest: ...
|
|
763
|
+
|
|
764
|
+
@abstractmethod
|
|
765
|
+
def _get_latest_price_request(self) -> GetLatestPriceRequest: ...
|
|
766
|
+
|
|
767
|
+
@abstractmethod
|
|
768
|
+
def _get_price_request(self, block_number: BlockNumber) -> GetPriceRequest: ...
|
|
769
|
+
|
|
654
770
|
@abstractmethod
|
|
655
771
|
def _get_extrinsic_request(
|
|
656
772
|
self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
|
|
@@ -658,3 +774,6 @@ class AbstractIdentityApi(AbstractApi, ABC):
|
|
|
658
774
|
|
|
659
775
|
@abstractmethod
|
|
660
776
|
def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest: ...
|
|
777
|
+
|
|
778
|
+
@abstractmethod
|
|
779
|
+
def _get_latest_evm_associations_request(self) -> GetLatestEvmAssociationsRequest: ...
|
|
@@ -48,6 +48,16 @@ class Endpoint(BaseEndpoint):
|
|
|
48
48
|
LATEST_VALIDATORS = (HTTPMethod.GET, "/block/latest/validators", "latest_validators")
|
|
49
49
|
NEURONS = (HTTPMethod.GET, "/block/{block_number:int}/neurons", "neurons")
|
|
50
50
|
RECENT_NEURONS = (HTTPMethod.GET, "/block/recent/neurons", "recent_neurons")
|
|
51
|
+
LATEST_PRICES = (HTTPMethod.GET, "/block/latest/prices", "latest_prices")
|
|
52
|
+
PRICES = (HTTPMethod.GET, "/block/{block_number:int}/prices", "prices")
|
|
53
|
+
SUBNET_LATEST_PRICE = (HTTPMethod.GET, "/block/latest/price", "subnet_latest_price")
|
|
54
|
+
SUBNET_PRICE = (HTTPMethod.GET, "/block/{block_number:int}/price", "subnet_price")
|
|
51
55
|
SUBNET_WEIGHTS = (HTTPMethod.PUT, "/weights", "subnet_weights")
|
|
52
|
-
|
|
56
|
+
SUBNET_MECHANISM_WEIGHTS = (HTTPMethod.PUT, "/mechanism/{mechanism_id:int}/weights", "subnet_mechanism_weights")
|
|
57
|
+
SUBNET_MECHANISM_WEIGHTS_STATUS = (
|
|
58
|
+
HTTPMethod.GET,
|
|
59
|
+
"/mechanism/{mechanism_id:int}/block/{block_number:int}/weights/status",
|
|
60
|
+
"subnet_mechanism_weight_status",
|
|
61
|
+
)
|
|
53
62
|
VALIDATORS = (HTTPMethod.GET, "/block/{block_number:int}/validators", "validators")
|
|
63
|
+
LATEST_EVM_ASSOCIATIONS = (HTTPMethod.GET, "/block/latest/evm_associations", "latest_evm_associations")
|
|
@@ -8,6 +8,7 @@ from ..models import (
|
|
|
8
8
|
Commitment,
|
|
9
9
|
CommitmentVariant,
|
|
10
10
|
CommitReveal,
|
|
11
|
+
EvmAssociation,
|
|
11
12
|
Extrinsic,
|
|
12
13
|
ExtrinsicCall,
|
|
13
14
|
ExtrinsicCallArg,
|
|
@@ -18,11 +19,16 @@ from ..models import (
|
|
|
18
19
|
RevealedCommitment,
|
|
19
20
|
Stakes,
|
|
20
21
|
SubnetCommitments,
|
|
22
|
+
SubnetEvmAssociations,
|
|
21
23
|
SubnetHyperparams,
|
|
22
24
|
SubnetNeurons,
|
|
25
|
+
SubnetPrice,
|
|
26
|
+
SubnetPriceEntry,
|
|
27
|
+
SubnetPrices,
|
|
23
28
|
SubnetRevealedCommitments,
|
|
24
29
|
SubnetState,
|
|
25
30
|
SubnetValidators,
|
|
26
31
|
TimelockEncryptedCommitment,
|
|
27
32
|
UnknownIntEnum,
|
|
33
|
+
WeightsStatus,
|
|
28
34
|
)
|
|
@@ -15,9 +15,13 @@ from .responses import (
|
|
|
15
15
|
GetExtrinsicResponse,
|
|
16
16
|
GetIdentitiesResponse,
|
|
17
17
|
GetLatestBlockInfoResponse,
|
|
18
|
+
GetLatestEvmAssociationsResponse,
|
|
18
19
|
GetNeuronsResponse,
|
|
20
|
+
GetPriceResponse,
|
|
21
|
+
GetPricesResponse,
|
|
19
22
|
GetRevealedCommitmentsResponse,
|
|
20
23
|
GetValidatorsResponse,
|
|
24
|
+
GetWeightsStatusResponse,
|
|
21
25
|
PylonResponse,
|
|
22
26
|
SetCommitmentResponse,
|
|
23
27
|
SetRevealedCommitmentResponse,
|
|
@@ -104,6 +108,24 @@ class GetRecentNeuronsRequest(AuthenticatedPylonRequest[GetNeuronsResponse]):
|
|
|
104
108
|
response_cls = GetNeuronsResponse
|
|
105
109
|
|
|
106
110
|
|
|
111
|
+
class GetLatestPriceRequest(AuthenticatedPylonRequest[GetPriceResponse]):
|
|
112
|
+
"""
|
|
113
|
+
Class used to fetch the alpha price for a single subnet at the latest block.
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
response_cls = GetPriceResponse
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class GetPriceRequest(AuthenticatedPylonRequest[GetPriceResponse]):
|
|
120
|
+
"""
|
|
121
|
+
Class used to fetch the alpha price for a single subnet at a specific block.
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
response_cls = GetPriceResponse
|
|
125
|
+
|
|
126
|
+
block_number: BlockNumber
|
|
127
|
+
|
|
128
|
+
|
|
107
129
|
class GetValidatorsRequest(AuthenticatedPylonRequest[GetValidatorsResponse]):
|
|
108
130
|
"""
|
|
109
131
|
Class used to fetch the validators by the Pylon client.
|
|
@@ -167,6 +189,28 @@ class GetLatestBlockInfoRequest(PylonRequest[GetLatestBlockInfoResponse]):
|
|
|
167
189
|
response_cls = GetLatestBlockInfoResponse
|
|
168
190
|
|
|
169
191
|
|
|
192
|
+
class GetLatestPricesRequest(PylonRequest[GetPricesResponse]):
|
|
193
|
+
"""
|
|
194
|
+
Class used to fetch alpha prices for all subnets at the latest block.
|
|
195
|
+
|
|
196
|
+
This request does not require subnet context as it is blockchain-level data.
|
|
197
|
+
"""
|
|
198
|
+
|
|
199
|
+
response_cls = GetPricesResponse
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
class GetPricesRequest(PylonRequest[GetPricesResponse]):
|
|
203
|
+
"""
|
|
204
|
+
Class used to fetch alpha prices for all subnets at a specific block.
|
|
205
|
+
|
|
206
|
+
This request does not require subnet context as it is blockchain-level data.
|
|
207
|
+
"""
|
|
208
|
+
|
|
209
|
+
response_cls = GetPricesResponse
|
|
210
|
+
|
|
211
|
+
block_number: BlockNumber
|
|
212
|
+
|
|
213
|
+
|
|
170
214
|
class GetExtrinsicRequest(PylonRequest[GetExtrinsicResponse]):
|
|
171
215
|
"""
|
|
172
216
|
Class used to fetch an extrinsic from a specific block by the Pylon client.
|
|
@@ -211,6 +255,17 @@ class SetWeightsRequest(SetWeightsBody, IdentityPylonRequest[SetWeightsResponse]
|
|
|
211
255
|
response_cls = SetWeightsResponse
|
|
212
256
|
|
|
213
257
|
|
|
258
|
+
class GetWeightsStatusRequest(IdentityPylonRequest[GetWeightsStatusResponse]):
|
|
259
|
+
"""
|
|
260
|
+
Class used to fetch the weight status for the identity by the Pylon client.
|
|
261
|
+
"""
|
|
262
|
+
|
|
263
|
+
mechanism_id: MechanismId
|
|
264
|
+
block_number: BlockNumber
|
|
265
|
+
|
|
266
|
+
response_cls = GetWeightsStatusResponse
|
|
267
|
+
|
|
268
|
+
|
|
214
269
|
class SetCommitmentRequest(SetCommitmentBody, IdentityPylonRequest[SetCommitmentResponse]):
|
|
215
270
|
"""
|
|
216
271
|
Class used to set a commitment (model metadata) on chain by the Pylon client.
|
|
@@ -252,3 +307,11 @@ class GenerateCertificateKeypairRequest(PylonRequest):
|
|
|
252
307
|
if v != CertificateAlgorithm.ED25519:
|
|
253
308
|
raise ValueError("Currently, only algorithm equals 1 is supported which is EdDSA using Ed25519 curve")
|
|
254
309
|
return v
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
class GetLatestEvmAssociationsRequest(AuthenticatedPylonRequest[GetLatestEvmAssociationsResponse]):
|
|
313
|
+
"""
|
|
314
|
+
Class used to fetch the latest EVM associations for the subnet by the Pylon client.
|
|
315
|
+
"""
|
|
316
|
+
|
|
317
|
+
response_cls = GetLatestEvmAssociationsResponse
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
from pydantic import BaseModel
|
|
2
2
|
|
|
3
|
-
from ..models import
|
|
3
|
+
from ..models import SubnetEvmAssociations
|
|
4
4
|
from ..types import IdentityName, NetUid
|
|
5
5
|
from .models import (
|
|
6
6
|
Block,
|
|
7
7
|
BlockInfoBag,
|
|
8
|
+
CommitmentVariant,
|
|
8
9
|
Extrinsic,
|
|
9
10
|
RevealedCommitment,
|
|
10
11
|
SubnetCommitments,
|
|
11
12
|
SubnetNeurons,
|
|
13
|
+
SubnetPrice,
|
|
14
|
+
SubnetPrices,
|
|
12
15
|
SubnetRevealedCommitments,
|
|
13
16
|
SubnetValidators,
|
|
17
|
+
WeightsStatus,
|
|
14
18
|
)
|
|
15
19
|
|
|
16
20
|
|
|
@@ -59,7 +63,13 @@ class SetWeightsResponse(PylonResponse):
|
|
|
59
63
|
Response class that is returned for the SetWeightsRequest.
|
|
60
64
|
"""
|
|
61
65
|
|
|
62
|
-
|
|
66
|
+
pass
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class GetWeightsStatusResponse(PylonResponse, WeightsStatus):
|
|
70
|
+
"""
|
|
71
|
+
Response class that is returned for the GetWeightStatusRequest.
|
|
72
|
+
"""
|
|
63
73
|
|
|
64
74
|
pass
|
|
65
75
|
|
|
@@ -152,3 +162,27 @@ class GetDrandLastStoredRoundResponse(PylonResponse):
|
|
|
152
162
|
"""
|
|
153
163
|
|
|
154
164
|
last_stored_round: int
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
class GetPricesResponse(PylonResponse, SubnetPrices):
|
|
168
|
+
"""
|
|
169
|
+
Response class that is returned for the GetPricesRequest (all subnets).
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
pass
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
class GetPriceResponse(PylonResponse, SubnetPrice):
|
|
176
|
+
"""
|
|
177
|
+
Response class that is returned for the GetPriceRequest (single subnet).
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
pass
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
class GetLatestEvmAssociationsResponse(PylonResponse, SubnetEvmAssociations):
|
|
184
|
+
"""
|
|
185
|
+
Response class that is returned for the GetLastestEvmAssociationsRequest.
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
pass
|
|
@@ -6,6 +6,7 @@ from pydantic import BaseModel, ConfigDict, Field
|
|
|
6
6
|
|
|
7
7
|
from .currency import Currency, Token
|
|
8
8
|
from .types import (
|
|
9
|
+
AlphaPriceRao,
|
|
9
10
|
AlphaStake,
|
|
10
11
|
AlphaStakeRao,
|
|
11
12
|
BlockHash,
|
|
@@ -16,6 +17,7 @@ from .types import (
|
|
|
16
17
|
Dividends,
|
|
17
18
|
Emission,
|
|
18
19
|
EmissionRao,
|
|
20
|
+
EvmAddress,
|
|
19
21
|
ExtrinsicHash,
|
|
20
22
|
ExtrinsicIndex,
|
|
21
23
|
ExtrinsicLength,
|
|
@@ -139,6 +141,21 @@ class SubnetValidators(BittensorModel):
|
|
|
139
141
|
validators: list[Neuron]
|
|
140
142
|
|
|
141
143
|
|
|
144
|
+
class SubnetPriceEntry(BittensorModel):
|
|
145
|
+
value: AlphaPriceRao
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
class SubnetPrices(BittensorModel):
|
|
149
|
+
block: Block
|
|
150
|
+
prices: dict[NetUid, SubnetPriceEntry]
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class SubnetPrice(BittensorModel):
|
|
154
|
+
block: Block
|
|
155
|
+
netuid: NetUid
|
|
156
|
+
price: SubnetPriceEntry
|
|
157
|
+
|
|
158
|
+
|
|
142
159
|
class SubnetHyperparams(BittensorModel):
|
|
143
160
|
tempo: Tempo | None = None
|
|
144
161
|
max_weights_limit: MaxWeightsLimit | None = None
|
|
@@ -284,3 +301,18 @@ class Extrinsic(BittensorModel):
|
|
|
284
301
|
|
|
285
302
|
# Call information
|
|
286
303
|
call: ExtrinsicCall
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
class WeightsStatus(BittensorModel):
|
|
307
|
+
weights_submitted: bool
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
class EvmAssociation(BittensorModel):
|
|
311
|
+
hotkey: Hotkey
|
|
312
|
+
evm_address: EvmAddress
|
|
313
|
+
last_block_where_ownership_was_proven: BlockNumber
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
class SubnetEvmAssociations(BittensorModel):
|
|
317
|
+
block: Block
|
|
318
|
+
evm_associations: dict[Hotkey, EvmAssociation]
|
|
@@ -38,6 +38,7 @@ SubnetActive = NewType("SubnetActive", bool)
|
|
|
38
38
|
AlphaStakeRao = NewType("AlphaStakeRao", CurrencyRao[Token.ALPHA])
|
|
39
39
|
TaoStakeRao = NewType("TaoStakeRao", CurrencyRao[Token.TAO])
|
|
40
40
|
TotalStakeRao = NewType("TotalStakeRao", CurrencyRao[Token.ALPHA])
|
|
41
|
+
AlphaPriceRao = NewType("AlphaPriceRao", CurrencyRao[Token.TAO])
|
|
41
42
|
AlphaStake = NewType("AlphaStake", Currency[Token.ALPHA])
|
|
42
43
|
TaoStake = NewType("TaoStake", Currency[Token.TAO])
|
|
43
44
|
TotalStake = NewType("TotalStake", Currency[Token.ALPHA])
|
|
@@ -49,6 +50,7 @@ ExtrinsicIndex = NewType("ExtrinsicIndex", int)
|
|
|
49
50
|
ExtrinsicHash = NewType("ExtrinsicHash", str)
|
|
50
51
|
ExtrinsicLength = NewType("ExtrinsicLength", int)
|
|
51
52
|
RevealedCommitmentData = NewType("RevealedCommitmentData", str)
|
|
53
|
+
EvmAddress = NewType("EvmAddress", str)
|
|
52
54
|
|
|
53
55
|
|
|
54
56
|
class CommitmentDataHex(str):
|
|
@@ -22,7 +22,6 @@ class Endpoint(BaseEndpoint):
|
|
|
22
22
|
CERTIFICATES_HOTKEY = (HTTPMethod.GET, "/block/latest/certificates/{hotkey:str}", "certificates_hotkey_v1")
|
|
23
23
|
CERTIFICATES_SELF = (HTTPMethod.GET, "/block/latest/certificates/self", "certificates_self_v1")
|
|
24
24
|
COMMITMENTS = (HTTPMethod.POST, "/commitments", "commitments_v1")
|
|
25
|
-
REVEALED_COMMITMENTS = (HTTPMethod.POST, "/commitments/revealed", "revealed_commitments_v1")
|
|
26
25
|
EXTRINSIC = (HTTPMethod.GET, "/block/{block_number:int}/extrinsic/{extrinsic_index:int}", "extrinsic_v1")
|
|
27
26
|
IDENTITIES = (HTTPMethod.GET, "/identities", "identities_v1")
|
|
28
27
|
LATEST_BLOCK_INFO = (HTTPMethod.GET, "/block/latest", "latest_block_info")
|
|
@@ -54,3 +53,7 @@ class Endpoint(BaseEndpoint):
|
|
|
54
53
|
RECENT_NEURONS = (HTTPMethod.GET, "/block/recent/neurons", "recent_neurons_v1")
|
|
55
54
|
SUBNET_WEIGHTS = (HTTPMethod.PUT, "/weights", "subnet_weights_v1")
|
|
56
55
|
VALIDATORS = (HTTPMethod.GET, "/block/{block_number:int}/validators", "validators_v1")
|
|
56
|
+
# TODO v1 includes the following endpoints only because v1 translator inherits from unstable
|
|
57
|
+
# they could be removed once we change ApiVer approach from inheritance to composition in pylon_client
|
|
58
|
+
REVEALED_COMMITMENTS = (HTTPMethod.POST, "/commitments/revealed", "revealed_commitments_v1")
|
|
59
|
+
LATEST_EVM_ASSOCIATIONS = (HTTPMethod.GET, "/block/latest/evm_associations", "latest_evm_associations_v1")
|
{bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/artanis/unstable.py
RENAMED
|
@@ -8,6 +8,7 @@ from pylon_client._internal.pylon_commons._unstable.models import (
|
|
|
8
8
|
Commitment,
|
|
9
9
|
CommitmentVariant,
|
|
10
10
|
CommitReveal,
|
|
11
|
+
EvmAssociation,
|
|
11
12
|
Extrinsic,
|
|
12
13
|
ExtrinsicCall,
|
|
13
14
|
ExtrinsicCallArg,
|
|
@@ -17,7 +18,11 @@ from pylon_client._internal.pylon_commons._unstable.models import (
|
|
|
17
18
|
NeuronCertificateKeypair,
|
|
18
19
|
RevealedCommitment,
|
|
19
20
|
Stakes,
|
|
21
|
+
SubnetEvmAssociations,
|
|
20
22
|
SubnetNeurons,
|
|
23
|
+
SubnetPrice,
|
|
24
|
+
SubnetPriceEntry,
|
|
25
|
+
SubnetPrices,
|
|
21
26
|
SubnetValidators,
|
|
22
27
|
TimelockEncryptedCommitment,
|
|
23
28
|
)
|
|
@@ -28,9 +33,13 @@ from pylon_client._internal.pylon_commons._unstable.responses import (
|
|
|
28
33
|
GetDrandLastStoredRoundResponse,
|
|
29
34
|
GetExtrinsicResponse,
|
|
30
35
|
GetLatestBlockInfoResponse,
|
|
36
|
+
GetLatestEvmAssociationsResponse,
|
|
31
37
|
GetNeuronsResponse,
|
|
38
|
+
GetPriceResponse,
|
|
39
|
+
GetPricesResponse,
|
|
32
40
|
GetRevealedCommitmentsResponse,
|
|
33
41
|
GetValidatorsResponse,
|
|
42
|
+
GetWeightsStatusResponse,
|
|
34
43
|
PylonResponse,
|
|
35
44
|
SetCommitmentResponse,
|
|
36
45
|
SetRevealedCommitmentResponse,
|
|
File without changes
|
{bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/__init__.py
RENAMED
|
File without changes
|
{bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bittensor_pylon_client-2.0.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/translators.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|