quantus-cli 1.3.2

Command line interface and library for interacting with the Quantus Network
//! # Quantus CLI Library
//!
//! This library provides the core functionality for interacting with the Quantus Network.
//! It can be used as a dependency in other Rust projects that need to interact with
//! the Quantus blockchain.

pub mod bins;
pub mod chain;
pub mod cli;
pub mod collect_rewards_lib;
pub mod config;
pub mod error;
pub mod log;
pub mod subsquid;
pub mod wallet;
pub mod wormhole_lib;

// Re-export commonly used types and functions
pub use error::{QuantusError as Error, Result};

// Re-export chain client and config
pub use chain::client::{ChainConfig, QuantusClient};

// Re-export dilithium crypto
pub use qp_dilithium_crypto;

// Re-export commonly used types from sp_core and sp_runtime
pub use sp_core::crypto::AccountId32;
pub use sp_runtime::MultiAddress;

// Re-export transfer functions for library usage
pub use cli::send::{
	batch_transfer, format_balance_with_symbol, get_balance, transfer, transfer_with_nonce,
};

// Re-export multisig functions for library usage
pub use cli::multisig::{
	approve_dissolve_multisig, approve_proposal, cancel_proposal, create_multisig,
	get_multisig_info, get_proposal_info, list_proposals, parse_amount as parse_multisig_amount,
	predict_multisig_address, propose_custom, propose_transfer, MultisigInfo, ProposalInfo,
	ProposalStatus,
};

// Re-export wormhole library functions for SDK usage
pub use wormhole_lib::{
	compute_nullifier, compute_output_amount, compute_wormhole_address,
	generate_proof as generate_wormhole_proof, quantize_amount, ProofGenerationInput,
	ProofGenerationOutput, WormholeLibError, NATIVE_ASSET_ID, SCALE_DOWN_FACTOR, VOLUME_FEE_BPS,
};

// Re-export collect rewards library for SDK usage
pub use collect_rewards_lib::{
	collect_rewards, query_pending_transfers, query_pending_transfers_for_address,
	CollectRewardsConfig, CollectRewardsError, CollectRewardsResult, NoOpProgress, PendingTransfer,
	ProgressCallback, QueryPendingTransfersResult, WithdrawalBatch,
};

/// Library version
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

/// Library name
pub const NAME: &str = env!("CARGO_PKG_NAME");

/// Get the library version
pub fn version() -> &'static str {
	VERSION
}

/// Get the library name
pub fn name() -> &'static str {
	NAME
}

#[cfg(test)]
mod tests {
	use super::*;

	#[test]
	fn test_version() {
		assert!(!version().is_empty());
	}

	#[test]
	fn test_name() {
		assert_eq!(name(), "quantus-cli");
	}
}