1use cosmwasm_std::{Addr, Uint128};
2use schemars::JsonSchema;
3use serde::{Deserialize, Serialize};
4
5use crate::{Admins, ConfigMsg, ExtendedFlowSchedule, FlowType, FlowTypeConfigMsg};
6
7#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
8#[serde(rename_all = "snake_case")]
9pub enum QueryMsg {
10 Config {},
11 PendingConfig {},
12 Flow {
13 id: u64,
14 },
15 FlowList {
16 start_after: Option<u64>,
17 limit: Option<u32>,
18 sort_asc: Option<bool>,
19 },
20 FlowMakerList {
21 maker: Addr,
22 start_after: Option<u64>,
23 limit: Option<u32>,
24 sort_asc: Option<bool>,
25 },
26 FlowTakerList {
27 taker: Addr,
28 start_after: Option<u64>,
29 limit: Option<u32>,
30 sort_asc: Option<bool>,
31 },
32 FlowDenomList {
33 denom: String,
34 start_after: Option<u64>,
35 limit: Option<u32>,
36 sort_asc: Option<bool>,
37 },
38 FlowTemplate {
39 id: u64,
40 },
41 FlowTemplateList {
42 start_after: Option<u64>,
43 limit: Option<u32>,
44 sort_asc: Option<bool>,
45 },
46 FlowTemplateMakerList {
47 maker: Addr,
48 start_after: Option<u64>,
49 limit: Option<u32>,
50 sort_asc: Option<bool>,
51 },
52 Claimable {
53 id: u64,
54 },
55 Statistics {
57 stats_key: String,
58 stats_key_type: String,
59 height: Option<u64>,
60 },
61 StatisticsList {
63 stats_key: Option<String>,
64 start_after: Option<(String, String)>,
65 limit: Option<u32>,
66 sort_asc: Option<bool>,
67 },
68}
69
70#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
71pub struct ConfigResponse {
72 pub admins: Admins,
73 pub flow_type_config: Vec<FlowTypeConfigMsg>,
74}
75
76#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
77pub struct PendingConfigResponse {
78 pub current_config: ConfigMsg,
79 pub pending_config: Option<ConfigMsg>,
80}
81
82#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
83pub struct ExtendedFlowResponse {
84 pub id: u64,
85 pub flow_type: FlowType,
86 pub maker: Addr,
87 pub taker: Addr,
88 pub denom: String,
89 pub identifier: Option<String>,
90 pub genesis_time: u64,
91 pub schedules: Vec<ExtendedFlowSchedule>,
92 pub last_claim_time: u64,
93}
94
95#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
96pub struct ClaimableAmountResponse {
97 pub id: u64,
98 pub flow_type: FlowType,
99 pub denom: String,
100 pub taker: Addr,
101 pub claimable_amount: Uint128,
102}
103
104#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema, Debug)]
105pub struct StatisticsResponse {
106 pub stats_key: String,
107 pub stats_key_type: String,
108 pub stats_value: Option<Uint128>,
109}