1use crate::dto::prelude::*;
2
3#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
8pub enum AppCommand {
9 SetStatus(AppStatus),
10 SetCyclesFundingEnabled(bool),
11}
12
13#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
18pub enum AppCommandResponse {
19 Status(SetStateResponse<AppStatus>),
20 CyclesFundingEnabled(SetStateResponse<bool>),
21}
22
23#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
28pub struct SetStateResponse<T> {
29 pub previous: T,
30 pub current: T,
31 pub changed: bool,
32}
33
34#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
39pub enum AppStatus {
40 Active,
41 Readonly,
42 Stopped,
43}
44
45#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
50pub enum AppMode {
51 Enabled,
52 Readonly,
53 Disabled,
54}
55
56#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
61pub struct AppStateInput {
62 pub mode: AppMode,
63 pub cycles_funding_enabled: bool,
64}
65
66#[derive(CandidType, Deserialize)]
71pub struct AppStateResponse {
72 pub mode: AppMode,
73 pub cycles_funding_enabled: bool,
74}
75
76#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq)]
81pub struct SubnetRootPublicKeyInput {
82 pub public_key_sec1: Vec<u8>,
83 pub key_name: String,
84 pub key_hash: [u8; 32],
85}
86
87#[derive(CandidType, Clone, Debug, Default, Deserialize, Eq, PartialEq)]
92pub struct SubnetAuthStateInput {
93 pub delegated_root_public_key: Option<SubnetRootPublicKeyInput>,
94}
95
96#[derive(CandidType, Clone, Debug, Default, Deserialize, Eq, PartialEq)]
101pub struct SubnetStateInput {
102 pub auth: SubnetAuthStateInput,
103}
104
105#[derive(CandidType, Clone, Debug, Default, Deserialize, Eq, PartialEq)]
110pub struct SubnetStateResponse {
111 pub auth: SubnetAuthStateInput,
112}
113
114#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq)]
119pub struct BootstrapStatusResponse {
120 pub ready: bool,
121 pub phase: String,
122 pub last_error: Option<String>,
123}