cosmwasm_std/query/
ibc.rs1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4use crate::ibc::IbcChannel;
5use crate::prelude::*;
6
7#[non_exhaustive]
11#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
12#[serde(rename_all = "snake_case")]
13pub enum IbcQuery {
14 PortId {},
18 #[deprecated = "Returns a potentially unbound number of results. If you think you have a valid usecase, please open an issue."]
23 ListChannels { port_id: Option<String> },
24 Channel {
30 channel_id: String,
31 port_id: Option<String>,
32 },
33 #[cfg(feature = "cosmwasm_2_2")]
39 FeeEnabledChannel {
40 port_id: Option<String>,
41 channel_id: String,
42 },
43}
44
45#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
46#[non_exhaustive]
47pub struct PortIdResponse {
48 pub port_id: String,
49}
50
51impl_response_constructor!(PortIdResponse, port_id: String);
52
53#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
54#[non_exhaustive]
55pub struct ListChannelsResponse {
56 pub channels: Vec<IbcChannel>,
57}
58
59impl_response_constructor!(ListChannelsResponse, channels: Vec<IbcChannel>);
60
61#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
62#[non_exhaustive]
63pub struct ChannelResponse {
64 pub channel: Option<IbcChannel>,
65}
66
67impl_response_constructor!(ChannelResponse, channel: Option<IbcChannel>);
68
69#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
70#[non_exhaustive]
71pub struct FeeEnabledChannelResponse {
72 pub fee_enabled: bool,
73}
74
75impl_response_constructor!(FeeEnabledChannelResponse, fee_enabled: bool);