@@ -149,19 +149,19 @@ def __init__(
149
149
"""Initializes an AsyncSubtensor instance for blockchain interaction.
150
150
151
151
Arguments:
152
- network: The network name or type to connect to (e.g., "finney", "test"). If `None`, uses the default
152
+ network: The network name or type to connect to (e.g., "finney", "test"). If `` None` `, uses the default
153
153
network from config.
154
- config: Configuration object for the AsyncSubtensor instance. If `None`, uses the default configuration.
155
- log_verbose: Enables or disables verbose logging. Defaults to `False`.
154
+ config: Configuration object for the AsyncSubtensor instance. If `` None` `, uses the default configuration.
155
+ log_verbose: Enables or disables verbose logging. Defaults to `` False` `.
156
156
fallback_endpoints: List of fallback endpoints to use if default or provided network is not available.
157
- Defaults to `None`.
158
- retry_forever: Whether to retry forever on connection errors. Defaults to `False`.
159
- _mock: Whether this is a mock instance. Mainly for testing purposes. Defaults to `False`.
157
+ Defaults to `` None` `.
158
+ retry_forever: Whether to retry forever on connection errors. Defaults to `` False` `.
159
+ _mock: Whether this is a mock instance. Mainly for testing purposes. Defaults to `` False` `.
160
160
archive_endpoints: Similar to fallback_endpoints, but specifically only archive nodes. Will be used in
161
161
cases where you are requesting a block that is too old for your current (presumably lite) node.
162
- Defaults to `None`.
162
+ Defaults to `` None` `.
163
163
websocket_shutdown_timer: Amount of time, in seconds, to wait after the last response from the chain to
164
- close the connection. Defaults to `5.0`.
164
+ close the connection. Defaults to `` 5.0` `.
165
165
Returns:
166
166
None
167
167
@@ -330,7 +330,7 @@ async def determine_block_hash(
330
330
# Ensure that only one of the parameters is specified.
331
331
if sum (bool (x ) for x in [block , block_hash , reuse_block ]) > 1 :
332
332
raise ValueError (
333
- "Only one of `block`, `block_hash`, or `reuse_block` can be specified."
333
+ "Only one of `` block`` , `` block_hash`` , or `` reuse_block` ` can be specified."
334
334
)
335
335
336
336
# Return the appropriate value.
@@ -462,12 +462,12 @@ def _get_substrate(
462
462
463
463
Arguments:
464
464
fallback_endpoints: List of fallback endpoints to use if default or provided network is not available.
465
- Defaults to `None`.
466
- retry_forever: Whether to retry forever on connection errors. Defaults to `False`.
467
- _mock: Whether this is a mock instance. Mainly for testing purposes. Defaults to `False`.
465
+ Defaults to `` None` `.
466
+ retry_forever: Whether to retry forever on connection errors. Defaults to `` False` `.
467
+ _mock: Whether this is a mock instance. Mainly for testing purposes. Defaults to `` False` `.
468
468
archive_endpoints: Similar to fallback_endpoints, but specifically only archive nodes. Will be used in
469
469
cases where you are requesting a block that is too old for your current (presumably lite) node. Defaults
470
- to `None`.
470
+ to `` None` `.
471
471
ws_shutdown_timer: Amount of time, in seconds, to wait after the last response from the chain to close
472
472
the connection.
473
473
@@ -521,10 +521,10 @@ async def query_constant(
521
521
reuse_block.
522
522
block_hash: The hash of the blockchain block at which to query the constant. Do not specify if using
523
523
block or reuse_block.
524
- reuse_block: Whether to reuse the blockchain block at which to query the constant. Defaults to `False`.
524
+ reuse_block: Whether to reuse the blockchain block at which to query the constant. Defaults to `` False` `.
525
525
526
526
Returns:
527
- Optional[async_substrate_interface.types.ScaleObj]: The value of the constant if found, `None` otherwise.
527
+ Optional[async_substrate_interface.types.ScaleObj]: The value of the constant if found, `` None` ` otherwise.
528
528
529
529
Example:
530
530
# Get existential deposit constant
@@ -565,12 +565,12 @@ async def query_map(
565
565
Arguments:
566
566
module: The name of the module from which to query the map storage (e.g., "SubtensorModule", "System").
567
567
name: The specific storage function within the module to query (e.g., "Bonds", "Weights").
568
- block: The blockchain block number at which to perform the query. Defaults to `None` (latest block).
568
+ block: The blockchain block number at which to perform the query. Defaults to `` None` ` (latest block).
569
569
block_hash: The hash of the block to retrieve the parameter from. Do not specify if using block or
570
570
reuse_block.
571
571
reuse_block: Whether to use the last-used block. Do not set if using block_hash or block. Defaults to
572
- `False`.
573
- params: Parameters to be passed to the query. Defaults to `None`.
572
+ `` False` `.
573
+ params: Parameters to be passed to the query. Defaults to `` None` `.
574
574
575
575
Returns:
576
576
AsyncQueryMapResult: A data structure representing the map storage if found, None otherwise.
@@ -613,7 +613,7 @@ async def query_map_subtensor(
613
613
params: A list of parameters to pass to the query function.
614
614
615
615
Returns:
616
- An object containing the map-like data structure, or `None` if not found.
616
+ An object containing the map-like data structure, or `` None` ` if not found.
617
617
618
618
This function is particularly useful for analyzing and understanding complex network structures and
619
619
relationships within the Bittensor ecosystem, such as interneuronal connections and stake distributions.
@@ -650,7 +650,7 @@ async def query_module(
650
650
params: A list of parameters to pass to the query function.
651
651
652
652
Returns:
653
- An object containing the requested data if found, `None` otherwise.
653
+ An object containing the requested data if found, `` None` ` otherwise.
654
654
655
655
This versatile query function is key to accessing a wide range of data and insights from different parts of the
656
656
Bittensor blockchain, enhancing the understanding and analysis of the network's state and dynamics.
@@ -687,7 +687,7 @@ async def query_runtime_api(
687
687
reuse_block: Whether to reuse the last-used block hash. Do not set if using block_hash or block.
688
688
689
689
Returns:
690
- The decoded result from the runtime API call, or `None` if the call fails.
690
+ The decoded result from the runtime API call, or `` None` ` if the call fails.
691
691
692
692
This function enables access to the deeper layers of the Bittensor blockchain, allowing for detailed and
693
693
specific interactions with the network's runtime environment.
@@ -856,7 +856,7 @@ async def blocks_since_last_step(
856
856
return query .value if query is not None and hasattr (query , "value" ) else query
857
857
858
858
async def blocks_since_last_update (self , netuid : int , uid : int ) -> Optional [int ]:
859
- """Returns the number of blocks since the last update, or `None` if the subnetwork or UID does not exist.
859
+ """Returns the number of blocks since the last update, or `` None` ` if the subnetwork or UID does not exist.
860
860
861
861
Arguments:
862
862
netuid: The unique identifier of the subnetwork.
@@ -1267,7 +1267,7 @@ async def get_block_hash(self, block: Optional[int] = None) -> str:
1267
1267
the trustworthiness of the blockchain.
1268
1268
1269
1269
Arguments:
1270
- block: The block number for which the hash is to be retrieved. If `None`, returns the latest block hash.
1270
+ block: The block number for which the hash is to be retrieved. If `` None` `, returns the latest block hash.
1271
1271
1272
1272
Returns:
1273
1273
str: The cryptographic hash of the specified block.
@@ -1572,7 +1572,7 @@ async def get_revealed_commitment_by_hotkey(
1572
1572
1573
1573
Arguments:
1574
1574
netuid: The unique identifier of the subnetwork.
1575
- block: The block number to retrieve the commitment from. Default is `None`.
1575
+ block: The block number to retrieve the commitment from. Default is `` None` `.
1576
1576
hotkey_ss58_address: The ss58 address of the committee member.
1577
1577
block_hash: The hash of the block to retrieve the subnet unique identifiers from.
1578
1578
reuse_block: Whether to reuse the last-used block hash.
@@ -1606,7 +1606,7 @@ async def get_revealed_commitment(
1606
1606
Arguments:
1607
1607
netuid: The unique identifier of the subnetwork.
1608
1608
uid: The neuron uid to retrieve the commitment from.
1609
- block: The block number to retrieve the commitment from. Default is `None`.
1609
+ block: The block number to retrieve the commitment from. Default is `` None` `.
1610
1610
1611
1611
Returns:
1612
1612
result (Optional[tuple[int, str]]: A tuple of reveal block and commitment message.
@@ -1639,7 +1639,7 @@ async def get_all_revealed_commitments(
1639
1639
1640
1640
Arguments:
1641
1641
netuid: The unique identifier of the subnetwork.
1642
- block: The block number to retrieve the commitment from. Default is `None`.
1642
+ block: The block number to retrieve the commitment from. Default is `` None` `.
1643
1643
block_hash: The hash of the block to retrieve the subnet unique identifiers from.
1644
1644
reuse_block: Whether to reuse the last-used block hash.
1645
1645
@@ -1682,7 +1682,7 @@ async def get_current_weight_commit_info(
1682
1682
1683
1683
Arguments:
1684
1684
netuid: The unique identifier of the subnet.
1685
- block: The blockchain block number for the query. Default is `None`.
1685
+ block: The blockchain block number for the query. Default is `` None` `.
1686
1686
block_hash: The hash of the block to retrieve the subnet unique identifiers from.
1687
1687
reuse_block: Whether to reuse the last-used block hash.
1688
1688
@@ -1714,13 +1714,13 @@ async def get_delegate_by_hotkey(
1714
1714
comprehensive view of the delegate's status, including its stakes, nominators, and reward distribution.
1715
1715
1716
1716
Arguments:
1717
- hotkey_ss58: The `SS58` address of the delegate's hotkey.
1717
+ hotkey_ss58: The `` SS58` ` address of the delegate's hotkey.
1718
1718
block: The blockchain block number for the query.
1719
1719
block_hash: The hash of the block to retrieve the subnet unique identifiers from.
1720
1720
reuse_block: Whether to reuse the last-used block hash.
1721
1721
1722
1722
Returns:
1723
- Optional[DelegateInfo]: Detailed information about the delegate neuron, `None` if not found.
1723
+ Optional[DelegateInfo]: Detailed information about the delegate neuron, `` None` ` if not found.
1724
1724
1725
1725
This function is essential for understanding the roles and influence of delegate neurons within the Bittensor
1726
1726
network's consensus and governance structures.
@@ -1818,7 +1818,7 @@ async def get_delegated(
1818
1818
delegates that a specific account has staked tokens on.
1819
1819
1820
1820
Arguments:
1821
- coldkey_ss58: The `SS58` address of the account's coldkey.
1821
+ coldkey_ss58: The `` SS58` ` address of the account's coldkey.
1822
1822
block: The blockchain block number for the query.
1823
1823
block_hash: The hash of the blockchain block number for the query.
1824
1824
reuse_block: Whether to reuse the last-used blockchain block hash.
@@ -1887,7 +1887,7 @@ async def get_existential_deposit(
1887
1887
1888
1888
Arguments:
1889
1889
block: The blockchain block number for the query.
1890
- block_hash: Block hash at which to query the deposit amount. If `None`, the current block is used.
1890
+ block_hash: Block hash at which to query the deposit amount. If `` None` `, the current block is used.
1891
1891
reuse_block: Whether to reuse the last-used blockchain block hash.
1892
1892
1893
1893
Returns:
@@ -2025,7 +2025,7 @@ async def get_metagraph_info(
2025
2025
]
2026
2026
else :
2027
2027
raise ValueError (
2028
- "`field_indices` must be a list of SelectiveMetagraphIndex enums or ints."
2028
+ "`` field_indices` ` must be a list of SelectiveMetagraphIndex enums or ints."
2029
2029
)
2030
2030
2031
2031
query = await self .substrate .runtime_call (
@@ -2135,7 +2135,7 @@ async def get_neuron_certificate(
2135
2135
reuse_block: Whether to use the last-used block. Do not set if using block_hash or block.
2136
2136
2137
2137
Returns:
2138
- the certificate of the neuron if found, `None` otherwise.
2138
+ the certificate of the neuron if found, `` None` ` otherwise.
2139
2139
2140
2140
This function is used for certificate discovery for setting up mutual tls communication between neurons.
2141
2141
"""
@@ -2372,15 +2372,15 @@ async def get_neuron_for_pubkey_and_subnet(
2372
2372
network.
2373
2373
2374
2374
Arguments:
2375
- hotkey: The `SS58` address of the neuron's hotkey.
2375
+ hotkey: The `` SS58` ` address of the neuron's hotkey.
2376
2376
netuid: The unique identifier of the subnet.
2377
2377
block: The blockchain block number for the query.
2378
2378
block_hash: The blockchain block number at which to perform the query.
2379
2379
reuse_block: Whether to reuse the last-used blockchain block hash.
2380
2380
2381
2381
Returns:
2382
2382
Optional[bittensor.core.chain_data.neuron_info.NeuronInfo]: Detailed information about the neuron if found,
2383
- `None` otherwise.
2383
+ `` None` ` otherwise.
2384
2384
2385
2385
This function is crucial for accessing specific neuron data and understanding its status, stake, and other
2386
2386
attributes within a particular subnet of the Bittensor ecosystem.
@@ -2414,7 +2414,7 @@ async def get_next_epoch_start_block(
2414
2414
"""
2415
2415
Calculates the first block number of the next epoch for the given subnet.
2416
2416
2417
- If `block` is not provided, the current chain block will be used. Epochs are
2417
+ If `` block` ` is not provided, the current chain block will be used. Epochs are
2418
2418
determined based on the subnet's tempo (i.e., blocks per epoch). The result
2419
2419
is the block number at which the next epoch will begin.
2420
2420
@@ -2770,7 +2770,7 @@ async def get_stake_for_coldkey_and_hotkey(
2770
2770
Arguments:
2771
2771
coldkey_ss58: The SS58 address of the coldkey.
2772
2772
hotkey_ss58: The SS58 address of the hotkey.
2773
- netuids: The subnet IDs to query for. Set to `None` for all subnets.
2773
+ netuids: The subnet IDs to query for. Set to `` None` ` for all subnets.
2774
2774
block: The block number at which to query the stake information.
2775
2775
block_hash: The hash of the block to retrieve the stake from. Do not specify if using block
2776
2776
or reuse_block
@@ -2821,7 +2821,7 @@ async def get_stake_for_coldkey(
2821
2821
reuse_block: Whether to reuse the last-used block hash.
2822
2822
2823
2823
Returns:
2824
- Optional[list[StakeInfo]]: A list of StakeInfo objects, or `None` if no stake information is found.
2824
+ Optional[list[StakeInfo]]: A list of StakeInfo objects, or `` None` ` if no stake information is found.
2825
2825
"""
2826
2826
result = await self .query_runtime_api (
2827
2827
runtime_api = "StakeInfoRuntimeApi" ,
@@ -2926,7 +2926,7 @@ async def get_subnet_hyperparameters(
2926
2926
reuse_block: Whether to reuse the last-used blockchain hash.
2927
2927
2928
2928
Returns:
2929
- The subnet's hyperparameters, or `None` if not available.
2929
+ The subnet's hyperparameters, or `` None` ` if not available.
2930
2930
2931
2931
Understanding the hyperparameters is crucial for comprehending how subnets are configured and managed, and how
2932
2932
they interact with the network's consensus and incentive mechanisms.
@@ -3028,7 +3028,7 @@ async def get_transfer_fee(
3028
3028
3029
3029
Arguments:
3030
3030
wallet: The wallet from which the transfer is initiated.
3031
- dest: The `SS58` address of the destination account.
3031
+ dest: The `` SS58` ` address of the destination account.
3032
3032
value: The amount of tokens to be transferred, specified as a Balance object, or in Tao (float) or Rao
3033
3033
(int) units.
3034
3034
@@ -3076,7 +3076,7 @@ async def get_vote_data(
3076
3076
reuse_block: Whether to reuse the last-used blockchain block hash.
3077
3077
3078
3078
Returns:
3079
- An object containing the proposal's voting data, or `None` if not found.
3079
+ An object containing the proposal's voting data, or `` None` ` if not found.
3080
3080
3081
3081
This function is important for tracking and understanding the decision-making processes within the Bittensor
3082
3082
network, particularly how proposals are received and acted upon by the governing body.
@@ -3114,7 +3114,7 @@ async def get_uid_for_hotkey_on_subnet(
3114
3114
reuse_block: Whether to reuse the last-used blockchain block hash.
3115
3115
3116
3116
Returns:
3117
- Optional[int]: The UID of the neuron if it is registered on the subnet, `None` otherwise.
3117
+ Optional[int]: The UID of the neuron if it is registered on the subnet, `` None` ` otherwise.
3118
3118
3119
3119
The UID is a critical identifier within the network, linking the neuron's hotkey to its operational and
3120
3120
governance activities on a particular subnet.
@@ -3205,7 +3205,7 @@ async def immunity_period(
3205
3205
reuse_block: Whether to reuse the last-used blockchain block hash.
3206
3206
3207
3207
Returns:
3208
- Optional[int]: The value of the 'ImmunityPeriod' hyperparameter if the subnet exists, `None` otherwise.
3208
+ Optional[int]: The value of the 'ImmunityPeriod' hyperparameter if the subnet exists, `` None` ` otherwise.
3209
3209
3210
3210
The 'ImmunityPeriod' is a critical aspect of the network's governance system, ensuring that new participants
3211
3211
have a grace period to establish themselves and contribute to the network without facing immediate
@@ -3244,7 +3244,7 @@ async def is_hotkey_delegate(
3244
3244
reuse_block: Whether to reuse the last-used block hash.
3245
3245
3246
3246
Returns:
3247
- `True` if the hotkey is a delegate, `False` otherwise.
3247
+ `` True`` if the hotkey is a delegate, `` False` ` otherwise.
3248
3248
3249
3249
Being a delegate is a significant status within the Bittensor network, indicating a neuron's involvement in
3250
3250
consensus and governance processes.
@@ -3271,7 +3271,7 @@ async def is_hotkey_registered(
3271
3271
3272
3272
Arguments:
3273
3273
hotkey_ss58: The SS58 address of the neuron's hotkey.
3274
- netuid: The unique identifier of the subnet to check the registration. If `None`, the
3274
+ netuid: The unique identifier of the subnet to check the registration. If `` None` `, the
3275
3275
registration is checked across all subnets.
3276
3276
block: The blockchain block number at which to perform the query.
3277
3277
block_hash: The blockchain block_hash representation of the block id. Do not specify if using block or
@@ -3280,8 +3280,8 @@ async def is_hotkey_registered(
3280
3280
reuse_block.
3281
3281
3282
3282
Returns:
3283
- bool: `True` if the hotkey is registered in the specified context (either any subnet or a specific subnet),
3284
- `False` otherwise.
3283
+ bool: `` True` ` if the hotkey is registered in the specified context (either any subnet or a specific subnet),
3284
+ `` False` ` otherwise.
3285
3285
3286
3286
This function is important for verifying the active status of neurons in the Bittensor network. It aids in
3287
3287
understanding whether a neuron is eligible to participate in network processes such as consensus,
@@ -3313,7 +3313,7 @@ async def is_hotkey_registered_any(
3313
3313
reuse_block: Whether to reuse the last-used block hash.
3314
3314
3315
3315
Returns:
3316
- bool: `True` if the hotkey is registered on any subnet, False otherwise.
3316
+ bool: `` True` ` if the hotkey is registered on any subnet, False otherwise.
3317
3317
3318
3318
This function is essential for determining the network-wide presence and participation of a neuron.
3319
3319
"""
0 commit comments