gemgen 0.3.0

CLI address generator for Gem
use gemblockchain::{account::PrivateKeyAccount, seed};

pub struct Address {
    pub seed: String,
    pub address: String,
    pub public_key: String,
    pub private_key: String,
}

pub fn generate(chain_id: u8) -> Address {
    let phrase = seed::generate_phrase();
    let account = PrivateKeyAccount::from_seed(&phrase);

    Address {
        seed: phrase,
        address: account.public_key().to_address(chain_id).to_string(),
        public_key: account.public_key().to_string(),
        private_key: account.to_string(),
    }
}