pub fn select_wallet_address(api_key: &String) -> String {
    let address_list = get_wallet_addresses(api_key);
    if address_list.len() == 1 {
        return address_list[0].clone();
    }

    let mut n = 0;
    for address in &address_list {
        n += 1;
        println!("{}. {}", n, address);
    }
    println!("Which address would you like to select?");
    let mut input = String::new();
    if let Ok(_) = std::io::stdin().read_line(&mut input){
        if let Ok(input_n) = input.trim().parse::<usize>(){
            if input_n > address_list.len() || input_n < 1 {
                println!("Please select an address within the range.");
                return select_wallet_address(api_key);
            }
            return address_list[input_n-1].clone();

        }
    }
    return select_wallet_address(api_key);
}
/// Gets list of addresses and asks the user to select one
Gets list of addresses and asks the user to select one
Gets list of addresses and asks the user to select one
pub fn select_wallet_address(api_key: &String) -> String {
    let address_list = get_wallet_addresses(api_key);
    if address_list.len() == 1 {
        return address_list[0].clone();
    }
    let mut n = 0;
    for address in &address_list {
        n += 1;
        println!("{}. {}", n, address);
    }
    println!("Which address would you like to select?");
    let mut input = String::new();
    if let Ok(_) = std::io::stdin().read_line(&mut input){
        if let Ok(input_n) = input.trim().parse::<usize>(){
            if input_n > address_list.len() || input_n < 1 {
                println!("Please select an address within the range.");
                return select_wallet_address(api_key);
            }
            return address_list[input_n-1].clone();
        }
    }
    return select_wallet_address(api_key);
}
pub fn select_wallet_address ( api_key : & String ) -> String { let address_list = get_wallet_addresses ( api_key ) ; if address_list . len ( ) == 1 { return address_list [ 0 ] . clone ( ) ; } let mut n = 0 ; for address in & address_list { n += 1 ; println ! ( " " n address ) ; } println ! ( " " ) ; let mut input = String :: new ( ) ; if let Ok ( _ ) = std :: io :: stdin ( ) . read_line ( & mut input ) { if let Ok ( input_n ) = input . trim ( ) . parse :: < usize > ( ) { if input_n > address_list . len ( ) || input_n < 1 { println ! ( " " ) ; return select_wallet_address ( api_key ) ; } return address_list [ input_n - 1 ] . clone ( ) ; } } return select_wallet_address ( api_key ) ; }
Gets list of addresses and asks the user to select one
Gets list of addresses and asks the user to select one
api_key
&String
api_key
&String