#![deny(missing_docs)]
#![deny(clippy::pedantic)]
mod cache;
mod clients;
mod crypto;
mod error;
mod gql;
mod rues;
mod store;
mod wallet;
pub mod currency;
pub mod dat;
pub mod gas;
pub use dusk_core::stake::EPOCH;
pub use error::Error;
pub use gql::{BlockData, BlockTransaction, GraphQL};
pub use rues::HttpClient as RuesHttpClient;
pub use wallet::{
Address, DecodedNote, Profile, SecureWalletFile, Wallet, WalletPath,
};
use currency::Dusk;
pub const MAX_FUNCTION_NAME_SIZE: usize = 64;
pub const MAX_CONVERTIBLE: Dusk = Dusk::MAX;
pub const MIN_CONVERTIBLE: Dusk = Dusk::new(1);
pub const MAX_PROFILES: usize = get_max_profiles();
pub const IV_SIZE: usize = 12;
pub const SALT_SIZE: usize = 32;
pub const PBKDF2_ROUNDS: u32 = 10_000;
const DEFAULT_MAX_PROFILES: usize = 2;
const fn get_max_profiles() -> usize {
match option_env!("WALLET_MAX_PROFILES") {
Some(v) => match konst::primitive::parse_usize(v) {
Ok(e) if e > 255 => {
panic!("WALLET_MAX_PROFILES must be lower or equal to 255")
}
Ok(e) if e > 0 => e,
_ => panic!("Invalid WALLET_MAX_PROFILES"),
},
None => DEFAULT_MAX_PROFILES,
}
}