From 7d1bf00a967d8a96befee2b01d3274f2a6d2bce4 Mon Sep 17 00:00:00 2001 From: Supanat Potiwarakorn Date: Wed, 11 Oct 2023 16:10:28 +0700 Subject: [PATCH] add ibc types --- .gitmodules | 3 + dependencies/cometbft | 2 +- dependencies/ibc-go | 1 + .../src/types/ibc/applications/fee/mod.rs | 1 + .../src/types/ibc/applications/fee/v1.rs | 1010 +++++++++ .../interchain_accounts/controller/mod.rs | 1 + .../interchain_accounts/controller/v1.rs | 127 ++ .../interchain_accounts/host/mod.rs | 1 + .../interchain_accounts/host/v1.rs | 70 + .../applications/interchain_accounts/mod.rs | 3 + .../applications/interchain_accounts/v1.rs | 247 +++ .../src/types/ibc/applications/mod.rs | 3 + .../types/ibc/applications/transfer/mod.rs | 2 + .../src/types/ibc/applications/transfer/v1.rs | 397 ++++ .../src/types/ibc/applications/transfer/v2.rs | 33 + .../src/types/ibc/core/channel/mod.rs | 1 + .../src/types/ibc/core/channel/v1.rs | 1940 +++++++++++++++++ .../src/types/ibc/core/client/mod.rs | 1 + .../src/types/ibc/core/client/v1.rs | 972 +++++++++ .../src/types/ibc/core/commitment/mod.rs | 1 + .../src/types/ibc/core/commitment/v1.rs | 86 + .../src/types/ibc/core/connection/mod.rs | 1 + .../src/types/ibc/core/connection/v1.rs | 838 +++++++ .../osmosis-std/src/types/ibc/core/mod.rs | 5 + .../src/types/ibc/core/types/mod.rs | 1 + .../src/types/ibc/core/types/v1.rs | 25 + .../types/ibc/lightclients/localhost/mod.rs | 1 + .../types/ibc/lightclients/localhost/v1.rs | 24 + .../src/types/ibc/lightclients/mod.rs | 3 + .../types/ibc/lightclients/solomachine/mod.rs | 2 + .../types/ibc/lightclients/solomachine/v1.rs | 532 +++++ .../types/ibc/lightclients/solomachine/v2.rs | 528 +++++ .../types/ibc/lightclients/tendermint/mod.rs | 1 + .../types/ibc/lightclients/tendermint/v1.rs | 174 ++ packages/osmosis-std/src/types/ibc/mod.rs | 3 + packages/osmosis-std/src/types/mod.rs | 1 + packages/proto-build/src/main.rs | 16 +- 37 files changed, 7055 insertions(+), 2 deletions(-) create mode 160000 dependencies/ibc-go create mode 100644 packages/osmosis-std/src/types/ibc/applications/fee/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/applications/fee/v1.rs create mode 100644 packages/osmosis-std/src/types/ibc/applications/interchain_accounts/controller/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs create mode 100644 packages/osmosis-std/src/types/ibc/applications/interchain_accounts/host/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/applications/interchain_accounts/host/v1.rs create mode 100644 packages/osmosis-std/src/types/ibc/applications/interchain_accounts/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/applications/interchain_accounts/v1.rs create mode 100644 packages/osmosis-std/src/types/ibc/applications/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/applications/transfer/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/applications/transfer/v1.rs create mode 100644 packages/osmosis-std/src/types/ibc/applications/transfer/v2.rs create mode 100644 packages/osmosis-std/src/types/ibc/core/channel/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/core/channel/v1.rs create mode 100644 packages/osmosis-std/src/types/ibc/core/client/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/core/client/v1.rs create mode 100644 packages/osmosis-std/src/types/ibc/core/commitment/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/core/commitment/v1.rs create mode 100644 packages/osmosis-std/src/types/ibc/core/connection/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/core/connection/v1.rs create mode 100644 packages/osmosis-std/src/types/ibc/core/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/core/types/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/core/types/v1.rs create mode 100644 packages/osmosis-std/src/types/ibc/lightclients/localhost/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/lightclients/localhost/v1.rs create mode 100644 packages/osmosis-std/src/types/ibc/lightclients/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/lightclients/solomachine/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/lightclients/solomachine/v1.rs create mode 100644 packages/osmosis-std/src/types/ibc/lightclients/solomachine/v2.rs create mode 100644 packages/osmosis-std/src/types/ibc/lightclients/tendermint/mod.rs create mode 100644 packages/osmosis-std/src/types/ibc/lightclients/tendermint/v1.rs create mode 100644 packages/osmosis-std/src/types/ibc/mod.rs diff --git a/.gitmodules b/.gitmodules index 219dd7cf..808456f9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,3 +12,6 @@ [submodule "dependencies/cometbft"] path = dependencies/cometbft url = https://github.com/cometbft/cometbft.git +[submodule "dependencies/ibc-go"] + path = dependencies/ibc-go + url = https://github.com/cosmos/ibc-go.git diff --git a/dependencies/cometbft b/dependencies/cometbft index 485ef362..fe4894f4 160000 --- a/dependencies/cometbft +++ b/dependencies/cometbft @@ -1 +1 @@ -Subproject commit 485ef362187a4496aed606b3ee7940e6d9cde5b3 +Subproject commit fe4894f4482b49c9bfe93382a2409f26c6f3f712 diff --git a/dependencies/ibc-go b/dependencies/ibc-go new file mode 160000 index 00000000..80bc4455 --- /dev/null +++ b/dependencies/ibc-go @@ -0,0 +1 @@ +Subproject commit 80bc445529817703754e57bb136cc8d6a4f00e12 diff --git a/packages/osmosis-std/src/types/ibc/applications/fee/mod.rs b/packages/osmosis-std/src/types/ibc/applications/fee/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/applications/fee/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/osmosis-std/src/types/ibc/applications/fee/v1.rs b/packages/osmosis-std/src/types/ibc/applications/fee/v1.rs new file mode 100644 index 00000000..a39cf267 --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/applications/fee/v1.rs @@ -0,0 +1,1010 @@ +use osmosis_std_derive::CosmwasmExt; +/// IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.IncentivizedAcknowledgement")] +pub struct IncentivizedAcknowledgement { + /// the underlying app acknowledgement bytes + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub app_acknowledgement: ::prost::alloc::vec::Vec, + /// the relayer address which submits the recv packet message + #[prost(string, tag = "2")] + pub forward_relayer_address: ::prost::alloc::string::String, + /// success flag of the base application callback + #[prost(bool, tag = "3")] + pub underlying_app_success: bool, +} +/// Fee defines the ICS29 receive, acknowledgement and timeout fees +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.Fee")] +pub struct Fee { + /// the packet receive fee + #[prost(message, repeated, tag = "1")] + pub recv_fee: ::prost::alloc::vec::Vec, + /// the packet acknowledgement fee + #[prost(message, repeated, tag = "2")] + pub ack_fee: ::prost::alloc::vec::Vec, + /// the packet timeout fee + #[prost(message, repeated, tag = "3")] + pub timeout_fee: + ::prost::alloc::vec::Vec, +} +/// PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.PacketFee")] +pub struct PacketFee { + /// fee encapsulates the recv, ack and timeout fees associated with an IBC packet + #[prost(message, optional, tag = "1")] + pub fee: ::core::option::Option, + /// the refund address for unspent fees + #[prost(string, tag = "2")] + pub refund_address: ::prost::alloc::string::String, + /// optional list of relayers permitted to receive fees + #[prost(string, repeated, tag = "3")] + pub relayers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// PacketFees contains a list of type PacketFee +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.PacketFees")] +pub struct PacketFees { + /// list of packet fees + #[prost(message, repeated, tag = "1")] + pub packet_fees: ::prost::alloc::vec::Vec, +} +/// IdentifiedPacketFees contains a list of type PacketFee and associated PacketId +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.IdentifiedPacketFees")] +pub struct IdentifiedPacketFees { + /// unique packet identifier comprised of the channel ID, port ID and sequence + #[prost(message, optional, tag = "1")] + #[serde(alias = "packetID")] + pub packet_id: ::core::option::Option, + /// list of packet fees + #[prost(message, repeated, tag = "2")] + pub packet_fees: ::prost::alloc::vec::Vec, +} +/// GenesisState defines the ICS29 fee middleware genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.GenesisState")] +pub struct GenesisState { + /// list of identified packet fees + #[prost(message, repeated, tag = "1")] + pub identified_fees: ::prost::alloc::vec::Vec, + /// list of fee enabled channels + #[prost(message, repeated, tag = "2")] + pub fee_enabled_channels: ::prost::alloc::vec::Vec, + /// list of registered payees + #[prost(message, repeated, tag = "3")] + pub registered_payees: ::prost::alloc::vec::Vec, + /// list of registered counterparty payees + #[prost(message, repeated, tag = "4")] + pub registered_counterparty_payees: ::prost::alloc::vec::Vec, + /// list of forward relayer addresses + #[prost(message, repeated, tag = "5")] + pub forward_relayers: ::prost::alloc::vec::Vec, +} +/// FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.FeeEnabledChannel")] +pub struct FeeEnabledChannel { + /// unique port identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, +} +/// RegisteredPayee contains the relayer address and payee address for a specific channel +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.RegisteredPayee")] +pub struct RegisteredPayee { + /// unique channel identifier + #[prost(string, tag = "1")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// the relayer address + #[prost(string, tag = "2")] + pub relayer: ::prost::alloc::string::String, + /// the payee address + #[prost(string, tag = "3")] + pub payee: ::prost::alloc::string::String, +} +/// RegisteredCounterpartyPayee contains the relayer address and counterparty payee address for a specific channel (used +/// for recv fee distribution) +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.RegisteredCounterpartyPayee")] +pub struct RegisteredCounterpartyPayee { + /// unique channel identifier + #[prost(string, tag = "1")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// the relayer address + #[prost(string, tag = "2")] + pub relayer: ::prost::alloc::string::String, + /// the counterparty payee address + #[prost(string, tag = "3")] + pub counterparty_payee: ::prost::alloc::string::String, +} +/// ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.ForwardRelayerAddress")] +pub struct ForwardRelayerAddress { + /// the forward relayer address + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// unique packet identifer comprised of the channel ID, port ID and sequence + #[prost(message, optional, tag = "2")] + #[serde(alias = "packetID")] + pub packet_id: ::core::option::Option, +} +/// Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring +/// See ICS004: +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.Metadata")] +pub struct Metadata { + /// fee_version defines the ICS29 fee version + #[prost(string, tag = "1")] + pub fee_version: ::prost::alloc::string::String, + /// app_version defines the underlying application version, which may or may not be a JSON encoded bytestring + #[prost(string, tag = "2")] + pub app_version: ::prost::alloc::string::String, +} +/// QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryIncentivizedPacketsRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/IncentivizedPackets", + response_type = QueryIncentivizedPacketsResponse +)] +pub struct QueryIncentivizedPacketsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + /// block height at which to query + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub query_height: u64, +} +/// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryIncentivizedPacketsResponse")] +pub struct QueryIncentivizedPacketsResponse { + /// list of identified fees for incentivized packets + #[prost(message, repeated, tag = "1")] + pub incentivized_packets: ::prost::alloc::vec::Vec, +} +/// QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryIncentivizedPacketRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/IncentivizedPacket", + response_type = QueryIncentivizedPacketResponse +)] +pub struct QueryIncentivizedPacketRequest { + /// unique packet identifier comprised of channel ID, port ID and sequence + #[prost(message, optional, tag = "1")] + #[serde(alias = "packetID")] + pub packet_id: ::core::option::Option, + /// block height at which to query + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub query_height: u64, +} +/// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryIncentivizedPacketResponse")] +pub struct QueryIncentivizedPacketResponse { + /// the identified fees for the incentivized packet + #[prost(message, optional, tag = "1")] + pub incentivized_packet: ::core::option::Option, +} +/// QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets +/// for a specific channel +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/IncentivizedPacketsForChannel", + response_type = QueryIncentivizedPacketsForChannelResponse +)] +pub struct QueryIncentivizedPacketsForChannelRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + #[prost(string, tag = "2")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// Height to query at + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub query_height: u64, +} +/// QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse")] +pub struct QueryIncentivizedPacketsForChannelResponse { + /// Map of all incentivized_packets + #[prost(message, repeated, tag = "1")] + pub incentivized_packets: ::prost::alloc::vec::Vec, +} +/// QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryTotalRecvFeesRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/TotalRecvFees", + response_type = QueryTotalRecvFeesResponse +)] +pub struct QueryTotalRecvFeesRequest { + /// the packet identifier for the associated fees + #[prost(message, optional, tag = "1")] + #[serde(alias = "packetID")] + pub packet_id: ::core::option::Option, +} +/// QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryTotalRecvFeesResponse")] +pub struct QueryTotalRecvFeesResponse { + /// the total packet receive fees + #[prost(message, repeated, tag = "1")] + pub recv_fees: + ::prost::alloc::vec::Vec, +} +/// QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryTotalAckFeesRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/TotalAckFees", + response_type = QueryTotalAckFeesResponse +)] +pub struct QueryTotalAckFeesRequest { + /// the packet identifier for the associated fees + #[prost(message, optional, tag = "1")] + #[serde(alias = "packetID")] + pub packet_id: ::core::option::Option, +} +/// QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryTotalAckFeesResponse")] +pub struct QueryTotalAckFeesResponse { + /// the total packet acknowledgement fees + #[prost(message, repeated, tag = "1")] + pub ack_fees: ::prost::alloc::vec::Vec, +} +/// QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/TotalTimeoutFees", + response_type = QueryTotalTimeoutFeesResponse +)] +pub struct QueryTotalTimeoutFeesRequest { + /// the packet identifier for the associated fees + #[prost(message, optional, tag = "1")] + #[serde(alias = "packetID")] + pub packet_id: ::core::option::Option, +} +/// QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse")] +pub struct QueryTotalTimeoutFeesResponse { + /// the total packet timeout fees + #[prost(message, repeated, tag = "1")] + pub timeout_fees: + ::prost::alloc::vec::Vec, +} +/// QueryPayeeRequest defines the request type for the Payee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryPayeeRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/Payee", + response_type = QueryPayeeResponse +)] +pub struct QueryPayeeRequest { + /// unique channel identifier + #[prost(string, tag = "1")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// the relayer address to which the distribution address is registered + #[prost(string, tag = "2")] + pub relayer: ::prost::alloc::string::String, +} +/// QueryPayeeResponse defines the response type for the Payee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryPayeeResponse")] +pub struct QueryPayeeResponse { + /// the payee address to which packet fees are paid out + #[prost(string, tag = "1")] + pub payee_address: ::prost::alloc::string::String, +} +/// QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryCounterpartyPayeeRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/CounterpartyPayee", + response_type = QueryCounterpartyPayeeResponse +)] +pub struct QueryCounterpartyPayeeRequest { + /// unique channel identifier + #[prost(string, tag = "1")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// the relayer address to which the counterparty is registered + #[prost(string, tag = "2")] + pub relayer: ::prost::alloc::string::String, +} +/// QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryCounterpartyPayeeResponse")] +pub struct QueryCounterpartyPayeeResponse { + /// the counterparty payee address used to compensate forward relaying + #[prost(string, tag = "1")] + pub counterparty_payee: ::prost::alloc::string::String, +} +/// QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/FeeEnabledChannels", + response_type = QueryFeeEnabledChannelsResponse +)] +pub struct QueryFeeEnabledChannelsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + /// block height at which to query + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub query_height: u64, +} +/// QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse")] +pub struct QueryFeeEnabledChannelsResponse { + /// list of fee enabled channels + #[prost(message, repeated, tag = "1")] + pub fee_enabled_channels: ::prost::alloc::vec::Vec, +} +/// QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryFeeEnabledChannelRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/FeeEnabledChannel", + response_type = QueryFeeEnabledChannelResponse +)] +pub struct QueryFeeEnabledChannelRequest { + /// unique port identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryFeeEnabledChannelResponse")] +pub struct QueryFeeEnabledChannelResponse { + /// boolean flag representing the fee enabled channel status + #[prost(bool, tag = "1")] + pub fee_enabled: bool, +} +/// MsgRegisterPayee defines the request type for the RegisterPayee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.MsgRegisterPayee")] +pub struct MsgRegisterPayee { + /// unique port identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// the relayer address + #[prost(string, tag = "3")] + pub relayer: ::prost::alloc::string::String, + /// the payee address + #[prost(string, tag = "4")] + pub payee: ::prost::alloc::string::String, +} +/// MsgRegisterPayeeResponse defines the response type for the RegisterPayee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.MsgRegisterPayeeResponse")] +pub struct MsgRegisterPayeeResponse {} +/// MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee")] +pub struct MsgRegisterCounterpartyPayee { + /// unique port identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// the relayer address + #[prost(string, tag = "3")] + pub relayer: ::prost::alloc::string::String, + /// the counterparty payee address + #[prost(string, tag = "4")] + pub counterparty_payee: ::prost::alloc::string::String, +} +/// MsgRegisterCounterpartyPayeeResponse defines the response type for the RegisterCounterpartyPayee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse")] +pub struct MsgRegisterCounterpartyPayeeResponse {} +/// MsgPayPacketFee defines the request type for the PayPacketFee rpc +/// This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be +/// paid for +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.MsgPayPacketFee")] +pub struct MsgPayPacketFee { + /// fee encapsulates the recv, ack and timeout fees associated with an IBC packet + #[prost(message, optional, tag = "1")] + pub fee: ::core::option::Option, + /// the source port unique identifier + #[prost(string, tag = "2")] + #[serde(alias = "source_portID")] + pub source_port_id: ::prost::alloc::string::String, + /// the source channel unique identifer + #[prost(string, tag = "3")] + #[serde(alias = "source_channelID")] + pub source_channel_id: ::prost::alloc::string::String, + /// account address to refund fee if necessary + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, + /// optional list of relayers permitted to the receive packet fees + #[prost(string, repeated, tag = "5")] + pub relayers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.MsgPayPacketFeeResponse")] +pub struct MsgPayPacketFeeResponse {} +/// MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc +/// This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.MsgPayPacketFeeAsync")] +pub struct MsgPayPacketFeeAsync { + /// unique packet identifier comprised of the channel ID, port ID and sequence + #[prost(message, optional, tag = "1")] + #[serde(alias = "packetID")] + pub packet_id: ::core::option::Option, + /// the packet fee associated with a particular IBC packet + #[prost(message, optional, tag = "2")] + pub packet_fee: ::core::option::Option, +} +/// MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse")] +pub struct MsgPayPacketFeeAsyncResponse {} +pub struct FeeQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> FeeQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn incentivized_packets( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + query_height: u64, + ) -> Result { + QueryIncentivizedPacketsRequest { + pagination, + query_height, + } + .query(self.querier) + } + pub fn incentivized_packet( + &self, + packet_id: ::core::option::Option, + query_height: u64, + ) -> Result { + QueryIncentivizedPacketRequest { + packet_id, + query_height, + } + .query(self.querier) + } + pub fn incentivized_packets_for_channel( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + query_height: u64, + ) -> Result { + QueryIncentivizedPacketsForChannelRequest { + pagination, + port_id, + channel_id, + query_height, + } + .query(self.querier) + } + pub fn total_recv_fees( + &self, + packet_id: ::core::option::Option, + ) -> Result { + QueryTotalRecvFeesRequest { packet_id }.query(self.querier) + } + pub fn total_ack_fees( + &self, + packet_id: ::core::option::Option, + ) -> Result { + QueryTotalAckFeesRequest { packet_id }.query(self.querier) + } + pub fn total_timeout_fees( + &self, + packet_id: ::core::option::Option, + ) -> Result { + QueryTotalTimeoutFeesRequest { packet_id }.query(self.querier) + } + pub fn payee( + &self, + channel_id: ::prost::alloc::string::String, + relayer: ::prost::alloc::string::String, + ) -> Result { + QueryPayeeRequest { + channel_id, + relayer, + } + .query(self.querier) + } + pub fn counterparty_payee( + &self, + channel_id: ::prost::alloc::string::String, + relayer: ::prost::alloc::string::String, + ) -> Result { + QueryCounterpartyPayeeRequest { + channel_id, + relayer, + } + .query(self.querier) + } + pub fn fee_enabled_channels( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + query_height: u64, + ) -> Result { + QueryFeeEnabledChannelsRequest { + pagination, + query_height, + } + .query(self.querier) + } + pub fn fee_enabled_channel( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + ) -> Result { + QueryFeeEnabledChannelRequest { + port_id, + channel_id, + } + .query(self.querier) + } +} diff --git a/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/controller/mod.rs b/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/controller/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/controller/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs b/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs new file mode 100644 index 00000000..85d0514e --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs @@ -0,0 +1,127 @@ +use osmosis_std_derive::CosmwasmExt; +/// Params defines the set of on-chain interchain accounts parameters. +/// The following parameters may be used to disable the controller submodule. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.controller.v1.Params")] +pub struct Params { + /// controller_enabled enables or disables the controller submodule. + #[prost(bool, tag = "1")] + pub controller_enabled: bool, +} +/// QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message( + type_url = "/ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest" +)] +#[proto_query( + path = "/ibc.applications.interchain_accounts.controller.v1.Query/InterchainAccount", + response_type = QueryInterchainAccountResponse +)] +pub struct QueryInterchainAccountRequest { + #[prost(string, tag = "1")] + pub owner: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(alias = "connectionID")] + pub connection_id: ::prost::alloc::string::String, +} +/// QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message( + type_url = "/ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse" +)] +pub struct QueryInterchainAccountResponse { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message( + type_url = "/ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest" +)] +#[proto_query( + path = "/ibc.applications.interchain_accounts.controller.v1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message( + type_url = "/ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse" +)] +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +pub struct ControllerQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> ControllerQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn interchain_account( + &self, + owner: ::prost::alloc::string::String, + connection_id: ::prost::alloc::string::String, + ) -> Result { + QueryInterchainAccountRequest { + owner, + connection_id, + } + .query(self.querier) + } + pub fn params(&self) -> Result { + QueryParamsRequest {}.query(self.querier) + } +} diff --git a/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/host/mod.rs b/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/host/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/host/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/host/v1.rs b/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/host/v1.rs new file mode 100644 index 00000000..18acd13d --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/host/v1.rs @@ -0,0 +1,70 @@ +use osmosis_std_derive::CosmwasmExt; +/// Params defines the set of on-chain interchain accounts parameters. +/// The following parameters may be used to disable the host submodule. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.host.v1.Params")] +pub struct Params { + /// host_enabled enables or disables the host submodule. + #[prost(bool, tag = "1")] + pub host_enabled: bool, + /// allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. + #[prost(string, repeated, tag = "2")] + pub allow_messages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.host.v1.QueryParamsRequest")] +#[proto_query( + path = "/ibc.applications.interchain_accounts.host.v1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.host.v1.QueryParamsResponse")] +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +pub struct HostQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> HostQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn params(&self) -> Result { + QueryParamsRequest {}.query(self.querier) + } +} diff --git a/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/mod.rs b/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/mod.rs new file mode 100644 index 00000000..6330aaee --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/mod.rs @@ -0,0 +1,3 @@ +pub mod controller; +pub mod host; +pub mod v1; diff --git a/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/v1.rs b/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/v1.rs new file mode 100644 index 00000000..d9e6eae2 --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/applications/interchain_accounts/v1.rs @@ -0,0 +1,247 @@ +use osmosis_std_derive::CosmwasmExt; +/// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.v1.InterchainAccount")] +pub struct InterchainAccount { + #[prost(message, optional, tag = "1")] + pub base_account: + ::core::option::Option, + #[prost(string, tag = "2")] + pub account_owner: ::prost::alloc::string::String, +} +/// GenesisState defines the interchain accounts genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.v1.GenesisState")] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub controller_genesis_state: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub host_genesis_state: ::core::option::Option, +} +/// ControllerGenesisState defines the interchain accounts controller genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.v1.ControllerGenesisState")] +pub struct ControllerGenesisState { + #[prost(message, repeated, tag = "1")] + pub active_channels: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub interchain_accounts: ::prost::alloc::vec::Vec, + #[prost(string, repeated, tag = "3")] + pub ports: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub params: ::core::option::Option, +} +/// HostGenesisState defines the interchain accounts host genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.v1.HostGenesisState")] +pub struct HostGenesisState { + #[prost(message, repeated, tag = "1")] + pub active_channels: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub interchain_accounts: ::prost::alloc::vec::Vec, + #[prost(string, tag = "3")] + pub port: ::prost::alloc::string::String, + #[prost(message, optional, tag = "4")] + pub params: ::core::option::Option, +} +/// ActiveChannel contains a connection ID, port ID and associated active channel ID +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.v1.ActiveChannel")] +pub struct ActiveChannel { + #[prost(string, tag = "1")] + #[serde(alias = "connectionID")] + pub connection_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, +} +/// RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount")] +pub struct RegisteredInterchainAccount { + #[prost(string, tag = "1")] + #[serde(alias = "connectionID")] + pub connection_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub account_address: ::prost::alloc::string::String, +} +/// Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring +/// See ICS004: +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.v1.Metadata")] +pub struct Metadata { + /// version defines the ICS27 protocol version + #[prost(string, tag = "1")] + pub version: ::prost::alloc::string::String, + /// controller_connection_id is the connection identifier associated with the controller chain + #[prost(string, tag = "2")] + #[serde(alias = "controller_connectionID")] + pub controller_connection_id: ::prost::alloc::string::String, + /// host_connection_id is the connection identifier associated with the host chain + #[prost(string, tag = "3")] + #[serde(alias = "host_connectionID")] + pub host_connection_id: ::prost::alloc::string::String, + /// address defines the interchain account address to be fulfilled upon the OnChanOpenTry handshake step + /// NOTE: the address field is empty on the OnChanOpenInit handshake step + #[prost(string, tag = "4")] + pub address: ::prost::alloc::string::String, + /// encoding defines the supported codec format + #[prost(string, tag = "5")] + pub encoding: ::prost::alloc::string::String, + /// tx_type defines the type of transactions the interchain account can execute + #[prost(string, tag = "6")] + pub tx_type: ::prost::alloc::string::String, +} +/// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.v1.InterchainAccountPacketData")] +pub struct InterchainAccountPacketData { + #[prost(enumeration = "Type", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub r#type: i32, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + #[prost(string, tag = "3")] + pub memo: ::prost::alloc::string::String, +} +/// CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.v1.CosmosTx")] +pub struct CosmosTx { + #[prost(message, repeated, tag = "1")] + pub messages: ::prost::alloc::vec::Vec, +} +/// Type defines a classification of message issued from a controller chain to its associated interchain accounts +/// host +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum Type { + /// Default zero value enumeration + Unspecified = 0, + /// Execute a transaction on an interchain accounts host chain + ExecuteTx = 1, +} +impl Type { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Type::Unspecified => "TYPE_UNSPECIFIED", + Type::ExecuteTx => "TYPE_EXECUTE_TX", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "TYPE_EXECUTE_TX" => Some(Self::ExecuteTx), + _ => None, + } + } +} diff --git a/packages/osmosis-std/src/types/ibc/applications/mod.rs b/packages/osmosis-std/src/types/ibc/applications/mod.rs new file mode 100644 index 00000000..a56db2d8 --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/applications/mod.rs @@ -0,0 +1,3 @@ +pub mod fee; +pub mod interchain_accounts; +pub mod transfer; diff --git a/packages/osmosis-std/src/types/ibc/applications/transfer/mod.rs b/packages/osmosis-std/src/types/ibc/applications/transfer/mod.rs new file mode 100644 index 00000000..ae6adc7c --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/applications/transfer/mod.rs @@ -0,0 +1,2 @@ +pub mod v1; +pub mod v2; diff --git a/packages/osmosis-std/src/types/ibc/applications/transfer/v1.rs b/packages/osmosis-std/src/types/ibc/applications/transfer/v1.rs new file mode 100644 index 00000000..ea88646f --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/applications/transfer/v1.rs @@ -0,0 +1,397 @@ +use osmosis_std_derive::CosmwasmExt; +/// DenomTrace contains the base denomination for ICS20 fungible tokens and the +/// source tracing information path. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.DenomTrace")] +pub struct DenomTrace { + /// path defines the chain of port/channel identifiers used for tracing the + /// source of the fungible token. + #[prost(string, tag = "1")] + pub path: ::prost::alloc::string::String, + /// base denomination of the relayed fungible token. + #[prost(string, tag = "2")] + pub base_denom: ::prost::alloc::string::String, +} +/// Params defines the set of IBC transfer parameters. +/// NOTE: To prevent a single token from being transferred, set the +/// TransfersEnabled parameter to true and then set the bank module's SendEnabled +/// parameter for the denomination to false. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.Params")] +pub struct Params { + /// send_enabled enables or disables all cross-chain token transfers from this + /// chain. + #[prost(bool, tag = "1")] + pub send_enabled: bool, + /// receive_enabled enables or disables all cross-chain token transfers to this + /// chain. + #[prost(bool, tag = "2")] + pub receive_enabled: bool, +} +/// GenesisState defines the ibc-transfer genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.GenesisState")] +pub struct GenesisState { + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub denom_traces: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub params: ::core::option::Option, +} +/// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.QueryDenomTraceRequest")] +#[proto_query( + path = "/ibc.applications.transfer.v1.Query/DenomTrace", + response_type = QueryDenomTraceResponse +)] +pub struct QueryDenomTraceRequest { + /// hash (in hex format) or denom (full denom with ibc prefix) of the denomination trace information. + #[prost(string, tag = "1")] + pub hash: ::prost::alloc::string::String, +} +/// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.QueryDenomTraceResponse")] +pub struct QueryDenomTraceResponse { + /// denom_trace returns the requested denomination trace information. + #[prost(message, optional, tag = "1")] + pub denom_trace: ::core::option::Option, +} +/// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.QueryDenomTracesRequest")] +#[proto_query( + path = "/ibc.applications.transfer.v1.Query/DenomTraces", + response_type = QueryDenomTracesResponse +)] +pub struct QueryDenomTracesRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.QueryDenomTracesResponse")] +pub struct QueryDenomTracesResponse { + /// denom_traces returns all denominations trace information. + #[prost(message, repeated, tag = "1")] + pub denom_traces: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.QueryParamsRequest")] +#[proto_query( + path = "/ibc.applications.transfer.v1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.QueryParamsResponse")] +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryDenomHashRequest is the request type for the Query/DenomHash RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.QueryDenomHashRequest")] +#[proto_query( + path = "/ibc.applications.transfer.v1.Query/DenomHash", + response_type = QueryDenomHashResponse +)] +pub struct QueryDenomHashRequest { + /// The denomination trace (\[port_id]/[channel_id])+/[denom\] + #[prost(string, tag = "1")] + pub trace: ::prost::alloc::string::String, +} +/// QueryDenomHashResponse is the response type for the Query/DenomHash RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.QueryDenomHashResponse")] +pub struct QueryDenomHashResponse { + /// hash (in hex format) of the denomination trace information. + #[prost(string, tag = "1")] + pub hash: ::prost::alloc::string::String, +} +/// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.QueryEscrowAddressRequest")] +#[proto_query( + path = "/ibc.applications.transfer.v1.Query/EscrowAddress", + response_type = QueryEscrowAddressResponse +)] +pub struct QueryEscrowAddressRequest { + /// unique port identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.QueryEscrowAddressResponse")] +pub struct QueryEscrowAddressResponse { + /// the escrow account address + #[prost(string, tag = "1")] + pub escrow_address: ::prost::alloc::string::String, +} +/// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between +/// ICS20 enabled chains. See ICS Spec here: +/// +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.MsgTransfer")] +pub struct MsgTransfer { + /// the port on which the packet will be sent + #[prost(string, tag = "1")] + pub source_port: ::prost::alloc::string::String, + /// the channel by which the packet will be sent + #[prost(string, tag = "2")] + pub source_channel: ::prost::alloc::string::String, + /// the tokens to be transferred + #[prost(message, optional, tag = "3")] + pub token: ::core::option::Option, + /// the sender address + #[prost(string, tag = "4")] + pub sender: ::prost::alloc::string::String, + /// the recipient address on the destination chain + #[prost(string, tag = "5")] + pub receiver: ::prost::alloc::string::String, + /// Timeout height relative to the current block height. + /// The timeout is disabled when set to 0. + #[prost(message, optional, tag = "6")] + pub timeout_height: ::core::option::Option, + /// Timeout timestamp in absolute nanoseconds since unix epoch. + /// The timeout is disabled when set to 0. + #[prost(uint64, tag = "7")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timeout_timestamp: u64, + /// optional memo + #[prost(string, tag = "8")] + pub memo: ::prost::alloc::string::String, +} +/// MsgTransferResponse defines the Msg/Transfer response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.MsgTransferResponse")] +pub struct MsgTransferResponse { + /// sequence number of the transfer packet sent + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +pub struct TransferQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> TransferQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn denom_trace( + &self, + hash: ::prost::alloc::string::String, + ) -> Result { + QueryDenomTraceRequest { hash }.query(self.querier) + } + pub fn denom_traces( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryDenomTracesRequest { pagination }.query(self.querier) + } + pub fn params(&self) -> Result { + QueryParamsRequest {}.query(self.querier) + } + pub fn denom_hash( + &self, + trace: ::prost::alloc::string::String, + ) -> Result { + QueryDenomHashRequest { trace }.query(self.querier) + } + pub fn escrow_address( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + ) -> Result { + QueryEscrowAddressRequest { + port_id, + channel_id, + } + .query(self.querier) + } +} diff --git a/packages/osmosis-std/src/types/ibc/applications/transfer/v2.rs b/packages/osmosis-std/src/types/ibc/applications/transfer/v2.rs new file mode 100644 index 00000000..d2d78f92 --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/applications/transfer/v2.rs @@ -0,0 +1,33 @@ +use osmosis_std_derive::CosmwasmExt; +/// FungibleTokenPacketData defines a struct for the packet payload +/// See FungibleTokenPacketData spec: +/// +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v2.FungibleTokenPacketData")] +pub struct FungibleTokenPacketData { + /// the token denomination to be transferred + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// the token amount to be transferred + #[prost(string, tag = "2")] + pub amount: ::prost::alloc::string::String, + /// the sender address + #[prost(string, tag = "3")] + pub sender: ::prost::alloc::string::String, + /// the recipient address on the destination chain + #[prost(string, tag = "4")] + pub receiver: ::prost::alloc::string::String, + /// optional memo + #[prost(string, tag = "5")] + pub memo: ::prost::alloc::string::String, +} diff --git a/packages/osmosis-std/src/types/ibc/core/channel/mod.rs b/packages/osmosis-std/src/types/ibc/core/channel/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/core/channel/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/osmosis-std/src/types/ibc/core/channel/v1.rs b/packages/osmosis-std/src/types/ibc/core/channel/v1.rs new file mode 100644 index 00000000..c7dc72e1 --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/core/channel/v1.rs @@ -0,0 +1,1940 @@ +use osmosis_std_derive::CosmwasmExt; +/// Channel defines pipeline for exactly-once packet delivery between specific +/// modules on separate blockchains, which has at least one end capable of +/// sending packets and one end capable of receiving packets. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.Channel")] +pub struct Channel { + /// current state of the channel end + #[prost(enumeration = "State", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub state: i32, + /// whether the channel is ordered or unordered + #[prost(enumeration = "Order", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub ordering: i32, + /// counterparty channel end + #[prost(message, optional, tag = "3")] + pub counterparty: ::core::option::Option, + /// list of connection identifiers, in order, along which packets sent on + /// this channel will travel + #[prost(string, repeated, tag = "4")] + pub connection_hops: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// opaque channel version, which is agreed upon during the handshake + #[prost(string, tag = "5")] + pub version: ::prost::alloc::string::String, +} +/// IdentifiedChannel defines a channel with additional port and channel +/// identifier fields. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.IdentifiedChannel")] +pub struct IdentifiedChannel { + /// current state of the channel end + #[prost(enumeration = "State", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub state: i32, + /// whether the channel is ordered or unordered + #[prost(enumeration = "Order", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub ordering: i32, + /// counterparty channel end + #[prost(message, optional, tag = "3")] + pub counterparty: ::core::option::Option, + /// list of connection identifiers, in order, along which packets sent on + /// this channel will travel + #[prost(string, repeated, tag = "4")] + pub connection_hops: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// opaque channel version, which is agreed upon during the handshake + #[prost(string, tag = "5")] + pub version: ::prost::alloc::string::String, + /// port identifier + #[prost(string, tag = "6")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel identifier + #[prost(string, tag = "7")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, +} +/// Counterparty defines a channel end counterparty +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.Counterparty")] +pub struct Counterparty { + /// port on the counterparty chain which owns the other end of the channel. + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel end on the counterparty chain + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, +} +/// Packet defines a type that carries data across different chains through IBC +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.Packet")] +pub struct Packet { + /// number corresponds to the order of sends and receives, where a Packet + /// with an earlier sequence number must be sent and received before a Packet + /// with a later sequence number. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + /// identifies the port on the sending chain. + #[prost(string, tag = "2")] + pub source_port: ::prost::alloc::string::String, + /// identifies the channel end on the sending chain. + #[prost(string, tag = "3")] + pub source_channel: ::prost::alloc::string::String, + /// identifies the port on the receiving chain. + #[prost(string, tag = "4")] + pub destination_port: ::prost::alloc::string::String, + /// identifies the channel end on the receiving chain. + #[prost(string, tag = "5")] + pub destination_channel: ::prost::alloc::string::String, + /// actual opaque bytes transferred directly to the application module + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + /// block height after which the packet times out + #[prost(message, optional, tag = "7")] + pub timeout_height: ::core::option::Option, + /// block timestamp (in nanoseconds) after which the packet times out + #[prost(uint64, tag = "8")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timeout_timestamp: u64, +} +/// PacketState defines the generic type necessary to retrieve and store +/// packet commitments, acknowledgements, and receipts. +/// Caller is responsible for knowing the context necessary to interpret this +/// state as a commitment, acknowledgement, or a receipt. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.PacketState")] +pub struct PacketState { + /// channel port identifier. + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier. + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence. + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + /// embedded data that represents packet state. + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// PacketId is an identifer for a unique Packet +/// Source chains refer to packets by source port/channel +/// Destination chains refer to packets by destination port/channel +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.PacketId")] +pub struct PacketId { + /// channel port identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +/// Acknowledgement is the recommended acknowledgement format to be used by +/// app-specific protocols. +/// NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental +/// conflicts with other protobuf message formats used for acknowledgements. +/// The first byte of any message with this format will be the non-ASCII values +/// `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: +/// +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.Acknowledgement")] +pub struct Acknowledgement { + /// response contains either a result or an error and must be non-empty + #[prost(oneof = "acknowledgement::Response", tags = "21, 22")] + pub response: ::core::option::Option, +} +/// Nested message and enum types in `Acknowledgement`. +pub mod acknowledgement { + use osmosis_std_derive::CosmwasmExt; + /// response contains either a result or an error and must be non-empty + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Response { + #[prost(bytes, tag = "21")] + Result(::prost::alloc::vec::Vec), + #[prost(string, tag = "22")] + Error(::prost::alloc::string::String), + } +} +/// State defines if a channel is in one of the following states: +/// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum State { + /// Default State + UninitializedUnspecified = 0, + /// A channel has just started the opening handshake. + Init = 1, + /// A channel has acknowledged the handshake step on the counterparty chain. + Tryopen = 2, + /// A channel has completed the handshake. Open channels are + /// ready to send and receive packets. + Open = 3, + /// A channel has been closed and can no longer be used to send or receive + /// packets. + Closed = 4, +} +impl State { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + State::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED", + State::Init => "STATE_INIT", + State::Tryopen => "STATE_TRYOPEN", + State::Open => "STATE_OPEN", + State::Closed => "STATE_CLOSED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "STATE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), + "STATE_INIT" => Some(Self::Init), + "STATE_TRYOPEN" => Some(Self::Tryopen), + "STATE_OPEN" => Some(Self::Open), + "STATE_CLOSED" => Some(Self::Closed), + _ => None, + } + } +} +/// Order defines if a channel is ORDERED or UNORDERED +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum Order { + /// zero-value for channel ordering + NoneUnspecified = 0, + /// packets can be delivered in any order, which may differ from the order in + /// which they were sent. + Unordered = 1, + /// packets are delivered exactly in the order which they were sent + Ordered = 2, +} +impl Order { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Order::NoneUnspecified => "ORDER_NONE_UNSPECIFIED", + Order::Unordered => "ORDER_UNORDERED", + Order::Ordered => "ORDER_ORDERED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ORDER_NONE_UNSPECIFIED" => Some(Self::NoneUnspecified), + "ORDER_UNORDERED" => Some(Self::Unordered), + "ORDER_ORDERED" => Some(Self::Ordered), + _ => None, + } + } +} +/// GenesisState defines the ibc channel submodule's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.GenesisState")] +pub struct GenesisState { + #[prost(message, repeated, tag = "1")] + pub channels: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub acknowledgements: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub commitments: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub receipts: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "5")] + pub send_sequences: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "6")] + pub recv_sequences: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "7")] + pub ack_sequences: ::prost::alloc::vec::Vec, + /// the sequence for the next generated channel identifier + #[prost(uint64, tag = "8")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_channel_sequence: u64, +} +/// PacketSequence defines the genesis type necessary to retrieve and store +/// next send and receive sequences. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.PacketSequence")] +pub struct PacketSequence { + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +/// QueryChannelRequest is the request type for the Query/Channel RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryChannelRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/Channel", + response_type = QueryChannelResponse +)] +pub struct QueryChannelRequest { + /// port unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryChannelResponse is the response type for the Query/Channel RPC method. +/// Besides the Channel end, it includes a proof and the height from which the +/// proof was retrieved. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryChannelResponse")] +pub struct QueryChannelResponse { + /// channel associated with the request identifiers + #[prost(message, optional, tag = "1")] + pub channel: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryChannelsRequest is the request type for the Query/Channels RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryChannelsRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/Channels", + response_type = QueryChannelsResponse +)] +pub struct QueryChannelsRequest { + /// pagination request + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryChannelsResponse is the response type for the Query/Channels RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryChannelsResponse")] +pub struct QueryChannelsResponse { + /// list of stored channels of the chain. + #[prost(message, repeated, tag = "1")] + pub channels: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, + /// query block height + #[prost(message, optional, tag = "3")] + pub height: ::core::option::Option, +} +/// QueryConnectionChannelsRequest is the request type for the +/// Query/QueryConnectionChannels RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryConnectionChannelsRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/ConnectionChannels", + response_type = QueryConnectionChannelsResponse +)] +pub struct QueryConnectionChannelsRequest { + /// connection unique identifier + #[prost(string, tag = "1")] + pub connection: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryConnectionChannelsResponse is the Response type for the +/// Query/QueryConnectionChannels RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryConnectionChannelsResponse")] +pub struct QueryConnectionChannelsResponse { + /// list of channels associated with a connection. + #[prost(message, repeated, tag = "1")] + pub channels: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, + /// query block height + #[prost(message, optional, tag = "3")] + pub height: ::core::option::Option, +} +/// QueryChannelClientStateRequest is the request type for the Query/ClientState +/// RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryChannelClientStateRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/ChannelClientState", + response_type = QueryChannelClientStateResponse +)] +pub struct QueryChannelClientStateRequest { + /// port unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryChannelClientStateResponse is the Response type for the +/// Query/QueryChannelClientState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryChannelClientStateResponse")] +pub struct QueryChannelClientStateResponse { + /// client state associated with the channel + #[prost(message, optional, tag = "1")] + pub identified_client_state: + ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryChannelConsensusStateRequest is the request type for the +/// Query/ConsensusState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryChannelConsensusStateRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/ChannelConsensusState", + response_type = QueryChannelConsensusStateResponse +)] +pub struct QueryChannelConsensusStateRequest { + /// port unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// revision number of the consensus state + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_number: u64, + /// revision height of the consensus state + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_height: u64, +} +/// QueryChannelClientStateResponse is the Response type for the +/// Query/QueryChannelClientState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryChannelConsensusStateResponse")] +pub struct QueryChannelConsensusStateResponse { + /// consensus state associated with the channel + #[prost(message, optional, tag = "1")] + pub consensus_state: ::core::option::Option, + /// client ID associated with the consensus state + #[prost(string, tag = "2")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, +} +/// QueryPacketCommitmentRequest is the request type for the +/// Query/PacketCommitment RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryPacketCommitmentRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/PacketCommitment", + response_type = QueryPacketCommitmentResponse +)] +pub struct QueryPacketCommitmentRequest { + /// port unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +/// QueryPacketCommitmentResponse defines the client query response for a packet +/// which also includes a proof and the height from which the proof was +/// retrieved +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryPacketCommitmentResponse")] +pub struct QueryPacketCommitmentResponse { + /// packet associated with the request fields + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub commitment: ::prost::alloc::vec::Vec, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryPacketCommitmentsRequest is the request type for the +/// Query/QueryPacketCommitments RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryPacketCommitmentsRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/PacketCommitments", + response_type = QueryPacketCommitmentsResponse +)] +pub struct QueryPacketCommitmentsRequest { + /// port unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryPacketCommitmentsResponse is the request type for the +/// Query/QueryPacketCommitments RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryPacketCommitmentsResponse")] +pub struct QueryPacketCommitmentsResponse { + #[prost(message, repeated, tag = "1")] + pub commitments: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, + /// query block height + #[prost(message, optional, tag = "3")] + pub height: ::core::option::Option, +} +/// QueryPacketReceiptRequest is the request type for the +/// Query/PacketReceipt RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryPacketReceiptRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/PacketReceipt", + response_type = QueryPacketReceiptResponse +)] +pub struct QueryPacketReceiptRequest { + /// port unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +/// QueryPacketReceiptResponse defines the client query response for a packet +/// receipt which also includes a proof, and the height from which the proof was +/// retrieved +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryPacketReceiptResponse")] +pub struct QueryPacketReceiptResponse { + /// success flag for if receipt exists + #[prost(bool, tag = "2")] + pub received: bool, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, +} +/// QueryPacketAcknowledgementRequest is the request type for the +/// Query/PacketAcknowledgement RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryPacketAcknowledgementRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/PacketAcknowledgement", + response_type = QueryPacketAcknowledgementResponse +)] +pub struct QueryPacketAcknowledgementRequest { + /// port unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +/// QueryPacketAcknowledgementResponse defines the client query response for a +/// packet which also includes a proof and the height from which the +/// proof was retrieved +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryPacketAcknowledgementResponse")] +pub struct QueryPacketAcknowledgementResponse { + /// packet associated with the request fields + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub acknowledgement: ::prost::alloc::vec::Vec, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryPacketAcknowledgementsRequest is the request type for the +/// Query/QueryPacketCommitments RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryPacketAcknowledgementsRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/PacketAcknowledgements", + response_type = QueryPacketAcknowledgementsResponse +)] +pub struct QueryPacketAcknowledgementsRequest { + /// port unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + /// list of packet sequences + #[prost(uint64, repeated, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub packet_commitment_sequences: ::prost::alloc::vec::Vec, +} +/// QueryPacketAcknowledgemetsResponse is the request type for the +/// Query/QueryPacketAcknowledgements RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryPacketAcknowledgementsResponse")] +pub struct QueryPacketAcknowledgementsResponse { + #[prost(message, repeated, tag = "1")] + pub acknowledgements: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, + /// query block height + #[prost(message, optional, tag = "3")] + pub height: ::core::option::Option, +} +/// QueryUnreceivedPacketsRequest is the request type for the +/// Query/UnreceivedPackets RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryUnreceivedPacketsRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/UnreceivedPackets", + response_type = QueryUnreceivedPacketsResponse +)] +pub struct QueryUnreceivedPacketsRequest { + /// port unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// list of packet sequences + #[prost(uint64, repeated, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub packet_commitment_sequences: ::prost::alloc::vec::Vec, +} +/// QueryUnreceivedPacketsResponse is the response type for the +/// Query/UnreceivedPacketCommitments RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryUnreceivedPacketsResponse")] +pub struct QueryUnreceivedPacketsResponse { + /// list of unreceived packet sequences + #[prost(uint64, repeated, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub sequences: ::prost::alloc::vec::Vec, + /// query block height + #[prost(message, optional, tag = "2")] + pub height: ::core::option::Option, +} +/// QueryUnreceivedAcks is the request type for the +/// Query/UnreceivedAcks RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryUnreceivedAcksRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/UnreceivedAcks", + response_type = QueryUnreceivedAcksResponse +)] +pub struct QueryUnreceivedAcksRequest { + /// port unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + /// list of acknowledgement sequences + #[prost(uint64, repeated, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub packet_ack_sequences: ::prost::alloc::vec::Vec, +} +/// QueryUnreceivedAcksResponse is the response type for the +/// Query/UnreceivedAcks RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryUnreceivedAcksResponse")] +pub struct QueryUnreceivedAcksResponse { + /// list of unreceived acknowledgement sequences + #[prost(uint64, repeated, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub sequences: ::prost::alloc::vec::Vec, + /// query block height + #[prost(message, optional, tag = "2")] + pub height: ::core::option::Option, +} +/// QueryNextSequenceReceiveRequest is the request type for the +/// Query/QueryNextSequenceReceiveRequest RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryNextSequenceReceiveRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/NextSequenceReceive", + response_type = QueryNextSequenceReceiveResponse +)] +pub struct QueryNextSequenceReceiveRequest { + /// port unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, +} +/// QuerySequenceResponse is the request type for the +/// Query/QueryNextSequenceReceiveResponse RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryNextSequenceReceiveResponse")] +pub struct QueryNextSequenceReceiveResponse { + /// next sequence receive number + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_sequence_receive: u64, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It +/// is called by a relayer on Chain A. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelOpenInit")] +pub struct MsgChannelOpenInit { + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub channel: ::core::option::Option, + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelOpenInitResponse")] +pub struct MsgChannelOpenInitResponse { + #[prost(string, tag = "1")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub version: ::prost::alloc::string::String, +} +/// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +/// on Chain B. The version field within the Channel field has been deprecated. Its +/// value will be ignored by core IBC. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelOpenTry")] +pub struct MsgChannelOpenTry { + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + /// Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. + #[deprecated] + #[prost(string, tag = "2")] + #[serde(alias = "previous_channelID")] + pub previous_channel_id: ::prost::alloc::string::String, + /// NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. + #[prost(message, optional, tag = "3")] + pub channel: ::core::option::Option, + #[prost(string, tag = "4")] + pub counterparty_version: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_init: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "7")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelOpenTryResponse")] +pub struct MsgChannelOpenTryResponse { + #[prost(string, tag = "1")] + pub version: ::prost::alloc::string::String, +} +/// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge +/// the change of channel state to TRYOPEN on Chain B. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelOpenAck")] +pub struct MsgChannelOpenAck { + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + #[serde(alias = "counterparty_channelID")] + pub counterparty_channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub counterparty_version: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_try: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "7")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelOpenAckResponse")] +pub struct MsgChannelOpenAckResponse {} +/// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to +/// acknowledge the change of channel state to OPEN on Chain A. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelOpenConfirm")] +pub struct MsgChannelOpenConfirm { + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_ack: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response +/// type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse")] +pub struct MsgChannelOpenConfirmResponse {} +/// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A +/// to close a channel with Chain B. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelCloseInit")] +pub struct MsgChannelCloseInit { + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelCloseInitResponse")] +pub struct MsgChannelCloseInitResponse {} +/// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B +/// to acknowledge the change of channel state to CLOSED on Chain A. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelCloseConfirm")] +pub struct MsgChannelCloseConfirm { + #[prost(string, tag = "1")] + #[serde(alias = "portID")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(alias = "channelID")] + pub channel_id: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_init: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response +/// type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse")] +pub struct MsgChannelCloseConfirmResponse {} +/// MsgRecvPacket receives incoming IBC packet +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgRecvPacket")] +pub struct MsgRecvPacket { + #[prost(message, optional, tag = "1")] + pub packet: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_commitment: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, +} +/// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgRecvPacketResponse")] +pub struct MsgRecvPacketResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub result: i32, +} +/// MsgTimeout receives timed-out packet +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgTimeout")] +pub struct MsgTimeout { + #[prost(message, optional, tag = "1")] + pub packet: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_unreceived: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_sequence_recv: u64, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, +} +/// MsgTimeoutResponse defines the Msg/Timeout response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgTimeoutResponse")] +pub struct MsgTimeoutResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub result: i32, +} +/// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgTimeoutOnClose")] +pub struct MsgTimeoutOnClose { + #[prost(message, optional, tag = "1")] + pub packet: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_unreceived: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_close: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_sequence_recv: u64, + #[prost(string, tag = "6")] + pub signer: ::prost::alloc::string::String, +} +/// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse")] +pub struct MsgTimeoutOnCloseResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub result: i32, +} +/// MsgAcknowledgement receives incoming IBC acknowledgement +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgAcknowledgement")] +pub struct MsgAcknowledgement { + #[prost(message, optional, tag = "1")] + pub packet: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub acknowledgement: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_acked: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, +} +/// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgAcknowledgementResponse")] +pub struct MsgAcknowledgementResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub result: i32, +} +/// ResponseResultType defines the possible outcomes of the execution of a message +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum ResponseResultType { + /// Default zero value enumeration + Unspecified = 0, + /// The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + Noop = 1, + /// The message was executed successfully + Success = 2, +} +impl ResponseResultType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ResponseResultType::Unspecified => "RESPONSE_RESULT_TYPE_UNSPECIFIED", + ResponseResultType::Noop => "RESPONSE_RESULT_TYPE_NOOP", + ResponseResultType::Success => "RESPONSE_RESULT_TYPE_SUCCESS", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RESPONSE_RESULT_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "RESPONSE_RESULT_TYPE_NOOP" => Some(Self::Noop), + "RESPONSE_RESULT_TYPE_SUCCESS" => Some(Self::Success), + _ => None, + } + } +} +pub struct ChannelQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> ChannelQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn channel( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + ) -> Result { + QueryChannelRequest { + port_id, + channel_id, + } + .query(self.querier) + } + pub fn channels( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryChannelsRequest { pagination }.query(self.querier) + } + pub fn connection_channels( + &self, + connection: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryConnectionChannelsRequest { + connection, + pagination, + } + .query(self.querier) + } + pub fn channel_client_state( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + ) -> Result { + QueryChannelClientStateRequest { + port_id, + channel_id, + } + .query(self.querier) + } + pub fn channel_consensus_state( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + revision_number: u64, + revision_height: u64, + ) -> Result { + QueryChannelConsensusStateRequest { + port_id, + channel_id, + revision_number, + revision_height, + } + .query(self.querier) + } + pub fn packet_commitment( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + sequence: u64, + ) -> Result { + QueryPacketCommitmentRequest { + port_id, + channel_id, + sequence, + } + .query(self.querier) + } + pub fn packet_commitments( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryPacketCommitmentsRequest { + port_id, + channel_id, + pagination, + } + .query(self.querier) + } + pub fn packet_receipt( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + sequence: u64, + ) -> Result { + QueryPacketReceiptRequest { + port_id, + channel_id, + sequence, + } + .query(self.querier) + } + pub fn packet_acknowledgement( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + sequence: u64, + ) -> Result { + QueryPacketAcknowledgementRequest { + port_id, + channel_id, + sequence, + } + .query(self.querier) + } + pub fn packet_acknowledgements( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + packet_commitment_sequences: ::prost::alloc::vec::Vec, + ) -> Result { + QueryPacketAcknowledgementsRequest { + port_id, + channel_id, + pagination, + packet_commitment_sequences, + } + .query(self.querier) + } + pub fn unreceived_packets( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + packet_commitment_sequences: ::prost::alloc::vec::Vec, + ) -> Result { + QueryUnreceivedPacketsRequest { + port_id, + channel_id, + packet_commitment_sequences, + } + .query(self.querier) + } + pub fn unreceived_acks( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + packet_ack_sequences: ::prost::alloc::vec::Vec, + ) -> Result { + QueryUnreceivedAcksRequest { + port_id, + channel_id, + packet_ack_sequences, + } + .query(self.querier) + } + pub fn next_sequence_receive( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + ) -> Result { + QueryNextSequenceReceiveRequest { + port_id, + channel_id, + } + .query(self.querier) + } +} diff --git a/packages/osmosis-std/src/types/ibc/core/client/mod.rs b/packages/osmosis-std/src/types/ibc/core/client/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/core/client/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/osmosis-std/src/types/ibc/core/client/v1.rs b/packages/osmosis-std/src/types/ibc/core/client/v1.rs new file mode 100644 index 00000000..a151c015 --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/core/client/v1.rs @@ -0,0 +1,972 @@ +use osmosis_std_derive::CosmwasmExt; +/// IdentifiedClientState defines a client state with an additional client +/// identifier field. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.IdentifiedClientState")] +pub struct IdentifiedClientState { + /// client identifier + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// client state + #[prost(message, optional, tag = "2")] + pub client_state: ::core::option::Option, +} +/// ConsensusStateWithHeight defines a consensus state with an additional height +/// field. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.ConsensusStateWithHeight")] +pub struct ConsensusStateWithHeight { + /// consensus state height + #[prost(message, optional, tag = "1")] + pub height: ::core::option::Option, + /// consensus state + #[prost(message, optional, tag = "2")] + pub consensus_state: ::core::option::Option, +} +/// ClientConsensusStates defines all the stored consensus states for a given +/// client. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.ClientConsensusStates")] +pub struct ClientConsensusStates { + /// client identifier + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// consensus states and their heights associated with the client + #[prost(message, repeated, tag = "2")] + pub consensus_states: ::prost::alloc::vec::Vec, +} +/// ClientUpdateProposal is a governance proposal. If it passes, the substitute +/// client's latest consensus state is copied over to the subject client. The proposal +/// handler may fail if the subject and the substitute do not match in client and +/// chain parameters (with exception to latest height, frozen height, and chain-id). +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.ClientUpdateProposal")] +pub struct ClientUpdateProposal { + /// the title of the update proposal + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// the description of the proposal + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// the client identifier for the client to be updated if the proposal passes + #[prost(string, tag = "3")] + #[serde(alias = "subject_clientID")] + pub subject_client_id: ::prost::alloc::string::String, + /// the substitute client identifier for the client standing in for the subject + /// client + #[prost(string, tag = "4")] + #[serde(alias = "substitute_clientID")] + pub substitute_client_id: ::prost::alloc::string::String, +} +/// UpgradeProposal is a gov Content type for initiating an IBC breaking +/// upgrade. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.UpgradeProposal")] +pub struct UpgradeProposal { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub plan: ::core::option::Option, + /// An UpgradedClientState must be provided to perform an IBC breaking upgrade. + /// This will make the chain commit to the correct upgraded (self) client state + /// before the upgrade occurs, so that connecting chains can verify that the + /// new upgraded client is valid by verifying a proof on the previous version + /// of the chain. This will allow IBC connections to persist smoothly across + /// planned chain upgrades + #[prost(message, optional, tag = "4")] + pub upgraded_client_state: ::core::option::Option, +} +/// Height is a monotonically increasing data type +/// that can be compared against another Height for the purposes of updating and +/// freezing clients +/// +/// Normally the RevisionHeight is incremented at each height while keeping +/// RevisionNumber the same. However some consensus algorithms may choose to +/// reset the height in certain conditions e.g. hard forks, state-machine +/// breaking changes In these cases, the RevisionNumber is incremented so that +/// height continues to be monitonically increasing even as the RevisionHeight +/// gets reset +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.Height")] +pub struct Height { + /// the revision that the client is currently on + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_number: u64, + /// the height within the given revision + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_height: u64, +} +/// Params defines the set of IBC light client parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.Params")] +pub struct Params { + /// allowed_clients defines the list of allowed client state types. + #[prost(string, repeated, tag = "1")] + pub allowed_clients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// GenesisState defines the ibc client submodule's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.GenesisState")] +pub struct GenesisState { + /// client states with their corresponding identifiers + #[prost(message, repeated, tag = "1")] + pub clients: ::prost::alloc::vec::Vec, + /// consensus states from each client + #[prost(message, repeated, tag = "2")] + pub clients_consensus: ::prost::alloc::vec::Vec, + /// metadata from each client + #[prost(message, repeated, tag = "3")] + pub clients_metadata: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub params: ::core::option::Option, + /// create localhost on initialization + #[prost(bool, tag = "5")] + pub create_localhost: bool, + /// the sequence for the next generated client identifier + #[prost(uint64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_client_sequence: u64, +} +/// GenesisMetadata defines the genesis type for metadata that clients may return +/// with ExportMetadata +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.GenesisMetadata")] +pub struct GenesisMetadata { + /// store key of metadata without clientID-prefix + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + /// metadata value + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, +} +/// IdentifiedGenesisMetadata has the client metadata with the corresponding +/// client id. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.IdentifiedGenesisMetadata")] +pub struct IdentifiedGenesisMetadata { + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub client_metadata: ::prost::alloc::vec::Vec, +} +/// QueryClientStateRequest is the request type for the Query/ClientState RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryClientStateRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ClientState", + response_type = QueryClientStateResponse +)] +pub struct QueryClientStateRequest { + /// client state unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, +} +/// QueryClientStateResponse is the response type for the Query/ClientState RPC +/// method. Besides the client state, it includes a proof and the height from +/// which the proof was retrieved. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryClientStateResponse")] +pub struct QueryClientStateResponse { + /// client state associated with the request identifier + #[prost(message, optional, tag = "1")] + pub client_state: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryClientStatesRequest is the request type for the Query/ClientStates RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryClientStatesRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ClientStates", + response_type = QueryClientStatesResponse +)] +pub struct QueryClientStatesRequest { + /// pagination request + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryClientStatesResponse is the response type for the Query/ClientStates RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryClientStatesResponse")] +pub struct QueryClientStatesResponse { + /// list of stored ClientStates of the chain. + #[prost(message, repeated, tag = "1")] + pub client_states: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +/// QueryConsensusStateRequest is the request type for the Query/ConsensusState +/// RPC method. Besides the consensus state, it includes a proof and the height +/// from which the proof was retrieved. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryConsensusStateRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ConsensusState", + response_type = QueryConsensusStateResponse +)] +pub struct QueryConsensusStateRequest { + /// client identifier + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// consensus state revision number + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_number: u64, + /// consensus state revision height + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_height: u64, + /// latest_height overrrides the height field and queries the latest stored + /// ConsensusState + #[prost(bool, tag = "4")] + pub latest_height: bool, +} +/// QueryConsensusStateResponse is the response type for the Query/ConsensusState +/// RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryConsensusStateResponse")] +pub struct QueryConsensusStateResponse { + /// consensus state associated with the client identifier at the given height + #[prost(message, optional, tag = "1")] + pub consensus_state: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates +/// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryConsensusStatesRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ConsensusStates", + response_type = QueryConsensusStatesResponse +)] +pub struct QueryConsensusStatesRequest { + /// client identifier + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryConsensusStatesResponse is the response type for the +/// Query/ConsensusStates RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryConsensusStatesResponse")] +pub struct QueryConsensusStatesResponse { + /// consensus states associated with the identifier + #[prost(message, repeated, tag = "1")] + pub consensus_states: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +/// QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights +/// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryConsensusStateHeightsRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ConsensusStateHeights", + response_type = QueryConsensusStateHeightsResponse +)] +pub struct QueryConsensusStateHeightsRequest { + /// client identifier + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryConsensusStateHeightsResponse is the response type for the +/// Query/ConsensusStateHeights RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryConsensusStateHeightsResponse")] +pub struct QueryConsensusStateHeightsResponse { + /// consensus state heights + #[prost(message, repeated, tag = "1")] + pub consensus_state_heights: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +/// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryClientStatusRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ClientStatus", + response_type = QueryClientStatusResponse +)] +pub struct QueryClientStatusRequest { + /// client unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, +} +/// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC +/// method. It returns the current status of the IBC client. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryClientStatusResponse")] +pub struct QueryClientStatusResponse { + #[prost(string, tag = "1")] + pub status: ::prost::alloc::string::String, +} +/// QueryClientParamsRequest is the request type for the Query/ClientParams RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryClientParamsRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ClientParams", + response_type = QueryClientParamsResponse +)] +pub struct QueryClientParamsRequest {} +/// QueryClientParamsResponse is the response type for the Query/ClientParams RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryClientParamsResponse")] +pub struct QueryClientParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryUpgradedClientStateRequest is the request type for the +/// Query/UpgradedClientState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryUpgradedClientStateRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/UpgradedClientState", + response_type = QueryUpgradedClientStateResponse +)] +pub struct QueryUpgradedClientStateRequest {} +/// QueryUpgradedClientStateResponse is the response type for the +/// Query/UpgradedClientState RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryUpgradedClientStateResponse")] +pub struct QueryUpgradedClientStateResponse { + /// client state associated with the request identifier + #[prost(message, optional, tag = "1")] + pub upgraded_client_state: ::core::option::Option, +} +/// QueryUpgradedConsensusStateRequest is the request type for the +/// Query/UpgradedConsensusState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryUpgradedConsensusStateRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/UpgradedConsensusState", + response_type = QueryUpgradedConsensusStateResponse +)] +pub struct QueryUpgradedConsensusStateRequest {} +/// QueryUpgradedConsensusStateResponse is the response type for the +/// Query/UpgradedConsensusState RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse")] +pub struct QueryUpgradedConsensusStateResponse { + /// Consensus state associated with the request identifier + #[prost(message, optional, tag = "1")] + pub upgraded_consensus_state: ::core::option::Option, +} +/// MsgCreateClient defines a message to create an IBC client +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgCreateClient")] +pub struct MsgCreateClient { + /// light client state + #[prost(message, optional, tag = "1")] + pub client_state: ::core::option::Option, + /// consensus state associated with the client that corresponds to a given + /// height. + #[prost(message, optional, tag = "2")] + pub consensus_state: ::core::option::Option, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgCreateClientResponse defines the Msg/CreateClient response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgCreateClientResponse")] +pub struct MsgCreateClientResponse {} +/// MsgUpdateClient defines an sdk.Msg to update a IBC client state using +/// the given header. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgUpdateClient")] +pub struct MsgUpdateClient { + /// client unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// header to update the light client + #[prost(message, optional, tag = "2")] + pub header: ::core::option::Option, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgUpdateClientResponse")] +pub struct MsgUpdateClientResponse {} +/// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client +/// state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgUpgradeClient")] +pub struct MsgUpgradeClient { + /// client unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// upgraded client state + #[prost(message, optional, tag = "2")] + pub client_state: ::core::option::Option, + /// upgraded consensus state, only contains enough information to serve as a + /// basis of trust in update logic + #[prost(message, optional, tag = "3")] + pub consensus_state: ::core::option::Option, + /// proof that old chain committed to new client + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_upgrade_client: ::prost::alloc::vec::Vec, + /// proof that old chain committed to new consensus state + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_upgrade_consensus_state: ::prost::alloc::vec::Vec, + /// signer address + #[prost(string, tag = "6")] + pub signer: ::prost::alloc::string::String, +} +/// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgUpgradeClientResponse")] +pub struct MsgUpgradeClientResponse {} +/// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for +/// light client misbehaviour. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgSubmitMisbehaviour")] +pub struct MsgSubmitMisbehaviour { + /// client unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// misbehaviour used for freezing the light client + #[prost(message, optional, tag = "2")] + pub misbehaviour: ::core::option::Option, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response +/// type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse")] +pub struct MsgSubmitMisbehaviourResponse {} +pub struct ClientQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> ClientQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn client_state( + &self, + client_id: ::prost::alloc::string::String, + ) -> Result { + QueryClientStateRequest { client_id }.query(self.querier) + } + pub fn client_states( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryClientStatesRequest { pagination }.query(self.querier) + } + pub fn consensus_state( + &self, + client_id: ::prost::alloc::string::String, + revision_number: u64, + revision_height: u64, + latest_height: bool, + ) -> Result { + QueryConsensusStateRequest { + client_id, + revision_number, + revision_height, + latest_height, + } + .query(self.querier) + } + pub fn consensus_states( + &self, + client_id: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryConsensusStatesRequest { + client_id, + pagination, + } + .query(self.querier) + } + pub fn consensus_state_heights( + &self, + client_id: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryConsensusStateHeightsRequest { + client_id, + pagination, + } + .query(self.querier) + } + pub fn client_status( + &self, + client_id: ::prost::alloc::string::String, + ) -> Result { + QueryClientStatusRequest { client_id }.query(self.querier) + } + pub fn client_params(&self) -> Result { + QueryClientParamsRequest {}.query(self.querier) + } + pub fn upgraded_client_state( + &self, + ) -> Result { + QueryUpgradedClientStateRequest {}.query(self.querier) + } + pub fn upgraded_consensus_state( + &self, + ) -> Result { + QueryUpgradedConsensusStateRequest {}.query(self.querier) + } +} diff --git a/packages/osmosis-std/src/types/ibc/core/commitment/mod.rs b/packages/osmosis-std/src/types/ibc/core/commitment/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/core/commitment/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/osmosis-std/src/types/ibc/core/commitment/v1.rs b/packages/osmosis-std/src/types/ibc/core/commitment/v1.rs new file mode 100644 index 00000000..693eec3e --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/core/commitment/v1.rs @@ -0,0 +1,86 @@ +use osmosis_std_derive::CosmwasmExt; +/// MerkleRoot defines a merkle root hash. +/// In the Cosmos SDK, the AppHash of a block header becomes the root. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.commitment.v1.MerkleRoot")] +pub struct MerkleRoot { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, +} +/// MerklePrefix is merkle path prefixed to the key. +/// The constructed key from the Path and the key will be append(Path.KeyPath, +/// append(Path.KeyPrefix, key...)) +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.commitment.v1.MerklePrefix")] +pub struct MerklePrefix { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub key_prefix: ::prost::alloc::vec::Vec, +} +/// MerklePath is the path used to verify commitment proofs, which can be an +/// arbitrary structured object (defined by a commitment type). +/// MerklePath is represented from root-to-leaf +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.commitment.v1.MerklePath")] +pub struct MerklePath { + #[prost(string, repeated, tag = "1")] + pub key_path: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MerkleProof is a wrapper type over a chain of CommitmentProofs. +/// It demonstrates membership or non-membership for an element or set of +/// elements, verifiable in conjunction with a known commitment root. Proofs +/// should be succinct. +/// MerkleProofs are ordered from leaf-to-root +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.commitment.v1.MerkleProof")] +pub struct MerkleProof { + #[prost(message, repeated, tag = "1")] + pub proofs: ::prost::alloc::vec::Vec, +} diff --git a/packages/osmosis-std/src/types/ibc/core/connection/mod.rs b/packages/osmosis-std/src/types/ibc/core/connection/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/core/connection/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/osmosis-std/src/types/ibc/core/connection/v1.rs b/packages/osmosis-std/src/types/ibc/core/connection/v1.rs new file mode 100644 index 00000000..0ff3e5b6 --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/core/connection/v1.rs @@ -0,0 +1,838 @@ +use osmosis_std_derive::CosmwasmExt; +/// ConnectionEnd defines a stateful object on a chain connected to another +/// separate one. +/// NOTE: there must only be 2 defined ConnectionEnds to establish +/// a connection between two chains. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.ConnectionEnd")] +pub struct ConnectionEnd { + /// client associated with this connection. + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// IBC version which can be utilised to determine encodings or protocols for + /// channels or packets utilising this connection. + #[prost(message, repeated, tag = "2")] + pub versions: ::prost::alloc::vec::Vec, + /// current state of the connection end. + #[prost(enumeration = "State", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub state: i32, + /// counterparty chain associated with this connection. + #[prost(message, optional, tag = "4")] + pub counterparty: ::core::option::Option, + /// delay period that must pass before a consensus state can be used for + /// packet-verification NOTE: delay period logic is only implemented by some + /// clients. + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub delay_period: u64, +} +/// IdentifiedConnection defines a connection with additional connection +/// identifier field. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.IdentifiedConnection")] +pub struct IdentifiedConnection { + /// connection identifier. + #[prost(string, tag = "1")] + #[serde(alias = "ID")] + pub id: ::prost::alloc::string::String, + /// client associated with this connection. + #[prost(string, tag = "2")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// IBC version which can be utilised to determine encodings or protocols for + /// channels or packets utilising this connection + #[prost(message, repeated, tag = "3")] + pub versions: ::prost::alloc::vec::Vec, + /// current state of the connection end. + #[prost(enumeration = "State", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub state: i32, + /// counterparty chain associated with this connection. + #[prost(message, optional, tag = "5")] + pub counterparty: ::core::option::Option, + /// delay period associated with this connection. + #[prost(uint64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub delay_period: u64, +} +/// Counterparty defines the counterparty chain associated with a connection end. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.Counterparty")] +pub struct Counterparty { + /// identifies the client on the counterparty chain associated with a given + /// connection. + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// identifies the connection end on the counterparty chain associated with a + /// given connection. + #[prost(string, tag = "2")] + #[serde(alias = "connectionID")] + pub connection_id: ::prost::alloc::string::String, + /// commitment merkle prefix of the counterparty chain. + #[prost(message, optional, tag = "3")] + pub prefix: ::core::option::Option, +} +/// ClientPaths define all the connection paths for a client state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.ClientPaths")] +pub struct ClientPaths { + /// list of connection paths + #[prost(string, repeated, tag = "1")] + pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// ConnectionPaths define all the connection paths for a given client state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.ConnectionPaths")] +pub struct ConnectionPaths { + /// client state unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// list of connection paths + #[prost(string, repeated, tag = "2")] + pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Version defines the versioning scheme used to negotiate the IBC verison in +/// the connection handshake. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.Version")] +pub struct Version { + /// unique version identifier + #[prost(string, tag = "1")] + pub identifier: ::prost::alloc::string::String, + /// list of features compatible with the specified identifier + #[prost(string, repeated, tag = "2")] + pub features: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Params defines the set of Connection parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.Params")] +pub struct Params { + /// maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the + /// largest amount of time that the chain might reasonably take to produce the next block under normal operating + /// conditions. A safe choice is 3-5x the expected time per block. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_expected_time_per_block: u64, +} +/// State defines if a connection is in one of the following states: +/// INIT, TRYOPEN, OPEN or UNINITIALIZED. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum State { + /// Default State + UninitializedUnspecified = 0, + /// A connection end has just started the opening handshake. + Init = 1, + /// A connection end has acknowledged the handshake step on the counterparty + /// chain. + Tryopen = 2, + /// A connection end has completed the handshake. + Open = 3, +} +impl State { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + State::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED", + State::Init => "STATE_INIT", + State::Tryopen => "STATE_TRYOPEN", + State::Open => "STATE_OPEN", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "STATE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), + "STATE_INIT" => Some(Self::Init), + "STATE_TRYOPEN" => Some(Self::Tryopen), + "STATE_OPEN" => Some(Self::Open), + _ => None, + } + } +} +/// GenesisState defines the ibc connection submodule's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.GenesisState")] +pub struct GenesisState { + #[prost(message, repeated, tag = "1")] + pub connections: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub client_connection_paths: ::prost::alloc::vec::Vec, + /// the sequence for the next generated connection identifier + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_connection_sequence: u64, + #[prost(message, optional, tag = "4")] + pub params: ::core::option::Option, +} +/// QueryConnectionRequest is the request type for the Query/Connection RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.QueryConnectionRequest")] +#[proto_query( + path = "/ibc.core.connection.v1.Query/Connection", + response_type = QueryConnectionResponse +)] +pub struct QueryConnectionRequest { + /// connection unique identifier + #[prost(string, tag = "1")] + #[serde(alias = "connectionID")] + pub connection_id: ::prost::alloc::string::String, +} +/// QueryConnectionResponse is the response type for the Query/Connection RPC +/// method. Besides the connection end, it includes a proof and the height from +/// which the proof was retrieved. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.QueryConnectionResponse")] +pub struct QueryConnectionResponse { + /// connection associated with the request identifier + #[prost(message, optional, tag = "1")] + pub connection: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryConnectionsRequest is the request type for the Query/Connections RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.QueryConnectionsRequest")] +#[proto_query( + path = "/ibc.core.connection.v1.Query/Connections", + response_type = QueryConnectionsResponse +)] +pub struct QueryConnectionsRequest { + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryConnectionsResponse is the response type for the Query/Connections RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.QueryConnectionsResponse")] +pub struct QueryConnectionsResponse { + /// list of stored connections of the chain. + #[prost(message, repeated, tag = "1")] + pub connections: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, + /// query block height + #[prost(message, optional, tag = "3")] + pub height: ::core::option::Option, +} +/// QueryClientConnectionsRequest is the request type for the +/// Query/ClientConnections RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.QueryClientConnectionsRequest")] +#[proto_query( + path = "/ibc.core.connection.v1.Query/ClientConnections", + response_type = QueryClientConnectionsResponse +)] +pub struct QueryClientConnectionsRequest { + /// client identifier associated with a connection + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, +} +/// QueryClientConnectionsResponse is the response type for the +/// Query/ClientConnections RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.QueryClientConnectionsResponse")] +pub struct QueryClientConnectionsResponse { + /// slice of all the connection paths associated with a client. + #[prost(string, repeated, tag = "1")] + pub connection_paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was generated + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryConnectionClientStateRequest is the request type for the +/// Query/ConnectionClientState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.QueryConnectionClientStateRequest")] +#[proto_query( + path = "/ibc.core.connection.v1.Query/ConnectionClientState", + response_type = QueryConnectionClientStateResponse +)] +pub struct QueryConnectionClientStateRequest { + /// connection identifier + #[prost(string, tag = "1")] + #[serde(alias = "connectionID")] + pub connection_id: ::prost::alloc::string::String, +} +/// QueryConnectionClientStateResponse is the response type for the +/// Query/ConnectionClientState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.QueryConnectionClientStateResponse")] +pub struct QueryConnectionClientStateResponse { + /// client state associated with the channel + #[prost(message, optional, tag = "1")] + pub identified_client_state: + ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryConnectionConsensusStateRequest is the request type for the +/// Query/ConnectionConsensusState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.QueryConnectionConsensusStateRequest")] +#[proto_query( + path = "/ibc.core.connection.v1.Query/ConnectionConsensusState", + response_type = QueryConnectionConsensusStateResponse +)] +pub struct QueryConnectionConsensusStateRequest { + /// connection identifier + #[prost(string, tag = "1")] + #[serde(alias = "connectionID")] + pub connection_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_number: u64, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_height: u64, +} +/// QueryConnectionConsensusStateResponse is the response type for the +/// Query/ConnectionConsensusState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.QueryConnectionConsensusStateResponse")] +pub struct QueryConnectionConsensusStateResponse { + /// consensus state associated with the channel + #[prost(message, optional, tag = "1")] + pub consensus_state: ::core::option::Option, + /// client ID associated with the consensus state + #[prost(string, tag = "2")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, +} +/// MsgConnectionOpenInit defines the msg sent by an account on Chain A to +/// initialize a connection with Chain B. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.MsgConnectionOpenInit")] +pub struct MsgConnectionOpenInit { + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub counterparty: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub version: ::core::option::Option, + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub delay_period: u64, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, +} +/// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response +/// type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.MsgConnectionOpenInitResponse")] +pub struct MsgConnectionOpenInitResponse {} +/// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a +/// connection on Chain B. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.MsgConnectionOpenTry")] +pub struct MsgConnectionOpenTry { + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + /// Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. + #[deprecated] + #[prost(string, tag = "2")] + #[serde(alias = "previous_connectionID")] + pub previous_connection_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub client_state: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub counterparty: ::core::option::Option, + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub delay_period: u64, + #[prost(message, repeated, tag = "6")] + pub counterparty_versions: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "7")] + pub proof_height: ::core::option::Option, + /// proof of the initialization the connection on Chain A: `UNITIALIZED -> + /// INIT` + #[prost(bytes = "vec", tag = "8")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_init: ::prost::alloc::vec::Vec, + /// proof of client state included in message + #[prost(bytes = "vec", tag = "9")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_client: ::prost::alloc::vec::Vec, + /// proof of client consensus state + #[prost(bytes = "vec", tag = "10")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_consensus: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "11")] + pub consensus_height: ::core::option::Option, + #[prost(string, tag = "12")] + pub signer: ::prost::alloc::string::String, +} +/// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.MsgConnectionOpenTryResponse")] +pub struct MsgConnectionOpenTryResponse {} +/// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to +/// acknowledge the change of connection state to TRYOPEN on Chain B. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.MsgConnectionOpenAck")] +pub struct MsgConnectionOpenAck { + #[prost(string, tag = "1")] + #[serde(alias = "connectionID")] + pub connection_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + #[serde(alias = "counterparty_connectionID")] + pub counterparty_connection_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub version: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub client_state: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub proof_height: ::core::option::Option, + /// proof of the initialization the connection on Chain B: `UNITIALIZED -> + /// TRYOPEN` + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_try: ::prost::alloc::vec::Vec, + /// proof of client state included in message + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_client: ::prost::alloc::vec::Vec, + /// proof of client consensus state + #[prost(bytes = "vec", tag = "8")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_consensus: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "9")] + pub consensus_height: ::core::option::Option, + #[prost(string, tag = "10")] + pub signer: ::prost::alloc::string::String, +} +/// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.MsgConnectionOpenAckResponse")] +pub struct MsgConnectionOpenAckResponse {} +/// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to +/// acknowledge the change of connection state to OPEN on Chain A. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.MsgConnectionOpenConfirm")] +pub struct MsgConnectionOpenConfirm { + #[prost(string, tag = "1")] + #[serde(alias = "connectionID")] + pub connection_id: ::prost::alloc::string::String, + /// proof for the change of the connection state on Chain A: `INIT -> OPEN` + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub proof_ack: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, +} +/// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm +/// response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse")] +pub struct MsgConnectionOpenConfirmResponse {} +pub struct ConnectionQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> ConnectionQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn connection( + &self, + connection_id: ::prost::alloc::string::String, + ) -> Result { + QueryConnectionRequest { connection_id }.query(self.querier) + } + pub fn connections( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryConnectionsRequest { pagination }.query(self.querier) + } + pub fn client_connections( + &self, + client_id: ::prost::alloc::string::String, + ) -> Result { + QueryClientConnectionsRequest { client_id }.query(self.querier) + } + pub fn connection_client_state( + &self, + connection_id: ::prost::alloc::string::String, + ) -> Result { + QueryConnectionClientStateRequest { connection_id }.query(self.querier) + } + pub fn connection_consensus_state( + &self, + connection_id: ::prost::alloc::string::String, + revision_number: u64, + revision_height: u64, + ) -> Result { + QueryConnectionConsensusStateRequest { + connection_id, + revision_number, + revision_height, + } + .query(self.querier) + } +} diff --git a/packages/osmosis-std/src/types/ibc/core/mod.rs b/packages/osmosis-std/src/types/ibc/core/mod.rs new file mode 100644 index 00000000..75c439f0 --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/core/mod.rs @@ -0,0 +1,5 @@ +pub mod channel; +pub mod client; +pub mod commitment; +pub mod connection; +pub mod types; diff --git a/packages/osmosis-std/src/types/ibc/core/types/mod.rs b/packages/osmosis-std/src/types/ibc/core/types/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/core/types/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/osmosis-std/src/types/ibc/core/types/v1.rs b/packages/osmosis-std/src/types/ibc/core/types/v1.rs new file mode 100644 index 00000000..95d35589 --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/core/types/v1.rs @@ -0,0 +1,25 @@ +use osmosis_std_derive::CosmwasmExt; +/// GenesisState defines the ibc module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.types.v1.GenesisState")] +pub struct GenesisState { + /// ICS002 - Clients genesis state + #[prost(message, optional, tag = "1")] + pub client_genesis: ::core::option::Option, + /// ICS003 - Connections genesis state + #[prost(message, optional, tag = "2")] + pub connection_genesis: ::core::option::Option, + /// ICS004 - Channel genesis state + #[prost(message, optional, tag = "3")] + pub channel_genesis: ::core::option::Option, +} diff --git a/packages/osmosis-std/src/types/ibc/lightclients/localhost/mod.rs b/packages/osmosis-std/src/types/ibc/lightclients/localhost/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/lightclients/localhost/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/osmosis-std/src/types/ibc/lightclients/localhost/v1.rs b/packages/osmosis-std/src/types/ibc/lightclients/localhost/v1.rs new file mode 100644 index 00000000..3fff841d --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/lightclients/localhost/v1.rs @@ -0,0 +1,24 @@ +use osmosis_std_derive::CosmwasmExt; +/// ClientState defines a loopback (localhost) client. It requires (read-only) +/// access to keys outside the client prefix. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.localhost.v1.ClientState")] +pub struct ClientState { + /// self chain ID + #[prost(string, tag = "1")] + #[serde(alias = "chainID")] + pub chain_id: ::prost::alloc::string::String, + /// self latest block height + #[prost(message, optional, tag = "2")] + pub height: ::core::option::Option, +} diff --git a/packages/osmosis-std/src/types/ibc/lightclients/mod.rs b/packages/osmosis-std/src/types/ibc/lightclients/mod.rs new file mode 100644 index 00000000..971b50e8 --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/lightclients/mod.rs @@ -0,0 +1,3 @@ +pub mod localhost; +pub mod solomachine; +pub mod tendermint; diff --git a/packages/osmosis-std/src/types/ibc/lightclients/solomachine/mod.rs b/packages/osmosis-std/src/types/ibc/lightclients/solomachine/mod.rs new file mode 100644 index 00000000..ae6adc7c --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/lightclients/solomachine/mod.rs @@ -0,0 +1,2 @@ +pub mod v1; +pub mod v2; diff --git a/packages/osmosis-std/src/types/ibc/lightclients/solomachine/v1.rs b/packages/osmosis-std/src/types/ibc/lightclients/solomachine/v1.rs new file mode 100644 index 00000000..7c849fc4 --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/lightclients/solomachine/v1.rs @@ -0,0 +1,532 @@ +use osmosis_std_derive::CosmwasmExt; +/// ClientState defines a solo machine client that tracks the current consensus +/// state and if the client is frozen. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.ClientState")] +pub struct ClientState { + /// latest sequence of the client state + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + /// frozen sequence of the solo machine + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub frozen_sequence: u64, + #[prost(message, optional, tag = "3")] + pub consensus_state: ::core::option::Option, + /// when set to true, will allow governance to update a solo machine client. + /// The client will be unfrozen if it is frozen. + #[prost(bool, tag = "4")] + pub allow_update_after_proposal: bool, +} +/// ConsensusState defines a solo machine consensus state. The sequence of a +/// consensus state is contained in the "height" key used in storing the +/// consensus state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.ConsensusState")] +pub struct ConsensusState { + /// public key of the solo machine + #[prost(message, optional, tag = "1")] + pub public_key: ::core::option::Option, + /// diversifier allows the same public key to be re-used across different solo + /// machine clients (potentially on different chains) without being considered + /// misbehaviour. + #[prost(string, tag = "2")] + pub diversifier: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// Header defines a solo machine consensus header +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.Header")] +pub struct Header { + /// sequence to update solo machine public key at + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub new_public_key: ::core::option::Option, + #[prost(string, tag = "5")] + pub new_diversifier: ::prost::alloc::string::String, +} +/// Misbehaviour defines misbehaviour for a solo machine which consists +/// of a sequence and two signatures over different messages at that sequence. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.Misbehaviour")] +pub struct Misbehaviour { + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + #[prost(message, optional, tag = "3")] + pub signature_one: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub signature_two: ::core::option::Option, +} +/// SignatureAndData contains a signature and the data signed over to create that +/// signature. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.SignatureAndData")] +pub struct SignatureAndData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, + #[prost(enumeration = "DataType", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub data_type: i32, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// TimestampedSignatureData contains the signature data and the timestamp of the +/// signature. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.TimestampedSignatureData")] +pub struct TimestampedSignatureData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub signature_data: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// SignBytes defines the signed bytes used for signature verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.SignBytes")] +pub struct SignBytes { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, + #[prost(string, tag = "3")] + pub diversifier: ::prost::alloc::string::String, + /// type of the data used + #[prost(enumeration = "DataType", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub data_type: i32, + /// marshaled data + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// HeaderData returns the SignBytes data for update verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.HeaderData")] +pub struct HeaderData { + /// header public key + #[prost(message, optional, tag = "1")] + pub new_pub_key: ::core::option::Option, + /// header diversifier + #[prost(string, tag = "2")] + pub new_diversifier: ::prost::alloc::string::String, +} +/// ClientStateData returns the SignBytes data for client state verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.ClientStateData")] +pub struct ClientStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub client_state: ::core::option::Option, +} +/// ConsensusStateData returns the SignBytes data for consensus state +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.ConsensusStateData")] +pub struct ConsensusStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub consensus_state: ::core::option::Option, +} +/// ConnectionStateData returns the SignBytes data for connection state +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.ConnectionStateData")] +pub struct ConnectionStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub connection: + ::core::option::Option, +} +/// ChannelStateData returns the SignBytes data for channel state +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.ChannelStateData")] +pub struct ChannelStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub channel: ::core::option::Option, +} +/// PacketCommitmentData returns the SignBytes data for packet commitment +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.PacketCommitmentData")] +pub struct PacketCommitmentData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub commitment: ::prost::alloc::vec::Vec, +} +/// PacketAcknowledgementData returns the SignBytes data for acknowledgement +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.PacketAcknowledgementData")] +pub struct PacketAcknowledgementData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub acknowledgement: ::prost::alloc::vec::Vec, +} +/// PacketReceiptAbsenceData returns the SignBytes data for +/// packet receipt absence verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData")] +pub struct PacketReceiptAbsenceData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, +} +/// NextSequenceRecvData returns the SignBytes data for verification of the next +/// sequence to be received. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v1.NextSequenceRecvData")] +pub struct NextSequenceRecvData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_seq_recv: u64, +} +/// DataType defines the type of solo machine proof being created. This is done +/// to preserve uniqueness of different data sign byte encodings. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum DataType { + /// Default State + UninitializedUnspecified = 0, + /// Data type for client state verification + ClientState = 1, + /// Data type for consensus state verification + ConsensusState = 2, + /// Data type for connection state verification + ConnectionState = 3, + /// Data type for channel state verification + ChannelState = 4, + /// Data type for packet commitment verification + PacketCommitment = 5, + /// Data type for packet acknowledgement verification + PacketAcknowledgement = 6, + /// Data type for packet receipt absence verification + PacketReceiptAbsence = 7, + /// Data type for next sequence recv verification + NextSequenceRecv = 8, + /// Data type for header verification + Header = 9, +} +impl DataType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + DataType::UninitializedUnspecified => "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", + DataType::ClientState => "DATA_TYPE_CLIENT_STATE", + DataType::ConsensusState => "DATA_TYPE_CONSENSUS_STATE", + DataType::ConnectionState => "DATA_TYPE_CONNECTION_STATE", + DataType::ChannelState => "DATA_TYPE_CHANNEL_STATE", + DataType::PacketCommitment => "DATA_TYPE_PACKET_COMMITMENT", + DataType::PacketAcknowledgement => "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", + DataType::PacketReceiptAbsence => "DATA_TYPE_PACKET_RECEIPT_ABSENCE", + DataType::NextSequenceRecv => "DATA_TYPE_NEXT_SEQUENCE_RECV", + DataType::Header => "DATA_TYPE_HEADER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), + "DATA_TYPE_CLIENT_STATE" => Some(Self::ClientState), + "DATA_TYPE_CONSENSUS_STATE" => Some(Self::ConsensusState), + "DATA_TYPE_CONNECTION_STATE" => Some(Self::ConnectionState), + "DATA_TYPE_CHANNEL_STATE" => Some(Self::ChannelState), + "DATA_TYPE_PACKET_COMMITMENT" => Some(Self::PacketCommitment), + "DATA_TYPE_PACKET_ACKNOWLEDGEMENT" => Some(Self::PacketAcknowledgement), + "DATA_TYPE_PACKET_RECEIPT_ABSENCE" => Some(Self::PacketReceiptAbsence), + "DATA_TYPE_NEXT_SEQUENCE_RECV" => Some(Self::NextSequenceRecv), + "DATA_TYPE_HEADER" => Some(Self::Header), + _ => None, + } + } +} diff --git a/packages/osmosis-std/src/types/ibc/lightclients/solomachine/v2.rs b/packages/osmosis-std/src/types/ibc/lightclients/solomachine/v2.rs new file mode 100644 index 00000000..cfc908c9 --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/lightclients/solomachine/v2.rs @@ -0,0 +1,528 @@ +use osmosis_std_derive::CosmwasmExt; +/// ClientState defines a solo machine client that tracks the current consensus +/// state and if the client is frozen. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.ClientState")] +pub struct ClientState { + /// latest sequence of the client state + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + /// frozen sequence of the solo machine + #[prost(bool, tag = "2")] + pub is_frozen: bool, + #[prost(message, optional, tag = "3")] + pub consensus_state: ::core::option::Option, + /// when set to true, will allow governance to update a solo machine client. + /// The client will be unfrozen if it is frozen. + #[prost(bool, tag = "4")] + pub allow_update_after_proposal: bool, +} +/// ConsensusState defines a solo machine consensus state. The sequence of a +/// consensus state is contained in the "height" key used in storing the +/// consensus state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.ConsensusState")] +pub struct ConsensusState { + /// public key of the solo machine + #[prost(message, optional, tag = "1")] + pub public_key: ::core::option::Option, + /// diversifier allows the same public key to be re-used across different solo + /// machine clients (potentially on different chains) without being considered + /// misbehaviour. + #[prost(string, tag = "2")] + pub diversifier: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// Header defines a solo machine consensus header +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.Header")] +pub struct Header { + /// sequence to update solo machine public key at + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub new_public_key: ::core::option::Option, + #[prost(string, tag = "5")] + pub new_diversifier: ::prost::alloc::string::String, +} +/// Misbehaviour defines misbehaviour for a solo machine which consists +/// of a sequence and two signatures over different messages at that sequence. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.Misbehaviour")] +pub struct Misbehaviour { + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + #[prost(message, optional, tag = "3")] + pub signature_one: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub signature_two: ::core::option::Option, +} +/// SignatureAndData contains a signature and the data signed over to create that +/// signature. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.SignatureAndData")] +pub struct SignatureAndData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, + #[prost(enumeration = "DataType", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub data_type: i32, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// TimestampedSignatureData contains the signature data and the timestamp of the +/// signature. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.TimestampedSignatureData")] +pub struct TimestampedSignatureData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub signature_data: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// SignBytes defines the signed bytes used for signature verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.SignBytes")] +pub struct SignBytes { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, + #[prost(string, tag = "3")] + pub diversifier: ::prost::alloc::string::String, + /// type of the data used + #[prost(enumeration = "DataType", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub data_type: i32, + /// marshaled data + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// HeaderData returns the SignBytes data for update verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.HeaderData")] +pub struct HeaderData { + /// header public key + #[prost(message, optional, tag = "1")] + pub new_pub_key: ::core::option::Option, + /// header diversifier + #[prost(string, tag = "2")] + pub new_diversifier: ::prost::alloc::string::String, +} +/// ClientStateData returns the SignBytes data for client state verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.ClientStateData")] +pub struct ClientStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub client_state: ::core::option::Option, +} +/// ConsensusStateData returns the SignBytes data for consensus state +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.ConsensusStateData")] +pub struct ConsensusStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub consensus_state: ::core::option::Option, +} +/// ConnectionStateData returns the SignBytes data for connection state +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.ConnectionStateData")] +pub struct ConnectionStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub connection: + ::core::option::Option, +} +/// ChannelStateData returns the SignBytes data for channel state +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.ChannelStateData")] +pub struct ChannelStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub channel: ::core::option::Option, +} +/// PacketCommitmentData returns the SignBytes data for packet commitment +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.PacketCommitmentData")] +pub struct PacketCommitmentData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub commitment: ::prost::alloc::vec::Vec, +} +/// PacketAcknowledgementData returns the SignBytes data for acknowledgement +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.PacketAcknowledgementData")] +pub struct PacketAcknowledgementData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub acknowledgement: ::prost::alloc::vec::Vec, +} +/// PacketReceiptAbsenceData returns the SignBytes data for +/// packet receipt absence verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData")] +pub struct PacketReceiptAbsenceData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, +} +/// NextSequenceRecvData returns the SignBytes data for verification of the next +/// sequence to be received. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.NextSequenceRecvData")] +pub struct NextSequenceRecvData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_seq_recv: u64, +} +/// DataType defines the type of solo machine proof being created. This is done +/// to preserve uniqueness of different data sign byte encodings. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum DataType { + /// Default State + UninitializedUnspecified = 0, + /// Data type for client state verification + ClientState = 1, + /// Data type for consensus state verification + ConsensusState = 2, + /// Data type for connection state verification + ConnectionState = 3, + /// Data type for channel state verification + ChannelState = 4, + /// Data type for packet commitment verification + PacketCommitment = 5, + /// Data type for packet acknowledgement verification + PacketAcknowledgement = 6, + /// Data type for packet receipt absence verification + PacketReceiptAbsence = 7, + /// Data type for next sequence recv verification + NextSequenceRecv = 8, + /// Data type for header verification + Header = 9, +} +impl DataType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + DataType::UninitializedUnspecified => "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", + DataType::ClientState => "DATA_TYPE_CLIENT_STATE", + DataType::ConsensusState => "DATA_TYPE_CONSENSUS_STATE", + DataType::ConnectionState => "DATA_TYPE_CONNECTION_STATE", + DataType::ChannelState => "DATA_TYPE_CHANNEL_STATE", + DataType::PacketCommitment => "DATA_TYPE_PACKET_COMMITMENT", + DataType::PacketAcknowledgement => "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", + DataType::PacketReceiptAbsence => "DATA_TYPE_PACKET_RECEIPT_ABSENCE", + DataType::NextSequenceRecv => "DATA_TYPE_NEXT_SEQUENCE_RECV", + DataType::Header => "DATA_TYPE_HEADER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), + "DATA_TYPE_CLIENT_STATE" => Some(Self::ClientState), + "DATA_TYPE_CONSENSUS_STATE" => Some(Self::ConsensusState), + "DATA_TYPE_CONNECTION_STATE" => Some(Self::ConnectionState), + "DATA_TYPE_CHANNEL_STATE" => Some(Self::ChannelState), + "DATA_TYPE_PACKET_COMMITMENT" => Some(Self::PacketCommitment), + "DATA_TYPE_PACKET_ACKNOWLEDGEMENT" => Some(Self::PacketAcknowledgement), + "DATA_TYPE_PACKET_RECEIPT_ABSENCE" => Some(Self::PacketReceiptAbsence), + "DATA_TYPE_NEXT_SEQUENCE_RECV" => Some(Self::NextSequenceRecv), + "DATA_TYPE_HEADER" => Some(Self::Header), + _ => None, + } + } +} diff --git a/packages/osmosis-std/src/types/ibc/lightclients/tendermint/mod.rs b/packages/osmosis-std/src/types/ibc/lightclients/tendermint/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/lightclients/tendermint/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/osmosis-std/src/types/ibc/lightclients/tendermint/v1.rs b/packages/osmosis-std/src/types/ibc/lightclients/tendermint/v1.rs new file mode 100644 index 00000000..1ad3a14e --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/lightclients/tendermint/v1.rs @@ -0,0 +1,174 @@ +use osmosis_std_derive::CosmwasmExt; +/// ClientState from Tendermint tracks the current validator set, latest height, +/// and a possible frozen height. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.tendermint.v1.ClientState")] +pub struct ClientState { + #[prost(string, tag = "1")] + #[serde(alias = "chainID")] + pub chain_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub trust_level: ::core::option::Option, + /// duration of the period since the LastestTimestamp during which the + /// submitted headers are valid for upgrade + #[prost(message, optional, tag = "3")] + pub trusting_period: ::core::option::Option, + /// duration of the staking unbonding period + #[prost(message, optional, tag = "4")] + pub unbonding_period: ::core::option::Option, + /// defines how much new (untrusted) header's Time can drift into the future. + #[prost(message, optional, tag = "5")] + pub max_clock_drift: ::core::option::Option, + /// Block height when the client was frozen due to a misbehaviour + #[prost(message, optional, tag = "6")] + pub frozen_height: ::core::option::Option, + /// Latest height the client was updated to + #[prost(message, optional, tag = "7")] + pub latest_height: ::core::option::Option, + /// Proof specifications used in verifying counterparty state + #[prost(message, repeated, tag = "8")] + pub proof_specs: ::prost::alloc::vec::Vec, + /// Path at which next upgraded client will be committed. + /// Each element corresponds to the key for a single CommitmentProof in the + /// chained proof. NOTE: ClientState must stored under + /// `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored + /// under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using + /// the default upgrade module, upgrade_path should be []string{"upgrade", + /// "upgradedIBCState"}` + #[prost(string, repeated, tag = "9")] + pub upgrade_path: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// allow_update_after_expiry is deprecated + #[deprecated] + #[prost(bool, tag = "10")] + pub allow_update_after_expiry: bool, + /// allow_update_after_misbehaviour is deprecated + #[deprecated] + #[prost(bool, tag = "11")] + pub allow_update_after_misbehaviour: bool, +} +/// ConsensusState defines the consensus state from Tendermint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.tendermint.v1.ConsensusState")] +pub struct ConsensusState { + /// timestamp that corresponds to the block height in which the ConsensusState + /// was stored. + #[prost(message, optional, tag = "1")] + pub timestamp: ::core::option::Option, + /// commitment root (i.e app hash) + #[prost(message, optional, tag = "2")] + pub root: ::core::option::Option, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub next_validators_hash: ::prost::alloc::vec::Vec, +} +/// Misbehaviour is a wrapper over two conflicting Headers +/// that implements Misbehaviour interface expected by ICS-02 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.tendermint.v1.Misbehaviour")] +pub struct Misbehaviour { + #[prost(string, tag = "1")] + #[serde(alias = "clientID")] + pub client_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub header_1: ::core::option::Option
, + #[prost(message, optional, tag = "3")] + pub header_2: ::core::option::Option
, +} +/// Header defines the Tendermint client consensus Header. +/// It encapsulates all the information necessary to update from a trusted +/// Tendermint ConsensusState. The inclusion of TrustedHeight and +/// TrustedValidators allows this update to process correctly, so long as the +/// ConsensusState for the TrustedHeight exists, this removes race conditions +/// among relayers The SignedHeader and ValidatorSet are the new untrusted update +/// fields for the client. The TrustedHeight is the height of a stored +/// ConsensusState on the client that will be used to verify the new untrusted +/// header. The Trusted ConsensusState must be within the unbonding period of +/// current time in order to correctly verify, and the TrustedValidators must +/// hash to TrustedConsensusState.NextValidatorsHash since that is the last +/// trusted validator set at the TrustedHeight. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.tendermint.v1.Header")] +pub struct Header { + #[prost(message, optional, tag = "1")] + pub signed_header: + ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub validator_set: + ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub trusted_height: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub trusted_validators: + ::core::option::Option, +} +/// Fraction defines the protobuf message type for tmmath.Fraction that only +/// supports positive values. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.tendermint.v1.Fraction")] +pub struct Fraction { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub numerator: u64, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub denominator: u64, +} diff --git a/packages/osmosis-std/src/types/ibc/mod.rs b/packages/osmosis-std/src/types/ibc/mod.rs new file mode 100644 index 00000000..c37ae57d --- /dev/null +++ b/packages/osmosis-std/src/types/ibc/mod.rs @@ -0,0 +1,3 @@ +pub mod applications; +pub mod core; +pub mod lightclients; diff --git a/packages/osmosis-std/src/types/mod.rs b/packages/osmosis-std/src/types/mod.rs index fcc9c75d..62b95c0b 100644 --- a/packages/osmosis-std/src/types/mod.rs +++ b/packages/osmosis-std/src/types/mod.rs @@ -1,5 +1,6 @@ pub mod cosmos; pub mod cosmwasm; +pub mod ibc; pub mod ics23; pub mod osmosis; pub mod tendermint; diff --git a/packages/proto-build/src/main.rs b/packages/proto-build/src/main.rs index 91351566..2fcf04a3 100644 --- a/packages/proto-build/src/main.rs +++ b/packages/proto-build/src/main.rs @@ -22,6 +22,9 @@ const WASMD_REV: &str = "v0.31.0-osmo-v16"; /// The cometbft commit or tag to be cloned and used to build the proto files const COMETBFT_REV: &str = "v0.34.29"; +/// The ibc-go commit or tag to be cloned and used to build the proto files +const IBC_GO_REV: &str = "v4.5.0"; + // All paths must end with a / and either be absolute or include a ./ to reference the current // working directory. @@ -35,6 +38,8 @@ const OSMOSIS_DIR: &str = "../../dependencies/osmosis/"; const WASMD_DIR: &str = "../../dependencies/wasmd/"; /// Directory where the cometbft submodule is located const COMETBFT_DIR: &str = "../../dependencies/cometbft/"; +/// Directory where the ibc-go submodule is located +const IBC_GO_DIR: &str = "../../dependencies/ibc-go/"; /// A temporary directory for proto building const TMP_BUILD_DIR: &str = "/tmp/tmp-protobuf/"; @@ -45,6 +50,8 @@ pub fn generate() { git::update_submodule(COSMOS_SDK_DIR, COSMOS_SDK_REV); git::update_submodule(OSMOSIS_DIR, OSMOSIS_REV); git::update_submodule(WASMD_DIR, WASMD_REV); + git::update_submodule(COMETBFT_DIR, COMETBFT_REV); + git::update_submodule(IBC_GO_DIR, IBC_GO_REV); } let tmp_build_dir: PathBuf = TMP_BUILD_DIR.parse().unwrap(); @@ -69,6 +76,13 @@ pub fn generate() { include_mods: vec!["types".to_string()], }; + let ibc_project = CosmosProject { + name: "ibc".to_string(), + version: IBC_GO_REV.to_string(), + project_dir: IBC_GO_DIR.to_string(), + include_mods: vec![], + }; + let cosmos_project = CosmosProject { name: "cosmos".to_string(), version: COSMOS_SDK_REV.to_string(), @@ -80,7 +94,7 @@ pub fn generate() { out_dir, tmp_build_dir, osmosis_project, - vec![cometbft_project, cosmos_project, wasmd_project], + vec![ibc_project, cometbft_project, cosmos_project, wasmd_project], ); osmosis_code_generator.generate();