bittensor-pylon-client 2.1.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.
Files changed (59) hide show
  1. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/PKG-INFO +1 -1
  2. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/_unstable/asynchronous/api.py +35 -0
  3. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/_unstable/sync/api.py +35 -0
  4. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/_unstable/translators.py +40 -0
  5. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/abstract_async.py +106 -2
  6. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/abstract_sync.py +106 -2
  7. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/_unstable/endpoints.py +5 -0
  8. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/_unstable/models.py +5 -0
  9. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/_unstable/requests.py +51 -0
  10. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/_unstable/responses.py +27 -0
  11. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/models.py +28 -2
  12. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/types.py +2 -0
  13. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/v1/endpoints.py +4 -3
  14. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/artanis/__init__.py +1 -0
  15. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/artanis/unstable.py +8 -0
  16. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/.gitignore +0 -0
  17. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/__init__.py +0 -0
  18. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/__init__.py +0 -0
  19. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/__init__.py +0 -0
  20. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/_unstable/__init__.py +0 -0
  21. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/_unstable/asynchronous/__init__.py +0 -0
  22. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/_unstable/sync/__init__.py +0 -0
  23. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/v1/__init__.py +0 -0
  24. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/v1/asynchronous/__init__.py +0 -0
  25. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/v1/asynchronous/api.py +0 -0
  26. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/v1/sync/__init__.py +0 -0
  27. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/v1/sync/api.py +0 -0
  28. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/api/v1/translators.py +0 -0
  29. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/__init__.py +0 -0
  30. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/asynchronous/__init__.py +0 -0
  31. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/asynchronous/client.py +0 -0
  32. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/asynchronous/communicators.py +0 -0
  33. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/asynchronous/config.py +0 -0
  34. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/config.py +0 -0
  35. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/namespace.py +0 -0
  36. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/sync/__init__.py +0 -0
  37. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/sync/client.py +0 -0
  38. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/sync/communicators.py +0 -0
  39. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/client/sync/config.py +0 -0
  40. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/docker_manager.py +0 -0
  41. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/__init__.py +0 -0
  42. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/_unstable/__init__.py +0 -0
  43. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/_unstable/bodies.py +0 -0
  44. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/apiver.py +0 -0
  45. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/constants.py +0 -0
  46. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/currency.py +0 -0
  47. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/endpoints.py +0 -0
  48. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/exceptions.py +0 -0
  49. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/settings.py +0 -0
  50. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/timeout.py +0 -0
  51. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/v1/__init__.py +0 -0
  52. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/v1/bodies.py +0 -0
  53. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/v1/models.py +0 -0
  54. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/v1/requests.py +0 -0
  55. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/pylon_commons/v1/responses.py +0 -0
  56. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/_internal/translators.py +0 -0
  57. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/artanis/v1.py +0 -0
  58. {bittensor_pylon_client-2.1.0 → bittensor_pylon_client-2.2.0}/pylon_client/v1/__init__.py +0 -0
  59. {bittensor_pylon_client-2.1.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.1.0
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,11 +12,16 @@ 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,
@@ -76,6 +81,18 @@ class AsyncOpenAccessApi(AbstractAsyncOpenAccessApi):
76
81
  async def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest:
77
82
  return GetLatestBlockInfoRequest()
78
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
+
79
96
  async def _get_extrinsic_request(
80
97
  self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
81
98
  ) -> GetExtrinsicRequest:
@@ -84,6 +101,9 @@ class AsyncOpenAccessApi(AbstractAsyncOpenAccessApi):
84
101
  async def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest:
85
102
  return GetDrandLastStoredRoundRequest()
86
103
 
104
+ async def _get_latest_evm_associations_request(self, netuid: NetUid) -> GetLatestEvmAssociationsRequest:
105
+ return GetLatestEvmAssociationsRequest(netuid=netuid)
106
+
87
107
 
88
108
  class AsyncIdentityApi(AbstractAsyncIdentityApi):
89
109
  api_version = ApiVersion.UNSTABLE
@@ -206,6 +226,18 @@ class AsyncIdentityApi(AbstractAsyncIdentityApi):
206
226
  async def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest:
207
227
  return GetLatestBlockInfoRequest()
208
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
+
209
241
  async def _get_extrinsic_request(
210
242
  self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
211
243
  ) -> GetExtrinsicRequest:
@@ -213,3 +245,6 @@ class AsyncIdentityApi(AbstractAsyncIdentityApi):
213
245
 
214
246
  async def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest:
215
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,11 +12,16 @@ 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,
@@ -76,12 +81,27 @@ class OpenAccessApi(AbstractOpenAccessApi):
76
81
  def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest:
77
82
  return GetLatestBlockInfoRequest()
78
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
+
79
96
  def _get_extrinsic_request(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicRequest:
80
97
  return GetExtrinsicRequest(block_number=block_number, extrinsic_index=extrinsic_index)
81
98
 
82
99
  def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest:
83
100
  return GetDrandLastStoredRoundRequest()
84
101
 
102
+ def _get_latest_evm_associations_request(self, netuid: NetUid) -> GetLatestEvmAssociationsRequest:
103
+ return GetLatestEvmAssociationsRequest(netuid=netuid)
104
+
85
105
 
86
106
  class IdentityApi(AbstractIdentityApi):
87
107
  api_version = ApiVersion.UNSTABLE
@@ -202,8 +222,23 @@ class IdentityApi(AbstractIdentityApi):
202
222
  def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest:
203
223
  return GetLatestBlockInfoRequest()
204
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
+
205
237
  def _get_extrinsic_request(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicRequest:
206
238
  return GetExtrinsicRequest(block_number=block_number, extrinsic_index=extrinsic_index)
207
239
 
208
240
  def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest:
209
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,11 +14,16 @@ 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,
@@ -213,6 +218,32 @@ class HttpTranslator(AbstractRequestTranslator[Request, HttpCommunicatorT]):
213
218
  method=self._endpoint_cls.LATEST_BLOCK_INFO.method, url=url, headers=headers
214
219
  )
215
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
+
216
247
  def _translate_get_extrinsic(self, request: GetExtrinsicRequest, communicator: HttpCommunicatorT) -> Request:
217
248
  url = self._build_url(self._endpoint_cls.EXTRINSIC, request)
218
249
  headers = self._get_auth_headers(request, communicator)
@@ -225,3 +256,12 @@ class HttpTranslator(AbstractRequestTranslator[Request, HttpCommunicatorT]):
225
256
  ) -> Request:
226
257
  url = self._build_url(self._endpoint_cls.DRAND_LAST_STORED_ROUND, request)
227
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,11 +12,16 @@ 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,
@@ -33,7 +38,10 @@ from pylon_client._internal.pylon_commons._unstable.responses import (
33
38
  GetDrandLastStoredRoundResponse,
34
39
  GetExtrinsicResponse,
35
40
  GetLatestBlockInfoResponse,
41
+ GetLatestEvmAssociationsResponse,
36
42
  GetNeuronsResponse,
43
+ GetPriceResponse,
44
+ GetPricesResponse,
37
45
  GetRevealedCommitmentsResponse,
38
46
  GetValidatorsResponse,
39
47
  GetWeightsStatusResponse,
@@ -248,6 +256,30 @@ class AbstractAsyncOpenAccessApi(AbstractAsyncApi, ABC):
248
256
  """
249
257
  return await self._send_request(await self._get_latest_block_info_request())
250
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
+
251
283
  async def get_extrinsic(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicResponse:
252
284
  """
253
285
  Retrieves a decoded extrinsic from a specific block.
@@ -265,7 +297,7 @@ class AbstractAsyncOpenAccessApi(AbstractAsyncApi, ABC):
265
297
 
266
298
  async def get_drand_last_stored_round(self) -> GetDrandLastStoredRoundResponse:
267
299
  """
268
- Retrieves the last stored drand round from the service.
300
+ Retrieves the last stored drand round.
269
301
 
270
302
  This is a blockchain-level query that does not require subnet context.
271
303
 
@@ -274,6 +306,15 @@ class AbstractAsyncOpenAccessApi(AbstractAsyncApi, ABC):
274
306
  """
275
307
  return await self._send_request(await self._get_drand_last_stored_round_request())
276
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
+
277
318
  # Private API
278
319
 
279
320
  @abstractmethod
@@ -308,6 +349,18 @@ class AbstractAsyncOpenAccessApi(AbstractAsyncApi, ABC):
308
349
  @abstractmethod
309
350
  async def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest: ...
310
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
+
311
364
  @abstractmethod
312
365
  async def _get_extrinsic_request(
313
366
  self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
@@ -316,6 +369,9 @@ class AbstractAsyncOpenAccessApi(AbstractAsyncApi, ABC):
316
369
  @abstractmethod
317
370
  async def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest: ...
318
371
 
372
+ @abstractmethod
373
+ async def _get_latest_evm_associations_request(self, netuid: NetUid) -> GetLatestEvmAssociationsRequest: ...
374
+
319
375
 
320
376
  class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
321
377
  """
@@ -587,6 +643,30 @@ class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
587
643
  """
588
644
  return await self._send_identity_request(self._get_latest_block_info_request)
589
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
+
590
670
  async def get_extrinsic(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicResponse:
591
671
  """
592
672
  Retrieves a decoded extrinsic from a specific block.
@@ -604,7 +684,7 @@ class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
604
684
 
605
685
  async def get_drand_last_stored_round(self) -> GetDrandLastStoredRoundResponse:
606
686
  """
607
- Retrieves the last stored drand round from the service.
687
+ Retrieves the last stored drand round.
608
688
 
609
689
  This is a blockchain-level query that does not require subnet context.
610
690
 
@@ -613,6 +693,15 @@ class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
613
693
  """
614
694
  return await self._send_identity_request(self._get_drand_last_stored_round_request)
615
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
+
616
705
  # Private API
617
706
 
618
707
  @abstractmethod
@@ -671,6 +760,18 @@ class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
671
760
  @abstractmethod
672
761
  async def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest: ...
673
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
+
674
775
  @abstractmethod
675
776
  async def _get_extrinsic_request(
676
777
  self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
@@ -678,3 +779,6 @@ class AbstractAsyncIdentityApi(AbstractAsyncApi, ABC):
678
779
 
679
780
  @abstractmethod
680
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,11 +12,16 @@ 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,
@@ -33,7 +38,10 @@ from pylon_client._internal.pylon_commons._unstable.responses import (
33
38
  GetDrandLastStoredRoundResponse,
34
39
  GetExtrinsicResponse,
35
40
  GetLatestBlockInfoResponse,
41
+ GetLatestEvmAssociationsResponse,
36
42
  GetNeuronsResponse,
43
+ GetPriceResponse,
44
+ GetPricesResponse,
37
45
  GetRevealedCommitmentsResponse,
38
46
  GetValidatorsResponse,
39
47
  GetWeightsStatusResponse,
@@ -247,6 +255,30 @@ class AbstractOpenAccessApi(AbstractApi, ABC):
247
255
  """
248
256
  return self._send_request(self._get_latest_block_info_request())
249
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
+
250
282
  def get_extrinsic(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicResponse:
251
283
  """
252
284
  Retrieves a decoded extrinsic from a specific block.
@@ -264,7 +296,7 @@ class AbstractOpenAccessApi(AbstractApi, ABC):
264
296
 
265
297
  def get_drand_last_stored_round(self) -> GetDrandLastStoredRoundResponse:
266
298
  """
267
- Retrieves the last stored drand round from the service.
299
+ Retrieves the last stored drand round.
268
300
 
269
301
  This is a blockchain-level query that does not require subnet context.
270
302
 
@@ -273,6 +305,15 @@ class AbstractOpenAccessApi(AbstractApi, ABC):
273
305
  """
274
306
  return self._send_request(self._get_drand_last_stored_round_request())
275
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
+
276
317
  # Private API
277
318
 
278
319
  @abstractmethod
@@ -305,6 +346,18 @@ class AbstractOpenAccessApi(AbstractApi, ABC):
305
346
  @abstractmethod
306
347
  def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest: ...
307
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
+
308
361
  @abstractmethod
309
362
  def _get_extrinsic_request(
310
363
  self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
@@ -313,6 +366,9 @@ class AbstractOpenAccessApi(AbstractApi, ABC):
313
366
  @abstractmethod
314
367
  def _get_drand_last_stored_round_request(self) -> GetDrandLastStoredRoundRequest: ...
315
368
 
369
+ @abstractmethod
370
+ def _get_latest_evm_associations_request(self, netuid: NetUid) -> GetLatestEvmAssociationsRequest: ...
371
+
316
372
 
317
373
  class AbstractIdentityApi(AbstractApi, ABC):
318
374
  """
@@ -586,6 +642,30 @@ class AbstractIdentityApi(AbstractApi, ABC):
586
642
  """
587
643
  return self._send_identity_request(self._get_latest_block_info_request)
588
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
+
589
669
  def get_extrinsic(self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex) -> GetExtrinsicResponse:
590
670
  """
591
671
  Retrieves a decoded extrinsic from a specific block.
@@ -603,7 +683,7 @@ class AbstractIdentityApi(AbstractApi, ABC):
603
683
 
604
684
  def get_drand_last_stored_round(self) -> GetDrandLastStoredRoundResponse:
605
685
  """
606
- Retrieves the last stored drand round from the service.
686
+ Retrieves the last stored drand round.
607
687
 
608
688
  This is a blockchain-level query that does not require subnet context.
609
689
 
@@ -612,6 +692,15 @@ class AbstractIdentityApi(AbstractApi, ABC):
612
692
  """
613
693
  return self._send_identity_request(self._get_drand_last_stored_round_request)
614
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
+
615
704
  # Private API
616
705
 
617
706
  @abstractmethod
@@ -666,6 +755,18 @@ class AbstractIdentityApi(AbstractApi, ABC):
666
755
  @abstractmethod
667
756
  def _get_latest_block_info_request(self) -> GetLatestBlockInfoRequest: ...
668
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
+
669
770
  @abstractmethod
670
771
  def _get_extrinsic_request(
671
772
  self, block_number: BlockNumber, extrinsic_index: ExtrinsicIndex
@@ -673,3 +774,6 @@ class AbstractIdentityApi(AbstractApi, ABC):
673
774
 
674
775
  @abstractmethod
675
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,10 @@ 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")
53
57
  SUBNET_MECHANISM_WEIGHTS_STATUS = (
@@ -56,3 +60,4 @@ class Endpoint(BaseEndpoint):
56
60
  "subnet_mechanism_weight_status",
57
61
  )
58
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,8 +19,12 @@ 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,
@@ -15,7 +15,10 @@ 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,
21
24
  GetWeightsStatusResponse,
@@ -105,6 +108,24 @@ class GetRecentNeuronsRequest(AuthenticatedPylonRequest[GetNeuronsResponse]):
105
108
  response_cls = GetNeuronsResponse
106
109
 
107
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
+
108
129
  class GetValidatorsRequest(AuthenticatedPylonRequest[GetValidatorsResponse]):
109
130
  """
110
131
  Class used to fetch the validators by the Pylon client.
@@ -168,6 +189,28 @@ class GetLatestBlockInfoRequest(PylonRequest[GetLatestBlockInfoResponse]):
168
189
  response_cls = GetLatestBlockInfoResponse
169
190
 
170
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
+
171
214
  class GetExtrinsicRequest(PylonRequest[GetExtrinsicResponse]):
172
215
  """
173
216
  Class used to fetch an extrinsic from a specific block by the Pylon client.
@@ -264,3 +307,11 @@ class GenerateCertificateKeypairRequest(PylonRequest):
264
307
  if v != CertificateAlgorithm.ED25519:
265
308
  raise ValueError("Currently, only algorithm equals 1 is supported which is EdDSA using Ed25519 curve")
266
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,5 +1,6 @@
1
1
  from pydantic import BaseModel
2
2
 
3
+ from ..models import SubnetEvmAssociations
3
4
  from ..types import IdentityName, NetUid
4
5
  from .models import (
5
6
  Block,
@@ -9,6 +10,8 @@ from .models import (
9
10
  RevealedCommitment,
10
11
  SubnetCommitments,
11
12
  SubnetNeurons,
13
+ SubnetPrice,
14
+ SubnetPrices,
12
15
  SubnetRevealedCommitments,
13
16
  SubnetValidators,
14
17
  WeightsStatus,
@@ -159,3 +162,27 @@ class GetDrandLastStoredRoundResponse(PylonResponse):
159
162
  """
160
163
 
161
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
@@ -287,6 +304,15 @@ class Extrinsic(BittensorModel):
287
304
 
288
305
 
289
306
  class WeightsStatus(BittensorModel):
290
- model_config = ConfigDict(extra="allow")
291
-
292
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,9 +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
- # TODO v1 includes revealed commitments endpoints only because v1 translator inherits from unstable
26
- # they could be removed once we change ApiVer approach from inheritance to composition in pylon_client
27
- REVEALED_COMMITMENTS = (HTTPMethod.POST, "/commitments/revealed", "revealed_commitments_v1")
28
25
  EXTRINSIC = (HTTPMethod.GET, "/block/{block_number:int}/extrinsic/{extrinsic_index:int}", "extrinsic_v1")
29
26
  IDENTITIES = (HTTPMethod.GET, "/identities", "identities_v1")
30
27
  LATEST_BLOCK_INFO = (HTTPMethod.GET, "/block/latest", "latest_block_info")
@@ -56,3 +53,7 @@ class Endpoint(BaseEndpoint):
56
53
  RECENT_NEURONS = (HTTPMethod.GET, "/block/recent/neurons", "recent_neurons_v1")
57
54
  SUBNET_WEIGHTS = (HTTPMethod.PUT, "/weights", "subnet_weights_v1")
58
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")
@@ -32,6 +32,7 @@ from pylon_client._internal.pylon_commons.types import (
32
32
  Dividends,
33
33
  Emission,
34
34
  EmissionRao,
35
+ EvmAddress,
35
36
  ExtrinsicHash,
36
37
  ExtrinsicIndex,
37
38
  ExtrinsicLength,
@@ -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,7 +33,10 @@ 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,
34
42
  GetWeightsStatusResponse,