@@ -1921,6 +1921,42 @@ async def get_stake_add_fee(
1921
1921
)
1922
1922
return Balance .from_rao (result )
1923
1923
1924
+ async def get_subnet_info (
1925
+ self ,
1926
+ netuid : int ,
1927
+ block : Optional [int ] = None ,
1928
+ block_hash : Optional [str ] = None ,
1929
+ reuse_block : bool = False ,
1930
+ ) -> Optional ["SubnetInfo" ]:
1931
+ """
1932
+ Retrieves detailed information about subnet within the Bittensor network.
1933
+ This function provides comprehensive data on subnet, including its characteristics and operational parameters.
1934
+
1935
+ Arguments:
1936
+ netuid: The unique identifier of the subnet.
1937
+ block: The blockchain block number for the query.
1938
+ block_hash (Optional[str]): The hash of the block to retrieve the stake from. Do not specify if using block
1939
+ or reuse_block
1940
+ reuse_block (bool): Whether to use the last-used block. Do not set if using block_hash or block.
1941
+
1942
+ Returns:
1943
+ SubnetInfo: A SubnetInfo objects, each containing detailed information about a subnet.
1944
+
1945
+ Gaining insights into the subnet's details assists in understanding the network's composition, the roles of
1946
+ different subnets, and their unique features.
1947
+ """
1948
+ result = await self .query_runtime_api (
1949
+ runtime_api = "SubnetInfoRuntimeApi" ,
1950
+ method = "get_subnet_info_v2" ,
1951
+ params = [netuid ],
1952
+ block = block ,
1953
+ block_hash = block_hash ,
1954
+ reuse_block = reuse_block ,
1955
+ )
1956
+ if not result :
1957
+ return None
1958
+ return SubnetInfo .from_dict (result )
1959
+
1924
1960
async def get_unstake_fee (
1925
1961
self ,
1926
1962
amount : Balance ,
0 commit comments