main
only changed error handling hereuse balance::{recover_wallet_state, EXTENDED_PRIVATE_KEY, WALLET_NAME}; fn main() { // Replace unwrap() with proper error handling let wallet_state = match recover_wallet_state(EXTENDED_PRIVATE_KEY) { Ok(state) => state, Err(e) => { eprintln!("Failed to recover wallet state: {:?}", e); std::process::exit(1); } }; let balance = wallet_state.balance(); println!("{} {:.8}", WALLET_NAME, balance); }
Leave a Comment