quantus_cli/cli/
address_format.rs

1/// Address formatting utilities for consistent SS58 encoding
2///
3/// This module provides unified functions for formatting addresses in the Quantus
4/// SS58 format (version 189). Since the default SS58 version is set to 189 in main.rs,
5/// most conversions can use the simpler to_ss58check() method.
6use sp_core::crypto::Ss58Codec;
7
8/// Trait for converting AccountId32 to Quantus SS58 format
9pub trait QuantusSS58 {
10	fn to_quantus_ss58(&self) -> String;
11}
12
13impl QuantusSS58 for sp_core::crypto::AccountId32 {
14	fn to_quantus_ss58(&self) -> String {
15		self.to_ss58check()
16	}
17}
18
19impl QuantusSS58 for subxt::ext::subxt_core::utils::AccountId32 {
20	fn to_quantus_ss58(&self) -> String {
21		let bytes: [u8; 32] = *self.as_ref();
22		let sp_account_id = sp_core::crypto::AccountId32::from(bytes);
23		sp_account_id.to_ss58check()
24	}
25}