1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! # Extrinsics (Transactions)
//!
//! Submit signed transactions to the Bittensor blockchain.
//!
//! This module provides functions for all Bittensor chain operations:
//!
//! | Category | Functions |
//! |----------|-----------|
//! | **Staking** | [`add_stake`], [`remove_stake`], [`delegate_stake`], [`undelegate_stake`] |
//! | **Transfer** | [`transfer`], [`transfer_keep_alive`], [`transfer_all`] |
//! | **Weights** | [`set_weights`], [`commit_weights`], [`reveal_weights`] |
//! | **Registration** | [`serve_axon`], [`serve_prometheus`], [`burned_register`] |
//! | **Subnet** | [`register_network`], [`set_subnet_identity`] |
//! | **Children** | [`set_children`], [`set_childkey_take`], [`revoke_children`] |
//! | **Root** | [`root_register`], [`set_root_weights`] |
//!
//! # Example
//!
//! ```rust,ignore
//! use bittensor_rs::extrinsics::{set_weights, WeightsParams, add_stake, StakeParams};
//!
//! async fn example(
//! client: &subxt::OnlineClient<subxt::PolkadotConfig>,
//! signer: &subxt_signer::sr25519::Keypair,
//! hotkey: subxt::config::polkadot::AccountId32,
//! ) -> Result<(), Box<dyn std::error::Error>> {
//! // Set weights on subnet 1
//! let params = WeightsParams {
//! netuid: 1,
//! uids: vec![0, 1, 2],
//! weights: vec![100, 200, 300],
//! version_key: 0,
//! };
//! let response = set_weights(client, signer, params).await?;
//!
//! // Add stake to a hotkey (1 TAO = 1e9 rao)
//! let stake_params = StakeParams {
//! hotkey,
//! amount_rao: 1_000_000_000,
//! };
//! add_stake(client, signer, stake_params).await?;
//! Ok(())
//! }
//! ```
//!
//! All extrinsic functions return [`ExtrinsicResponse`] with transaction status.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;