niko_trust_gui/examples/smoke.rs
Niko Marmeladkov 6278321873
niko_trust_gui: TCE protocol client with iced GUI
- Byte-exact TCE codec (encoder/decoder, canonical numbers, vectors-tested)
- Ed25519 identities with bech32m trust1… addresses
- Relay client: challenge/auth handshake, request feed, responses,
  transparent re-auth on 401
- iced GUI (Material-dark, Solana-style palette): tab shell, approval
  prompts with native toasts on Linux, address book, history, settings,
  password change
- Portable single-file vault (identity + book + history + settings)
- Live 2FA roundtrip examples (send_2fa, await_2fa)
2026-08-22 23:20:41 +03:00

32 lines
No EOL
1 KiB
Rust

use std::time::Duration;
use niko_trust_gui::autostart::Autostart;
use niko_trust_gui::notify::{show, ApprovalNotification};
fn main() {
println!("interactive_supported = {}", niko_trust_gui::notify::interactive_supported());
let handle = show(ApprovalNotification {
sender: "trust1qz9g...jya75".to_string(),
action: "login".to_string(),
message: "Approve 2FA login to mail.example.com".to_string(),
});
let outcome = handle.wait_timeout(Duration::from_secs(5));
println!("outcome = {outcome:?}");
let exe = std::env::current_exe().unwrap();
match Autostart::new(&exe) {
Ok(a) => {
println!(
"autostart app={} path={:?}",
niko_trust_gui::autostart::APP_NAME,
exe
);
match a.is_enabled() {
Ok(enabled) => println!("is_enabled = {enabled}"),
Err(e) => println!("is_enabled error: {e}"),
}
}
Err(e) => println!("autostart build failed: {e}"),
}
}