fn create_wallet()

in projects/web3/eth_wallet/ta/src/main.rs [70:84]


fn create_wallet(_input: &proto::CreateWalletInput) -> Result<proto::CreateWalletOutput> {
    let wallet = Wallet::new()?;
    let wallet_id = wallet.get_id();
    let mnemonic = wallet.get_mnemonic()?;
    dbg_println!("[+] Wallet ID: {:?}", wallet_id);

    let secure_object: Vec<u8> = wallet.try_into()?;
    save_in_secure_storage(wallet_id.as_bytes(), &secure_object)?;
    dbg_println!("[+] Wallet saved in secure storage");

    Ok(proto::CreateWalletOutput {
        wallet_id,
        mnemonic,
    })
}