main
only changed error handling hereunknown
rust
9 months ago
486 B
13
Indexable
use 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);
}Editor is loading...
Leave a Comment