@@ -580,6 +580,23 @@ async def all_subnets(
580
580
subnets = DynamicInfo .list_from_dicts (query .decode ())
581
581
return subnets
582
582
583
+ async def blocks_since_last_step (
584
+ self , netuid : int , block : Optional [int ] = None
585
+ ) -> Optional [int ]:
586
+ """Returns number of blocks since the last epoch of the subnet.
587
+
588
+ Arguments:
589
+ netuid (int): The unique identifier of the subnetwork.
590
+ block: the block number for this query.
591
+
592
+ Returns:
593
+ block number of the last step in the subnet.
594
+ """
595
+ query = await self .query_subtensor (
596
+ name = "BlocksSinceLastStep" , block = block , params = [netuid ]
597
+ )
598
+ return query .value if query is not None and hasattr (query , "value" ) else query
599
+
583
600
async def blocks_since_last_update (self , netuid : int , uid : int ) -> Optional [int ]:
584
601
"""
585
602
Returns the number of blocks since the last update for a specific UID in the subnetwork.
@@ -3149,6 +3166,46 @@ async def get_timestamp(
3149
3166
).value
3150
3167
return datetime .fromtimestamp (unix / 1000 , tz = timezone .utc )
3151
3168
3169
+ async def get_subnet_owner_hotkey (
3170
+ self , netuid : int , block : Optional [int ] = None
3171
+ ) -> Optional [str ]:
3172
+ """
3173
+ Retrieves the hotkey of the subnet owner for a given network UID.
3174
+
3175
+ This function queries the subtensor network to fetch the hotkey of the owner of a subnet specified by its
3176
+ netuid. If no data is found or the query fails, the function returns None.
3177
+
3178
+ Arguments:
3179
+ netuid: The network UID of the subnet to fetch the owner's hotkey for.
3180
+ block: The specific block number to query the data from.
3181
+
3182
+ Returns:
3183
+ The hotkey of the subnet owner if available; None otherwise.
3184
+ """
3185
+ return await self .query_subtensor (
3186
+ name = "SubnetOwnerHotkey" , params = [netuid ], block = block
3187
+ )
3188
+
3189
+ async def get_subnet_validator_permits (
3190
+ self , netuid : int , block : Optional [int ] = None
3191
+ ) -> Optional [list [bool ]]:
3192
+ """
3193
+ Retrieves the list of validator permits for a given subnet as boolean values.
3194
+
3195
+ Arguments:
3196
+ netuid: The unique identifier of the subnetwork.
3197
+ block: The blockchain block number for the query.
3198
+
3199
+ Returns:
3200
+ A list of boolean values representing validator permits, or None if not available.
3201
+ """
3202
+ query = await self .query_subtensor (
3203
+ name = "ValidatorPermit" ,
3204
+ params = [netuid ],
3205
+ block = block ,
3206
+ )
3207
+ return query .value if query is not None and hasattr (query , "value" ) else query
3208
+
3152
3209
# Extrinsics helper ================================================================================================
3153
3210
3154
3211
async def sign_and_send_extrinsic (
@@ -3172,6 +3229,9 @@ async def sign_and_send_extrinsic(
3172
3229
wait_for_inclusion (bool): whether to wait until the extrinsic call is included on the chain
3173
3230
wait_for_finalization (bool): whether to wait until the extrinsic call is finalized on the chain
3174
3231
sign_with: the wallet's keypair to use for the signing. Options are "coldkey", "hotkey", "coldkeypub"
3232
+ use_nonce: unique identifier for the transaction related with hot/coldkey.
3233
+ period: the period of the transaction as ERA part for transaction. Means how many blocks the transaction will be valid for.
3234
+ nonce_key: the type on nonce to use. Options are "hotkey" or "coldkey".
3175
3235
raise_error: raises relevant exception rather than returning `False` if unsuccessful.
3176
3236
3177
3237
Returns:
0 commit comments