summaryrefslogtreecommitdiff
path: root/impls/monero.rs/example/src/main.rs
blob: 099c6d409311c71a9bb278fef8de12131caa8ba0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use monero_rust::{network, WalletError, WalletManager};

fn main() -> Result<(), WalletError> {
    let wallet_manager = WalletManager::new(None)?;

    let wallet = wallet_manager.create_wallet(
        "wallet_name",
        "password",
        "English",
        network::MAINNET,
    )?;

    println!("Wallet created successfully.");

    match wallet.get_seed("") {
        Ok(seed) => println!("Seed: {}", seed),
        Err(e) => eprintln!("Failed to get seed: {:?}", e),
    }

    match wallet.get_address(0, 0) {
        Ok(address) => println!("Primary address: {}", address),
        Err(e) => eprintln!("Failed to get address: {:?}", e),
    }

    Ok(())
}