feat!: initial sdk release - #4
Conversation
WalkthroughAdds release automation (release-please + publish workflow), crate metadata and licensing, comprehensive docs and changelog, many documentation/import-path updates across the crate, new query modules (neuron, subnet) and connection submodules, a public export Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
bittensor-rs/examples/test_axon_discovery.rs (1)
32-32: Inconsistent import path with line 117.This function uses
use bittensor::api::api;whiletest_direct_extrinsicat line 117 usesuse bittensor_rs::api::api;. Both imports should use the same crate path.🔎 Proposed fix
- use bittensor::api::api; + use bittensor_rs::api::api;bittensor-rs/src/service.rs (2)
577-589: Potential race condition in circuit breaker state update.The circuit breaker is cloned, executed, then the original is overwritten. With concurrent calls to
get_metagraph, one call's state update could overwrite another's, potentially losing failure/success counts.Consider using an atomic state update pattern or accepting the current behavior if occasional state loss is acceptable for circuit breaker semantics.
871-875: Hardcoded circuit breaker reset values ignore configuration.The reset uses hardcoded
(5, Duration::from_secs(60))instead of the configuredcircuit_breaker_thresholdandcircuit_breaker_recoveryfromself.config. This could lead to different behavior after reset.🔎 Suggested fix
pub async fn reset_circuit_breaker(&self) { let mut cb = self.circuit_breaker.lock().await; - *cb = CircuitBreaker::new(5, Duration::from_secs(60)); + *cb = CircuitBreaker::new( + self.config.circuit_breaker_threshold.unwrap_or(5), + self.config.circuit_breaker_recovery.unwrap_or(Duration::from_secs(60)), + ); info!("Circuit breaker reset"); }
🧹 Nitpick comments (3)
bittensor-rs/LICENSE (1)
3-3: Consider updating the copyright year.The copyright notice shows 2024, but the current date is December 27, 2025. Consider updating to "2024-2025" or just "2025" to reflect the actual release timeframe.
LICENSE (1)
3-3: Consider updating the copyright year.The copyright notice shows 2024, but the current date is December 27, 2025. Consider updating to "2024-2025" or just "2025" to reflect the actual release timeframe.
bittensor-rs/tests/connection_reliability_tests.rs (1)
289-314: Consider using public API for metrics manipulation in tests.The test directly accesses
checker.metricsinternal fields via atomic operations. IfHealthCheckerprovides a public API for metrics (likereset_metrics()), consider using that consistently. Direct field access couples tests to internal implementation.However, if this is intentional to test atomic behavior, it's acceptable.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (16)
.github/workflows/publish.yml.github/workflows/release-please.yml.release-please-manifest.jsonLICENSEREADME.mdbittensor-rs/CHANGELOG.mdbittensor-rs/Cargo.tomlbittensor-rs/LICENSEbittensor-rs/README.mdbittensor-rs/examples/test_axon_discovery.rsbittensor-rs/src/connect/mod.rsbittensor-rs/src/extrinsics/mod.rsbittensor-rs/src/queries/mod.rsbittensor-rs/src/service.rsbittensor-rs/tests/connection_reliability_tests.rsrelease-please-config.json
🧰 Additional context used
🪛 LanguageTool
bittensor-rs/README.md
[style] ~231-~231: Consider using a less common alternative to make your writing sound more unique and professional.
Context: ...ontributing Contributions are welcome! Please feel free to submit a Pull Request. ## Related Proj...
(FEEL_FREE_TO_STYLE_ME)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Coverage
🔇 Additional comments (14)
bittensor-rs/src/extrinsics/mod.rs (1)
1-46: Documentation improvements are well-structured and comprehensive.The reorganized module documentation with the categorized function table and practical example code demonstrates good API clarity. Ensure the example import statement is corrected as flagged above.
bittensor-rs/examples/test_axon_discovery.rs (1)
117-117: LGTM - Import path updated correctly.The import path has been updated to
bittensor_rs::api::apito align with the crate rename. However, note that line 32 still uses the old import path and needs to be updated for consistency.bittensor-rs/CHANGELOG.md (1)
1-61: LGTM - Well-structured changelog.The CHANGELOG follows Keep a Changelog format and provides comprehensive documentation of the initial release features. The structure and content are clear and well-organized.
release-please-config.json (1)
1-26: LGTM - Release Please configuration is correct.The configuration properly sets up automated releases for the bittensor-rs crate with appropriate bump rules for pre-1.0 versions and well-organized changelog sections.
bittensor-rs/Cargo.toml (1)
5-19: LGTM - Package metadata properly configured for publishing.The metadata fields (authors, documentation, homepage, repository, readme, keywords) are well-configured for crates.io publication. URLs are consistent and appropriate.
Consider verifying that the
rust-version = "1.70"requirement is accurate for your actual MSRV (Minimum Supported Rust Version). Rust 1.70 was released in 2023, so you may want to confirm this is the oldest version you've tested against.bittensor-rs/README.md (1)
23-26: LGTM - Installation instructions are clear.The Cargo.toml dependency specification is correct with
bittensor-rs = "0.1"..release-please-manifest.json (1)
1-4: LGTM!The release-please manifest is correctly configured for the initial 0.1.0 release of bittensor-rs.
bittensor-rs/tests/connection_reliability_tests.rs (1)
3-6: LGTM!The import path update from
bittensortobittensor_rscorrectly follows Rust's crate naming convention where hyphens in package names become underscores in imports.bittensor-rs/src/service.rs (1)
106-113: LGTM!The
signer_from_seedfunction correctly usesSecretUrito parse various seed formats (mnemonic, hex) and the error is properly mapped toBittensorErrorat the call site..github/workflows/publish.yml (2)
41-51: LGTM - publish workflow structure is sound.The dry-run verification before actual publish is a good practice. Using
--no-verifyon the actual publish is acceptable since the prior step already verified the package.
53-70: LGTM!The failure notification job properly creates an issue with relevant labels and links to the failed workflow run, providing good visibility for publish failures.
.github/workflows/release-please.yml (1)
1-26: LGTM!The release-please workflow is correctly configured with appropriate permissions, outputs for downstream consumption, and references to the manifest and config files.
bittensor-rs/src/queries/mod.rs (1)
32-45: LGTM!The module structure is well-organized with clear separation between account, metagraph, neuron, and subnet queries. The public re-exports provide a clean API surface for consumers.
bittensor-rs/src/connect/mod.rs (1)
55-75: LGTM!The module structure is well-organized with clear submodule separation. The prelude module follows Rust conventions and provides convenient bulk imports for connection-related types.
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-action@stable | ||
| with: | ||
| components: rustfmt, clippy |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
dtolnay rust-toolchain github action
💡 Result:
dtolnay/rust-toolchain is a concise GitHub Action that installs a Rust toolchain via rustup. Key points:
- Repo/README: usage example (one-line use like uses: dtolnay/rust-toolchain@stable or @nightly), inputs (toolchain, targets, components), and outputs (cachekey, name). [1]
- Action selects toolchain from the action ref by default (e.g. @nightly or @1.89.0); to override with an explicit toolchain input use @master. [1]
- Marketplace entry and related actions (actions-rust-lang/setup-rust-toolchain) show alternatives with extra features (caching, problem matchers). [2][3]
Sources:
[1] dtolnay/rust-toolchain (README & action.yml).
[2] GitHub Marketplace: Setup Rust Toolchain for GitHub CI (actions-rust-lang).
[3] dtolnay/rust-toolchain repository Actions page.
🌐 Web query:
dtolnay/rust-action github
💡 Result:
You likely mean dtolnay/rust-toolchain — a concise GitHub Action that installs a Rust toolchain via rustup (usage: e.g. uses: dtolnay/rust-toolchain@stable). (github.com)
Citations:
🏁 Script executed:
cat -n .github/workflows/publish.yml | sed -n '20,23p'Repository: one-covenant/bittensor-rs
Length of output: 226
Invalid GitHub Action reference - workflow will fail.
The action dtolnay/rust-action@stable does not exist. The correct action is dtolnay/rust-toolchain@stable.
- name: Install Rust toolchain
- uses: dtolnay/rust-action@stable
+ uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy🤖 Prompt for AI Agents
In .github/workflows/publish.yml around lines 20 to 23 the workflow references a
non-existent action `dtolnay/rust-action@stable`; replace that reference with
the correct action `dtolnay/rust-toolchain@stable` so the step becomes `uses:
dtolnay/rust-toolchain@stable` and keep the existing `with: components: rustfmt,
clippy` configuration intact.
| ## Quick Start | ||
|
|
||
| ```rust | ||
| use bittensor::{config::BittensorConfig, Service}; |
There was a problem hiding this comment.
Critical: Import path inconsistency with crate name.
The example shows use bittensor::{config::BittensorConfig, Service}; but the crate name is bittensor-rs, which means imports should use use bittensor_rs:: (with underscore).
This same issue affects all code examples throughout this README at lines 31, 58, 81, 99, 131, 151, and 174.
🔎 Proposed fix for all occurrences
-use bittensor::{config::BittensorConfig, Service};
+use bittensor_rs::{config::BittensorConfig, Service};Apply similar changes to all other import statements throughout the file.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| use bittensor::{config::BittensorConfig, Service}; | |
| use bittensor_rs::{config::BittensorConfig, Service}; |
🤖 Prompt for AI Agents
In bittensor-rs/README.md around lines 31, 58, 81, 99, 131, 151, and 174 the
import statements use the incorrect crate path `use bittensor::...`; update each
occurrence to use the actual crate name with an underscore `use
bittensor_rs::...` (e.g., change `use bittensor::{...}` to `use
bittensor_rs::{...}`) and apply the same replacement consistently to all code
examples in the README so imports compile against the crate name.
| ```rust | ||
| use bittensor::{config::BittensorConfig, Service}; | ||
|
|
||
| #[tokio::main] | ||
| async fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
| // Connect to Finney mainnet | ||
| let config = BittensorConfig::finney("my_wallet", "my_hotkey", 1); | ||
| let service = Service::new(config).await?; | ||
|
|
||
| // Query metagraph | ||
| let metagraph = service.get_metagraph(1).await?; | ||
| println!("Found {} neurons", metagraph.hotkeys.len()); | ||
|
|
||
| Ok(()) | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Critical: Import path inconsistency with crate name.
The example shows use bittensor::{config::BittensorConfig, Service}; but the Cargo.toml dependency specifies bittensor-rs = "0.1". This means the import should be use bittensor_rs::{config::BittensorConfig, Service}; (with underscore, not hyphen).
This inconsistency will cause compilation errors for users following the Quick Start guide.
🔎 Proposed fix
-use bittensor::{config::BittensorConfig, Service};
+use bittensor_rs::{config::BittensorConfig, Service};🤖 Prompt for AI Agents
In README.md around lines 29 to 44 the example imports "bittensor::{...}" but
the crate in Cargo.toml is declared as "bittensor-rs", causing a compile-time
import error; update the import to use the actual crate identifier (replace the
hyphenated crate name with the valid Rust identifier form) and ensure any other
README examples and import references match the crate name in Cargo.toml (or
alternatively update Cargo.toml to expose the intended crate name).
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
bittensor-rs/src/types/balance.rs (1)
79-81: Consider validating or using saturating conversion for f64→u64 casts.Both
Balance::from_taoandtao_to_raoperform uncheckedf64tou64casts that can panic on:
- Negative input values
- Values that overflow
u64::MAXwhen multiplied byRAO_PER_TAO- NaN or infinity
Since this is a public SDK being released to crates.io, consider adding validation or using saturating conversions to prevent panics in user code.
🔎 Suggested fix with validation
pub fn from_tao(tao: f64) -> Self { + let tao = tao.max(0.0); // Clamp negative to zero let rao = (tao * RAO_PER_TAO as f64) as u64; Self { rao } }pub fn tao_to_rao(tao: f64) -> u64 { + let tao = tao.max(0.0); // Clamp negative to zero (tao * RAO_PER_TAO as f64) as u64 }Alternatively, consider returning
Result<Self, Error>to explicitly handle invalid inputs.Also applies to: 287-289
🧹 Nitpick comments (1)
bittensor-rs/src/extrinsics/weights.rs (1)
40-50: Consider usingBittensorErrorinstead of&'static strfor error handling.The signature change from
SelftoResult<Self, &'static str>is a breaking change (appropriate for an initial release), but the error type is inconsistent with the rest of the codebase. For consistency and better error handling, consider returningResult<Self, BittensorError>instead. This would allow for more descriptive error messages and align with other functions likeverify_bittensor_signaturethat returnBittensorError.Additionally, the doc comment doesn't document the error case. It should mention that an error is returned when UIDs and weights have different lengths.
🔎 Recommended refactor using BittensorError
/// Create new weights params /// + /// # Errors + /// + /// Returns an error if the UIDs and weights vectors have different lengths. + /// /// # Example /// /// ``` /// use bittensor_rs::extrinsics::WeightsParams; /// /// let params = WeightsParams::new(1, vec![0, 1, 2], vec![100, 200, 300]).unwrap(); /// assert_eq!(params.netuid, 1); /// assert_eq!(params.uids.len(), 3); /// ``` - pub fn new(netuid: u16, uids: Vec<u16>, weights: Vec<u16>) -> Result<Self, &'static str> { + pub fn new(netuid: u16, uids: Vec<u16>, weights: Vec<u16>) -> Result<Self, BittensorError> { if uids.len() != weights.len() { - return Err("UIDs and weights must have the same length"); + return Err(BittensorError::ConfigError { + field: "weights".to_string(), + message: format!("UIDs and weights must have the same length: got {} UIDs and {} weights", uids.len(), weights.len()), + }); } Ok(Self { netuid, uids, weights, version_key: 0, }) }
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (23)
bittensor-rs/examples/test_axon_discovery.rsbittensor-rs/src/config.rsbittensor-rs/src/connect/mod.rsbittensor-rs/src/extrinsics/children.rsbittensor-rs/src/extrinsics/mod.rsbittensor-rs/src/extrinsics/registration.rsbittensor-rs/src/extrinsics/response.rsbittensor-rs/src/extrinsics/root.rsbittensor-rs/src/extrinsics/staking.rsbittensor-rs/src/extrinsics/subnet.rsbittensor-rs/src/extrinsics/transfer.rsbittensor-rs/src/extrinsics/weights.rsbittensor-rs/src/lib.rsbittensor-rs/src/queries/account.rsbittensor-rs/src/queries/metagraph.rsbittensor-rs/src/queries/mod.rsbittensor-rs/src/service.rsbittensor-rs/src/types/account.rsbittensor-rs/src/types/balance.rsbittensor-rs/src/types/hotkey.rsbittensor-rs/src/utils.rsbittensor-rs/src/wallet/mod.rsbittensor-rs/src/wallet/signer.rs
✅ Files skipped from review due to trivial changes (7)
- bittensor-rs/src/types/hotkey.rs
- bittensor-rs/src/extrinsics/registration.rs
- bittensor-rs/src/wallet/signer.rs
- bittensor-rs/src/config.rs
- bittensor-rs/src/extrinsics/transfer.rs
- bittensor-rs/src/queries/metagraph.rs
- bittensor-rs/src/extrinsics/response.rs
🚧 Files skipped from review as they are similar to previous changes (3)
- bittensor-rs/src/service.rs
- bittensor-rs/src/connect/mod.rs
- bittensor-rs/examples/test_axon_discovery.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Test
- GitHub Check: Coverage
🔇 Additional comments (17)
bittensor-rs/src/extrinsics/subnet.rs (1)
42-42: LGTM! Documentation import path updated correctly.The import path change from
bittensortobittensor_rscorrectly reflects the crate naming convention for the crates.io release. The documentation example remains accurate and functional.bittensor-rs/src/extrinsics/children.rs (1)
34-34: LGTM! Documentation updated to reflect correct crate name.The import path in the documentation example has been correctly updated to
bittensor_rs, ensuring users can reference accurate examples when using the SDK.bittensor-rs/src/extrinsics/root.rs (1)
38-38: Documentation import path correctly updated.The import path in the code example has been properly updated from
bittensor::extrinsicstobittensor_rs::extrinsicson line 38, aligning with the crate renaming for this initial SDK release. A search of the codebase confirms no remaining old-style imports in documentation comments and consistent application of the new crate path throughout.bittensor-rs/src/types/account.rs (1)
15-15: LGTM! Documentation paths updated correctly.The documentation examples have been updated to use the correct crate path
bittensor_rs::typesfor the crates.io release.Also applies to: 32-32
bittensor-rs/src/types/balance.rs (1)
23-23: LGTM! Comprehensive documentation path updates.All documentation examples have been correctly updated to use
bittensor_rs::typesfor the crates.io release. The examples are well-written and cover the API surface thoroughly.Also applies to: 45-45, 60-60, 74-74, 89-89, 103-103, 117-117, 131-131, 149-149, 167-167, 183-183, 282-282, 296-296
bittensor-rs/src/utils.rs (1)
38-38: LGTM! Documentation paths updated correctly.The documentation examples have been properly updated to reflect the new crate path
bittensor_rs::.Also applies to: 115-116
bittensor-rs/src/lib.rs (1)
14-14: LGTM! Quick Start example updated correctly.The documentation correctly references the new crate path.
bittensor-rs/src/wallet/mod.rs (2)
9-9: LGTM! Documentation updated consistently.All documentation examples have been properly updated to use the
bittensor_rs::crate path.Also applies to: 43-43, 48-48, 94-94, 97-97, 115-115, 120-120, 164-166, 193-193, 197-197, 233-233, 275-277, 305-307, 321-323, 336-338, 364-366
442-442: LGTM! Test adjustments are appropriate.Using
.unwrap()onWallet::create_randomin tests is acceptable sincecreate_randomreturns aResultand test failures are expected to panic.Also applies to: 452-452, 462-462, 491-491, 498-498, 505-505, 515-515
bittensor-rs/src/extrinsics/staking.rs (1)
35-35: LGTM! Documentation examples updated correctly.The documentation has been properly updated to use the
bittensor_rs::crate path, and the examples now use theignoreattribute which is appropriate for code that requires real infrastructure.Also applies to: 78-90
bittensor-rs/src/extrinsics/weights.rs (2)
276-280: LGTM! Tests properly updated for the new constructor signature.All test call sites correctly handle the
Resultreturn type with.unwrap(), which is appropriate for test code.Also applies to: 285-289, 293-300
160-168: LGTM! Documentation example updated correctly.The example properly demonstrates the new constructor signature with
.unwrap()and uses the correctbittensor_rs::crate path.bittensor-rs/src/extrinsics/mod.rs (2)
1-16: Well-structured module documentation!The reorganized documentation with categorized table format clearly presents all available extrinsic functions, making the API surface easy to understand.
68-68: LGTM:transfer_allproperly exported.The addition of
transfer_allto the public exports is consistent with the documentation and expands the transfer functionality appropriately.bittensor-rs/src/queries/account.rs (1)
27-27: Documentation import path correctly updated.The example now references the correct crate name
bittensor_rs::queries::get_balance, aligning with the crate renaming in this PR.bittensor-rs/src/queries/mod.rs (2)
1-11: Improved documentation structure and clarity.The module documentation has been enhanced with a clearer title, structured overview of available query types, and better organization. This improves discoverability for users of the SDK.
32-45: Module structure and exports look correct.The module declarations and public re-exports are well organized, providing a clean public API surface for the Chain Queries functionality.
| //! let params = WeightsParams { | ||
| //! netuid: 1, | ||
| //! uids: vec![0, 1, 2], | ||
| //! weights: vec![100, 200, 300], | ||
| //! version_key: 0, | ||
| //! }; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find the file containing WeightsParams definition
fd -t f -e rs | xargs grep -l "struct WeightsParams" | head -5Repository: one-covenant/bittensor-rs
Length of output: 107
🏁 Script executed:
#!/bin/bash
# Search for WeightsParams struct definition
rg "struct WeightsParams" -A 15 -B 2Repository: one-covenant/bittensor-rs
Length of output: 1179
🏁 Script executed:
#!/bin/bash
# Search for WeightsParams::new constructor
rg "impl.*WeightsParams" -A 20 | head -50Repository: one-covenant/bittensor-rs
Length of output: 2934
🏁 Script executed:
#!/bin/bash
# Read the example code in mod.rs around lines 17-44
sed -n '17,44p' bittensor-rs/src/extrinsics/mod.rsRepository: one-covenant/bittensor-rs
Length of output: 962
Use WeightsParams::new() constructor instead of direct struct construction.
The example constructs WeightsParams directly as a struct literal, but the WeightsParams::new() constructor returns a Result and validates that uids and weights have matching lengths. Direct construction bypasses this validation. Update the example to use the constructor pattern: WeightsParams::new(1, vec![0, 1, 2], vec![100, 200, 300]).unwrap() (which also automatically sets version_key: 0, eliminating the need to specify it manually).
🤖 Prompt for AI Agents
In bittensor-rs/src/extrinsics/mod.rs around lines 28 to 33, the example
constructs WeightsParams directly which bypasses validation; replace the struct
literal with the constructor call WeightsParams::new(netuid, uids,
weights).unwrap() (e.g., WeightsParams::new(1, vec![0,1,2],
vec![100,200,300]).unwrap()) so the lengths of uids and weights are validated
and version_key is set automatically.
| //! ```rust,ignore | ||
| //! use bittensor_rs::queries::{get_metagraph, get_balance, get_neuron}; | ||
| //! | ||
| //! async fn example(client: &subxt::OnlineClient<subxt::PolkadotConfig>, account_id: &subxt::config::polkadot::AccountId32) -> Result<(), Box<dyn std::error::Error>> { | ||
| //! // Get metagraph for subnet 1 | ||
| //! let metagraph = get_metagraph(client, 1).await?; | ||
| //! | ||
| //! // Check account balance | ||
| //! let balance = get_balance(client, account_id).await?; | ||
| //! | ||
| //! // Get specific neuron by UID | ||
| //! let neuron = get_neuron(client, 1, 0).await?; | ||
| //! Ok(()) | ||
| //! } | ||
| //! ``` |
There was a problem hiding this comment.
Fix type mismatch in documentation example.
Line 22 calls get_balance(client, account_id) where account_id is typed as &subxt::config::polkadot::AccountId32, but the get_balance function signature (from account.rs line 38) expects address: &str.
This example will not compile due to the type mismatch.
🔎 Proposed fix
Option 1: Use a string address directly:
-//! async fn example(client: &subxt::OnlineClient<subxt::PolkadotConfig>, account_id: &subxt::config::polkadot::AccountId32) -> Result<(), Box<dyn std::error::Error>> {
+//! async fn example(client: &subxt::OnlineClient<subxt::PolkadotConfig>) -> Result<(), Box<dyn std::error::Error>> {
//! // Get metagraph for subnet 1
//! let metagraph = get_metagraph(client, 1).await?;
//!
//! // Check account balance
-//! let balance = get_balance(client, account_id).await?;
+//! let balance = get_balance(client, "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY").await?;
//!
//! // Get specific neuron by UID
//! let neuron = get_neuron(client, 1, 0).await?;Option 2: Convert AccountId32 to SS58 string (if demonstrating AccountId usage is important):
+//! use subxt::ext::sp_core::crypto::Ss58Codec;
+//!
//! async fn example(client: &subxt::OnlineClient<subxt::PolkadotConfig>, account_id: &subxt::config::polkadot::AccountId32) -> Result<(), Box<dyn std::error::Error>> {
//! // Get metagraph for subnet 1
//! let metagraph = get_metagraph(client, 1).await?;
//!
//! // Check account balance
-//! let balance = get_balance(client, account_id).await?;
+//! let balance = get_balance(client, &account_id.to_ss58check()).await?;
//!
//! // Get specific neuron by UID
//! let neuron = get_neuron(client, 1, 0).await?;
Summary by CodeRabbit
New Features
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.