Skip to main content

quantus_cli/
lib.rs

1//! # Quantus CLI Library
2//!
3//! This library provides the core functionality for interacting with the Quantus Network.
4//! It can be used as a dependency in other Rust projects that need to interact with
5//! the Quantus blockchain.
6
7pub mod chain;
8pub mod cli;
9pub mod config;
10pub mod error;
11pub mod log;
12pub mod subsquid;
13pub mod wallet;
14pub mod wormhole_lib;
15
16// Re-export commonly used types and functions
17pub use error::{QuantusError as Error, Result};
18
19// Re-export chain client and config
20pub use chain::client::{ChainConfig, QuantusClient};
21
22// Re-export dilithium crypto
23pub use qp_dilithium_crypto;
24
25// Re-export commonly used types from sp_core and sp_runtime
26pub use sp_core::crypto::AccountId32;
27pub use sp_runtime::MultiAddress;
28
29// Re-export transfer functions for library usage
30pub use cli::send::{
31	batch_transfer, format_balance_with_symbol, get_balance, transfer, transfer_with_nonce,
32};
33
34// Re-export multisig functions for library usage
35pub use cli::multisig::{
36	approve_dissolve_multisig, approve_proposal, cancel_proposal, create_multisig,
37	get_multisig_info, get_proposal_info, list_proposals, parse_amount as parse_multisig_amount,
38	predict_multisig_address, propose_custom, propose_transfer, MultisigInfo, ProposalInfo,
39	ProposalStatus,
40};
41
42// Re-export wormhole library functions for SDK usage
43pub use wormhole_lib::{
44	compute_leaf_hash, compute_nullifier, compute_output_amount, compute_storage_key,
45	compute_wormhole_address, generate_proof as generate_wormhole_proof, quantize_amount,
46	ProofGenerationInput, ProofGenerationOutput, TransferProofData, TransferProofKey,
47	WormholeLibError, NATIVE_ASSET_ID, SCALE_DOWN_FACTOR, VOLUME_FEE_BPS,
48};
49
50/// Library version
51pub const VERSION: &str = env!("CARGO_PKG_VERSION");
52
53/// Library name
54pub const NAME: &str = env!("CARGO_PKG_NAME");
55
56/// Get the library version
57pub fn version() -> &'static str {
58	VERSION
59}
60
61/// Get the library name
62pub fn name() -> &'static str {
63	NAME
64}
65
66#[cfg(test)]
67mod tests {
68	use super::*;
69
70	#[test]
71	fn test_version() {
72		assert!(!version().is_empty());
73	}
74
75	#[test]
76	fn test_name() {
77		assert_eq!(name(), "quantus-cli");
78	}
79}