Paper wallet for Hush, which you can use with no internet access while wearing a tinfoil hat inside of a Faraday cage. https://hush.is
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.8 KiB

extern crate clap;
extern crate zecpaperlib;
use clap::{Arg, App};
5 years ago
use zecpaperlib::paper::*;
use zecpaperlib::pdf;
fn main() {
let matches = App::new("zecpaperwaller")
.version("1.0")
.about("A command line Zcash Sapling paper wallet generator")
.arg(Arg::with_name("testnet")
.short("t")
.long("testnet")
5 years ago
.help("Generate Testnet addresses"))
.arg(Arg::with_name("format")
.short("f")
.long("format")
5 years ago
.help("What format to generate the output in")
.takes_value(true)
.value_name("FORMAT")
5 years ago
.possible_values(&["png", "pdf", "json"])
.default_value("json"))
.arg(Arg::with_name("output")
.short("o")
.long("output")
.index(1)
.help("Name of output file."))
.arg(Arg::with_name("num_addresses")
.short("n")
.long("num_addresses")
.help("Number of addresses to generate")
.takes_value(true)
.default_value("1")
.validator(|i:String| match i.parse::<i32>() {
Ok(_) => return Ok(()),
Err(_) => return Err(format!("Number of addresses '{}' is not a number", i))
}))
.get_matches();
5 years ago
let testnet: bool = matches.is_present("testnet");
if !testnet {
eprint!("Mainnet addresses are not supported yet. Please re-run with --testnet\n");
5 years ago
return;
}
let num_addresses = matches.value_of("num_addresses").unwrap().parse::<u32>().unwrap();
let addresses = generate_wallet(testnet, num_addresses);
5 years ago
println!("{}", addresses);
pdf::save_to_pdf(&addresses, "test_working.pdf");
}