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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
mod address;
mod query;
mod stake_address;
mod transaction;

pub use address::Address;
pub use query::Query;
pub use stake_address::StakeAddress;
use std::process::Command;
pub use transaction::Transaction;

pub struct Root {
    command: Command,
}

impl Root {
    pub fn new(command: Command) -> Self {
        Self { command }
    }

    pub fn query(mut self) -> Query {
        self.command.arg("query");
        query::Query::new(self.command)
    }

    pub fn address(mut self) -> Address {
        self.command.arg("address");
        address::Address::new(self.command)
    }

    pub fn stake_address(mut self) -> StakeAddress {
        self.command.arg("stake-address");
        stake_address::StakeAddress::new(self.command)
    }

    pub fn transaction(mut self) -> Transaction {
        self.command.arg("transaction");
        transaction::Transaction::new(self.command)
    }
}